@hawkeyexl/manni 4.2.0 → 4.3.1

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.
Files changed (43) hide show
  1. package/README.md +2 -2
  2. package/dist/batch-A5HZKYIW.js +18 -0
  3. package/dist/batch-A5HZKYIW.js.map +1 -0
  4. package/dist/calibrate-S5K6QHUY.js +13 -0
  5. package/dist/calibrate-S5K6QHUY.js.map +1 -0
  6. package/dist/capture-OZEZDABQ.js +15 -0
  7. package/dist/capture-OZEZDABQ.js.map +1 -0
  8. package/dist/chunk-3R23C5DT.js +120 -0
  9. package/dist/chunk-3R23C5DT.js.map +1 -0
  10. package/dist/chunk-5HNHEUD5.js +174 -0
  11. package/dist/chunk-5HNHEUD5.js.map +1 -0
  12. package/dist/chunk-CFDUZRM2.js +1941 -0
  13. package/dist/chunk-CFDUZRM2.js.map +1 -0
  14. package/dist/chunk-G5CM2VGQ.js +297 -0
  15. package/dist/chunk-G5CM2VGQ.js.map +1 -0
  16. package/dist/chunk-HAPTXWU2.js +379 -0
  17. package/dist/chunk-HAPTXWU2.js.map +1 -0
  18. package/dist/chunk-IOYXPBCL.js +37 -0
  19. package/dist/chunk-IOYXPBCL.js.map +1 -0
  20. package/dist/chunk-KJR7OVDX.js +4447 -0
  21. package/dist/chunk-KJR7OVDX.js.map +1 -0
  22. package/dist/chunk-KTSJ2ZHA.js +40 -0
  23. package/dist/chunk-KTSJ2ZHA.js.map +1 -0
  24. package/dist/{chunk-BNHQWIAE.js → chunk-UBMMXS2Y.js} +2 -2
  25. package/dist/{chunk-UYDRDFYF.js → chunk-V4KUVE47.js} +1943 -909
  26. package/dist/chunk-V4KUVE47.js.map +1 -0
  27. package/dist/{chunk-TH565O2N.js → chunk-ZQBTK3DO.js} +898 -278
  28. package/dist/chunk-ZQBTK3DO.js.map +1 -0
  29. package/dist/cli.js +437 -47
  30. package/dist/cli.js.map +1 -1
  31. package/dist/docmeta.js +3 -2
  32. package/dist/docmeta.js.map +1 -1
  33. package/dist/index.d.ts +3873 -795
  34. package/dist/index.js +292 -4
  35. package/dist/index.js.map +1 -1
  36. package/dist/picker-6HRMETE7.js +12 -0
  37. package/dist/picker-6HRMETE7.js.map +1 -0
  38. package/package.json +3 -1
  39. package/plugin/tracevals/.claude-plugin/plugin.json +9 -0
  40. package/plugin/tracevals/hooks/hooks.json +17 -0
  41. package/dist/chunk-TH565O2N.js.map +0 -1
  42. package/dist/chunk-UYDRDFYF.js.map +0 -1
  43. /package/dist/{chunk-BNHQWIAE.js.map → chunk-UBMMXS2Y.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  buildProgram
4
- } from "./chunk-BNHQWIAE.js";
4
+ } from "./chunk-UBMMXS2Y.js";
5
5
  import {
6
6
  ALL_FILL_FIELDS,
7
7
  CONFIG_SECTION,
@@ -9,7 +9,6 @@ import {
9
9
  DEFAULT_CONFIG_FILENAME2 as DEFAULT_CONFIG_FILENAME,
10
10
  DEFAULT_EXTENSIONS,
11
11
  DocevalsError,
12
- EXECUTION_GRANTS,
13
12
  EXPORT_TARGETS,
14
13
  GraphError,
15
14
  INFER_FORMATS,
@@ -52,6 +51,7 @@ import {
52
51
  renderFill,
53
52
  renderFill2,
54
53
  renderList,
54
+ renderList2,
55
55
  renderQuery,
56
56
  renderRemoveJson,
57
57
  renderRemovePretty,
@@ -72,12 +72,14 @@ import {
72
72
  runExport,
73
73
  runFill,
74
74
  runFill2,
75
+ runFill3,
75
76
  runGenerate,
76
77
  runInit,
77
78
  runKeyRotate,
78
79
  runKeySet,
79
80
  runLint,
80
81
  runList,
82
+ runList2,
81
83
  runPromote,
82
84
  runQuery,
83
85
  runRemove,
@@ -97,7 +99,19 @@ import {
97
99
  shortSrc,
98
100
  spellSource,
99
101
  validateGraph
100
- } from "./chunk-UYDRDFYF.js";
102
+ } from "./chunk-V4KUVE47.js";
103
+ import {
104
+ CALIBRATE_FORMATS,
105
+ REPORT_FORMATS as REPORT_FORMATS3,
106
+ SUMMARY_FORMATS as SUMMARY_FORMATS2,
107
+ parseFormat as parseFormat2,
108
+ runRun as runRun2
109
+ } from "./chunk-KJR7OVDX.js";
110
+ import "./chunk-5HNHEUD5.js";
111
+ import {
112
+ allowExecutionMessage,
113
+ isExecutionGrant
114
+ } from "./chunk-CFDUZRM2.js";
101
115
  import {
102
116
  COMMON_FORMAT_LIST,
103
117
  CONCEPT_FIELDS,
@@ -109,11 +123,10 @@ import {
109
123
  STDIN_LABEL,
110
124
  STDIN_TOKEN,
111
125
  TERM_RELATION_FIELDS,
112
- ToolError,
113
126
  assertNonEmpty,
114
127
  collect,
128
+ colorFor,
115
129
  configOption,
116
- errorMessage,
117
130
  escapeWorkflowCommandMessage,
118
131
  escapeWorkflowCommandProperty,
119
132
  explicitFalse,
@@ -151,10 +164,17 @@ import {
151
164
  valueAt,
152
165
  warn,
153
166
  writeTextAtomic
154
- } from "./chunk-TH565O2N.js";
167
+ } from "./chunk-ZQBTK3DO.js";
168
+ import {
169
+ TracevalsError
170
+ } from "./chunk-3R23C5DT.js";
171
+ import {
172
+ ToolError,
173
+ errorMessage
174
+ } from "./chunk-IOYXPBCL.js";
155
175
 
156
176
  // src/cli.ts
157
- import { Command as Command8 } from "commander";
177
+ import { Command as Command9 } from "commander";
158
178
 
159
179
  // src/a11y/cli.ts
160
180
  import { Command } from "commander";
@@ -601,12 +621,15 @@ function finishPage(page, floor) {
601
621
  const score = applicable === 0 ? null : Math.round(100 * page.passes / applicable);
602
622
  return { ...page, violations, score };
603
623
  }
624
+ function fails(page) {
625
+ return page.error !== void 0 || page.violations.length > 0;
626
+ }
604
627
  function summarize(results, { discovered, skipped: skipped2, duplicates, redirects, excluded }, sitemap, crawl2) {
605
628
  const bySeverity = { notice: 0, warning: 0, error: 0 };
606
629
  let failed = 0;
607
630
  let violations = 0;
608
631
  for (const page of results) {
609
- if (page.error !== void 0 || page.violations.length > 0) failed += 1;
632
+ if (fails(page)) failed += 1;
610
633
  for (const violation of page.violations) {
611
634
  violations += 1;
612
635
  bySeverity[violation.severity] += 1;
@@ -632,7 +655,9 @@ function summarize(results, { discovered, skipped: skipped2, duplicates, redirec
632
655
 
633
656
  // src/a11y/core/analyzer.ts
634
657
  import { AxeBuilder } from "@axe-core/playwright";
635
- import { chromium } from "playwright-core";
658
+ import {
659
+ chromium
660
+ } from "playwright-core";
636
661
  var NO_BROWSER_MESSAGE = "No browser found. Install one with `npx playwright install chromium`, or install Google Chrome or Microsoft Edge.";
637
662
  var CHANNELS = ["chrome", "msedge", "chromium"];
638
663
  function launch(channel) {
@@ -649,19 +674,23 @@ async function launchAny() {
649
674
  }
650
675
  function createPlaywrightAnalyzer() {
651
676
  let session = null;
677
+ let current = null;
652
678
  const open = () => {
653
679
  session ??= (async () => {
654
680
  const found = await launchAny();
655
681
  if (found === null) throw new A11yError(NO_BROWSER_MESSAGE);
656
682
  const context = await found.browser.newContext();
657
- const page = await context.newPage();
658
- return { browser: found.browser, page };
683
+ return { browser: found.browser, context };
659
684
  })();
660
685
  return session;
661
686
  };
662
687
  return {
663
688
  async analyze(url, opts) {
664
- const { page } = await open();
689
+ const { context } = await open();
690
+ const page = await context.newPage();
691
+ const previous = current;
692
+ current = page;
693
+ await previous?.close().catch(() => void 0);
665
694
  const navigations = [];
666
695
  const onRequest = (request) => {
667
696
  if (request.isNavigationRequest() && request.frame() === page.mainFrame() && request.redirectedFrom() === null) {
@@ -679,6 +708,7 @@ function createPlaywrightAnalyzer() {
679
708
  if (session === null) return;
680
709
  const pending = session;
681
710
  session = null;
711
+ current = null;
682
712
  try {
683
713
  const { browser } = await pending;
684
714
  await browser.close();
@@ -1375,7 +1405,7 @@ function renderCheckJunit(run) {
1375
1405
  // src/cite/cli.ts
1376
1406
  var UPDATE_FORMATS = ["pretty", "json"];
1377
1407
  var REMOVE_FORMATS = UPDATE_FORMATS;
1378
- function colorFor(command, isTTY, env) {
1408
+ function colorFor2(command, isTTY, env) {
1379
1409
  const noColor = colorOwner(command).opts().color === false;
1380
1410
  return shouldColor({ noColor, isTTY, env });
1381
1411
  }
@@ -1502,7 +1532,7 @@ function buildProgram3() {
1502
1532
  switch (format) {
1503
1533
  case "pretty":
1504
1534
  text2 = renderCheckPretty(run, {
1505
- color: colorFor(command, process.stdout.isTTY),
1535
+ color: colorFor2(command, process.stdout.isTTY),
1506
1536
  quiet: Boolean(options.quiet),
1507
1537
  showDiff: Boolean(options.showDiff),
1508
1538
  reveal: Boolean(options.reveal)
@@ -1666,7 +1696,7 @@ function buildProgram3() {
1666
1696
  dryRun
1667
1697
  });
1668
1698
  const text2 = format === "json" ? renderUpdateJson(run) : renderUpdatePretty(run, {
1669
- color: colorFor(command, process.stdout.isTTY),
1699
+ color: colorFor2(command, process.stdout.isTTY),
1670
1700
  // The diffs are the point of a dry run; a real run prints
1671
1701
  // what it rewrote and leaves the file to say the rest.
1672
1702
  showDiff: dryRun
@@ -1741,7 +1771,7 @@ function buildProgram3() {
1741
1771
  dryRun
1742
1772
  });
1743
1773
  const text2 = format === "json" ? renderRemoveJson(run) : renderRemovePretty(run, {
1744
- color: colorFor(command, process.stdout.isTTY),
1774
+ color: colorFor2(command, process.stdout.isTTY),
1745
1775
  // The diffs are the point of a dry run; a real run prints
1746
1776
  // what it removed and leaves the file to say the rest.
1747
1777
  showDiff: dryRun,
@@ -1766,28 +1796,14 @@ function buildProgram3() {
1766
1796
 
1767
1797
  // src/docevals/cli.ts
1768
1798
  import { Command as Command3 } from "commander";
1769
- function colorFor2(command, isTTY, env) {
1770
- const noColor = colorOwner2(command).opts().color === false;
1771
- return shouldColor({ noColor, isTTY, env });
1772
- }
1773
- function colorOwner2(command) {
1774
- for (let c = command; c !== null; c = c.parent) {
1775
- if (c.options.some((o) => o.long === "--no-color")) return c;
1776
- }
1777
- return command;
1778
- }
1779
1799
  function buildProgram4() {
1780
1800
  const program = new Command3();
1781
1801
  program.name("docevals").description(
1782
1802
  "Deterministic and LLM-as-judge evals for documentation pages, driven by frontmatter."
1783
1803
  ).version(package_default.version).option("--no-color", "disable colored output").showHelpAfterError("(add --help for usage)").exitOverride();
1784
1804
  function collectGrant(value, previous) {
1785
- if (!EXECUTION_GRANTS.includes(value)) {
1786
- fail(
1787
- new DocevalsError(
1788
- `--allow-execution must be one of ${EXECUTION_GRANTS.join(" | ")}, got "${value}"`
1789
- )
1790
- );
1805
+ if (!isExecutionGrant(value)) {
1806
+ fail(new DocevalsError(allowExecutionMessage(value)));
1791
1807
  }
1792
1808
  return [...previous, value];
1793
1809
  }
@@ -1860,7 +1876,7 @@ function buildProgram4() {
1860
1876
  });
1861
1877
  console.log(
1862
1878
  renderList(run, opts.format, {
1863
- color: colorFor2(command, process.stdout.isTTY)
1879
+ color: colorFor(command, process.stdout.isTTY)
1864
1880
  })
1865
1881
  );
1866
1882
  process.exitCode = run.exitCode;
@@ -1883,7 +1899,7 @@ function buildProgram4() {
1883
1899
  // frontmatter-commands docs/**` would silently swallow the glob and run
1884
1900
  // over the default file set instead. Repeat the flag to grant twice.
1885
1901
  "--allow-execution <kind>",
1886
- "Grant content-authored execution: frontmatter-commands",
1902
+ "Run only these execution grants (repeatable): frontmatter-commands",
1887
1903
  collectGrant,
1888
1904
  []
1889
1905
  ).option("--no-execution", "Clear every execution grant for this run").option("--no-generate", "Do not generate scripts for command evals missing a command").option("--no-cache", "Bypass the judge response cache").option("--fail-on-review", "Exit 1 when any eval lands in the human-review zone").option("--provider <name>", "Judge provider: auto (default) | anthropic | openai | claude-cli | llama-cpp").option("--model <model>", "Model override; needs a named provider, from here or config").option("--local", LOCAL_FLAG_HELP).option("--runs <n>", "Ensemble runs per eval", parseIntArg("--runs")).option(
@@ -1898,6 +1914,9 @@ function buildProgram4() {
1898
1914
  ).option("--suite <name>", "Run only evals in this suite").option(
1899
1915
  "--since <ref>",
1900
1916
  "Evaluate only pages whose file or eval manifest changed between this git ref and HEAD"
1917
+ ).option(
1918
+ "--newer-than <duration>",
1919
+ "Evaluate only pages whose file or eval manifest changed within this window, such as 30m, 24h, 7d or 2w; in CI, prefer --since"
1901
1920
  ).option(
1902
1921
  "--max-turns <n>",
1903
1922
  "Stop after this many ensemble runs (a cached ensemble costs none)",
@@ -1921,7 +1940,9 @@ function buildProgram4() {
1921
1940
  format: opts.format,
1922
1941
  deterministicOnly: opts.deterministicOnly,
1923
1942
  aiOnly: opts.aiOnly,
1924
- allowExecution: opts.allowExecution,
1943
+ // Commander's default is `[]`, which is "no flag", not "run nothing":
1944
+ // only a list someone typed narrows the run.
1945
+ allowExecution: opts.allowExecution.length > 0 ? opts.allowExecution : void 0,
1925
1946
  execution: opts.execution,
1926
1947
  generate: opts.generate,
1927
1948
  cache: opts.cache,
@@ -1935,6 +1956,7 @@ function buildProgram4() {
1935
1956
  evalNames: opts.eval,
1936
1957
  suite: opts.suite,
1937
1958
  since: opts.since,
1959
+ newerThan: opts.newerThan,
1938
1960
  // commander collapses `--baseline` to true and `--no-baseline` to
1939
1961
  // false on the same key; a string is an explicit path.
1940
1962
  baseline: opts.baseline,
@@ -1943,7 +1965,7 @@ function buildProgram4() {
1943
1965
  });
1944
1966
  console.log(
1945
1967
  render(report, opts.format, {
1946
- color: colorFor2(command, process.stdout.isTTY)
1968
+ color: colorFor(command, process.stdout.isTTY)
1947
1969
  })
1948
1970
  );
1949
1971
  process.exitCode = report.exitCode;
@@ -1959,7 +1981,7 @@ function buildProgram4() {
1959
1981
  ).option("--provider <name>", "Provider: auto (default) | anthropic | openai | claude-cli | llama-cpp").option("--model <model>", "Model override; needs a named provider, from here or config").option("--local", LOCAL_FLAG_HELP).action(
1960
1982
  async (paths, opts, command) => {
1961
1983
  try {
1962
- const pc = palette(colorFor2(command, process.stdout.isTTY));
1984
+ const pc = palette(colorFor(command, process.stdout.isTTY));
1963
1985
  const result = await runGenerate(paths, {
1964
1986
  ...documentOptions(opts),
1965
1987
  provider: opts.provider,
@@ -2038,7 +2060,7 @@ function buildProgram4() {
2038
2060
  });
2039
2061
  console.log(
2040
2062
  renderFill(report, opts.format, {
2041
- color: colorFor2(command, process.stdout.isTTY)
2063
+ color: colorFor(command, process.stdout.isTTY)
2042
2064
  })
2043
2065
  );
2044
2066
  process.exitCode = report.exitCode;
@@ -2054,7 +2076,7 @@ function buildProgram4() {
2054
2076
  ).option("--write", "Apply promotions (write scripts and rewrite evals)").option("--provider <name>", "Provider: auto (default) | anthropic | openai | claude-cli | llama-cpp").option("--model <model>", "Model override; needs a named provider, from here or config").option("--local", LOCAL_FLAG_HELP).action(
2055
2077
  async (paths, opts, command) => {
2056
2078
  try {
2057
- const pc = palette(colorFor2(command, process.stdout.isTTY));
2079
+ const pc = palette(colorFor(command, process.stdout.isTTY));
2058
2080
  const proposals = await runPromote(paths, {
2059
2081
  ...documentOptions(opts),
2060
2082
  write: opts.write,
@@ -2093,7 +2115,7 @@ function buildProgram4() {
2093
2115
  ).option("--no-cache", "Bypass the judge response cache").action(
2094
2116
  async (opts, command) => {
2095
2117
  try {
2096
- const color = colorFor2(command, process.stdout.isTTY);
2118
+ const color = colorFor(command, process.stdout.isTTY);
2097
2119
  const pc = palette(color);
2098
2120
  if (opts.seed) {
2099
2121
  const seeded = seedGoldenCases({ golden: opts.golden });
@@ -2148,7 +2170,7 @@ function buildProgram4() {
2148
2170
  if (!file) {
2149
2171
  console.log(
2150
2172
  renderReviews(listReviews(), {
2151
- color: colorFor2(command, process.stdout.isTTY)
2173
+ color: colorFor(command, process.stdout.isTTY)
2152
2174
  })
2153
2175
  );
2154
2176
  return;
@@ -6508,7 +6530,7 @@ async function runLint2(opts) {
6508
6530
 
6509
6531
  // src/term/commands/list.ts
6510
6532
  var LIST_FORMATS2 = ["pretty", "json", "csv"];
6511
- async function runList2(opts) {
6533
+ async function runList3(opts) {
6512
6534
  const { set } = await loadTerms(opts);
6513
6535
  return { terms: set.terms, set };
6514
6536
  }
@@ -7135,7 +7157,7 @@ function buildProgram8() {
7135
7157
  ).action(async (paths, options) => {
7136
7158
  try {
7137
7159
  const format = formatChoice(options.format, LIST_FORMATS2);
7138
- const { terms } = await runList2(await coreOptions(paths, options));
7160
+ const { terms } = await runList3(await coreOptions(paths, options));
7139
7161
  print(format === "json" ? renderListJson(terms) : format === "csv" ? renderListCsv(terms) : renderListPretty(terms));
7140
7162
  process.exitCode = 0;
7141
7163
  } catch (err) {
@@ -7236,13 +7258,376 @@ function buildProgram8() {
7236
7258
  return program;
7237
7259
  }
7238
7260
 
7239
- // src/cli.ts
7261
+ // src/tracevals/cli.ts
7262
+ import { Command as Command8 } from "commander";
7263
+ var { version } = package_default;
7240
7264
  function buildProgram9() {
7265
+ const program = new Command8();
7266
+ program.name("tracevals").description(
7267
+ "Deterministic and LLM-as-judge adherence evals for AI agent session traces."
7268
+ ).version(version).option("--no-color", "disable colored output").showHelpAfterError("(add --help for usage)").exitOverride();
7269
+ function collectGrant(value, previous) {
7270
+ if (!isExecutionGrant(value)) fail(new TracevalsError(allowExecutionMessage(value)));
7271
+ return [...previous, value];
7272
+ }
7273
+ function addConfigFlags(cmd) {
7274
+ return cmd.option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file");
7275
+ }
7276
+ function configOptions(opts) {
7277
+ const { configPath, noConfig } = configOption(opts.config);
7278
+ return {
7279
+ ...configPath === void 0 ? {} : { config: configPath },
7280
+ ...noConfig === true ? { noConfig } : {}
7281
+ };
7282
+ }
7283
+ function parseFormatArg(name, allowed) {
7284
+ return (value) => {
7285
+ try {
7286
+ return parseFormat2(value, allowed, name);
7287
+ } catch (e) {
7288
+ fail(e);
7289
+ }
7290
+ };
7291
+ }
7292
+ const range = (min, max) => Number.isFinite(max) ? `between ${min} and ${max}` : `of at least ${min}`;
7293
+ function numeric(name, value, min, max = Number.POSITIVE_INFINITY) {
7294
+ if (value === void 0) return;
7295
+ if (Number.isFinite(value) && value >= min && value <= max) return;
7296
+ throw new TracevalsError(
7297
+ `${name} must be a number ${range(min, max)}, got ${value}`
7298
+ );
7299
+ }
7300
+ function whole(name, value, min, max = Number.POSITIVE_INFINITY) {
7301
+ if (value === void 0) return;
7302
+ if (Number.isInteger(value) && value >= min && value <= max) return;
7303
+ throw new TracevalsError(
7304
+ `${name} must be a whole number ${range(min, max)}, got ${value}`
7305
+ );
7306
+ }
7307
+ function sharedRunOptions(opts) {
7308
+ whole("--runs", opts.runs, 1);
7309
+ whole("--limit", opts.limit, 1);
7310
+ whole("--max-turns", opts.maxTurns, 1);
7311
+ return {
7312
+ ...configOptions(opts),
7313
+ project: opts.project,
7314
+ provider: opts.provider,
7315
+ model: opts.model,
7316
+ local: opts.local,
7317
+ // `undefined` rather than `false` when absent, so a future config
7318
+ // `offline:` still decides on a run where the flag was never typed.
7319
+ offline: opts.offline ? true : void 0,
7320
+ runs: opts.runs,
7321
+ deterministicOnly: opts.deterministicOnly,
7322
+ noCache: opts.cache === false,
7323
+ maxTurns: opts.maxTurns,
7324
+ format: opts.format ?? "pretty",
7325
+ output: opts.output,
7326
+ // Undefined when neither spelling is passed, so the config still decides.
7327
+ // Both spellings are declared for precisely that reason: commander
7328
+ // defaults a lone `--no-x` to `true`, which makes the config's own value
7329
+ // unreachable from the command line.
7330
+ failOnReview: opts.failOnReview,
7331
+ // Commander's default is `[]`, which is "no flag", not "run nothing": only
7332
+ // a list someone typed narrows the run, and `--no-execution` runs none.
7333
+ ...opts.execution === false ? { allowExecution: [] } : (opts.allowExecution ?? []).length > 0 ? { allowExecution: opts.allowExecution } : {},
7334
+ reportUnusedArtifacts: opts.reportUnusedArtifacts,
7335
+ ...opts.require !== void 0 ? { require: opts.require } : {},
7336
+ ...opts.allProjects !== void 0 ? { allProjects: opts.allProjects } : {},
7337
+ ...opts.newerThan !== void 0 ? { newerThan: opts.newerThan } : {},
7338
+ ...opts.limit !== void 0 ? { limit: opts.limit } : {}
7339
+ };
7340
+ }
7341
+ async function executeRun(traces, opts, color) {
7342
+ const shared = {
7343
+ ...sharedRunOptions(opts),
7344
+ color,
7345
+ // Run-only, both of them: `--history` is a point in one session's
7346
+ // timeline, and a manifest belongs to exactly one session (ADR 01024).
7347
+ history: opts.history,
7348
+ ...opts.manifest !== void 0 ? { manifest: opts.manifest } : {}
7349
+ };
7350
+ const selecting = opts.allProjects === true || opts.newerThan !== void 0 || opts.limit !== void 0;
7351
+ if (traces.length > 1 || selecting) {
7352
+ if (opts.manifest !== void 0) {
7353
+ throw new TracevalsError(
7354
+ "--manifest names one session's manifest, so it cannot be used with a corpus; drop it and each trace will find its own"
7355
+ );
7356
+ }
7357
+ const { runBatch } = await import("./batch-A5HZKYIW.js");
7358
+ const { report: report2, rendered: rendered3 } = await runBatch({
7359
+ ...shared,
7360
+ ...traces.length > 0 ? { traces } : {}
7361
+ });
7362
+ console.log(rendered3);
7363
+ process.exitCode = report2.exitCode;
7364
+ return;
7365
+ }
7366
+ let trace = traces[0];
7367
+ if (trace === void 0) {
7368
+ if (!process.stdout.isTTY || !process.stdin.isTTY) {
7369
+ throw new TracevalsError(
7370
+ "no trace given; pass a trace file or run `manni tracevals list`"
7371
+ );
7372
+ }
7373
+ const { pickTrace } = await import("./picker-6HRMETE7.js");
7374
+ trace = await pickTrace();
7375
+ }
7376
+ const { report, rendered: rendered2 } = await runRun2({ ...shared, tracePath: trace });
7377
+ console.log(rendered2);
7378
+ process.exitCode = report.exitCode;
7379
+ }
7380
+ function addRunFlags(cmd, options = {}) {
7381
+ const withHistory = options.history !== false;
7382
+ const formats = options.formats ?? REPORT_FORMATS3;
7383
+ const base = addConfigFlags(cmd).option(
7384
+ "--project <dir>",
7385
+ "artifact-lookup root (overrides the trace's recorded cwd)"
7386
+ ).option(
7387
+ "--provider <name>",
7388
+ "Judge provider: auto (default) | anthropic | openai | claude-cli | llama-cpp"
7389
+ ).option(
7390
+ "--model <model>",
7391
+ "Model override; needs a named provider, from here or config"
7392
+ ).option("--local", LOCAL_FLAG_HELP).option("--runs <n>", "ensemble runs per eval", (v) => Number(v)).option("--deterministic-only", "skip LLM-judged evals").option(
7393
+ "--offline",
7394
+ "never fetch a remote manifest; read external metadata from local manifests"
7395
+ ).option("--no-cache", "bypass the judge cache").option(
7396
+ "--max-turns <n>",
7397
+ "Stop after this many ensemble runs (a cached ensemble costs none)",
7398
+ (v) => Number(v)
7399
+ ).option(
7400
+ "-f, --format <format>",
7401
+ `Output format: ${formats.join(" | ")}`,
7402
+ parseFormatArg("--format", formats),
7403
+ "pretty"
7404
+ ).option("-o, --output <file>", "also write the report to a file").option(
7405
+ "--report-unused-artifacts",
7406
+ "list every skill and agent the session was offered and never used"
7407
+ ).option("--fail-on-review", "Exit 1 when any eval lands in the human-review zone (the default)").option("--no-fail-on-review", "Do not fail the run on evals left for human review").option(
7408
+ "--allow-execution <kind>",
7409
+ "Run only these execution grants (repeatable): frontmatter-commands",
7410
+ collectGrant,
7411
+ []
7412
+ ).option("--no-execution", "Clear every execution grant for this run").option(
7413
+ "--require <module>",
7414
+ "load a grader plugin; repeatable, and added to config plugins",
7415
+ collect,
7416
+ []
7417
+ ).option("--all-projects", "evaluate every project's traces in the session store").option(
7418
+ "--newer-than <duration>",
7419
+ "only traces modified within this window, such as 30m, 24h, 7d or 2w"
7420
+ ).option("--limit <n>", "maximum traces to evaluate", (v) => Number(v));
7421
+ return withHistory ? base.option(
7422
+ "--history",
7423
+ "append to history and compare with the previous run"
7424
+ ) : base;
7425
+ }
7426
+ addRunFlags(
7427
+ // No `isDefault` (proposal 0034): `run` is a verb, so a bare
7428
+ // `manni tracevals` prints the help and exits 2, and a trace path with no
7429
+ // verb is commander's unknown-command refusal rather than a silent run.
7430
+ program.command("run [traces...]").description(
7431
+ "Evaluate one or more traces against the skills and instructions they used"
7432
+ )
7433
+ ).option(
7434
+ "--manifest <file>",
7435
+ "session manifest to compare artifacts against; without it one is looked for beside the trace and under the project"
7436
+ ).action(async (traces, opts, command) => {
7437
+ try {
7438
+ await executeRun(traces, opts, colorFor(command, process.stdout.isTTY));
7439
+ } catch (e) {
7440
+ fail(e);
7441
+ }
7442
+ });
7443
+ addRunFlags(
7444
+ program.command("calibrate [traces...]").description(
7445
+ "Measure judged and graded verdicts against a labels file: false passes, false fails, and review volume"
7446
+ ).option(
7447
+ "--labels <file>",
7448
+ "calibration labels sidecar (default: calibrate.labels)"
7449
+ ).option(
7450
+ "--sweep",
7451
+ "re-score the corpus across the configured grid of zones and ensemble sizes, from cached verdicts"
7452
+ ).option(
7453
+ "--max-false-pass <n>",
7454
+ "exit 1 above this many false passes",
7455
+ (v) => Number(v)
7456
+ ).option(
7457
+ "--max-false-fail <n>",
7458
+ "exit 1 above this many false fails",
7459
+ (v) => Number(v)
7460
+ ).option(
7461
+ "--max-review <n>",
7462
+ "exit 1 above this many needs-review outcomes",
7463
+ (v) => Number(v)
7464
+ ),
7465
+ { history: false, formats: CALIBRATE_FORMATS }
7466
+ ).action(
7467
+ async (traces, opts, command) => {
7468
+ try {
7469
+ const shared = {
7470
+ ...sharedRunOptions(opts),
7471
+ color: colorFor(command, process.stdout.isTTY)
7472
+ };
7473
+ whole("--max-false-pass", opts.maxFalsePass, 0);
7474
+ whole("--max-false-fail", opts.maxFalseFail, 0);
7475
+ whole("--max-review", opts.maxReview, 0);
7476
+ const { runCalibrate: runCalibrate2 } = await import("./calibrate-S5K6QHUY.js");
7477
+ const { report, rendered: rendered2 } = await runCalibrate2({
7478
+ ...shared,
7479
+ ...traces.length > 0 ? { traces } : {},
7480
+ ...opts.labels !== void 0 ? { labels: opts.labels } : {},
7481
+ ...opts.sweep !== void 0 ? { sweep: opts.sweep } : {},
7482
+ ...opts.maxFalsePass !== void 0 ? { maxFalsePass: opts.maxFalsePass } : {},
7483
+ ...opts.maxFalseFail !== void 0 ? { maxFalseFail: opts.maxFalseFail } : {},
7484
+ ...opts.maxReview !== void 0 ? { maxReview: opts.maxReview } : {}
7485
+ });
7486
+ console.log(rendered2);
7487
+ process.exitCode = report.exitCode;
7488
+ } catch (e) {
7489
+ fail(e);
7490
+ }
7491
+ }
7492
+ );
7493
+ addConfigFlags(
7494
+ program.command("fill [paths...]").description(
7495
+ "Propose evals for skills, agent definitions, and project rules, and write those above the confidence threshold"
7496
+ )
7497
+ ).option("--project <dir>", "project root to scan (default: current directory)").option("--exclude <glob>", "Glob to exclude (repeatable)", collect, []).option("--dry-run", "report proposals without writing them").option(
7498
+ "--confidence <n>",
7499
+ "minimum confidence to write (0-1)",
7500
+ (v) => parseFloat(v)
7501
+ ).option(
7502
+ "--max-evals <n>",
7503
+ "maximum evals per artifact, including existing ones",
7504
+ (v) => Number(v)
7505
+ ).option(
7506
+ "--max-turns <n>",
7507
+ "Stop after this many inference calls (a cached artifact costs none)",
7508
+ (v) => Number(v)
7509
+ ).option("--no-cache", "bypass the proposal cache").option(
7510
+ "--provider <name>",
7511
+ "Provider: auto (default) | anthropic | openai | claude-cli | llama-cpp"
7512
+ ).option(
7513
+ "--model <model>",
7514
+ "Model override; needs a named provider, from here or config"
7515
+ ).option("--local", LOCAL_FLAG_HELP).option(
7516
+ "--offline",
7517
+ "never fetch a remote manifest; read external metadata from local manifests"
7518
+ ).option(
7519
+ "--require <module>",
7520
+ "load a grader plugin; repeatable, and added to config plugins",
7521
+ collect,
7522
+ []
7523
+ ).option(
7524
+ "-f, --format <format>",
7525
+ `Output format: ${SUMMARY_FORMATS2.join(" | ")}`,
7526
+ parseFormatArg("--format", SUMMARY_FORMATS2),
7527
+ "pretty"
7528
+ ).action(async (paths, opts, command) => {
7529
+ try {
7530
+ numeric("--confidence", opts.confidence, 0, 1);
7531
+ whole("--max-evals", opts.maxEvals, 1);
7532
+ whole("--max-turns", opts.maxTurns, 1);
7533
+ const { report, rendered: rendered2 } = await runFill3({
7534
+ ...configOptions(opts),
7535
+ ...paths.length > 0 ? { paths } : {},
7536
+ ...opts.project !== void 0 ? { project: opts.project } : {},
7537
+ ...opts.exclude !== void 0 ? { exclude: opts.exclude } : {},
7538
+ ...opts.dryRun !== void 0 ? { dryRun: opts.dryRun } : {},
7539
+ ...opts.confidence !== void 0 ? { confidence: opts.confidence } : {},
7540
+ ...opts.maxEvals !== void 0 ? { maxEvals: opts.maxEvals } : {},
7541
+ ...opts.maxTurns !== void 0 ? { maxTurns: opts.maxTurns } : {},
7542
+ ...opts.cache === false ? { noCache: true } : {},
7543
+ ...opts.provider !== void 0 ? { provider: opts.provider } : {},
7544
+ ...opts.model !== void 0 ? { model: opts.model } : {},
7545
+ ...opts.local !== void 0 ? { local: opts.local } : {},
7546
+ ...opts.offline === true ? { offline: true } : {},
7547
+ ...opts.require !== void 0 ? { require: opts.require } : {},
7548
+ // P1 (proposal 0047): offered only on a terminal, where there is
7549
+ // someone to answer. Off one the block goes to the artifact and the
7550
+ // W1 line says so.
7551
+ confirm: terminalConfirm(),
7552
+ onNotice: notice,
7553
+ onRelocated: (result) => {
7554
+ const manifests = result.manifests.map((m) => m.file).join(", ");
7555
+ notice(`moved ${String(result.summary.moved)} value(s) into ${manifests}.`);
7556
+ },
7557
+ color: colorFor(command, process.stdout.isTTY)
7558
+ });
7559
+ console.log(
7560
+ opts.format === "json" ? JSON.stringify(report, null, 2) : rendered2
7561
+ );
7562
+ process.exitCode = report.exitCode;
7563
+ } catch (e) {
7564
+ fail(e);
7565
+ }
7566
+ });
7567
+ addConfigFlags(
7568
+ program.command("capture").description(
7569
+ "Record a session manifest: sha256 of every instruction artifact plus the git SHA, read from a Claude Code hook payload on stdin"
7570
+ )
7571
+ ).option("--project <dir>", "project root to scan (default: the payload's cwd)").option("--session-id <id>", "session id (default: the payload's session_id)").option("-o, --out <file>", "write here instead of the configured directory").option(
7572
+ "-f, --format <format>",
7573
+ `Output format: ${SUMMARY_FORMATS2.join(" | ")}`,
7574
+ parseFormatArg("--format", SUMMARY_FORMATS2),
7575
+ "pretty"
7576
+ ).action(async (opts) => {
7577
+ try {
7578
+ const { runCapture } = await import("./capture-OZEZDABQ.js");
7579
+ const result = await runCapture({
7580
+ version,
7581
+ ...configOptions(opts),
7582
+ ...opts.project !== void 0 ? { project: opts.project } : {},
7583
+ ...opts.sessionId !== void 0 ? { sessionId: opts.sessionId } : {},
7584
+ ...opts.out !== void 0 ? { out: opts.out } : {},
7585
+ format: opts.format ?? "pretty"
7586
+ });
7587
+ if (result.stdout !== "") console.log(result.stdout);
7588
+ if (result.stderr !== "") notice(result.stderr);
7589
+ process.exitCode = result.exitCode;
7590
+ } catch (e) {
7591
+ fail(e);
7592
+ }
7593
+ });
7594
+ program.command("list").description("List discoverable traces (Claude Code session files)").option(
7595
+ "--project <dir>",
7596
+ "project directory to scope to (default: current directory)"
7597
+ ).option("--all-projects", "scan every project in the session store").option(
7598
+ "--newer-than <duration>",
7599
+ "only traces modified within this window, such as 30m, 24h, 7d or 2w"
7600
+ ).option("--limit <n>", "maximum traces to list", (v) => Number(v)).option(
7601
+ "-f, --format <format>",
7602
+ `Output format: ${SUMMARY_FORMATS2.join(" | ")}`,
7603
+ parseFormatArg("--format", SUMMARY_FORMATS2),
7604
+ "pretty"
7605
+ ).action(async (opts, command) => {
7606
+ try {
7607
+ whole("--limit", opts.limit, 1);
7608
+ const run = await runList2({
7609
+ project: opts.project,
7610
+ allProjects: opts.allProjects,
7611
+ ...opts.newerThan !== void 0 ? { newerThan: opts.newerThan } : {},
7612
+ limit: opts.limit
7613
+ });
7614
+ console.log(
7615
+ opts.format === "json" ? JSON.stringify(run, null, 2) : renderList2(run, { color: colorFor(command, process.stdout.isTTY) })
7616
+ );
7617
+ } catch (e) {
7618
+ fail(e);
7619
+ }
7620
+ });
7621
+ return program;
7622
+ }
7623
+
7624
+ // src/cli.ts
7625
+ function buildProgram10() {
7241
7626
  const meta = buildProgram().name("meta").description(
7242
7627
  "Validate, read, query and fill document metadata against JSON Schema"
7243
7628
  );
7244
7629
  const metaCommands = new Set(meta.commands.map((c) => c.name()));
7245
- const program = new Command8();
7630
+ const program = new Command9();
7246
7631
  program.name("manni").description("Tools for documentation that is meant to be checked.").version(package_default.version, "-V, --version").showHelpAfterError("(add --help for usage)").exitOverride().configureOutput({
7247
7632
  outputError: (str, write) => {
7248
7633
  write(str);
@@ -7285,13 +7670,18 @@ function buildProgram9() {
7285
7670
  "Deterministic knowledge graphs derived from documentation frontmatter and formatting"
7286
7671
  )
7287
7672
  );
7673
+ program.addCommand(
7674
+ buildProgram9().name("tracevals").description(
7675
+ "Deterministic and LLM-as-judge adherence evals for AI agent session traces"
7676
+ )
7677
+ );
7288
7678
  program.addCommand(
7289
7679
  buildProgram5().name("key").description("Set and rotate the family key that encrypted values are encrypted with.")
7290
7680
  );
7291
7681
  return program;
7292
7682
  }
7293
- runIfMain(import.meta.url, buildProgram9);
7683
+ runIfMain(import.meta.url, buildProgram10);
7294
7684
  export {
7295
- buildProgram9 as buildProgram
7685
+ buildProgram10 as buildProgram
7296
7686
  };
7297
7687
  //# sourceMappingURL=cli.js.map