@lasso-ai/cli 1.1.1 → 1.1.2

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 (3) hide show
  1. package/ARCHITECTURE.md +35 -27
  2. package/README.md +29 -32
  3. package/package.json +1 -1
package/ARCHITECTURE.md CHANGED
@@ -170,38 +170,46 @@ context (source + screenshot + instruction)
170
170
  │ Agent adapter │ interface: given context, return old/new string pairs
171
171
  └───────┬───────┘
172
172
  │
173
- ┌──────┼───────────────────┬─────────────────────┐
174
- ▼ ▼ ▼ ▼
175
- Built-in Claude Code User's own CLI coding Any future
176
- agent (headless/ agent (Cursor CLI, adapter
177
- (default) `claude -p`) Aider, etc.)
173
+ ┌──────┼──────────────┬─────────────────┐
174
+ ▼ ▼ ▼ ▼
175
+ Hosted Claude Code Codex OpenCode
176
+ model `claude -p` `codex exec` `opencode run`
178
177
  ```
179
178
 
180
- - **Built-in agent** (`agent: "builtin"`): default path, zero setup, calls a hosted model
181
- directly (`@anthropic-ai/sdk`) with the assembled context and the old/new-string contract
182
- from §5.3.
183
- - **Claude Code passthrough** (`agent: "claude-code"`): the CLI shells out to Claude Code
184
- in headless/print mode (`claude -p`), passing the assembled context as the prompt and
185
- parsing its file edits back into the same diff-preview pipeline. This lets a user keep
186
- using their existing Claude Code setup (subscription, project memory, MCP tools) while
187
- still getting the point-and-select UX.
188
- - **Bring-your-own-agent** (`agent: "custom"`): define the adapter interface once (context
189
- in, old/new-string pairs out) and let power users wire in whatever CLI coding tool they
190
- already trust. Lasso's value in this mode is entirely the capture + context-assembly
191
- pipeline (§4–5), not the model itself.
192
-
193
- Selection is a config choice, not an either/or product decision:
179
+ - **Hosted model** (`anthropic` | `openai` | `google` | `ollama`): the default path when
180
+ no local CLI is selected. Lasso calls the provider SDK directly (`@anthropic-ai/sdk`)
181
+ with the assembled context and the old/new-string contract from §5.3. The provider and
182
+ key come from `LASSO_AGENT_PROVIDER` plus the matching `*_API_KEY`, read from the
183
+ process environment or the project `.env`.
184
+ - **Claude Code passthrough** (`claude-code`): the CLI shells out to Claude Code in
185
+ headless/print mode (`claude -p … --permission-mode plan --output-format
186
+ stream-json --max-turns 3`), passing the assembled context as the prompt and parsing
187
+ its output back into the same diff-preview pipeline. This lets a user keep using their
188
+ existing Claude Code setup (subscription, project memory, MCP tools) while still
189
+ getting the point-and-select UX.
190
+ - **Codex passthrough** (`codex`): `codex exec --json --sandbox read-only
191
+ --skip-git-repo-check`. Lasso passes the repository trust check itself, so Codex's own
192
+ check is skipped, and the read-only sandbox keeps it from writing.
193
+ - **OpenCode passthrough** (`opencode`): `opencode run --format json --print-logs
194
+ --log-level INFO --agent plan`. The `plan` agent is read-only; `--print-logs` is why
195
+ diagnostics reach the bridge, which classifies them rather than surfacing raw output.
196
+
197
+ Every local agent is invoked read-only, so it can only propose a patch. Lasso writes
198
+ nothing until the user accepts the diff. If an agent asks for approval or input, the
199
+ child's stdin stays attached and the request is surfaced as a task-scoped overlay prompt.
200
+
201
+ Availability is detected rather than configured: at bridge start Lasso runs `which` for
202
+ `claude`, `codex`, and `opencode`, and only detected agents appear in the model picker.
203
+ OpenCode's model list is discovered with `opencode models`.
204
+
205
+ Selection happens in the overlay model picker, not in `lasso.config.json`. That file
206
+ carries only the project `id` and local `domain`:
194
207
 
195
208
  ```json
196
- // lasso.config.json (before `lasso init`)
209
+ // lasso.config.json — the only project fields
197
210
  {
198
- "agent": "builtin" // | "claude-code" | "custom"
199
- }
200
-
201
- // lasso.config.json (after `lasso init` — id is the only project field)
202
- {
203
- "agent": "builtin",
204
- "id": "proj_3f2a9c…" // workspace-scoped; commit it so teammates share the session
211
+ "id": "proj_3f2a9c…", // workspace-scoped; commit it so teammates share the session
212
+ "domain": "my-project.lasso"
205
213
  }
206
214
  ```
207
215
 
package/README.md CHANGED
@@ -373,51 +373,48 @@ inside the project and refuses to overwrite an existing file.
373
373
 
374
374
  ## Agent configuration
375
375
 
376
- Create `lasso.config.json` in your project root:
376
+ You choose the coding agent in the overlay's model picker, not in a config file.
377
+ `lasso.config.json` only records your project `id` and local `domain` — it has no
378
+ agent field.
377
379
 
378
- ```json
379
- {
380
- "agent": "builtin"
381
- }
382
- ```
380
+ ### Local CLI agents
383
381
 
384
- ### Built-in agent
382
+ Lasso shells out to a coding CLI installed on your machine. Each one appears as its own
383
+ group in the model picker **only when its binary is on the `PATH` that `lasso dev`
384
+ sees**, so install it before starting the dev server (or restart afterwards):
385
385
 
386
- ```json
387
- {
388
- "agent": "builtin"
389
- }
390
- ```
386
+ | Agent | Binary | Lasso runs |
387
+ | ------------------------------------------------------------ | ---------- | ----------------------------------------------------------------------------- |
388
+ | [Claude Code](https://lasso.byorello.space/docs/claude-code) | `claude` | `claude -p … --permission-mode plan --output-format stream-json --max-turns 3` |
389
+ | [Codex](https://lasso.byorello.space/docs/codex) | `codex` | `codex exec --json --sandbox read-only --skip-git-repo-check` |
390
+ | [OpenCode](https://lasso.byorello.space/docs/opencode) | `opencode` | `opencode run --format json --print-logs --agent plan` |
391
391
 
392
- Uses Lasso's built-in agent through the Anthropic SDK.
392
+ All three run read-only, so the agent proposes a patch and never writes to your project.
393
+ Sign each CLI in once in a real terminal; Lasso inherits the credentials it stores for
394
+ your user.
393
395
 
394
- Requires:
396
+ ### Hosted agents
397
+
398
+ To use a hosted model instead, set the provider and key in your shell or in the project
399
+ `.env` before running `lasso dev`:
395
400
 
396
401
  ```bash
402
+ export LASSO_AGENT_PROVIDER=anthropic # or openai, google, ollama
397
403
  export ANTHROPIC_API_KEY=your_key
404
+ export LASSO_AGENT_MODEL=... # optional
398
405
  ```
399
406
 
400
- ### Claude Code
401
-
402
- ```json
403
- {
404
- "agent": "claude-code"
405
- }
406
- ```
407
-
408
- Lasso can delegate the coding task to Claude Code in headless mode while keeping the same selection → context → diff → accept workflow.
407
+ Supported keys are `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`,
408
+ `GOOGLE_GENERATIVE_AI_API_KEY` (or `GEMINI_API_KEY`), and `OLLAMA_BASE_URL` with
409
+ `OLLAMA_MODEL`. If `LASSO_AGENT_PROVIDER` is unset, Lasso picks a provider from whichever
410
+ key it finds, defaulting to `anthropic`.
409
411
 
410
- ### Custom agent
411
-
412
- ```json
413
- {
414
- "agent": "custom"
415
- }
416
- ```
412
+ Hosted agents additionally require your Lasso key from `lasso auth login`, and the
413
+ credentials are never written to `lasso.config.json`.
417
414
 
418
- Build your own adapter for another coding agent.
415
+ ### The adapter contract
419
416
 
420
- The adapter contract is intentionally simple:
417
+ Whichever agent runs, the contract is the same:
421
418
 
422
419
  ```text
423
420
  Lasso context
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lasso-ai/cli",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
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",