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.
- package/changelog.md +32 -0
- package/dist_serve/bundle.js +5950 -5530
- package/dist_serve/bundle.js.map +2 -2
- package/dist_serve/bundle.js.third-party-notices.json +31 -31
- package/dist_serve/bundle.js.third-party-notices.txt +31 -31
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/aglapi/aglapisurface.document.js +521 -17
- package/dist_ts/aglapi/interfaces.d.ts +3 -0
- package/dist_ts/aglapi/interfaces.js +2 -1
- package/dist_ts/classes.accountsactions.d.ts +3 -1
- package/dist_ts/classes.accountsactions.js +21 -3
- package/dist_ts/classes.authmodels.js +17 -4
- package/dist_ts/classes.authstore.js +16 -2
- package/dist_ts/classes.claudeharness.d.ts +16 -0
- package/dist_ts/classes.claudeharness.js +24 -2
- package/dist_ts/classes.cli.d.ts +4 -2
- package/dist_ts/classes.cli.js +6 -3
- package/dist_ts/classes.codexclientadapter.d.ts +11 -0
- package/dist_ts/classes.codexclientadapter.js +14 -2
- package/dist_ts/classes.controller.d.ts +175 -11
- package/dist_ts/classes.controller.js +1213 -173
- package/dist_ts/classes.controllerdevices.d.ts +2 -0
- package/dist_ts/classes.controllerdevices.js +6 -1
- package/dist_ts/classes.controllermanagement.d.ts +14 -4
- package/dist_ts/classes.controllermanagement.js +20 -2
- package/dist_ts/classes.gatewayclient.d.ts +115 -0
- package/dist_ts/classes.gatewayclient.js +336 -0
- package/dist_ts/classes.gatewayclientstore.d.ts +97 -0
- package/dist_ts/classes.gatewayclientstore.js +261 -0
- package/dist_ts/classes.inbox.d.ts +72 -0
- package/dist_ts/classes.inbox.js +231 -0
- package/dist_ts/classes.inferencerouter.d.ts +19 -0
- package/dist_ts/classes.inferencerouter.js +15 -3
- package/dist_ts/classes.inferenceservice.d.ts +9 -0
- package/dist_ts/classes.inferenceservice.js +28 -2
- package/dist_ts/classes.mcpclient.d.ts +4 -1
- package/dist_ts/classes.mcpclient.js +42 -6
- package/dist_ts/classes.mcpcontrollerhost.d.ts +3 -1
- package/dist_ts/classes.mcpcontrollerhost.js +11 -1
- package/dist_ts/classes.mcptools.d.ts +3 -3
- package/dist_ts/classes.mcptools.js +38 -8
- package/dist_ts/classes.mcpvalidation.d.ts +5 -0
- package/dist_ts/classes.mcpvalidation.js +38 -2
- package/dist_ts/classes.nativesessions.d.ts +17 -4
- package/dist_ts/classes.nativesessions.js +41 -9
- package/dist_ts/classes.opencodeclient.d.ts +23 -2
- package/dist_ts/classes.opencodeclient.js +47 -3
- package/dist_ts/classes.proxycontrol.d.ts +11 -0
- package/dist_ts/classes.proxycontrol.js +7 -1
- package/dist_ts/classes.proxycontrolclient.d.ts +17 -0
- package/dist_ts/classes.proxycontrolclient.js +35 -1
- package/dist_ts/classes.proxydaemon.js +8 -1
- package/dist_ts/classes.proxymonitor.d.ts +7 -0
- package/dist_ts/classes.proxymonitor.js +13 -1
- package/dist_ts/classes.publishedset.d.ts +38 -0
- package/dist_ts/classes.publishedset.js +50 -0
- package/dist_ts/classes.sessionfeed.d.ts +3 -3
- package/dist_ts/classes.sessionfeed.js +18 -26
- package/dist_ts/classes.systemmetricssampler.d.ts +6 -0
- package/dist_ts/classes.systemmetricssampler.js +15 -3
- package/dist_ts/classes.ticketstore.d.ts +50 -3
- package/dist_ts/classes.ticketstore.js +45 -8
- package/dist_ts/classes.trustedproxysecrets.d.ts +2 -0
- package/dist_ts/classes.trustedproxysecrets.js +5 -1
- package/dist_ts/driver/classes.directreports.d.ts +14 -4
- package/dist_ts/driver/classes.directreports.js +25 -6
- package/dist_ts/driver/classes.driverservice.d.ts +44 -3
- package/dist_ts/driver/classes.driverservice.js +50 -16
- package/dist_ts/fleet/classes.claudeworkers.d.ts +21 -5
- package/dist_ts/fleet/classes.claudeworkers.js +142 -46
- package/dist_ts/fleet/classes.codexworkers.d.ts +16 -4
- package/dist_ts/fleet/classes.codexworkers.js +22 -5
- package/dist_ts/fleet/classes.workercommand.d.ts +6 -1
- package/dist_ts/fleet/classes.workercommand.js +15 -4
- package/dist_ts/fleet/classes.workers.d.ts +5 -1
- package/dist_ts/fleet/classes.workers.js +8 -2
- package/dist_ts/fleet/functions.unbounddrivers.js +2 -2
- package/dist_ts/fleet/functions.workervalidation.js +2 -2
- package/dist_ts/fleet/interfaces.workers.d.ts +21 -3
- package/dist_ts/fleet/interfaces.workers.js +1 -1
- package/dist_ts/functions.agentmessage.d.ts +3 -0
- package/dist_ts/functions.agentmessage.js +4 -1
- package/dist_ts/functions.controllermanagementsurface.d.ts +4 -0
- package/dist_ts/functions.controllermanagementsurface.js +15 -1
- package/dist_ts/functions.deviceapi.d.ts +151 -4
- package/dist_ts/functions.deviceapi.js +893 -38
- package/dist_ts/functions.fleetworkercli.d.ts +1 -1
- package/dist_ts/functions.fleetworkercli.js +11 -8
- package/dist_ts/functions.gatewaycli.d.ts +24 -0
- package/dist_ts/functions.gatewaycli.js +395 -0
- package/dist_ts/functions.gatewayroute.d.ts +135 -0
- package/dist_ts/functions.gatewayroute.js +366 -0
- package/dist_ts/functions.inferencecli.js +32 -1
- package/dist_ts/functions.inferencecliarguments.d.ts +8 -2
- package/dist_ts/functions.inferencecliarguments.js +31 -3
- package/dist_ts/functions.mcpfleetworkertools.js +2 -2
- package/dist_ts/functions.proxycapacity.d.ts +50 -0
- package/dist_ts/functions.proxycapacity.js +142 -0
- package/dist_ts/functions.proxycapacitycli.d.ts +30 -0
- package/dist_ts/functions.proxycapacitycli.js +65 -0
- package/dist_ts/functions.remotecli.d.ts +30 -3
- package/dist_ts/functions.remotecli.js +44 -18
- package/dist_ts/functions.ticketvalidation.js +11 -2
- package/dist_ts/interfaces.auth.d.ts +25 -4
- package/dist_ts/interfaces.auth.js +15 -1
- package/dist_ts/plugins.d.ts +5 -1
- package/dist_ts/plugins.js +10 -2
- package/dist_ts_authswitch/authority-contract.d.ts +25 -0
- package/dist_ts_authswitch/authority-contract.js +1 -1
- package/dist_ts_authswitch/authority-overview.d.ts +8 -0
- package/dist_ts_authswitch/authority-overview.js +17 -6
- package/dist_ts_authswitch/authority-placement.d.ts +20 -16
- package/dist_ts_authswitch/authority-placement.js +19 -26
- package/dist_ts_authswitch/authority-renewal.d.ts +34 -0
- package/dist_ts_authswitch/authority-renewal.js +56 -0
- package/dist_ts_authswitch/authority-usagelimit.d.ts +29 -0
- package/dist_ts_authswitch/authority-usagelimit.js +66 -2
- package/dist_ts_authswitch/authority-usagewindows.d.ts +6 -0
- package/dist_ts_authswitch/authority-usagewindows.js +15 -1
- package/dist_ts_authswitch/classes.authoritybroker.d.ts +8 -0
- package/dist_ts_authswitch/classes.authoritybroker.js +35 -2
- package/dist_ts_authswitch/classes.authoritycli.d.ts +1 -0
- package/dist_ts_authswitch/classes.authoritycli.js +44 -3
- package/dist_ts_authswitch/classes.authorityclient.d.ts +6 -1
- package/dist_ts_authswitch/classes.authorityclient.js +12 -4
- package/dist_ts_authswitch/classes.authoritydaemon.js +8 -1
- package/dist_ts_authswitch/classes.authoritydatabase.js +6 -2
- package/dist_ts_authswitch/classes.authoritymodels.d.ts +7 -0
- package/dist_ts_authswitch/classes.authoritymodels.js +21 -5
- package/dist_ts_interfaces/devices.d.ts +1012 -5
- package/dist_ts_interfaces/devices.js +68 -2
- package/dist_ts_interfaces/fleetworkers.d.ts +5 -3
- package/dist_ts_interfaces/gateway.d.ts +151 -0
- package/dist_ts_interfaces/gateway.js +66 -0
- package/dist_ts_interfaces/inbox.d.ts +234 -0
- package/dist_ts_interfaces/inbox.js +101 -0
- package/dist_ts_interfaces/index.d.ts +3 -0
- package/dist_ts_interfaces/index.js +4 -1
- package/dist_ts_interfaces/interfaces.d.ts +10 -3
- package/dist_ts_interfaces/interfaces.js +4 -2
- package/dist_ts_interfaces/management.d.ts +4 -4
- package/dist_ts_interfaces/management.js +3 -2
- package/dist_ts_interfaces/mcprequests.d.ts +48 -6
- package/dist_ts_interfaces/mcprequests.js +12 -1
- package/dist_ts_interfaces/mcpworkspacerequests.d.ts +4 -1
- package/dist_ts_interfaces/mcpworkspacerequests.js +1 -1
- package/dist_ts_interfaces/nativesessions.d.ts +16 -3
- package/dist_ts_interfaces/plugins.d.ts +2 -1
- package/dist_ts_interfaces/plugins.js +4 -2
- package/dist_ts_interfaces/proxycapacity.d.ts +99 -0
- package/dist_ts_interfaces/proxycapacity.js +74 -0
- package/dist_ts_interfaces/requests.accounts.d.ts +21 -0
- package/dist_ts_interfaces/requests.accounts.js +3 -1
- package/dist_ts_interfaces/requests.d.ts +3 -2
- package/dist_ts_interfaces/requests.js +1 -1
- package/docs/authswitch.md +20 -1
- package/package.json +6 -5
- package/readme.md +191 -31
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/aglapi/aglapisurface.document.ts +520 -16
- package/ts/aglapi/interfaces.ts +1 -0
- package/ts/classes.accountsactions.ts +30 -3
- package/ts/classes.authmodels.ts +22 -3
- package/ts/classes.authstore.ts +15 -1
- package/ts/classes.claudeharness.ts +27 -1
- package/ts/classes.cli.ts +7 -3
- package/ts/classes.codexclientadapter.ts +14 -1
- package/ts/classes.controller.ts +1428 -249
- package/ts/classes.controllerdevices.ts +6 -0
- package/ts/classes.controllermanagement.ts +40 -7
- package/ts/classes.gatewayclient.ts +401 -0
- package/ts/classes.gatewayclientstore.ts +272 -0
- package/ts/classes.inbox.ts +239 -0
- package/ts/classes.inferencerouter.ts +27 -2
- package/ts/classes.inferenceservice.ts +28 -1
- package/ts/classes.mcpclient.ts +42 -3
- package/ts/classes.mcpcontrollerhost.ts +15 -0
- package/ts/classes.mcptools.ts +42 -9
- package/ts/classes.mcpvalidation.ts +32 -1
- package/ts/classes.nativesessions.ts +50 -12
- package/ts/classes.opencodeclient.ts +55 -4
- package/ts/classes.proxycontrol.ts +16 -0
- package/ts/classes.proxycontrolclient.ts +30 -0
- package/ts/classes.proxydaemon.ts +8 -0
- package/ts/classes.proxymonitor.ts +12 -0
- package/ts/classes.publishedset.ts +56 -0
- package/ts/classes.sessionfeed.ts +17 -20
- package/ts/classes.systemmetricssampler.ts +13 -2
- package/ts/classes.ticketstore.ts +73 -12
- package/ts/classes.trustedproxysecrets.ts +5 -0
- package/ts/driver/classes.directreports.ts +25 -6
- package/ts/driver/classes.driverservice.ts +75 -14
- package/ts/fleet/classes.claudeworkers.ts +112 -39
- package/ts/fleet/classes.codexworkers.ts +21 -6
- package/ts/fleet/classes.workercommand.ts +14 -4
- package/ts/fleet/classes.workers.ts +9 -2
- package/ts/fleet/functions.unbounddrivers.ts +1 -1
- package/ts/fleet/functions.workervalidation.ts +1 -1
- package/ts/fleet/interfaces.workers.ts +20 -5
- package/ts/functions.agentmessage.ts +3 -0
- package/ts/functions.controllermanagementsurface.ts +15 -0
- package/ts/functions.deviceapi.ts +1071 -34
- package/ts/functions.fleetworkercli.ts +10 -7
- package/ts/functions.gatewaycli.ts +436 -0
- package/ts/functions.gatewayroute.ts +429 -0
- package/ts/functions.inferencecli.ts +26 -0
- package/ts/functions.inferencecliarguments.ts +30 -4
- package/ts/functions.mcpfleetworkertools.ts +1 -1
- package/ts/functions.proxycapacity.ts +191 -0
- package/ts/functions.proxycapacitycli.ts +104 -0
- package/ts/functions.remotecli.ts +56 -20
- package/ts/functions.ticketvalidation.ts +11 -1
- package/ts/interfaces.auth.ts +36 -4
- package/ts/plugins.ts +12 -0
- package/ts_authswitch/authority-contract.ts +20 -0
- package/ts_authswitch/authority-overview.ts +28 -6
- package/ts_authswitch/authority-placement.ts +27 -32
- package/ts_authswitch/authority-renewal.ts +64 -0
- package/ts_authswitch/authority-usagelimit.ts +84 -1
- package/ts_authswitch/authority-usagewindows.ts +13 -0
- package/ts_authswitch/classes.authoritybroker.ts +34 -1
- package/ts_authswitch/classes.authoritycli.ts +49 -2
- package/ts_authswitch/classes.authorityclient.ts +14 -4
- package/ts_authswitch/classes.authoritydaemon.ts +9 -1
- package/ts_authswitch/classes.authoritydatabase.ts +5 -1
- package/ts_authswitch/classes.authoritymodels.ts +23 -3
- package/ts_authswitch/native-contracts.md +21 -0
- package/ts_authswitch/readme.md +1 -1
- package/ts_interfaces/devices.schema.json +3573 -603
- package/ts_interfaces/devices.ts +1093 -4
- package/ts_interfaces/fleetworkers.ts +5 -3
- package/ts_interfaces/gateway.ts +242 -0
- package/ts_interfaces/inbox.ts +287 -0
- package/ts_interfaces/index.ts +3 -0
- package/ts_interfaces/interfaces.ts +9 -2
- package/ts_interfaces/management.ts +6 -4
- package/ts_interfaces/mcprequests.ts +61 -4
- package/ts_interfaces/mcpworkspacerequests.ts +4 -2
- package/ts_interfaces/nativesessions.ts +17 -3
- package/ts_interfaces/plugins.ts +3 -1
- package/ts_interfaces/proxycapacity.ts +162 -0
- package/ts_interfaces/requests.accounts.ts +20 -0
- package/ts_interfaces/requests.ts +4 -0
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/accounts.plugins.ts +4 -2
- package/ts_web/classes.accountsreadmodel.ts +33 -0
- package/ts_web/classes.browserpresentation.ts +19 -6
- package/ts_web/classes.inboxfeed.ts +329 -0
- package/ts_web/classes.nativesessionstate.ts +9 -23
- package/ts_web/elements.accounts.ts +121 -113
- package/ts_web/elements.configurationpane.ts +24 -37
- package/ts_web/elements.deployments.ts +66 -2
- package/ts_web/elements.devices.ts +4 -17
- package/ts_web/elements.flexlimitstrip.ts +21 -70
- package/ts_web/elements.harnesscontrollerapp.ts +198 -222
- package/ts_web/elements.inbox.ts +808 -0
- package/ts_web/functions.inbox.ts +95 -0
- package/ts_web/functions.sessioncards.ts +40 -0
- package/ts_web/plugins.ts +2 -0
|
@@ -2,7 +2,7 @@ import type { ITypedRequest, implementsTR } from '@api.global/typedrequest-inter
|
|
|
2
2
|
/** The device protocol this controller speaks. */
|
|
3
3
|
export declare const deviceProtocolVersion: {
|
|
4
4
|
readonly major: 1;
|
|
5
|
-
readonly minor:
|
|
5
|
+
readonly minor: 3;
|
|
6
6
|
};
|
|
7
7
|
/** The scheme of a pairing payload: `agl-pair:?origin=<https origin>&controller=<controller id>&code=<base64url>`. */
|
|
8
8
|
export declare const devicePairingScheme: 'agl-pair';
|
|
@@ -26,6 +26,18 @@ export declare const deviceLabelMaximumCharacters = 64;
|
|
|
26
26
|
export declare const deviceMessageMaximumBytes: number;
|
|
27
27
|
/** The close code of every live connection of a device the owner revoked. */
|
|
28
28
|
export declare const deviceRevokedCloseCode = 4403;
|
|
29
|
+
/**
|
|
30
|
+
* The ticket store's own refusals: a device's ticket request is refused with them as the store refuses the owner's
|
|
31
|
+
* browser, each with the store's reason, and nothing changed. The ones a device meets: `ticket_not_found`,
|
|
32
|
+
* `ticket_question_not_found`; `ticket_revision_conflict`: the board changed while the change was made, so read the
|
|
33
|
+
* ticket again; `ticket_review_branch_required`, `ticket_landed_evidence_required`,
|
|
34
|
+
* `ticket_released_evidence_required`: the column needs its evidence first (a branch link; a branch or commit link; a
|
|
35
|
+
* release link); `ticket_closed_landed`: landed code ships with its release and is not closed; `ticket_question_answered`
|
|
36
|
+
* and `ticket_answer_invalid`. The others refuse workers and requests a device does not make. Since protocol 1.3;
|
|
37
|
+
* `ticket_not_found`, `ticket_question_not_found`, `ticket_question_answered` and `ticket_answer_invalid` since 1.2.
|
|
38
|
+
*/
|
|
39
|
+
export declare const deviceTicketRefusalCodes: readonly ['ticket_revision_conflict', 'ticket_identity_required', 'ticket_not_found', 'ticket_not_assigned', 'ticket_worker_column', 'ticket_worker_create_backlog', 'ticket_assignment_forbidden', 'ticket_review_branch_required', 'ticket_landed_evidence_required', 'ticket_released_evidence_required', 'ticket_closed_landed', 'ticket_parent_required', 'ticket_parent_invalid', 'ticket_move_anchor_invalid', 'ticket_label_reserved', 'ticket_release_plan_forbidden', 'ticket_unlink_forbidden', 'ticket_release_link_forbidden', 'ticket_link_not_found', 'ticket_affects_invalid', 'ticket_release_plan_invalid', 'ticket_window_forbidden', 'ticket_window_invalid', 'ticket_deploy_plan_forbidden', 'ticket_deploy_plan_invalid', 'ticket_deploy_plan_link_forbidden', 'ticket_deploy_plan_fixed', 'ticket_window_waiting', 'ticket_go_owner_only', 'ticket_ask_forbidden', 'ticket_answer_forbidden', 'ticket_question_not_found', 'ticket_comment_not_found', 'ticket_question_answered', 'ticket_answer_invalid'];
|
|
40
|
+
export type TDeviceTicketRefusalCode = (typeof deviceTicketRefusalCodes)[number];
|
|
29
41
|
/**
|
|
30
42
|
* Why AGL refused a device request, as `error.data.code`:
|
|
31
43
|
* `device_unknown`: no such device is paired (any more): forget the pairing;
|
|
@@ -36,14 +48,27 @@ export declare const deviceRevokedCloseCode = 4403;
|
|
|
36
48
|
* `device_proof_invalid`: the signature does not verify;
|
|
37
49
|
* `device_challenge_invalid`: no live nonce of this connection for this device;
|
|
38
50
|
* `device_authentication_required`: the connection is not authenticated as a device;
|
|
39
|
-
* `session_not_found`: the session feed lists no such session
|
|
51
|
+
* `session_not_found`: the session feed lists no such session (or, for a `childSessionId`, the session has no such
|
|
52
|
+
* direct child that runs);
|
|
40
53
|
* `session_read_only`: AGL does not write to the session (another process runs it, a fleet worker owns it);
|
|
54
|
+
* the ticket store's own refusals, `deviceTicketRefusalCodes`, each with the store's reason (since 1.3; these four since
|
|
55
|
+
* 1.2): `ticket_not_found`, `ticket_question_not_found`: no such ticket, or no such question on it;
|
|
56
|
+
* `ticket_question_answered`: the question already has a different answer; a second answer is refused;
|
|
57
|
+
* `ticket_answer_invalid`: the answer chooses options the question does not have, more than one where it takes one,
|
|
58
|
+
* or text where it takes none;
|
|
59
|
+
* `driver_absent`: the host has no driver session; the owner starts the driver in the browser, a device never does
|
|
60
|
+
* (since 1.3);
|
|
61
|
+
* `direct_report_failed`: the direct report took no message, or AGL could not confirm it did: it is not an active
|
|
62
|
+
* report, it is a Claude Code session the fleet does not run, or its fleet job or Codex server failed; the message says
|
|
63
|
+
* why (since 1.3);
|
|
64
|
+
* `direct_report_busy`: the report's Codex thread runs a turn another Codex client started, which a device does not
|
|
65
|
+
* steer; nothing was sent: send it again once that turn ended (since 1.3);
|
|
41
66
|
* `rate_limited`, `invalid_request`, `controller_unavailable` and `operation_limit` as for any client.
|
|
42
67
|
* In this device protocol version (1.0) AGL sends no retry hint with a refusal (no `retry` beside the error, no retry
|
|
43
68
|
* timing in `error.data`), and `rate_limited` is final: a client never resends the refused request on its own; it shows
|
|
44
69
|
* the refusal, and the user may try again.
|
|
45
70
|
*/
|
|
46
|
-
export type TDeviceRefusalCode = 'device_unknown' | 'device_pairing_invalid' | 'device_pairing_unavailable' | 'device_limit' | 'device_already_paired' | 'device_proof_invalid' | 'device_challenge_invalid' | 'device_authentication_required' | 'session_not_found' | 'session_read_only';
|
|
71
|
+
export type TDeviceRefusalCode = 'device_unknown' | 'device_pairing_invalid' | 'device_pairing_unavailable' | 'device_limit' | 'device_already_paired' | 'device_proof_invalid' | 'device_challenge_invalid' | 'device_authentication_required' | 'session_not_found' | 'session_read_only' | (typeof deviceTicketRefusalCodes)[number] | 'driver_absent' | 'direct_report_failed' | 'direct_report_busy' | 'rate_limited' | 'invalid_request' | 'controller_unavailable' | 'operation_limit';
|
|
47
72
|
/** The harness a session runs on. */
|
|
48
73
|
export type TDeviceHarness = 'claude' | 'codex' | 'flex' | 'opencode';
|
|
49
74
|
/** `needs_input`: a question, a permission or an MCP elicitation waits for the owner. */
|
|
@@ -283,8 +308,730 @@ export interface IDeviceSessionTextDeltaEvent {
|
|
|
283
308
|
export interface IDeviceSessionsChangedEvent {
|
|
284
309
|
type: 'sessions.changed';
|
|
285
310
|
}
|
|
311
|
+
/**
|
|
312
|
+
* What an Inbox item is, in the order the Inbox lists the kinds: a permission, a question, an MCP form, a wait the
|
|
313
|
+
* harness shows in its own client, the driver's `needs input:` turn, a deploy plan's go, a maintenance window's go, a
|
|
314
|
+
* ticket question. Since protocol 1.2.
|
|
315
|
+
*/
|
|
316
|
+
export type TDeviceInboxKind = 'permission' | 'question' | 'elicitation' | 'native_wait' | 'driver' | 'deploy_go' | 'window_go' | 'ticket_question';
|
|
317
|
+
/**
|
|
318
|
+
* Where an item lives: a session as the feed names it (with the direct child that asks, an OpenCode subagent, when it
|
|
319
|
+
* is one), the host's driver, or a ticket.
|
|
320
|
+
*/
|
|
321
|
+
export type TDeviceInboxWhere = {
|
|
322
|
+
kind: 'session';
|
|
323
|
+
/** The feed's row id. */
|
|
324
|
+
sessionId: string;
|
|
325
|
+
harness: TDeviceHarness;
|
|
326
|
+
name: string;
|
|
327
|
+
/** The direct child that asks, which `childSessionId` of the reply names. */
|
|
328
|
+
childSessionId?: string;
|
|
329
|
+
childName?: string;
|
|
330
|
+
} | {
|
|
331
|
+
kind: 'driver';
|
|
332
|
+
} | {
|
|
333
|
+
kind: 'ticket';
|
|
334
|
+
ticketKey: string;
|
|
335
|
+
ticketTitle: string;
|
|
336
|
+
project: string;
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* How a device answers an item: `session` with `device.permission.reply`, `device.question.reply` or
|
|
340
|
+
* `device.elicitation.reply` for the session; `child` with the same replies and the child's `childSessionId`; `ticket`
|
|
341
|
+
* with `device.ticket.answer`; `none` not on a device (the driver's turn, the driver's own prompts, a native wait, an
|
|
342
|
+
* item whose payload was left out, or a session the feed does not list).
|
|
343
|
+
*/
|
|
344
|
+
export type TDeviceInboxAnswer = 'session' | 'child' | 'ticket' | 'none';
|
|
345
|
+
/** An option of a ticket question; the answer names it by `id`. */
|
|
346
|
+
export interface IDeviceTicketQuestionOption {
|
|
347
|
+
id: string;
|
|
348
|
+
label: string;
|
|
349
|
+
description?: string;
|
|
350
|
+
}
|
|
351
|
+
/** A ticket's question: Markdown text, options to choose from (several when `multiSelect`), and text when `allowCustom`. */
|
|
352
|
+
export interface IDeviceTicketQuestion {
|
|
353
|
+
/** `Q1`, `Q2` and so on, per ticket. */
|
|
354
|
+
id: string;
|
|
355
|
+
question: string;
|
|
356
|
+
options: IDeviceTicketQuestionOption[];
|
|
357
|
+
multiSelect: boolean;
|
|
358
|
+
allowCustom: boolean;
|
|
359
|
+
/** Who asked it. */
|
|
360
|
+
askedBy: string;
|
|
361
|
+
/** @asType integer */
|
|
362
|
+
createdAt: number;
|
|
363
|
+
/** Present once it is answered. */
|
|
364
|
+
answer?: IDeviceTicketQuestionAnswer;
|
|
365
|
+
}
|
|
366
|
+
/** A ticket question's answer: the chosen option ids, the text, who answered and when. */
|
|
367
|
+
export interface IDeviceTicketQuestionAnswer {
|
|
368
|
+
choices: string[];
|
|
369
|
+
text?: string;
|
|
370
|
+
answeredBy: string;
|
|
371
|
+
/** @asType integer */
|
|
372
|
+
answeredAt: number;
|
|
373
|
+
}
|
|
374
|
+
/** A span of time in Unix milliseconds. */
|
|
375
|
+
export interface IDeviceTimeSpan {
|
|
376
|
+
/** @asType integer */
|
|
377
|
+
from: number;
|
|
378
|
+
/** @asType integer */
|
|
379
|
+
to: number;
|
|
380
|
+
}
|
|
381
|
+
/** A ticket by key and title. */
|
|
382
|
+
export interface IDeviceTicketRef {
|
|
383
|
+
key: string;
|
|
384
|
+
title: string;
|
|
385
|
+
}
|
|
386
|
+
/** Why an item's payload was left out: its size in bytes. */
|
|
387
|
+
export interface IDeviceInboxOmission {
|
|
388
|
+
reason: 'oversize';
|
|
389
|
+
/** @asType integer */
|
|
390
|
+
bytes: number;
|
|
391
|
+
}
|
|
392
|
+
/** A deploy plan as its go shows it: what the target runs now, what it deploys, when, and what ships with it. */
|
|
393
|
+
export interface IDeviceDeployGo {
|
|
394
|
+
target: string;
|
|
395
|
+
targetName?: string;
|
|
396
|
+
environment?: string;
|
|
397
|
+
version: string;
|
|
398
|
+
runs?: string;
|
|
399
|
+
/** `anytime`, `window` (in a maintenance window the owner gave) or `idle` (the AGL controller: no session busy). */
|
|
400
|
+
deployWhen?: 'anytime' | 'window' | 'idle';
|
|
401
|
+
/** The maintenance window the deploy would run in. */
|
|
402
|
+
window?: IDeviceTimeSpan;
|
|
403
|
+
ships: IDeviceTicketRef[];
|
|
404
|
+
/** @asType integer */
|
|
405
|
+
shipsTotal: number;
|
|
406
|
+
}
|
|
407
|
+
/** A maintenance window the driver proposed, as its go shows it. */
|
|
408
|
+
export interface IDeviceWindowGo {
|
|
409
|
+
/** @asType integer */
|
|
410
|
+
from: number;
|
|
411
|
+
/** @asType integer */
|
|
412
|
+
to: number;
|
|
413
|
+
targets: string[];
|
|
414
|
+
}
|
|
415
|
+
interface IDeviceInboxItemBase {
|
|
416
|
+
/** Stable across clients: the kind, where it lives and the request or question id. */
|
|
417
|
+
id: string;
|
|
418
|
+
/**
|
|
419
|
+
* Unix milliseconds since it waits.
|
|
420
|
+
* @asType integer
|
|
421
|
+
*/
|
|
422
|
+
since: number;
|
|
423
|
+
/** One line: what is asked. */
|
|
424
|
+
title: string;
|
|
425
|
+
where: TDeviceInboxWhere;
|
|
426
|
+
answer: TDeviceInboxAnswer;
|
|
427
|
+
/** Set when the payload was left out for its size: it is answered only where it lives. */
|
|
428
|
+
omitted?: IDeviceInboxOmission;
|
|
429
|
+
}
|
|
430
|
+
export interface IDeviceInboxPermissionItem extends IDeviceInboxItemBase {
|
|
431
|
+
kind: 'permission';
|
|
432
|
+
permission?: IDevicePermission;
|
|
433
|
+
}
|
|
434
|
+
export interface IDeviceInboxQuestionItem extends IDeviceInboxItemBase {
|
|
435
|
+
kind: 'question';
|
|
436
|
+
question?: IDeviceQuestion;
|
|
437
|
+
}
|
|
438
|
+
export interface IDeviceInboxElicitationItem extends IDeviceInboxItemBase {
|
|
439
|
+
kind: 'elicitation';
|
|
440
|
+
elicitation?: TDeviceElicitation;
|
|
441
|
+
}
|
|
442
|
+
/** The harness waits in its own client on this controller's host, `host`: it is answered there. */
|
|
443
|
+
export interface IDeviceInboxNativeWaitItem extends IDeviceInboxItemBase {
|
|
444
|
+
kind: 'native_wait';
|
|
445
|
+
/** `approval`, `user_input`, `native_prompt` (Claude Code) or `unrecognized`. */
|
|
446
|
+
reason: 'approval' | 'user_input' | 'native_prompt' | 'unrecognized';
|
|
447
|
+
host: string;
|
|
448
|
+
}
|
|
449
|
+
/** The driver's last turn ended on this `needs input:` line. */
|
|
450
|
+
export interface IDeviceInboxDriverItem extends IDeviceInboxItemBase {
|
|
451
|
+
kind: 'driver';
|
|
452
|
+
line?: string;
|
|
453
|
+
}
|
|
454
|
+
export interface IDeviceInboxDeployGoItem extends IDeviceInboxItemBase {
|
|
455
|
+
kind: 'deploy_go';
|
|
456
|
+
question?: IDeviceTicketQuestion;
|
|
457
|
+
plan: IDeviceDeployGo;
|
|
458
|
+
}
|
|
459
|
+
export interface IDeviceInboxWindowGoItem extends IDeviceInboxItemBase {
|
|
460
|
+
kind: 'window_go';
|
|
461
|
+
question?: IDeviceTicketQuestion;
|
|
462
|
+
window: IDeviceWindowGo;
|
|
463
|
+
}
|
|
464
|
+
export interface IDeviceInboxTicketQuestionItem extends IDeviceInboxItemBase {
|
|
465
|
+
kind: 'ticket_question';
|
|
466
|
+
question?: IDeviceTicketQuestion;
|
|
467
|
+
}
|
|
468
|
+
/** One thing that waits for the owner. Since protocol 1.2. */
|
|
469
|
+
export type TDeviceInboxItem = IDeviceInboxPermissionItem | IDeviceInboxQuestionItem | IDeviceInboxElicitationItem | IDeviceInboxNativeWaitItem | IDeviceInboxDriverItem | IDeviceInboxDeployGoItem | IDeviceInboxWindowGoItem | IDeviceInboxTicketQuestionItem;
|
|
470
|
+
/**
|
|
471
|
+
* An Inbox change: apply it on the same epoch at the revision after the held one, then show the items in `order`;
|
|
472
|
+
* on `reset` or any gap, list again. `total` counts every item, also those `limited` left out of the list.
|
|
473
|
+
*/
|
|
474
|
+
export interface IDeviceInboxDelta {
|
|
475
|
+
epoch: string;
|
|
476
|
+
/** @asType integer */
|
|
477
|
+
revision: number;
|
|
478
|
+
reset: boolean;
|
|
479
|
+
upserts: TDeviceInboxItem[];
|
|
480
|
+
removed: string[];
|
|
481
|
+
order: string[];
|
|
482
|
+
/** @asType integer */
|
|
483
|
+
total: number;
|
|
484
|
+
limited: boolean;
|
|
485
|
+
}
|
|
486
|
+
/** The Inbox changed. Since protocol 1.2. */
|
|
487
|
+
export interface IDeviceInboxChangedEvent {
|
|
488
|
+
type: 'inbox.changed';
|
|
489
|
+
delta: IDeviceInboxDelta;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* What the host's driver does: `absent`, the host has no driver session (a device never creates one); `needs_input`,
|
|
493
|
+
* its last turn ended on a `needs input:` line, or one of its own prompts waits. Since protocol 1.3.
|
|
494
|
+
*/
|
|
495
|
+
export type TDeviceDriverActivity = 'absent' | 'idle' | 'working' | 'needs_input' | 'error';
|
|
496
|
+
/** The host's driver as a device sees it. Since protocol 1.3. */
|
|
497
|
+
export interface IDeviceDriverStatus {
|
|
498
|
+
activity: TDeviceDriverActivity;
|
|
499
|
+
/**
|
|
500
|
+
* Driver turns that ended since the owner last marked the driver seen, in any client: one count for all of them.
|
|
501
|
+
* @asType integer
|
|
502
|
+
*/
|
|
503
|
+
unreadCount: number;
|
|
504
|
+
/** The driver session's title, while it can be read. */
|
|
505
|
+
title?: string;
|
|
506
|
+
/** The `needs input:` line the driver's last turn ended on, while that turn is what `needs_input` stands for. */
|
|
507
|
+
needsInput?: string;
|
|
508
|
+
/**
|
|
509
|
+
* Unix milliseconds of the last status change.
|
|
510
|
+
* @asType integer
|
|
511
|
+
*/
|
|
512
|
+
updatedAt: number;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* The driver's status changed, or its transcript or prompts did: apply `driver`, and read an open Driver view again.
|
|
516
|
+
* A device that was resynchronized (`sessions.changed`) reads it again too. Since protocol 1.3.
|
|
517
|
+
*/
|
|
518
|
+
export interface IDeviceDriverChangedEvent {
|
|
519
|
+
type: 'driver.changed';
|
|
520
|
+
driver: IDeviceDriverStatus;
|
|
521
|
+
}
|
|
522
|
+
/** The direct reports, their workers or their open questions changed: list them again. Since protocol 1.3. */
|
|
523
|
+
export interface IDeviceDirectReportsChangedEvent {
|
|
524
|
+
type: 'directreports.changed';
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* What the host's status reads may have changed: its deploy targets, their planned deploys (tickets) or its accounts.
|
|
528
|
+
* It says nothing more: an open Host view reads `device.host.get` again. Since protocol 1.3.
|
|
529
|
+
*/
|
|
530
|
+
export interface IDeviceHostChangedEvent {
|
|
531
|
+
type: 'host.changed';
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* The shared board changed: a ticket, its comments or questions, or the AutoLabels the deploy monitor computes. It names
|
|
535
|
+
* no ticket: an open board reads `device.board.list` again from its first page, an open ticket `device.ticket.get`.
|
|
536
|
+
* `revision` is the board's after the change; it is absent when only AutoLabels moved, which move no revision. Since
|
|
537
|
+
* protocol 1.3.
|
|
538
|
+
*/
|
|
539
|
+
export interface IDeviceTicketsChangedEvent {
|
|
540
|
+
type: 'tickets.changed';
|
|
541
|
+
/** @asType integer */
|
|
542
|
+
revision?: number;
|
|
543
|
+
}
|
|
286
544
|
/** The events a device receives: an allowlist, each in a reduced shape. */
|
|
287
|
-
export type TDeviceEvent = IDeviceSessionFeedChangedEvent | IDeviceSessionChangedEvent | IDeviceSessionTextUpdatedEvent | IDeviceSessionTextDeltaEvent | IDeviceSessionsChangedEvent;
|
|
545
|
+
export type TDeviceEvent = IDeviceSessionFeedChangedEvent | IDeviceSessionChangedEvent | IDeviceSessionTextUpdatedEvent | IDeviceSessionTextDeltaEvent | IDeviceSessionsChangedEvent | IDeviceInboxChangedEvent | IDeviceDriverChangedEvent | IDeviceDirectReportsChangedEvent | IDeviceHostChangedEvent | IDeviceTicketsChangedEvent;
|
|
546
|
+
/** The harness a direct report's session runs on. Since protocol 1.3. */
|
|
547
|
+
export type TDeviceDirectReportHarness = 'claude' | 'codex';
|
|
548
|
+
/**
|
|
549
|
+
* A fleet worker's native status as AGL last observed it: `reaped`, its process ended under it; `gone`, its session is
|
|
550
|
+
* no more. Since protocol 1.3.
|
|
551
|
+
*/
|
|
552
|
+
export type TDeviceReportWorkerStatus = 'busy' | 'idle' | 'blocked' | 'stopped' | 'archived' | 'reaped' | 'gone';
|
|
553
|
+
/**
|
|
554
|
+
* A direct report's status, derived on every read: its fleet worker's, `failed` for a session that failed, `unknown`
|
|
555
|
+
* for a fleet worker whose last dispatch has no known outcome. Since protocol 1.3.
|
|
556
|
+
*/
|
|
557
|
+
export type TDeviceDirectReportStatus = TDeviceReportWorkerStatus | 'failed' | 'unknown';
|
|
558
|
+
/** A fleet worker that a direct report started or adopted, which reports to it. Since protocol 1.3. */
|
|
559
|
+
export interface IDeviceReportWorker {
|
|
560
|
+
name: string;
|
|
561
|
+
harness: TDeviceDirectReportHarness;
|
|
562
|
+
/** Absent until AGL observed the worker. */
|
|
563
|
+
status?: TDeviceReportWorkerStatus;
|
|
564
|
+
/** The ticket the worker is bound to. */
|
|
565
|
+
ticketKey?: string;
|
|
566
|
+
}
|
|
567
|
+
/** The newest `result:` line a direct report's session ended a turn or reported on. Since protocol 1.3. */
|
|
568
|
+
export interface IDeviceDirectReportResult {
|
|
569
|
+
text: string;
|
|
570
|
+
/** @asType integer */
|
|
571
|
+
at: number;
|
|
572
|
+
}
|
|
573
|
+
/** An open ticket question that counts as a direct report's: asked by its session, or in one of its projects. */
|
|
574
|
+
export interface IDeviceDirectReportQuestion {
|
|
575
|
+
ticketKey: string;
|
|
576
|
+
project: string;
|
|
577
|
+
question: IDeviceTicketQuestion;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* A session that reports to the owner directly, as the Driver view lists it. A device names a report only by `name`.
|
|
581
|
+
* Since protocol 1.3.
|
|
582
|
+
*/
|
|
583
|
+
export interface IDeviceDirectReport {
|
|
584
|
+
name: string;
|
|
585
|
+
/** `fleet-worker`: a fleet worker AGL runs; `session`: a Claude Code or Codex session the fleet does not run. */
|
|
586
|
+
kind: 'fleet-worker' | 'session';
|
|
587
|
+
harness: TDeviceDirectReportHarness;
|
|
588
|
+
/** Absent while AGL does not observe the report's session. */
|
|
589
|
+
status?: TDeviceDirectReportStatus;
|
|
590
|
+
/** The report's session as the session feed names it (`harness:nativeId`); `device.session.read` opens it while the feed lists it. */
|
|
591
|
+
sessionId: string;
|
|
592
|
+
/** Ticket projects whose open questions count as the report's. */
|
|
593
|
+
projects: string[];
|
|
594
|
+
/** The ticket the report is steered through. */
|
|
595
|
+
ticketKey: string;
|
|
596
|
+
latestResult?: IDeviceDirectReportResult;
|
|
597
|
+
/** The oldest open questions first, at most 20. */
|
|
598
|
+
openQuestions: IDeviceDirectReportQuestion[];
|
|
599
|
+
/** @asType integer */
|
|
600
|
+
openQuestionCount: number;
|
|
601
|
+
/** The fleet workers that report to it. */
|
|
602
|
+
workers: IDeviceReportWorker[];
|
|
603
|
+
/** Whether `device.directreport.message` reaches it: a Claude Code session the fleet does not run takes none. */
|
|
604
|
+
messageable: boolean;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* How a direct report took a message: `fleet`, the fleet steered its worker through the report's ticket and the steer
|
|
608
|
+
* succeeded; `steer`, its Codex thread's running turn took it; `next-turn`, the thread's next turn takes it; `queue`,
|
|
609
|
+
* it runs after every earlier message. Since protocol 1.3.
|
|
610
|
+
*/
|
|
611
|
+
export type TDeviceDirectReportDelivery = 'fleet' | 'steer' | 'next-turn' | 'queue';
|
|
612
|
+
/**
|
|
613
|
+
* Where the host's route on its gateway stands: `finalize_pending`, the enrolment waits to be confirmed; `syncing`;
|
|
614
|
+
* `synced`, the route is written; `retrying`, the last sync failed and is retried; `waiting`, the gateway cannot carry
|
|
615
|
+
* the route yet; `failed`, the last sync failed until the owner acts; `stopped`. Since protocol 1.3.
|
|
616
|
+
*/
|
|
617
|
+
export type TDeviceGatewayState = 'finalize_pending' | 'syncing' | 'synced' | 'retrying' | 'waiting' | 'failed' | 'stopped';
|
|
618
|
+
/** The host reached through its gateway, which AGL keeps its own route on. Since protocol 1.3. */
|
|
619
|
+
export interface IDeviceHostGatewayReach {
|
|
620
|
+
kind: 'gateway';
|
|
621
|
+
state: TDeviceGatewayState;
|
|
622
|
+
}
|
|
623
|
+
/** The host reached through a TLS reverse proxy the owner runs. Since protocol 1.3. */
|
|
624
|
+
export interface IDeviceHostProxyReach {
|
|
625
|
+
kind: 'proxy';
|
|
626
|
+
}
|
|
627
|
+
/** The AGL that runs on the host, and how a device reaches it. Since protocol 1.3. */
|
|
628
|
+
export interface IDeviceHostAgl {
|
|
629
|
+
/** The AGL release, such as `43.2.0`. */
|
|
630
|
+
version: string;
|
|
631
|
+
/**
|
|
632
|
+
* Unix milliseconds the controller started.
|
|
633
|
+
* @asType integer
|
|
634
|
+
*/
|
|
635
|
+
startedAt: number;
|
|
636
|
+
/** The public origin a device reaches the host at. */
|
|
637
|
+
origin: string;
|
|
638
|
+
reach: IDeviceHostGatewayReach | IDeviceHostProxyReach;
|
|
639
|
+
}
|
|
640
|
+
/** This device, as the host keeps it: read-only, a device neither renames nor unpairs itself. Since protocol 1.3. */
|
|
641
|
+
export interface IDeviceHostDevice {
|
|
642
|
+
name: string;
|
|
643
|
+
model: string;
|
|
644
|
+
/**
|
|
645
|
+
* Unix milliseconds it paired.
|
|
646
|
+
* @asType integer
|
|
647
|
+
*/
|
|
648
|
+
pairedAt: number;
|
|
649
|
+
/**
|
|
650
|
+
* Unix milliseconds of its last authenticated connection, kept to about five minutes.
|
|
651
|
+
* @asType integer
|
|
652
|
+
*/
|
|
653
|
+
lastSeenAt?: number;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Why a section was not read: `not_running`, what answers it does not run now (the configuration service the deploy
|
|
657
|
+
* monitor reads, the inference proxy or the accounts service; it may be starting); `outdated`, it runs a release this
|
|
658
|
+
* AGL cannot read; `failed`, the read failed, and AGL keeps the cause in its failure journal under `reference`. Since
|
|
659
|
+
* protocol 1.3.
|
|
660
|
+
*/
|
|
661
|
+
export type TDeviceHostUnavailableReason = 'not_running' | 'outdated' | 'failed';
|
|
662
|
+
/**
|
|
663
|
+
* A section that was not read: of the host's status, whose other sections are read on their own, or a ticket's
|
|
664
|
+
* placement (`device.ticket.get`). Since protocol 1.3.
|
|
665
|
+
*/
|
|
666
|
+
export interface IDeviceHostUnavailable {
|
|
667
|
+
state: 'unavailable';
|
|
668
|
+
reason: TDeviceHostUnavailableReason;
|
|
669
|
+
/** For `failed`: the failure journal's reference, which the browser's diagnostics show the cause under. */
|
|
670
|
+
reference?: string;
|
|
671
|
+
}
|
|
672
|
+
/** What a deploy target's last probe found: `unknown` before its first probe. Since protocol 1.3. */
|
|
673
|
+
export type TDeviceDeployProbeState = 'up' | 'down' | 'unknown';
|
|
674
|
+
/** What a deploy target runs, as its probe answered it. Since protocol 1.3. */
|
|
675
|
+
export interface IDeviceDeployRunning {
|
|
676
|
+
version: string;
|
|
677
|
+
/**
|
|
678
|
+
* Unix milliseconds the probe first answered this version.
|
|
679
|
+
* @asType integer
|
|
680
|
+
*/
|
|
681
|
+
since: number;
|
|
682
|
+
/** The version it ran before. */
|
|
683
|
+
previousVersion?: string;
|
|
684
|
+
/** It runs an older version than before. */
|
|
685
|
+
rolledBack: boolean;
|
|
686
|
+
/** Its commit is not the one its version's release tag names, such as a development checkout's. */
|
|
687
|
+
untagged: boolean;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* The owner's go on a planned deploy, from the answer to its question: `waiting` while it is open, `now`, `window` (the
|
|
691
|
+
* next maintenance window), `idle` (the AGL controller: when no session is busy) or `hold`. Since protocol 1.3.
|
|
692
|
+
*/
|
|
693
|
+
export type TDeviceDeployPlanGo = 'waiting' | 'now' | 'window' | 'idle' | 'hold';
|
|
694
|
+
/**
|
|
695
|
+
* A planned deploy of a target: its ticket, the release the target should run (or a newer one) and the owner's go. Who
|
|
696
|
+
* deploys it and the question it is answered on stay on the host. Since protocol 1.3.
|
|
697
|
+
*/
|
|
698
|
+
export interface IDeviceDeployPlan {
|
|
699
|
+
ticketKey: string;
|
|
700
|
+
title: string;
|
|
701
|
+
version: string;
|
|
702
|
+
go: TDeviceDeployPlanGo;
|
|
703
|
+
/** For `window`: the maintenance window it is queued into; absent while the owner gave none. */
|
|
704
|
+
window?: IDeviceTimeSpan;
|
|
705
|
+
}
|
|
706
|
+
/** A deploy target and what it runs; its probe's address and the owner's notes on it stay on the host. Since protocol 1.3. */
|
|
707
|
+
export interface IDeviceDeployTarget {
|
|
708
|
+
id: string;
|
|
709
|
+
/** The name the views show; absent shows the id. */
|
|
710
|
+
name?: string;
|
|
711
|
+
/** Where it runs: an environment such as `production`, or a host. */
|
|
712
|
+
environment?: string;
|
|
713
|
+
/** The repository it runs, `org/name`. */
|
|
714
|
+
repo: string;
|
|
715
|
+
/** Absent until its probe answered a version. */
|
|
716
|
+
running?: IDeviceDeployRunning;
|
|
717
|
+
probe: TDeviceDeployProbeState;
|
|
718
|
+
/**
|
|
719
|
+
* Unix milliseconds of its last probe.
|
|
720
|
+
* @asType integer
|
|
721
|
+
*/
|
|
722
|
+
probedAt?: number;
|
|
723
|
+
/**
|
|
724
|
+
* Unix milliseconds of the first failed probe of a failure that still lasts.
|
|
725
|
+
* @asType integer
|
|
726
|
+
*/
|
|
727
|
+
downSince?: number;
|
|
728
|
+
/** The repository's newest release. */
|
|
729
|
+
latest?: string;
|
|
730
|
+
/** The releases newer than the version it runs, newest first; none while its probe answered no version. */
|
|
731
|
+
undeployed: string[];
|
|
732
|
+
/** `anytime`, `window` (in a maintenance window the owner gave) or `idle` (the AGL controller: no session busy). */
|
|
733
|
+
deployWhen: 'anytime' | 'window' | 'idle';
|
|
734
|
+
/** Its planned deploys whose ticket is not done, the newest version first. */
|
|
735
|
+
plans: IDeviceDeployPlan[];
|
|
736
|
+
}
|
|
737
|
+
/** The host's deploy targets, the AGL controller among them. Since protocol 1.3. */
|
|
738
|
+
export interface IDeviceHostDeploys {
|
|
739
|
+
state: 'ready';
|
|
740
|
+
/** @asType integer */
|
|
741
|
+
checkedAt: number;
|
|
742
|
+
targets: IDeviceDeployTarget[];
|
|
743
|
+
}
|
|
744
|
+
/** An account pool, or an API key's provider: Claude (`anthropic`) or ChatGPT and OpenAI (`openai`). Since protocol 1.3. */
|
|
745
|
+
export type TDeviceAccountProvider = 'anthropic' | 'openai';
|
|
746
|
+
/** Whether a pool's account takes new work now, or why not. Since protocol 1.3. */
|
|
747
|
+
export type TDevicePoolMemberState = 'available' | 'reserved' | 'exhausted' | 'cooling' | 'unavailable';
|
|
748
|
+
/** The usage window an account's room is bound by, as its last reading states it. Since protocol 1.3. */
|
|
749
|
+
export interface IDevicePoolWindow {
|
|
750
|
+
/** The provider's name for the window, or its length (`5h`, `7d`). */
|
|
751
|
+
name: string;
|
|
752
|
+
usedPercent: number;
|
|
753
|
+
/** Whether `usedPercent` is the accounts service's estimate between its reads. */
|
|
754
|
+
estimated: boolean;
|
|
755
|
+
/**
|
|
756
|
+
* Unix milliseconds its current period ends; absent when the reading states none.
|
|
757
|
+
* @asType integer
|
|
758
|
+
*/
|
|
759
|
+
resetAt?: number;
|
|
760
|
+
}
|
|
761
|
+
/** One account of a pool, without anything that names it. Since protocol 1.3. */
|
|
762
|
+
export interface IDevicePoolMember {
|
|
763
|
+
plan: string;
|
|
764
|
+
state: TDevicePoolMemberState;
|
|
765
|
+
/** Absent without a usable reading. */
|
|
766
|
+
window?: IDevicePoolWindow;
|
|
767
|
+
}
|
|
768
|
+
/** A pool takes new work now. Since protocol 1.3. */
|
|
769
|
+
export interface IDevicePoolOpen {
|
|
770
|
+
state: 'open';
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* A pool waits: for too little room, a provider 429 within the quiet period, or a proxy that has not observed it long
|
|
774
|
+
* enough. Since protocol 1.3.
|
|
775
|
+
*/
|
|
776
|
+
export interface IDevicePoolWait {
|
|
777
|
+
state: 'wait';
|
|
778
|
+
reason: 'room' | 'provider-429' | 'quiet-unobserved';
|
|
779
|
+
/**
|
|
780
|
+
* Unix milliseconds it takes new work again; absent when its accounts' readings foresee no such moment.
|
|
781
|
+
* @asType integer
|
|
782
|
+
*/
|
|
783
|
+
until?: number;
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* An account pool of the host's inference proxy: its verdict, its room (the headroom of its accounts summed, in
|
|
787
|
+
* percent) and its accounts, by plan and then the most used first. Since protocol 1.3.
|
|
788
|
+
*/
|
|
789
|
+
export interface IDevicePool {
|
|
790
|
+
provider: TDeviceAccountProvider;
|
|
791
|
+
verdict: IDevicePoolOpen | IDevicePoolWait;
|
|
792
|
+
room: number;
|
|
793
|
+
members: IDevicePoolMember[];
|
|
794
|
+
}
|
|
795
|
+
/** The host's account pools. Since protocol 1.3. */
|
|
796
|
+
export interface IDeviceHostPools {
|
|
797
|
+
state: 'ready';
|
|
798
|
+
pools: IDevicePool[];
|
|
799
|
+
}
|
|
800
|
+
/** How a provider's API keys stand against their monthly spend limits, counted. Since protocol 1.3. */
|
|
801
|
+
export interface IDeviceApiKeyGroup {
|
|
802
|
+
provider: TDeviceAccountProvider;
|
|
803
|
+
/**
|
|
804
|
+
* Keys under their limit this month.
|
|
805
|
+
* @asType integer
|
|
806
|
+
*/
|
|
807
|
+
within: number;
|
|
808
|
+
/**
|
|
809
|
+
* Keys at their limit (or with an answer AGL could not price): AGL places nothing on them until the month ends.
|
|
810
|
+
* @asType integer
|
|
811
|
+
*/
|
|
812
|
+
over: number;
|
|
813
|
+
/**
|
|
814
|
+
* Keys without a spend limit.
|
|
815
|
+
* @asType integer
|
|
816
|
+
*/
|
|
817
|
+
unlimited: number;
|
|
818
|
+
/**
|
|
819
|
+
* Keys whose month AGL could not read.
|
|
820
|
+
* @asType integer
|
|
821
|
+
*/
|
|
822
|
+
unread: number;
|
|
823
|
+
/**
|
|
824
|
+
* Unix milliseconds the keys over their limit take work again, at the month's end; absent while none is.
|
|
825
|
+
* @asType integer
|
|
826
|
+
*/
|
|
827
|
+
resetAt?: number;
|
|
828
|
+
}
|
|
829
|
+
/** The host's API keys, per provider that holds any. Since protocol 1.3. */
|
|
830
|
+
export interface IDeviceHostApiKeys {
|
|
831
|
+
state: 'ready';
|
|
832
|
+
groups: IDeviceApiKeyGroup[];
|
|
833
|
+
}
|
|
834
|
+
/** A column of the shared board, in the board's order; `released` and `closed` hold finished work. Since protocol 1.3. */
|
|
835
|
+
export type TDeviceTicketColumn = 'backlog' | 'ready' | 'in_progress' | 'needs_input' | 'review' | 'landed' | 'released' | 'closed';
|
|
836
|
+
/**
|
|
837
|
+
* A label AGL computes from a ticket's state, never set by hand: `openQuestion`, an unanswered question on a ticket that
|
|
838
|
+
* is not done; `planned`, a release plan, a deploy plan or a maintenance window on a ticket that is not done;
|
|
839
|
+
* `undeployed`, released in a version some deploy target of its repositories does not run yet. Since protocol 1.3.
|
|
840
|
+
*/
|
|
841
|
+
export type TDeviceTicketAutoLabel = 'openQuestion' | 'planned' | 'undeployed';
|
|
842
|
+
/** An epic holds tasks, a task subtasks. Since protocol 1.3. */
|
|
843
|
+
export type TDeviceTicketKind = 'epic' | 'task' | 'subtask';
|
|
844
|
+
export type TDeviceTicketPriority = 'none' | 'low' | 'normal' | 'high' | 'urgent';
|
|
845
|
+
/** What a person on a ticket is: the owner, a person, a Claude Code or Codex session, another worker. Since protocol 1.3. */
|
|
846
|
+
export type TDeviceTicketPersonKind = 'owner' | 'person' | 'claude' | 'codex' | 'worker';
|
|
847
|
+
/**
|
|
848
|
+
* Who holds, wrote or asked something on a ticket, by name. The owner is `kind` `owner`, never the owner's account;
|
|
849
|
+
* `sessionId` names the person's session as the session feed does, only while the feed lists it. Since protocol 1.3.
|
|
850
|
+
*/
|
|
851
|
+
export interface IDeviceTicketPerson {
|
|
852
|
+
name: string;
|
|
853
|
+
kind?: TDeviceTicketPersonKind;
|
|
854
|
+
sessionId?: string;
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Whose tickets the board shows: the owner's, nobody's, or those of the session the feed names `sessionId` (as a
|
|
858
|
+
* ticket person's `sessionId` names it). Since protocol 1.3.
|
|
859
|
+
*/
|
|
860
|
+
export type TDeviceAssigneeFilter = {
|
|
861
|
+
kind: 'owner';
|
|
862
|
+
} | {
|
|
863
|
+
kind: 'unassigned';
|
|
864
|
+
} | {
|
|
865
|
+
kind: 'session';
|
|
866
|
+
sessionId: string;
|
|
867
|
+
};
|
|
868
|
+
/** A ticket as the board's card shows it. Since protocol 1.3. */
|
|
869
|
+
export interface IDeviceTicketCard {
|
|
870
|
+
key: string;
|
|
871
|
+
title: string;
|
|
872
|
+
kind: TDeviceTicketKind;
|
|
873
|
+
project: string;
|
|
874
|
+
column: TDeviceTicketColumn;
|
|
875
|
+
priority: TDeviceTicketPriority;
|
|
876
|
+
assignee?: IDeviceTicketPerson;
|
|
877
|
+
labels: string[];
|
|
878
|
+
autoLabels: TDeviceTicketAutoLabel[];
|
|
879
|
+
/** The epic a task belongs to. */
|
|
880
|
+
epic?: IDeviceTicketRef;
|
|
881
|
+
/** @asType integer */
|
|
882
|
+
updatedAt: number;
|
|
883
|
+
}
|
|
884
|
+
/** A column of the board and how many of its tickets the filters let through. Since protocol 1.3. */
|
|
885
|
+
export interface IDeviceBoardColumn {
|
|
886
|
+
id: TDeviceTicketColumn;
|
|
887
|
+
title: string;
|
|
888
|
+
/** It holds finished work; the board folds it. */
|
|
889
|
+
done: boolean;
|
|
890
|
+
/** @asType integer */
|
|
891
|
+
count: number;
|
|
892
|
+
}
|
|
893
|
+
/** Where a ticket came from: the owner's, the driver's or a worker's own words, and who wrote them. Since protocol 1.3. */
|
|
894
|
+
export interface IDeviceTicketSource {
|
|
895
|
+
kind: 'owner_words' | 'driver' | 'worker';
|
|
896
|
+
text: string;
|
|
897
|
+
by: IDeviceTicketPerson;
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Evidence a ticket carries: a branch or a commit it landed as, a release (`v<version>` of a repository, or a package),
|
|
901
|
+
* or the version of a repository a bug was found in (`affects`). Since protocol 1.3.
|
|
902
|
+
*/
|
|
903
|
+
export type TDeviceTicketLink = {
|
|
904
|
+
kind: 'branch';
|
|
905
|
+
repo: string;
|
|
906
|
+
branch: string;
|
|
907
|
+
sha: string;
|
|
908
|
+
} | {
|
|
909
|
+
kind: 'commit';
|
|
910
|
+
repo: string;
|
|
911
|
+
sha: string;
|
|
912
|
+
} | {
|
|
913
|
+
kind: 'release';
|
|
914
|
+
version: string;
|
|
915
|
+
package?: string;
|
|
916
|
+
repo?: string;
|
|
917
|
+
sha?: string;
|
|
918
|
+
} | {
|
|
919
|
+
kind: 'affects';
|
|
920
|
+
repo: string;
|
|
921
|
+
version: string;
|
|
922
|
+
};
|
|
923
|
+
/** A ticket as its detail shows it: the card, its description, where it came from and its evidence. Since protocol 1.3. */
|
|
924
|
+
export interface IDeviceTicket extends IDeviceTicketCard {
|
|
925
|
+
/** Markdown. */
|
|
926
|
+
description: string;
|
|
927
|
+
source: IDeviceTicketSource;
|
|
928
|
+
links: TDeviceTicketLink[];
|
|
929
|
+
/** The epic of a task, the task of a subtask. */
|
|
930
|
+
parent?: IDeviceTicketRef;
|
|
931
|
+
/**
|
|
932
|
+
* Moves with every change of the ticket, its comments and its questions.
|
|
933
|
+
* @asType integer
|
|
934
|
+
*/
|
|
935
|
+
revision: number;
|
|
936
|
+
/** @asType integer */
|
|
937
|
+
createdAt: number;
|
|
938
|
+
}
|
|
939
|
+
/** A part of a comment: text (Markdown), or a reference by id with its label. Since protocol 1.3. */
|
|
940
|
+
export type TDeviceTicketCommentPart = {
|
|
941
|
+
type: 'text';
|
|
942
|
+
text: string;
|
|
943
|
+
} | {
|
|
944
|
+
type: 'reference';
|
|
945
|
+
id: string;
|
|
946
|
+
label: string;
|
|
947
|
+
};
|
|
948
|
+
/** A comment in a ticket's discussion. Since protocol 1.3. */
|
|
949
|
+
export interface IDeviceTicketComment {
|
|
950
|
+
id: string;
|
|
951
|
+
author: IDeviceTicketPerson;
|
|
952
|
+
/** @asType integer */
|
|
953
|
+
createdAt: number;
|
|
954
|
+
body: TDeviceTicketCommentPart[];
|
|
955
|
+
}
|
|
956
|
+
/** A commit a ticket landed as on a repository's main, and the first release that holds it. Since protocol 1.3. */
|
|
957
|
+
export interface IDeviceTicketLanding {
|
|
958
|
+
repo: string;
|
|
959
|
+
sha: string;
|
|
960
|
+
branch?: string;
|
|
961
|
+
/** The first release (`v<version>`) that holds it; absent while none does. */
|
|
962
|
+
fixedIn?: string;
|
|
963
|
+
}
|
|
964
|
+
/** A deploy target of a ticket's repositories: what it runs, and whether that holds the ticket's release. Since protocol 1.3. */
|
|
965
|
+
export interface IDeviceTicketRun {
|
|
966
|
+
target: string;
|
|
967
|
+
name: string;
|
|
968
|
+
environment?: string;
|
|
969
|
+
repo: string;
|
|
970
|
+
/** The version it runs; absent until its probe answered one. */
|
|
971
|
+
version?: string;
|
|
972
|
+
probe: TDeviceDeployProbeState;
|
|
973
|
+
/** It runs a release that holds the ticket's work. */
|
|
974
|
+
runs: boolean;
|
|
975
|
+
/** The release that ships the ticket's work in the target's repository. */
|
|
976
|
+
shippedIn?: string;
|
|
977
|
+
}
|
|
978
|
+
/** Where a ticket's work runs, as the deploy monitor last observed it ("Where it runs"). Since protocol 1.3. */
|
|
979
|
+
export interface IDeviceTicketPlacement {
|
|
980
|
+
state: 'ready';
|
|
981
|
+
landed: IDeviceTicketLanding[];
|
|
982
|
+
runs: IDeviceTicketRun[];
|
|
983
|
+
/** The versions it was found in (its `affects` links). */
|
|
984
|
+
foundIn: {
|
|
985
|
+
repo: string;
|
|
986
|
+
version: string;
|
|
987
|
+
}[];
|
|
988
|
+
}
|
|
989
|
+
/** A maintenance window on a ticket ("Planned"). Since protocol 1.3. */
|
|
990
|
+
export interface IDeviceTicketWindow {
|
|
991
|
+
/** @asType integer */
|
|
992
|
+
from: number;
|
|
993
|
+
/** @asType integer */
|
|
994
|
+
to: number;
|
|
995
|
+
targets: string[];
|
|
996
|
+
/** Where it stands now; absent while the deploy monitor cannot be read and once its ticket is done. */
|
|
997
|
+
state?: 'scheduled' | 'active' | 'done';
|
|
998
|
+
/**
|
|
999
|
+
* The owner's go: `given` (the owner's own window, or one the owner approved), `waiting` (a window the driver proposed,
|
|
1000
|
+
* its question open) or `declined`; absent as `state` is.
|
|
1001
|
+
*/
|
|
1002
|
+
go?: 'given' | 'waiting' | 'declined';
|
|
1003
|
+
}
|
|
1004
|
+
/** A planned deploy on a ticket ("Planned"): the target should run `version` or a newer release. Since protocol 1.3. */
|
|
1005
|
+
export interface IDeviceTicketDeploy {
|
|
1006
|
+
target: string;
|
|
1007
|
+
version: string;
|
|
1008
|
+
/** What the deploy monitor reads besides: absent while it cannot be read and once the ticket is done. */
|
|
1009
|
+
targetName?: string;
|
|
1010
|
+
environment?: string;
|
|
1011
|
+
go?: TDeviceDeployPlanGo;
|
|
1012
|
+
/** `anytime`, `window` (in a maintenance window the owner gave) or `idle` (the AGL controller: no session busy). */
|
|
1013
|
+
deployWhen?: 'anytime' | 'window' | 'idle';
|
|
1014
|
+
/** For the go `window`: the maintenance window it is queued into. */
|
|
1015
|
+
window?: IDeviceTimeSpan;
|
|
1016
|
+
}
|
|
1017
|
+
/** What a ticket plans: a release of a repository (the next one, or `version`), a maintenance window, a deploy. Since 1.3. */
|
|
1018
|
+
export interface IDeviceTicketPlans {
|
|
1019
|
+
release?: {
|
|
1020
|
+
repo: string;
|
|
1021
|
+
version?: string;
|
|
1022
|
+
};
|
|
1023
|
+
window?: IDeviceTicketWindow;
|
|
1024
|
+
deploy?: IDeviceTicketDeploy;
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* A page of a ticket's discussion holds at most `maximum` comments and questions together (`default` when the request
|
|
1028
|
+
* names none) and at most `bytes` of them as JSON, but always one.
|
|
1029
|
+
*/
|
|
1030
|
+
export declare const deviceTicketDiscussionPage: {
|
|
1031
|
+
readonly default: 20;
|
|
1032
|
+
readonly maximum: 50;
|
|
1033
|
+
readonly bytes: number;
|
|
1034
|
+
};
|
|
288
1035
|
/**
|
|
289
1036
|
* The device protocol of this controller. A device speaks one major; minors only add. Unauthenticated
|
|
290
1037
|
* (scope `devicePairing`).
|
|
@@ -415,6 +1162,8 @@ export interface IReq_DevicePermissionReply extends implementsTR<ITypedRequest,
|
|
|
415
1162
|
method: 'device.permission.reply';
|
|
416
1163
|
request: {
|
|
417
1164
|
sessionId: string;
|
|
1165
|
+
/** The direct child (an OpenCode subagent) of the session that asks, as the Inbox names it. Since protocol 1.2. */
|
|
1166
|
+
childSessionId?: string;
|
|
418
1167
|
permissionId: string;
|
|
419
1168
|
reply: 'once' | 'reject';
|
|
420
1169
|
/** Sent along with the answer where the harness takes one (OpenCode). */
|
|
@@ -429,6 +1178,8 @@ export interface IReq_DeviceQuestionReply extends implementsTR<ITypedRequest, IR
|
|
|
429
1178
|
method: 'device.question.reply';
|
|
430
1179
|
request: {
|
|
431
1180
|
sessionId: string;
|
|
1181
|
+
/** The direct child (an OpenCode subagent) of the session that asks, as the Inbox names it. Since protocol 1.2. */
|
|
1182
|
+
childSessionId?: string;
|
|
432
1183
|
questionId: string;
|
|
433
1184
|
answers: string[][] | null;
|
|
434
1185
|
};
|
|
@@ -448,6 +1199,261 @@ export interface IReq_DeviceElicitationReply extends implementsTR<ITypedRequest,
|
|
|
448
1199
|
success: boolean;
|
|
449
1200
|
};
|
|
450
1201
|
}
|
|
1202
|
+
/**
|
|
1203
|
+
* What waits for the owner, in the Inbox's order: the session prompts, then the driver, then go's, then ticket
|
|
1204
|
+
* questions, the oldest first within each kind. `inbox.changed` events keep it current. Scope `device`. Since 1.2.
|
|
1205
|
+
*/
|
|
1206
|
+
export interface IReq_DeviceInboxList extends implementsTR<ITypedRequest, IReq_DeviceInboxList> {
|
|
1207
|
+
method: 'device.inbox.list';
|
|
1208
|
+
request: {};
|
|
1209
|
+
response: {
|
|
1210
|
+
epoch: string;
|
|
1211
|
+
/** @asType integer */
|
|
1212
|
+
revision: number;
|
|
1213
|
+
items: TDeviceInboxItem[];
|
|
1214
|
+
/** @asType integer */
|
|
1215
|
+
total: number;
|
|
1216
|
+
limited: boolean;
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
/**
|
|
1220
|
+
* Answers a ticket question as the owner, also a deploy plan's or a maintenance window's question, whose answer is the
|
|
1221
|
+
* owner's go: option ids from the question (one unless it takes several) and text where it takes text. The identical
|
|
1222
|
+
* answer again is accepted; a different one is refused (`ticket_question_answered`). Scope `device`. Since 1.2.
|
|
1223
|
+
*/
|
|
1224
|
+
export interface IReq_DeviceTicketAnswer extends implementsTR<ITypedRequest, IReq_DeviceTicketAnswer> {
|
|
1225
|
+
method: 'device.ticket.answer';
|
|
1226
|
+
request: {
|
|
1227
|
+
ticketKey: string;
|
|
1228
|
+
questionId: string;
|
|
1229
|
+
choices?: string[];
|
|
1230
|
+
/** At most 16 KiB, not blank. */
|
|
1231
|
+
text?: string;
|
|
1232
|
+
};
|
|
1233
|
+
response: {
|
|
1234
|
+
question: IDeviceTicketQuestion;
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
/** The host's driver now. Scope `device`. Since protocol 1.3. */
|
|
1238
|
+
export interface IReq_DeviceDriverGet extends implementsTR<ITypedRequest, IReq_DeviceDriverGet> {
|
|
1239
|
+
method: 'device.driver.get';
|
|
1240
|
+
request: {};
|
|
1241
|
+
response: {
|
|
1242
|
+
driver: IDeviceDriverStatus;
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* Marks the driver's ended turns seen: the unread count is the owner's, one for every client, so this clears it in the
|
|
1247
|
+
* browser too. Scope `device`. Since protocol 1.3.
|
|
1248
|
+
*/
|
|
1249
|
+
export interface IReq_DeviceDriverSeen extends implementsTR<ITypedRequest, IReq_DeviceDriverSeen> {
|
|
1250
|
+
method: 'device.driver.seen';
|
|
1251
|
+
request: {};
|
|
1252
|
+
response: {
|
|
1253
|
+
driver: IDeviceDriverStatus;
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* A bounded page of the driver's transcript, oldest first, and the driver's own prompts, which a device shows but does
|
|
1258
|
+
* not answer. Paged as `device.session.read`. Refused with `driver_absent` while the host has no driver session. Scope
|
|
1259
|
+
* `device`. Since protocol 1.3.
|
|
1260
|
+
*/
|
|
1261
|
+
export interface IReq_DeviceDriverRead extends implementsTR<ITypedRequest, IReq_DeviceDriverRead> {
|
|
1262
|
+
method: 'device.driver.read';
|
|
1263
|
+
request: {
|
|
1264
|
+
/** The `before` cursor of a newer page; absent for the newest page. */
|
|
1265
|
+
before?: string;
|
|
1266
|
+
/**
|
|
1267
|
+
* Messages of an older page (a read with `before`), 1 to 50 (default 20); the newest page ignores it.
|
|
1268
|
+
* @asType integer
|
|
1269
|
+
*/
|
|
1270
|
+
limit?: number;
|
|
1271
|
+
};
|
|
1272
|
+
response: {
|
|
1273
|
+
driver: IDeviceDriverStatus;
|
|
1274
|
+
messages: IDeviceMessage[];
|
|
1275
|
+
/** The cursor of the next older page; `null` at the first message. */
|
|
1276
|
+
before: string | null;
|
|
1277
|
+
permissions: IDevicePermission[];
|
|
1278
|
+
questions: IDeviceQuestion[];
|
|
1279
|
+
elicitations: TDeviceElicitation[];
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* Sends the driver text as a direct message; it queues behind a running turn. Refused with `driver_absent` while the
|
|
1284
|
+
* host has no driver session: a device never creates one. Scope `device`. Since protocol 1.3.
|
|
1285
|
+
*/
|
|
1286
|
+
export interface IReq_DeviceDriverSend extends implementsTR<ITypedRequest, IReq_DeviceDriverSend> {
|
|
1287
|
+
method: 'device.driver.send';
|
|
1288
|
+
request: {
|
|
1289
|
+
/** At most 64 KiB of UTF-8, not blank. */
|
|
1290
|
+
text: string;
|
|
1291
|
+
};
|
|
1292
|
+
response: {
|
|
1293
|
+
accepted: true;
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
/** The owner's active direct reports, as the Driver view lists them. Scope `device`. Since protocol 1.3. */
|
|
1297
|
+
export interface IReq_DeviceDirectReportsList extends implementsTR<ITypedRequest, IReq_DeviceDirectReportsList> {
|
|
1298
|
+
method: 'device.directreports.list';
|
|
1299
|
+
request: {};
|
|
1300
|
+
response: {
|
|
1301
|
+
reports: IDeviceDirectReport[];
|
|
1302
|
+
};
|
|
1303
|
+
}
|
|
1304
|
+
/**
|
|
1305
|
+
* Sends the active direct report `name` the owner's message, as the Driver view does: a fleet worker is steered
|
|
1306
|
+
* through the report's ticket and the request resolves once the fleet settled the steer (a failed steer is refused with
|
|
1307
|
+
* `direct_report_failed`); a Codex thread takes it as the owner's agent message, steered into the turn AGL runs or else
|
|
1308
|
+
* its next turn. A turn another Codex client runs is refused with `direct_report_busy`, a Claude Code session the
|
|
1309
|
+
* fleet does not run with `direct_report_failed`, and messages to a report faster than its agent message rate with
|
|
1310
|
+
* `rate_limited`. Scope `device`. Since protocol 1.3.
|
|
1311
|
+
*/
|
|
1312
|
+
export interface IReq_DeviceDirectReportMessage extends implementsTR<ITypedRequest, IReq_DeviceDirectReportMessage> {
|
|
1313
|
+
method: 'device.directreport.message';
|
|
1314
|
+
request: {
|
|
1315
|
+
name: string;
|
|
1316
|
+
/** At most 64 KiB of UTF-8 (16 KiB for a Codex thread), not blank. */
|
|
1317
|
+
text: string;
|
|
1318
|
+
};
|
|
1319
|
+
response: {
|
|
1320
|
+
delivery: TDeviceDirectReportDelivery;
|
|
1321
|
+
};
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* The host's status, read-only: the AGL that runs and how a device reaches it, this device, the deploy targets, the
|
|
1325
|
+
* account pools and the API keys. A section that cannot be read answers `unavailable` on its own; the request still
|
|
1326
|
+
* answers the others. Nothing names an account, a key or a dollar amount, and no deploy probe runs for it: a device
|
|
1327
|
+
* changes nothing on the host. `host.changed` says when to read it again. Scope `device`. Since protocol 1.3.
|
|
1328
|
+
*/
|
|
1329
|
+
export interface IReq_DeviceHostGet extends implementsTR<ITypedRequest, IReq_DeviceHostGet> {
|
|
1330
|
+
method: 'device.host.get';
|
|
1331
|
+
request: {};
|
|
1332
|
+
response: {
|
|
1333
|
+
agl: IDeviceHostAgl;
|
|
1334
|
+
device: IDeviceHostDevice;
|
|
1335
|
+
deploys: IDeviceHostDeploys | IDeviceHostUnavailable;
|
|
1336
|
+
pools: IDeviceHostPools | IDeviceHostUnavailable;
|
|
1337
|
+
apiKeys: IDeviceHostApiKeys | IDeviceHostUnavailable;
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1340
|
+
/**
|
|
1341
|
+
* One column of the shared board, as the browser's board shows its cards: the tasks (an epic and its subtasks show on
|
|
1342
|
+
* their task's card in the browser; a device opens them with `device.ticket.get`), in the column's order, `limit` from
|
|
1343
|
+
* `offset` on. The filters are the browser board's: `text` (in the key, title, description and source words),
|
|
1344
|
+
* `project`, `epic` (the epic's own tasks), `assignee` and an AutoLabel `label`. `columns` counts every column under the
|
|
1345
|
+
* same filters, from the same read as the page; `total` is the requested column's count. `projects` are those the
|
|
1346
|
+
* board's tickets name and `epics` the epics a filter may choose: in the chosen project (their own or one of their
|
|
1347
|
+
* tasks'), and the chosen epic. `revision` is the board's: when a later page answers another revision, or
|
|
1348
|
+
* `tickets.changed` arrives, a client reads the board again from offset 0. Scope `device`. Since protocol 1.3.
|
|
1349
|
+
*/
|
|
1350
|
+
export interface IReq_DeviceBoardList extends implementsTR<ITypedRequest, IReq_DeviceBoardList> {
|
|
1351
|
+
method: 'device.board.list';
|
|
1352
|
+
request: {
|
|
1353
|
+
column: TDeviceTicketColumn;
|
|
1354
|
+
/** 1 to 200 characters. */
|
|
1355
|
+
text?: string;
|
|
1356
|
+
project?: string;
|
|
1357
|
+
/** The epic's key. */
|
|
1358
|
+
epic?: string;
|
|
1359
|
+
assignee?: TDeviceAssigneeFilter;
|
|
1360
|
+
label?: TDeviceTicketAutoLabel;
|
|
1361
|
+
/**
|
|
1362
|
+
* Tickets of the column to skip, 0 when absent.
|
|
1363
|
+
* @asType integer
|
|
1364
|
+
*/
|
|
1365
|
+
offset?: number;
|
|
1366
|
+
/**
|
|
1367
|
+
* Tickets on the page, 1 to 100 (default 50).
|
|
1368
|
+
* @asType integer
|
|
1369
|
+
*/
|
|
1370
|
+
limit?: number;
|
|
1371
|
+
};
|
|
1372
|
+
response: {
|
|
1373
|
+
/** @asType integer */
|
|
1374
|
+
revision: number;
|
|
1375
|
+
columns: IDeviceBoardColumn[];
|
|
1376
|
+
tickets: IDeviceTicketCard[];
|
|
1377
|
+
/** @asType integer */
|
|
1378
|
+
total: number;
|
|
1379
|
+
projects: string[];
|
|
1380
|
+
epics: IDeviceTicketRef[];
|
|
1381
|
+
};
|
|
1382
|
+
}
|
|
1383
|
+
/**
|
|
1384
|
+
* A ticket as its detail shows it, with one page of its discussion: the comments and questions written before
|
|
1385
|
+
* `before`, or the newest without it, within `deviceTicketDiscussionPage`, each list oldest first; the page's own
|
|
1386
|
+
* `before` reads the next older one and is `null` at the first. "Where it runs" (`placement`) is read from the deploy
|
|
1387
|
+
* monitor and answers `unavailable` on its own, as a section of `device.host.get` does; `plans` come from the ticket,
|
|
1388
|
+
* with the owner's go and where a window stands while the monitor answers. No history of the ticket's other changes
|
|
1389
|
+
* and no source attachments. Scope `device`. Since protocol 1.3.
|
|
1390
|
+
*/
|
|
1391
|
+
export interface IReq_DeviceTicketGet extends implementsTR<ITypedRequest, IReq_DeviceTicketGet> {
|
|
1392
|
+
method: 'device.ticket.get';
|
|
1393
|
+
request: {
|
|
1394
|
+
ticketKey: string;
|
|
1395
|
+
/** The `before` of a newer page; absent for the newest page. */
|
|
1396
|
+
before?: string;
|
|
1397
|
+
/**
|
|
1398
|
+
* Comments and questions on the page, 1 to 50 (default 20).
|
|
1399
|
+
* @asType integer
|
|
1400
|
+
*/
|
|
1401
|
+
limit?: number;
|
|
1402
|
+
};
|
|
1403
|
+
response: {
|
|
1404
|
+
ticket: IDeviceTicket;
|
|
1405
|
+
questions: IDeviceTicketQuestion[];
|
|
1406
|
+
comments: IDeviceTicketComment[];
|
|
1407
|
+
before: string | null;
|
|
1408
|
+
placement: IDeviceTicketPlacement | IDeviceHostUnavailable;
|
|
1409
|
+
plans: IDeviceTicketPlans;
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1413
|
+
* Comments on a ticket as the owner, as the browser's board does. A refusal changes nothing: the app keeps the draft,
|
|
1414
|
+
* reads the ticket again and shows the reason. Scope `device`. Since protocol 1.3.
|
|
1415
|
+
*/
|
|
1416
|
+
export interface IReq_DeviceTicketComment extends implementsTR<ITypedRequest, IReq_DeviceTicketComment> {
|
|
1417
|
+
method: 'device.ticket.comment';
|
|
1418
|
+
request: {
|
|
1419
|
+
ticketKey: string;
|
|
1420
|
+
/** Markdown, at most 64 KiB of UTF-8, not blank. */
|
|
1421
|
+
text: string;
|
|
1422
|
+
};
|
|
1423
|
+
response: {
|
|
1424
|
+
comment: IDeviceTicketComment;
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
/**
|
|
1428
|
+
* Asks a question on a ticket as the owner, as the browser's board does: text alone, answered with text. A refusal
|
|
1429
|
+
* changes nothing. Scope `device`. Since protocol 1.3.
|
|
1430
|
+
*/
|
|
1431
|
+
export interface IReq_DeviceTicketAsk extends implementsTR<ITypedRequest, IReq_DeviceTicketAsk> {
|
|
1432
|
+
method: 'device.ticket.ask';
|
|
1433
|
+
request: {
|
|
1434
|
+
ticketKey: string;
|
|
1435
|
+
/** Markdown, at most 16 KiB of UTF-8, not blank. */
|
|
1436
|
+
question: string;
|
|
1437
|
+
};
|
|
1438
|
+
response: {
|
|
1439
|
+
question: IDeviceTicketQuestion;
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1442
|
+
/**
|
|
1443
|
+
* Moves a ticket to the end of `column` as the owner ("Move to…", a phone's drag on the browser's board); the column's
|
|
1444
|
+
* rules hold as for the browser (review needs a branch, landed a commit, released a release; landed work is not
|
|
1445
|
+
* closed). A refusal changes nothing. Scope `device`. Since protocol 1.3.
|
|
1446
|
+
*/
|
|
1447
|
+
export interface IReq_DeviceTicketMove extends implementsTR<ITypedRequest, IReq_DeviceTicketMove> {
|
|
1448
|
+
method: 'device.ticket.move';
|
|
1449
|
+
request: {
|
|
1450
|
+
ticketKey: string;
|
|
1451
|
+
column: TDeviceTicketColumn;
|
|
1452
|
+
};
|
|
1453
|
+
response: {
|
|
1454
|
+
ticket: IDeviceTicketCard;
|
|
1455
|
+
};
|
|
1456
|
+
}
|
|
451
1457
|
/** An event, sent by the controller to an authenticated device connection. */
|
|
452
1458
|
export interface IReq_DeviceEventPush extends implementsTR<ITypedRequest, IReq_DeviceEventPush> {
|
|
453
1459
|
method: 'device.event';
|
|
@@ -458,4 +1464,5 @@ export interface IReq_DeviceEventPush extends implementsTR<ITypedRequest, IReq_D
|
|
|
458
1464
|
}
|
|
459
1465
|
/** Every device method, by the scope that admits it. */
|
|
460
1466
|
export declare const devicePairingMethods: readonly ['device.hello', 'device.pair', 'device.auth.challenge', 'device.auth.prove'];
|
|
461
|
-
export declare const deviceMethods: readonly ['device.sessions.list', 'device.session.read', 'device.session.send', 'device.permission.reply', 'device.question.reply', 'device.elicitation.reply'];
|
|
1467
|
+
export declare const deviceMethods: readonly ['device.sessions.list', 'device.session.read', 'device.session.send', 'device.permission.reply', 'device.question.reply', 'device.elicitation.reply', 'device.inbox.list', 'device.ticket.answer', 'device.driver.get', 'device.driver.seen', 'device.driver.read', 'device.driver.send', 'device.directreports.list', 'device.directreport.message', 'device.host.get', 'device.board.list', 'device.ticket.get', 'device.ticket.comment', 'device.ticket.ask', 'device.ticket.move'];
|
|
1468
|
+
export {};
|