@lasso-ai/cli 1.0.17 → 1.0.18
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/agent.js +35 -2
- package/dist/overlay.js +5 -0
- package/package.json +1 -1
package/dist/cli/agent.js
CHANGED
|
@@ -193,6 +193,39 @@ function extractLocalAgentText(raw, provider) {
|
|
|
193
193
|
}
|
|
194
194
|
return texts.at(-1) || raw;
|
|
195
195
|
}
|
|
196
|
+
function extractLocalAgentProposal(raw, provider) {
|
|
197
|
+
const outputs = [];
|
|
198
|
+
for (const line of raw.split(/\r?\n/)) {
|
|
199
|
+
try {
|
|
200
|
+
const event = JSON.parse(line);
|
|
201
|
+
const item = event.item;
|
|
202
|
+
const part = event.part;
|
|
203
|
+
const values = provider === "claude-code"
|
|
204
|
+
? [event.result, ...(event.message?.content || []).map((entry) => entry.text)]
|
|
205
|
+
: provider === "opencode"
|
|
206
|
+
? [part?.type === "text" ? part.text : undefined, event.text, event.output_text]
|
|
207
|
+
: [event.text, event.output_text, item?.text, item?.output_text, item?.message];
|
|
208
|
+
for (const value of values)
|
|
209
|
+
if (typeof value === "string" && value.trim())
|
|
210
|
+
outputs.push(value);
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
if (line.trim())
|
|
214
|
+
outputs.push(line);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// Tool events are interleaved with the final answer. Try text events in
|
|
218
|
+
// reverse order, then the complete stream as a final fallback.
|
|
219
|
+
for (const output of [...outputs.reverse(), raw]) {
|
|
220
|
+
try {
|
|
221
|
+
return jsonFrom(output);
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
// Keep looking; this output may only be a progress or tool event.
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
throw new Error("The agent returned no valid reviewable changes. Progress output may have been mixed with the final JSON.");
|
|
228
|
+
}
|
|
196
229
|
function snippet(value, max = 80) {
|
|
197
230
|
const s = String(value ?? "").trim().replace(/\s+/g, " ");
|
|
198
231
|
return s.length > max ? `${s.slice(0, max)}…` : s;
|
|
@@ -309,7 +342,7 @@ function localCommand(provider, model, prompt) {
|
|
|
309
342
|
return { command: "claude", args: ["-p", prompt || "", "--output-format", "stream-json", "--verbose", "--permission-mode", "plan", "--max-turns", "3", ...(selectedModel ? ["--model", selectedModel] : [])] };
|
|
310
343
|
}
|
|
311
344
|
if (provider === "opencode") {
|
|
312
|
-
return { command: "opencode", args: ["run", "--format", "json", ...(selectedModel ? ["--model", selectedModel] : []), prompt || ""] };
|
|
345
|
+
return { command: "opencode", args: ["run", "--format", "json", "--agent", "plan", ...(selectedModel ? ["--model", selectedModel] : []), prompt || ""] };
|
|
313
346
|
}
|
|
314
347
|
return { command: "codex", args: ["exec", "--json", "--sandbox", "read-only", "--skip-git-repo-check", ...(selectedModel ? ["--model", selectedModel] : []), prompt || ""] };
|
|
315
348
|
}
|
|
@@ -355,7 +388,7 @@ async function proposeWithLocalAgent(cwd, instruction, context, config, signal,
|
|
|
355
388
|
}
|
|
356
389
|
if (exitCode !== 0)
|
|
357
390
|
throw new Error(localAgentError(command, stderr, exitCode));
|
|
358
|
-
return
|
|
391
|
+
return extractLocalAgentProposal(stdout, config.provider);
|
|
359
392
|
}
|
|
360
393
|
async function proposeChanges(cwd, input, config, signal, onProgress) {
|
|
361
394
|
const context = await contextFor(cwd, input.element);
|
package/dist/overlay.js
CHANGED
|
@@ -10180,8 +10180,13 @@
|
|
|
10180
10180
|
display: none;
|
|
10181
10181
|
}
|
|
10182
10182
|
|
|
10183
|
+
.lasso-prompt-send.loading span {
|
|
10184
|
+
display: none;
|
|
10185
|
+
}
|
|
10186
|
+
|
|
10183
10187
|
.lasso-prompt-send.loading::before {
|
|
10184
10188
|
content: "";
|
|
10189
|
+
display: block;
|
|
10185
10190
|
width: 12px;
|
|
10186
10191
|
height: 12px;
|
|
10187
10192
|
border: 2px solid rgba(0, 0, 0, 0.3);
|
package/package.json
CHANGED