agl 42.0.0 → 42.1.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 (58) hide show
  1. package/changelog.md +6 -0
  2. package/dist_serve/bundle.js +2493 -2143
  3. package/dist_serve/bundle.js.map +2 -2
  4. package/dist_ts/00_commitinfo_data.js +1 -1
  5. package/dist_ts/aglapi/aglapisurface.document.js +2 -2
  6. package/dist_ts/classes.authstore.d.ts +2 -0
  7. package/dist_ts/classes.authstore.js +50 -17
  8. package/dist_ts/classes.controller.d.ts +71 -2
  9. package/dist_ts/classes.controller.js +500 -113
  10. package/dist_ts/classes.controllerdevices.d.ts +128 -0
  11. package/dist_ts/classes.controllerdevices.js +472 -0
  12. package/dist_ts/classes.sessionfeed.d.ts +10 -1
  13. package/dist_ts/classes.sessionfeed.js +12 -2
  14. package/dist_ts/classes.validation.d.ts +2 -0
  15. package/dist_ts/classes.validation.js +2 -2
  16. package/dist_ts/functions.deviceapi.d.ts +28 -0
  17. package/dist_ts/functions.deviceapi.js +246 -0
  18. package/dist_ts/functions.deviceproof.d.ts +33 -0
  19. package/dist_ts/functions.deviceproof.js +93 -0
  20. package/dist_ts/functions.remotecli.d.ts +1 -1
  21. package/dist_ts/functions.remotecli.js +12 -7
  22. package/dist_ts/interfaces.auth.d.ts +1 -1
  23. package/dist_ts/interfaces.auth.js +6 -1
  24. package/dist_ts_interfaces/devices.d.ts +331 -0
  25. package/dist_ts_interfaces/devices.js +34 -0
  26. package/dist_ts_interfaces/index.d.ts +2 -0
  27. package/dist_ts_interfaces/index.js +3 -1
  28. package/dist_ts_interfaces/interfaces.d.ts +4 -2
  29. package/dist_ts_interfaces/interfaces.js +3 -2
  30. package/dist_ts_interfaces/mcprequests.d.ts +1 -1
  31. package/dist_ts_interfaces/requests.d.ts +2 -1
  32. package/dist_ts_interfaces/requests.devices.d.ts +89 -0
  33. package/dist_ts_interfaces/requests.devices.js +2 -0
  34. package/dist_ts_interfaces/requests.js +1 -1
  35. package/package.json +1 -1
  36. package/readme.md +36 -4
  37. package/ts/00_commitinfo_data.ts +1 -1
  38. package/ts/aglapi/aglapisurface.document.ts +2 -2
  39. package/ts/classes.authstore.ts +46 -14
  40. package/ts/classes.controller.ts +697 -167
  41. package/ts/classes.controllerdevices.ts +469 -0
  42. package/ts/classes.sessionfeed.ts +13 -1
  43. package/ts/classes.validation.ts +1 -1
  44. package/ts/functions.deviceapi.ts +295 -0
  45. package/ts/functions.deviceproof.ts +118 -0
  46. package/ts/functions.remotecli.ts +11 -5
  47. package/ts/interfaces.auth.ts +5 -0
  48. package/ts_interfaces/devices.schema.json +890 -0
  49. package/ts_interfaces/devices.ts +392 -0
  50. package/ts_interfaces/index.ts +2 -0
  51. package/ts_interfaces/interfaces.ts +4 -1
  52. package/ts_interfaces/mcprequests.ts +1 -1
  53. package/ts_interfaces/requests.devices.ts +95 -0
  54. package/ts_interfaces/requests.ts +10 -0
  55. package/ts_web/00_commitinfo_data.ts +1 -1
  56. package/ts_web/classes.controllersocketclient.ts +27 -0
  57. package/ts_web/elements.devices.ts +752 -0
  58. package/ts_web/elements.harnesscontrollerapp.ts +18 -1
@@ -0,0 +1,890 @@
1
+ {
2
+ "contracts": [
3
+ {
4
+ "name": "IReq_DeviceAuthChallenge",
5
+ "method": "device.auth.challenge",
6
+ "description": "A fresh nonce bound to this connection, single use, valid 60 s; a newer one replaces it. A device that is not paired (any more) is refused with `device_unknown`. Unauthenticated (scope `devicePairing`).",
7
+ "request": {
8
+ "type": "object",
9
+ "properties": {
10
+ "deviceId": {
11
+ "type": "string"
12
+ }
13
+ },
14
+ "required": [
15
+ "deviceId"
16
+ ],
17
+ "additionalProperties": false
18
+ },
19
+ "response": {
20
+ "type": "object",
21
+ "properties": {
22
+ "nonce": {
23
+ "type": "string",
24
+ "description": "base64url (no padding) of 32 bytes."
25
+ }
26
+ },
27
+ "required": [
28
+ "nonce"
29
+ ],
30
+ "additionalProperties": false
31
+ }
32
+ },
33
+ {
34
+ "name": "IReq_DeviceAuthProve",
35
+ "method": "device.auth.prove",
36
+ "description": "Authenticates this connection as the device: `signature` is the device key's signature over the authentication message (label `agl-device-auth`, controller id, origin, nonce bytes, public key). Unauthenticated (scope `devicePairing`); a device that is not paired (any more) is refused with `device_unknown`.",
37
+ "request": {
38
+ "type": "object",
39
+ "properties": {
40
+ "deviceId": {
41
+ "type": "string"
42
+ },
43
+ "signature": {
44
+ "type": "string",
45
+ "description": "ECDSA P-256 with SHA-256, DER (X9.62), base64url."
46
+ }
47
+ },
48
+ "required": [
49
+ "deviceId",
50
+ "signature"
51
+ ],
52
+ "additionalProperties": false
53
+ },
54
+ "response": {
55
+ "type": "object",
56
+ "properties": {
57
+ "name": {
58
+ "type": "string",
59
+ "description": "The name AGL keeps for the device."
60
+ }
61
+ },
62
+ "required": [
63
+ "name"
64
+ ],
65
+ "additionalProperties": false
66
+ }
67
+ },
68
+ {
69
+ "name": "IReq_DeviceEventPush",
70
+ "method": "device.event",
71
+ "description": "An event, sent by the controller to an authenticated device connection.",
72
+ "request": {
73
+ "type": "object",
74
+ "properties": {
75
+ "event": {
76
+ "$ref": "#/components/schemas/TDeviceEvent"
77
+ }
78
+ },
79
+ "required": [
80
+ "event"
81
+ ],
82
+ "additionalProperties": false
83
+ },
84
+ "response": {
85
+ "type": "object",
86
+ "additionalProperties": false
87
+ }
88
+ },
89
+ {
90
+ "name": "IReq_DeviceHello",
91
+ "method": "device.hello",
92
+ "description": "The device protocol of this controller. A device speaks one major; minors only add. Unauthenticated (scope `devicePairing`).",
93
+ "request": {
94
+ "type": "object",
95
+ "additionalProperties": false
96
+ },
97
+ "response": {
98
+ "type": "object",
99
+ "properties": {
100
+ "major": {
101
+ "type": "integer"
102
+ },
103
+ "minor": {
104
+ "type": "integer"
105
+ }
106
+ },
107
+ "required": [
108
+ "major",
109
+ "minor"
110
+ ],
111
+ "additionalProperties": false
112
+ }
113
+ },
114
+ {
115
+ "name": "IReq_DevicePair",
116
+ "method": "device.pair",
117
+ "description": "Pairs a device with the single-use code of the QR. `proof` is the device key's signature over the pairing message (label `agl-device-pair`, controller id, origin, SHA-256 of the code bytes, public key). Refused while the controller has no public origin. Unauthenticated (scope `devicePairing`).",
118
+ "request": {
119
+ "type": "object",
120
+ "properties": {
121
+ "code": {
122
+ "type": "string",
123
+ "description": "The QR's code: base64url (no padding) of 32 bytes."
124
+ },
125
+ "name": {
126
+ "type": "string",
127
+ "description": "The device's name, at most 64 characters."
128
+ },
129
+ "model": {
130
+ "type": "string",
131
+ "description": "The hardware model, at most 64 characters."
132
+ },
133
+ "publicKey": {
134
+ "type": "string",
135
+ "description": "The P-256 public key: SubjectPublicKeyInfo DER, base64url."
136
+ },
137
+ "proof": {
138
+ "type": "string",
139
+ "description": "ECDSA P-256 with SHA-256, DER (X9.62), base64url."
140
+ }
141
+ },
142
+ "required": [
143
+ "code",
144
+ "name",
145
+ "model",
146
+ "publicKey",
147
+ "proof"
148
+ ],
149
+ "additionalProperties": false
150
+ },
151
+ "response": {
152
+ "type": "object",
153
+ "properties": {
154
+ "deviceId": {
155
+ "type": "string"
156
+ },
157
+ "name": {
158
+ "type": "string",
159
+ "description": "The name AGL keeps for the device."
160
+ }
161
+ },
162
+ "required": [
163
+ "deviceId",
164
+ "name"
165
+ ],
166
+ "additionalProperties": false
167
+ }
168
+ },
169
+ {
170
+ "name": "IReq_DevicePermissionReply",
171
+ "method": "device.permission.reply",
172
+ "description": "Answers a permission. Scope `device`.",
173
+ "request": {
174
+ "type": "object",
175
+ "properties": {
176
+ "sessionId": {
177
+ "type": "string"
178
+ },
179
+ "permissionId": {
180
+ "type": "string"
181
+ },
182
+ "reply": {
183
+ "type": "string",
184
+ "enum": [
185
+ "once",
186
+ "reject"
187
+ ]
188
+ },
189
+ "message": {
190
+ "type": "string",
191
+ "description": "Sent along with the answer where the harness takes one (OpenCode)."
192
+ }
193
+ },
194
+ "required": [
195
+ "sessionId",
196
+ "permissionId",
197
+ "reply"
198
+ ],
199
+ "additionalProperties": false
200
+ },
201
+ "response": {
202
+ "type": "object",
203
+ "properties": {
204
+ "success": {
205
+ "type": "boolean"
206
+ }
207
+ },
208
+ "required": [
209
+ "success"
210
+ ],
211
+ "additionalProperties": false
212
+ }
213
+ },
214
+ {
215
+ "name": "IReq_DeviceQuestionReply",
216
+ "method": "device.question.reply",
217
+ "description": "Answers a question: one answer list per question, in order; `null` rejects it. Scope `device`.",
218
+ "request": {
219
+ "type": "object",
220
+ "properties": {
221
+ "sessionId": {
222
+ "type": "string"
223
+ },
224
+ "questionId": {
225
+ "type": "string"
226
+ },
227
+ "answers": {
228
+ "anyOf": [
229
+ {
230
+ "type": "array",
231
+ "items": {
232
+ "type": "array",
233
+ "items": {
234
+ "type": "string"
235
+ }
236
+ }
237
+ },
238
+ {
239
+ "type": "null"
240
+ }
241
+ ]
242
+ }
243
+ },
244
+ "required": [
245
+ "sessionId",
246
+ "questionId",
247
+ "answers"
248
+ ],
249
+ "additionalProperties": false
250
+ },
251
+ "response": {
252
+ "type": "object",
253
+ "properties": {
254
+ "success": {
255
+ "type": "boolean"
256
+ }
257
+ },
258
+ "required": [
259
+ "success"
260
+ ],
261
+ "additionalProperties": false
262
+ }
263
+ },
264
+ {
265
+ "name": "IReq_DeviceSessionRead",
266
+ "method": "device.session.read",
267
+ "description": "A bounded page of one session's transcript, oldest first, and what the session waits for now (on every page). Scope `device`. A read without `before` returns the newest page, sized by the controller's own bound whatever `limit` says; a read with `before` returns the next older page of `limit` messages.",
268
+ "request": {
269
+ "type": "object",
270
+ "properties": {
271
+ "sessionId": {
272
+ "type": "string"
273
+ },
274
+ "before": {
275
+ "type": "string",
276
+ "description": "The `before` cursor of a newer page; absent for the newest page."
277
+ },
278
+ "limit": {
279
+ "type": "integer",
280
+ "description": "Messages of an older page (a read with `before`), 1 to 50 (default 20). The newest page ignores it and holds what the controller's own bound allows; the value is still validated."
281
+ }
282
+ },
283
+ "required": [
284
+ "sessionId"
285
+ ],
286
+ "additionalProperties": false
287
+ },
288
+ "response": {
289
+ "type": "object",
290
+ "properties": {
291
+ "session": {
292
+ "$ref": "#/components/schemas/IDeviceSessionRow"
293
+ },
294
+ "messages": {
295
+ "type": "array",
296
+ "items": {
297
+ "$ref": "#/components/schemas/IDeviceMessage"
298
+ }
299
+ },
300
+ "before": {
301
+ "type": [
302
+ "string",
303
+ "null"
304
+ ],
305
+ "description": "The cursor of the next older page; `null` at the first message."
306
+ },
307
+ "permissions": {
308
+ "type": "array",
309
+ "items": {
310
+ "$ref": "#/components/schemas/IDevicePermission"
311
+ }
312
+ },
313
+ "questions": {
314
+ "type": "array",
315
+ "items": {
316
+ "$ref": "#/components/schemas/IDeviceQuestion"
317
+ }
318
+ }
319
+ },
320
+ "required": [
321
+ "session",
322
+ "messages",
323
+ "before",
324
+ "permissions",
325
+ "questions"
326
+ ],
327
+ "additionalProperties": false
328
+ }
329
+ },
330
+ {
331
+ "name": "IReq_DeviceSessionSend",
332
+ "method": "device.session.send",
333
+ "description": "Sends text to a session as a direct message (never the browser's shared draft); it queues behind a running turn. A session AGL does not write to (another process runs it, a fleet worker owns it) refuses it. Scope `device`.",
334
+ "request": {
335
+ "type": "object",
336
+ "properties": {
337
+ "sessionId": {
338
+ "type": "string"
339
+ },
340
+ "text": {
341
+ "type": "string",
342
+ "description": "At most 64 KiB of UTF-8, not blank."
343
+ }
344
+ },
345
+ "required": [
346
+ "sessionId",
347
+ "text"
348
+ ],
349
+ "additionalProperties": false
350
+ },
351
+ "response": {
352
+ "type": "object",
353
+ "properties": {
354
+ "accepted": {
355
+ "type": "boolean",
356
+ "const": true
357
+ }
358
+ },
359
+ "required": [
360
+ "accepted"
361
+ ],
362
+ "additionalProperties": false
363
+ }
364
+ },
365
+ {
366
+ "name": "IReq_DeviceSessionsList",
367
+ "method": "device.sessions.list",
368
+ "description": "The session feed, newest first, without terminal rows. Scope `device`.",
369
+ "request": {
370
+ "type": "object",
371
+ "additionalProperties": false
372
+ },
373
+ "response": {
374
+ "type": "object",
375
+ "properties": {
376
+ "epoch": {
377
+ "type": "string"
378
+ },
379
+ "revision": {
380
+ "type": "integer"
381
+ },
382
+ "rows": {
383
+ "type": "array",
384
+ "items": {
385
+ "$ref": "#/components/schemas/IDeviceSessionRow"
386
+ }
387
+ }
388
+ },
389
+ "required": [
390
+ "epoch",
391
+ "revision",
392
+ "rows"
393
+ ],
394
+ "additionalProperties": false
395
+ }
396
+ }
397
+ ],
398
+ "schemas": {
399
+ "IDeviceMessage": {
400
+ "type": "object",
401
+ "properties": {
402
+ "id": {
403
+ "type": "string"
404
+ },
405
+ "role": {
406
+ "$ref": "#/components/schemas/TDeviceMessageRole"
407
+ },
408
+ "createdAt": {
409
+ "type": "integer"
410
+ },
411
+ "parts": {
412
+ "type": "array",
413
+ "items": {
414
+ "$ref": "#/components/schemas/TDeviceMessagePart"
415
+ }
416
+ }
417
+ },
418
+ "required": [
419
+ "id",
420
+ "role",
421
+ "createdAt",
422
+ "parts"
423
+ ],
424
+ "additionalProperties": false
425
+ },
426
+ "IDevicePermission": {
427
+ "type": "object",
428
+ "properties": {
429
+ "id": {
430
+ "type": "string"
431
+ },
432
+ "title": {
433
+ "type": "string"
434
+ },
435
+ "type": {
436
+ "type": "string"
437
+ },
438
+ "patterns": {
439
+ "type": "array",
440
+ "items": {
441
+ "type": "string"
442
+ }
443
+ }
444
+ },
445
+ "required": [
446
+ "id",
447
+ "title",
448
+ "type",
449
+ "patterns"
450
+ ],
451
+ "additionalProperties": false,
452
+ "description": "A permission the session waits for."
453
+ },
454
+ "IDeviceQuestion": {
455
+ "type": "object",
456
+ "properties": {
457
+ "id": {
458
+ "type": "string"
459
+ },
460
+ "questions": {
461
+ "type": "array",
462
+ "items": {
463
+ "$ref": "#/components/schemas/IDeviceQuestionItem"
464
+ }
465
+ }
466
+ },
467
+ "required": [
468
+ "id",
469
+ "questions"
470
+ ],
471
+ "additionalProperties": false,
472
+ "description": "A question the session waits for; it is never answered automatically."
473
+ },
474
+ "IDeviceQuestionItem": {
475
+ "type": "object",
476
+ "properties": {
477
+ "question": {
478
+ "type": "string"
479
+ },
480
+ "header": {
481
+ "type": "string"
482
+ },
483
+ "options": {
484
+ "type": "array",
485
+ "items": {
486
+ "$ref": "#/components/schemas/IDeviceQuestionOption"
487
+ }
488
+ },
489
+ "multiple": {
490
+ "type": "boolean"
491
+ },
492
+ "custom": {
493
+ "type": "boolean",
494
+ "description": "A free-text answer is accepted besides the options."
495
+ }
496
+ },
497
+ "required": [
498
+ "question",
499
+ "header",
500
+ "options"
501
+ ],
502
+ "additionalProperties": false
503
+ },
504
+ "IDeviceQuestionOption": {
505
+ "type": "object",
506
+ "properties": {
507
+ "label": {
508
+ "type": "string"
509
+ },
510
+ "description": {
511
+ "type": "string"
512
+ }
513
+ },
514
+ "required": [
515
+ "label",
516
+ "description"
517
+ ],
518
+ "additionalProperties": false
519
+ },
520
+ "IDeviceReasoningPart": {
521
+ "type": "object",
522
+ "properties": {
523
+ "type": {
524
+ "type": "string",
525
+ "const": "reasoning"
526
+ },
527
+ "id": {
528
+ "type": "string"
529
+ },
530
+ "text": {
531
+ "type": "string"
532
+ }
533
+ },
534
+ "required": [
535
+ "type",
536
+ "id",
537
+ "text"
538
+ ],
539
+ "additionalProperties": false
540
+ },
541
+ "IDeviceSessionChangedEvent": {
542
+ "type": "object",
543
+ "properties": {
544
+ "type": {
545
+ "type": "string",
546
+ "const": "session.changed"
547
+ },
548
+ "sessionId": {
549
+ "type": "string"
550
+ }
551
+ },
552
+ "required": [
553
+ "type",
554
+ "sessionId"
555
+ ],
556
+ "additionalProperties": false,
557
+ "description": "The session's transcript, state or pending prompts changed: read it again."
558
+ },
559
+ "IDeviceSessionFeedChangedEvent": {
560
+ "type": "object",
561
+ "properties": {
562
+ "type": {
563
+ "type": "string",
564
+ "const": "sessionfeed.changed"
565
+ },
566
+ "delta": {
567
+ "$ref": "#/components/schemas/IDeviceSessionFeedDelta"
568
+ }
569
+ },
570
+ "required": [
571
+ "type",
572
+ "delta"
573
+ ],
574
+ "additionalProperties": false
575
+ },
576
+ "IDeviceSessionFeedDelta": {
577
+ "type": "object",
578
+ "properties": {
579
+ "epoch": {
580
+ "type": "string"
581
+ },
582
+ "revision": {
583
+ "type": "integer"
584
+ },
585
+ "reset": {
586
+ "type": "boolean"
587
+ },
588
+ "upserts": {
589
+ "type": "array",
590
+ "items": {
591
+ "$ref": "#/components/schemas/IDeviceSessionRow"
592
+ }
593
+ },
594
+ "removed": {
595
+ "type": "array",
596
+ "items": {
597
+ "type": "string"
598
+ }
599
+ }
600
+ },
601
+ "required": [
602
+ "epoch",
603
+ "revision",
604
+ "reset",
605
+ "upserts",
606
+ "removed"
607
+ ],
608
+ "additionalProperties": false,
609
+ "description": "A feed change: apply it on the same epoch at the revision after the held one; on `reset` or any gap, list again."
610
+ },
611
+ "IDeviceSessionRow": {
612
+ "type": "object",
613
+ "properties": {
614
+ "id": {
615
+ "type": "string",
616
+ "description": "`${harness}:${nativeId}`, the feed's row id; the device names a session only by it."
617
+ },
618
+ "harness": {
619
+ "$ref": "#/components/schemas/TDeviceHarness"
620
+ },
621
+ "state": {
622
+ "$ref": "#/components/schemas/TDeviceSessionState"
623
+ },
624
+ "name": {
625
+ "type": "string"
626
+ },
627
+ "excerpt": {
628
+ "type": "string",
629
+ "description": "The tail of the newest assistant text."
630
+ },
631
+ "updatedAt": {
632
+ "type": "integer",
633
+ "description": "Unix milliseconds of the session's last activity."
634
+ }
635
+ },
636
+ "required": [
637
+ "id",
638
+ "harness",
639
+ "state",
640
+ "name",
641
+ "updatedAt"
642
+ ],
643
+ "additionalProperties": false,
644
+ "description": "One session of the feed as a device sees it: the browser feed row without where it opens (no host paths, no tickets)."
645
+ },
646
+ "IDeviceSessionTextDeltaEvent": {
647
+ "type": "object",
648
+ "properties": {
649
+ "type": {
650
+ "type": "string",
651
+ "const": "session.text.delta"
652
+ },
653
+ "delta": {
654
+ "$ref": "#/components/schemas/IDeviceTextDelta"
655
+ }
656
+ },
657
+ "required": [
658
+ "type",
659
+ "delta"
660
+ ],
661
+ "additionalProperties": false
662
+ },
663
+ "IDeviceSessionTextUpdatedEvent": {
664
+ "type": "object",
665
+ "properties": {
666
+ "type": {
667
+ "type": "string",
668
+ "const": "session.text.updated"
669
+ },
670
+ "update": {
671
+ "$ref": "#/components/schemas/IDeviceTextUpdate"
672
+ }
673
+ },
674
+ "required": [
675
+ "type",
676
+ "update"
677
+ ],
678
+ "additionalProperties": false
679
+ },
680
+ "IDeviceSessionsChangedEvent": {
681
+ "type": "object",
682
+ "properties": {
683
+ "type": {
684
+ "type": "string",
685
+ "const": "sessions.changed"
686
+ }
687
+ },
688
+ "required": [
689
+ "type"
690
+ ],
691
+ "additionalProperties": false,
692
+ "description": "Changes reached this device only in part: list the feed and read the open session again."
693
+ },
694
+ "IDeviceTextDelta": {
695
+ "type": "object",
696
+ "properties": {
697
+ "sessionId": {
698
+ "type": "string"
699
+ },
700
+ "messageId": {
701
+ "type": "string"
702
+ },
703
+ "partId": {
704
+ "type": "string"
705
+ },
706
+ "delta": {
707
+ "type": "string"
708
+ },
709
+ "baseTextUtf8Bytes": {
710
+ "type": "integer"
711
+ },
712
+ "textUtf8Bytes": {
713
+ "type": "integer"
714
+ }
715
+ },
716
+ "required": [
717
+ "sessionId",
718
+ "messageId",
719
+ "partId",
720
+ "delta",
721
+ "baseTextUtf8Bytes",
722
+ "textUtf8Bytes"
723
+ ],
724
+ "additionalProperties": false,
725
+ "description": "Text appended to an assistant text part while it streams. Apply it only when the part's text held now is `baseTextUtf8Bytes` long in UTF-8, which makes it `textUtf8Bytes` long; otherwise read the session again."
726
+ },
727
+ "IDeviceTextPart": {
728
+ "type": "object",
729
+ "properties": {
730
+ "type": {
731
+ "type": "string",
732
+ "const": "text"
733
+ },
734
+ "id": {
735
+ "type": "string"
736
+ },
737
+ "text": {
738
+ "type": "string"
739
+ }
740
+ },
741
+ "required": [
742
+ "type",
743
+ "id",
744
+ "text"
745
+ ],
746
+ "additionalProperties": false
747
+ },
748
+ "IDeviceTextUpdate": {
749
+ "type": "object",
750
+ "properties": {
751
+ "sessionId": {
752
+ "type": "string"
753
+ },
754
+ "messageId": {
755
+ "type": "string"
756
+ },
757
+ "partId": {
758
+ "type": "string"
759
+ },
760
+ "text": {
761
+ "type": "string"
762
+ }
763
+ },
764
+ "required": [
765
+ "sessionId",
766
+ "messageId",
767
+ "partId",
768
+ "text"
769
+ ],
770
+ "additionalProperties": false,
771
+ "description": "A live snapshot of an assistant text part while it streams: it replaces the part's text."
772
+ },
773
+ "IDeviceToolPart": {
774
+ "type": "object",
775
+ "properties": {
776
+ "type": {
777
+ "type": "string",
778
+ "const": "tool"
779
+ },
780
+ "id": {
781
+ "type": "string"
782
+ },
783
+ "tool": {
784
+ "type": "string"
785
+ },
786
+ "title": {
787
+ "type": "string"
788
+ },
789
+ "status": {
790
+ "$ref": "#/components/schemas/TDeviceToolStatus"
791
+ }
792
+ },
793
+ "required": [
794
+ "type",
795
+ "id",
796
+ "tool",
797
+ "status"
798
+ ],
799
+ "additionalProperties": false,
800
+ "description": "A tool call, reduced to its name, title and status: no input, no output."
801
+ },
802
+ "TDeviceEvent": {
803
+ "anyOf": [
804
+ {
805
+ "$ref": "#/components/schemas/IDeviceSessionFeedChangedEvent"
806
+ },
807
+ {
808
+ "$ref": "#/components/schemas/IDeviceSessionChangedEvent"
809
+ },
810
+ {
811
+ "$ref": "#/components/schemas/IDeviceSessionTextUpdatedEvent"
812
+ },
813
+ {
814
+ "$ref": "#/components/schemas/IDeviceSessionTextDeltaEvent"
815
+ },
816
+ {
817
+ "$ref": "#/components/schemas/IDeviceSessionsChangedEvent"
818
+ }
819
+ ],
820
+ "description": "The events a device receives: an allowlist, each in a reduced shape."
821
+ },
822
+ "TDeviceHarness": {
823
+ "type": "string",
824
+ "enum": [
825
+ "claude",
826
+ "codex",
827
+ "flex",
828
+ "opencode"
829
+ ],
830
+ "description": "The harness a session runs on."
831
+ },
832
+ "TDeviceMessagePart": {
833
+ "anyOf": [
834
+ {
835
+ "$ref": "#/components/schemas/IDeviceTextPart"
836
+ },
837
+ {
838
+ "$ref": "#/components/schemas/IDeviceReasoningPart"
839
+ },
840
+ {
841
+ "$ref": "#/components/schemas/IDeviceToolPart"
842
+ }
843
+ ]
844
+ },
845
+ "TDeviceMessageRole": {
846
+ "type": "string",
847
+ "enum": [
848
+ "user",
849
+ "assistant"
850
+ ]
851
+ },
852
+ "TDeviceRefusalCode": {
853
+ "type": "string",
854
+ "enum": [
855
+ "device_unknown",
856
+ "device_pairing_invalid",
857
+ "device_pairing_unavailable",
858
+ "device_limit",
859
+ "device_already_paired",
860
+ "device_proof_invalid",
861
+ "device_challenge_invalid",
862
+ "device_authentication_required",
863
+ "session_not_found",
864
+ "session_read_only"
865
+ ],
866
+ "description": "Why AGL refused a device request, as `error.data.code`: `device_unknown`: no such device is paired (any more): forget the pairing; `device_pairing_invalid`: the code is unknown, used or expired; `device_pairing_unavailable`: the controller has no public origin, so nothing can pair with it; `device_limit`: the controller holds its maximum of devices; `device_already_paired`: this key is paired already; `device_proof_invalid`: the signature does not verify; `device_challenge_invalid`: no live nonce of this connection for this device; `device_authentication_required`: the connection is not authenticated as a device; `session_not_found`: the session feed lists no such session; `session_read_only`: AGL does not write to the session (another process runs it, a fleet worker owns it); `rate_limited`, `invalid_request`, `controller_unavailable` and `operation_limit` as for any client. In this device protocol version (1.0) AGL sends no retry hint with a refusal (no `retry` beside the error, no retry timing in `error.data`), and `rate_limited` is final: a client never resends the refused request on its own; it shows the refusal, and the user may try again."
867
+ },
868
+ "TDeviceSessionState": {
869
+ "type": "string",
870
+ "enum": [
871
+ "needs_input",
872
+ "working",
873
+ "completed",
874
+ "failed"
875
+ ],
876
+ "description": "`needs_input`: a question or permission waits for the owner."
877
+ },
878
+ "TDeviceToolStatus": {
879
+ "type": "string",
880
+ "enum": [
881
+ "pending",
882
+ "running",
883
+ "completed",
884
+ "error",
885
+ "stopped"
886
+ ],
887
+ "description": "`stopped`: the turn ended before the call finished."
888
+ }
889
+ }
890
+ }