@lasso-ai/cli 2.1.23 → 2.1.25
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/dist/cli/auth.d.ts +2 -9
- package/dist/cli/bridge.d.ts +1 -290
- package/dist/cli/bridge.js +18 -0
- package/dist/cli/create.d.ts +2 -15
- package/dist/cli/project.d.ts +2 -42
- package/dist/cli/runtime-client.d.ts +15 -0
- package/dist/cli/runtime-client.js +13 -0
- package/dist/core/interfaces/agent-runtime.d.ts +308 -0
- package/dist/core/interfaces/agent-runtime.js +8 -0
- package/dist/core/interfaces/backend.d.ts +274 -0
- package/dist/core/interfaces/backend.js +38 -0
- package/dist/core/interfaces/data.d.ts +398 -0
- package/dist/core/interfaces/data.js +2 -0
- package/dist/core/interfaces/review.d.ts +12 -0
- package/dist/core/interfaces/review.js +2 -0
- package/dist/core/interfaces/session-runner.d.ts +27 -0
- package/dist/core/interfaces/session-runner.js +2 -0
- package/dist/core/interfaces/tool-protocol.d.ts +40 -0
- package/dist/core/interfaces/tool-protocol.js +13 -0
- package/dist/core/interfaces/types.d.ts +1 -0
- package/dist/core/interfaces/types.js +2 -0
- package/dist/core/interfaces/verification.d.ts +24 -0
- package/dist/core/interfaces/verification.js +2 -0
- package/dist/core/interfaces/workspace.d.ts +23 -0
- package/dist/core/interfaces/workspace.js +2 -0
- package/dist/overlay.js +2 -1
- package/dist/runtime/action-executor.d.ts +2 -11
- package/dist/runtime/action-executor.js +7 -0
- package/dist/runtime/agent-runtime.d.ts +2 -308
- package/dist/runtime/agent-runtime.js +16 -6
- package/dist/runtime/backend-interface.d.ts +2 -274
- package/dist/runtime/backend-interface.js +16 -36
- package/dist/runtime/local-session-runner.d.ts +3 -36
- package/dist/runtime/review.d.ts +2 -15
- package/dist/runtime/tool-protocol.d.ts +2 -40
- package/dist/runtime/tool-protocol.js +16 -11
- package/dist/runtime/verification-engine.d.ts +2 -27
- package/dist/runtime/verification-engine.js +6 -0
- package/dist/runtime/workspace-guard.d.ts +2 -23
- package/package.json +1 -1
|
@@ -12,42 +12,9 @@
|
|
|
12
12
|
* the npm CLI) provide: a pre-captured WorkspaceGuard, the backend instance,
|
|
13
13
|
* the TaskContext, and an event sink. Persistence stays host-side.
|
|
14
14
|
*/
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
import { PendingChange } from "./review";
|
|
19
|
-
export interface LocalSessionOutcome {
|
|
20
|
-
/** Backend-reported success (terminal success signal + clean exit). */
|
|
21
|
-
success: boolean;
|
|
22
|
-
/** Session status to persist: waiting (review) | completed | failed. */
|
|
23
|
-
status: "waiting" | "completed" | "failed";
|
|
24
|
-
summary?: string;
|
|
25
|
-
/** Reviewable text changes (workspace already rolled back). */
|
|
26
|
-
changes: PendingChange[];
|
|
27
|
-
binaryPaths: string[];
|
|
28
|
-
/** Normalized actions replacing any backend-reported ones. */
|
|
29
|
-
actions: AgentAction[];
|
|
30
|
-
observations: Observation[];
|
|
31
|
-
errors: AgentError[];
|
|
32
|
-
conversation: Array<{
|
|
33
|
-
role: "user" | "assistant" | "system";
|
|
34
|
-
content: string;
|
|
35
|
-
timestamp: number;
|
|
36
|
-
}>;
|
|
37
|
-
externalSessionId?: string;
|
|
38
|
-
/** Suggested session metadata updates (backend provider/model/session id). */
|
|
39
|
-
metadata: Record<string, unknown>;
|
|
40
|
-
}
|
|
41
|
-
export interface LocalSessionRunnerOptions {
|
|
42
|
-
sessionId: string;
|
|
43
|
-
backend: IBackend;
|
|
44
|
-
/** Workspace captured BEFORE the agent ran. Consumed (diffed + restored). */
|
|
45
|
-
guard: WorkspaceGuard;
|
|
46
|
-
/** Sink for wire-format AgentEvents (forward to SSE / UI / in-memory). */
|
|
47
|
-
emit: (event: AgentEvent) => void;
|
|
48
|
-
/** Current phase, recorded on observations/errors. */
|
|
49
|
-
phase?: AgentPhase;
|
|
50
|
-
}
|
|
15
|
+
import { TaskContext } from "./backend-interface";
|
|
16
|
+
import type { LocalSessionOutcome, LocalSessionRunnerOptions } from "../core/interfaces/session-runner";
|
|
17
|
+
export type { LocalSessionOutcome, LocalSessionRunnerOptions } from "../core/interfaces/session-runner";
|
|
51
18
|
export declare class LocalSessionRunner {
|
|
52
19
|
private readonly options;
|
|
53
20
|
private restored;
|
package/dist/runtime/review.d.ts
CHANGED
|
@@ -6,19 +6,6 @@
|
|
|
6
6
|
* pendingChanges contract consumed by the review UI and the apply flow.
|
|
7
7
|
*/
|
|
8
8
|
import { FileChange } from "./workspace-guard";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
filePath: string;
|
|
12
|
-
oldString: string;
|
|
13
|
-
newString: string;
|
|
14
|
-
operation: "created" | "modified" | "deleted";
|
|
15
|
-
}
|
|
16
|
-
export interface WorkspaceReview {
|
|
17
|
-
/** Reviewable (text) changes in the wire format used by the review UI. */
|
|
18
|
-
changes: PendingChange[];
|
|
19
|
-
/** Paths of binary changes — preserved for rollback, not shown as text. */
|
|
20
|
-
binaryPaths: string[];
|
|
21
|
-
/** Normalized session actions matching the reviewable changes. */
|
|
22
|
-
actions: AgentAction[];
|
|
23
|
-
}
|
|
9
|
+
export type { PendingChange, WorkspaceReview } from "../core/interfaces/review";
|
|
10
|
+
import type { WorkspaceReview } from "../core/interfaces/review";
|
|
24
11
|
export declare function diffToReview(rawChanges: FileChange[]): WorkspaceReview;
|
|
@@ -1,40 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* The server orchestrates the agent loop and calls the hosted model, but it
|
|
5
|
-
* never touches the user's filesystem. When the model requests a workspace
|
|
6
|
-
* action (read/edit/run/verify/...), the server emits a `tool_call` event over
|
|
7
|
-
* the runtime event channel (SSE). The local CLI executes the tool against
|
|
8
|
-
* the real project directory and posts the result back to
|
|
9
|
-
* `POST /sessions/:sessionId/tool-results`, where the orchestrator feeds it
|
|
10
|
-
* back into the model loop.
|
|
11
|
-
*/
|
|
12
|
-
import type { AgentAction, AgentError, Observation } from "./agent-runtime";
|
|
13
|
-
/** A tool execution request from the server to the local CLI. */
|
|
14
|
-
export interface ToolCallRequest {
|
|
15
|
-
/** Unique id correlating the request with its result. */
|
|
16
|
-
callId: string;
|
|
17
|
-
sessionId: string;
|
|
18
|
-
/** `action` = workspace tool; `verify` = run the verification engine. */
|
|
19
|
-
kind: "action" | "verify";
|
|
20
|
-
/** Present when kind === "action". */
|
|
21
|
-
action?: AgentAction;
|
|
22
|
-
/** Present when kind === "verify". */
|
|
23
|
-
verify?: {
|
|
24
|
-
phase?: string;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
/** The CLI's response to a tool_call, posted back to the server. */
|
|
28
|
-
export interface ToolCallResultPayload {
|
|
29
|
-
callId: string;
|
|
30
|
-
success: boolean;
|
|
31
|
-
output?: unknown;
|
|
32
|
-
error?: string;
|
|
33
|
-
/** Observations to feed back into the model's context. */
|
|
34
|
-
observations?: Observation[];
|
|
35
|
-
/** Errors to record on the session (e.g. verification failures). */
|
|
36
|
-
errors?: AgentError[];
|
|
37
|
-
}
|
|
38
|
-
/** Default per-tool timeouts (ms). run_command is long-running by nature. */
|
|
39
|
-
export declare const TOOL_CALL_TIMEOUT_MS: Record<string, number>;
|
|
40
|
-
export declare function toolCallTimeoutMs(tool: string): number;
|
|
1
|
+
/** @deprecated Runtime protocol contracts now live in `core/interfaces/tool-protocol`. */
|
|
2
|
+
export * from "../core/interfaces/tool-protocol";
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
10
15
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/** @deprecated Runtime protocol contracts now live in `core/interfaces/tool-protocol`. */
|
|
18
|
+
__exportStar(require("../core/interfaces/tool-protocol"), exports);
|
|
@@ -1,37 +1,12 @@
|
|
|
1
1
|
import { Observation, AgentError, AgentPhase } from "./agent-runtime";
|
|
2
|
+
import type { VerificationConfig, VerificationResult } from "../core/interfaces/verification";
|
|
3
|
+
export type { VerificationConfig, VerificationResult } from "../core/interfaces/verification";
|
|
2
4
|
/**
|
|
3
5
|
* Verification Engine - Verifies changes after execution
|
|
4
6
|
*
|
|
5
7
|
* Mandatory verification step in the agent loop.
|
|
6
8
|
* Timeouts are failures or inconclusive observations, never proof of success.
|
|
7
9
|
*/
|
|
8
|
-
export interface VerificationConfig {
|
|
9
|
-
typecheckTimeout: number;
|
|
10
|
-
buildTimeout: number;
|
|
11
|
-
devServerTimeout: number;
|
|
12
|
-
browserTimeout: number;
|
|
13
|
-
/** URL of the project's already-running dev server, if available. */
|
|
14
|
-
devServerUrl?: string;
|
|
15
|
-
/** Optional browser bridge used for DOM/runtime verification. */
|
|
16
|
-
browserContextProvider?: (action: {
|
|
17
|
-
id: string;
|
|
18
|
-
type: "browser_check";
|
|
19
|
-
data?: Record<string, unknown>;
|
|
20
|
-
}) => Promise<unknown>;
|
|
21
|
-
}
|
|
22
|
-
export interface VerificationResult {
|
|
23
|
-
type: "typecheck" | "build" | "dev_server" | "browser";
|
|
24
|
-
success: boolean;
|
|
25
|
-
/** Set when the check could not meaningfully run (no tsconfig, no build script). */
|
|
26
|
-
skipped?: boolean;
|
|
27
|
-
/** Command that produced this result, when applicable. */
|
|
28
|
-
command?: string;
|
|
29
|
-
output?: string;
|
|
30
|
-
error?: string;
|
|
31
|
-
observations: Observation[];
|
|
32
|
-
errors: AgentError[];
|
|
33
|
-
duration: number;
|
|
34
|
-
}
|
|
35
10
|
export declare class VerificationEngine {
|
|
36
11
|
private projectPath;
|
|
37
12
|
private config;
|
|
@@ -9,6 +9,12 @@ const node_fs_1 = __importDefault(require("node:fs"));
|
|
|
9
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const node_util_1 = require("node:util");
|
|
11
11
|
const exec = (0, node_util_1.promisify)(node_child_process_1.exec);
|
|
12
|
+
/**
|
|
13
|
+
* Verification Engine - Verifies changes after execution
|
|
14
|
+
*
|
|
15
|
+
* Mandatory verification step in the agent loop.
|
|
16
|
+
* Timeouts are failures or inconclusive observations, never proof of success.
|
|
17
|
+
*/
|
|
12
18
|
class VerificationEngine {
|
|
13
19
|
projectPath;
|
|
14
20
|
config;
|
|
@@ -11,29 +11,8 @@
|
|
|
11
11
|
* oversized files), computes a normalized diff against the captured state,
|
|
12
12
|
* and can restore the workspace exactly (content + permission bits + deletions).
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
filePath: string;
|
|
17
|
-
operation: "created" | "modified" | "deleted";
|
|
18
|
-
/** Full original text content (text files only) */
|
|
19
|
-
oldContent?: string;
|
|
20
|
-
/** Full new text content (text files only) */
|
|
21
|
-
newContent?: string;
|
|
22
|
-
/** True when the file is binary — contents are preserved for rollback but not reviewable as text */
|
|
23
|
-
binary?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export interface WorkspaceGuardOptions {
|
|
26
|
-
/** Directory names that are never captured (defaults cover Node/tooling outputs) */
|
|
27
|
-
ignoreDirs?: string[];
|
|
28
|
-
/** Extra ignore predicates (relative path, isDirectory) */
|
|
29
|
-
ignore?: (relPath: string, isDir: boolean) => boolean;
|
|
30
|
-
/** Max bytes held in memory per file; larger files are copied to a temp dir (default 4MB) */
|
|
31
|
-
maxMemoryFileSize?: number;
|
|
32
|
-
/** Max total bytes held in memory before oversized handling kicks in per file (default 64MB) */
|
|
33
|
-
maxTotalBytes?: number;
|
|
34
|
-
/** Max directory recursion depth (default 32) */
|
|
35
|
-
maxDepth?: number;
|
|
36
|
-
}
|
|
14
|
+
import type { FileChange, WorkspaceGuardOptions } from "../core/interfaces/workspace";
|
|
15
|
+
export type { FileChange, WorkspaceGuardOptions } from "../core/interfaces/workspace";
|
|
37
16
|
export declare class WorkspaceGuard {
|
|
38
17
|
readonly root: string;
|
|
39
18
|
private readonly files;
|
package/package.json
CHANGED