@kumwe/studio-protocol 0.1.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +77 -0
  3. package/THIRD_PARTY_NOTICES.md +9 -0
  4. package/dist/generated/schema-models.d.ts +1968 -0
  5. package/dist/generated/schema-models.d.ts.map +1 -0
  6. package/dist/generated/schema-models.js +76 -0
  7. package/dist/generated/schema-models.js.map +1 -0
  8. package/dist/guards.d.ts +7 -0
  9. package/dist/guards.d.ts.map +1 -0
  10. package/dist/guards.js +374 -0
  11. package/dist/guards.js.map +1 -0
  12. package/dist/host-failure.d.ts +16 -0
  13. package/dist/host-failure.d.ts.map +1 -0
  14. package/dist/host-failure.js +27 -0
  15. package/dist/host-failure.js.map +1 -0
  16. package/dist/index.d.ts +7 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +6 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/schemas.d.ts +50 -0
  21. package/dist/schemas.d.ts.map +1 -0
  22. package/dist/schemas.js +144 -0
  23. package/dist/schemas.js.map +1 -0
  24. package/dist/types.d.ts +1256 -0
  25. package/dist/types.d.ts.map +1 -0
  26. package/dist/types.js +8 -0
  27. package/dist/types.js.map +1 -0
  28. package/package.json +42 -0
  29. package/schemas/authoring-message-catalog.schema.json +45 -0
  30. package/schemas/authoring-web-vector.schema.json +236 -0
  31. package/schemas/binding-projection-vector.schema.json +127 -0
  32. package/schemas/block-definition.schema.json +227 -0
  33. package/schemas/blueprint.schema.json +273 -0
  34. package/schemas/canonical-vector.schema.json +65 -0
  35. package/schemas/command-vector.schema.json +68 -0
  36. package/schemas/command.schema.json +410 -0
  37. package/schemas/common.schema.json +222 -0
  38. package/schemas/content-model.schema.json +216 -0
  39. package/schemas/corpus-manifest.schema.json +48 -0
  40. package/schemas/design-vocabulary.schema.json +91 -0
  41. package/schemas/entry.schema.json +32 -0
  42. package/schemas/field-adapter.schema.json +51 -0
  43. package/schemas/host-capabilities.schema.json +65 -0
  44. package/schemas/host-error.schema.json +42 -0
  45. package/schemas/host-operations.schema.json +162 -0
  46. package/schemas/host-request.schema.json +71 -0
  47. package/schemas/host-result.schema.json +19 -0
  48. package/schemas/host-sequence-vector.schema.json +342 -0
  49. package/schemas/host-vector.schema.json +199 -0
  50. package/schemas/inspector.schema.json +44 -0
  51. package/schemas/manifest.json +246 -0
  52. package/schemas/media-asset.schema.json +83 -0
  53. package/schemas/media-reference.schema.json +112 -0
  54. package/schemas/media-upload-grant.schema.json +48 -0
  55. package/schemas/media-upload-session.schema.json +109 -0
  56. package/schemas/media-vector.schema.json +123 -0
  57. package/schemas/migration.schema.json +41 -0
  58. package/schemas/pattern.schema.json +50 -0
  59. package/schemas/plugin-manifest.schema.json +126 -0
  60. package/schemas/preview-message.schema.json +583 -0
  61. package/schemas/preview-vector.schema.json +52 -0
  62. package/schemas/provenance.schema.json +57 -0
  63. package/schemas/renderer-web-vector.schema.json +160 -0
  64. package/schemas/rich-text-projection.schema.json +79 -0
  65. package/schemas/rich-text.schema.json +323 -0
  66. package/schemas/schema-profile-vector.schema.json +133 -0
  67. package/schemas/schema-profile.schema.json +201 -0
  68. package/schemas/studio-chart.schema.json +35 -0
  69. package/schemas/studio-config.schema.json +244 -0
  70. package/schemas/studio-drawing.schema.json +44 -0
  71. package/schemas/studio-money.schema.json +16 -0
  72. package/schemas/studio-presentation.schema.json +31 -0
  73. package/schemas/studio-release.schema.json +81 -0
  74. package/schemas/studio-table.schema.json +27 -0
  75. package/schemas/theme.schema.json +164 -0
  76. package/schemas/unresolved-contribution.schema.json +50 -0
  77. package/studio-release.json +18 -0
@@ -0,0 +1,1256 @@
1
+ export declare const STUDIO_CONTRACT_VERSION: "0.1-draft";
2
+ export type StudioContractVersion = typeof STUDIO_CONTRACT_VERSION;
3
+ export declare const STUDIO_WIRE_PROTOCOL_VERSION: "0.1.0-draft.2";
4
+ export type StudioWireProtocolVersion = typeof STUDIO_WIRE_PROTOCOL_VERSION;
5
+ /**
6
+ * Stable diagnostic carried with the canonical `invalid-request` category
7
+ * when a host refuses an operation from an obsolete session generation.
8
+ */
9
+ export declare const STUDIO_STALE_SESSION_GENERATION_DIAGNOSTIC_CODE: "studio.host/stale-session-generation";
10
+ export type JsonPrimitive = boolean | null | number | string;
11
+ export type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
12
+ export interface JsonObject {
13
+ [key: string]: JsonValue;
14
+ }
15
+ export interface JsonSchema extends JsonObject {
16
+ $id?: string;
17
+ $schema?: string;
18
+ }
19
+ export type StableId = string;
20
+ export type Revision = string;
21
+ export type SemanticVersion = string;
22
+ export type QualifiedName = `${string}/${string}`;
23
+ export type LocalName = string;
24
+ export type PackageRelativePath = string;
25
+ export type NodeId = StableId;
26
+ export type BlockType = QualifiedName;
27
+ export interface MessageReference {
28
+ defaultMessage?: string;
29
+ key: QualifiedName;
30
+ }
31
+ export interface OwnerReference {
32
+ id: QualifiedName;
33
+ version: SemanticVersion;
34
+ }
35
+ export interface ArtifactReference {
36
+ id: StableId;
37
+ integrity?: string;
38
+ revision?: Revision;
39
+ version: SemanticVersion;
40
+ }
41
+ export interface LockedArtifactReference extends ArtifactReference {
42
+ revision: Revision;
43
+ }
44
+ export interface ResolvedEntryReference {
45
+ id: StableId;
46
+ integrity?: string;
47
+ revision: Revision;
48
+ }
49
+ export interface DiagnosticLocation {
50
+ artifactId?: StableId;
51
+ fieldPath?: LocalName[];
52
+ jsonPointer?: string;
53
+ nodeId?: NodeId;
54
+ }
55
+ export interface StudioDiagnostic {
56
+ code: QualifiedName;
57
+ location?: DiagnosticLocation;
58
+ message: MessageReference;
59
+ parameters?: Record<string, JsonPrimitive>;
60
+ remediations?: QualifiedName[];
61
+ severity: 'blocking' | 'error' | 'information' | 'warning';
62
+ }
63
+ export interface EntryFieldBindingSource {
64
+ fieldPath: LocalName[];
65
+ kind: 'entry-field';
66
+ }
67
+ export interface ContextValueBindingSource {
68
+ key: QualifiedName;
69
+ kind: 'context-value';
70
+ }
71
+ export interface StaticValueBindingSource {
72
+ kind: 'static-value';
73
+ value: JsonValue;
74
+ }
75
+ export interface ResourceReferenceBindingSource {
76
+ id: StableId;
77
+ kind: 'resource-reference';
78
+ resourceType: QualifiedName;
79
+ }
80
+ export interface QueryReferenceBindingSource {
81
+ kind: 'query-reference';
82
+ parameters: JsonObject;
83
+ query: QualifiedName;
84
+ version: SemanticVersion;
85
+ }
86
+ export type BindingSource = ContextValueBindingSource | EntryFieldBindingSource | QueryReferenceBindingSource | ResourceReferenceBindingSource | StaticValueBindingSource;
87
+ export interface BindingTransform {
88
+ arguments: JsonObject;
89
+ operator: QualifiedName;
90
+ version: SemanticVersion;
91
+ }
92
+ export interface FieldBinding {
93
+ fallback?: JsonValue;
94
+ onError: 'error' | 'fallback' | 'hide';
95
+ onNull: 'empty' | 'error' | 'fallback' | 'hide';
96
+ source: BindingSource;
97
+ transforms: BindingTransform[];
98
+ }
99
+ /**
100
+ * The per-slot composition marker: declares one named slot of a node as a
101
+ * hybrid-composable region on its own, without making the whole node
102
+ * structural. The marker only ever grants composability — it never revokes
103
+ * what the node-level policy already permits — and its `allowedBlocks`, when
104
+ * declared, bounds that slot ahead of the node-level list.
105
+ */
106
+ export interface SlotCompositionPolicy {
107
+ allowedBlocks?: BlockType[];
108
+ composable: true;
109
+ }
110
+ export interface NodeAuthoringPolicy {
111
+ allowedBlocks?: BlockType[];
112
+ mode: 'content' | 'designer' | 'locked' | 'structural' | 'variant';
113
+ requiredPermission?: QualifiedName;
114
+ slots?: Record<LocalName, SlotCompositionPolicy>;
115
+ }
116
+ /** Layout axes addressable by size-role commands; the schema admits no other member names. */
117
+ export type SizeRoleAxis = 'block' | 'inline';
118
+ export interface BlueprintNode {
119
+ authoring: NodeAuthoringPolicy;
120
+ bindings: Record<LocalName, FieldBinding>;
121
+ extensions?: Record<QualifiedName, JsonValue>;
122
+ id: NodeId;
123
+ properties: JsonObject;
124
+ responsive?: Record<LocalName, Record<LocalName, JsonValue>>;
125
+ /** Responsive size-role overrides per axis and viewport role, mirroring `responsive`. */
126
+ responsiveSizeRoles?: Record<LocalName, Record<LocalName, LocalName>>;
127
+ /** Base named size role per layout axis (`inline` or `block`). */
128
+ sizeRoles?: Record<LocalName, LocalName>;
129
+ slots: Record<LocalName, BlueprintNode[]>;
130
+ type: BlockType;
131
+ version: SemanticVersion;
132
+ }
133
+ export interface BlueprintBlockLock {
134
+ integrity?: string;
135
+ revision: Revision;
136
+ type: BlockType;
137
+ version: SemanticVersion;
138
+ }
139
+ export interface BlueprintDependencyLock {
140
+ blocks: BlueprintBlockLock[];
141
+ plugins?: LockedArtifactReference[];
142
+ theme: LockedArtifactReference;
143
+ }
144
+ export interface BlueprintDocument {
145
+ contractVersion: StudioContractVersion;
146
+ dependencyLock: BlueprintDependencyLock;
147
+ description?: MessageReference;
148
+ extensions?: Record<QualifiedName, JsonValue>;
149
+ id: StableId;
150
+ kind: 'blueprint';
151
+ label: MessageReference;
152
+ model: LockedArtifactReference;
153
+ owner: OwnerReference;
154
+ revision: Revision;
155
+ roots: BlueprintNode[];
156
+ status: 'draft' | 'published' | 'retired';
157
+ version: SemanticVersion;
158
+ }
159
+ export interface BlockSlotAcceptance {
160
+ types: BlockType[];
161
+ }
162
+ export interface BlockSlotDefinition {
163
+ accepts: BlockSlotAcceptance;
164
+ id: LocalName;
165
+ label: MessageReference;
166
+ maximum: number;
167
+ minimum: number;
168
+ ordered: boolean;
169
+ }
170
+ export interface BlockPortDefinition {
171
+ /**
172
+ * Portable authoring hints. They select a Studio control/profile without
173
+ * exposing an editor implementation. A read-only port may still be bound by
174
+ * the host, but Studio never offers a value mutation for it.
175
+ */
176
+ authoring?: BlockPortAuthoringMetadata;
177
+ id: LocalName;
178
+ label: MessageReference;
179
+ multiple: boolean;
180
+ required: boolean;
181
+ valueType: string;
182
+ }
183
+ export interface BlockPortAuthoringMetadata {
184
+ control?: QualifiedName;
185
+ profile?: QualifiedName;
186
+ readOnly?: boolean;
187
+ }
188
+ export interface RendererRequirement {
189
+ capability: QualifiedName;
190
+ surface: 'document' | 'email' | 'native' | 'preview' | 'web';
191
+ versions: string;
192
+ }
193
+ export interface BlockAccessibilityContract {
194
+ accessibleName: 'derived' | 'not-applicable' | 'required-binding' | 'required-property';
195
+ category: 'composite' | 'data-display' | 'decorative' | 'interactive' | 'landmark' | 'media' | 'structural' | 'text';
196
+ keyboard: MessageReference;
197
+ outputChecks: QualifiedName[];
198
+ reducedMotion: 'disable-motion' | 'not-applicable' | 'required';
199
+ }
200
+ export type BlockIcon = {
201
+ kind: 'asset';
202
+ integrity: string;
203
+ path: PackageRelativePath;
204
+ } | {
205
+ kind: 'symbol';
206
+ value: LocalName | QualifiedName;
207
+ };
208
+ export interface BlockPropertyControl {
209
+ control: QualifiedName;
210
+ help?: MessageReference;
211
+ label?: MessageReference;
212
+ property: LocalName;
213
+ }
214
+ export interface BlockFallback {
215
+ lossless: true;
216
+ type: BlockType;
217
+ versions: string;
218
+ }
219
+ export interface BlockDefinition {
220
+ accessibility: BlockAccessibilityContract;
221
+ category: QualifiedName;
222
+ contractVersion: StudioContractVersion;
223
+ description?: MessageReference;
224
+ extensions?: Record<QualifiedName, JsonValue>;
225
+ fallback?: BlockFallback;
226
+ icon?: BlockIcon;
227
+ kind: 'block-definition';
228
+ label: MessageReference;
229
+ editingModes: ('blueprint' | 'content')[];
230
+ owner: OwnerReference;
231
+ ports: BlockPortDefinition[];
232
+ propertyControls?: BlockPropertyControl[];
233
+ propertySchema: JsonSchema;
234
+ rendererRequirements: RendererRequirement[];
235
+ revision: Revision;
236
+ slots: BlockSlotDefinition[];
237
+ themeControls: LocalName[];
238
+ type: BlockType;
239
+ version: SemanticVersion;
240
+ }
241
+ /** Canonical, renderer-neutral chart data. It carries no Chart.js configuration. */
242
+ export interface StudioChartDataset {
243
+ label: string;
244
+ values: number[];
245
+ }
246
+ export interface StudioChartSpec {
247
+ datasets: StudioChartDataset[];
248
+ labels: string[];
249
+ title?: string;
250
+ type: 'bar' | 'doughnut' | 'line' | 'pie';
251
+ }
252
+ export interface StudioDrawingPoint {
253
+ x: number;
254
+ y: number;
255
+ }
256
+ export interface StudioDrawingStroke {
257
+ color: string;
258
+ points: StudioDrawingPoint[];
259
+ width: number;
260
+ }
261
+ /** Bounded vector drawing data; never an SVG or canvas command stream. */
262
+ export interface StudioDrawingDocument {
263
+ alt: string;
264
+ height: number;
265
+ strokes: StudioDrawingStroke[];
266
+ width: number;
267
+ }
268
+ /** Decimal money uses a string so persistence never rounds through a binary float. */
269
+ export interface StudioMoneyValue {
270
+ amount: string;
271
+ currency: string;
272
+ }
273
+ /** Portable visual intent resolved by Studio renderers; it contains no CSS values or selectors. */
274
+ export interface StudioPresentationIntent {
275
+ align?: 'center' | 'end' | 'start' | 'stretch';
276
+ animation?: 'fade' | 'none' | 'parallax' | 'scale' | 'slide';
277
+ height?: 'auto' | 'content' | 'full' | 'viewport';
278
+ inverse?: boolean;
279
+ margin?: 'comfortable' | 'compact' | 'none' | 'spacious';
280
+ marker?: 'check' | 'decimal' | 'disc' | 'none';
281
+ padding?: 'comfortable' | 'compact' | 'none' | 'spacious';
282
+ position?: 'flow' | 'relative' | 'sticky';
283
+ print?: 'hide' | 'only' | 'show';
284
+ scrolling?: 'auto' | 'clip' | 'snap' | 'visible';
285
+ visibility?: {
286
+ compact?: 'hidden' | 'visible';
287
+ expanded?: 'hidden' | 'visible';
288
+ medium?: 'hidden' | 'visible';
289
+ };
290
+ width?: 'auto' | 'content' | 'full';
291
+ }
292
+ /** Canonical bounded table data used by static authoring and host query projections. */
293
+ export interface StudioTableDocument {
294
+ caption?: string;
295
+ columns: string[];
296
+ rows: string[][];
297
+ }
298
+ export interface HostPortCapability {
299
+ id: QualifiedName;
300
+ operations: QualifiedName[];
301
+ version: SemanticVersion;
302
+ }
303
+ export interface HostFeatureCapability {
304
+ configuration?: JsonValue;
305
+ id: QualifiedName;
306
+ version: SemanticVersion;
307
+ }
308
+ export interface HostCapabilities {
309
+ capabilities: HostFeatureCapability[];
310
+ contractVersion: StudioContractVersion;
311
+ extensions?: Record<QualifiedName, JsonValue>;
312
+ host: {
313
+ generation: Revision;
314
+ id: QualifiedName;
315
+ version: SemanticVersion;
316
+ };
317
+ kind: 'host-capabilities';
318
+ ports: HostPortCapability[];
319
+ protocolVersions: SemanticVersion[];
320
+ }
321
+ export type ContentFieldKind = 'boolean' | 'collection' | 'date' | 'date-time' | 'decimal' | 'enum' | 'integer' | 'media' | 'money' | 'object' | 'resource' | 'rich-text' | 'string' | QualifiedName;
322
+ export interface FieldAuthoringMetadata {
323
+ control?: QualifiedName;
324
+ group?: LocalName;
325
+ hidden?: boolean;
326
+ order?: number;
327
+ placeholder?: MessageReference;
328
+ readOnly?: boolean;
329
+ width?: 'full' | 'half' | 'third' | 'two-thirds';
330
+ }
331
+ export interface FieldConstraints {
332
+ allowedMediaKinds?: MediaAsset['mediaKind'][];
333
+ maxItems?: number;
334
+ maxLength?: number;
335
+ maximum?: string;
336
+ minItems?: number;
337
+ minLength?: number;
338
+ minimum?: string;
339
+ scale?: number;
340
+ validator?: QualifiedName;
341
+ validatorArguments?: Record<string, JsonValue>;
342
+ }
343
+ export interface ContentModelEnumValue {
344
+ label: MessageReference;
345
+ value: LocalName;
346
+ }
347
+ export interface FieldDefinition {
348
+ authoring?: FieldAuthoringMetadata;
349
+ cardinality: 'many' | 'one';
350
+ constraints?: FieldConstraints;
351
+ defaultValue?: JsonValue;
352
+ description?: MessageReference;
353
+ enumValues?: ContentModelEnumValue[];
354
+ extensions?: Record<QualifiedName, JsonValue>;
355
+ fields?: FieldDefinition[];
356
+ id: LocalName;
357
+ itemKind?: Exclude<ContentFieldKind, 'collection'>;
358
+ kind: ContentFieldKind;
359
+ label: MessageReference;
360
+ localized: boolean;
361
+ required: boolean;
362
+ semanticRole?: QualifiedName;
363
+ }
364
+ export interface RelationshipAuthoringMetadata {
365
+ allowCreate: boolean;
366
+ control: QualifiedName;
367
+ displayField?: LocalName;
368
+ searchProvider?: QualifiedName;
369
+ }
370
+ export interface RelationshipDefinition {
371
+ authoring?: RelationshipAuthoringMetadata;
372
+ extensions?: Record<QualifiedName, JsonValue>;
373
+ id: LocalName;
374
+ kind: 'many-to-many' | 'many-to-one' | 'one-to-many' | 'one-to-one';
375
+ label: MessageReference;
376
+ onDelete: 'detach' | 'nullify' | 'restrict';
377
+ required: boolean;
378
+ sourceField: LocalName;
379
+ targetField?: LocalName;
380
+ targetModel: ArtifactReference;
381
+ }
382
+ export interface ContentModelDocument {
383
+ contractVersion: StudioContractVersion;
384
+ description?: MessageReference;
385
+ extensions?: Record<QualifiedName, JsonValue>;
386
+ fields: FieldDefinition[];
387
+ id: StableId;
388
+ kind: 'content-model';
389
+ label: MessageReference;
390
+ owner: OwnerReference;
391
+ relationships: RelationshipDefinition[];
392
+ revision: Revision;
393
+ status: 'draft' | 'published' | 'retired';
394
+ version: SemanticVersion;
395
+ }
396
+ export type PluginActivation = 'declarative' | 'executable';
397
+ export type PluginEntryRealm = 'application' | 'sandboxed-frame' | 'worker';
398
+ export interface PluginEntryModule {
399
+ integrity: string;
400
+ path: PackageRelativePath;
401
+ realm: PluginEntryRealm;
402
+ }
403
+ export type PluginContributionKind = 'block' | 'command' | 'design-vocabulary' | 'field-adapter' | 'inspector' | 'locale' | 'migration' | 'panel' | 'pattern' | 'renderer-capability' | 'test-fixture' | 'transform';
404
+ export interface PluginContributionDeclaration {
405
+ executable?: boolean;
406
+ id: QualifiedName;
407
+ integrity: string;
408
+ kind: PluginContributionKind;
409
+ resource: PackageRelativePath;
410
+ version: SemanticVersion;
411
+ }
412
+ export interface PluginCapabilityRequirement {
413
+ id: QualifiedName;
414
+ versions: string;
415
+ }
416
+ export interface PluginDependency {
417
+ id: QualifiedName;
418
+ optional: boolean;
419
+ versions: string;
420
+ }
421
+ export interface PluginManifest {
422
+ activation: PluginActivation;
423
+ contractVersion: StudioContractVersion;
424
+ contributions: PluginContributionDeclaration[];
425
+ dependencies: PluginDependency[];
426
+ description?: MessageReference;
427
+ entryModules: PluginEntryModule[];
428
+ extensions?: Record<QualifiedName, JsonValue>;
429
+ id: QualifiedName;
430
+ kind: 'plugin-manifest';
431
+ label: MessageReference;
432
+ locales?: string[];
433
+ optionalCapabilities: PluginCapabilityRequirement[];
434
+ owner: OwnerReference;
435
+ permissions: QualifiedName[];
436
+ requiredCapabilities: PluginCapabilityRequirement[];
437
+ version: SemanticVersion;
438
+ }
439
+ export interface ThemeViewport {
440
+ base: boolean;
441
+ id: LocalName;
442
+ label: MessageReference;
443
+ order: number;
444
+ previewWidth: number;
445
+ }
446
+ export type ThemeDesignControlKind = 'boolean' | 'color-role' | 'enum' | 'integer' | 'layer-role' | 'motion-role' | 'radius-role' | 'shadow-role' | 'size-role' | 'spacing-role' | 'typography-role';
447
+ export interface ThemeDesignChoice {
448
+ deprecated?: boolean;
449
+ id: LocalName;
450
+ label: MessageReference;
451
+ }
452
+ export interface ThemeDesignControl {
453
+ choices: ThemeDesignChoice[];
454
+ description?: MessageReference;
455
+ id: LocalName;
456
+ kind: ThemeDesignControlKind;
457
+ label: MessageReference;
458
+ }
459
+ export interface ThemeRecipe {
460
+ blockType: QualifiedName;
461
+ designValues: Record<LocalName, JsonValue>;
462
+ id: LocalName;
463
+ label: MessageReference;
464
+ }
465
+ export interface ThemeRendererDeclaration {
466
+ exactPreview: boolean;
467
+ id: QualifiedName;
468
+ surfaces: RendererRequirement['surface'][];
469
+ version: SemanticVersion;
470
+ }
471
+ export interface ThemeBlockSupport {
472
+ renderer: QualifiedName;
473
+ type: QualifiedName;
474
+ versions: string;
475
+ }
476
+ export interface ThemeAlias {
477
+ equivalentMeaning: true;
478
+ from: LocalName;
479
+ kind: 'choice' | 'design-control' | 'recipe' | 'viewport';
480
+ to: LocalName;
481
+ }
482
+ export interface ThemeDocument {
483
+ aliases?: ThemeAlias[];
484
+ blockSupport: ThemeBlockSupport[];
485
+ contractVersion: StudioContractVersion;
486
+ description?: MessageReference;
487
+ designControls: ThemeDesignControl[];
488
+ extensions?: Record<QualifiedName, JsonValue>;
489
+ id: StableId;
490
+ kind: 'theme';
491
+ label: MessageReference;
492
+ owner: OwnerReference;
493
+ recipes: ThemeRecipe[];
494
+ renderers: ThemeRendererDeclaration[];
495
+ revision: Revision;
496
+ version: SemanticVersion;
497
+ viewports: ThemeViewport[];
498
+ }
499
+ /**
500
+ * The declarative payload behind a `design-vocabulary` plugin contribution:
501
+ * design controls and recipes an extension offers, which a theme may adopt or
502
+ * remap through its own declared controls and aliases. The vocabulary never
503
+ * carries CSS or executable values; a theme that ignores it loses nothing.
504
+ */
505
+ export interface DesignVocabulary {
506
+ contractVersion: StudioContractVersion;
507
+ description?: MessageReference;
508
+ designControls: ThemeDesignControl[];
509
+ extensions?: Record<QualifiedName, JsonValue>;
510
+ id: QualifiedName;
511
+ kind: 'design-vocabulary';
512
+ label: MessageReference;
513
+ owner: OwnerReference;
514
+ recipes: ThemeRecipe[];
515
+ version: SemanticVersion;
516
+ }
517
+ /**
518
+ * The declarative payload behind a `field-adapter` contribution. Executable
519
+ * control code remains host-bound; this document is safe to validate and
520
+ * activate into an immutable contribution generation.
521
+ */
522
+ export interface FieldAdapterContribution {
523
+ contractVersion: StudioContractVersion;
524
+ control: QualifiedName;
525
+ description?: MessageReference;
526
+ extensions?: Record<QualifiedName, JsonValue>;
527
+ fieldKinds: QualifiedName[];
528
+ id: QualifiedName;
529
+ kind: 'field-adapter';
530
+ label: MessageReference;
531
+ optionSchema?: JsonSchema;
532
+ owner: OwnerReference;
533
+ requiredCapability?: QualifiedName;
534
+ version: SemanticVersion;
535
+ }
536
+ /**
537
+ * The declarative payload behind an `inspector` contribution. Its executable
538
+ * surface is resolved separately through host capability policy.
539
+ */
540
+ export interface InspectorContribution {
541
+ blockTypes: BlockType[];
542
+ contractVersion: StudioContractVersion;
543
+ description?: MessageReference;
544
+ extensions?: Record<QualifiedName, JsonValue>;
545
+ id: QualifiedName;
546
+ kind: 'inspector';
547
+ label: MessageReference;
548
+ owner: OwnerReference;
549
+ placement: 'augment' | 'replace';
550
+ requiredCapability?: QualifiedName;
551
+ version: SemanticVersion;
552
+ }
553
+ export type MigrationArtifactKind = 'block-definition' | 'blueprint' | 'content-model' | 'entry' | 'theme';
554
+ /**
555
+ * The declarative payload behind a `migration` plugin contribution: the
556
+ * portable descriptor of a document migration, safe to validate at admission
557
+ * and install without executing plugin code. The transformation itself is
558
+ * trusted package code the host binds separately; artifacts never carry
559
+ * executable migration source.
560
+ */
561
+ export interface MigrationDeclaration {
562
+ artifactKinds: MigrationArtifactKind[];
563
+ contractVersion: StudioContractVersion;
564
+ description?: MessageReference;
565
+ extensions?: Record<QualifiedName, JsonValue>;
566
+ id: QualifiedName;
567
+ kind: 'migration';
568
+ label: MessageReference;
569
+ lossClassification: 'lossless' | 'lossy';
570
+ owner: OwnerReference;
571
+ sourceVersions: string;
572
+ targetVersion: SemanticVersion;
573
+ version: SemanticVersion;
574
+ }
575
+ export type HostErrorCategory = 'cancelled' | 'conflict' | 'forbidden' | 'incompatible' | 'internal' | 'invalid-request' | 'limit-exceeded' | 'not-found' | 'rate-limited' | 'unauthenticated' | 'unavailable' | 'validation-failed';
576
+ export interface HostPortError {
577
+ category: HostErrorCategory;
578
+ contractVersion: StudioContractVersion;
579
+ correlationId?: StableId;
580
+ diagnostics?: StudioDiagnostic[];
581
+ kind: 'host-error';
582
+ message: MessageReference;
583
+ retryAfterMilliseconds?: number;
584
+ retryable: boolean;
585
+ revision?: Revision;
586
+ }
587
+ export interface HostRequestContext {
588
+ expectedRevision?: Revision;
589
+ idempotencyKey?: StableId;
590
+ locale?: string;
591
+ operationId: QualifiedName;
592
+ protocolVersion: StudioWireProtocolVersion;
593
+ requestId: StableId;
594
+ resourceContextKey: StableId;
595
+ sessionGeneration: Revision;
596
+ traceContext?: Record<LocalName, string>;
597
+ }
598
+ export interface HostPortResult<TValue> {
599
+ revision?: Revision;
600
+ value: TValue;
601
+ }
602
+ export type StudioArtifact = BlueprintDocument | ContentModelDocument | EntryDocument;
603
+ export interface ArtifactPort {
604
+ dependencies(reference: ArtifactReference, context: HostRequestContext): Promise<HostPortResult<ArtifactReference[]>>;
605
+ load(reference: ArtifactReference, context: HostRequestContext): Promise<HostPortResult<StudioArtifact>>;
606
+ publish(reference: ArtifactReference, context: HostRequestContext): Promise<HostPortResult<null>>;
607
+ save(artifact: StudioArtifact, context: HostRequestContext): Promise<HostPortResult<null>>;
608
+ unpublish(reference: ArtifactReference, context: HostRequestContext): Promise<HostPortResult<null>>;
609
+ }
610
+ export interface ModelPort {
611
+ get(reference: ArtifactReference, context: HostRequestContext): Promise<HostPortResult<ContentModelDocument>>;
612
+ list(context: HostRequestContext): Promise<HostPortResult<ContentModelDocument[]>>;
613
+ }
614
+ export interface ResourceSearchQuery {
615
+ cursor?: string;
616
+ limit: number;
617
+ resourceType: QualifiedName;
618
+ search?: string;
619
+ }
620
+ export interface ResourceSearchHit {
621
+ id: StableId;
622
+ label: MessageReference;
623
+ resourceType: QualifiedName;
624
+ }
625
+ export interface ResourceSearchPage {
626
+ items: ResourceSearchHit[];
627
+ nextCursor?: string;
628
+ }
629
+ export interface ResourcePort {
630
+ search(query: ResourceSearchQuery, context: HostRequestContext): Promise<HostPortResult<ResourceSearchPage>>;
631
+ }
632
+ export interface PreviewPort {
633
+ cancel(draftDigest: string, context: HostRequestContext): Promise<HostPortResult<null>>;
634
+ render(payload: PreviewRenderPayload, context: HostRequestContext): Promise<HostPortResult<PreviewRenderedPayload>>;
635
+ }
636
+ export interface MediaHostPort {
637
+ /** Releases a grant the client will not use. Never deletes an accepted asset. */
638
+ abortUpload(uploadId: StableId, context: HostRequestContext): Promise<HostPortResult<null>>;
639
+ /**
640
+ * Authorizes one declared upload against host policy and returns the grant
641
+ * to transfer against. Policy rejection happens here, before any byte moves.
642
+ */
643
+ authorizeUpload(request: MediaUploadRequestDescriptor, context: HostRequestContext): Promise<HostPortResult<MediaUploadGrant>>;
644
+ /**
645
+ * Closes a transferred upload. The host verifies the bytes it received - it
646
+ * never trusts the client's declared media type or checksum - and mints the
647
+ * stable asset identity, which may still be processing or quarantined.
648
+ */
649
+ completeUpload(uploadId: StableId, context: HostRequestContext): Promise<HostPortResult<MediaUploadAcceptedAsset>>;
650
+ get(assetId: StableId, context: HostRequestContext): Promise<HostPortResult<MediaAsset | null>>;
651
+ /**
652
+ * Fetches an external candidate under host runtime hardening. The lexical
653
+ * URL policy is necessary but not sufficient: redirect re-validation, DNS
654
+ * rebinding defence, response verification and size bounds are the host's.
655
+ */
656
+ importExternal(url: string, context: HostRequestContext): Promise<HostPortResult<MediaUploadAcceptedAsset>>;
657
+ list(query: MediaQuery, context: HostRequestContext): Promise<HostPortResult<MediaPage>>;
658
+ /** Polls an accepted asset whose processing has not settled. */
659
+ uploadStatus(assetId: StableId, context: HostRequestContext): Promise<HostPortResult<MediaUploadAcceptedAsset>>;
660
+ }
661
+ export interface LocalizationPort {
662
+ messages(locale: string, namespaces: QualifiedName[], context: HostRequestContext): Promise<HostPortResult<Record<QualifiedName, string>>>;
663
+ }
664
+ export interface PermissionExplanation {
665
+ allowed: boolean;
666
+ reason?: MessageReference;
667
+ }
668
+ export interface PermissionSnapshot {
669
+ permissions: QualifiedName[];
670
+ sessionGeneration: Revision;
671
+ }
672
+ export interface PermissionPort {
673
+ explain(operation: QualifiedName, context: HostRequestContext): Promise<HostPortResult<PermissionExplanation>>;
674
+ refresh(context: HostRequestContext): Promise<HostPortResult<PermissionSnapshot>>;
675
+ }
676
+ export interface RecoveryPort {
677
+ discard(context: HostRequestContext): Promise<HostPortResult<null>>;
678
+ load(context: HostRequestContext): Promise<HostPortResult<JsonObject | null>>;
679
+ store(envelope: JsonObject, context: HostRequestContext): Promise<HostPortResult<null>>;
680
+ }
681
+ export interface TelemetryEvent {
682
+ attributes?: Record<string, JsonPrimitive>;
683
+ name: QualifiedName;
684
+ }
685
+ export interface TelemetryPort {
686
+ emit(event: TelemetryEvent, context: HostRequestContext): Promise<HostPortResult<null>>;
687
+ }
688
+ export interface HostAdapter {
689
+ artifact: ArtifactPort;
690
+ localization?: LocalizationPort;
691
+ media?: MediaHostPort;
692
+ model?: ModelPort;
693
+ permission?: PermissionPort;
694
+ preview?: PreviewPort;
695
+ recovery?: RecoveryPort;
696
+ resource?: ResourcePort;
697
+ telemetry?: TelemetryPort;
698
+ }
699
+ export type ExtensionLifecycleState = 'activating' | 'active' | 'disabled' | 'discovered' | 'installed-disabled' | 'purged' | 'rejected' | 'trust-revoked' | 'uninstalled-data-preserved' | 'verified';
700
+ export interface EntryDocument {
701
+ compositionOverrides?: Record<StableId, JsonValue>;
702
+ contractVersion: StudioContractVersion;
703
+ extensions?: Record<QualifiedName, JsonValue>;
704
+ id: StableId;
705
+ kind: 'entry';
706
+ locale?: string;
707
+ model: LockedArtifactReference;
708
+ revision: Revision;
709
+ status: 'archived' | 'draft' | 'in-review' | 'published';
710
+ translationOf?: StableId;
711
+ values: Record<LocalName, JsonValue>;
712
+ workflowState?: QualifiedName;
713
+ }
714
+ export type StudioAuthoringMode = 'blueprint' | 'content' | 'model';
715
+ /**
716
+ * The single permission determinant of a headless editing session, fixed at
717
+ * session creation. It flattens the configuration triple of editing `mode`,
718
+ * `composite`, and `sessionState`: a read-only session state flattens to
719
+ * `read-only`, the bounded hybrid composite flattens to `hybrid`, and every
720
+ * other session flattens to its authoring mode. `hybrid` remains the bounded
721
+ * Blueprint-plus-Content composite — not a fourth editing mode — and
722
+ * `read-only` is the canonical session-mode spelling of the read-only
723
+ * session state.
724
+ */
725
+ export type StudioSessionMode = StudioAuthoringMode | 'hybrid' | 'read-only';
726
+ export interface StudioDisplayPreferences {
727
+ calendar: LocalName;
728
+ hourCycle: 'h11' | 'h12' | 'h23' | 'h24';
729
+ measurementSystem?: 'metric' | 'uk' | 'us';
730
+ numberingSystem: LocalName;
731
+ }
732
+ export interface StudioResourceScope {
733
+ id: StableId;
734
+ kind: QualifiedName;
735
+ }
736
+ export interface StudioResourceContext {
737
+ key: StableId;
738
+ resource?: {
739
+ id: StableId;
740
+ type: QualifiedName;
741
+ };
742
+ revision?: Revision;
743
+ scopes: StudioResourceScope[];
744
+ surface: QualifiedName;
745
+ }
746
+ export interface StudioLimits {
747
+ maxChildrenPerSlot: number;
748
+ maxCommandBatch: number;
749
+ maxContributionsPerPlugin: number;
750
+ maxDepth: number;
751
+ maxExtensionBytes: number;
752
+ maxHistoryEntries: number;
753
+ maxLocaleBytes: number;
754
+ maxMediaBatch: number;
755
+ maxMediaUploadBytes: number;
756
+ maxNodes: number;
757
+ maxPluginCount: number;
758
+ maxPreviewBytes: number;
759
+ maxPreviewRequestsPerMinute: number;
760
+ maxPropertyBytes: number;
761
+ maxRichTextBytes: number;
762
+ maxRichTextDepth: number;
763
+ maxSlotsPerNode: number;
764
+ }
765
+ export interface StudioConfiguration {
766
+ actor: {
767
+ displayName: string;
768
+ id: StableId;
769
+ };
770
+ artifacts: {
771
+ blueprint?: LockedArtifactReference;
772
+ entry?: ResolvedEntryReference;
773
+ model?: LockedArtifactReference;
774
+ theme?: LockedArtifactReference;
775
+ };
776
+ blocks: BlueprintBlockLock[];
777
+ composite: 'hybrid' | 'single';
778
+ contractVersion: StudioContractVersion;
779
+ displayPreferences: StudioDisplayPreferences;
780
+ extensions?: Record<QualifiedName, JsonValue>;
781
+ features: {
782
+ clipboardMediaUpload: boolean;
783
+ collaboration: boolean;
784
+ customInspectors: boolean;
785
+ executablePlugins: boolean;
786
+ externalMediaImport: boolean;
787
+ offlineRecovery: boolean;
788
+ };
789
+ hostCapabilities: HostCapabilities;
790
+ limits: StudioLimits;
791
+ locale: {
792
+ direction: 'ltr' | 'rtl';
793
+ fallbacks: string[];
794
+ requested: string;
795
+ resolved: string;
796
+ timeZone: string;
797
+ };
798
+ mode: StudioAuthoringMode;
799
+ permissions: QualifiedName[];
800
+ plugins: LockedArtifactReference[];
801
+ protocolVersion: StudioWireProtocolVersion;
802
+ preview: {
803
+ allowApproximateRenderer: boolean;
804
+ enabled: boolean;
805
+ initialViewport?: LocalName;
806
+ sameOriginRequired: boolean;
807
+ };
808
+ sessionGeneration: Revision;
809
+ sessionId: StableId;
810
+ sessionState: 'editable' | 'read-only';
811
+ resourceContext: StudioResourceContext;
812
+ }
813
+ export interface ExperimentalShellConfiguration {
814
+ /** Omit to use Studio's complete first-party catalog; an explicit array overrides it. */
815
+ blockDefinitions?: BlockDefinition[];
816
+ session: StudioConfiguration;
817
+ }
818
+ export interface CommandDestination {
819
+ parentNodeId?: NodeId;
820
+ position: number;
821
+ slot?: LocalName;
822
+ }
823
+ export interface CommandBase<TType extends QualifiedName, TPayload extends object> {
824
+ artifactId: StableId;
825
+ baseStateVersion: number;
826
+ contractVersion: StudioContractVersion;
827
+ expectedRevision?: Revision;
828
+ groupId?: StableId;
829
+ id: StableId;
830
+ kind: 'command';
831
+ payload: TPayload;
832
+ sessionGeneration: Revision;
833
+ type: TType;
834
+ }
835
+ export interface InsertNodePayload {
836
+ destination: CommandDestination;
837
+ node: BlueprintNode;
838
+ }
839
+ export type InsertNodeCommand = CommandBase<'studio.command/insert-node', InsertNodePayload>;
840
+ export interface RemoveNodePayload {
841
+ nodeId: NodeId;
842
+ }
843
+ export type RemoveNodeCommand = CommandBase<'studio.command/remove-node', RemoveNodePayload>;
844
+ export interface RestoreNodePayload {
845
+ destination: CommandDestination;
846
+ node: BlueprintNode;
847
+ }
848
+ export type RestoreNodeCommand = CommandBase<'studio.command/restore-node', RestoreNodePayload>;
849
+ export interface MoveNodePayload {
850
+ destination: CommandDestination;
851
+ nodeId: NodeId;
852
+ }
853
+ export type MoveNodeCommand = CommandBase<'studio.command/move-node', MoveNodePayload>;
854
+ export interface SetPropertyPayload {
855
+ nodeId: NodeId;
856
+ property: LocalName;
857
+ value: JsonValue;
858
+ viewport?: LocalName;
859
+ }
860
+ export type SetPropertyCommand = CommandBase<'studio.command/set-property', SetPropertyPayload>;
861
+ export interface DuplicateNodePayload {
862
+ destination?: CommandDestination;
863
+ idMap: Record<NodeId, NodeId>;
864
+ nodeId: NodeId;
865
+ }
866
+ export type DuplicateNodeCommand = CommandBase<'studio.command/duplicate-node', DuplicateNodePayload>;
867
+ export interface ReorderChildrenPayload {
868
+ order: NodeId[];
869
+ parentNodeId?: NodeId;
870
+ slot?: LocalName;
871
+ }
872
+ export type ReorderChildrenCommand = CommandBase<'studio.command/reorder-children', ReorderChildrenPayload>;
873
+ export interface UnsetPropertyPayload {
874
+ nodeId: NodeId;
875
+ property: LocalName;
876
+ viewport?: LocalName;
877
+ }
878
+ export type UnsetPropertyCommand = CommandBase<'studio.command/unset-property', UnsetPropertyPayload>;
879
+ export interface SetSizeRolePayload {
880
+ axis: SizeRoleAxis;
881
+ nodeId: NodeId;
882
+ role: LocalName;
883
+ viewport?: LocalName;
884
+ }
885
+ export type SetSizeRoleCommand = CommandBase<'studio.command/set-size-role', SetSizeRolePayload>;
886
+ export interface UnsetSizeRolePayload {
887
+ axis: SizeRoleAxis;
888
+ nodeId: NodeId;
889
+ viewport?: LocalName;
890
+ }
891
+ export type UnsetSizeRoleCommand = CommandBase<'studio.command/unset-size-role', UnsetSizeRolePayload>;
892
+ export interface ResetInheritedPropertyPayload {
893
+ nodeId: NodeId;
894
+ property: LocalName;
895
+ }
896
+ export type ResetInheritedPropertyCommand = CommandBase<'studio.command/reset-inherited-property', ResetInheritedPropertyPayload>;
897
+ export interface SetBindingPayload {
898
+ binding: FieldBinding;
899
+ nodeId: NodeId;
900
+ port: LocalName;
901
+ }
902
+ export type SetBindingCommand = CommandBase<'studio.command/set-binding', SetBindingPayload>;
903
+ export interface RemoveBindingPayload {
904
+ nodeId: NodeId;
905
+ port: LocalName;
906
+ }
907
+ export type RemoveBindingCommand = CommandBase<'studio.command/remove-binding', RemoveBindingPayload>;
908
+ export interface SetFieldValuePayload {
909
+ fieldPath: LocalName[];
910
+ locale?: string;
911
+ value: JsonValue;
912
+ }
913
+ export type SetFieldValueCommand = CommandBase<'studio.command/set-field-value', SetFieldValuePayload>;
914
+ export type ProvenanceOrigin = 'authoring' | 'import' | 'migration' | 'pattern' | 'plugin' | 'system';
915
+ export interface ProvenanceActor {
916
+ displayName?: string;
917
+ id: StableId;
918
+ }
919
+ export interface ProvenanceEntry {
920
+ actor: ProvenanceActor;
921
+ commandCount?: number;
922
+ fromRevision?: Revision;
923
+ migrationId?: QualifiedName;
924
+ origin: ProvenanceOrigin;
925
+ recordedAt: string;
926
+ sessionId?: StableId;
927
+ source?: ArtifactReference;
928
+ toRevision: Revision;
929
+ }
930
+ export interface ProvenanceRecord {
931
+ artifact: {
932
+ id: StableId;
933
+ revision: Revision;
934
+ };
935
+ chain: ProvenanceEntry[];
936
+ contractVersion: StudioContractVersion;
937
+ extensions?: Record<QualifiedName, JsonValue>;
938
+ kind: 'provenance';
939
+ }
940
+ export type UnresolvedContributionReason = 'incompatible' | 'not-installed' | 'owner-disabled' | 'owner-revoked';
941
+ export interface UnresolvedContributionReference {
942
+ contribution: Exclude<PluginContributionKind, 'test-fixture'>;
943
+ id: QualifiedName;
944
+ version: SemanticVersion;
945
+ }
946
+ export interface UnresolvedContribution {
947
+ affectedNodes?: StableId[];
948
+ contractVersion: StudioContractVersion;
949
+ diagnostics?: StudioDiagnostic[];
950
+ kind: 'unresolved-contribution';
951
+ owner?: OwnerReference;
952
+ reason: UnresolvedContributionReason;
953
+ reference: UnresolvedContributionReference;
954
+ }
955
+ export interface PatternDocument {
956
+ blockDependencies: BlueprintBlockLock[];
957
+ contractVersion: StudioContractVersion;
958
+ description?: MessageReference;
959
+ extensions?: Record<QualifiedName, JsonValue>;
960
+ id: StableId;
961
+ kind: 'pattern';
962
+ label: MessageReference;
963
+ owner: OwnerReference;
964
+ revision: Revision;
965
+ roots: BlueprintNode[];
966
+ version: SemanticVersion;
967
+ }
968
+ export interface PatternReference {
969
+ id: StableId;
970
+ revision: Revision;
971
+ version: SemanticVersion;
972
+ }
973
+ export interface ApplyPatternPayload {
974
+ destination: CommandDestination;
975
+ idMap: Record<NodeId, NodeId>;
976
+ nodes: BlueprintNode[];
977
+ pattern: PatternReference;
978
+ }
979
+ export type ApplyPatternCommand = CommandBase<'studio.command/apply-pattern', ApplyPatternPayload>;
980
+ export interface BatchOperation<TType extends QualifiedName, TPayload extends object> {
981
+ payload: TPayload;
982
+ type: TType;
983
+ }
984
+ export type BlueprintBatchOperation = BatchOperation<'studio.command/duplicate-node', DuplicateNodePayload> | BatchOperation<'studio.command/insert-node', InsertNodePayload> | BatchOperation<'studio.command/move-node', MoveNodePayload> | BatchOperation<'studio.command/remove-binding', RemoveBindingPayload> | BatchOperation<'studio.command/remove-node', RemoveNodePayload> | BatchOperation<'studio.command/reorder-children', ReorderChildrenPayload> | BatchOperation<'studio.command/restore-node', RestoreNodePayload> | BatchOperation<'studio.command/set-binding', SetBindingPayload> | BatchOperation<'studio.command/set-property', SetPropertyPayload> | BatchOperation<'studio.command/set-size-role', SetSizeRolePayload> | BatchOperation<'studio.command/unset-property', UnsetPropertyPayload> | BatchOperation<'studio.command/unset-size-role', UnsetSizeRolePayload>;
985
+ export interface BatchPayload {
986
+ operations: BlueprintBatchOperation[];
987
+ }
988
+ export type BatchCommand = CommandBase<'studio.command/batch', BatchPayload>;
989
+ export interface AddModelFieldPayload {
990
+ field: FieldDefinition;
991
+ position?: number;
992
+ }
993
+ export type AddModelFieldCommand = CommandBase<'studio.command/add-model-field', AddModelFieldPayload>;
994
+ export type BlueprintCommand = ApplyPatternCommand | BatchCommand | DuplicateNodeCommand | InsertNodeCommand | MoveNodeCommand | RemoveBindingCommand | RemoveNodeCommand | ReorderChildrenCommand | ResetInheritedPropertyCommand | RestoreNodeCommand | SetBindingCommand | SetPropertyCommand | SetSizeRoleCommand | UnsetPropertyCommand | UnsetSizeRoleCommand;
995
+ export type StudioCommand = AddModelFieldCommand | BlueprintCommand | SetFieldValueCommand;
996
+ export interface PreviewMessageBase<TType extends QualifiedName, TPayload extends object> {
997
+ channelId: StableId;
998
+ contractVersion: StudioContractVersion;
999
+ kind: 'preview-message';
1000
+ payload: TPayload;
1001
+ sequence: number;
1002
+ sessionGeneration: Revision;
1003
+ type: TType;
1004
+ }
1005
+ export interface PreviewReadyPayload {
1006
+ protocolVersion: StudioWireProtocolVersion;
1007
+ renderer: QualifiedName;
1008
+ viewports: LocalName[];
1009
+ }
1010
+ export interface PreviewRenderPayload {
1011
+ artifactId: StableId;
1012
+ draftDigest: string;
1013
+ draftRevision: Revision;
1014
+ /** Session-unique identity for this render attempt, including retries. */
1015
+ requestId: StableId;
1016
+ viewport: LocalName;
1017
+ }
1018
+ export interface PreviewRenderedPayload {
1019
+ diagnostics: StudioDiagnostic[];
1020
+ draftDigest: string;
1021
+ /** Exact render request this response settles. */
1022
+ requestId: StableId;
1023
+ /** Canonical render markers in deterministic Blueprint preorder. */
1024
+ markers: StableId[];
1025
+ /** Exact one-to-one mapping from every marker to the node it renders. */
1026
+ markerMap: Record<StableId, NodeId>;
1027
+ }
1028
+ export interface PreviewSelectPayload {
1029
+ nodeId: NodeId;
1030
+ reveal?: boolean;
1031
+ }
1032
+ /** Axis-aligned rectangle in CSS pixels, relative to the preview viewport origin. */
1033
+ export interface PreviewMarkerRect {
1034
+ height: number;
1035
+ width: number;
1036
+ x: number;
1037
+ y: number;
1038
+ }
1039
+ /** Preview viewport metrics captured at measurement time. */
1040
+ export interface PreviewViewportMetrics {
1041
+ devicePixelRatio: number;
1042
+ height: number;
1043
+ scrollX: number;
1044
+ scrollY: number;
1045
+ width: number;
1046
+ }
1047
+ export interface PreviewMeasurePayload {
1048
+ /** Opaque render markers to measure, as a bounded explicit list. */
1049
+ markers: StableId[];
1050
+ /** Session-unique request identity; never reused for a render or measurement. */
1051
+ requestId: StableId;
1052
+ }
1053
+ /**
1054
+ * Volatile on-screen geometry for render markers. Measurements are never document
1055
+ * state: they are bound to the render digest they were measured against and become
1056
+ * meaningless as soon as a newer render or reload supersedes that digest.
1057
+ */
1058
+ export interface PreviewMeasurementsPayload {
1059
+ /** Digest of the render the geometry was measured against. */
1060
+ draftDigest: string;
1061
+ /** One or more rectangles per measured marker; inline content fragments across lines. */
1062
+ measurements: Record<StableId, PreviewMarkerRect[]>;
1063
+ requestId: StableId;
1064
+ /** Requested markers the renderer could not associate with any on-screen geometry. */
1065
+ unknown: StableId[];
1066
+ viewport: PreviewViewportMetrics;
1067
+ }
1068
+ export interface PreviewErrorPayload {
1069
+ code: QualifiedName;
1070
+ correlationId?: StableId;
1071
+ message: MessageReference;
1072
+ retryable: boolean;
1073
+ }
1074
+ export type PreviewReadyMessage = PreviewMessageBase<'studio.preview/ready', PreviewReadyPayload>;
1075
+ export type PreviewRenderMessage = PreviewMessageBase<'studio.preview/render', PreviewRenderPayload>;
1076
+ export type PreviewRenderedMessage = PreviewMessageBase<'studio.preview/rendered', PreviewRenderedPayload>;
1077
+ export type PreviewSelectMessage = PreviewMessageBase<'studio.preview/select', PreviewSelectPayload>;
1078
+ export type PreviewMeasureMessage = PreviewMessageBase<'studio.preview/measure', PreviewMeasurePayload>;
1079
+ export type PreviewMeasurementsMessage = PreviewMessageBase<'studio.preview/measurements', PreviewMeasurementsPayload>;
1080
+ export type PreviewErrorMessage = PreviewMessageBase<'studio.preview/error', PreviewErrorPayload>;
1081
+ export interface PreviewReloadPayload {
1082
+ reason: QualifiedName;
1083
+ }
1084
+ export type PreviewReloadMessage = PreviewMessageBase<'studio.preview/reload', PreviewReloadPayload>;
1085
+ /**
1086
+ * The renderer reports a trusted interaction with a marked region. It reports
1087
+ * intent, never raw input events, and the marker carries nothing beyond the
1088
+ * node identity the render already published.
1089
+ */
1090
+ export interface PreviewActivatedPayload {
1091
+ interaction: 'activate' | 'context-menu' | 'focus';
1092
+ /** A marker from the currently accepted render inventory. */
1093
+ marker: StableId;
1094
+ }
1095
+ export type PreviewActivatedMessage = PreviewMessageBase<'studio.preview/activated', PreviewActivatedPayload>;
1096
+ /**
1097
+ * The client drives the preview surface to a semantic viewport role or to
1098
+ * bounded explicit dimensions. A role and explicit dimensions are
1099
+ * alternatives, not a merge.
1100
+ */
1101
+ export interface PreviewViewportPayload {
1102
+ height?: number;
1103
+ viewport?: LocalName;
1104
+ width?: number;
1105
+ }
1106
+ export type PreviewViewportMessage = PreviewMessageBase<'studio.preview/viewport', PreviewViewportPayload>;
1107
+ /**
1108
+ * The client instructs the renderer to revoke the resources it holds for a
1109
+ * draft while the channel stays open. This is not teardown: teardown ends the
1110
+ * session, dispose frees a superseded render's resources within it.
1111
+ */
1112
+ export interface PreviewDisposePayload {
1113
+ draftDigest?: string;
1114
+ reason: QualifiedName;
1115
+ }
1116
+ export type PreviewDisposeMessage = PreviewMessageBase<'studio.preview/dispose', PreviewDisposePayload>;
1117
+ export interface PreviewTeardownPayload {
1118
+ reason: QualifiedName;
1119
+ }
1120
+ export type PreviewTeardownMessage = PreviewMessageBase<'studio.preview/teardown', PreviewTeardownPayload>;
1121
+ export type PreviewMessage = PreviewActivatedMessage | PreviewDisposeMessage | PreviewErrorMessage | PreviewMeasureMessage | PreviewMeasurementsMessage | PreviewReadyMessage | PreviewReloadMessage | PreviewRenderMessage | PreviewRenderedMessage | PreviewSelectMessage | PreviewTeardownMessage | PreviewViewportMessage;
1122
+ export interface MediaRendition {
1123
+ height: number;
1124
+ id: LocalName;
1125
+ mediaType: string;
1126
+ width: number;
1127
+ }
1128
+ export interface MediaMetadata {
1129
+ altText?: string;
1130
+ caption?: string;
1131
+ credit?: string;
1132
+ decorative?: boolean;
1133
+ durationMilliseconds?: number;
1134
+ focalPoint?: {
1135
+ x: number;
1136
+ y: number;
1137
+ };
1138
+ height?: number;
1139
+ license?: string;
1140
+ width?: number;
1141
+ }
1142
+ export interface MediaRenditionIntent {
1143
+ fit?: 'contain' | 'cover' | 'fill' | 'scale-down';
1144
+ preferredMediaTypes?: string[];
1145
+ role: LocalName;
1146
+ }
1147
+ export type MediaCropIntent = {
1148
+ height: number;
1149
+ mode: 'aspect-ratio';
1150
+ width: number;
1151
+ } | {
1152
+ height: number;
1153
+ mode: 'rectangle';
1154
+ width: number;
1155
+ x: number;
1156
+ y: number;
1157
+ };
1158
+ export type MediaAccessibility = {
1159
+ altFieldPath: LocalName[];
1160
+ captionFieldPath?: LocalName[];
1161
+ mode: 'bound';
1162
+ } | {
1163
+ mode: 'decorative';
1164
+ } | {
1165
+ altText: string;
1166
+ caption?: string;
1167
+ mode: 'informative';
1168
+ };
1169
+ export interface MediaReference {
1170
+ accessibility: MediaAccessibility;
1171
+ assetId: StableId;
1172
+ assetRevision?: Revision;
1173
+ contractVersion: StudioContractVersion;
1174
+ cropIntent?: MediaCropIntent;
1175
+ focalPoint?: {
1176
+ x: number;
1177
+ y: number;
1178
+ };
1179
+ kind: 'media-reference';
1180
+ renditionIntent?: MediaRenditionIntent;
1181
+ usage: QualifiedName;
1182
+ }
1183
+ export interface MediaAsset {
1184
+ byteSize: number;
1185
+ contractVersion: StudioContractVersion;
1186
+ extensions?: Record<QualifiedName, JsonValue>;
1187
+ filename: string;
1188
+ id: StableId;
1189
+ kind: 'media-asset';
1190
+ mediaKind: 'archive' | 'audio' | 'document' | 'image' | 'other' | 'video';
1191
+ mediaType: string;
1192
+ metadata: MediaMetadata;
1193
+ renditions?: MediaRendition[];
1194
+ revision: Revision;
1195
+ state: 'archived' | 'processing' | 'quarantined' | 'ready' | 'rejected';
1196
+ }
1197
+ export type MediaUploadSessionState = 'authorized' | 'cancelled' | 'complete' | 'failed' | 'requested' | 'transferring' | 'verifying';
1198
+ export interface MediaUploadRequestDescriptor {
1199
+ byteSize: number;
1200
+ checksum?: string;
1201
+ filename: string;
1202
+ mediaType: string;
1203
+ purpose: QualifiedName;
1204
+ }
1205
+ export interface MediaUploadPlan {
1206
+ chunkBytes?: number;
1207
+ maximumBytes: number;
1208
+ resumable: boolean;
1209
+ }
1210
+ export interface MediaUploadProgress {
1211
+ totalBytes: number;
1212
+ transferredBytes: number;
1213
+ }
1214
+ export interface MediaUploadAcceptedAsset {
1215
+ id: StableId;
1216
+ revision: Revision;
1217
+ state: 'processing' | 'quarantined' | 'ready' | 'rejected';
1218
+ }
1219
+ /**
1220
+ * The host's authorization to transfer one upload. Bytes never cross the JSON
1221
+ * port: the host issues a short-lived, single-purpose destination it controls
1222
+ * and the client transfers directly to it, so custody, quotas and storage
1223
+ * placement stay host-owned and a large body never traverses the port
1224
+ * transport. The grant is a capability, not a credential store - it is scoped
1225
+ * to one declared upload and expires.
1226
+ */
1227
+ export interface MediaUploadGrant {
1228
+ expiresAt: string;
1229
+ headers?: Record<string, string>;
1230
+ method: 'POST' | 'PUT';
1231
+ plan: MediaUploadPlan;
1232
+ uploadId: StableId;
1233
+ url: string;
1234
+ }
1235
+ export interface MediaUploadSession {
1236
+ asset?: MediaUploadAcceptedAsset;
1237
+ contractVersion: StudioContractVersion;
1238
+ failure?: StudioDiagnostic;
1239
+ id: StableId;
1240
+ kind: 'media-upload-session';
1241
+ plan?: MediaUploadPlan;
1242
+ progress: MediaUploadProgress;
1243
+ request: MediaUploadRequestDescriptor;
1244
+ state: MediaUploadSessionState;
1245
+ }
1246
+ export interface MediaQuery {
1247
+ cursor?: string;
1248
+ limit: number;
1249
+ mediaTypes?: string[];
1250
+ search?: string;
1251
+ }
1252
+ export interface MediaPage {
1253
+ assets: MediaAsset[];
1254
+ nextCursor?: string;
1255
+ }
1256
+ //# sourceMappingURL=types.d.ts.map