@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
@@ -4,37 +4,65 @@
4
4
  "title": "Clowder AI Contract Behavior Fixture",
5
5
  "type": "object",
6
6
  "properties": {
7
- "_meta": { "$ref": "#/$defs/FixtureMetadata" },
7
+ "_meta": {
8
+ "$ref": "#/$defs/FixtureMetadata"
9
+ },
8
10
  "cases": {
9
11
  "type": "array",
10
- "items": { "$ref": "#/$defs/BehaviorCase" },
12
+ "items": {
13
+ "$ref": "#/$defs/BehaviorCase"
14
+ },
11
15
  "minItems": 1
12
16
  }
13
17
  },
14
- "required": ["_meta", "cases"],
18
+ "required": [
19
+ "_meta",
20
+ "cases"
21
+ ],
15
22
  "additionalProperties": false,
16
23
  "$defs": {
17
24
  "FixtureMetadata": {
18
25
  "type": "object",
19
26
  "properties": {
20
- "executor": { "const": "loopback" },
21
- "domain": { "const": "messaging" },
27
+ "executor": {
28
+ "const": "loopback"
29
+ },
30
+ "domain": {
31
+ "const": "messaging"
32
+ },
22
33
  "contractVersion": {
23
34
  "type": "string",
24
35
  "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-]*))*)?$"
25
36
  },
26
- "source": { "type": "string", "minLength": 1 },
27
- "description": { "type": "string", "minLength": 1 }
37
+ "source": {
38
+ "type": "string",
39
+ "minLength": 1
40
+ },
41
+ "description": {
42
+ "type": "string",
43
+ "minLength": 1
44
+ }
28
45
  },
29
- "required": ["executor", "domain", "contractVersion", "source", "description"],
46
+ "required": [
47
+ "executor",
48
+ "domain",
49
+ "contractVersion",
50
+ "source",
51
+ "description"
52
+ ],
30
53
  "additionalProperties": false
31
54
  },
32
55
  "FixtureCaller": {
33
56
  "type": "object",
34
57
  "properties": {
35
- "pluginInstanceId": { "type": "string", "minLength": 1 }
58
+ "pluginInstanceId": {
59
+ "type": "string",
60
+ "minLength": 1
61
+ }
36
62
  },
37
- "required": ["pluginInstanceId"],
63
+ "required": [
64
+ "pluginInstanceId"
65
+ ],
38
66
  "additionalProperties": false
39
67
  },
40
68
  "FixtureHandle": {
@@ -42,37 +70,67 @@
42
70
  "properties": {
43
71
  "kind": {
44
72
  "type": "string",
45
- "enum": ["thread_handle", "connector_binding", "message_handle", "subscription"]
46
- },
47
- "token": { "type": "string", "minLength": 1 },
48
- "ownerPluginInstanceId": { "type": "string", "minLength": 1 },
49
- "threadId": { "type": "string", "minLength": 1 },
50
- "messageId": { "type": "string", "minLength": 1 },
51
- "connectorId": { "type": "string", "minLength": 1 },
52
- "subscriptionId": { "type": "string", "minLength": 1 }
73
+ "enum": [
74
+ "thread_handle",
75
+ "connector_binding",
76
+ "message_handle",
77
+ "subscription"
78
+ ]
79
+ },
80
+ "token": {
81
+ "type": "string",
82
+ "minLength": 1
83
+ },
84
+ "ownerPluginInstanceId": {
85
+ "type": "string",
86
+ "minLength": 1
87
+ },
88
+ "threadId": {
89
+ "type": "string",
90
+ "minLength": 1
91
+ },
92
+ "messageId": {
93
+ "type": "string",
94
+ "minLength": 1
95
+ },
96
+ "connectorId": {
97
+ "type": "string",
98
+ "minLength": 1
99
+ },
100
+ "subscriptionId": {
101
+ "type": "string",
102
+ "minLength": 1
103
+ }
53
104
  },
54
- "required": ["kind", "token", "ownerPluginInstanceId"],
105
+ "required": [
106
+ "kind",
107
+ "token",
108
+ "ownerPluginInstanceId"
109
+ ],
55
110
  "additionalProperties": false
56
111
  },
57
112
  "FixtureSetup": {
58
113
  "type": "object",
59
114
  "properties": {
60
- "caller": { "$ref": "#/$defs/FixtureCaller" },
61
- "grants": {
62
- "type": "array",
63
- "items": { "$ref": "#/$defs/CapabilityName" },
64
- "uniqueItems": true
115
+ "caller": {
116
+ "$ref": "#/$defs/FixtureCaller"
65
117
  },
66
118
  "handles": {
67
119
  "type": "object",
68
- "additionalProperties": { "$ref": "#/$defs/FixtureHandle" }
120
+ "additionalProperties": {
121
+ "$ref": "#/$defs/FixtureHandle"
122
+ }
69
123
  },
70
124
  "state": {
71
125
  "type": "object",
72
126
  "additionalProperties": true
73
127
  }
74
128
  },
75
- "required": ["caller", "grants", "handles", "state"],
129
+ "required": [
130
+ "caller",
131
+ "handles",
132
+ "state"
133
+ ],
76
134
  "additionalProperties": false
77
135
  },
78
136
  "FixtureOperation": {
@@ -80,100 +138,252 @@
80
138
  {
81
139
  "type": "object",
82
140
  "properties": {
83
- "operation": { "const": "send" },
84
- "input": { "$ref": "#/$defs/SendOperationInput" }
141
+ "operation": {
142
+ "const": "send"
143
+ },
144
+ "input": {
145
+ "$ref": "#/$defs/SendOperationInput"
146
+ }
85
147
  },
86
- "required": ["operation", "input"],
148
+ "required": [
149
+ "operation",
150
+ "input"
151
+ ],
87
152
  "additionalProperties": false
88
153
  },
89
154
  {
90
155
  "type": "object",
91
156
  "properties": {
92
- "operation": { "const": "appendElements" },
93
- "input": { "$ref": "#/$defs/AppendOperationInput" }
157
+ "operation": {
158
+ "const": "appendElements"
159
+ },
160
+ "input": {
161
+ "$ref": "#/$defs/AppendOperationInput"
162
+ }
94
163
  },
95
- "required": ["operation", "input"],
164
+ "required": [
165
+ "operation",
166
+ "input"
167
+ ],
96
168
  "additionalProperties": false
97
169
  },
98
170
  {
99
171
  "type": "object",
100
172
  "properties": {
101
- "operation": { "const": "subscribe" },
102
- "input": { "$ref": "#/$defs/SubscribeOperationInput" }
173
+ "operation": {
174
+ "const": "subscribe"
175
+ },
176
+ "input": {
177
+ "$ref": "#/$defs/SubscribeOperationInput"
178
+ }
103
179
  },
104
- "required": ["operation", "input"],
180
+ "required": [
181
+ "operation",
182
+ "input"
183
+ ],
105
184
  "additionalProperties": false
106
185
  },
107
186
  {
108
187
  "type": "object",
109
188
  "properties": {
110
- "operation": { "const": "read" },
111
- "input": { "$ref": "#/$defs/ReadOperationInput" }
189
+ "operation": {
190
+ "const": "read"
191
+ },
192
+ "input": {
193
+ "$ref": "#/$defs/ReadOperationInput"
194
+ }
112
195
  },
113
- "required": ["operation", "input"],
196
+ "required": [
197
+ "operation",
198
+ "input"
199
+ ],
114
200
  "additionalProperties": false
115
201
  },
116
202
  {
117
203
  "type": "object",
118
204
  "properties": {
119
- "operation": { "const": "ack" },
120
- "input": { "$ref": "#/$defs/AckOperationInput" }
205
+ "operation": {
206
+ "const": "ack"
207
+ },
208
+ "input": {
209
+ "$ref": "#/$defs/AckOperationInput"
210
+ }
121
211
  },
122
- "required": ["operation", "input"],
212
+ "required": [
213
+ "operation",
214
+ "input"
215
+ ],
123
216
  "additionalProperties": false
124
217
  },
125
218
  {
126
219
  "type": "object",
127
220
  "properties": {
128
- "operation": { "const": "snapshot" },
129
- "input": { "$ref": "#/$defs/SnapshotOperationInput" }
221
+ "operation": {
222
+ "const": "snapshot"
223
+ },
224
+ "input": {
225
+ "$ref": "#/$defs/SnapshotOperationInput"
226
+ }
130
227
  },
131
- "required": ["operation", "input"],
228
+ "required": [
229
+ "operation",
230
+ "input"
231
+ ],
132
232
  "additionalProperties": false
133
233
  },
134
234
  {
135
235
  "type": "object",
136
236
  "properties": {
137
- "operation": { "const": "applyGrantPreset" },
138
- "input": { "$ref": "#/$defs/GrantPresetInput" }
237
+ "operation": {
238
+ "const": "deliverOnMessage"
239
+ },
240
+ "input": {
241
+ "$ref": "#/$defs/OnMessageDeliveryInput"
242
+ }
139
243
  },
140
- "required": ["operation", "input"],
244
+ "required": [
245
+ "operation",
246
+ "input"
247
+ ],
141
248
  "additionalProperties": false
142
249
  },
143
250
  {
144
251
  "type": "object",
145
252
  "properties": {
146
- "operation": { "const": "revokeGrant" },
147
- "input": { "$ref": "#/$defs/RevokeGrantInput" }
253
+ "operation": {
254
+ "const": "deleteReplayEvents"
255
+ },
256
+ "input": {
257
+ "$ref": "#/$defs/DeleteReplayEventsInput"
258
+ }
148
259
  },
149
- "required": ["operation", "input"],
260
+ "required": [
261
+ "operation",
262
+ "input"
263
+ ],
264
+ "additionalProperties": false
265
+ }
266
+ ]
267
+ },
268
+ "PluginToHostMethod": {
269
+ "type": "string",
270
+ "enum": [
271
+ "messaging.send",
272
+ "messaging.appendElements",
273
+ "messaging.subscribe",
274
+ "messaging.read",
275
+ "messaging.ack",
276
+ "messaging.snapshot"
277
+ ]
278
+ },
279
+ "BehaviorExpectationOracle": {
280
+ "type": "object",
281
+ "properties": {
282
+ "kind": {
283
+ "const": "behavior-expectation"
284
+ }
285
+ },
286
+ "required": [
287
+ "kind"
288
+ ],
289
+ "additionalProperties": false
290
+ },
291
+ "JsonRpcAdmissionOracle": {
292
+ "type": "object",
293
+ "properties": {
294
+ "kind": {
295
+ "const": "json-rpc-error"
296
+ },
297
+ "code": {
298
+ "const": -32602
299
+ },
300
+ "sideEffects": {
301
+ "const": "behavior-expectation"
302
+ }
303
+ },
304
+ "required": [
305
+ "kind",
306
+ "code",
307
+ "sideEffects"
308
+ ],
309
+ "additionalProperties": false
310
+ },
311
+ "BehaviorExecution": {
312
+ "oneOf": [
313
+ {
314
+ "type": "object",
315
+ "properties": {
316
+ "plane": {
317
+ "const": "plugin-to-host-wire"
318
+ },
319
+ "method": {
320
+ "$ref": "#/$defs/PluginToHostMethod"
321
+ },
322
+ "verdictOracle": {
323
+ "$ref": "#/$defs/BehaviorExpectationOracle"
324
+ }
325
+ },
326
+ "required": [
327
+ "plane",
328
+ "method",
329
+ "verdictOracle"
330
+ ],
150
331
  "additionalProperties": false
151
332
  },
152
333
  {
153
334
  "type": "object",
154
335
  "properties": {
155
- "operation": { "const": "deliverOnMessage" },
156
- "input": { "$ref": "#/$defs/OnMessageDeliveryInput" }
336
+ "plane": {
337
+ "const": "wire-admission"
338
+ },
339
+ "method": {
340
+ "$ref": "#/$defs/PluginToHostMethod"
341
+ },
342
+ "verdictOracle": {
343
+ "$ref": "#/$defs/JsonRpcAdmissionOracle"
344
+ }
157
345
  },
158
- "required": ["operation", "input"],
346
+ "required": [
347
+ "plane",
348
+ "method",
349
+ "verdictOracle"
350
+ ],
159
351
  "additionalProperties": false
160
352
  },
161
353
  {
162
354
  "type": "object",
163
355
  "properties": {
164
- "operation": { "const": "checkPermissionMatrix" },
165
- "input": { "$ref": "#/$defs/PermissionMatrixInput" }
356
+ "plane": {
357
+ "const": "host-to-plugin-delivery"
358
+ },
359
+ "method": {
360
+ "const": "host.messaging.deliver"
361
+ },
362
+ "verdictOracle": {
363
+ "$ref": "#/$defs/BehaviorExpectationOracle"
364
+ }
166
365
  },
167
- "required": ["operation", "input"],
366
+ "required": [
367
+ "plane",
368
+ "method",
369
+ "verdictOracle"
370
+ ],
168
371
  "additionalProperties": false
169
372
  },
170
373
  {
171
374
  "type": "object",
172
375
  "properties": {
173
- "operation": { "const": "deleteReplayEvents" },
174
- "input": { "$ref": "#/$defs/DeleteReplayEventsInput" }
376
+ "plane": {
377
+ "const": "host-control"
378
+ },
379
+ "verdictOracle": {
380
+ "$ref": "#/$defs/BehaviorExpectationOracle"
381
+ }
175
382
  },
176
- "required": ["operation", "input"],
383
+ "required": [
384
+ "plane",
385
+ "verdictOracle"
386
+ ],
177
387
  "additionalProperties": false
178
388
  }
179
389
  ]
@@ -181,190 +391,628 @@
181
391
  "SendOperationInput": {
182
392
  "type": "object",
183
393
  "properties": {
184
- "address": { "type": "object" },
185
- "idempotencyKey": { "type": "string", "minLength": 1 },
186
- "payload": { "type": "object" }
394
+ "address": {
395
+ "type": "object"
396
+ },
397
+ "idempotencyKey": {
398
+ "type": "string",
399
+ "minLength": 1
400
+ },
401
+ "payload": {
402
+ "type": "object"
403
+ }
187
404
  },
188
- "required": ["address", "idempotencyKey", "payload"],
405
+ "required": [
406
+ "address",
407
+ "idempotencyKey",
408
+ "payload"
409
+ ],
189
410
  "additionalProperties": true
190
411
  },
191
412
  "AppendOperationInput": {
192
413
  "type": "object",
193
414
  "properties": {
194
- "handle": { "type": "object" },
195
- "operationId": { "type": "string", "minLength": 1 },
196
- "elements": { "type": "array", "minItems": 1 }
415
+ "handle": {
416
+ "type": "object"
417
+ },
418
+ "operationId": {
419
+ "type": "string",
420
+ "minLength": 1
421
+ },
422
+ "elements": {
423
+ "type": "array",
424
+ "minItems": 1
425
+ }
197
426
  },
198
- "required": ["handle", "operationId", "elements"],
427
+ "required": [
428
+ "handle",
429
+ "operationId",
430
+ "elements"
431
+ ],
199
432
  "additionalProperties": true
200
433
  },
201
434
  "SubscribeOperationInput": {
202
435
  "type": "object",
203
436
  "properties": {
204
- "handleId": { "type": "string", "minLength": 1 }
437
+ "handleId": {
438
+ "type": "string",
439
+ "minLength": 1
440
+ }
205
441
  },
206
- "required": ["handleId"],
442
+ "required": [
443
+ "handleId"
444
+ ],
207
445
  "additionalProperties": false
208
446
  },
209
447
  "ReadOperationInput": {
210
448
  "type": "object",
211
449
  "properties": {
212
- "subscriptionId": { "type": "string", "minLength": 1 },
213
- "limit": { "type": "integer", "minimum": 1, "maximum": 32 }
450
+ "subscriptionId": {
451
+ "type": "string",
452
+ "minLength": 1
453
+ },
454
+ "limit": {
455
+ "type": "integer",
456
+ "minimum": 1,
457
+ "maximum": 32
458
+ }
214
459
  },
215
- "required": ["subscriptionId"],
460
+ "required": [
461
+ "subscriptionId"
462
+ ],
216
463
  "additionalProperties": false
217
464
  },
218
465
  "AckOperationInput": {
219
466
  "type": "object",
220
467
  "properties": {
221
- "subscriptionId": { "type": "string", "minLength": 1 },
222
- "ackToken": { "type": "string", "minLength": 1 }
468
+ "subscriptionId": {
469
+ "type": "string",
470
+ "minLength": 1
471
+ },
472
+ "ackToken": {
473
+ "type": "string",
474
+ "minLength": 1
475
+ }
223
476
  },
224
- "required": ["subscriptionId", "ackToken"],
477
+ "required": [
478
+ "subscriptionId",
479
+ "ackToken"
480
+ ],
225
481
  "additionalProperties": false
226
482
  },
227
483
  "SnapshotOperationInput": {
228
484
  "type": "object",
229
485
  "properties": {
230
- "subscriptionId": { "type": "string", "minLength": 1 }
231
- },
232
- "required": ["subscriptionId"],
233
- "additionalProperties": false
234
- },
235
- "CapabilityName": {
236
- "$ref": "https://clowder-ai.dev/schemas/manifest/v0.1#/$defs/Capability"
237
- },
238
- "GrantPresetInput": {
239
- "type": "object",
240
- "properties": {
241
- "presetKind": { "const": "first_party" },
242
- "capabilities": {
243
- "type": "array",
244
- "items": { "$ref": "#/$defs/CapabilityName" },
245
- "minItems": 1,
246
- "uniqueItems": true
486
+ "subscriptionId": {
487
+ "type": "string",
488
+ "minLength": 1
247
489
  }
248
490
  },
249
- "required": ["presetKind", "capabilities"],
250
- "additionalProperties": false
251
- },
252
- "RevokeGrantInput": {
253
- "type": "object",
254
- "properties": {
255
- "capability": { "$ref": "#/$defs/CapabilityName" }
256
- },
257
- "required": ["capability"],
491
+ "required": [
492
+ "subscriptionId"
493
+ ],
258
494
  "additionalProperties": false
259
495
  },
260
496
  "OnMessageDeliveryInput": {
261
497
  "type": "object",
262
498
  "properties": {
263
- "threadHandle": { "type": "string", "minLength": 1 },
264
- "envelope": { "type": "object" }
265
- },
266
- "required": ["threadHandle", "envelope"],
267
- "additionalProperties": false
268
- },
269
- "PermissionMatrixEntry": {
270
- "type": "object",
271
- "properties": {
272
- "capability": { "$ref": "#/$defs/CapabilityName" },
273
- "layer": { "type": "string", "enum": ["L0", "L1", "L2"] },
274
- "firstPartyPreset": { "type": "boolean" }
275
- },
276
- "required": ["capability", "layer", "firstPartyPreset"],
277
- "additionalProperties": false
278
- },
279
- "PermissionMatrixInput": {
280
- "type": "object",
281
- "properties": {
282
- "entries": {
283
- "type": "array",
284
- "items": { "$ref": "#/$defs/PermissionMatrixEntry" },
285
- "minItems": 17,
286
- "maxItems": 17
499
+ "threadHandle": {
500
+ "type": "string",
501
+ "minLength": 1
502
+ },
503
+ "envelope": {
504
+ "type": "object"
287
505
  }
288
506
  },
289
- "required": ["entries"],
507
+ "required": [
508
+ "threadHandle",
509
+ "envelope"
510
+ ],
290
511
  "additionalProperties": false
291
512
  },
292
513
  "DeleteReplayEventsInput": {
293
514
  "type": "object",
294
515
  "properties": {
295
- "subscriptionId": { "type": "string", "minLength": 1 },
296
- "throughSequence": { "type": "integer", "minimum": 0 }
516
+ "subscriptionId": {
517
+ "type": "string",
518
+ "minLength": 1
519
+ },
520
+ "throughSequence": {
521
+ "type": "integer",
522
+ "minimum": 0
523
+ }
297
524
  },
298
- "required": ["subscriptionId", "throughSequence"],
525
+ "required": [
526
+ "subscriptionId",
527
+ "throughSequence"
528
+ ],
299
529
  "additionalProperties": false
300
530
  },
301
531
  "MessagingErrorCode": {
302
532
  "type": "string",
303
- "enum": ["VALIDATION", "PERMISSION", "NOT_FOUND", "CONFLICT", "RETRYABLE_INFLIGHT", "STALE_CURSOR"]
533
+ "enum": [
534
+ "VALIDATION",
535
+ "PERMISSION",
536
+ "NOT_FOUND",
537
+ "CONFLICT",
538
+ "RETRYABLE_INFLIGHT",
539
+ "STALE_CURSOR",
540
+ "MEDIA_ACCESS_DENIED",
541
+ "MESSAGE_NOT_PUBLISHED"
542
+ ]
304
543
  },
305
544
  "SideEffectAssertion": {
306
545
  "type": "object",
307
546
  "properties": {
308
547
  "target": {
309
548
  "type": "string",
310
- "enum": ["messages", "output_events", "idempotency_ledger", "subscription", "snapshot", "reply_preview", "provenance", "grant_state", "permission_matrix", "replay_events"]
549
+ "enum": [
550
+ "messages",
551
+ "output_events",
552
+ "idempotency_ledger",
553
+ "subscription",
554
+ "snapshot",
555
+ "reply_preview",
556
+ "provenance",
557
+ "replay_events"
558
+ ]
311
559
  },
312
560
  "assertion": {
313
561
  "type": "string",
314
- "enum": ["unchanged", "none", "state_equals", "round_trip", "matches"]
562
+ "enum": [
563
+ "unchanged",
564
+ "none",
565
+ "state_equals",
566
+ "round_trip",
567
+ "matches"
568
+ ]
315
569
  },
316
570
  "value": true
317
571
  },
318
- "required": ["target", "assertion"],
572
+ "required": [
573
+ "target",
574
+ "assertion"
575
+ ],
319
576
  "additionalProperties": false,
320
577
  "allOf": [
321
578
  {
322
579
  "if": {
323
580
  "properties": {
324
- "assertion": { "enum": ["state_equals", "round_trip", "matches"] }
581
+ "assertion": {
582
+ "enum": [
583
+ "state_equals",
584
+ "round_trip",
585
+ "matches"
586
+ ]
587
+ }
325
588
  },
326
- "required": ["assertion"]
589
+ "required": [
590
+ "assertion"
591
+ ]
592
+ },
593
+ "then": {
594
+ "required": [
595
+ "value"
596
+ ]
327
597
  },
328
- "then": { "required": ["value"] },
329
- "else": { "not": { "required": ["value"] } }
598
+ "else": {
599
+ "not": {
600
+ "required": [
601
+ "value"
602
+ ]
603
+ }
604
+ }
330
605
  }
331
606
  ]
332
607
  },
333
608
  "ExpectedVerdict": {
334
609
  "type": "object",
335
610
  "properties": {
336
- "status": { "type": "string", "enum": ["success", "error"] },
337
- "errorCode": { "$ref": "#/$defs/MessagingErrorCode" },
611
+ "status": {
612
+ "type": "string",
613
+ "enum": [
614
+ "success",
615
+ "error"
616
+ ]
617
+ },
618
+ "errorCode": {
619
+ "$ref": "#/$defs/MessagingErrorCode"
620
+ },
338
621
  "sideEffects": {
339
622
  "type": "array",
340
- "items": { "$ref": "#/$defs/SideEffectAssertion" },
623
+ "items": {
624
+ "$ref": "#/$defs/SideEffectAssertion"
625
+ },
341
626
  "minItems": 1
342
627
  }
343
628
  },
344
- "required": ["status", "sideEffects"],
629
+ "required": [
630
+ "status",
631
+ "sideEffects"
632
+ ],
345
633
  "additionalProperties": false,
346
634
  "allOf": [
347
635
  {
348
636
  "if": {
349
- "properties": { "status": { "const": "error" } },
350
- "required": ["status"]
637
+ "properties": {
638
+ "status": {
639
+ "const": "error"
640
+ }
641
+ },
642
+ "required": [
643
+ "status"
644
+ ]
351
645
  },
352
- "then": { "required": ["errorCode"] },
353
- "else": { "not": { "required": ["errorCode"] } }
646
+ "then": {
647
+ "required": [
648
+ "errorCode"
649
+ ]
650
+ },
651
+ "else": {
652
+ "not": {
653
+ "required": [
654
+ "errorCode"
655
+ ]
656
+ }
657
+ }
354
658
  }
355
659
  ]
356
660
  },
357
661
  "BehaviorCase": {
358
662
  "type": "object",
359
663
  "properties": {
360
- "id": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
361
- "invariant": { "type": "string", "minLength": 1 },
362
- "given": { "$ref": "#/$defs/FixtureSetup" },
363
- "when": { "$ref": "#/$defs/FixtureOperation" },
364
- "expect": { "$ref": "#/$defs/ExpectedVerdict" }
664
+ "id": {
665
+ "type": "string",
666
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
667
+ },
668
+ "invariant": {
669
+ "type": "string",
670
+ "minLength": 1
671
+ },
672
+ "execution": {
673
+ "$ref": "#/$defs/BehaviorExecution"
674
+ },
675
+ "given": {
676
+ "$ref": "#/$defs/FixtureSetup"
677
+ },
678
+ "when": {
679
+ "$ref": "#/$defs/FixtureOperation"
680
+ },
681
+ "expect": {
682
+ "$ref": "#/$defs/ExpectedVerdict"
683
+ }
365
684
  },
366
- "required": ["id", "invariant", "given", "when", "expect"],
367
- "additionalProperties": false
685
+ "required": [
686
+ "id",
687
+ "invariant",
688
+ "execution",
689
+ "given",
690
+ "when",
691
+ "expect"
692
+ ],
693
+ "additionalProperties": false,
694
+ "allOf": [
695
+ {
696
+ "if": {
697
+ "properties": {
698
+ "when": {
699
+ "properties": {
700
+ "operation": {
701
+ "const": "send"
702
+ }
703
+ },
704
+ "required": [
705
+ "operation"
706
+ ]
707
+ }
708
+ },
709
+ "required": [
710
+ "when"
711
+ ]
712
+ },
713
+ "then": {
714
+ "properties": {
715
+ "execution": {
716
+ "type": "object",
717
+ "properties": {
718
+ "plane": {
719
+ "enum": [
720
+ "plugin-to-host-wire",
721
+ "wire-admission"
722
+ ]
723
+ },
724
+ "method": {
725
+ "const": "messaging.send"
726
+ }
727
+ },
728
+ "required": [
729
+ "plane",
730
+ "method"
731
+ ]
732
+ }
733
+ }
734
+ }
735
+ },
736
+ {
737
+ "if": {
738
+ "properties": {
739
+ "when": {
740
+ "properties": {
741
+ "operation": {
742
+ "const": "appendElements"
743
+ }
744
+ },
745
+ "required": [
746
+ "operation"
747
+ ]
748
+ }
749
+ },
750
+ "required": [
751
+ "when"
752
+ ]
753
+ },
754
+ "then": {
755
+ "properties": {
756
+ "execution": {
757
+ "type": "object",
758
+ "properties": {
759
+ "plane": {
760
+ "enum": [
761
+ "plugin-to-host-wire",
762
+ "wire-admission"
763
+ ]
764
+ },
765
+ "method": {
766
+ "const": "messaging.appendElements"
767
+ }
768
+ },
769
+ "required": [
770
+ "plane",
771
+ "method"
772
+ ]
773
+ }
774
+ }
775
+ }
776
+ },
777
+ {
778
+ "if": {
779
+ "properties": {
780
+ "when": {
781
+ "properties": {
782
+ "operation": {
783
+ "const": "subscribe"
784
+ }
785
+ },
786
+ "required": [
787
+ "operation"
788
+ ]
789
+ }
790
+ },
791
+ "required": [
792
+ "when"
793
+ ]
794
+ },
795
+ "then": {
796
+ "properties": {
797
+ "execution": {
798
+ "type": "object",
799
+ "properties": {
800
+ "plane": {
801
+ "enum": [
802
+ "plugin-to-host-wire",
803
+ "wire-admission"
804
+ ]
805
+ },
806
+ "method": {
807
+ "const": "messaging.subscribe"
808
+ }
809
+ },
810
+ "required": [
811
+ "plane",
812
+ "method"
813
+ ]
814
+ }
815
+ }
816
+ }
817
+ },
818
+ {
819
+ "if": {
820
+ "properties": {
821
+ "when": {
822
+ "properties": {
823
+ "operation": {
824
+ "const": "read"
825
+ }
826
+ },
827
+ "required": [
828
+ "operation"
829
+ ]
830
+ }
831
+ },
832
+ "required": [
833
+ "when"
834
+ ]
835
+ },
836
+ "then": {
837
+ "properties": {
838
+ "execution": {
839
+ "type": "object",
840
+ "properties": {
841
+ "plane": {
842
+ "enum": [
843
+ "plugin-to-host-wire",
844
+ "wire-admission"
845
+ ]
846
+ },
847
+ "method": {
848
+ "const": "messaging.read"
849
+ }
850
+ },
851
+ "required": [
852
+ "plane",
853
+ "method"
854
+ ]
855
+ }
856
+ }
857
+ }
858
+ },
859
+ {
860
+ "if": {
861
+ "properties": {
862
+ "when": {
863
+ "properties": {
864
+ "operation": {
865
+ "const": "ack"
866
+ }
867
+ },
868
+ "required": [
869
+ "operation"
870
+ ]
871
+ }
872
+ },
873
+ "required": [
874
+ "when"
875
+ ]
876
+ },
877
+ "then": {
878
+ "properties": {
879
+ "execution": {
880
+ "type": "object",
881
+ "properties": {
882
+ "plane": {
883
+ "enum": [
884
+ "plugin-to-host-wire",
885
+ "wire-admission"
886
+ ]
887
+ },
888
+ "method": {
889
+ "const": "messaging.ack"
890
+ }
891
+ },
892
+ "required": [
893
+ "plane",
894
+ "method"
895
+ ]
896
+ }
897
+ }
898
+ }
899
+ },
900
+ {
901
+ "if": {
902
+ "properties": {
903
+ "when": {
904
+ "properties": {
905
+ "operation": {
906
+ "const": "snapshot"
907
+ }
908
+ },
909
+ "required": [
910
+ "operation"
911
+ ]
912
+ }
913
+ },
914
+ "required": [
915
+ "when"
916
+ ]
917
+ },
918
+ "then": {
919
+ "properties": {
920
+ "execution": {
921
+ "type": "object",
922
+ "properties": {
923
+ "plane": {
924
+ "enum": [
925
+ "plugin-to-host-wire",
926
+ "wire-admission"
927
+ ]
928
+ },
929
+ "method": {
930
+ "const": "messaging.snapshot"
931
+ }
932
+ },
933
+ "required": [
934
+ "plane",
935
+ "method"
936
+ ]
937
+ }
938
+ }
939
+ }
940
+ },
941
+ {
942
+ "if": {
943
+ "properties": {
944
+ "when": {
945
+ "properties": {
946
+ "operation": {
947
+ "const": "deliverOnMessage"
948
+ }
949
+ },
950
+ "required": [
951
+ "operation"
952
+ ]
953
+ }
954
+ },
955
+ "required": [
956
+ "when"
957
+ ]
958
+ },
959
+ "then": {
960
+ "properties": {
961
+ "execution": {
962
+ "type": "object",
963
+ "properties": {
964
+ "plane": {
965
+ "const": "host-to-plugin-delivery"
966
+ },
967
+ "method": {
968
+ "const": "host.messaging.deliver"
969
+ }
970
+ },
971
+ "required": [
972
+ "plane",
973
+ "method"
974
+ ]
975
+ }
976
+ }
977
+ }
978
+ },
979
+ {
980
+ "if": {
981
+ "properties": {
982
+ "when": {
983
+ "properties": {
984
+ "operation": {
985
+ "enum": [
986
+ "deleteReplayEvents"
987
+ ]
988
+ }
989
+ },
990
+ "required": [
991
+ "operation"
992
+ ]
993
+ }
994
+ },
995
+ "required": [
996
+ "when"
997
+ ]
998
+ },
999
+ "then": {
1000
+ "properties": {
1001
+ "execution": {
1002
+ "type": "object",
1003
+ "properties": {
1004
+ "plane": {
1005
+ "const": "host-control"
1006
+ }
1007
+ },
1008
+ "required": [
1009
+ "plane"
1010
+ ]
1011
+ }
1012
+ }
1013
+ }
1014
+ }
1015
+ ]
368
1016
  }
369
1017
  }
370
1018
  }