@lasso-ai/cli 1.2.3 → 1.2.5
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/ARCHITECTURE.md +10 -3
- package/CHANGELOG.md +38 -0
- package/README.md +23 -3
- package/dist/cli/agent.d.ts +38 -2
- package/dist/cli/agent.js +521 -72
- package/dist/cli/auth.js +3 -1
- package/dist/cli/bridge.d.ts +22 -6
- package/dist/cli/bridge.js +182 -49
- package/dist/cli/index.js +10 -0
- package/dist/cli/oneshot.d.ts +19 -1
- package/dist/cli/oneshot.js +611 -106
- package/dist/cli/project.d.ts +2 -1
- package/dist/cli/project.js +71 -26
- package/dist/overlay.js +8668 -6431
- package/package.json +1 -1
package/ARCHITECTURE.md
CHANGED
|
@@ -85,6 +85,13 @@ Responsibilities, and _only_ these:
|
|
|
85
85
|
`_debugSource` fiber data.
|
|
86
86
|
- Take a screenshot of the selection (`html2canvas`) — visual context measurably improves
|
|
87
87
|
edit quality even when the AI has the source.
|
|
88
|
+
- Capture the page's runtime health: uncaught `window` errors, unhandled promise
|
|
89
|
+
rejections, and the host app's `console.error` output. Listeners are installed when
|
|
90
|
+
the overlay script evaluates (before the app's own modules), so failures during
|
|
91
|
+
initial load — a broken import, a missing named export — are recorded as well. The
|
|
92
|
+
latest five unique entries travel with every request (`context.runtimeErrors` for
|
|
93
|
+
select/drag, `pageContext.runtimeErrors` for one-shot) and are cleared on apply so
|
|
94
|
+
they always describe the code that is running now.
|
|
88
95
|
- Show the inline prompt box anchored to the selection (never a blocking `prompt()`).
|
|
89
96
|
- Render the diff/accept/undo UI once the CLI streams a proposed change back.
|
|
90
97
|
- Render concurrent Agent Tasks with In progress/Completed tabs and task-level review
|
|
@@ -118,8 +125,8 @@ A Node process that wraps the user's existing dev server. Entry: `src/cli/index.
|
|
|
118
125
|
never touched on disk.
|
|
119
126
|
3. Host the WebSocket bridge (`src/cli/bridge.ts`) the browser overlay connects to.
|
|
120
127
|
4. On a selection + instruction: read the referenced source file(s), assemble context
|
|
121
|
-
(source snippet, imports, relevant CSS/Tailwind config, screenshot,
|
|
122
|
-
hand it to the coding agent (§6).
|
|
128
|
+
(source snippet, imports, relevant CSS/Tailwind config, screenshot, captured
|
|
129
|
+
console/runtime errors, instruction), and hand it to the coding agent (§6).
|
|
123
130
|
5. Hold the returned diff in memory and stream it to the browser for preview — never write
|
|
124
131
|
on receipt.
|
|
125
132
|
6. On accept: snapshot the file's prior content (for undo), then apply the diff.
|
|
@@ -163,7 +170,7 @@ Lasso ships its own default agent, but the CLI's job is to assemble _context_, n
|
|
|
163
170
|
married to one model.
|
|
164
171
|
|
|
165
172
|
```
|
|
166
|
-
context (source + screenshot + instruction)
|
|
173
|
+
context (source + screenshot + console errors + instruction)
|
|
167
174
|
│
|
|
168
175
|
▼
|
|
169
176
|
┌───────────────┐
|
package/CHANGELOG.md
CHANGED
|
@@ -9,11 +9,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
### Changed
|
|
11
11
|
|
|
12
|
+
- **`lasso init` registers against the Lasso API, not the realtime server.**
|
|
13
|
+
Project registration (`init`, `register`, `create`) now posts to
|
|
14
|
+
`serverUrlFrom()` — `https://api.lasso.byorello.space` by default — because the
|
|
15
|
+
API owns the workspace's project records and stores the local `.lasso` domain.
|
|
16
|
+
The realtime/collab server (`…/api/v1/collab/projects/register`) is only tried
|
|
17
|
+
when the API cannot be reached. Override with `LASSO_API_URL` /
|
|
18
|
+
`LASSO_SERVER_URL`.
|
|
12
19
|
- **One-shot mode as sidebar panel**: Changed one-shot mode from a centered modal to a right-side sidebar panel that only appears during one-shot mode. When users exit one-shot mode, they return to the normal edit mode with just the toolbar. This provides a cleaner, more integrated experience similar to modern AI editors.
|
|
13
20
|
- **Mini toolbar positioning**: Adjusted the mini toolbar position to `left: calc(50% + 140px)` (reduced from 280px) to reduce overlap with the main toolbar. Added smooth transition and centered positioning when the main toolbar is dismissed. Mini toolbar is now hidden when one-shot sidebar is open to avoid UI clutter.
|
|
14
21
|
|
|
15
22
|
### Added
|
|
16
23
|
|
|
24
|
+
- **Console-aware agent context**: the overlay now captures the page's runtime
|
|
25
|
+
health — uncaught `window` errors, unhandled promise rejections, and anything
|
|
26
|
+
the host app logs through `console.error` — starting from the moment the overlay
|
|
27
|
+
script loads, so failures during initial page load (for example
|
|
28
|
+
`SyntaxError: The requested module … does not provide an export named …` from a
|
|
29
|
+
broken import) are recorded too. The latest five unique entries (1200 chars each)
|
|
30
|
+
are attached to every request:
|
|
31
|
+
- **Select / component flow**: `edit`, `ask`, and drag requests carry
|
|
32
|
+
`context.runtimeErrors`, which the agent prompt renders as an explicit
|
|
33
|
+
`LIVE CONSOLE/RUNTIME ERRORS` block alongside the element and source context.
|
|
34
|
+
- **One-shot flow**: `pageContext.runtimeErrors` travels with the ⌘K request and
|
|
35
|
+
renders as a `Console/Runtime Errors` line in the live page context — local
|
|
36
|
+
plan/conversation prompts and the hosted agent gateway alike.
|
|
37
|
+
- **Runtime errors are part of the task**: agent instructions treat listed console
|
|
38
|
+
errors as work to fix, and require verifying named package exports (via
|
|
39
|
+
`run_command` over `node_modules` or the package docs) before importing them, so a
|
|
40
|
+
guessed export name cannot kill the page with a SyntaxError.
|
|
41
|
+
- **Error buffer resets on apply**: applying a change clears the captured runtime
|
|
42
|
+
errors, so the next prompt only reflects errors produced by the new code.
|
|
17
43
|
- **Multiple access points for one-shot mode**: Added a Command button to the toolbar (⌘ icon) for opening the one-shot sidebar, in addition to the existing ⌘K keyboard shortcut. The sidebar includes a model selector dropdown allowing users to choose their AI model before submitting a one-shot request.
|
|
18
44
|
- **Model selector in command sidebar**: The one-shot sidebar now displays the currently selected model with a dropdown to switch between available models. The selector is organized by provider (Anthropic, OpenAI, Google, Local Agents) for easy navigation.
|
|
19
45
|
- **Cursor CLI support**: Added Cursor as a local agent option alongside Claude Code, Codex, and OpenCode. Users can now select Cursor models in the model dropdown if Cursor is installed on their system. Cursor uses similar output parsing to Claude Code with progress tracking and error handling.
|
|
@@ -130,6 +156,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
130
156
|
name, version, workspaceId }` so the overlay can join the right (workspace-
|
|
131
157
|
gated) session. The bridge only forwards a config it successfully authenticated.
|
|
132
158
|
|
|
159
|
+
### Fixed
|
|
160
|
+
|
|
161
|
+
- **Useless `Project registration failed (400)` from `lasso init`**: the CLI only
|
|
162
|
+
read `body.message`, but the registration endpoint answers with `{ error }`, so
|
|
163
|
+
every server-side validation message was dropped and collapsed into the generic
|
|
164
|
+
status line. The server text is surfaced now, e.g.
|
|
165
|
+
`"domain" is not allowed (HTTP 400)`.
|
|
166
|
+
- **Selected element missing from one-shot page context**: `capturePageContext()`
|
|
167
|
+
read `state.selectedElement`, which does not exist on the overlay state (the
|
|
168
|
+
property is `state.selected`), so the inspected element never reached the page
|
|
169
|
+
context. The same mistake failed `typecheck:overlay`.
|
|
170
|
+
|
|
133
171
|
## [0.1.0] - 2026-09-21
|
|
134
172
|
|
|
135
173
|
### Added
|
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ Lasso works differently.
|
|
|
66
66
|
| | Lasso |
|
|
67
67
|
|---|---|
|
|
68
68
|
| 🎯 **Point at the UI** | Select exactly what you want to change |
|
|
69
|
-
| 🧠 **AI understands context** | The selected component is resolved back to your source |
|
|
69
|
+
| 🧠 **AI understands context** | The selected component is resolved back to your source, plus the live page state (DOM summary, screenshot, console/runtime errors) |
|
|
70
70
|
| 📝 **Real code changes** | Lasso modifies your actual source files |
|
|
71
71
|
| 👀 **Preview first** | Every change comes back as a diff |
|
|
72
72
|
| 🔒 **You stay in control** | Nothing is written until you explicitly accept |
|
|
@@ -97,6 +97,24 @@ Lasso now supports two equally powerful ways to build:
|
|
|
97
97
|
These modes work together naturally: use one-shot to generate large features, then
|
|
98
98
|
visual mode to refine specific parts.
|
|
99
99
|
|
|
100
|
+
### Console-aware context
|
|
101
|
+
|
|
102
|
+
Both modes receive the page's runtime health alongside the DOM and screenshot
|
|
103
|
+
context. The overlay captures:
|
|
104
|
+
|
|
105
|
+
- uncaught `window` errors and unhandled promise rejections
|
|
106
|
+
- anything your app logs through `console.error`
|
|
107
|
+
|
|
108
|
+
Capture starts with the overlay script itself, so failures during the initial page
|
|
109
|
+
load (a broken import, a missing named export) are recorded too. The latest five
|
|
110
|
+
unique entries ride along with every request — as `context.runtimeErrors` for
|
|
111
|
+
select/drag prompts and as `pageContext.runtimeErrors` for ⌘K one-shot prompts —
|
|
112
|
+
and the agent is instructed to treat listed errors as part of the task instead of
|
|
113
|
+
working around them.
|
|
114
|
+
|
|
115
|
+
The buffer is cleared when you apply a change, so the next prompt only reflects
|
|
116
|
+
errors produced by the new code.
|
|
117
|
+
|
|
100
118
|
### Visual selection
|
|
101
119
|
|
|
102
120
|
Turn on Lasso Mode and interact with your application normally.
|
|
@@ -156,7 +174,8 @@ or:
|
|
|
156
174
|
|
|
157
175
|
> "Add a loading state below this button."
|
|
158
176
|
|
|
159
|
-
Lasso assembles the relevant source context
|
|
177
|
+
Lasso assembles the relevant source context — source files, screenshot, and the
|
|
178
|
+
page's console/runtime errors — and sends it to your configured coding agent.
|
|
160
179
|
|
|
161
180
|
### Diff-first workflow
|
|
162
181
|
|
|
@@ -496,6 +515,7 @@ Lasso has three main pieces.
|
|
|
496
515
|
│ │
|
|
497
516
|
│ Select UI element │
|
|
498
517
|
│ Capture screenshot │
|
|
518
|
+
│ Console errors │
|
|
499
519
|
│ Presence, locks, │
|
|
500
520
|
│ comments, voice │
|
|
501
521
|
└──────────┬───────────┘
|
|
@@ -544,7 +564,7 @@ The CLI:
|
|
|
544
564
|
2. Resolves the selected component
|
|
545
565
|
3. Reads the relevant source
|
|
546
566
|
4. Collects imports and surrounding context
|
|
547
|
-
5. Captures the selected UI
|
|
567
|
+
5. Captures the selected UI and the page's console/runtime errors
|
|
548
568
|
6. Sends the assembled context to your configured agent
|
|
549
569
|
7. Receives a proposed change
|
|
550
570
|
8. Shows you the diff
|
package/dist/cli/agent.d.ts
CHANGED
|
@@ -39,17 +39,20 @@ type AgentInput = {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
export type AgentConfig = {
|
|
42
|
-
provider: "anthropic" | "openai" | "google" | "ollama" | "claude-code" | "codex" | "opencode" | "cursor";
|
|
42
|
+
provider: "anthropic" | "openai" | "google" | "ollama" | "nvidia" | "claude-code" | "codex" | "opencode" | "cursor";
|
|
43
43
|
apiKey?: string;
|
|
44
44
|
model?: string;
|
|
45
45
|
baseUrl?: string;
|
|
46
|
+
lassoKey?: string;
|
|
47
|
+
serverUrl?: string;
|
|
46
48
|
};
|
|
49
|
+
export declare function installPackages(cwd: string, packages: string[], onProgress?: AgentProgress): Promise<string[]>;
|
|
47
50
|
export type LocalAgent = "claude-code" | "codex" | "opencode" | "cursor";
|
|
48
51
|
export type AgentProgressLevel = "working" | "error";
|
|
49
52
|
export type AgentProgress = (message: string, detail?: string, level?: AgentProgressLevel) => void;
|
|
50
53
|
export type AgentPrompt = {
|
|
51
54
|
message: string;
|
|
52
|
-
kind: "permission" | "input";
|
|
55
|
+
kind: "permission" | "input" | "multiselect";
|
|
53
56
|
options?: string[];
|
|
54
57
|
};
|
|
55
58
|
export type AgentPromptHandler = (prompt: AgentPrompt) => void;
|
|
@@ -61,9 +64,42 @@ export type AgentAnswer = {
|
|
|
61
64
|
messages?: AgentInput["messages"];
|
|
62
65
|
};
|
|
63
66
|
export declare function respondToAgentPrompt(taskId: string, value: string): boolean;
|
|
67
|
+
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<{
|
|
74
|
+
stdout: string;
|
|
75
|
+
stderr: string;
|
|
76
|
+
exitCode: number;
|
|
77
|
+
}>;
|
|
64
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;
|
|
65
100
|
export declare function proposeChanges(cwd: string, input: AgentInput, config: AgentConfig, signal?: AbortSignal, onProgress?: AgentProgress, onPrompt?: AgentPromptHandler): Promise<{
|
|
66
101
|
summary: string;
|
|
102
|
+
packages?: string[];
|
|
67
103
|
changes: SourceChange[];
|
|
68
104
|
}>;
|
|
69
105
|
export declare function answerQuestion(cwd: string, input: AgentAnswer, config: AgentConfig, signal?: AbortSignal, onProgress?: AgentProgress, onPrompt?: AgentPromptHandler): Promise<string>;
|