@skrr-ai/cli 0.1.114 → 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 (55) hide show
  1. package/dist/commands/agents/chat.js +10 -1
  2. package/dist/commands/computer-use/audio.d.ts +6 -0
  3. package/dist/commands/computer-use/audio.js +9 -0
  4. package/dist/commands/computer-use/browser.d.ts +7 -0
  5. package/dist/commands/computer-use/browser.js +16 -0
  6. package/dist/commands/computer-use/disable.d.ts +6 -0
  7. package/dist/commands/computer-use/disable.js +9 -0
  8. package/dist/commands/computer-use/enable.d.ts +6 -0
  9. package/dist/commands/computer-use/enable.js +9 -0
  10. package/dist/commands/computer-use/index.d.ts +6 -0
  11. package/dist/commands/computer-use/index.js +9 -0
  12. package/dist/commands/computer-use/install.d.ts +6 -0
  13. package/dist/commands/computer-use/install.js +9 -0
  14. package/dist/commands/computer-use/recover.d.ts +6 -0
  15. package/dist/commands/computer-use/recover.js +9 -0
  16. package/dist/commands/computer-use/status.d.ts +6 -0
  17. package/dist/commands/computer-use/status.js +9 -0
  18. package/dist/commands/computer-use/stop.d.ts +6 -0
  19. package/dist/commands/computer-use/stop.js +9 -0
  20. package/dist/commands/daemon/login.js +1 -1
  21. package/dist/commands/followups/plans/cancel.js +10 -3
  22. package/dist/commands/followups/plans/capacity.d.ts +9 -0
  23. package/dist/commands/followups/plans/capacity.js +42 -0
  24. package/dist/commands/followups/plans/create.js +3 -0
  25. package/dist/commands/followups/plans/revise.js +13 -6
  26. package/dist/lib/agentic-stream.d.ts +5 -1
  27. package/dist/lib/agentic-stream.js +25 -9
  28. package/dist/lib/computer-use.d.ts +9 -0
  29. package/dist/lib/computer-use.js +41 -0
  30. package/dist/lib/lookbackPlans.d.ts +20 -6
  31. package/dist/lib/lookbackPlans.js +19 -5
  32. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerUse.d.ts +228 -0
  33. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerUse.js +375 -0
  34. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.d.ts +4 -1
  35. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.js +6 -2
  36. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +40 -0
  37. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopWire.d.ts +140 -0
  38. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopWire.js +46 -0
  39. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.d.ts +1 -1
  40. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +3 -1
  41. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +8 -5
  42. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerUse.d.ts +228 -0
  43. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerUse.js +358 -0
  44. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.d.ts +4 -1
  45. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.js +5 -1
  46. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +40 -0
  47. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopWire.d.ts +140 -0
  48. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopWire.js +42 -0
  49. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.d.ts +1 -1
  50. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +3 -1
  51. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +3 -1
  52. package/dist/node_modules/@skrr-ai/auth-core/package.json +21 -1
  53. package/dist/node_modules/@skrr-ai/data-provider/index.js +23687 -23456
  54. package/oclif.manifest.json +284 -4
  55. package/package.json +2 -2
@@ -1,13 +1,27 @@
1
- import { lookbackPlansApi, type CreateLookbackPlanRequest, type LookbackPlan, type LookbackPlanInput } from '@skrr-ai/data-provider';
2
- export { lookbackPlansApi };
1
+ import { lookbackPlansApi, isLookbackMutationOutcomeUnknown, type CreateLookbackPlanRequest, type LookbackPlan, type LookbackPlanInput } from '@skrr-ai/data-provider';
2
+ export { lookbackPlansApi, isLookbackMutationOutcomeUnknown };
3
3
  export declare function lookbackInputFailure(error: unknown): {
4
+ code: "LOOKBACK_INVALID_FIELD" | "LOOKBACK_INVALID_TIME" | "LOOKBACK_INVALID_TIMEZONE" | "LOOKBACK_AMBIGUOUS_TIME" | "LOOKBACK_NONEXISTENT_TIME" | "LOOKBACK_LIMIT_EXCEEDED";
5
+ message: string;
6
+ details: {
7
+ field?: string | undefined;
8
+ stage: string;
9
+ retryCondition: string;
10
+ remedy: string;
11
+ };
4
12
  exit: number;
5
13
  retryable: boolean;
6
- details?: {
7
- field: string;
8
- } | undefined;
9
- code: "LOOKBACK_INVALID_FIELD" | "LOOKBACK_INVALID_TIME" | "LOOKBACK_INVALID_TIMEZONE" | "LOOKBACK_AMBIGUOUS_TIME" | "LOOKBACK_NONEXISTENT_TIME" | "LOOKBACK_LIMIT_EXCEEDED";
14
+ };
15
+ export declare function lookbackUnconfirmedFailure(details: Record<string, unknown>): {
16
+ code: string;
10
17
  message: string;
18
+ exit: number;
19
+ retryable: boolean;
20
+ details: {
21
+ stage: string;
22
+ retryCondition: string;
23
+ remedy: string;
24
+ };
11
25
  };
12
26
  export declare const lookbackPlanIdArg: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
13
27
  /** JSON can be the plan itself or the canonical create envelope. Never copy identity fields. */
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lookbackPlanIdArg = exports.lookbackPlansApi = void 0;
3
+ exports.lookbackPlanIdArg = exports.isLookbackMutationOutcomeUnknown = exports.lookbackPlansApi = void 0;
4
4
  exports.lookbackInputFailure = lookbackInputFailure;
5
+ exports.lookbackUnconfirmedFailure = lookbackUnconfirmedFailure;
5
6
  exports.lookbackCreateBody = lookbackCreateBody;
6
7
  exports.lookbackInput = lookbackInput;
7
8
  exports.lookbackPlanSummary = lookbackPlanSummary;
@@ -9,6 +10,7 @@ exports.lookbackArmingLine = lookbackArmingLine;
9
10
  const core_1 = require("@oclif/core");
10
11
  const data_provider_1 = require("@skrr-ai/data-provider");
11
12
  Object.defineProperty(exports, "lookbackPlansApi", { enumerable: true, get: function () { return data_provider_1.lookbackPlansApi; } });
13
+ Object.defineProperty(exports, "isLookbackMutationOutcomeUnknown", { enumerable: true, get: function () { return data_provider_1.isLookbackMutationOutcomeUnknown; } });
12
14
  const followups_1 = require("./followups");
13
15
  class LookbackValidationError extends Error {
14
16
  issue;
@@ -18,12 +20,23 @@ class LookbackValidationError extends Error {
18
20
  }
19
21
  }
20
22
  function lookbackInputFailure(error) {
23
+ const repair = { stage: 'validation', retryCondition: 'correct_input',
24
+ remedy: 'Correct the indicated input field before submitting again.',
25
+ ...(error instanceof LookbackValidationError ? { field: error.issue.field } : {}),
26
+ };
21
27
  return {
22
28
  code: error instanceof LookbackValidationError ? error.issue.code : 'LOOKBACK_INVALID_FIELD',
23
29
  message: error instanceof Error ? error.message : String(error),
24
- ...(error instanceof LookbackValidationError ? { details: { field: error.issue.field } } : {}),
25
- exit: 2,
26
- retryable: false,
30
+ // BaseCommand's machine envelope carries additive domain facts in details.
31
+ details: repair, exit: 2, retryable: false,
32
+ };
33
+ }
34
+ function lookbackUnconfirmedFailure(details) {
35
+ return {
36
+ code: 'LOOKBACK_OUTCOME_UNCONFIRMED', message: 'The plan update outcome could not be confirmed. Read the original source or known plan before submitting another change.',
37
+ exit: 5, retryable: false,
38
+ details: { stage: 'lifecycle', retryCondition: 'read_original_source_or_known_plan',
39
+ remedy: 'Read the known plan or original source. Do not submit a replacement source or blindly repeat this mutation.', ...details },
27
40
  };
28
41
  }
29
42
  exports.lookbackPlanIdArg = core_1.Args.string({
@@ -75,7 +88,8 @@ function lookbackInput(raw, allowPast = false) {
75
88
  return raw;
76
89
  }
77
90
  function lookbackPlanSummary(plan) {
78
- const next = plan.steps.find((step) => step.state === 'pending');
91
+ const next = plan.steps.filter((step) => step.state === 'pending')
92
+ .reduce((earliest, step) => !earliest || Date.parse(step.runAt) < Date.parse(earliest.runAt) ? step : earliest, undefined);
79
93
  return `${plan.id} [${plan.state}] r${plan.revision} ${plan.title || plan.objective}` +
80
94
  ` ${plan.steps.length} lookbacks${next ? ` next:${next.runAt}` : ''}`;
81
95
  }
@@ -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;