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