@clowder-ai/plugin-contract 0.1.0-beta.29 → 0.1.0-beta.37

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