@clowder-ai/plugin-contract 0.1.0-beta.9 → 0.3.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 (182) hide show
  1. package/dist/codegen/generate-contract.d.ts +6 -0
  2. package/dist/codegen/generate-contract.d.ts.map +1 -1
  3. package/dist/codegen/generate-contract.js +338 -44
  4. package/dist/codegen/generate-contract.js.map +1 -1
  5. package/dist/conformance/fixtures.d.ts +3 -1
  6. package/dist/conformance/fixtures.d.ts.map +1 -1
  7. package/dist/conformance/fixtures.js +2 -1
  8. package/dist/conformance/fixtures.js.map +1 -1
  9. package/dist/conformance/index.d.ts +3 -3
  10. package/dist/conformance/index.d.ts.map +1 -1
  11. package/dist/conformance/index.js +3 -3
  12. package/dist/conformance/index.js.map +1 -1
  13. package/dist/conformance/messaging-behavior-fixture.d.ts +12 -0
  14. package/dist/conformance/messaging-behavior-fixture.d.ts.map +1 -0
  15. package/dist/conformance/messaging-behavior-fixture.js +24 -0
  16. package/dist/conformance/messaging-behavior-fixture.js.map +1 -0
  17. package/dist/conformance/messaging-loopback-adapter.d.ts +0 -3
  18. package/dist/conformance/messaging-loopback-adapter.d.ts.map +1 -1
  19. package/dist/conformance/messaging-loopback-adapter.js +1 -77
  20. package/dist/conformance/messaging-loopback-adapter.js.map +1 -1
  21. package/dist/conformance/messaging-loopback-state.d.ts +0 -6
  22. package/dist/conformance/messaging-loopback-state.d.ts.map +1 -1
  23. package/dist/conformance/messaging-loopback-state.js +0 -20
  24. package/dist/conformance/messaging-loopback-state.js.map +1 -1
  25. package/dist/conformance/runner.d.ts.map +1 -1
  26. package/dist/conformance/runner.js +3 -1
  27. package/dist/conformance/runner.js.map +1 -1
  28. package/dist/docx-materialization.d.ts +8 -0
  29. package/dist/docx-materialization.d.ts.map +1 -0
  30. package/dist/docx-materialization.js +19 -0
  31. package/dist/docx-materialization.js.map +1 -0
  32. package/dist/generated/contract.generated.d.ts +1637 -87
  33. package/dist/generated/contract.generated.d.ts.map +1 -1
  34. package/dist/generated/contract.generated.js +70 -9
  35. package/dist/generated/contract.generated.js.map +1 -1
  36. package/dist/index.d.ts +2 -3
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +2 -3
  39. package/dist/index.js.map +1 -1
  40. package/dist/types/index.d.ts +0 -1
  41. package/dist/types/index.d.ts.map +1 -1
  42. package/dist/types/index.js +0 -1
  43. package/dist/types/index.js.map +1 -1
  44. package/dist/validation/catalog.d.ts +21 -0
  45. package/dist/validation/catalog.d.ts.map +1 -0
  46. package/dist/validation/catalog.js +140 -0
  47. package/dist/validation/catalog.js.map +1 -0
  48. package/dist/validation/cloud-conversation-host.d.ts +18 -0
  49. package/dist/validation/cloud-conversation-host.d.ts.map +1 -0
  50. package/dist/validation/cloud-conversation-host.js +83 -0
  51. package/dist/validation/cloud-conversation-host.js.map +1 -0
  52. package/dist/validation/companion-bridge.d.ts +6 -0
  53. package/dist/validation/companion-bridge.d.ts.map +1 -0
  54. package/dist/validation/companion-bridge.js +198 -0
  55. package/dist/validation/companion-bridge.js.map +1 -0
  56. package/dist/validation/docx-materialization.d.ts +6 -0
  57. package/dist/validation/docx-materialization.d.ts.map +1 -0
  58. package/dist/validation/docx-materialization.js +36 -0
  59. package/dist/validation/docx-materialization.js.map +1 -0
  60. package/dist/validation/index.d.ts +9 -1
  61. package/dist/validation/index.d.ts.map +1 -1
  62. package/dist/validation/index.js +9 -1
  63. package/dist/validation/index.js.map +1 -1
  64. package/dist/validation/manifest.d.ts.map +1 -1
  65. package/dist/validation/manifest.js +317 -0
  66. package/dist/validation/manifest.js.map +1 -1
  67. package/dist/validation/members.d.ts +4 -0
  68. package/dist/validation/members.d.ts.map +1 -0
  69. package/dist/validation/members.js +11 -0
  70. package/dist/validation/members.js.map +1 -0
  71. package/dist/validation/messaging-semantic.d.ts.map +1 -1
  72. package/dist/validation/messaging-semantic.js +98 -0
  73. package/dist/validation/messaging-semantic.js.map +1 -1
  74. package/dist/validation/messaging-wire.d.ts +42 -0
  75. package/dist/validation/messaging-wire.d.ts.map +1 -0
  76. package/dist/validation/messaging-wire.js +184 -0
  77. package/dist/validation/messaging-wire.js.map +1 -0
  78. package/dist/validation/operation-rows.d.ts +25 -0
  79. package/dist/validation/operation-rows.d.ts.map +1 -0
  80. package/dist/validation/operation-rows.js +135 -0
  81. package/dist/validation/operation-rows.js.map +1 -0
  82. package/dist/validation/signals.d.ts +1 -10
  83. package/dist/validation/signals.d.ts.map +1 -1
  84. package/dist/validation/signals.js +0 -174
  85. package/dist/validation/signals.js.map +1 -1
  86. package/dist/variant.d.ts +114 -0
  87. package/dist/variant.d.ts.map +1 -0
  88. package/dist/variant.js +305 -0
  89. package/dist/variant.js.map +1 -0
  90. package/dist/wire/constants.d.ts +2 -1
  91. package/dist/wire/constants.d.ts.map +1 -1
  92. package/dist/wire/constants.js +2 -1
  93. package/dist/wire/constants.js.map +1 -1
  94. package/dist/wire/dispatch.d.ts +49 -0
  95. package/dist/wire/dispatch.d.ts.map +1 -0
  96. package/dist/wire/dispatch.js +870 -0
  97. package/dist/wire/dispatch.js.map +1 -0
  98. package/dist/wire/disposition-fixtures.d.ts +10 -2
  99. package/dist/wire/disposition-fixtures.d.ts.map +1 -1
  100. package/dist/wire/disposition-fixtures.js +539 -108
  101. package/dist/wire/disposition-fixtures.js.map +1 -1
  102. package/dist/wire/disposition.d.ts +3 -4
  103. package/dist/wire/disposition.d.ts.map +1 -1
  104. package/dist/wire/disposition.js +5 -16
  105. package/dist/wire/disposition.js.map +1 -1
  106. package/dist/wire/envelope.d.ts +31 -1
  107. package/dist/wire/envelope.d.ts.map +1 -1
  108. package/dist/wire/envelope.js +48 -1
  109. package/dist/wire/envelope.js.map +1 -1
  110. package/dist/wire/errors.d.ts +31 -1
  111. package/dist/wire/errors.d.ts.map +1 -1
  112. package/dist/wire/errors.js +36 -0
  113. package/dist/wire/errors.js.map +1 -1
  114. package/dist/wire/handshake-byte-bounds.d.ts.map +1 -1
  115. package/dist/wire/handshake-byte-bounds.js +1 -4
  116. package/dist/wire/handshake-byte-bounds.js.map +1 -1
  117. package/dist/wire/handshake.d.ts +12 -11
  118. package/dist/wire/handshake.d.ts.map +1 -1
  119. package/dist/wire/handshake.js +11 -15
  120. package/dist/wire/handshake.js.map +1 -1
  121. package/dist/wire/index.d.ts +15 -13
  122. package/dist/wire/index.d.ts.map +1 -1
  123. package/dist/wire/index.js +30 -9
  124. package/dist/wire/index.js.map +1 -1
  125. package/dist/wire/lifecycle-byte-bounds.d.ts +40 -0
  126. package/dist/wire/lifecycle-byte-bounds.d.ts.map +1 -0
  127. package/dist/wire/lifecycle-byte-bounds.js +148 -0
  128. package/dist/wire/lifecycle-byte-bounds.js.map +1 -0
  129. package/dist/wire/messaging-byte-bounds.d.ts +62 -0
  130. package/dist/wire/messaging-byte-bounds.d.ts.map +1 -0
  131. package/dist/wire/messaging-byte-bounds.js +581 -0
  132. package/dist/wire/messaging-byte-bounds.js.map +1 -0
  133. package/dist/wire/registry.d.ts +58 -107
  134. package/dist/wire/registry.d.ts.map +1 -1
  135. package/dist/wire/registry.js +45 -107
  136. package/dist/wire/registry.js.map +1 -1
  137. package/dist/wire/row-shapes.d.ts +82 -81
  138. package/dist/wire/row-shapes.d.ts.map +1 -1
  139. package/dist/wire/row-shapes.js +30 -3
  140. package/dist/wire/row-shapes.js.map +1 -1
  141. package/fixtures/behavior/messaging/adversarial-invariants.json +62 -183
  142. package/fixtures/manifest/invalid/contract-version-leading-zero-prerelease.json +1 -3
  143. package/fixtures/manifest/invalid/contract-version-range.json +1 -3
  144. package/fixtures/manifest/invalid/duplicate-signal-type.json +4 -4
  145. package/fixtures/manifest/invalid/icon-package-escape.json +20 -0
  146. package/fixtures/manifest/invalid/ipc-empty-entrypoint.json +1 -3
  147. package/fixtures/manifest/invalid/plugin-version-leading-zero-prerelease.json +1 -3
  148. package/fixtures/manifest/invalid/plugin-version-not-semver.json +1 -3
  149. package/fixtures/manifest/invalid/semver-empty-build-metadata.json +1 -3
  150. package/fixtures/manifest/invalid/stdio-missing-entrypoint.json +1 -3
  151. package/fixtures/manifest/invalid/user-authored-lifecycle.json +1 -3
  152. package/fixtures/manifest/valid/localized-product-metadata.json +25 -0
  153. package/fixtures/manifest/valid/minimal-builtin.json +1 -3
  154. package/fixtures/manifest/valid/protocol-intrinsic-lifecycle.json +1 -3
  155. package/fixtures/manifest/valid/semver-build-metadata.json +1 -3
  156. package/fixtures/manifest/valid/stdio-entrypoint.json +1 -3
  157. package/fixtures/messaging/valid/subscription-delivery.json +1 -1
  158. package/package.json +17 -4
  159. package/src/schemas/behavior-fixture.schema.json +800 -152
  160. package/src/schemas/catalog.schema.json +91 -0
  161. package/src/schemas/companion-bridge.schema.json +2256 -0
  162. package/src/schemas/docx-materialization.schema.json +302 -0
  163. package/src/schemas/manifest.schema.json +2196 -107
  164. package/src/schemas/messaging.schema.json +692 -41
  165. package/src/schemas/plugin-metadata.schema.json +62 -0
  166. package/src/schemas/signal.schema.json +68 -78
  167. package/dist/types/capability.d.ts +0 -4
  168. package/dist/types/capability.d.ts.map +0 -1
  169. package/dist/types/capability.js +0 -11
  170. package/dist/types/capability.js.map +0 -1
  171. package/dist/wire/grants.d.ts +0 -57
  172. package/dist/wire/grants.d.ts.map +0 -1
  173. package/dist/wire/grants.js +0 -59
  174. package/dist/wire/grants.js.map +0 -1
  175. package/dist/wire/signal-byte-bounds.d.ts +0 -97
  176. package/dist/wire/signal-byte-bounds.d.ts.map +0 -1
  177. package/dist/wire/signal-byte-bounds.js +0 -229
  178. package/dist/wire/signal-byte-bounds.js.map +0 -1
  179. package/fixtures/manifest/invalid/unknown-capability.json +0 -19
  180. package/fixtures/signals/invalid/destination-injection.json +0 -15
  181. package/fixtures/signals/invalid/non-utc-occurred-at.json +0 -12
  182. package/fixtures/signals/valid/feishu-meeting-artifact.json +0 -18
@@ -0,0 +1,62 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://clowder-ai.dev/schemas/plugin-metadata/v1",
4
+ "title": "Clowder AI Plugin Product Metadata (v1)",
5
+ "description": "Manifest-owned static product metadata projected into the repository catalog for Agent, Console, and Marketplace discovery.",
6
+ "$defs": {
7
+ "LocalizedDescriptionObject": {
8
+ "type": "object",
9
+ "properties": {
10
+ "default": { "type": "string", "minLength": 1, "maxLength": 4096 },
11
+ "translations": {
12
+ "type": "object",
13
+ "propertyNames": {
14
+ "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$"
15
+ },
16
+ "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 4096 },
17
+ "minProperties": 1,
18
+ "maxProperties": 32
19
+ }
20
+ },
21
+ "required": ["default", "translations"],
22
+ "additionalProperties": false
23
+ },
24
+ "LocalizedDescription": {
25
+ "oneOf": [
26
+ { "type": "string", "minLength": 1, "maxLength": 4096 },
27
+ { "$ref": "#/$defs/LocalizedDescriptionObject" }
28
+ ]
29
+ },
30
+ "PackageAssetPath": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "maxLength": 256,
34
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(/[A-Za-z0-9][A-Za-z0-9._-]*)*$"
35
+ },
36
+ "PackageIcon": {
37
+ "type": "object",
38
+ "properties": {
39
+ "type": { "type": "string", "enum": ["svg", "png"] },
40
+ "src": { "$ref": "#/$defs/PackageAssetPath" }
41
+ },
42
+ "required": ["type", "src"],
43
+ "additionalProperties": false,
44
+ "allOf": [
45
+ {
46
+ "if": { "properties": { "type": { "const": "svg" } }, "required": ["type"] },
47
+ "then": { "properties": { "src": { "pattern": "\\.svg$" } } }
48
+ },
49
+ {
50
+ "if": { "properties": { "type": { "const": "png" } }, "required": ["type"] },
51
+ "then": { "properties": { "src": { "pattern": "\\.png$" } } }
52
+ }
53
+ ]
54
+ },
55
+ "PluginIcon": {
56
+ "oneOf": [
57
+ { "const": "github" },
58
+ { "$ref": "#/$defs/PackageIcon" }
59
+ ]
60
+ }
61
+ }
62
+ }
@@ -1,11 +1,16 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://clowder-ai.dev/schemas/signals/v0.2",
4
- "title": "Clowder AI Signal Ingress Contract (C-2)",
5
- "description": "Declared external signals and the closed events.publish wire payload. Producer identity, provenance, grants, routing, and liveness are Host-bound and intentionally absent from plugin input.",
6
- "x-clowder-payload-max-encoded-bytes": 65536,
7
- "x-clowder-forbidden-privacy-classes": ["av-raw", "input-raw"],
8
- "x-clowder-forbidden-source-classes": ["av-capture", "input-hardware"],
4
+ "title": "Clowder AI Signal Declarations",
5
+ "description": "Manifest-only signal declarations and contribution metadata. Runtime publication is not part of this schema.",
6
+ "x-clowder-forbidden-privacy-classes": [
7
+ "av-raw",
8
+ "input-raw"
9
+ ],
10
+ "x-clowder-forbidden-source-classes": [
11
+ "av-capture",
12
+ "input-hardware"
13
+ ],
9
14
  "$defs": {
10
15
  "SignalType": {
11
16
  "type": "string",
@@ -15,41 +20,80 @@
15
20
  },
16
21
  "SignalSchemaRef": {
17
22
  "type": "string",
18
- "description": "Package-local schema applied to the {payload, source} signal content at publish admission.",
23
+ "description": "Package-local content schema reference declared in manifest metadata.",
19
24
  "minLength": 21,
20
25
  "maxLength": 256,
21
26
  "pattern": "^schemas/([A-Za-z0-9][A-Za-z0-9._-]*/)*[A-Za-z0-9][A-Za-z0-9._-]*\\.schema\\.json$"
22
27
  },
23
28
  "SignalEpistemicStatus": {
24
29
  "type": "string",
25
- "enum": ["observation", "inference"]
30
+ "enum": [
31
+ "observation",
32
+ "inference"
33
+ ]
26
34
  },
27
35
  "SignalPrivacyClass": {
28
36
  "type": "string",
29
- "enum": ["behavioral", "content-adjacent", "content", "av-raw", "input-raw"]
37
+ "enum": [
38
+ "behavioral",
39
+ "content-adjacent",
40
+ "content",
41
+ "av-raw",
42
+ "input-raw"
43
+ ]
30
44
  },
31
45
  "AdmissibleSignalPrivacyClass": {
32
46
  "type": "string",
33
- "enum": ["behavioral", "content-adjacent", "content"]
47
+ "enum": [
48
+ "behavioral",
49
+ "content-adjacent",
50
+ "content"
51
+ ]
34
52
  },
35
53
  "SignalSourceClass": {
36
54
  "type": "string",
37
- "enum": ["os-metadata", "accessibility-api", "remote-service", "av-capture", "input-hardware"]
55
+ "enum": [
56
+ "os-metadata",
57
+ "accessibility-api",
58
+ "remote-service",
59
+ "av-capture",
60
+ "input-hardware"
61
+ ]
38
62
  },
39
63
  "AdmissibleSignalSourceClass": {
40
64
  "type": "string",
41
- "enum": ["os-metadata", "accessibility-api", "remote-service"]
65
+ "enum": [
66
+ "os-metadata",
67
+ "accessibility-api",
68
+ "remote-service"
69
+ ]
42
70
  },
43
71
  "SignalDeclaration": {
44
72
  "type": "object",
45
73
  "properties": {
46
- "type": { "$ref": "#/$defs/SignalType" },
47
- "schemaRef": { "$ref": "#/$defs/SignalSchemaRef" },
48
- "epistemicStatus": { "$ref": "#/$defs/SignalEpistemicStatus" },
49
- "privacyClass": { "$ref": "#/$defs/AdmissibleSignalPrivacyClass" },
50
- "sourceClass": { "$ref": "#/$defs/AdmissibleSignalSourceClass" }
74
+ "type": {
75
+ "$ref": "#/$defs/SignalType"
76
+ },
77
+ "schemaRef": {
78
+ "$ref": "#/$defs/SignalSchemaRef"
79
+ },
80
+ "epistemicStatus": {
81
+ "$ref": "#/$defs/SignalEpistemicStatus"
82
+ },
83
+ "privacyClass": {
84
+ "$ref": "#/$defs/AdmissibleSignalPrivacyClass"
85
+ },
86
+ "sourceClass": {
87
+ "$ref": "#/$defs/AdmissibleSignalSourceClass"
88
+ }
51
89
  },
52
- "required": ["type", "schemaRef", "epistemicStatus", "privacyClass", "sourceClass"],
90
+ "required": [
91
+ "type",
92
+ "schemaRef",
93
+ "epistemicStatus",
94
+ "privacyClass",
95
+ "sourceClass"
96
+ ],
53
97
  "additionalProperties": false
54
98
  },
55
99
  "SignalContribution": {
@@ -57,73 +101,19 @@
57
101
  "properties": {
58
102
  "provides": {
59
103
  "type": "array",
60
- "items": { "$ref": "#/$defs/SignalDeclaration" },
104
+ "items": {
105
+ "$ref": "#/$defs/SignalDeclaration"
106
+ },
61
107
  "minItems": 1,
62
108
  "maxItems": 64,
63
109
  "uniqueItems": true
64
110
  }
65
111
  },
66
- "required": ["provides"],
67
- "additionalProperties": false
68
- },
69
- "SignalEventId": {
70
- "type": "string",
71
- "minLength": 1,
72
- "maxLength": 128,
73
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
74
- },
75
- "SignalIdempotencyKey": {
76
- "type": "string",
77
- "minLength": 1,
78
- "maxLength": 256,
79
- "pattern": "^[^\\u0000-\\u001F\\u007F\\uD800-\\uDFFF]+$"
80
- },
81
- "OpaqueSourceHandle": {
82
- "type": "string",
83
- "minLength": 1,
84
- "maxLength": 512,
85
- "pattern": "^[^\\u0000-\\u001F\\u007F\\uD800-\\uDFFF]+$"
86
- },
87
- "SignalSourceRef": {
88
- "type": "object",
89
- "properties": {
90
- "handle": { "$ref": "#/$defs/OpaqueSourceHandle" }
91
- },
92
- "required": ["handle"],
93
- "additionalProperties": false
94
- },
95
- "EventsPublishInput": {
96
- "type": "object",
97
- "properties": {
98
- "signalType": { "$ref": "#/$defs/SignalType" },
99
- "eventId": { "$ref": "#/$defs/SignalEventId" },
100
- "idempotencyKey": { "$ref": "#/$defs/SignalIdempotencyKey" },
101
- "occurredAt": {
102
- "type": "string",
103
- "format": "date-time",
104
- "minLength": 20,
105
- "maxLength": 30,
106
- "pattern": "Z$"
107
- },
108
- "payload": { "type": "object", "additionalProperties": true },
109
- "source": { "$ref": "#/$defs/SignalSourceRef" }
110
- },
111
- "required": ["signalType", "eventId", "idempotencyKey", "occurredAt", "payload", "source"],
112
- "additionalProperties": false
113
- },
114
- "EventsPublishDisposition": {
115
- "type": "string",
116
- "enum": ["accepted", "duplicate"]
117
- },
118
- "EventsPublishResult": {
119
- "type": "object",
120
- "properties": {
121
- "publicationId": { "$ref": "#/$defs/SignalEventId" },
122
- "disposition": { "$ref": "#/$defs/EventsPublishDisposition" }
123
- },
124
- "required": ["publicationId", "disposition"],
112
+ "required": [
113
+ "provides"
114
+ ],
125
115
  "additionalProperties": false
126
116
  }
127
117
  },
128
- "$ref": "#/$defs/EventsPublishInput"
118
+ "$ref": "#/$defs/SignalContribution"
129
119
  }
@@ -1,4 +0,0 @@
1
- import { type AuthorizationLayer } from '../generated/contract.generated.js';
2
- /** Return the schema-owned authorization layer for a capability identifier. */
3
- export declare function getCapabilityLayer(capability: string): AuthorizationLayer | undefined;
4
- //# sourceMappingURL=capability.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../src/types/capability.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,oCAAoC,CAAC;AAE5C,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAOrF"}
@@ -1,11 +0,0 @@
1
- import { CAPABILITY_TABLE, } from '../generated/contract.generated.js';
2
- /** Return the schema-owned authorization layer for a capability identifier. */
3
- export function getCapabilityLayer(capability) {
4
- for (const layer of Object.keys(CAPABILITY_TABLE)) {
5
- if (CAPABILITY_TABLE[layer].includes(capability)) {
6
- return layer;
7
- }
8
- }
9
- return undefined;
10
- }
11
- //# sourceMappingURL=capability.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capability.js","sourceRoot":"","sources":["../../src/types/capability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,GAEjB,MAAM,oCAAoC,CAAC;AAE5C,+EAA+E;AAC/E,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACnD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAyB,EAAE,CAAC;QAC1E,IAAK,gBAAgB,CAAC,KAAK,CAAuB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACxE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,57 +0,0 @@
1
- /**
2
- * Grant snapshot types — GrantSnapshot for SessionBinding and host.grants.changed.
3
- * Mechanized verbatim from #1165 frozen shape.
4
- *
5
- * GrantSnapshot represents the effective capability set at a point in time.
6
- * It appears in two locations:
7
- * - SessionBinding (initial grant state at handshake)
8
- * - host.grants.changed notification (runtime grant mutations)
9
- *
10
- * grantRevision is strictly monotonic per plugin instance — the Host
11
- * increments it on every grant mutation. A plugin that observes
12
- * revision N may discard any notification with revision < N.
13
- */
14
- import type { Capability } from '../generated/contract.generated.js';
15
- /**
16
- * Maximum number of items in effectiveGrants.
17
- * Derived from the 17-value Capability enum — a plugin cannot hold
18
- * more capabilities than exist.
19
- */
20
- export declare const MAX_GRANT_ITEMS: 17;
21
- /**
22
- * GrantSnapshot captures a versioned capability set.
23
- *
24
- * Used in SessionBinding (handshake) and host.grants.changed (notification).
25
- * The two fields are always paired and always travel together.
26
- */
27
- export interface GrantSnapshot {
28
- /**
29
- * WireUInt53(0, 9_007_199_254_740_991).
30
- * Monotonically increasing per plugin instance.
31
- * The Host is the sole writer; plugins observe only.
32
- */
33
- readonly grantRevision: number;
34
- /**
35
- * Unique Capability[], 0..17 items.
36
- * Duplicates are a protocol violation (Host guarantees uniqueness).
37
- * Empty array is valid (plugin has no capabilities).
38
- */
39
- readonly effectiveGrants: readonly Capability[];
40
- }
41
- /**
42
- * Frozen set of all valid Capability values, derived from the generated
43
- * L0/L1/L2 capability arrays. Used for closed-enum membership checks.
44
- */
45
- export declare const VALID_CAPABILITIES: ReadonlySet<string>;
46
- /**
47
- * Validate that effectiveGrants:
48
- * 1. Does not exceed MAX_GRANT_ITEMS (17).
49
- * 2. Contains no duplicates.
50
- * 3. Contains only valid Capability enum members (closed-enum check).
51
- *
52
- * Fail-closed: any unrecognized capability value returns false.
53
- * This is an authorization boundary — fail-open would allow
54
- * uncontrolled privilege escalation.
55
- */
56
- export declare function validateEffectiveGrants(grants: readonly string[]): boolean;
57
- //# sourceMappingURL=grants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../../src/wire/grants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAWrE;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAG,EAAW,CAAC;AAM3C;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,UAAU,EAAE,CAAC;CACjD;AAMD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAIjD,CAAC;AAEH;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAS1E"}
@@ -1,59 +0,0 @@
1
- /**
2
- * Grant snapshot types — GrantSnapshot for SessionBinding and host.grants.changed.
3
- * Mechanized verbatim from #1165 frozen shape.
4
- *
5
- * GrantSnapshot represents the effective capability set at a point in time.
6
- * It appears in two locations:
7
- * - SessionBinding (initial grant state at handshake)
8
- * - host.grants.changed notification (runtime grant mutations)
9
- *
10
- * grantRevision is strictly monotonic per plugin instance — the Host
11
- * increments it on every grant mutation. A plugin that observes
12
- * revision N may discard any notification with revision < N.
13
- */
14
- import { L0_CAPABILITIES, L1_CAPABILITIES, L2_CAPABILITIES, } from '../generated/contract.generated.js';
15
- // ---------------------------------------------------------------------------
16
- // Constants
17
- // ---------------------------------------------------------------------------
18
- /**
19
- * Maximum number of items in effectiveGrants.
20
- * Derived from the 17-value Capability enum — a plugin cannot hold
21
- * more capabilities than exist.
22
- */
23
- export const MAX_GRANT_ITEMS = 17;
24
- // ---------------------------------------------------------------------------
25
- // Validators
26
- // ---------------------------------------------------------------------------
27
- /**
28
- * Frozen set of all valid Capability values, derived from the generated
29
- * L0/L1/L2 capability arrays. Used for closed-enum membership checks.
30
- */
31
- export const VALID_CAPABILITIES = new Set([
32
- ...L0_CAPABILITIES,
33
- ...L1_CAPABILITIES,
34
- ...L2_CAPABILITIES,
35
- ]);
36
- /**
37
- * Validate that effectiveGrants:
38
- * 1. Does not exceed MAX_GRANT_ITEMS (17).
39
- * 2. Contains no duplicates.
40
- * 3. Contains only valid Capability enum members (closed-enum check).
41
- *
42
- * Fail-closed: any unrecognized capability value returns false.
43
- * This is an authorization boundary — fail-open would allow
44
- * uncontrolled privilege escalation.
45
- */
46
- export function validateEffectiveGrants(grants) {
47
- if (grants.length > MAX_GRANT_ITEMS)
48
- return false;
49
- const seen = new Set();
50
- for (const g of grants) {
51
- if (!VALID_CAPABILITIES.has(g))
52
- return false; // unknown capability
53
- if (seen.has(g))
54
- return false; // duplicate
55
- seen.add(g);
56
- }
57
- return true;
58
- }
59
- //# sourceMappingURL=grants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grants.js","sourceRoot":"","sources":["../../src/wire/grants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,eAAe,EACf,eAAe,EACf,eAAe,GAChB,MAAM,oCAAoC,CAAC;AAE5C,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAW,CAAC;AA2B3C,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAS;IACrE,GAAG,eAAe;IAClB,GAAG,eAAe;IAClB,GAAG,eAAe;CACnB,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAyB;IAC/D,IAAI,MAAM,CAAC,MAAM,GAAG,eAAe;QAAE,OAAO,KAAK,CAAC;IAClD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC,CAAC,qBAAqB;QACnE,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC,CAAgB,YAAY;QAC1D,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,97 +0,0 @@
1
- /**
2
- * Derived compact-JSON byte bounds for the beta.9 C-2 events.publish row.
3
- *
4
- * Signal payloads are bounded by their compact encoded byte length, not by a
5
- * string code-point count. That makes the generic leaf proof insufficient for
6
- * row 13: this module constructs an exactly 64 KiB JSON object independently
7
- * for ASCII, multibyte, and escaped-string families, then measures the entire
8
- * request envelope and one rejected N+1 witness for every bounded leaf.
9
- */
10
- import type { EventsPublishInput, EventsPublishResult } from '../generated/contract.generated.js';
11
- export declare const EVENTS_PUBLISH_BYTE_PROOF_ENCODING_FAMILIES: readonly ["ascii", "multibyte", "escaping"];
12
- export type EventsPublishByteProofEncodingFamily = (typeof EVENTS_PUBLISH_BYTE_PROOF_ENCODING_FAMILIES)[number];
13
- export declare const SIGNAL_TYPE_MAX_LENGTH: 128;
14
- export declare const SIGNAL_EVENT_ID_MAX_LENGTH: 128;
15
- export declare const SIGNAL_IDEMPOTENCY_KEY_MAX_LENGTH: 256;
16
- export declare const SIGNAL_OCCURRED_AT_MAX_LENGTH: 30;
17
- export declare const SIGNAL_SOURCE_HANDLE_MAX_LENGTH: 512;
18
- interface EventsPublishProofInput {
19
- readonly requestId: string;
20
- readonly input: EventsPublishInput;
21
- readonly payloadEncodedBytes: number;
22
- }
23
- export interface EventsPublishNPlusOneWitness extends EventsPublishProofInput {
24
- readonly leaf: 'requestId' | 'signalType' | 'eventId' | 'idempotencyKey' | 'occurredAt' | 'payloadBytes' | 'sourceHandle';
25
- readonly encodedBytes: number;
26
- readonly fitsFrame: boolean;
27
- }
28
- export interface EventsPublishEncodedByteProofCase {
29
- readonly family: EventsPublishByteProofEncodingFamily;
30
- readonly encodedBytes: number;
31
- readonly fitsFrame: boolean;
32
- readonly nPlusOne: readonly {
33
- readonly leaf: string;
34
- readonly encodedBytes: number;
35
- readonly fitsFrame: boolean;
36
- }[];
37
- }
38
- export interface EventsPublishEncodedByteProof {
39
- readonly maxEncodedBytes: number;
40
- readonly cases: readonly EventsPublishEncodedByteProofCase[];
41
- }
42
- export interface EventsPublishRowEncodedByteBounds {
43
- readonly maxEncodedRequestBytes: number;
44
- readonly maxEncodedResultBytes: number;
45
- readonly maxEncodedErrorBytes: number;
46
- }
47
- export declare function eventsPublishMaximumInput(family: EventsPublishByteProofEncodingFamily): EventsPublishProofInput;
48
- export declare function eventsPublishNPlusOneInputs(family: EventsPublishByteProofEncodingFamily): readonly EventsPublishNPlusOneWitness[];
49
- export declare function eventsPublishMaximumResult(): {
50
- readonly requestId: string;
51
- readonly result: EventsPublishResult;
52
- };
53
- export declare function eventsPublishResultNPlusOneWitnesses(): readonly [{
54
- readonly leaf: "requestId";
55
- readonly requestId: string;
56
- readonly result: EventsPublishResult;
57
- }, {
58
- readonly leaf: "publicationId";
59
- readonly result: {
60
- readonly publicationId: string;
61
- readonly disposition: import("../generated/contract.generated.js").EventsPublishDisposition;
62
- };
63
- readonly requestId: string;
64
- }];
65
- export declare function eventsPublishStandardErrorEnvelopes(): ({
66
- arm: string;
67
- id: null;
68
- error: {
69
- code: -32700 | -32600 | -32601 | -32602 | -32603;
70
- message: "Parse error" | "Invalid Request" | "Method not found" | "Invalid params" | "Internal error";
71
- };
72
- } | {
73
- arm: string;
74
- id: string;
75
- error: {
76
- code: -32700 | -32600 | -32601 | -32602 | -32603;
77
- message: "Parse error" | "Invalid Request" | "Method not found" | "Invalid params" | "Internal error";
78
- };
79
- })[];
80
- export declare function eventsPublishStandardErrorNPlusOneWitnesses(): {
81
- id: string;
82
- arm: string;
83
- error: {
84
- code: -32700 | -32600 | -32601 | -32602 | -32603;
85
- message: "Parse error" | "Invalid Request" | "Method not found" | "Invalid params" | "Internal error";
86
- };
87
- }[];
88
- export declare const EVENTS_PUBLISH_REQUEST_BYTE_PROOF: EventsPublishEncodedByteProof;
89
- export declare const EVENTS_PUBLISH_RESULT_BYTE_PROOF: EventsPublishEncodedByteProof;
90
- export declare const EVENTS_PUBLISH_ERROR_BYTE_PROOF: EventsPublishEncodedByteProof;
91
- export declare const EVENTS_PUBLISH_ROW_ENCODED_BYTE_BOUNDS: {
92
- readonly maxEncodedRequestBytes: number;
93
- readonly maxEncodedResultBytes: number;
94
- readonly maxEncodedErrorBytes: number;
95
- };
96
- export {};
97
- //# sourceMappingURL=signal-byte-bounds.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signal-byte-bounds.d.ts","sourceRoot":"","sources":["../../src/wire/signal-byte-bounds.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,oCAAoC,CAAC;AAY5C,eAAO,MAAM,2CAA2C,6CAI9C,CAAC;AAEX,MAAM,MAAM,oCAAoC,GAC9C,CAAC,OAAO,2CAA2C,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,sBAAsB,EAAG,GAAY,CAAC;AACnD,eAAO,MAAM,0BAA0B,EAAG,GAAY,CAAC;AACvD,eAAO,MAAM,iCAAiC,EAAG,GAAY,CAAC;AAC9D,eAAO,MAAM,6BAA6B,EAAG,EAAW,CAAC;AACzD,eAAO,MAAM,+BAA+B,EAAG,GAAY,CAAC;AAI5D,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,4BAA6B,SAAQ,uBAAuB;IAC3E,QAAQ,CAAC,IAAI,EACT,WAAW,GACX,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,YAAY,GACZ,cAAc,GACd,cAAc,CAAC;IACnB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,MAAM,EAAE,oCAAoC,CAAC;IACtD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS;QAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;KAC7B,EAAE,CAAC;CACL;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,iCAAiC,EAAE,CAAC;CAC9D;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;CACvC;AAwED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,oCAAoC,GAC3C,uBAAuB,CAOzB;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,oCAAoC,GAC3C,SAAS,4BAA4B,EAAE,CAuDzC;AA6BD,wBAAgB,0BAA0B,IAAI;IAC5C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;CACtC,CAKA;AAED,wBAAgB,oCAAoC;;;qBARjC,mBAAmB;;;;;;;wBADhB,MAAM;GAmB3B;AAED,wBAAgB,mCAAmC;;;;;;;;;;;;;;KAWlD;AAED,wBAAgB,2CAA2C;;;;;;;IAI1D;AAoBD,eAAO,MAAM,iCAAiC,+BAAiB,CAAC;AAGhE,eAAO,MAAM,gCAAgC,+BAM5C,CAAC;AAEF,eAAO,MAAM,+BAA+B,+BAO3C,CAAC;AAEF,eAAO,MAAM,sCAAsC;;;;CAIG,CAAC"}