@skrr-ai/cli 0.1.86 → 0.1.88
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/bin/run.js +11 -0
- package/dist/base-command.js +1 -0
- package/dist/commands/agents/chat.d.ts +58 -1
- package/dist/commands/agents/chat.js +206 -4
- package/dist/commands/computer/index.d.ts +19 -0
- package/dist/commands/computer/index.js +37 -0
- package/dist/commands/labels/create.d.ts +1 -0
- package/dist/commands/labels/create.js +2 -0
- package/dist/commands/labels/restore.d.ts +1 -0
- package/dist/commands/labels/restore.js +6 -3
- package/dist/commands/labels/update.d.ts +1 -0
- package/dist/commands/labels/update.js +2 -0
- package/dist/commands/machines/computer-adoption.d.ts +15 -0
- package/dist/commands/machines/computer-adoption.js +33 -0
- package/dist/commands/machines/dedicated/archive.d.ts +26 -0
- package/dist/commands/machines/dedicated/archive.js +113 -0
- package/dist/commands/machines/dedicated/audit.d.ts +25 -0
- package/dist/commands/machines/dedicated/audit.js +113 -0
- package/dist/commands/machines/dedicated/computer.d.ts +23 -0
- package/dist/commands/machines/dedicated/computer.js +64 -0
- package/dist/commands/machines/dedicated/cp.d.ts +2 -0
- package/dist/commands/machines/dedicated/cp.js +74 -2
- package/dist/commands/machines/dedicated/git-status.d.ts +15 -0
- package/dist/commands/machines/dedicated/git-status.js +56 -0
- package/dist/commands/machines/dedicated/index.js +15 -1
- package/dist/commands/machines/dedicated/ls.d.ts +27 -0
- package/dist/commands/machines/dedicated/ls.js +100 -0
- package/dist/commands/machines/dedicated/mkdir.d.ts +18 -0
- package/dist/commands/machines/dedicated/mkdir.js +57 -0
- package/dist/commands/machines/dedicated/mv.d.ts +24 -0
- package/dist/commands/machines/dedicated/mv.js +83 -0
- package/dist/commands/machines/dedicated/rm.d.ts +26 -0
- package/dist/commands/machines/dedicated/rm.js +100 -0
- package/dist/commands/machines/dedicated/search.d.ts +24 -0
- package/dist/commands/machines/dedicated/search.js +78 -0
- package/dist/commands/machines/dedicated/stat.d.ts +22 -0
- package/dist/commands/machines/dedicated/stat.js +92 -0
- package/dist/commands/machines/hosted/index.js +1 -1
- package/dist/commands/machines/hosted/list.js +1 -1
- package/dist/commands/machines/hosted/start.js +1 -1
- package/dist/commands/machines/services/declare.d.ts +24 -0
- package/dist/commands/machines/services/declare.js +73 -0
- package/dist/commands/machines/services/index.d.ts +15 -0
- package/dist/commands/machines/services/index.js +31 -0
- package/dist/commands/machines/services/ls.d.ts +17 -0
- package/dist/commands/machines/services/ls.js +60 -0
- package/dist/commands/machines/services/withdraw.d.ts +19 -0
- package/dist/commands/machines/services/withdraw.js +47 -0
- package/dist/commands/machines/share.d.ts +29 -0
- package/dist/commands/machines/share.js +100 -0
- package/dist/commands/machines/shared.d.ts +19 -0
- package/dist/commands/machines/shared.js +62 -0
- package/dist/commands/machines/shares.d.ts +16 -0
- package/dist/commands/machines/shares.js +69 -0
- package/dist/commands/machines/unshare.d.ts +19 -0
- package/dist/commands/machines/unshare.js +61 -0
- package/dist/commands/tasks/labels/create.d.ts +1 -0
- package/dist/commands/tasks/labels/create.js +3 -0
- package/dist/commands/views/create.d.ts +1 -0
- package/dist/commands/views/create.js +5 -0
- package/dist/lib/agent-home-workspace.d.ts +26 -0
- package/dist/lib/agent-home-workspace.js +174 -0
- package/dist/lib/agentic-stream.d.ts +135 -0
- package/dist/lib/agentic-stream.js +341 -6
- package/dist/lib/auth-storage.d.ts +4 -0
- package/dist/lib/auth-storage.js +33 -0
- package/dist/lib/computer-adoption.d.ts +55 -0
- package/dist/lib/computer-adoption.js +67 -0
- package/dist/lib/computer-consent.d.ts +13 -0
- package/dist/lib/computer-consent.js +33 -0
- package/dist/lib/computer-files.d.ts +239 -0
- package/dist/lib/computer-files.js +707 -0
- package/dist/lib/dedicated-copy.d.ts +45 -9
- package/dist/lib/dedicated-copy.js +141 -44
- package/dist/lib/dedicated-machines.d.ts +49 -0
- package/dist/lib/dedicated-machines.js +97 -6
- package/dist/lib/keychain.d.ts +1 -0
- package/dist/lib/keychain.js +67 -14
- package/dist/lib/label-scope.d.ts +12 -0
- package/dist/lib/label-scope.js +15 -1
- package/dist/lib/machine-audit.d.ts +34 -0
- package/dist/lib/machine-audit.js +50 -0
- package/dist/lib/machine-grants.d.ts +70 -0
- package/dist/lib/machine-grants.js +47 -0
- package/dist/lib/machine-services.d.ts +64 -0
- package/dist/lib/machine-services.js +60 -0
- package/dist/lib/refresh.d.ts +7 -0
- package/dist/lib/refresh.js +2 -1
- package/dist/lib/task-view-render.d.ts +2 -0
- package/dist/lib/task-view-render.js +1 -1
- package/dist/lib/views/vocabulary.d.ts +1 -1
- package/dist/lib/views/vocabulary.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +955 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +1070 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +7 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +955 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +1051 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +7 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +22143 -20728
- package/dist/node_modules/@skrr-ai/data-provider/package.json +1 -1
- package/oclif.manifest.json +18855 -17260
- package/package.json +2 -2
|
@@ -0,0 +1,955 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* computerWire.ts — the ONE declaration of every name the computer protocol
|
|
3
|
+
* puts on the wire, and the pure rules the daemon applies to them (design
|
|
4
|
+
* docs/architecture/dedicated-runtime-computer-2026-10-01.md §4, §7.1).
|
|
5
|
+
*
|
|
6
|
+
* The daemon is published and cannot depend on `@skrr-ai/data-provider`, which
|
|
7
|
+
* is private. Without this module it would declare its own copy of the event
|
|
8
|
+
* names and refusal codes, and two hand-typed copies of a wire contract drift
|
|
9
|
+
* in exactly the way neither copy's tests can see (OSK-8588). So the names live
|
|
10
|
+
* here, in the published package, the way `firstPartyHarness.ts` does for the
|
|
11
|
+
* harness; `@skrr-ai/data-provider` re-exports this module and builds its zod
|
|
12
|
+
* schemas over these constants (`z.enum(COMPUTER_REFUSAL_CODES)`), so each name
|
|
13
|
+
* is still declared exactly once. `packages/data-provider/specs/computerWireBoundary.spec.ts`
|
|
14
|
+
* fails on a `computer:*` event name or a refusal-code table declared anywhere
|
|
15
|
+
* else.
|
|
16
|
+
*
|
|
17
|
+
* Pure TypeScript: no zod, no Node-only imports, so the browser, React Native
|
|
18
|
+
* and a bun-compiled daemon all load it. Most payload SHAPES are not here — they
|
|
19
|
+
* are zod schemas in data-provider; the daemon re-validates every field it
|
|
20
|
+
* reads. The exceptions are shapes the DAEMON produces and the API re-validates
|
|
21
|
+
* (activity details, the browser key input): those are declared here as plain
|
|
22
|
+
* interfaces, and data-provider's zod schemas are checked against them at
|
|
23
|
+
* compile time, because a producer and a validator that each spell the shape
|
|
24
|
+
* dropped every command event for a release (OSK-13605).
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Client ⇄ API, on the existing `/ws/agentic` socket. A request the client
|
|
28
|
+
* needs answered is acknowledged through the Socket.IO acknowledgement
|
|
29
|
+
* callback.
|
|
30
|
+
*/
|
|
31
|
+
export declare const COMPUTER_EVENTS: {
|
|
32
|
+
/** client → API: attach to a machine. */
|
|
33
|
+
readonly attach: "computer:attach";
|
|
34
|
+
/** client → API: leave. */
|
|
35
|
+
readonly detach: "computer:detach";
|
|
36
|
+
/** API → client: this attachment was detached, with the reason (revoked, stale generation, …). */
|
|
37
|
+
readonly detached: "computer:detached";
|
|
38
|
+
/** API → client: a whole manifest, or a revisioned delta. */
|
|
39
|
+
readonly manifest: "computer:manifest";
|
|
40
|
+
/** client → API: observe one surface. */
|
|
41
|
+
readonly subscribe: "computer:surface:subscribe";
|
|
42
|
+
/** client → API: stop observing one surface. */
|
|
43
|
+
readonly unsubscribe: "computer:surface:unsubscribe";
|
|
44
|
+
/** API → client: terminal bytes with a byte cursor, or a page frame. */
|
|
45
|
+
readonly data: "computer:surface:data";
|
|
46
|
+
/**
|
|
47
|
+
* client → API: this viewer painted the page frame `seq` and wants the next.
|
|
48
|
+
* A viewer's slot is latest-wins: until it acknowledges, newer frames
|
|
49
|
+
* replace the one waiting for it and nothing queues (§6.2, §7.2 R3).
|
|
50
|
+
* Never acknowledged.
|
|
51
|
+
*/
|
|
52
|
+
readonly frameAck: "computer:surface:frame:ack";
|
|
53
|
+
/** client → API: take / release / request / grant / decline. */
|
|
54
|
+
readonly control: "computer:surface:control";
|
|
55
|
+
/** client → API: share or unshare one of the person's own surfaces with an agent session. */
|
|
56
|
+
readonly share: "computer:surface:share";
|
|
57
|
+
/** client → API: one input, carrying the lease epoch. Never acknowledged. */
|
|
58
|
+
readonly input: "computer:surface:input";
|
|
59
|
+
/** client → API: open a person's own terminal or browser window. */
|
|
60
|
+
readonly open: "computer:surface:open";
|
|
61
|
+
/** client → API: close a surface. */
|
|
62
|
+
readonly close: "computer:surface:close";
|
|
63
|
+
/** API → client: activity events. */
|
|
64
|
+
readonly activity: "computer:activity";
|
|
65
|
+
/** client → API: the activity events after a `seq`, to fill a gap. */
|
|
66
|
+
readonly activityFill: "computer:activity:fill";
|
|
67
|
+
/** client → API: the directories expanded and files open, which scope the file watches. */
|
|
68
|
+
readonly filesWatch: "computer:files:watch";
|
|
69
|
+
/**
|
|
70
|
+
* API → client: what this attachment's scoped watches saw — paths and kinds,
|
|
71
|
+
* never contents — or that they went stale and the tree must be refreshed
|
|
72
|
+
* (§6.3 layer 2). Needs `computer_files_watch_v1`.
|
|
73
|
+
*/
|
|
74
|
+
readonly filesChanged: "computer:files:changed";
|
|
75
|
+
/**
|
|
76
|
+
* client → API: answer a dialog the page is blocked on. Only the attachment
|
|
77
|
+
* holding the browser's lease, at the current epoch. Needs
|
|
78
|
+
* `computer_browser_page_v1`.
|
|
79
|
+
*/
|
|
80
|
+
readonly dialog: "computer:surface:dialog";
|
|
81
|
+
/**
|
|
82
|
+
* client → API: copy-out — the text the person selected on the page, answered
|
|
83
|
+
* to the asking attachment alone and only while it holds the lease at the
|
|
84
|
+
* current epoch. Needs `computer_browser_page_v1`.
|
|
85
|
+
*/
|
|
86
|
+
readonly copy: "computer:surface:copy";
|
|
87
|
+
/**
|
|
88
|
+
* client → API: answer the file chooser a page opened (§6.2 "a file chooser
|
|
89
|
+
* opens a picker over the computer's files, or a local upload"): paths on the
|
|
90
|
+
* computer, or none to cancel. Only the attachment holding the browser's
|
|
91
|
+
* lease, at the current epoch; the paths are read as the file surface reads
|
|
92
|
+
* them. Needs `computer_browser_file_chooser_v1`.
|
|
93
|
+
*/
|
|
94
|
+
readonly fileChooser: "computer:surface:filechooser";
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* API ⇄ daemon. The daemon transports (Socket.IO and SSE) carry no
|
|
98
|
+
* acknowledgement callback, so a request the API needs answered carries a
|
|
99
|
+
* `requestId` and the daemon answers with `daemon:computer:ack`.
|
|
100
|
+
*/
|
|
101
|
+
export declare const DAEMON_COMPUTER_EVENTS: {
|
|
102
|
+
/** Bind an attachment: its principal, operations and (dedicated) generation. */
|
|
103
|
+
readonly attach: "daemon:computer:attach";
|
|
104
|
+
readonly detach: "daemon:computer:detach";
|
|
105
|
+
/** The machine's grant set, whole, on registration and on every change. */
|
|
106
|
+
readonly grants: "daemon:computer:grants";
|
|
107
|
+
readonly subscribe: "daemon:computer:surface:subscribe";
|
|
108
|
+
readonly unsubscribe: "daemon:computer:surface:unsubscribe";
|
|
109
|
+
readonly frameAck: "daemon:computer:surface:frame:ack";
|
|
110
|
+
readonly control: "daemon:computer:surface:control";
|
|
111
|
+
readonly share: "daemon:computer:surface:share";
|
|
112
|
+
readonly input: "daemon:computer:surface:input";
|
|
113
|
+
readonly open: "daemon:computer:surface:open";
|
|
114
|
+
readonly close: "daemon:computer:surface:close";
|
|
115
|
+
readonly activityFill: "daemon:computer:activity:fill";
|
|
116
|
+
readonly filesWatch: "daemon:computer:files:watch";
|
|
117
|
+
/** One file operation, relayed from `/api/machines/:machineId/files/<op>`. */
|
|
118
|
+
readonly files: "daemon:computer:files";
|
|
119
|
+
readonly dialog: "daemon:computer:surface:dialog";
|
|
120
|
+
readonly copy: "daemon:computer:surface:copy";
|
|
121
|
+
readonly fileChooser: "daemon:computer:surface:filechooser";
|
|
122
|
+
/**
|
|
123
|
+
* Pin or unpin the surface an open human-input request names (§8): a pinned
|
|
124
|
+
* surface is not reclaimed by idle or wall-clock expiry. Fire-and-forget,
|
|
125
|
+
* idempotent on the pin id, bounded by its own `until`. Needs
|
|
126
|
+
* `computer_surface_pin_v1`.
|
|
127
|
+
*/
|
|
128
|
+
readonly pin: "daemon:computer:surface:pin";
|
|
129
|
+
/**
|
|
130
|
+
* Declare, withdraw or list the machine's declared services (§20.5): a web
|
|
131
|
+
* service someone started on the machine, named and opened in the
|
|
132
|
+
* computer's own browser. Carries a `requestId`, the principal the API
|
|
133
|
+
* authorized and, for a declaration, who declared it; the daemon checks the
|
|
134
|
+
* principal against the grant set it holds. Needs
|
|
135
|
+
* `computer_declared_services_v1`.
|
|
136
|
+
*/
|
|
137
|
+
readonly services: "daemon:computer:services";
|
|
138
|
+
/** The answer to any request that carried a `requestId`. */
|
|
139
|
+
readonly ack: "daemon:computer:ack";
|
|
140
|
+
readonly manifest: "daemon:computer:manifest";
|
|
141
|
+
readonly data: "daemon:computer:surface:data";
|
|
142
|
+
readonly activity: "daemon:computer:activity";
|
|
143
|
+
/** The daemon detached an attachment itself, e.g. its grant was revoked. */
|
|
144
|
+
readonly detached: "daemon:computer:detached";
|
|
145
|
+
/** One attachment's scoped watches saw changes, or went stale (§6.3). */
|
|
146
|
+
readonly filesChanged: "daemon:computer:files:changed";
|
|
147
|
+
/**
|
|
148
|
+
* The daemon's own frame-lane counters (§7.2, OSK-13616), every
|
|
149
|
+
* `COMPUTER_DIAGNOSTICS_INTERVAL_MS` while anyone is attached: counters and
|
|
150
|
+
* per-viewer timestamps from a closed vocabulary, never content. Needs
|
|
151
|
+
* `computer_diagnostics_v1`. Fire-and-forget; a lost report is the next one.
|
|
152
|
+
*/
|
|
153
|
+
readonly diagnostics: "daemon:computer:diagnostics";
|
|
154
|
+
};
|
|
155
|
+
export type ComputerEventKey = keyof typeof COMPUTER_EVENTS;
|
|
156
|
+
export type ComputerEventName = (typeof COMPUTER_EVENTS)[ComputerEventKey];
|
|
157
|
+
export type DaemonComputerEventKey = keyof typeof DAEMON_COMPUTER_EVENTS;
|
|
158
|
+
export type DaemonComputerEventName = (typeof DAEMON_COMPUTER_EVENTS)[DaemonComputerEventKey];
|
|
159
|
+
export declare const COMPUTER_EVENT_NAMES: readonly ComputerEventName[];
|
|
160
|
+
export declare const DAEMON_COMPUTER_EVENT_NAMES: readonly DaemonComputerEventName[];
|
|
161
|
+
/** The daemon → API events; every other `daemon:computer:*` event flows API → daemon. */
|
|
162
|
+
export declare const DAEMON_COMPUTER_REPORT_EVENT_KEYS: readonly ["ack", "manifest", "data", "activity", "detached", "filesChanged", "diagnostics"];
|
|
163
|
+
/** The API → client events; every other `computer:*` event flows client → API. */
|
|
164
|
+
export declare const COMPUTER_SERVER_EVENT_KEYS: readonly ["detached", "manifest", "data", "activity", "filesChanged"];
|
|
165
|
+
/**
|
|
166
|
+
* One capability per wire addition, each withheld positively at dispatch: the
|
|
167
|
+
* API never sends a computer event to a daemon that did not announce the
|
|
168
|
+
* capability that event belongs to. Activity is part of `computer_v1`.
|
|
169
|
+
*/
|
|
170
|
+
export declare const COMPUTER_CAPABILITIES: {
|
|
171
|
+
/** Manifest, surfaces, control leases, terminal surfaces, activity core. */
|
|
172
|
+
readonly computer: "computer_v1";
|
|
173
|
+
/** The grant set and the daemon's own check of every attachment against it (§9). */
|
|
174
|
+
readonly access: "computer_access_v1";
|
|
175
|
+
/** The file surface: `daemon:computer:files` and `computer:files:watch` (§6.3). */
|
|
176
|
+
readonly files: "computer_files_v1";
|
|
177
|
+
/**
|
|
178
|
+
* Filename and content search and git status decorations over the tenant
|
|
179
|
+
* roots, as the workload (§6.3 "Later, same contract"): the `FileSearch` and
|
|
180
|
+
* `FileGitStatus` tools. A daemon without it is never asked.
|
|
181
|
+
*/
|
|
182
|
+
readonly filesSearch: "computer_files_search_v1";
|
|
183
|
+
/**
|
|
184
|
+
* File mutations fenced on what the person saw (review CW-01, CW-02 and the
|
|
185
|
+
* folder-delete finding): an upload commits create-only (`exists` when the
|
|
186
|
+
* name was claimed) or over exactly the version chosen to be replaced
|
|
187
|
+
* (`replaceTag`, else `file_changed`); a committed transfer leaves a receipt,
|
|
188
|
+
* so a resume after a lost final acknowledgement answers "already
|
|
189
|
+
* committed"; and `stat` with `contents: true` gives a folder a contents tag that
|
|
190
|
+
* a recursive delete presents. A daemon without it would ignore those
|
|
191
|
+
* conditions, so the API refuses them `capability_missing` instead of
|
|
192
|
+
* sending them.
|
|
193
|
+
*/
|
|
194
|
+
readonly filesFenced: "computer_files_fenced_v1";
|
|
195
|
+
/** Observe attachments on a browser surface, separate from control (§6.2). */
|
|
196
|
+
readonly browserObserve: "computer_browser_observe_v1";
|
|
197
|
+
/** A browser surface's tab strip and tab input (§6.2). */
|
|
198
|
+
readonly browserTabs: "computer_browser_tabs_v1";
|
|
199
|
+
/**
|
|
200
|
+
* The rest of a real browser on a browser surface (§6.2): its pending
|
|
201
|
+
* dialogs and its downloads on the descriptor, answering a dialog
|
|
202
|
+
* (`computer:surface:dialog`) and copy-out (`computer:surface:copy`).
|
|
203
|
+
* Permission prompts are not part of it: Chromium exposes no CDP event for
|
|
204
|
+
* them (headless refuses them), so no surface may claim to show one.
|
|
205
|
+
*/
|
|
206
|
+
readonly browserPage: "computer_browser_page_v1";
|
|
207
|
+
/** Sharing a person's own surface with an agent session (§5.4). */
|
|
208
|
+
readonly surfaceShare: "computer_surface_share_v1";
|
|
209
|
+
/** Pinning a surface an open human-input request names: `daemon:computer:surface:pin` (§8). */
|
|
210
|
+
readonly surfacePin: "computer_surface_pin_v1";
|
|
211
|
+
/**
|
|
212
|
+
* "Reset browser" — sign out everywhere (§6.2, OSK-13499): the
|
|
213
|
+
* `reset_browser` control action on a browser surface. Announced only by a
|
|
214
|
+
* daemon whose browser keeps one profile across sessions (a Dedicated
|
|
215
|
+
* Runtime guest); a personal machine's browser keeps nothing to reset.
|
|
216
|
+
*/
|
|
217
|
+
readonly browserReset: "computer_browser_reset_v1";
|
|
218
|
+
/**
|
|
219
|
+
* Scoped file watches (§6.3 layer 2): `computer:files:watch` is served and
|
|
220
|
+
* `computer:files:changed` reports. Announced only where the daemon runs a
|
|
221
|
+
* watcher it can stand behind; without it the file tree says it does not
|
|
222
|
+
* update by itself and offers a refresh.
|
|
223
|
+
*/
|
|
224
|
+
readonly filesWatch: "computer_files_watch_v1";
|
|
225
|
+
/**
|
|
226
|
+
* The file chooser a page opens while a person holds the browser (§6.2,
|
|
227
|
+
* OSK-13481): the pending chooser on the descriptor (`fileChooser`) and
|
|
228
|
+
* answering it with files on the computer (`computer:surface:file-chooser`).
|
|
229
|
+
* Announced only by a daemon whose browser intercepts the chooser.
|
|
230
|
+
*/
|
|
231
|
+
readonly browserFileChooser: "computer_browser_file_chooser_v1";
|
|
232
|
+
/**
|
|
233
|
+
* A person's own terminal opens in a folder (§6.3 "Open a terminal here",
|
|
234
|
+
* OSK-13615): `computer:surface:open` carries `cwd`, which the daemon checks
|
|
235
|
+
* the way the file surface would (the tenant roots as the workload; on a
|
|
236
|
+
* personal machine the deny set, `blockedPaths` and home) and refuses typed
|
|
237
|
+
* when it may not. Without it the client types `cd` once it holds control.
|
|
238
|
+
*/
|
|
239
|
+
readonly terminalCwd: "computer_terminal_cwd_v1";
|
|
240
|
+
/**
|
|
241
|
+
* A run in an agent's interactive shell (`terminal.run`, tool `Terminal`)
|
|
242
|
+
* says where in its terminal's byte stream it began: `streamOffset` on its
|
|
243
|
+
* `command` activity, the terminal lane's cursor at that moment (§6.1, task
|
|
244
|
+
* 5-04b, OSK-13614). A client places such a block inline at that point of
|
|
245
|
+
* the terminal; without the capability it keeps every block in the list
|
|
246
|
+
* below the terminal, as before.
|
|
247
|
+
*/
|
|
248
|
+
readonly terminalCommandOffset: "computer_terminal_command_offset_v1";
|
|
249
|
+
/**
|
|
250
|
+
* The daemon reports its frame-lane counters (`daemon:computer:diagnostics`,
|
|
251
|
+
* OSK-13616), so the API's own logs can tell "the daemon stopped sending"
|
|
252
|
+
* from "the page did not change". Announced by the relay that sends them;
|
|
253
|
+
* the API asks nothing of a daemon without it, and reads its silence as
|
|
254
|
+
* "unreported", never as healthy.
|
|
255
|
+
*/
|
|
256
|
+
readonly diagnostics: "computer_diagnostics_v1";
|
|
257
|
+
/**
|
|
258
|
+
* Declared services (§20.5, 9-17, OSK-13579): the manifest carries
|
|
259
|
+
* `services`, the web services an agent or a person declared on this
|
|
260
|
+
* machine, and `daemon:computer:services` (and the agent's
|
|
261
|
+
* `computer.services` tool call) declares, withdraws and lists them. A
|
|
262
|
+
* service is a localhost port on the machine, opened in the computer's own
|
|
263
|
+
* browser; nothing is proxied to it. Announced by the relay that serves it.
|
|
264
|
+
*/
|
|
265
|
+
readonly declaredServices: "computer_declared_services_v1";
|
|
266
|
+
};
|
|
267
|
+
export type ComputerCapabilityKey = keyof typeof COMPUTER_CAPABILITIES;
|
|
268
|
+
export type ComputerCapability = (typeof COMPUTER_CAPABILITIES)[ComputerCapabilityKey];
|
|
269
|
+
export declare const COMPUTER_CAPABILITY_VALUES: [ComputerCapability, ...ComputerCapability[]];
|
|
270
|
+
/**
|
|
271
|
+
* Every refusal and limit the computer protocol can answer with. Callers branch
|
|
272
|
+
* on the code; a message beside it is free text and may change.
|
|
273
|
+
*/
|
|
274
|
+
export declare const COMPUTER_REFUSAL_CODES: readonly ["human_control", "stale_epoch", "stale_generation", "file_changed", "capability_missing", "unauthorized", "control_denied", "not_holder", "attachment_limit", "observer_limit", "watch_limit", "grant_limit", "browser_limit", "rate_limited", "not_found", "surface_ended", "machine_unavailable", "daemon_unreachable", "timeout", "invalid_request", "consent_missing", "path_withheld", "too_large", "service_limit"];
|
|
275
|
+
export type ComputerRefusalCode = (typeof COMPUTER_REFUSAL_CODES)[number];
|
|
276
|
+
/**
|
|
277
|
+
* Older spellings the daemon boundary accepts for one release (§5.2). After
|
|
278
|
+
* that release this map is emptied, and nothing else names the old spelling.
|
|
279
|
+
*/
|
|
280
|
+
export declare const COMPUTER_LEGACY_REFUSAL_SPELLINGS: Readonly<Record<string, ComputerRefusalCode>>;
|
|
281
|
+
/** The canonical code for a received spelling, or `null` when it is not a computer refusal. */
|
|
282
|
+
export declare function normalizeComputerRefusalCode(code: unknown): ComputerRefusalCode | null;
|
|
283
|
+
export declare const COMPUTER_ACTOR_KINDS: readonly ["agent", "human"];
|
|
284
|
+
export type ComputerActorKind = (typeof COMPUTER_ACTOR_KINDS)[number];
|
|
285
|
+
/**
|
|
286
|
+
* Who an activity event is attributed to. `system` is what happened with no
|
|
287
|
+
* actor behind it — a process exited, the machine stopped — and appears ONLY
|
|
288
|
+
* on activity: it never holds a lease, is never present, is never audited as
|
|
289
|
+
* an actor. Without it on the wire every lifecycle event was dropped by the
|
|
290
|
+
* API and a client saw a `seq` hole no fill could close.
|
|
291
|
+
*/
|
|
292
|
+
export declare const COMPUTER_ACTIVITY_ACTOR_KINDS: readonly ["agent", "human", "system"];
|
|
293
|
+
export type ComputerActivityActorKind = (typeof COMPUTER_ACTIVITY_ACTOR_KINDS)[number];
|
|
294
|
+
/** An agent session, as the wire names it. Same session = same `agentId` AND `sessionId`. */
|
|
295
|
+
export interface ComputerWireAgentActor {
|
|
296
|
+
kind: 'agent';
|
|
297
|
+
agentId: string;
|
|
298
|
+
sessionId: string;
|
|
299
|
+
label: string;
|
|
300
|
+
}
|
|
301
|
+
export interface ComputerWireHumanActor {
|
|
302
|
+
kind: 'human';
|
|
303
|
+
userId: string;
|
|
304
|
+
label: string;
|
|
305
|
+
}
|
|
306
|
+
/** Activity only (see `COMPUTER_ACTIVITY_ACTOR_KINDS`). */
|
|
307
|
+
export interface ComputerWireSystemActor {
|
|
308
|
+
kind: 'system';
|
|
309
|
+
label: string;
|
|
310
|
+
}
|
|
311
|
+
/** Who can hold a lease or be present. */
|
|
312
|
+
export type ComputerWireActor = ComputerWireAgentActor | ComputerWireHumanActor;
|
|
313
|
+
/** Who an activity event is attributed to. */
|
|
314
|
+
export type ComputerWireActivityActor = ComputerWireActor | ComputerWireSystemActor;
|
|
315
|
+
/**
|
|
316
|
+
* How a person present on the machine reached it: as its owner, or through a
|
|
317
|
+
* grant at one of the two tiers. Agents carry no access level — an agent
|
|
318
|
+
* session acts with its own run's authority, not a grant.
|
|
319
|
+
*/
|
|
320
|
+
export declare const COMPUTER_ACCESS_LEVELS: readonly ["owner", "watch", "operate"];
|
|
321
|
+
export type ComputerAccessLevel = (typeof COMPUTER_ACCESS_LEVELS)[number];
|
|
322
|
+
/**
|
|
323
|
+
* What a principal may do on a computer. Kept separate so a refusal says
|
|
324
|
+
* exactly what was refused. `power`, closing other people's surfaces and
|
|
325
|
+
* managing grants stay with the owner; no tier contains `power`.
|
|
326
|
+
*/
|
|
327
|
+
export declare const COMPUTER_OPERATIONS: readonly ["observe", "control", "files.read", "files.write", "open", "power"];
|
|
328
|
+
export type ComputerOperation = (typeof COMPUTER_OPERATIONS)[number];
|
|
329
|
+
/** A grant is one of two fixed tiers: a finer grant cannot be enforced on a shell. */
|
|
330
|
+
export declare const COMPUTER_GRANT_TIERS: readonly ["watch", "operate"];
|
|
331
|
+
export type ComputerGrantTier = (typeof COMPUTER_GRANT_TIERS)[number];
|
|
332
|
+
/** The fixed set of operations a grant tier carries. */
|
|
333
|
+
export declare function computerTierOperations(tier: ComputerGrantTier): readonly ComputerOperation[];
|
|
334
|
+
/** Whether a grant tier carries `operation`. */
|
|
335
|
+
export declare function computerOperationAllowed(tier: ComputerGrantTier, operation: ComputerOperation): boolean;
|
|
336
|
+
/** The operations an access level carries: the owner holds every one. */
|
|
337
|
+
export declare function computerAccessOperations(level: ComputerAccessLevel): readonly ComputerOperation[];
|
|
338
|
+
/** A person releasing control may leave a note for the agent (§8). */
|
|
339
|
+
export declare const COMPUTER_HANDBACK_NOTE_MAX_LENGTH = 2000;
|
|
340
|
+
/** A person holding control is released after this long without human input (§5.1 rule 4). */
|
|
341
|
+
export declare const COMPUTER_CONTROL_IDLE_MS: number;
|
|
342
|
+
/** How long before idle reclaim of a person's hold the daemon says it is coming (§8). */
|
|
343
|
+
export declare const COMPUTER_RECLAIM_WARNING_MS: number;
|
|
344
|
+
/** A transport blip shorter than this changes no lease (§7.2 R6). */
|
|
345
|
+
export declare const COMPUTER_RECONNECT_GRACE_MS: number;
|
|
346
|
+
/** An agent terminal write waits this long for a person to hand back before refusing (§5.2). */
|
|
347
|
+
export declare const COMPUTER_AGENT_WRITE_WAIT_MS: number;
|
|
348
|
+
/** What a person can do to a surface's lease (§5.1, §5.3). */
|
|
349
|
+
export declare const COMPUTER_CONTROL_ACTIONS: readonly ["take", "release", "request", "grant", "decline", "reveal", "reset_browser"];
|
|
350
|
+
export type ComputerControlAction = (typeof COMPUTER_CONTROL_ACTIONS)[number];
|
|
351
|
+
/** Sharing one of a person's own surfaces with one agent session (§5.4). */
|
|
352
|
+
export declare const COMPUTER_SHARE_ACTIONS: readonly ["share", "unshare"];
|
|
353
|
+
export type ComputerShareAction = (typeof COMPUTER_SHARE_ACTIONS)[number];
|
|
354
|
+
export declare const COMPUTER_SHARE_MODES: readonly ["observe", "control"];
|
|
355
|
+
export type ComputerShareMode = (typeof COMPUTER_SHARE_MODES)[number];
|
|
356
|
+
/** `daemon:computer:surface:pin` actions (§8). */
|
|
357
|
+
export declare const COMPUTER_SURFACE_PIN_ACTIONS: readonly ["pin", "unpin"];
|
|
358
|
+
export type ComputerSurfacePinAction = (typeof COMPUTER_SURFACE_PIN_ACTIONS)[number];
|
|
359
|
+
/** Why a pin ended: the request it held the surface for left `open`. */
|
|
360
|
+
export declare const COMPUTER_SURFACE_UNPIN_REASONS: readonly ["answered", "dismissed", "expired"];
|
|
361
|
+
export type ComputerSurfaceUnpinReason = (typeof COMPUTER_SURFACE_UNPIN_REASONS)[number];
|
|
362
|
+
/**
|
|
363
|
+
* A surface held for a person by an open human-input request (§8), as the
|
|
364
|
+
* manifest shows it: which request, since when, until when at the latest.
|
|
365
|
+
*/
|
|
366
|
+
export interface ComputerSurfacePin {
|
|
367
|
+
/** The human-input request id. */
|
|
368
|
+
pinId: string;
|
|
369
|
+
taskId?: string;
|
|
370
|
+
since: number;
|
|
371
|
+
until: number;
|
|
372
|
+
}
|
|
373
|
+
/** Why a lease changed holder. Carried by `control` activity events and the audit record. */
|
|
374
|
+
export declare const COMPUTER_CONTROL_CHANGE_REASONS: readonly ["take", "release", "grant", "idle", "disconnect", "share", "unshare", "revoked", "machine_stopped"];
|
|
375
|
+
export type ComputerControlChangeReason = (typeof COMPUTER_CONTROL_CHANGE_REASONS)[number];
|
|
376
|
+
/**
|
|
377
|
+
* What a `control` activity event reports: a change of holder (one of
|
|
378
|
+
* `COMPUTER_CONTROL_CHANGE_REASONS`), a person-to-person request's lifecycle,
|
|
379
|
+
* or a reveal (D12). Only the first changes the holder or the epoch's owner;
|
|
380
|
+
* {@link computerControlChangeIsHolderChange} tells them apart.
|
|
381
|
+
*/
|
|
382
|
+
export declare const COMPUTER_CONTROL_ACTIVITY_CHANGES: readonly ["take", "release", "grant", "idle", "disconnect", "share", "unshare", "revoked", "machine_stopped", "request", "request_declined", "request_expired", "request_withdrawn", "revealed"];
|
|
383
|
+
export type ComputerControlActivityChange = (typeof COMPUTER_CONTROL_ACTIVITY_CHANGES)[number];
|
|
384
|
+
/** Whether a `control` activity change moved the lease to a new holder. */
|
|
385
|
+
export declare function computerControlChangeIsHolderChange(change: unknown): change is ComputerControlChangeReason;
|
|
386
|
+
/**
|
|
387
|
+
* The part of a control lease the input fence reads. `epoch` is a fence, not
|
|
388
|
+
* an authorisation: it increments on every change of holder, and because every
|
|
389
|
+
* observer can read it, input is accepted only from the ATTACHMENT that took
|
|
390
|
+
* the lease (`holderAttachmentId` + `epoch`).
|
|
391
|
+
*/
|
|
392
|
+
export interface ComputerLeaseFence {
|
|
393
|
+
holder: {
|
|
394
|
+
kind: ComputerActorKind;
|
|
395
|
+
};
|
|
396
|
+
epoch: number;
|
|
397
|
+
/** The attachment that took the lease. Set while a person holds; absent for an agent. */
|
|
398
|
+
holderAttachmentId?: string;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Why an input from `attachmentId`, issued under `epoch`, must be dropped — or
|
|
402
|
+
* `null` when the lease accepts it.
|
|
403
|
+
*
|
|
404
|
+
* The epoch is checked first: an input issued under an epoch that is no longer
|
|
405
|
+
* current is the in-flight keystroke the fence exists for, whoever sent it.
|
|
406
|
+
* Only a current-epoch input from an attachment that does not hold the lease
|
|
407
|
+
* is `not_holder`. An agent-held lease accepts no attachment's input.
|
|
408
|
+
*/
|
|
409
|
+
export declare function computerLeaseInputRefusal(lease: ComputerLeaseFence, attachmentId: string, epoch: number): Extract<ComputerRefusalCode, 'stale_epoch' | 'not_holder'> | null;
|
|
410
|
+
/** Whether the lease accepts an input from `attachmentId` issued under `epoch`. */
|
|
411
|
+
export declare function computerLeaseAcceptsInput(lease: ComputerLeaseFence, attachmentId: string, epoch: number): boolean;
|
|
412
|
+
/** Files are a namespace, not a leased surface (§6.3). */
|
|
413
|
+
export declare const COMPUTER_SURFACE_KINDS: readonly ["terminal", "browser"];
|
|
414
|
+
export type ComputerSurfaceKind = (typeof COMPUTER_SURFACE_KINDS)[number];
|
|
415
|
+
export declare const COMPUTER_SURFACE_STATES: readonly ["live", "ended"];
|
|
416
|
+
export type ComputerSurfaceState = (typeof COMPUTER_SURFACE_STATES)[number];
|
|
417
|
+
/**
|
|
418
|
+
* Why a surface ended (§10). An ended surface stays as a tombstone with its
|
|
419
|
+
* history until dismissed, and its reason is shown, never swallowed.
|
|
420
|
+
*/
|
|
421
|
+
export declare const COMPUTER_SURFACE_END_REASONS: readonly ["machine_stopped", "closed_by_owner", "closed", "process_exited", "daemon_restarted", "browser_crashed", "expired", "browser_reset"];
|
|
422
|
+
export type ComputerSurfaceEndReason = (typeof COMPUTER_SURFACE_END_REASONS)[number];
|
|
423
|
+
/** The browser's fixed logical viewport, whoever is looking (§6.2). */
|
|
424
|
+
export declare const COMPUTER_BROWSER_VIEWPORT: Readonly<{
|
|
425
|
+
width: 1280;
|
|
426
|
+
height: 800;
|
|
427
|
+
}>;
|
|
428
|
+
/** One frame never exceeds this, so it fits the SSE transport every guest uses (§7.2 R7). */
|
|
429
|
+
export declare const COMPUTER_FRAME_MAX_BYTES: number;
|
|
430
|
+
/**
|
|
431
|
+
* A viewer's frame slot frees itself after this long without the viewer's
|
|
432
|
+
* acknowledgement. The relay cannot promise delivery of the acknowledgement
|
|
433
|
+
* either, and a lost one must not freeze a viewer that is still painting; a
|
|
434
|
+
* viewer that really stalled still gets at most one frame per bound, never a
|
|
435
|
+
* backlog.
|
|
436
|
+
*/
|
|
437
|
+
export declare const COMPUTER_FRAME_ACK_TIMEOUT_MS = 5000;
|
|
438
|
+
/**
|
|
439
|
+
* The daemon's frame-lane counters (`daemon:computer:diagnostics`, OSK-13616).
|
|
440
|
+
* Cumulative since `since`, so a lost report loses nothing but its moment.
|
|
441
|
+
*/
|
|
442
|
+
export declare const COMPUTER_DIAGNOSTIC_COUNTERS: readonly ["frames_produced", "frames_sent", "frames_held_disconnected", "frames_dropped_oversize", "frames_send_failed", "frames_acked", "frames_ack_timeout", "frame_slots_released"];
|
|
443
|
+
/** How often a daemon with anyone attached reports its counters. */
|
|
444
|
+
export declare const COMPUTER_DIAGNOSTICS_INTERVAL_MS = 15000;
|
|
445
|
+
/** Viewers one report names, newest first; the rest are in the totals only. */
|
|
446
|
+
export declare const COMPUTER_DIAGNOSTICS_MAX_STREAMS = 64;
|
|
447
|
+
export declare const COMPUTER_TERMINAL_SIGNALS: readonly ["interrupt", "eof"];
|
|
448
|
+
export type ComputerTerminalSignal = (typeof COMPUTER_TERMINAL_SIGNALS)[number];
|
|
449
|
+
/** Input a terminal surface takes. */
|
|
450
|
+
export declare const COMPUTER_TERMINAL_INPUT_TYPES: readonly ["bytes", "paste", "resize", "signal"];
|
|
451
|
+
/**
|
|
452
|
+
* How long a terminal lives (§6.1, §18), so its window can say so instead of
|
|
453
|
+
* implying a guest's guarantees on a laptop (OSK-13535):
|
|
454
|
+
* - `host`: its shell is in the terminal host; a daemon restart or update
|
|
455
|
+
* leaves it running. Off a guest the host closes it an hour after its
|
|
456
|
+
* daemon stopped for good. Its output is kept on disk, so after the machine
|
|
457
|
+
* (or the host) restarts it reopens with its history above a divider;
|
|
458
|
+
* - `tmux`: a guest's persistent terminal from before the host; it outlives
|
|
459
|
+
* the daemon and ends with the machine, with no history;
|
|
460
|
+
* - `daemon`: its shell is in the daemon's own process and ends with it.
|
|
461
|
+
*/
|
|
462
|
+
export declare const COMPUTER_TERMINAL_LIFETIMES: readonly ["host", "tmux", "daemon"];
|
|
463
|
+
export type ComputerTerminalLifetime = (typeof COMPUTER_TERMINAL_LIFETIMES)[number];
|
|
464
|
+
/**
|
|
465
|
+
* Why a reopened terminal's shell is not the one that wrote the history above
|
|
466
|
+
* its divider (OSK-13474). The terminal host decides it from its records.
|
|
467
|
+
*/
|
|
468
|
+
export declare const COMPUTER_TERMINAL_HISTORY_CAUSES: readonly ["machine_restarted", "host_stopped", "host_orphaned", "host_restarted"];
|
|
469
|
+
export type ComputerTerminalHistoryCause = (typeof COMPUTER_TERMINAL_HISTORY_CAUSES)[number];
|
|
470
|
+
/**
|
|
471
|
+
* What a terminal's window cannot promise on this machine, said rather than
|
|
472
|
+
* left silent. `windows_pty_unverified`: a Windows machine's terminal is a
|
|
473
|
+
* ConPTY in the daemon's process; its resize and PTY behaviour have not been
|
|
474
|
+
* verified (OSK-13535).
|
|
475
|
+
*/
|
|
476
|
+
export declare const COMPUTER_TERMINAL_CAVEATS: readonly ["windows_pty_unverified"];
|
|
477
|
+
export type ComputerTerminalCaveat = (typeof COMPUTER_TERMINAL_CAVEATS)[number];
|
|
478
|
+
/** Terminal-only facts a surface descriptor carries (`terminal`). Every field is optional. */
|
|
479
|
+
export interface ComputerTerminalInfo {
|
|
480
|
+
/**
|
|
481
|
+
* The size the terminal's controller set (§6.1, OSK-13475). A viewer that
|
|
482
|
+
* does not hold control renders at this size, scaled to fit, and never sends
|
|
483
|
+
* its own.
|
|
484
|
+
*/
|
|
485
|
+
cols?: number;
|
|
486
|
+
rows?: number;
|
|
487
|
+
lifetime?: ComputerTerminalLifetime;
|
|
488
|
+
/** It reopened above the history of a shell that ended with the machine or its host. */
|
|
489
|
+
restarted?: {
|
|
490
|
+
cause: ComputerTerminalHistoryCause;
|
|
491
|
+
at: number;
|
|
492
|
+
};
|
|
493
|
+
caveats?: ComputerTerminalCaveat[];
|
|
494
|
+
}
|
|
495
|
+
/** Input a browser surface takes. `tab` needs `computer_browser_tabs_v1`. */
|
|
496
|
+
export declare const COMPUTER_BROWSER_INPUT_TYPES: readonly ["pointer", "key", "text", "navigate", "history", "tab"];
|
|
497
|
+
/**
|
|
498
|
+
* The client OS a browser `key` input comes from. A person's shortcuts are
|
|
499
|
+
* mapped onto the Linux page's by the daemon: on `mac`, Command is Control,
|
|
500
|
+
* Command+Arrow is Home/End and Option+Arrow is Control+Arrow. Omitted, the
|
|
501
|
+
* keys are sent as they are (the client has already mapped them, or needs none).
|
|
502
|
+
*/
|
|
503
|
+
export declare const COMPUTER_BROWSER_INPUT_PLATFORMS: readonly ["mac", "windows", "linux", "other"];
|
|
504
|
+
export type ComputerBrowserInputPlatform = (typeof COMPUTER_BROWSER_INPUT_PLATFORMS)[number];
|
|
505
|
+
/** The most text one `text` input, `paste` input or `key` input's `text` carries. */
|
|
506
|
+
export declare const COMPUTER_INPUT_TEXT_MAX_LENGTH: number;
|
|
507
|
+
/**
|
|
508
|
+
* A browser `key` input. `text` is the character the key produces, so a
|
|
509
|
+
* printable key is inserted by the key itself (one input, the page sees the
|
|
510
|
+
* key and the character together); IME composition still commits through a
|
|
511
|
+
* separate `text` input. `platform` names the client OS so the daemon maps its
|
|
512
|
+
* shortcuts (see `COMPUTER_BROWSER_INPUT_PLATFORMS`).
|
|
513
|
+
*/
|
|
514
|
+
export interface ComputerBrowserKeyInput {
|
|
515
|
+
type: 'key';
|
|
516
|
+
action: 'down' | 'up';
|
|
517
|
+
key: string;
|
|
518
|
+
code?: string;
|
|
519
|
+
/** CDP modifier bits: Alt 1, Control 2, Meta 4, Shift 8. */
|
|
520
|
+
modifiers?: number;
|
|
521
|
+
text?: string;
|
|
522
|
+
platform?: ComputerBrowserInputPlatform;
|
|
523
|
+
}
|
|
524
|
+
/** What a page can block on until someone answers (§6.2). Permission prompts have no CDP event. */
|
|
525
|
+
export declare const COMPUTER_BROWSER_DIALOG_KINDS: readonly ["alert", "confirm", "prompt", "beforeunload", "auth"];
|
|
526
|
+
export type ComputerBrowserDialogKind = (typeof COMPUTER_BROWSER_DIALOG_KINDS)[number];
|
|
527
|
+
/** How a dialog ended; `cancelled` is the page or a navigation closing it first. */
|
|
528
|
+
export declare const COMPUTER_BROWSER_DIALOG_OUTCOMES: readonly ["accepted", "dismissed", "credentials_supplied", "cancelled"];
|
|
529
|
+
export type ComputerBrowserDialogOutcome = (typeof COMPUTER_BROWSER_DIALOG_OUTCOMES)[number];
|
|
530
|
+
/** Who answered: the standing policy, the agent, the person, or the page itself. */
|
|
531
|
+
export declare const COMPUTER_BROWSER_DIALOG_ANSWERERS: readonly ["agent_policy", "agent", "person", "page"];
|
|
532
|
+
export type ComputerBrowserDialogAnswerer = (typeof COMPUTER_BROWSER_DIALOG_ANSWERERS)[number];
|
|
533
|
+
/** The most of a dialog's message the surface carries; the page's text is cut there. */
|
|
534
|
+
export declare const COMPUTER_BROWSER_DIALOG_MESSAGE_MAX_LENGTH = 2000;
|
|
535
|
+
/** The longest answer a `prompt` dialog takes. */
|
|
536
|
+
export declare const COMPUTER_BROWSER_DIALOG_PROMPT_MAX_LENGTH = 4096;
|
|
537
|
+
/** The longest username or password an `auth` dialog takes; forwarded to the page only. */
|
|
538
|
+
export declare const COMPUTER_BROWSER_DIALOG_CREDENTIAL_MAX_LENGTH = 1024;
|
|
539
|
+
/** A download's state on the surface (§6.2); a finished one also appears in Files. */
|
|
540
|
+
export declare const COMPUTER_BROWSER_DOWNLOAD_STATES: readonly ["in_progress", "completed", "canceled"];
|
|
541
|
+
export type ComputerBrowserDownloadState = (typeof COMPUTER_BROWSER_DOWNLOAD_STATES)[number];
|
|
542
|
+
/** The downloads one browser surface lists, newest first; older ones are in Files. */
|
|
543
|
+
export declare const COMPUTER_BROWSER_DOWNLOADS_MAX = 20;
|
|
544
|
+
/** Whether the page's file input takes one file or several. */
|
|
545
|
+
export declare const COMPUTER_BROWSER_FILE_CHOOSER_MODES: readonly ["single", "multiple"];
|
|
546
|
+
export type ComputerBrowserFileChooserMode = (typeof COMPUTER_BROWSER_FILE_CHOOSER_MODES)[number];
|
|
547
|
+
/** How a file chooser ended: files went to the page, or the person chose none. */
|
|
548
|
+
export declare const COMPUTER_BROWSER_FILE_CHOOSER_OUTCOMES: readonly ["files_chosen", "cancelled"];
|
|
549
|
+
export type ComputerBrowserFileChooserOutcome = (typeof COMPUTER_BROWSER_FILE_CHOOSER_OUTCOMES)[number];
|
|
550
|
+
/** The most files one answer hands the page. */
|
|
551
|
+
export declare const COMPUTER_BROWSER_FILE_CHOOSER_MAX_FILES = 32;
|
|
552
|
+
/** The longest `accept` attribute the descriptor carries; the page's is cut there. */
|
|
553
|
+
export declare const COMPUTER_BROWSER_FILE_CHOOSER_ACCEPT_MAX_LENGTH = 512;
|
|
554
|
+
/** The longest path one answer names. */
|
|
555
|
+
export declare const COMPUTER_BROWSER_FILE_CHOOSER_PATH_MAX_LENGTH = 4096;
|
|
556
|
+
/** The longest folder `computer:surface:open` may name as a terminal's `cwd`. */
|
|
557
|
+
export declare const COMPUTER_TERMINAL_CWD_MAX_LENGTH = 4096;
|
|
558
|
+
/** The most text one copy-out returns; a longer selection is cut there. */
|
|
559
|
+
export declare const COMPUTER_BROWSER_COPY_MAX_LENGTH: number;
|
|
560
|
+
/** `history` input: the browser's own back, forward and reload. */
|
|
561
|
+
export declare const COMPUTER_BROWSER_HISTORY_ACTIONS: readonly ["back", "forward", "reload"];
|
|
562
|
+
export type ComputerBrowserHistoryAction = (typeof COMPUTER_BROWSER_HISTORY_ACTIONS)[number];
|
|
563
|
+
/** `tab` input. `activate` and `close` name a `tabId`; `open` opens a blank tab. */
|
|
564
|
+
export declare const COMPUTER_BROWSER_TAB_ACTIONS: readonly ["activate", "open", "close"];
|
|
565
|
+
export type ComputerBrowserTabAction = (typeof COMPUTER_BROWSER_TAB_ACTIONS)[number];
|
|
566
|
+
/** The longest URL a `navigate` input carries. */
|
|
567
|
+
export declare const COMPUTER_BROWSER_URL_MAX_LENGTH = 4096;
|
|
568
|
+
export type ComputerSurfaceInputType = (typeof COMPUTER_TERMINAL_INPUT_TYPES)[number] | (typeof COMPUTER_BROWSER_INPUT_TYPES)[number];
|
|
569
|
+
export declare const COMPUTER_FILE_OPERATIONS: readonly ["list", "stat", "read", "write", "mkdir", "move", "delete", "archive"];
|
|
570
|
+
export type ComputerFileOperation = (typeof COMPUTER_FILE_OPERATIONS)[number];
|
|
571
|
+
/**
|
|
572
|
+
* The read-only file routes that arrived with `computer_files_search_v1`
|
|
573
|
+
* (§6.3). A separate list: the operations above are the original contract and
|
|
574
|
+
* the audit/activity vocabulary pins them; these two never mutate.
|
|
575
|
+
*/
|
|
576
|
+
export declare const COMPUTER_FILE_SEARCH_OPERATIONS: readonly ["search", "gitstatus"];
|
|
577
|
+
export type ComputerFileSearchOperation = (typeof COMPUTER_FILE_SEARCH_OPERATIONS)[number];
|
|
578
|
+
/** How a search ended: all of it read, cut at the result limit, or cut at the time bound. */
|
|
579
|
+
export declare const COMPUTER_FILE_SEARCH_STATES: readonly ["complete", "truncated", "timed_out"];
|
|
580
|
+
export type ComputerFileSearchState = (typeof COMPUTER_FILE_SEARCH_STATES)[number];
|
|
581
|
+
/** What `git status` says about one entry of a directory. */
|
|
582
|
+
export declare const COMPUTER_FILE_GIT_MARKS: readonly ["modified", "added", "untracked", "ignored", "conflicted"];
|
|
583
|
+
export type ComputerFileGitMark = (typeof COMPUTER_FILE_GIT_MARKS)[number];
|
|
584
|
+
/** Search bounds, one declaration for the daemon, the API and the client. */
|
|
585
|
+
export declare const COMPUTER_FILE_SEARCH_DEFAULT_LIMIT = 200;
|
|
586
|
+
export declare const COMPUTER_FILE_SEARCH_MAX_LIMIT = 1000;
|
|
587
|
+
export declare const COMPUTER_FILE_SEARCH_DEFAULT_BUDGET_MS = 8000;
|
|
588
|
+
export declare const COMPUTER_FILE_SEARCH_MAX_BUDGET_MS = 20000;
|
|
589
|
+
export declare const COMPUTER_FILE_SEARCH_MAX_QUERY_LENGTH = 200;
|
|
590
|
+
export declare const COMPUTER_FILE_GIT_STATUS_BUDGET_MS = 4000;
|
|
591
|
+
export declare const COMPUTER_FILE_TYPES: readonly ["file", "directory", "symlink", "other"];
|
|
592
|
+
export type ComputerFileType = (typeof COMPUTER_FILE_TYPES)[number];
|
|
593
|
+
/**
|
|
594
|
+
* Why an entry is withheld rather than listed as readable (§18): the daemon's
|
|
595
|
+
* own deny set, the machine's `blockedPaths`, a built-in sensitive pattern, or
|
|
596
|
+
* an operating-system privacy control denying the daemon the folder.
|
|
597
|
+
*/
|
|
598
|
+
export declare const COMPUTER_FILE_WITHHELD_REASONS: readonly ["deny_set", "blocked_path", "sensitive_pattern", "os_permission"];
|
|
599
|
+
export type ComputerFileWithheldReason = (typeof COMPUTER_FILE_WITHHELD_REASONS)[number];
|
|
600
|
+
/**
|
|
601
|
+
* Why an attachment's scoped watches went stale (§6.3 "degrades to stale, not
|
|
602
|
+
* to wrong"). The tree then says so and offers a refresh — it never sits on a
|
|
603
|
+
* silently partial picture.
|
|
604
|
+
*
|
|
605
|
+
* - `spawn_failed`: the watcher could not start.
|
|
606
|
+
* - `watcher_exited`: the watcher ended (tenant code may kill it on a guest).
|
|
607
|
+
* - `watch_quota`: the account's watch quota is spent.
|
|
608
|
+
* - `events_overflow`: more changes arrived than are forwarded (a build
|
|
609
|
+
* writing thousands of files), so the watcher stopped rather than queue.
|
|
610
|
+
* - `delivery_gap`: a report was lost between the machine and this viewer.
|
|
611
|
+
*/
|
|
612
|
+
export declare const COMPUTER_FILES_WATCH_DEGRADED_REASONS: readonly ["spawn_failed", "watcher_exited", "watch_quota", "events_overflow", "delivery_gap"];
|
|
613
|
+
export type ComputerFilesWatchDegradedReason = (typeof COMPUTER_FILES_WATCH_DEGRADED_REASONS)[number];
|
|
614
|
+
/** Changes one `computer:files:changed` report carries; more in one window is `events_overflow`. */
|
|
615
|
+
export declare const COMPUTER_FILES_CHANGED_MAX_CHANGES = 256;
|
|
616
|
+
/** The kinds of change a `file_change` activity event reports. */
|
|
617
|
+
export declare const COMPUTER_FILE_CHANGES: readonly ["created", "modified", "deleted", "moved"];
|
|
618
|
+
export type ComputerFileChange = (typeof COMPUTER_FILE_CHANGES)[number];
|
|
619
|
+
/**
|
|
620
|
+
* The optimistic-concurrency tag a read returns and a write presents. Inode
|
|
621
|
+
* and nanosecond mtime are decimal strings: both exceed what a JS number holds
|
|
622
|
+
* exactly.
|
|
623
|
+
*/
|
|
624
|
+
export interface ComputerFileEntityTagFields {
|
|
625
|
+
inode: string;
|
|
626
|
+
size: number;
|
|
627
|
+
mtimeNs: string;
|
|
628
|
+
/**
|
|
629
|
+
* A DIRECTORY's contents tag, asked for with `stat {contents: true}`: a
|
|
630
|
+
* SHA-256 (lowercase hex) over every entry below the folder — its type,
|
|
631
|
+
* inode, size, change time and relative path. It changes when anything
|
|
632
|
+
* inside the folder is created, removed, renamed or written, at any depth,
|
|
633
|
+
* which the folder's own `mtimeNs` does not (that moves only for its direct
|
|
634
|
+
* children). A recursive delete that presents a tag must present this one,
|
|
635
|
+
* so it can only erase the contents the person was shown. Comparable only
|
|
636
|
+
* on the machine that computed it.
|
|
637
|
+
*/
|
|
638
|
+
contents?: string;
|
|
639
|
+
}
|
|
640
|
+
/** The most entries below a folder a contents tag covers; a larger folder is `too_large`. */
|
|
641
|
+
export declare const COMPUTER_FILE_CONTENTS_TAG_MAX_ENTRIES = 100000;
|
|
642
|
+
/** A contents tag's shape: SHA-256 as lowercase hex. */
|
|
643
|
+
export declare const COMPUTER_FILE_CONTENTS_TAG_PATTERN: RegExp;
|
|
644
|
+
export declare function computerFileEntityTagsEqual(a: ComputerFileEntityTagFields, b: ComputerFileEntityTagFields): boolean;
|
|
645
|
+
export declare const COMPUTER_ACTIVITY_KINDS: readonly ["command", "browser_action", "file_change", "control", "lifecycle"];
|
|
646
|
+
export type ComputerActivityKind = (typeof COMPUTER_ACTIVITY_KINDS)[number];
|
|
647
|
+
/** `summary` is one line, safe to show. */
|
|
648
|
+
export declare const COMPUTER_ACTIVITY_SUMMARY_MAX_LENGTH = 500;
|
|
649
|
+
/** The most command output one event carries; longer output is split across events. */
|
|
650
|
+
export declare const COMPUTER_ACTIVITY_OUTPUT_MAX_LENGTH: number;
|
|
651
|
+
/**
|
|
652
|
+
* What a viewer without file access reads where a withheld path stood
|
|
653
|
+
* (security review PM-10, OSK-13701): one stable token, so a client can say
|
|
654
|
+
* "withheld" rather than render a path-shaped string.
|
|
655
|
+
*/
|
|
656
|
+
export declare const COMPUTER_ACTIVITY_WITHHELD_PLACEHOLDER = "[withheld]";
|
|
657
|
+
export declare const COMPUTER_COMMAND_PHASES: readonly ["started", "output", "exited"];
|
|
658
|
+
export type ComputerCommandPhase = (typeof COMPUTER_COMMAND_PHASES)[number];
|
|
659
|
+
export declare const COMPUTER_LIFECYCLE_EVENTS: readonly ["surface_opened", "surface_ended", "surface_shared", "surface_unshared", "surface_orphaned", "reclaim_imminent", "power", "browser_reset"];
|
|
660
|
+
export type ComputerLifecycleEvent = (typeof COMPUTER_LIFECYCLE_EVENTS)[number];
|
|
661
|
+
/** How a command call ended, as its producer stated it — never inferred from output. */
|
|
662
|
+
export declare const COMPUTER_COMMAND_OUTCOMES: readonly ["succeeded", "failed"];
|
|
663
|
+
export type ComputerCommandOutcome = (typeof COMPUTER_COMMAND_OUTCOMES)[number];
|
|
664
|
+
/**
|
|
665
|
+
* The `signal` of a command that ended without a process exit status, beyond
|
|
666
|
+
* `timeout`, `error`, `cancelled` and signal names (task 5-04b, OSK-13614):
|
|
667
|
+
* `not_started` — the run was refused before it began, and `refusal` says
|
|
668
|
+
* why; `unknown` — the shell it ran in ended first, so its own exit status
|
|
669
|
+
* cannot be known.
|
|
670
|
+
*/
|
|
671
|
+
export declare const COMPUTER_COMMAND_NOT_STARTED_SIGNAL = "not_started";
|
|
672
|
+
export declare const COMPUTER_COMMAND_UNKNOWN_END_SIGNAL = "unknown";
|
|
673
|
+
/**
|
|
674
|
+
* Why a run in an agent's shell never started (`refusal` beside
|
|
675
|
+
* `signal: 'not_started'`): the shell was busy with another run, had ended,
|
|
676
|
+
* was still opening, a person held the terminal, the command could not be
|
|
677
|
+
* handed to the shell, or the request was incomplete. A client shows an
|
|
678
|
+
* unknown value as "did not start" without a reason.
|
|
679
|
+
*/
|
|
680
|
+
export declare const COMPUTER_COMMAND_START_REFUSALS: readonly ["session_busy", "session_closed", "session_not_ready", "human_control", "start_failed", "invalid_request"];
|
|
681
|
+
export type ComputerCommandStartRefusal = (typeof COMPUTER_COMMAND_START_REFUSALS)[number];
|
|
682
|
+
export declare const COMPUTER_COMMAND_OUTPUT_STREAMS: readonly ["stdout", "stderr"];
|
|
683
|
+
export type ComputerCommandOutputStream = (typeof COMPUTER_COMMAND_OUTPUT_STREAMS)[number];
|
|
684
|
+
/**
|
|
685
|
+
* The `detail` of each activity kind, exactly as the daemon's stream composes
|
|
686
|
+
* it (`daemon/src/computer/activity-stream.ts` `compose()`). This is the one
|
|
687
|
+
* declaration of those shapes: data-provider's zod schema is checked against
|
|
688
|
+
* it at compile time, and the daemon's replay test pushes every producer's
|
|
689
|
+
* real events through that schema and fails on a rejected or a stripped field.
|
|
690
|
+
*
|
|
691
|
+
* Every text field has been redacted at the source; `redacted` says a secret
|
|
692
|
+
* pattern matched in at least one of them.
|
|
693
|
+
*/
|
|
694
|
+
export interface ComputerCommandActivityDetail {
|
|
695
|
+
phase: ComputerCommandPhase;
|
|
696
|
+
/**
|
|
697
|
+
* Correlates the started / output / exited events of one call: the tool use
|
|
698
|
+
* id, or a harness's call id. Absent only when the producer had none (a
|
|
699
|
+
* harness call announced without an id), and such a call cannot be grouped.
|
|
700
|
+
*/
|
|
701
|
+
runId?: string;
|
|
702
|
+
/** The command line as run (or the tool's one whitelisted line: a path, a pattern). Redacted. */
|
|
703
|
+
commandLine?: string;
|
|
704
|
+
cwd?: string;
|
|
705
|
+
/** `exited` only. `null`: the call ended without a process exit status (timeout, error). */
|
|
706
|
+
exitCode?: number | null;
|
|
707
|
+
/**
|
|
708
|
+
* `exited` only: `timeout`, `error`, `cancelled`, `not_started`, `unknown`
|
|
709
|
+
* (`COMPUTER_COMMAND_NOT_STARTED_SIGNAL`, `COMPUTER_COMMAND_UNKNOWN_END_SIGNAL`),
|
|
710
|
+
* or a signal name.
|
|
711
|
+
*/
|
|
712
|
+
signal?: string;
|
|
713
|
+
/**
|
|
714
|
+
* `exited` with `signal: 'not_started'`: why the run never began, one of
|
|
715
|
+
* `COMPUTER_COMMAND_START_REFUSALS` (a string, so a newer reason does not
|
|
716
|
+
* break an older reader).
|
|
717
|
+
*/
|
|
718
|
+
refusal?: string;
|
|
719
|
+
/**
|
|
720
|
+
* A run in an agent's shell: the terminal lane cursor where it began — the
|
|
721
|
+
* byte the shell's echo of the command starts at. Announced by
|
|
722
|
+
* `computer_terminal_command_offset_v1`.
|
|
723
|
+
*/
|
|
724
|
+
streamOffset?: number;
|
|
725
|
+
/** `output` only, as produced — the one field that is not redacted. */
|
|
726
|
+
output?: string;
|
|
727
|
+
/** `output` only: this event's output was cut at `COMPUTER_ACTIVITY_OUTPUT_MAX_LENGTH`. */
|
|
728
|
+
outputTruncated?: true;
|
|
729
|
+
/**
|
|
730
|
+
* `output` only: this viewer may not read the machine's files (the watch
|
|
731
|
+
* tier), so the output was not sent to them (PM-10, OSK-13701). Set by the
|
|
732
|
+
* relay's per-viewer projection, never by the daemon.
|
|
733
|
+
*/
|
|
734
|
+
outputWithheld?: true;
|
|
735
|
+
stream?: ComputerCommandOutputStream;
|
|
736
|
+
/** `output` only: bytes the live view did not stream before this event. */
|
|
737
|
+
droppedBytes?: number;
|
|
738
|
+
/** `output` only: the per-call streaming cap was reached; nothing further streams. */
|
|
739
|
+
streamTruncated?: true;
|
|
740
|
+
/** The agent tool behind the call (`Bash`, `Grep`); absent for a terminal's own commands. */
|
|
741
|
+
tool?: string;
|
|
742
|
+
outcome?: ComputerCommandOutcome;
|
|
743
|
+
durationMs?: number;
|
|
744
|
+
/**
|
|
745
|
+
* An agent session acted on a person's surface shared with it (§5.4): the
|
|
746
|
+
* audit record keeps it. Typed text is never carried on such an event.
|
|
747
|
+
*/
|
|
748
|
+
shared?: true;
|
|
749
|
+
redacted?: true;
|
|
750
|
+
}
|
|
751
|
+
export interface ComputerActivityBox {
|
|
752
|
+
x: number;
|
|
753
|
+
y: number;
|
|
754
|
+
width: number;
|
|
755
|
+
height: number;
|
|
756
|
+
}
|
|
757
|
+
export interface ComputerBrowserActionActivityDetail {
|
|
758
|
+
/** `navigate`, `click`, `type`, … */
|
|
759
|
+
action: string;
|
|
760
|
+
url?: string;
|
|
761
|
+
tabId?: string;
|
|
762
|
+
/** The element acted on (role + name), from the daemon's snapshot. Never typed text. */
|
|
763
|
+
target?: string;
|
|
764
|
+
/** A short label for the target, never typed text. */
|
|
765
|
+
label?: string;
|
|
766
|
+
/** The target's box, for the cursor and ripple overlay. */
|
|
767
|
+
box?: ComputerActivityBox;
|
|
768
|
+
/** A two-target action's second box (a drag's destination). */
|
|
769
|
+
toBox?: ComputerActivityBox;
|
|
770
|
+
/** A named key, mouse button or mode token — never a typed character. */
|
|
771
|
+
key?: string;
|
|
772
|
+
count?: number;
|
|
773
|
+
/** `type`: how many characters, never which. */
|
|
774
|
+
textLength?: number;
|
|
775
|
+
/** An agent session acted on a person's window shared with it (§5.4). */
|
|
776
|
+
shared?: true;
|
|
777
|
+
redacted?: true;
|
|
778
|
+
}
|
|
779
|
+
export interface ComputerFileChangeActivityDetail {
|
|
780
|
+
change: ComputerFileChange;
|
|
781
|
+
/** Where the file is now (a move's destination). */
|
|
782
|
+
path: string;
|
|
783
|
+
/** A move's previous path. */
|
|
784
|
+
fromPath?: string;
|
|
785
|
+
bytes?: number;
|
|
786
|
+
redacted?: true;
|
|
787
|
+
}
|
|
788
|
+
export interface ComputerControlActivityDetail {
|
|
789
|
+
change: ComputerControlActivityChange;
|
|
790
|
+
epoch?: number;
|
|
791
|
+
/** The holder before (for a request: the holding person). */
|
|
792
|
+
from?: ComputerWireActor;
|
|
793
|
+
/** The holder after (for a request: the requester). */
|
|
794
|
+
to?: ComputerWireActor;
|
|
795
|
+
/** A handback note, or what caused a reveal. */
|
|
796
|
+
note?: string;
|
|
797
|
+
redacted?: true;
|
|
798
|
+
}
|
|
799
|
+
export interface ComputerLifecycleActivityDetail {
|
|
800
|
+
event: ComputerLifecycleEvent;
|
|
801
|
+
surfaceKind?: string;
|
|
802
|
+
title?: string;
|
|
803
|
+
endedReason?: ComputerSurfaceEndReason;
|
|
804
|
+
/** `power`: the machine's power phase now. */
|
|
805
|
+
phase?: string;
|
|
806
|
+
/** `surface_shared`: the share mode. */
|
|
807
|
+
mode?: string;
|
|
808
|
+
/** `surface_shared` / `surface_unshared`: the agent session. */
|
|
809
|
+
agent?: ComputerWireActor;
|
|
810
|
+
/** `surface_orphaned`: the person who opened it and lost access. */
|
|
811
|
+
opener?: ComputerWireActor;
|
|
812
|
+
/** `reclaim_imminent`: epoch ms the daemon hands the surface back unless the person acts. */
|
|
813
|
+
deadline?: number;
|
|
814
|
+
redacted?: true;
|
|
815
|
+
}
|
|
816
|
+
export interface ComputerActivityDetailByKind {
|
|
817
|
+
command: ComputerCommandActivityDetail;
|
|
818
|
+
browser_action: ComputerBrowserActionActivityDetail;
|
|
819
|
+
file_change: ComputerFileChangeActivityDetail;
|
|
820
|
+
control: ComputerControlActivityDetail;
|
|
821
|
+
lifecycle: ComputerLifecycleActivityDetail;
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* What `daemon:computer:services` (and the agent's `computer.services` call)
|
|
825
|
+
* asks of the machine: add or replace one service by name, remove one, or
|
|
826
|
+
* answer the list. Declaring and withdrawing need `open`; listing needs
|
|
827
|
+
* `observe`.
|
|
828
|
+
*/
|
|
829
|
+
export declare const COMPUTER_DECLARED_SERVICE_ACTIONS: readonly ["declare", "withdraw", "list"];
|
|
830
|
+
export type ComputerDeclaredServiceAction = (typeof COMPUTER_DECLARED_SERVICE_ACTIONS)[number];
|
|
831
|
+
/**
|
|
832
|
+
* The tool an agent session's declaration rides to its own daemon: the same
|
|
833
|
+
* `daemon:tool:request` channel that carries its other calls, answered by the
|
|
834
|
+
* same gate as `daemon:computer:services`. The input is the API's (action,
|
|
835
|
+
* principal, agent, service or name); the session is the request's own.
|
|
836
|
+
*/
|
|
837
|
+
export declare const COMPUTER_SERVICES_TOOL_NAME = "computer.services";
|
|
838
|
+
/** A refused `computer.services` call: this prefix, then the refusal as JSON. */
|
|
839
|
+
export declare const COMPUTER_SERVICES_TOOL_ERROR_PREFIX = "computer_services_refused:";
|
|
840
|
+
/** The operation each action needs, by the one access vocabulary. */
|
|
841
|
+
export declare function computerDeclaredServiceOperation(action: ComputerDeclaredServiceAction): Extract<ComputerOperation, 'open' | 'observe'>;
|
|
842
|
+
export declare const COMPUTER_DECLARED_SERVICE_PROTOCOLS: readonly ["http", "https"];
|
|
843
|
+
export type ComputerDeclaredServiceProtocol = (typeof COMPUTER_DECLARED_SERVICE_PROTOCOLS)[number];
|
|
844
|
+
/** Services one machine holds at once; one more is `service_limit`. */
|
|
845
|
+
export declare const COMPUTER_DECLARED_SERVICES_MAX = 16;
|
|
846
|
+
export declare const COMPUTER_DECLARED_SERVICE_NAME_MAX_LENGTH = 48;
|
|
847
|
+
export declare const COMPUTER_DECLARED_SERVICE_PATH_MAX_LENGTH = 512;
|
|
848
|
+
/**
|
|
849
|
+
* The one host a declared service names. A declaration carries a port and a
|
|
850
|
+
* path, never a host or a URL: the target is always this machine's own
|
|
851
|
+
* loopback, by construction, and a request that names anything else is
|
|
852
|
+
* refused as malformed rather than narrowed.
|
|
853
|
+
*/
|
|
854
|
+
export declare const COMPUTER_DECLARED_SERVICE_HOST = "localhost";
|
|
855
|
+
/** A service's name: its key on the machine, lower case, shown as written. */
|
|
856
|
+
export declare const COMPUTER_DECLARED_SERVICE_NAME_PATTERN: RegExp;
|
|
857
|
+
/** A service as it is declared: what it is called and where it listens. */
|
|
858
|
+
export interface ComputerDeclaredServiceSpec {
|
|
859
|
+
name: string;
|
|
860
|
+
/** A TCP port on the machine's loopback, 1 to 65535. */
|
|
861
|
+
port: number;
|
|
862
|
+
/** Absolute; `/` when the declaration named none. */
|
|
863
|
+
path: string;
|
|
864
|
+
protocol: ComputerDeclaredServiceProtocol;
|
|
865
|
+
}
|
|
866
|
+
/** A declared service as the manifest carries it. */
|
|
867
|
+
export interface ComputerDeclaredService extends ComputerDeclaredServiceSpec {
|
|
868
|
+
/** Who declared it: an agent session or a person. */
|
|
869
|
+
declaredBy: ComputerWireActor;
|
|
870
|
+
/** Epoch ms of the declaration (or of the latest one that replaced it). */
|
|
871
|
+
declaredAt: number;
|
|
872
|
+
}
|
|
873
|
+
/** Which part of a declaration was refused. */
|
|
874
|
+
export declare const COMPUTER_DECLARED_SERVICE_PROBLEMS: readonly ["shape", "name", "port", "path", "protocol"];
|
|
875
|
+
export type ComputerDeclaredServiceProblem = (typeof COMPUTER_DECLARED_SERVICE_PROBLEMS)[number];
|
|
876
|
+
/**
|
|
877
|
+
* A declaration, checked and filled in, or the part of it that was refused.
|
|
878
|
+
* The daemon, the API, the client and the CLI all read a declaration through
|
|
879
|
+
* this one rule, so a service none of them would accept never reaches the
|
|
880
|
+
* manifest.
|
|
881
|
+
*/
|
|
882
|
+
export declare function computerDeclaredServiceSpec(raw: unknown): {
|
|
883
|
+
ok: true;
|
|
884
|
+
spec: ComputerDeclaredServiceSpec;
|
|
885
|
+
} | {
|
|
886
|
+
ok: false;
|
|
887
|
+
problem: ComputerDeclaredServiceProblem;
|
|
888
|
+
};
|
|
889
|
+
/**
|
|
890
|
+
* The address a declared service opens at in the computer's browser: always
|
|
891
|
+
* this machine's loopback. Throws on a spec the rule above would refuse, so a
|
|
892
|
+
* caller can never be handed an address off the machine.
|
|
893
|
+
*/
|
|
894
|
+
export declare function computerDeclaredServiceUrl(service: Pick<ComputerDeclaredServiceSpec, 'port'> & Partial<Pick<ComputerDeclaredServiceSpec, 'path' | 'protocol'>>): string;
|
|
895
|
+
export declare const COMPUTER_MACHINE_KINDS: readonly ["dedicated", "personal"];
|
|
896
|
+
export type ComputerMachineKind = (typeof COMPUTER_MACHINE_KINDS)[number];
|
|
897
|
+
/**
|
|
898
|
+
* One picture per machine state; none of them is a spinner without a bound,
|
|
899
|
+
* and none collapses two states into the reassuring one.
|
|
900
|
+
*/
|
|
901
|
+
export declare const COMPUTER_POWER_PHASES: readonly ["on", "booting", "stopping", "off", "archived", "removing", "gone", "blind", "unresponsive", "not_a_computer", "needs_update", "online", "offline", "needs_sign_in", "not_allowed"];
|
|
902
|
+
export type ComputerPowerPhase = (typeof COMPUTER_POWER_PHASES)[number];
|
|
903
|
+
/**
|
|
904
|
+
* Phases a personal machine can be in. `blind` is shared with a Dedicated
|
|
905
|
+
* Runtime: the machine's presence could not be READ, which is not the same
|
|
906
|
+
* fact as "offline" and must not be shown as it (§10, §18; 10-09).
|
|
907
|
+
*/
|
|
908
|
+
export declare const COMPUTER_PERSONAL_POWER_PHASES: readonly ["online", "offline", "needs_sign_in", "not_allowed", "needs_update", "blind"];
|
|
909
|
+
/**
|
|
910
|
+
* Why a personal machine needs signing in again — `power.reason` on
|
|
911
|
+
* `needs_sign_in`. `needs_reauth`: the daemon's credential stopped refreshing
|
|
912
|
+
* (it latches the Harness mark and waits). `revoked`: the machine's sign-in was
|
|
913
|
+
* revoked from the account, so it is no longer this person's machine until it
|
|
914
|
+
* is signed in again. Same next action, different fact, different picture.
|
|
915
|
+
*/
|
|
916
|
+
export declare const COMPUTER_PERSONAL_SIGN_IN_REASONS: readonly ["needs_reauth", "revoked"];
|
|
917
|
+
export type ComputerPersonalSignInReason = (typeof COMPUTER_PERSONAL_SIGN_IN_REASONS)[number];
|
|
918
|
+
/** Why a stopped machine would also refuse a start, so the screen does not offer one (§10). */
|
|
919
|
+
export declare const COMPUTER_START_REFUSALS: readonly ["spend_cap", "entitlement"];
|
|
920
|
+
export type ComputerStartRefusal = (typeof COMPUTER_START_REFUSALS)[number];
|
|
921
|
+
/**
|
|
922
|
+
* The picture for each Dedicated Runtime lease state. Its keys are the lease
|
|
923
|
+
* states; `@skrr-ai/data-provider` asserts at compile time that they are
|
|
924
|
+
* exactly `MachineLeaseStateName`, so a new lease state fails to compile there
|
|
925
|
+
* until it is given a picture here — never a default.
|
|
926
|
+
*/
|
|
927
|
+
export declare const COMPUTER_LEASE_STATE_POWER_PHASE: Readonly<{
|
|
928
|
+
readonly ready: "on";
|
|
929
|
+
readonly active: "on";
|
|
930
|
+
readonly idle: "on";
|
|
931
|
+
readonly requested: "booting";
|
|
932
|
+
readonly provisioning: "booting";
|
|
933
|
+
readonly bootstrapping: "booting";
|
|
934
|
+
readonly starting: "booting";
|
|
935
|
+
readonly restarting: "booting";
|
|
936
|
+
readonly recovering: "booting";
|
|
937
|
+
readonly stopping: "stopping";
|
|
938
|
+
readonly snapshotting: "stopping";
|
|
939
|
+
readonly stopped: "off";
|
|
940
|
+
readonly archived: "archived";
|
|
941
|
+
readonly terminating: "removing";
|
|
942
|
+
readonly failed: "gone";
|
|
943
|
+
readonly lost: "gone";
|
|
944
|
+
readonly terminated: "gone";
|
|
945
|
+
readonly pausing: "not_a_computer";
|
|
946
|
+
readonly paused: "not_a_computer";
|
|
947
|
+
readonly resuming: "not_a_computer";
|
|
948
|
+
}>;
|
|
949
|
+
export type ComputerLeaseStateName = keyof typeof COMPUTER_LEASE_STATE_POWER_PHASE;
|
|
950
|
+
/** The phase a Dedicated Runtime lease state shows as, or `null` for a state this build does not know. */
|
|
951
|
+
export declare function computerPowerPhaseForLeaseState(state: unknown): ComputerPowerPhase | null;
|
|
952
|
+
/** Whether the phase shows the desktop. */
|
|
953
|
+
export declare function computerShowsDesktop(phase: ComputerPowerPhase): boolean;
|
|
954
|
+
/** Power actions are offered for a Dedicated Runtime only; a personal machine has none (§18). */
|
|
955
|
+
export declare function computerOffersPowerActions(machineKind: ComputerMachineKind): boolean;
|