@kumwe/studio-protocol 0.1.0-alpha.4 → 0.1.0-alpha.5

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.
@@ -14,55 +14,228 @@
14
14
  "payload"
15
15
  ],
16
16
  "properties": {
17
- "contractVersion": { "$ref": "common.schema.json#/$defs/contractVersion" },
18
- "kind": { "const": "preview-message" },
19
- "channelId": { "$ref": "common.schema.json#/$defs/stableId" },
20
- "sessionGeneration": { "$ref": "common.schema.json#/$defs/revision" },
21
- "sequence": { "type": "integer", "minimum": 0 },
22
- "type": { "$ref": "common.schema.json#/$defs/qualifiedName" },
17
+ "contractVersion": {
18
+ "$ref": "common.schema.json#/$defs/contractVersion"
19
+ },
20
+ "kind": {
21
+ "const": "preview-message"
22
+ },
23
+ "channelId": {
24
+ "$ref": "common.schema.json#/$defs/stableId"
25
+ },
26
+ "sessionGeneration": {
27
+ "$ref": "common.schema.json#/$defs/revision"
28
+ },
29
+ "sequence": {
30
+ "type": "integer",
31
+ "minimum": 0
32
+ },
33
+ "type": {
34
+ "$ref": "common.schema.json#/$defs/qualifiedName"
35
+ },
23
36
  "payload": {
24
37
  "type": "object",
25
38
  "maxProperties": 1000,
26
- "propertyNames": { "$ref": "common.schema.json#/$defs/safeJsonMemberName" },
27
- "additionalProperties": { "$ref": "common.schema.json#/$defs/jsonValue" }
39
+ "propertyNames": {
40
+ "$ref": "common.schema.json#/$defs/safeJsonMemberName"
41
+ },
42
+ "additionalProperties": {
43
+ "$ref": "common.schema.json#/$defs/jsonValue"
44
+ }
28
45
  }
29
46
  },
30
47
  "allOf": [
31
48
  {
32
- "if": { "properties": { "type": { "const": "studio.preview/ready" } } },
33
- "then": { "properties": { "payload": { "$ref": "#/$defs/ready" } } }
49
+ "if": {
50
+ "properties": {
51
+ "type": {
52
+ "const": "studio.preview/ready"
53
+ }
54
+ }
55
+ },
56
+ "then": {
57
+ "properties": {
58
+ "payload": {
59
+ "$ref": "#/$defs/ready"
60
+ }
61
+ }
62
+ }
34
63
  },
35
64
  {
36
- "if": { "properties": { "type": { "const": "studio.preview/render" } } },
37
- "then": { "properties": { "payload": { "$ref": "#/$defs/render" } } }
65
+ "if": {
66
+ "properties": {
67
+ "type": {
68
+ "const": "studio.preview/render"
69
+ }
70
+ }
71
+ },
72
+ "then": {
73
+ "properties": {
74
+ "payload": {
75
+ "$ref": "#/$defs/render"
76
+ }
77
+ }
78
+ }
38
79
  },
39
80
  {
40
- "if": { "properties": { "type": { "const": "studio.preview/rendered" } } },
41
- "then": { "properties": { "payload": { "$ref": "#/$defs/rendered" } } }
81
+ "if": {
82
+ "properties": {
83
+ "type": {
84
+ "const": "studio.preview/rendered"
85
+ }
86
+ }
87
+ },
88
+ "then": {
89
+ "properties": {
90
+ "payload": {
91
+ "$ref": "#/$defs/rendered"
92
+ }
93
+ }
94
+ }
42
95
  },
43
96
  {
44
- "if": { "properties": { "type": { "const": "studio.preview/select" } } },
45
- "then": { "properties": { "payload": { "$ref": "#/$defs/select" } } }
97
+ "if": {
98
+ "properties": {
99
+ "type": {
100
+ "const": "studio.preview/select"
101
+ }
102
+ }
103
+ },
104
+ "then": {
105
+ "properties": {
106
+ "payload": {
107
+ "$ref": "#/$defs/select"
108
+ }
109
+ }
110
+ }
46
111
  },
47
112
  {
48
- "if": { "properties": { "type": { "const": "studio.preview/measure" } } },
49
- "then": { "properties": { "payload": { "$ref": "#/$defs/measure" } } }
113
+ "if": {
114
+ "properties": {
115
+ "type": {
116
+ "const": "studio.preview/measure"
117
+ }
118
+ }
119
+ },
120
+ "then": {
121
+ "properties": {
122
+ "payload": {
123
+ "$ref": "#/$defs/measure"
124
+ }
125
+ }
126
+ }
50
127
  },
51
128
  {
52
- "if": { "properties": { "type": { "const": "studio.preview/measurements" } } },
53
- "then": { "properties": { "payload": { "$ref": "#/$defs/measurements" } } }
129
+ "if": {
130
+ "properties": {
131
+ "type": {
132
+ "const": "studio.preview/measurements"
133
+ }
134
+ }
135
+ },
136
+ "then": {
137
+ "properties": {
138
+ "payload": {
139
+ "$ref": "#/$defs/measurements"
140
+ }
141
+ }
142
+ }
143
+ },
144
+ {
145
+ "if": {
146
+ "properties": {
147
+ "type": {
148
+ "const": "studio.preview/error"
149
+ }
150
+ }
151
+ },
152
+ "then": {
153
+ "properties": {
154
+ "payload": {
155
+ "$ref": "#/$defs/error"
156
+ }
157
+ }
158
+ }
159
+ },
160
+ {
161
+ "if": {
162
+ "properties": {
163
+ "type": {
164
+ "const": "studio.preview/reload"
165
+ }
166
+ }
167
+ },
168
+ "then": {
169
+ "properties": {
170
+ "payload": {
171
+ "$ref": "#/$defs/reload"
172
+ }
173
+ }
174
+ }
54
175
  },
55
176
  {
56
- "if": { "properties": { "type": { "const": "studio.preview/error" } } },
57
- "then": { "properties": { "payload": { "$ref": "#/$defs/error" } } }
177
+ "if": {
178
+ "properties": {
179
+ "type": {
180
+ "const": "studio.preview/teardown"
181
+ }
182
+ }
183
+ },
184
+ "then": {
185
+ "properties": {
186
+ "payload": {
187
+ "$ref": "#/$defs/teardown"
188
+ }
189
+ }
190
+ }
58
191
  },
59
192
  {
60
- "if": { "properties": { "type": { "const": "studio.preview/reload" } } },
61
- "then": { "properties": { "payload": { "$ref": "#/$defs/reload" } } }
193
+ "if": {
194
+ "properties": {
195
+ "type": {
196
+ "const": "studio.preview/activated"
197
+ }
198
+ }
199
+ },
200
+ "then": {
201
+ "properties": {
202
+ "payload": {
203
+ "$ref": "#/$defs/activated"
204
+ }
205
+ }
206
+ }
62
207
  },
63
208
  {
64
- "if": { "properties": { "type": { "const": "studio.preview/teardown" } } },
65
- "then": { "properties": { "payload": { "$ref": "#/$defs/teardown" } } }
209
+ "if": {
210
+ "properties": {
211
+ "type": {
212
+ "const": "studio.preview/viewport"
213
+ }
214
+ }
215
+ },
216
+ "then": {
217
+ "properties": {
218
+ "payload": {
219
+ "$ref": "#/$defs/viewport"
220
+ }
221
+ }
222
+ }
223
+ },
224
+ {
225
+ "if": {
226
+ "properties": {
227
+ "type": {
228
+ "const": "studio.preview/dispose"
229
+ }
230
+ }
231
+ },
232
+ "then": {
233
+ "properties": {
234
+ "payload": {
235
+ "$ref": "#/$defs/dispose"
236
+ }
237
+ }
238
+ }
66
239
  }
67
240
  ],
68
241
  "$defs": {
@@ -71,12 +244,18 @@
71
244
  "additionalProperties": false,
72
245
  "required": ["protocolVersion", "renderer", "viewports"],
73
246
  "properties": {
74
- "protocolVersion": { "$ref": "common.schema.json#/$defs/semanticVersion" },
75
- "renderer": { "$ref": "common.schema.json#/$defs/qualifiedName" },
247
+ "protocolVersion": {
248
+ "$ref": "common.schema.json#/$defs/semanticVersion"
249
+ },
250
+ "renderer": {
251
+ "$ref": "common.schema.json#/$defs/qualifiedName"
252
+ },
76
253
  "viewports": {
77
254
  "type": "array",
78
255
  "maxItems": 20,
79
- "items": { "$ref": "common.schema.json#/$defs/localName" }
256
+ "items": {
257
+ "$ref": "common.schema.json#/$defs/localName"
258
+ }
80
259
  }
81
260
  }
82
261
  },
@@ -85,13 +264,19 @@
85
264
  "additionalProperties": false,
86
265
  "required": ["artifactId", "draftDigest", "viewport"],
87
266
  "properties": {
88
- "artifactId": { "$ref": "common.schema.json#/$defs/stableId" },
267
+ "artifactId": {
268
+ "$ref": "common.schema.json#/$defs/stableId"
269
+ },
89
270
  "draftDigest": {
90
271
  "type": "string",
91
272
  "pattern": "^[a-f0-9]{64}(?![\\s\\S])"
92
273
  },
93
- "draftRevision": { "$ref": "common.schema.json#/$defs/revision" },
94
- "viewport": { "$ref": "common.schema.json#/$defs/localName" }
274
+ "draftRevision": {
275
+ "$ref": "common.schema.json#/$defs/revision"
276
+ },
277
+ "viewport": {
278
+ "$ref": "common.schema.json#/$defs/localName"
279
+ }
95
280
  }
96
281
  },
97
282
  "rendered": {
@@ -106,18 +291,26 @@
106
291
  "markers": {
107
292
  "type": "array",
108
293
  "maxItems": 100000,
109
- "items": { "$ref": "common.schema.json#/$defs/stableId" }
294
+ "items": {
295
+ "$ref": "common.schema.json#/$defs/stableId"
296
+ }
110
297
  },
111
298
  "markerMap": {
112
299
  "type": "object",
113
300
  "maxProperties": 100000,
114
- "propertyNames": { "$ref": "common.schema.json#/$defs/stableId" },
115
- "additionalProperties": { "$ref": "common.schema.json#/$defs/stableId" }
301
+ "propertyNames": {
302
+ "$ref": "common.schema.json#/$defs/stableId"
303
+ },
304
+ "additionalProperties": {
305
+ "$ref": "common.schema.json#/$defs/stableId"
306
+ }
116
307
  },
117
308
  "diagnostics": {
118
309
  "type": "array",
119
310
  "maxItems": 10000,
120
- "items": { "$ref": "common.schema.json#/$defs/diagnostic" }
311
+ "items": {
312
+ "$ref": "common.schema.json#/$defs/diagnostic"
313
+ }
121
314
  }
122
315
  }
123
316
  },
@@ -126,8 +319,13 @@
126
319
  "additionalProperties": false,
127
320
  "required": ["nodeId"],
128
321
  "properties": {
129
- "nodeId": { "$ref": "common.schema.json#/$defs/stableId" },
130
- "reveal": { "type": "boolean", "default": true }
322
+ "nodeId": {
323
+ "$ref": "common.schema.json#/$defs/stableId"
324
+ },
325
+ "reveal": {
326
+ "type": "boolean",
327
+ "default": true
328
+ }
131
329
  }
132
330
  },
133
331
  "measure": {
@@ -135,11 +333,15 @@
135
333
  "additionalProperties": false,
136
334
  "required": ["requestId", "markers"],
137
335
  "properties": {
138
- "requestId": { "$ref": "common.schema.json#/$defs/stableId" },
336
+ "requestId": {
337
+ "$ref": "common.schema.json#/$defs/stableId"
338
+ },
139
339
  "markers": {
140
340
  "type": "array",
141
341
  "maxItems": 1000,
142
- "items": { "$ref": "common.schema.json#/$defs/stableId" }
342
+ "items": {
343
+ "$ref": "common.schema.json#/$defs/stableId"
344
+ }
143
345
  }
144
346
  }
145
347
  },
@@ -148,7 +350,9 @@
148
350
  "additionalProperties": false,
149
351
  "required": ["requestId", "draftDigest", "measurements", "unknown", "viewport"],
150
352
  "properties": {
151
- "requestId": { "$ref": "common.schema.json#/$defs/stableId" },
353
+ "requestId": {
354
+ "$ref": "common.schema.json#/$defs/stableId"
355
+ },
152
356
  "draftDigest": {
153
357
  "type": "string",
154
358
  "pattern": "^[a-f0-9]{64}(?![\\s\\S])"
@@ -156,20 +360,28 @@
156
360
  "measurements": {
157
361
  "type": "object",
158
362
  "maxProperties": 1000,
159
- "propertyNames": { "$ref": "common.schema.json#/$defs/stableId" },
363
+ "propertyNames": {
364
+ "$ref": "common.schema.json#/$defs/stableId"
365
+ },
160
366
  "additionalProperties": {
161
367
  "type": "array",
162
368
  "minItems": 1,
163
369
  "maxItems": 1000,
164
- "items": { "$ref": "#/$defs/markerRect" }
370
+ "items": {
371
+ "$ref": "#/$defs/markerRect"
372
+ }
165
373
  }
166
374
  },
167
375
  "unknown": {
168
376
  "type": "array",
169
377
  "maxItems": 1000,
170
- "items": { "$ref": "common.schema.json#/$defs/stableId" }
378
+ "items": {
379
+ "$ref": "common.schema.json#/$defs/stableId"
380
+ }
171
381
  },
172
- "viewport": { "$ref": "#/$defs/viewportMetrics" }
382
+ "viewport": {
383
+ "$ref": "#/$defs/viewportMetrics"
384
+ }
173
385
  }
174
386
  },
175
387
  "markerRect": {
@@ -177,10 +389,26 @@
177
389
  "additionalProperties": false,
178
390
  "required": ["x", "y", "width", "height"],
179
391
  "properties": {
180
- "x": { "type": "number", "minimum": -100000000, "maximum": 100000000 },
181
- "y": { "type": "number", "minimum": -100000000, "maximum": 100000000 },
182
- "width": { "type": "number", "minimum": 0, "maximum": 100000000 },
183
- "height": { "type": "number", "minimum": 0, "maximum": 100000000 }
392
+ "x": {
393
+ "type": "number",
394
+ "minimum": -100000000,
395
+ "maximum": 100000000
396
+ },
397
+ "y": {
398
+ "type": "number",
399
+ "minimum": -100000000,
400
+ "maximum": 100000000
401
+ },
402
+ "width": {
403
+ "type": "number",
404
+ "minimum": 0,
405
+ "maximum": 100000000
406
+ },
407
+ "height": {
408
+ "type": "number",
409
+ "minimum": 0,
410
+ "maximum": 100000000
411
+ }
184
412
  }
185
413
  },
186
414
  "viewportMetrics": {
@@ -188,11 +416,31 @@
188
416
  "additionalProperties": false,
189
417
  "required": ["width", "height", "scrollX", "scrollY", "devicePixelRatio"],
190
418
  "properties": {
191
- "width": { "type": "number", "minimum": 0, "maximum": 100000000 },
192
- "height": { "type": "number", "minimum": 0, "maximum": 100000000 },
193
- "scrollX": { "type": "number", "minimum": -100000000, "maximum": 100000000 },
194
- "scrollY": { "type": "number", "minimum": -100000000, "maximum": 100000000 },
195
- "devicePixelRatio": { "type": "number", "exclusiveMinimum": 0, "maximum": 100 }
419
+ "width": {
420
+ "type": "number",
421
+ "minimum": 0,
422
+ "maximum": 100000000
423
+ },
424
+ "height": {
425
+ "type": "number",
426
+ "minimum": 0,
427
+ "maximum": 100000000
428
+ },
429
+ "scrollX": {
430
+ "type": "number",
431
+ "minimum": -100000000,
432
+ "maximum": 100000000
433
+ },
434
+ "scrollY": {
435
+ "type": "number",
436
+ "minimum": -100000000,
437
+ "maximum": 100000000
438
+ },
439
+ "devicePixelRatio": {
440
+ "type": "number",
441
+ "exclusiveMinimum": 0,
442
+ "maximum": 100
443
+ }
196
444
  }
197
445
  },
198
446
  "error": {
@@ -200,10 +448,18 @@
200
448
  "additionalProperties": false,
201
449
  "required": ["code", "message", "retryable"],
202
450
  "properties": {
203
- "code": { "$ref": "common.schema.json#/$defs/qualifiedName" },
204
- "message": { "$ref": "common.schema.json#/$defs/messageReference" },
205
- "retryable": { "type": "boolean" },
206
- "correlationId": { "$ref": "common.schema.json#/$defs/stableId" }
451
+ "code": {
452
+ "$ref": "common.schema.json#/$defs/qualifiedName"
453
+ },
454
+ "message": {
455
+ "$ref": "common.schema.json#/$defs/messageReference"
456
+ },
457
+ "retryable": {
458
+ "type": "boolean"
459
+ },
460
+ "correlationId": {
461
+ "$ref": "common.schema.json#/$defs/stableId"
462
+ }
207
463
  }
208
464
  },
209
465
  "reload": {
@@ -211,7 +467,9 @@
211
467
  "additionalProperties": false,
212
468
  "required": ["reason"],
213
469
  "properties": {
214
- "reason": { "$ref": "common.schema.json#/$defs/qualifiedName" }
470
+ "reason": {
471
+ "$ref": "common.schema.json#/$defs/qualifiedName"
472
+ }
215
473
  }
216
474
  },
217
475
  "teardown": {
@@ -219,7 +477,74 @@
219
477
  "additionalProperties": false,
220
478
  "required": ["reason"],
221
479
  "properties": {
222
- "reason": { "$ref": "common.schema.json#/$defs/qualifiedName" }
480
+ "reason": {
481
+ "$ref": "common.schema.json#/$defs/qualifiedName"
482
+ }
483
+ }
484
+ },
485
+ "activated": {
486
+ "type": "object",
487
+ "additionalProperties": false,
488
+ "required": ["interaction", "marker"],
489
+ "properties": {
490
+ "interaction": {
491
+ "description": "How the author reached the region. The renderer reports intent, never raw input events.",
492
+ "enum": ["activate", "context-menu", "focus"]
493
+ },
494
+ "marker": {
495
+ "description": "The opaque marker the renderer associated with the region. It carries nothing beyond the node identity the render already published.",
496
+ "$ref": "common.schema.json#/$defs/stableId"
497
+ }
498
+ }
499
+ },
500
+ "viewport": {
501
+ "description": "A semantic viewport role and explicit dimensions are alternatives, never a merge. Each branch is closed, so a payload naming both matches neither.",
502
+ "oneOf": [
503
+ {
504
+ "type": "object",
505
+ "additionalProperties": false,
506
+ "required": ["viewport"],
507
+ "properties": {
508
+ "viewport": {
509
+ "$ref": "common.schema.json#/$defs/localName",
510
+ "description": "The theme-declared semantic viewport role to render at."
511
+ }
512
+ }
513
+ },
514
+ {
515
+ "type": "object",
516
+ "additionalProperties": false,
517
+ "minProperties": 1,
518
+ "properties": {
519
+ "height": {
520
+ "description": "Bounded CSS-pixel height.",
521
+ "type": "integer",
522
+ "minimum": 120,
523
+ "maximum": 10000
524
+ },
525
+ "width": {
526
+ "description": "Bounded CSS-pixel width.",
527
+ "type": "integer",
528
+ "minimum": 240,
529
+ "maximum": 10000
530
+ }
531
+ }
532
+ }
533
+ ]
534
+ },
535
+ "dispose": {
536
+ "type": "object",
537
+ "additionalProperties": false,
538
+ "required": ["reason"],
539
+ "properties": {
540
+ "draftDigest": {
541
+ "description": "Revoke only the resources held for this render. Absent revokes every draft resource the renderer holds.",
542
+ "type": "string",
543
+ "pattern": "^[0-9a-f]{64}(?![\\s\\S])"
544
+ },
545
+ "reason": {
546
+ "$ref": "common.schema.json#/$defs/qualifiedName"
547
+ }
223
548
  }
224
549
  }
225
550
  }