@garuda-agent/garuda 0.18.0 → 0.18.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.
- package/CHANGELOG.md +156 -0
- package/README.md +3 -2
- package/dist/{acpCommand-IUZPLPLI.js → acpCommand-PUJHFWYU.js} +10 -8
- package/dist/advise-C777SZ5M.js +433 -0
- package/dist/brief-RWKESOPT.js +91 -0
- package/dist/buildCheck-HB46NWLX.js +19 -0
- package/dist/buildInfo-Z4P7QAQL.js +8 -0
- package/dist/chunk-2OYTNNUJ.js +216 -0
- package/dist/chunk-4BELTWP4.js +156 -0
- package/dist/chunk-4QRTTRVK.js +88 -0
- package/dist/chunk-6JQTPW3P.js +88 -0
- package/dist/chunk-A5DLAXB4.js +1780 -0
- package/dist/{chunk-FARS4R67.js → chunk-AX3A5KPH.js} +18 -1
- package/dist/chunk-CFDRP6XW.js +9 -0
- package/dist/chunk-E6YRCDSF.js +9 -0
- package/dist/{chunk-OQ26W5L4.js → chunk-HP6EGFHV.js} +132 -75
- package/dist/chunk-L55VUSX3.js +54 -0
- package/dist/{chunk-B4SJY7KT.js → chunk-LMKGSYJC.js} +77 -8
- package/dist/{chunk-Q4P3W657.js → chunk-LWNMEGDF.js} +10 -1124
- package/dist/{chunk-23FXBNBB.js → chunk-MNE7HHX2.js} +2 -1
- package/dist/{chunk-UKIE4AAM.js → chunk-NLS7GMF7.js} +11 -105
- package/dist/{chunk-6XHON3Q6.js → chunk-QXTHEFKP.js} +3 -3
- package/dist/{chunk-4BVCYCQT.js → chunk-R7RCW4BQ.js} +9 -7
- package/dist/{chunk-NHWHG3SW.js → chunk-STVFWSIL.js} +350 -57
- package/dist/{chunk-5B5HDTUR.js → chunk-TWQ7V2L6.js} +2 -2
- package/dist/chunk-ULAJPMY7.js +107 -0
- package/dist/chunk-VISKX36R.js +306 -0
- package/dist/{chunk-55CFEEIN.js → chunk-WK5NE6RY.js} +2 -2
- package/dist/chunk-Y62J7PTD.js +90 -0
- package/dist/chunk-YAQ6QLKB.js +40 -0
- package/dist/{chunk-FOPBOB7W.js → chunk-YEH2OONM.js} +6 -4
- package/dist/{chunk-7TH3NHCQ.js → chunk-ZKT4P2PC.js} +2 -2
- package/dist/cli/index.js +242 -52
- package/dist/{create-W6BV75QX.js → create-OACSGJ37.js} +5 -5
- package/dist/{evalCommand-SKJQ6CW2.js → evalCommand-MRO6ENCA.js} +77 -39
- package/dist/{evalTune-CZRCPSZ3.js → evalTune-VL5RHYOG.js} +24 -18
- package/dist/{export-SJ3DUP6W.js → export-ZPF3AMO6.js} +27 -4
- package/dist/exportHtml-ISISG5HG.js +21 -0
- package/dist/{inkChat-WYYAFZXD.js → inkChat-UDFX6GH6.js} +256 -41
- package/dist/{install-TKWN5AYH.js → install-4ST5BNRG.js} +3 -3
- package/dist/{jobCommand-2ODQLHB3.js → jobCommand-ILOTYOX3.js} +8 -7
- package/dist/{launchd-3A3ONEW5.js → launchd-QG6R5RAK.js} +4 -4
- package/dist/{lspCommand-ZZ6R4PA2.js → lspCommand-X4FTTONR.js} +3 -3
- package/dist/{manager-TCYTA5XU.js → manager-YH7722C2.js} +3 -3
- package/dist/{nightCommand-WJU6VZA6.js → nightCommand-XPWT6CQZ.js} +8 -7
- package/dist/receiptView-YFDHV253.js +19 -0
- package/dist/{remove-42WQNVPX.js → remove-STX5UO7X.js} +3 -3
- package/dist/{run-PTMRQCIU.js → run-W4TK52WT.js} +5 -5
- package/dist/runner-EBF6EOYM.js +97 -0
- package/dist/{server-VEYIJHEU.js → server-ASM73QVY.js} +3 -3
- package/dist/tour-CEVMAC5S.js +18 -0
- package/dist/tune-KSNKBPNJ.js +51 -0
- package/dist/uiState-YFJQ43D7.js +16 -0
- package/package.json +1 -1
- package/dist/chunk-4JSUUDFQ.js +0 -118
- package/dist/chunk-C57GHLKP.js +0 -9
- package/dist/chunk-DOCDCQVM.js +0 -484
- package/dist/tune-YVI2KWQF.js +0 -31
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
DEFAULT_COMMITS,
|
|
4
3
|
EVAL_SUITES,
|
|
5
4
|
HELD_OUT_TASKS,
|
|
5
|
+
chooseTasks,
|
|
6
|
+
requiredToolchains
|
|
7
|
+
} from "./chunk-LWNMEGDF.js";
|
|
8
|
+
import {
|
|
9
|
+
reportV2
|
|
10
|
+
} from "./chunk-6JQTPW3P.js";
|
|
11
|
+
import {
|
|
12
|
+
garudaCommit,
|
|
13
|
+
staleBuildNote
|
|
14
|
+
} from "./chunk-YAQ6QLKB.js";
|
|
15
|
+
import {
|
|
16
|
+
BUILD_COMMIT
|
|
17
|
+
} from "./chunk-E6YRCDSF.js";
|
|
18
|
+
import {
|
|
19
|
+
DEFAULT_COMMITS,
|
|
20
|
+
DEFAULT_SEED,
|
|
6
21
|
TOOLCHAINS,
|
|
7
22
|
buildRepoSuite,
|
|
8
23
|
checkToolchains,
|
|
9
|
-
|
|
24
|
+
compareReports,
|
|
25
|
+
formatComparison,
|
|
10
26
|
formatReport,
|
|
11
27
|
isAuthFailure,
|
|
12
28
|
isMcpFailure,
|
|
13
29
|
isSetupFailure,
|
|
14
30
|
loadRepoSuite,
|
|
31
|
+
loadReport,
|
|
15
32
|
prepareToolchain,
|
|
16
33
|
repoEvalTasks,
|
|
17
|
-
requiredToolchains,
|
|
18
34
|
runEvals,
|
|
19
35
|
saveRepoSuite,
|
|
36
|
+
shuffled,
|
|
20
37
|
summarize,
|
|
21
38
|
toolchainId
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import {
|
|
24
|
-
BUILD_COMMIT,
|
|
25
|
-
DEFAULT_SEED,
|
|
26
|
-
compareReports,
|
|
27
|
-
formatComparison,
|
|
28
|
-
garudaCommit,
|
|
29
|
-
loadReport,
|
|
30
|
-
reportV2,
|
|
31
|
-
shuffled,
|
|
32
|
-
staleBuildNote
|
|
33
|
-
} from "./chunk-DOCDCQVM.js";
|
|
34
|
-
import "./chunk-NXJ4XLB5.js";
|
|
39
|
+
} from "./chunk-A5DLAXB4.js";
|
|
35
40
|
import {
|
|
36
41
|
NO_MODEL,
|
|
37
42
|
chooseModel,
|
|
@@ -40,38 +45,41 @@ import {
|
|
|
40
45
|
providerKeyValue,
|
|
41
46
|
resolveModel
|
|
42
47
|
} from "./chunk-2FIV2VZP.js";
|
|
48
|
+
import "./chunk-NXJ4XLB5.js";
|
|
43
49
|
import {
|
|
44
50
|
CODE_INDEX_MODES,
|
|
45
51
|
DEFAULT_CODE_INDEX_MODE,
|
|
46
52
|
detectProfiles
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import "./chunk-65NUEOI7.js";
|
|
53
|
+
} from "./chunk-STVFWSIL.js";
|
|
49
54
|
import "./chunk-G2AX7MGS.js";
|
|
55
|
+
import "./chunk-ULAJPMY7.js";
|
|
56
|
+
import "./chunk-65NUEOI7.js";
|
|
57
|
+
import "./chunk-4QRTTRVK.js";
|
|
50
58
|
import "./chunk-A2QAIRQL.js";
|
|
51
59
|
import {
|
|
52
60
|
newSessionId
|
|
53
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-NLS7GMF7.js";
|
|
54
62
|
import "./chunk-7KBOIPUT.js";
|
|
55
63
|
import "./chunk-B25VL4RU.js";
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-
|
|
64
|
+
import "./chunk-MNE7HHX2.js";
|
|
65
|
+
import "./chunk-CFDRP6XW.js";
|
|
58
66
|
import "./chunk-5DEWP3YX.js";
|
|
59
67
|
import "./chunk-PZS3V6P3.js";
|
|
60
68
|
import "./chunk-QANRZW7W.js";
|
|
61
69
|
import "./chunk-ATW7BNIG.js";
|
|
62
|
-
import "./chunk-
|
|
70
|
+
import "./chunk-WK5NE6RY.js";
|
|
63
71
|
import {
|
|
64
72
|
detectTestCommand
|
|
65
73
|
} from "./chunk-AOGFYUKG.js";
|
|
66
74
|
import {
|
|
67
75
|
git
|
|
68
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-QXTHEFKP.js";
|
|
69
77
|
import {
|
|
70
78
|
EXECUTOR_NAMES,
|
|
71
79
|
HostExecutor,
|
|
72
80
|
createExecutor,
|
|
73
81
|
expandAllowlist
|
|
74
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-LMKGSYJC.js";
|
|
75
83
|
import "./chunk-BHZ6G65V.js";
|
|
76
84
|
import "./chunk-P6XWWIEK.js";
|
|
77
85
|
import "./chunk-UIRJOQQS.js";
|
|
@@ -83,6 +91,7 @@ import { existsSync, mkdirSync, realpathSync, writeFileSync } from "fs";
|
|
|
83
91
|
import { createRequire } from "module";
|
|
84
92
|
import { homedir } from "os";
|
|
85
93
|
import { delimiter, dirname, join } from "path";
|
|
94
|
+
var progressHead = (label, done, total) => label === void 0 ? "" : `[${label} ${done}/${total}] `;
|
|
86
95
|
var BATCH_TASK_TIMEOUT_MS = 12 * 60 * 6e4;
|
|
87
96
|
async function runEvalCommand(options) {
|
|
88
97
|
if (options.fromGit) return buildFromGit(options);
|
|
@@ -316,7 +325,7 @@ ${detail === "" ? "" : ` ${detail}
|
|
|
316
325
|
}
|
|
317
326
|
let addendum;
|
|
318
327
|
if (options.addendum !== void 0) {
|
|
319
|
-
const { readAddendum } = await import("./tune-
|
|
328
|
+
const { readAddendum } = await import("./tune-KSNKBPNJ.js");
|
|
320
329
|
const read = await readAddendum(options.addendum);
|
|
321
330
|
if ("problem" in read) {
|
|
322
331
|
process.stderr.write(`${read.problem}
|
|
@@ -359,7 +368,7 @@ ${detail === "" ? "" : ` ${detail}
|
|
|
359
368
|
1,
|
|
360
369
|
options.parallel ?? (batchMode === "on" ? Math.min(tasks.length, 20) : 1)
|
|
361
370
|
);
|
|
362
|
-
const outDir = join(process.cwd(), ".garuda", "evals", newSessionId());
|
|
371
|
+
const outDir = options.outDir ?? join(process.cwd(), ".garuda", "evals", newSessionId());
|
|
363
372
|
mkdirSync(outDir, { recursive: true });
|
|
364
373
|
const stale = staleBuildNote(BUILD_COMMIT, await garudaCommit());
|
|
365
374
|
if (stale !== void 0) process.stderr.write(`Warning: ${stale}
|
|
@@ -378,6 +387,7 @@ ${where}, in scratch folders.
|
|
|
378
387
|
);
|
|
379
388
|
}
|
|
380
389
|
const started = Date.now();
|
|
390
|
+
let done = 0;
|
|
381
391
|
const results = await runEvals(
|
|
382
392
|
tasks,
|
|
383
393
|
{
|
|
@@ -405,8 +415,10 @@ ${where}, in scratch folders.
|
|
|
405
415
|
executor: executor.name === "host" ? "host" : "os",
|
|
406
416
|
...options.keep ? { keep: true } : {},
|
|
407
417
|
onEvent: (taskId, event) => {
|
|
408
|
-
if (event.type === "tool_call"
|
|
418
|
+
if (event.type === "tool_call" && options.progress === void 0) {
|
|
419
|
+
process.stderr.write(` [${taskId}] ${event.call.name}
|
|
409
420
|
`);
|
|
421
|
+
}
|
|
410
422
|
if (event.type === "notice") process.stderr.write(` [${taskId}] ${event.text}
|
|
411
423
|
`);
|
|
412
424
|
if (event.type === "model_retry")
|
|
@@ -416,11 +428,15 @@ ${where}, in scratch folders.
|
|
|
416
428
|
);
|
|
417
429
|
}
|
|
418
430
|
},
|
|
419
|
-
(r) =>
|
|
420
|
-
|
|
431
|
+
(r) => {
|
|
432
|
+
done++;
|
|
433
|
+
const head = progressHead(options.progress, done, tasks.length);
|
|
434
|
+
process.stderr.write(
|
|
435
|
+
`${head}${r.passed ? "\u2713" : "\u2717"} ${r.id}: ${r.passed ? "pass" : "fail"} (${r.steps} steps)${r.reason ? `
|
|
421
436
|
${r.reason.split("\n").slice(0, 3).join("\n ")}` : ""}
|
|
422
437
|
`
|
|
423
|
-
|
|
438
|
+
);
|
|
439
|
+
},
|
|
424
440
|
// A refused key or an unreachable API fails every run: stop at the first one (0.17).
|
|
425
441
|
isSetupFailure
|
|
426
442
|
);
|
|
@@ -495,20 +511,35 @@ async function buildFromGit(options) {
|
|
|
495
511
|
return 1;
|
|
496
512
|
}
|
|
497
513
|
}
|
|
514
|
+
const { loadTeamPolicy } = await import("./policy-ZJ7RMOFN.js");
|
|
515
|
+
let team;
|
|
516
|
+
try {
|
|
517
|
+
team = await loadTeamPolicy();
|
|
518
|
+
} catch (error) {
|
|
519
|
+
process.stderr.write(`Team policy: ${error.message}
|
|
520
|
+
`);
|
|
521
|
+
return 1;
|
|
522
|
+
}
|
|
523
|
+
const { checkAsEval } = await import("./runner-EBF6EOYM.js");
|
|
498
524
|
process.stderr.write(
|
|
499
525
|
`Building the repo suite from ${options.commits ?? DEFAULT_COMMITS} recent commits${options.since === void 0 ? "" : ` since ${options.since}`} in ${root}.
|
|
500
|
-
Each candidate runs its own test files with \`${testCommand}\` twice on this machine (no sandbox), in a git worktree; your checkout does not change.
|
|
526
|
+
Each candidate runs its own test files with \`${testCommand}\` twice on this machine (no sandbox), in a git worktree; your checkout does not change. A kept one runs a third time as an eval runs it: in a copy, in the sandbox.
|
|
501
527
|
|
|
502
528
|
`
|
|
503
529
|
);
|
|
504
|
-
const { suite, checked, skipped, failure } = await buildRepoSuite(
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
530
|
+
const { suite, checked, skipped, failure, evalFailure } = await buildRepoSuite(
|
|
531
|
+
new HostExecutor(),
|
|
532
|
+
root,
|
|
533
|
+
{
|
|
534
|
+
testCommand,
|
|
535
|
+
evalCheck: (sha, check) => checkAsEval(root, sha, check, team === void 0 ? {} : { policy: team.policy }),
|
|
536
|
+
...options.commits === void 0 ? {} : { commits: options.commits },
|
|
537
|
+
...options.since === void 0 ? {} : { since: options.since },
|
|
538
|
+
...options.maxTasks === void 0 ? {} : { maxTasks: options.maxTasks },
|
|
539
|
+
onProgress: (line) => process.stderr.write(` ${line}
|
|
510
540
|
`)
|
|
511
|
-
|
|
541
|
+
}
|
|
542
|
+
);
|
|
512
543
|
const file = await saveRepoSuite(suite);
|
|
513
544
|
const reasons = Object.entries(skipped).sort((a, b) => b[1] - a[1]).map(([why, n]) => ` ${String(n).padStart(4)} ${why}`);
|
|
514
545
|
process.stdout.write(
|
|
@@ -521,6 +552,11 @@ ${suite.tasks.length} task(s) kept; ${checked} candidate(s) checked with the tes
|
|
|
521
552
|
...failure.tail.split("\n").map((line) => ` ${line}`),
|
|
522
553
|
'If every commit fails like this, the tests do not run in a worktree on this machine; give a working command with --test-command ("{files}" takes the test files).'
|
|
523
554
|
],
|
|
555
|
+
...evalFailure === void 0 ? [] : [
|
|
556
|
+
`The first commit whose tests pass here but fail as an eval runs them (${evalFailure.sha.slice(0, 7)}: \`${evalFailure.command}\`):`,
|
|
557
|
+
...evalFailure.tail.split("\n").map((line) => ` ${line}`),
|
|
558
|
+
"No model could pass such a task, so it is left out. A test that needs the network, or starts its own sandbox, fails like this."
|
|
559
|
+
],
|
|
524
560
|
`Suite: ${file}`,
|
|
525
561
|
...suite.tasks.length === 0 ? ["No task: try more commits (--commits 500) or an older --since."] : ["Run it: garuda eval -s repo -m <model> (add --list to see the tasks)"]
|
|
526
562
|
].join("\n")}
|
|
@@ -680,7 +716,9 @@ export {
|
|
|
680
716
|
BATCH_TASK_TIMEOUT_MS,
|
|
681
717
|
chooseMcp,
|
|
682
718
|
claudeCodeAgent,
|
|
719
|
+
progressHead,
|
|
720
|
+
repoSuite,
|
|
683
721
|
runEvalCommand,
|
|
684
722
|
runEvalCompare
|
|
685
723
|
};
|
|
686
|
-
//# sourceMappingURL=evalCommand-
|
|
724
|
+
//# sourceMappingURL=evalCommand-MRO6ENCA.js.map
|
|
@@ -4,22 +4,25 @@ import {
|
|
|
4
4
|
parseProposal,
|
|
5
5
|
readAddendum,
|
|
6
6
|
tune
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YEH2OONM.js";
|
|
8
8
|
import {
|
|
9
9
|
EVAL_SUITES,
|
|
10
10
|
HELD_OUT_TASKS,
|
|
11
|
+
requiredToolchains
|
|
12
|
+
} from "./chunk-LWNMEGDF.js";
|
|
13
|
+
import {
|
|
14
|
+
reportV2
|
|
15
|
+
} from "./chunk-6JQTPW3P.js";
|
|
16
|
+
import "./chunk-YAQ6QLKB.js";
|
|
17
|
+
import "./chunk-E6YRCDSF.js";
|
|
18
|
+
import {
|
|
19
|
+
DEFAULT_SEED,
|
|
11
20
|
TOOLCHAINS,
|
|
12
21
|
checkToolchains,
|
|
13
22
|
formatReport,
|
|
14
|
-
|
|
15
|
-
runEvals
|
|
16
|
-
} from "./chunk-Q4P3W657.js";
|
|
17
|
-
import {
|
|
18
|
-
DEFAULT_SEED,
|
|
19
|
-
reportV2,
|
|
23
|
+
runEvals,
|
|
20
24
|
shuffled
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-NXJ4XLB5.js";
|
|
25
|
+
} from "./chunk-A5DLAXB4.js";
|
|
23
26
|
import {
|
|
24
27
|
NO_MODEL,
|
|
25
28
|
chooseModel,
|
|
@@ -27,29 +30,32 @@ import {
|
|
|
27
30
|
loadModelsConfig,
|
|
28
31
|
resolveModel
|
|
29
32
|
} from "./chunk-2FIV2VZP.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-NXJ4XLB5.js";
|
|
34
|
+
import "./chunk-STVFWSIL.js";
|
|
32
35
|
import "./chunk-G2AX7MGS.js";
|
|
36
|
+
import "./chunk-ULAJPMY7.js";
|
|
37
|
+
import "./chunk-65NUEOI7.js";
|
|
38
|
+
import "./chunk-4QRTTRVK.js";
|
|
33
39
|
import "./chunk-A2QAIRQL.js";
|
|
34
40
|
import {
|
|
35
41
|
newSessionId
|
|
36
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-NLS7GMF7.js";
|
|
37
43
|
import {
|
|
38
44
|
costOf
|
|
39
45
|
} from "./chunk-7KBOIPUT.js";
|
|
40
46
|
import "./chunk-B25VL4RU.js";
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-MNE7HHX2.js";
|
|
48
|
+
import "./chunk-CFDRP6XW.js";
|
|
43
49
|
import "./chunk-5DEWP3YX.js";
|
|
44
50
|
import "./chunk-PZS3V6P3.js";
|
|
45
51
|
import "./chunk-QANRZW7W.js";
|
|
46
52
|
import "./chunk-ATW7BNIG.js";
|
|
47
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-WK5NE6RY.js";
|
|
48
54
|
import "./chunk-AOGFYUKG.js";
|
|
49
|
-
import "./chunk-
|
|
55
|
+
import "./chunk-QXTHEFKP.js";
|
|
50
56
|
import {
|
|
51
57
|
createExecutor
|
|
52
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-LMKGSYJC.js";
|
|
53
59
|
import "./chunk-BHZ6G65V.js";
|
|
54
60
|
import "./chunk-P6XWWIEK.js";
|
|
55
61
|
import "./chunk-UIRJOQQS.js";
|
|
@@ -292,4 +298,4 @@ export {
|
|
|
292
298
|
progressLine,
|
|
293
299
|
runEvalTune
|
|
294
300
|
};
|
|
295
|
-
//# sourceMappingURL=evalTune-
|
|
301
|
+
//# sourceMappingURL=evalTune-VL5RHYOG.js.map
|
|
@@ -2,11 +2,20 @@
|
|
|
2
2
|
import {
|
|
3
3
|
summariseCall,
|
|
4
4
|
summariseResult
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AX3A5KPH.js";
|
|
6
|
+
import {
|
|
7
|
+
receiptText
|
|
8
|
+
} from "./chunk-2OYTNNUJ.js";
|
|
9
|
+
import {
|
|
10
|
+
hasReceipt
|
|
11
|
+
} from "./chunk-4QRTTRVK.js";
|
|
6
12
|
import {
|
|
7
13
|
serverCallText,
|
|
8
14
|
serverResultSummary
|
|
9
15
|
} from "./chunk-A2QAIRQL.js";
|
|
16
|
+
import "./chunk-NLS7GMF7.js";
|
|
17
|
+
import "./chunk-7KBOIPUT.js";
|
|
18
|
+
import "./chunk-BHZ6G65V.js";
|
|
10
19
|
import {
|
|
11
20
|
PathOutsideRootError,
|
|
12
21
|
displayPath,
|
|
@@ -98,6 +107,20 @@ function sessionMarkdown(records, sessionId) {
|
|
|
98
107
|
case "compaction":
|
|
99
108
|
out.push("_The conversation was compacted here to fit the context window._", "");
|
|
100
109
|
break;
|
|
110
|
+
case "fork":
|
|
111
|
+
out.push(
|
|
112
|
+
`_This session starts as a fork of session ${record.from.sessionId}, at turn ${record.from.turn}._`,
|
|
113
|
+
""
|
|
114
|
+
);
|
|
115
|
+
break;
|
|
116
|
+
case "receipt":
|
|
117
|
+
if (hasReceipt(record.receipt)) {
|
|
118
|
+
out.push(
|
|
119
|
+
...receiptText(record.receipt).split("\n").map((line) => `> ${line}`),
|
|
120
|
+
""
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
break;
|
|
101
124
|
case "model":
|
|
102
125
|
out.push(`_The model changed to ${record.model}._`, "");
|
|
103
126
|
break;
|
|
@@ -129,8 +152,8 @@ function when(iso) {
|
|
|
129
152
|
const pad = (n) => String(n).padStart(2, "0");
|
|
130
153
|
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
131
154
|
}
|
|
132
|
-
async function writeExport(root, sessionId, markdown, file = "") {
|
|
133
|
-
const name = file === "" ? `garuda-${sessionId}
|
|
155
|
+
async function writeExport(root, sessionId, markdown, file = "", ext = ".md") {
|
|
156
|
+
const name = file === "" ? `garuda-${sessionId}${ext}` : file;
|
|
134
157
|
let absolute;
|
|
135
158
|
try {
|
|
136
159
|
absolute = await resolveInRoot(root, name);
|
|
@@ -155,4 +178,4 @@ export {
|
|
|
155
178
|
sessionMarkdown,
|
|
156
179
|
writeExport
|
|
157
180
|
};
|
|
158
|
-
//# sourceMappingURL=export-
|
|
181
|
+
//# sourceMappingURL=export-ZPF3AMO6.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
OUTPUT_CHARS,
|
|
4
|
+
callChange,
|
|
5
|
+
escapeHtml,
|
|
6
|
+
sessionHtml
|
|
7
|
+
} from "./chunk-4BELTWP4.js";
|
|
8
|
+
import "./chunk-AX3A5KPH.js";
|
|
9
|
+
import "./chunk-2OYTNNUJ.js";
|
|
10
|
+
import "./chunk-4QRTTRVK.js";
|
|
11
|
+
import "./chunk-A2QAIRQL.js";
|
|
12
|
+
import "./chunk-NLS7GMF7.js";
|
|
13
|
+
import "./chunk-7KBOIPUT.js";
|
|
14
|
+
import "./chunk-BHZ6G65V.js";
|
|
15
|
+
export {
|
|
16
|
+
OUTPUT_CHARS,
|
|
17
|
+
callChange,
|
|
18
|
+
escapeHtml,
|
|
19
|
+
sessionHtml
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=exportHtml-ISISG5HG.js.map
|