@clowder-ai/plugin-contract 0.1.0-beta.9 → 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 (145) hide show
  1. package/dist/codegen/generate-contract.d.ts +6 -0
  2. package/dist/codegen/generate-contract.d.ts.map +1 -1
  3. package/dist/codegen/generate-contract.js +343 -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 +3 -1
  19. package/dist/conformance/runner.js.map +1 -1
  20. package/dist/docx-materialization.d.ts +8 -0
  21. package/dist/docx-materialization.d.ts.map +1 -0
  22. package/dist/docx-materialization.js +19 -0
  23. package/dist/docx-materialization.js.map +1 -0
  24. package/dist/generated/contract.generated.d.ts +1647 -52
  25. package/dist/generated/contract.generated.d.ts.map +1 -1
  26. package/dist/generated/contract.generated.js +72 -3
  27. package/dist/generated/contract.generated.js.map +1 -1
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +1 -1
  30. package/dist/validation/catalog.d.ts +21 -0
  31. package/dist/validation/catalog.d.ts.map +1 -0
  32. package/dist/validation/catalog.js +140 -0
  33. package/dist/validation/catalog.js.map +1 -0
  34. package/dist/validation/cloud-conversation-host.d.ts +18 -0
  35. package/dist/validation/cloud-conversation-host.d.ts.map +1 -0
  36. package/dist/validation/cloud-conversation-host.js +83 -0
  37. package/dist/validation/cloud-conversation-host.js.map +1 -0
  38. package/dist/validation/companion-bridge.d.ts +6 -0
  39. package/dist/validation/companion-bridge.d.ts.map +1 -0
  40. package/dist/validation/companion-bridge.js +198 -0
  41. package/dist/validation/companion-bridge.js.map +1 -0
  42. package/dist/validation/docx-materialization.d.ts +6 -0
  43. package/dist/validation/docx-materialization.d.ts.map +1 -0
  44. package/dist/validation/docx-materialization.js +36 -0
  45. package/dist/validation/docx-materialization.js.map +1 -0
  46. package/dist/validation/index.d.ts +9 -1
  47. package/dist/validation/index.d.ts.map +1 -1
  48. package/dist/validation/index.js +9 -1
  49. package/dist/validation/index.js.map +1 -1
  50. package/dist/validation/manifest.d.ts.map +1 -1
  51. package/dist/validation/manifest.js +303 -0
  52. package/dist/validation/manifest.js.map +1 -1
  53. package/dist/validation/members.d.ts +4 -0
  54. package/dist/validation/members.d.ts.map +1 -0
  55. package/dist/validation/members.js +11 -0
  56. package/dist/validation/members.js.map +1 -0
  57. package/dist/validation/messaging-semantic.d.ts.map +1 -1
  58. package/dist/validation/messaging-semantic.js +98 -0
  59. package/dist/validation/messaging-semantic.js.map +1 -1
  60. package/dist/validation/messaging-wire.d.ts +42 -0
  61. package/dist/validation/messaging-wire.d.ts.map +1 -0
  62. package/dist/validation/messaging-wire.js +184 -0
  63. package/dist/validation/messaging-wire.js.map +1 -0
  64. package/dist/validation/operation-rows.d.ts +25 -0
  65. package/dist/validation/operation-rows.d.ts.map +1 -0
  66. package/dist/validation/operation-rows.js +135 -0
  67. package/dist/validation/operation-rows.js.map +1 -0
  68. package/dist/validation/signals.d.ts +1 -10
  69. package/dist/validation/signals.d.ts.map +1 -1
  70. package/dist/validation/signals.js +0 -174
  71. package/dist/validation/signals.js.map +1 -1
  72. package/dist/variant.d.ts +114 -0
  73. package/dist/variant.d.ts.map +1 -0
  74. package/dist/variant.js +305 -0
  75. package/dist/variant.js.map +1 -0
  76. package/dist/wire/constants.d.ts +2 -1
  77. package/dist/wire/constants.d.ts.map +1 -1
  78. package/dist/wire/constants.js +2 -1
  79. package/dist/wire/constants.js.map +1 -1
  80. package/dist/wire/dispatch.d.ts +49 -0
  81. package/dist/wire/dispatch.d.ts.map +1 -0
  82. package/dist/wire/dispatch.js +880 -0
  83. package/dist/wire/dispatch.js.map +1 -0
  84. package/dist/wire/disposition-fixtures.d.ts +9 -1
  85. package/dist/wire/disposition-fixtures.d.ts.map +1 -1
  86. package/dist/wire/disposition-fixtures.js +622 -95
  87. package/dist/wire/disposition-fixtures.js.map +1 -1
  88. package/dist/wire/envelope.d.ts +31 -0
  89. package/dist/wire/envelope.d.ts.map +1 -1
  90. package/dist/wire/envelope.js +48 -1
  91. package/dist/wire/envelope.js.map +1 -1
  92. package/dist/wire/errors.d.ts +31 -1
  93. package/dist/wire/errors.d.ts.map +1 -1
  94. package/dist/wire/errors.js +36 -0
  95. package/dist/wire/errors.js.map +1 -1
  96. package/dist/wire/grants.d.ts +4 -4
  97. package/dist/wire/grants.js +3 -3
  98. package/dist/wire/handshake-byte-bounds.d.ts.map +1 -1
  99. package/dist/wire/handshake-byte-bounds.js +5 -2
  100. package/dist/wire/handshake-byte-bounds.js.map +1 -1
  101. package/dist/wire/handshake.d.ts +6 -0
  102. package/dist/wire/handshake.d.ts.map +1 -1
  103. package/dist/wire/handshake.js +6 -3
  104. package/dist/wire/handshake.js.map +1 -1
  105. package/dist/wire/index.d.ts +13 -9
  106. package/dist/wire/index.d.ts.map +1 -1
  107. package/dist/wire/index.js +29 -6
  108. package/dist/wire/index.js.map +1 -1
  109. package/dist/wire/lifecycle-byte-bounds.d.ts +40 -0
  110. package/dist/wire/lifecycle-byte-bounds.d.ts.map +1 -0
  111. package/dist/wire/lifecycle-byte-bounds.js +149 -0
  112. package/dist/wire/lifecycle-byte-bounds.js.map +1 -0
  113. package/dist/wire/messaging-byte-bounds.d.ts +62 -0
  114. package/dist/wire/messaging-byte-bounds.d.ts.map +1 -0
  115. package/dist/wire/messaging-byte-bounds.js +581 -0
  116. package/dist/wire/messaging-byte-bounds.js.map +1 -0
  117. package/dist/wire/registry.d.ts +58 -86
  118. package/dist/wire/registry.d.ts.map +1 -1
  119. package/dist/wire/registry.js +45 -88
  120. package/dist/wire/registry.js.map +1 -1
  121. package/dist/wire/row-shapes.d.ts +86 -69
  122. package/dist/wire/row-shapes.d.ts.map +1 -1
  123. package/dist/wire/row-shapes.js +30 -3
  124. package/dist/wire/row-shapes.js.map +1 -1
  125. package/fixtures/behavior/messaging/adversarial-invariants.json +92 -2
  126. package/fixtures/manifest/invalid/duplicate-signal-type.json +4 -2
  127. package/fixtures/manifest/invalid/icon-package-escape.json +22 -0
  128. package/fixtures/manifest/valid/localized-product-metadata.json +27 -0
  129. package/fixtures/messaging/valid/subscription-delivery.json +1 -1
  130. package/package.json +16 -3
  131. package/src/schemas/behavior-fixture.schema.json +903 -116
  132. package/src/schemas/catalog.schema.json +91 -0
  133. package/src/schemas/companion-bridge.schema.json +2256 -0
  134. package/src/schemas/docx-materialization.schema.json +302 -0
  135. package/src/schemas/manifest.schema.json +2273 -88
  136. package/src/schemas/messaging.schema.json +692 -41
  137. package/src/schemas/plugin-metadata.schema.json +62 -0
  138. package/src/schemas/signal.schema.json +68 -78
  139. package/dist/wire/signal-byte-bounds.d.ts +0 -97
  140. package/dist/wire/signal-byte-bounds.d.ts.map +0 -1
  141. package/dist/wire/signal-byte-bounds.js +0 -229
  142. package/dist/wire/signal-byte-bounds.js.map +0 -1
  143. package/fixtures/signals/invalid/destination-injection.json +0 -15
  144. package/fixtures/signals/invalid/non-utc-occurred-at.json +0 -12
  145. package/fixtures/signals/valid/feishu-meeting-artifact.json +0 -18
@@ -0,0 +1,2256 @@
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, conversation and the current transcript scope; the renderer can read only that bound call. 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
+ "CompanionCallId": {
12
+ "type": "string",
13
+ "format": "uuid"
14
+ },
15
+ "CompanionClientMessageId": {
16
+ "type": "string",
17
+ "format": "uuid"
18
+ },
19
+ "CompanionAppAssistRef": {
20
+ "description": "Opaque Host-issued reference bound to one current application-assistance page scope or offer. It is correlation data, not authority.",
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "maxLength": 200,
24
+ "pattern": "^[A-Za-z0-9_-]+$"
25
+ },
26
+ "CompanionAppAssistAction": {
27
+ "enum": ["dismiss", "timeout", "accept"]
28
+ },
29
+ "CompanionCorrelatableId": {
30
+ "description": "A bounded single-line opaque identity issued by the Host or its current provider session.",
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "maxLength": 256,
34
+ "pattern": "^[^\\s\\u2028\\u2029]+$"
35
+ },
36
+ "CompanionOpaqueReadReference": {
37
+ "description": "A bounded opaque continuation issued by the Host for this bound conversation. The renderer can only return it to the matching read command.",
38
+ "type": "string",
39
+ "minLength": 1,
40
+ "maxLength": 2048,
41
+ "pattern": "^[^\\s\\u2028\\u2029]+$"
42
+ },
43
+ "CompanionConversationScopeRef": {
44
+ "description": "Stable opaque owner + canonical conversation fingerprint derived by the Host. It fences thread-local revisions but is not an authorization token.",
45
+ "type": "string",
46
+ "minLength": 1,
47
+ "maxLength": 256,
48
+ "pattern": "^[^\\s\\u2028\\u2029]+$"
49
+ },
50
+ "CompanionPresentationReference": {
51
+ "description": "One Host-correlatable identity already present on the current call. The renderer cannot register or select a session with this reference.",
52
+ "oneOf": [
53
+ {
54
+ "type": "object",
55
+ "properties": {
56
+ "kind": { "const": "message" },
57
+ "messageId": { "$ref": "#/$defs/CompanionCorrelatableId" }
58
+ },
59
+ "required": ["kind", "messageId"],
60
+ "additionalProperties": false
61
+ },
62
+ {
63
+ "type": "object",
64
+ "properties": {
65
+ "kind": { "const": "native-item" },
66
+ "nativeItemId": { "$ref": "#/$defs/CompanionCorrelatableId" }
67
+ },
68
+ "required": ["kind", "nativeItemId"],
69
+ "additionalProperties": false
70
+ }
71
+ ]
72
+ },
73
+ "CompanionScreenFrame": {
74
+ "type": "object",
75
+ "properties": {
76
+ "image": {
77
+ "type": "string",
78
+ "maxLength": 1400000,
79
+ "pattern": "^data:image/(jpeg|png|webp);base64,"
80
+ },
81
+ "width": {
82
+ "type": "integer",
83
+ "minimum": 1,
84
+ "maximum": 1600
85
+ },
86
+ "height": {
87
+ "type": "integer",
88
+ "minimum": 1,
89
+ "maximum": 1600
90
+ },
91
+ "frameId": {
92
+ "type": "string",
93
+ "minLength": 1,
94
+ "maxLength": 160
95
+ },
96
+ "sourceLabel": {
97
+ "type": "string",
98
+ "minLength": 1,
99
+ "maxLength": 256
100
+ },
101
+ "observedAt": {
102
+ "type": "number",
103
+ "minimum": 0
104
+ }
105
+ },
106
+ "required": [
107
+ "image",
108
+ "width",
109
+ "height",
110
+ "frameId",
111
+ "sourceLabel",
112
+ "observedAt"
113
+ ],
114
+ "additionalProperties": false
115
+ },
116
+ "CompanionCommand": {
117
+ "oneOf": [
118
+ {
119
+ "type": "object",
120
+ "properties": {
121
+ "kind": {
122
+ "const": "state"
123
+ }
124
+ },
125
+ "required": [
126
+ "kind"
127
+ ],
128
+ "additionalProperties": false
129
+ },
130
+ {
131
+ "type": "object",
132
+ "properties": {
133
+ "kind": { "const": "work.read" }
134
+ },
135
+ "required": ["kind"],
136
+ "additionalProperties": false
137
+ },
138
+ {
139
+ "type": "object",
140
+ "properties": {
141
+ "kind": { "const": "work.open" },
142
+ "entryRef": {
143
+ "type": "string",
144
+ "pattern": "^[A-Za-z0-9_-]{1,256}$",
145
+ "description": "Opaque Host-issued navigation identity; never a renderer-selected task, thread or route."
146
+ }
147
+ },
148
+ "required": ["kind", "entryRef"],
149
+ "additionalProperties": false
150
+ },
151
+ {
152
+ "type": "object",
153
+ "properties": {
154
+ "kind": {
155
+ "const": "prepare"
156
+ }
157
+ },
158
+ "required": [
159
+ "kind"
160
+ ],
161
+ "additionalProperties": false
162
+ },
163
+ {
164
+ "type": "object",
165
+ "properties": {
166
+ "kind": {
167
+ "const": "audio.connect"
168
+ },
169
+ "mode": {
170
+ "const": "receive_only"
171
+ }
172
+ },
173
+ "required": [
174
+ "kind"
175
+ ],
176
+ "additionalProperties": false
177
+ },
178
+ {
179
+ "type": "object",
180
+ "properties": {
181
+ "kind": {
182
+ "const": "audio.close"
183
+ }
184
+ },
185
+ "required": [
186
+ "kind"
187
+ ],
188
+ "additionalProperties": false
189
+ },
190
+ {
191
+ "type": "object",
192
+ "properties": {
193
+ "kind": {
194
+ "const": "audio.microphone"
195
+ },
196
+ "muted": {
197
+ "type": "boolean"
198
+ }
199
+ },
200
+ "required": [
201
+ "kind",
202
+ "muted"
203
+ ],
204
+ "additionalProperties": false
205
+ },
206
+ {
207
+ "type": "object",
208
+ "properties": {
209
+ "kind": {
210
+ "const": "audio.speaker"
211
+ },
212
+ "muted": {
213
+ "type": "boolean"
214
+ }
215
+ },
216
+ "required": [
217
+ "kind",
218
+ "muted"
219
+ ],
220
+ "additionalProperties": false
221
+ },
222
+ {
223
+ "type": "object",
224
+ "properties": {
225
+ "kind": {
226
+ "const": "stop"
227
+ }
228
+ },
229
+ "required": [
230
+ "kind"
231
+ ],
232
+ "additionalProperties": false
233
+ },
234
+ {
235
+ "type": "object",
236
+ "properties": {
237
+ "kind": {
238
+ "const": "text"
239
+ },
240
+ "text": {
241
+ "type": "string",
242
+ "minLength": 1,
243
+ "maxLength": 8000
244
+ },
245
+ "clientMessageId": {
246
+ "type": "string",
247
+ "format": "uuid"
248
+ }
249
+ },
250
+ "required": [
251
+ "kind",
252
+ "text",
253
+ "clientMessageId"
254
+ ],
255
+ "additionalProperties": false
256
+ },
257
+ {
258
+ "type": "object",
259
+ "properties": {
260
+ "kind": {
261
+ "const": "documents"
262
+ },
263
+ "allowed": {
264
+ "type": "boolean"
265
+ }
266
+ },
267
+ "required": [
268
+ "kind",
269
+ "allowed"
270
+ ],
271
+ "additionalProperties": false
272
+ },
273
+ {
274
+ "type": "object",
275
+ "properties": {
276
+ "kind": {
277
+ "const": "screen.pick"
278
+ }
279
+ },
280
+ "required": [
281
+ "kind"
282
+ ],
283
+ "additionalProperties": false
284
+ },
285
+ {
286
+ "type": "object",
287
+ "properties": {
288
+ "kind": {
289
+ "const": "screen.open"
290
+ },
291
+ "selectionId": {
292
+ "$ref": "#/$defs/CompanionSelectionId"
293
+ },
294
+ "label": {
295
+ "type": "string",
296
+ "minLength": 1,
297
+ "maxLength": 256
298
+ }
299
+ },
300
+ "required": [
301
+ "kind",
302
+ "selectionId",
303
+ "label"
304
+ ],
305
+ "additionalProperties": false
306
+ },
307
+ {
308
+ "type": "object",
309
+ "properties": {
310
+ "kind": {
311
+ "const": "screen.frame"
312
+ },
313
+ "selectionId": {
314
+ "$ref": "#/$defs/CompanionSelectionId"
315
+ },
316
+ "frame": {
317
+ "$ref": "#/$defs/CompanionScreenFrame"
318
+ }
319
+ },
320
+ "required": [
321
+ "kind",
322
+ "selectionId",
323
+ "frame"
324
+ ],
325
+ "additionalProperties": false
326
+ },
327
+ {
328
+ "type": "object",
329
+ "properties": {
330
+ "kind": {
331
+ "const": "screen.close"
332
+ }
333
+ },
334
+ "required": [
335
+ "kind"
336
+ ],
337
+ "additionalProperties": false
338
+ },
339
+ {
340
+ "type": "object",
341
+ "properties": {
342
+ "kind": {
343
+ "const": "conversation.open"
344
+ }
345
+ },
346
+ "required": [
347
+ "kind"
348
+ ],
349
+ "additionalProperties": false
350
+ },
351
+ {
352
+ "type": "object",
353
+ "description": "Untrusted renderer observation that one assistant subtitle row passed an animation-frame, document, panel and viewport visibility check. It does not prove compositor paint, an unoccluded native window or human reading.",
354
+ "properties": {
355
+ "kind": { "const": "presentation.observe" },
356
+ "event": { "const": "first_text_visible" },
357
+ "observedAt": {
358
+ "type": "integer",
359
+ "minimum": 0,
360
+ "maximum": 9007199254740991,
361
+ "description": "Renderer wall-clock observation time in Unix epoch milliseconds (Date.now domain)."
362
+ },
363
+ "callId": { "$ref": "#/$defs/CompanionCallId" },
364
+ "reference": { "$ref": "#/$defs/CompanionPresentationReference" }
365
+ },
366
+ "required": ["kind", "event", "observedAt", "callId", "reference"],
367
+ "additionalProperties": false
368
+ },
369
+ {
370
+ "type": "object",
371
+ "properties": {
372
+ "kind": { "const": "decisions.read" },
373
+ "offset": { "type": "integer", "minimum": 0 },
374
+ "limit": { "type": "integer", "minimum": 1, "maximum": 20 }
375
+ },
376
+ "required": ["kind", "offset", "limit"],
377
+ "additionalProperties": false
378
+ },
379
+ {
380
+ "type": "object",
381
+ "properties": {
382
+ "kind": { "const": "decision.open" },
383
+ "variantRef": {
384
+ "type": "string",
385
+ "minLength": 1,
386
+ "maxLength": 256,
387
+ "pattern": "^[A-Za-z0-9_-]+$",
388
+ "description": "Opaque Host-issued identity for one concrete decision variant; never a private route or renderer-selected address."
389
+ },
390
+ "target": { "$ref": "#/$defs/CompanionDecisionNavigationTarget" }
391
+ },
392
+ "required": ["kind", "variantRef", "target"],
393
+ "additionalProperties": false
394
+ },
395
+ {
396
+ "type": "object",
397
+ "properties": {
398
+ "kind": { "const": "f221.inspect" },
399
+ "proposalId": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,200}$" }
400
+ },
401
+ "required": ["kind", "proposalId"],
402
+ "additionalProperties": false
403
+ },
404
+ {
405
+ "type": "object",
406
+ "properties": {
407
+ "kind": {
408
+ "const": "view.resize"
409
+ },
410
+ "expanded": {
411
+ "type": "boolean"
412
+ }
413
+ },
414
+ "required": [
415
+ "kind",
416
+ "expanded"
417
+ ],
418
+ "additionalProperties": false
419
+ },
420
+ {
421
+ "type": "object",
422
+ "properties": {
423
+ "kind": {
424
+ "const": "view.layout"
425
+ },
426
+ "panel": {
427
+ "enum": [
428
+ "none",
429
+ "bubble",
430
+ "actions",
431
+ "menu",
432
+ "chat",
433
+ "decisions",
434
+ "transcript",
435
+ "settings",
436
+ "app-assist"
437
+ ]
438
+ },
439
+ "width": {
440
+ "type": "integer",
441
+ "minimum": 120,
442
+ "maximum": 420
443
+ },
444
+ "height": {
445
+ "type": "integer",
446
+ "minimum": 32,
447
+ "maximum": 500
448
+ },
449
+ "call": {
450
+ "type": "object",
451
+ "properties": {
452
+ "presentation": {
453
+ "enum": [
454
+ "lite",
455
+ "controls"
456
+ ]
457
+ },
458
+ "bubble": {
459
+ "type": "object",
460
+ "properties": {
461
+ "width": {
462
+ "type": "integer",
463
+ "minimum": 120,
464
+ "maximum": 420
465
+ },
466
+ "height": {
467
+ "type": "integer",
468
+ "minimum": 32,
469
+ "maximum": 500
470
+ }
471
+ },
472
+ "required": [
473
+ "width",
474
+ "height"
475
+ ],
476
+ "additionalProperties": false
477
+ }
478
+ },
479
+ "required": [
480
+ "presentation"
481
+ ],
482
+ "additionalProperties": false
483
+ }
484
+ },
485
+ "required": [
486
+ "kind",
487
+ "panel",
488
+ "width",
489
+ "height"
490
+ ],
491
+ "additionalProperties": false
492
+ },
493
+ {
494
+ "type": "object",
495
+ "properties": {
496
+ "kind": {
497
+ "const": "view.drag"
498
+ },
499
+ "phase": {
500
+ "enum": [
501
+ "start",
502
+ "end"
503
+ ]
504
+ }
505
+ },
506
+ "required": [
507
+ "kind",
508
+ "phase"
509
+ ],
510
+ "additionalProperties": false
511
+ },
512
+ {
513
+ "type": "object",
514
+ "properties": {
515
+ "kind": {
516
+ "const": "view.hide"
517
+ }
518
+ },
519
+ "required": [
520
+ "kind"
521
+ ],
522
+ "additionalProperties": false
523
+ },
524
+ {
525
+ "type": "object",
526
+ "properties": {
527
+ "kind": { "const": "view.reset" }
528
+ },
529
+ "required": ["kind"],
530
+ "additionalProperties": false
531
+ },
532
+ {
533
+ "type": "object",
534
+ "properties": {
535
+ "kind": { "const": "settings.read" }
536
+ },
537
+ "required": ["kind"],
538
+ "additionalProperties": false
539
+ },
540
+ {
541
+ "type": "object",
542
+ "properties": {
543
+ "kind": { "const": "settings.update" },
544
+ "field": { "const": "dutyCatProfileId" },
545
+ "value": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "\\S" }
546
+ },
547
+ "required": ["kind", "field", "value"],
548
+ "additionalProperties": false
549
+ },
550
+ {
551
+ "type": "object",
552
+ "properties": {
553
+ "kind": { "const": "settings.update" },
554
+ "field": { "const": "skin" },
555
+ "value": { "enum": ["yarn-ball", "ragdoll-v1", "yanyan-codex", "xianxian-codex"] }
556
+ },
557
+ "required": ["kind", "field", "value"],
558
+ "additionalProperties": false
559
+ },
560
+ {
561
+ "type": "object",
562
+ "properties": {
563
+ "kind": { "const": "settings.update" },
564
+ "field": { "const": "ballSize" },
565
+ "value": { "type": "integer", "minimum": 43, "maximum": 192 }
566
+ },
567
+ "required": ["kind", "field", "value"],
568
+ "additionalProperties": false
569
+ },
570
+ {
571
+ "type": "object",
572
+ "properties": {
573
+ "kind": { "const": "settings.update" },
574
+ "field": { "const": "behaviorEnabled" },
575
+ "value": { "type": "boolean" }
576
+ },
577
+ "required": ["kind", "field", "value"],
578
+ "additionalProperties": false
579
+ },
580
+ {
581
+ "type": "object",
582
+ "properties": {
583
+ "kind": { "const": "settings.update" },
584
+ "field": { "const": "proactivePolicy" },
585
+ "value": { "enum": ["ambient", "quiet-badge"] }
586
+ },
587
+ "required": ["kind", "field", "value"],
588
+ "additionalProperties": false
589
+ },
590
+ {
591
+ "type": "object",
592
+ "properties": {
593
+ "kind": { "const": "settings.update" },
594
+ "field": { "const": "personaTone" },
595
+ "value": { "type": "string", "minLength": 1, "maxLength": 200, "pattern": "^(?=.*\\S)[^\\r\\n\\u2028\\u2029]+$" }
596
+ },
597
+ "required": ["kind", "field", "value"],
598
+ "additionalProperties": false
599
+ },
600
+ {
601
+ "type": "object",
602
+ "properties": {
603
+ "kind": { "const": "settings.update" },
604
+ "field": { "const": "householdReadsAllowed" },
605
+ "value": { "type": "boolean" }
606
+ },
607
+ "required": ["kind", "field", "value"],
608
+ "additionalProperties": false
609
+ },
610
+ {
611
+ "type": "object",
612
+ "properties": {
613
+ "kind": { "const": "settings.update" },
614
+ "field": { "const": "appAssistEnabled" },
615
+ "value": { "type": "boolean" }
616
+ },
617
+ "required": ["kind", "field", "value"],
618
+ "additionalProperties": false
619
+ },
620
+ {
621
+ "type": "object",
622
+ "properties": {
623
+ "kind": { "const": "app-assist.settle" },
624
+ "scopeRef": { "$ref": "#/$defs/CompanionAppAssistRef" },
625
+ "offerRef": { "$ref": "#/$defs/CompanionAppAssistRef" },
626
+ "action": { "$ref": "#/$defs/CompanionAppAssistAction" }
627
+ },
628
+ "required": ["kind", "scopeRef", "offerRef", "action"],
629
+ "additionalProperties": false
630
+ },
631
+ {
632
+ "type": "object",
633
+ "properties": {
634
+ "kind": { "const": "companion.disable" }
635
+ },
636
+ "required": ["kind"],
637
+ "additionalProperties": false
638
+ },
639
+ {
640
+ "type": "object",
641
+ "properties": {
642
+ "kind": {
643
+ "const": "conversation.read"
644
+ }
645
+ },
646
+ "required": [
647
+ "kind"
648
+ ],
649
+ "additionalProperties": false
650
+ },
651
+ {
652
+ "type": "object",
653
+ "properties": {
654
+ "kind": { "const": "conversation.read" },
655
+ "v": { "const": 2 },
656
+ "before": { "$ref": "#/$defs/CompanionOpaqueReadReference" },
657
+ "limit": { "type": "integer", "minimum": 1, "maximum": 32 }
658
+ },
659
+ "required": ["kind", "v"],
660
+ "additionalProperties": false
661
+ },
662
+ {
663
+ "type": "object",
664
+ "properties": {
665
+ "kind": { "const": "conversation.body.read" },
666
+ "v": { "const": 2 },
667
+ "continuation": { "$ref": "#/$defs/CompanionOpaqueReadReference" }
668
+ },
669
+ "required": ["kind", "v", "continuation"],
670
+ "additionalProperties": false
671
+ },
672
+ {
673
+ "type": "object",
674
+ "properties": {
675
+ "kind": { "const": "conversation.draft.read" },
676
+ "v": { "const": 1 }
677
+ },
678
+ "required": ["kind", "v"],
679
+ "additionalProperties": false
680
+ },
681
+ {
682
+ "type": "object",
683
+ "properties": {
684
+ "kind": { "const": "conversation.draft.save" },
685
+ "v": { "const": 1 },
686
+ "scopeRef": { "$ref": "#/$defs/CompanionConversationScopeRef" },
687
+ "expectedRevision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
688
+ "text": { "type": "string", "maxLength": 8000 }
689
+ },
690
+ "required": ["kind", "v", "scopeRef", "expectedRevision", "text"],
691
+ "additionalProperties": false
692
+ },
693
+ {
694
+ "type": "object",
695
+ "properties": {
696
+ "kind": { "const": "conversation.delivery.read" },
697
+ "v": { "const": 1 },
698
+ "scopeRef": { "$ref": "#/$defs/CompanionConversationScopeRef" },
699
+ "clientMessageId": { "$ref": "#/$defs/CompanionClientMessageId" }
700
+ },
701
+ "required": ["kind", "v", "scopeRef", "clientMessageId"],
702
+ "additionalProperties": false
703
+ },
704
+ {
705
+ "type": "object",
706
+ "properties": {
707
+ "kind": {
708
+ "const": "transcript.read"
709
+ }
710
+ },
711
+ "required": [
712
+ "kind"
713
+ ],
714
+ "additionalProperties": false
715
+ },
716
+ {
717
+ "type": "object",
718
+ "properties": {
719
+ "kind": {
720
+ "const": "text"
721
+ },
722
+ "v": {
723
+ "const": 2
724
+ },
725
+ "scopeRef": {
726
+ "$ref": "#/$defs/CompanionConversationScopeRef"
727
+ },
728
+ "text": {
729
+ "type": "string",
730
+ "minLength": 1,
731
+ "maxLength": 8000
732
+ },
733
+ "clientMessageId": {
734
+ "$ref": "#/$defs/CompanionClientMessageId"
735
+ },
736
+ "submissionRevision": {
737
+ "type": "integer",
738
+ "minimum": 0,
739
+ "maximum": 9007199254740991
740
+ }
741
+ },
742
+ "required": [
743
+ "kind",
744
+ "v",
745
+ "scopeRef",
746
+ "text",
747
+ "clientMessageId",
748
+ "submissionRevision"
749
+ ],
750
+ "additionalProperties": false
751
+ }
752
+ ]
753
+ },
754
+ "CompanionActor": {
755
+ "type": "object",
756
+ "properties": {
757
+ "catId": {
758
+ "type": "string",
759
+ "minLength": 1,
760
+ "maxLength": 160
761
+ },
762
+ "displayName": {
763
+ "type": "string",
764
+ "minLength": 1,
765
+ "maxLength": 256
766
+ }
767
+ },
768
+ "required": [
769
+ "catId",
770
+ "displayName"
771
+ ],
772
+ "additionalProperties": false
773
+ },
774
+ "CompanionWorkCoverage": {
775
+ "type": "object",
776
+ "properties": {
777
+ "source": { "enum": ["tasks", "messages", "artifacts"] },
778
+ "status": { "enum": ["available", "partial", "unavailable"] }
779
+ },
780
+ "required": ["source", "status"],
781
+ "additionalProperties": false
782
+ },
783
+ "CompanionWorkActive": {
784
+ "type": "object",
785
+ "properties": {
786
+ "entryRef": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,256}$" },
787
+ "title": { "type": "string", "minLength": 1, "maxLength": 280, "pattern": "^(?=.*\\S)[^\\r\\n]+$" },
788
+ "actor": {
789
+ "oneOf": [
790
+ { "$ref": "#/$defs/CompanionActor" },
791
+ { "type": "null" }
792
+ ]
793
+ },
794
+ "activity": { "enum": ["working", "waiting"] },
795
+ "taskId": { "type": ["string", "null"], "minLength": 1, "maxLength": 256, "pattern": "\\S" },
796
+ "homeThreadId": { "type": ["string", "null"], "minLength": 1, "maxLength": 256, "pattern": "\\S" },
797
+ "sourceRef": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(?=.*\\S)[^\\r\\n]+$" },
798
+ "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
799
+ },
800
+ "required": ["entryRef", "title", "actor", "activity", "taskId", "homeThreadId", "sourceRef", "updatedAt"],
801
+ "additionalProperties": false
802
+ },
803
+ "CompanionWorkDelivery": {
804
+ "type": "object",
805
+ "properties": {
806
+ "entryRef": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,256}$" },
807
+ "title": { "type": "string", "minLength": 1, "maxLength": 280, "pattern": "^(?=.*\\S)[^\\r\\n]+$" },
808
+ "taskId": { "type": ["string", "null"], "minLength": 1, "maxLength": 256, "pattern": "\\S" },
809
+ "homeThreadId": { "type": ["string", "null"], "minLength": 1, "maxLength": 256, "pattern": "\\S" },
810
+ "sourceRef": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(?=.*\\S)[^\\r\\n]+$" },
811
+ "deliveredAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
812
+ "artifact": {
813
+ "oneOf": [
814
+ { "type": "null" },
815
+ {
816
+ "type": "object",
817
+ "properties": {
818
+ "artifactId": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "\\S" },
819
+ "version": { "type": ["string", "null"], "minLength": 1, "maxLength": 160, "pattern": "\\S" },
820
+ "versionState": { "enum": ["current", "superseded", "unknown"] }
821
+ },
822
+ "required": ["artifactId", "version", "versionState"],
823
+ "allOf": [
824
+ {
825
+ "if": {
826
+ "properties": { "versionState": { "enum": ["current", "superseded"] } },
827
+ "required": ["versionState"]
828
+ },
829
+ "then": {
830
+ "properties": {
831
+ "version": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "\\S" }
832
+ }
833
+ }
834
+ }
835
+ ],
836
+ "additionalProperties": false
837
+ }
838
+ ]
839
+ }
840
+ },
841
+ "required": ["entryRef", "title", "taskId", "homeThreadId", "sourceRef", "deliveredAt", "artifact"],
842
+ "additionalProperties": false
843
+ },
844
+ "CompanionWorkOverview": {
845
+ "type": "object",
846
+ "properties": {
847
+ "kind": { "const": "work" },
848
+ "v": { "const": 1 },
849
+ "status": { "enum": ["available", "partial", "unavailable"] },
850
+ "observedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
851
+ "scope": {
852
+ "type": "object",
853
+ "properties": {
854
+ "kind": { "const": "current-project" },
855
+ "label": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^(?=.*\\S)[^\\r\\n]+$" }
856
+ },
857
+ "required": ["kind", "label"],
858
+ "additionalProperties": false
859
+ },
860
+ "coverage": {
861
+ "type": "array",
862
+ "minItems": 3,
863
+ "maxItems": 3,
864
+ "items": { "$ref": "#/$defs/CompanionWorkCoverage" },
865
+ "allOf": [
866
+ { "contains": { "type": "object", "properties": { "source": { "const": "tasks" } }, "required": ["source"] } },
867
+ { "contains": { "type": "object", "properties": { "source": { "const": "messages" } }, "required": ["source"] } },
868
+ { "contains": { "type": "object", "properties": { "source": { "const": "artifacts" } }, "required": ["source"] } }
869
+ ]
870
+ },
871
+ "active": { "type": "array", "maxItems": 8, "items": { "$ref": "#/$defs/CompanionWorkActive" } },
872
+ "recentDeliveries": { "type": "array", "maxItems": 8, "items": { "$ref": "#/$defs/CompanionWorkDelivery" } }
873
+ },
874
+ "required": ["kind", "v", "status", "observedAt", "scope", "coverage", "active", "recentDeliveries"],
875
+ "additionalProperties": false
876
+ },
877
+ "CompanionIdentitySnapshotV1": {
878
+ "type": "object",
879
+ "description": "Immutable display identity saved with one historical message. The real author and source remain on the message itself.",
880
+ "properties": {
881
+ "v": { "const": 1 },
882
+ "name": { "const": "猫猫球" },
883
+ "partner": {
884
+ "type": "object",
885
+ "properties": {
886
+ "catId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "\\S" },
887
+ "displayName": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "\\S" },
888
+ "skin": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "\\S" }
889
+ },
890
+ "required": ["catId", "displayName", "skin"],
891
+ "additionalProperties": false
892
+ },
893
+ "live": {
894
+ "type": "object",
895
+ "properties": {
896
+ "catId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "\\S" },
897
+ "displayName": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "\\S" },
898
+ "transport": { "const": "gpt_live_v3" },
899
+ "verifiedModel": {
900
+ "type": ["string", "null"], "minLength": 1, "maxLength": 160, "pattern": "\\S"
901
+ }
902
+ },
903
+ "required": ["catId", "displayName", "transport", "verifiedModel"],
904
+ "additionalProperties": false
905
+ },
906
+ "deep": {
907
+ "type": "object",
908
+ "properties": {
909
+ "catId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "\\S" },
910
+ "displayName": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "\\S" },
911
+ "verifiedModel": {
912
+ "type": ["string", "null"], "minLength": 1, "maxLength": 160, "pattern": "\\S"
913
+ }
914
+ },
915
+ "required": ["catId", "displayName", "verifiedModel"],
916
+ "additionalProperties": false
917
+ }
918
+ },
919
+ "required": ["v", "name", "partner", "live", "deep"],
920
+ "additionalProperties": false
921
+ },
922
+ "CompanionLiveTransport": {
923
+ "type": "object",
924
+ "properties": {
925
+ "kind": { "const": "gpt_live_v3" },
926
+ "verifiedModel": { "type": "null" }
927
+ },
928
+ "required": ["kind", "verifiedModel"],
929
+ "additionalProperties": false
930
+ },
931
+ "CompanionAudioState": {
932
+ "type": "object",
933
+ "properties": {
934
+ "supportedModes": {
935
+ "type": "array",
936
+ "minItems": 1,
937
+ "maxItems": 2,
938
+ "uniqueItems": true,
939
+ "items": { "enum": ["duplex", "receive_only"] }
940
+ },
941
+ "activeMode": {
942
+ "oneOf": [
943
+ { "enum": ["duplex", "receive_only"] },
944
+ { "type": "null" }
945
+ ]
946
+ }
947
+ },
948
+ "required": ["supportedModes", "activeMode"],
949
+ "additionalProperties": false
950
+ },
951
+ "CompanionNativeWorkEntry": {
952
+ "type": "object",
953
+ "properties": {
954
+ "taskId": { "type": "string", "minLength": 1, "maxLength": 500 },
955
+ "nativeTurnId": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,160}$" },
956
+ "kind": { "enum": ["reasoning", "tool", "workspace_fetch", "workspace_dispatch", "screen_read"] },
957
+ "startedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
958
+ "expiresAt": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }
959
+ },
960
+ "required": ["taskId", "nativeTurnId", "kind", "startedAt", "expiresAt"],
961
+ "additionalProperties": false
962
+ },
963
+ "CompanionNativeWorkEvent": {
964
+ "type": "object",
965
+ "properties": {
966
+ "eventId": { "type": "string", "minLength": 1, "maxLength": 500 },
967
+ "taskId": { "type": "string", "minLength": 1, "maxLength": 500 },
968
+ "kind": { "enum": ["reasoning", "tool", "workspace_fetch", "workspace_dispatch", "screen_read", "result"] },
969
+ "phase": { "enum": ["started", "completed", "failed", "cancelled", "expired", "result_handed_to_voice"] },
970
+ "occurredAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
971
+ "expiresAt": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
972
+ "resultId": { "type": "string", "minLength": 1, "maxLength": 500 },
973
+ "nativeCarrierCatId": { "type": "string", "minLength": 1, "maxLength": 160 }
974
+ },
975
+ "required": ["eventId", "taskId", "kind", "phase", "occurredAt", "expiresAt"],
976
+ "additionalProperties": false
977
+ },
978
+ "CompanionNativeWork": {
979
+ "type": "object",
980
+ "properties": {
981
+ "scopeId": { "type": ["string", "null"], "pattern": "^[0-9a-f]{16}$" },
982
+ "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
983
+ "active": { "type": "array", "maxItems": 64, "items": { "$ref": "#/$defs/CompanionNativeWorkEntry" } },
984
+ "recent": { "type": "array", "maxItems": 16, "items": { "$ref": "#/$defs/CompanionNativeWorkEvent" } }
985
+ },
986
+ "required": ["scopeId", "revision", "active", "recent"],
987
+ "additionalProperties": false
988
+ },
989
+ "CompanionMeetingState": {
990
+ "description": "Bounded, read-only projection of Host meeting-capture truth for the current companion call. It carries no meeting selector, raw identifier, transcript metric, lease, participant, or control authority.",
991
+ "oneOf": [
992
+ {
993
+ "type": "object",
994
+ "properties": {
995
+ "kind": { "const": "running" },
996
+ "sharing": { "type": "boolean", "description": "Whether this capture is connected to the current companion call. This is not proof that speech was heard or transcribed." },
997
+ "paused": { "type": "boolean", "description": "Whether capture is paused. Pause and call sharing are independent Host observations." },
998
+ "sourceLabel": {
999
+ "description": "Optional verified display label for the meeting application; never a raw source identifier.",
1000
+ "oneOf": [
1001
+ { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F-\\u009F\\u061C\\u200E\\u200F\\u2028-\\u202E\\u2066-\\u2069]+$" },
1002
+ { "type": "null" }
1003
+ ]
1004
+ }
1005
+ },
1006
+ "required": ["kind", "sharing", "paused", "sourceLabel"],
1007
+ "additionalProperties": false
1008
+ },
1009
+ {
1010
+ "type": "object",
1011
+ "properties": {
1012
+ "kind": { "enum": ["idle", "stopped", "unconfirmed", "needs_source"] },
1013
+ "sharing": { "const": false },
1014
+ "paused": { "const": false },
1015
+ "sourceLabel": { "const": null }
1016
+ },
1017
+ "required": ["kind", "sharing", "paused", "sourceLabel"],
1018
+ "additionalProperties": false
1019
+ }
1020
+ ]
1021
+ },
1022
+ "CompanionAppAssistState": {
1023
+ "type": "object",
1024
+ "properties": {
1025
+ "scopeRef": { "$ref": "#/$defs/CompanionAppAssistRef" },
1026
+ "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
1027
+ "status": {
1028
+ "enum": [
1029
+ "off",
1030
+ "ready",
1031
+ "suspended",
1032
+ "unsupported",
1033
+ "source_unavailable",
1034
+ "permission_required",
1035
+ "timezone_required",
1036
+ "identity_unavailable"
1037
+ ]
1038
+ },
1039
+ "offer": {
1040
+ "oneOf": [
1041
+ { "type": "null" },
1042
+ {
1043
+ "type": "object",
1044
+ "properties": {
1045
+ "offerRef": { "$ref": "#/$defs/CompanionAppAssistRef" },
1046
+ "appName": {
1047
+ "type": "string",
1048
+ "minLength": 1,
1049
+ "maxLength": 128,
1050
+ "pattern": "^(?=.*\\S)[^\\u0000-\\u001F\\u007F-\\u009F\\u061C\\u200E\\u200F\\u2028-\\u202E\\u2066-\\u2069]+$"
1051
+ }
1052
+ },
1053
+ "required": ["offerRef", "appName"],
1054
+ "additionalProperties": false
1055
+ }
1056
+ ]
1057
+ }
1058
+ },
1059
+ "required": ["scopeRef", "revision", "status", "offer"],
1060
+ "additionalProperties": false,
1061
+ "oneOf": [
1062
+ {
1063
+ "properties": {
1064
+ "status": { "const": "ready" },
1065
+ "offer": {}
1066
+ },
1067
+ "required": ["status", "offer"]
1068
+ },
1069
+ {
1070
+ "properties": {
1071
+ "status": {
1072
+ "enum": [
1073
+ "off",
1074
+ "suspended",
1075
+ "unsupported",
1076
+ "source_unavailable",
1077
+ "permission_required",
1078
+ "timezone_required",
1079
+ "identity_unavailable"
1080
+ ]
1081
+ },
1082
+ "offer": { "const": null }
1083
+ },
1084
+ "required": ["status", "offer"]
1085
+ }
1086
+ ]
1087
+ },
1088
+ "CompanionAppAssistSettlement": {
1089
+ "type": "object",
1090
+ "properties": {
1091
+ "kind": { "const": "app-assist-settlement" },
1092
+ "scopeRef": { "$ref": "#/$defs/CompanionAppAssistRef" },
1093
+ "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
1094
+ "offerRef": { "$ref": "#/$defs/CompanionAppAssistRef" },
1095
+ "action": { "$ref": "#/$defs/CompanionAppAssistAction" },
1096
+ "outcome": { "enum": ["settled", "stale_offer"] }
1097
+ },
1098
+ "required": ["kind", "scopeRef", "revision", "offerRef", "action", "outcome"],
1099
+ "additionalProperties": false
1100
+ },
1101
+ "CompanionState": {
1102
+ "type": "object",
1103
+ "properties": {
1104
+ "kind": {
1105
+ "const": "state"
1106
+ },
1107
+ "phase": {
1108
+ "enum": [
1109
+ "idle",
1110
+ "preparing",
1111
+ "ready",
1112
+ "connecting",
1113
+ "talking",
1114
+ "closed",
1115
+ "failed"
1116
+ ]
1117
+ },
1118
+ "displayName": {
1119
+ "type": "string",
1120
+ "minLength": 1,
1121
+ "maxLength": 256
1122
+ },
1123
+ "skin": {
1124
+ "type": "string",
1125
+ "minLength": 1,
1126
+ "maxLength": 100
1127
+ },
1128
+ "duty": {
1129
+ "$ref": "#/$defs/CompanionActor"
1130
+ },
1131
+ "carrier": {
1132
+ "$ref": "#/$defs/CompanionActor"
1133
+ },
1134
+ "documentsAllowed": {
1135
+ "type": "boolean"
1136
+ },
1137
+ "behaviorEnabled": {
1138
+ "type": "boolean"
1139
+ },
1140
+ "toolsReady": {
1141
+ "type": "boolean"
1142
+ },
1143
+ "nativeActivity": {
1144
+ "enum": ["none", "reasoning", "tool_running"]
1145
+ },
1146
+ "liveTransport": {
1147
+ "$ref": "#/$defs/CompanionLiveTransport"
1148
+ },
1149
+ "audio": {
1150
+ "$ref": "#/$defs/CompanionAudioState"
1151
+ },
1152
+ "meeting": {
1153
+ "$ref": "#/$defs/CompanionMeetingState"
1154
+ },
1155
+ "appAssist": {
1156
+ "$ref": "#/$defs/CompanionAppAssistState"
1157
+ },
1158
+ "nativeWork": {
1159
+ "$ref": "#/$defs/CompanionNativeWork"
1160
+ }
1161
+ },
1162
+ "required": [
1163
+ "kind",
1164
+ "phase",
1165
+ "displayName",
1166
+ "skin",
1167
+ "duty",
1168
+ "carrier",
1169
+ "documentsAllowed",
1170
+ "behaviorEnabled",
1171
+ "toolsReady",
1172
+ "nativeActivity",
1173
+ "liveTransport",
1174
+ "meeting",
1175
+ "appAssist",
1176
+ "nativeWork"
1177
+ ],
1178
+ "additionalProperties": false
1179
+ },
1180
+ "CompanionDecisionNavigationTarget": {
1181
+ "enum": ["origin", "approval_card", "action"]
1182
+ },
1183
+ "CompanionDecisionNavigation": {
1184
+ "type": "object",
1185
+ "properties": {
1186
+ "targets": {
1187
+ "type": "array",
1188
+ "maxItems": 3,
1189
+ "uniqueItems": true,
1190
+ "items": { "$ref": "#/$defs/CompanionDecisionNavigationTarget" }
1191
+ }
1192
+ },
1193
+ "required": ["targets"],
1194
+ "additionalProperties": false
1195
+ },
1196
+ "CompanionDecisionSourceRead": {
1197
+ "type": "object",
1198
+ "properties": {
1199
+ "status": { "enum": ["available", "unavailable", "unauthenticated", "forbidden", "invalid"] },
1200
+ "coverage": { "enum": ["complete", "partial", "unknown"] }
1201
+ },
1202
+ "required": ["status", "coverage"],
1203
+ "additionalProperties": false
1204
+ },
1205
+ "CompanionDecisionSources": {
1206
+ "type": "object",
1207
+ "properties": {
1208
+ "approvals": { "$ref": "#/$defs/CompanionDecisionSourceRead" },
1209
+ "needsMe": { "$ref": "#/$defs/CompanionDecisionSourceRead" }
1210
+ },
1211
+ "required": ["approvals", "needsMe"],
1212
+ "additionalProperties": false
1213
+ },
1214
+ "CompanionDecisionApproval": {
1215
+ "type": "object",
1216
+ "properties": {
1217
+ "resolution": { "enum": ["open", "accepted", "rejected", "closed_without_decision"] },
1218
+ "materializationState": { "enum": ["not_started", "outcome_unknown", "in_progress", "succeeded", "failed"] },
1219
+ "linkedNeedsMe": { "type": "boolean" }
1220
+ },
1221
+ "required": ["resolution", "materializationState", "linkedNeedsMe"],
1222
+ "additionalProperties": false
1223
+ },
1224
+ "CompanionDecisionItem": {
1225
+ "oneOf": [
1226
+ {
1227
+ "type": "object",
1228
+ "properties": {
1229
+ "variantRef": {
1230
+ "type": "string",
1231
+ "minLength": 1,
1232
+ "maxLength": 256,
1233
+ "pattern": "^[A-Za-z0-9_-]+$",
1234
+ "description": "Opaque stable identity for this concrete canonical version; unique even when internal logical identities conflict."
1235
+ },
1236
+ "kind": { "const": "approval" },
1237
+ "summary": { "type": "string", "maxLength": 500 },
1238
+ "navigation": { "$ref": "#/$defs/CompanionDecisionNavigation" },
1239
+ "approval": { "$ref": "#/$defs/CompanionDecisionApproval" }
1240
+ },
1241
+ "required": ["variantRef", "kind", "summary", "navigation", "approval"],
1242
+ "additionalProperties": false
1243
+ },
1244
+ {
1245
+ "type": "object",
1246
+ "properties": {
1247
+ "variantRef": {
1248
+ "type": "string",
1249
+ "minLength": 1,
1250
+ "maxLength": 256,
1251
+ "pattern": "^[A-Za-z0-9_-]+$",
1252
+ "description": "Opaque stable identity for this concrete canonical version; unique even when internal logical identities conflict."
1253
+ },
1254
+ "kind": { "enum": ["judgment", "repair"] },
1255
+ "summary": { "type": "string", "maxLength": 500 },
1256
+ "navigation": { "$ref": "#/$defs/CompanionDecisionNavigation" }
1257
+ },
1258
+ "required": ["variantRef", "kind", "summary", "navigation"],
1259
+ "additionalProperties": false
1260
+ }
1261
+ ]
1262
+ },
1263
+ "CompanionLegacyDecisions": {
1264
+ "type": "object",
1265
+ "properties": {
1266
+ "kind": { "const": "decisions" },
1267
+ "status": { "enum": ["available", "unavailable"] },
1268
+ "approvalCount": { "type": ["integer", "null"], "minimum": 0 },
1269
+ "needsMeCount": { "type": ["integer", "null"], "minimum": 0 },
1270
+ "otherNeedsMeCount": { "type": ["integer", "null"], "minimum": 0 },
1271
+ "approvals": {
1272
+ "type": "array",
1273
+ "maxItems": 20,
1274
+ "items": {
1275
+ "type": "object",
1276
+ "properties": {
1277
+ "proposalId": { "type": "string", "minLength": 1, "maxLength": 200 },
1278
+ "sourceFeatureId": { "type": "string", "minLength": 1, "maxLength": 40 },
1279
+ "summary": { "type": "string", "maxLength": 500 },
1280
+ "resolution": { "enum": ["open", "accepted", "rejected", "closed_without_decision"] },
1281
+ "materializationState": { "enum": ["not_started", "outcome_unknown", "in_progress", "succeeded", "failed"] },
1282
+ "linkedNeedsMe": { "type": "boolean" }
1283
+ },
1284
+ "required": ["proposalId", "sourceFeatureId", "summary", "resolution", "materializationState", "linkedNeedsMe"],
1285
+ "additionalProperties": false
1286
+ }
1287
+ },
1288
+ "otherNeedsMe": {
1289
+ "type": "array",
1290
+ "maxItems": 20,
1291
+ "items": {
1292
+ "type": "object",
1293
+ "properties": {
1294
+ "subjectRef": { "type": "string", "minLength": 1, "maxLength": 256 },
1295
+ "summary": { "type": "string", "maxLength": 500 }
1296
+ },
1297
+ "required": ["subjectRef", "summary"],
1298
+ "additionalProperties": false
1299
+ }
1300
+ },
1301
+ "page": {
1302
+ "type": "object",
1303
+ "properties": {
1304
+ "offset": { "type": "integer", "minimum": 0 },
1305
+ "limit": { "type": "integer", "minimum": 1, "maximum": 20 },
1306
+ "hasMoreApprovals": { "type": "boolean" },
1307
+ "hasMoreNeedsMe": { "type": "boolean" }
1308
+ },
1309
+ "required": ["offset", "limit", "hasMoreApprovals", "hasMoreNeedsMe"],
1310
+ "additionalProperties": false
1311
+ }
1312
+ },
1313
+ "required": ["kind", "status", "approvalCount", "needsMeCount", "otherNeedsMeCount", "approvals", "otherNeedsMe", "page"],
1314
+ "additionalProperties": false
1315
+ },
1316
+ "CompanionUnifiedDecisions": {
1317
+ "type": "object",
1318
+ "properties": {
1319
+ "kind": { "const": "decisions" },
1320
+ "version": { "const": 1 },
1321
+ "status": { "enum": ["available", "partial", "unavailable"] },
1322
+ "observedAt": { "type": "number", "minimum": 0 },
1323
+ "sources": { "$ref": "#/$defs/CompanionDecisionSources" },
1324
+ "items": {
1325
+ "type": "array",
1326
+ "maxItems": 20,
1327
+ "items": { "$ref": "#/$defs/CompanionDecisionItem" }
1328
+ },
1329
+ "totalCount": {
1330
+ "type": "integer",
1331
+ "minimum": 0,
1332
+ "maximum": 1000000,
1333
+ "description": "Exact normalized count before paging; omitted unless every declared source is complete and identity reconciliation is trustworthy."
1334
+ },
1335
+ "page": {
1336
+ "type": "object",
1337
+ "properties": {
1338
+ "offset": { "type": "integer", "minimum": 0 },
1339
+ "limit": { "type": "integer", "minimum": 1, "maximum": 20 },
1340
+ "scope": { "const": "known_rows" },
1341
+ "hasMore": { "type": "boolean" }
1342
+ },
1343
+ "required": ["offset", "limit", "scope", "hasMore"],
1344
+ "additionalProperties": false
1345
+ }
1346
+ },
1347
+ "required": ["kind", "version", "status", "observedAt", "sources", "items", "page"],
1348
+ "additionalProperties": false
1349
+ },
1350
+ "CompanionDecisions": {
1351
+ "oneOf": [
1352
+ { "$ref": "#/$defs/CompanionLegacyDecisions" },
1353
+ { "$ref": "#/$defs/CompanionUnifiedDecisions" }
1354
+ ]
1355
+ },
1356
+ "CompanionDecisionTrial": {
1357
+ "type": "object",
1358
+ "properties": {
1359
+ "kind": { "const": "decision-trial" },
1360
+ "status": { "enum": ["dismissed", "trial_confirmed", "stale", "unavailable"] }
1361
+ },
1362
+ "required": ["kind", "status"],
1363
+ "additionalProperties": false
1364
+ },
1365
+ "CompanionSettingField": {
1366
+ "enum": [
1367
+ "dutyCatProfileId",
1368
+ "skin",
1369
+ "ballSize",
1370
+ "behaviorEnabled",
1371
+ "proactivePolicy",
1372
+ "personaTone",
1373
+ "householdReadsAllowed",
1374
+ "appAssistEnabled"
1375
+ ]
1376
+ },
1377
+ "CompanionSettingsValues": {
1378
+ "type": "object",
1379
+ "properties": {
1380
+ "dutyCatProfileId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "\\S" },
1381
+ "skin": { "enum": ["yarn-ball", "ragdoll-v1", "yanyan-codex", "xianxian-codex"] },
1382
+ "ballSize": { "type": "integer", "minimum": 43, "maximum": 192 },
1383
+ "behaviorEnabled": { "type": "boolean" },
1384
+ "proactivePolicy": { "enum": ["ambient", "quiet-badge"] },
1385
+ "personaTone": { "type": "string", "minLength": 1, "maxLength": 200, "pattern": "^[^\\r\\n]+$" },
1386
+ "householdReadsAllowed": { "type": "boolean" },
1387
+ "appAssistEnabled": { "type": "boolean" }
1388
+ },
1389
+ "required": [
1390
+ "dutyCatProfileId",
1391
+ "skin",
1392
+ "ballSize",
1393
+ "behaviorEnabled",
1394
+ "proactivePolicy",
1395
+ "personaTone",
1396
+ "householdReadsAllowed",
1397
+ "appAssistEnabled"
1398
+ ],
1399
+ "additionalProperties": false
1400
+ },
1401
+ "CompanionSettingsRosterEntry": {
1402
+ "type": "object",
1403
+ "properties": {
1404
+ "catProfileId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "\\S" },
1405
+ "displayName": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "\\S" },
1406
+ "available": { "type": "boolean" }
1407
+ },
1408
+ "required": ["catProfileId", "displayName", "available"],
1409
+ "additionalProperties": false
1410
+ },
1411
+ "CompanionSettings": {
1412
+ "oneOf": [
1413
+ {
1414
+ "type": "object",
1415
+ "properties": {
1416
+ "kind": { "const": "settings" },
1417
+ "status": { "const": "available" },
1418
+ "values": { "$ref": "#/$defs/CompanionSettingsValues" },
1419
+ "companions": {
1420
+ "type": "array",
1421
+ "maxItems": 64,
1422
+ "items": { "$ref": "#/$defs/CompanionSettingsRosterEntry" }
1423
+ },
1424
+ "selectedCompanionStatus": { "enum": ["available", "unavailable"] }
1425
+ },
1426
+ "required": ["kind", "status", "values", "companions", "selectedCompanionStatus"],
1427
+ "additionalProperties": false
1428
+ },
1429
+ {
1430
+ "type": "object",
1431
+ "properties": {
1432
+ "kind": { "const": "settings" },
1433
+ "status": { "const": "unavailable" },
1434
+ "reason": { "enum": ["host_upgrade_required", "temporarily_unavailable"] }
1435
+ },
1436
+ "required": ["kind", "status", "reason"],
1437
+ "additionalProperties": false
1438
+ }
1439
+ ]
1440
+ },
1441
+ "CompanionSettingsUpdateReceipt": {
1442
+ "oneOf": [
1443
+ {
1444
+ "type": "object",
1445
+ "properties": {
1446
+ "kind": { "const": "settings-update" },
1447
+ "field": { "$ref": "#/$defs/CompanionSettingField" },
1448
+ "outcome": { "const": "saved" },
1449
+ "callStatus": { "enum": ["unchanged", "stopped"] },
1450
+ "applies": { "enum": ["now", "next_call"] }
1451
+ },
1452
+ "required": ["kind", "field", "outcome", "callStatus", "applies"],
1453
+ "additionalProperties": false
1454
+ },
1455
+ {
1456
+ "type": "object",
1457
+ "properties": {
1458
+ "kind": { "const": "settings-update" },
1459
+ "field": { "$ref": "#/$defs/CompanionSettingField" },
1460
+ "outcome": { "const": "rejected" },
1461
+ "callStatus": { "enum": ["unchanged", "stopped", "stop_failed"] },
1462
+ "reason": {
1463
+ "enum": [
1464
+ "invalid_value",
1465
+ "selection_unavailable",
1466
+ "permission_denied",
1467
+ "call_stop_failed",
1468
+ "save_failed",
1469
+ "unsupported"
1470
+ ]
1471
+ }
1472
+ },
1473
+ "required": ["kind", "field", "outcome", "callStatus", "reason"],
1474
+ "additionalProperties": false
1475
+ },
1476
+ {
1477
+ "type": "object",
1478
+ "properties": {
1479
+ "kind": { "const": "settings-update" },
1480
+ "field": { "$ref": "#/$defs/CompanionSettingField" },
1481
+ "outcome": { "const": "unconfirmed" },
1482
+ "callStatus": { "enum": ["unchanged", "stopped"] },
1483
+ "reconcile": { "const": "settings.read" }
1484
+ },
1485
+ "required": ["kind", "field", "outcome", "callStatus", "reconcile"],
1486
+ "additionalProperties": false
1487
+ }
1488
+ ]
1489
+ },
1490
+ "CompanionLifecycleReceipt": {
1491
+ "type": "object",
1492
+ "properties": {
1493
+ "kind": { "const": "companion-lifecycle" },
1494
+ "action": { "const": "disable" },
1495
+ "outcome": { "const": "disabled" }
1496
+ },
1497
+ "required": ["kind", "action", "outcome"],
1498
+ "additionalProperties": false
1499
+ },
1500
+ "CompanionTranscriptScope": {
1501
+ "type": "object",
1502
+ "properties": {
1503
+ "callId": { "$ref": "#/$defs/CompanionCallId" },
1504
+ "realtimeSessionId": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "\\S" }
1505
+ },
1506
+ "required": ["callId", "realtimeSessionId"],
1507
+ "additionalProperties": false
1508
+ },
1509
+ "CompanionTranscriptVoiceSource": {
1510
+ "type": "object",
1511
+ "properties": {
1512
+ "kind": { "const": "voice" },
1513
+ "nativeThreadId": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "\\S" },
1514
+ "realtimeSessionId": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "\\S" },
1515
+ "nativeItemId": { "$ref": "#/$defs/CompanionCorrelatableId" },
1516
+ "nativeTurnId": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "\\S" }
1517
+ },
1518
+ "required": ["kind", "nativeThreadId", "realtimeSessionId", "nativeItemId"],
1519
+ "additionalProperties": false
1520
+ },
1521
+ "CompanionTranscriptTypedSource": {
1522
+ "type": "object",
1523
+ "properties": {
1524
+ "kind": { "const": "typed" },
1525
+ "clientMessageId": { "$ref": "#/$defs/CompanionClientMessageId" },
1526
+ "callId": { "$ref": "#/$defs/CompanionCallId" }
1527
+ },
1528
+ "required": ["kind", "clientMessageId", "callId"],
1529
+ "additionalProperties": false
1530
+ },
1531
+ "CompanionTranscriptRow": {
1532
+ "oneOf": [
1533
+ {
1534
+ "type": "object",
1535
+ "properties": {
1536
+ "messageId": { "$ref": "#/$defs/CompanionCorrelatableId" },
1537
+ "role": { "enum": ["user", "assistant"] },
1538
+ "text": { "type": "string", "minLength": 1, "maxLength": 16000 },
1539
+ "source": { "$ref": "#/$defs/CompanionTranscriptVoiceSource" }
1540
+ },
1541
+ "required": ["messageId", "role", "text", "source"],
1542
+ "additionalProperties": false
1543
+ },
1544
+ {
1545
+ "type": "object",
1546
+ "properties": {
1547
+ "messageId": { "$ref": "#/$defs/CompanionCorrelatableId" },
1548
+ "role": { "const": "user" },
1549
+ "text": { "type": "string", "minLength": 1, "maxLength": 16000 },
1550
+ "source": { "$ref": "#/$defs/CompanionTranscriptTypedSource" }
1551
+ },
1552
+ "required": ["messageId", "role", "text", "source"],
1553
+ "additionalProperties": false
1554
+ }
1555
+ ]
1556
+ },
1557
+ "CompanionDeliveryReceipt": {
1558
+ "oneOf": [
1559
+ {
1560
+ "type": "object",
1561
+ "properties": {
1562
+ "kind": { "const": "delivery" },
1563
+ "delivery": { "const": "accepted" },
1564
+ "clientMessageId": { "$ref": "#/$defs/CompanionClientMessageId" },
1565
+ "messageId": { "$ref": "#/$defs/CompanionCorrelatableId" },
1566
+ "callId": {
1567
+ "oneOf": [
1568
+ { "$ref": "#/$defs/CompanionCallId" },
1569
+ { "type": "null" }
1570
+ ]
1571
+ }
1572
+ },
1573
+ "required": ["kind", "delivery", "clientMessageId", "messageId", "callId"],
1574
+ "additionalProperties": false
1575
+ },
1576
+ {
1577
+ "type": "object",
1578
+ "properties": {
1579
+ "kind": { "const": "delivery" },
1580
+ "delivery": { "const": "unconfirmed" },
1581
+ "clientMessageId": { "$ref": "#/$defs/CompanionClientMessageId" },
1582
+ "messageId": { "type": "null" },
1583
+ "callId": {
1584
+ "oneOf": [
1585
+ { "$ref": "#/$defs/CompanionCallId" },
1586
+ { "type": "null" }
1587
+ ]
1588
+ }
1589
+ },
1590
+ "required": ["kind", "delivery", "clientMessageId", "messageId", "callId"],
1591
+ "additionalProperties": false
1592
+ }
1593
+ ]
1594
+ },
1595
+ "CompanionDeliveryAcceptedV2": {
1596
+ "type": "object",
1597
+ "properties": {
1598
+ "kind": { "const": "delivery" },
1599
+ "v": { "const": 2 },
1600
+ "delivery": { "const": "accepted" },
1601
+ "clientMessageId": { "$ref": "#/$defs/CompanionClientMessageId" },
1602
+ "messageId": { "$ref": "#/$defs/CompanionCorrelatableId" },
1603
+ "callId": {
1604
+ "oneOf": [
1605
+ { "$ref": "#/$defs/CompanionCallId" },
1606
+ { "type": "null" }
1607
+ ]
1608
+ }
1609
+ },
1610
+ "required": ["kind", "v", "delivery", "clientMessageId", "messageId", "callId"],
1611
+ "additionalProperties": false
1612
+ },
1613
+ "CompanionDeliveryUnconfirmedV2": {
1614
+ "type": "object",
1615
+ "properties": {
1616
+ "kind": { "const": "delivery" },
1617
+ "v": { "const": 2 },
1618
+ "delivery": { "const": "unconfirmed" },
1619
+ "clientMessageId": { "$ref": "#/$defs/CompanionClientMessageId" },
1620
+ "messageId": { "type": "null" },
1621
+ "callId": {
1622
+ "oneOf": [
1623
+ { "$ref": "#/$defs/CompanionCallId" },
1624
+ { "type": "null" }
1625
+ ]
1626
+ }
1627
+ },
1628
+ "required": ["kind", "v", "delivery", "clientMessageId", "messageId", "callId"],
1629
+ "additionalProperties": false
1630
+ },
1631
+ "CompanionDeliveryRejectedV2": {
1632
+ "type": "object",
1633
+ "properties": {
1634
+ "kind": { "const": "delivery" },
1635
+ "v": { "const": 2 },
1636
+ "delivery": { "const": "rejected" },
1637
+ "clientMessageId": { "$ref": "#/$defs/CompanionClientMessageId" },
1638
+ "reason": { "enum": ["draft_changed", "unsupported_draft", "pending_limit"] },
1639
+ "draftRevision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
1640
+ },
1641
+ "required": ["kind", "v", "delivery", "clientMessageId", "reason", "draftRevision"],
1642
+ "additionalProperties": false
1643
+ },
1644
+ "CompanionDeliveryReceiptV2": {
1645
+ "oneOf": [
1646
+ { "$ref": "#/$defs/CompanionDeliveryAcceptedV2" },
1647
+ { "$ref": "#/$defs/CompanionDeliveryUnconfirmedV2" },
1648
+ { "$ref": "#/$defs/CompanionDeliveryRejectedV2" }
1649
+ ]
1650
+ },
1651
+ "CompanionConversationDraftSubmissionV1": {
1652
+ "type": "object",
1653
+ "properties": {
1654
+ "clientMessageId": { "$ref": "#/$defs/CompanionClientMessageId" },
1655
+ "text": { "type": "string", "minLength": 1, "maxLength": 8000 },
1656
+ "submissionRevision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
1657
+ "receipt": {
1658
+ "oneOf": [
1659
+ { "$ref": "#/$defs/CompanionDeliveryAcceptedV2" },
1660
+ { "$ref": "#/$defs/CompanionDeliveryUnconfirmedV2" }
1661
+ ]
1662
+ }
1663
+ },
1664
+ "required": ["clientMessageId", "text", "submissionRevision", "receipt"],
1665
+ "additionalProperties": false
1666
+ },
1667
+ "CompanionConversationDraftV1": {
1668
+ "oneOf": [
1669
+ {
1670
+ "type": "object",
1671
+ "properties": {
1672
+ "kind": { "const": "conversation-draft" },
1673
+ "v": { "const": 1 },
1674
+ "status": { "const": "available" },
1675
+ "scopeRef": { "$ref": "#/$defs/CompanionConversationScopeRef" },
1676
+ "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
1677
+ "text": { "type": "string", "maxLength": 100000 },
1678
+ "writable": { "type": "boolean" },
1679
+ "submissions": {
1680
+ "type": "array",
1681
+ "maxItems": 32,
1682
+ "items": { "$ref": "#/$defs/CompanionConversationDraftSubmissionV1" }
1683
+ }
1684
+ },
1685
+ "required": ["kind", "v", "status", "scopeRef", "revision", "text", "writable", "submissions"],
1686
+ "additionalProperties": false
1687
+ },
1688
+ {
1689
+ "type": "object",
1690
+ "properties": {
1691
+ "kind": { "const": "conversation-draft" },
1692
+ "v": { "const": 1 },
1693
+ "status": { "enum": ["conflict", "readonly"] },
1694
+ "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
1695
+ },
1696
+ "required": ["kind", "v", "status", "revision"],
1697
+ "additionalProperties": false
1698
+ }
1699
+ ]
1700
+ },
1701
+ "CompanionConversationResponsePhase": {
1702
+ "oneOf": [
1703
+ { "enum": ["processing", "completed", "failed", "canceled", "interrupted"] },
1704
+ { "type": "null" }
1705
+ ]
1706
+ },
1707
+ "CompanionConversationBodyProjection": {
1708
+ "oneOf": [
1709
+ {
1710
+ "type": "object",
1711
+ "properties": {
1712
+ "revision": { "$ref": "#/$defs/CompanionCorrelatableId" },
1713
+ "complete": { "const": true },
1714
+ "continuation": { "type": "null" }
1715
+ },
1716
+ "required": ["revision", "complete", "continuation"],
1717
+ "additionalProperties": false
1718
+ },
1719
+ {
1720
+ "type": "object",
1721
+ "properties": {
1722
+ "revision": { "$ref": "#/$defs/CompanionCorrelatableId" },
1723
+ "complete": { "const": false },
1724
+ "continuation": { "$ref": "#/$defs/CompanionOpaqueReadReference" }
1725
+ },
1726
+ "required": ["revision", "complete", "continuation"],
1727
+ "additionalProperties": false
1728
+ }
1729
+ ]
1730
+ },
1731
+ "CompanionConversationRowV2": {
1732
+ "type": "object",
1733
+ "properties": {
1734
+ "id": { "$ref": "#/$defs/CompanionCorrelatableId" },
1735
+ "role": { "enum": ["user", "assistant"] },
1736
+ "name": { "type": "string", "maxLength": 256 },
1737
+ "text": { "type": "string", "maxLength": 16000 },
1738
+ "companionIdentity": { "$ref": "#/$defs/CompanionIdentitySnapshotV1" },
1739
+ "inputMessageIds": {
1740
+ "type": "array",
1741
+ "maxItems": 32,
1742
+ "uniqueItems": true,
1743
+ "items": { "$ref": "#/$defs/CompanionCorrelatableId" }
1744
+ },
1745
+ "responsePhase": { "$ref": "#/$defs/CompanionConversationResponsePhase" },
1746
+ "body": { "$ref": "#/$defs/CompanionConversationBodyProjection" },
1747
+ "deliveryReceipt": { "$ref": "#/$defs/CompanionDeliveryAcceptedV2" }
1748
+ },
1749
+ "required": ["id", "role", "name", "text", "inputMessageIds", "responsePhase", "body"],
1750
+ "additionalProperties": false
1751
+ },
1752
+ "CompanionConversationPageV2": {
1753
+ "oneOf": [
1754
+ {
1755
+ "type": "object",
1756
+ "properties": {
1757
+ "kind": { "const": "conversation" },
1758
+ "v": { "const": 2 },
1759
+ "status": { "const": "available" },
1760
+ "threadTitle": { "type": "string", "minLength": 1, "maxLength": 256 },
1761
+ "messages": {
1762
+ "type": "array",
1763
+ "maxItems": 32,
1764
+ "items": { "$ref": "#/$defs/CompanionConversationRowV2" }
1765
+ },
1766
+ "hasMoreOlder": { "type": "boolean" },
1767
+ "olderCursor": {
1768
+ "oneOf": [
1769
+ { "$ref": "#/$defs/CompanionOpaqueReadReference" },
1770
+ { "type": "null" }
1771
+ ]
1772
+ }
1773
+ },
1774
+ "required": ["kind", "v", "status", "threadTitle", "messages", "hasMoreOlder", "olderCursor"],
1775
+ "additionalProperties": false,
1776
+ "allOf": [
1777
+ {
1778
+ "if": { "properties": { "hasMoreOlder": { "const": true } }, "required": ["hasMoreOlder"] },
1779
+ "then": { "properties": { "olderCursor": { "$ref": "#/$defs/CompanionOpaqueReadReference" } } },
1780
+ "else": { "properties": { "olderCursor": { "type": "null" } } }
1781
+ }
1782
+ ]
1783
+ },
1784
+ {
1785
+ "type": "object",
1786
+ "properties": {
1787
+ "kind": { "const": "conversation" },
1788
+ "v": { "const": 2 },
1789
+ "status": { "const": "stale" }
1790
+ },
1791
+ "required": ["kind", "v", "status"],
1792
+ "additionalProperties": false
1793
+ }
1794
+ ]
1795
+ },
1796
+ "CompanionConversationBodyV2": {
1797
+ "oneOf": [
1798
+ {
1799
+ "type": "object",
1800
+ "properties": {
1801
+ "kind": { "const": "conversation-body" },
1802
+ "v": { "const": 2 },
1803
+ "status": { "const": "available" },
1804
+ "messageId": { "$ref": "#/$defs/CompanionCorrelatableId" },
1805
+ "text": { "type": "string", "maxLength": 16000 },
1806
+ "body": { "$ref": "#/$defs/CompanionConversationBodyProjection" }
1807
+ },
1808
+ "required": ["kind", "v", "status", "messageId", "text", "body"],
1809
+ "additionalProperties": false
1810
+ },
1811
+ {
1812
+ "type": "object",
1813
+ "properties": {
1814
+ "kind": { "const": "conversation-body" },
1815
+ "v": { "const": 2 },
1816
+ "status": { "enum": ["stale", "withdrawn"] }
1817
+ },
1818
+ "required": ["kind", "v", "status"],
1819
+ "additionalProperties": false
1820
+ }
1821
+ ]
1822
+ },
1823
+ "CompanionErrorCode": {
1824
+ "enum": [
1825
+ "invalid_request",
1826
+ "permission_required",
1827
+ "unavailable",
1828
+ "session_required",
1829
+ "busy",
1830
+ "selection_changed",
1831
+ "carrier_unavailable",
1832
+ "cancelled",
1833
+ "unconfirmed"
1834
+ ]
1835
+ },
1836
+ "CompanionReply": {
1837
+ "oneOf": [
1838
+ {
1839
+ "type": "object",
1840
+ "properties": {
1841
+ "kind": {
1842
+ "const": "ok"
1843
+ }
1844
+ },
1845
+ "required": [
1846
+ "kind"
1847
+ ],
1848
+ "additionalProperties": false
1849
+ },
1850
+ {
1851
+ "$ref": "#/$defs/CompanionState"
1852
+ },
1853
+ {
1854
+ "$ref": "#/$defs/CompanionWorkOverview"
1855
+ },
1856
+ {
1857
+ "$ref": "#/$defs/CompanionDecisions"
1858
+ },
1859
+ {
1860
+ "$ref": "#/$defs/CompanionDecisionTrial"
1861
+ },
1862
+ {
1863
+ "$ref": "#/$defs/CompanionDeliveryReceipt"
1864
+ },
1865
+ {
1866
+ "$ref": "#/$defs/CompanionDeliveryReceiptV2"
1867
+ },
1868
+ {
1869
+ "$ref": "#/$defs/CompanionConversationDraftV1"
1870
+ },
1871
+ {
1872
+ "$ref": "#/$defs/CompanionSettings"
1873
+ },
1874
+ {
1875
+ "$ref": "#/$defs/CompanionSettingsUpdateReceipt"
1876
+ },
1877
+ {
1878
+ "$ref": "#/$defs/CompanionLifecycleReceipt"
1879
+ },
1880
+ {
1881
+ "$ref": "#/$defs/CompanionAppAssistSettlement"
1882
+ },
1883
+ {
1884
+ "type": "object",
1885
+ "properties": {
1886
+ "kind": {
1887
+ "const": "selection"
1888
+ },
1889
+ "selectionId": {
1890
+ "$ref": "#/$defs/CompanionSelectionId"
1891
+ }
1892
+ },
1893
+ "required": [
1894
+ "kind",
1895
+ "selectionId"
1896
+ ],
1897
+ "additionalProperties": false
1898
+ },
1899
+ {
1900
+ "$ref": "#/$defs/CompanionConversationPageV2"
1901
+ },
1902
+ {
1903
+ "$ref": "#/$defs/CompanionConversationBodyV2"
1904
+ },
1905
+ {
1906
+ "type": "object",
1907
+ "properties": {
1908
+ "kind": {
1909
+ "const": "navigation"
1910
+ },
1911
+ "delivery": {
1912
+ "description": "Host navigation truth: requested/queued mean accepted but not visibly applied; applied means the destination owner confirmed the effect; blocked means the Host refused it; unconfirmed means settlement is unknown.",
1913
+ "enum": [
1914
+ "requested",
1915
+ "applied",
1916
+ "queued",
1917
+ "blocked",
1918
+ "unconfirmed"
1919
+ ]
1920
+ }
1921
+ },
1922
+ "required": [
1923
+ "kind",
1924
+ "delivery"
1925
+ ],
1926
+ "additionalProperties": false
1927
+ },
1928
+ {
1929
+ "type": "object",
1930
+ "properties": {
1931
+ "kind": {
1932
+ "const": "error"
1933
+ },
1934
+ "code": {
1935
+ "$ref": "#/$defs/CompanionErrorCode"
1936
+ }
1937
+ },
1938
+ "required": [
1939
+ "kind",
1940
+ "code"
1941
+ ],
1942
+ "additionalProperties": false
1943
+ },
1944
+ {
1945
+ "type": "object",
1946
+ "properties": {
1947
+ "kind": {
1948
+ "const": "layout"
1949
+ },
1950
+ "pet": {
1951
+ "type": "object",
1952
+ "properties": {
1953
+ "x": {
1954
+ "type": "number"
1955
+ },
1956
+ "y": {
1957
+ "type": "number"
1958
+ }
1959
+ },
1960
+ "required": [
1961
+ "x",
1962
+ "y"
1963
+ ],
1964
+ "additionalProperties": false
1965
+ },
1966
+ "panel": {
1967
+ "type": "object",
1968
+ "properties": {
1969
+ "x": {
1970
+ "type": "number"
1971
+ },
1972
+ "y": {
1973
+ "type": "number"
1974
+ },
1975
+ "width": {
1976
+ "type": "number",
1977
+ "minimum": 0,
1978
+ "maximum": 2000
1979
+ },
1980
+ "height": {
1981
+ "type": "number",
1982
+ "minimum": 0,
1983
+ "maximum": 2000
1984
+ }
1985
+ },
1986
+ "required": [
1987
+ "x",
1988
+ "y",
1989
+ "width",
1990
+ "height"
1991
+ ],
1992
+ "additionalProperties": false
1993
+ },
1994
+ "bubble": {
1995
+ "type": "object",
1996
+ "properties": {
1997
+ "x": {
1998
+ "type": "number"
1999
+ },
2000
+ "y": {
2001
+ "type": "number"
2002
+ },
2003
+ "width": {
2004
+ "type": "number",
2005
+ "minimum": 0,
2006
+ "maximum": 2000
2007
+ },
2008
+ "height": {
2009
+ "type": "number",
2010
+ "minimum": 0,
2011
+ "maximum": 2000
2012
+ }
2013
+ },
2014
+ "required": [
2015
+ "x",
2016
+ "y",
2017
+ "width",
2018
+ "height"
2019
+ ],
2020
+ "additionalProperties": false
2021
+ },
2022
+ "width": {
2023
+ "type": "integer",
2024
+ "minimum": 1,
2025
+ "maximum": 2000
2026
+ },
2027
+ "height": {
2028
+ "type": "integer",
2029
+ "minimum": 1,
2030
+ "maximum": 2000
2031
+ }
2032
+ },
2033
+ "required": [
2034
+ "kind",
2035
+ "pet",
2036
+ "panel",
2037
+ "width",
2038
+ "height"
2039
+ ],
2040
+ "additionalProperties": false
2041
+ },
2042
+ {
2043
+ "type": "object",
2044
+ "properties": {
2045
+ "kind": {
2046
+ "const": "conversation"
2047
+ },
2048
+ "threadTitle": {
2049
+ "type": "string",
2050
+ "minLength": 1,
2051
+ "maxLength": 256
2052
+ },
2053
+ "messages": {
2054
+ "type": "array",
2055
+ "maxItems": 32,
2056
+ "items": {
2057
+ "type": "object",
2058
+ "properties": {
2059
+ "id": {
2060
+ "type": "string",
2061
+ "maxLength": 256
2062
+ },
2063
+ "role": {
2064
+ "enum": [
2065
+ "user",
2066
+ "assistant"
2067
+ ]
2068
+ },
2069
+ "text": {
2070
+ "type": "string",
2071
+ "maxLength": 16000
2072
+ },
2073
+ "name": {
2074
+ "type": "string",
2075
+ "maxLength": 256
2076
+ },
2077
+ "companionIdentity": {
2078
+ "$ref": "#/$defs/CompanionIdentitySnapshotV1"
2079
+ }
2080
+ },
2081
+ "required": [
2082
+ "id",
2083
+ "role",
2084
+ "text",
2085
+ "name"
2086
+ ],
2087
+ "additionalProperties": false
2088
+ }
2089
+ },
2090
+ "hasMore": {
2091
+ "type": "boolean"
2092
+ }
2093
+ },
2094
+ "required": [
2095
+ "kind",
2096
+ "threadTitle",
2097
+ "messages",
2098
+ "hasMore"
2099
+ ],
2100
+ "additionalProperties": false
2101
+ },
2102
+ {
2103
+ "type": "object",
2104
+ "properties": {
2105
+ "kind": { "const": "transcript" },
2106
+ "scope": { "$ref": "#/$defs/CompanionTranscriptScope" },
2107
+ "rows": {
2108
+ "type": "array",
2109
+ "maxItems": 32,
2110
+ "items": { "$ref": "#/$defs/CompanionTranscriptRow" }
2111
+ },
2112
+ "hasMore": { "type": "boolean" }
2113
+ },
2114
+ "required": ["kind", "scope", "rows", "hasMore"],
2115
+ "additionalProperties": false
2116
+ }
2117
+ ]
2118
+ },
2119
+ "CompanionEvent": {
2120
+ "oneOf": [
2121
+ {
2122
+ "type": "object",
2123
+ "properties": {
2124
+ "kind": {
2125
+ "const": "media-stopped"
2126
+ },
2127
+ "reason": {
2128
+ "enum": [
2129
+ "locked",
2130
+ "suspended",
2131
+ "hidden",
2132
+ "closed",
2133
+ "revoked"
2134
+ ]
2135
+ }
2136
+ },
2137
+ "required": [
2138
+ "kind",
2139
+ "reason"
2140
+ ],
2141
+ "additionalProperties": false
2142
+ },
2143
+ {
2144
+ "type": "object",
2145
+ "properties": {
2146
+ "kind": {
2147
+ "const": "audio"
2148
+ },
2149
+ "type": {
2150
+ "enum": [
2151
+ "connected",
2152
+ "recovering",
2153
+ "recovered",
2154
+ "error"
2155
+ ]
2156
+ },
2157
+ "callId": {
2158
+ "$ref": "#/$defs/CompanionCallId"
2159
+ }
2160
+ },
2161
+ "required": [
2162
+ "kind",
2163
+ "type",
2164
+ "callId"
2165
+ ],
2166
+ "additionalProperties": false
2167
+ },
2168
+ {
2169
+ "type": "object",
2170
+ "properties": {
2171
+ "kind": {
2172
+ "const": "audio"
2173
+ },
2174
+ "type": {
2175
+ "const": "transcript"
2176
+ },
2177
+ "role": {
2178
+ "enum": [
2179
+ "user",
2180
+ "assistant"
2181
+ ]
2182
+ },
2183
+ "text": {
2184
+ "type": "string",
2185
+ "maxLength": 16000
2186
+ },
2187
+ "callId": {
2188
+ "$ref": "#/$defs/CompanionCallId"
2189
+ },
2190
+ "turnId": {
2191
+ "type": "string",
2192
+ "minLength": 1,
2193
+ "maxLength": 256
2194
+ },
2195
+ "itemId": { "$ref": "#/$defs/CompanionCorrelatableId" }
2196
+ },
2197
+ "required": [
2198
+ "kind",
2199
+ "type",
2200
+ "callId",
2201
+ "role",
2202
+ "text"
2203
+ ],
2204
+ "additionalProperties": false
2205
+ },
2206
+ {
2207
+ "type": "object",
2208
+ "properties": {
2209
+ "kind": {
2210
+ "const": "audio"
2211
+ },
2212
+ "type": {
2213
+ "const": "turn-done"
2214
+ },
2215
+ "role": {
2216
+ "enum": [
2217
+ "user",
2218
+ "assistant"
2219
+ ]
2220
+ },
2221
+ "transcript": {
2222
+ "type": "string",
2223
+ "maxLength": 16000
2224
+ },
2225
+ "callId": {
2226
+ "$ref": "#/$defs/CompanionCallId"
2227
+ },
2228
+ "turnId": {
2229
+ "type": "string",
2230
+ "minLength": 1,
2231
+ "maxLength": 256
2232
+ }
2233
+ },
2234
+ "required": [
2235
+ "kind",
2236
+ "type",
2237
+ "callId"
2238
+ ],
2239
+ "additionalProperties": false
2240
+ },
2241
+ {
2242
+ "type": "object",
2243
+ "properties": {
2244
+ "kind": {
2245
+ "const": "view-dismiss"
2246
+ }
2247
+ },
2248
+ "required": [
2249
+ "kind"
2250
+ ],
2251
+ "additionalProperties": false
2252
+ }
2253
+ ]
2254
+ }
2255
+ }
2256
+ }