agl 43.1.0 → 43.3.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 (259) hide show
  1. package/changelog.md +32 -0
  2. package/dist_serve/bundle.js +5950 -5530
  3. package/dist_serve/bundle.js.map +2 -2
  4. package/dist_serve/bundle.js.third-party-notices.json +31 -31
  5. package/dist_serve/bundle.js.third-party-notices.txt +31 -31
  6. package/dist_ts/00_commitinfo_data.js +1 -1
  7. package/dist_ts/aglapi/aglapisurface.document.js +521 -17
  8. package/dist_ts/aglapi/interfaces.d.ts +3 -0
  9. package/dist_ts/aglapi/interfaces.js +2 -1
  10. package/dist_ts/classes.accountsactions.d.ts +3 -1
  11. package/dist_ts/classes.accountsactions.js +21 -3
  12. package/dist_ts/classes.authmodels.js +17 -4
  13. package/dist_ts/classes.authstore.js +16 -2
  14. package/dist_ts/classes.claudeharness.d.ts +16 -0
  15. package/dist_ts/classes.claudeharness.js +24 -2
  16. package/dist_ts/classes.cli.d.ts +4 -2
  17. package/dist_ts/classes.cli.js +6 -3
  18. package/dist_ts/classes.codexclientadapter.d.ts +11 -0
  19. package/dist_ts/classes.codexclientadapter.js +14 -2
  20. package/dist_ts/classes.controller.d.ts +175 -11
  21. package/dist_ts/classes.controller.js +1213 -173
  22. package/dist_ts/classes.controllerdevices.d.ts +2 -0
  23. package/dist_ts/classes.controllerdevices.js +6 -1
  24. package/dist_ts/classes.controllermanagement.d.ts +14 -4
  25. package/dist_ts/classes.controllermanagement.js +20 -2
  26. package/dist_ts/classes.gatewayclient.d.ts +115 -0
  27. package/dist_ts/classes.gatewayclient.js +336 -0
  28. package/dist_ts/classes.gatewayclientstore.d.ts +97 -0
  29. package/dist_ts/classes.gatewayclientstore.js +261 -0
  30. package/dist_ts/classes.inbox.d.ts +72 -0
  31. package/dist_ts/classes.inbox.js +231 -0
  32. package/dist_ts/classes.inferencerouter.d.ts +19 -0
  33. package/dist_ts/classes.inferencerouter.js +15 -3
  34. package/dist_ts/classes.inferenceservice.d.ts +9 -0
  35. package/dist_ts/classes.inferenceservice.js +28 -2
  36. package/dist_ts/classes.mcpclient.d.ts +4 -1
  37. package/dist_ts/classes.mcpclient.js +42 -6
  38. package/dist_ts/classes.mcpcontrollerhost.d.ts +3 -1
  39. package/dist_ts/classes.mcpcontrollerhost.js +11 -1
  40. package/dist_ts/classes.mcptools.d.ts +3 -3
  41. package/dist_ts/classes.mcptools.js +38 -8
  42. package/dist_ts/classes.mcpvalidation.d.ts +5 -0
  43. package/dist_ts/classes.mcpvalidation.js +38 -2
  44. package/dist_ts/classes.nativesessions.d.ts +17 -4
  45. package/dist_ts/classes.nativesessions.js +41 -9
  46. package/dist_ts/classes.opencodeclient.d.ts +23 -2
  47. package/dist_ts/classes.opencodeclient.js +47 -3
  48. package/dist_ts/classes.proxycontrol.d.ts +11 -0
  49. package/dist_ts/classes.proxycontrol.js +7 -1
  50. package/dist_ts/classes.proxycontrolclient.d.ts +17 -0
  51. package/dist_ts/classes.proxycontrolclient.js +35 -1
  52. package/dist_ts/classes.proxydaemon.js +8 -1
  53. package/dist_ts/classes.proxymonitor.d.ts +7 -0
  54. package/dist_ts/classes.proxymonitor.js +13 -1
  55. package/dist_ts/classes.publishedset.d.ts +38 -0
  56. package/dist_ts/classes.publishedset.js +50 -0
  57. package/dist_ts/classes.sessionfeed.d.ts +3 -3
  58. package/dist_ts/classes.sessionfeed.js +18 -26
  59. package/dist_ts/classes.systemmetricssampler.d.ts +6 -0
  60. package/dist_ts/classes.systemmetricssampler.js +15 -3
  61. package/dist_ts/classes.ticketstore.d.ts +50 -3
  62. package/dist_ts/classes.ticketstore.js +45 -8
  63. package/dist_ts/classes.trustedproxysecrets.d.ts +2 -0
  64. package/dist_ts/classes.trustedproxysecrets.js +5 -1
  65. package/dist_ts/driver/classes.directreports.d.ts +14 -4
  66. package/dist_ts/driver/classes.directreports.js +25 -6
  67. package/dist_ts/driver/classes.driverservice.d.ts +44 -3
  68. package/dist_ts/driver/classes.driverservice.js +50 -16
  69. package/dist_ts/fleet/classes.claudeworkers.d.ts +21 -5
  70. package/dist_ts/fleet/classes.claudeworkers.js +142 -46
  71. package/dist_ts/fleet/classes.codexworkers.d.ts +16 -4
  72. package/dist_ts/fleet/classes.codexworkers.js +22 -5
  73. package/dist_ts/fleet/classes.workercommand.d.ts +6 -1
  74. package/dist_ts/fleet/classes.workercommand.js +15 -4
  75. package/dist_ts/fleet/classes.workers.d.ts +5 -1
  76. package/dist_ts/fleet/classes.workers.js +8 -2
  77. package/dist_ts/fleet/functions.unbounddrivers.js +2 -2
  78. package/dist_ts/fleet/functions.workervalidation.js +2 -2
  79. package/dist_ts/fleet/interfaces.workers.d.ts +21 -3
  80. package/dist_ts/fleet/interfaces.workers.js +1 -1
  81. package/dist_ts/functions.agentmessage.d.ts +3 -0
  82. package/dist_ts/functions.agentmessage.js +4 -1
  83. package/dist_ts/functions.controllermanagementsurface.d.ts +4 -0
  84. package/dist_ts/functions.controllermanagementsurface.js +15 -1
  85. package/dist_ts/functions.deviceapi.d.ts +151 -4
  86. package/dist_ts/functions.deviceapi.js +893 -38
  87. package/dist_ts/functions.fleetworkercli.d.ts +1 -1
  88. package/dist_ts/functions.fleetworkercli.js +11 -8
  89. package/dist_ts/functions.gatewaycli.d.ts +24 -0
  90. package/dist_ts/functions.gatewaycli.js +395 -0
  91. package/dist_ts/functions.gatewayroute.d.ts +135 -0
  92. package/dist_ts/functions.gatewayroute.js +366 -0
  93. package/dist_ts/functions.inferencecli.js +32 -1
  94. package/dist_ts/functions.inferencecliarguments.d.ts +8 -2
  95. package/dist_ts/functions.inferencecliarguments.js +31 -3
  96. package/dist_ts/functions.mcpfleetworkertools.js +2 -2
  97. package/dist_ts/functions.proxycapacity.d.ts +50 -0
  98. package/dist_ts/functions.proxycapacity.js +142 -0
  99. package/dist_ts/functions.proxycapacitycli.d.ts +30 -0
  100. package/dist_ts/functions.proxycapacitycli.js +65 -0
  101. package/dist_ts/functions.remotecli.d.ts +30 -3
  102. package/dist_ts/functions.remotecli.js +44 -18
  103. package/dist_ts/functions.ticketvalidation.js +11 -2
  104. package/dist_ts/interfaces.auth.d.ts +25 -4
  105. package/dist_ts/interfaces.auth.js +15 -1
  106. package/dist_ts/plugins.d.ts +5 -1
  107. package/dist_ts/plugins.js +10 -2
  108. package/dist_ts_authswitch/authority-contract.d.ts +25 -0
  109. package/dist_ts_authswitch/authority-contract.js +1 -1
  110. package/dist_ts_authswitch/authority-overview.d.ts +8 -0
  111. package/dist_ts_authswitch/authority-overview.js +17 -6
  112. package/dist_ts_authswitch/authority-placement.d.ts +20 -16
  113. package/dist_ts_authswitch/authority-placement.js +19 -26
  114. package/dist_ts_authswitch/authority-renewal.d.ts +34 -0
  115. package/dist_ts_authswitch/authority-renewal.js +56 -0
  116. package/dist_ts_authswitch/authority-usagelimit.d.ts +29 -0
  117. package/dist_ts_authswitch/authority-usagelimit.js +66 -2
  118. package/dist_ts_authswitch/authority-usagewindows.d.ts +6 -0
  119. package/dist_ts_authswitch/authority-usagewindows.js +15 -1
  120. package/dist_ts_authswitch/classes.authoritybroker.d.ts +8 -0
  121. package/dist_ts_authswitch/classes.authoritybroker.js +35 -2
  122. package/dist_ts_authswitch/classes.authoritycli.d.ts +1 -0
  123. package/dist_ts_authswitch/classes.authoritycli.js +44 -3
  124. package/dist_ts_authswitch/classes.authorityclient.d.ts +6 -1
  125. package/dist_ts_authswitch/classes.authorityclient.js +12 -4
  126. package/dist_ts_authswitch/classes.authoritydaemon.js +8 -1
  127. package/dist_ts_authswitch/classes.authoritydatabase.js +6 -2
  128. package/dist_ts_authswitch/classes.authoritymodels.d.ts +7 -0
  129. package/dist_ts_authswitch/classes.authoritymodels.js +21 -5
  130. package/dist_ts_interfaces/devices.d.ts +1012 -5
  131. package/dist_ts_interfaces/devices.js +68 -2
  132. package/dist_ts_interfaces/fleetworkers.d.ts +5 -3
  133. package/dist_ts_interfaces/gateway.d.ts +151 -0
  134. package/dist_ts_interfaces/gateway.js +66 -0
  135. package/dist_ts_interfaces/inbox.d.ts +234 -0
  136. package/dist_ts_interfaces/inbox.js +101 -0
  137. package/dist_ts_interfaces/index.d.ts +3 -0
  138. package/dist_ts_interfaces/index.js +4 -1
  139. package/dist_ts_interfaces/interfaces.d.ts +10 -3
  140. package/dist_ts_interfaces/interfaces.js +4 -2
  141. package/dist_ts_interfaces/management.d.ts +4 -4
  142. package/dist_ts_interfaces/management.js +3 -2
  143. package/dist_ts_interfaces/mcprequests.d.ts +48 -6
  144. package/dist_ts_interfaces/mcprequests.js +12 -1
  145. package/dist_ts_interfaces/mcpworkspacerequests.d.ts +4 -1
  146. package/dist_ts_interfaces/mcpworkspacerequests.js +1 -1
  147. package/dist_ts_interfaces/nativesessions.d.ts +16 -3
  148. package/dist_ts_interfaces/plugins.d.ts +2 -1
  149. package/dist_ts_interfaces/plugins.js +4 -2
  150. package/dist_ts_interfaces/proxycapacity.d.ts +99 -0
  151. package/dist_ts_interfaces/proxycapacity.js +74 -0
  152. package/dist_ts_interfaces/requests.accounts.d.ts +21 -0
  153. package/dist_ts_interfaces/requests.accounts.js +3 -1
  154. package/dist_ts_interfaces/requests.d.ts +3 -2
  155. package/dist_ts_interfaces/requests.js +1 -1
  156. package/docs/authswitch.md +20 -1
  157. package/package.json +6 -5
  158. package/readme.md +191 -31
  159. package/ts/00_commitinfo_data.ts +1 -1
  160. package/ts/aglapi/aglapisurface.document.ts +520 -16
  161. package/ts/aglapi/interfaces.ts +1 -0
  162. package/ts/classes.accountsactions.ts +30 -3
  163. package/ts/classes.authmodels.ts +22 -3
  164. package/ts/classes.authstore.ts +15 -1
  165. package/ts/classes.claudeharness.ts +27 -1
  166. package/ts/classes.cli.ts +7 -3
  167. package/ts/classes.codexclientadapter.ts +14 -1
  168. package/ts/classes.controller.ts +1428 -249
  169. package/ts/classes.controllerdevices.ts +6 -0
  170. package/ts/classes.controllermanagement.ts +40 -7
  171. package/ts/classes.gatewayclient.ts +401 -0
  172. package/ts/classes.gatewayclientstore.ts +272 -0
  173. package/ts/classes.inbox.ts +239 -0
  174. package/ts/classes.inferencerouter.ts +27 -2
  175. package/ts/classes.inferenceservice.ts +28 -1
  176. package/ts/classes.mcpclient.ts +42 -3
  177. package/ts/classes.mcpcontrollerhost.ts +15 -0
  178. package/ts/classes.mcptools.ts +42 -9
  179. package/ts/classes.mcpvalidation.ts +32 -1
  180. package/ts/classes.nativesessions.ts +50 -12
  181. package/ts/classes.opencodeclient.ts +55 -4
  182. package/ts/classes.proxycontrol.ts +16 -0
  183. package/ts/classes.proxycontrolclient.ts +30 -0
  184. package/ts/classes.proxydaemon.ts +8 -0
  185. package/ts/classes.proxymonitor.ts +12 -0
  186. package/ts/classes.publishedset.ts +56 -0
  187. package/ts/classes.sessionfeed.ts +17 -20
  188. package/ts/classes.systemmetricssampler.ts +13 -2
  189. package/ts/classes.ticketstore.ts +73 -12
  190. package/ts/classes.trustedproxysecrets.ts +5 -0
  191. package/ts/driver/classes.directreports.ts +25 -6
  192. package/ts/driver/classes.driverservice.ts +75 -14
  193. package/ts/fleet/classes.claudeworkers.ts +112 -39
  194. package/ts/fleet/classes.codexworkers.ts +21 -6
  195. package/ts/fleet/classes.workercommand.ts +14 -4
  196. package/ts/fleet/classes.workers.ts +9 -2
  197. package/ts/fleet/functions.unbounddrivers.ts +1 -1
  198. package/ts/fleet/functions.workervalidation.ts +1 -1
  199. package/ts/fleet/interfaces.workers.ts +20 -5
  200. package/ts/functions.agentmessage.ts +3 -0
  201. package/ts/functions.controllermanagementsurface.ts +15 -0
  202. package/ts/functions.deviceapi.ts +1071 -34
  203. package/ts/functions.fleetworkercli.ts +10 -7
  204. package/ts/functions.gatewaycli.ts +436 -0
  205. package/ts/functions.gatewayroute.ts +429 -0
  206. package/ts/functions.inferencecli.ts +26 -0
  207. package/ts/functions.inferencecliarguments.ts +30 -4
  208. package/ts/functions.mcpfleetworkertools.ts +1 -1
  209. package/ts/functions.proxycapacity.ts +191 -0
  210. package/ts/functions.proxycapacitycli.ts +104 -0
  211. package/ts/functions.remotecli.ts +56 -20
  212. package/ts/functions.ticketvalidation.ts +11 -1
  213. package/ts/interfaces.auth.ts +36 -4
  214. package/ts/plugins.ts +12 -0
  215. package/ts_authswitch/authority-contract.ts +20 -0
  216. package/ts_authswitch/authority-overview.ts +28 -6
  217. package/ts_authswitch/authority-placement.ts +27 -32
  218. package/ts_authswitch/authority-renewal.ts +64 -0
  219. package/ts_authswitch/authority-usagelimit.ts +84 -1
  220. package/ts_authswitch/authority-usagewindows.ts +13 -0
  221. package/ts_authswitch/classes.authoritybroker.ts +34 -1
  222. package/ts_authswitch/classes.authoritycli.ts +49 -2
  223. package/ts_authswitch/classes.authorityclient.ts +14 -4
  224. package/ts_authswitch/classes.authoritydaemon.ts +9 -1
  225. package/ts_authswitch/classes.authoritydatabase.ts +5 -1
  226. package/ts_authswitch/classes.authoritymodels.ts +23 -3
  227. package/ts_authswitch/native-contracts.md +21 -0
  228. package/ts_authswitch/readme.md +1 -1
  229. package/ts_interfaces/devices.schema.json +3573 -603
  230. package/ts_interfaces/devices.ts +1093 -4
  231. package/ts_interfaces/fleetworkers.ts +5 -3
  232. package/ts_interfaces/gateway.ts +242 -0
  233. package/ts_interfaces/inbox.ts +287 -0
  234. package/ts_interfaces/index.ts +3 -0
  235. package/ts_interfaces/interfaces.ts +9 -2
  236. package/ts_interfaces/management.ts +6 -4
  237. package/ts_interfaces/mcprequests.ts +61 -4
  238. package/ts_interfaces/mcpworkspacerequests.ts +4 -2
  239. package/ts_interfaces/nativesessions.ts +17 -3
  240. package/ts_interfaces/plugins.ts +3 -1
  241. package/ts_interfaces/proxycapacity.ts +162 -0
  242. package/ts_interfaces/requests.accounts.ts +20 -0
  243. package/ts_interfaces/requests.ts +4 -0
  244. package/ts_web/00_commitinfo_data.ts +1 -1
  245. package/ts_web/accounts.plugins.ts +4 -2
  246. package/ts_web/classes.accountsreadmodel.ts +33 -0
  247. package/ts_web/classes.browserpresentation.ts +19 -6
  248. package/ts_web/classes.inboxfeed.ts +329 -0
  249. package/ts_web/classes.nativesessionstate.ts +9 -23
  250. package/ts_web/elements.accounts.ts +121 -113
  251. package/ts_web/elements.configurationpane.ts +24 -37
  252. package/ts_web/elements.deployments.ts +66 -2
  253. package/ts_web/elements.devices.ts +4 -17
  254. package/ts_web/elements.flexlimitstrip.ts +21 -70
  255. package/ts_web/elements.harnesscontrollerapp.ts +198 -222
  256. package/ts_web/elements.inbox.ts +808 -0
  257. package/ts_web/functions.inbox.ts +95 -0
  258. package/ts_web/functions.sessioncards.ts +40 -0
  259. package/ts_web/plugins.ts +2 -0
@@ -1,5 +1,5 @@
1
1
  /** The device protocol this controller speaks. */
2
- export const deviceProtocolVersion = { major: 1, minor: 1 };
2
+ export const deviceProtocolVersion = { major: 1, minor: 3 };
3
3
  /** The scheme of a pairing payload: `agl-pair:?origin=<https origin>&controller=<controller id>&code=<base64url>`. */
4
4
  export const devicePairingScheme = 'agl-pair';
5
5
  /** The first field of the message a device signs to pair. */
@@ -22,6 +22,58 @@ export const deviceLabelMaximumCharacters = 64;
22
22
  export const deviceMessageMaximumBytes = 64 * 1024;
23
23
  /** The close code of every live connection of a device the owner revoked. */
24
24
  export const deviceRevokedCloseCode = 4403;
25
+ /**
26
+ * The ticket store's own refusals: a device's ticket request is refused with them as the store refuses the owner's
27
+ * browser, each with the store's reason, and nothing changed. The ones a device meets: `ticket_not_found`,
28
+ * `ticket_question_not_found`; `ticket_revision_conflict`: the board changed while the change was made, so read the
29
+ * ticket again; `ticket_review_branch_required`, `ticket_landed_evidence_required`,
30
+ * `ticket_released_evidence_required`: the column needs its evidence first (a branch link; a branch or commit link; a
31
+ * release link); `ticket_closed_landed`: landed code ships with its release and is not closed; `ticket_question_answered`
32
+ * and `ticket_answer_invalid`. The others refuse workers and requests a device does not make. Since protocol 1.3;
33
+ * `ticket_not_found`, `ticket_question_not_found`, `ticket_question_answered` and `ticket_answer_invalid` since 1.2.
34
+ */
35
+ export const deviceTicketRefusalCodes = [
36
+ 'ticket_revision_conflict',
37
+ 'ticket_identity_required',
38
+ 'ticket_not_found',
39
+ 'ticket_not_assigned',
40
+ 'ticket_worker_column',
41
+ 'ticket_worker_create_backlog',
42
+ 'ticket_assignment_forbidden',
43
+ 'ticket_review_branch_required',
44
+ 'ticket_landed_evidence_required',
45
+ 'ticket_released_evidence_required',
46
+ 'ticket_closed_landed',
47
+ 'ticket_parent_required',
48
+ 'ticket_parent_invalid',
49
+ 'ticket_move_anchor_invalid',
50
+ 'ticket_label_reserved',
51
+ 'ticket_release_plan_forbidden',
52
+ 'ticket_unlink_forbidden',
53
+ 'ticket_release_link_forbidden',
54
+ 'ticket_link_not_found',
55
+ 'ticket_affects_invalid',
56
+ 'ticket_release_plan_invalid',
57
+ 'ticket_window_forbidden',
58
+ 'ticket_window_invalid',
59
+ 'ticket_deploy_plan_forbidden',
60
+ 'ticket_deploy_plan_invalid',
61
+ 'ticket_deploy_plan_link_forbidden',
62
+ 'ticket_deploy_plan_fixed',
63
+ 'ticket_window_waiting',
64
+ 'ticket_go_owner_only',
65
+ 'ticket_ask_forbidden',
66
+ 'ticket_answer_forbidden',
67
+ 'ticket_question_not_found',
68
+ 'ticket_comment_not_found',
69
+ 'ticket_question_answered',
70
+ 'ticket_answer_invalid',
71
+ ];
72
+ /**
73
+ * A page of a ticket's discussion holds at most `maximum` comments and questions together (`default` when the request
74
+ * names none) and at most `bytes` of them as JSON, but always one.
75
+ */
76
+ export const deviceTicketDiscussionPage = { default: 20, maximum: 50, bytes: 256 * 1024 };
25
77
  /** Every device method, by the scope that admits it. */
26
78
  export const devicePairingMethods = ['device.hello', 'device.pair', 'device.auth.challenge', 'device.auth.prove'];
27
79
  export const deviceMethods = [
@@ -31,5 +83,19 @@ export const deviceMethods = [
31
83
  'device.permission.reply',
32
84
  'device.question.reply',
33
85
  'device.elicitation.reply',
86
+ 'device.inbox.list',
87
+ 'device.ticket.answer',
88
+ 'device.driver.get',
89
+ 'device.driver.seen',
90
+ 'device.driver.read',
91
+ 'device.driver.send',
92
+ 'device.directreports.list',
93
+ 'device.directreport.message',
94
+ 'device.host.get',
95
+ 'device.board.list',
96
+ 'device.ticket.get',
97
+ 'device.ticket.comment',
98
+ 'device.ticket.ask',
99
+ 'device.ticket.move',
34
100
  ];
35
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGV2aWNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX2ludGVyZmFjZXMvZGV2aWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFrQkEsa0RBQWtEO0FBQ2xELE1BQU0sQ0FBQyxNQUFNLHFCQUFxQixHQUFHLEVBQUUsS0FBSyxFQUFFLENBQUMsRUFBRSxLQUFLLEVBQUUsQ0FBQyxFQUFXLENBQUM7QUFFckUsc0hBQXNIO0FBQ3RILE1BQU0sQ0FBQyxNQUFNLG1CQUFtQixHQUFHLFVBQW1CLENBQUM7QUFDdkQsNkRBQTZEO0FBQzdELE1BQU0sQ0FBQyxNQUFNLHlCQUF5QixHQUFHLGlCQUEwQixDQUFDO0FBQ3BFLGtGQUFrRjtBQUNsRixNQUFNLENBQUMsTUFBTSxnQ0FBZ0MsR0FBRyxpQkFBMEIsQ0FBQztBQUMzRSxpRUFBaUU7QUFDakUsTUFBTSxDQUFDLE1BQU0saUJBQWlCLEdBQUcsRUFBRSxDQUFDO0FBQ3BDLHFFQUFxRTtBQUNyRSxNQUFNLENBQUMsTUFBTSx1QkFBdUIsR0FBRyxDQUFDLEdBQUcsRUFBRSxHQUFHLElBQUksQ0FBQztBQUNyRCwyRkFBMkY7QUFDM0YsTUFBTSxDQUFDLE1BQU0seUJBQXlCLEdBQUcsRUFBRSxHQUFHLElBQUksQ0FBQztBQUNuRCxvREFBb0Q7QUFDcEQsTUFBTSxDQUFDLE1BQU0sNEJBQTRCLEdBQUcsQ0FBQyxDQUFDO0FBQzlDLDhEQUE4RDtBQUM5R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LHVCQUF1QjtJQUN2QixtQkFBbUI7SUFDbkIsb0JBQW9CO0NBQ1osQ0FBQyJ9
@@ -382,11 +382,13 @@ export interface IFleetWorkerJob {
382
382
  error?: string;
383
383
  }
384
384
  /**
385
- * A native wake of a settled Claude Code background job no fleet worker binds. It holds no dispatch fence, writes no
386
- * ticket comment and does not observe the woken turn; `adopt` is the command that makes the job a fleet worker.
385
+ * A message to a Claude Code background job no fleet worker binds: a native wake of a settled job (`native-wake`) or a
386
+ * message into a running job's inbox through Claude Code's own SendMessage (`native-inbox`, accepted and queued, not
387
+ * read). It holds no dispatch fence, writes no ticket comment and does not observe the turn; `adopt` is the command that
388
+ * makes the job a fleet worker.
387
389
  */
388
390
  export interface IFleetNativeMessageReceipt {
389
- delivery: 'native-wake';
391
+ delivery: 'native-wake' | 'native-inbox';
390
392
  /** The job's full session id. */
391
393
  nativeId: string;
392
394
  /** Claude Code's short job id. */
@@ -0,0 +1,151 @@
1
+ import * as plugins from './plugins.js';
2
+ import type { IConfigurationLocalCliActor } from './configuration.js';
3
+ import type { IControllerStatus } from './interfaces.js';
4
+ /**
5
+ * The controller's own gateway route (AGL-828): AGL is a gateway client of a dcrouter (`agl remote gateway enrol`)
6
+ * and keeps one route for its public hostname there, LOCAL NETWORK only. Only the CLI and `agl status --json` show
7
+ * it, over the loopback management endpoint; the browser contract does not carry it.
8
+ */
9
+ /**
10
+ * Where the gateway client stands.
11
+ * - `not_enrolled`: no enrolment; nothing is synced.
12
+ * - `finalize_pending`: `agl remote gateway enrol` stored a candidate credential the gateway has not confirmed yet.
13
+ * - `syncing`: a sync runs.
14
+ * - `synced`: the last sync wrote the route; the next one repairs drift after six hours.
15
+ * - `retrying`: the last sync failed in a way a later one can fix; it is retried with backoff.
16
+ * - `waiting`: the gateway lacks `routes.requestHeaders`, so no route is written; the controller asks again with
17
+ * backoff from 30 s to 15 min, then at every six-hour sync and every `agl remote gateway sync`, and writes the route
18
+ * as soon as the gateway announces it.
19
+ * - `failed`: the last sync failed in a way only the operator can fix (`problem`); nothing is retried on its own.
20
+ * - `stopped`: the controller does not run; `problem` and `lastSyncedAt` are what it last recorded.
21
+ */
22
+ export type TControllerGatewayState = 'not_enrolled' | 'finalize_pending' | 'syncing' | 'synced' | 'retrying' | 'waiting' | 'failed' | 'stopped';
23
+ /**
24
+ * Why a sync did not write the route. The transient ones (`unreachable`, `gateway_error`) are retried, a gateway
25
+ * without request headers is waited for (`request_headers_unsupported`); every other one is terminal and names what
26
+ * the operator does.
27
+ */
28
+ export type TControllerGatewayProblemCode =
29
+ /** The gateway did not answer: network, timeout or an HTTP error in front of its API. */
30
+ 'unreachable'
31
+ /** The gateway answered with a refusal a later sync may not meet (not initialized, DNS provider unavailable). */
32
+ | 'gateway_error'
33
+ /** The credential is unknown, revoked, or bound to a missing or disabled gateway client: enrol again. */
34
+ | 'credential_invalid'
35
+ /** An admin changed the gateway client's policy, which invalidates its credential: enrol again. */
36
+ | 'credential_stale'
37
+ /** The enrolment's candidate credential is not finalized: run `agl remote gateway enrol` again. */
38
+ | 'finalize_pending'
39
+ /** The credential lacks a capability the route needs, or the gateway does not write routes idempotently. */
40
+ | 'capability_missing'
41
+ /**
42
+ * The gateway lacks `routes.requestHeaders` (before dcrouter 34.5.0, or one downgraded): the route cannot carry the
43
+ * trusted-proxy secret, so none is written until the gateway announces it.
44
+ */
45
+ | 'request_headers_unsupported'
46
+ /** The gateway refused the route itself (validation, policy, an unknown source profile). */
47
+ | 'route_refused'
48
+ /** DNS `record-conflict`: another owner or a manual record holds the hostname. */
49
+ | 'dns_record_conflict'
50
+ /** DNS `zone-unmanaged`: the gateway manages no zone holding the hostname. */
51
+ | 'dns_zone_unmanaged'
52
+ /** DNS `target-invalid`: the gateway cannot publish an address for the route. */
53
+ | 'dns_target_invalid'
54
+ /**
55
+ * The controller's public origin is no longer the hostname it was enrolled for: enrol again. `agl remote set`
56
+ * refuses such a move while enrolled, so only a leftover meets it (an interrupted change, or a move an earlier
57
+ * release made after a rollback).
58
+ */
59
+ | 'origin_changed'
60
+ /** The controller is not behind a TLS reverse proxy (`agl remote set`), so it has no route. */
61
+ | 'not_proxied'
62
+ /** The enrolment's gateway URL is plain http off loopback, which no credential is sent over: enrol again with https. */
63
+ | 'gateway_url_insecure';
64
+ export declare const controllerGatewayProblemCodes: readonly ["unreachable", "gateway_error", "credential_invalid", "credential_stale", "finalize_pending", "capability_missing", "request_headers_unsupported", "route_refused", "dns_record_conflict", "dns_zone_unmanaged", "dns_target_invalid", "origin_changed", "not_proxied", "gateway_url_insecure"];
65
+ /**
66
+ * What follows a sync that ended with a problem: `transient` is retried with backoff, `waiting` is asked again with
67
+ * backoff and then at every six-hour sync, `terminal` waits for the operator (the next start or sync).
68
+ */
69
+ export type TControllerGatewayProblemKind = 'transient' | 'waiting' | 'terminal';
70
+ export declare const controllerGatewayProblemKind: Record<TControllerGatewayProblemCode, TControllerGatewayProblemKind>;
71
+ export interface IControllerGatewayProblem {
72
+ code: TControllerGatewayProblemCode;
73
+ /** What failed and what the operator does; never a credential. */
74
+ message: string;
75
+ }
76
+ /** What `agl remote gateway enrol` registered: the gateway, the client and the route it keeps. */
77
+ export interface IControllerGatewayEnrolment {
78
+ /** The gateway's API base URL; requests go to `<gatewayUrl>/typedrequest`. */
79
+ gatewayUrl: string;
80
+ /** The gateway client this controller is (`agl-<installation>-<port>`, type `custom`). */
81
+ gatewayClientId: string;
82
+ /** `controller-<port>`. */
83
+ appId: string;
84
+ /** The route's hostname: the public origin's when it enrolled. */
85
+ hostname: string;
86
+ /** Where the gateway forwards the route. */
87
+ target: {
88
+ host: string;
89
+ port: number;
90
+ };
91
+ /** Unix epoch milliseconds. */
92
+ enrolledAt: number;
93
+ }
94
+ /** The DNS outcome of the last sync that wrote the route. */
95
+ export interface IControllerGatewayDns {
96
+ /** The gateway's own DNS status, such as `managed-unchanged` or `manual-satisfied`. */
97
+ status: string;
98
+ /** False for `manual-satisfied`: records the gateway does not own satisfy the route. */
99
+ owned: boolean;
100
+ }
101
+ export interface IControllerGatewayStatus {
102
+ state: TControllerGatewayState;
103
+ enrolment?: IControllerGatewayEnrolment;
104
+ /** Unix epoch milliseconds of the last sync that wrote the route. */
105
+ lastSyncedAt?: number;
106
+ dns?: IControllerGatewayDns;
107
+ /**
108
+ * After the last sync that wrote the route: true when the gateway named its source profile as `LOCAL NETWORK`,
109
+ * false when the gateway names no profile (before dcrouter 34.5.0), so the binding is unverified.
110
+ */
111
+ sourceProfileVerified?: boolean;
112
+ /** Why the last sync failed; absent after one that wrote the route. */
113
+ problem?: IControllerGatewayProblem;
114
+ /** Unix epoch milliseconds of the next sync the controller runs on its own. */
115
+ nextSyncAt?: number;
116
+ /** A trusted-proxy secret rotation waits for a sync that carries the new secret to its route. */
117
+ rotationPending?: boolean;
118
+ }
119
+ /**
120
+ * Reads the gateway section of a controller's management status, or `undefined` when it is not one this release
121
+ * reads; never trusts a field it does not check.
122
+ */
123
+ export declare const readControllerGatewayStatus: (valueArg: unknown) => IControllerGatewayStatus | undefined;
124
+ /**
125
+ * The management endpoint's status: the controller's status and, from AGL-828 on, its gateway client. A controller
126
+ * of an earlier release reports no `gateway`.
127
+ */
128
+ export interface IControllerManagementStatus extends IControllerStatus {
129
+ gateway?: IControllerGatewayStatus;
130
+ }
131
+ export interface IReq_ControllerManagementStatus extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_ControllerManagementStatus> {
132
+ method: 'controller.status';
133
+ request: Record<string, never>;
134
+ response: IControllerManagementStatus;
135
+ }
136
+ /**
137
+ * Syncs the controller's gateway route now (`agl remote gateway sync`), first rotating the trusted-proxy secret when
138
+ * `rotate` is set: the route then carries the new secret, and the previous one is refused once the gateway confirms
139
+ * it. Only over the loopback management endpoint, from a process of the controller's own OS user that holds the
140
+ * request's connection (`localCli` names it); the answer is the gateway status after that sync.
141
+ */
142
+ export interface IReq_ControllerGatewaySync extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_ControllerGatewaySync> {
143
+ method: 'controller.gateway.sync';
144
+ request: {
145
+ rotate: boolean;
146
+ localCli: IConfigurationLocalCliActor;
147
+ };
148
+ response: {
149
+ gateway: IControllerGatewayStatus;
150
+ };
151
+ }
@@ -0,0 +1,66 @@
1
+ import * as plugins from './plugins.js';
2
+ export const controllerGatewayProblemCodes = [
3
+ 'unreachable', 'gateway_error', 'credential_invalid', 'credential_stale', 'finalize_pending', 'capability_missing',
4
+ 'request_headers_unsupported', 'route_refused', 'dns_record_conflict', 'dns_zone_unmanaged', 'dns_target_invalid',
5
+ 'origin_changed', 'not_proxied', 'gateway_url_insecure',
6
+ ];
7
+ export const controllerGatewayProblemKind = {
8
+ unreachable: 'transient',
9
+ gateway_error: 'transient',
10
+ request_headers_unsupported: 'waiting',
11
+ credential_invalid: 'terminal',
12
+ credential_stale: 'terminal',
13
+ finalize_pending: 'terminal',
14
+ capability_missing: 'terminal',
15
+ route_refused: 'terminal',
16
+ dns_record_conflict: 'terminal',
17
+ dns_zone_unmanaged: 'terminal',
18
+ dns_target_invalid: 'terminal',
19
+ origin_changed: 'terminal',
20
+ not_proxied: 'terminal',
21
+ gateway_url_insecure: 'terminal',
22
+ };
23
+ const gatewayStates = [
24
+ 'not_enrolled', 'finalize_pending', 'syncing', 'synced', 'retrying', 'waiting', 'failed', 'stopped',
25
+ ];
26
+ const isRecord = (valueArg) => (typeof valueArg === 'object' && valueArg !== null && !Array.isArray(valueArg));
27
+ const hasOnlyKeys = (valueArg, requiredArg, optionalArg) => (requiredArg.every((keyArg) => Object.hasOwn(valueArg, keyArg))
28
+ && Object.keys(valueArg).every((keyArg) => requiredArg.includes(keyArg) || optionalArg.includes(keyArg)));
29
+ const isText = (valueArg, maximumArg) => (typeof valueArg === 'string' && valueArg.length > 0 && valueArg.length <= maximumArg);
30
+ const isTime = (valueArg) => Number.isSafeInteger(valueArg) && valueArg >= 0;
31
+ const isEnrolment = (valueArg) => {
32
+ if (!isRecord(valueArg) || !hasOnlyKeys(valueArg, ['gatewayUrl', 'gatewayClientId', 'appId', 'hostname', 'target', 'enrolledAt'], [])) {
33
+ return false;
34
+ }
35
+ const target = valueArg.target;
36
+ return isText(valueArg.gatewayUrl, 2048) && isText(valueArg.gatewayClientId, 128) && isText(valueArg.appId, 128)
37
+ && isText(valueArg.hostname, 253) && isTime(valueArg.enrolledAt)
38
+ && isRecord(target) && hasOnlyKeys(target, ['host', 'port'], []) && isText(target.host, 253)
39
+ && Number.isSafeInteger(target.port) && target.port >= 1 && target.port <= 65_535;
40
+ };
41
+ /**
42
+ * Reads the gateway section of a controller's management status, or `undefined` when it is not one this release
43
+ * reads; never trusts a field it does not check.
44
+ */
45
+ export const readControllerGatewayStatus = (valueArg) => {
46
+ if (!isRecord(valueArg)
47
+ || !hasOnlyKeys(valueArg, ['state'], ['enrolment', 'lastSyncedAt', 'dns', 'sourceProfileVerified', 'problem', 'nextSyncAt', 'rotationPending'])
48
+ || !gatewayStates.includes(valueArg.state)
49
+ || (valueArg.enrolment !== undefined && !isEnrolment(valueArg.enrolment))
50
+ || (valueArg.lastSyncedAt !== undefined && !isTime(valueArg.lastSyncedAt))
51
+ || (valueArg.nextSyncAt !== undefined && !isTime(valueArg.nextSyncAt))
52
+ || (valueArg.rotationPending !== undefined && typeof valueArg.rotationPending !== 'boolean')
53
+ || (valueArg.sourceProfileVerified !== undefined && typeof valueArg.sourceProfileVerified !== 'boolean'))
54
+ return undefined;
55
+ const dns = valueArg.dns;
56
+ if (dns !== undefined && !(isRecord(dns) && hasOnlyKeys(dns, ['status', 'owned'], [])
57
+ && isText(dns.status, 64) && typeof dns.owned === 'boolean'))
58
+ return undefined;
59
+ const problem = valueArg.problem;
60
+ if (problem !== undefined && !(isRecord(problem) && hasOnlyKeys(problem, ['code', 'message'], [])
61
+ && controllerGatewayProblemCodes.includes(problem.code)
62
+ && isText(problem.message, 4096)))
63
+ return undefined;
64
+ return valueArg;
65
+ };
66
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZX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QUcsQ0FBQyxJQUFJLFdBQVcsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxRQUFRLEVBQUUsT0FBTyxDQUFDLEVBQUUsRUFBRSxDQUFDO1dBQ2hGLE1BQU0sQ0FBQyxHQUFHLENBQUMsTUFBTSxFQUFFLEVBQUUsQ0FBQyxJQUFJLE9BQU8sR0FBRyxDQUFDLEtBQUssS0FBSyxTQUFTLENBQUM7UUFBRSxPQUFPLFNBQVMsQ0FBQztJQUNqRixNQUFNLE9BQU8sR0FBRyxRQUFRLENBQUMsT0FBTyxDQUFDO0lBQ2pDLElBQUksT0FBTyxLQUFLLFNBQVMsSUFBSSxDQUFDLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBQyxJQUFJLFdBQVcsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxNQUFNLEVBQUUsU0FBUyxDQUFDLEVBQUUsRUFBRSxDQUFDO1dBQzVGLDZCQUE2QixDQUFDLFFBQVEsQ0FBQyxPQUFPLENBQUMsSUFBcUMsQ0FBQztXQUNyRixNQUFNLENBQUMsT0FBTyxDQUFDLE9BQU8sRUFBRSxJQUFJLENBQUMsQ0FBQztRQUFFLE9BQU8sU0FBUyxDQUFDO0lBQ3RELE9BQU8sUUFBK0MsQ0FBQztBQUN6RCxDQUFDLENBQUMifQ==
@@ -0,0 +1,234 @@
1
+ import type * as plugins from './plugins.js';
2
+ import type { IControllerNativeWait, IControllerPermission, IControllerQuestion, IControllerRuntimeId } from './interfaces.js';
3
+ import type { TControllerElicitation } from './elicitations.js';
4
+ import type { IControllerNativeSessionRef } from './nativesessions.js';
5
+ import type { TControllerSessionFeedHarness } from './sessionfeed.js';
6
+ import type { ITicketQuestion, TTicketColumn } from './tickets.js';
7
+ import type { TFleetDeployCondition } from './deployments.js';
8
+ /** Every kind of Inbox item. */
9
+ export declare const controllerInboxKinds: readonly ['permission', 'question', 'elicitation', 'native_wait', 'driver', 'deploy_go', 'window_go', 'ticket_question'];
10
+ export type TControllerInboxKind = (typeof controllerInboxKinds)[number];
11
+ /**
12
+ * The order the Inbox lists its items in: the session prompts (a permission, a question, an MCP form, and a wait the
13
+ * harness shows in its own client), then the driver's `needs input:` turn, then the owner's go's, then ticket
14
+ * questions. Within a group the oldest comes first, whatever its kind. The controller sorts; clients show the order
15
+ * it sends.
16
+ */
17
+ export declare const controllerInboxGroups: readonly (readonly TControllerInboxKind[])[];
18
+ /** The filter chips besides All, and the kinds each shows. All shows every kind. */
19
+ export declare const controllerInboxChipKinds: {
20
+ readonly sessions: readonly ["permission", "question", "elicitation", "native_wait", "driver"];
21
+ readonly board: readonly ["ticket_question"];
22
+ readonly deploys: readonly ["deploy_go", "window_go"];
23
+ };
24
+ export type TControllerInboxChip = 'all' | keyof typeof controllerInboxChipKinds;
25
+ export declare const controllerInboxChips: readonly TControllerInboxChip[];
26
+ /** The chip, besides All, that shows `kindArg`. */
27
+ export declare const controllerInboxChipOf: (kindArg: TControllerInboxKind) => Exclude<TControllerInboxChip, 'all'>;
28
+ /**
29
+ * The Inbox's bounds. An item whose JSON is over `itemBytes` keeps its place without its payload (`omitted`) and is
30
+ * answered only in its own view; a payload is never cut short. The list holds at most `items` items and `listBytes` of
31
+ * JSON; `total` counts every item, and `limited` says some were left out. A change of more than `deltaItems` items
32
+ * publishes a reset. A title is one line of at most `titleChars` characters; a go names at most `ships` tickets.
33
+ */
34
+ export declare const controllerInboxLimits: {
35
+ readonly items: 200;
36
+ readonly itemBytes: number;
37
+ readonly listBytes: number;
38
+ readonly deltaItems: 100;
39
+ readonly titleChars: 280;
40
+ readonly ships: 20;
41
+ };
42
+ /** Where an item lives. A session is named as the session feed names it (`rowId`) and as the browser opens it. */
43
+ export type TControllerInboxWhere =
44
+ /** A conversation AGL hosts. */
45
+ {
46
+ kind: 'conversation';
47
+ projectId: string;
48
+ sessionId: IControllerRuntimeId;
49
+ harness: TControllerSessionFeedHarness;
50
+ rowId: string;
51
+ name: string;
52
+ }
53
+ /** A direct child (an OpenCode subagent) of the conversation `parentSessionId`, whose row is `rowId`. */
54
+ | {
55
+ kind: 'child';
56
+ projectId: string;
57
+ parentSessionId: IControllerRuntimeId & {
58
+ harnessId: 'opencode';
59
+ };
60
+ childSessionId: IControllerRuntimeId & {
61
+ harnessId: 'opencode';
62
+ };
63
+ harness: 'opencode';
64
+ rowId: string;
65
+ name: string;
66
+ childName: string;
67
+ }
68
+ /** A native session AGL does not host, on this controller's host. */
69
+ | {
70
+ kind: 'native';
71
+ session: IControllerNativeSessionRef;
72
+ harness: 'claude' | 'codex';
73
+ rowId: string;
74
+ name: string;
75
+ /** The host the session runs on: the controller's. */
76
+ host: string;
77
+ }
78
+ /** The host's driver, which no session list shows. */
79
+ | {
80
+ kind: 'driver';
81
+ projectId: string;
82
+ sessionId: IControllerRuntimeId;
83
+ } | {
84
+ kind: 'ticket';
85
+ ticketId: string;
86
+ ticketKey: string;
87
+ ticketTitle: string;
88
+ project: string;
89
+ columnId: TTicketColumn;
90
+ };
91
+ /**
92
+ * How an item is answered, through the request its owner already takes:
93
+ * `conversation`: `controller.permission.reply`, `controller.question.reply` or `controller.elicitation.reply` with the
94
+ * conversation's `projectId` and `sessionId` (the driver's own prompts too);
95
+ * `child`: `controller.session.child.get` for the child, then `controller.session.child.permission.reply` or
96
+ * `controller.session.child.question.reply`;
97
+ * `native`: `controller.nativesession.permission.reply`, `.question.reply` or `.elicitation.reply` with the session ref;
98
+ * `ticket`: `controller.ticket.answer` with the ticket and the question;
99
+ * `none`: not here. The driver's turn is answered in the Driver view, a native wait in the harness's own client, and an
100
+ * item whose payload was left out in its own view.
101
+ */
102
+ export type TControllerInboxAnswer = 'conversation' | 'child' | 'native' | 'ticket' | 'none';
103
+ /** Why an item's payload was left out: its JSON is `bytes` long, over `controllerInboxLimits.itemBytes`. */
104
+ export interface IControllerInboxOmission {
105
+ reason: 'oversize';
106
+ bytes: number;
107
+ }
108
+ /** A deploy plan as its go shows it: what runs now, what it deploys, when, and what ships with it. */
109
+ export interface IControllerInboxDeployGo {
110
+ target: string;
111
+ targetName?: string;
112
+ environment?: string;
113
+ /** The release the target should run. */
114
+ version: string;
115
+ /** What the target runs now, as its newest observation says. */
116
+ runs?: string;
117
+ deployWhen?: TFleetDeployCondition;
118
+ /** The maintenance window the deploy would run in, the next one the owner gave for the target. */
119
+ window?: {
120
+ from: string;
121
+ to: string;
122
+ };
123
+ /** Tickets the deploy ships, at most `controllerInboxLimits.ships`; `shipsTotal` counts them all. */
124
+ ships: {
125
+ key: string;
126
+ title: string;
127
+ }[];
128
+ shipsTotal: number;
129
+ /** Who deploys it: the session the plan is assigned to; absent is the driver. */
130
+ assignee?: string;
131
+ }
132
+ /** A maintenance window the driver proposed, as its go shows it. */
133
+ export interface IControllerInboxWindowGo {
134
+ from: string;
135
+ to: string;
136
+ targets: string[];
137
+ }
138
+ interface IControllerInboxItemBase<TKind extends TControllerInboxKind, TWhere extends TControllerInboxWhere> {
139
+ /** Stable across clients and passes: the kind, where it lives and the request or question id. */
140
+ id: string;
141
+ kind: TKind;
142
+ /** Unix milliseconds since it waits. */
143
+ since: number;
144
+ /** One line: what is asked. */
145
+ title: string;
146
+ where: TWhere;
147
+ answer: TControllerInboxAnswer;
148
+ /** Set when the payload was left out; the item is then answered only in its own view (`answer: 'none'`). */
149
+ omitted?: IControllerInboxOmission;
150
+ }
151
+ type TSessionWhere = Extract<TControllerInboxWhere, {
152
+ kind: 'conversation' | 'child' | 'native' | 'driver';
153
+ }>;
154
+ export interface IControllerInboxPermissionItem extends IControllerInboxItemBase<'permission', TSessionWhere> {
155
+ permission?: IControllerPermission;
156
+ }
157
+ export interface IControllerInboxQuestionItem extends IControllerInboxItemBase<'question', TSessionWhere> {
158
+ question?: IControllerQuestion;
159
+ }
160
+ export interface IControllerInboxElicitationItem extends IControllerInboxItemBase<'elicitation', TSessionWhere> {
161
+ elicitation?: TControllerElicitation;
162
+ }
163
+ /** A wait the harness shows in its own client: AGL holds no request for it, so it is answered there (`answer: 'none'`). */
164
+ export interface IControllerInboxNativeWaitItem extends IControllerInboxItemBase<'native_wait', Extract<TControllerInboxWhere, {
165
+ kind: 'conversation' | 'native';
166
+ }>> {
167
+ nativeWait: IControllerNativeWait;
168
+ /** The host the harness's client runs on: the controller's. */
169
+ host: string;
170
+ }
171
+ /** The driver's last turn ended on a `needs input:` line; the owner answers in the Driver view (`answer: 'none'`). */
172
+ export interface IControllerInboxDriverItem extends IControllerInboxItemBase<'driver', Extract<TControllerInboxWhere, {
173
+ kind: 'driver';
174
+ }>> {
175
+ /** The `needs input:` line. */
176
+ line?: string;
177
+ /** The transcript entry the line ends. */
178
+ messageId: string;
179
+ }
180
+ type TTicketWhere = Extract<TControllerInboxWhere, {
181
+ kind: 'ticket';
182
+ }>;
183
+ /** A deploy plan's question: only the owner's answer is a go. */
184
+ export interface IControllerInboxDeployGoItem extends IControllerInboxItemBase<'deploy_go', TTicketWhere> {
185
+ question?: ITicketQuestion;
186
+ plan: IControllerInboxDeployGo;
187
+ }
188
+ /** The question of a maintenance window the driver proposed: only the owner's answer is a go. */
189
+ export interface IControllerInboxWindowGoItem extends IControllerInboxItemBase<'window_go', TTicketWhere> {
190
+ question?: ITicketQuestion;
191
+ window: IControllerInboxWindowGo;
192
+ }
193
+ export interface IControllerInboxTicketQuestionItem extends IControllerInboxItemBase<'ticket_question', TTicketWhere> {
194
+ question?: ITicketQuestion;
195
+ }
196
+ export type TControllerInboxItem = IControllerInboxPermissionItem | IControllerInboxQuestionItem | IControllerInboxElicitationItem | IControllerInboxNativeWaitItem | IControllerInboxDriverItem | IControllerInboxDeployGoItem | IControllerInboxWindowGoItem | IControllerInboxTicketQuestionItem;
197
+ /** The order of two items: by group as `controllerInboxGroups` lists them, then oldest first, then by id. */
198
+ export declare const compareControllerInboxItems: (leftArg: TControllerInboxItem, rightArg: TControllerInboxItem) => number;
199
+ /** The words an item is found by: its title, where it lives and what it names. */
200
+ export declare const controllerInboxSearchText: (itemArg: TControllerInboxItem) => string;
201
+ /** Whether an item shows under `chipArg` and the search `queryArg` (every word of it, any case). */
202
+ export declare const controllerInboxItemShown: (itemArg: TControllerInboxItem, chipArg: TControllerInboxChip, queryArg?: string) => boolean;
203
+ /** The list as the controller holds it, in its order. `total` counts every item, also those `limited` left out. */
204
+ export interface IControllerInboxSnapshot {
205
+ epoch: string;
206
+ revision: number;
207
+ items: TControllerInboxItem[];
208
+ total: number;
209
+ limited: boolean;
210
+ }
211
+ /**
212
+ * One change. `epoch` names the controller process's Inbox; a client applies a delta only on its epoch at the revision
213
+ * after the one it holds, and lists the Inbox again otherwise (and on `reset`). `order` is every listed item's id in
214
+ * the list's order.
215
+ */
216
+ export type TControllerInboxDelta = {
217
+ epoch: string;
218
+ revision: number;
219
+ } & ({
220
+ upserts: TControllerInboxItem[];
221
+ removed: string[];
222
+ order: string[];
223
+ total: number;
224
+ limited: boolean;
225
+ } | {
226
+ reset: true;
227
+ });
228
+ /** The Inbox, after reading every source that changed. */
229
+ export interface IReq_ControllerInboxList extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_ControllerInboxList> {
230
+ method: 'controller.inbox.list';
231
+ request: Record<string, never>;
232
+ response: IControllerInboxSnapshot;
233
+ }
234
+ export {};