@openplanr/protocol 0.13.0 → 0.15.0

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 (34) hide show
  1. package/README.md +23 -0
  2. package/package.json +6 -2
  3. package/registries/commands.json +12 -12
  4. package/registries/roles.json +43 -133
  5. package/registries/skills.json +14 -14
  6. package/registries/task-kinds.json +2 -2
  7. package/schemas/v1.20.0/design-document.schema.json +379 -0
  8. package/schemas/v1.20.0/design-review-bundle.schema.json +692 -0
  9. package/schemas/v1.21.0/diagram-authoring-bundle.schema.json +1609 -0
  10. package/schemas/v1.21.0/diagram-edit-transaction.schema.json +4369 -0
  11. package/schemas/v1.21.0/diagram-review-bundle.schema.json +4047 -0
  12. package/schemas/v1.21.0/diagram-shape-definition.schema.json +457 -0
  13. package/schemas/v1.22.0/design-document.schema.json +506 -0
  14. package/schemas/v1.22.0/design-review-bundle.schema.json +822 -0
  15. package/schemas/v1.5.0/role-registry.schema.json +4 -1
  16. package/src/browser-contracts.d.mts +5 -1
  17. package/src/browser-contracts.mjs +27 -0
  18. package/src/contracts.mjs +39 -6
  19. package/src/design-contracts.d.mts +40 -2
  20. package/src/design-contracts.mjs +258 -17
  21. package/src/design-publication-contracts.mjs +3 -1
  22. package/src/diagram-authoring-contracts.d.mts +2 -0
  23. package/src/generated/canonical-registries.mjs +71 -161
  24. package/src/index.d.mts +7 -0
  25. package/src/index.mjs +7 -0
  26. package/src/json-schema.mjs +4 -0
  27. package/src/registries.mjs +20 -4
  28. package/src/review-experience-contracts.d.mts +2 -0
  29. package/src/review-experience-contracts.mjs +77 -5
  30. package/src/shape-library-contracts.d.mts +57 -0
  31. package/src/shape-library-contracts.mjs +266 -0
  32. package/src/studio-presentation-contracts.d.mts +50 -2
  33. package/src/studio-presentation-contracts.mjs +285 -4
  34. package/src/workspace-contracts.mjs +3 -3
@@ -0,0 +1,379 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://openplanr.dev/schemas/v1.20.0/design-document.schema.json",
4
+ "x-openplanr-contract": {
5
+ "id": "design-document",
6
+ "version": "1.20.0"
7
+ },
8
+ "title": "OpenPlanr authored design document",
9
+ "type": "object",
10
+ "additionalProperties": false,
11
+ "required": [
12
+ "kind",
13
+ "schemaVersion",
14
+ "id",
15
+ "title",
16
+ "brief",
17
+ "frames",
18
+ "screens",
19
+ "screenOrder",
20
+ "variants",
21
+ "selectedVariant",
22
+ "defaultView"
23
+ ],
24
+ "properties": {
25
+ "kind": {
26
+ "const": "openplanr-design-document"
27
+ },
28
+ "schemaVersion": {
29
+ "const": "1.0.0"
30
+ },
31
+ "id": {
32
+ "$ref": "#/$defs/id"
33
+ },
34
+ "title": {
35
+ "$ref": "#/$defs/text"
36
+ },
37
+ "brief": {
38
+ "type": "object",
39
+ "additionalProperties": false,
40
+ "required": [
41
+ "text",
42
+ "source",
43
+ "provenance"
44
+ ],
45
+ "properties": {
46
+ "text": {
47
+ "$ref": "#/$defs/text"
48
+ },
49
+ "source": {
50
+ "enum": [
51
+ "spec",
52
+ "png",
53
+ "describe"
54
+ ]
55
+ },
56
+ "provenance": {
57
+ "enum": [
58
+ "spec",
59
+ "inferred"
60
+ ]
61
+ },
62
+ "references": {
63
+ "type": "array",
64
+ "items": {
65
+ "$ref": "#/$defs/text"
66
+ },
67
+ "uniqueItems": true
68
+ }
69
+ }
70
+ },
71
+ "designSystem": {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "properties": {
75
+ "path": {
76
+ "$ref": "#/$defs/localPath"
77
+ },
78
+ "tokens": {
79
+ "$ref": "#/$defs/localPath"
80
+ },
81
+ "spacing": {
82
+ "type": "array",
83
+ "minItems": 1,
84
+ "uniqueItems": true,
85
+ "items": {
86
+ "type": "number",
87
+ "minimum": 0,
88
+ "maximum": 16384
89
+ }
90
+ }
91
+ }
92
+ },
93
+ "assets": {
94
+ "$ref": "#/$defs/paths"
95
+ },
96
+ "frames": {
97
+ "type": "array",
98
+ "minItems": 1,
99
+ "items": {
100
+ "type": "object",
101
+ "additionalProperties": false,
102
+ "required": [
103
+ "id",
104
+ "label",
105
+ "width",
106
+ "height"
107
+ ],
108
+ "properties": {
109
+ "id": {
110
+ "$ref": "#/$defs/id"
111
+ },
112
+ "label": {
113
+ "$ref": "#/$defs/text"
114
+ },
115
+ "width": {
116
+ "type": "integer",
117
+ "minimum": 1,
118
+ "maximum": 16384
119
+ },
120
+ "height": {
121
+ "anyOf": [
122
+ {
123
+ "type": "integer",
124
+ "minimum": 1,
125
+ "maximum": 16384
126
+ },
127
+ {
128
+ "const": "auto"
129
+ }
130
+ ]
131
+ }
132
+ }
133
+ }
134
+ },
135
+ "screens": {
136
+ "type": "array",
137
+ "minItems": 1,
138
+ "items": {
139
+ "type": "object",
140
+ "additionalProperties": false,
141
+ "required": [
142
+ "id",
143
+ "title",
144
+ "source"
145
+ ],
146
+ "properties": {
147
+ "id": {
148
+ "$ref": "#/$defs/id"
149
+ },
150
+ "title": {
151
+ "$ref": "#/$defs/text"
152
+ },
153
+ "description": {
154
+ "$ref": "#/$defs/text"
155
+ },
156
+ "source": {
157
+ "$ref": "#/$defs/source"
158
+ },
159
+ "anchors": {
160
+ "$ref": "#/$defs/ids"
161
+ }
162
+ }
163
+ }
164
+ },
165
+ "screenOrder": {
166
+ "type": "array",
167
+ "minItems": 1,
168
+ "items": {
169
+ "$ref": "#/$defs/id"
170
+ },
171
+ "uniqueItems": true
172
+ },
173
+ "flows": {
174
+ "type": "array",
175
+ "items": {
176
+ "type": "object",
177
+ "additionalProperties": false,
178
+ "required": [
179
+ "id",
180
+ "title",
181
+ "screens"
182
+ ],
183
+ "properties": {
184
+ "id": {
185
+ "$ref": "#/$defs/id"
186
+ },
187
+ "title": {
188
+ "$ref": "#/$defs/text"
189
+ },
190
+ "screens": {
191
+ "type": "array",
192
+ "minItems": 1,
193
+ "items": {
194
+ "$ref": "#/$defs/id"
195
+ }
196
+ }
197
+ }
198
+ }
199
+ },
200
+ "variants": {
201
+ "type": "array",
202
+ "minItems": 1,
203
+ "items": {
204
+ "type": "object",
205
+ "additionalProperties": false,
206
+ "required": [
207
+ "id",
208
+ "label",
209
+ "status"
210
+ ],
211
+ "properties": {
212
+ "id": {
213
+ "$ref": "#/$defs/id"
214
+ },
215
+ "label": {
216
+ "$ref": "#/$defs/text"
217
+ },
218
+ "description": {
219
+ "$ref": "#/$defs/text"
220
+ },
221
+ "status": {
222
+ "enum": [
223
+ "ready",
224
+ "failed"
225
+ ]
226
+ },
227
+ "issue": {
228
+ "$ref": "#/$defs/text"
229
+ },
230
+ "sources": {
231
+ "type": "object",
232
+ "additionalProperties": {
233
+ "$ref": "#/$defs/source"
234
+ }
235
+ }
236
+ },
237
+ "if": {
238
+ "properties": {
239
+ "status": {
240
+ "const": "failed"
241
+ }
242
+ }
243
+ },
244
+ "then": {
245
+ "required": [
246
+ "issue"
247
+ ]
248
+ }
249
+ }
250
+ },
251
+ "selectedVariant": {
252
+ "$ref": "#/$defs/id"
253
+ },
254
+ "defaultView": {
255
+ "enum": [
256
+ "canvas",
257
+ "prototype",
258
+ "walkthrough"
259
+ ]
260
+ },
261
+ "layout": {
262
+ "type": "object",
263
+ "additionalProperties": false,
264
+ "properties": {
265
+ "boards": {
266
+ "type": "object",
267
+ "description": "Keys are screenId, screenId/frameId or screenId/frameId/variantId; each ID must exist in the document.",
268
+ "additionalProperties": {
269
+ "type": "object",
270
+ "additionalProperties": false,
271
+ "required": [
272
+ "x",
273
+ "y"
274
+ ],
275
+ "properties": {
276
+ "x": {
277
+ "$ref": "#/$defs/coordinate"
278
+ },
279
+ "y": {
280
+ "$ref": "#/$defs/coordinate"
281
+ },
282
+ "title": {
283
+ "$ref": "#/$defs/text"
284
+ }
285
+ }
286
+ }
287
+ },
288
+ "sections": {
289
+ "type": "array",
290
+ "items": {
291
+ "type": "object",
292
+ "additionalProperties": false,
293
+ "required": [
294
+ "id",
295
+ "x",
296
+ "y",
297
+ "text"
298
+ ],
299
+ "properties": {
300
+ "id": {
301
+ "$ref": "#/$defs/id"
302
+ },
303
+ "x": {
304
+ "$ref": "#/$defs/coordinate"
305
+ },
306
+ "y": {
307
+ "$ref": "#/$defs/coordinate"
308
+ },
309
+ "text": {
310
+ "$ref": "#/$defs/text"
311
+ },
312
+ "maxW": {
313
+ "type": "integer",
314
+ "minimum": 1,
315
+ "maximum": 16384
316
+ }
317
+ }
318
+ }
319
+ }
320
+ }
321
+ }
322
+ },
323
+ "$defs": {
324
+ "id": {
325
+ "type": "string",
326
+ "minLength": 1,
327
+ "maxLength": 128,
328
+ "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
329
+ },
330
+ "text": {
331
+ "type": "string",
332
+ "minLength": 1,
333
+ "pattern": "\\S"
334
+ },
335
+ "ids": {
336
+ "type": "array",
337
+ "items": {
338
+ "$ref": "#/$defs/id"
339
+ },
340
+ "uniqueItems": true
341
+ },
342
+ "localPath": {
343
+ "type": "string",
344
+ "minLength": 1,
345
+ "description": "Path relative to the authored document directory. No URL, traversal, encoded path, query or fragment.",
346
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)(?!.*[/ ]$)[^\\\\:\\u0000-\\u001F%?#]+$"
347
+ },
348
+ "paths": {
349
+ "type": "array",
350
+ "items": {
351
+ "$ref": "#/$defs/localPath"
352
+ },
353
+ "uniqueItems": true
354
+ },
355
+ "source": {
356
+ "type": "object",
357
+ "additionalProperties": false,
358
+ "required": [
359
+ "html"
360
+ ],
361
+ "properties": {
362
+ "html": {
363
+ "$ref": "#/$defs/localPath"
364
+ },
365
+ "styles": {
366
+ "$ref": "#/$defs/paths"
367
+ },
368
+ "scripts": {
369
+ "$ref": "#/$defs/paths"
370
+ }
371
+ }
372
+ },
373
+ "coordinate": {
374
+ "type": "number",
375
+ "minimum": -10000000,
376
+ "maximum": 10000000
377
+ }
378
+ }
379
+ }