@lasso-ai/cli 1.4.5 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/cli/agent.d.ts +10 -89
  2. package/dist/cli/agent.js +66 -1412
  3. package/dist/cli/backends.d.ts +53 -0
  4. package/dist/cli/backends.js +267 -0
  5. package/dist/cli/bridge-old.d.ts +259 -0
  6. package/dist/cli/bridge-old.js +1350 -0
  7. package/dist/cli/bridge.d.ts +22 -12
  8. package/dist/cli/bridge.js +824 -1174
  9. package/dist/cli/host/install.js +12 -1
  10. package/dist/cli/host/next-host-entry.js +0 -2
  11. package/dist/cli/host/vite-host-entry.js +1 -3
  12. package/dist/cli/local-runtime.d.ts +28 -0
  13. package/dist/cli/local-runtime.js +294 -0
  14. package/dist/cli/oneshot.js +177 -961
  15. package/dist/cli/runtime-client.d.ts +310 -0
  16. package/dist/cli/runtime-client.js +178 -0
  17. package/dist/cli/snapshot.d.ts +3 -1
  18. package/dist/cli/snapshot.js +8 -1
  19. package/dist/overlay.js +44 -28
  20. package/dist/runtime/__tests__/adapter-normalization.test.d.ts +1 -0
  21. package/dist/runtime/__tests__/adapter-normalization.test.js +392 -0
  22. package/dist/runtime/__tests__/state-machine.test.d.ts +1 -0
  23. package/dist/runtime/__tests__/state-machine.test.js +107 -0
  24. package/dist/runtime/__tests__/verification-engine.test.d.ts +1 -0
  25. package/dist/runtime/__tests__/verification-engine.test.js +91 -0
  26. package/dist/runtime/__tests__/workspace-guard.test.d.ts +1 -0
  27. package/dist/runtime/__tests__/workspace-guard.test.js +104 -0
  28. package/dist/runtime/adapters/claude-code-adapter.d.ts +46 -0
  29. package/dist/runtime/adapters/claude-code-adapter.js +230 -0
  30. package/dist/runtime/adapters/codex-cli-adapter.d.ts +44 -0
  31. package/dist/runtime/adapters/codex-cli-adapter.js +202 -0
  32. package/dist/runtime/adapters/cursor-adapter.d.ts +47 -0
  33. package/dist/runtime/adapters/cursor-adapter.js +214 -0
  34. package/dist/runtime/adapters/factory.d.ts +19 -0
  35. package/dist/runtime/adapters/factory.js +48 -0
  36. package/dist/runtime/adapters/local-agent-adapter.d.ts +143 -0
  37. package/dist/runtime/adapters/local-agent-adapter.js +408 -0
  38. package/dist/runtime/adapters/opencode-adapter.d.ts +43 -0
  39. package/dist/runtime/adapters/opencode-adapter.js +210 -0
  40. package/dist/runtime/agent-runtime.d.ts +286 -0
  41. package/dist/runtime/agent-runtime.js +8 -0
  42. package/dist/runtime/agent-state-machine.d.ts +67 -0
  43. package/dist/runtime/agent-state-machine.js +234 -0
  44. package/dist/runtime/backend-interface.d.ts +272 -0
  45. package/dist/runtime/backend-interface.js +38 -0
  46. package/dist/runtime/event-mapper.d.ts +11 -0
  47. package/dist/runtime/event-mapper.js +40 -0
  48. package/dist/runtime/index.d.ts +20 -0
  49. package/dist/runtime/index.js +43 -0
  50. package/dist/runtime/local-session-runner.d.ts +60 -0
  51. package/dist/runtime/local-session-runner.js +185 -0
  52. package/dist/runtime/review.d.ts +24 -0
  53. package/dist/runtime/review.js +30 -0
  54. package/dist/runtime/verification-engine.d.ts +71 -0
  55. package/dist/runtime/verification-engine.js +374 -0
  56. package/dist/runtime/workspace-guard.d.ts +70 -0
  57. package/dist/runtime/workspace-guard.js +321 -0
  58. package/docs/local-coding-agents.md +183 -0
  59. package/package.json +22 -3
@@ -2,106 +2,27 @@ export type SourceChange = {
2
2
  filePath: string;
3
3
  oldString: string;
4
4
  newString: string;
5
- };
6
- export type AgentInput = {
7
- taskId?: string;
8
- instruction: string;
9
- model: string;
10
- messages?: Array<{
11
- role: string;
12
- content: string;
13
- createdAt?: string;
14
- }>;
15
- changesHistory?: Array<{
16
- summary: string;
17
- changes: SourceChange[];
18
- createdAt?: string;
19
- }>;
20
- context?: {
21
- selectionId?: string;
22
- position?: Record<string, number>;
23
- viewport?: Record<string, unknown>;
24
- styles?: Record<string, string>;
25
- attributes?: Record<string, string>;
26
- runtimeErrors?: string[];
27
- screenshots?: {
28
- full?: string;
29
- element?: string;
30
- };
31
- drag?: Record<string, any>;
32
- };
33
- element: {
34
- tag: string;
35
- group: string;
36
- label: string;
37
- html?: string;
38
- sourceHint?: string;
39
- };
5
+ operation?: "created" | "modified" | "deleted";
40
6
  };
41
7
  export type AgentConfig = {
42
- provider: "anthropic" | "openai" | "google" | "ollama" | "nvidia" | "claude-code" | "codex" | "opencode" | "cursor";
8
+ provider: "anthropic" | "openai" | "google" | "ollama" | "nvidia";
43
9
  apiKey?: string;
44
10
  model?: string;
45
11
  baseUrl?: string;
46
12
  lassoKey?: string;
47
13
  serverUrl?: string;
48
14
  };
49
- export declare function installPackages(cwd: string, packages: string[], onProgress?: AgentProgress): Promise<string[]>;
50
- export type LocalAgent = "claude-code" | "codex" | "opencode" | "cursor";
51
- export type AgentProgressLevel = "working" | "error";
52
- export type AgentProgress = (message: string, detail?: string, level?: AgentProgressLevel) => void;
53
- export type AgentPrompt = {
54
- message: string;
55
- kind: "permission" | "input" | "multiselect";
56
- options?: string[];
57
- };
58
- export type AgentPromptHandler = (prompt: AgentPrompt) => void;
59
- export type AgentAnswer = {
60
- taskId?: string;
15
+ export type AgentProgress = (status: "thinking" | "working" | "review" | "error" | "stopped", message: string, detail?: string) => void;
16
+ export type AgentPromptHandler = (prompt: {
61
17
  question: string;
62
- context?: AgentInput["context"];
63
- element: AgentInput["element"];
64
- messages?: AgentInput["messages"];
65
- };
18
+ options?: string[];
19
+ }) => void;
66
20
  export declare function respondToAgentPrompt(taskId: string, value: string): boolean;
67
21
  export declare function waitForAgentPrompt(taskId: string, timeoutMs?: number): Promise<string>;
68
- export declare function executeWebSearch(query: string, maxResults?: number): Promise<Array<{
69
- title: string;
70
- url: string;
71
- snippet: string;
72
- }>>;
73
- export declare function executeAgentCommand(cwd: string, command: string, timeout?: number): Promise<{
22
+ export declare function installPackages(cwd: string, packages: string[], onProgress?: AgentProgress): Promise<string[]>;
23
+ export declare function executeWebSearch(query: string, apiKey?: string, signal?: AbortSignal): Promise<string>;
24
+ export declare function executeAgentCommand(cwd: string, command: string, signal?: AbortSignal, onProgress?: AgentProgress): Promise<{
74
25
  stdout: string;
75
26
  stderr: string;
76
- exitCode: number;
77
- }>;
78
- export declare function detectLocalAgents(): Promise<Set<LocalAgent>>;
79
- export type AgentStepAction = {
80
- type: "run_command";
81
- command: string;
82
- thought?: string;
83
- } | {
84
- type: "web_search";
85
- query: string;
86
- thought?: string;
87
- } | {
88
- type: "ask_user";
89
- question: string;
90
- kind?: "permission" | "input" | "multiselect";
91
- options?: string[];
92
- thought?: string;
93
- } | {
94
- type: "proposal";
95
- summary: string;
96
- packages?: string[];
97
- changes: SourceChange[];
98
- };
99
- export declare function parseAgentAction(text: string): AgentStepAction;
100
- export declare function runLocalAgentPrompt(cwd: string, config: AgentConfig, prompt: string, signal?: AbortSignal, onProgress?: AgentProgress, taskId?: string, onPrompt?: AgentPromptHandler): Promise<string>;
101
- export declare function proposeChanges(cwd: string, input: AgentInput, config: AgentConfig, signal?: AbortSignal, onProgress?: AgentProgress, onPrompt?: AgentPromptHandler): Promise<{
102
- summary: string;
103
- packages?: string[];
104
- changes: SourceChange[];
27
+ exitCode: number | null;
105
28
  }>;
106
- export declare function answerQuestion(cwd: string, input: AgentAnswer, config: AgentConfig, signal?: AbortSignal, onProgress?: AgentProgress, onPrompt?: AgentPromptHandler): Promise<string>;
107
- export declare function generateCommitMessage(cwd: string, status: string[], config: AgentConfig, signal?: AbortSignal, onProgress?: AgentProgress): Promise<string>;