@ikenga/contract 0.18.1 → 0.19.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 (36) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/manifest.d.ts +1803 -37
  4. package/dist/manifest.d.ts.map +1 -1
  5. package/dist/manifest.js +125 -3
  6. package/dist/manifest.js.map +1 -1
  7. package/dist/ngwa.d.ts +2 -2
  8. package/dist/registry.d.ts +1307 -35
  9. package/dist/registry.d.ts.map +1 -1
  10. package/dist/window.d.ts +5 -5
  11. package/package.json +1 -1
  12. package/schemas/registry/pkg-detail-v1.json +532 -11
  13. package/src/__fixtures__/manifest-v5/README.md +23 -0
  14. package/src/__fixtures__/manifest-v5/alias/nav-only.json +16 -0
  15. package/src/__fixtures__/manifest-v5/invalid/companion-panel-missing-route.json +11 -0
  16. package/src/__fixtures__/manifest-v5/invalid/context-action-bad-run.json +16 -0
  17. package/src/__fixtures__/manifest-v5/invalid/context-selector-bad-kind.json +16 -0
  18. package/src/__fixtures__/manifest-v5/invalid/explorer-section-missing-data-route.json +11 -0
  19. package/src/__fixtures__/manifest-v5/invalid/side-pane-viewers-empty.json +9 -0
  20. package/src/__fixtures__/manifest-v5/invalid/side-pane-viewers.json +14 -0
  21. package/src/__fixtures__/manifest-v5/invalid/view-route-no-routes.json +11 -0
  22. package/src/__fixtures__/manifest-v5/invalid/view-route-undeclared.json +15 -0
  23. package/src/__fixtures__/manifest-v5/invalid/view-unknown-field.json +14 -0
  24. package/src/__fixtures__/manifest-v5/invalid/widget-bad-span.json +14 -0
  25. package/src/__fixtures__/manifest-v5/valid/companion-panels.json +26 -0
  26. package/src/__fixtures__/manifest-v5/valid/context-actions.json +41 -0
  27. package/src/__fixtures__/manifest-v5/valid/explorer-sections.json +31 -0
  28. package/src/__fixtures__/manifest-v5/valid/full.json +42 -0
  29. package/src/__fixtures__/manifest-v5/valid/minimal.json +6 -0
  30. package/src/__fixtures__/manifest-v5/valid/nav-and-views.json +17 -0
  31. package/src/__fixtures__/manifest-v5/valid/v4-manifest.json +20 -0
  32. package/src/__fixtures__/manifest-v5/valid/views.json +26 -0
  33. package/src/__fixtures__/manifest-v5/valid/widgets.json +18 -0
  34. package/src/index.ts +1 -1
  35. package/src/manifest.test.ts +350 -2
  36. package/src/manifest.ts +143 -3
@@ -53,6 +53,23 @@
53
53
  "type": "string",
54
54
  "pattern": "^\\d+$"
55
55
  },
56
+ "auth_bridge": {
57
+ "type": "object",
58
+ "properties": {
59
+ "strategy": {
60
+ "type": "string",
61
+ "enum": [
62
+ "api-key",
63
+ "cdp",
64
+ "none"
65
+ ]
66
+ }
67
+ },
68
+ "required": [
69
+ "strategy"
70
+ ],
71
+ "additionalProperties": false
72
+ },
56
73
  "kind": {
57
74
  "type": "string"
58
75
  },
@@ -78,15 +95,6 @@
78
95
  },
79
96
  "default": []
80
97
  },
81
- "skills": {
82
- "type": "string"
83
- },
84
- "commands": {
85
- "type": "string"
86
- },
87
- "agents": {
88
- "type": "string"
89
- },
90
98
  "mcp": {
91
99
  "type": "array",
92
100
  "items": {
@@ -118,6 +126,17 @@
118
126
  "per-call",
119
127
  "long-lived"
120
128
  ]
129
+ },
130
+ "restart_when_changed": {
131
+ "type": "array",
132
+ "items": {
133
+ "type": "string"
134
+ },
135
+ "default": []
136
+ },
137
+ "auto_restart": {
138
+ "type": "boolean",
139
+ "default": true
121
140
  }
122
141
  },
123
142
  "required": [
@@ -142,6 +161,17 @@
142
161
  "stdio": {
143
162
  "type": "string",
144
163
  "default": "json"
164
+ },
165
+ "restart_when_changed": {
166
+ "type": "array",
167
+ "items": {
168
+ "type": "string"
169
+ },
170
+ "default": []
171
+ },
172
+ "auto_restart": {
173
+ "type": "boolean",
174
+ "default": true
145
175
  }
146
176
  },
147
177
  "required": [
@@ -183,6 +213,13 @@
183
213
  },
184
214
  "default": []
185
215
  },
216
+ "sqlite.tables": {
217
+ "type": "array",
218
+ "items": {
219
+ "type": "string"
220
+ },
221
+ "default": []
222
+ },
186
223
  "supabase.tables": {
187
224
  "type": "array",
188
225
  "items": {
@@ -196,6 +233,27 @@
196
233
  "type": "string"
197
234
  },
198
235
  "default": []
236
+ },
237
+ "engine": {
238
+ "type": "array",
239
+ "items": {
240
+ "type": "string"
241
+ },
242
+ "default": []
243
+ },
244
+ "notify": {
245
+ "type": "array",
246
+ "items": {
247
+ "type": "string"
248
+ },
249
+ "default": []
250
+ },
251
+ "events": {
252
+ "type": "array",
253
+ "items": {
254
+ "type": "string"
255
+ },
256
+ "default": []
199
257
  }
200
258
  },
201
259
  "additionalProperties": false,
@@ -230,6 +288,9 @@
230
288
  "default": {},
231
289
  "description": {
232
290
  "type": "string"
291
+ },
292
+ "env": {
293
+ "type": "string"
233
294
  }
234
295
  },
235
296
  "required": [
@@ -289,11 +350,15 @@
289
350
  "type": "string",
290
351
  "enum": [
291
352
  "iframe",
292
- "component"
353
+ "component",
354
+ "webview"
293
355
  ]
294
356
  },
295
357
  "source": {
296
358
  "type": "string"
359
+ },
360
+ "partition": {
361
+ "type": "string"
297
362
  }
298
363
  },
299
364
  "required": [
@@ -330,6 +395,9 @@
330
395
  "default": []
331
396
  },
332
397
  "side_pane_viewers": {
398
+ "not": {}
399
+ },
400
+ "views": {
333
401
  "type": "array",
334
402
  "items": {
335
403
  "type": "object",
@@ -337,16 +405,245 @@
337
405
  "id": {
338
406
  "type": "string"
339
407
  },
340
- "label": {
408
+ "title": {
409
+ "type": "string"
410
+ },
411
+ "icon": {
341
412
  "type": "string"
342
413
  },
343
414
  "route": {
344
415
  "type": "string"
416
+ },
417
+ "pin_on_install": {
418
+ "type": "boolean",
419
+ "default": false
420
+ }
421
+ },
422
+ "required": [
423
+ "id",
424
+ "title",
425
+ "route"
426
+ ],
427
+ "additionalProperties": false
428
+ },
429
+ "default": []
430
+ },
431
+ "explorer_sections": {
432
+ "type": "array",
433
+ "items": {
434
+ "type": "object",
435
+ "properties": {
436
+ "id": {
437
+ "type": "string"
438
+ },
439
+ "title": {
440
+ "type": "string"
441
+ },
442
+ "icon": {
443
+ "type": "string"
444
+ },
445
+ "order": {
446
+ "type": "integer"
447
+ },
448
+ "data_route": {
449
+ "type": "string"
450
+ }
451
+ },
452
+ "required": [
453
+ "id",
454
+ "title",
455
+ "data_route"
456
+ ],
457
+ "additionalProperties": false
458
+ },
459
+ "default": []
460
+ },
461
+ "companion_panels": {
462
+ "type": "array",
463
+ "items": {
464
+ "type": "object",
465
+ "properties": {
466
+ "id": {
467
+ "type": "string"
468
+ },
469
+ "title": {
470
+ "type": "string"
471
+ },
472
+ "icon": {
473
+ "type": "string"
474
+ },
475
+ "route": {
476
+ "type": "string"
477
+ },
478
+ "session_scoped": {
479
+ "type": "boolean",
480
+ "default": false
481
+ }
482
+ },
483
+ "required": [
484
+ "id",
485
+ "title",
486
+ "route"
487
+ ],
488
+ "additionalProperties": false
489
+ },
490
+ "default": []
491
+ },
492
+ "context_actions": {
493
+ "type": "array",
494
+ "items": {
495
+ "type": "object",
496
+ "properties": {
497
+ "id": {
498
+ "type": "string"
499
+ },
500
+ "label": {
501
+ "type": "string"
502
+ },
503
+ "when": {
504
+ "anyOf": [
505
+ {
506
+ "type": "object",
507
+ "properties": {
508
+ "kind": {
509
+ "type": "string",
510
+ "const": "file"
511
+ },
512
+ "glob": {
513
+ "type": "string"
514
+ }
515
+ },
516
+ "required": [
517
+ "kind"
518
+ ],
519
+ "additionalProperties": false
520
+ },
521
+ {
522
+ "type": "object",
523
+ "properties": {
524
+ "kind": {
525
+ "type": "string",
526
+ "const": "artifact"
527
+ }
528
+ },
529
+ "required": [
530
+ "kind"
531
+ ],
532
+ "additionalProperties": false
533
+ },
534
+ {
535
+ "type": "object",
536
+ "properties": {
537
+ "kind": {
538
+ "type": "string",
539
+ "const": "session"
540
+ }
541
+ },
542
+ "required": [
543
+ "kind"
544
+ ],
545
+ "additionalProperties": false
546
+ },
547
+ {
548
+ "type": "object",
549
+ "properties": {
550
+ "kind": {
551
+ "type": "string",
552
+ "const": "ngwa-item"
553
+ },
554
+ "kinds": {
555
+ "type": "array",
556
+ "items": {
557
+ "type": "string"
558
+ }
559
+ }
560
+ },
561
+ "required": [
562
+ "kind"
563
+ ],
564
+ "additionalProperties": false
565
+ }
566
+ ]
567
+ },
568
+ "run": {
569
+ "anyOf": [
570
+ {
571
+ "type": "object",
572
+ "properties": {
573
+ "kind": {
574
+ "type": "string",
575
+ "const": "dispatch"
576
+ },
577
+ "prompt": {
578
+ "type": "string"
579
+ },
580
+ "target": {
581
+ "type": "string"
582
+ }
583
+ },
584
+ "required": [
585
+ "kind",
586
+ "prompt"
587
+ ],
588
+ "additionalProperties": false
589
+ },
590
+ {
591
+ "type": "object",
592
+ "properties": {
593
+ "kind": {
594
+ "type": "string",
595
+ "const": "view"
596
+ },
597
+ "route": {
598
+ "type": "string"
599
+ }
600
+ },
601
+ "required": [
602
+ "kind",
603
+ "route"
604
+ ],
605
+ "additionalProperties": false
606
+ }
607
+ ]
345
608
  }
346
609
  },
347
610
  "required": [
348
611
  "id",
349
612
  "label",
613
+ "when",
614
+ "run"
615
+ ],
616
+ "additionalProperties": false
617
+ },
618
+ "default": []
619
+ },
620
+ "widgets": {
621
+ "type": "array",
622
+ "items": {
623
+ "type": "object",
624
+ "properties": {
625
+ "id": {
626
+ "type": "string"
627
+ },
628
+ "title": {
629
+ "type": "string"
630
+ },
631
+ "route": {
632
+ "type": "string"
633
+ },
634
+ "span": {
635
+ "type": "string",
636
+ "enum": [
637
+ "small",
638
+ "medium",
639
+ "wide"
640
+ ],
641
+ "default": "medium"
642
+ }
643
+ },
644
+ "required": [
645
+ "id",
646
+ "title",
350
647
  "route"
351
648
  ],
352
649
  "additionalProperties": false
@@ -370,6 +667,23 @@
370
667
  "type": "string"
371
668
  }
372
669
  }
670
+ },
671
+ "session": {
672
+ "type": "object",
673
+ "properties": {
674
+ "persistence": {
675
+ "type": "string",
676
+ "enum": [
677
+ "keep",
678
+ "clear-on-exit",
679
+ "ask"
680
+ ]
681
+ }
682
+ },
683
+ "required": [
684
+ "persistence"
685
+ ],
686
+ "additionalProperties": false
373
687
  }
374
688
  },
375
689
  "additionalProperties": false,
@@ -495,6 +809,139 @@
495
809
  },
496
810
  "additionalProperties": false
497
811
  },
812
+ "capabilities": {
813
+ "type": "object",
814
+ "properties": {
815
+ "supabase": {
816
+ "type": "object",
817
+ "properties": {
818
+ "required": {
819
+ "type": "boolean",
820
+ "default": false
821
+ }
822
+ },
823
+ "additionalProperties": false
824
+ },
825
+ "sqlite": {
826
+ "anyOf": [
827
+ {
828
+ "type": "boolean"
829
+ },
830
+ {
831
+ "type": "object",
832
+ "properties": {
833
+ "db": {
834
+ "type": "string",
835
+ "default": "ikenga.local"
836
+ }
837
+ },
838
+ "additionalProperties": false
839
+ }
840
+ ]
841
+ },
842
+ "webview": {
843
+ "type": "object",
844
+ "properties": {
845
+ "child_webviews": {
846
+ "type": "boolean",
847
+ "default": false
848
+ },
849
+ "partitions": {
850
+ "type": "array",
851
+ "items": {
852
+ "type": "string"
853
+ },
854
+ "default": []
855
+ },
856
+ "engines": {
857
+ "type": "array",
858
+ "items": {
859
+ "type": "string",
860
+ "enum": [
861
+ "webkit",
862
+ "chrome"
863
+ ]
864
+ },
865
+ "default": [
866
+ "webkit"
867
+ ]
868
+ },
869
+ "allowed_origins": {
870
+ "type": "array",
871
+ "items": {
872
+ "type": "string"
873
+ }
874
+ }
875
+ },
876
+ "additionalProperties": false
877
+ },
878
+ "agentOps": {
879
+ "type": "object",
880
+ "properties": {},
881
+ "additionalProperties": false
882
+ },
883
+ "http": {
884
+ "type": "object",
885
+ "properties": {
886
+ "auth_secret": {
887
+ "type": "string"
888
+ },
889
+ "auth_header": {
890
+ "type": "string",
891
+ "default": "Authorization"
892
+ }
893
+ },
894
+ "additionalProperties": false
895
+ },
896
+ "secrets": {
897
+ "type": "object",
898
+ "properties": {
899
+ "declarations": {
900
+ "type": "array",
901
+ "items": {
902
+ "type": "object",
903
+ "properties": {
904
+ "name": {
905
+ "type": "string"
906
+ },
907
+ "vault_key": {
908
+ "type": "string"
909
+ },
910
+ "required": {
911
+ "type": "boolean",
912
+ "default": false
913
+ },
914
+ "format": {
915
+ "type": "string"
916
+ }
917
+ },
918
+ "required": [
919
+ "name",
920
+ "vault_key"
921
+ ],
922
+ "additionalProperties": false
923
+ },
924
+ "default": []
925
+ }
926
+ },
927
+ "additionalProperties": false
928
+ },
929
+ "invoke": {
930
+ "type": "object",
931
+ "properties": {
932
+ "commands": {
933
+ "type": "array",
934
+ "items": {
935
+ "type": "string"
936
+ },
937
+ "default": []
938
+ }
939
+ },
940
+ "additionalProperties": false
941
+ }
942
+ },
943
+ "additionalProperties": false
944
+ },
498
945
  "engine": {
499
946
  "type": "object",
500
947
  "properties": {
@@ -598,6 +1045,60 @@
598
1045
  "capabilities"
599
1046
  ],
600
1047
  "additionalProperties": false
1048
+ },
1049
+ "screenshots": {
1050
+ "type": "array",
1051
+ "items": {
1052
+ "type": "object",
1053
+ "properties": {
1054
+ "path": {
1055
+ "type": "string"
1056
+ },
1057
+ "caption": {
1058
+ "type": "string"
1059
+ }
1060
+ },
1061
+ "required": [
1062
+ "path"
1063
+ ],
1064
+ "additionalProperties": false
1065
+ },
1066
+ "default": []
1067
+ },
1068
+ "requires": {
1069
+ "type": "array",
1070
+ "items": {
1071
+ "type": "object",
1072
+ "properties": {
1073
+ "kind": {
1074
+ "type": "string"
1075
+ },
1076
+ "name": {
1077
+ "type": "string"
1078
+ },
1079
+ "source": {
1080
+ "type": "string",
1081
+ "enum": [
1082
+ "git",
1083
+ "npx",
1084
+ "catalog",
1085
+ "local"
1086
+ ]
1087
+ },
1088
+ "ref": {
1089
+ "type": "string"
1090
+ }
1091
+ },
1092
+ "required": [
1093
+ "kind",
1094
+ "name"
1095
+ ],
1096
+ "additionalProperties": false
1097
+ },
1098
+ "default": []
1099
+ },
1100
+ "signature": {
1101
+ "type": "string"
601
1102
  }
602
1103
  },
603
1104
  "required": [
@@ -627,6 +1128,26 @@
627
1128
  "additionalProperties": false
628
1129
  },
629
1130
  "default": []
1131
+ },
1132
+ "screenshots": {
1133
+ "type": "array",
1134
+ "items": {
1135
+ "type": "object",
1136
+ "properties": {
1137
+ "url": {
1138
+ "type": "string",
1139
+ "format": "uri"
1140
+ },
1141
+ "caption": {
1142
+ "type": "string"
1143
+ }
1144
+ },
1145
+ "required": [
1146
+ "url"
1147
+ ],
1148
+ "additionalProperties": false
1149
+ },
1150
+ "default": []
630
1151
  }
631
1152
  },
632
1153
  "required": [
@@ -0,0 +1,23 @@
1
+ # manifest-v5 fixtures
2
+
3
+ Fixture set for the manifest v5 schema (G-MANIFEST-V5,
4
+ `plans/shell-ux-rearchitecture/drafts/g-manifest-v5.md`, frozen 2026-09-22).
5
+ Produced by WP-27 (`@ikenga/contract`); consumed by WP-28's Rust↔Zod parity
6
+ test in the shell repo.
7
+
8
+ ## Contract
9
+
10
+ Every `*.json` file is a complete pkg `manifest.json`. Parse verdict by folder:
11
+
12
+ | Folder | Expected verdict (`ManifestSchema.parse` / Rust `Manifest` parse) |
13
+ |-----------|------------------------------------------------------------------|
14
+ | `valid/` | Parses successfully |
15
+ | `invalid/`| Fails to parse |
16
+ | `alias/` | Parses successfully; on the shell side the `ui.nav`→`ui.views` alias mapping applies (§4) |
17
+
18
+ `alias/nav-only.json` declares `ikenga_api: "1"` on purpose — the real-world
19
+ alias population is the api=1..4 pkgs still declaring `ui.nav`.
20
+
21
+ `valid/v4-manifest.json` and `valid/nav-and-views.json` also carry `ui.nav`:
22
+ they are parse-verdict fixtures (both parse on both sides); the alias *mapping*
23
+ assertion lives in `alias/`.
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "com.ikenga.nav-only",
3
+ "name": "Nav Only",
4
+ "version": "0.9.0",
5
+ "ikenga_api": "1",
6
+ "ui": {
7
+ "routes": [
8
+ { "path": "/home", "kind": "iframe", "source": "home.html" },
9
+ { "path": "/settings", "kind": "iframe", "source": "settings.html" }
10
+ ],
11
+ "nav": [
12
+ { "id": "home", "label": "Home", "icon": "home", "section": "main", "route": "/home" },
13
+ { "id": "settings", "label": "Settings", "icon": "settings", "route": "/settings" }
14
+ ]
15
+ }
16
+ }