@hacksmith/doraval 0.2.48 → 0.2.50
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/README.md +2 -2
- package/bin/doraval.js +299 -287
- package/bin/ui/index.html +199 -56
- package/package.json +1 -1
package/bin/doraval.js
CHANGED
|
@@ -599,7 +599,7 @@ var init_dist = __esm(() => {
|
|
|
599
599
|
var require_package = __commonJS((exports, module) => {
|
|
600
600
|
module.exports = {
|
|
601
601
|
name: "@hacksmith/doraval",
|
|
602
|
-
version: "0.2.
|
|
602
|
+
version: "0.2.50",
|
|
603
603
|
author: "Saif",
|
|
604
604
|
repository: {
|
|
605
605
|
type: "git",
|
|
@@ -1284,6 +1284,16 @@ function truncateToolCalls(calls, maxCalls) {
|
|
|
1284
1284
|
const selected = new Set([...headSet, ...tailSet, ...skillCalls.map((c) => c.index)]);
|
|
1285
1285
|
return calls.filter((c) => selected.has(c.index));
|
|
1286
1286
|
}
|
|
1287
|
+
function sanitizeSessionId(raw) {
|
|
1288
|
+
if (!raw || typeof raw !== "string") {
|
|
1289
|
+
return `unknown-${Date.now()}`;
|
|
1290
|
+
}
|
|
1291
|
+
let sanitized = raw.replace(/[^a-zA-Z0-9_-]/g, "-").replace(/-+/g, "-").replace(/^[-_]+|[-_]+$/g, "").slice(0, 64);
|
|
1292
|
+
if (!sanitized || sanitized === "." || sanitized === ".." || sanitized.includes("..")) {
|
|
1293
|
+
return `unknown-${Date.now()}`;
|
|
1294
|
+
}
|
|
1295
|
+
return sanitized;
|
|
1296
|
+
}
|
|
1287
1297
|
|
|
1288
1298
|
// src/core/session-adapters.ts
|
|
1289
1299
|
import { existsSync as existsSync3, readdirSync, readFileSync, statSync } from "fs";
|
|
@@ -1406,8 +1416,6 @@ function extractCandidates(text) {
|
|
|
1406
1416
|
async function invokeAgent(promptText, agentCfg, expectedKeys) {
|
|
1407
1417
|
const template = agentCfg.prompt_template ?? '-p "{{prompt}}" --output-format json --bare';
|
|
1408
1418
|
const extraArgs = buildAgentArgv(template, promptText);
|
|
1409
|
-
const shortTemplate = template.slice(0, 80);
|
|
1410
|
-
ui.write(` ${import_picocolors4.default.dim(`\u2192 ${agentCfg.command} ${shortTemplate}...`)}`);
|
|
1411
1419
|
let result;
|
|
1412
1420
|
try {
|
|
1413
1421
|
result = spawnSync([agentCfg.command, ...extraArgs], {
|
|
@@ -1416,21 +1424,11 @@ async function invokeAgent(promptText, agentCfg, expectedKeys) {
|
|
|
1416
1424
|
env: { ...process.env }
|
|
1417
1425
|
});
|
|
1418
1426
|
} catch (e) {
|
|
1419
|
-
ui.write(` ${import_picocolors4.default.yellow("\u26A0")} Failed to spawn ${agentCfg.command}: ${e.message}`);
|
|
1420
1427
|
return null;
|
|
1421
1428
|
}
|
|
1422
|
-
const stdout = result.stdout.toString().trim();
|
|
1423
|
-
const stderr = result.stderr.toString().trim();
|
|
1429
|
+
const stdout = (result.stdout ?? "").toString().trim();
|
|
1430
|
+
const stderr = (result.stderr ?? "").toString().trim();
|
|
1424
1431
|
if (result.exitCode !== 0) {
|
|
1425
|
-
ui.write(` ${import_picocolors4.default.yellow("\u26A0")} Agent exited with code ${result.exitCode}.`);
|
|
1426
|
-
const out = stdout.replace(/sk-[a-zA-Z0-9_-]+/g, "sk-REDACTED").slice(0, 800);
|
|
1427
|
-
const err = stderr.replace(/sk-[a-zA-Z0-9_-]+/g, "sk-REDACTED").slice(0, 800);
|
|
1428
|
-
if (err)
|
|
1429
|
-
ui.write(` stderr: ${err}`);
|
|
1430
|
-
if (out)
|
|
1431
|
-
ui.write(` stdout: ${out}`);
|
|
1432
|
-
if (!err && !out)
|
|
1433
|
-
ui.write(` (no output captured)`);
|
|
1434
1432
|
return null;
|
|
1435
1433
|
}
|
|
1436
1434
|
let cleaned = stdout.replace(/```(?:json)?\s*([\s\S]*?)\s*```/gi, "$1").trim();
|
|
@@ -1441,14 +1439,9 @@ async function invokeAgent(promptText, agentCfg, expectedKeys) {
|
|
|
1441
1439
|
}
|
|
1442
1440
|
if (unwrapped[0])
|
|
1443
1441
|
return unwrapped[0];
|
|
1444
|
-
ui.write(` ${import_picocolors4.default.yellow("\u26A0")} Agent produced no usable JSON. stdout (700 chars): ${stdout.slice(0, 700)}`);
|
|
1445
1442
|
return null;
|
|
1446
1443
|
}
|
|
1447
|
-
var
|
|
1448
|
-
var init_agent_invoke = __esm(() => {
|
|
1449
|
-
init_out();
|
|
1450
|
-
import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
1451
|
-
});
|
|
1444
|
+
var init_agent_invoke = () => {};
|
|
1452
1445
|
|
|
1453
1446
|
// src/core/session-eval.ts
|
|
1454
1447
|
function toolCallSummary(call) {
|
|
@@ -1531,7 +1524,6 @@ async function runEval(primitives, skillName, skillContent, agentCfg, evalCfg) {
|
|
|
1531
1524
|
return makeUnknownResult(primitives, skillName, "LLM call failed \u2014 no response");
|
|
1532
1525
|
}
|
|
1533
1526
|
if (typeof raw.verdict !== "string" || !Array.isArray(raw.checklist)) {
|
|
1534
|
-
ui.write(` ${import_picocolors5.default.yellow("\u26A0")} Received from agent (first 800 chars): ${JSON.stringify(raw).slice(0, 800)}`);
|
|
1535
1527
|
return makeUnknownResult(primitives, skillName, "LLM returned malformed response");
|
|
1536
1528
|
}
|
|
1537
1529
|
const checklist = raw.checklist.map((item) => {
|
|
@@ -1561,11 +1553,8 @@ async function runEval(primitives, skillName, skillContent, agentCfg, evalCfg) {
|
|
|
1561
1553
|
checklist
|
|
1562
1554
|
};
|
|
1563
1555
|
}
|
|
1564
|
-
var import_picocolors5;
|
|
1565
1556
|
var init_session_eval = __esm(() => {
|
|
1566
1557
|
init_agent_invoke();
|
|
1567
|
-
init_out();
|
|
1568
|
-
import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
1569
1558
|
});
|
|
1570
1559
|
|
|
1571
1560
|
// src/core/journal-config.ts
|
|
@@ -1651,15 +1640,15 @@ var init_journal_config = () => {};
|
|
|
1651
1640
|
|
|
1652
1641
|
// src/cli/prompt.ts
|
|
1653
1642
|
function prompt(label, fallback) {
|
|
1654
|
-
process.stderr.write(`${label} ${
|
|
1643
|
+
process.stderr.write(`${label} ${import_picocolors4.default.dim(`(${fallback})`)} `);
|
|
1655
1644
|
const buf = new Uint8Array(1024);
|
|
1656
1645
|
const n = __require("fs").readSync(0, buf);
|
|
1657
1646
|
const input = new TextDecoder().decode(buf.subarray(0, n)).trim();
|
|
1658
1647
|
return input || fallback;
|
|
1659
1648
|
}
|
|
1660
|
-
var
|
|
1649
|
+
var import_picocolors4;
|
|
1661
1650
|
var init_prompt = __esm(() => {
|
|
1662
|
-
|
|
1651
|
+
import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
1663
1652
|
});
|
|
1664
1653
|
|
|
1665
1654
|
// src/cli/commands/eval.ts
|
|
@@ -1668,12 +1657,12 @@ __export(exports_eval, {
|
|
|
1668
1657
|
default: () => eval_default
|
|
1669
1658
|
});
|
|
1670
1659
|
import { join as join3, basename } from "path";
|
|
1671
|
-
import { existsSync as existsSync5 } from "fs";
|
|
1660
|
+
import { existsSync as existsSync5, readFileSync as readFileSync2 } from "fs";
|
|
1672
1661
|
function renderResult(result, verbose) {
|
|
1673
|
-
const verdictColor = result.verdict === "PASS" ?
|
|
1662
|
+
const verdictColor = result.verdict === "PASS" ? import_picocolors5.default.green : result.verdict === "FAIL" ? import_picocolors5.default.red : import_picocolors5.default.yellow;
|
|
1674
1663
|
const verdictSymbol = result.verdict === "PASS" ? "\u2713" : result.verdict === "FAIL" ? "\u2717" : "?";
|
|
1675
1664
|
ui.write(`
|
|
1676
|
-
${verdictColor(`[${result.verdict}]`)} ${
|
|
1665
|
+
${verdictColor(`[${result.verdict}]`)} ${import_picocolors5.default.bold(result.skill)}`);
|
|
1677
1666
|
ui.write(` agent: ${result.agent}`);
|
|
1678
1667
|
ui.write(` model: ${result.model}`);
|
|
1679
1668
|
if (result.userFamiliarity > 0) {
|
|
@@ -1687,8 +1676,8 @@ function renderResult(result, verbose) {
|
|
|
1687
1676
|
ui.write(`
|
|
1688
1677
|
Adherence:`);
|
|
1689
1678
|
for (const item of result.checklist) {
|
|
1690
|
-
const sym = item.pass ?
|
|
1691
|
-
const detail = item.detail ? ` ${
|
|
1679
|
+
const sym = item.pass ? import_picocolors5.default.green("\u2713") : import_picocolors5.default.red("\u2717");
|
|
1680
|
+
const detail = item.detail ? ` ${import_picocolors5.default.dim(item.detail)}` : "";
|
|
1692
1681
|
ui.write(` ${sym} ${item.instruction}${detail}`);
|
|
1693
1682
|
}
|
|
1694
1683
|
const passed = result.checklist.filter((c) => c.pass).length;
|
|
@@ -1711,7 +1700,7 @@ function selectRecentSessions(recent) {
|
|
|
1711
1700
|
const titleStr = s.title ? ` "${s.title.slice(0, 45)}"` : "";
|
|
1712
1701
|
const skillStr = s.skillCount > 0 ? ` (${s.skillCount} skill${s.skillCount === 1 ? "" : "s"})` : "";
|
|
1713
1702
|
const short = basename(s.path);
|
|
1714
|
-
ui.write(` ${i + 1}. ${date}${titleStr}${skillStr} ${
|
|
1703
|
+
ui.write(` ${i + 1}. ${date}${titleStr}${skillStr} ${import_picocolors5.default.dim(short)}`);
|
|
1715
1704
|
});
|
|
1716
1705
|
const input = prompt(`
|
|
1717
1706
|
Select session(s) (e.g. 1,3 or 2-4 or all or latest): `, "1").trim().toLowerCase();
|
|
@@ -1744,7 +1733,7 @@ function selectRecentSessions(recent) {
|
|
|
1744
1733
|
}
|
|
1745
1734
|
return selected.size > 0 ? Array.from(selected) : [recent[0].path];
|
|
1746
1735
|
}
|
|
1747
|
-
var
|
|
1736
|
+
var import_picocolors5, eval_default;
|
|
1748
1737
|
var init_eval = __esm(() => {
|
|
1749
1738
|
init_dist();
|
|
1750
1739
|
init_out();
|
|
@@ -1753,7 +1742,7 @@ var init_eval = __esm(() => {
|
|
|
1753
1742
|
init_journal_config();
|
|
1754
1743
|
init_skill_validate();
|
|
1755
1744
|
init_prompt();
|
|
1756
|
-
|
|
1745
|
+
import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
1757
1746
|
eval_default = defineCommand({
|
|
1758
1747
|
meta: {
|
|
1759
1748
|
name: "eval",
|
|
@@ -1801,15 +1790,16 @@ var init_eval = __esm(() => {
|
|
|
1801
1790
|
ui.info(" If you want to record a specific model, run: dora config set eval.model claude-3-5-sonnet-20241022");
|
|
1802
1791
|
}
|
|
1803
1792
|
let sessionPaths = [];
|
|
1793
|
+
let discoveryAdapter = null;
|
|
1804
1794
|
if (args.session) {
|
|
1805
1795
|
sessionPaths = String(args.session).split(/[\s,]+/).map((s) => s.trim()).filter(Boolean);
|
|
1806
1796
|
} else {
|
|
1807
|
-
|
|
1808
|
-
if (!
|
|
1797
|
+
discoveryAdapter = getAdapter();
|
|
1798
|
+
if (!discoveryAdapter) {
|
|
1809
1799
|
ui.fail("No supported coding agent detected. Is Claude Code installed?");
|
|
1810
1800
|
process.exit(2);
|
|
1811
1801
|
}
|
|
1812
|
-
let recent =
|
|
1802
|
+
let recent = discoveryAdapter.listRecentSessions(process.cwd(), 12);
|
|
1813
1803
|
const withSkills = recent.filter((s) => s.skillCount > 0);
|
|
1814
1804
|
if (withSkills.length > 0)
|
|
1815
1805
|
recent = withSkills;
|
|
@@ -1830,15 +1820,23 @@ var init_eval = __esm(() => {
|
|
|
1830
1820
|
ui.fail("No sessions selected.");
|
|
1831
1821
|
process.exit(2);
|
|
1832
1822
|
}
|
|
1833
|
-
const adapter = getAdapter();
|
|
1834
|
-
if (!adapter) {
|
|
1835
|
-
ui.fail("No supported coding agent detected.");
|
|
1836
|
-
process.exit(2);
|
|
1837
|
-
}
|
|
1838
1823
|
const allResults = [];
|
|
1839
1824
|
for (const sessionPath of sessionPaths) {
|
|
1840
|
-
ui.info(` Session: ${
|
|
1841
|
-
|
|
1825
|
+
ui.info(` Session: ${import_picocolors5.default.dim(sessionPath)}`);
|
|
1826
|
+
let primitives;
|
|
1827
|
+
try {
|
|
1828
|
+
if (discoveryAdapter) {
|
|
1829
|
+
primitives = discoveryAdapter.parse(sessionPath);
|
|
1830
|
+
} else {
|
|
1831
|
+
const text = readFileSync2(sessionPath, "utf8");
|
|
1832
|
+
primitives = parseSession(text);
|
|
1833
|
+
}
|
|
1834
|
+
} catch (err) {
|
|
1835
|
+
ui.fail(`Failed to read or parse session: ${sessionPath}`);
|
|
1836
|
+
if (err?.message)
|
|
1837
|
+
ui.info(` ${err.message}`);
|
|
1838
|
+
continue;
|
|
1839
|
+
}
|
|
1842
1840
|
if (primitives.skillsInvoked.length === 0) {
|
|
1843
1841
|
ui.warn(" No skills were invoked in this session.");
|
|
1844
1842
|
continue;
|
|
@@ -1851,11 +1849,11 @@ var init_eval = __esm(() => {
|
|
|
1851
1849
|
continue;
|
|
1852
1850
|
}
|
|
1853
1851
|
}
|
|
1854
|
-
ui.write(` ${
|
|
1852
|
+
ui.write(` ${import_picocolors5.default.dim("\xB7 Sending session summary (tool calls + 5 user messages) to")} ${import_picocolors5.default.dim(evalCfg.model || "configured model")}${import_picocolors5.default.dim(". Use --verbose to inspect.")}`);
|
|
1855
1853
|
ensureDoravalDirs();
|
|
1856
1854
|
for (const skillName of skillsToEval) {
|
|
1857
1855
|
ui.info(`
|
|
1858
|
-
Evaluating: ${
|
|
1856
|
+
Evaluating: ${import_picocolors5.default.bold(skillName)}`);
|
|
1859
1857
|
let skillContent = `Skill: ${skillName}
|
|
1860
1858
|
(skill content not found locally \u2014 using skill name only for evaluation)`;
|
|
1861
1859
|
const candidateDirs = [
|
|
@@ -1875,7 +1873,8 @@ var init_eval = __esm(() => {
|
|
|
1875
1873
|
const result = await runEval(primitives, skillName, skillContent, agentCfg, evalCfg);
|
|
1876
1874
|
allResults.push(result);
|
|
1877
1875
|
if (evalCfg.save_history) {
|
|
1878
|
-
const
|
|
1876
|
+
const safeId = sanitizeSessionId(primitives.sessionId) || `unknown-${Date.now()}`;
|
|
1877
|
+
const evalPath = join3(getEvalsDir(), `${safeId}-${Date.now()}.json`);
|
|
1879
1878
|
await Bun.write(evalPath, JSON.stringify(result, null, 2));
|
|
1880
1879
|
}
|
|
1881
1880
|
}
|
|
@@ -2050,14 +2049,14 @@ __export(exports_init, {
|
|
|
2050
2049
|
default: () => init_default
|
|
2051
2050
|
});
|
|
2052
2051
|
import { basename as basename2, join as join4 } from "path";
|
|
2053
|
-
var
|
|
2052
|
+
var import_picocolors6, init_default;
|
|
2054
2053
|
var init_init = __esm(() => {
|
|
2055
2054
|
init_dist();
|
|
2056
2055
|
init_out();
|
|
2057
2056
|
init_journal_config();
|
|
2058
2057
|
init_journal_remote();
|
|
2059
2058
|
init_prompt();
|
|
2060
|
-
|
|
2059
|
+
import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
2061
2060
|
init_default = defineCommand({
|
|
2062
2061
|
meta: {
|
|
2063
2062
|
name: "init",
|
|
@@ -2082,21 +2081,21 @@ var init_init = __esm(() => {
|
|
|
2082
2081
|
},
|
|
2083
2082
|
async run({ args }) {
|
|
2084
2083
|
ui.write(`
|
|
2085
|
-
${
|
|
2084
|
+
${import_picocolors6.default.bold(import_picocolors6.default.white("dora journal init"))} (or top-level ${import_picocolors6.default.dim(import_picocolors6.default.gray("dora init"))}) \u2014 Set up your journal
|
|
2086
2085
|
`);
|
|
2087
2086
|
const ghCheck = ensureGhCli();
|
|
2088
2087
|
if (!ghCheck.ok) {
|
|
2089
|
-
ui.write(` ${
|
|
2088
|
+
ui.write(` ${import_picocolors6.default.red("\u2717")} ${import_picocolors6.default.white("The GitHub CLI (")}${import_picocolors6.default.bold("gh")}${import_picocolors6.default.white(") is not installed.")}
|
|
2090
2089
|
`);
|
|
2091
|
-
ui.write(` doraval uses ${
|
|
2090
|
+
ui.write(` doraval uses ${import_picocolors6.default.bold("gh")} to fetch and sync journal files with GitHub.
|
|
2092
2091
|
`);
|
|
2093
2092
|
ui.write(` Install it:
|
|
2094
2093
|
`);
|
|
2095
|
-
ui.write(` macOS: ${
|
|
2096
|
-
ui.write(` Linux: ${
|
|
2097
|
-
ui.write(` Windows: ${
|
|
2094
|
+
ui.write(` macOS: ${import_picocolors6.default.dim("brew install gh")}`);
|
|
2095
|
+
ui.write(` Linux: ${import_picocolors6.default.dim("https://github.com/cli/cli/blob/trunk/docs/install_linux.md")}`);
|
|
2096
|
+
ui.write(` Windows: ${import_picocolors6.default.dim("winget install --id GitHub.cli")}
|
|
2098
2097
|
`);
|
|
2099
|
-
ui.write(` Then authenticate: ${
|
|
2098
|
+
ui.write(` Then authenticate: ${import_picocolors6.default.dim("gh auth login")}
|
|
2100
2099
|
`);
|
|
2101
2100
|
process.exit(1);
|
|
2102
2101
|
}
|
|
@@ -2109,28 +2108,28 @@ var init_init = __esm(() => {
|
|
|
2109
2108
|
if (gitOwner) {
|
|
2110
2109
|
defaultRepo = `${gitOwner}/${gitOwner}.md`;
|
|
2111
2110
|
if (ghLogin && ghLogin !== gitOwner) {
|
|
2112
|
-
sourceNote = ` ${
|
|
2111
|
+
sourceNote = ` ${import_picocolors6.default.dim("(from git remote; your active gh account is " + ghLogin + ")")}
|
|
2113
2112
|
`;
|
|
2114
2113
|
} else {
|
|
2115
|
-
sourceNote = ` ${
|
|
2114
|
+
sourceNote = ` ${import_picocolors6.default.dim("(from git remote)")}
|
|
2116
2115
|
`;
|
|
2117
2116
|
}
|
|
2118
2117
|
} else if (ghLogin) {
|
|
2119
2118
|
defaultRepo = `${ghLogin}/${ghLogin}.md`;
|
|
2120
|
-
sourceNote = ` ${
|
|
2119
|
+
sourceNote = ` ${import_picocolors6.default.dim("(from your active gh account)")}
|
|
2121
2120
|
`;
|
|
2122
2121
|
} else {
|
|
2123
|
-
ui.write(` ${
|
|
2122
|
+
ui.write(` ${import_picocolors6.default.yellow("\u26A0")} Not logged in to GitHub. Run ${import_picocolors6.default.dim("gh auth login")} first.
|
|
2124
2123
|
`);
|
|
2125
2124
|
process.exit(1);
|
|
2126
2125
|
}
|
|
2127
2126
|
const existingConfig = await readConfig();
|
|
2128
2127
|
if (existingConfig?.journal.repo) {
|
|
2129
2128
|
defaultRepo = existingConfig.journal.repo;
|
|
2130
|
-
sourceNote = ` ${
|
|
2129
|
+
sourceNote = ` ${import_picocolors6.default.dim("(from your previous journal setup)")}
|
|
2131
2130
|
`;
|
|
2132
2131
|
}
|
|
2133
|
-
ui.write(` Journal repo ${
|
|
2132
|
+
ui.write(` Journal repo ${import_picocolors6.default.dim(import_picocolors6.default.gray("(owner/name)"))}`);
|
|
2134
2133
|
if (sourceNote)
|
|
2135
2134
|
ui.write(sourceNote);
|
|
2136
2135
|
repo = prompt(" >", defaultRepo);
|
|
@@ -2142,13 +2141,13 @@ var init_init = __esm(() => {
|
|
|
2142
2141
|
}
|
|
2143
2142
|
project = sanitizeProjectName(project);
|
|
2144
2143
|
if (!repoExists(repo)) {
|
|
2145
|
-
ui.write(` ${
|
|
2144
|
+
ui.write(` ${import_picocolors6.default.red("\u2717")} Repository ${import_picocolors6.default.bold(import_picocolors6.default.white(repo))} not found on GitHub.
|
|
2146
2145
|
`);
|
|
2147
2146
|
ui.write(` Create it first:
|
|
2148
2147
|
`);
|
|
2149
|
-
ui.write(` ${
|
|
2148
|
+
ui.write(` ${import_picocolors6.default.dim(`gh repo create ${repo} --private --description "Personal journal for agent decisions"`)}
|
|
2150
2149
|
`);
|
|
2151
|
-
ui.write(` The repo should be private. doraval will populate it on first ${
|
|
2150
|
+
ui.write(` The repo should be private. doraval will populate it on first ${import_picocolors6.default.dim("dora journal sync")}.
|
|
2152
2151
|
`);
|
|
2153
2152
|
process.exit(1);
|
|
2154
2153
|
}
|
|
@@ -2156,14 +2155,14 @@ var init_init = __esm(() => {
|
|
|
2156
2155
|
const alreadyRegistered = existing?.journal.projects[project];
|
|
2157
2156
|
const isRefresh = alreadyRegistered && args.refresh;
|
|
2158
2157
|
if (alreadyRegistered && !isRefresh) {
|
|
2159
|
-
ui.write(` ${
|
|
2158
|
+
ui.write(` ${import_picocolors6.default.yellow("\u26A0")} Project ${import_picocolors6.default.bold(import_picocolors6.default.white(project))} is already registered.
|
|
2160
2159
|
`);
|
|
2161
|
-
ui.write(` Repo: ${
|
|
2160
|
+
ui.write(` Repo: ${import_picocolors6.default.gray(existing.journal.repo)}`);
|
|
2162
2161
|
ui.write(` Remote: ${existing.journal.projects[project]?.remote_path}
|
|
2163
2162
|
`);
|
|
2164
|
-
ui.write(` To refresh local files, run: ${
|
|
2163
|
+
ui.write(` To refresh local files, run: ${import_picocolors6.default.dim(import_picocolors6.default.gray(`dora journal update`))}
|
|
2165
2164
|
` + ` (init --refresh still works for compatibility.)
|
|
2166
|
-
` + ` Or remove the project from ${
|
|
2165
|
+
` + ` Or remove the project from ${import_picocolors6.default.dim(import_picocolors6.default.gray("~/.doraval/config.yml"))} to fully re-initialize.
|
|
2167
2166
|
`);
|
|
2168
2167
|
process.exit(0);
|
|
2169
2168
|
}
|
|
@@ -2181,7 +2180,7 @@ var init_init = __esm(() => {
|
|
|
2181
2180
|
};
|
|
2182
2181
|
ensureDoravalDirs();
|
|
2183
2182
|
const actionLabel = isRefresh ? "Refreshing" : "Fetching";
|
|
2184
|
-
ui.write(` ${
|
|
2183
|
+
ui.write(` ${import_picocolors6.default.dim(import_picocolors6.default.gray(`${actionLabel} journal files from`))} ${import_picocolors6.default.gray(effectiveRepo)}${import_picocolors6.default.dim(import_picocolors6.default.gray("..."))}
|
|
2185
2184
|
`);
|
|
2186
2185
|
const globalDest = join4(journalsDir, "global.md");
|
|
2187
2186
|
const refreshGlobalRes = await refreshLocalJournalFile(effectiveRepo, "global.md", globalDest);
|
|
@@ -2190,7 +2189,7 @@ var init_init = __esm(() => {
|
|
|
2190
2189
|
if (refreshGlobalRes.isNotFound) {
|
|
2191
2190
|
wroteGlobal = false;
|
|
2192
2191
|
} else {
|
|
2193
|
-
ui.write(` ${
|
|
2192
|
+
ui.write(` ${import_picocolors6.default.red("\u2717")} Failed to fetch global.md from ${effectiveRepo}:`);
|
|
2194
2193
|
ui.write(refreshGlobalRes.error);
|
|
2195
2194
|
process.exit(1);
|
|
2196
2195
|
}
|
|
@@ -2198,9 +2197,9 @@ var init_init = __esm(() => {
|
|
|
2198
2197
|
wroteGlobal = refreshGlobalRes.value;
|
|
2199
2198
|
}
|
|
2200
2199
|
if (wroteGlobal) {
|
|
2201
|
-
ui.write(` ${
|
|
2200
|
+
ui.write(` ${import_picocolors6.default.green("\u2713")} global.md`);
|
|
2202
2201
|
} else {
|
|
2203
|
-
ui.write(` ${
|
|
2202
|
+
ui.write(` ${import_picocolors6.default.dim("\xB7")} global.md ${import_picocolors6.default.dim("(not found \u2014 will be created on first sync)")}`);
|
|
2204
2203
|
await Bun.write(globalDest, `# Global Journal
|
|
2205
2204
|
|
|
2206
2205
|
Cross-project principles.
|
|
@@ -2212,7 +2211,7 @@ Cross-project principles.
|
|
|
2212
2211
|
if (refreshProjectRes.isNotFound) {
|
|
2213
2212
|
wroteProject = false;
|
|
2214
2213
|
} else {
|
|
2215
|
-
ui.write(` ${
|
|
2214
|
+
ui.write(` ${import_picocolors6.default.red("\u2717")} Failed to fetch ${remotePath} from ${effectiveRepo}:`);
|
|
2216
2215
|
ui.write(refreshProjectRes.error);
|
|
2217
2216
|
process.exit(1);
|
|
2218
2217
|
}
|
|
@@ -2220,9 +2219,9 @@ Cross-project principles.
|
|
|
2220
2219
|
wroteProject = refreshProjectRes.value;
|
|
2221
2220
|
}
|
|
2222
2221
|
if (wroteProject) {
|
|
2223
|
-
ui.write(` ${
|
|
2222
|
+
ui.write(` ${import_picocolors6.default.green("\u2713")} ${remotePath}`);
|
|
2224
2223
|
} else {
|
|
2225
|
-
ui.write(` ${
|
|
2224
|
+
ui.write(` ${import_picocolors6.default.dim("\xB7")} ${remotePath} ${import_picocolors6.default.dim("(not found \u2014 will be created on first sync)")}`);
|
|
2226
2225
|
await Bun.write(localPath, `# ${project} Journal
|
|
2227
2226
|
|
|
2228
2227
|
Project-specific decisions.
|
|
@@ -2230,13 +2229,13 @@ Project-specific decisions.
|
|
|
2230
2229
|
}
|
|
2231
2230
|
await writeConfig(config);
|
|
2232
2231
|
ui.write(`
|
|
2233
|
-
${
|
|
2232
|
+
${import_picocolors6.default.green("\u2713")} Project ${import_picocolors6.default.bold(import_picocolors6.default.white(project))} registered to ${import_picocolors6.default.bold(import_picocolors6.default.white(repo))}.
|
|
2234
2233
|
`);
|
|
2235
|
-
ui.write(` Config: ${
|
|
2236
|
-
ui.write(` Journals: ${
|
|
2237
|
-
ui.write(` Pending: ${
|
|
2234
|
+
ui.write(` Config: ${import_picocolors6.default.dim(import_picocolors6.default.gray("~/.doraval/config.yml"))}`);
|
|
2235
|
+
ui.write(` Journals: ${import_picocolors6.default.dim(import_picocolors6.default.gray("~/.doraval/journals/"))}`);
|
|
2236
|
+
ui.write(` Pending: ${import_picocolors6.default.dim(import_picocolors6.default.gray("~/.doraval/pending/"))}
|
|
2238
2237
|
`);
|
|
2239
|
-
ui.write(` Use ${
|
|
2238
|
+
ui.write(` Use ${import_picocolors6.default.dim(import_picocolors6.default.gray("dora journal add"))} to propose decisions and ${import_picocolors6.default.dim(import_picocolors6.default.gray("dora journal list"))} to view them.
|
|
2240
2239
|
`);
|
|
2241
2240
|
process.exit(0);
|
|
2242
2241
|
}
|
|
@@ -2312,13 +2311,13 @@ __export(exports_list, {
|
|
|
2312
2311
|
});
|
|
2313
2312
|
import { existsSync as existsSync6, readdirSync as readdirSync2 } from "fs";
|
|
2314
2313
|
import { join as join5 } from "path";
|
|
2315
|
-
var
|
|
2314
|
+
var import_picocolors7, list_default;
|
|
2316
2315
|
var init_list = __esm(() => {
|
|
2317
2316
|
init_dist();
|
|
2318
2317
|
init_out();
|
|
2319
2318
|
init_journal_config();
|
|
2320
2319
|
init_journal_parse();
|
|
2321
|
-
|
|
2320
|
+
import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
2322
2321
|
list_default = defineCommand({
|
|
2323
2322
|
meta: {
|
|
2324
2323
|
name: "list",
|
|
@@ -2352,9 +2351,9 @@ var init_list = __esm(() => {
|
|
|
2352
2351
|
project = sanitizeProjectName(project);
|
|
2353
2352
|
}
|
|
2354
2353
|
if (!project) {
|
|
2355
|
-
ui.write(`${
|
|
2354
|
+
ui.write(`${import_picocolors7.default.yellow("\u26A0")} ${import_picocolors7.default.yellow("No project mapping found.")}
|
|
2356
2355
|
|
|
2357
|
-
` + `Run ${
|
|
2356
|
+
` + `Run ${import_picocolors7.default.dim(import_picocolors7.default.gray("dora init"))} (or ${import_picocolors7.default.dim(import_picocolors7.default.gray("doraval journal init"))}) first, or pass ${import_picocolors7.default.dim(import_picocolors7.default.gray("--project <name>"))}.`);
|
|
2358
2357
|
process.exit(1);
|
|
2359
2358
|
}
|
|
2360
2359
|
const journalRepo = config?.journal.repo ?? "(unknown)";
|
|
@@ -2389,7 +2388,7 @@ var init_list = __esm(() => {
|
|
|
2389
2388
|
return;
|
|
2390
2389
|
}
|
|
2391
2390
|
ui.write(`
|
|
2392
|
-
${
|
|
2391
|
+
${import_picocolors7.default.bold(import_picocolors7.default.white("dora journal list"))} \u2014 ${import_picocolors7.default.white(project)} ${import_picocolors7.default.dim(import_picocolors7.default.gray(`(from ${journalRepo})`))}
|
|
2393
2392
|
`);
|
|
2394
2393
|
const hasStaged = staged.length > 0;
|
|
2395
2394
|
const hasCommitted = allEntries.length > 0;
|
|
@@ -2403,46 +2402,46 @@ var init_list = __esm(() => {
|
|
|
2403
2402
|
}
|
|
2404
2403
|
if (dups.length > 0) {
|
|
2405
2404
|
const uniqueDups = [...new Set(dups)];
|
|
2406
|
-
ui.write(` ${
|
|
2405
|
+
ui.write(` ${import_picocolors7.default.yellow("\u26A0")} ${import_picocolors7.default.yellow("Duplicate titles in this view (clean in your journal repo + update):")} ${uniqueDups.map((t) => import_picocolors7.default.yellow(`"${t}"`)).join(", ")}
|
|
2407
2406
|
`);
|
|
2408
2407
|
}
|
|
2409
2408
|
if (!hasStaged && !hasCommitted) {
|
|
2410
|
-
ui.write(` ${
|
|
2409
|
+
ui.write(` ${import_picocolors7.default.dim(import_picocolors7.default.gray("No active entries found for"))} ${import_picocolors7.default.bold(import_picocolors7.default.white(project))}.
|
|
2411
2410
|
`);
|
|
2412
|
-
ui.write(` Journal repo: ${
|
|
2413
|
-
ui.write(` Local file: ${
|
|
2411
|
+
ui.write(` Journal repo: ${import_picocolors7.default.dim(import_picocolors7.default.gray(journalRepo))}`);
|
|
2412
|
+
ui.write(` Local file: ${import_picocolors7.default.dim(import_picocolors7.default.gray(projectFile))}
|
|
2414
2413
|
`);
|
|
2415
|
-
ui.write(` ${
|
|
2416
|
-
` + ` Use ${
|
|
2417
|
-
` + ` They will be staged locally until you run ${
|
|
2414
|
+
ui.write(` ${import_picocolors7.default.dim(import_picocolors7.default.gray("This is normal for a freshly initialized project."))}
|
|
2415
|
+
` + ` Use ${import_picocolors7.default.dim(import_picocolors7.default.gray("dora journal add"))} to propose decisions.
|
|
2416
|
+
` + ` They will be staged locally until you run ${import_picocolors7.default.dim(import_picocolors7.default.gray("dora journal sync"))}.
|
|
2418
2417
|
`);
|
|
2419
|
-
ui.write(` If you expect content, try: ${
|
|
2418
|
+
ui.write(` If you expect content, try: ${import_picocolors7.default.dim(import_picocolors7.default.gray(`dora journal update`))}
|
|
2420
2419
|
`);
|
|
2421
2420
|
return;
|
|
2422
2421
|
}
|
|
2423
2422
|
function printEntry(entry) {
|
|
2424
2423
|
const pb = entry.pushback ?? 0;
|
|
2425
|
-
let pbColor =
|
|
2424
|
+
let pbColor = import_picocolors7.default.green;
|
|
2426
2425
|
if (pb >= 7)
|
|
2427
|
-
pbColor =
|
|
2426
|
+
pbColor = import_picocolors7.default.red;
|
|
2428
2427
|
else if (pb >= 4)
|
|
2429
|
-
pbColor =
|
|
2430
|
-
const tagsStr = (entry.tags || []).join(", ") ||
|
|
2431
|
-
const statusNote = entry.status !== "active" ?
|
|
2432
|
-
const stagedNote = entry._staged ?
|
|
2433
|
-
ui.write(` ${pbColor(String(pb).padStart(2))} ${
|
|
2434
|
-
ui.write(` ${
|
|
2435
|
-
const by = entry.author?.startsWith("agent:") ?
|
|
2436
|
-
ui.write(` ${
|
|
2428
|
+
pbColor = import_picocolors7.default.yellow;
|
|
2429
|
+
const tagsStr = (entry.tags || []).join(", ") || import_picocolors7.default.dim("(none)");
|
|
2430
|
+
const statusNote = entry.status !== "active" ? import_picocolors7.default.dim(` [${entry.status}]`) : "";
|
|
2431
|
+
const stagedNote = entry._staged ? import_picocolors7.default.dim(" (staged)") : "";
|
|
2432
|
+
ui.write(` ${pbColor(String(pb).padStart(2))} ${import_picocolors7.default.bold(import_picocolors7.default.white(entry.title))}${statusNote}${stagedNote}`);
|
|
2433
|
+
ui.write(` ${import_picocolors7.default.dim(import_picocolors7.default.gray("tags:"))} ${import_picocolors7.default.gray(tagsStr)}`);
|
|
2434
|
+
const by = entry.author?.startsWith("agent:") ? import_picocolors7.default.cyan(entry.author) : entry.author || "human";
|
|
2435
|
+
ui.write(` ${import_picocolors7.default.dim(import_picocolors7.default.gray("by:"))} ${import_picocolors7.default.gray(by)} ${import_picocolors7.default.dim(import_picocolors7.default.gray("on"))} ${import_picocolors7.default.gray(entry.date)}`);
|
|
2437
2436
|
const rat = (entry.rationale || "").replace(/\s+/g, " ").trim();
|
|
2438
2437
|
if (rat) {
|
|
2439
|
-
const preview = rat.length > 88 ? rat.slice(0, 85) +
|
|
2440
|
-
ui.write(` ${
|
|
2438
|
+
const preview = rat.length > 88 ? rat.slice(0, 85) + import_picocolors7.default.dim(import_picocolors7.default.gray("\u2026")) : rat;
|
|
2439
|
+
ui.write(` ${import_picocolors7.default.dim(import_picocolors7.default.gray(preview))}`);
|
|
2441
2440
|
}
|
|
2442
2441
|
ui.write("");
|
|
2443
2442
|
}
|
|
2444
2443
|
if (hasStaged) {
|
|
2445
|
-
ui.write(` ${
|
|
2444
|
+
ui.write(` ${import_picocolors7.default.yellow("\u25CF")} ${import_picocolors7.default.bold(import_picocolors7.default.white("Staged / pending"))} (not yet in remote; run ${import_picocolors7.default.dim(import_picocolors7.default.gray("dora journal sync"))} to publish):
|
|
2446
2445
|
`);
|
|
2447
2446
|
for (const entry of staged) {
|
|
2448
2447
|
printEntry(entry);
|
|
@@ -2452,7 +2451,7 @@ var init_list = __esm(() => {
|
|
|
2452
2451
|
}
|
|
2453
2452
|
if (hasCommitted) {
|
|
2454
2453
|
if (hasStaged) {
|
|
2455
|
-
ui.write(` ${
|
|
2454
|
+
ui.write(` ${import_picocolors7.default.dim(import_picocolors7.default.gray("Committed (from local cache):"))}
|
|
2456
2455
|
`);
|
|
2457
2456
|
}
|
|
2458
2457
|
for (const entry of allEntries) {
|
|
@@ -2460,7 +2459,7 @@ var init_list = __esm(() => {
|
|
|
2460
2459
|
}
|
|
2461
2460
|
}
|
|
2462
2461
|
const totalShown = staged.length + allEntries.length;
|
|
2463
|
-
ui.write(` ${
|
|
2462
|
+
ui.write(` ${import_picocolors7.default.dim(import_picocolors7.default.gray(`${totalShown} entries shown from ${journalRepo}.`))}
|
|
2464
2463
|
`);
|
|
2465
2464
|
process.exit(0);
|
|
2466
2465
|
}
|
|
@@ -2596,20 +2595,20 @@ async function appendOrUpdateJournalBlock(target, contextText, project, useRefer
|
|
|
2596
2595
|
await Bun.write(absTarget, updated);
|
|
2597
2596
|
const action = existsSync7(absTarget) && startIdx !== -1 ? "Updated" : "Added";
|
|
2598
2597
|
ui.write(`
|
|
2599
|
-
${
|
|
2598
|
+
${import_picocolors8.default.green("\u2713")} ${action} journal decisions section in ${import_picocolors8.default.white(target)}`);
|
|
2600
2599
|
if (useReference) {
|
|
2601
|
-
ui.write(` ${
|
|
2600
|
+
ui.write(` ${import_picocolors8.default.dim("Using @import references (full files will be loaded by Claude).")}`);
|
|
2602
2601
|
} else {
|
|
2603
|
-
ui.write(` ${
|
|
2602
|
+
ui.write(` ${import_picocolors8.default.dim("Embedded compact decisions (low noise).")}`);
|
|
2604
2603
|
}
|
|
2605
2604
|
}
|
|
2606
|
-
var
|
|
2605
|
+
var import_picocolors8, JOURNAL_BLOCK_START = "<!-- doraval-journal:start -->", JOURNAL_BLOCK_END = "<!-- doraval-journal:end -->", context_default;
|
|
2607
2606
|
var init_context = __esm(() => {
|
|
2608
2607
|
init_dist();
|
|
2609
2608
|
init_out();
|
|
2610
2609
|
init_journal_config();
|
|
2611
2610
|
init_journal_parse();
|
|
2612
|
-
|
|
2611
|
+
import_picocolors8 = __toESM(require_picocolors(), 1);
|
|
2613
2612
|
context_default = defineCommand({
|
|
2614
2613
|
meta: {
|
|
2615
2614
|
name: "context",
|
|
@@ -2666,9 +2665,9 @@ var init_context = __esm(() => {
|
|
|
2666
2665
|
}
|
|
2667
2666
|
]
|
|
2668
2667
|
}, null, 2));
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2668
|
+
ui.write("\nTip: Use `dora journal hook enable` to install the hook automatically.");
|
|
2669
|
+
ui.write(" Use `dora journal hook disable` to remove it.");
|
|
2670
|
+
ui.write(" (sh -c wrapper ensures shell features like redir work reliably.)");
|
|
2672
2671
|
process.exit(0);
|
|
2673
2672
|
}
|
|
2674
2673
|
const config = await readConfig();
|
|
@@ -2937,13 +2936,13 @@ __export(exports_update, {
|
|
|
2937
2936
|
});
|
|
2938
2937
|
import { existsSync as existsSync9 } from "fs";
|
|
2939
2938
|
import { join as join8 } from "path";
|
|
2940
|
-
var
|
|
2939
|
+
var import_picocolors9, update_default;
|
|
2941
2940
|
var init_update = __esm(() => {
|
|
2942
2941
|
init_dist();
|
|
2943
2942
|
init_out();
|
|
2944
2943
|
init_journal_config();
|
|
2945
2944
|
init_journal_remote();
|
|
2946
|
-
|
|
2945
|
+
import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
2947
2946
|
update_default = defineCommand({
|
|
2948
2947
|
meta: {
|
|
2949
2948
|
name: "update",
|
|
@@ -2964,30 +2963,30 @@ var init_update = __esm(() => {
|
|
|
2964
2963
|
async run({ args }) {
|
|
2965
2964
|
const ghCheck = ensureGhCli();
|
|
2966
2965
|
if (!ghCheck.ok) {
|
|
2967
|
-
ui.write(` ${
|
|
2966
|
+
ui.write(` ${import_picocolors9.default.red("\u2717")} ${import_picocolors9.default.white("The GitHub CLI (")}${import_picocolors9.default.bold("gh")}${import_picocolors9.default.white(") is not installed.")}
|
|
2968
2967
|
`);
|
|
2969
|
-
ui.write(` doraval uses ${
|
|
2968
|
+
ui.write(` doraval uses ${import_picocolors9.default.bold("gh")} to fetch and sync journal files with GitHub.
|
|
2970
2969
|
`);
|
|
2971
2970
|
ui.write(` Install it:
|
|
2972
2971
|
`);
|
|
2973
|
-
ui.write(` macOS: ${
|
|
2974
|
-
ui.write(` Linux: ${
|
|
2975
|
-
ui.write(` Windows: ${
|
|
2972
|
+
ui.write(` macOS: ${import_picocolors9.default.dim("brew install gh")}`);
|
|
2973
|
+
ui.write(` Linux: ${import_picocolors9.default.dim("https://github.com/cli/cli/blob/trunk/docs/install_linux.md")}`);
|
|
2974
|
+
ui.write(` Windows: ${import_picocolors9.default.dim("winget install --id GitHub.cli")}
|
|
2976
2975
|
`);
|
|
2977
|
-
ui.write(` Then authenticate: ${
|
|
2976
|
+
ui.write(` Then authenticate: ${import_picocolors9.default.dim("gh auth login")}
|
|
2978
2977
|
`);
|
|
2979
2978
|
process.exit(1);
|
|
2980
2979
|
}
|
|
2981
2980
|
const config = await readConfig();
|
|
2982
2981
|
if (!config?.journal.repo) {
|
|
2983
|
-
ui.write(`${
|
|
2982
|
+
ui.write(`${import_picocolors9.default.red("\u2717")} No journal repo configured. Run ${import_picocolors9.default.dim("dora init")} (or ${import_picocolors9.default.dim("doraval journal init")}) first.`);
|
|
2984
2983
|
process.exit(1);
|
|
2985
2984
|
}
|
|
2986
2985
|
const journalRepo = config.journal.repo;
|
|
2987
2986
|
ensureDoravalDirs();
|
|
2988
2987
|
const journalsDir = getJournalsDir();
|
|
2989
2988
|
ui.write(`
|
|
2990
|
-
${
|
|
2989
|
+
${import_picocolors9.default.bold(import_picocolors9.default.white("dora journal update"))} \u2014 ${import_picocolors9.default.dim(import_picocolors9.default.gray(journalRepo))}
|
|
2991
2990
|
`);
|
|
2992
2991
|
const projectsToUpdate = [];
|
|
2993
2992
|
if (args.all) {
|
|
@@ -3005,7 +3004,7 @@ var init_update = __esm(() => {
|
|
|
3005
3004
|
try {
|
|
3006
3005
|
projectsToUpdate.push(sanitizeProjectName(project));
|
|
3007
3006
|
} catch {
|
|
3008
|
-
ui.write(`${
|
|
3007
|
+
ui.write(`${import_picocolors9.default.red("\u2717")} Invalid project name: ${project}`);
|
|
3009
3008
|
process.exit(1);
|
|
3010
3009
|
}
|
|
3011
3010
|
}
|
|
@@ -3017,7 +3016,7 @@ var init_update = __esm(() => {
|
|
|
3017
3016
|
if (refreshGlobalRes.isNotFound) {
|
|
3018
3017
|
gotGlobal = false;
|
|
3019
3018
|
} else {
|
|
3020
|
-
ui.write(`${
|
|
3019
|
+
ui.write(`${import_picocolors9.default.red("\u2717")} Failed to fetch global.md from ${journalRepo}:`);
|
|
3021
3020
|
ui.write(refreshGlobalRes.error);
|
|
3022
3021
|
process.exit(1);
|
|
3023
3022
|
}
|
|
@@ -3025,19 +3024,19 @@ var init_update = __esm(() => {
|
|
|
3025
3024
|
gotGlobal = refreshGlobalRes.value;
|
|
3026
3025
|
}
|
|
3027
3026
|
if (gotGlobal) {
|
|
3028
|
-
ui.write(` ${
|
|
3027
|
+
ui.write(` ${import_picocolors9.default.green("\u2713")} global.md`);
|
|
3029
3028
|
} else {
|
|
3030
|
-
ui.write(` ${
|
|
3029
|
+
ui.write(` ${import_picocolors9.default.dim("\xB7")} global.md ${import_picocolors9.default.dim("(not present on remote)")}`);
|
|
3031
3030
|
}
|
|
3032
3031
|
if (projectsToUpdate.length === 0) {
|
|
3033
3032
|
if (args.all) {
|
|
3034
3033
|
ui.write(`
|
|
3035
|
-
${
|
|
3034
|
+
${import_picocolors9.default.dim(import_picocolors9.default.gray("No projects registered."))}
|
|
3036
3035
|
`);
|
|
3037
3036
|
} else {
|
|
3038
3037
|
ui.write(`
|
|
3039
|
-
${
|
|
3040
|
-
` + ` Run ${
|
|
3038
|
+
${import_picocolors9.default.yellow("\u26A0")} No project mapping found.
|
|
3039
|
+
` + ` Run ${import_picocolors9.default.dim("dora init")} or pass ${import_picocolors9.default.dim("--project <name>")} / ${import_picocolors9.default.dim("--all")}.
|
|
3041
3040
|
`);
|
|
3042
3041
|
}
|
|
3043
3042
|
return;
|
|
@@ -3051,7 +3050,7 @@ var init_update = __esm(() => {
|
|
|
3051
3050
|
if (refreshRes.isNotFound) {
|
|
3052
3051
|
got = false;
|
|
3053
3052
|
} else {
|
|
3054
|
-
ui.write(`${
|
|
3053
|
+
ui.write(`${import_picocolors9.default.red("\u2717")} Failed to fetch ${remotePath} from ${journalRepo}:`);
|
|
3055
3054
|
ui.write(refreshRes.error);
|
|
3056
3055
|
process.exit(1);
|
|
3057
3056
|
}
|
|
@@ -3059,9 +3058,9 @@ var init_update = __esm(() => {
|
|
|
3059
3058
|
got = refreshRes.value;
|
|
3060
3059
|
}
|
|
3061
3060
|
if (got) {
|
|
3062
|
-
ui.write(` ${
|
|
3061
|
+
ui.write(` ${import_picocolors9.default.green("\u2713")} ${remotePath}`);
|
|
3063
3062
|
} else {
|
|
3064
|
-
ui.write(` ${
|
|
3063
|
+
ui.write(` ${import_picocolors9.default.dim("\xB7")} ${remotePath} ${import_picocolors9.default.dim("(not present on remote \u2014 will be created on first sync)")}`);
|
|
3065
3064
|
if (!existsSync9(localPath)) {
|
|
3066
3065
|
await Bun.write(localPath, `# ${project} Journal
|
|
3067
3066
|
|
|
@@ -3072,7 +3071,7 @@ Project-specific decisions.
|
|
|
3072
3071
|
}
|
|
3073
3072
|
const summary = args.all && projectsToUpdate.length > 1 ? `${projectsToUpdate.length} projects + global` : projectsToUpdate.length === 1 ? projectsToUpdate[0] : "journals";
|
|
3074
3073
|
ui.write(`
|
|
3075
|
-
${
|
|
3074
|
+
${import_picocolors9.default.dim(import_picocolors9.default.gray("Local cache refreshed for"))} ${import_picocolors9.default.bold(import_picocolors9.default.white(summary))}.
|
|
3076
3075
|
`);
|
|
3077
3076
|
}
|
|
3078
3077
|
});
|
|
@@ -3143,14 +3142,14 @@ import { join as join9 } from "path";
|
|
|
3143
3142
|
function slugify(title) {
|
|
3144
3143
|
return title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || "untitled";
|
|
3145
3144
|
}
|
|
3146
|
-
var
|
|
3145
|
+
var import_picocolors10, add_default;
|
|
3147
3146
|
var init_add = __esm(() => {
|
|
3148
3147
|
init_dist();
|
|
3149
3148
|
init_out();
|
|
3150
3149
|
init_journal_config();
|
|
3151
3150
|
init_journal_validate();
|
|
3152
3151
|
init_agent_invoke();
|
|
3153
|
-
|
|
3152
|
+
import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
3154
3153
|
add_default = defineCommand({
|
|
3155
3154
|
meta: {
|
|
3156
3155
|
name: "add",
|
|
@@ -3225,9 +3224,9 @@ var init_add = __esm(() => {
|
|
|
3225
3224
|
project = sanitizeProjectName(project);
|
|
3226
3225
|
}
|
|
3227
3226
|
if (!project) {
|
|
3228
|
-
ui.write(`${
|
|
3227
|
+
ui.write(`${import_picocolors10.default.yellow("\u26A0")} No project mapping found.
|
|
3229
3228
|
|
|
3230
|
-
` + `Run ${
|
|
3229
|
+
` + `Run ${import_picocolors10.default.dim("dora init")} (or ${import_picocolors10.default.dim("doraval journal init")}) first, or pass ${import_picocolors10.default.dim("--project <name>")}.`);
|
|
3231
3230
|
process.exit(1);
|
|
3232
3231
|
}
|
|
3233
3232
|
let title;
|
|
@@ -3265,7 +3264,7 @@ var init_add = __esm(() => {
|
|
|
3265
3264
|
if (parsed.date)
|
|
3266
3265
|
date = String(parsed.date);
|
|
3267
3266
|
} catch (e) {
|
|
3268
|
-
ui.write(`${
|
|
3267
|
+
ui.write(`${import_picocolors10.default.red("\u2717")} Failed to parse --json input: ${e.message}`);
|
|
3269
3268
|
process.exit(1);
|
|
3270
3269
|
}
|
|
3271
3270
|
}
|
|
@@ -3289,7 +3288,7 @@ var init_add = __esm(() => {
|
|
|
3289
3288
|
title = (headingMatch[1] ?? "").trim();
|
|
3290
3289
|
rawBody = rawBody.replace(/^#+\s+(.+?)(?:\r?\n|$)/m, "").trimStart();
|
|
3291
3290
|
} else {
|
|
3292
|
-
ui.write(`${
|
|
3291
|
+
ui.write(`${import_picocolors10.default.red("\u2717")} --raw-markdown provided without a TITLE and without a leading '# Heading' in the markdown.`);
|
|
3293
3292
|
process.exit(1);
|
|
3294
3293
|
}
|
|
3295
3294
|
}
|
|
@@ -3329,7 +3328,7 @@ var init_add = __esm(() => {
|
|
|
3329
3328
|
agentCfg = fullConfigForAgent?.agent;
|
|
3330
3329
|
if (agentCfg) {
|
|
3331
3330
|
attemptedAgent = true;
|
|
3332
|
-
ui.write(` ${
|
|
3331
|
+
ui.write(` ${import_picocolors10.default.dim(import_picocolors10.default.gray("(querying your configured coding agent...)"))}`);
|
|
3333
3332
|
const scaffold = `Raw user capture (a decision, observation, or useful note that just happened): "${title}"
|
|
3334
3333
|
|
|
3335
3334
|
Turn this into a clean journal entry. Infer the core decision or note even if the input is phrased as a todo or reminder. Be professional and concise.
|
|
@@ -3378,18 +3377,18 @@ If you cannot produce exactly this, output the JSON with the best you can and se
|
|
|
3378
3377
|
};
|
|
3379
3378
|
const validation = validateEntry(entry);
|
|
3380
3379
|
if (!validation.valid) {
|
|
3381
|
-
ui.write(`${
|
|
3380
|
+
ui.write(`${import_picocolors10.default.red("\u2717")} Invalid entry:
|
|
3382
3381
|
`);
|
|
3383
3382
|
for (const err of validation.errors) {
|
|
3384
|
-
ui.write(` ${
|
|
3383
|
+
ui.write(` ${import_picocolors10.default.red("\u2022")} ${err}`);
|
|
3385
3384
|
}
|
|
3386
3385
|
process.exit(1);
|
|
3387
3386
|
}
|
|
3388
3387
|
for (const warn of validation.warnings) {
|
|
3389
3388
|
if ((warn.includes("not supplied") || warn.includes("empty")) && attemptedAgent) {} else if (warn.includes("not supplied") || warn.includes("empty")) {
|
|
3390
|
-
ui.write(`${
|
|
3389
|
+
ui.write(`${import_picocolors10.default.dim("\xB7")} ${warn}`);
|
|
3391
3390
|
} else {
|
|
3392
|
-
ui.write(`${
|
|
3391
|
+
ui.write(`${import_picocolors10.default.yellow("\u26A0")} ${warn}`);
|
|
3393
3392
|
}
|
|
3394
3393
|
}
|
|
3395
3394
|
if (!rationale) {
|
|
@@ -3417,23 +3416,23 @@ ${rationale}
|
|
|
3417
3416
|
const filePath = join9(pendingDir, filename);
|
|
3418
3417
|
await Bun.write(filePath, content);
|
|
3419
3418
|
ui.write(`
|
|
3420
|
-
${
|
|
3421
|
-
ui.write(` Project: ${
|
|
3419
|
+
${import_picocolors10.default.green("\u2713")} ${import_picocolors10.default.bold(import_picocolors10.default.white(title))}`);
|
|
3420
|
+
ui.write(` Project: ${import_picocolors10.default.white(project)} \xB7 run ${import_picocolors10.default.dim(import_picocolors10.default.gray("dora journal sync"))} to publish
|
|
3422
3421
|
`);
|
|
3423
3422
|
if (args.verbose) {
|
|
3424
|
-
const authorDisplay = author.startsWith("agent:") ?
|
|
3425
|
-
ui.write(` Pushback: ${
|
|
3426
|
-
ui.write(` Tags: ${
|
|
3423
|
+
const authorDisplay = author.startsWith("agent:") ? import_picocolors10.default.cyan(author) : author;
|
|
3424
|
+
ui.write(` Pushback: ${import_picocolors10.default.white(String(pushback))}`);
|
|
3425
|
+
ui.write(` Tags: ${import_picocolors10.default.gray(tags.join(", ") || import_picocolors10.default.dim("(none)"))}`);
|
|
3427
3426
|
ui.write(` Author: ${authorDisplay}`);
|
|
3428
|
-
ui.write(` File: ${
|
|
3427
|
+
ui.write(` File: ${import_picocolors10.default.dim(import_picocolors10.default.gray(filePath))}
|
|
3429
3428
|
`);
|
|
3430
3429
|
}
|
|
3431
3430
|
if (isThinInput && !author.startsWith("agent:")) {
|
|
3432
3431
|
if (attemptedAgent) {
|
|
3433
|
-
ui.write(` ${
|
|
3432
|
+
ui.write(` ${import_picocolors10.default.dim(import_picocolors10.default.gray("Note: agent was called but returned no usable enrichment. Edit the pending file or re-run dora init."))}
|
|
3434
3433
|
`);
|
|
3435
3434
|
} else {
|
|
3436
|
-
ui.write(` ${
|
|
3435
|
+
ui.write(` ${import_picocolors10.default.dim(import_picocolors10.default.gray("Tip: run dora init to configure an agent for auto-enrichment."))}
|
|
3437
3436
|
`);
|
|
3438
3437
|
}
|
|
3439
3438
|
}
|
|
@@ -3477,18 +3476,18 @@ function updateGitHubFile(repo, path, content, message, sha) {
|
|
|
3477
3476
|
stderr: "pipe"
|
|
3478
3477
|
});
|
|
3479
3478
|
if (result.exitCode !== 0) {
|
|
3480
|
-
ui.write(
|
|
3479
|
+
ui.write(import_picocolors11.default.red(`Failed to update ${path} on ${repo}:`));
|
|
3481
3480
|
ui.write(result.stderr.toString());
|
|
3482
3481
|
process.exit(1);
|
|
3483
3482
|
}
|
|
3484
3483
|
}
|
|
3485
|
-
var
|
|
3484
|
+
var import_picocolors11, sync_default;
|
|
3486
3485
|
var init_sync = __esm(() => {
|
|
3487
3486
|
init_dist();
|
|
3488
3487
|
init_out();
|
|
3489
3488
|
init_journal_config();
|
|
3490
3489
|
init_journal_remote();
|
|
3491
|
-
|
|
3490
|
+
import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
3492
3491
|
sync_default = defineCommand({
|
|
3493
3492
|
meta: {
|
|
3494
3493
|
name: "sync",
|
|
@@ -3522,70 +3521,70 @@ var init_sync = __esm(() => {
|
|
|
3522
3521
|
project = sanitizeProjectName(project);
|
|
3523
3522
|
}
|
|
3524
3523
|
if (!project) {
|
|
3525
|
-
ui.write(`${
|
|
3524
|
+
ui.write(`${import_picocolors11.default.yellow("\u26A0")} No project mapping found.
|
|
3526
3525
|
|
|
3527
|
-
` + `Run ${
|
|
3526
|
+
` + `Run ${import_picocolors11.default.dim("dora init")} (or ${import_picocolors11.default.dim("doraval journal init")}) first, or pass ${import_picocolors11.default.dim("--project <name>")}.`);
|
|
3528
3527
|
process.exit(1);
|
|
3529
3528
|
}
|
|
3530
3529
|
if (!config?.journal.repo) {
|
|
3531
|
-
ui.write(`${
|
|
3530
|
+
ui.write(`${import_picocolors11.default.red("\u2717")} No journal repo configured. Run ${import_picocolors11.default.dim("dora init")} (or ${import_picocolors11.default.dim("doraval journal init")}) first.`);
|
|
3532
3531
|
process.exit(1);
|
|
3533
3532
|
}
|
|
3534
3533
|
const ghCheck = ensureGhCli();
|
|
3535
3534
|
if (!ghCheck.ok) {
|
|
3536
|
-
ui.write(` ${
|
|
3535
|
+
ui.write(` ${import_picocolors11.default.red("\u2717")} ${import_picocolors11.default.white("The GitHub CLI (")}${import_picocolors11.default.bold("gh")}${import_picocolors11.default.white(") is not installed.")}
|
|
3537
3536
|
`);
|
|
3538
|
-
ui.write(` doraval uses ${
|
|
3537
|
+
ui.write(` doraval uses ${import_picocolors11.default.bold("gh")} to fetch and sync journal files with GitHub.
|
|
3539
3538
|
`);
|
|
3540
3539
|
ui.write(` Install it:
|
|
3541
3540
|
`);
|
|
3542
|
-
ui.write(` macOS: ${
|
|
3543
|
-
ui.write(` Linux: ${
|
|
3544
|
-
ui.write(` Windows: ${
|
|
3541
|
+
ui.write(` macOS: ${import_picocolors11.default.dim("brew install gh")}`);
|
|
3542
|
+
ui.write(` Linux: ${import_picocolors11.default.dim("https://github.com/cli/cli/blob/trunk/docs/install_linux.md")}`);
|
|
3543
|
+
ui.write(` Windows: ${import_picocolors11.default.dim("winget install --id GitHub.cli")}
|
|
3545
3544
|
`);
|
|
3546
|
-
ui.write(` Then authenticate: ${
|
|
3545
|
+
ui.write(` Then authenticate: ${import_picocolors11.default.dim("gh auth login")}
|
|
3547
3546
|
`);
|
|
3548
3547
|
process.exit(1);
|
|
3549
3548
|
}
|
|
3550
3549
|
const journalRepo = config.journal.repo;
|
|
3551
3550
|
const pendingDir = getPendingProjectDir(project);
|
|
3552
3551
|
ui.write(`
|
|
3553
|
-
${
|
|
3552
|
+
${import_picocolors11.default.bold(import_picocolors11.default.white("dora journal sync"))} \u2014 ${import_picocolors11.default.white(project)}
|
|
3554
3553
|
`);
|
|
3555
|
-
ui.write(` Journal repo: ${
|
|
3554
|
+
ui.write(` Journal repo: ${import_picocolors11.default.dim(import_picocolors11.default.gray(journalRepo))}`);
|
|
3556
3555
|
ensureDoravalDirs();
|
|
3557
3556
|
const journalsDir = getJournalsDir();
|
|
3558
3557
|
const remoteProjectPath = `projects/${project}.md`;
|
|
3559
3558
|
const localProjectPath = join10(journalsDir, `${project}.md`);
|
|
3560
|
-
ui.write(` ${
|
|
3559
|
+
ui.write(` ${import_picocolors11.default.dim(import_picocolors11.default.gray("Refreshing local cache from remote..."))}`);
|
|
3561
3560
|
const refreshGlobalRes = await refreshLocalJournalFile(journalRepo, "global.md", join10(journalsDir, "global.md"));
|
|
3562
3561
|
if (!refreshGlobalRes.ok) {
|
|
3563
3562
|
if (!refreshGlobalRes.isNotFound) {
|
|
3564
|
-
ui.write(
|
|
3563
|
+
ui.write(import_picocolors11.default.red(`Failed to fetch global.md from ${journalRepo}:`));
|
|
3565
3564
|
ui.write(refreshGlobalRes.error);
|
|
3566
3565
|
process.exit(1);
|
|
3567
3566
|
}
|
|
3568
3567
|
}
|
|
3569
3568
|
const gotGlobal = refreshGlobalRes.ok && refreshGlobalRes.value;
|
|
3570
3569
|
if (gotGlobal) {
|
|
3571
|
-
ui.write(` ${
|
|
3570
|
+
ui.write(` ${import_picocolors11.default.dim(import_picocolors11.default.gray("\u2713 global.md"))}`);
|
|
3572
3571
|
}
|
|
3573
3572
|
const refreshProjectCacheRes = await refreshLocalJournalFile(journalRepo, remoteProjectPath, localProjectPath);
|
|
3574
3573
|
if (!refreshProjectCacheRes.ok) {
|
|
3575
3574
|
if (!refreshProjectCacheRes.isNotFound) {
|
|
3576
|
-
ui.write(
|
|
3575
|
+
ui.write(import_picocolors11.default.red(`Failed to fetch ${remoteProjectPath} from ${journalRepo}:`));
|
|
3577
3576
|
ui.write(refreshProjectCacheRes.error);
|
|
3578
3577
|
process.exit(1);
|
|
3579
3578
|
}
|
|
3580
3579
|
}
|
|
3581
3580
|
const gotProjectCache = refreshProjectCacheRes.ok && refreshProjectCacheRes.value;
|
|
3582
3581
|
if (gotProjectCache) {
|
|
3583
|
-
ui.write(` ${
|
|
3582
|
+
ui.write(` ${import_picocolors11.default.dim(import_picocolors11.default.gray(`\u2713 ${remoteProjectPath}`))}`);
|
|
3584
3583
|
}
|
|
3585
3584
|
const pendingFiles = existsSync11(pendingDir) ? readdirSync4(pendingDir).filter((f) => f.endsWith(".md") && f !== ".gitkeep").sort() : [];
|
|
3586
3585
|
if (pendingFiles.length === 0) {
|
|
3587
3586
|
ui.write(`
|
|
3588
|
-
${
|
|
3587
|
+
${import_picocolors11.default.yellow("\u26A0")} No pending entries. Local cache is now up to date.
|
|
3589
3588
|
`);
|
|
3590
3589
|
process.exit(0);
|
|
3591
3590
|
}
|
|
@@ -3598,7 +3597,7 @@ var init_sync = __esm(() => {
|
|
|
3598
3597
|
let currentFile = null;
|
|
3599
3598
|
if (!metaRes.ok) {
|
|
3600
3599
|
if (!metaRes.isNotFound) {
|
|
3601
|
-
ui.write(
|
|
3600
|
+
ui.write(import_picocolors11.default.red(`Failed to fetch ${remotePath} from ${journalRepo}:`));
|
|
3602
3601
|
ui.write(metaRes.error);
|
|
3603
3602
|
process.exit(1);
|
|
3604
3603
|
}
|
|
@@ -3609,10 +3608,10 @@ var init_sync = __esm(() => {
|
|
|
3609
3608
|
existingContent = Buffer.from(currentFile.content, "base64").toString("utf8");
|
|
3610
3609
|
currentSha = currentFile.sha;
|
|
3611
3610
|
if (args.verbose)
|
|
3612
|
-
ui.write(` ${
|
|
3611
|
+
ui.write(` ${import_picocolors11.default.dim(import_picocolors11.default.gray("Found existing remote file (sha: " + (currentSha?.slice(0, 7) ?? "") + "...)"))}`);
|
|
3613
3612
|
} else {
|
|
3614
3613
|
if (args.verbose)
|
|
3615
|
-
ui.write(` ${
|
|
3614
|
+
ui.write(` ${import_picocolors11.default.dim(import_picocolors11.default.gray("No existing file on remote \u2014 will create it"))}`);
|
|
3616
3615
|
}
|
|
3617
3616
|
let newEntries = "";
|
|
3618
3617
|
for (const file of pendingFiles) {
|
|
@@ -3636,12 +3635,12 @@ var init_sync = __esm(() => {
|
|
|
3636
3635
|
const commitMessage = args.message || `journal: add ${pendingFiles.length} entr${pendingFiles.length === 1 ? "y" : "ies"} for ${project}`;
|
|
3637
3636
|
if (args.verbose)
|
|
3638
3637
|
ui.write(`
|
|
3639
|
-
${
|
|
3638
|
+
${import_picocolors11.default.dim(import_picocolors11.default.gray("Pushing to remote..."))}`);
|
|
3640
3639
|
try {
|
|
3641
3640
|
updateGitHubFile(journalRepo, remotePath, newContent, commitMessage, currentSha);
|
|
3642
|
-
ui.write(` ${
|
|
3641
|
+
ui.write(` ${import_picocolors11.default.green("\u2713")} ${import_picocolors11.default.white("Successfully pushed to")} ${import_picocolors11.default.white(remotePath)}`);
|
|
3643
3642
|
} catch (err) {
|
|
3644
|
-
ui.write(`${
|
|
3643
|
+
ui.write(`${import_picocolors11.default.red("\u2717")} ${import_picocolors11.default.white("Failed to push to GitHub.")}`);
|
|
3645
3644
|
process.exit(1);
|
|
3646
3645
|
}
|
|
3647
3646
|
for (const file of pendingFiles) {
|
|
@@ -3650,22 +3649,22 @@ var init_sync = __esm(() => {
|
|
|
3650
3649
|
await Bun.file(fullPath).unlink();
|
|
3651
3650
|
} catch {}
|
|
3652
3651
|
}
|
|
3653
|
-
ui.write(` ${
|
|
3652
|
+
ui.write(` ${import_picocolors11.default.green("\u2713")} ${import_picocolors11.default.white("Cleared local pending entries")}`);
|
|
3654
3653
|
try {
|
|
3655
3654
|
const refreshRes = await refreshLocalJournalFile(journalRepo, remotePath, localProjectPath);
|
|
3656
3655
|
if (!refreshRes.ok) {
|
|
3657
3656
|
if (!refreshRes.isNotFound) {
|
|
3658
|
-
ui.write(` ${
|
|
3657
|
+
ui.write(` ${import_picocolors11.default.yellow("\u26A0")} Could not re-fetch updated file (you can run sync again later)`);
|
|
3659
3658
|
}
|
|
3660
3659
|
} else if (refreshRes.value) {
|
|
3661
3660
|
if (args.verbose)
|
|
3662
|
-
ui.write(` ${
|
|
3661
|
+
ui.write(` ${import_picocolors11.default.green("\u2713")} ${import_picocolors11.default.white("Re-fetched")} ${import_picocolors11.default.white(project)}.md ${import_picocolors11.default.white("into local cache")}`);
|
|
3663
3662
|
}
|
|
3664
3663
|
} catch {
|
|
3665
|
-
ui.write(` ${
|
|
3664
|
+
ui.write(` ${import_picocolors11.default.yellow("\u26A0")} Could not re-fetch updated file (you can run sync again later)`);
|
|
3666
3665
|
}
|
|
3667
3666
|
ui.write(`
|
|
3668
|
-
${
|
|
3667
|
+
${import_picocolors11.default.green("Done!")} ${import_picocolors11.default.white(pendingFiles.length + " entr" + (pendingFiles.length === 1 ? "y" : "ies") + " published.")}
|
|
3669
3668
|
`);
|
|
3670
3669
|
process.exit(0);
|
|
3671
3670
|
}
|
|
@@ -3679,12 +3678,12 @@ __export(exports_eval_history, {
|
|
|
3679
3678
|
});
|
|
3680
3679
|
import { existsSync as existsSync12, readdirSync as readdirSync5 } from "fs";
|
|
3681
3680
|
import { join as join11 } from "path";
|
|
3682
|
-
var
|
|
3681
|
+
var import_picocolors12, eval_history_default;
|
|
3683
3682
|
var init_eval_history = __esm(() => {
|
|
3684
3683
|
init_dist();
|
|
3685
3684
|
init_out();
|
|
3686
3685
|
init_journal_config();
|
|
3687
|
-
|
|
3686
|
+
import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
3688
3687
|
eval_history_default = defineCommand({
|
|
3689
3688
|
meta: {
|
|
3690
3689
|
name: "history",
|
|
@@ -3744,7 +3743,7 @@ var init_eval_history = __esm(() => {
|
|
|
3744
3743
|
const date = r.timestamp.slice(0, 10);
|
|
3745
3744
|
const title = (r.sessionTitle ?? r.sessionId.slice(0, 8)).slice(0, 33).padEnd(35);
|
|
3746
3745
|
const skill = r.skill.slice(0, 33).padEnd(35);
|
|
3747
|
-
const verdictColor = r.verdict === "PASS" ?
|
|
3746
|
+
const verdictColor = r.verdict === "PASS" ? import_picocolors12.default.green : r.verdict === "FAIL" ? import_picocolors12.default.red : import_picocolors12.default.yellow;
|
|
3748
3747
|
ui.write(` ${date.padEnd(20)} ${title} ${skill} ${verdictColor(r.verdict)}`);
|
|
3749
3748
|
}
|
|
3750
3749
|
ui.blank();
|
|
@@ -4056,14 +4055,14 @@ description: Starter
|
|
|
4056
4055
|
${skillBody}`);
|
|
4057
4056
|
}
|
|
4058
4057
|
}
|
|
4059
|
-
var
|
|
4058
|
+
var import_picocolors13, new_default;
|
|
4060
4059
|
var init_new = __esm(() => {
|
|
4061
4060
|
init_dist();
|
|
4062
4061
|
init_out();
|
|
4063
4062
|
init_context2();
|
|
4064
4063
|
init_prompt();
|
|
4065
4064
|
init_spec();
|
|
4066
|
-
|
|
4065
|
+
import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
4067
4066
|
new_default = defineCommand({
|
|
4068
4067
|
meta: {
|
|
4069
4068
|
name: "new",
|
|
@@ -4102,7 +4101,7 @@ var init_new = __esm(() => {
|
|
|
4102
4101
|
}
|
|
4103
4102
|
scaffold(decision, ctx, migrateContent);
|
|
4104
4103
|
ui.write(`
|
|
4105
|
-
${
|
|
4104
|
+
${import_picocolors13.default.green("\u2713")} Created ${decision.path} at ${import_picocolors13.default.bold(decision.targetDir)}`);
|
|
4106
4105
|
const cmdName = decision.path === "plugin" ? `/${basename3(decision.targetDir)}:doraval` : "/my-skill";
|
|
4107
4106
|
ui.info(` Command: ${cmdName}`);
|
|
4108
4107
|
if (decision.path === "plugin") {
|
|
@@ -4129,7 +4128,7 @@ __export(exports_bump, {
|
|
|
4129
4128
|
default: () => bump_default
|
|
4130
4129
|
});
|
|
4131
4130
|
import { resolve as resolve4, join as join14, dirname as dirname3, relative } from "path";
|
|
4132
|
-
import { existsSync as existsSync15, readFileSync as
|
|
4131
|
+
import { existsSync as existsSync15, readFileSync as readFileSync3, writeFileSync as writeFileSync2, readdirSync as readdirSync7, statSync as statSync2 } from "fs";
|
|
4133
4132
|
function bumpVersion(current, type) {
|
|
4134
4133
|
if (/^\d+\.\d+\.\d+$/.test(type))
|
|
4135
4134
|
return type;
|
|
@@ -4149,7 +4148,7 @@ function bumpVersion(current, type) {
|
|
|
4149
4148
|
}
|
|
4150
4149
|
function readJson2(p) {
|
|
4151
4150
|
try {
|
|
4152
|
-
const content =
|
|
4151
|
+
const content = readFileSync3(p, "utf8");
|
|
4153
4152
|
return JSON.parse(content);
|
|
4154
4153
|
} catch {
|
|
4155
4154
|
return null;
|
|
@@ -4247,11 +4246,11 @@ function walkForTargets(dir, maxDepth = 6, currentDepth = 0) {
|
|
|
4247
4246
|
}
|
|
4248
4247
|
return results;
|
|
4249
4248
|
}
|
|
4250
|
-
var
|
|
4249
|
+
var import_picocolors14, bump_default;
|
|
4251
4250
|
var init_bump = __esm(() => {
|
|
4252
4251
|
init_dist();
|
|
4253
4252
|
init_out();
|
|
4254
|
-
|
|
4253
|
+
import_picocolors14 = __toESM(require_picocolors(), 1);
|
|
4255
4254
|
bump_default = defineCommand({
|
|
4256
4255
|
meta: {
|
|
4257
4256
|
name: "bump",
|
|
@@ -4360,9 +4359,9 @@ var init_bump = __esm(() => {
|
|
|
4360
4359
|
}
|
|
4361
4360
|
writeJson2(t.file, json);
|
|
4362
4361
|
if (didRootUpdate && current) {
|
|
4363
|
-
ui.success(`${t.label}: ${
|
|
4362
|
+
ui.success(`${t.label}: ${import_picocolors14.default.dim(current)} \u2192 ${import_picocolors14.default.green(next)}`);
|
|
4364
4363
|
} else if (didRootUpdate) {
|
|
4365
|
-
ui.success(`${t.label}: ${
|
|
4364
|
+
ui.success(`${t.label}: ${import_picocolors14.default.green(next)}`);
|
|
4366
4365
|
} else {
|
|
4367
4366
|
ui.success(`${t.label} (no root version)`);
|
|
4368
4367
|
}
|
|
@@ -4566,14 +4565,14 @@ description: Starter (local skill)
|
|
|
4566
4565
|
${skillBody}`);
|
|
4567
4566
|
}
|
|
4568
4567
|
}
|
|
4569
|
-
var
|
|
4568
|
+
var import_picocolors15, new_default2;
|
|
4570
4569
|
var init_new2 = __esm(() => {
|
|
4571
4570
|
init_dist();
|
|
4572
4571
|
init_out();
|
|
4573
4572
|
init_context3();
|
|
4574
4573
|
init_prompt();
|
|
4575
4574
|
init_spec();
|
|
4576
|
-
|
|
4575
|
+
import_picocolors15 = __toESM(require_picocolors(), 1);
|
|
4577
4576
|
new_default2 = defineCommand({
|
|
4578
4577
|
meta: {
|
|
4579
4578
|
name: "new",
|
|
@@ -4612,7 +4611,7 @@ var init_new2 = __esm(() => {
|
|
|
4612
4611
|
}
|
|
4613
4612
|
scaffold2(decision, ctx, migrateContent);
|
|
4614
4613
|
ui.write(`
|
|
4615
|
-
${
|
|
4614
|
+
${import_picocolors15.default.green("\u2713")} Created ${decision.path} at ${import_picocolors15.default.bold(decision.targetDir)}`);
|
|
4616
4615
|
const cmdName = decision.path === "plugin" ? `/${basename4(decision.targetDir)}:doraval` : "/doraval (local skill)";
|
|
4617
4616
|
ui.info(` Command: ${cmdName}`);
|
|
4618
4617
|
if (decision.path === "plugin") {
|
|
@@ -4794,14 +4793,14 @@ description: Starter (local skill)
|
|
|
4794
4793
|
${skillBody}`);
|
|
4795
4794
|
}
|
|
4796
4795
|
}
|
|
4797
|
-
var
|
|
4796
|
+
var import_picocolors16, new_default3;
|
|
4798
4797
|
var init_new3 = __esm(() => {
|
|
4799
4798
|
init_dist();
|
|
4800
4799
|
init_out();
|
|
4801
4800
|
init_context4();
|
|
4802
4801
|
init_prompt();
|
|
4803
4802
|
init_spec();
|
|
4804
|
-
|
|
4803
|
+
import_picocolors16 = __toESM(require_picocolors(), 1);
|
|
4805
4804
|
new_default3 = defineCommand({
|
|
4806
4805
|
meta: {
|
|
4807
4806
|
name: "new",
|
|
@@ -4840,7 +4839,7 @@ var init_new3 = __esm(() => {
|
|
|
4840
4839
|
}
|
|
4841
4840
|
scaffold3(decision, ctx, migrateContent);
|
|
4842
4841
|
ui.write(`
|
|
4843
|
-
${
|
|
4842
|
+
${import_picocolors16.default.green("\u2713")} Created ${decision.path} at ${import_picocolors16.default.bold(decision.targetDir)}`);
|
|
4844
4843
|
const cmdName = decision.path === "plugin" ? `/${basename5(decision.targetDir)}:doraval` : "/doraval (local skill)";
|
|
4845
4844
|
ui.info(` Command: ${cmdName}`);
|
|
4846
4845
|
if (decision.path === "plugin") {
|
|
@@ -5023,14 +5022,14 @@ description: Starter (local skill)
|
|
|
5023
5022
|
${skillBody}`);
|
|
5024
5023
|
}
|
|
5025
5024
|
}
|
|
5026
|
-
var
|
|
5025
|
+
var import_picocolors17, new_default4;
|
|
5027
5026
|
var init_new4 = __esm(() => {
|
|
5028
5027
|
init_dist();
|
|
5029
5028
|
init_out();
|
|
5030
5029
|
init_context5();
|
|
5031
5030
|
init_prompt();
|
|
5032
5031
|
init_spec();
|
|
5033
|
-
|
|
5032
|
+
import_picocolors17 = __toESM(require_picocolors(), 1);
|
|
5034
5033
|
new_default4 = defineCommand({
|
|
5035
5034
|
meta: {
|
|
5036
5035
|
name: "new",
|
|
@@ -5069,7 +5068,7 @@ var init_new4 = __esm(() => {
|
|
|
5069
5068
|
}
|
|
5070
5069
|
scaffold4(decision, ctx, migrateContent);
|
|
5071
5070
|
ui.write(`
|
|
5072
|
-
${
|
|
5071
|
+
${import_picocolors17.default.green("\u2713")} Created ${decision.path} at ${import_picocolors17.default.bold(decision.targetDir)}`);
|
|
5073
5072
|
const cmdName = decision.path === "plugin" ? `/${basename6(decision.targetDir)}:doraval` : "/doraval (local skill)";
|
|
5074
5073
|
ui.info(` Command: ${cmdName}`);
|
|
5075
5074
|
if (decision.path === "plugin") {
|
|
@@ -5094,7 +5093,7 @@ var exports_ui = {};
|
|
|
5094
5093
|
__export(exports_ui, {
|
|
5095
5094
|
default: () => ui_default
|
|
5096
5095
|
});
|
|
5097
|
-
import { existsSync as existsSync22, readdirSync as readdirSync11, writeFileSync as writeFileSync6, unlinkSync as unlinkSync2, readFileSync as
|
|
5096
|
+
import { existsSync as existsSync22, readdirSync as readdirSync11, writeFileSync as writeFileSync6, unlinkSync as unlinkSync2, readFileSync as readFileSync4 } from "fs";
|
|
5098
5097
|
import { join as join21 } from "path";
|
|
5099
5098
|
import { spawn } from "child_process";
|
|
5100
5099
|
function slugify2(title) {
|
|
@@ -5195,9 +5194,9 @@ async function killPort(port) {
|
|
|
5195
5194
|
return;
|
|
5196
5195
|
const pids = output.split(`
|
|
5197
5196
|
`).map((p) => p.trim()).filter(Boolean);
|
|
5198
|
-
|
|
5197
|
+
ui.write(` Killing previous doraval ui on port ${port}...`);
|
|
5199
5198
|
for (const pid of pids) {
|
|
5200
|
-
|
|
5199
|
+
ui.write(` \u2192 kill -9 ${pid}`);
|
|
5201
5200
|
Bun.spawn(["kill", "-9", pid], { stdout: "ignore", stderr: "ignore" });
|
|
5202
5201
|
}
|
|
5203
5202
|
await new Promise((r) => setTimeout(r, 400));
|
|
@@ -5208,7 +5207,7 @@ function readPid(p) {
|
|
|
5208
5207
|
if (!existsSync22(file))
|
|
5209
5208
|
return null;
|
|
5210
5209
|
try {
|
|
5211
|
-
const raw =
|
|
5210
|
+
const raw = readFileSync4(file, "utf8").trim();
|
|
5212
5211
|
const pid = parseInt(raw, 10);
|
|
5213
5212
|
if (isNaN(pid))
|
|
5214
5213
|
return null;
|
|
@@ -5237,17 +5236,18 @@ async function getDashboardHtml() {
|
|
|
5237
5236
|
try {
|
|
5238
5237
|
return await Bun.file(htmlPath).text();
|
|
5239
5238
|
} catch (err) {
|
|
5240
|
-
|
|
5239
|
+
ui.write(`[doraval ui] Failed to load HTML from ${htmlPath}`);
|
|
5241
5240
|
return `<!doctype html><meta charset="utf-8"><body style="font-family:monospace;background:#111;color:#ddd;padding:2rem"><h1>doraval ui</h1><p>Dashboard HTML missing.</p><pre>${String(err)}</pre></body>`;
|
|
5242
5241
|
}
|
|
5243
5242
|
}
|
|
5244
|
-
var
|
|
5243
|
+
var import_picocolors18, DEFAULT_PORT = 3737, getPidFile = (p) => join21(getDoravalDir(), `ui.${p}.pid`), ui_default;
|
|
5245
5244
|
var init_ui = __esm(() => {
|
|
5245
|
+
init_out();
|
|
5246
5246
|
init_journal_config();
|
|
5247
5247
|
init_journal_parse();
|
|
5248
5248
|
init_context();
|
|
5249
5249
|
init_hook();
|
|
5250
|
-
|
|
5250
|
+
import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
5251
5251
|
ui_default = {
|
|
5252
5252
|
async run({ args }) {
|
|
5253
5253
|
const port = Number(args.port) || DEFAULT_PORT;
|
|
@@ -5260,17 +5260,17 @@ var init_ui = __esm(() => {
|
|
|
5260
5260
|
if (showStatusOnly) {
|
|
5261
5261
|
if (existingPid) {
|
|
5262
5262
|
const url2 = `http://${host === "0.0.0.0" ? "localhost" : host}:${port}`;
|
|
5263
|
-
|
|
5264
|
-
|
|
5263
|
+
ui.write(` Dashboard running (pid ${existingPid})`);
|
|
5264
|
+
ui.write(` URL: ${import_picocolors18.default.underline(import_picocolors18.default.cyan(url2))}`);
|
|
5265
5265
|
} else {
|
|
5266
|
-
|
|
5266
|
+
ui.write(` No dashboard running.`);
|
|
5267
5267
|
}
|
|
5268
5268
|
return;
|
|
5269
5269
|
}
|
|
5270
5270
|
if (existingPid && !force) {
|
|
5271
5271
|
const url2 = `http://${host === "0.0.0.0" ? "localhost" : host}:${port}`;
|
|
5272
|
-
|
|
5273
|
-
|
|
5272
|
+
ui.write(` Dashboard already running (pid ${existingPid}).`);
|
|
5273
|
+
ui.write(` URL: ${import_picocolors18.default.underline(import_picocolors18.default.cyan(url2))}`);
|
|
5274
5274
|
if (shouldOpen && process.stdout.isTTY) {
|
|
5275
5275
|
try {
|
|
5276
5276
|
const opener = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
@@ -5280,7 +5280,7 @@ var init_ui = __esm(() => {
|
|
|
5280
5280
|
return;
|
|
5281
5281
|
}
|
|
5282
5282
|
if (existingPid && force) {
|
|
5283
|
-
|
|
5283
|
+
ui.write(` Force restarting (killing pid ${existingPid})...`);
|
|
5284
5284
|
try {
|
|
5285
5285
|
process.kill(existingPid, "SIGTERM");
|
|
5286
5286
|
} catch {}
|
|
@@ -5397,6 +5397,14 @@ var init_ui = __esm(() => {
|
|
|
5397
5397
|
const evals = await loadEvals(25);
|
|
5398
5398
|
return Response.json({ evals });
|
|
5399
5399
|
}
|
|
5400
|
+
if (url2.pathname === "/api/open-dir" && req.method === "POST") {
|
|
5401
|
+
const dir = getDoravalDir();
|
|
5402
|
+
try {
|
|
5403
|
+
const opener = process.platform === "darwin" ? "open" : process.platform === "win32" ? "explorer" : "xdg-open";
|
|
5404
|
+
Bun.spawn([opener, dir], { stdout: "ignore", stderr: "ignore" });
|
|
5405
|
+
} catch {}
|
|
5406
|
+
return Response.json({ ok: true, path: dir });
|
|
5407
|
+
}
|
|
5400
5408
|
if (url2.pathname.startsWith("/api/")) {
|
|
5401
5409
|
return Response.json({ error: "Not found" }, { status: 404 });
|
|
5402
5410
|
}
|
|
@@ -5405,32 +5413,32 @@ var init_ui = __esm(() => {
|
|
|
5405
5413
|
});
|
|
5406
5414
|
} catch (err) {
|
|
5407
5415
|
removePid(port);
|
|
5408
|
-
|
|
5416
|
+
ui.write(` Failed to start dashboard on port ${port}: ${err?.message || err}`);
|
|
5409
5417
|
process.exit(1);
|
|
5410
5418
|
}
|
|
5411
5419
|
const url = `http://${host === "0.0.0.0" ? "localhost" : host}:${server.port}`;
|
|
5412
5420
|
writePid(process.pid, port);
|
|
5413
5421
|
const msg = `
|
|
5414
|
-
${
|
|
5415
|
-
${
|
|
5416
|
-
${
|
|
5417
|
-
${
|
|
5422
|
+
${import_picocolors18.default.blue("\u25C9")} dora local dashboard
|
|
5423
|
+
${import_picocolors18.default.dim("Project:")} ${project ? import_picocolors18.default.white(project) : import_picocolors18.default.yellow("none (run dora init)")}
|
|
5424
|
+
${import_picocolors18.default.dim("Data dir:")} ${getDoravalDir()}
|
|
5425
|
+
${import_picocolors18.default.dim("URL:")} ${import_picocolors18.default.underline(import_picocolors18.default.cyan(url))}
|
|
5418
5426
|
|
|
5419
|
-
${
|
|
5427
|
+
${import_picocolors18.default.dim("Press Ctrl+C to stop")}
|
|
5420
5428
|
`;
|
|
5421
|
-
|
|
5422
|
-
|
|
5429
|
+
ui.write(msg);
|
|
5430
|
+
ui.write(` ${import_picocolors18.default.dim("Tip:")} data location = ${getDoravalDir()} (set DORAVAL_HOME to change)`);
|
|
5423
5431
|
if (shouldOpen && process.stdout.isTTY) {
|
|
5424
5432
|
try {
|
|
5425
5433
|
const opener = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
5426
5434
|
spawn(opener, [url], { stdio: "ignore", detached: true }).unref();
|
|
5427
5435
|
} catch {
|
|
5428
|
-
|
|
5436
|
+
ui.write(import_picocolors18.default.dim(` Could not auto-open. Visit ${url}`));
|
|
5429
5437
|
}
|
|
5430
5438
|
}
|
|
5431
5439
|
const cleanup = () => {
|
|
5432
5440
|
removePid(port);
|
|
5433
|
-
|
|
5441
|
+
ui.write(`
|
|
5434
5442
|
Stopping dashboard...`);
|
|
5435
5443
|
server.stop();
|
|
5436
5444
|
process.exit(0);
|
|
@@ -7779,13 +7787,13 @@ __export(exports_validate_top, {
|
|
|
7779
7787
|
});
|
|
7780
7788
|
import { existsSync as existsSync46 } from "fs";
|
|
7781
7789
|
import { resolve as resolve27 } from "path";
|
|
7782
|
-
var
|
|
7790
|
+
var import_picocolors19, validate_top_default;
|
|
7783
7791
|
var init_validate_top = __esm(() => {
|
|
7784
7792
|
init_dist();
|
|
7785
7793
|
init_out();
|
|
7786
7794
|
init_validators();
|
|
7787
7795
|
init_remote();
|
|
7788
|
-
|
|
7796
|
+
import_picocolors19 = __toESM(require_picocolors(), 1);
|
|
7789
7797
|
validate_top_default = defineCommand({
|
|
7790
7798
|
meta: {
|
|
7791
7799
|
name: "validate",
|
|
@@ -7825,7 +7833,7 @@ var init_validate_top = __esm(() => {
|
|
|
7825
7833
|
let cleanup;
|
|
7826
7834
|
if (remote) {
|
|
7827
7835
|
ui.info(`
|
|
7828
|
-
Cloning ${
|
|
7836
|
+
Cloning ${import_picocolors19.default.dim(args.path)}...`);
|
|
7829
7837
|
try {
|
|
7830
7838
|
const result = await cloneToTemp(remote);
|
|
7831
7839
|
fullPath = remote.subpath ? resolve27(result.dir, remote.subpath) : result.dir;
|
|
@@ -7873,13 +7881,13 @@ Check that the path is correct and the directory exists.`);
|
|
|
7873
7881
|
` + `Available providers:
|
|
7874
7882
|
` + providers.map((p) => {
|
|
7875
7883
|
const pvs = validators.filter((v) => v.provider === p);
|
|
7876
|
-
return ` ${
|
|
7877
|
-
` + pvs.map((v) => ` \u2022 ${
|
|
7884
|
+
return ` ${import_picocolors19.default.bold(p)}
|
|
7885
|
+
` + pvs.map((v) => ` \u2022 ${import_picocolors19.default.dim(v.id)} \u2014 ${v.description}`).join(`
|
|
7878
7886
|
`);
|
|
7879
7887
|
}).join(`
|
|
7880
7888
|
`) + `
|
|
7881
7889
|
|
|
7882
|
-
Use ${
|
|
7890
|
+
Use ${import_picocolors19.default.dim("--for <provider>")} or ${import_picocolors19.default.dim("--for <provider:type>")} to target explicitly.`);
|
|
7883
7891
|
process.exit(1);
|
|
7884
7892
|
}
|
|
7885
7893
|
const allResults = [];
|
|
@@ -7900,7 +7908,7 @@ Use ${import_picocolors21.default.dim("--for <provider>")} or ${import_picocolor
|
|
|
7900
7908
|
} else {
|
|
7901
7909
|
for (const { id, name, result } of allResults) {
|
|
7902
7910
|
ui.write(`
|
|
7903
|
-
${
|
|
7911
|
+
${import_picocolors19.default.bold("dora validate")} \u2014 ${import_picocolors19.default.white(name)} ${import_picocolors19.default.dim(`(${id})`)}
|
|
7904
7912
|
`);
|
|
7905
7913
|
ui.info(` Path: ${args.path}
|
|
7906
7914
|
`);
|
|
@@ -7915,7 +7923,7 @@ Use ${import_picocolors21.default.dim("--for <provider>")} or ${import_picocolor
|
|
|
7915
7923
|
}
|
|
7916
7924
|
if (result.errors.length === 0 && result.warnings.length === 0) {
|
|
7917
7925
|
ui.write(`
|
|
7918
|
-
${
|
|
7926
|
+
${import_picocolors19.default.green("\u2713")} ${import_picocolors19.default.white("All checks passed.")}
|
|
7919
7927
|
`);
|
|
7920
7928
|
} else {
|
|
7921
7929
|
ui.info(`
|
|
@@ -7939,14 +7947,14 @@ __export(exports_init2, {
|
|
|
7939
7947
|
});
|
|
7940
7948
|
import { basename as basename7, join as join32 } from "path";
|
|
7941
7949
|
var {spawnSync: spawnSync5 } = globalThis.Bun;
|
|
7942
|
-
var
|
|
7950
|
+
var import_picocolors20, init_default2;
|
|
7943
7951
|
var init_init2 = __esm(() => {
|
|
7944
7952
|
init_dist();
|
|
7945
7953
|
init_out();
|
|
7946
7954
|
init_journal_config();
|
|
7947
7955
|
init_journal_remote();
|
|
7948
7956
|
init_prompt();
|
|
7949
|
-
|
|
7957
|
+
import_picocolors20 = __toESM(require_picocolors(), 1);
|
|
7950
7958
|
init_default2 = defineCommand({
|
|
7951
7959
|
meta: {
|
|
7952
7960
|
name: "init",
|
|
@@ -7971,19 +7979,21 @@ var init_init2 = __esm(() => {
|
|
|
7971
7979
|
},
|
|
7972
7980
|
async run({ args }) {
|
|
7973
7981
|
ui.heading("dora init \u2014 Set up doraval, your journal, and the coding agent dora should use on the fly");
|
|
7982
|
+
ui.write(` ${import_picocolors20.default.bold(import_picocolors20.default.white("Step 1: Journal setup"))}
|
|
7983
|
+
`);
|
|
7974
7984
|
const ghCheck = ensureGhCli();
|
|
7975
7985
|
if (!ghCheck.ok) {
|
|
7976
|
-
ui.write(` ${
|
|
7986
|
+
ui.write(` ${import_picocolors20.default.red("\u2717")} ${import_picocolors20.default.white("The GitHub CLI (")}${import_picocolors20.default.bold("gh")}${import_picocolors20.default.white(") is not installed.")}
|
|
7977
7987
|
`);
|
|
7978
|
-
ui.info(` doraval uses ${
|
|
7988
|
+
ui.info(` doraval uses ${import_picocolors20.default.bold("gh")} to fetch and sync journal files with GitHub.
|
|
7979
7989
|
`);
|
|
7980
7990
|
ui.info(` Install it:
|
|
7981
7991
|
`);
|
|
7982
|
-
ui.info(` macOS: ${
|
|
7983
|
-
ui.info(` Linux: ${
|
|
7984
|
-
ui.info(` Windows: ${
|
|
7992
|
+
ui.info(` macOS: ${import_picocolors20.default.dim("brew install gh")}`);
|
|
7993
|
+
ui.info(` Linux: ${import_picocolors20.default.dim("https://github.com/cli/cli/blob/trunk/docs/install_linux.md")}`);
|
|
7994
|
+
ui.info(` Windows: ${import_picocolors20.default.dim("winget install --id GitHub.cli")}
|
|
7985
7995
|
`);
|
|
7986
|
-
ui.info(` Then authenticate: ${
|
|
7996
|
+
ui.info(` Then authenticate: ${import_picocolors20.default.dim("gh auth login")}
|
|
7987
7997
|
`);
|
|
7988
7998
|
process.exit(1);
|
|
7989
7999
|
}
|
|
@@ -7996,28 +8006,28 @@ var init_init2 = __esm(() => {
|
|
|
7996
8006
|
if (gitOwner) {
|
|
7997
8007
|
defaultRepo = `${gitOwner}/${gitOwner}.md`;
|
|
7998
8008
|
if (ghLogin && ghLogin !== gitOwner) {
|
|
7999
|
-
sourceNote = ` ${
|
|
8009
|
+
sourceNote = ` ${import_picocolors20.default.dim("(from git remote; your active gh account is " + ghLogin + ")")}
|
|
8000
8010
|
`;
|
|
8001
8011
|
} else {
|
|
8002
|
-
sourceNote = ` ${
|
|
8012
|
+
sourceNote = ` ${import_picocolors20.default.dim("(from git remote)")}
|
|
8003
8013
|
`;
|
|
8004
8014
|
}
|
|
8005
8015
|
} else if (ghLogin) {
|
|
8006
8016
|
defaultRepo = `${ghLogin}/${ghLogin}.md`;
|
|
8007
|
-
sourceNote = ` ${
|
|
8017
|
+
sourceNote = ` ${import_picocolors20.default.dim("(from your active gh account)")}
|
|
8008
8018
|
`;
|
|
8009
8019
|
} else {
|
|
8010
|
-
ui.warn(`Not logged in to GitHub. Run ${
|
|
8020
|
+
ui.warn(`Not logged in to GitHub. Run ${import_picocolors20.default.dim("gh auth login")} first.
|
|
8011
8021
|
`);
|
|
8012
8022
|
process.exit(1);
|
|
8013
8023
|
}
|
|
8014
8024
|
const existingConfig = await readConfig();
|
|
8015
8025
|
if (existingConfig?.journal.repo) {
|
|
8016
8026
|
defaultRepo = existingConfig.journal.repo;
|
|
8017
|
-
sourceNote = ` ${
|
|
8027
|
+
sourceNote = ` ${import_picocolors20.default.dim("(from your previous journal setup)")}
|
|
8018
8028
|
`;
|
|
8019
8029
|
}
|
|
8020
|
-
ui.info(` Journal repo ${
|
|
8030
|
+
ui.info(` Journal repo ${import_picocolors20.default.dim("(owner/name)")}`);
|
|
8021
8031
|
if (sourceNote)
|
|
8022
8032
|
ui.write(sourceNote);
|
|
8023
8033
|
repo = prompt(" >", defaultRepo);
|
|
@@ -8029,11 +8039,11 @@ var init_init2 = __esm(() => {
|
|
|
8029
8039
|
}
|
|
8030
8040
|
project = sanitizeProjectName(project);
|
|
8031
8041
|
if (!repoExists(repo)) {
|
|
8032
|
-
ui.write(` ${
|
|
8042
|
+
ui.write(` ${import_picocolors20.default.red("\u2717")} ${import_picocolors20.default.white("Repository")} ${import_picocolors20.default.bold(repo)} ${import_picocolors20.default.white("not found on GitHub.")}
|
|
8033
8043
|
`);
|
|
8034
8044
|
ui.info(` Create it first:
|
|
8035
8045
|
`);
|
|
8036
|
-
ui.info(` ${
|
|
8046
|
+
ui.info(` ${import_picocolors20.default.dim(`gh repo create ${repo} --private --description "Personal journal for agent decisions"`)}
|
|
8037
8047
|
`);
|
|
8038
8048
|
process.exit(1);
|
|
8039
8049
|
}
|
|
@@ -8041,11 +8051,11 @@ var init_init2 = __esm(() => {
|
|
|
8041
8051
|
const alreadyRegistered = existing?.journal.projects[project];
|
|
8042
8052
|
const isRefresh = alreadyRegistered && args.refresh;
|
|
8043
8053
|
if (alreadyRegistered && !isRefresh) {
|
|
8044
|
-
ui.write(` ${
|
|
8054
|
+
ui.write(` ${import_picocolors20.default.yellow("\u26A0")} ${import_picocolors20.default.white("Project")} ${import_picocolors20.default.bold(project)} ${import_picocolors20.default.white("is already registered.")}
|
|
8045
8055
|
`);
|
|
8046
8056
|
ui.info(` Repo: ${existing.journal.repo}
|
|
8047
8057
|
`);
|
|
8048
|
-
ui.info(` To refresh journal files, use ${
|
|
8058
|
+
ui.info(` To refresh journal files, use ${import_picocolors20.default.dim("dora journal update")} (or ${import_picocolors20.default.dim("dora init --refresh")}).
|
|
8049
8059
|
`);
|
|
8050
8060
|
}
|
|
8051
8061
|
const journalsDir = getJournalsDir();
|
|
@@ -8061,7 +8071,7 @@ var init_init2 = __esm(() => {
|
|
|
8061
8071
|
local_path: localPath
|
|
8062
8072
|
};
|
|
8063
8073
|
ensureDoravalDirs();
|
|
8064
|
-
ui.write(` ${
|
|
8074
|
+
ui.write(` ${import_picocolors20.default.dim(import_picocolors20.default.gray("Fetching journal files from"))} ${import_picocolors20.default.gray(effectiveRepo)}${import_picocolors20.default.dim(import_picocolors20.default.gray("..."))}
|
|
8065
8075
|
`);
|
|
8066
8076
|
const globalDest = join32(journalsDir, "global.md");
|
|
8067
8077
|
const refreshGlobalRes = await refreshLocalJournalFile(effectiveRepo, "global.md", globalDest);
|
|
@@ -8080,7 +8090,7 @@ var init_init2 = __esm(() => {
|
|
|
8080
8090
|
if (wroteGlobal) {
|
|
8081
8091
|
ui.success("global.md");
|
|
8082
8092
|
} else {
|
|
8083
|
-
ui.write(` ${
|
|
8093
|
+
ui.write(` ${import_picocolors20.default.dim("\xB7")} global.md ${import_picocolors20.default.dim("(not found \u2014 will be created on first sync)")}`);
|
|
8084
8094
|
await Bun.write(globalDest, `# Global Journal
|
|
8085
8095
|
|
|
8086
8096
|
Cross-project principles.
|
|
@@ -8102,7 +8112,7 @@ Cross-project principles.
|
|
|
8102
8112
|
if (wroteProject) {
|
|
8103
8113
|
ui.success(remotePath);
|
|
8104
8114
|
} else {
|
|
8105
|
-
ui.write(` ${
|
|
8115
|
+
ui.write(` ${import_picocolors20.default.dim("\xB7")} ${remotePath} ${import_picocolors20.default.dim("(not found \u2014 will be created on first sync)")}`);
|
|
8106
8116
|
await Bun.write(localPath, `# ${project} Journal
|
|
8107
8117
|
|
|
8108
8118
|
Project-specific decisions.
|
|
@@ -8110,13 +8120,13 @@ Project-specific decisions.
|
|
|
8110
8120
|
}
|
|
8111
8121
|
await writeConfig(config);
|
|
8112
8122
|
ui.write(`
|
|
8113
|
-
${
|
|
8123
|
+
${import_picocolors20.default.green("\u2713")} ${import_picocolors20.default.white("Journal ready for project")} ${import_picocolors20.default.bold(import_picocolors20.default.white(project))}.
|
|
8114
8124
|
`);
|
|
8115
8125
|
const existingAgent = (await readConfig())?.agent;
|
|
8116
8126
|
if (existingAgent?.command) {
|
|
8117
|
-
ui.write(` ${
|
|
8127
|
+
ui.write(` ${import_picocolors20.default.bold(import_picocolors20.default.white("Coding agent (already configured)"))}
|
|
8118
8128
|
`);
|
|
8119
|
-
ui.write(` Current: ${
|
|
8129
|
+
ui.write(` Current: ${import_picocolors20.default.dim(import_picocolors20.default.gray(existingAgent.command))} template: ${import_picocolors20.default.dim(import_picocolors20.default.gray(existingAgent.prompt_template || "(default)"))}
|
|
8120
8130
|
`);
|
|
8121
8131
|
const change = prompt(" Reconfigure / change the coding agent for on-the-fly enrichment? (y/N)", "n");
|
|
8122
8132
|
if (!/^y/i.test(String(change))) {
|
|
@@ -8126,16 +8136,17 @@ Project-specific decisions.
|
|
|
8126
8136
|
if (existingAgent)
|
|
8127
8137
|
cfg.agent = existingAgent;
|
|
8128
8138
|
await writeConfig(cfg);
|
|
8129
|
-
ui.write(` ${
|
|
8139
|
+
ui.write(` ${import_picocolors20.default.green("\u2713")} ${import_picocolors20.default.white("Try:")} ${import_picocolors20.default.dim(import_picocolors20.default.gray('dora journal add "short decision"'))}
|
|
8130
8140
|
`);
|
|
8131
8141
|
process.exit(0);
|
|
8132
8142
|
return;
|
|
8133
8143
|
}
|
|
8134
8144
|
ui.blank();
|
|
8135
8145
|
} else {
|
|
8136
|
-
ui.write(`
|
|
8146
|
+
ui.write(`
|
|
8147
|
+
${import_picocolors20.default.bold(import_picocolors20.default.white("Step 2: Coding agent for journal add"))}
|
|
8137
8148
|
`);
|
|
8138
|
-
ui.info(` When configured, ${
|
|
8149
|
+
ui.info(` When configured, ${import_picocolors20.default.dim(import_picocolors20.default.gray('dora journal add ".."'))} will use your agent to enrich entries with tags and rationale automatically.
|
|
8139
8150
|
`);
|
|
8140
8151
|
}
|
|
8141
8152
|
const common = [
|
|
@@ -8154,7 +8165,7 @@ Project-specific decisions.
|
|
|
8154
8165
|
}
|
|
8155
8166
|
}
|
|
8156
8167
|
let agentCmd = detected || "claude";
|
|
8157
|
-
ui.write(` Detected / default agent command: ${
|
|
8168
|
+
ui.write(` Detected / default agent command: ${import_picocolors20.default.dim(import_picocolors20.default.gray(agentCmd))}`);
|
|
8158
8169
|
agentCmd = prompt(" Agent command (the binary you run for prompts)", agentCmd);
|
|
8159
8170
|
let template = detected ? common.find((c) => c.name === detected)?.template || '-p "{{prompt}}" --output-format json' : '-p "{{prompt}}" --output-format json';
|
|
8160
8171
|
ui.info(` Prompt template (use {{prompt}} placeholder):`);
|
|
@@ -8166,12 +8177,12 @@ Project-specific decisions.
|
|
|
8166
8177
|
};
|
|
8167
8178
|
await writeConfig(finalConfig);
|
|
8168
8179
|
ui.write(`
|
|
8169
|
-
${
|
|
8180
|
+
${import_picocolors20.default.green("\u2713")} ${import_picocolors20.default.white("Agent configured.")}
|
|
8170
8181
|
`);
|
|
8171
|
-
ui.info(` Re-run ${
|
|
8182
|
+
ui.info(` Re-run ${import_picocolors20.default.dim(import_picocolors20.default.gray("dora init"))} anytime to change it.
|
|
8172
8183
|
`);
|
|
8173
8184
|
ui.write(`
|
|
8174
|
-
${
|
|
8185
|
+
${import_picocolors20.default.bold("Step 3: Eval configuration (doraval eval)")}
|
|
8175
8186
|
`);
|
|
8176
8187
|
const hasAnthropic = !!process.env.ANTHROPIC_API_KEY;
|
|
8177
8188
|
const hasOpenAI = !!process.env.OPENAI_API_KEY;
|
|
@@ -8180,7 +8191,7 @@ Project-specific decisions.
|
|
|
8180
8191
|
} else {
|
|
8181
8192
|
ui.warn("No ANTHROPIC_API_KEY or OPENAI_API_KEY set. Set the right one before running doraval eval.");
|
|
8182
8193
|
}
|
|
8183
|
-
const evalModelAnswer = await prompt(` Which model should doraval eval use? ${
|
|
8194
|
+
const evalModelAnswer = await prompt(` Which model should doraval eval use? ${import_picocolors20.default.dim("(e.g. claude-sonnet-4-6 or gpt-4o, press Enter to skip)")} `, "");
|
|
8184
8195
|
if (evalModelAnswer.trim()) {
|
|
8185
8196
|
const updatedConfig2 = await readConfig();
|
|
8186
8197
|
if (updatedConfig2) {
|
|
@@ -8195,7 +8206,7 @@ Project-specific decisions.
|
|
|
8195
8206
|
} else {
|
|
8196
8207
|
ui.dim(" Skipped. Run: dora config set eval.model <model-name>");
|
|
8197
8208
|
}
|
|
8198
|
-
ui.info(` Next: ${
|
|
8209
|
+
ui.info(` Next: ${import_picocolors20.default.dim(import_picocolors20.default.gray('dora journal add ".."'))}, ${import_picocolors20.default.dim(import_picocolors20.default.gray("dora journal list"))}, or ${import_picocolors20.default.dim(import_picocolors20.default.gray("dora journal update"))}.
|
|
8199
8210
|
`);
|
|
8200
8211
|
process.exit(0);
|
|
8201
8212
|
}
|
|
@@ -8535,12 +8546,12 @@ var exports_providers = {};
|
|
|
8535
8546
|
__export(exports_providers, {
|
|
8536
8547
|
default: () => providers_default
|
|
8537
8548
|
});
|
|
8538
|
-
var
|
|
8549
|
+
var import_picocolors21, providers_default;
|
|
8539
8550
|
var init_providers2 = __esm(() => {
|
|
8540
8551
|
init_dist();
|
|
8541
8552
|
init_out();
|
|
8542
8553
|
init_spec();
|
|
8543
|
-
|
|
8554
|
+
import_picocolors21 = __toESM(require_picocolors(), 1);
|
|
8544
8555
|
providers_default = defineCommand({
|
|
8545
8556
|
meta: {
|
|
8546
8557
|
name: "providers",
|
|
@@ -8565,7 +8576,7 @@ var init_providers2 = __esm(() => {
|
|
|
8565
8576
|
for (const id of supportedProviders) {
|
|
8566
8577
|
const spec = getProviderSpec(id);
|
|
8567
8578
|
ui.write(`
|
|
8568
|
-
${
|
|
8579
|
+
${import_picocolors21.default.bold(id)} \u2014 ${spec.name}`);
|
|
8569
8580
|
ui.info(` Manifest: ${spec.manifestPath}`);
|
|
8570
8581
|
ui.info(` Marketplace: ${spec.marketplacePath}`);
|
|
8571
8582
|
ui.info(` MCP: ${spec.mcpFilename}`);
|
|
@@ -8642,13 +8653,13 @@ _doraval_completions() {
|
|
|
8642
8653
|
COMPREPLY=( $(compgen -W "${commands.join(" ")}" -- "$cur") )
|
|
8643
8654
|
elif [ $COMP_CWORD -eq 2 ]; then
|
|
8644
8655
|
case "$prev" in
|
|
8645
|
-
skill) COMPREPLY=( $(compgen -W "${subCommands.skill.join(" ")}" -- "$cur") ) ;;
|
|
8646
|
-
journal) COMPREPLY=( $(compgen -W "${subCommands.journal.join(" ")}" -- "$cur") ) ;;
|
|
8647
|
-
eval) COMPREPLY=( $(compgen -W "${subCommands.eval.join(" ")}" -- "$cur") ) ;;
|
|
8648
|
-
config) COMPREPLY=( $(compgen -W "${subCommands.config.join(" ")}" -- "$cur") ) ;;
|
|
8649
|
-
hook) COMPREPLY=( $(compgen -W "${subCommands.hook.join(" ")}" -- "$cur") ) ;;
|
|
8656
|
+
skill) COMPREPLY=( $(compgen -W "${(subCommands.skill ?? []).join(" ")}" -- "$cur") ) ;;
|
|
8657
|
+
journal) COMPREPLY=( $(compgen -W "${(subCommands.journal ?? []).join(" ")}" -- "$cur") ) ;;
|
|
8658
|
+
eval) COMPREPLY=( $(compgen -W "${(subCommands.eval ?? []).join(" ")}" -- "$cur") ) ;;
|
|
8659
|
+
config) COMPREPLY=( $(compgen -W "${(subCommands.config ?? []).join(" ")}" -- "$cur") ) ;;
|
|
8660
|
+
hook) COMPREPLY=( $(compgen -W "${(subCommands.hook ?? []).join(" ")}" -- "$cur") ) ;;
|
|
8650
8661
|
ui) COMPREPLY=( $(compgen -W "${uiFlags.join(" ")}" -- "$cur") ) ;;
|
|
8651
|
-
claude|codex|cursor|copilot) COMPREPLY=( $(compgen -W "${subCommands.claude.join(" ")}" -- "$cur") ) ;;
|
|
8662
|
+
claude|codex|cursor|copilot) COMPREPLY=( $(compgen -W "${(subCommands.claude ?? []).join(" ")}" -- "$cur") ) ;;
|
|
8652
8663
|
esac
|
|
8653
8664
|
fi
|
|
8654
8665
|
}
|
|
@@ -8728,8 +8739,9 @@ complete -c doraval -n '__fish_seen_subcommand_from claude codex cursor copilot'
|
|
|
8728
8739
|
|
|
8729
8740
|
// src/cli/index.ts
|
|
8730
8741
|
init_dist();
|
|
8742
|
+
init_out();
|
|
8731
8743
|
var import__package = __toESM(require_package(), 1);
|
|
8732
|
-
var
|
|
8744
|
+
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
8733
8745
|
var skill = defineCommand({
|
|
8734
8746
|
meta: {
|
|
8735
8747
|
name: "skill",
|
|
@@ -8922,8 +8934,8 @@ var main = defineCommand({
|
|
|
8922
8934
|
if (cliArgs.length > 0)
|
|
8923
8935
|
return;
|
|
8924
8936
|
if (process.stdout.isTTY) {
|
|
8925
|
-
|
|
8926
|
-
` +
|
|
8937
|
+
ui.write(`
|
|
8938
|
+
` + import_picocolors22.default.blue(doraemonArt) + `
|
|
8927
8939
|
`);
|
|
8928
8940
|
}
|
|
8929
8941
|
showUsage(main);
|