@tarcisiopgs/lisa 1.21.1 → 1.21.3
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.
|
@@ -772,9 +772,18 @@ function useKanbanState(bellEnabled, initialCards = []) {
|
|
|
772
772
|
const onLogFile = (issueId, logFile) => {
|
|
773
773
|
setCards((prev) => prev.map((c) => c.id === issueId ? { ...c, logFile } : c));
|
|
774
774
|
};
|
|
775
|
+
const MAX_OUTPUT_SIZE = 2e5;
|
|
775
776
|
const onOutput = (issueId, text) => {
|
|
776
777
|
setCards(
|
|
777
|
-
(prev) => prev.map((c) =>
|
|
778
|
+
(prev) => prev.map((c) => {
|
|
779
|
+
if (c.id !== issueId) return c;
|
|
780
|
+
let newLog = c.outputLog + text;
|
|
781
|
+
if (newLog.length > MAX_OUTPUT_SIZE) {
|
|
782
|
+
const trimAt = newLog.indexOf("\n", newLog.length - MAX_OUTPUT_SIZE);
|
|
783
|
+
newLog = trimAt !== -1 ? newLog.slice(trimAt + 1) : newLog.slice(-MAX_OUTPUT_SIZE);
|
|
784
|
+
}
|
|
785
|
+
return { ...c, outputLog: newLog };
|
|
786
|
+
})
|
|
778
787
|
);
|
|
779
788
|
};
|
|
780
789
|
const onReconcileRemove = (issueId) => {
|
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
setOutputMode,
|
|
48
48
|
updateNotice,
|
|
49
49
|
warn
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-3QCZWKDJ.js";
|
|
51
51
|
import {
|
|
52
52
|
notify,
|
|
53
53
|
resetTitle,
|
|
@@ -642,8 +642,7 @@ var AiderProvider = class {
|
|
|
642
642
|
kanbanEmitter.emit(
|
|
643
643
|
"issue:output",
|
|
644
644
|
opts.issueId,
|
|
645
|
-
`$
|
|
646
|
-
`.trim()}
|
|
645
|
+
`$ aider --message-file --yes-always ${modelFlag || "(default model)"} <prompt: ${prompt.length} chars>
|
|
647
646
|
`
|
|
648
647
|
);
|
|
649
648
|
}
|
|
@@ -746,8 +745,12 @@ var ClaudeProvider = class {
|
|
|
746
745
|
const command = `claude ${flags.join(" ")} "$(cat '${promptFile}')"`;
|
|
747
746
|
log(`[claude] Running: claude ${flags.join(" ")}`.trim());
|
|
748
747
|
if (opts.issueId) {
|
|
749
|
-
kanbanEmitter.emit(
|
|
750
|
-
|
|
748
|
+
kanbanEmitter.emit(
|
|
749
|
+
"issue:output",
|
|
750
|
+
opts.issueId,
|
|
751
|
+
`$ claude ${flags.join(" ")} <prompt: ${prompt.length} chars>
|
|
752
|
+
`
|
|
753
|
+
);
|
|
751
754
|
}
|
|
752
755
|
const spawnEnv = { ...process.env, ...opts.env, CLAUDECODE: void 0 };
|
|
753
756
|
const isNestedInClaude = Boolean(process.env.CLAUDECODE);
|
|
@@ -858,8 +861,8 @@ var CodexProvider = class {
|
|
|
858
861
|
kanbanEmitter.emit(
|
|
859
862
|
"issue:output",
|
|
860
863
|
opts.issueId,
|
|
861
|
-
`$ codex exec --dangerously-bypass-approvals-and-sandbox --ephemeral ${modelFlag || "(default model)"}
|
|
862
|
-
|
|
864
|
+
`$ codex exec --dangerously-bypass-approvals-and-sandbox --ephemeral ${modelFlag || "(default model)"} <prompt: ${prompt.length} chars>
|
|
865
|
+
`
|
|
863
866
|
);
|
|
864
867
|
}
|
|
865
868
|
const { proc, isPty } = spawnWithPty(command, {
|
|
@@ -961,8 +964,7 @@ var CopilotProvider = class {
|
|
|
961
964
|
kanbanEmitter.emit(
|
|
962
965
|
"issue:output",
|
|
963
966
|
opts.issueId,
|
|
964
|
-
`$
|
|
965
|
-
`.trim()}
|
|
967
|
+
`$ copilot --allow-all ${modelFlag || "(default model)"} -p <prompt: ${prompt.length} chars>
|
|
966
968
|
`
|
|
967
969
|
);
|
|
968
970
|
}
|
|
@@ -1083,8 +1085,8 @@ var CursorProvider = class {
|
|
|
1083
1085
|
kanbanEmitter.emit(
|
|
1084
1086
|
"issue:output",
|
|
1085
1087
|
opts.issueId,
|
|
1086
|
-
`$ ${bin} -p --output-format text --force ${modelFlag || "(default model)"}
|
|
1087
|
-
|
|
1088
|
+
`$ ${bin} -p --output-format text --force ${modelFlag || "(default model)"} <prompt: ${prompt.length} chars>
|
|
1089
|
+
`
|
|
1088
1090
|
);
|
|
1089
1091
|
}
|
|
1090
1092
|
const { proc, isPty } = spawnWithPty(command, {
|
|
@@ -1185,8 +1187,7 @@ var GeminiProvider = class {
|
|
|
1185
1187
|
kanbanEmitter.emit(
|
|
1186
1188
|
"issue:output",
|
|
1187
1189
|
opts.issueId,
|
|
1188
|
-
`$
|
|
1189
|
-
`.trim()}
|
|
1190
|
+
`$ gemini --yolo ${modelFlag || "(default model)"} -p <prompt: ${prompt.length} chars>
|
|
1190
1191
|
`
|
|
1191
1192
|
);
|
|
1192
1193
|
}
|
|
@@ -1290,8 +1291,7 @@ var GooseProvider = class {
|
|
|
1290
1291
|
kanbanEmitter.emit(
|
|
1291
1292
|
"issue:output",
|
|
1292
1293
|
opts.issueId,
|
|
1293
|
-
`$
|
|
1294
|
-
`.trim()}
|
|
1294
|
+
`$ goose run ${providerFlag} ${modelFlag || "(default model)"} --text <prompt: ${prompt.length} chars>
|
|
1295
1295
|
`
|
|
1296
1296
|
);
|
|
1297
1297
|
}
|
|
@@ -1392,8 +1392,7 @@ var OpenCodeProvider = class {
|
|
|
1392
1392
|
kanbanEmitter.emit(
|
|
1393
1393
|
"issue:output",
|
|
1394
1394
|
opts.issueId,
|
|
1395
|
-
`$
|
|
1396
|
-
`.trim()}
|
|
1395
|
+
`$ opencode run ${modelFlag || "(default model)"} <prompt: ${prompt.length} chars>
|
|
1397
1396
|
`
|
|
1398
1397
|
);
|
|
1399
1398
|
}
|
|
@@ -4995,7 +4994,10 @@ Do NOT use interactive skills, ask clarifying questions, or wait for user input.
|
|
|
4995
4994
|
|
|
4996
4995
|
You are already inside the correct repository worktree on the correct branch.
|
|
4997
4996
|
Do NOT create a new branch \u2014 just work on the current one.
|
|
4998
|
-
|
|
4997
|
+
${cwd ? `
|
|
4998
|
+
**Working directory:** \`${cwd}\`
|
|
4999
|
+
All file paths are relative to this directory. Use this as the base for any absolute paths.
|
|
5000
|
+
` : ""}
|
|
4999
5001
|
## Issue
|
|
5000
5002
|
|
|
5001
5003
|
- **ID:** ${issue2.id}
|
|
@@ -5146,7 +5148,10 @@ Do NOT use interactive skills, ask clarifying questions, or wait for user input.
|
|
|
5146
5148
|
|
|
5147
5149
|
You are working inside a git worktree that was automatically created for this task.
|
|
5148
5150
|
Work on the current branch \u2014 it was created for you.
|
|
5149
|
-
|
|
5151
|
+
${repoPath ? `
|
|
5152
|
+
**Working directory:** \`${repoPath}\`
|
|
5153
|
+
All file paths are relative to this directory. Use this as the base for any absolute paths.
|
|
5154
|
+
` : ""}
|
|
5150
5155
|
## Issue
|
|
5151
5156
|
|
|
5152
5157
|
- **ID:** ${issue2.id}
|
|
@@ -5285,7 +5290,10 @@ Use this context if the current step depends on changes from previous steps.
|
|
|
5285
5290
|
|
|
5286
5291
|
You are working inside a git worktree that was automatically created for this task.
|
|
5287
5292
|
Work on the current branch \u2014 it was created for you.
|
|
5288
|
-
|
|
5293
|
+
${cwd ? `
|
|
5294
|
+
**Working directory:** \`${cwd}\`
|
|
5295
|
+
All file paths are relative to this directory. Use this as the base for any absolute paths.
|
|
5296
|
+
` : ""}
|
|
5289
5297
|
## Issue
|
|
5290
5298
|
|
|
5291
5299
|
- **ID:** ${issue2.id}
|
|
@@ -5661,7 +5669,8 @@ function registerCleanup() {
|
|
|
5661
5669
|
}
|
|
5662
5670
|
|
|
5663
5671
|
// src/loop/manifest.ts
|
|
5664
|
-
import { existsSync as existsSync8, readFileSync as readFileSync8, unlinkSync } from "fs";
|
|
5672
|
+
import { existsSync as existsSync8, readdirSync as readdirSync2, readFileSync as readFileSync8, rmdirSync, unlinkSync } from "fs";
|
|
5673
|
+
import { dirname as dirname2 } from "path";
|
|
5665
5674
|
function readLisaManifest(cwd, issueId) {
|
|
5666
5675
|
const manifestPath = getManifestPath(cwd, issueId);
|
|
5667
5676
|
if (!existsSync8(manifestPath)) return null;
|
|
@@ -5706,17 +5715,27 @@ function readPlanFile(filePath) {
|
|
|
5706
5715
|
return null;
|
|
5707
5716
|
}
|
|
5708
5717
|
}
|
|
5718
|
+
function cleanupPlanFile(filePath) {
|
|
5719
|
+
try {
|
|
5720
|
+
unlinkSync(filePath);
|
|
5721
|
+
} catch {
|
|
5722
|
+
}
|
|
5723
|
+
try {
|
|
5724
|
+
const dir = dirname2(filePath);
|
|
5725
|
+
if (existsSync8(dir) && readdirSync2(dir).length === 0) {
|
|
5726
|
+
rmdirSync(dir);
|
|
5727
|
+
}
|
|
5728
|
+
} catch {
|
|
5729
|
+
}
|
|
5730
|
+
}
|
|
5709
5731
|
|
|
5710
5732
|
// src/loop/multi-repo-session.ts
|
|
5711
|
-
import { appendFileSync as appendFileSync10
|
|
5733
|
+
import { appendFileSync as appendFileSync10 } from "fs";
|
|
5712
5734
|
import { resolve as resolve9 } from "path";
|
|
5713
5735
|
async function runWorktreeMultiRepoSession(config2, issue2, logFile, session, models) {
|
|
5714
5736
|
const workspace = resolve9(config2.workspace);
|
|
5715
5737
|
const planPath = getPlanPath(workspace, issue2.id);
|
|
5716
|
-
|
|
5717
|
-
unlinkSync2(planPath);
|
|
5718
|
-
} catch {
|
|
5719
|
-
}
|
|
5738
|
+
cleanupPlanFile(planPath);
|
|
5720
5739
|
initLogFile(logFile);
|
|
5721
5740
|
kanbanEmitter.emit("issue:log-file", issue2.id, logFile);
|
|
5722
5741
|
startSpinner(`${issue2.id} \u2014 analyzing issue...`);
|
|
@@ -5750,10 +5769,7 @@ ${planResult.output}
|
|
|
5750
5769
|
}
|
|
5751
5770
|
if (!planResult.success) {
|
|
5752
5771
|
error(`Planning phase failed for ${issue2.id}. Check ${logFile}`);
|
|
5753
|
-
|
|
5754
|
-
unlinkSync2(planPath);
|
|
5755
|
-
} catch {
|
|
5756
|
-
}
|
|
5772
|
+
cleanupPlanFile(planPath);
|
|
5757
5773
|
activeProviderPids.delete(issue2.id);
|
|
5758
5774
|
return {
|
|
5759
5775
|
success: false,
|
|
@@ -5765,10 +5781,7 @@ ${planResult.output}
|
|
|
5765
5781
|
const plan = readPlanFile(planPath);
|
|
5766
5782
|
if (!plan?.steps || plan.steps.length === 0) {
|
|
5767
5783
|
error(`Agent did not produce a valid execution plan for ${issue2.id}. Aborting.`);
|
|
5768
|
-
|
|
5769
|
-
unlinkSync2(planPath);
|
|
5770
|
-
} catch {
|
|
5771
|
-
}
|
|
5784
|
+
cleanupPlanFile(planPath);
|
|
5772
5785
|
activeProviderPids.delete(issue2.id);
|
|
5773
5786
|
return {
|
|
5774
5787
|
success: false,
|
|
@@ -5781,10 +5794,7 @@ ${planResult.output}
|
|
|
5781
5794
|
ok(
|
|
5782
5795
|
`Plan produced ${sortedSteps.length} step(s): ${sortedSteps.map((s) => s.repoPath).join(" \u2192 ")}`
|
|
5783
5796
|
);
|
|
5784
|
-
|
|
5785
|
-
unlinkSync2(planPath);
|
|
5786
|
-
} catch {
|
|
5787
|
-
}
|
|
5797
|
+
cleanupPlanFile(planPath);
|
|
5788
5798
|
const prUrls = [];
|
|
5789
5799
|
const previousResults = [];
|
|
5790
5800
|
let lastFallback = planResult;
|
|
@@ -6531,13 +6541,13 @@ async function getChangedFiles(repoPath, baseBranch, dependencyBranch) {
|
|
|
6531
6541
|
}
|
|
6532
6542
|
|
|
6533
6543
|
// src/loop/branch-session.ts
|
|
6534
|
-
import { appendFileSync as appendFileSync12, unlinkSync as
|
|
6544
|
+
import { appendFileSync as appendFileSync12, unlinkSync as unlinkSync2 } from "fs";
|
|
6535
6545
|
import { resolve as resolve12 } from "path";
|
|
6536
6546
|
async function runBranchSession(config2, issue2, logFile, session, models) {
|
|
6537
6547
|
const workspace = resolve12(config2.workspace);
|
|
6538
6548
|
const manifestPath = getManifestPath(workspace, issue2.id);
|
|
6539
6549
|
try {
|
|
6540
|
-
|
|
6550
|
+
unlinkSync2(manifestPath);
|
|
6541
6551
|
} catch {
|
|
6542
6552
|
}
|
|
6543
6553
|
const testRunner = detectTestRunner(workspace);
|
|
@@ -6637,7 +6647,7 @@ ${result.output}
|
|
|
6637
6647
|
}
|
|
6638
6648
|
const manifest = readManifestFile(manifestPath);
|
|
6639
6649
|
try {
|
|
6640
|
-
|
|
6650
|
+
unlinkSync2(manifestPath);
|
|
6641
6651
|
} catch {
|
|
6642
6652
|
}
|
|
6643
6653
|
let prUrl = manifest?.prUrl;
|
|
@@ -7071,7 +7081,7 @@ async function runLoop(config2, opts) {
|
|
|
7071
7081
|
|
|
7072
7082
|
// src/session/kanban-persistence.ts
|
|
7073
7083
|
import { existsSync as existsSync9, mkdirSync as mkdirSync4, readFileSync as readFileSync9, renameSync, writeFileSync as writeFileSync12 } from "fs";
|
|
7074
|
-
import { dirname as
|
|
7084
|
+
import { dirname as dirname3 } from "path";
|
|
7075
7085
|
var STATE_VERSION = 1;
|
|
7076
7086
|
var OUTPUT_TAIL_LINES = 100;
|
|
7077
7087
|
function resolveCard(card) {
|
|
@@ -7224,7 +7234,7 @@ var KanbanPersistence = class {
|
|
|
7224
7234
|
}
|
|
7225
7235
|
flush() {
|
|
7226
7236
|
this.state.updatedAt = Date.now();
|
|
7227
|
-
const dir =
|
|
7237
|
+
const dir = dirname3(this.statePath);
|
|
7228
7238
|
if (!existsSync9(dir)) mkdirSync4(dir, { recursive: true });
|
|
7229
7239
|
writeFileSync12(this.statePath, JSON.stringify(this.state));
|
|
7230
7240
|
}
|
|
@@ -7315,7 +7325,7 @@ var run = defineCommand6({
|
|
|
7315
7325
|
if (isTTY) {
|
|
7316
7326
|
const { render } = await import("ink");
|
|
7317
7327
|
const { createElement } = await import("react");
|
|
7318
|
-
const { KanbanApp } = await import("./kanban-
|
|
7328
|
+
const { KanbanApp } = await import("./kanban-GK6MHA5G.js");
|
|
7319
7329
|
const demoConfig = {
|
|
7320
7330
|
provider: "claude",
|
|
7321
7331
|
source: "linear",
|
|
@@ -7398,7 +7408,7 @@ Add them to your ${shell} and run: source ${shell}`));
|
|
|
7398
7408
|
onBeforeExit = () => persistence.stop();
|
|
7399
7409
|
const { render } = await import("ink");
|
|
7400
7410
|
const { createElement } = await import("react");
|
|
7401
|
-
const { KanbanApp } = await import("./kanban-
|
|
7411
|
+
const { KanbanApp } = await import("./kanban-GK6MHA5G.js");
|
|
7402
7412
|
render(createElement(KanbanApp, { config: merged, initialCards }), { exitOnCtrlC: false });
|
|
7403
7413
|
}
|
|
7404
7414
|
await runLoop(merged, {
|
|
@@ -7415,7 +7425,7 @@ Add them to your ${shell} and run: source ${shell}`));
|
|
|
7415
7425
|
});
|
|
7416
7426
|
|
|
7417
7427
|
// src/cli/commands/status.ts
|
|
7418
|
-
import { existsSync as existsSync10, readdirSync as
|
|
7428
|
+
import { existsSync as existsSync10, readdirSync as readdirSync3 } from "fs";
|
|
7419
7429
|
import { defineCommand as defineCommand7 } from "citty";
|
|
7420
7430
|
import pc6 from "picocolors";
|
|
7421
7431
|
var status = defineCommand7({
|
|
@@ -7439,7 +7449,7 @@ var status = defineCommand7({
|
|
|
7439
7449
|
const logsDir = getLogsDir(process.cwd());
|
|
7440
7450
|
console.log(` Logs: ${pc6.dim(logsDir)}`);
|
|
7441
7451
|
if (existsSync10(logsDir)) {
|
|
7442
|
-
const logs =
|
|
7452
|
+
const logs = readdirSync3(logsDir).filter((f) => f.endsWith(".log"));
|
|
7443
7453
|
console.log(`
|
|
7444
7454
|
${pc6.cyan("Sessions:")} ${logs.length} log file(s) found`);
|
|
7445
7455
|
} else {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
kanbanEmitter,
|
|
4
4
|
useKanbanState
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3QCZWKDJ.js";
|
|
6
6
|
import {
|
|
7
7
|
resetTitle,
|
|
8
8
|
startSpinner,
|
|
@@ -418,6 +418,24 @@ function formatElapsed2(ms) {
|
|
|
418
418
|
function hyperlink(url, text) {
|
|
419
419
|
return `\x1B]8;;${url}\x07${text}\x1B]8;;\x07`;
|
|
420
420
|
}
|
|
421
|
+
var ANSI_CSI = /\x1b\[[0-9;]*[A-Za-z]/g;
|
|
422
|
+
var ANSI_OSC = /\x1b\][^\x07]*\x07/g;
|
|
423
|
+
var ANSI_CHARSET = /\x1b\([A-Z]/g;
|
|
424
|
+
function stripAnsi(str) {
|
|
425
|
+
return str.replace(ANSI_CSI, "").replace(ANSI_OSC, "").replace(ANSI_CHARSET, "").replace(/\r/g, "");
|
|
426
|
+
}
|
|
427
|
+
function truncateLine(line, maxWidth) {
|
|
428
|
+
const clean = stripAnsi(line);
|
|
429
|
+
if (clean.length <= maxWidth) return clean;
|
|
430
|
+
return `${clean.slice(0, maxWidth - 1)}\u2026`;
|
|
431
|
+
}
|
|
432
|
+
function processOutputLines(raw) {
|
|
433
|
+
const normalized = raw.replace(/\r\n/g, "\n");
|
|
434
|
+
return normalized.split("\n").map((line) => {
|
|
435
|
+
const parts = line.split("\r");
|
|
436
|
+
return parts[parts.length - 1] ?? "";
|
|
437
|
+
});
|
|
438
|
+
}
|
|
421
439
|
function logLineColor(line) {
|
|
422
440
|
if (/\berror\b|✖/i.test(line)) return "red";
|
|
423
441
|
if (/\bwarn(ing)?\b/i.test(line)) return "yellow";
|
|
@@ -478,10 +496,15 @@ function IssueDetail({ card, onBack }) {
|
|
|
478
496
|
}
|
|
479
497
|
});
|
|
480
498
|
const { columns: terminalCols, rows: terminalRows } = useTerminalSize();
|
|
499
|
+
const SIDEBAR_TOTAL_WIDTH = 30;
|
|
481
500
|
const bodyRows = Math.max(1, terminalRows - 10);
|
|
482
|
-
const
|
|
501
|
+
const maxLineWidth = Math.max(1, terminalCols - SIDEBAR_TOTAL_WIDTH - 4);
|
|
502
|
+
const lines = useMemo(() => processOutputLines(card.outputLog), [card.outputLog]);
|
|
483
503
|
const startLine = Math.max(0, lines.length - bodyRows - logScrollOffset);
|
|
484
|
-
const visibleLines =
|
|
504
|
+
const visibleLines = useMemo(
|
|
505
|
+
() => lines.slice(startLine, startLine + bodyRows).map((l) => truncateLine(l, maxLineWidth)),
|
|
506
|
+
[lines, startLine, bodyRows, maxLineWidth]
|
|
507
|
+
);
|
|
485
508
|
const status = statusLabel(card.column, card.hasError, card.killed, card.skipped, card.merged);
|
|
486
509
|
let elapsedDisplay = null;
|
|
487
510
|
let isRunning = false;
|
|
@@ -492,7 +515,6 @@ function IssueDetail({ card, onBack }) {
|
|
|
492
515
|
} else if (card.column === "done" && card.startedAt !== void 0 && card.finishedAt !== void 0) {
|
|
493
516
|
elapsedDisplay = formatElapsed2(card.finishedAt - card.startedAt);
|
|
494
517
|
}
|
|
495
|
-
const SIDEBAR_TOTAL_WIDTH = 30;
|
|
496
518
|
const separator = useMemo(() => {
|
|
497
519
|
const separatorInner = Math.max(0, terminalCols - SIDEBAR_TOTAL_WIDTH - 4);
|
|
498
520
|
return `\u2560${"\u2550".repeat(Math.max(0, separatorInner - 2))}\u2563`;
|
|
@@ -555,7 +577,7 @@ function IssueDetail({ card, onBack }) {
|
|
|
555
577
|
const color = logLineColor(line);
|
|
556
578
|
return (
|
|
557
579
|
// biome-ignore lint/suspicious/noArrayIndexKey: log lines have no stable key
|
|
558
|
-
/* @__PURE__ */ jsx4(Text4, { color, dimColor: color === "white", children: line }, i)
|
|
580
|
+
/* @__PURE__ */ jsx4(Text4, { color, dimColor: color === "white", wrap: "truncate", children: line }, i)
|
|
559
581
|
);
|
|
560
582
|
}) })
|
|
561
583
|
]
|