@hacksmith/doraval 0.2.47 → 0.2.49
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/bin/doraval.js +272 -273
- 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.49",
|
|
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",
|
|
@@ -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) {
|
|
@@ -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;
|
|
@@ -5241,13 +5240,13 @@ async function getDashboardHtml() {
|
|
|
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(() => {
|
|
5246
5245
|
init_journal_config();
|
|
5247
5246
|
init_journal_parse();
|
|
5248
5247
|
init_context();
|
|
5249
5248
|
init_hook();
|
|
5250
|
-
|
|
5249
|
+
import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
5251
5250
|
ui_default = {
|
|
5252
5251
|
async run({ args }) {
|
|
5253
5252
|
const port = Number(args.port) || DEFAULT_PORT;
|
|
@@ -5261,7 +5260,7 @@ var init_ui = __esm(() => {
|
|
|
5261
5260
|
if (existingPid) {
|
|
5262
5261
|
const url2 = `http://${host === "0.0.0.0" ? "localhost" : host}:${port}`;
|
|
5263
5262
|
console.error(` Dashboard running (pid ${existingPid})`);
|
|
5264
|
-
console.error(` URL: ${
|
|
5263
|
+
console.error(` URL: ${import_picocolors18.default.underline(import_picocolors18.default.cyan(url2))}`);
|
|
5265
5264
|
} else {
|
|
5266
5265
|
console.error(` No dashboard running.`);
|
|
5267
5266
|
}
|
|
@@ -5270,7 +5269,7 @@ var init_ui = __esm(() => {
|
|
|
5270
5269
|
if (existingPid && !force) {
|
|
5271
5270
|
const url2 = `http://${host === "0.0.0.0" ? "localhost" : host}:${port}`;
|
|
5272
5271
|
console.error(` Dashboard already running (pid ${existingPid}).`);
|
|
5273
|
-
console.error(` URL: ${
|
|
5272
|
+
console.error(` URL: ${import_picocolors18.default.underline(import_picocolors18.default.cyan(url2))}`);
|
|
5274
5273
|
if (shouldOpen && process.stdout.isTTY) {
|
|
5275
5274
|
try {
|
|
5276
5275
|
const opener = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
@@ -5411,21 +5410,21 @@ var init_ui = __esm(() => {
|
|
|
5411
5410
|
const url = `http://${host === "0.0.0.0" ? "localhost" : host}:${server.port}`;
|
|
5412
5411
|
writePid(process.pid, port);
|
|
5413
5412
|
const msg = `
|
|
5414
|
-
${
|
|
5415
|
-
${
|
|
5416
|
-
${
|
|
5417
|
-
${
|
|
5413
|
+
${import_picocolors18.default.blue("\u25C9")} dora local dashboard
|
|
5414
|
+
${import_picocolors18.default.dim("Project:")} ${project ? import_picocolors18.default.white(project) : import_picocolors18.default.yellow("none (run dora init)")}
|
|
5415
|
+
${import_picocolors18.default.dim("Data dir:")} ${getDoravalDir()}
|
|
5416
|
+
${import_picocolors18.default.dim("URL:")} ${import_picocolors18.default.underline(import_picocolors18.default.cyan(url))}
|
|
5418
5417
|
|
|
5419
|
-
${
|
|
5418
|
+
${import_picocolors18.default.dim("Press Ctrl+C to stop")}
|
|
5420
5419
|
`;
|
|
5421
5420
|
console.error(msg);
|
|
5422
|
-
console.error(` ${
|
|
5421
|
+
console.error(` ${import_picocolors18.default.dim("Tip:")} data location = ${getDoravalDir()} (set DORAVAL_HOME to change)`);
|
|
5423
5422
|
if (shouldOpen && process.stdout.isTTY) {
|
|
5424
5423
|
try {
|
|
5425
5424
|
const opener = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
5426
5425
|
spawn(opener, [url], { stdio: "ignore", detached: true }).unref();
|
|
5427
5426
|
} catch {
|
|
5428
|
-
console.error(
|
|
5427
|
+
console.error(import_picocolors18.default.dim(` Could not auto-open. Visit ${url}`));
|
|
5429
5428
|
}
|
|
5430
5429
|
}
|
|
5431
5430
|
const cleanup = () => {
|
|
@@ -7779,13 +7778,13 @@ __export(exports_validate_top, {
|
|
|
7779
7778
|
});
|
|
7780
7779
|
import { existsSync as existsSync46 } from "fs";
|
|
7781
7780
|
import { resolve as resolve27 } from "path";
|
|
7782
|
-
var
|
|
7781
|
+
var import_picocolors19, validate_top_default;
|
|
7783
7782
|
var init_validate_top = __esm(() => {
|
|
7784
7783
|
init_dist();
|
|
7785
7784
|
init_out();
|
|
7786
7785
|
init_validators();
|
|
7787
7786
|
init_remote();
|
|
7788
|
-
|
|
7787
|
+
import_picocolors19 = __toESM(require_picocolors(), 1);
|
|
7789
7788
|
validate_top_default = defineCommand({
|
|
7790
7789
|
meta: {
|
|
7791
7790
|
name: "validate",
|
|
@@ -7825,7 +7824,7 @@ var init_validate_top = __esm(() => {
|
|
|
7825
7824
|
let cleanup;
|
|
7826
7825
|
if (remote) {
|
|
7827
7826
|
ui.info(`
|
|
7828
|
-
Cloning ${
|
|
7827
|
+
Cloning ${import_picocolors19.default.dim(args.path)}...`);
|
|
7829
7828
|
try {
|
|
7830
7829
|
const result = await cloneToTemp(remote);
|
|
7831
7830
|
fullPath = remote.subpath ? resolve27(result.dir, remote.subpath) : result.dir;
|
|
@@ -7873,13 +7872,13 @@ Check that the path is correct and the directory exists.`);
|
|
|
7873
7872
|
` + `Available providers:
|
|
7874
7873
|
` + providers.map((p) => {
|
|
7875
7874
|
const pvs = validators.filter((v) => v.provider === p);
|
|
7876
|
-
return ` ${
|
|
7877
|
-
` + pvs.map((v) => ` \u2022 ${
|
|
7875
|
+
return ` ${import_picocolors19.default.bold(p)}
|
|
7876
|
+
` + pvs.map((v) => ` \u2022 ${import_picocolors19.default.dim(v.id)} \u2014 ${v.description}`).join(`
|
|
7878
7877
|
`);
|
|
7879
7878
|
}).join(`
|
|
7880
7879
|
`) + `
|
|
7881
7880
|
|
|
7882
|
-
Use ${
|
|
7881
|
+
Use ${import_picocolors19.default.dim("--for <provider>")} or ${import_picocolors19.default.dim("--for <provider:type>")} to target explicitly.`);
|
|
7883
7882
|
process.exit(1);
|
|
7884
7883
|
}
|
|
7885
7884
|
const allResults = [];
|
|
@@ -7900,7 +7899,7 @@ Use ${import_picocolors21.default.dim("--for <provider>")} or ${import_picocolor
|
|
|
7900
7899
|
} else {
|
|
7901
7900
|
for (const { id, name, result } of allResults) {
|
|
7902
7901
|
ui.write(`
|
|
7903
|
-
${
|
|
7902
|
+
${import_picocolors19.default.bold("dora validate")} \u2014 ${import_picocolors19.default.white(name)} ${import_picocolors19.default.dim(`(${id})`)}
|
|
7904
7903
|
`);
|
|
7905
7904
|
ui.info(` Path: ${args.path}
|
|
7906
7905
|
`);
|
|
@@ -7915,7 +7914,7 @@ Use ${import_picocolors21.default.dim("--for <provider>")} or ${import_picocolor
|
|
|
7915
7914
|
}
|
|
7916
7915
|
if (result.errors.length === 0 && result.warnings.length === 0) {
|
|
7917
7916
|
ui.write(`
|
|
7918
|
-
${
|
|
7917
|
+
${import_picocolors19.default.green("\u2713")} ${import_picocolors19.default.white("All checks passed.")}
|
|
7919
7918
|
`);
|
|
7920
7919
|
} else {
|
|
7921
7920
|
ui.info(`
|
|
@@ -7939,14 +7938,14 @@ __export(exports_init2, {
|
|
|
7939
7938
|
});
|
|
7940
7939
|
import { basename as basename7, join as join32 } from "path";
|
|
7941
7940
|
var {spawnSync: spawnSync5 } = globalThis.Bun;
|
|
7942
|
-
var
|
|
7941
|
+
var import_picocolors20, init_default2;
|
|
7943
7942
|
var init_init2 = __esm(() => {
|
|
7944
7943
|
init_dist();
|
|
7945
7944
|
init_out();
|
|
7946
7945
|
init_journal_config();
|
|
7947
7946
|
init_journal_remote();
|
|
7948
7947
|
init_prompt();
|
|
7949
|
-
|
|
7948
|
+
import_picocolors20 = __toESM(require_picocolors(), 1);
|
|
7950
7949
|
init_default2 = defineCommand({
|
|
7951
7950
|
meta: {
|
|
7952
7951
|
name: "init",
|
|
@@ -7973,17 +7972,17 @@ var init_init2 = __esm(() => {
|
|
|
7973
7972
|
ui.heading("dora init \u2014 Set up doraval, your journal, and the coding agent dora should use on the fly");
|
|
7974
7973
|
const ghCheck = ensureGhCli();
|
|
7975
7974
|
if (!ghCheck.ok) {
|
|
7976
|
-
ui.write(` ${
|
|
7975
|
+
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
7976
|
`);
|
|
7978
|
-
ui.info(` doraval uses ${
|
|
7977
|
+
ui.info(` doraval uses ${import_picocolors20.default.bold("gh")} to fetch and sync journal files with GitHub.
|
|
7979
7978
|
`);
|
|
7980
7979
|
ui.info(` Install it:
|
|
7981
7980
|
`);
|
|
7982
|
-
ui.info(` macOS: ${
|
|
7983
|
-
ui.info(` Linux: ${
|
|
7984
|
-
ui.info(` Windows: ${
|
|
7981
|
+
ui.info(` macOS: ${import_picocolors20.default.dim("brew install gh")}`);
|
|
7982
|
+
ui.info(` Linux: ${import_picocolors20.default.dim("https://github.com/cli/cli/blob/trunk/docs/install_linux.md")}`);
|
|
7983
|
+
ui.info(` Windows: ${import_picocolors20.default.dim("winget install --id GitHub.cli")}
|
|
7985
7984
|
`);
|
|
7986
|
-
ui.info(` Then authenticate: ${
|
|
7985
|
+
ui.info(` Then authenticate: ${import_picocolors20.default.dim("gh auth login")}
|
|
7987
7986
|
`);
|
|
7988
7987
|
process.exit(1);
|
|
7989
7988
|
}
|
|
@@ -7996,28 +7995,28 @@ var init_init2 = __esm(() => {
|
|
|
7996
7995
|
if (gitOwner) {
|
|
7997
7996
|
defaultRepo = `${gitOwner}/${gitOwner}.md`;
|
|
7998
7997
|
if (ghLogin && ghLogin !== gitOwner) {
|
|
7999
|
-
sourceNote = ` ${
|
|
7998
|
+
sourceNote = ` ${import_picocolors20.default.dim("(from git remote; your active gh account is " + ghLogin + ")")}
|
|
8000
7999
|
`;
|
|
8001
8000
|
} else {
|
|
8002
|
-
sourceNote = ` ${
|
|
8001
|
+
sourceNote = ` ${import_picocolors20.default.dim("(from git remote)")}
|
|
8003
8002
|
`;
|
|
8004
8003
|
}
|
|
8005
8004
|
} else if (ghLogin) {
|
|
8006
8005
|
defaultRepo = `${ghLogin}/${ghLogin}.md`;
|
|
8007
|
-
sourceNote = ` ${
|
|
8006
|
+
sourceNote = ` ${import_picocolors20.default.dim("(from your active gh account)")}
|
|
8008
8007
|
`;
|
|
8009
8008
|
} else {
|
|
8010
|
-
ui.warn(`Not logged in to GitHub. Run ${
|
|
8009
|
+
ui.warn(`Not logged in to GitHub. Run ${import_picocolors20.default.dim("gh auth login")} first.
|
|
8011
8010
|
`);
|
|
8012
8011
|
process.exit(1);
|
|
8013
8012
|
}
|
|
8014
8013
|
const existingConfig = await readConfig();
|
|
8015
8014
|
if (existingConfig?.journal.repo) {
|
|
8016
8015
|
defaultRepo = existingConfig.journal.repo;
|
|
8017
|
-
sourceNote = ` ${
|
|
8016
|
+
sourceNote = ` ${import_picocolors20.default.dim("(from your previous journal setup)")}
|
|
8018
8017
|
`;
|
|
8019
8018
|
}
|
|
8020
|
-
ui.info(` Journal repo ${
|
|
8019
|
+
ui.info(` Journal repo ${import_picocolors20.default.dim("(owner/name)")}`);
|
|
8021
8020
|
if (sourceNote)
|
|
8022
8021
|
ui.write(sourceNote);
|
|
8023
8022
|
repo = prompt(" >", defaultRepo);
|
|
@@ -8029,11 +8028,11 @@ var init_init2 = __esm(() => {
|
|
|
8029
8028
|
}
|
|
8030
8029
|
project = sanitizeProjectName(project);
|
|
8031
8030
|
if (!repoExists(repo)) {
|
|
8032
|
-
ui.write(` ${
|
|
8031
|
+
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
8032
|
`);
|
|
8034
8033
|
ui.info(` Create it first:
|
|
8035
8034
|
`);
|
|
8036
|
-
ui.info(` ${
|
|
8035
|
+
ui.info(` ${import_picocolors20.default.dim(`gh repo create ${repo} --private --description "Personal journal for agent decisions"`)}
|
|
8037
8036
|
`);
|
|
8038
8037
|
process.exit(1);
|
|
8039
8038
|
}
|
|
@@ -8041,11 +8040,11 @@ var init_init2 = __esm(() => {
|
|
|
8041
8040
|
const alreadyRegistered = existing?.journal.projects[project];
|
|
8042
8041
|
const isRefresh = alreadyRegistered && args.refresh;
|
|
8043
8042
|
if (alreadyRegistered && !isRefresh) {
|
|
8044
|
-
ui.write(` ${
|
|
8043
|
+
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
8044
|
`);
|
|
8046
8045
|
ui.info(` Repo: ${existing.journal.repo}
|
|
8047
8046
|
`);
|
|
8048
|
-
ui.info(` To refresh journal files, use ${
|
|
8047
|
+
ui.info(` To refresh journal files, use ${import_picocolors20.default.dim("dora journal update")} (or ${import_picocolors20.default.dim("dora init --refresh")}).
|
|
8049
8048
|
`);
|
|
8050
8049
|
}
|
|
8051
8050
|
const journalsDir = getJournalsDir();
|
|
@@ -8061,7 +8060,7 @@ var init_init2 = __esm(() => {
|
|
|
8061
8060
|
local_path: localPath
|
|
8062
8061
|
};
|
|
8063
8062
|
ensureDoravalDirs();
|
|
8064
|
-
ui.write(` ${
|
|
8063
|
+
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
8064
|
`);
|
|
8066
8065
|
const globalDest = join32(journalsDir, "global.md");
|
|
8067
8066
|
const refreshGlobalRes = await refreshLocalJournalFile(effectiveRepo, "global.md", globalDest);
|
|
@@ -8080,7 +8079,7 @@ var init_init2 = __esm(() => {
|
|
|
8080
8079
|
if (wroteGlobal) {
|
|
8081
8080
|
ui.success("global.md");
|
|
8082
8081
|
} else {
|
|
8083
|
-
ui.write(` ${
|
|
8082
|
+
ui.write(` ${import_picocolors20.default.dim("\xB7")} global.md ${import_picocolors20.default.dim("(not found \u2014 will be created on first sync)")}`);
|
|
8084
8083
|
await Bun.write(globalDest, `# Global Journal
|
|
8085
8084
|
|
|
8086
8085
|
Cross-project principles.
|
|
@@ -8102,7 +8101,7 @@ Cross-project principles.
|
|
|
8102
8101
|
if (wroteProject) {
|
|
8103
8102
|
ui.success(remotePath);
|
|
8104
8103
|
} else {
|
|
8105
|
-
ui.write(` ${
|
|
8104
|
+
ui.write(` ${import_picocolors20.default.dim("\xB7")} ${remotePath} ${import_picocolors20.default.dim("(not found \u2014 will be created on first sync)")}`);
|
|
8106
8105
|
await Bun.write(localPath, `# ${project} Journal
|
|
8107
8106
|
|
|
8108
8107
|
Project-specific decisions.
|
|
@@ -8110,13 +8109,13 @@ Project-specific decisions.
|
|
|
8110
8109
|
}
|
|
8111
8110
|
await writeConfig(config);
|
|
8112
8111
|
ui.write(`
|
|
8113
|
-
${
|
|
8112
|
+
${import_picocolors20.default.green("\u2713")} ${import_picocolors20.default.white("Journal ready for project")} ${import_picocolors20.default.bold(import_picocolors20.default.white(project))}.
|
|
8114
8113
|
`);
|
|
8115
8114
|
const existingAgent = (await readConfig())?.agent;
|
|
8116
8115
|
if (existingAgent?.command) {
|
|
8117
|
-
ui.write(` ${
|
|
8116
|
+
ui.write(` ${import_picocolors20.default.bold(import_picocolors20.default.white("Coding agent (already configured)"))}
|
|
8118
8117
|
`);
|
|
8119
|
-
ui.write(` Current: ${
|
|
8118
|
+
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
8119
|
`);
|
|
8121
8120
|
const change = prompt(" Reconfigure / change the coding agent for on-the-fly enrichment? (y/N)", "n");
|
|
8122
8121
|
if (!/^y/i.test(String(change))) {
|
|
@@ -8126,16 +8125,16 @@ Project-specific decisions.
|
|
|
8126
8125
|
if (existingAgent)
|
|
8127
8126
|
cfg.agent = existingAgent;
|
|
8128
8127
|
await writeConfig(cfg);
|
|
8129
|
-
ui.write(` ${
|
|
8128
|
+
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
8129
|
`);
|
|
8131
8130
|
process.exit(0);
|
|
8132
8131
|
return;
|
|
8133
8132
|
}
|
|
8134
8133
|
ui.blank();
|
|
8135
8134
|
} else {
|
|
8136
|
-
ui.write(` ${
|
|
8135
|
+
ui.write(` ${import_picocolors20.default.bold(import_picocolors20.default.white("Coding agent for journal add"))}
|
|
8137
8136
|
`);
|
|
8138
|
-
ui.info(` When configured, ${
|
|
8137
|
+
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
8138
|
`);
|
|
8140
8139
|
}
|
|
8141
8140
|
const common = [
|
|
@@ -8154,7 +8153,7 @@ Project-specific decisions.
|
|
|
8154
8153
|
}
|
|
8155
8154
|
}
|
|
8156
8155
|
let agentCmd = detected || "claude";
|
|
8157
|
-
ui.write(` Detected / default agent command: ${
|
|
8156
|
+
ui.write(` Detected / default agent command: ${import_picocolors20.default.dim(import_picocolors20.default.gray(agentCmd))}`);
|
|
8158
8157
|
agentCmd = prompt(" Agent command (the binary you run for prompts)", agentCmd);
|
|
8159
8158
|
let template = detected ? common.find((c) => c.name === detected)?.template || '-p "{{prompt}}" --output-format json' : '-p "{{prompt}}" --output-format json';
|
|
8160
8159
|
ui.info(` Prompt template (use {{prompt}} placeholder):`);
|
|
@@ -8166,12 +8165,12 @@ Project-specific decisions.
|
|
|
8166
8165
|
};
|
|
8167
8166
|
await writeConfig(finalConfig);
|
|
8168
8167
|
ui.write(`
|
|
8169
|
-
${
|
|
8168
|
+
${import_picocolors20.default.green("\u2713")} ${import_picocolors20.default.white("Agent configured.")}
|
|
8170
8169
|
`);
|
|
8171
|
-
ui.info(` Re-run ${
|
|
8170
|
+
ui.info(` Re-run ${import_picocolors20.default.dim(import_picocolors20.default.gray("dora init"))} anytime to change it.
|
|
8172
8171
|
`);
|
|
8173
8172
|
ui.write(`
|
|
8174
|
-
${
|
|
8173
|
+
${import_picocolors20.default.bold("Step 3: Eval configuration (doraval eval)")}
|
|
8175
8174
|
`);
|
|
8176
8175
|
const hasAnthropic = !!process.env.ANTHROPIC_API_KEY;
|
|
8177
8176
|
const hasOpenAI = !!process.env.OPENAI_API_KEY;
|
|
@@ -8180,7 +8179,7 @@ Project-specific decisions.
|
|
|
8180
8179
|
} else {
|
|
8181
8180
|
ui.warn("No ANTHROPIC_API_KEY or OPENAI_API_KEY set. Set the right one before running doraval eval.");
|
|
8182
8181
|
}
|
|
8183
|
-
const evalModelAnswer = await prompt(` Which model should doraval eval use? ${
|
|
8182
|
+
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
8183
|
if (evalModelAnswer.trim()) {
|
|
8185
8184
|
const updatedConfig2 = await readConfig();
|
|
8186
8185
|
if (updatedConfig2) {
|
|
@@ -8195,7 +8194,7 @@ Project-specific decisions.
|
|
|
8195
8194
|
} else {
|
|
8196
8195
|
ui.dim(" Skipped. Run: dora config set eval.model <model-name>");
|
|
8197
8196
|
}
|
|
8198
|
-
ui.info(` Next: ${
|
|
8197
|
+
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
8198
|
`);
|
|
8200
8199
|
process.exit(0);
|
|
8201
8200
|
}
|
|
@@ -8535,12 +8534,12 @@ var exports_providers = {};
|
|
|
8535
8534
|
__export(exports_providers, {
|
|
8536
8535
|
default: () => providers_default
|
|
8537
8536
|
});
|
|
8538
|
-
var
|
|
8537
|
+
var import_picocolors21, providers_default;
|
|
8539
8538
|
var init_providers2 = __esm(() => {
|
|
8540
8539
|
init_dist();
|
|
8541
8540
|
init_out();
|
|
8542
8541
|
init_spec();
|
|
8543
|
-
|
|
8542
|
+
import_picocolors21 = __toESM(require_picocolors(), 1);
|
|
8544
8543
|
providers_default = defineCommand({
|
|
8545
8544
|
meta: {
|
|
8546
8545
|
name: "providers",
|
|
@@ -8565,7 +8564,7 @@ var init_providers2 = __esm(() => {
|
|
|
8565
8564
|
for (const id of supportedProviders) {
|
|
8566
8565
|
const spec = getProviderSpec(id);
|
|
8567
8566
|
ui.write(`
|
|
8568
|
-
${
|
|
8567
|
+
${import_picocolors21.default.bold(id)} \u2014 ${spec.name}`);
|
|
8569
8568
|
ui.info(` Manifest: ${spec.manifestPath}`);
|
|
8570
8569
|
ui.info(` Marketplace: ${spec.marketplacePath}`);
|
|
8571
8570
|
ui.info(` MCP: ${spec.mcpFilename}`);
|
|
@@ -8642,13 +8641,13 @@ _doraval_completions() {
|
|
|
8642
8641
|
COMPREPLY=( $(compgen -W "${commands.join(" ")}" -- "$cur") )
|
|
8643
8642
|
elif [ $COMP_CWORD -eq 2 ]; then
|
|
8644
8643
|
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") ) ;;
|
|
8644
|
+
skill) COMPREPLY=( $(compgen -W "${(subCommands.skill ?? []).join(" ")}" -- "$cur") ) ;;
|
|
8645
|
+
journal) COMPREPLY=( $(compgen -W "${(subCommands.journal ?? []).join(" ")}" -- "$cur") ) ;;
|
|
8646
|
+
eval) COMPREPLY=( $(compgen -W "${(subCommands.eval ?? []).join(" ")}" -- "$cur") ) ;;
|
|
8647
|
+
config) COMPREPLY=( $(compgen -W "${(subCommands.config ?? []).join(" ")}" -- "$cur") ) ;;
|
|
8648
|
+
hook) COMPREPLY=( $(compgen -W "${(subCommands.hook ?? []).join(" ")}" -- "$cur") ) ;;
|
|
8650
8649
|
ui) COMPREPLY=( $(compgen -W "${uiFlags.join(" ")}" -- "$cur") ) ;;
|
|
8651
|
-
claude|codex|cursor|copilot) COMPREPLY=( $(compgen -W "${subCommands.claude.join(" ")}" -- "$cur") ) ;;
|
|
8650
|
+
claude|codex|cursor|copilot) COMPREPLY=( $(compgen -W "${(subCommands.claude ?? []).join(" ")}" -- "$cur") ) ;;
|
|
8652
8651
|
esac
|
|
8653
8652
|
fi
|
|
8654
8653
|
}
|
|
@@ -8729,7 +8728,7 @@ complete -c doraval -n '__fish_seen_subcommand_from claude codex cursor copilot'
|
|
|
8729
8728
|
// src/cli/index.ts
|
|
8730
8729
|
init_dist();
|
|
8731
8730
|
var import__package = __toESM(require_package(), 1);
|
|
8732
|
-
var
|
|
8731
|
+
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
8733
8732
|
var skill = defineCommand({
|
|
8734
8733
|
meta: {
|
|
8735
8734
|
name: "skill",
|
|
@@ -8923,7 +8922,7 @@ var main = defineCommand({
|
|
|
8923
8922
|
return;
|
|
8924
8923
|
if (process.stdout.isTTY) {
|
|
8925
8924
|
console.error(`
|
|
8926
|
-
` +
|
|
8925
|
+
` + import_picocolors22.default.blue(doraemonArt) + `
|
|
8927
8926
|
`);
|
|
8928
8927
|
}
|
|
8929
8928
|
showUsage(main);
|