@clowder-ai/plugin-contract 0.1.0-beta.2 → 0.1.0-beta.20

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 (183) hide show
  1. package/dist/codegen/generate-contract.d.ts +10 -0
  2. package/dist/codegen/generate-contract.d.ts.map +1 -1
  3. package/dist/codegen/generate-contract.js +201 -19
  4. package/dist/codegen/generate-contract.js.map +1 -1
  5. package/dist/conformance/fixtures.d.ts +11 -0
  6. package/dist/conformance/fixtures.d.ts.map +1 -0
  7. package/dist/conformance/fixtures.js +9 -0
  8. package/dist/conformance/fixtures.js.map +1 -0
  9. package/dist/conformance/index.d.ts +4 -0
  10. package/dist/conformance/index.d.ts.map +1 -1
  11. package/dist/conformance/index.js +3 -0
  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 +22 -2
  19. package/dist/conformance/runner.js.map +1 -1
  20. package/dist/conformance/stdio-harness/child-process-harness.d.ts +65 -0
  21. package/dist/conformance/stdio-harness/child-process-harness.d.ts.map +1 -0
  22. package/dist/conformance/stdio-harness/child-process-harness.js +296 -0
  23. package/dist/conformance/stdio-harness/child-process-harness.js.map +1 -0
  24. package/dist/conformance/stdio-harness/dual-transport-oracle.d.ts +26 -0
  25. package/dist/conformance/stdio-harness/dual-transport-oracle.d.ts.map +1 -0
  26. package/dist/conformance/stdio-harness/dual-transport-oracle.js +32 -0
  27. package/dist/conformance/stdio-harness/dual-transport-oracle.js.map +1 -0
  28. package/dist/conformance/stdio-harness/harness-process-spawn.d.ts +27 -0
  29. package/dist/conformance/stdio-harness/harness-process-spawn.d.ts.map +1 -0
  30. package/dist/conformance/stdio-harness/harness-process-spawn.js +43 -0
  31. package/dist/conformance/stdio-harness/harness-process-spawn.js.map +1 -0
  32. package/dist/conformance/stdio-harness/index.d.ts +5 -0
  33. package/dist/conformance/stdio-harness/index.d.ts.map +1 -0
  34. package/dist/conformance/stdio-harness/index.js +4 -0
  35. package/dist/conformance/stdio-harness/index.js.map +1 -0
  36. package/dist/conformance/stdio-harness/ndjson-frame.d.ts +31 -0
  37. package/dist/conformance/stdio-harness/ndjson-frame.d.ts.map +1 -0
  38. package/dist/conformance/stdio-harness/ndjson-frame.js +125 -0
  39. package/dist/conformance/stdio-harness/ndjson-frame.js.map +1 -0
  40. package/dist/conformance/stdio-harness/node-process-tree-runtime.d.ts +15 -0
  41. package/dist/conformance/stdio-harness/node-process-tree-runtime.d.ts.map +1 -0
  42. package/dist/conformance/stdio-harness/node-process-tree-runtime.js +78 -0
  43. package/dist/conformance/stdio-harness/node-process-tree-runtime.js.map +1 -0
  44. package/dist/conformance/stdio-harness/process-tree-controller.d.ts +51 -0
  45. package/dist/conformance/stdio-harness/process-tree-controller.d.ts.map +1 -0
  46. package/dist/conformance/stdio-harness/process-tree-controller.js +162 -0
  47. package/dist/conformance/stdio-harness/process-tree-controller.js.map +1 -0
  48. package/dist/conformance/stdio-harness/windows-sentinel.d.ts +15 -0
  49. package/dist/conformance/stdio-harness/windows-sentinel.d.ts.map +1 -0
  50. package/dist/conformance/stdio-harness/windows-sentinel.js +160 -0
  51. package/dist/conformance/stdio-harness/windows-sentinel.js.map +1 -0
  52. package/dist/conformance/stdio-harness/wire-shape.d.ts +18 -0
  53. package/dist/conformance/stdio-harness/wire-shape.d.ts.map +1 -0
  54. package/dist/conformance/stdio-harness/wire-shape.js +2 -0
  55. package/dist/conformance/stdio-harness/wire-shape.js.map +1 -0
  56. package/dist/docx-materialization.d.ts +8 -0
  57. package/dist/docx-materialization.d.ts.map +1 -0
  58. package/dist/docx-materialization.js +19 -0
  59. package/dist/docx-materialization.js.map +1 -0
  60. package/dist/generated/contract.generated.d.ts +957 -12
  61. package/dist/generated/contract.generated.d.ts.map +1 -1
  62. package/dist/generated/contract.generated.js +9 -1
  63. package/dist/generated/contract.generated.js.map +1 -1
  64. package/dist/index.d.ts +3 -1
  65. package/dist/index.d.ts.map +1 -1
  66. package/dist/index.js +5 -1
  67. package/dist/index.js.map +1 -1
  68. package/dist/validation/catalog.d.ts +21 -0
  69. package/dist/validation/catalog.d.ts.map +1 -0
  70. package/dist/validation/catalog.js +140 -0
  71. package/dist/validation/catalog.js.map +1 -0
  72. package/dist/validation/companion-bridge.d.ts +6 -0
  73. package/dist/validation/companion-bridge.d.ts.map +1 -0
  74. package/dist/validation/companion-bridge.js +57 -0
  75. package/dist/validation/companion-bridge.js.map +1 -0
  76. package/dist/validation/docx-materialization.d.ts +6 -0
  77. package/dist/validation/docx-materialization.d.ts.map +1 -0
  78. package/dist/validation/docx-materialization.js +36 -0
  79. package/dist/validation/docx-materialization.js.map +1 -0
  80. package/dist/validation/index.d.ts +6 -0
  81. package/dist/validation/index.d.ts.map +1 -1
  82. package/dist/validation/index.js +6 -0
  83. package/dist/validation/index.js.map +1 -1
  84. package/dist/validation/manifest.d.ts +23 -0
  85. package/dist/validation/manifest.d.ts.map +1 -0
  86. package/dist/validation/manifest.js +160 -0
  87. package/dist/validation/manifest.js.map +1 -0
  88. package/dist/validation/messaging-semantic.d.ts.map +1 -1
  89. package/dist/validation/messaging-semantic.js +49 -0
  90. package/dist/validation/messaging-semantic.js.map +1 -1
  91. package/dist/validation/messaging-wire.d.ts +38 -0
  92. package/dist/validation/messaging-wire.d.ts.map +1 -0
  93. package/dist/validation/messaging-wire.js +164 -0
  94. package/dist/validation/messaging-wire.js.map +1 -0
  95. package/dist/validation/signals.d.ts +26 -0
  96. package/dist/validation/signals.d.ts.map +1 -0
  97. package/dist/validation/signals.js +206 -0
  98. package/dist/validation/signals.js.map +1 -0
  99. package/dist/wire/constants.d.ts +36 -0
  100. package/dist/wire/constants.d.ts.map +1 -0
  101. package/dist/wire/constants.js +36 -0
  102. package/dist/wire/constants.js.map +1 -0
  103. package/dist/wire/disposition-fixtures.d.ts +118 -0
  104. package/dist/wire/disposition-fixtures.d.ts.map +1 -0
  105. package/dist/wire/disposition-fixtures.js +1881 -0
  106. package/dist/wire/disposition-fixtures.js.map +1 -0
  107. package/dist/wire/disposition.d.ts +102 -0
  108. package/dist/wire/disposition.d.ts.map +1 -0
  109. package/dist/wire/disposition.js +217 -0
  110. package/dist/wire/disposition.js.map +1 -0
  111. package/dist/wire/envelope.d.ts +253 -0
  112. package/dist/wire/envelope.d.ts.map +1 -0
  113. package/dist/wire/envelope.js +19 -0
  114. package/dist/wire/envelope.js.map +1 -0
  115. package/dist/wire/errors.d.ts +222 -0
  116. package/dist/wire/errors.d.ts.map +1 -0
  117. package/dist/wire/errors.js +153 -0
  118. package/dist/wire/errors.js.map +1 -0
  119. package/dist/wire/grants.d.ts +57 -0
  120. package/dist/wire/grants.d.ts.map +1 -0
  121. package/dist/wire/grants.js +59 -0
  122. package/dist/wire/grants.js.map +1 -0
  123. package/dist/wire/handshake-byte-bounds.d.ts +69 -0
  124. package/dist/wire/handshake-byte-bounds.d.ts.map +1 -0
  125. package/dist/wire/handshake-byte-bounds.js +173 -0
  126. package/dist/wire/handshake-byte-bounds.js.map +1 -0
  127. package/dist/wire/handshake.d.ts +146 -0
  128. package/dist/wire/handshake.d.ts.map +1 -0
  129. package/dist/wire/handshake.js +189 -0
  130. package/dist/wire/handshake.js.map +1 -0
  131. package/dist/wire/index.d.ts +37 -0
  132. package/dist/wire/index.d.ts.map +1 -0
  133. package/dist/wire/index.js +61 -0
  134. package/dist/wire/index.js.map +1 -0
  135. package/dist/wire/lifecycle-byte-bounds.d.ts +55 -0
  136. package/dist/wire/lifecycle-byte-bounds.d.ts.map +1 -0
  137. package/dist/wire/lifecycle-byte-bounds.js +209 -0
  138. package/dist/wire/lifecycle-byte-bounds.js.map +1 -0
  139. package/dist/wire/messaging-byte-bounds.d.ts +61 -0
  140. package/dist/wire/messaging-byte-bounds.d.ts.map +1 -0
  141. package/dist/wire/messaging-byte-bounds.js +459 -0
  142. package/dist/wire/messaging-byte-bounds.js.map +1 -0
  143. package/dist/wire/registry.d.ts +294 -0
  144. package/dist/wire/registry.d.ts.map +1 -0
  145. package/dist/wire/registry.js +256 -0
  146. package/dist/wire/registry.js.map +1 -0
  147. package/dist/wire/request-id.d.ts +34 -0
  148. package/dist/wire/request-id.d.ts.map +1 -0
  149. package/dist/wire/request-id.js +40 -0
  150. package/dist/wire/request-id.js.map +1 -0
  151. package/dist/wire/row-shapes.d.ts +217 -0
  152. package/dist/wire/row-shapes.d.ts.map +1 -0
  153. package/dist/wire/row-shapes.js +75 -0
  154. package/dist/wire/row-shapes.js.map +1 -0
  155. package/dist/wire/signal-byte-bounds.d.ts +97 -0
  156. package/dist/wire/signal-byte-bounds.d.ts.map +1 -0
  157. package/dist/wire/signal-byte-bounds.js +229 -0
  158. package/dist/wire/signal-byte-bounds.js.map +1 -0
  159. package/dist/wire/wire-uint53.d.ts +26 -0
  160. package/dist/wire/wire-uint53.d.ts.map +1 -0
  161. package/dist/wire/wire-uint53.js +32 -0
  162. package/dist/wire/wire-uint53.js.map +1 -0
  163. package/fixtures/behavior/messaging/adversarial-invariants.json +85 -0
  164. package/fixtures/manifest/invalid/duplicate-signal-type.json +33 -0
  165. package/fixtures/manifest/invalid/icon-package-escape.json +22 -0
  166. package/fixtures/manifest/valid/localized-product-metadata.json +27 -0
  167. package/fixtures/messaging/valid/subscription-delivery.json +1 -1
  168. package/fixtures/signals/invalid/destination-injection.json +15 -0
  169. package/fixtures/signals/invalid/dynamic-schema-url.json +10 -0
  170. package/fixtures/signals/invalid/forbidden-raw-privacy.json +10 -0
  171. package/fixtures/signals/invalid/non-utc-occurred-at.json +12 -0
  172. package/fixtures/signals/valid/feishu-meeting-artifact.json +18 -0
  173. package/fixtures/signals/valid/remote-service-declaration.json +10 -0
  174. package/package.json +19 -6
  175. package/src/schemas/behavior-fixture.schema.json +262 -2
  176. package/src/schemas/catalog.schema.json +91 -0
  177. package/src/schemas/companion-bridge.schema.json +937 -0
  178. package/src/schemas/docx-materialization.schema.json +302 -0
  179. package/src/schemas/manifest.schema.json +490 -4
  180. package/src/schemas/messaging.schema.json +209 -32
  181. package/src/schemas/physical-limb.schema.json +319 -0
  182. package/src/schemas/plugin-metadata.schema.json +62 -0
  183. package/src/schemas/signal.schema.json +129 -0
@@ -0,0 +1,937 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://clowder-ai.dev/schemas/companion-bridge/v1",
4
+ "title": "Desktop companion renderer bridge",
5
+ "description": "Closed package presentation bridge. The Host-owned isolated preload owns WebRTC, microphone playback and its receive-only provider data channel. Packages never provide SDP, get a peer/channel handle, or send provider events. Host binds owner, installation and conversation; the trusted executor requires explicit gestures for voice and screen admission. Renderer screen observations remain untrusted. No new M0 methods.",
6
+ "$defs": {
7
+ "CompanionSelectionId": {
8
+ "type": "string",
9
+ "pattern": "^[a-zA-Z0-9_-]{1,160}$"
10
+ },
11
+ "CompanionScreenFrame": {
12
+ "type": "object",
13
+ "properties": {
14
+ "image": {
15
+ "type": "string",
16
+ "maxLength": 1400000,
17
+ "pattern": "^data:image/(jpeg|png|webp);base64,"
18
+ },
19
+ "width": {
20
+ "type": "integer",
21
+ "minimum": 1,
22
+ "maximum": 1600
23
+ },
24
+ "height": {
25
+ "type": "integer",
26
+ "minimum": 1,
27
+ "maximum": 1600
28
+ },
29
+ "frameId": {
30
+ "type": "string",
31
+ "minLength": 1,
32
+ "maxLength": 160
33
+ },
34
+ "sourceLabel": {
35
+ "type": "string",
36
+ "minLength": 1,
37
+ "maxLength": 256
38
+ },
39
+ "observedAt": {
40
+ "type": "number",
41
+ "minimum": 0
42
+ }
43
+ },
44
+ "required": [
45
+ "image",
46
+ "width",
47
+ "height",
48
+ "frameId",
49
+ "sourceLabel",
50
+ "observedAt"
51
+ ],
52
+ "additionalProperties": false
53
+ },
54
+ "CompanionCommand": {
55
+ "oneOf": [
56
+ {
57
+ "type": "object",
58
+ "properties": {
59
+ "kind": {
60
+ "const": "state"
61
+ }
62
+ },
63
+ "required": [
64
+ "kind"
65
+ ],
66
+ "additionalProperties": false
67
+ },
68
+ {
69
+ "type": "object",
70
+ "properties": {
71
+ "kind": {
72
+ "const": "prepare"
73
+ }
74
+ },
75
+ "required": [
76
+ "kind"
77
+ ],
78
+ "additionalProperties": false
79
+ },
80
+ {
81
+ "type": "object",
82
+ "properties": {
83
+ "kind": {
84
+ "const": "audio.connect"
85
+ }
86
+ },
87
+ "required": [
88
+ "kind"
89
+ ],
90
+ "additionalProperties": false
91
+ },
92
+ {
93
+ "type": "object",
94
+ "properties": {
95
+ "kind": {
96
+ "const": "audio.close"
97
+ }
98
+ },
99
+ "required": [
100
+ "kind"
101
+ ],
102
+ "additionalProperties": false
103
+ },
104
+ {
105
+ "type": "object",
106
+ "properties": {
107
+ "kind": {
108
+ "const": "audio.microphone"
109
+ },
110
+ "muted": {
111
+ "type": "boolean"
112
+ }
113
+ },
114
+ "required": [
115
+ "kind",
116
+ "muted"
117
+ ],
118
+ "additionalProperties": false
119
+ },
120
+ {
121
+ "type": "object",
122
+ "properties": {
123
+ "kind": {
124
+ "const": "audio.speaker"
125
+ },
126
+ "muted": {
127
+ "type": "boolean"
128
+ }
129
+ },
130
+ "required": [
131
+ "kind",
132
+ "muted"
133
+ ],
134
+ "additionalProperties": false
135
+ },
136
+ {
137
+ "type": "object",
138
+ "properties": {
139
+ "kind": {
140
+ "const": "stop"
141
+ }
142
+ },
143
+ "required": [
144
+ "kind"
145
+ ],
146
+ "additionalProperties": false
147
+ },
148
+ {
149
+ "type": "object",
150
+ "properties": {
151
+ "kind": {
152
+ "const": "text"
153
+ },
154
+ "text": {
155
+ "type": "string",
156
+ "minLength": 1,
157
+ "maxLength": 8000
158
+ },
159
+ "clientMessageId": {
160
+ "type": "string",
161
+ "format": "uuid"
162
+ }
163
+ },
164
+ "required": [
165
+ "kind",
166
+ "text",
167
+ "clientMessageId"
168
+ ],
169
+ "additionalProperties": false
170
+ },
171
+ {
172
+ "type": "object",
173
+ "properties": {
174
+ "kind": {
175
+ "const": "documents"
176
+ },
177
+ "allowed": {
178
+ "type": "boolean"
179
+ }
180
+ },
181
+ "required": [
182
+ "kind",
183
+ "allowed"
184
+ ],
185
+ "additionalProperties": false
186
+ },
187
+ {
188
+ "type": "object",
189
+ "properties": {
190
+ "kind": {
191
+ "const": "screen.pick"
192
+ }
193
+ },
194
+ "required": [
195
+ "kind"
196
+ ],
197
+ "additionalProperties": false
198
+ },
199
+ {
200
+ "type": "object",
201
+ "properties": {
202
+ "kind": {
203
+ "const": "screen.open"
204
+ },
205
+ "selectionId": {
206
+ "$ref": "#/$defs/CompanionSelectionId"
207
+ },
208
+ "label": {
209
+ "type": "string",
210
+ "minLength": 1,
211
+ "maxLength": 256
212
+ }
213
+ },
214
+ "required": [
215
+ "kind",
216
+ "selectionId",
217
+ "label"
218
+ ],
219
+ "additionalProperties": false
220
+ },
221
+ {
222
+ "type": "object",
223
+ "properties": {
224
+ "kind": {
225
+ "const": "screen.frame"
226
+ },
227
+ "selectionId": {
228
+ "$ref": "#/$defs/CompanionSelectionId"
229
+ },
230
+ "frame": {
231
+ "$ref": "#/$defs/CompanionScreenFrame"
232
+ }
233
+ },
234
+ "required": [
235
+ "kind",
236
+ "selectionId",
237
+ "frame"
238
+ ],
239
+ "additionalProperties": false
240
+ },
241
+ {
242
+ "type": "object",
243
+ "properties": {
244
+ "kind": {
245
+ "const": "screen.close"
246
+ }
247
+ },
248
+ "required": [
249
+ "kind"
250
+ ],
251
+ "additionalProperties": false
252
+ },
253
+ {
254
+ "type": "object",
255
+ "properties": {
256
+ "kind": {
257
+ "const": "conversation.open"
258
+ }
259
+ },
260
+ "required": [
261
+ "kind"
262
+ ],
263
+ "additionalProperties": false
264
+ },
265
+ {
266
+ "type": "object",
267
+ "properties": {
268
+ "kind": { "const": "decisions.read" },
269
+ "offset": { "type": "integer", "minimum": 0 },
270
+ "limit": { "type": "integer", "minimum": 1, "maximum": 20 }
271
+ },
272
+ "required": ["kind", "offset", "limit"],
273
+ "additionalProperties": false
274
+ },
275
+ {
276
+ "type": "object",
277
+ "properties": {
278
+ "kind": { "const": "f221.inspect" },
279
+ "proposalId": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,200}$" }
280
+ },
281
+ "required": ["kind", "proposalId"],
282
+ "additionalProperties": false
283
+ },
284
+ {
285
+ "type": "object",
286
+ "properties": {
287
+ "kind": {
288
+ "const": "view.resize"
289
+ },
290
+ "expanded": {
291
+ "type": "boolean"
292
+ }
293
+ },
294
+ "required": [
295
+ "kind",
296
+ "expanded"
297
+ ],
298
+ "additionalProperties": false
299
+ },
300
+ {
301
+ "type": "object",
302
+ "properties": {
303
+ "kind": {
304
+ "const": "view.layout"
305
+ },
306
+ "panel": {
307
+ "enum": [
308
+ "none",
309
+ "bubble",
310
+ "actions",
311
+ "menu",
312
+ "chat",
313
+ "decisions"
314
+ ]
315
+ },
316
+ "width": {
317
+ "type": "integer",
318
+ "minimum": 120,
319
+ "maximum": 420
320
+ },
321
+ "height": {
322
+ "type": "integer",
323
+ "minimum": 32,
324
+ "maximum": 500
325
+ }
326
+ },
327
+ "required": [
328
+ "kind",
329
+ "panel",
330
+ "width",
331
+ "height"
332
+ ],
333
+ "additionalProperties": false
334
+ },
335
+ {
336
+ "type": "object",
337
+ "properties": {
338
+ "kind": {
339
+ "const": "view.drag"
340
+ },
341
+ "phase": {
342
+ "enum": [
343
+ "start",
344
+ "end"
345
+ ]
346
+ }
347
+ },
348
+ "required": [
349
+ "kind",
350
+ "phase"
351
+ ],
352
+ "additionalProperties": false
353
+ },
354
+ {
355
+ "type": "object",
356
+ "properties": {
357
+ "kind": {
358
+ "const": "view.hide"
359
+ }
360
+ },
361
+ "required": [
362
+ "kind"
363
+ ],
364
+ "additionalProperties": false
365
+ },
366
+ {
367
+ "type": "object",
368
+ "properties": {
369
+ "kind": {
370
+ "const": "conversation.read"
371
+ }
372
+ },
373
+ "required": [
374
+ "kind"
375
+ ],
376
+ "additionalProperties": false
377
+ }
378
+ ]
379
+ },
380
+ "CompanionActor": {
381
+ "type": "object",
382
+ "properties": {
383
+ "catId": {
384
+ "type": "string",
385
+ "minLength": 1,
386
+ "maxLength": 160
387
+ },
388
+ "displayName": {
389
+ "type": "string",
390
+ "minLength": 1,
391
+ "maxLength": 256
392
+ }
393
+ },
394
+ "required": [
395
+ "catId",
396
+ "displayName"
397
+ ],
398
+ "additionalProperties": false
399
+ },
400
+ "CompanionLiveTransport": {
401
+ "type": "object",
402
+ "properties": {
403
+ "kind": { "const": "gpt_live_v3" },
404
+ "verifiedModel": { "type": "null" }
405
+ },
406
+ "required": ["kind", "verifiedModel"],
407
+ "additionalProperties": false
408
+ },
409
+ "CompanionNativeWorkEntry": {
410
+ "type": "object",
411
+ "properties": {
412
+ "taskId": { "type": "string", "minLength": 1, "maxLength": 500 },
413
+ "nativeTurnId": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,160}$" },
414
+ "kind": { "enum": ["reasoning", "tool", "workspace_fetch", "workspace_dispatch", "screen_read"] },
415
+ "startedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
416
+ "expiresAt": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }
417
+ },
418
+ "required": ["taskId", "nativeTurnId", "kind", "startedAt", "expiresAt"],
419
+ "additionalProperties": false
420
+ },
421
+ "CompanionNativeWorkEvent": {
422
+ "type": "object",
423
+ "properties": {
424
+ "eventId": { "type": "string", "minLength": 1, "maxLength": 500 },
425
+ "taskId": { "type": "string", "minLength": 1, "maxLength": 500 },
426
+ "kind": { "enum": ["reasoning", "tool", "workspace_fetch", "workspace_dispatch", "screen_read", "result"] },
427
+ "phase": { "enum": ["started", "completed", "failed", "cancelled", "expired", "result_handed_to_voice"] },
428
+ "occurredAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
429
+ "expiresAt": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
430
+ "resultId": { "type": "string", "minLength": 1, "maxLength": 500 },
431
+ "nativeCarrierCatId": { "type": "string", "minLength": 1, "maxLength": 160 }
432
+ },
433
+ "required": ["eventId", "taskId", "kind", "phase", "occurredAt", "expiresAt"],
434
+ "additionalProperties": false
435
+ },
436
+ "CompanionNativeWork": {
437
+ "type": "object",
438
+ "properties": {
439
+ "scopeId": { "type": ["string", "null"], "pattern": "^[0-9a-f]{16}$" },
440
+ "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
441
+ "active": { "type": "array", "maxItems": 64, "items": { "$ref": "#/$defs/CompanionNativeWorkEntry" } },
442
+ "recent": { "type": "array", "maxItems": 16, "items": { "$ref": "#/$defs/CompanionNativeWorkEvent" } }
443
+ },
444
+ "required": ["scopeId", "revision", "active", "recent"],
445
+ "additionalProperties": false
446
+ },
447
+ "CompanionState": {
448
+ "type": "object",
449
+ "properties": {
450
+ "kind": {
451
+ "const": "state"
452
+ },
453
+ "phase": {
454
+ "enum": [
455
+ "idle",
456
+ "preparing",
457
+ "ready",
458
+ "connecting",
459
+ "talking",
460
+ "closed",
461
+ "failed"
462
+ ]
463
+ },
464
+ "displayName": {
465
+ "type": "string",
466
+ "minLength": 1,
467
+ "maxLength": 256
468
+ },
469
+ "skin": {
470
+ "type": "string",
471
+ "minLength": 1,
472
+ "maxLength": 100
473
+ },
474
+ "duty": {
475
+ "$ref": "#/$defs/CompanionActor"
476
+ },
477
+ "carrier": {
478
+ "$ref": "#/$defs/CompanionActor"
479
+ },
480
+ "documentsAllowed": {
481
+ "type": "boolean"
482
+ },
483
+ "toolsReady": {
484
+ "type": "boolean"
485
+ },
486
+ "nativeActivity": {
487
+ "enum": ["none", "reasoning", "tool_running"]
488
+ },
489
+ "liveTransport": {
490
+ "$ref": "#/$defs/CompanionLiveTransport"
491
+ },
492
+ "nativeWork": {
493
+ "$ref": "#/$defs/CompanionNativeWork"
494
+ }
495
+ },
496
+ "required": [
497
+ "kind",
498
+ "phase",
499
+ "displayName",
500
+ "skin",
501
+ "duty",
502
+ "carrier",
503
+ "documentsAllowed",
504
+ "toolsReady",
505
+ "nativeActivity",
506
+ "liveTransport",
507
+ "nativeWork"
508
+ ],
509
+ "additionalProperties": false
510
+ },
511
+ "CompanionDecisions": {
512
+ "type": "object",
513
+ "properties": {
514
+ "kind": { "const": "decisions" },
515
+ "status": { "enum": ["available", "unavailable"] },
516
+ "approvalCount": { "type": ["integer", "null"], "minimum": 0 },
517
+ "needsMeCount": { "type": ["integer", "null"], "minimum": 0 },
518
+ "otherNeedsMeCount": { "type": ["integer", "null"], "minimum": 0 },
519
+ "approvals": {
520
+ "type": "array",
521
+ "maxItems": 20,
522
+ "items": {
523
+ "type": "object",
524
+ "properties": {
525
+ "proposalId": { "type": "string", "minLength": 1, "maxLength": 200 },
526
+ "sourceFeatureId": { "type": "string", "minLength": 1, "maxLength": 40 },
527
+ "summary": { "type": "string", "maxLength": 500 },
528
+ "resolution": { "enum": ["open", "accepted", "rejected", "closed_without_decision"] },
529
+ "materializationState": { "enum": ["not_started", "outcome_unknown", "in_progress", "succeeded", "failed"] },
530
+ "linkedNeedsMe": { "type": "boolean" }
531
+ },
532
+ "required": ["proposalId", "sourceFeatureId", "summary", "resolution", "materializationState", "linkedNeedsMe"],
533
+ "additionalProperties": false
534
+ }
535
+ },
536
+ "otherNeedsMe": {
537
+ "type": "array",
538
+ "maxItems": 20,
539
+ "items": {
540
+ "type": "object",
541
+ "properties": {
542
+ "subjectRef": { "type": "string", "minLength": 1, "maxLength": 256 },
543
+ "summary": { "type": "string", "maxLength": 500 }
544
+ },
545
+ "required": ["subjectRef", "summary"],
546
+ "additionalProperties": false
547
+ }
548
+ },
549
+ "page": {
550
+ "type": "object",
551
+ "properties": {
552
+ "offset": { "type": "integer", "minimum": 0 },
553
+ "limit": { "type": "integer", "minimum": 1, "maximum": 20 },
554
+ "hasMoreApprovals": { "type": "boolean" },
555
+ "hasMoreNeedsMe": { "type": "boolean" }
556
+ },
557
+ "required": ["offset", "limit", "hasMoreApprovals", "hasMoreNeedsMe"],
558
+ "additionalProperties": false
559
+ }
560
+ },
561
+ "required": ["kind", "status", "approvalCount", "needsMeCount", "otherNeedsMeCount", "approvals", "otherNeedsMe", "page"],
562
+ "additionalProperties": false
563
+ },
564
+ "CompanionDecisionTrial": {
565
+ "type": "object",
566
+ "properties": {
567
+ "kind": { "const": "decision-trial" },
568
+ "status": { "enum": ["dismissed", "trial_confirmed", "stale", "unavailable"] }
569
+ },
570
+ "required": ["kind", "status"],
571
+ "additionalProperties": false
572
+ },
573
+ "CompanionErrorCode": {
574
+ "enum": [
575
+ "invalid_request",
576
+ "permission_required",
577
+ "unavailable",
578
+ "session_required",
579
+ "busy",
580
+ "selection_changed",
581
+ "carrier_unavailable",
582
+ "cancelled",
583
+ "unconfirmed"
584
+ ]
585
+ },
586
+ "CompanionReply": {
587
+ "oneOf": [
588
+ {
589
+ "type": "object",
590
+ "properties": {
591
+ "kind": {
592
+ "const": "ok"
593
+ }
594
+ },
595
+ "required": [
596
+ "kind"
597
+ ],
598
+ "additionalProperties": false
599
+ },
600
+ {
601
+ "$ref": "#/$defs/CompanionState"
602
+ },
603
+ {
604
+ "$ref": "#/$defs/CompanionDecisions"
605
+ },
606
+ {
607
+ "$ref": "#/$defs/CompanionDecisionTrial"
608
+ },
609
+ {
610
+ "type": "object",
611
+ "properties": {
612
+ "kind": {
613
+ "const": "delivery"
614
+ },
615
+ "delivery": {
616
+ "enum": [
617
+ "accepted",
618
+ "unconfirmed"
619
+ ]
620
+ }
621
+ },
622
+ "required": [
623
+ "kind",
624
+ "delivery"
625
+ ],
626
+ "additionalProperties": false
627
+ },
628
+ {
629
+ "type": "object",
630
+ "properties": {
631
+ "kind": {
632
+ "const": "selection"
633
+ },
634
+ "selectionId": {
635
+ "$ref": "#/$defs/CompanionSelectionId"
636
+ }
637
+ },
638
+ "required": [
639
+ "kind",
640
+ "selectionId"
641
+ ],
642
+ "additionalProperties": false
643
+ },
644
+ {
645
+ "type": "object",
646
+ "properties": {
647
+ "kind": {
648
+ "const": "navigation"
649
+ },
650
+ "delivery": {
651
+ "enum": [
652
+ "requested",
653
+ "unconfirmed"
654
+ ]
655
+ }
656
+ },
657
+ "required": [
658
+ "kind",
659
+ "delivery"
660
+ ],
661
+ "additionalProperties": false
662
+ },
663
+ {
664
+ "type": "object",
665
+ "properties": {
666
+ "kind": {
667
+ "const": "error"
668
+ },
669
+ "code": {
670
+ "$ref": "#/$defs/CompanionErrorCode"
671
+ }
672
+ },
673
+ "required": [
674
+ "kind",
675
+ "code"
676
+ ],
677
+ "additionalProperties": false
678
+ },
679
+ {
680
+ "type": "object",
681
+ "properties": {
682
+ "kind": {
683
+ "const": "layout"
684
+ },
685
+ "pet": {
686
+ "type": "object",
687
+ "properties": {
688
+ "x": {
689
+ "type": "number"
690
+ },
691
+ "y": {
692
+ "type": "number"
693
+ }
694
+ },
695
+ "required": [
696
+ "x",
697
+ "y"
698
+ ],
699
+ "additionalProperties": false
700
+ },
701
+ "panel": {
702
+ "type": "object",
703
+ "properties": {
704
+ "x": {
705
+ "type": "number"
706
+ },
707
+ "y": {
708
+ "type": "number"
709
+ },
710
+ "width": {
711
+ "type": "number",
712
+ "minimum": 0,
713
+ "maximum": 2000
714
+ },
715
+ "height": {
716
+ "type": "number",
717
+ "minimum": 0,
718
+ "maximum": 2000
719
+ }
720
+ },
721
+ "required": [
722
+ "x",
723
+ "y",
724
+ "width",
725
+ "height"
726
+ ],
727
+ "additionalProperties": false
728
+ },
729
+ "width": {
730
+ "type": "integer",
731
+ "minimum": 1,
732
+ "maximum": 2000
733
+ },
734
+ "height": {
735
+ "type": "integer",
736
+ "minimum": 1,
737
+ "maximum": 2000
738
+ }
739
+ },
740
+ "required": [
741
+ "kind",
742
+ "pet",
743
+ "panel",
744
+ "width",
745
+ "height"
746
+ ],
747
+ "additionalProperties": false
748
+ },
749
+ {
750
+ "type": "object",
751
+ "properties": {
752
+ "kind": {
753
+ "const": "conversation"
754
+ },
755
+ "threadTitle": {
756
+ "type": "string",
757
+ "minLength": 1,
758
+ "maxLength": 256
759
+ },
760
+ "messages": {
761
+ "type": "array",
762
+ "maxItems": 32,
763
+ "items": {
764
+ "type": "object",
765
+ "properties": {
766
+ "id": {
767
+ "type": "string",
768
+ "maxLength": 256
769
+ },
770
+ "role": {
771
+ "enum": [
772
+ "user",
773
+ "assistant"
774
+ ]
775
+ },
776
+ "text": {
777
+ "type": "string",
778
+ "maxLength": 16000
779
+ },
780
+ "name": {
781
+ "type": "string",
782
+ "maxLength": 256
783
+ }
784
+ },
785
+ "required": [
786
+ "id",
787
+ "role",
788
+ "text",
789
+ "name"
790
+ ],
791
+ "additionalProperties": false
792
+ }
793
+ },
794
+ "hasMore": {
795
+ "type": "boolean"
796
+ }
797
+ },
798
+ "required": [
799
+ "kind",
800
+ "threadTitle",
801
+ "messages",
802
+ "hasMore"
803
+ ],
804
+ "additionalProperties": false
805
+ }
806
+ ]
807
+ },
808
+ "CompanionEvent": {
809
+ "oneOf": [
810
+ {
811
+ "type": "object",
812
+ "properties": {
813
+ "kind": {
814
+ "const": "media-stopped"
815
+ },
816
+ "reason": {
817
+ "enum": [
818
+ "locked",
819
+ "suspended",
820
+ "hidden",
821
+ "closed",
822
+ "revoked"
823
+ ]
824
+ }
825
+ },
826
+ "required": [
827
+ "kind",
828
+ "reason"
829
+ ],
830
+ "additionalProperties": false
831
+ },
832
+ {
833
+ "type": "object",
834
+ "properties": {
835
+ "kind": {
836
+ "const": "audio"
837
+ },
838
+ "type": {
839
+ "enum": [
840
+ "connected",
841
+ "recovering",
842
+ "recovered",
843
+ "error"
844
+ ]
845
+ }
846
+ },
847
+ "required": [
848
+ "kind",
849
+ "type"
850
+ ],
851
+ "additionalProperties": false
852
+ },
853
+ {
854
+ "type": "object",
855
+ "properties": {
856
+ "kind": {
857
+ "const": "audio"
858
+ },
859
+ "type": {
860
+ "const": "transcript"
861
+ },
862
+ "role": {
863
+ "enum": [
864
+ "user",
865
+ "assistant"
866
+ ]
867
+ },
868
+ "text": {
869
+ "type": "string",
870
+ "maxLength": 16000
871
+ },
872
+ "turnId": {
873
+ "type": "string",
874
+ "minLength": 1,
875
+ "maxLength": 256
876
+ },
877
+ "itemId": {
878
+ "type": "string",
879
+ "minLength": 1,
880
+ "maxLength": 256
881
+ }
882
+ },
883
+ "required": [
884
+ "kind",
885
+ "type",
886
+ "role",
887
+ "text"
888
+ ],
889
+ "additionalProperties": false
890
+ },
891
+ {
892
+ "type": "object",
893
+ "properties": {
894
+ "kind": {
895
+ "const": "audio"
896
+ },
897
+ "type": {
898
+ "const": "turn-done"
899
+ },
900
+ "role": {
901
+ "enum": [
902
+ "user",
903
+ "assistant"
904
+ ]
905
+ },
906
+ "transcript": {
907
+ "type": "string",
908
+ "maxLength": 16000
909
+ },
910
+ "turnId": {
911
+ "type": "string",
912
+ "minLength": 1,
913
+ "maxLength": 256
914
+ }
915
+ },
916
+ "required": [
917
+ "kind",
918
+ "type"
919
+ ],
920
+ "additionalProperties": false
921
+ },
922
+ {
923
+ "type": "object",
924
+ "properties": {
925
+ "kind": {
926
+ "const": "view-dismiss"
927
+ }
928
+ },
929
+ "required": [
930
+ "kind"
931
+ ],
932
+ "additionalProperties": false
933
+ }
934
+ ]
935
+ }
936
+ }
937
+ }