@hanamesh/dsh-app-host 0.2.0-rc.2 → 0.6.14

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 (120) hide show
  1. package/LICENSE +4 -7
  2. package/README.md +140 -13
  3. package/consistency.json +41 -6
  4. package/dist/catalog/fixtures/consumer.json +35 -0
  5. package/dist/catalog/fixtures/provider.json +107 -0
  6. package/dist/catalog/suite.d.ts +4 -0
  7. package/dist/catalog/suite.js +50 -0
  8. package/dist/client-ui.d.ts +21 -3
  9. package/dist/client-ui.js +961 -94
  10. package/dist/client.js +2 -2
  11. package/dist/control-origin.js +9 -0
  12. package/dist/descriptor.js +6 -0
  13. package/dist/dsh-compat.js +6 -0
  14. package/dist/dsh.d.ts +21 -4
  15. package/dist/dsh.js +149 -58
  16. package/dist/gateway.js +140 -11
  17. package/dist/git-process.js +64 -0
  18. package/dist/git-worker.js +50 -0
  19. package/dist/index.d.ts +9 -7
  20. package/dist/install-target/fixtures/catalog.json +58 -0
  21. package/dist/install-target/fixtures/consumer-cases.json +148 -0
  22. package/dist/install-target/fixtures/install-failure-cases.json +58 -0
  23. package/dist/install-target/fixtures/provider-cases.json +618 -0
  24. package/dist/install-target/fixtures/reference-consumer.js +37 -0
  25. package/dist/install-target/fixtures/source-profile.js +123 -0
  26. package/dist/install-target/harness.js +43 -0
  27. package/dist/install-target/run.js +28 -0
  28. package/dist/install-target/suite.d.ts +19 -0
  29. package/dist/install-target/suite.js +328 -0
  30. package/dist/installation-status.d.ts +21 -0
  31. package/dist/installation-status.js +2 -0
  32. package/dist/library/catalog.js +163 -19
  33. package/dist/library/client-identity.js +31 -0
  34. package/dist/library/desktop-cli.js +7 -0
  35. package/dist/library/domain.js +3 -1
  36. package/dist/library/handoff.js +246 -0
  37. package/dist/library/install.js +138 -32
  38. package/dist/library/installation-cli.js +48 -0
  39. package/dist/library/installation-command-worker.js +27 -0
  40. package/dist/library/installation-status-http.js +26 -0
  41. package/dist/library/installation-status.js +91 -0
  42. package/dist/library/installation-worker.js +44 -0
  43. package/dist/library/locate.js +70 -9
  44. package/dist/library/node-binding.js +11 -0
  45. package/dist/library/recovery.js +66 -0
  46. package/dist/library/routes.js +90 -14
  47. package/dist/library/service.js +123 -27
  48. package/dist/library/suite.js +130 -0
  49. package/dist/manager.js +24 -8
  50. package/dist/node-runtime/domain.js +6 -0
  51. package/dist/node-runtime/releases.json +59 -0
  52. package/dist/node-runtime/service.js +101 -0
  53. package/dist/owned-probe-diagnostic.js +53 -0
  54. package/dist/router/receipts.js +8 -11
  55. package/dist/router/routes.js +7 -7
  56. package/dist/routes.js +9 -8
  57. package/dist/runtime.js +11 -1
  58. package/dist/usage-evidence.js +18 -86
  59. package/dist/workspace-origin.js +17 -0
  60. package/docs/APP_PACKAGE.md +4 -0
  61. package/docs/CONTRACT.md +75 -11
  62. package/docs/DSH_COMPATIBILITY.md +94 -0
  63. package/docs/DSH_INTEGRATION.md +41 -0
  64. package/docs/INSTALLATION_STATUS.md +96 -0
  65. package/docs/INSTALL_TARGET.md +130 -0
  66. package/docs/LIBRARY.md +44 -3
  67. package/docs/LICENSES.json +189 -61
  68. package/docs/PROVENANCE.json +53 -12
  69. package/docs/SECURITY.md +31 -0
  70. package/node_modules/@hanamesh/lib-provision/LICENSE +15 -0
  71. package/node_modules/@hanamesh/lib-provision/README.md +134 -0
  72. package/node_modules/@hanamesh/lib-provision/THIRD_PARTY_NOTICES.md +17 -0
  73. package/node_modules/@hanamesh/lib-provision/bin/hanamesh-provision.js +13 -0
  74. package/node_modules/@hanamesh/lib-provision/consistency.json +20 -0
  75. package/node_modules/@hanamesh/lib-provision/contract/CHANGELOG.md +5 -0
  76. package/node_modules/@hanamesh/lib-provision/contract/conformance.mjs +80 -0
  77. package/node_modules/@hanamesh/lib-provision/contract/fixtures/consumer.json +9 -0
  78. package/node_modules/@hanamesh/lib-provision/contract/fixtures/provider.json +11 -0
  79. package/node_modules/@hanamesh/lib-provision/contract/lib-provision.schema.json +47 -0
  80. package/node_modules/@hanamesh/lib-provision/package.json +50 -0
  81. package/package.json +81 -33
  82. package/schemas/catalog-provider-page.schema.json +884 -7
  83. package/schemas/catalog-source.schema.json +9 -7
  84. package/schemas/install-target.schema.json +298 -0
  85. package/dist/provision/LICENSE +0 -6
  86. package/dist/provision/THIRD_PARTY_NOTICES.md +0 -13
  87. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/archive.d.ts +0 -0
  88. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/archive.js +0 -0
  89. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/check.d.ts +0 -0
  90. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/check.js +0 -0
  91. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/checkpoints.d.ts +0 -0
  92. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/checkpoints.js +0 -0
  93. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/cli.d.ts +0 -0
  94. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/cli.js +0 -0
  95. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/download.d.ts +0 -0
  96. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/download.js +0 -0
  97. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/errors.d.ts +0 -0
  98. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/errors.js +0 -0
  99. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/extract.d.ts +0 -0
  100. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/extract.js +0 -0
  101. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/fsutil.d.ts +0 -0
  102. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/fsutil.js +0 -0
  103. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/index.d.ts +0 -0
  104. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/index.js +0 -0
  105. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/ledger.d.ts +0 -0
  106. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/ledger.js +0 -0
  107. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/manifest.d.ts +0 -0
  108. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/manifest.js +0 -0
  109. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/paths.d.ts +0 -0
  110. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/paths.js +0 -0
  111. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/platform.d.ts +0 -0
  112. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/platform.js +0 -0
  113. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/provision.d.ts +0 -0
  114. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/provision.js +0 -0
  115. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/tar.d.ts +0 -0
  116. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/tar.js +0 -0
  117. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/types.d.ts +0 -0
  118. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/types.js +0 -0
  119. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/zip.d.ts +0 -0
  120. /package/{dist/provision → node_modules/@hanamesh/lib-provision/lib}/zip.js +0 -0
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "urn:dsh-community-market:schema:catalog-provider-page:1.0.0",
3
+ "$id": "urn:dsh-community-market:schema:catalog-provider-page:1.1.0",
4
4
  "title": "DSH Community Market standard provider page",
5
- "description": "The untrusted page JSON returned by one standard HTTPS catalog endpoint. Only schemaVersion, items, and page are required. A page may contain at most 200 items and must also respect the effective requested or declared default limit. Host-observed provenance is intentionally absent and is injected only after validation.",
5
+ "description": "Default catalog-major-1 or explicit HanaMesh view. Both branches reject unknown fields; cross-field suite identity/version checks also run in the consumer.",
6
6
  "type": "object",
7
7
  "additionalProperties": false,
8
8
  "required": [
@@ -12,7 +12,9 @@
12
12
  ],
13
13
  "properties": {
14
14
  "schemaVersion": {
15
- "const": "1.0.0"
15
+ "type": "string",
16
+ "pattern": "^(?:hanamesh\\.catalog\\.v1|1\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?)$(?![\\s\\S])",
17
+ "description": "Valid SemVer with major 1. Minor and patch additions preserve the validated shape; other majors are refused."
16
18
  },
17
19
  "generatedAt": {
18
20
  "type": "string",
@@ -26,9 +28,7 @@
26
28
  "items": {
27
29
  "type": "array",
28
30
  "maxItems": 200,
29
- "items": {
30
- "$ref": "#/$defs/item"
31
- }
31
+ "items": {}
32
32
  },
33
33
  "page": {
34
34
  "$ref": "#/$defs/page"
@@ -371,6 +371,883 @@
371
371
  ]
372
372
  }
373
373
  ]
374
+ },
375
+ "legacyPage": {
376
+ "type": "object",
377
+ "additionalProperties": false,
378
+ "required": [
379
+ "schemaVersion",
380
+ "items",
381
+ "page"
382
+ ],
383
+ "properties": {
384
+ "schemaVersion": {
385
+ "type": "string",
386
+ "pattern": "^1\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$(?![\\s\\S])",
387
+ "description": "Valid SemVer with major 1. Minor and patch additions preserve the validated shape; other majors are refused."
388
+ },
389
+ "generatedAt": {
390
+ "type": "string",
391
+ "format": "date-time"
392
+ },
393
+ "revision": {
394
+ "type": "string",
395
+ "minLength": 1,
396
+ "maxLength": 160
397
+ },
398
+ "items": {
399
+ "type": "array",
400
+ "maxItems": 200,
401
+ "items": {
402
+ "$ref": "#/$defs/item"
403
+ }
404
+ },
405
+ "page": {
406
+ "$ref": "#/$defs/page"
407
+ }
408
+ }
409
+ },
410
+ "hana_identifier": {
411
+ "type": "string",
412
+ "minLength": 1,
413
+ "maxLength": 160,
414
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/@+-]*$"
415
+ },
416
+ "hana_httpsUri": {
417
+ "type": "string",
418
+ "format": "uri",
419
+ "maxLength": 2048,
420
+ "pattern": "^https://(?![^/?#]*@)(?![^/?#]*:)[^/?#]+(?:[/?#].*)?$"
421
+ },
422
+ "hana_plainText": {
423
+ "type": "string",
424
+ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F\\u202A-\\u202E\\u2066-\\u2069]*$"
425
+ },
426
+ "hana_page": {
427
+ "oneOf": [
428
+ {
429
+ "type": "object",
430
+ "additionalProperties": false,
431
+ "maxProperties": 0
432
+ },
433
+ {
434
+ "type": "object",
435
+ "additionalProperties": false,
436
+ "required": [
437
+ "nextCursor",
438
+ "total"
439
+ ],
440
+ "properties": {
441
+ "nextCursor": {
442
+ "type": "string",
443
+ "minLength": 1,
444
+ "maxLength": 2048
445
+ },
446
+ "total": {
447
+ "type": "integer",
448
+ "minimum": 0
449
+ }
450
+ }
451
+ }
452
+ ]
453
+ },
454
+ "hana_repository": {
455
+ "type": "object",
456
+ "additionalProperties": false,
457
+ "required": [
458
+ "url"
459
+ ],
460
+ "properties": {
461
+ "url": {
462
+ "$ref": "#/$defs/hana_httpsUri",
463
+ "description": "GitHub repository only; runtime validates hostname and owner/repository path."
464
+ },
465
+ "subdirectory": {
466
+ "type": "string",
467
+ "minLength": 1,
468
+ "maxLength": 240,
469
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))[^\\\\]+$"
470
+ }
471
+ }
472
+ },
473
+ "hana_package": {
474
+ "type": "object",
475
+ "additionalProperties": false,
476
+ "required": [
477
+ "registry",
478
+ "name"
479
+ ],
480
+ "properties": {
481
+ "registry": {
482
+ "const": "npm"
483
+ },
484
+ "name": {
485
+ "type": "string",
486
+ "minLength": 1,
487
+ "maxLength": 214,
488
+ "pattern": "^(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*$"
489
+ }
490
+ }
491
+ },
492
+ "hana_publisher": {
493
+ "type": "object",
494
+ "additionalProperties": false,
495
+ "required": [
496
+ "name"
497
+ ],
498
+ "properties": {
499
+ "name": {
500
+ "allOf": [
501
+ {
502
+ "$ref": "#/$defs/hana_plainText"
503
+ },
504
+ {
505
+ "type": "string",
506
+ "minLength": 1,
507
+ "maxLength": 120
508
+ }
509
+ ]
510
+ },
511
+ "url": {
512
+ "$ref": "#/$defs/hana_httpsUri"
513
+ }
514
+ }
515
+ },
516
+ "hana_categoryId": {
517
+ "type": "string",
518
+ "minLength": 1,
519
+ "maxLength": 64,
520
+ "pattern": "^[a-z0-9][a-z0-9._:-]*$"
521
+ },
522
+ "hana_item": {
523
+ "type": "object",
524
+ "additionalProperties": false,
525
+ "required": [
526
+ "id",
527
+ "name",
528
+ "displayName",
529
+ "summary",
530
+ "itemId",
531
+ "packageName",
532
+ "catalogKind",
533
+ "source"
534
+ ],
535
+ "properties": {
536
+ "id": {
537
+ "$ref": "#/$defs/hana_identifier"
538
+ },
539
+ "name": {
540
+ "allOf": [
541
+ {
542
+ "$ref": "#/$defs/hana_plainText"
543
+ },
544
+ {
545
+ "type": "string",
546
+ "minLength": 1,
547
+ "maxLength": 160
548
+ }
549
+ ]
550
+ },
551
+ "displayName": {
552
+ "allOf": [
553
+ {
554
+ "$ref": "#/$defs/hana_plainText"
555
+ },
556
+ {
557
+ "type": "string",
558
+ "minLength": 1,
559
+ "maxLength": 120
560
+ }
561
+ ]
562
+ },
563
+ "summary": {
564
+ "allOf": [
565
+ {
566
+ "$ref": "#/$defs/hana_plainText"
567
+ },
568
+ {
569
+ "type": "string",
570
+ "maxLength": 1000
571
+ }
572
+ ]
573
+ },
574
+ "description": {
575
+ "allOf": [
576
+ {
577
+ "$ref": "#/$defs/hana_plainText"
578
+ },
579
+ {
580
+ "type": "string",
581
+ "maxLength": 5000
582
+ }
583
+ ]
584
+ },
585
+ "homepage": {
586
+ "$ref": "#/$defs/hana_httpsUri"
587
+ },
588
+ "latestVersion": {
589
+ "type": "string",
590
+ "minLength": 1,
591
+ "maxLength": 64
592
+ },
593
+ "license": {
594
+ "type": "string",
595
+ "minLength": 1,
596
+ "maxLength": 80
597
+ },
598
+ "categories": {
599
+ "type": "array",
600
+ "maxItems": 32,
601
+ "uniqueItems": true,
602
+ "items": {
603
+ "$ref": "#/$defs/hana_categoryId"
604
+ }
605
+ },
606
+ "keywords": {
607
+ "type": "array",
608
+ "maxItems": 64,
609
+ "uniqueItems": true,
610
+ "items": {
611
+ "type": "string",
612
+ "minLength": 1,
613
+ "maxLength": 64
614
+ }
615
+ },
616
+ "repository": {
617
+ "$ref": "#/$defs/hana_repository"
618
+ },
619
+ "package": {
620
+ "$ref": "#/$defs/hana_package"
621
+ },
622
+ "publisher": {
623
+ "$ref": "#/$defs/hana_publisher"
624
+ },
625
+ "updatedAt": {
626
+ "type": "string",
627
+ "format": "date-time"
628
+ },
629
+ "itemId": {
630
+ "$ref": "#/$defs/hana_identifier"
631
+ },
632
+ "packageName": {
633
+ "anyOf": [
634
+ {
635
+ "type": "null"
636
+ },
637
+ {
638
+ "type": "string",
639
+ "minLength": 1,
640
+ "maxLength": 214,
641
+ "pattern": "^(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*$"
642
+ }
643
+ ]
644
+ },
645
+ "catalogKind": {
646
+ "enum": [
647
+ "application",
648
+ "plugin",
649
+ "entry"
650
+ ]
651
+ },
652
+ "source": {
653
+ "$ref": "#/$defs/hana_source"
654
+ },
655
+ "official": {
656
+ "type": "boolean",
657
+ "description": "Mirrored official marker from the source; absent when unknown. Does not grant authorization."
658
+ },
659
+ "suite": {
660
+ "$ref": "#/$defs/hana_suite"
661
+ }
662
+ },
663
+ "allOf": [
664
+ {
665
+ "if": {
666
+ "properties": {
667
+ "packageName": {
668
+ "type": "null"
669
+ }
670
+ }
671
+ },
672
+ "then": {
673
+ "not": {
674
+ "required": [
675
+ "package"
676
+ ]
677
+ }
678
+ },
679
+ "else": {
680
+ "required": [
681
+ "package"
682
+ ]
683
+ }
684
+ }
685
+ ]
686
+ },
687
+ "hana_sourceLink": {
688
+ "type": "object",
689
+ "additionalProperties": false,
690
+ "required": [
691
+ "sourceId",
692
+ "sourceRef",
693
+ "sourceUrl",
694
+ "firstSeenAt",
695
+ "lastSeenAt"
696
+ ],
697
+ "properties": {
698
+ "sourceId": {
699
+ "type": "string",
700
+ "minLength": 1,
701
+ "maxLength": 120,
702
+ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F\\u202A-\\u202E\\u2066-\\u2069]*$"
703
+ },
704
+ "sourceRef": {
705
+ "type": "string",
706
+ "minLength": 1,
707
+ "maxLength": 512,
708
+ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F\\u202A-\\u202E\\u2066-\\u2069]*$"
709
+ },
710
+ "sourceUrl": {
711
+ "$ref": "#/$defs/hana_httpsUri"
712
+ },
713
+ "firstSeenAt": {
714
+ "type": "string",
715
+ "format": "date-time"
716
+ },
717
+ "lastSeenAt": {
718
+ "type": "string",
719
+ "format": "date-time"
720
+ }
721
+ }
722
+ },
723
+ "hana_source": {
724
+ "type": "object",
725
+ "additionalProperties": false,
726
+ "required": [
727
+ "sourceId",
728
+ "sourceRef",
729
+ "sourceLinks"
730
+ ],
731
+ "properties": {
732
+ "sourceId": {
733
+ "type": "string",
734
+ "minLength": 1,
735
+ "maxLength": 120,
736
+ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F\\u202A-\\u202E\\u2066-\\u2069]*$"
737
+ },
738
+ "sourceRef": {
739
+ "type": "string",
740
+ "minLength": 1,
741
+ "maxLength": 512,
742
+ "pattern": "^[^\\u0000-\\u001F\\u007F-\\u009F\\u202A-\\u202E\\u2066-\\u2069]*$"
743
+ },
744
+ "sourceLinks": {
745
+ "type": "array",
746
+ "maxItems": 500,
747
+ "items": {
748
+ "$ref": "#/$defs/hana_sourceLink"
749
+ }
750
+ }
751
+ }
752
+ },
753
+ "hana_suite": {
754
+ "type": "object",
755
+ "additionalProperties": false,
756
+ "required": [
757
+ "schemaVersion",
758
+ "id",
759
+ "role",
760
+ "component",
761
+ "canonicalHanaId",
762
+ "installable"
763
+ ],
764
+ "properties": {
765
+ "schemaVersion": {
766
+ "const": 1
767
+ },
768
+ "id": {
769
+ "const": "hanamesh"
770
+ },
771
+ "role": {
772
+ "enum": [
773
+ "suite",
774
+ "component",
775
+ "client-only"
776
+ ]
777
+ },
778
+ "component": {
779
+ "enum": [
780
+ "core",
781
+ "usage",
782
+ "app-host",
783
+ "brand"
784
+ ]
785
+ },
786
+ "canonicalHanaId": {
787
+ "type": [
788
+ "string",
789
+ "null"
790
+ ],
791
+ "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[1-8][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$"
792
+ },
793
+ "installable": {
794
+ "type": "boolean"
795
+ },
796
+ "installTargets": {
797
+ "type": "array",
798
+ "minItems": 3,
799
+ "maxItems": 3,
800
+ "items": {
801
+ "type": "object",
802
+ "additionalProperties": false,
803
+ "required": [
804
+ "component",
805
+ "npmPackageName",
806
+ "githubRepo",
807
+ "source"
808
+ ],
809
+ "properties": {
810
+ "component": {
811
+ "enum": [
812
+ "core",
813
+ "usage",
814
+ "app-host"
815
+ ]
816
+ },
817
+ "npmPackageName": {
818
+ "type": "string",
819
+ "maxLength": 214,
820
+ "pattern": "^(?:@[a-z0-9-]+/)?[a-z0-9][a-z0-9._-]*$"
821
+ },
822
+ "githubRepo": {
823
+ "type": "string",
824
+ "pattern": "^[A-Za-z0-9.-]+/[A-Za-z0-9._-]+$"
825
+ },
826
+ "source": {
827
+ "oneOf": [
828
+ {
829
+ "type": "object",
830
+ "additionalProperties": false,
831
+ "required": [
832
+ "source",
833
+ "repo",
834
+ "ref"
835
+ ],
836
+ "properties": {
837
+ "source": {
838
+ "const": "github"
839
+ },
840
+ "repo": {
841
+ "type": "string"
842
+ },
843
+ "ref": {
844
+ "type": "string",
845
+ "pattern": "^[a-f0-9]{40}$"
846
+ }
847
+ }
848
+ },
849
+ {
850
+ "type": "object",
851
+ "additionalProperties": false,
852
+ "required": [
853
+ "source",
854
+ "name",
855
+ "version"
856
+ ],
857
+ "properties": {
858
+ "source": {
859
+ "const": "npm"
860
+ },
861
+ "name": {
862
+ "type": "string",
863
+ "maxLength": 214,
864
+ "pattern": "^(?:@[a-z0-9-]+/)?[a-z0-9][a-z0-9._-]*$"
865
+ },
866
+ "version": {
867
+ "$ref": "#/$defs/hana_semver"
868
+ }
869
+ }
870
+ }
871
+ ]
872
+ },
873
+ "version": {
874
+ "$ref": "#/$defs/hana_semver"
875
+ }
876
+ },
877
+ "allOf": [
878
+ {
879
+ "$ref": "#/$defs/hana_officialSuiteIdentity"
880
+ },
881
+ {
882
+ "if": {
883
+ "properties": {
884
+ "source": {
885
+ "properties": {
886
+ "source": {
887
+ "const": "npm"
888
+ }
889
+ },
890
+ "type": "object"
891
+ }
892
+ },
893
+ "type": "object"
894
+ },
895
+ "then": {
896
+ "required": [
897
+ "version"
898
+ ]
899
+ }
900
+ }
901
+ ]
902
+ }
903
+ },
904
+ "distributionVersion": {
905
+ "$ref": "#/$defs/hana_semver"
906
+ },
907
+ "components": {
908
+ "type": "array",
909
+ "minItems": 4,
910
+ "maxItems": 4,
911
+ "items": {
912
+ "type": "object",
913
+ "additionalProperties": false,
914
+ "required": [
915
+ "component",
916
+ "npmPackageName",
917
+ "githubRepo",
918
+ "version"
919
+ ],
920
+ "properties": {
921
+ "component": {
922
+ "enum": [
923
+ "core",
924
+ "usage",
925
+ "app-host",
926
+ "brand"
927
+ ]
928
+ },
929
+ "npmPackageName": {
930
+ "type": "string"
931
+ },
932
+ "githubRepo": {
933
+ "type": "string"
934
+ },
935
+ "version": {
936
+ "$ref": "#/$defs/hana_semver"
937
+ }
938
+ },
939
+ "allOf": [
940
+ {
941
+ "$ref": "#/$defs/hana_officialSuiteIdentity"
942
+ }
943
+ ]
944
+ },
945
+ "allOf": [
946
+ {
947
+ "contains": {
948
+ "type": "object",
949
+ "required": [
950
+ "component"
951
+ ],
952
+ "properties": {
953
+ "component": {
954
+ "const": "core"
955
+ }
956
+ }
957
+ }
958
+ },
959
+ {
960
+ "contains": {
961
+ "type": "object",
962
+ "required": [
963
+ "component"
964
+ ],
965
+ "properties": {
966
+ "component": {
967
+ "const": "usage"
968
+ }
969
+ }
970
+ }
971
+ },
972
+ {
973
+ "contains": {
974
+ "type": "object",
975
+ "required": [
976
+ "component"
977
+ ],
978
+ "properties": {
979
+ "component": {
980
+ "const": "app-host"
981
+ }
982
+ }
983
+ }
984
+ },
985
+ {
986
+ "contains": {
987
+ "type": "object",
988
+ "required": [
989
+ "component"
990
+ ],
991
+ "properties": {
992
+ "component": {
993
+ "const": "brand"
994
+ }
995
+ }
996
+ }
997
+ }
998
+ ]
999
+ },
1000
+ "agentPlugins": {
1001
+ "type": "array",
1002
+ "minItems": 1,
1003
+ "maxItems": 2,
1004
+ "uniqueItems": true,
1005
+ "items": {
1006
+ "type": "object",
1007
+ "additionalProperties": false,
1008
+ "required": [
1009
+ "host",
1010
+ "pluginName",
1011
+ "pluginId",
1012
+ "marketplaceUrl",
1013
+ "version"
1014
+ ],
1015
+ "properties": {
1016
+ "host": {
1017
+ "enum": [
1018
+ "claude",
1019
+ "codex"
1020
+ ]
1021
+ },
1022
+ "pluginName": {
1023
+ "type": "string",
1024
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,119}$"
1025
+ },
1026
+ "pluginId": {
1027
+ "type": "string",
1028
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,119}@[A-Za-z0-9][A-Za-z0-9._-]{0,119}$"
1029
+ },
1030
+ "marketplaceUrl": {
1031
+ "type": "string",
1032
+ "format": "uri",
1033
+ "pattern": "^https://"
1034
+ },
1035
+ "version": {
1036
+ "$ref": "#/$defs/hana_semver"
1037
+ }
1038
+ }
1039
+ }
1040
+ }
1041
+ },
1042
+ "description": "Validated Indexer declaration. Optional versions are provider-supplied SemVer, never inferred from another component. Worker enforces role/component relationships, canonical self UUID for installation, distinct official components, source.repo=githubRepo and matching component/target versions when both are supplied. npm targets require source.name=npmPackageName and source.version=target.version=component.version; agent targets bind the distribution version. Cross-field checks also run in the Worker.",
1043
+ "allOf": [
1044
+ {
1045
+ "if": {
1046
+ "anyOf": [
1047
+ {
1048
+ "required": [
1049
+ "components"
1050
+ ]
1051
+ },
1052
+ {
1053
+ "required": [
1054
+ "distributionVersion"
1055
+ ]
1056
+ },
1057
+ {
1058
+ "required": [
1059
+ "agentPlugins"
1060
+ ]
1061
+ }
1062
+ ]
1063
+ },
1064
+ "then": {
1065
+ "properties": {
1066
+ "role": {
1067
+ "const": "suite"
1068
+ },
1069
+ "component": {
1070
+ "const": "usage"
1071
+ },
1072
+ "installable": {
1073
+ "const": true
1074
+ }
1075
+ }
1076
+ }
1077
+ }
1078
+ ]
1079
+ },
1080
+ "hana_officialSuiteIdentity": {
1081
+ "description": "Public Indexer official component identities; shared by Web validation for mirrored rows and install targets. Ref commits remain provider supplied. Scoped identities and their explicit historical npm names share the same component/GitHub binding.",
1082
+ "oneOf": [
1083
+ {
1084
+ "type": "object",
1085
+ "required": [
1086
+ "npmPackageName",
1087
+ "githubRepo"
1088
+ ],
1089
+ "properties": {
1090
+ "component": {
1091
+ "const": "core"
1092
+ },
1093
+ "npmPackageName": {
1094
+ "enum": [
1095
+ "@hanamesh/core",
1096
+ "hanamesh-core"
1097
+ ]
1098
+ },
1099
+ "githubRepo": {
1100
+ "const": "yzsnstotz/hanamesh-core"
1101
+ },
1102
+ "suite": {
1103
+ "type": "object",
1104
+ "properties": {
1105
+ "component": {
1106
+ "const": "core"
1107
+ }
1108
+ }
1109
+ }
1110
+ }
1111
+ },
1112
+ {
1113
+ "type": "object",
1114
+ "required": [
1115
+ "npmPackageName",
1116
+ "githubRepo"
1117
+ ],
1118
+ "properties": {
1119
+ "component": {
1120
+ "const": "usage"
1121
+ },
1122
+ "npmPackageName": {
1123
+ "enum": [
1124
+ "@hanamesh/usage",
1125
+ "hanamesh-usage"
1126
+ ]
1127
+ },
1128
+ "githubRepo": {
1129
+ "const": "yzsnstotz/hanamesh-usage"
1130
+ },
1131
+ "suite": {
1132
+ "type": "object",
1133
+ "properties": {
1134
+ "component": {
1135
+ "const": "usage"
1136
+ }
1137
+ }
1138
+ }
1139
+ }
1140
+ },
1141
+ {
1142
+ "type": "object",
1143
+ "required": [
1144
+ "npmPackageName",
1145
+ "githubRepo"
1146
+ ],
1147
+ "properties": {
1148
+ "component": {
1149
+ "const": "app-host"
1150
+ },
1151
+ "npmPackageName": {
1152
+ "enum": [
1153
+ "@hanamesh/dsh-app-host"
1154
+ ]
1155
+ },
1156
+ "githubRepo": {
1157
+ "const": "yzsnstotz/hanamesh-plugin-app-host"
1158
+ },
1159
+ "suite": {
1160
+ "type": "object",
1161
+ "properties": {
1162
+ "component": {
1163
+ "const": "app-host"
1164
+ }
1165
+ }
1166
+ }
1167
+ }
1168
+ },
1169
+ {
1170
+ "type": "object",
1171
+ "required": [
1172
+ "npmPackageName",
1173
+ "githubRepo"
1174
+ ],
1175
+ "properties": {
1176
+ "component": {
1177
+ "const": "brand"
1178
+ },
1179
+ "npmPackageName": {
1180
+ "enum": [
1181
+ "@hanamesh/brand",
1182
+ "hanamesh-brand"
1183
+ ]
1184
+ },
1185
+ "githubRepo": {
1186
+ "const": "yzsnstotz/hanamesh-brand"
1187
+ },
1188
+ "suite": {
1189
+ "type": "object",
1190
+ "properties": {
1191
+ "component": {
1192
+ "const": "brand"
1193
+ }
1194
+ }
1195
+ }
1196
+ }
1197
+ }
1198
+ ]
1199
+ },
1200
+ "hana_semver": {
1201
+ "type": "string",
1202
+ "maxLength": 128,
1203
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$(?![\\s\\S])"
1204
+ },
1205
+ "hanaPage": {
1206
+ "title": "HanaMesh opt-in full catalog page",
1207
+ "description": "C-WEB-CATALOG version 1 public allowlist. Runtime additionally enforces id=itemId, npm package equality, classification, source safety and actual UTF-8 response byte limits.",
1208
+ "type": "object",
1209
+ "additionalProperties": false,
1210
+ "required": [
1211
+ "schemaVersion",
1212
+ "items",
1213
+ "page"
1214
+ ],
1215
+ "properties": {
1216
+ "schemaVersion": {
1217
+ "const": "hanamesh.catalog.v1"
1218
+ },
1219
+ "generatedAt": {
1220
+ "type": "string",
1221
+ "format": "date-time"
1222
+ },
1223
+ "items": {
1224
+ "type": "array",
1225
+ "maxItems": 200,
1226
+ "items": {
1227
+ "$ref": "#/$defs/hana_item"
1228
+ }
1229
+ },
1230
+ "page": {
1231
+ "$ref": "#/$defs/hana_page"
1232
+ }
1233
+ }
1234
+ }
1235
+ },
1236
+ "allOf": [
1237
+ {
1238
+ "if": {
1239
+ "properties": {
1240
+ "schemaVersion": {
1241
+ "const": "hanamesh.catalog.v1"
1242
+ }
1243
+ }
1244
+ },
1245
+ "then": {
1246
+ "$ref": "#/$defs/hanaPage"
1247
+ },
1248
+ "else": {
1249
+ "$ref": "#/$defs/legacyPage"
1250
+ }
374
1251
  }
375
- }
1252
+ ]
376
1253
  }