@hawkeyexl/manni 4.3.1 → 4.4.0
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 +9 -1
- package/dist/batch-DFRCLY77.js +36 -0
- package/dist/build-Q5C6SX5J.js +31 -0
- package/dist/calibrate-XQILKXS3.js +31 -0
- package/dist/capture-JQMOC3BW.js +32 -0
- package/dist/check-HYNGXYJV.js +18 -0
- package/dist/check-HYNGXYJV.js.map +1 -0
- package/dist/check-NFZQLJKN.js +27 -0
- package/dist/check-NFZQLJKN.js.map +1 -0
- package/dist/check-U54XV6BP.js +40 -0
- package/dist/check-U54XV6BP.js.map +1 -0
- package/dist/chunk-252LNOEG.js +622 -0
- package/dist/chunk-252LNOEG.js.map +1 -0
- package/dist/chunk-2H7UOFLK.js +11 -0
- package/dist/chunk-2H7UOFLK.js.map +1 -0
- package/dist/chunk-2U3ORT6D.js +230 -0
- package/dist/chunk-2U3ORT6D.js.map +1 -0
- package/dist/chunk-3AFUD75K.js +23 -0
- package/dist/chunk-3AFUD75K.js.map +1 -0
- package/dist/{chunk-3R23C5DT.js → chunk-4TSWU2SU.js} +2 -14
- package/dist/chunk-4TSWU2SU.js.map +1 -0
- package/dist/chunk-5KHIFVD2.js +1192 -0
- package/dist/chunk-5KHIFVD2.js.map +1 -0
- package/dist/chunk-5YXBLLAC.js +2165 -0
- package/dist/chunk-5YXBLLAC.js.map +1 -0
- package/dist/chunk-644JVKJ4.js +3872 -0
- package/dist/chunk-644JVKJ4.js.map +1 -0
- package/dist/chunk-6OYEI2VV.js +88 -0
- package/dist/chunk-6OYEI2VV.js.map +1 -0
- package/dist/chunk-77AINBYM.js +19 -0
- package/dist/chunk-77AINBYM.js.map +1 -0
- package/dist/chunk-77HX34KD.js +1287 -0
- package/dist/chunk-77HX34KD.js.map +1 -0
- package/dist/{chunk-CFDUZRM2.js → chunk-7QMCHA4N.js} +32 -240
- package/dist/chunk-7QMCHA4N.js.map +1 -0
- package/dist/chunk-BUXDLRDT.js +455 -0
- package/dist/chunk-BUXDLRDT.js.map +1 -0
- package/dist/chunk-C6OH6CNF.js +388 -0
- package/dist/chunk-C6OH6CNF.js.map +1 -0
- package/dist/chunk-CK7SKVHR.js +1042 -0
- package/dist/chunk-CK7SKVHR.js.map +1 -0
- package/dist/chunk-CYWHFSRT.js +6737 -0
- package/dist/chunk-CYWHFSRT.js.map +1 -0
- package/dist/chunk-ERMSO34F.js +17 -0
- package/dist/chunk-ERMSO34F.js.map +1 -0
- package/dist/{chunk-IOYXPBCL.js → chunk-G3T47CFV.js} +1 -7
- package/dist/{chunk-IOYXPBCL.js.map → chunk-G3T47CFV.js.map} +1 -1
- package/dist/chunk-G7NJSREW.js +979 -0
- package/dist/chunk-G7NJSREW.js.map +1 -0
- package/dist/chunk-GLP5PSXB.js +72 -0
- package/dist/chunk-GLP5PSXB.js.map +1 -0
- package/dist/chunk-H2DLH2JI.js +198 -0
- package/dist/chunk-H2DLH2JI.js.map +1 -0
- package/dist/chunk-H6FZ66XR.js +634 -0
- package/dist/chunk-H6FZ66XR.js.map +1 -0
- package/dist/{chunk-KJR7OVDX.js → chunk-IEQHSCZG.js} +56 -137
- package/dist/chunk-IEQHSCZG.js.map +1 -0
- package/dist/chunk-IKEWBMCN.js +98 -0
- package/dist/chunk-IKEWBMCN.js.map +1 -0
- package/dist/chunk-JOHKIAVH.js +5440 -0
- package/dist/chunk-JOHKIAVH.js.map +1 -0
- package/dist/chunk-JVTNMVYU.js +10921 -0
- package/dist/chunk-JVTNMVYU.js.map +1 -0
- package/dist/chunk-K3D6FPV6.js +164 -0
- package/dist/chunk-K3D6FPV6.js.map +1 -0
- package/dist/{chunk-UBMMXS2Y.js → chunk-KCGV52AM.js} +69 -48
- package/dist/{chunk-UBMMXS2Y.js.map → chunk-KCGV52AM.js.map} +1 -1
- package/dist/chunk-LAKAWRV5.js +1651 -0
- package/dist/chunk-LAKAWRV5.js.map +1 -0
- package/dist/chunk-LJ2RDH3F.js +49 -0
- package/dist/chunk-LJ2RDH3F.js.map +1 -0
- package/dist/chunk-M2JCK5F6.js +805 -0
- package/dist/chunk-M2JCK5F6.js.map +1 -0
- package/dist/chunk-MNH7QO4Z.js +15 -0
- package/dist/chunk-MNH7QO4Z.js.map +1 -0
- package/dist/{chunk-HAPTXWU2.js → chunk-MYC3O5EJ.js} +4 -4
- package/dist/chunk-MYMBCTDE.js +387 -0
- package/dist/chunk-MYMBCTDE.js.map +1 -0
- package/dist/chunk-NCPWXHDO.js +683 -0
- package/dist/chunk-NCPWXHDO.js.map +1 -0
- package/dist/chunk-NWZ2SLYL.js +2957 -0
- package/dist/chunk-NWZ2SLYL.js.map +1 -0
- package/dist/chunk-OBFENF3U.js +934 -0
- package/dist/chunk-OBFENF3U.js.map +1 -0
- package/dist/chunk-OWBRDNRZ.js +16 -0
- package/dist/chunk-OWBRDNRZ.js.map +1 -0
- package/dist/{chunk-KTSJ2ZHA.js → chunk-PAU352SV.js} +5 -3
- package/dist/{chunk-KTSJ2ZHA.js.map → chunk-PAU352SV.js.map} +1 -1
- package/dist/chunk-PCE7QHXJ.js +68 -0
- package/dist/chunk-PCE7QHXJ.js.map +1 -0
- package/dist/chunk-PCHZY2I7.js +299 -0
- package/dist/chunk-PCHZY2I7.js.map +1 -0
- package/dist/chunk-PHF3D7ER.js +1042 -0
- package/dist/chunk-PHF3D7ER.js.map +1 -0
- package/dist/chunk-Q35YIDBV.js +1202 -0
- package/dist/chunk-Q35YIDBV.js.map +1 -0
- package/dist/chunk-RLR4TKUZ.js +4398 -0
- package/dist/chunk-RLR4TKUZ.js.map +1 -0
- package/dist/chunk-RNVYGWIC.js +30 -0
- package/dist/chunk-RNVYGWIC.js.map +1 -0
- package/dist/chunk-SE4JN5XN.js +19 -0
- package/dist/chunk-SE4JN5XN.js.map +1 -0
- package/dist/chunk-TIUTIOFB.js +25 -0
- package/dist/chunk-TIUTIOFB.js.map +1 -0
- package/dist/chunk-TU2WUBVZ.js +2 -0
- package/dist/chunk-TU2WUBVZ.js.map +1 -0
- package/dist/chunk-TZOYZK2E.js +98 -0
- package/dist/chunk-TZOYZK2E.js.map +1 -0
- package/dist/chunk-UKZNLVJW.js +17 -0
- package/dist/chunk-UKZNLVJW.js.map +1 -0
- package/dist/chunk-UZC7LDAQ.js +178 -0
- package/dist/chunk-UZC7LDAQ.js.map +1 -0
- package/dist/chunk-V46OILVC.js +3090 -0
- package/dist/chunk-V46OILVC.js.map +1 -0
- package/dist/chunk-WQE54PNH.js +1975 -0
- package/dist/chunk-WQE54PNH.js.map +1 -0
- package/dist/chunk-X3BPBDGQ.js +52 -0
- package/dist/chunk-X3BPBDGQ.js.map +1 -0
- package/dist/chunk-XSLV76YK.js +54 -0
- package/dist/chunk-XSLV76YK.js.map +1 -0
- package/dist/{chunk-5HNHEUD5.js → chunk-XYLUCIKQ.js} +3 -3
- package/dist/chunk-YEUYKR62.js +72 -0
- package/dist/chunk-YEUYKR62.js.map +1 -0
- package/dist/{chunk-G5CM2VGQ.js → chunk-YFQBFNQS.js} +8 -94
- package/dist/chunk-YFQBFNQS.js.map +1 -0
- package/dist/chunk-YIL4XLLJ.js +1661 -0
- package/dist/chunk-YIL4XLLJ.js.map +1 -0
- package/dist/chunk-YNHZHSSM.js +41 -0
- package/dist/chunk-YNHZHSSM.js.map +1 -0
- package/dist/chunk-YTCZRLTU.js +96 -0
- package/dist/chunk-YTCZRLTU.js.map +1 -0
- package/dist/chunk-YYBFZLAJ.js +374 -0
- package/dist/chunk-YYBFZLAJ.js.map +1 -0
- package/dist/chunk-ZXRAE55H.js +31 -0
- package/dist/chunk-ZXRAE55H.js.map +1 -0
- package/dist/cli-2QPR2OZG.js +232 -0
- package/dist/cli-2QPR2OZG.js.map +1 -0
- package/dist/cli-4IOPGZHR.js +1203 -0
- package/dist/cli-4IOPGZHR.js.map +1 -0
- package/dist/cli-5FL73WHA.js +346 -0
- package/dist/cli-5FL73WHA.js.map +1 -0
- package/dist/cli-C262QOWM.js +739 -0
- package/dist/cli-C262QOWM.js.map +1 -0
- package/dist/cli-LJLLIQB2.js +423 -0
- package/dist/cli-LJLLIQB2.js.map +1 -0
- package/dist/cli-OFPZ5MAS.js +626 -0
- package/dist/cli-OFPZ5MAS.js.map +1 -0
- package/dist/cli-SHSMSRQY.js +28 -0
- package/dist/cli-SHSMSRQY.js.map +1 -0
- package/dist/cli-SRHFUZHA.js +473 -0
- package/dist/cli-SRHFUZHA.js.map +1 -0
- package/dist/cli-URZQXL4K.js +552 -0
- package/dist/cli-URZQXL4K.js.map +1 -0
- package/dist/cli.d.ts +12 -2
- package/dist/cli.js +109 -7661
- package/dist/cli.js.map +1 -1
- package/dist/docmeta.js +15 -3
- package/dist/docmeta.js.map +1 -1
- package/dist/github-FE6KCNYJ.js +27 -0
- package/dist/github-FE6KCNYJ.js.map +1 -0
- package/dist/github-QXL3VMK2.js +32 -0
- package/dist/github-QXL3VMK2.js.map +1 -0
- package/dist/index.d.ts +65 -3
- package/dist/index.js +407 -337
- package/dist/index.js.map +1 -1
- package/dist/json-7WV7KL6H.js +17 -0
- package/dist/json-7WV7KL6H.js.map +1 -0
- package/dist/json-SGZ6ZRFD.js +35 -0
- package/dist/json-SGZ6ZRFD.js.map +1 -0
- package/dist/lint-DL4LJRAY.js +28 -0
- package/dist/lint-DL4LJRAY.js.map +1 -0
- package/dist/list-6BAXTZUM.js +29 -0
- package/dist/list-6BAXTZUM.js.map +1 -0
- package/dist/list-7BKNYPSB.js +31 -0
- package/dist/list-7BKNYPSB.js.map +1 -0
- package/dist/page-3U2GCFNE.js +41 -0
- package/dist/page-3U2GCFNE.js.map +1 -0
- package/dist/picker-3XF36MJF.js +14 -0
- package/dist/picker-3XF36MJF.js.map +1 -0
- package/dist/pretty-2H57QVTY.js +43 -0
- package/dist/pretty-2H57QVTY.js.map +1 -0
- package/dist/pretty-N6DO4OOL.js +37 -0
- package/dist/pretty-N6DO4OOL.js.map +1 -0
- package/dist/reporters-M6LJ2IYU.js +21 -0
- package/dist/reporters-M6LJ2IYU.js.map +1 -0
- package/dist/reporters-N6GHXSS7.js +42 -0
- package/dist/reporters-N6GHXSS7.js.map +1 -0
- package/dist/reporters-UCNEV7PH.js +71 -0
- package/dist/reporters-UCNEV7PH.js.map +1 -0
- package/dist/run-XZDAREJE.js +33 -0
- package/dist/run-XZDAREJE.js.map +1 -0
- package/dist/term-5ICGKPC3.js +1592 -0
- package/dist/term-5ICGKPC3.js.map +1 -0
- package/dist/types-Y6TXHM7M.js +10 -0
- package/dist/types-Y6TXHM7M.js.map +1 -0
- package/dist/validate-GQRM77YN.js +16 -0
- package/dist/validate-GQRM77YN.js.map +1 -0
- package/package.json +1 -1
- package/plugin/manni/.claude-plugin/plugin.json +9 -0
- package/plugin/manni/hooks/hooks.json +52 -0
- package/plugin/manni/skills/check/SKILL.md +20 -0
- package/plugin/manni/skills/evals/SKILL.md +27 -0
- package/plugin/manni/skills/fix/SKILL.md +56 -0
- package/plugin/manni/skills/setup/SKILL.md +41 -0
- package/dist/batch-A5HZKYIW.js +0 -18
- package/dist/calibrate-S5K6QHUY.js +0 -13
- package/dist/capture-OZEZDABQ.js +0 -15
- package/dist/chunk-3R23C5DT.js.map +0 -1
- package/dist/chunk-CFDUZRM2.js.map +0 -1
- package/dist/chunk-G5CM2VGQ.js.map +0 -1
- package/dist/chunk-KJR7OVDX.js.map +0 -1
- package/dist/chunk-V4KUVE47.js +0 -27170
- package/dist/chunk-V4KUVE47.js.map +0 -1
- package/dist/chunk-ZQBTK3DO.js +0 -26518
- package/dist/chunk-ZQBTK3DO.js.map +0 -1
- package/dist/picker-6HRMETE7.js +0 -12
- package/plugin/tracevals/.claude-plugin/plugin.json +0 -9
- package/plugin/tracevals/hooks/hooks.json +0 -17
- /package/dist/{batch-A5HZKYIW.js.map → batch-DFRCLY77.js.map} +0 -0
- /package/dist/{calibrate-S5K6QHUY.js.map → build-Q5C6SX5J.js.map} +0 -0
- /package/dist/{capture-OZEZDABQ.js.map → calibrate-XQILKXS3.js.map} +0 -0
- /package/dist/{picker-6HRMETE7.js.map → capture-JQMOC3BW.js.map} +0 -0
- /package/dist/{chunk-HAPTXWU2.js.map → chunk-MYC3O5EJ.js.map} +0 -0
- /package/dist/{chunk-5HNHEUD5.js.map → chunk-XYLUCIKQ.js.map} +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
programName,
|
|
4
|
+
setProgramName
|
|
5
|
+
} from "./chunk-OWBRDNRZ.js";
|
|
6
|
+
import {
|
|
7
|
+
ToolError,
|
|
8
|
+
errorMessage
|
|
9
|
+
} from "./chunk-G3T47CFV.js";
|
|
10
|
+
|
|
11
|
+
// src/shared/run.ts
|
|
12
|
+
import { realpathSync } from "node:fs";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
import { CommanderError } from "commander";
|
|
15
|
+
function fail(err) {
|
|
16
|
+
const msg = err instanceof ToolError ? err.message : `Unexpected error: ${errorMessage(err)}`;
|
|
17
|
+
const prefix = programName();
|
|
18
|
+
for (const line of msg.replace(/\n+$/, "").split("\n")) {
|
|
19
|
+
process.stderr.write(`${prefix}: ${line}
|
|
20
|
+
`);
|
|
21
|
+
}
|
|
22
|
+
process.exit(2);
|
|
23
|
+
}
|
|
24
|
+
var STDIN_LINES_MARKER = "\0";
|
|
25
|
+
var STDIN_WITH_LINES = /^-(:[1-9][0-9]*(?:-[1-9][0-9]*)?)$/;
|
|
26
|
+
function normalizeStdinArgv(argv) {
|
|
27
|
+
return argv.map((arg) => {
|
|
28
|
+
const lines = STDIN_WITH_LINES.exec(arg)?.[1];
|
|
29
|
+
return lines === void 0 ? arg : `${STDIN_LINES_MARKER}${lines}`;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
async function runProgram(program, argv = process.argv) {
|
|
33
|
+
setProgramName(program.name());
|
|
34
|
+
try {
|
|
35
|
+
await program.parseAsync(normalizeStdinArgv(argv));
|
|
36
|
+
} catch (err) {
|
|
37
|
+
if (err instanceof CommanderError) {
|
|
38
|
+
process.exitCode = err.exitCode === 0 ? 0 : 2;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
throw err;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function isMainModule(moduleUrl) {
|
|
45
|
+
const entry = process.argv[1];
|
|
46
|
+
if (!entry) return false;
|
|
47
|
+
try {
|
|
48
|
+
return realpathSync(entry) === fileURLToPath(moduleUrl);
|
|
49
|
+
} catch {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function endOutputOnClosedReader(streams = [process.stdout, process.stderr]) {
|
|
54
|
+
for (const stream of streams) {
|
|
55
|
+
stream.on("error", (err) => {
|
|
56
|
+
if (err.code === "EPIPE") return;
|
|
57
|
+
throw err;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function runIfMain(moduleUrl, build) {
|
|
62
|
+
if (!isMainModule(moduleUrl)) return;
|
|
63
|
+
endOutputOnClosedReader();
|
|
64
|
+
Promise.resolve(build()).then(runProgram).catch(fail);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
fail,
|
|
69
|
+
STDIN_LINES_MARKER,
|
|
70
|
+
runIfMain
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=chunk-YEUYKR62.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/run.ts"],"sourcesContent":["/**\n * Running a commander program as a bin.\n *\n * Every entry point (`manni`, and `docmeta` for existing scripts) is the same\n * three lines: build the program, parse, and turn what escapes into an exit\n * code. Keeping that here means the exit-code contract (0 ok, 1 findings, 2\n * operational/usage) is written once, and the stderr prefix follows the bin\n * that was actually run.\n */\nimport { realpathSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { CommanderError, type Command } from \"commander\";\nimport { ToolError, errorMessage } from \"./errors.js\";\nimport { programName, setProgramName } from \"./program-name.js\";\n\n/**\n * Report an operational error on stderr and exit 2.\n *\n * Almost every message is one line. A few name a list the user has to fix in\n * one pass — every seed an `--exclude` pattern contradicts, say — and carry a\n * `\\n` between the lines. Each line gets the prefix, so a second line reads\n * like a message from the tool rather than like wrapped output.\n */\nexport function fail(err: unknown): never {\n const msg =\n err instanceof ToolError\n ? err.message\n : `Unexpected error: ${errorMessage(err)}`;\n const prefix = programName();\n // A trailing newline is the message's own, not a line of its own. Splitting\n // without dropping it would end the run on a bare `manni: `, which is what\n // an unexpected error carrying a library's newline-terminated message would\n // have printed.\n for (const line of msg.replace(/\\n+$/, \"\").split(\"\\n\")) {\n process.stderr.write(`${prefix}: ${line}\\n`);\n }\n process.exit(2);\n}\n\n/**\n * The marker a normalized stdin-with-lines argument carries in place of its\n * `-`. It is a NUL, which no path and no option can hold, and it never\n * reaches a message: a page read from stdin is labelled `<stdin>`.\n */\nexport const STDIN_LINES_MARKER = \"\\u0000\";\n\n/** `-:9`, `-:14-18`: stdin, and the lines of it a command was pointed at. */\nconst STDIN_WITH_LINES = /^-(:[1-9][0-9]*(?:-[1-9][0-9]*)?)$/;\n\n/**\n * Rewrite `-:L` so commander reads it as an operand.\n *\n * `-` is stdin in every command of the family, so `-:9` is stdin and a line\n * range, the form `cite add` takes its claim's lines in. Commander tells an\n * option from an operand lexically, by the leading `-`, and would reject the\n * token as an unknown option before any command saw it. The rewrite is here,\n * once, rather than in the one command that reads the form today: the rule\n * is about what `-` means to the family, not about that command.\n */\nexport function normalizeStdinArgv(argv: readonly string[]): string[] {\n return argv.map((arg) => {\n const lines = STDIN_WITH_LINES.exec(arg)?.[1];\n return lines === undefined ? arg : `${STDIN_LINES_MARKER}${lines}`;\n });\n}\n\nexport async function runProgram(\n program: Command,\n argv: string[] = process.argv,\n): Promise<void> {\n setProgramName(program.name());\n try {\n await program.parseAsync(normalizeStdinArgv(argv));\n } catch (err) {\n // `exitOverride()` makes commander throw on every terminating condition,\n // including the successful ones. Branch on `err.exitCode`, not on a list of\n // code strings: `--help` is `commander.helpDisplayed`, `-V` is\n // `commander.version`, and `help get` is a third code, `commander.help` —\n // all carrying exitCode 0, and a hand-written list would eventually miss\n // one and turn a success into a usage error.\n if (err instanceof CommanderError) {\n // Say nothing. `Command.error()` has already written the message and the\n // after-error hint; `fail()` would add \"Unexpected error: …\" on top,\n // because a CommanderError is not a ToolError.\n //\n // `process.exitCode`, not `process.exit()`: Node does not flush queued\n // async stderr writes on `process.exit`, which truncates the very message\n // the user needs.\n process.exitCode = err.exitCode === 0 ? 0 : 2;\n return;\n }\n throw err;\n }\n}\n\n/**\n * Whether `moduleUrl` is the file Node was asked to run.\n *\n * Pass the entry file's own `import.meta.url`. After bundling, shared code\n * lands in a chunk whose URL is never argv[1], so this cannot read\n * `import.meta.url` itself.\n */\nexport function isMainModule(moduleUrl: string): boolean {\n const entry = process.argv[1];\n if (!entry) return false;\n try {\n return realpathSync(entry) === fileURLToPath(moduleUrl);\n } catch {\n return false;\n }\n}\n\n/**\n * Treat a closed reader on stdout or stderr as the end of output.\n *\n * `manni cite check | head -1` closes the pipe while the command is still\n * writing, and the next write fails with EPIPE. Node emits that as an `error`\n * event on the stream, and with no listener it is thrown as an uncaught\n * exception: a stack trace and exit 1 from a command that did nothing wrong.\n *\n * The listener swallows EPIPE and nothing else, so any other stream error\n * still surfaces the way it did. The command then runs to completion and exits\n * with its own code rather than a fixed 0: `set -o pipefail; manni meta\n * validate | head` must still fail when validation does. Writes after the\n * pipe closed go nowhere, which is what the reader asked for.\n */\nexport function endOutputOnClosedReader(\n streams: readonly NodeJS.EventEmitter[] = [process.stdout, process.stderr],\n): void {\n for (const stream of streams) {\n stream.on(\"error\", (err: NodeJS.ErrnoException) => {\n if (err.code === \"EPIPE\") return;\n throw err;\n });\n }\n}\n\n/** Run `build()` as a bin when `moduleUrl` is the entry, and not when imported. */\nexport function runIfMain(\n moduleUrl: string,\n build: () => Command | Promise<Command>,\n): void {\n if (!isMainModule(moduleUrl)) return;\n endO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AAO,GAAG,SAAS,CAAC,QAA+B;AACjD,UAAI,IAAI,SAAS,QAAS;AAC1B,YAAM;AAAA,IACR,CAAC;AAAA,EACH;AACF;AAGO,SAAS,UACd,WACA,OACM;AACN,MAAI,CAAC,aAAa,SAAS,EAAG;AAC9B,0BAAwB;AACxB,UAAQ,QAAQ,MAAM,CAAC,EAAE,KAAK,UAAU,EAAE,MAAM,IAAI;AACtD;","names":[]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
discoverArtifacts
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XYLUCIKQ.js";
|
|
5
|
+
import {
|
|
6
|
+
parseHookPayload,
|
|
7
|
+
readStdin
|
|
8
|
+
} from "./chunk-TZOYZK2E.js";
|
|
5
9
|
import {
|
|
6
10
|
MANIFEST_VERSION,
|
|
7
11
|
hashFile,
|
|
@@ -11,10 +15,10 @@ import {
|
|
|
11
15
|
relPosix,
|
|
12
16
|
sha256Hex,
|
|
13
17
|
writeManifest
|
|
14
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-7QMCHA4N.js";
|
|
15
19
|
import {
|
|
16
20
|
TracevalsError
|
|
17
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-UKZNLVJW.js";
|
|
18
22
|
|
|
19
23
|
// src/tracevals/commands/capture.ts
|
|
20
24
|
import { resolve as resolve2 } from "node:path";
|
|
@@ -133,94 +137,6 @@ function git(args, cwd, timeoutMs = 5e3) {
|
|
|
133
137
|
});
|
|
134
138
|
}
|
|
135
139
|
|
|
136
|
-
// src/tracevals/capture/hook.ts
|
|
137
|
-
var REASON_KEYS = ["how", "why", "source", "reason"];
|
|
138
|
-
function str(record, key) {
|
|
139
|
-
const value = record[key];
|
|
140
|
-
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
141
|
-
}
|
|
142
|
-
function parseHookPayload(raw) {
|
|
143
|
-
let parsed;
|
|
144
|
-
try {
|
|
145
|
-
parsed = JSON.parse(raw);
|
|
146
|
-
} catch (err) {
|
|
147
|
-
throw new TracevalsError(
|
|
148
|
-
`hook payload is not JSON: ${err instanceof Error ? err.message : String(err)}`
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
152
|
-
throw new TracevalsError(
|
|
153
|
-
"hook payload must be a JSON object; Claude Code writes one object on stdin"
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
const record = parsed;
|
|
157
|
-
let reason;
|
|
158
|
-
for (const key of REASON_KEYS) {
|
|
159
|
-
reason = str(record, key);
|
|
160
|
-
if (reason !== void 0) break;
|
|
161
|
-
}
|
|
162
|
-
return {
|
|
163
|
-
...str(record, "session_id") !== void 0 ? { sessionId: str(record, "session_id") } : {},
|
|
164
|
-
...str(record, "transcript_path") !== void 0 ? { transcriptPath: str(record, "transcript_path") } : {},
|
|
165
|
-
...str(record, "cwd") !== void 0 ? { cwd: str(record, "cwd") } : {},
|
|
166
|
-
...str(record, "hook_event_name") !== void 0 ? { hookEvent: str(record, "hook_event_name") } : {},
|
|
167
|
-
...reason !== void 0 ? { reason } : {}
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
function readStdin(stream = process.stdin, options = {}) {
|
|
171
|
-
const maxBytes = options.maxBytes ?? 1e6;
|
|
172
|
-
const timeoutMs = options.timeoutMs ?? 1500;
|
|
173
|
-
if (stream.isTTY) return Promise.resolve("");
|
|
174
|
-
return new Promise((settle, fail) => {
|
|
175
|
-
const chunks = [];
|
|
176
|
-
let total = 0;
|
|
177
|
-
let done = false;
|
|
178
|
-
const stop = () => {
|
|
179
|
-
clearTimeout(timer);
|
|
180
|
-
stream.off("data", onData);
|
|
181
|
-
stream.off("end", onEnd);
|
|
182
|
-
stream.off("error", onError);
|
|
183
|
-
stream.pause();
|
|
184
|
-
};
|
|
185
|
-
const finish = () => {
|
|
186
|
-
if (done) return;
|
|
187
|
-
done = true;
|
|
188
|
-
stop();
|
|
189
|
-
settle(Buffer.concat(chunks).toString("utf-8"));
|
|
190
|
-
};
|
|
191
|
-
const abort = (err) => {
|
|
192
|
-
if (done) return;
|
|
193
|
-
done = true;
|
|
194
|
-
stop();
|
|
195
|
-
fail(err);
|
|
196
|
-
};
|
|
197
|
-
const onData = (chunk) => {
|
|
198
|
-
const buf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
199
|
-
total += buf.length;
|
|
200
|
-
if (total > maxBytes) {
|
|
201
|
-
abort(
|
|
202
|
-
new TracevalsError(
|
|
203
|
-
`hook payload exceeded ${maxBytes} bytes; this is not a Claude Code hook envelope`
|
|
204
|
-
)
|
|
205
|
-
);
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
chunks.push(buf);
|
|
209
|
-
};
|
|
210
|
-
const onEnd = () => {
|
|
211
|
-
finish();
|
|
212
|
-
};
|
|
213
|
-
const onError = () => {
|
|
214
|
-
finish();
|
|
215
|
-
};
|
|
216
|
-
const timer = setTimeout(finish, timeoutMs);
|
|
217
|
-
stream.on("data", onData);
|
|
218
|
-
stream.on("end", onEnd);
|
|
219
|
-
stream.on("error", onError);
|
|
220
|
-
stream.resume();
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
|
|
224
140
|
// src/tracevals/commands/capture.ts
|
|
225
141
|
async function runCapture(options = {}) {
|
|
226
142
|
const raw = options.stdin ?? await readStdin();
|
|
@@ -289,9 +205,7 @@ export {
|
|
|
289
205
|
deviceId,
|
|
290
206
|
redactDeep,
|
|
291
207
|
readGit,
|
|
292
|
-
parseHookPayload,
|
|
293
|
-
readStdin,
|
|
294
208
|
runCapture,
|
|
295
209
|
renderCapture
|
|
296
210
|
};
|
|
297
|
-
//# sourceMappingURL=chunk-
|
|
211
|
+
//# sourceMappingURL=chunk-YFQBFNQS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tracevals/commands/capture.ts","../src/tracevals/capture/build.ts"],"sourcesContent":["/**\n * `manni tracevals capture` — record what the project's instruction artifacts\n * said, and at which commit, at the moment a session started (ADR 01024).\n *\n * **This is the one write path `run` never takes.** CLAUDE.md states that\n * evaluation is read-only, so the manifest is written by a separate,\n * explicitly-invoked command — the same shape as `fill`. `run` only ever reads\n * a manifest, and degrades cleanly when there is none.\n *\n * Designed to be wired to a `SessionStart` hook, which constrains it in two\n * ways that are not obvious:\n *\n * - **Nothing goes to stdout in hook mode.** Claude Code adds a\n * SessionStart hook's stdout to the model's context, so a report printed\n * there would be a side effect on the very session being observed. In hook\n * mode the report goes to stderr, where an exit-0 hook's output is a debug\n * line and nothing more.\n * - **The transcript is never read.** `transcript_path` is recorded as a\n * correlation key only. At SessionStart the file barely exists, and the\n * reference warns that it lags the conversation in any case.\n */\nimport { resolve } from \"node:path\";\nimport { loadConfig } from \"../core/config.js\";\nimport { buildManifest } from \"../capture/build.js\";\nimport { manifestPathFor, writeManifest } from \"../capture/manifest.js\";\nimport type { SessionManifest } from \"../capture/types.js\";\nimport { parseHookPayload, readStdin } from \"../capture/hook.js\";\nimport type { SummaryFormat } from \"../reporters/index.js\";\nimport { TracevalsError } from \"../types.js\";\n\nexport interface CaptureCommandOptions {\n /**\n * The hook payload. Undefined means \"read stdin\"; an empty string means\n * \"there was none\", which is the hand-run path.\n */\n stdin?: string;\n /** Overrides the payload's `cwd` as the project root to scan. */\n project?: string;\n /** Overrides the payload's `session_id`. */\n sessionId?: string;\n /** Write here instead of `<project>/<capture.dir>/<session-id>.json`. */\n out?: string;\n /** Directory holding manni.config.yaml; defaults to the project root. */\n configDir?: string;\n /** `-c/--config`: read this file instead of discovering one. */\n config?: string;\n /** `--no-config`: skip discovery and run on the built-in defaults. */\n noConfig?: boolean;\n format?: SummaryFormat;\n /**\n * Version recorded in the manifest. Passed in rather than read from\n * package.json here: this module is bundled into an unpredictable chunk\n * path, so any relative require of it resolves differently in dist than in\n * src. The CLI, which is not bundled away, supplies it.\n */\n version?: string;\n}\n\nexport interface CaptureCommandResult {\n manifest: SessionManifest;\n /** Where the manifest was written. */\n path: string;\n /** The report, wherever it is destined for. */\n rendered: string;\n /** What the caller should print to stdout — empty in hook mode. */\n stdout: string;\n /** What the caller should print to stderr — the report, in hook mode. */\n stderr: string;\n exitCode: number;\n}\n\nexport async function runCapture(\n options: CaptureCommandOptions = {},\n): Promise<CaptureCommandResult> {\n const raw = options.stdin ?? (await readStdin());\n const hookMode = raw.trim().length > 0;\n const payload = hookMode ? parseHookPayload(raw) : {};\n\n const sessionId = options.sessionId ?? payload.sessionId;\n if (sessionId === undefined) {\n // Without an id the manifest has no name and no join key, and writing one\n // under a guessed name would produce evidence nothing could ever find.\n throw new TracevalsError(\n \"no session id: pipe a Claude Code hook payload on stdin, or pass --session-id\",\n );\n }\n\n const root = resolve(options.project ?? payload.cwd ?? process.cwd());\n const config = await loadConfig(options.configDir ?? root, {\n ...(options.config === undefined ? {} : { configPath: options.config }),\n ...(options.noConfig === undefined ? {} : { noConfig: options.noConfig }),\n });\n\n const manifest = await buildManifest({\n sessionId,\n root,\n hookEvent: payload.hookEvent ?? \"manual\",\n ...(payload.reason !== undefined ? { reason: payload.reason } : {}),\n ...(payload.transcriptPath !== undefined\n ? { transcriptPath: payload.transcriptPath }\n : {}),\n config,\n redact: config.judge.redact,\n ...(options.version !== undefined ? { version: options.version } : {}),\n });\n\n const path =\n options.out ??\n manifestPathFor(resolve(root, config.capture.dir), sessionId);\n try {\n await writeManifest(path, manifest);\n } catch (err) {\n throw new TracevalsError(\n `could not write ${path}: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n\n const rendered =\n options.format === \"json\"\n ? JSON.stringify({ path, manifest }, null, 2)\n : renderCapture(path, manifest);\n\n return {\n manifest,\n path,\n rendered,\n // The whole point of the split: a SessionStart hook's stdout becomes model\n // context, so hook mode writes none.\n stdout: hookMode ? \"\" : rendered,\n stderr: hookMode ? rendered : \"\",\n exitCode: 0,\n };\n}\n\nexport function renderCapture(\n path: string,\n manifest: SessionManifest,\n): string {\n const lines = [\n `Captured session ${manifest.sessionId}`,\n ` manifest ${path}`,\n ` artifacts ${manifest.artifacts.length} hashed`,\n ];\n if (manifest.git !== undefined) {\n lines.push(\n ` commit ${manifest.git.sha}${manifest.git.branch ? ` (${manifest.git.branch})` : \"\"}${\n manifest.git.dirty ? \" — working tree dirty\" : \"\"\n }`,\n );\n } else {\n lines.push(\" commit not a git repository, or git is unavailable\");\n }\n lines.push(` device ${manifest.device.id} (${manifest.device.platform})`);\n return lines.join(\"\\n\");\n}\n","/**\n * Building a session manifest (ADR 01024) — the producing half.\n *\n * Separate from `capture/manifest.ts` because this side reaches for\n * `discoverArtifacts`, which imports `artifacts/resolve.ts`, which consumes a\n * manifest. Producing and consuming therefore cannot share a module.\n */\nimport { spawn } from \"node:child_process\";\nimport { hostname, platform, userInfo } from \"node:os\";\nimport { resolve } from \"node:path\";\nimport { discoverArtifacts } from \"../artifacts/discover.js\";\nimport { makeRedactor, type Redactor } from \"../judge/redact.js\";\nimport { hashFile, relPosix, sha256Hex } from \"./manifest.js\";\nimport {\n MANIFEST_VERSION,\n type ManifestArtifact,\n type ManifestGit,\n type SessionManifest,\n} from \"./types.js\";\n\nexport interface BuildManifestOptions {\n sessionId: string;\n /** Project root to scan, and the base every artifact path is relative to. */\n root: string;\n hookEvent?: string;\n reason?: string;\n transcriptPath?: string;\n /** The resolved config section, recorded as provenance. */\n config?: unknown;\n /** `judge.redact` sources, applied to the manifest's free text (ADR 01020). */\n redact?: readonly string[];\n version?: string;\n /** Test seam: `false` skips shelling out to git. */\n git?: ManifestGit | false;\n}\n\n/**\n * Hash every instruction artifact the project holds, at the commit it holds\n * them at.\n *\n * The population is `discoverArtifacts`' — the same one `fill` authors against\n * — so capture and authoring never disagree about what an instruction artifact\n * is. That scope is **project-only** by its own design note, so a user-level or\n * plugin artifact is simply absent from the manifest, and its hash check at run\n * time degrades to the mtime heuristic rather than to a wrong answer.\n *\n * **Redaction covers the free text and never a join key.** `root`,\n * `transcriptPath`, `git.branch`, `reason` and the recorded `config` go through\n * the `judge.redact` redactor; `sessionId`, an artifact's `name` and `path`,\n * and every `sha256` do not. A redactor applied to a join key would turn an\n * exact check into a silent `skipped` — the one failure mode this whole feature\n * exists to remove — and those keys are the project's own vocabulary and its\n * repository-relative paths, not somewhere a credential lives. A secret in an\n * artifact path is a problem to fix in the path, the same call ADR 01020 makes\n * about a secret in a `SKILL.md`.\n */\nexport async function buildManifest(\n options: BuildManifestOptions,\n): Promise<SessionManifest> {\n const root = resolve(options.root);\n const redact = makeRedactor(options.redact ?? []);\n\n const discovered = await discoverArtifacts({ root });\n const artifacts: ManifestArtifact[] = [];\n for (const found of discovered.artifacts) {\n const rel = relPosix(root, found.artifact.path);\n if (rel === null) continue;\n const digest = await hashFile(found.artifact.path);\n // An artifact that cannot be read is one the manifest says nothing about,\n // which degrades to the mtime heuristic at run time. Never a crash.\n if (digest === null) continue;\n artifacts.push({\n name: found.artifact.name,\n type: found.artifact.type,\n path: rel,\n sha256: digest,\n bytes: Buffer.byteLength(found.artifact.content, \"utf-8\"),\n });\n }\n // Stable order, so two captures of an unchanged tree produce the same bytes.\n artifacts.sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));\n\n const git =\n options.git === false ? undefined : (options.git ?? (await readGit(root)));\n\n return {\n version: MANIFEST_VERSION,\n sessionId: options.sessionId,\n capturedAt: new Date().toISOString(),\n hookEvent: options.hookEvent ?? \"manual\",\n ...(options.reason !== undefined ? { reason: redact(options.reason) } : {}),\n ...(options.transcriptPath !== undefined\n ? { transcriptPath: redact(options.transcriptPath) }\n : {}),\n root: redact(root),\n ...(git !== undefined\n ? {\n git: {\n sha: git.sha,\n ...(git.branch !== undefined ? { branch: redact(git.branch) } : {}),\n dirty: git.dirty,\n },\n }\n : {}),\n device: { id: deviceId(), platform: platform() },\n tool: { name: \"manni-tracevals\", version: options.version ?? \"unknown\" },\n artifacts,\n config: redactDeep(options.config ?? {}, redact),\n };\n}\n\n/**\n * A stable, opaque per-machine id. Not the hostname: \"was this captured here?\"\n * is the whole question, and answering it does not require shipping the name of\n * the machine into a file that travels with the repository.\n */\nexport function deviceId(): string {\n let user = \"\";\n try {\n user = userInfo().username;\n } catch {\n // A container with no passwd entry throws; the digest is still stable.\n }\n return sha256Hex(`${hostname()} ${user} ${platform()}`).slice(0, 16);\n}\n\n/**\n * Redact every string in a JSON-shaped value. Used for the recorded config\n * only — never for a join key.\n */\nexport function redactDeep(value: unknown, redact: Redactor): unknown {\n if (typeof value === \"string\") return redact(value);\n if (Array.isArray(value)) return value.map((v) => redactDeep(v, redact));\n if (value !== null && typeof value === \"object\") {\n const out: Record<string, unknown> = {};\n for (const [key, member] of Object.entries(value)) {\n out[key] = redactDeep(member, redact);\n }\n return out;\n }\n return value;\n}\n\n/**\n * What `git` says about `root`, or nothing. Every failure mode — git absent,\n * not a repository, a timeout — degrades to an absent block, because a manifest\n * without a SHA is still a manifest with hashes in it.\n */\nexport async function readGit(root: string): Promise<ManifestGit | undefined> {\n const sha = await git([\"rev-parse\", \"HEAD\"], root);\n if (sha === null || !/^[0-9a-f]{40}$/.test(sha)) return undefined;\n const branch = await git([\"rev-parse\", \"--abbrev-ref\", \"HEAD\"], root);\n const status = await git(\n [\"status\", \"--porcelain\", \"--untracked-files=no\"],\n root,\n );\n return {\n sha,\n // Detached HEAD reports the literal \"HEAD\", which is not a branch name.\n ...(branch !== null && branch !== \"HEAD\" ? { branch } : {}),\n dirty: status !== null && status.length > 0,\n };\n}\n\n/** One `git` invocation, argv-only and bounded — the shape ADR 01011 uses. */\nfunction git(\n args: string[],\n cwd: string,\n timeoutMs = 5000,\n): Promise<string | null> {\n return new Promise((settle) => {\n let done = false;\n let child;\n try {\n // shell:false — nothing here is ever parsed as shell syntax.\n child = spawn(\"git\", args, { cwd, shell: false, windowsHide: true });\n } catch {\n settle(null);\n return;\n }\n // `finish` is declared below the timer because it clears it; the timer\n // callback only runs after both exist.\n const timer = setTimeout(() => {\n child.kill();\n finish(null);\n }, timeoutMs);\n const finish = (value: string | null): void => {\n if (done) return;\n done = true;\n clearTimeout(timer);\n settle(value);\n };\n let out = \"\";\n child.stdout.on(\"data\", (d: Buffer) => {\n out += d.toString(\"utf-8\");\n });\n child.stderr.resume();\n child.on(\"error\", () => { finish(null); });\n child.on(\"close\", (code) => { finish(code === 0 ? out.trim() : null); });\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,WAAAA,gBAAe;;;ACdxB,SAAS,aAAa;AACtB,SAAS,UAAU,UAAU,gBAAgB;AAC7C,SAAS,eAAe;AA+CxB,eAAsB,cACpB,SAC0B;AAC1B,QAAM,OAAO,QAAQ,QAAQ,IAAI;AACjC,QAAM,SAAS,aAAa,QAAQ,UAAU,CAAC,CAAC;AAEhD,QAAM,aAAa,MAAM,kBAAkB,EAAE,KAAK,CAAC;AACnD,QAAM,YAAgC,CAAC;AACvC,aAAW,SAAS,WAAW,WAAW;AACxC,UAAM,MAAM,SAAS,MAAM,MAAM,SAAS,IAAI;AAC9C,QAAI,QAAQ,KAAM;AAClB,UAAM,SAAS,MAAM,SAAS,MAAM,SAAS,IAAI;AAGjD,QAAI,WAAW,KAAM;AACrB,cAAU,KAAK;AAAA,MACb,MAAM,MAAM,SAAS;AAAA,MACrB,MAAM,MAAM,SAAS;AAAA,MACrB,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,OAAO,OAAO,WAAW,MAAM,SAAS,SAAS,OAAO;AAAA,IAC1D,CAAC;AAAA,EACH;AAEA,YAAU,KAAK,CAAC,GAAG,MAAO,EAAE,OAAO,EAAE,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,IAAI,CAAE;AAEzE,QAAMC,OACJ,QAAQ,QAAQ,QAAQ,SAAa,QAAQ,OAAQ,MAAM,QAAQ,IAAI;AAEzE,SAAO;AAAA,IACL,SAAS;AAAA,IACT,WAAW,QAAQ;AAAA,IACnB,aAAY,oBAAI,KAAK,GAA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