@lasso-ai/cli 1.2.4 → 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 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, instruction), and
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 and sends it to your configured coding agent.
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
@@ -211,7 +211,9 @@ async function initProject(cwd, fileEnv, forcedDomain) {
211
211
  try {
212
212
  let response;
213
213
  try {
214
- response = await (0, auth_1.fetchWithTimeout)(`${collabApi}/collab/projects/register`, {
214
+ // Registration lives on the Lasso API (api.lasso.byorello.space): it owns
215
+ // the workspace's project records and stores the local `.lasso` domain.
216
+ response = await (0, auth_1.fetchWithTimeout)(`${serverUrl}/api/v1/collab/projects/register`, {
215
217
  method: "POST",
216
218
  headers: {
217
219
  "content-type": "application/json",
@@ -221,8 +223,8 @@ async function initProject(cwd, fileEnv, forcedDomain) {
221
223
  });
222
224
  }
223
225
  catch {
224
- // Fall back to main server if collab server unreachable
225
- response = await (0, auth_1.fetchWithTimeout)(`${serverUrl}/api/v1/collab/projects/register`, {
226
+ // Fall back to the realtime/collab server if the API is unreachable
227
+ response = await (0, auth_1.fetchWithTimeout)(`${collabApi}/collab/projects/register`, {
226
228
  method: "POST",
227
229
  headers: {
228
230
  "content-type": "application/json",
@@ -239,7 +241,8 @@ async function initProject(cwd, fileEnv, forcedDomain) {
239
241
  if (response.status === 403) {
240
242
  return { ok: false, error: "Your API key does not have access to a Lasso workspace." };
241
243
  }
242
- return { ok: false, error: body.message || `Project registration failed (${response.status}).` };
244
+ const detail = body.message || body.error;
245
+ return { ok: false, error: detail ? `${detail} (HTTP ${response.status})` : `Project registration failed (${response.status}).` };
243
246
  }
244
247
  const projectId = body.project?.id || existingConfig?.id;
245
248
  if (!projectId) {
@@ -264,7 +267,7 @@ async function initProject(cwd, fileEnv, forcedDomain) {
264
267
  }
265
268
  catch (error) {
266
269
  const reason = error instanceof Error ? error.message : "request failed";
267
- return { ok: false, error: `Could not reach the Lasso realtime server at ${realtimeUrl} (${reason}). Is it running?` };
270
+ return { ok: false, error: `Could not reach the Lasso API at ${serverUrl} (${reason}). Is it running?` };
268
271
  }
269
272
  }
270
273
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lasso-ai/cli",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Select any part of your running app, describe a change, and let AI edit the real source code.",
5
5
  "type": "commonjs",
6
6
  "main": "dist/cli/index.js",