agl 43.0.5 → 43.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 (142) hide show
  1. package/changelog.md +18 -0
  2. package/dist_serve/bundle.js +5186 -4683
  3. package/dist_serve/bundle.js.map +2 -2
  4. package/dist_serve/bundle.js.third-party-notices.json +29 -29
  5. package/dist_serve/bundle.js.third-party-notices.txt +29 -29
  6. package/dist_serve/third-party-notices.md +1 -1
  7. package/dist_ts/00_commitinfo_data.js +1 -1
  8. package/dist_ts/aglapi/aglapisurface.document.js +475 -4
  9. package/dist_ts/aglapi/interfaces.d.ts +10 -0
  10. package/dist_ts/aglapi/interfaces.js +3 -1
  11. package/dist_ts/classes.claudeharness.d.ts +14 -5
  12. package/dist_ts/classes.claudeharness.js +62 -2
  13. package/dist_ts/classes.codexclientadapter.d.ts +7 -5
  14. package/dist_ts/classes.codexclientadapter.js +38 -3
  15. package/dist_ts/classes.controller.d.ts +9 -2
  16. package/dist_ts/classes.controller.js +116 -24
  17. package/dist_ts/classes.inferencegateway.d.ts +8 -5
  18. package/dist_ts/classes.inferencegateway.js +62 -19
  19. package/dist_ts/classes.inferencespend.d.ts +9 -3
  20. package/dist_ts/classes.inferencespend.js +44 -16
  21. package/dist_ts/classes.mcpclient.d.ts +6 -4
  22. package/dist_ts/classes.mcpclient.js +6 -2
  23. package/dist_ts/classes.mcpcontrollerhost.js +5 -1
  24. package/dist_ts/classes.mcptools.d.ts +1 -1
  25. package/dist_ts/classes.mcptools.js +17 -4
  26. package/dist_ts/classes.opencodeclient.js +3 -1
  27. package/dist_ts/classes.proxycontrol.d.ts +22 -11
  28. package/dist_ts/classes.proxycontrol.js +6 -3
  29. package/dist_ts/classes.proxycontrolclient.d.ts +6 -5
  30. package/dist_ts/classes.proxycontrolclient.js +8 -6
  31. package/dist_ts/classes.proxydaemon.d.ts +8 -6
  32. package/dist_ts/classes.proxydaemon.js +35 -21
  33. package/dist_ts/classes.proxyleaseholder.d.ts +12 -4
  34. package/dist_ts/classes.proxyleaseholder.js +39 -9
  35. package/dist_ts/classes.proxystore.d.ts +4 -3
  36. package/dist_ts/classes.proxystore.js +17 -7
  37. package/dist_ts/classes.sessionfeed.d.ts +1 -1
  38. package/dist_ts/classes.validation.d.ts +7 -0
  39. package/dist_ts/classes.validation.js +49 -2
  40. package/dist_ts/driver/functions.drivertools.js +2 -2
  41. package/dist_ts/fleet/classes.codexworkers.d.ts +4 -11
  42. package/dist_ts/fleet/classes.codexworkers.js +6 -3
  43. package/dist_ts/fleet/classes.workers.d.ts +25 -13
  44. package/dist_ts/fleet/classes.workers.js +105 -9
  45. package/dist_ts/fleet/functions.workervalidation.d.ts +26 -1
  46. package/dist_ts/fleet/functions.workervalidation.js +40 -11
  47. package/dist_ts/fleet/interfaces.workers.d.ts +17 -11
  48. package/dist_ts/fleet/interfaces.workers.js +10 -1
  49. package/dist_ts/functions.confinedrelay.d.ts +21 -0
  50. package/dist_ts/functions.confinedrelay.js +65 -0
  51. package/dist_ts/functions.deviceapi.d.ts +4 -2
  52. package/dist_ts/functions.deviceapi.js +20 -2
  53. package/dist_ts/functions.elicitation.d.ts +49 -0
  54. package/dist_ts/functions.elicitation.js +418 -0
  55. package/dist_ts/functions.inferencecli.d.ts +3 -3
  56. package/dist_ts/functions.inferencecli.js +33 -10
  57. package/dist_ts/functions.inferencecliarguments.d.ts +2 -1
  58. package/dist_ts/functions.inferencecliarguments.js +29 -8
  59. package/dist_ts/functions.inferencelaunch.d.ts +35 -7
  60. package/dist_ts/functions.inferencelaunch.js +143 -16
  61. package/dist_ts/functions.mcpfleetworkertools.d.ts +63 -70
  62. package/dist_ts/functions.mcpfleetworkertools.js +32 -4
  63. package/dist_ts/functions.proxycontract.d.ts +21 -4
  64. package/dist_ts/functions.proxycontract.js +12 -5
  65. package/dist_ts/functions.proxyharnessconfig.d.ts +7 -0
  66. package/dist_ts/functions.proxyharnessconfig.js +11 -1
  67. package/dist_ts/interfaces.auth.d.ts +1 -1
  68. package/dist_ts/interfaces.auth.js +2 -1
  69. package/dist_ts_interfaces/devices.d.ts +133 -3
  70. package/dist_ts_interfaces/devices.js +3 -2
  71. package/dist_ts_interfaces/elicitations.d.ts +125 -0
  72. package/dist_ts_interfaces/elicitations.js +7 -0
  73. package/dist_ts_interfaces/fleetworkers.d.ts +119 -5
  74. package/dist_ts_interfaces/fleetworkers.js +14 -2
  75. package/dist_ts_interfaces/index.d.ts +1 -0
  76. package/dist_ts_interfaces/index.js +2 -1
  77. package/dist_ts_interfaces/interfaces.d.ts +3 -1
  78. package/dist_ts_interfaces/interfaces.js +2 -2
  79. package/dist_ts_interfaces/mcprequests.d.ts +5 -1
  80. package/dist_ts_interfaces/mcprequests.js +2 -1
  81. package/dist_ts_interfaces/nativesessions.d.ts +14 -0
  82. package/dist_ts_interfaces/requests.d.ts +3 -3
  83. package/dist_ts_interfaces/requests.fleetworkers.js +2 -2
  84. package/dist_ts_interfaces/requests.js +1 -1
  85. package/dist_ts_interfaces/requests.promptreply.d.ts +18 -0
  86. package/dist_ts_interfaces/sessionfeed.d.ts +3 -2
  87. package/dist_ts_interfaces/sessionfeed.js +1 -1
  88. package/package.json +3 -3
  89. package/readme.md +191 -24
  90. package/third-party-notices.md +1 -1
  91. package/ts/00_commitinfo_data.ts +1 -1
  92. package/ts/aglapi/aglapisurface.document.ts +474 -3
  93. package/ts/aglapi/interfaces.ts +2 -0
  94. package/ts/classes.claudeharness.ts +80 -9
  95. package/ts/classes.codexclientadapter.ts +41 -5
  96. package/ts/classes.controller.ts +142 -29
  97. package/ts/classes.inferencegateway.ts +69 -23
  98. package/ts/classes.inferencespend.ts +46 -13
  99. package/ts/classes.mcpclient.ts +8 -4
  100. package/ts/classes.mcpcontrollerhost.ts +4 -0
  101. package/ts/classes.mcptools.ts +17 -3
  102. package/ts/classes.opencodeclient.ts +2 -0
  103. package/ts/classes.proxycontrol.ts +27 -13
  104. package/ts/classes.proxycontrolclient.ts +9 -6
  105. package/ts/classes.proxydaemon.ts +49 -27
  106. package/ts/classes.proxyleaseholder.ts +43 -11
  107. package/ts/classes.proxystore.ts +21 -8
  108. package/ts/classes.sessionfeed.ts +1 -1
  109. package/ts/classes.validation.ts +52 -0
  110. package/ts/driver/functions.drivertools.ts +1 -1
  111. package/ts/fleet/classes.codexworkers.ts +8 -6
  112. package/ts/fleet/classes.workers.ts +101 -17
  113. package/ts/fleet/functions.workervalidation.ts +35 -9
  114. package/ts/fleet/interfaces.workers.ts +11 -4
  115. package/ts/functions.confinedrelay.ts +65 -0
  116. package/ts/functions.deviceapi.ts +24 -1
  117. package/ts/functions.elicitation.ts +443 -0
  118. package/ts/functions.inferencecli.ts +38 -13
  119. package/ts/functions.inferencecliarguments.ts +26 -5
  120. package/ts/functions.inferencelaunch.ts +143 -16
  121. package/ts/functions.mcpfleetworkertools.ts +34 -4
  122. package/ts/functions.proxycontract.ts +17 -4
  123. package/ts/functions.proxyharnessconfig.ts +11 -0
  124. package/ts/interfaces.auth.ts +1 -0
  125. package/ts_interfaces/devices.schema.json +476 -2
  126. package/ts_interfaces/devices.ts +146 -2
  127. package/ts_interfaces/elicitations.ts +148 -0
  128. package/ts_interfaces/fleetworkers.ts +96 -4
  129. package/ts_interfaces/index.ts +1 -0
  130. package/ts_interfaces/interfaces.ts +3 -1
  131. package/ts_interfaces/mcprequests.ts +1 -0
  132. package/ts_interfaces/nativesessions.ts +16 -0
  133. package/ts_interfaces/requests.fleetworkers.ts +1 -1
  134. package/ts_interfaces/requests.promptreply.ts +22 -0
  135. package/ts_interfaces/requests.ts +4 -0
  136. package/ts_interfaces/sessionfeed.ts +3 -2
  137. package/ts_web/00_commitinfo_data.ts +1 -1
  138. package/ts_web/classes.elicitationcards.ts +106 -0
  139. package/ts_web/classes.nativesessionstate.ts +38 -1
  140. package/ts_web/elements.fleetworker.ts +27 -2
  141. package/ts_web/elements.harnesscontrollerapp.ts +68 -1
  142. package/ts_web/functions.sessionchat.ts +5 -0
@@ -65,6 +65,43 @@
65
65
  "additionalProperties": false
66
66
  }
67
67
  },
68
+ {
69
+ "name": "IReq_DeviceElicitationReply",
70
+ "method": "device.elicitation.reply",
71
+ "description": "Answers an MCP elicitation. Scope `device`. Since protocol 1.1.",
72
+ "request": {
73
+ "type": "object",
74
+ "properties": {
75
+ "sessionId": {
76
+ "type": "string"
77
+ },
78
+ "elicitationId": {
79
+ "type": "string"
80
+ },
81
+ "reply": {
82
+ "$ref": "#/components/schemas/TDeviceElicitationReply"
83
+ }
84
+ },
85
+ "required": [
86
+ "sessionId",
87
+ "elicitationId",
88
+ "reply"
89
+ ],
90
+ "additionalProperties": false
91
+ },
92
+ "response": {
93
+ "type": "object",
94
+ "properties": {
95
+ "success": {
96
+ "type": "boolean"
97
+ }
98
+ },
99
+ "required": [
100
+ "success"
101
+ ],
102
+ "additionalProperties": false
103
+ }
104
+ },
68
105
  {
69
106
  "name": "IReq_DeviceEventPush",
70
107
  "method": "device.event",
@@ -315,6 +352,13 @@
315
352
  "items": {
316
353
  "$ref": "#/components/schemas/IDeviceQuestion"
317
354
  }
355
+ },
356
+ "elicitations": {
357
+ "type": "array",
358
+ "items": {
359
+ "$ref": "#/components/schemas/TDeviceElicitation"
360
+ },
361
+ "description": "Since protocol 1.1."
318
362
  }
319
363
  },
320
364
  "required": [
@@ -322,7 +366,8 @@
322
366
  "messages",
323
367
  "before",
324
368
  "permissions",
325
- "questions"
369
+ "questions",
370
+ "elicitations"
326
371
  ],
327
372
  "additionalProperties": false
328
373
  }
@@ -396,6 +441,332 @@
396
441
  }
397
442
  ],
398
443
  "schemas": {
444
+ "IDeviceElicitationBooleanField": {
445
+ "type": "object",
446
+ "properties": {
447
+ "kind": {
448
+ "type": "string",
449
+ "const": "boolean"
450
+ },
451
+ "name": {
452
+ "type": "string"
453
+ },
454
+ "title": {
455
+ "type": "string"
456
+ },
457
+ "description": {
458
+ "type": "string"
459
+ },
460
+ "required": {
461
+ "type": "boolean"
462
+ },
463
+ "default": {
464
+ "type": "boolean"
465
+ }
466
+ },
467
+ "required": [
468
+ "kind",
469
+ "name",
470
+ "required"
471
+ ],
472
+ "additionalProperties": false,
473
+ "description": "A yes or no."
474
+ },
475
+ "IDeviceElicitationChoiceField": {
476
+ "type": "object",
477
+ "properties": {
478
+ "kind": {
479
+ "type": "string",
480
+ "const": "choice"
481
+ },
482
+ "name": {
483
+ "type": "string"
484
+ },
485
+ "title": {
486
+ "type": "string"
487
+ },
488
+ "description": {
489
+ "type": "string"
490
+ },
491
+ "required": {
492
+ "type": "boolean"
493
+ },
494
+ "options": {
495
+ "type": "array",
496
+ "items": {
497
+ "$ref": "#/components/schemas/IDeviceElicitationOption"
498
+ }
499
+ },
500
+ "default": {
501
+ "type": "string"
502
+ }
503
+ },
504
+ "required": [
505
+ "kind",
506
+ "name",
507
+ "required",
508
+ "options"
509
+ ],
510
+ "additionalProperties": false,
511
+ "description": "One choice among the options; the answer carries the option's `value`."
512
+ },
513
+ "IDeviceElicitationChoicesField": {
514
+ "type": "object",
515
+ "properties": {
516
+ "kind": {
517
+ "type": "string",
518
+ "const": "choices"
519
+ },
520
+ "name": {
521
+ "type": "string"
522
+ },
523
+ "title": {
524
+ "type": "string"
525
+ },
526
+ "description": {
527
+ "type": "string"
528
+ },
529
+ "required": {
530
+ "type": "boolean"
531
+ },
532
+ "options": {
533
+ "type": "array",
534
+ "items": {
535
+ "$ref": "#/components/schemas/IDeviceElicitationOption"
536
+ }
537
+ },
538
+ "minItems": {
539
+ "type": "integer"
540
+ },
541
+ "maxItems": {
542
+ "type": "integer"
543
+ },
544
+ "default": {
545
+ "type": "array",
546
+ "items": {
547
+ "type": "string"
548
+ }
549
+ }
550
+ },
551
+ "required": [
552
+ "kind",
553
+ "name",
554
+ "required",
555
+ "options"
556
+ ],
557
+ "additionalProperties": false,
558
+ "description": "Several of the options, each at most once; the answer carries their `value`s."
559
+ },
560
+ "IDeviceElicitationForm": {
561
+ "type": "object",
562
+ "properties": {
563
+ "mode": {
564
+ "type": "string",
565
+ "const": "form"
566
+ },
567
+ "id": {
568
+ "type": "string"
569
+ },
570
+ "serverName": {
571
+ "type": "string"
572
+ },
573
+ "message": {
574
+ "type": "string"
575
+ },
576
+ "fields": {
577
+ "type": "array",
578
+ "items": {
579
+ "$ref": "#/components/schemas/TDeviceElicitationField"
580
+ }
581
+ },
582
+ "createdAt": {
583
+ "type": "integer"
584
+ }
585
+ },
586
+ "required": [
587
+ "mode",
588
+ "id",
589
+ "serverName",
590
+ "message",
591
+ "fields",
592
+ "createdAt"
593
+ ],
594
+ "additionalProperties": false,
595
+ "description": "An MCP server of the session asks the owner to fill in `fields`; it is never answered automatically."
596
+ },
597
+ "IDeviceElicitationNumberField": {
598
+ "type": "object",
599
+ "properties": {
600
+ "kind": {
601
+ "type": "string",
602
+ "const": "number"
603
+ },
604
+ "name": {
605
+ "type": "string"
606
+ },
607
+ "title": {
608
+ "type": "string"
609
+ },
610
+ "description": {
611
+ "type": "string"
612
+ },
613
+ "required": {
614
+ "type": "boolean"
615
+ },
616
+ "integer": {
617
+ "type": "boolean"
618
+ },
619
+ "minimum": {
620
+ "type": "number"
621
+ },
622
+ "maximum": {
623
+ "type": "number"
624
+ },
625
+ "default": {
626
+ "type": "number"
627
+ }
628
+ },
629
+ "required": [
630
+ "kind",
631
+ "name",
632
+ "required",
633
+ "integer"
634
+ ],
635
+ "additionalProperties": false,
636
+ "description": "A number field; `integer` takes whole numbers only, the bounds are inclusive."
637
+ },
638
+ "IDeviceElicitationOption": {
639
+ "type": "object",
640
+ "properties": {
641
+ "value": {
642
+ "type": "string"
643
+ },
644
+ "label": {
645
+ "type": "string"
646
+ }
647
+ },
648
+ "required": [
649
+ "value",
650
+ "label"
651
+ ],
652
+ "additionalProperties": false,
653
+ "description": "One choice of an elicitation field: the value the answer carries, and its label."
654
+ },
655
+ "IDeviceElicitationTextField": {
656
+ "type": "object",
657
+ "properties": {
658
+ "kind": {
659
+ "type": "string",
660
+ "const": "text"
661
+ },
662
+ "name": {
663
+ "type": "string",
664
+ "description": "The name the answer carries the value under."
665
+ },
666
+ "title": {
667
+ "type": "string"
668
+ },
669
+ "description": {
670
+ "type": "string"
671
+ },
672
+ "required": {
673
+ "type": "boolean"
674
+ },
675
+ "format": {
676
+ "type": "string",
677
+ "enum": [
678
+ "email",
679
+ "uri",
680
+ "date",
681
+ "date-time"
682
+ ]
683
+ },
684
+ "minLength": {
685
+ "type": "integer"
686
+ },
687
+ "maxLength": {
688
+ "type": "integer"
689
+ },
690
+ "default": {
691
+ "type": "string"
692
+ }
693
+ },
694
+ "required": [
695
+ "kind",
696
+ "name",
697
+ "required"
698
+ ],
699
+ "additionalProperties": false,
700
+ "description": "A text field; a value is checked against `format` (`email`, `uri`, `date`, `date-time`) and the lengths in characters."
701
+ },
702
+ "IDeviceElicitationUnsupported": {
703
+ "type": "object",
704
+ "properties": {
705
+ "mode": {
706
+ "type": "string",
707
+ "const": "unsupported"
708
+ },
709
+ "id": {
710
+ "type": "string"
711
+ },
712
+ "serverName": {
713
+ "type": "string"
714
+ },
715
+ "message": {
716
+ "type": "string"
717
+ },
718
+ "reason": {
719
+ "type": "string"
720
+ },
721
+ "createdAt": {
722
+ "type": "integer"
723
+ }
724
+ },
725
+ "required": [
726
+ "mode",
727
+ "id",
728
+ "serverName",
729
+ "message",
730
+ "reason",
731
+ "createdAt"
732
+ ],
733
+ "additionalProperties": false,
734
+ "description": "An MCP request AGL cannot collect, with the reason: only decline or cancel answer it."
735
+ },
736
+ "IDeviceElicitationUrl": {
737
+ "type": "object",
738
+ "properties": {
739
+ "mode": {
740
+ "type": "string",
741
+ "const": "url"
742
+ },
743
+ "id": {
744
+ "type": "string"
745
+ },
746
+ "serverName": {
747
+ "type": "string"
748
+ },
749
+ "message": {
750
+ "type": "string"
751
+ },
752
+ "url": {
753
+ "type": "string"
754
+ },
755
+ "createdAt": {
756
+ "type": "integer"
757
+ }
758
+ },
759
+ "required": [
760
+ "mode",
761
+ "id",
762
+ "serverName",
763
+ "message",
764
+ "url",
765
+ "createdAt"
766
+ ],
767
+ "additionalProperties": false,
768
+ "description": "An MCP server of the session asks the owner to visit `url`, which AGL never opens or fetches: show it as plain text and accept, without content, once the owner reports the visit done."
769
+ },
399
770
  "IDeviceMessage": {
400
771
  "type": "object",
401
772
  "properties": {
@@ -799,6 +1170,109 @@
799
1170
  "additionalProperties": false,
800
1171
  "description": "A tool call, reduced to its name, title and status: no input, no output."
801
1172
  },
1173
+ "TDeviceElicitation": {
1174
+ "anyOf": [
1175
+ {
1176
+ "$ref": "#/components/schemas/IDeviceElicitationForm"
1177
+ },
1178
+ {
1179
+ "$ref": "#/components/schemas/IDeviceElicitationUrl"
1180
+ },
1181
+ {
1182
+ "$ref": "#/components/schemas/IDeviceElicitationUnsupported"
1183
+ }
1184
+ ],
1185
+ "description": "An MCP server of the session asks the owner for input: a form, a URL to visit, or a request AGL cannot collect."
1186
+ },
1187
+ "TDeviceElicitationField": {
1188
+ "anyOf": [
1189
+ {
1190
+ "$ref": "#/components/schemas/IDeviceElicitationTextField"
1191
+ },
1192
+ {
1193
+ "$ref": "#/components/schemas/IDeviceElicitationNumberField"
1194
+ },
1195
+ {
1196
+ "$ref": "#/components/schemas/IDeviceElicitationBooleanField"
1197
+ },
1198
+ {
1199
+ "$ref": "#/components/schemas/IDeviceElicitationChoiceField"
1200
+ },
1201
+ {
1202
+ "$ref": "#/components/schemas/IDeviceElicitationChoicesField"
1203
+ }
1204
+ ]
1205
+ },
1206
+ "TDeviceElicitationReply": {
1207
+ "anyOf": [
1208
+ {
1209
+ "type": "object",
1210
+ "properties": {
1211
+ "action": {
1212
+ "type": "string",
1213
+ "const": "accept"
1214
+ },
1215
+ "content": {
1216
+ "type": "object",
1217
+ "additionalProperties": {
1218
+ "$ref": "#/components/schemas/TDeviceElicitationValue"
1219
+ }
1220
+ }
1221
+ },
1222
+ "required": [
1223
+ "action"
1224
+ ],
1225
+ "additionalProperties": false
1226
+ },
1227
+ {
1228
+ "type": "object",
1229
+ "properties": {
1230
+ "action": {
1231
+ "type": "string",
1232
+ "const": "decline"
1233
+ }
1234
+ },
1235
+ "required": [
1236
+ "action"
1237
+ ],
1238
+ "additionalProperties": false
1239
+ },
1240
+ {
1241
+ "type": "object",
1242
+ "properties": {
1243
+ "action": {
1244
+ "type": "string",
1245
+ "const": "cancel"
1246
+ }
1247
+ },
1248
+ "required": [
1249
+ "action"
1250
+ ],
1251
+ "additionalProperties": false
1252
+ }
1253
+ ],
1254
+ "description": "The owner's answer to an elicitation. `accept` carries a form's values by field name (checked against the form; a mismatch is refused, nothing is sent), or none in URL mode, and is refused for an unsupported request; `decline` refuses; `cancel` dismisses without a decision."
1255
+ },
1256
+ "TDeviceElicitationValue": {
1257
+ "anyOf": [
1258
+ {
1259
+ "type": "string"
1260
+ },
1261
+ {
1262
+ "type": "number"
1263
+ },
1264
+ {
1265
+ "type": "boolean"
1266
+ },
1267
+ {
1268
+ "type": "array",
1269
+ "items": {
1270
+ "type": "string"
1271
+ }
1272
+ }
1273
+ ],
1274
+ "description": "A value of an elicitation field: text or a choice, a number, a yes or no, or several choices."
1275
+ },
802
1276
  "TDeviceEvent": {
803
1277
  "anyOf": [
804
1278
  {
@@ -873,7 +1347,7 @@
873
1347
  "completed",
874
1348
  "failed"
875
1349
  ],
876
- "description": "`needs_input`: a question or permission waits for the owner."
1350
+ "description": "`needs_input`: a question, a permission or an MCP elicitation waits for the owner."
877
1351
  },
878
1352
  "TDeviceToolStatus": {
879
1353
  "type": "string",
@@ -17,7 +17,7 @@
17
17
  import type { ITypedRequest, implementsTR } from '@api.global/typedrequest-interfaces';
18
18
 
19
19
  /** The device protocol this controller speaks. */
20
- export const deviceProtocolVersion = { major: 1, minor: 0 } as const;
20
+ export const deviceProtocolVersion = { major: 1, minor: 1 } as const;
21
21
 
22
22
  /** The scheme of a pairing payload: `agl-pair:?origin=<https origin>&controller=<controller id>&code=<base64url>`. */
23
23
  export const devicePairingScheme = 'agl-pair' as const;
@@ -74,7 +74,7 @@ export type TDeviceRefusalCode =
74
74
  /** The harness a session runs on. */
75
75
  export type TDeviceHarness = 'claude' | 'codex' | 'flex' | 'opencode';
76
76
 
77
- /** `needs_input`: a question or permission waits for the owner. */
77
+ /** `needs_input`: a question, a permission or an MCP elicitation waits for the owner. */
78
78
  export type TDeviceSessionState = 'needs_input' | 'working' | 'completed' | 'failed';
79
79
 
80
80
  /** One session of the feed as a device sees it: the browser feed row without where it opens (no host paths, no tickets). */
@@ -167,6 +167,136 @@ export interface IDeviceQuestion {
167
167
  questions: IDeviceQuestionItem[];
168
168
  }
169
169
 
170
+ /** One choice of an elicitation field: the value the answer carries, and its label. */
171
+ export interface IDeviceElicitationOption {
172
+ value: string;
173
+ label: string;
174
+ }
175
+
176
+ /** A text field; a value is checked against `format` (`email`, `uri`, `date`, `date-time`) and the lengths in characters. */
177
+ export interface IDeviceElicitationTextField {
178
+ kind: 'text';
179
+ /** The name the answer carries the value under. */
180
+ name: string;
181
+ title?: string;
182
+ description?: string;
183
+ required: boolean;
184
+ format?: 'email' | 'uri' | 'date' | 'date-time';
185
+ /** @asType integer */
186
+ minLength?: number;
187
+ /** @asType integer */
188
+ maxLength?: number;
189
+ default?: string;
190
+ }
191
+
192
+ /** A number field; `integer` takes whole numbers only, the bounds are inclusive. */
193
+ export interface IDeviceElicitationNumberField {
194
+ kind: 'number';
195
+ name: string;
196
+ title?: string;
197
+ description?: string;
198
+ required: boolean;
199
+ integer: boolean;
200
+ minimum?: number;
201
+ maximum?: number;
202
+ default?: number;
203
+ }
204
+
205
+ /** A yes or no. */
206
+ export interface IDeviceElicitationBooleanField {
207
+ kind: 'boolean';
208
+ name: string;
209
+ title?: string;
210
+ description?: string;
211
+ required: boolean;
212
+ default?: boolean;
213
+ }
214
+
215
+ /** One choice among the options; the answer carries the option's `value`. */
216
+ export interface IDeviceElicitationChoiceField {
217
+ kind: 'choice';
218
+ name: string;
219
+ title?: string;
220
+ description?: string;
221
+ required: boolean;
222
+ options: IDeviceElicitationOption[];
223
+ default?: string;
224
+ }
225
+
226
+ /** Several of the options, each at most once; the answer carries their `value`s. */
227
+ export interface IDeviceElicitationChoicesField {
228
+ kind: 'choices';
229
+ name: string;
230
+ title?: string;
231
+ description?: string;
232
+ required: boolean;
233
+ options: IDeviceElicitationOption[];
234
+ /** @asType integer */
235
+ minItems?: number;
236
+ /** @asType integer */
237
+ maxItems?: number;
238
+ default?: string[];
239
+ }
240
+
241
+ export type TDeviceElicitationField =
242
+ | IDeviceElicitationTextField
243
+ | IDeviceElicitationNumberField
244
+ | IDeviceElicitationBooleanField
245
+ | IDeviceElicitationChoiceField
246
+ | IDeviceElicitationChoicesField;
247
+
248
+ /** An MCP server of the session asks the owner to fill in `fields`; it is never answered automatically. */
249
+ export interface IDeviceElicitationForm {
250
+ mode: 'form';
251
+ id: string;
252
+ serverName: string;
253
+ message: string;
254
+ fields: TDeviceElicitationField[];
255
+ /** @asType integer */
256
+ createdAt: number;
257
+ }
258
+
259
+ /**
260
+ * An MCP server of the session asks the owner to visit `url`, which AGL never opens or fetches: show it as plain text
261
+ * and accept, without content, once the owner reports the visit done.
262
+ */
263
+ export interface IDeviceElicitationUrl {
264
+ mode: 'url';
265
+ id: string;
266
+ serverName: string;
267
+ message: string;
268
+ url: string;
269
+ /** @asType integer */
270
+ createdAt: number;
271
+ }
272
+
273
+ /** An MCP request AGL cannot collect, with the reason: only decline or cancel answer it. */
274
+ export interface IDeviceElicitationUnsupported {
275
+ mode: 'unsupported';
276
+ id: string;
277
+ serverName: string;
278
+ message: string;
279
+ reason: string;
280
+ /** @asType integer */
281
+ createdAt: number;
282
+ }
283
+
284
+ /** An MCP server of the session asks the owner for input: a form, a URL to visit, or a request AGL cannot collect. */
285
+ export type TDeviceElicitation = IDeviceElicitationForm | IDeviceElicitationUrl | IDeviceElicitationUnsupported;
286
+
287
+ /** A value of an elicitation field: text or a choice, a number, a yes or no, or several choices. */
288
+ export type TDeviceElicitationValue = string | number | boolean | string[];
289
+
290
+ /**
291
+ * The owner's answer to an elicitation. `accept` carries a form's values by field name (checked against the form; a
292
+ * mismatch is refused, nothing is sent), or none in URL mode, and is refused for an unsupported request; `decline`
293
+ * refuses; `cancel` dismisses without a decision.
294
+ */
295
+ export type TDeviceElicitationReply =
296
+ | { action: 'accept'; content?: Record<string, TDeviceElicitationValue> }
297
+ | { action: 'decline' }
298
+ | { action: 'cancel' };
299
+
170
300
  /** A live snapshot of an assistant text part while it streams: it replaces the part's text. */
171
301
  export interface IDeviceTextUpdate {
172
302
  sessionId: string;
@@ -333,6 +463,8 @@ export interface IReq_DeviceSessionRead extends implementsTR<ITypedRequest, IReq
333
463
  before: string | null;
334
464
  permissions: IDevicePermission[];
335
465
  questions: IDeviceQuestion[];
466
+ /** Since protocol 1.1. */
467
+ elicitations: TDeviceElicitation[];
336
468
  };
337
469
  }
338
470
 
@@ -374,6 +506,17 @@ export interface IReq_DeviceQuestionReply extends implementsTR<ITypedRequest, IR
374
506
  response: { success: boolean };
375
507
  }
376
508
 
509
+ /** Answers an MCP elicitation. Scope `device`. Since protocol 1.1. */
510
+ export interface IReq_DeviceElicitationReply extends implementsTR<ITypedRequest, IReq_DeviceElicitationReply> {
511
+ method: 'device.elicitation.reply';
512
+ request: {
513
+ sessionId: string;
514
+ elicitationId: string;
515
+ reply: TDeviceElicitationReply;
516
+ };
517
+ response: { success: boolean };
518
+ }
519
+
377
520
  /** An event, sent by the controller to an authenticated device connection. */
378
521
  export interface IReq_DeviceEventPush extends implementsTR<ITypedRequest, IReq_DeviceEventPush> {
379
522
  method: 'device.event';
@@ -389,4 +532,5 @@ export const deviceMethods = [
389
532
  'device.session.send',
390
533
  'device.permission.reply',
391
534
  'device.question.reply',
535
+ 'device.elicitation.reply',
392
536
  ] as const;