@harness-engineering/cli 5.0.0 → 6.0.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.
Files changed (56) hide show
  1. package/dist/{agents-md-GOFDOUEI.js → agents-md-OTKZE5HH.js} +4 -4
  2. package/dist/{analyzer-XRCV63KC-CUGBENHK.js → analyzer-XRCV63KC-FALMS3MO.js} +2 -2
  3. package/dist/{architecture-UJZTBKJ2.js → architecture-3VYDN7MQ.js} +5 -5
  4. package/dist/{assess-project-S3UOQUQW.js → assess-project-27X2FSZZ.js} +1 -1
  5. package/dist/bin/harness-mcp.js +15 -15
  6. package/dist/bin/harness.js +25 -25
  7. package/dist/{check-phase-gate-SQ2X2Q7T.js → check-phase-gate-IXLFZ6YH.js} +5 -5
  8. package/dist/{chunk-FXO3EODY.js → chunk-354MCPT3.js} +3 -3
  9. package/dist/{chunk-OIMJWYWF.js → chunk-3H7JA24B.js} +7 -7
  10. package/dist/{chunk-WHPZG5TX.js → chunk-3MKQKNY3.js} +6 -6
  11. package/dist/{chunk-DPG2WNSN.js → chunk-6Y6M3AZA.js} +3 -3
  12. package/dist/{chunk-JGW4CHIJ.js → chunk-BMNHLKBA.js} +2 -2
  13. package/dist/{chunk-CFK4RJFP.js → chunk-CTMHHMHQ.js} +15 -3
  14. package/dist/{chunk-RD75T4XK.js → chunk-D7QXGI6E.js} +2 -2
  15. package/dist/{chunk-4ITYAEOA.js → chunk-EFWRZHZ7.js} +101 -97
  16. package/dist/{chunk-V6QYVM6K.js → chunk-IOJGLIEQ.js} +2 -2
  17. package/dist/{chunk-DU6AUYTA.js → chunk-IXGYIQSR.js} +1 -1
  18. package/dist/{chunk-T2PQWRRK.js → chunk-JJLOWMGC.js} +2 -2
  19. package/dist/{chunk-YE7NZ44F.js → chunk-KPBGAB35.js} +2 -2
  20. package/dist/{chunk-OWJTMHVP.js → chunk-L5UKNGC5.js} +2 -2
  21. package/dist/{chunk-R5C7ZFON.js → chunk-LHWBQD7F.js} +10 -1
  22. package/dist/{chunk-KI64IQLS.js → chunk-LISEPDVT.js} +5 -5
  23. package/dist/{chunk-UJW4POA3.js → chunk-MEIUXTFY.js} +2 -2
  24. package/dist/{chunk-RPOBWUKV.js → chunk-NZ5AXKRA.js} +1 -1
  25. package/dist/{chunk-6RXT67Q4.js → chunk-QHFXVVUY.js} +2 -2
  26. package/dist/{chunk-SQDQMVNE.js → chunk-S2ETJDQJ.js} +6 -6
  27. package/dist/{chunk-AIFPI3UZ.js → chunk-TM4KFUWP.js} +2 -2
  28. package/dist/{chunk-PSFJ5YKQ.js → chunk-VGDZAWCJ.js} +335 -177
  29. package/dist/{chunk-DFWM2SNS.js → chunk-VRA64HYI.js} +2 -2
  30. package/dist/{chunk-DSXUS6KG.js → chunk-WAFTJFT3.js} +3 -3
  31. package/dist/{chunk-7BBQ5C7I.js → chunk-XF6RE3JQ.js} +2 -2
  32. package/dist/{chunk-XC7NR63Q.js → chunk-XNHKXELN.js} +2 -2
  33. package/dist/{ci-workflow-5WHUEHOF.js → ci-workflow-Y5GBKNZP.js} +4 -4
  34. package/dist/{dist-SOKOW7BC.js → dist-4CZLCE33.js} +5 -3
  35. package/dist/{dist-O7MTFDG5.js → dist-S3KCRI7X.js} +3 -1
  36. package/dist/{docs-AEHPPDKX.js → docs-3MWDPK4S.js} +5 -5
  37. package/dist/{engine-HYM5SLCD.js → engine-RJXQ5DHK.js} +4 -4
  38. package/dist/{entropy-6KH5G3NR.js → entropy-OX5LSM4S.js} +5 -5
  39. package/dist/{feedback-AUP2JK43.js → feedback-OODAP2G2.js} +1 -1
  40. package/dist/{generate-agent-definitions-OH4RF445.js → generate-agent-definitions-CCREQZEA.js} +5 -5
  41. package/dist/hooks/adoption-tracker.js +41 -25
  42. package/dist/hooks/pre-compact-state.js +45 -27
  43. package/dist/hooks/sentinel-post.js +125 -102
  44. package/dist/hooks/sentinel-pre.js +70 -53
  45. package/dist/hooks/telemetry-reporter.js +44 -25
  46. package/dist/index.js +25 -25
  47. package/dist/{loader-KWRPA7D5.js → loader-ZICOJBVX.js} +4 -4
  48. package/dist/{mcp-JTPO5RAK.js → mcp-XX6EIBLL.js} +15 -15
  49. package/dist/{performance-HW53ZIAF.js → performance-OLZVGMAY.js} +5 -5
  50. package/dist/{review-pipeline-2R7UBFTG.js → review-pipeline-3QPHMWPC.js} +4 -4
  51. package/dist/{runtime-BB35PFZY.js → runtime-ZFFIH76Z.js} +4 -4
  52. package/dist/{security-IDJHGBBH.js → security-7YW3UK2C.js} +1 -1
  53. package/dist/{state-events-H3GGBKTB.js → state-events-PTWAEGJ2.js} +4 -4
  54. package/dist/{validate-6SDGP7AH.js → validate-H5SB7X3Z.js} +5 -5
  55. package/dist/{validate-cross-check-OF3FPM32.js → validate-cross-check-YYVYMSPA.js} +4 -4
  56. package/package.json +8 -8
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  generateRuntime
3
- } from "./chunk-AIFPI3UZ.js";
3
+ } from "./chunk-TM4KFUWP.js";
4
4
  import {
5
5
  generateAgentsMd
6
- } from "./chunk-DFWM2SNS.js";
6
+ } from "./chunk-VRA64HYI.js";
7
7
  import {
8
8
  generateCIWorkflow
9
- } from "./chunk-7BBQ5C7I.js";
9
+ } from "./chunk-XF6RE3JQ.js";
10
10
  import {
11
11
  readHarnessState
12
- } from "./chunk-UJW4POA3.js";
12
+ } from "./chunk-MEIUXTFY.js";
13
13
  import {
14
14
  runCrossCheck
15
- } from "./chunk-RD75T4XK.js";
15
+ } from "./chunk-D7QXGI6E.js";
16
16
  import {
17
17
  createGenerateAgentDefinitionsCommand,
18
18
  generateAgentDefinitions
19
- } from "./chunk-DU6AUYTA.js";
19
+ } from "./chunk-IXGYIQSR.js";
20
20
  import {
21
21
  toKebabCase
22
22
  } from "./chunk-KET4QQZB.js";
@@ -26,7 +26,7 @@ import {
26
26
  } from "./chunk-YYFSFSB3.js";
27
27
  import {
28
28
  TemplateEngine
29
- } from "./chunk-T2PQWRRK.js";
29
+ } from "./chunk-JJLOWMGC.js";
30
30
  import {
31
31
  generate,
32
32
  validate
@@ -37,7 +37,7 @@ import {
37
37
  import {
38
38
  listPersonas,
39
39
  loadPersona
40
- } from "./chunk-YE7NZ44F.js";
40
+ } from "./chunk-KPBGAB35.js";
41
41
  import {
42
42
  runPersona
43
43
  } from "./chunk-GISMXMVL.js";
@@ -51,7 +51,7 @@ import {
51
51
  OutputFormatter,
52
52
  OutputMode,
53
53
  createCheckPhaseGateCommand
54
- } from "./chunk-DPG2WNSN.js";
54
+ } from "./chunk-6Y6M3AZA.js";
55
55
  import {
56
56
  appendFrameworkAgents,
57
57
  captureHealthSnapshot,
@@ -79,7 +79,7 @@ import {
79
79
  runSecurityCraft,
80
80
  runSpecCraft,
81
81
  runTestCraft
82
- } from "./chunk-4ITYAEOA.js";
82
+ } from "./chunk-EFWRZHZ7.js";
83
83
  import {
84
84
  VALID_PLATFORMS
85
85
  } from "./chunk-3ISINLYT.js";
@@ -108,7 +108,7 @@ import {
108
108
  BranchingConfigSchema,
109
109
  findConfigFile,
110
110
  resolveConfig
111
- } from "./chunk-V6QYVM6K.js";
111
+ } from "./chunk-IOJGLIEQ.js";
112
112
  import {
113
113
  logger
114
114
  } from "./chunk-EBJQ6N4M.js";
@@ -226,7 +226,7 @@ import {
226
226
  writeConfig,
227
227
  writeLockfile,
228
228
  writeRegeneratedRoadmap
229
- } from "./chunk-CFK4RJFP.js";
229
+ } from "./chunk-CTMHHMHQ.js";
230
230
  import {
231
231
  CLI_VERSION
232
232
  } from "./chunk-BM3PWGXQ.js";
@@ -239,14 +239,14 @@ import {
239
239
  detectDocDrift,
240
240
  generateSuggestions,
241
241
  validateDependencies
242
- } from "./chunk-RPOBWUKV.js";
242
+ } from "./chunk-NZ5AXKRA.js";
243
243
  import {
244
244
  Err,
245
245
  INDEXED_FILE_KINDS,
246
246
  INSIGHTS_KEYS,
247
247
  Ok,
248
248
  init_dist
249
- } from "./chunk-R5C7ZFON.js";
249
+ } from "./chunk-LHWBQD7F.js";
250
250
  import {
251
251
  DEFAULT_SKIP_DIRS,
252
252
  DesignConstraintAdapter,
@@ -263,7 +263,7 @@ import {
263
263
  } from "./chunk-KFQGP6VL.js";
264
264
 
265
265
  // src/index.ts
266
- import { Command as Command131 } from "commander";
266
+ import { Command as Command133 } from "commander";
267
267
 
268
268
  // src/commands/add.ts
269
269
  init_dist3();
@@ -454,7 +454,7 @@ function registerSkillsCommand(adoption) {
454
454
  const globalOpts = cmd.optsWithGlobals();
455
455
  const limit = Math.max(parseInt(opts.limit, 10) || 20, 1);
456
456
  const cwd = process.cwd();
457
- const { readAdoptionRecords, aggregateBySkill } = await import("./dist-SOKOW7BC.js");
457
+ const { readAdoptionRecords, aggregateBySkill } = await import("./dist-4CZLCE33.js");
458
458
  const records = readAdoptionRecords(cwd);
459
459
  if (records.length === 0) {
460
460
  if (globalOpts.json) {
@@ -490,7 +490,7 @@ function registerRecentCommand(adoption) {
490
490
  const globalOpts = cmd.optsWithGlobals();
491
491
  const limit = Math.max(parseInt(opts.limit, 10) || 20, 1);
492
492
  const cwd = process.cwd();
493
- const { readAdoptionRecords } = await import("./dist-SOKOW7BC.js");
493
+ const { readAdoptionRecords } = await import("./dist-4CZLCE33.js");
494
494
  const records = readAdoptionRecords(cwd);
495
495
  if (records.length === 0) {
496
496
  if (globalOpts.json) {
@@ -568,7 +568,7 @@ function registerSkillCommand(adoption) {
568
568
  adoption.command("skill <name>").description("Show detail for a specific skill").action(async (name, _opts, cmd) => {
569
569
  const globalOpts = cmd.optsWithGlobals();
570
570
  const cwd = process.cwd();
571
- const { readAdoptionRecords, aggregateBySkill } = await import("./dist-SOKOW7BC.js");
571
+ const { readAdoptionRecords, aggregateBySkill } = await import("./dist-4CZLCE33.js");
572
572
  const records = readAdoptionRecords(cwd);
573
573
  const skillRecords = records.filter((r) => r.skill === name);
574
574
  if (skillRecords.length === 0) {
@@ -602,7 +602,7 @@ function registerRetrospectiveCommand(adoption) {
602
602
  adoption.command("retrospective").description("Generate a catalog retrospective from adoption telemetry").option("--inactive-days <n>", "Inactivity threshold in days (default: 90)", "90").option("--top <n>", "Rows per ranked section (default: 10)", "10").option("--out <path>", "Output file path (default: docs/retrospectives/YYYY-MM-DD.md)").option("--no-write", "Print the report to stdout instead of writing a file").action(async (opts, cmd) => {
603
603
  const globalOpts = cmd.optsWithGlobals();
604
604
  const cwd = process.cwd();
605
- const { readAdoptionRecords, getCatalogRetrospectiveReport, renderRetrospectiveMarkdown } = await import("./dist-SOKOW7BC.js");
605
+ const { readAdoptionRecords, getCatalogRetrospectiveReport, renderRetrospectiveMarkdown } = await import("./dist-4CZLCE33.js");
606
606
  const records = readAdoptionRecords(cwd);
607
607
  const catalogSkills = discoverCatalogSkills(cwd);
608
608
  const report = getCatalogRetrospectiveReport(records, {
@@ -5249,16 +5249,9 @@ function createRemoveCommand() {
5249
5249
  import { Command as Command41 } from "commander";
5250
5250
  import * as fs13 from "fs";
5251
5251
  import * as path27 from "path";
5252
- import { fileURLToPath as fileURLToPath3 } from "url";
5253
- var __dirname3 = path27.dirname(fileURLToPath3(import.meta.url));
5254
5252
  var ALIASES = {
5255
5253
  sentinel: ["sentinel-pre", "sentinel-post"]
5256
5254
  };
5257
- function hookSourceDir() {
5258
- const d = path27.resolve(__dirname3, "..", "..", "hooks");
5259
- if (fs13.existsSync(d)) return d;
5260
- throw new Error(`Hook scripts not found: ${d}`);
5261
- }
5262
5255
  function readJson(p) {
5263
5256
  return fs13.existsSync(p) ? JSON.parse(fs13.readFileSync(p, "utf-8")) : {};
5264
5257
  }
@@ -5272,7 +5265,7 @@ function registerHook(s, ev, matcher, name) {
5272
5265
  function addHooks(hookName, projectDir) {
5273
5266
  const names = ALIASES[hookName] ?? [hookName];
5274
5267
  const result = { added: [], alreadyInstalled: [], notFound: [] };
5275
- const srcDir = hookSourceDir();
5268
+ const srcDir = resolveHookSourceDir();
5276
5269
  const destDir = path27.join(projectDir, ".harness", "hooks");
5277
5270
  fs13.mkdirSync(destDir, { recursive: true });
5278
5271
  const claudeDir = path27.join(projectDir, ".claude");
@@ -6210,7 +6203,7 @@ function createInsightsCommand() {
6210
6203
  return new Command46("insights").description("Composite project report \u2014 health, entropy, decay, attention, impact.").option("--json", "Emit JSON to stdout instead of pretty text").option("--skip <list>", `Comma-separated keys to skip (${INSIGHTS_KEYS.join(",")})`).action(async (opts) => {
6211
6204
  const cwd = process.cwd();
6212
6205
  const skip = parseSkip2(opts.skip);
6213
- const { composeInsights } = await import("./dist-SOKOW7BC.js");
6206
+ const { composeInsights } = await import("./dist-4CZLCE33.js");
6214
6207
  const report = await composeInsights(cwd, { skip });
6215
6208
  if (opts.json) {
6216
6209
  console.log(JSON.stringify(report, null, 2));
@@ -8321,7 +8314,7 @@ function createMcpCommand() {
8321
8314
  parseBudget
8322
8315
  ).action(async (opts) => {
8323
8316
  const [{ startServer: startServer2, getToolDefinitions: getToolDefinitions2 }, { selectTier }] = await Promise.all([
8324
- import("./mcp-JTPO5RAK.js"),
8317
+ import("./mcp-XX6EIBLL.js"),
8325
8318
  import("./tool-tiers-OKK5FE57.js")
8326
8319
  ]);
8327
8320
  if (opts.tools && opts.tools.length > 0) {
@@ -8863,7 +8856,7 @@ function updateReferences(plan) {
8863
8856
  }
8864
8857
  async function prompt(question, def = "n") {
8865
8858
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
8866
- const answer = await new Promise((resolve50) => rl.question(question, resolve50));
8859
+ const answer = await new Promise((resolve49) => rl.question(question, resolve49));
8867
8860
  rl.close();
8868
8861
  return (answer.trim() || def).toLowerCase();
8869
8862
  }
@@ -9052,7 +9045,7 @@ function createMigrateCommand() {
9052
9045
  // src/commands/models.ts
9053
9046
  init_dist3();
9054
9047
  import { Command as Command66 } from "commander";
9055
- import { resolve as resolve31 } from "path";
9048
+ import { resolve as resolve30 } from "path";
9056
9049
  import { defaultFetchModels } from "@harness-engineering/orchestrator";
9057
9050
  function errorResult(message, partial) {
9058
9051
  return {
@@ -9170,7 +9163,7 @@ function formatProbe(result) {
9170
9163
  return lines.join("\n");
9171
9164
  }
9172
9165
  function projectRoot() {
9173
- return resolve31(process.env["HARNESS_PROJECT_ROOT"] ?? process.cwd());
9166
+ return resolve30(process.env["HARNESS_PROJECT_ROOT"] ?? process.cwd());
9174
9167
  }
9175
9168
  function summarizeModelProposal(p) {
9176
9169
  const base = { id: p.id, status: p.status, proposedBy: p.proposedBy, createdAt: p.createdAt };
@@ -9431,7 +9424,7 @@ import { Command as Command69 } from "commander";
9431
9424
  init_dist3();
9432
9425
  import { Command as Command68 } from "commander";
9433
9426
  import { randomBytes } from "crypto";
9434
- import { resolve as resolve32 } from "path";
9427
+ import { resolve as resolve31 } from "path";
9435
9428
  import { SinkRegistry, SinkConfigError, wrapAsEnvelope } from "@harness-engineering/orchestrator";
9436
9429
  function makeTestEvent(message) {
9437
9430
  return {
@@ -9483,7 +9476,7 @@ async function runNotificationsTest(sinkId, opts, projectRoot3 = process.cwd())
9483
9476
  function createNotificationsTestSubcommand() {
9484
9477
  return new Command68("test").description("Send a synthetic notification.test event through the named sink").argument("<sink-id>", "Sink id from harness.config.json `notifications.sinks[].id`").option("--message <text>", "Override the default test message").action(async (sinkId, opts, cmd) => {
9485
9478
  const globalOpts = cmd.optsWithGlobals();
9486
- const projectRoot3 = typeof globalOpts["cwd"] === "string" ? resolve32(globalOpts["cwd"]) : process.cwd();
9479
+ const projectRoot3 = typeof globalOpts["cwd"] === "string" ? resolve31(globalOpts["cwd"]) : process.cwd();
9487
9480
  const result = await runNotificationsTest(sinkId, opts, projectRoot3);
9488
9481
  if (globalOpts["json"]) {
9489
9482
  console.log(JSON.stringify(result, null, 2));
@@ -9557,7 +9550,7 @@ function registerBenchCommand(perf) {
9557
9550
  perf.command("bench [glob]").description("Run benchmarks via vitest bench").action(async (glob2, _opts, cmd) => {
9558
9551
  const globalOpts = cmd.optsWithGlobals();
9559
9552
  const cwd = process.cwd();
9560
- const { BenchmarkRunner } = await import("./dist-SOKOW7BC.js");
9553
+ const { BenchmarkRunner } = await import("./dist-4CZLCE33.js");
9561
9554
  const runner = new BenchmarkRunner();
9562
9555
  const benchFiles = runner.discover(cwd, glob2);
9563
9556
  if (benchFiles.length === 0) {
@@ -9621,7 +9614,7 @@ async function runBaselinesShow(globalOpts) {
9621
9614
  }
9622
9615
  async function runBaselinesUpdate(globalOpts) {
9623
9616
  const cwd = process.cwd();
9624
- const { BenchmarkRunner } = await import("./dist-SOKOW7BC.js");
9617
+ const { BenchmarkRunner } = await import("./dist-4CZLCE33.js");
9625
9618
  const runner = new BenchmarkRunner();
9626
9619
  const manager = new BaselineManager(cwd);
9627
9620
  logger.info("Running benchmarks to update baselines...");
@@ -9662,7 +9655,7 @@ function registerReportCommand(perf) {
9662
9655
  perf.command("report").description("Full performance report with metrics, trends, and hotspots").action(async (_opts, cmd) => {
9663
9656
  const globalOpts = cmd.optsWithGlobals();
9664
9657
  const cwd = process.cwd();
9665
- const { EntropyAnalyzer: EntropyAnalyzer2 } = await import("./dist-SOKOW7BC.js");
9658
+ const { EntropyAnalyzer: EntropyAnalyzer2 } = await import("./dist-4CZLCE33.js");
9666
9659
  const analyzer = new EntropyAnalyzer2({
9667
9660
  rootDir: path51.resolve(cwd),
9668
9661
  analyze: { complexity: true, coupling: true }
@@ -10449,9 +10442,9 @@ function createPreMergeBriefCommand() {
10449
10442
  // src/commands/proposals.ts
10450
10443
  init_dist3();
10451
10444
  import { Command as Command78 } from "commander";
10452
- import { resolve as resolve36 } from "path";
10445
+ import { resolve as resolve35 } from "path";
10453
10446
  function projectRoot2() {
10454
- return resolve36(process.env["HARNESS_PROJECT_ROOT"] ?? process.cwd());
10447
+ return resolve35(process.env["HARNESS_PROJECT_ROOT"] ?? process.cwd());
10455
10448
  }
10456
10449
  function summarizeProposal(p) {
10457
10450
  const base = {
@@ -10685,7 +10678,7 @@ async function runPublishAnalyses(opts) {
10685
10678
  const nameToExternalId = await buildNameToExternalIdMap(projectPath);
10686
10679
  if (!nameToExternalId) return process.exit(1);
10687
10680
  const { AnalysisArchive } = await import("@harness-engineering/orchestrator");
10688
- const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-SOKOW7BC.js");
10681
+ const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-4CZLCE33.js");
10689
10682
  const archive = new AnalysisArchive(path53.join(projectPath, ".harness", "analyses"));
10690
10683
  const analyses = await archive.list();
10691
10684
  if (analyses.length === 0) {
@@ -10729,7 +10722,7 @@ import { Command as Command81 } from "commander";
10729
10722
  // src/commands/pulse/run.ts
10730
10723
  init_dist3();
10731
10724
  import { readFileSync as readFileSync19, mkdirSync as mkdirSync16, writeFileSync as writeFileSync20 } from "fs";
10732
- import { dirname as dirname19, join as join43, resolve as resolve38 } from "path";
10725
+ import { dirname as dirname18, join as join43, resolve as resolve37 } from "path";
10733
10726
  import { Command as Command80 } from "commander";
10734
10727
  async function runPulseRunCommand(opts) {
10735
10728
  const startedAt = Date.now();
@@ -10762,7 +10755,7 @@ async function runPulseRunCommand(opts) {
10762
10755
  const now = /* @__PURE__ */ new Date();
10763
10756
  const ts = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}_${String(now.getHours()).padStart(2, "0")}-${String(now.getMinutes()).padStart(2, "0")}`;
10764
10757
  const filePath = join43(opts.outputDir, `${ts}.md`);
10765
- mkdirSync16(dirname19(filePath), { recursive: true });
10758
+ mkdirSync16(dirname18(filePath), { recursive: true });
10766
10759
  writeFileSync20(filePath, report);
10767
10760
  const headlines = extractHeadlines(report);
10768
10761
  return emit2(
@@ -10805,8 +10798,8 @@ function createRunCommand2() {
10805
10798
  async (options) => {
10806
10799
  const nonInteractive = options.nonInteractive === true || !process.stdout.isTTY;
10807
10800
  const status = await runPulseRunCommand({
10808
- configPath: resolve38(process.cwd(), options.config),
10809
- outputDir: resolve38(process.cwd(), options.outputDir),
10801
+ configPath: resolve37(process.cwd(), options.config),
10802
+ outputDir: resolve37(process.cwd(), options.outputDir),
10810
10803
  nonInteractive,
10811
10804
  lookback: options.lookback
10812
10805
  });
@@ -11849,13 +11842,13 @@ async function composeRevertPr(decision, originalTitle, opts) {
11849
11842
 
11850
11843
  // src/rollback/breadcrumb.ts
11851
11844
  import { appendFileSync, mkdirSync as mkdirSync19 } from "fs";
11852
- import { dirname as dirname21, join as join50 } from "path";
11845
+ import { dirname as dirname20, join as join50 } from "path";
11853
11846
  var ROLLBACK_EVENTS_FILE = join50(".harness", "signals", "rollback-events.jsonl");
11854
11847
  async function appendRollbackEvent(event, opts = {}) {
11855
11848
  const root = opts.root ?? process.cwd();
11856
11849
  const ts = (opts.now ?? (() => (/* @__PURE__ */ new Date()).toISOString()))();
11857
11850
  const file = join50(root, ROLLBACK_EVENTS_FILE);
11858
- mkdirSync19(dirname21(file), { recursive: true });
11851
+ mkdirSync19(dirname20(file), { recursive: true });
11859
11852
  appendFileSync(file, `${JSON.stringify({ ...event, ts })}
11860
11853
  `, "utf-8");
11861
11854
  }
@@ -12213,7 +12206,7 @@ function createRollbackCommand() {
12213
12206
  }
12214
12207
 
12215
12208
  // src/commands/routing/index.ts
12216
- import { Command as Command94 } from "commander";
12209
+ import { Command as Command96 } from "commander";
12217
12210
 
12218
12211
  // src/commands/routing/config.ts
12219
12212
  import { Command as Command91 } from "commander";
@@ -12308,6 +12301,12 @@ function createConfigCommand() {
12308
12301
 
12309
12302
  // src/commands/routing/trace.ts
12310
12303
  import { Command as Command92 } from "commander";
12304
+ var COMPLEXITY_VALUES = ["trivial", "simple", "moderate", "complex"];
12305
+ var RISK_VALUES = ["low", "high"];
12306
+ function validateEnum(flag, value, allowed) {
12307
+ if (value === void 0 || allowed.includes(value)) return null;
12308
+ return `Invalid ${flag} "${value}". Allowed values: ${allowed.join(", ")}.`;
12309
+ }
12311
12310
  function buildUseCase(opts) {
12312
12311
  if (opts.skill) {
12313
12312
  return opts.mode ? { kind: "skill", skillName: opts.skill, cognitiveMode: opts.mode } : { kind: "skill", skillName: opts.skill };
@@ -12326,37 +12325,56 @@ function renderHuman2(r) {
12326
12325
  for (const step of r.decision.resolutionPath) {
12327
12326
  console.log(` ${step.source}:${step.candidate} -> ${step.outcome}`);
12328
12327
  }
12328
+ if (r.tierRequired !== void 0) {
12329
+ console.log(`Tier required: ${r.tierRequired}`);
12330
+ }
12331
+ if (r.estCostUsd !== void 0) {
12332
+ console.log(`Est cost: $${r.estCostUsd.toFixed(4)}`);
12333
+ }
12329
12334
  }
12330
- function createTraceCommand() {
12331
- return new Command92("trace").description("Dry-run a routing decision without dispatching (Spec B F7)").option("--skill <name>", "Skill name to trace").option("--mode <m>", "Cognitive mode to trace (or attach to --skill per spec D12)").option("--json", "Emit JSON to stdout instead of human-readable text").action(async (opts) => {
12332
- const useCase = buildUseCase(opts);
12333
- if (!useCase) {
12334
- logger.error("Either --skill <name> or --mode <m> is required");
12335
- process.exit(ExitCode.ERROR);
12336
- return;
12337
- }
12338
- const r = await postJson("/api/v1/routing/trace", { useCase });
12339
- if (!r.ok) {
12340
- if (r.status === 0) {
12341
- logger.error(
12342
- `Failed to reach orchestrator at ${orchestratorBase()}: ${r.error ?? "unknown error"}`
12343
- );
12344
- } else if (r.status === 503) {
12345
- logger.error(
12346
- "Routing observability not available \u2014 orchestrator has no BackendRouter (legacy single-backend config)"
12347
- );
12348
- } else {
12349
- logger.error(`Trace failed (${r.status}): ${r.error ?? ""}`);
12350
- }
12351
- process.exit(ExitCode.ERROR);
12352
- return;
12353
- }
12354
- if (opts.json) {
12355
- console.log(JSON.stringify(r.body, null, 2));
12356
- return;
12357
- }
12358
- if (r.body) renderHuman2(r.body);
12335
+ function traceErrorMessage(r) {
12336
+ if (r.status === 0) {
12337
+ return `Failed to reach orchestrator at ${orchestratorBase()}: ${r.error ?? "unknown error"}`;
12338
+ }
12339
+ if (r.status === 503) {
12340
+ return "Routing observability not available \u2014 orchestrator has no BackendRouter (legacy single-backend config)";
12341
+ }
12342
+ return `Trace failed (${r.status}): ${r.error ?? ""}`;
12343
+ }
12344
+ async function runTrace(opts) {
12345
+ const useCase = buildUseCase(opts);
12346
+ if (!useCase) {
12347
+ logger.error("Either --skill <name> or --mode <m> is required");
12348
+ process.exit(ExitCode.ERROR);
12349
+ return;
12350
+ }
12351
+ const enumError = validateEnum("--complexity", opts.complexity, COMPLEXITY_VALUES) ?? validateEnum("--risk", opts.risk, RISK_VALUES);
12352
+ if (enumError) {
12353
+ logger.error(enumError);
12354
+ process.exit(ExitCode.ERROR);
12355
+ return;
12356
+ }
12357
+ const r = await postJson("/api/v1/routing/trace", {
12358
+ useCase,
12359
+ ...opts.complexity ? { complexity: opts.complexity } : {},
12360
+ ...opts.risk ? { risk: opts.risk } : {}
12359
12361
  });
12362
+ if (!r.ok) {
12363
+ logger.error(traceErrorMessage(r));
12364
+ process.exit(ExitCode.ERROR);
12365
+ return;
12366
+ }
12367
+ if (opts.json) {
12368
+ console.log(JSON.stringify(r.body, null, 2));
12369
+ return;
12370
+ }
12371
+ if (r.body) renderHuman2(r.body);
12372
+ }
12373
+ function createTraceCommand() {
12374
+ return new Command92("trace").description("Dry-run a routing decision without dispatching (Spec B F7)").option("--skill <name>", "Skill name to trace").option("--mode <m>", "Cognitive mode to trace (or attach to --skill per spec D12)").option(
12375
+ "--complexity <level>",
12376
+ "Synthetic complexity (trivial|simple|moderate|complex) \u2014 dry-run only"
12377
+ ).option("--risk <band>", "Synthetic risk band (low|high) \u2014 dry-run only").option("--json", "Emit JSON to stdout instead of human-readable text").action(runTrace);
12360
12378
  }
12361
12379
 
12362
12380
  // src/commands/routing/decisions.ts
@@ -12436,20 +12454,160 @@ function createDecisionsCommand() {
12436
12454
  );
12437
12455
  }
12438
12456
 
12457
+ // src/commands/routing/telemetry.ts
12458
+ import { Command as Command94 } from "commander";
12459
+ var TIERS = ["fast", "standard", "strong"];
12460
+ function shortIso2(iso) {
12461
+ const tail = iso.split("T")[1] ?? iso;
12462
+ return tail.replace("Z", "");
12463
+ }
12464
+ function renderHuman4(data, tableLimit) {
12465
+ if (data.decisions.length === 0) {
12466
+ console.log("(no routing telemetry \u2014 AMR is off or no decisions recorded yet)");
12467
+ return;
12468
+ }
12469
+ const byTier = /* @__PURE__ */ new Map();
12470
+ for (const t of TIERS) byTier.set(t, { count: 0, cost: 0 });
12471
+ for (const d of data.decisions) {
12472
+ const bucket = byTier.get(d.tierRequired);
12473
+ if (bucket) {
12474
+ bucket.count += 1;
12475
+ bucket.cost += d.estCostUsd;
12476
+ }
12477
+ }
12478
+ console.log(`Decisions (retained ring): ${data.decisions.length}`);
12479
+ console.log(`Ring spend total: $${data.spentUsd.toFixed(4)}`);
12480
+ console.log("");
12481
+ console.log("TIER COUNT SHARE COST");
12482
+ for (const t of TIERS) {
12483
+ const b = byTier.get(t);
12484
+ const share = Math.round(b.count / data.decisions.length * 100);
12485
+ console.log(
12486
+ `${t.padEnd(9)} ${String(b.count).padStart(5)} ${String(share).padStart(4)}% $${b.cost.toFixed(4)}`
12487
+ );
12488
+ }
12489
+ console.log("");
12490
+ const rows = tableLimit !== void 0 ? data.decisions.slice(0, tableLimit) : data.decisions;
12491
+ console.log(
12492
+ `TIMESTAMP TIER BACKEND COST${tableLimit !== void 0 ? ` (latest ${rows.length} of ${data.decisions.length})` : ""}`
12493
+ );
12494
+ for (const d of rows) {
12495
+ const ts = shortIso2(d.decisionTs).padEnd(13);
12496
+ const tier = d.tierRequired.padEnd(9);
12497
+ const be = d.backend.padEnd(15);
12498
+ console.log(`${ts} ${tier} ${be} $${d.estCostUsd.toFixed(4)}`);
12499
+ }
12500
+ }
12501
+ function createTelemetryCommand() {
12502
+ return new Command94("telemetry").description("Routing telemetry: per-decision tier/backend/cost + tier distribution (AMR)").option("--last <N>", "Show only the N most recent decisions in the per-decision table").option("--json", "Emit JSON to stdout instead of human-readable text").action(async (opts) => {
12503
+ const r = await getJson("/api/v1/routing/telemetry");
12504
+ if (!r.ok) {
12505
+ if (r.status === 0) {
12506
+ logger.error(
12507
+ `Failed to reach orchestrator at ${orchestratorBase()}: ${r.error ?? "unknown error"}`
12508
+ );
12509
+ } else {
12510
+ logger.error(`Request failed (${r.status}): ${r.error ?? ""}`);
12511
+ }
12512
+ process.exit(ExitCode.ERROR);
12513
+ return;
12514
+ }
12515
+ const body = r.body ?? { decisions: [], spentUsd: 0 };
12516
+ if (opts.json) {
12517
+ console.log(JSON.stringify(body, null, 2));
12518
+ return;
12519
+ }
12520
+ const tableLimit = opts.last && Number.isFinite(Number(opts.last)) && Number(opts.last) > 0 ? Math.floor(Number(opts.last)) : void 0;
12521
+ renderHuman4(body, tableLimit);
12522
+ });
12523
+ }
12524
+
12525
+ // src/commands/routing/status.ts
12526
+ import { Command as Command95 } from "commander";
12527
+ function bar(pct, width = 24) {
12528
+ const clamped = Math.max(0, Math.min(100, pct));
12529
+ const filled = Math.round(clamped / 100 * width);
12530
+ return `[${"#".repeat(filled)}${"-".repeat(width - filled)}]`;
12531
+ }
12532
+ function renderHuman5(s) {
12533
+ if (!s.active) {
12534
+ console.log("Adaptive routing: OFF (no routing.policy configured \u2014 dispatch is unchanged)");
12535
+ return;
12536
+ }
12537
+ console.log("Adaptive routing: ON");
12538
+ if (s.budget) {
12539
+ const b = s.budget;
12540
+ const state = b.exhausted ? "EXHAUSTED (hard cap \u2014 forcing fast / surfacing to steward)" : b.degrading ? "DEGRADING (clamping tiers down)" : "ok";
12541
+ console.log("");
12542
+ console.log("Budget:");
12543
+ console.log(
12544
+ ` $${b.spentUsd.toFixed(4)} / $${b.capUsd.toFixed(2)} ${bar(b.spentPct)} ${b.spentPct}%`
12545
+ );
12546
+ console.log(` degrade at ${b.degradeAtPct}% \u2192 ${state}`);
12547
+ } else {
12548
+ console.log("Budget: (none configured)");
12549
+ }
12550
+ console.log("");
12551
+ if (s.escalation.length === 0) {
12552
+ console.log("Escalation: (no units have climbed above the fast floor)");
12553
+ } else {
12554
+ console.log(`Escalation: ${s.escalation.length} unit(s) climbed`);
12555
+ console.log(" UNIT FLOOR");
12556
+ for (const u of s.escalation) {
12557
+ console.log(` ${u.coherenceUnit.padEnd(38)} ${u.floor}`);
12558
+ }
12559
+ }
12560
+ console.log("");
12561
+ console.log(
12562
+ `Allowlist: ${s.allowedProviders && s.allowedProviders.length > 0 ? s.allowedProviders.join(", ") : "(all providers allowed)"}`
12563
+ );
12564
+ }
12565
+ function createStatusCommand() {
12566
+ return new Command95("status").description(
12567
+ "Live routing status: budget spend-vs-cap, escalated units, provider allowlist (AMR)"
12568
+ ).option("--json", "Emit JSON to stdout instead of human-readable text").action(async (opts) => {
12569
+ const r = await getJson("/api/v1/routing/status");
12570
+ if (!r.ok) {
12571
+ if (r.status === 0) {
12572
+ logger.error(
12573
+ `Failed to reach orchestrator at ${orchestratorBase()}: ${r.error ?? "unknown error"}`
12574
+ );
12575
+ } else {
12576
+ logger.error(`Request failed (${r.status}): ${r.error ?? ""}`);
12577
+ }
12578
+ process.exit(ExitCode.ERROR);
12579
+ return;
12580
+ }
12581
+ const body = r.body ?? {
12582
+ active: false,
12583
+ budget: null,
12584
+ escalation: [],
12585
+ allowedProviders: null
12586
+ };
12587
+ if (opts.json) {
12588
+ console.log(JSON.stringify(body, null, 2));
12589
+ return;
12590
+ }
12591
+ renderHuman5(body);
12592
+ });
12593
+ }
12594
+
12439
12595
  // src/commands/routing/index.ts
12440
12596
  function createRoutingCommand() {
12441
- const cmd = new Command94("routing").description(
12442
- "Inspect routing config, trace decisions, and read recent dispatches"
12597
+ const cmd = new Command96("routing").description(
12598
+ "Inspect routing config, trace decisions, and read AMR telemetry + status"
12443
12599
  );
12444
12600
  cmd.addCommand(createConfigCommand());
12445
12601
  cmd.addCommand(createTraceCommand());
12446
12602
  cmd.addCommand(createDecisionsCommand());
12603
+ cmd.addCommand(createTelemetryCommand());
12604
+ cmd.addCommand(createStatusCommand());
12447
12605
  return cmd;
12448
12606
  }
12449
12607
 
12450
12608
  // src/commands/scan-config.ts
12451
12609
  init_dist3();
12452
- import { Command as Command95 } from "commander";
12610
+ import { Command as Command97 } from "commander";
12453
12611
  import { existsSync as existsSync31, readFileSync as readFileSync22, writeFileSync as writeFileSync23 } from "fs";
12454
12612
  import { join as join51, relative as relative4 } from "path";
12455
12613
  var CONFIG_FILES = ["CLAUDE.md", "AGENTS.md", ".gemini/settings.json", "skill.yaml"];
@@ -12538,7 +12696,7 @@ function formatTextOutput(result) {
12538
12696
  }
12539
12697
  }
12540
12698
  function createScanConfigCommand() {
12541
- const command = new Command95("scan-config").description(
12699
+ const command = new Command97("scan-config").description(
12542
12700
  "Scan CLAUDE.md, AGENTS.md, .gemini/settings.json, and skill.yaml for prompt injection patterns"
12543
12701
  ).option("--path <dir>", "Target directory to scan (default: cwd)").option("--fix", "Strip high-severity patterns from files in-place").action(async (opts, cmd) => {
12544
12702
  const globalOpts = cmd.optsWithGlobals();
@@ -12556,7 +12714,7 @@ function createScanConfigCommand() {
12556
12714
 
12557
12715
  // src/commands/search.ts
12558
12716
  init_dist();
12559
- import { Command as Command96 } from "commander";
12717
+ import { Command as Command98 } from "commander";
12560
12718
  function parseFileKinds(raw) {
12561
12719
  if (!raw) return void 0;
12562
12720
  const set = /* @__PURE__ */ new Set();
@@ -12577,7 +12735,7 @@ function fmtBytes(n) {
12577
12735
  return n.toFixed(0);
12578
12736
  }
12579
12737
  function createSearchCommand() {
12580
- return new Command96("search").description("Full-text search over archived + live session content.").argument(
12738
+ return new Command98("search").description("Full-text search over archived + live session content.").argument(
12581
12739
  "<query>",
12582
12740
  "FTS5 query (bare words AND-joined; quotes/AND/OR/NOT/column: for advanced syntax)"
12583
12741
  ).option("-n, --limit <n>", "Max results", "20").option("--archived-only", "Skip live sessions, only search archived ones").option("--json", "Emit JSON to stdout instead of pretty text").option(
@@ -12637,9 +12795,9 @@ function createSearchCommand() {
12637
12795
  }
12638
12796
 
12639
12797
  // src/commands/security-craft.ts
12640
- import { Command as Command97 } from "commander";
12798
+ import { Command as Command99 } from "commander";
12641
12799
  function createSecurityCraftCommand() {
12642
- return new Command97("security-craft").description(
12800
+ return new Command99("security-craft").description(
12643
12801
  "LLM-judgment critique of security posture (TS/JS source). Sixth non-design craft-pipeline ceiling skill (the final sub-project). AST-driven signal detection fires only on files with security-relevant constructs; conservative confidence defaults manage the FP risk inherent in judgment-based security."
12644
12802
  ).option("-f, --files <files...>", "Optional file scope (overrides discovery)").option("-p, --packages <names...>", "Restrict to specific packages under packages/").option("--max-files <n>", "Cap source-file count (default: 100)").option("--max-signals-per-file <n>", "Cap per-file signal critique (default: 10)").action(async (opts, cmd) => {
12645
12803
  const globalOpts = cmd.optsWithGlobals();
@@ -12705,7 +12863,7 @@ ${file}`);
12705
12863
  }
12706
12864
 
12707
12865
  // src/commands/setup.ts
12708
- import { Command as Command98 } from "commander";
12866
+ import { Command as Command100 } from "commander";
12709
12867
  import * as fs38 from "fs";
12710
12868
  import * as os9 from "os";
12711
12869
  import * as path62 from "path";
@@ -12744,10 +12902,10 @@ function prompt2(question) {
12744
12902
  input: process.stdin,
12745
12903
  output: process.stdout
12746
12904
  });
12747
- return new Promise((resolve50) => {
12905
+ return new Promise((resolve49) => {
12748
12906
  rl.question(question, (answer) => {
12749
12907
  rl.close();
12750
- resolve50(answer.trim().toLowerCase());
12908
+ resolve49(answer.trim().toLowerCase());
12751
12909
  });
12752
12910
  });
12753
12911
  }
@@ -12756,10 +12914,10 @@ function promptRaw(question) {
12756
12914
  input: process.stdin,
12757
12915
  output: process.stdout
12758
12916
  });
12759
- return new Promise((resolve50) => {
12917
+ return new Promise((resolve49) => {
12760
12918
  rl.question(question, (answer) => {
12761
12919
  rl.close();
12762
- resolve50(answer.trim());
12920
+ resolve49(answer.trim());
12763
12921
  });
12764
12922
  });
12765
12923
  }
@@ -13050,7 +13208,7 @@ async function runSetup(cwd) {
13050
13208
  return { steps, success };
13051
13209
  }
13052
13210
  function createSetupCommand() {
13053
- return new Command98("setup").description("Configure harness environment: slash commands, MCP, and more").action(async () => {
13211
+ return new Command100("setup").description("Configure harness environment: slash commands, MCP, and more").action(async () => {
13054
13212
  const cwd = process.cwd();
13055
13213
  console.log("");
13056
13214
  console.log(` ${chalk16.bold("harness setup")}`);
@@ -13073,7 +13231,7 @@ function createSetupCommand() {
13073
13231
 
13074
13232
  // src/commands/share.ts
13075
13233
  init_dist3();
13076
- import { Command as Command99 } from "commander";
13234
+ import { Command as Command101 } from "commander";
13077
13235
  import * as fs39 from "fs";
13078
13236
  import * as path63 from "path";
13079
13237
  import { parse as parseYaml3 } from "yaml";
@@ -13132,16 +13290,16 @@ Create a constraints.yaml in your project root to define what to share.`
13132
13290
  logger.success(`Bundle written to ${outputPath}`);
13133
13291
  }
13134
13292
  function createShareCommand() {
13135
- return new Command99("share").description("Extract and publish a constraints bundle from constraints.yaml").argument("[path]", "Path to the project root", ".").option("-o, --output <dir>", "Output directory for the bundle", ".").action(async (projectPath, options) => {
13293
+ return new Command101("share").description("Extract and publish a constraints bundle from constraints.yaml").argument("[path]", "Path to the project root", ".").option("-o, --output <dir>", "Output directory for the bundle", ".").action(async (projectPath, options) => {
13136
13294
  await runShareAction(projectPath, options);
13137
13295
  });
13138
13296
  }
13139
13297
 
13140
13298
  // src/commands/skill/index.ts
13141
- import { Command as Command107 } from "commander";
13299
+ import { Command as Command109 } from "commander";
13142
13300
 
13143
13301
  // src/commands/skill/list.ts
13144
- import { Command as Command100 } from "commander";
13302
+ import { Command as Command102 } from "commander";
13145
13303
  import * as fs40 from "fs";
13146
13304
  import * as path64 from "path";
13147
13305
  import { parse } from "yaml";
@@ -13244,7 +13402,7 @@ function printSkillsVerbose(skills) {
13244
13402
  for (const s of skills) printSkillEntry(s);
13245
13403
  }
13246
13404
  function createListCommand3() {
13247
- return new Command100("list").description("List available skills").option("--installed", "Show only community-installed skills").option("--local", "Show only project-local skills").option("--all", "Show all skills (default)").action(async (opts, cmd) => {
13405
+ return new Command102("list").description("List available skills").option("--installed", "Show only community-installed skills").option("--local", "Show only project-local skills").option("--all", "Show all skills (default)").action(async (opts, cmd) => {
13248
13406
  const globalOpts = cmd.optsWithGlobals();
13249
13407
  const skills = collectSkills({ filter: resolveFilter(opts) });
13250
13408
  if (globalOpts.json) {
@@ -13259,7 +13417,7 @@ function createListCommand3() {
13259
13417
  }
13260
13418
 
13261
13419
  // src/commands/skill/run.ts
13262
- import { Command as Command101 } from "commander";
13420
+ import { Command as Command103 } from "commander";
13263
13421
  import * as fs41 from "fs";
13264
13422
  import * as path65 from "path";
13265
13423
  import { parse as parse2 } from "yaml";
@@ -13407,7 +13565,7 @@ function resolvePhaseState(metadata, projectPath, phase) {
13407
13565
  }
13408
13566
  async function appendProjectState(content, metadata, projectPath, hasPathOpt) {
13409
13567
  if (!metadata?.state.persistent || !hasPathOpt) return content;
13410
- const { readHarnessState: readHarnessState2, isEmptyHarnessState } = await import("./state-events-H3GGBKTB.js");
13568
+ const { readHarnessState: readHarnessState2, isEmptyHarnessState } = await import("./state-events-PTWAEGJ2.js");
13411
13569
  const stateResult = await readHarnessState2(projectPath);
13412
13570
  if (!stateResult.ok || isEmptyHarnessState(stateResult.value)) return content;
13413
13571
  const stateContent = JSON.stringify(stateResult.value, null, 2);
@@ -13473,14 +13631,14 @@ async function runSkill(name, opts) {
13473
13631
  process.exit(ExitCode.SUCCESS);
13474
13632
  }
13475
13633
  function createRunCommand3() {
13476
- return new Command101("run").description("Run a skill (outputs SKILL.md content with context preamble)").argument("<name>", "Skill name (e.g., harness-tdd)").option("--path <path>", "Project root path for context injection").option("--complexity <level>", "Rigor level: fast, standard, thorough", "standard").option("--phase <name>", "Start at a specific phase (for re-entry)").option("--party", "Enable multi-perspective evaluation").option(
13634
+ return new Command103("run").description("Run a skill (outputs SKILL.md content with context preamble)").argument("<name>", "Skill name (e.g., harness-tdd)").option("--path <path>", "Project root path for context injection").option("--complexity <level>", "Rigor level: fast, standard, thorough", "standard").option("--phase <name>", "Start at a specific phase (for re-entry)").option("--party", "Enable multi-perspective evaluation").option(
13477
13635
  "--backend <name>",
13478
13636
  "Spec B: one-shot routing override forwarded to the orchestrator as HARNESS_BACKEND_OVERRIDE"
13479
13637
  ).action(async (name, opts) => runSkill(name, opts));
13480
13638
  }
13481
13639
 
13482
13640
  // src/commands/skill/validate.ts
13483
- import { Command as Command102 } from "commander";
13641
+ import { Command as Command104 } from "commander";
13484
13642
  import * as fs42 from "fs";
13485
13643
  import * as path66 from "path";
13486
13644
  import { parse as parse3 } from "yaml";
@@ -13544,7 +13702,7 @@ function validateSkillEntry(name, skillsDir, errors) {
13544
13702
  }
13545
13703
  }
13546
13704
  function createValidateCommand2() {
13547
- return new Command102("validate").description("Validate all skill.yaml files and SKILL.md structure").action(async (_opts, cmd) => {
13705
+ return new Command104("validate").description("Validate all skill.yaml files and SKILL.md structure").action(async (_opts, cmd) => {
13548
13706
  const globalOpts = cmd.optsWithGlobals();
13549
13707
  const skillsDir = resolveSkillsDir();
13550
13708
  if (!fs42.existsSync(skillsDir)) {
@@ -13574,7 +13732,7 @@ function createValidateCommand2() {
13574
13732
  }
13575
13733
 
13576
13734
  // src/commands/skill/info.ts
13577
- import { Command as Command103 } from "commander";
13735
+ import { Command as Command105 } from "commander";
13578
13736
  import * as fs43 from "fs";
13579
13737
  import * as path67 from "path";
13580
13738
  import { parse as parse4 } from "yaml";
@@ -13619,7 +13777,7 @@ function printSkillInfo(skill) {
13619
13777
  console.log(`Persistent: ${skill.state.persistent}`);
13620
13778
  }
13621
13779
  function createInfoCommand() {
13622
- return new Command103("info").description("Show metadata for a skill").argument("<name>", "Skill name (e.g., harness-tdd)").action(async (name, _opts, cmd) => {
13780
+ return new Command105("info").description("Show metadata for a skill").argument("<name>", "Skill name (e.g., harness-tdd)").action(async (name, _opts, cmd) => {
13623
13781
  const globalOpts = cmd.optsWithGlobals();
13624
13782
  const loaded = loadSkillMetadata2(name);
13625
13783
  if (!loaded.ok) {
@@ -13636,7 +13794,7 @@ function createInfoCommand() {
13636
13794
  }
13637
13795
 
13638
13796
  // src/commands/skill/search.ts
13639
- import { Command as Command104 } from "commander";
13797
+ import { Command as Command106 } from "commander";
13640
13798
  async function runSearch(query, opts) {
13641
13799
  const results = await searchNpmRegistry(query, opts.registry);
13642
13800
  return results.filter((r) => {
@@ -13681,13 +13839,13 @@ async function runSearchAction(query, opts, globalOpts) {
13681
13839
  }
13682
13840
  }
13683
13841
  function createSearchCommand2() {
13684
- return new Command104("search").description("Search for community skills on the @harness-skills registry").argument("<query>", "Search query").option("--platform <platform>", "Filter by platform (e.g., claude-code)").option("--trigger <trigger>", "Filter by trigger type (e.g., manual, automatic)").option("--registry <url>", "Use a custom npm registry URL").action(async (query, opts, cmd) => {
13842
+ return new Command106("search").description("Search for community skills on the @harness-skills registry").argument("<query>", "Search query").option("--platform <platform>", "Filter by platform (e.g., claude-code)").option("--trigger <trigger>", "Filter by trigger type (e.g., manual, automatic)").option("--registry <url>", "Use a custom npm registry URL").action(async (query, opts, cmd) => {
13685
13843
  await runSearchAction(query, opts, cmd.optsWithGlobals());
13686
13844
  });
13687
13845
  }
13688
13846
 
13689
13847
  // src/commands/skill/create.ts
13690
- import { Command as Command105 } from "commander";
13848
+ import { Command as Command107 } from "commander";
13691
13849
  import * as path68 from "path";
13692
13850
  import * as fs44 from "fs";
13693
13851
  import YAML from "yaml";
@@ -13807,7 +13965,7 @@ Next steps:`);
13807
13965
  logger.info(` 3. Run: harness skills publish`);
13808
13966
  }
13809
13967
  function createCreateCommand() {
13810
- return new Command105("create").description("Scaffold a new community skill").argument("<name>", "Skill name (kebab-case)").option("--description <desc>", "Skill description").option("--type <type>", "Skill type: rigid or flexible", "flexible").option("--platforms <platforms>", "Comma-separated platforms (default: claude-code)").option("--triggers <triggers>", "Comma-separated triggers (default: manual)").option("--output-dir <dir>", "Output directory (default: agents/skills/claude-code/)").action(async (name, opts, cmd) => {
13968
+ return new Command107("create").description("Scaffold a new community skill").argument("<name>", "Skill name (kebab-case)").option("--description <desc>", "Skill description").option("--type <type>", "Skill type: rigid or flexible", "flexible").option("--platforms <platforms>", "Comma-separated platforms (default: claude-code)").option("--triggers <triggers>", "Comma-separated triggers (default: manual)").option("--output-dir <dir>", "Output directory (default: agents/skills/claude-code/)").action(async (name, opts, cmd) => {
13811
13969
  const globalOpts = cmd.optsWithGlobals();
13812
13970
  try {
13813
13971
  const result = runCreate(name, {
@@ -13830,7 +13988,7 @@ function createCreateCommand() {
13830
13988
  }
13831
13989
 
13832
13990
  // src/commands/skill/publish.ts
13833
- import { Command as Command106 } from "commander";
13991
+ import { Command as Command108 } from "commander";
13834
13992
  import * as fs46 from "fs";
13835
13993
  import * as path70 from "path";
13836
13994
  import { execFileSync as execFileSync12 } from "child_process";
@@ -13999,7 +14157,7 @@ ${skillMdContent}`;
13999
14157
  };
14000
14158
  }
14001
14159
  function createPublishCommand() {
14002
- return new Command106("publish").description("Validate and publish a skill to @harness-skills on npm").option("--dry-run", "Run validation and generate package.json without publishing").option("--dir <dir>", "Skill directory (default: current directory)").option("--registry <url>", "Use a custom npm registry URL").action(async (opts, cmd) => {
14160
+ return new Command108("publish").description("Validate and publish a skill to @harness-skills on npm").option("--dry-run", "Run validation and generate package.json without publishing").option("--dir <dir>", "Skill directory (default: current directory)").option("--registry <url>", "Use a custom npm registry URL").action(async (opts, cmd) => {
14003
14161
  const globalOpts = cmd.optsWithGlobals();
14004
14162
  const skillDir = opts.dir || process.cwd();
14005
14163
  try {
@@ -14024,7 +14182,7 @@ function createPublishCommand() {
14024
14182
 
14025
14183
  // src/commands/skill/index.ts
14026
14184
  function createSkillCommand() {
14027
- const command = new Command107("skill").description("Skill management commands");
14185
+ const command = new Command109("skill").description("Skill management commands");
14028
14186
  command.addCommand(createListCommand3());
14029
14187
  command.addCommand(createRunCommand3());
14030
14188
  command.addCommand(createValidateCommand2());
@@ -14037,7 +14195,7 @@ function createSkillCommand() {
14037
14195
 
14038
14196
  // src/commands/snapshot.ts
14039
14197
  init_dist3();
14040
- import { Command as Command108 } from "commander";
14198
+ import { Command as Command110 } from "commander";
14041
14199
  import { execSync as execSync5 } from "child_process";
14042
14200
  import chalk17 from "chalk";
14043
14201
  function getCommitHash3(cwd) {
@@ -14219,7 +14377,7 @@ function registerListCommand2(parent) {
14219
14377
  });
14220
14378
  }
14221
14379
  function createSnapshotCommand() {
14222
- const command = new Command108("snapshot").description("Architecture timeline snapshot commands");
14380
+ const command = new Command110("snapshot").description("Architecture timeline snapshot commands");
14223
14381
  registerCaptureCommand(command);
14224
14382
  registerTrendsCommand(command);
14225
14383
  registerListCommand2(command);
@@ -14227,9 +14385,9 @@ function createSnapshotCommand() {
14227
14385
  }
14228
14386
 
14229
14387
  // src/commands/spec-craft.ts
14230
- import { Command as Command109 } from "commander";
14388
+ import { Command as Command111 } from "commander";
14231
14389
  function createSpecCraftCommand() {
14232
- return new Command109("spec-craft").description(
14390
+ return new Command111("spec-craft").description(
14233
14391
  "LLM-judgment critique of spec quality (proposals + ADRs). Second craft-pipeline ceiling skill; 7 seed rubrics from the spec-quality canon. Per-section critique."
14234
14392
  ).option("-f, --files <files...>", "Optional spec file/glob scope").option("-k, --kinds <kinds...>", "Restrict to proposal / adr (default: both)").option("-s, --sections <names...>", "Restrict to specific canonical section names").option("--max-files <n>", "Cap doc count (default: 50)").option("--max-sections-per-file <n>", "Cap per-doc section critique (default: 10)").action(async (opts, cmd) => {
14235
14393
  const globalOpts = cmd.optsWithGlobals();
@@ -14297,7 +14455,7 @@ ${file}`);
14297
14455
 
14298
14456
  // src/commands/stale-constraints.ts
14299
14457
  init_dist3();
14300
- import { Command as Command110 } from "commander";
14458
+ import { Command as Command112 } from "commander";
14301
14459
  import chalk18 from "chalk";
14302
14460
  var CATEGORIES = [
14303
14461
  "circular-deps",
@@ -14384,7 +14542,7 @@ async function runStaleConstraintsCommand(options) {
14384
14542
  );
14385
14543
  }
14386
14544
  function createStaleConstraintsCommand() {
14387
- return new Command110("stale-constraints").description(
14545
+ return new Command112("stale-constraints").description(
14388
14546
  "Detect architectural constraints not violated within a window (candidates for removal)"
14389
14547
  ).option(
14390
14548
  "--window <days>",
@@ -14402,10 +14560,10 @@ function createStaleConstraintsCommand() {
14402
14560
  }
14403
14561
 
14404
14562
  // src/commands/state/index.ts
14405
- import { Command as Command115 } from "commander";
14563
+ import { Command as Command117 } from "commander";
14406
14564
 
14407
14565
  // src/commands/state/show.ts
14408
- import { Command as Command111 } from "commander";
14566
+ import { Command as Command113 } from "commander";
14409
14567
  import * as path71 from "path";
14410
14568
  function printStateText(state, stream) {
14411
14569
  if (stream) console.log(`Stream: ${stream}`);
@@ -14430,7 +14588,7 @@ function printStateProgress(progress) {
14430
14588
  }
14431
14589
  }
14432
14590
  function createShowCommand() {
14433
- return new Command111("show").description("Show current project state").option("--path <path>", "Project root path", ".").option("--stream <name>", "Target a specific stream").action(async (opts, cmd) => {
14591
+ return new Command113("show").description("Show current project state").option("--path <path>", "Project root path", ".").option("--stream <name>", "Target a specific stream").action(async (opts, cmd) => {
14434
14592
  const globalOpts = cmd.optsWithGlobals();
14435
14593
  const result = await readHarnessState(path71.resolve(opts.path), { stream: opts.stream });
14436
14594
  if (!result.ok) {
@@ -14448,13 +14606,13 @@ function createShowCommand() {
14448
14606
 
14449
14607
  // src/commands/state/reset.ts
14450
14608
  init_dist3();
14451
- import { Command as Command112 } from "commander";
14609
+ import { Command as Command114 } from "commander";
14452
14610
  import * as path72 from "path";
14453
14611
  import * as readline3 from "readline";
14454
14612
  async function confirmReset() {
14455
14613
  const rl = readline3.createInterface({ input: process.stdin, output: process.stdout });
14456
- const answer = await new Promise((resolve50) => {
14457
- rl.question("Reset project state? This cannot be undone. [y/N] ", resolve50);
14614
+ const answer = await new Promise((resolve49) => {
14615
+ rl.question("Reset project state? This cannot be undone. [y/N] ", resolve49);
14458
14616
  });
14459
14617
  rl.close();
14460
14618
  return answer.toLowerCase() === "y" || answer.toLowerCase() === "yes";
@@ -14474,15 +14632,15 @@ async function runReset(opts) {
14474
14632
  process.exit(ExitCode.SUCCESS);
14475
14633
  }
14476
14634
  function createResetCommand() {
14477
- return new Command112("reset").description("Reset project state (truncates the event log to a fresh default)").option("--path <path>", "Project root path", ".").option("--stream <name>", "Target a specific stream").option("--yes", "Skip confirmation prompt").action(async (opts) => runReset(opts));
14635
+ return new Command114("reset").description("Reset project state (truncates the event log to a fresh default)").option("--path <path>", "Project root path", ".").option("--stream <name>", "Target a specific stream").option("--yes", "Skip confirmation prompt").action(async (opts) => runReset(opts));
14478
14636
  }
14479
14637
 
14480
14638
  // src/commands/state/learn.ts
14481
14639
  init_dist3();
14482
- import { Command as Command113 } from "commander";
14640
+ import { Command as Command115 } from "commander";
14483
14641
  import * as path73 from "path";
14484
14642
  function createLearnCommand() {
14485
- return new Command113("learn").description("Append a learning to .harness/learnings.md").argument("<message>", "The learning to record").option("--path <path>", "Project root path", ".").option("--stream <name>", "Target a specific stream").action(async (message, opts, _cmd) => {
14643
+ return new Command115("learn").description("Append a learning to .harness/learnings.md").argument("<message>", "The learning to record").option("--path <path>", "Project root path", ".").option("--stream <name>", "Target a specific stream").action(async (message, opts, _cmd) => {
14486
14644
  const projectPath = path73.resolve(opts.path);
14487
14645
  const result = await appendLearning(projectPath, message, void 0, void 0, opts.stream);
14488
14646
  if (!result.ok) {
@@ -14497,7 +14655,7 @@ function createLearnCommand() {
14497
14655
 
14498
14656
  // src/commands/state/streams.ts
14499
14657
  init_dist3();
14500
- import { Command as Command114 } from "commander";
14658
+ import { Command as Command116 } from "commander";
14501
14659
  import * as path74 from "path";
14502
14660
  async function runListStreams(opts, globalOpts) {
14503
14661
  const projectPath = path74.resolve(opts.path);
@@ -14548,7 +14706,7 @@ async function runActivateStream(name, opts) {
14548
14706
  process.exit(ExitCode.SUCCESS);
14549
14707
  }
14550
14708
  function createStreamsCommand() {
14551
- const command = new Command114("streams").description("Manage state streams");
14709
+ const command = new Command116("streams").description("Manage state streams");
14552
14710
  command.command("list").description("List all known streams").option("--path <path>", "Project root path", ".").action(async (opts, cmd) => runListStreams(opts, cmd.optsWithGlobals()));
14553
14711
  command.command("create <name>").description("Create a new stream").option("--path <path>", "Project root path", ".").option("--branch <branch>", "Associate with a git branch").action(async (name, opts) => runCreateStream(name, opts));
14554
14712
  command.command("archive <name>").description("Archive a stream").option("--path <path>", "Project root path", ".").action(async (name, opts) => runArchiveStream(name, opts));
@@ -14558,7 +14716,7 @@ function createStreamsCommand() {
14558
14716
 
14559
14717
  // src/commands/state/index.ts
14560
14718
  function createStateCommand() {
14561
- const command = new Command115("state").description("Project state management commands");
14719
+ const command = new Command117("state").description("Project state management commands");
14562
14720
  command.addCommand(createShowCommand());
14563
14721
  command.addCommand(createResetCommand());
14564
14722
  command.addCommand(createLearnCommand());
@@ -14569,7 +14727,7 @@ function createStateCommand() {
14569
14727
  // src/commands/sync-analyses.ts
14570
14728
  import * as fs47 from "fs";
14571
14729
  import * as path75 from "path";
14572
- import { Command as Command116 } from "commander";
14730
+ import { Command as Command118 } from "commander";
14573
14731
  init_dist3();
14574
14732
  function isValidRecord(record) {
14575
14733
  return typeof record.issueId === "string" && !!record.issueId && typeof record.identifier === "string" && !!record.identifier && typeof record.analyzedAt === "string" && !/[/\\]/.test(record.issueId);
@@ -14694,7 +14852,7 @@ async function runSyncAnalyses(opts) {
14694
14852
  return;
14695
14853
  }
14696
14854
  const { AnalysisArchive, loadPublishedIndex: loadPublishedIndex2, savePublishedIndex: savePublishedIndex2 } = await import("@harness-engineering/orchestrator");
14697
- const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-SOKOW7BC.js");
14855
+ const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-4CZLCE33.js");
14698
14856
  const adapter = new GitHubIssuesSyncAdapter2({ token, config: trackerConfig });
14699
14857
  const archive = new AnalysisArchive(path75.join(projectPath, ".harness", "analyses"));
14700
14858
  const publishedIndex = loadPublishedIndex2(projectPath);
@@ -14716,7 +14874,7 @@ async function runSyncAnalyses(opts) {
14716
14874
  }
14717
14875
  }
14718
14876
  function createSyncAnalysesCommand() {
14719
- const command = new Command116("sync-analyses").description(
14877
+ const command = new Command118("sync-analyses").description(
14720
14878
  "Pull published intelligence analyses from the external issue tracker into the local .harness/analyses/ directory"
14721
14879
  ).option("-d, --dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
14722
14880
  try {
@@ -14730,7 +14888,7 @@ function createSyncAnalysesCommand() {
14730
14888
  }
14731
14889
 
14732
14890
  // src/commands/sync-main.ts
14733
- import { Command as Command117 } from "commander";
14891
+ import { Command as Command119 } from "commander";
14734
14892
  import * as path76 from "path";
14735
14893
  import {
14736
14894
  syncMain as defaultSyncMain
@@ -14761,7 +14919,7 @@ function formatHuman2(r) {
14761
14919
  }
14762
14920
  }
14763
14921
  function createSyncMainCommand() {
14764
- return new Command117("sync-main").description("Fast-forward the local default branch from origin (no-op on conflict)").option("--json", "Emit a SyncMainResult JSON object", false).option("--path <path>", "Project root path", ".").action(async (opts) => {
14922
+ return new Command119("sync-main").description("Fast-forward the local default branch from origin (no-op on conflict)").option("--json", "Emit a SyncMainResult JSON object", false).option("--path <path>", "Project root path", ".").action(async (opts) => {
14765
14923
  const cwd = path76.resolve(opts.path ?? ".");
14766
14924
  const exitCode = await runSyncMain({ cwd, json: Boolean(opts.json) });
14767
14925
  process.exit(exitCode);
@@ -14770,7 +14928,7 @@ function createSyncMainCommand() {
14770
14928
 
14771
14929
  // src/commands/taint.ts
14772
14930
  init_dist3();
14773
- import { Command as Command118 } from "commander";
14931
+ import { Command as Command120 } from "commander";
14774
14932
  function getProjectRoot() {
14775
14933
  return process.cwd();
14776
14934
  }
@@ -14842,18 +15000,18 @@ function registerStatusCommand(taint) {
14842
15000
  });
14843
15001
  }
14844
15002
  function createTaintCommand() {
14845
- const taint = new Command118("taint").description("Manage sentinel session taint state");
15003
+ const taint = new Command120("taint").description("Manage sentinel session taint state");
14846
15004
  registerClearCommand(taint);
14847
15005
  registerStatusCommand(taint);
14848
15006
  return taint;
14849
15007
  }
14850
15008
 
14851
15009
  // src/commands/telemetry/index.ts
14852
- import { Command as Command122 } from "commander";
15010
+ import { Command as Command124 } from "commander";
14853
15011
 
14854
15012
  // src/commands/telemetry/identify.ts
14855
15013
  init_dist3();
14856
- import { Command as Command119 } from "commander";
15014
+ import { Command as Command121 } from "commander";
14857
15015
  import * as fs48 from "fs";
14858
15016
  import * as path77 from "path";
14859
15017
  function telemetryFilePath(cwd) {
@@ -14877,7 +15035,7 @@ function printIdentity(identity) {
14877
15035
  }
14878
15036
  }
14879
15037
  function createIdentifyCommand() {
14880
- const cmd = new Command119("identify").description("Set or clear telemetry identity fields in .harness/telemetry.json").option("--project <name>", "Project name").option("--team <name>", "Team name").option("--alias <name>", "User alias").option("--clear", "Remove all identity fields").action((opts) => {
15038
+ const cmd = new Command121("identify").description("Set or clear telemetry identity fields in .harness/telemetry.json").option("--project <name>", "Project name").option("--team <name>", "Team name").option("--alias <name>", "User alias").option("--clear", "Remove all identity fields").action((opts) => {
14881
15039
  const cwd = process.cwd();
14882
15040
  if (opts.clear) {
14883
15041
  writeTelemetryFile(cwd, { identity: {} });
@@ -14902,7 +15060,7 @@ function createIdentifyCommand() {
14902
15060
 
14903
15061
  // src/commands/telemetry/status.ts
14904
15062
  init_dist3();
14905
- import { Command as Command120 } from "commander";
15063
+ import { Command as Command122 } from "commander";
14906
15064
  function gatherEnvOverrides() {
14907
15065
  const overrides = {};
14908
15066
  if (process.env.DO_NOT_TRACK) overrides.DO_NOT_TRACK = process.env.DO_NOT_TRACK;
@@ -14943,8 +15101,8 @@ function printHumanStatus(result) {
14943
15101
  printIdentity2(result.identity);
14944
15102
  printEnvOverrides(result.envOverrides);
14945
15103
  }
14946
- function createStatusCommand() {
14947
- const cmd = new Command120("status").description("Show current telemetry consent state, install ID, and identity").option("--json", "Output as JSON").action((opts) => {
15104
+ function createStatusCommand2() {
15105
+ const cmd = new Command122("status").description("Show current telemetry consent state, install ID, and identity").option("--json", "Output as JSON").action((opts) => {
14948
15106
  const cwd = process.cwd();
14949
15107
  const envOverrides = gatherEnvOverrides();
14950
15108
  const consent = resolveConsent(cwd, void 0);
@@ -14977,20 +15135,20 @@ function createStatusCommand() {
14977
15135
 
14978
15136
  // src/commands/telemetry/test.ts
14979
15137
  init_dist3();
14980
- import { Command as Command121 } from "commander";
15138
+ import { Command as Command123 } from "commander";
14981
15139
 
14982
15140
  // src/bin/command-telemetry.ts
14983
15141
  import { existsSync as existsSync44, readFileSync as readFileSync32, mkdirSync as mkdirSync24, appendFileSync as appendFileSync2, writeFileSync as writeFileSync29 } from "fs";
14984
- import { join as join65, parse as parsePath, resolve as resolve47 } from "path";
15142
+ import { join as join65, parse as parsePath, resolve as resolve46 } from "path";
14985
15143
  import { spawn as spawn2 } from "child_process";
14986
15144
  var POSTHOG_API_KEY = "phc_wNTdCMcfJXZPgdNeDociZW6vwoGGo4nb7vqEfWThFfsG";
14987
15145
  var EXCLUDED_COMMANDS = /* @__PURE__ */ new Set(["help", "completion"]);
14988
15146
  function findProjectRoot(cwd) {
14989
- let dir = resolve47(cwd);
15147
+ let dir = resolve46(cwd);
14990
15148
  const { root } = parsePath(dir);
14991
15149
  while (dir !== root) {
14992
15150
  if (existsSync44(join65(dir, "harness.config.json"))) return dir;
14993
- dir = resolve47(dir, "..");
15151
+ dir = resolve46(dir, "..");
14994
15152
  }
14995
15153
  return cwd;
14996
15154
  }
@@ -15099,7 +15257,7 @@ function reportTestSuccess(status, distinctId, identity) {
15099
15257
  if (identity.team) logger.info(` team: ${identity.team}`);
15100
15258
  }
15101
15259
  function createTestCommand() {
15102
- return new Command121("test").description("Send a test event to PostHog and verify connectivity").action(async () => {
15260
+ return new Command123("test").description("Send a test event to PostHog and verify connectivity").action(async () => {
15103
15261
  const cwd = process.cwd();
15104
15262
  const consent = resolveConsent(cwd, void 0);
15105
15263
  if (!consent.allowed) {
@@ -15135,18 +15293,18 @@ function createTestCommand() {
15135
15293
  }
15136
15294
 
15137
15295
  // src/commands/telemetry/index.ts
15138
- function createTelemetryCommand() {
15139
- const command = new Command122("telemetry").description("Telemetry identity and status management");
15296
+ function createTelemetryCommand2() {
15297
+ const command = new Command124("telemetry").description("Telemetry identity and status management");
15140
15298
  command.addCommand(createIdentifyCommand());
15141
- command.addCommand(createStatusCommand());
15299
+ command.addCommand(createStatusCommand2());
15142
15300
  command.addCommand(createTestCommand());
15143
15301
  return command;
15144
15302
  }
15145
15303
 
15146
15304
  // src/commands/test-craft.ts
15147
- import { Command as Command123 } from "commander";
15305
+ import { Command as Command125 } from "commander";
15148
15306
  function createTestCraftCommand() {
15149
- return new Command123("test-craft").description(
15307
+ return new Command125("test-craft").description(
15150
15308
  "LLM-judgment critique of test quality across vitest/jest/mocha/playwright. Fourth craft-pipeline ceiling skill. Per-test critique with best-effort source pairing."
15151
15309
  ).option("-f, --files <files...>", "Optional test file/glob scope").option("--frameworks <names...>", "Restrict to: vitest / jest / mocha / playwright").option("--max-files <n>", "Cap test file count (default: 100)").option("--max-tests-per-file <n>", "Cap per-file test critique (default: 20)").option("--no-source-pair", "Skip source-pairing resolution").action(async (opts, cmd) => {
15152
15310
  const globalOpts = cmd.optsWithGlobals();
@@ -15216,7 +15374,7 @@ ${file}`);
15216
15374
  }
15217
15375
 
15218
15376
  // src/commands/traceability.ts
15219
- import { Command as Command124 } from "commander";
15377
+ import { Command as Command126 } from "commander";
15220
15378
  import chalk19 from "chalk";
15221
15379
  function confidenceLabel(maxConfidence) {
15222
15380
  if (maxConfidence >= 0.8) return "explicit";
@@ -15356,7 +15514,7 @@ async function runTraceability(options) {
15356
15514
  process.exit(ExitCode.SUCCESS);
15357
15515
  }
15358
15516
  function createTraceabilityCommand() {
15359
- return new Command124("traceability").description("Show spec-to-implementation traceability from the knowledge graph").option("--spec <path>", "Filter by spec file path").option("--feature <name>", "Filter by feature name").action(async (opts, cmd) => {
15517
+ return new Command126("traceability").description("Show spec-to-implementation traceability from the knowledge graph").option("--spec <path>", "Filter by spec file path").option("--feature <name>", "Filter by feature name").action(async (opts, cmd) => {
15360
15518
  const globalOpts = cmd.optsWithGlobals();
15361
15519
  await runTraceability({
15362
15520
  spec: opts.spec,
@@ -15370,7 +15528,7 @@ function createTraceabilityCommand() {
15370
15528
 
15371
15529
  // src/commands/uninstall.ts
15372
15530
  import * as path78 from "path";
15373
- import { Command as Command125 } from "commander";
15531
+ import { Command as Command127 } from "commander";
15374
15532
  async function runUninstall(skillName, options) {
15375
15533
  const packageName = resolvePackageName(skillName);
15376
15534
  const shortName = extractSkillName(packageName);
@@ -15407,7 +15565,7 @@ async function runUninstall(skillName, options) {
15407
15565
  return result;
15408
15566
  }
15409
15567
  function createUninstallCommand() {
15410
- const cmd = new Command125("uninstall");
15568
+ const cmd = new Command127("uninstall");
15411
15569
  cmd.description("Uninstall a community skill").argument("<skill>", "Skill name or @harness-skills/scoped package name").option("--force", "Remove even if other skills depend on this one").action(async (skill, opts) => {
15412
15570
  try {
15413
15571
  const result = await runUninstall(skill, opts);
@@ -15429,7 +15587,7 @@ function createUninstallCommand() {
15429
15587
  init_dist3();
15430
15588
  import * as fs49 from "fs/promises";
15431
15589
  import * as path79 from "path";
15432
- import { Command as Command126 } from "commander";
15590
+ import { Command as Command128 } from "commander";
15433
15591
  async function runUninstallConstraints(options) {
15434
15592
  const { packageName, configPath, lockfilePath } = options;
15435
15593
  const lockfileResult = await readLockfile(lockfilePath);
@@ -15486,7 +15644,7 @@ async function runUninstallConstraints(options) {
15486
15644
  };
15487
15645
  }
15488
15646
  function createUninstallConstraintsCommand() {
15489
- const cmd = new Command126("uninstall-constraints");
15647
+ const cmd = new Command128("uninstall-constraints");
15490
15648
  cmd.description("Remove a previously installed constraints package").argument("<name>", "Name of the constraint package to uninstall").option("-c, --config <path>", "Path to harness.config.json").action(async (name, opts) => {
15491
15649
  let configPath;
15492
15650
  if (opts.config) {
@@ -15526,10 +15684,10 @@ function createUninstallConstraintsCommand() {
15526
15684
 
15527
15685
  // src/commands/update.ts
15528
15686
  init_dist3();
15529
- import { Command as Command127 } from "commander";
15687
+ import { Command as Command129 } from "commander";
15530
15688
  import { execFile as execFile2, execFileSync as execFileSync13 } from "child_process";
15531
15689
  import { realpathSync, existsSync as existsSync45, readFileSync as readFileSync33 } from "fs";
15532
- import { dirname as dirname26, join as join68 } from "path";
15690
+ import { dirname as dirname25, join as join68 } from "path";
15533
15691
  import { promisify as promisify2 } from "util";
15534
15692
  import readline4 from "readline";
15535
15693
  import chalk20 from "chalk";
@@ -15610,15 +15768,15 @@ function prompt3(question) {
15610
15768
  input: process.stdin,
15611
15769
  output: process.stdout
15612
15770
  });
15613
- return new Promise((resolve50) => {
15771
+ return new Promise((resolve49) => {
15614
15772
  rl.question(question, (answer) => {
15615
15773
  rl.close();
15616
- resolve50(answer.trim().toLowerCase());
15774
+ resolve49(answer.trim().toLowerCase());
15617
15775
  });
15618
15776
  });
15619
15777
  }
15620
15778
  function findPackageDir(resolvedBin) {
15621
- let dir = dirname26(resolvedBin);
15779
+ let dir = dirname25(resolvedBin);
15622
15780
  for (let i = 0; i < 6; i++) {
15623
15781
  if (existsSync45(join68(dir, "package.json"))) {
15624
15782
  try {
@@ -15627,7 +15785,7 @@ function findPackageDir(resolvedBin) {
15627
15785
  } catch {
15628
15786
  }
15629
15787
  }
15630
- const parent = dirname26(dir);
15788
+ const parent = dirname25(dir);
15631
15789
  if (parent === dir) return null;
15632
15790
  dir = parent;
15633
15791
  }
@@ -15894,7 +16052,7 @@ async function runUpdateAction(opts, globalOpts) {
15894
16052
  process.exit(ExitCode.SUCCESS);
15895
16053
  }
15896
16054
  function createUpdateCommand() {
15897
- return new Command127("update").description("Update all @harness-engineering packages to the latest version").option("--version <semver>", "Pin @harness-engineering/cli to a specific version").option("--force", "Force update even if versions match").option(
16055
+ return new Command129("update").description("Update all @harness-engineering packages to the latest version").option("--version <semver>", "Pin @harness-engineering/cli to a specific version").option("--force", "Force update even if versions match").option(
15898
16056
  "--regenerate",
15899
16057
  "Only regenerate slash commands and agent definitions (skip package updates)"
15900
16058
  ).action(async (opts, cmd) => {
@@ -15904,9 +16062,9 @@ function createUpdateCommand() {
15904
16062
  }
15905
16063
 
15906
16064
  // src/commands/usage.ts
15907
- import { Command as Command128 } from "commander";
16065
+ import { Command as Command130 } from "commander";
15908
16066
  async function loadAndPriceRecords(cwd, includeClaudeSessions = false) {
15909
- const { readCostRecords, loadPricingData, calculateCost, parseCCRecords } = await import("./dist-SOKOW7BC.js");
16067
+ const { readCostRecords, loadPricingData, calculateCost, parseCCRecords } = await import("./dist-4CZLCE33.js");
15910
16068
  const records = readCostRecords(cwd);
15911
16069
  if (includeClaudeSessions) {
15912
16070
  const ccRecords = parseCCRecords();
@@ -15999,7 +16157,7 @@ function registerDailyCommand(usage) {
15999
16157
  else logger.info("No usage data found. Run some harness sessions first.");
16000
16158
  return;
16001
16159
  }
16002
- const { aggregateByDay } = await import("./dist-SOKOW7BC.js");
16160
+ const { aggregateByDay } = await import("./dist-4CZLCE33.js");
16003
16161
  const limited = aggregateByDay(records).slice(0, days);
16004
16162
  if (globalOpts.json) {
16005
16163
  console.log(
@@ -16028,7 +16186,7 @@ function registerSessionsCommand(usage) {
16028
16186
  }
16029
16187
  return;
16030
16188
  }
16031
- const { aggregateBySession } = await import("./dist-SOKOW7BC.js");
16189
+ const { aggregateBySession } = await import("./dist-4CZLCE33.js");
16032
16190
  const sessionData = aggregateBySession(records);
16033
16191
  const limited = sessionData.slice(0, limit);
16034
16192
  if (globalOpts.json) {
@@ -16108,7 +16266,7 @@ function registerSessionCommand(usage) {
16108
16266
  cwd,
16109
16267
  globalOpts.includeClaudeSessions
16110
16268
  );
16111
- const { aggregateBySession } = await import("./dist-SOKOW7BC.js");
16269
+ const { aggregateBySession } = await import("./dist-4CZLCE33.js");
16112
16270
  const sessionData = aggregateBySession(records);
16113
16271
  const match = sessionData.find((s) => s.sessionId === id);
16114
16272
  if (!match) {
@@ -16143,7 +16301,7 @@ function registerLatestCommand(usage) {
16143
16301
  }
16144
16302
  return;
16145
16303
  }
16146
- const { aggregateBySession } = await import("./dist-SOKOW7BC.js");
16304
+ const { aggregateBySession } = await import("./dist-4CZLCE33.js");
16147
16305
  const sessionData = aggregateBySession(records);
16148
16306
  const latest = sessionData[0];
16149
16307
  if (!latest) {
@@ -16169,7 +16327,7 @@ function registerLatestCommand(usage) {
16169
16327
  });
16170
16328
  }
16171
16329
  function createUsageCommand() {
16172
- const usage = new Command128("usage").description("Token usage and cost tracking");
16330
+ const usage = new Command130("usage").description("Token usage and cost tracking");
16173
16331
  usage.option(
16174
16332
  "--include-claude-sessions",
16175
16333
  "Include Claude Code session data from ~/.claude/projects/"
@@ -16184,7 +16342,7 @@ function createUsageCommand() {
16184
16342
  // src/commands/validate.ts
16185
16343
  init_dist3();
16186
16344
  init_dist3();
16187
- import { Command as Command129 } from "commander";
16345
+ import { Command as Command131 } from "commander";
16188
16346
  import * as fs50 from "fs";
16189
16347
  import * as path80 from "path";
16190
16348
  import { execFileSync as execFileSync14 } from "child_process";
@@ -16492,7 +16650,7 @@ function resolveValidateMode(globalOpts) {
16492
16650
  return OutputMode.TEXT;
16493
16651
  }
16494
16652
  async function printCrossCheckWarnings(mode) {
16495
- const { runCrossCheck: runCrossCheck2 } = await import("./validate-cross-check-OF3FPM32.js");
16653
+ const { runCrossCheck: runCrossCheck2 } = await import("./validate-cross-check-YYVYMSPA.js");
16496
16654
  const cwd = process.cwd();
16497
16655
  const crossResult = await runCrossCheck2({
16498
16656
  specsDir: path80.join(cwd, "docs", "specs"),
@@ -16508,7 +16666,7 @@ async function printCrossCheckWarnings(mode) {
16508
16666
  ${crossResult.value.warnings} warnings`);
16509
16667
  }
16510
16668
  function createValidateCommand3() {
16511
- const command = new Command129("validate").description("Run all validation checks").option("--cross-check", "Run cross-artifact consistency validation").option(
16669
+ const command = new Command131("validate").description("Run all validation checks").option("--cross-check", "Run cross-artifact consistency validation").option(
16512
16670
  "--agent-configs",
16513
16671
  "Validate agent configs (CLAUDE.md, hooks, skills) via agnix or built-in fallback rules"
16514
16672
  ).option("--strict", "Treat warnings as errors (applies to --agent-configs)").option("--agnix-bin <path>", "Override the agnix binary path discovered on PATH").action(async (opts, cmd) => runValidateAction(opts, cmd.optsWithGlobals()));
@@ -16557,7 +16715,7 @@ Agent configs checked via ${engineLabel}${note}`);
16557
16715
 
16558
16716
  // src/commands/verify.ts
16559
16717
  init_dist3();
16560
- import { Command as Command130 } from "commander";
16718
+ import { Command as Command132 } from "commander";
16561
16719
  import { execSync as execSync6 } from "child_process";
16562
16720
  function loadBranchingConfig(configPath) {
16563
16721
  const shouldLoad = configPath !== void 0 || findConfigFile().ok;
@@ -16620,7 +16778,7 @@ async function runVerify(options) {
16620
16778
  process.exit(ExitCode.VALIDATION_FAILED);
16621
16779
  }
16622
16780
  function createVerifyCommand() {
16623
- return new Command130("verify").description(
16781
+ return new Command132("verify").description(
16624
16782
  "Verify project conventions (currently: branch naming). Works with or without a harness.config.json."
16625
16783
  ).option(
16626
16784
  "--branch <name>",
@@ -16714,7 +16872,7 @@ var commandCreators = [
16714
16872
  createSyncAnalysesCommand,
16715
16873
  createSyncMainCommand,
16716
16874
  createTaintCommand,
16717
- createTelemetryCommand,
16875
+ createTelemetryCommand2,
16718
16876
  createTestCraftCommand,
16719
16877
  createTraceabilityCommand,
16720
16878
  createUninstallCommand,
@@ -16748,7 +16906,7 @@ function registerDeprecatedGraphAliases(program) {
16748
16906
 
16749
16907
  // src/index.ts
16750
16908
  function createProgram() {
16751
- const program = new Command131();
16909
+ const program = new Command133();
16752
16910
  program.name("harness").description("CLI for Harness Engineering toolkit").version(CLI_VERSION).option("-c, --config <path>", "Path to config file").option("--json", "Output as JSON").option("--verbose", "Verbose output").option("--quiet", "Minimal output");
16753
16911
  for (const creator of commandCreators) {
16754
16912
  program.addCommand(creator());