@openship/protocol 0.0.3 → 0.1.1

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.
@@ -1,118 +1,615 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://openship.dev/schemas/systems.schema.json",
4
- "title": "OpenShip Systems v1",
4
+ "title": "OpenShip Systems 2.0",
5
5
  "type": "object",
6
- "required": ["openship", "capability", "source", "system"],
6
+ "required": [
7
+ "openship",
8
+ "capability",
9
+ "source",
10
+ "system",
11
+ "systemsVersion"
12
+ ],
7
13
  "properties": {
8
- "openship": { "const": "1.0" },
9
- "capability": { "const": "systems" },
14
+ "openship": {
15
+ "const": "1.0"
16
+ },
17
+ "capability": {
18
+ "const": "systems"
19
+ },
10
20
  "source": {
11
21
  "type": "object",
12
- "required": ["manifest", "bundle"],
22
+ "required": [
23
+ "manifest",
24
+ "bundle"
25
+ ],
13
26
  "properties": {
14
- "manifest": { "$ref": "sources-manifest.schema.json" },
15
- "bundle": { "$ref": "sources-bundle.schema.json" }
27
+ "manifest": {
28
+ "$ref": "sources-manifest.schema.json"
29
+ },
30
+ "bundle": {
31
+ "$ref": "sources-bundle.schema.json"
32
+ }
16
33
  },
17
34
  "additionalProperties": true
18
35
  },
19
36
  "system": {
20
37
  "type": "object",
21
- "required": ["id", "name", "rootNodeId", "nodes", "edges"],
38
+ "required": [
39
+ "id",
40
+ "name",
41
+ "layers",
42
+ "refinements"
43
+ ],
22
44
  "properties": {
23
- "id": { "$ref": "#/$defs/id" },
24
- "name": { "type": "string", "minLength": 1 },
25
- "rootNodeId": { "$ref": "#/$defs/id" },
26
- "metadata": { "type": "object", "additionalProperties": true },
27
- "nodes": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/node" } },
28
- "edges": { "type": "array", "items": { "$ref": "#/$defs/edge" } },
29
- "context": { "$ref": "#/$defs/context" }
45
+ "id": {
46
+ "$ref": "#/$defs/id"
47
+ },
48
+ "name": {
49
+ "type": "string",
50
+ "minLength": 1
51
+ },
52
+ "metadata": {
53
+ "type": "object",
54
+ "additionalProperties": true
55
+ },
56
+ "context": {
57
+ "$ref": "#/$defs/context"
58
+ },
59
+ "layers": {
60
+ "type": "array",
61
+ "minItems": 1,
62
+ "items": {
63
+ "$ref": "#/$defs/layer"
64
+ }
65
+ },
66
+ "refinements": {
67
+ "type": "array",
68
+ "items": {
69
+ "$ref": "#/$defs/refinement"
70
+ }
71
+ },
72
+ "instances": {
73
+ "type": "array",
74
+ "items": {
75
+ "$ref": "#/$defs/instance"
76
+ }
77
+ },
78
+ "nodes": false,
79
+ "edges": false,
80
+ "rootNodeId": false,
81
+ "domains": {
82
+ "type": "array",
83
+ "items": {
84
+ "$ref": "#/$defs/domain"
85
+ }
86
+ }
30
87
  },
31
88
  "additionalProperties": true
89
+ },
90
+ "systemsVersion": {
91
+ "const": "2.0"
32
92
  }
33
93
  },
34
94
  "$defs": {
35
- "id": { "type": "string", "pattern": "^[A-Za-z0-9._:-]+$" },
36
- "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
37
- "ownership": { "enum": ["first_party", "third_party"] },
95
+ "id": {
96
+ "type": "string",
97
+ "pattern": "^[A-Za-z0-9._:-]+$"
98
+ },
99
+ "digest": {
100
+ "type": "string",
101
+ "pattern": "^sha256:[0-9a-f]{64}$"
102
+ },
103
+ "ownership": {
104
+ "enum": [
105
+ "first_party",
106
+ "third_party"
107
+ ]
108
+ },
38
109
  "node": {
39
110
  "type": "object",
40
- "required": ["id", "kind", "name", "metadata"],
111
+ "required": [
112
+ "id",
113
+ "kind",
114
+ "name",
115
+ "metadata"
116
+ ],
41
117
  "properties": {
42
- "id": { "$ref": "#/$defs/id" },
43
- "kind": { "enum": ["Root", "Host", "Container", "Process", "Library"] },
44
- "name": { "type": "string", "minLength": 1 },
45
- "parentId": { "$ref": "#/$defs/id" },
46
- "sourceSelectors": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
118
+ "id": {
119
+ "$ref": "#/$defs/id"
120
+ },
121
+ "kind": {
122
+ "enum": [
123
+ "Root",
124
+ "Host",
125
+ "Container",
126
+ "Process",
127
+ "Library",
128
+ "Block",
129
+ "Store"
130
+ ]
131
+ },
132
+ "name": {
133
+ "type": "string",
134
+ "minLength": 1
135
+ },
136
+ "parentId": {
137
+ "$ref": "#/$defs/id"
138
+ },
139
+ "sourceSelectors": {
140
+ "type": "array",
141
+ "items": {
142
+ "type": "string",
143
+ "minLength": 1
144
+ },
145
+ "uniqueItems": true
146
+ },
47
147
  "metadata": {
48
148
  "type": "object",
49
- "required": ["ownership"],
149
+ "required": [
150
+ "ownership"
151
+ ],
50
152
  "properties": {
51
- "ownership": { "$ref": "#/$defs/ownership" }
153
+ "ownership": {
154
+ "$ref": "#/$defs/ownership"
155
+ }
52
156
  },
53
157
  "additionalProperties": true
158
+ },
159
+ "configuration": {
160
+ "$ref": "#/$defs/configuration"
54
161
  }
55
162
  },
56
163
  "additionalProperties": true
57
164
  },
58
165
  "edge": {
59
166
  "type": "object",
60
- "required": ["id", "type", "fromNodeId", "toNodeId"],
167
+ "required": [
168
+ "id",
169
+ "type",
170
+ "fromNodeId",
171
+ "toNodeId"
172
+ ],
61
173
  "properties": {
62
- "id": { "$ref": "#/$defs/id" },
63
- "type": { "enum": ["Runtime", "Dataflow", "Dependency"] },
64
- "fromNodeId": { "$ref": "#/$defs/id" },
65
- "toNodeId": { "$ref": "#/$defs/id" },
66
- "metadata": { "type": "object", "additionalProperties": true }
174
+ "id": {
175
+ "$ref": "#/$defs/id"
176
+ },
177
+ "type": {
178
+ "enum": [
179
+ "Runtime",
180
+ "Dataflow",
181
+ "Dependency"
182
+ ]
183
+ },
184
+ "fromNodeId": {
185
+ "$ref": "#/$defs/id"
186
+ },
187
+ "toNodeId": {
188
+ "$ref": "#/$defs/id"
189
+ },
190
+ "metadata": {
191
+ "type": "object",
192
+ "additionalProperties": true
193
+ }
67
194
  },
68
195
  "additionalProperties": true
69
196
  },
70
197
  "document": {
71
198
  "type": "object",
72
- "required": ["kind", "hash", "title", "language", "text"],
199
+ "required": [
200
+ "kind",
201
+ "hash",
202
+ "title",
203
+ "language",
204
+ "text"
205
+ ],
73
206
  "properties": {
74
- "kind": { "enum": ["Document", "Skill", "Prompt"] },
75
- "hash": { "$ref": "#/$defs/digest" },
76
- "title": { "type": "string", "minLength": 1 },
77
- "language": { "type": "string", "minLength": 1 },
78
- "text": { "type": "string" },
79
- "supersedes": { "$ref": "#/$defs/digest" }
207
+ "kind": {
208
+ "enum": [
209
+ "Document",
210
+ "Skill",
211
+ "Prompt"
212
+ ]
213
+ },
214
+ "hash": {
215
+ "$ref": "#/$defs/digest"
216
+ },
217
+ "title": {
218
+ "type": "string",
219
+ "minLength": 1
220
+ },
221
+ "language": {
222
+ "type": "string",
223
+ "minLength": 1
224
+ },
225
+ "text": {
226
+ "type": "string"
227
+ },
228
+ "supersedes": {
229
+ "$ref": "#/$defs/digest"
230
+ }
80
231
  },
81
232
  "additionalProperties": true
82
233
  },
83
234
  "matrix": {
84
235
  "type": "object",
85
- "required": ["nodeId", "concern"],
236
+ "required": [
237
+ "nodeId",
238
+ "concern"
239
+ ],
86
240
  "properties": {
87
- "nodeId": { "$ref": "#/$defs/id" },
88
- "concern": { "type": "string", "minLength": 1 },
89
- "documentRefs": { "type": "array", "items": { "$ref": "#/$defs/digest" }, "uniqueItems": true },
90
- "skillRefs": { "type": "array", "items": { "$ref": "#/$defs/digest" }, "uniqueItems": true }
241
+ "nodeId": {
242
+ "$ref": "#/$defs/id"
243
+ },
244
+ "concern": {
245
+ "type": "string",
246
+ "minLength": 1
247
+ },
248
+ "documentRefs": {
249
+ "type": "array",
250
+ "items": {
251
+ "$ref": "#/$defs/digest"
252
+ },
253
+ "uniqueItems": true
254
+ },
255
+ "skillRefs": {
256
+ "type": "array",
257
+ "items": {
258
+ "$ref": "#/$defs/digest"
259
+ },
260
+ "uniqueItems": true
261
+ }
91
262
  },
92
263
  "additionalProperties": true
93
264
  },
94
265
  "artifact": {
95
266
  "type": "object",
96
- "required": ["id", "nodeId", "concern", "type"],
267
+ "required": [
268
+ "id",
269
+ "nodeId",
270
+ "concern",
271
+ "type"
272
+ ],
97
273
  "properties": {
98
- "id": { "$ref": "#/$defs/id" },
99
- "nodeId": { "$ref": "#/$defs/id" },
100
- "concern": { "type": "string", "minLength": 1 },
101
- "type": { "enum": ["Summary", "Docs", "Code"] },
102
- "language": { "type": "string" },
103
- "text": { "type": "string" },
104
- "sourcePaths": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }
274
+ "id": {
275
+ "$ref": "#/$defs/id"
276
+ },
277
+ "nodeId": {
278
+ "$ref": "#/$defs/id"
279
+ },
280
+ "concern": {
281
+ "type": "string",
282
+ "minLength": 1
283
+ },
284
+ "type": {
285
+ "enum": [
286
+ "Summary",
287
+ "Docs",
288
+ "Code"
289
+ ]
290
+ },
291
+ "language": {
292
+ "type": "string"
293
+ },
294
+ "text": {
295
+ "type": "string"
296
+ },
297
+ "sourcePaths": {
298
+ "type": "array",
299
+ "items": {
300
+ "type": "string"
301
+ },
302
+ "uniqueItems": true
303
+ }
105
304
  },
106
305
  "additionalProperties": true
107
306
  },
108
307
  "context": {
109
308
  "type": "object",
110
309
  "properties": {
111
- "concerns": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
112
- "documents": { "type": "array", "items": { "$ref": "#/$defs/document" } },
113
- "matrix": { "type": "array", "items": { "$ref": "#/$defs/matrix" } },
114
- "systemPromptRefs": { "type": "array", "items": { "$ref": "#/$defs/digest" }, "uniqueItems": true },
115
- "artifacts": { "type": "array", "items": { "$ref": "#/$defs/artifact" } }
310
+ "concerns": {
311
+ "type": "array",
312
+ "items": {
313
+ "type": "string",
314
+ "minLength": 1
315
+ },
316
+ "uniqueItems": true
317
+ },
318
+ "documents": {
319
+ "type": "array",
320
+ "items": {
321
+ "$ref": "#/$defs/document"
322
+ }
323
+ },
324
+ "matrix": {
325
+ "type": "array",
326
+ "items": {
327
+ "$ref": "#/$defs/matrix"
328
+ }
329
+ },
330
+ "systemPromptRefs": {
331
+ "type": "array",
332
+ "items": {
333
+ "$ref": "#/$defs/digest"
334
+ },
335
+ "uniqueItems": true
336
+ },
337
+ "artifacts": {
338
+ "type": "array",
339
+ "items": {
340
+ "$ref": "#/$defs/artifact"
341
+ }
342
+ }
343
+ },
344
+ "additionalProperties": true
345
+ },
346
+ "layer": {
347
+ "type": "object",
348
+ "required": [
349
+ "rootNodeId",
350
+ "nodes",
351
+ "edges",
352
+ "id",
353
+ "name",
354
+ "role"
355
+ ],
356
+ "properties": {
357
+ "rootNodeId": {
358
+ "$ref": "#/$defs/id"
359
+ },
360
+ "nodes": {
361
+ "type": "array",
362
+ "minItems": 1,
363
+ "items": {
364
+ "$ref": "#/$defs/node"
365
+ }
366
+ },
367
+ "edges": {
368
+ "type": "array",
369
+ "items": {
370
+ "$ref": "#/$defs/edge"
371
+ }
372
+ },
373
+ "id": {
374
+ "$ref": "#/$defs/id"
375
+ },
376
+ "name": {
377
+ "type": "string",
378
+ "minLength": 1
379
+ },
380
+ "role": {
381
+ "enum": [
382
+ "logical",
383
+ "technical",
384
+ "provider",
385
+ "custom"
386
+ ]
387
+ }
388
+ },
389
+ "additionalProperties": true
390
+ },
391
+ "configuration": {
392
+ "type": "array",
393
+ "items": {
394
+ "type": "object",
395
+ "required": [
396
+ "name",
397
+ "description",
398
+ "required"
399
+ ],
400
+ "properties": {
401
+ "name": {
402
+ "type": "string",
403
+ "minLength": 1
404
+ },
405
+ "description": {
406
+ "type": "string",
407
+ "minLength": 1
408
+ },
409
+ "required": {
410
+ "type": "boolean"
411
+ },
412
+ "sensitive": {
413
+ "type": "boolean"
414
+ },
415
+ "value": {},
416
+ "secretRef": {
417
+ "type": "object",
418
+ "required": [
419
+ "nodeId",
420
+ "key"
421
+ ],
422
+ "properties": {
423
+ "nodeId": {
424
+ "$ref": "#/$defs/id"
425
+ },
426
+ "key": {
427
+ "type": "string",
428
+ "minLength": 1
429
+ }
430
+ },
431
+ "additionalProperties": true
432
+ }
433
+ },
434
+ "allOf": [
435
+ {
436
+ "if": {
437
+ "required": [
438
+ "sensitive"
439
+ ],
440
+ "properties": {
441
+ "sensitive": {
442
+ "const": true
443
+ }
444
+ }
445
+ },
446
+ "then": {
447
+ "not": {
448
+ "required": [
449
+ "value"
450
+ ],
451
+ "properties": {
452
+ "value": {}
453
+ }
454
+ }
455
+ }
456
+ },
457
+ {
458
+ "if": {
459
+ "required": [
460
+ "secretRef"
461
+ ],
462
+ "properties": {
463
+ "secretRef": {}
464
+ }
465
+ },
466
+ "then": {
467
+ "not": {
468
+ "required": [
469
+ "value"
470
+ ],
471
+ "properties": {
472
+ "value": {}
473
+ }
474
+ }
475
+ }
476
+ }
477
+ ],
478
+ "additionalProperties": true
479
+ }
480
+ },
481
+ "refinement": {
482
+ "type": "object",
483
+ "required": [
484
+ "id",
485
+ "fromNodeId",
486
+ "toNodeId"
487
+ ],
488
+ "properties": {
489
+ "id": {
490
+ "$ref": "#/$defs/id"
491
+ },
492
+ "fromNodeId": {
493
+ "$ref": "#/$defs/id"
494
+ },
495
+ "toNodeId": {
496
+ "$ref": "#/$defs/id"
497
+ }
498
+ },
499
+ "additionalProperties": true
500
+ },
501
+ "state": {
502
+ "type": "object",
503
+ "properties": {
504
+ "appliedMigration": {
505
+ "type": "string",
506
+ "minLength": 1
507
+ },
508
+ "snapshot": {
509
+ "type": "object",
510
+ "required": [
511
+ "ref",
512
+ "capturedAt"
513
+ ],
514
+ "properties": {
515
+ "ref": {
516
+ "type": "string",
517
+ "minLength": 1
518
+ },
519
+ "capturedAt": {
520
+ "type": "string",
521
+ "format": "date-time"
522
+ },
523
+ "digest": {
524
+ "$ref": "#/$defs/digest"
525
+ }
526
+ },
527
+ "additionalProperties": true
528
+ }
529
+ },
530
+ "additionalProperties": true
531
+ },
532
+ "binding": {
533
+ "type": "object",
534
+ "required": [
535
+ "nodeId"
536
+ ],
537
+ "properties": {
538
+ "nodeId": {
539
+ "$ref": "#/$defs/id"
540
+ },
541
+ "resourceId": {
542
+ "type": "string",
543
+ "minLength": 1
544
+ },
545
+ "configuration": {
546
+ "$ref": "#/$defs/configuration"
547
+ },
548
+ "state": {
549
+ "$ref": "#/$defs/state"
550
+ }
551
+ },
552
+ "additionalProperties": true
553
+ },
554
+ "instance": {
555
+ "type": "object",
556
+ "required": [
557
+ "id",
558
+ "name",
559
+ "environment",
560
+ "layerId",
561
+ "bindings"
562
+ ],
563
+ "properties": {
564
+ "id": {
565
+ "$ref": "#/$defs/id"
566
+ },
567
+ "name": {
568
+ "type": "string",
569
+ "minLength": 1
570
+ },
571
+ "environment": {
572
+ "type": "string",
573
+ "minLength": 1
574
+ },
575
+ "layerId": {
576
+ "$ref": "#/$defs/id"
577
+ },
578
+ "bindings": {
579
+ "type": "array",
580
+ "items": {
581
+ "$ref": "#/$defs/binding"
582
+ }
583
+ }
584
+ },
585
+ "additionalProperties": true
586
+ },
587
+ "domain": {
588
+ "type": "object",
589
+ "required": [
590
+ "id",
591
+ "name",
592
+ "nodeIds"
593
+ ],
594
+ "properties": {
595
+ "id": {
596
+ "$ref": "#/$defs/id"
597
+ },
598
+ "name": {
599
+ "type": "string",
600
+ "minLength": 1
601
+ },
602
+ "description": {
603
+ "type": "string",
604
+ "minLength": 1
605
+ },
606
+ "nodeIds": {
607
+ "type": "array",
608
+ "items": {
609
+ "$ref": "#/$defs/id"
610
+ },
611
+ "uniqueItems": true
612
+ }
116
613
  },
117
614
  "additionalProperties": true
118
615
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openship/protocol",
3
- "version": "0.0.3",
3
+ "version": "0.1.1",
4
4
  "description": "Canonical OpenShip 1.0 types, validators, consumer helpers, schemas, and skill assets.",
5
5
  "type": "module",
6
6
  "license": "MIT",