@skrr-ai/cli 0.1.113 → 0.1.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/bin/update-npm-runner.cjs +4 -1
  2. package/bin/update-worker.cjs +6 -3
  3. package/dist/commands/agents/chat.js +10 -1
  4. package/dist/commands/computer-use/audio.d.ts +6 -0
  5. package/dist/commands/computer-use/audio.js +9 -0
  6. package/dist/commands/computer-use/browser.d.ts +7 -0
  7. package/dist/commands/computer-use/browser.js +16 -0
  8. package/dist/commands/computer-use/disable.d.ts +6 -0
  9. package/dist/commands/computer-use/disable.js +9 -0
  10. package/dist/commands/computer-use/enable.d.ts +6 -0
  11. package/dist/commands/computer-use/enable.js +9 -0
  12. package/dist/commands/computer-use/index.d.ts +6 -0
  13. package/dist/commands/computer-use/index.js +9 -0
  14. package/dist/commands/computer-use/install.d.ts +6 -0
  15. package/dist/commands/computer-use/install.js +9 -0
  16. package/dist/commands/computer-use/recover.d.ts +6 -0
  17. package/dist/commands/computer-use/recover.js +9 -0
  18. package/dist/commands/computer-use/status.d.ts +6 -0
  19. package/dist/commands/computer-use/status.js +9 -0
  20. package/dist/commands/computer-use/stop.d.ts +6 -0
  21. package/dist/commands/computer-use/stop.js +9 -0
  22. package/dist/commands/daemon/login.js +1 -1
  23. package/dist/commands/followups/plans/cancel.js +10 -3
  24. package/dist/commands/followups/plans/capacity.d.ts +9 -0
  25. package/dist/commands/followups/plans/capacity.js +42 -0
  26. package/dist/commands/followups/plans/create.js +3 -0
  27. package/dist/commands/followups/plans/revise.js +13 -6
  28. package/dist/commands/followups/remind.js +13 -5
  29. package/dist/commands/followups/watch.js +2 -2
  30. package/dist/lib/agentic-stream.d.ts +5 -1
  31. package/dist/lib/agentic-stream.js +25 -9
  32. package/dist/lib/computer-use.d.ts +9 -0
  33. package/dist/lib/computer-use.js +41 -0
  34. package/dist/lib/lookbackPlans.d.ts +20 -6
  35. package/dist/lib/lookbackPlans.js +19 -5
  36. package/dist/lib/update-check.d.ts +11 -10
  37. package/dist/lib/update-check.js +41 -23
  38. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerUse.d.ts +228 -0
  39. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerUse.js +375 -0
  40. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.d.ts +4 -1
  41. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.js +6 -2
  42. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +40 -0
  43. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopWire.d.ts +140 -0
  44. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopWire.js +46 -0
  45. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.d.ts +4 -4
  46. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +2 -2
  47. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +3 -1
  48. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +8 -5
  49. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerUse.d.ts +228 -0
  50. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerUse.js +358 -0
  51. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.d.ts +4 -1
  52. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.js +5 -1
  53. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +40 -0
  54. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopWire.d.ts +140 -0
  55. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopWire.js +42 -0
  56. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.d.ts +4 -4
  57. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +2 -2
  58. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +3 -1
  59. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +3 -1
  60. package/dist/node_modules/@skrr-ai/auth-core/package.json +21 -1
  61. package/dist/node_modules/@skrr-ai/data-provider/index.js +23687 -23456
  62. package/oclif.manifest.json +306 -26
  63. package/package.json +2 -2
@@ -52,6 +52,7 @@ exports.DAEMON_WIRE_NAMES = exports.DAEMON_WIRE = exports.DAEMON_WIRE_CARRIERS =
52
52
  exports.daemonWireEntry = daemonWireEntry;
53
53
  exports.daemonWireSends = daemonWireSends;
54
54
  exports.daemonWireHandles = daemonWireHandles;
55
+ const desktopWire_js_1 = require("./desktopWire.js");
55
56
  const computerWire_js_1 = require("./computerWire.js");
56
57
  // ---------------------------------------------------------------------------
57
58
  // Vocabulary
@@ -127,6 +128,15 @@ const CONNECTION = [
127
128
  toServer('daemon:shuttingDown', 'The daemon is draining before it exits, so the API can fail over without waiting for the socket to time out.'),
128
129
  toDaemon('server:draining', 'This API task is draining: reconnect (after jitter) to another one.'),
129
130
  toDaemon('auth:revoked', 'The credential this socket used was revoked: stop retrying and ask the person to sign in again.'),
131
+ toDaemon('error:stale-process', 'This daemon process was replaced by a fresher registration; stop transport drain recovery before disconnect.', {
132
+ payload: { kind: 'zod', schema: 'daemonConnectionFenceErrorSchema' },
133
+ }),
134
+ toDaemon('error:stale-generation', 'This Dedicated Runtime generation is no longer active; stop transport drain recovery before disconnect.', {
135
+ payload: { kind: 'zod', schema: 'daemonConnectionFenceErrorSchema' },
136
+ }),
137
+ toDaemon('error:stale-binding', 'This daemon credential was rebound to another account; stop transport drain recovery before disconnect.', {
138
+ payload: { kind: 'zod', schema: 'daemonConnectionFenceErrorSchema' },
139
+ }),
130
140
  toServer('daemon:auth-failed', 'The daemon could not refresh its own credential and needs the person to sign in again.'),
131
141
  toServer('daemon:auth-warning', "The daemon's credential expires soon."),
132
142
  toDaemon('error:unauthorized', 'The API refused an event this daemon sent, for lack of authority, naming the event.'),
@@ -279,6 +289,36 @@ const TOOLS = [
279
289
  capability: TOOL_RESPONSE_OUTBOX,
280
290
  }),
281
291
  toDaemon('daemon:tool:cancel', 'Abandon a running tool call.'),
292
+ toDaemon('daemon:computer:use-control', 'An authorized person observes, configures, stops or recovers the machine Computer Use provider.', {
293
+ stability: 'experimental', capability: 'computer_use_mcp_v1', delivery: 'acked', answeredBy: 'daemon:computer:ack',
294
+ payload: { kind: 'zod', schema: 'daemonComputerUseControlSchema' },
295
+ }),
296
+ toDaemon('daemon:computer-use:rotate-credential', 'The approved hosted-desktop owner requests credential rotation for this exact active machine lease generation.', {
297
+ stability: 'experimental', capability: 'computer_use_mcp_v1', delivery: 'acked', answeredBy: 'daemon:computer:ack',
298
+ payload: { kind: 'zod', schema: 'daemonComputerUseRotateCredentialSchema' },
299
+ }),
300
+ toDaemon('daemon:computer-use:revoke', 'Revoke cloud Computer Use bindings after owner machine authority was removed.', {
301
+ stability: 'experimental', capability: 'computer_use_mcp_v1',
302
+ payload: { kind: 'zod', schema: 'daemonComputerUseRevokeSchema' },
303
+ }),
304
+ ...['subscribe', 'protocol', 'unsubscribe'].map((operation) => toDaemon(desktopWire_js_1.DAEMON_COMPUTER_DESKTOP_EVENTS[operation], `Read-only desktop stream: ${operation}; bound to an authenticated attachment and generation.`, {
305
+ stability: 'experimental', capability: desktopWire_js_1.COMPUTER_DESKTOP_CAPABILITY,
306
+ delivery: 'acked', answeredBy: 'daemon:computer:ack',
307
+ payload: { kind: 'zod', schema: `daemonComputerDesktop${operation[0].toUpperCase()}${operation.slice(1)}Schema` },
308
+ })),
309
+ ...['control', 'input'].map((operation) => toDaemon(desktopWire_js_1.DAEMON_COMPUTER_DESKTOP_EVENTS[operation], `Human-only typed desktop ${operation}; exact authenticated attachment, stream and generation.`, {
310
+ stability: 'experimental', capability: desktopWire_js_1.COMPUTER_DESKTOP_CONTROL_CAPABILITY,
311
+ delivery: 'acked', answeredBy: 'daemon:computer:ack',
312
+ payload: { kind: 'zod', schema: `daemonComputerDesktop${operation[0].toUpperCase()}${operation.slice(1)}Schema` },
313
+ })),
314
+ toServer(desktopWire_js_1.DAEMON_COMPUTER_DESKTOP_EVENTS.controlChanged, 'Private desktop holder and input revocation fact; never carries a control token.', {
315
+ stability: 'experimental', capability: desktopWire_js_1.COMPUTER_DESKTOP_CONTROL_CAPABILITY,
316
+ payload: { kind: 'zod', schema: 'computerDesktopControlResultSchema' },
317
+ }),
318
+ toServer(desktopWire_js_1.DAEMON_COMPUTER_DESKTOP_EVENTS.data, 'Read-only desktop stream data or a terminal close fact for one attachment generation.', {
319
+ stability: 'experimental', capability: desktopWire_js_1.COMPUTER_DESKTOP_CAPABILITY,
320
+ payload: { kind: 'zod', schema: 'computerDesktopDataSchema' },
321
+ }),
282
322
  toServer('daemon:wire:chunk', 'One slice of a tool or session response above the single-message ceiling, sha256-checked and reassembled by the API before the reassembled event reaches its normal handler. Sent only to a server that announced `serverCaps.wireChunking`; the last slice is acked by that handler (OSK-16616).', {
283
323
  delivery: 'acked',
284
324
  stability: 'experimental',
@@ -0,0 +1,140 @@
1
+ /** A separately negotiated read-only desktop stream, not a browser surface or an input grant. */
2
+ export declare const COMPUTER_DESKTOP_CAPABILITY: "computer_desktop_observe_v1";
3
+ export declare const COMPUTER_DESKTOP_SURFACE_ID: "desktop:main";
4
+ export declare const COMPUTER_DESKTOP_EVENTS: {
5
+ readonly subscribe: "computer:desktop:subscribe";
6
+ readonly protocol: "computer:desktop:protocol";
7
+ readonly unsubscribe: "computer:desktop:unsubscribe";
8
+ readonly data: "computer:desktop:data";
9
+ readonly control: "computer:desktop:control";
10
+ readonly input: "computer:desktop:input";
11
+ readonly controlChanged: "computer:desktop:control-changed";
12
+ };
13
+ export declare const DAEMON_COMPUTER_DESKTOP_EVENTS: {
14
+ readonly subscribe: "daemon:computer:desktop:subscribe";
15
+ readonly protocol: "daemon:computer:desktop:protocol";
16
+ readonly unsubscribe: "daemon:computer:desktop:unsubscribe";
17
+ readonly data: "daemon:computer:desktop:data";
18
+ readonly control: "daemon:computer:desktop:control";
19
+ readonly input: "daemon:computer:desktop:input";
20
+ readonly controlChanged: "daemon:computer:desktop:control-changed";
21
+ };
22
+ export declare const COMPUTER_DESKTOP_LIMITS: Readonly<{
23
+ maxIdChars: 160;
24
+ maxProtocolBase64Chars: number;
25
+ maxDataBase64Chars: number;
26
+ }>;
27
+ export declare const COMPUTER_DESKTOP_CLOSED_REASONS: readonly ["unavailable", "revoked", "protocol_error", "slow_viewer", "ended", "private_control"];
28
+ export type ComputerDesktopClosedReason = (typeof COMPUTER_DESKTOP_CLOSED_REASONS)[number];
29
+ export interface ComputerDesktopSubscribe {
30
+ attachmentId: string;
31
+ surfaceId: typeof COMPUTER_DESKTOP_SURFACE_ID;
32
+ }
33
+ export interface ComputerDesktopProtocol {
34
+ attachmentId: string;
35
+ streamId: string;
36
+ seq: number;
37
+ data: string;
38
+ }
39
+ export interface ComputerDesktopUnsubscribe {
40
+ attachmentId: string;
41
+ streamId: string;
42
+ }
43
+ export interface ComputerDesktopSubscribeResult {
44
+ attachmentId: string;
45
+ generation: number;
46
+ streamId: string;
47
+ surfaceId: typeof COMPUTER_DESKTOP_SURFACE_ID;
48
+ lane: 'desktop';
49
+ readOnly: true;
50
+ }
51
+ export type DaemonComputerDesktopSubscribe = ComputerDesktopSubscribe & {
52
+ requestId: string;
53
+ generation: number;
54
+ };
55
+ export type DaemonComputerDesktopProtocol = ComputerDesktopProtocol & {
56
+ requestId: string;
57
+ generation: number;
58
+ };
59
+ export type DaemonComputerDesktopUnsubscribe = ComputerDesktopUnsubscribe & {
60
+ requestId: string;
61
+ generation: number;
62
+ };
63
+ export type ComputerDesktopData = {
64
+ attachmentId: string;
65
+ generation: number;
66
+ streamId: string;
67
+ surfaceId: typeof COMPUTER_DESKTOP_SURFACE_ID;
68
+ lane: 'desktop';
69
+ } & ({
70
+ kind: 'data';
71
+ seq: number;
72
+ data: string;
73
+ } | {
74
+ kind: 'closed';
75
+ reason: ComputerDesktopClosedReason;
76
+ });
77
+ /** Canonical RFC 4648 base64 including zero pad bits; no whitespace/URL alphabet. */
78
+ export declare function isComputerDesktopBase64(value: unknown, maxChars: number): value is string;
79
+ /** Typed human input is independent of read-only RFB negotiation. */
80
+ export declare const COMPUTER_DESKTOP_CONTROL_CAPABILITY: "computer_desktop_control_v1";
81
+ export type ComputerDesktopInputEvent = {
82
+ type: 'pointer';
83
+ action: 'move' | 'down' | 'up' | 'scroll';
84
+ x: number;
85
+ y: number;
86
+ button?: 0 | 1 | 2;
87
+ deltaX?: number;
88
+ deltaY?: number;
89
+ } | {
90
+ type: 'key';
91
+ action: 'down' | 'up';
92
+ key: string;
93
+ } | {
94
+ type: 'text';
95
+ text: string;
96
+ };
97
+ export interface ComputerDesktopControl {
98
+ attachmentId: string;
99
+ streamId?: string;
100
+ action: 'takeover' | 'handback' | 'status' | 'recover_private';
101
+ expectedController?: {
102
+ sessionId: string;
103
+ turnId: string;
104
+ generation: number;
105
+ };
106
+ controlToken?: string;
107
+ epoch?: number;
108
+ }
109
+ export interface ComputerDesktopInput {
110
+ attachmentId: string;
111
+ streamId: string;
112
+ controlToken: string;
113
+ epoch: number;
114
+ seq: number;
115
+ event: ComputerDesktopInputEvent;
116
+ }
117
+ export interface ComputerDesktopControlResult {
118
+ attachmentId: string;
119
+ streamId?: string;
120
+ generation: number;
121
+ controlling: boolean;
122
+ private: boolean;
123
+ epoch: number;
124
+ controlToken?: string;
125
+ holderAttachmentId?: string;
126
+ holderUserId?: string;
127
+ state?: 'idle' | 'controlled' | 'private' | 'unavailable';
128
+ idleDeadline?: number;
129
+ }
130
+ export type DaemonComputerDesktopControl = ComputerDesktopControl & {
131
+ requestId: string;
132
+ generation: number;
133
+ userId: string;
134
+ label?: string;
135
+ };
136
+ export type DaemonComputerDesktopInput = ComputerDesktopInput & {
137
+ requestId: string;
138
+ generation: number;
139
+ userId: string;
140
+ };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.COMPUTER_DESKTOP_CONTROL_CAPABILITY = exports.COMPUTER_DESKTOP_CLOSED_REASONS = exports.COMPUTER_DESKTOP_LIMITS = exports.DAEMON_COMPUTER_DESKTOP_EVENTS = exports.COMPUTER_DESKTOP_EVENTS = exports.COMPUTER_DESKTOP_SURFACE_ID = exports.COMPUTER_DESKTOP_CAPABILITY = void 0;
4
+ exports.isComputerDesktopBase64 = isComputerDesktopBase64;
5
+ /** A separately negotiated read-only desktop stream, not a browser surface or an input grant. */
6
+ exports.COMPUTER_DESKTOP_CAPABILITY = 'computer_desktop_observe_v1';
7
+ exports.COMPUTER_DESKTOP_SURFACE_ID = 'desktop:main';
8
+ exports.COMPUTER_DESKTOP_EVENTS = {
9
+ subscribe: 'computer:desktop:subscribe',
10
+ protocol: 'computer:desktop:protocol',
11
+ unsubscribe: 'computer:desktop:unsubscribe',
12
+ data: 'computer:desktop:data',
13
+ control: 'computer:desktop:control',
14
+ input: 'computer:desktop:input',
15
+ controlChanged: 'computer:desktop:control-changed',
16
+ };
17
+ exports.DAEMON_COMPUTER_DESKTOP_EVENTS = {
18
+ subscribe: 'daemon:computer:desktop:subscribe',
19
+ protocol: 'daemon:computer:desktop:protocol',
20
+ unsubscribe: 'daemon:computer:desktop:unsubscribe',
21
+ data: 'daemon:computer:desktop:data',
22
+ control: 'daemon:computer:desktop:control',
23
+ input: 'daemon:computer:desktop:input',
24
+ controlChanged: 'daemon:computer:desktop:control-changed',
25
+ };
26
+ exports.COMPUTER_DESKTOP_LIMITS = Object.freeze({
27
+ maxIdChars: 160,
28
+ maxProtocolBase64Chars: 88 * 1024,
29
+ maxDataBase64Chars: 128 * 1024,
30
+ });
31
+ exports.COMPUTER_DESKTOP_CLOSED_REASONS = ['unavailable', 'revoked', 'protocol_error', 'slow_viewer', 'ended', 'private_control'];
32
+ /** Canonical RFC 4648 base64 including zero pad bits; no whitespace/URL alphabet. */
33
+ function isComputerDesktopBase64(value, maxChars) {
34
+ if (typeof value !== 'string' || !value.length || value.length > maxChars || value.length % 4 !== 0)
35
+ return false;
36
+ if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(value))
37
+ return false;
38
+ const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
39
+ if (value.endsWith('=='))
40
+ return (alphabet.indexOf(value[value.length - 3]) & 15) === 0;
41
+ if (value.endsWith('='))
42
+ return (alphabet.indexOf(value[value.length - 2]) & 3) === 0;
43
+ return true;
44
+ }
45
+ /** Typed human input is independent of read-only RFB negotiation. */
46
+ exports.COMPUTER_DESKTOP_CONTROL_CAPABILITY = 'computer_desktop_control_v1';
@@ -2,7 +2,7 @@
2
2
  * The first-party harness identity — the ONLY place its product name is written.
3
3
  *
4
4
  * "First-party harness" is the harness provider this platform builds, signs,
5
- * distributes and installs itself: today a fork of OpenCode sold as skrr Code.
5
+ * distributes and installs itself: today a fork of OpenCode sold as Skrr Code.
6
6
  * It is a different axis from trust Tier 1 in `harnessTrust.ts`, whose
7
7
  * "first-party" means an audited VENDOR harness such as Claude Code.
8
8
  *
@@ -68,7 +68,7 @@
68
68
  * both bundles at a distance.
69
69
  */
70
70
  export interface FirstPartyHarnessIdentity {
71
- /** What a person reads. Lowercase brand inside a compound (naming map §1). */
71
+ /** What a person reads, with the product's proper-name capitalization. */
72
72
  readonly displayName: string;
73
73
  /** The command a person types, as it appears in prose. */
74
74
  readonly command: string;
@@ -93,7 +93,7 @@ export interface FirstPartyHarnessIdentity {
93
93
  * release or a stored value written before the rename is looked for.
94
94
  */
95
95
  declare const IDENTITY: {
96
- readonly displayName: "skrr Code";
96
+ readonly displayName: "Skrr Code";
97
97
  readonly command: "skrr code";
98
98
  readonly provider: "skrr-code";
99
99
  readonly aliases: readonly [];
@@ -365,7 +365,7 @@ export declare const FIRST_PARTY_HARNESS_ENGINE: Readonly<{
365
365
  * `readFirstPartyHarnessEngineEnv` to read one the way the engine does and
366
366
  * `firstPartyHarnessEngineEnvEntries` to set one every engine build honours.
367
367
  */
368
- env: Readonly<Record<"appName" | "serverPassword" | "serverUsername" | "home" | "config" | "scriptName" | "allowUpstreamEgress" | "compatOpencode" | "noCompatPrompts" | "maxInputTokens" | "sessionId", string>>;
368
+ env: Readonly<Record<"sessionId" | "appName" | "serverPassword" | "serverUsername" | "home" | "config" | "scriptName" | "allowUpstreamEgress" | "compatOpencode" | "noCompatPrompts" | "maxInputTokens", string>>;
369
369
  }>;
370
370
  /**
371
371
  * Every name the engine reads for one purpose, current namespace first — the
@@ -3,7 +3,7 @@
3
3
  * The first-party harness identity — the ONLY place its product name is written.
4
4
  *
5
5
  * "First-party harness" is the harness provider this platform builds, signs,
6
- * distributes and installs itself: today a fork of OpenCode sold as skrr Code.
6
+ * distributes and installs itself: today a fork of OpenCode sold as Skrr Code.
7
7
  * It is a different axis from trust Tier 1 in `harnessTrust.ts`, whose
8
8
  * "first-party" means an audited VENDOR harness such as Claude Code.
9
9
  *
@@ -138,7 +138,7 @@ const PROVIDER = 'skrr-code';
138
138
  * release or a stored value written before the rename is looked for.
139
139
  */
140
140
  const IDENTITY = {
141
- displayName: 'skrr Code',
141
+ displayName: 'Skrr Code',
142
142
  command: 'skrr code',
143
143
  provider: PROVIDER,
144
144
  aliases: [],
@@ -6,7 +6,7 @@
6
6
  * wire up its logger, config dir, kill switches, and binary name — then
7
7
  * uses the rest of the API uniformly.
8
8
  */
9
- export { SCOPES, ALL_DAEMON_SCOPES, VALID_DAEMON_SCOPE_SET, isDaemonScope, OAUTH_CLI_SCOPE, type DaemonScope, type OAuthCliScope, type OAuthScope, } from './daemonScopes.js';
9
+ export { SCOPES, ALL_DAEMON_SCOPES, DEFAULT_DAEMON_SCOPES, VALID_DAEMON_SCOPE_SET, isDaemonScope, OAUTH_CLI_SCOPE, type DaemonScope, type OAuthCliScope, type OAuthScope, } from './daemonScopes.js';
10
10
  export { configureAuthCore, getAuthLogger, getAuthConfigDir, getAuthKillSwitches, getAuthBinaryName, emitAuthTelemetry, type AuthCoreConfig, type AuthLogger, type AuthKillSwitches, type AuthTelemetryEvent, } from './runtime.js';
11
11
  export { PermanentAuthFailure, TransientAuthFailure, type PermanentAuthReason, type ReauthState, type TokenPair, } from './types.js';
12
12
  export { decodeJwtExpiry, decodeJwtPayload } from './jwtUtils.js';
@@ -48,3 +48,5 @@ export { resolveConfigRoot, configRootPath, isConfigRootOverridden } from './con
48
48
  export { PROFILES_SEGMENT, SUPERSEDED_MARKER_SUFFIX, SUPERSEDED_COPY_SUFFIX, profileStateDir, legacyProfileStateDir, resolveProfileStateDir, resolveProfileStateFile, profileStateFileLocations, profileStateFilePathsToClear, consolidateProfileState, type ResolvedProfileStateDir, type ConsolidationSpec, type ConsolidationStatus, type ConsolidationOutcome, } from './profileStateDir.js';
49
49
  export * from './harnessPermissionControls.js';
50
50
  export { compareReleaseVersions } from './releaseVersions.js';
51
+ export * from './computerUse.js';
52
+ export * from './desktopWire.js';
@@ -22,11 +22,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
22
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.runHeadersHelper = exports.SENTINEL_TRIGGERING_FAILURES = exports.__resetAuthHelperFailureReasonForTest = exports.getLastAuthHelperFailureReason = exports.getDefaultHelperTtlMs = exports.invokeAuthHelper = exports.AuthHelperUnavailableError = exports.AuthHelperUntrustedError = exports.isStaticTokenKind = exports.PERSONAL_ACCESS_TOKEN_PREFIX = exports.CI_TOKEN_PREFIX = exports.classifyTokenKind = exports.invalidateAuthHelperCache = exports.__resetCredentialResolverForTest = exports.CREDENTIAL_PRECEDENCE = exports.CredentialResolver = exports.__setFdReaderForTest = exports.readAuthFromFd = exports.createRefreshScheduler = exports.UNKNOWN_401_BUDGET = exports.__resetUnknown401StreaksForTest = exports.__refreshDiagnostics = exports.installLockExitHandlers = exports.clearReauthState = exports.needsReauthState = exports.persistReauthState = exports.withAuthLock = exports.revokeDaemonRefreshSession = exports.refreshDaemonToken = exports.classifyRefreshResponse = exports.EXIT_NEEDS_REAUTH = exports.reauthCommand = exports.formatReauthMessage = exports.handleMidStreamAuthExpiry = exports.isAuthExpiredSseEvent = exports.decodeJwtPayload = exports.decodeJwtExpiry = exports.TransientAuthFailure = exports.PermanentAuthFailure = exports.emitAuthTelemetry = exports.getAuthBinaryName = exports.getAuthKillSwitches = exports.getAuthConfigDir = exports.getAuthLogger = exports.configureAuthCore = exports.OAUTH_CLI_SCOPE = exports.isDaemonScope = exports.VALID_DAEMON_SCOPE_SET = exports.ALL_DAEMON_SCOPES = exports.SCOPES = void 0;
26
- exports.jwkThumbprint = exports.generateDeviceKeyPair = exports.buildDeviceProof = exports.zeroizeKekCaches = exports.WindowsKek = exports.registerZeroizeHook = exports.MacosKek = exports.LinuxKek = exports.KekUnavailableError = exports.UnavailableKek = exports.InMemoryKek = exports.getKekStrategy = exports.__setKekStrategyForTest = exports.credEnvelopeWrap = exports.credEnvelopeUnwrap = exports.credEnvelopeSerialize = exports.credSealBuffer = exports.credOpenBuffer = exports.CRED_KEY_LEN = exports.isCredEnvelopeString = exports.generateDek = exports.CRED_ENVELOPE_MAGIC = exports.credEnvelopeEncrypt = exports.credEnvelopeDeserialize = exports.credEnvelopeDecrypt = exports.buildCredentialAad = exports.isValidRecoveryCode = exports.normalizeRecoveryCode = exports.parseRecoveryCode = exports.formatRecoveryCode = exports.MAX_TTL_DAYS = exports.MIN_TTL_DAYS = exports.parseTtlDays = exports.LoginExchangeError = exports.LoginInitError = exports.loginWithLocalhost = exports.LocalCallbackMalformedError = exports.LocalCallbackDeniedError = exports.LocalCallbackStateMismatchError = exports.LocalCallbackTimeoutError = exports.LocalCallbackBindError = exports.LocalCallbackError = exports.DEFAULT_LOGIN_TIMEOUT_MS = exports.startLocalCallback = exports.verifyChallenge = exports.safeEqual = exports.generateState = exports.challenge = exports.generateVerifier = exports.invalidateHeadersHelperCache = void 0;
27
- exports.setMachineUuidProfile = exports.getHardwareMachineUuid = exports.describeMachineIdentity = exports.getMachineUuidForProfile = exports.getMachineUuid = exports.__getDeviceIdentityStateForTest = exports.__setDeviceIdentityStateForTest = exports.__enrollmentBackoffPathForTest = exports.__enrollmentMarkerPathForTest = exports.__privateKeyPathForTest = exports.__publicKeyPathForTest = exports.describeDeviceKeySplit = exports.describeDeviceIdentityState = exports.getDevicePublicKey = exports.isDeviceIdentityActive = exports.clearEnrollmentMarker = exports.enrollWithServer = exports.signServerRequest = exports.resetDeviceIdentity = exports.initDeviceIdentity = exports.__resetShutdownGuardForTest = exports.__getCredEnvelopeStateForTest = exports.__setCredEnvelopeStateForTest = exports.__wrappedDekFilePathForTest = exports.DEFAULT_UNREADABLE_CREDENTIAL_HINT = exports.maybeDecryptOnRead = exports.maybeEncryptForWrite = exports.splitKeyConvergencePolicy = exports.describeCredEnvelopeState = exports.hasCredEnvelopePathConflict = exports.isCredEnvelopeActive = exports.shutdownCredEnvelope = exports.resetCredEnvelope = exports.initCredEnvelope = exports.verifyDpopProof = exports.normalizeDpopHtu = exports.isJwkThumbprint = exports.isAth = exports.createDpopKey = exports.accessTokenHash = exports.DPOP_PROOF_VERIFY_UNAVAILABLE = exports.DPOP_PROOF_TYP = exports.DPOP_PROOF_REQUIRED = exports.DPOP_PROOF_INVALID = exports.DPOP_MAX_AGE_SECONDS = exports.DPOP_HEADER = exports.verifyDeviceProof = exports.tokenHash = exports.publicJwkFromX = exports.normalizeHtu = void 0;
28
- exports.isLoopbackAddress = exports.isLoopbackHostname = exports.assertLoopbackHttpUrl = exports.loopbackFetch = exports.withLoopbackNoProxy = exports.envHasProxy = exports.LOOPBACK_NO_PROXY_HOSTS = exports.isDaemonChildEnv = exports.DAEMON_CHILD_ENV = exports.SENSITIVE_ENV_PREFIX_EXCEPTIONS = exports.SENSITIVE_ENV_NAME_TOKENS = exports.SENSITIVE_ENV_SUFFIXES = exports.SENSITIVE_ENV_PREFIXES = exports.SENSITIVE_ENV_VARS = exports.sanitizeSpawnEnv = exports.harnessLoadsClaudeSkillsLayout = exports.claudeSkillsLayoutEvidence = exports.HARNESSES_LOADING_CLAUDE_SKILLS_LAYOUT = exports.tierPermitsConfiguredAutoMode = exports.credentialPolicyForTier = exports.getHarnessTier = exports.HARNESS_TIERS = exports.pairUint8ArrayToBase64Url = exports.pairUint8ArrayToBase64 = exports.parsePairUrl = exports.parsePairPlaintext = exports.parsePairBundle = exports.openPairBundleBase64 = exports.generatePairKeyPair = exports.buildPairUrl = exports.buildPairAad = exports.pairBase64UrlToUint8Array = exports.pairBase64ToUint8Array = exports.assemblePairBundleBase64 = exports.PairBundleError = exports.PAIR_SECRET_LEN = exports.PAIR_PUBKEY_LEN = exports.PAIR_NONCE_LEN = exports.PAIR_BUNDLE_MAX_BASE64_LEN = exports.PAIR_AAD_MAX_LEN = exports.PAIR_AAD_PREFIX = exports.__resetCachedDaemonIdForTest = exports.legacyDaemonUuids = exports.ensureMachineDaemonId = exports.__resetMachineUuidCacheForTest = exports.HOSTED_RUNTIME_MACHINE_SOURCES = exports.hostedRuntimeIdOverride = exports.MACHINE_IDENTITY_FILENAME = exports.qualifyMachineUuid = exports.getMachineUuidProfile = void 0;
29
- exports.compareReleaseVersions = exports.consolidateProfileState = exports.profileStateFilePathsToClear = exports.profileStateFileLocations = exports.resolveProfileStateFile = exports.resolveProfileStateDir = exports.legacyProfileStateDir = exports.profileStateDir = exports.SUPERSEDED_COPY_SUFFIX = exports.SUPERSEDED_MARKER_SUFFIX = exports.PROFILES_SEGMENT = exports.isConfigRootOverridden = exports.configRootPath = exports.resolveConfigRoot = exports.verifyManifest = exports.verifyArtifact = exports.isTrustedArtifactOrigin = exports.getDeltaFor = exports.buildManifestMessage = exports.buildArtifactMessage = exports.TRUSTED_FEED_ORIGINS = exports.MAX_SIGS = exports.OVERSKY_RELEASE_PUBLIC_KEYS = exports.resolveFirstPartyHarnessChannel = exports.resolveChannelManifestUrl = exports.isFirstPartyHarnessChannel = exports.firstPartyHarnessFeedCandidates = exports.firstPartyHarnessFeedBase = exports.firstPartyHarnessChannelPrefix = exports.FIRST_PARTY_HARNESS_CHANNELS = exports.DEFAULT_FIRST_PARTY_HARNESS_CHANNEL = exports.migrateFirstPartyHarnessHome = exports.linkFirstPartyHarnessAliases = exports.firstPartyHarnessInstalledBinaryPath = exports.firstPartyHarnessHomeDir = exports.firstPartyHarnessBinDir = exports.FIRST_PARTY_HARNESS_PROVENANCE_SUFFIX = exports.FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX = exports.describeLegacyState = exports.findLegacyLocalState = exports.DEFAULT_BINARY_NAME = exports.LEGACY_NATIVE_ID_PREFIXES = exports.NATIVE_ID_PREFIX = exports.LEGACY_CONFIG_DIR_NAMES = exports.CONFIG_DIR_NAME = exports.LOOPBACK_DEFAULT_MAX_BODY_BYTES = exports.LoopbackTargetRefusedError = void 0;
25
+ exports.SENTINEL_TRIGGERING_FAILURES = exports.__resetAuthHelperFailureReasonForTest = exports.getLastAuthHelperFailureReason = exports.getDefaultHelperTtlMs = exports.invokeAuthHelper = exports.AuthHelperUnavailableError = exports.AuthHelperUntrustedError = exports.isStaticTokenKind = exports.PERSONAL_ACCESS_TOKEN_PREFIX = exports.CI_TOKEN_PREFIX = exports.classifyTokenKind = exports.invalidateAuthHelperCache = exports.__resetCredentialResolverForTest = exports.CREDENTIAL_PRECEDENCE = exports.CredentialResolver = exports.__setFdReaderForTest = exports.readAuthFromFd = exports.createRefreshScheduler = exports.UNKNOWN_401_BUDGET = exports.__resetUnknown401StreaksForTest = exports.__refreshDiagnostics = exports.installLockExitHandlers = exports.clearReauthState = exports.needsReauthState = exports.persistReauthState = exports.withAuthLock = exports.revokeDaemonRefreshSession = exports.refreshDaemonToken = exports.classifyRefreshResponse = exports.EXIT_NEEDS_REAUTH = exports.reauthCommand = exports.formatReauthMessage = exports.handleMidStreamAuthExpiry = exports.isAuthExpiredSseEvent = exports.decodeJwtPayload = exports.decodeJwtExpiry = exports.TransientAuthFailure = exports.PermanentAuthFailure = exports.emitAuthTelemetry = exports.getAuthBinaryName = exports.getAuthKillSwitches = exports.getAuthConfigDir = exports.getAuthLogger = exports.configureAuthCore = exports.OAUTH_CLI_SCOPE = exports.isDaemonScope = exports.VALID_DAEMON_SCOPE_SET = exports.DEFAULT_DAEMON_SCOPES = exports.ALL_DAEMON_SCOPES = exports.SCOPES = void 0;
26
+ exports.generateDeviceKeyPair = exports.buildDeviceProof = exports.zeroizeKekCaches = exports.WindowsKek = exports.registerZeroizeHook = exports.MacosKek = exports.LinuxKek = exports.KekUnavailableError = exports.UnavailableKek = exports.InMemoryKek = exports.getKekStrategy = exports.__setKekStrategyForTest = exports.credEnvelopeWrap = exports.credEnvelopeUnwrap = exports.credEnvelopeSerialize = exports.credSealBuffer = exports.credOpenBuffer = exports.CRED_KEY_LEN = exports.isCredEnvelopeString = exports.generateDek = exports.CRED_ENVELOPE_MAGIC = exports.credEnvelopeEncrypt = exports.credEnvelopeDeserialize = exports.credEnvelopeDecrypt = exports.buildCredentialAad = exports.isValidRecoveryCode = exports.normalizeRecoveryCode = exports.parseRecoveryCode = exports.formatRecoveryCode = exports.MAX_TTL_DAYS = exports.MIN_TTL_DAYS = exports.parseTtlDays = exports.LoginExchangeError = exports.LoginInitError = exports.loginWithLocalhost = exports.LocalCallbackMalformedError = exports.LocalCallbackDeniedError = exports.LocalCallbackStateMismatchError = exports.LocalCallbackTimeoutError = exports.LocalCallbackBindError = exports.LocalCallbackError = exports.DEFAULT_LOGIN_TIMEOUT_MS = exports.startLocalCallback = exports.verifyChallenge = exports.safeEqual = exports.generateState = exports.challenge = exports.generateVerifier = exports.invalidateHeadersHelperCache = exports.runHeadersHelper = void 0;
27
+ exports.getHardwareMachineUuid = exports.describeMachineIdentity = exports.getMachineUuidForProfile = exports.getMachineUuid = exports.__getDeviceIdentityStateForTest = exports.__setDeviceIdentityStateForTest = exports.__enrollmentBackoffPathForTest = exports.__enrollmentMarkerPathForTest = exports.__privateKeyPathForTest = exports.__publicKeyPathForTest = exports.describeDeviceKeySplit = exports.describeDeviceIdentityState = exports.getDevicePublicKey = exports.isDeviceIdentityActive = exports.clearEnrollmentMarker = exports.enrollWithServer = exports.signServerRequest = exports.resetDeviceIdentity = exports.initDeviceIdentity = exports.__resetShutdownGuardForTest = exports.__getCredEnvelopeStateForTest = exports.__setCredEnvelopeStateForTest = exports.__wrappedDekFilePathForTest = exports.DEFAULT_UNREADABLE_CREDENTIAL_HINT = exports.maybeDecryptOnRead = exports.maybeEncryptForWrite = exports.splitKeyConvergencePolicy = exports.describeCredEnvelopeState = exports.hasCredEnvelopePathConflict = exports.isCredEnvelopeActive = exports.shutdownCredEnvelope = exports.resetCredEnvelope = exports.initCredEnvelope = exports.verifyDpopProof = exports.normalizeDpopHtu = exports.isJwkThumbprint = exports.isAth = exports.createDpopKey = exports.accessTokenHash = exports.DPOP_PROOF_VERIFY_UNAVAILABLE = exports.DPOP_PROOF_TYP = exports.DPOP_PROOF_REQUIRED = exports.DPOP_PROOF_INVALID = exports.DPOP_MAX_AGE_SECONDS = exports.DPOP_HEADER = exports.verifyDeviceProof = exports.tokenHash = exports.publicJwkFromX = exports.normalizeHtu = exports.jwkThumbprint = void 0;
28
+ exports.isLoopbackHostname = exports.assertLoopbackHttpUrl = exports.loopbackFetch = exports.withLoopbackNoProxy = exports.envHasProxy = exports.LOOPBACK_NO_PROXY_HOSTS = exports.isDaemonChildEnv = exports.DAEMON_CHILD_ENV = exports.SENSITIVE_ENV_PREFIX_EXCEPTIONS = exports.SENSITIVE_ENV_NAME_TOKENS = exports.SENSITIVE_ENV_SUFFIXES = exports.SENSITIVE_ENV_PREFIXES = exports.SENSITIVE_ENV_VARS = exports.sanitizeSpawnEnv = exports.harnessLoadsClaudeSkillsLayout = exports.claudeSkillsLayoutEvidence = exports.HARNESSES_LOADING_CLAUDE_SKILLS_LAYOUT = exports.tierPermitsConfiguredAutoMode = exports.credentialPolicyForTier = exports.getHarnessTier = exports.HARNESS_TIERS = exports.pairUint8ArrayToBase64Url = exports.pairUint8ArrayToBase64 = exports.parsePairUrl = exports.parsePairPlaintext = exports.parsePairBundle = exports.openPairBundleBase64 = exports.generatePairKeyPair = exports.buildPairUrl = exports.buildPairAad = exports.pairBase64UrlToUint8Array = exports.pairBase64ToUint8Array = exports.assemblePairBundleBase64 = exports.PairBundleError = exports.PAIR_SECRET_LEN = exports.PAIR_PUBKEY_LEN = exports.PAIR_NONCE_LEN = exports.PAIR_BUNDLE_MAX_BASE64_LEN = exports.PAIR_AAD_MAX_LEN = exports.PAIR_AAD_PREFIX = exports.__resetCachedDaemonIdForTest = exports.legacyDaemonUuids = exports.ensureMachineDaemonId = exports.__resetMachineUuidCacheForTest = exports.HOSTED_RUNTIME_MACHINE_SOURCES = exports.hostedRuntimeIdOverride = exports.MACHINE_IDENTITY_FILENAME = exports.qualifyMachineUuid = exports.getMachineUuidProfile = exports.setMachineUuidProfile = void 0;
29
+ exports.compareReleaseVersions = exports.consolidateProfileState = exports.profileStateFilePathsToClear = exports.profileStateFileLocations = exports.resolveProfileStateFile = exports.resolveProfileStateDir = exports.legacyProfileStateDir = exports.profileStateDir = exports.SUPERSEDED_COPY_SUFFIX = exports.SUPERSEDED_MARKER_SUFFIX = exports.PROFILES_SEGMENT = exports.isConfigRootOverridden = exports.configRootPath = exports.resolveConfigRoot = exports.verifyManifest = exports.verifyArtifact = exports.isTrustedArtifactOrigin = exports.getDeltaFor = exports.buildManifestMessage = exports.buildArtifactMessage = exports.TRUSTED_FEED_ORIGINS = exports.MAX_SIGS = exports.OVERSKY_RELEASE_PUBLIC_KEYS = exports.resolveFirstPartyHarnessChannel = exports.resolveChannelManifestUrl = exports.isFirstPartyHarnessChannel = exports.firstPartyHarnessFeedCandidates = exports.firstPartyHarnessFeedBase = exports.firstPartyHarnessChannelPrefix = exports.FIRST_PARTY_HARNESS_CHANNELS = exports.DEFAULT_FIRST_PARTY_HARNESS_CHANNEL = exports.migrateFirstPartyHarnessHome = exports.linkFirstPartyHarnessAliases = exports.firstPartyHarnessInstalledBinaryPath = exports.firstPartyHarnessHomeDir = exports.firstPartyHarnessBinDir = exports.FIRST_PARTY_HARNESS_PROVENANCE_SUFFIX = exports.FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX = exports.describeLegacyState = exports.findLegacyLocalState = exports.DEFAULT_BINARY_NAME = exports.LEGACY_NATIVE_ID_PREFIXES = exports.NATIVE_ID_PREFIX = exports.LEGACY_CONFIG_DIR_NAMES = exports.CONFIG_DIR_NAME = exports.LOOPBACK_DEFAULT_MAX_BODY_BYTES = exports.LoopbackTargetRefusedError = exports.isLoopbackAddress = void 0;
30
30
  // Daemon scope vocabulary — single source of truth for non-Mongoose tiers
31
31
  // (daemon, desktop, cli). Schema-bound canonical lives in
32
32
  // `@skrr-ai/data-schemas/common/daemonScopes`; the two are kept byte-equal
@@ -34,6 +34,7 @@ exports.compareReleaseVersions = exports.consolidateProfileState = exports.profi
34
34
  var daemonScopes_js_1 = require("./daemonScopes.js");
35
35
  Object.defineProperty(exports, "SCOPES", { enumerable: true, get: function () { return daemonScopes_js_1.SCOPES; } });
36
36
  Object.defineProperty(exports, "ALL_DAEMON_SCOPES", { enumerable: true, get: function () { return daemonScopes_js_1.ALL_DAEMON_SCOPES; } });
37
+ Object.defineProperty(exports, "DEFAULT_DAEMON_SCOPES", { enumerable: true, get: function () { return daemonScopes_js_1.DEFAULT_DAEMON_SCOPES; } });
37
38
  Object.defineProperty(exports, "VALID_DAEMON_SCOPE_SET", { enumerable: true, get: function () { return daemonScopes_js_1.VALID_DAEMON_SCOPE_SET; } });
38
39
  Object.defineProperty(exports, "isDaemonScope", { enumerable: true, get: function () { return daemonScopes_js_1.isDaemonScope; } });
39
40
  Object.defineProperty(exports, "OAUTH_CLI_SCOPE", { enumerable: true, get: function () { return daemonScopes_js_1.OAUTH_CLI_SCOPE; } });
@@ -443,3 +444,5 @@ Object.defineProperty(exports, "consolidateProfileState", { enumerable: true, ge
443
444
  __exportStar(require("./harnessPermissionControls.js"), exports);
444
445
  var releaseVersions_js_1 = require("./releaseVersions.js");
445
446
  Object.defineProperty(exports, "compareReleaseVersions", { enumerable: true, get: function () { return releaseVersions_js_1.compareReleaseVersions; } });
447
+ __exportStar(require("./computerUse.js"), exports);
448
+ __exportStar(require("./desktopWire.js"), exports);
@@ -0,0 +1,228 @@
1
+ /**
2
+ * Computer Use v1 is a host-to-host protocol, never a model tool schema.
3
+ * Models see exactly the runtime's js/js_reset surface. In particular, script
4
+ * contents cannot prove that a call is read-only or supply execution identity.
5
+ * Kept dependency-free so daemon, API, browser and native clients agree.
6
+ */
7
+ export declare const COMPUTER_USE_TOOL: "ComputerUse";
8
+ export declare const COMPUTER_USE_PROVIDER: "lcu";
9
+ export declare const COMPUTER_USE_PROTOCOL: "computer_use_mcp_v1";
10
+ export declare const COMPUTER_USE_ROTATE_CREDENTIAL_EVENT: "daemon:computer-use:rotate-credential";
11
+ /** Owner-approved hosted credential upgrade; no bearer secret travels in this request. */
12
+ export interface ComputerUseRotateCredentialRequest {
13
+ requestId: string;
14
+ ownerUserId: string;
15
+ machineUuid: string;
16
+ leaseId: string;
17
+ generation: number;
18
+ }
19
+ export declare const COMPUTER_USE_EXECUTION_CAPABILITY: "computer_use";
20
+ export declare const COMPUTER_USE_CLOUD_CONSENT: "computer_use_cloud_agents_v1";
21
+ export declare const COMPUTER_USE_PUBLIC_TOOLS: readonly ["js", "js_reset"];
22
+ export type ComputerUsePublicTool = (typeof COMPUTER_USE_PUBLIC_TOOLS)[number];
23
+ export declare const COMPUTER_USE_OPERATIONS: readonly ["describe", "call", "end_turn", "close", "status", "control_stop"];
24
+ export type ComputerUseOperation = (typeof COMPUTER_USE_OPERATIONS)[number];
25
+ export type ComputerUseSurfaceMode = 'computer' | 'browser' | 'all';
26
+ export type ComputerUseEndReason = 'Stop' | 'Interrupt';
27
+ /** Identity is derived from authenticated execution, never tool arguments. */
28
+ export interface ComputerUseHostContext {
29
+ principalId: string;
30
+ machineId: string;
31
+ sessionId: string;
32
+ turnId: string;
33
+ generation: number;
34
+ toolCallId?: string;
35
+ agentId?: string;
36
+ engine?: string;
37
+ conversationId?: string;
38
+ contextKey?: string;
39
+ }
40
+ export interface ComputerUseBudgets {
41
+ activeExecutionMs: number;
42
+ humanResponseMs: number;
43
+ totalLifetimeMs: number;
44
+ cleanupGraceMs: number;
45
+ }
46
+ export declare const COMPUTER_USE_DEFAULT_BUDGETS: Readonly<ComputerUseBudgets>;
47
+ /** Negotiated ceilings; exceeding a limit is an error, never silent clipping. */
48
+ export declare const COMPUTER_USE_LIMITS: Readonly<{
49
+ maxEnvelopeBytes: number;
50
+ maxInstructionsBytes: number;
51
+ maxSchemaBytes: number;
52
+ maxContentBlocks: 512;
53
+ maxIdentityChars: 512;
54
+ maxActiveExecutionMs: 900000;
55
+ maxHumanResponseMs: 900000;
56
+ maxTotalLifetimeMs: 1800000;
57
+ maxCleanupGraceMs: 60000;
58
+ }>;
59
+ /** Preserve upstream fields and schemas, including annotations and extensions. */
60
+ export interface ComputerUseToolDescriptor {
61
+ name: ComputerUsePublicTool;
62
+ description?: string;
63
+ inputSchema: Record<string, unknown>;
64
+ [key: string]: unknown;
65
+ }
66
+ export interface ComputerUseMcpContent {
67
+ type: string;
68
+ [key: string]: unknown;
69
+ }
70
+ export interface ComputerUseMcpResult {
71
+ content: ComputerUseMcpContent[];
72
+ isError?: boolean;
73
+ structuredContent?: Record<string, unknown>;
74
+ [key: string]: unknown;
75
+ }
76
+ export interface ComputerUseVersions {
77
+ lcu: string;
78
+ adapter?: string;
79
+ app?: string;
80
+ runtime?: string;
81
+ [key: string]: string | undefined;
82
+ }
83
+ export interface ComputerUseRuntimePolicy {
84
+ replPersistence: 'turn';
85
+ audioCleanup: 'retire-runtime';
86
+ }
87
+ export interface ComputerUseSurface {
88
+ protocol: typeof COMPUTER_USE_PROTOCOL;
89
+ provider: typeof COMPUTER_USE_PROVIDER;
90
+ instructions: string;
91
+ tools: ComputerUseToolDescriptor[];
92
+ versions: ComputerUseVersions;
93
+ /** Digest of the actual instructions and full descriptors, not a version label. */
94
+ digest: string;
95
+ surfaceMode: ComputerUseSurfaceMode;
96
+ /** Host-observed lifecycle constraints, separate from original runtime instructions. */
97
+ runtimePolicy?: ComputerUseRuntimePolicy;
98
+ }
99
+ /** Preserve original documentation while explaining the host's narrower lifecycle. */
100
+ export declare function computerUseModelInstructions(surface: ComputerUseSurface): string;
101
+ export declare const COMPUTER_USE_RUNTIME_STATES: readonly ["disabled", "starting", "ready", "executing", "awaiting_approval", "ending_turn", "unavailable", "closed"];
102
+ export type ComputerUseRuntimeState = (typeof COMPUTER_USE_RUNTIME_STATES)[number];
103
+ export interface ComputerUseReadiness {
104
+ provider: typeof COMPUTER_USE_PROVIDER;
105
+ protocol: typeof COMPUTER_USE_PROTOCOL;
106
+ state: ComputerUseRuntimeState;
107
+ available: boolean;
108
+ enabled: boolean;
109
+ cloudAgentsAllowed: boolean;
110
+ reason?: string;
111
+ versions?: ComputerUseVersions;
112
+ surfaceDigest?: string;
113
+ /** Capability readiness is independent of whether a person granted consent. */
114
+ browserReady?: boolean;
115
+ audioReady?: boolean;
116
+ }
117
+ export interface ComputerUseStatus extends ComputerUseReadiness {
118
+ controller?: Pick<ComputerUseHostContext, 'sessionId' | 'turnId' | 'generation' | 'agentId' | 'conversationId'>;
119
+ pendingApprovalId?: string;
120
+ cleanupConfirmed?: boolean;
121
+ }
122
+ export type ComputerUseInput = {
123
+ operation: 'describe';
124
+ surfaceMode?: ComputerUseSurfaceMode;
125
+ } | {
126
+ operation: 'call';
127
+ tool: ComputerUsePublicTool;
128
+ arguments: Record<string, unknown>;
129
+ surfaceDigest?: string;
130
+ budgets?: Partial<ComputerUseBudgets>;
131
+ } | {
132
+ operation: 'end_turn';
133
+ reason: ComputerUseEndReason;
134
+ } | {
135
+ operation: 'close';
136
+ reason?: string;
137
+ } | {
138
+ operation: 'status';
139
+ } | {
140
+ operation: 'control_stop';
141
+ reason?: string;
142
+ };
143
+ export type ComputerUseRequest = ComputerUseInput & {
144
+ protocol: typeof COMPUTER_USE_PROTOCOL;
145
+ provider: typeof COMPUTER_USE_PROVIDER;
146
+ context: ComputerUseHostContext;
147
+ };
148
+ export interface ComputerUseCleanupResult {
149
+ /** True only after the runtime confirms execution can no longer produce input. */
150
+ cleanupConfirmed: boolean;
151
+ closed: boolean;
152
+ generation: number;
153
+ }
154
+ export type ComputerUseResponse = {
155
+ operation: 'describe';
156
+ surface: ComputerUseSurface;
157
+ } | {
158
+ operation: 'call';
159
+ mcpResult: ComputerUseMcpResult;
160
+ } | {
161
+ operation: 'status';
162
+ status: ComputerUseStatus;
163
+ } | {
164
+ operation: 'end_turn' | 'close' | 'control_stop';
165
+ cleanup: ComputerUseCleanupResult;
166
+ };
167
+ export declare const COMPUTER_USE_ELICITATION_CHOICES: readonly ["once", "session", "always", "decline"];
168
+ export type ComputerUseElicitationChoice = (typeof COMPUTER_USE_ELICITATION_CHOICES)[number];
169
+ export interface ComputerUseElicitationOption {
170
+ value: ComputerUseElicitationChoice;
171
+ label: string;
172
+ description?: string;
173
+ }
174
+ /** This is a dedicated permission request, not AskUserQuestion or sticky tool approval. */
175
+ export interface ComputerUseElicitationRequest {
176
+ kind: 'computer_use_runtime';
177
+ requestId: string;
178
+ context: ComputerUseHostContext & {
179
+ toolCallId: string;
180
+ };
181
+ message: string;
182
+ resource?: Record<string, unknown>;
183
+ options: ComputerUseElicitationOption[];
184
+ expiresAt: number;
185
+ }
186
+ export interface ComputerUseElicitationResponse {
187
+ requestId: string;
188
+ context: ComputerUseHostContext & {
189
+ toolCallId: string;
190
+ };
191
+ choice: ComputerUseElicitationChoice;
192
+ }
193
+ export declare class ComputerUseContractError extends Error {
194
+ readonly code: string;
195
+ constructor(code: string, message: string);
196
+ }
197
+ /** Validate the hosted rotation envelope before changing runtime admission. */
198
+ export declare function assertComputerUseRotateCredentialRequest(value: unknown): asserts value is ComputerUseRotateCredentialRequest;
199
+ export declare function assertComputerUseHostContext(value: unknown): asserts value is ComputerUseHostContext;
200
+ export declare function computerUseBudgets(value?: unknown): ComputerUseBudgets;
201
+ export declare function assertComputerUseInput(value: unknown): asserts value is ComputerUseInput;
202
+ export declare function assertComputerUseRequest(value: unknown): asserts value is ComputerUseRequest;
203
+ export declare function assertComputerUseSurface(value: unknown): asserts value is ComputerUseSurface;
204
+ /** Validate the envelope without rewriting blocks or discarding upstream extensions. */
205
+ export declare function assertComputerUseMcpResult(value: unknown): asserts value is ComputerUseMcpResult;
206
+ /** Compare full execution identity; a matching conversation alone never grants access. */
207
+ export declare function sameComputerUseContext(left: ComputerUseHostContext, right: ComputerUseHostContext): boolean;
208
+ export declare function assertComputerUseElicitationRequest(value: unknown): asserts value is ComputerUseElicitationRequest;
209
+ export declare function assertComputerUseElicitationResponse(value: unknown): asserts value is ComputerUseElicitationResponse;
210
+ /** A human answer can only satisfy this exact pending request and offered scope.
211
+ * This matcher is not authentication: the caller must verify the human responder.
212
+ */
213
+ export declare function acceptsComputerUseElicitationResponse(request: ComputerUseElicitationRequest, response: ComputerUseElicitationResponse, now?: number): boolean;
214
+ export type ComputerUseModelProjectionOptions = {
215
+ audio: 'inline';
216
+ } | {
217
+ audio: 'artifact-reference';
218
+ principalId: string;
219
+ sessionId: string;
220
+ consumer?: string;
221
+ };
222
+ /**
223
+ * Consumer capability projection, never a rewrite of the canonical daemon
224
+ * result. Some model hosts accept MCP AudioContent but silently omit its bytes.
225
+ * Those hosts receive explicit references to already-persisted owned audio.
226
+ * This function never uploads, transcribes, invents a path or grants access.
227
+ */
228
+ export declare function projectComputerUseResultForModel(result: ComputerUseMcpResult, options: ComputerUseModelProjectionOptions): ComputerUseMcpResult;