@aayambansal/squint 0.3.3 → 0.3.4
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.
|
@@ -23,6 +23,7 @@ var COMMANDS = [
|
|
|
23
23
|
{ name: "btw", args: "<question>", group: "session", description: "read-only side question; the main thread is untouched" },
|
|
24
24
|
{ name: "copy", group: "session", description: "copy the last reply to the clipboard" },
|
|
25
25
|
{ name: "save", group: "session", description: "export the transcript to .squint/transcripts/" },
|
|
26
|
+
{ name: "find", args: "<term>", group: "session", description: "search this session and saved transcripts" },
|
|
26
27
|
{ name: "resume", group: "session", description: "pick up the previous session for this repo" },
|
|
27
28
|
{ name: "clear", group: "session", description: "new session (transcript, totals, persisted state)" },
|
|
28
29
|
{ name: "help", group: "session", description: "list commands" },
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
completeCommand
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BNJGHNXB.js";
|
|
5
5
|
import {
|
|
6
6
|
applySandbox,
|
|
7
7
|
discardSandbox,
|
|
@@ -96,6 +96,8 @@ var ConfigSchema = z.object({
|
|
|
96
96
|
budgetUsd: z.number().positive().optional(),
|
|
97
97
|
/** Auto-run /review when the visual pulse shows a big change (default off). */
|
|
98
98
|
autoReview: z.boolean().optional(),
|
|
99
|
+
/** Cheaper model used for auto-fix and /fix turns (mechanical work). */
|
|
100
|
+
fixModel: z.string().optional(),
|
|
99
101
|
/** TUI theme name (amber, ocean, moss, rose, mono). */
|
|
100
102
|
theme: z.string().optional()
|
|
101
103
|
});
|
|
@@ -138,7 +140,7 @@ function resolveModel(config, engineId, override) {
|
|
|
138
140
|
function setConfigValue(file, key, value) {
|
|
139
141
|
const current = readConfigFile(file);
|
|
140
142
|
let next;
|
|
141
|
-
if (key === "engine" || key === "theme") {
|
|
143
|
+
if (key === "engine" || key === "theme" || key === "fixModel") {
|
|
142
144
|
next = { ...current, [key]: value };
|
|
143
145
|
} else if (key === "autoDev" || key === "autoFix" || key === "autoProbe" || key === "autoCheck" || key === "autoReview" || key === "bell") {
|
|
144
146
|
if (value !== "true" && value !== "false") {
|
|
@@ -157,7 +159,7 @@ function setConfigValue(file, key, value) {
|
|
|
157
159
|
next = { ...current, models: { ...current.models, [engineId]: value } };
|
|
158
160
|
} else {
|
|
159
161
|
throw new Error(
|
|
160
|
-
`Unknown config key "${key}". Supported: engine, theme, autoDev, autoFix, autoProbe, autoCheck, autoReview, bell, budgetUsd, models.<engineId>`
|
|
162
|
+
`Unknown config key "${key}". Supported: engine, theme, autoDev, autoFix, autoProbe, autoCheck, autoReview, bell, budgetUsd, fixModel, models.<engineId>`
|
|
161
163
|
);
|
|
162
164
|
}
|
|
163
165
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
@@ -756,10 +758,11 @@ var Session = class {
|
|
|
756
758
|
dispatchFix(problems) {
|
|
757
759
|
if (problems.length === 0) return;
|
|
758
760
|
const prompt = this.combinedFixPrompt(problems);
|
|
759
|
-
const
|
|
761
|
+
const fixModel = this.opts.fixModel;
|
|
762
|
+
const display = `\u26D1 fix: ${problems.map((p) => p.source).join(" + ")}${fixModel ? ` \xB7 ${fixModel}` : ""}`;
|
|
760
763
|
for (const problem of problems) this.problemPrompts.delete(problem.id);
|
|
761
764
|
this.notify({ problems: this.state.problems.filter((p) => !problems.includes(p)) });
|
|
762
|
-
void this.runTurn(prompt, display);
|
|
765
|
+
void this.runTurn(prompt, display, fixModel);
|
|
763
766
|
}
|
|
764
767
|
/** Launch a capped auto-fix turn over all open problems. Returns true if launched. */
|
|
765
768
|
maybeAutoFix() {
|
|
@@ -1006,7 +1009,7 @@ ${question}`,
|
|
|
1006
1009
|
}
|
|
1007
1010
|
};
|
|
1008
1011
|
/** Run one engine turn. `display` is what the transcript shows as the ask. */
|
|
1009
|
-
async runTurn(prompt, display) {
|
|
1012
|
+
async runTurn(prompt, display, modelOverride) {
|
|
1010
1013
|
this.push("user", display);
|
|
1011
1014
|
this.turnEdits = 0;
|
|
1012
1015
|
this.turnTools = 0;
|
|
@@ -1019,7 +1022,7 @@ ${question}`,
|
|
|
1019
1022
|
{
|
|
1020
1023
|
prompt,
|
|
1021
1024
|
cwd: this.execCwd(),
|
|
1022
|
-
model: this.state.model,
|
|
1025
|
+
model: modelOverride ?? this.state.model,
|
|
1023
1026
|
mode: this.state.mode,
|
|
1024
1027
|
sessionId: engine.supportsResume ? this.sessionId : void 0
|
|
1025
1028
|
},
|
|
@@ -1392,6 +1395,50 @@ They are objective defects, not style preferences.`
|
|
|
1392
1395
|
}
|
|
1393
1396
|
break;
|
|
1394
1397
|
}
|
|
1398
|
+
case "find": {
|
|
1399
|
+
if (!arg) {
|
|
1400
|
+
this.push("status", "usage: /find <term> \u2014 searches this session and saved transcripts");
|
|
1401
|
+
break;
|
|
1402
|
+
}
|
|
1403
|
+
const needle = arg.toLowerCase();
|
|
1404
|
+
const matches = [];
|
|
1405
|
+
for (const item of this.state.items) {
|
|
1406
|
+
if ((item.role === "user" || item.role === "assistant") && item.text.toLowerCase().includes(needle)) {
|
|
1407
|
+
const line = item.text.split("\n").find((l) => l.toLowerCase().includes(needle)) ?? item.text;
|
|
1408
|
+
matches.push(`[live] ${item.role === "user" ? "\u276F " : ""}${line.trim().slice(0, 90)}`);
|
|
1409
|
+
if (matches.length >= 8) break;
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
if (matches.length < 8) {
|
|
1413
|
+
void (async () => {
|
|
1414
|
+
try {
|
|
1415
|
+
const fs3 = await import("fs");
|
|
1416
|
+
const path5 = await import("path");
|
|
1417
|
+
const dir = path5.join(this.opts.cwd, ".squint", "transcripts");
|
|
1418
|
+
const files = fs3.readdirSync(dir).filter((f) => f.endsWith(".md")).sort().reverse().slice(0, 20);
|
|
1419
|
+
for (const file of files) {
|
|
1420
|
+
if (matches.length >= 8) break;
|
|
1421
|
+
const text = fs3.readFileSync(path5.join(dir, file), "utf8");
|
|
1422
|
+
for (const line of text.split("\n")) {
|
|
1423
|
+
if (line.toLowerCase().includes(needle)) {
|
|
1424
|
+
matches.push(`[${file.replace(/\.md$/, "")}] ${line.trim().slice(0, 90)}`);
|
|
1425
|
+
break;
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
} catch {
|
|
1430
|
+
}
|
|
1431
|
+
this.push(
|
|
1432
|
+
"status",
|
|
1433
|
+
matches.length > 0 ? `${matches.join("\n")}
|
|
1434
|
+
/checkpoints can rewind \xB7 /save archives this session` : `no matches for "${arg}"`
|
|
1435
|
+
);
|
|
1436
|
+
})();
|
|
1437
|
+
} else {
|
|
1438
|
+
this.push("status", matches.join("\n"));
|
|
1439
|
+
}
|
|
1440
|
+
break;
|
|
1441
|
+
}
|
|
1395
1442
|
case "save": {
|
|
1396
1443
|
void (async () => {
|
|
1397
1444
|
const fs3 = await import("fs");
|
|
@@ -1692,7 +1739,7 @@ ${sandboxFiles(this.opts.cwd).join("\n")}`);
|
|
|
1692
1739
|
this.notify({ items: [], totals: { costUsd: 0, turns: 0 } });
|
|
1693
1740
|
break;
|
|
1694
1741
|
case "help": {
|
|
1695
|
-
void import("./commands-
|
|
1742
|
+
void import("./commands-3HHBHBQV.js").then(({ commandHelp }) => this.push("status", commandHelp()));
|
|
1696
1743
|
break;
|
|
1697
1744
|
}
|
|
1698
1745
|
case "quit":
|
|
@@ -2063,6 +2110,7 @@ function App({
|
|
|
2063
2110
|
autoProbe,
|
|
2064
2111
|
autoCheck,
|
|
2065
2112
|
autoReview,
|
|
2113
|
+
fixModel,
|
|
2066
2114
|
bell,
|
|
2067
2115
|
budgetUsd,
|
|
2068
2116
|
initialTheme
|
|
@@ -2081,6 +2129,7 @@ function App({
|
|
|
2081
2129
|
autoProbe,
|
|
2082
2130
|
autoCheck,
|
|
2083
2131
|
autoReview,
|
|
2132
|
+
fixModel,
|
|
2084
2133
|
budgetUsd,
|
|
2085
2134
|
// Delay lets the goodbye summary land in the Static scrollback.
|
|
2086
2135
|
onQuit: () => setTimeout(() => exit(), 60)
|
|
@@ -2298,6 +2347,7 @@ function registerTui(program2) {
|
|
|
2298
2347
|
autoProbe: config.autoProbe,
|
|
2299
2348
|
autoCheck: config.autoCheck,
|
|
2300
2349
|
autoReview: config.autoReview,
|
|
2350
|
+
fixModel: config.fixModel,
|
|
2301
2351
|
bell: config.bell,
|
|
2302
2352
|
budgetUsd: config.budgetUsd,
|
|
2303
2353
|
initialTheme: theme2
|
|
@@ -2308,7 +2358,7 @@ function registerTui(program2) {
|
|
|
2308
2358
|
}
|
|
2309
2359
|
|
|
2310
2360
|
// src/cli.tsx
|
|
2311
|
-
var VERSION = true ? "0.3.
|
|
2361
|
+
var VERSION = true ? "0.3.4" : "0.0.0-dev";
|
|
2312
2362
|
var program = new Command();
|
|
2313
2363
|
program.name("squint").description("Lovable for your terminal \u2014 a frontend harness on top of Claude Code, Codex, and friends.").version(VERSION);
|
|
2314
2364
|
registerRun(program);
|
package/package.json
CHANGED