@harness-engineering/cli 1.25.4 → 1.25.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/skills/claude-code/enforce-architecture/SKILL.md +12 -0
- package/dist/agents/skills/claude-code/harness-api-design/SKILL.md +12 -0
- package/dist/agents/skills/claude-code/harness-architecture-advisor/SKILL.md +12 -0
- package/dist/agents/skills/claude-code/harness-auth/SKILL.md +12 -0
- package/dist/agents/skills/claude-code/harness-code-review/SKILL.md +30 -6
- package/dist/agents/skills/claude-code/harness-database/SKILL.md +12 -0
- package/dist/agents/skills/claude-code/harness-debugging/SKILL.md +38 -6
- package/dist/agents/skills/claude-code/harness-deployment/SKILL.md +12 -0
- package/dist/agents/skills/claude-code/harness-execution/SKILL.md +30 -6
- package/dist/agents/skills/claude-code/harness-planning/SKILL.md +20 -9
- package/dist/agents/skills/claude-code/harness-pre-commit-review/SKILL.md +59 -6
- package/dist/agents/skills/claude-code/harness-refactoring/SKILL.md +28 -7
- package/dist/agents/skills/claude-code/harness-security-scan/SKILL.md +12 -0
- package/dist/agents/skills/claude-code/harness-skill-authoring/SKILL.md +43 -8
- package/dist/agents/skills/claude-code/harness-soundness-review/SKILL.md +59 -7
- package/dist/agents/skills/claude-code/harness-tdd/SKILL.md +21 -0
- package/dist/agents/skills/claude-code/harness-verification/SKILL.md +31 -6
- package/dist/agents/skills/codex/enforce-architecture/SKILL.md +12 -0
- package/dist/agents/skills/codex/harness-api-design/SKILL.md +12 -0
- package/dist/agents/skills/codex/harness-architecture-advisor/SKILL.md +12 -0
- package/dist/agents/skills/codex/harness-auth/SKILL.md +12 -0
- package/dist/agents/skills/codex/harness-code-review/SKILL.md +30 -6
- package/dist/agents/skills/codex/harness-database/SKILL.md +12 -0
- package/dist/agents/skills/codex/harness-debugging/SKILL.md +38 -6
- package/dist/agents/skills/codex/harness-deployment/SKILL.md +12 -0
- package/dist/agents/skills/codex/harness-execution/SKILL.md +30 -6
- package/dist/agents/skills/codex/harness-planning/SKILL.md +20 -9
- package/dist/agents/skills/codex/harness-pre-commit-review/SKILL.md +59 -6
- package/dist/agents/skills/codex/harness-refactoring/SKILL.md +28 -7
- package/dist/agents/skills/codex/harness-security-scan/SKILL.md +12 -0
- package/dist/agents/skills/codex/harness-skill-authoring/SKILL.md +43 -8
- package/dist/agents/skills/codex/harness-soundness-review/SKILL.md +59 -7
- package/dist/agents/skills/codex/harness-tdd/SKILL.md +21 -0
- package/dist/agents/skills/codex/harness-verification/SKILL.md +31 -6
- package/dist/agents/skills/cursor/enforce-architecture/SKILL.md +12 -0
- package/dist/agents/skills/cursor/harness-api-design/SKILL.md +12 -0
- package/dist/agents/skills/cursor/harness-architecture-advisor/SKILL.md +12 -0
- package/dist/agents/skills/cursor/harness-auth/SKILL.md +12 -0
- package/dist/agents/skills/cursor/harness-code-review/SKILL.md +30 -6
- package/dist/agents/skills/cursor/harness-database/SKILL.md +12 -0
- package/dist/agents/skills/cursor/harness-debugging/SKILL.md +38 -6
- package/dist/agents/skills/cursor/harness-deployment/SKILL.md +12 -0
- package/dist/agents/skills/cursor/harness-execution/SKILL.md +30 -6
- package/dist/agents/skills/cursor/harness-planning/SKILL.md +20 -9
- package/dist/agents/skills/cursor/harness-pre-commit-review/SKILL.md +59 -6
- package/dist/agents/skills/cursor/harness-refactoring/SKILL.md +28 -7
- package/dist/agents/skills/cursor/harness-security-scan/SKILL.md +12 -0
- package/dist/agents/skills/cursor/harness-skill-authoring/SKILL.md +43 -8
- package/dist/agents/skills/cursor/harness-soundness-review/SKILL.md +59 -7
- package/dist/agents/skills/cursor/harness-tdd/SKILL.md +21 -0
- package/dist/agents/skills/cursor/harness-verification/SKILL.md +31 -6
- package/dist/agents/skills/gemini-cli/enforce-architecture/SKILL.md +12 -0
- package/dist/agents/skills/gemini-cli/harness-api-design/SKILL.md +12 -0
- package/dist/agents/skills/gemini-cli/harness-architecture-advisor/SKILL.md +12 -0
- package/dist/agents/skills/gemini-cli/harness-auth/SKILL.md +12 -0
- package/dist/agents/skills/gemini-cli/harness-code-review/SKILL.md +30 -6
- package/dist/agents/skills/gemini-cli/harness-database/SKILL.md +12 -0
- package/dist/agents/skills/gemini-cli/harness-debugging/SKILL.md +38 -6
- package/dist/agents/skills/gemini-cli/harness-deployment/SKILL.md +12 -0
- package/dist/agents/skills/gemini-cli/harness-execution/SKILL.md +30 -6
- package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +20 -9
- package/dist/agents/skills/gemini-cli/harness-pre-commit-review/SKILL.md +59 -6
- package/dist/agents/skills/gemini-cli/harness-refactoring/SKILL.md +28 -7
- package/dist/agents/skills/gemini-cli/harness-security-scan/SKILL.md +12 -0
- package/dist/agents/skills/gemini-cli/harness-skill-authoring/SKILL.md +43 -8
- package/dist/agents/skills/gemini-cli/harness-soundness-review/SKILL.md +59 -7
- package/dist/agents/skills/gemini-cli/harness-tdd/SKILL.md +21 -0
- package/dist/agents/skills/gemini-cli/harness-verification/SKILL.md +31 -6
- package/dist/{agents-md-MCUM4SIZ.js → agents-md-COWXFHR5.js} +2 -2
- package/dist/{architecture-HNIO6AUX.js → architecture-EYPG4ZMC.js} +3 -3
- package/dist/{assess-project-6MV5TNY3.js → assess-project-JQPEVJIA.js} +1 -1
- package/dist/bin/harness-mcp.js +13 -13
- package/dist/bin/harness.js +23 -112
- package/dist/{check-phase-gate-VCBQHQAC.js → check-phase-gate-AJRMDGYW.js} +3 -3
- package/dist/{chunk-6VZQJ5CX.js → chunk-24ZGGCIW.js} +1 -1
- package/dist/{chunk-GEEYCQDS.js → chunk-2OIPQMU5.js} +5 -5
- package/dist/{chunk-2KZAXESR.js → chunk-2OM5TA56.js} +205 -55
- package/dist/{chunk-FES2YEQU.js → chunk-2TFT7XRX.js} +3 -3
- package/dist/{chunk-AT74HEQM.js → chunk-2X336Q7J.js} +1 -1
- package/dist/{chunk-BUYW3SA2.js → chunk-2X42NMPD.js} +68 -68
- package/dist/{chunk-WIQA4BSH.js → chunk-5R2LFUU3.js} +1 -1
- package/dist/{chunk-FIQL2HND.js → chunk-BVRWLK5U.js} +2 -2
- package/dist/{chunk-F23H3U5U.js → chunk-HWLHJSJQ.js} +2 -2
- package/dist/{chunk-CXJTVICF.js → chunk-JD4FGVHH.js} +2 -2
- package/dist/{chunk-FSNPBT74.js → chunk-KDHZAL4B.js} +1 -1
- package/dist/{chunk-MI6MA6OP.js → chunk-KHMKAC6E.js} +71 -32
- package/dist/{chunk-UQZBZINS.js → chunk-KVK3KAFQ.js} +6 -6
- package/dist/{chunk-P7PANON5.js → chunk-KWQTMJ3B.js} +1 -1
- package/dist/{chunk-XTITAVUR.js → chunk-KXUCIAM4.js} +1 -1
- package/dist/{chunk-TYV4EUAD.js → chunk-PVRKHUTA.js} +6 -6
- package/dist/{chunk-YTP2UDPV.js → chunk-Q6ZEUMOF.js} +3 -3
- package/dist/{chunk-UV3BZMGT.js → chunk-UB6NZNJJ.js} +2 -2
- package/dist/{chunk-47N6R2F4.js → chunk-UI6NWJJK.js} +1 -1
- package/dist/{chunk-EHRZMOQ2.js → chunk-WN6YIQ66.js} +1 -1
- package/dist/{chunk-M55DGGF3.js → chunk-YFIALHGI.js} +3 -3
- package/dist/{chunk-5BQ5BOJL.js → chunk-ZYYVDA5K.js} +1 -1
- package/dist/{ci-workflow-RTM7VVTD.js → ci-workflow-35KBJC2U.js} +2 -2
- package/dist/{dist-WCSJHQPK.js → dist-UMONICND.js} +15 -1
- package/dist/{docs-UBOGGHTY.js → docs-T5J2AJH6.js} +3 -3
- package/dist/{engine-MJJAP5CH.js → engine-KWHV2LUX.js} +2 -2
- package/dist/{entropy-EMSXF2PX.js → entropy-GEBHWBPR.js} +2 -2
- package/dist/{feedback-ZLUX72HD.js → feedback-I4QPE3RI.js} +1 -1
- package/dist/{generate-agent-definitions-AWLPJ27C.js → generate-agent-definitions-3XNR77ET.js} +3 -3
- package/dist/hooks/telemetry-reporter.js +22 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +22 -22
- package/dist/{loader-JVSJZSWZ.js → loader-MN2CZXPG.js} +2 -2
- package/dist/{mcp-JZ7YB7TD.js → mcp-XSU77BZY.js} +13 -13
- package/dist/{performance-7AGWJUY4.js → performance-7I5MCEFP.js} +3 -3
- package/dist/{review-pipeline-ZWVQJTJX.js → review-pipeline-PWPKJXSN.js} +2 -2
- package/dist/{runtime-D6YUQPP2.js → runtime-ZYEFJSGS.js} +2 -2
- package/dist/{security-JLZUAQYT.js → security-OVTGS7DL.js} +1 -1
- package/dist/{validate-TIIHRPMA.js → validate-ACIP5BUO.js} +3 -3
- package/dist/{validate-cross-check-ZOWFA3DB.js → validate-cross-check-OWITNCHN.js} +2 -2
- package/package.json +5 -5
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateAgentsMd
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZYYVDA5K.js";
|
|
4
4
|
import {
|
|
5
5
|
generateCIWorkflow
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WN6YIQ66.js";
|
|
7
7
|
import {
|
|
8
8
|
TemplateEngine
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KDHZAL4B.js";
|
|
10
10
|
import {
|
|
11
11
|
generate,
|
|
12
12
|
validate
|
|
13
13
|
} from "./chunk-CQ553GZO.js";
|
|
14
14
|
import {
|
|
15
15
|
generateRuntime
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-24ZGGCIW.js";
|
|
17
17
|
import {
|
|
18
18
|
runPersona
|
|
19
19
|
} from "./chunk-GISMXMVL.js";
|
|
@@ -28,18 +28,18 @@ import {
|
|
|
28
28
|
OutputMode,
|
|
29
29
|
createCheckPhaseGateCommand,
|
|
30
30
|
findFiles
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-BVRWLK5U.js";
|
|
32
32
|
import {
|
|
33
33
|
createGenerateAgentDefinitionsCommand,
|
|
34
34
|
generateAgentDefinitions
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-2X336Q7J.js";
|
|
36
36
|
import {
|
|
37
37
|
toKebabCase
|
|
38
38
|
} from "./chunk-KET4QQZB.js";
|
|
39
39
|
import {
|
|
40
40
|
listPersonas,
|
|
41
41
|
loadPersona
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-KWQTMJ3B.js";
|
|
43
43
|
import {
|
|
44
44
|
createScanCommand
|
|
45
45
|
} from "./chunk-4NK7Z3BP.js";
|
|
@@ -56,11 +56,11 @@ import {
|
|
|
56
56
|
loadOrRebuildIndex,
|
|
57
57
|
persistToolingConfig,
|
|
58
58
|
recommend
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-2X42NMPD.js";
|
|
60
60
|
import {
|
|
61
61
|
findConfigFile,
|
|
62
62
|
resolveConfig
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-5R2LFUU3.js";
|
|
64
64
|
import {
|
|
65
65
|
VALID_PLATFORMS
|
|
66
66
|
} from "./chunk-3ISINLYT.js";
|
|
@@ -148,7 +148,7 @@ import {
|
|
|
148
148
|
validateKnowledgeMap,
|
|
149
149
|
writeConfig,
|
|
150
150
|
writeLockfile
|
|
151
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-KHMKAC6E.js";
|
|
152
152
|
import {
|
|
153
153
|
Err,
|
|
154
154
|
Ok
|
|
@@ -173,7 +173,7 @@ import {
|
|
|
173
173
|
} from "./chunk-KFQGP6VL.js";
|
|
174
174
|
|
|
175
175
|
// src/index.ts
|
|
176
|
-
import { Command as
|
|
176
|
+
import { Command as Command84 } from "commander";
|
|
177
177
|
|
|
178
178
|
// src/commands/add.ts
|
|
179
179
|
init_dist();
|
|
@@ -362,7 +362,7 @@ function registerSkillsCommand(adoption) {
|
|
|
362
362
|
const globalOpts = cmd.optsWithGlobals();
|
|
363
363
|
const limit = Math.max(parseInt(opts.limit, 10) || 20, 1);
|
|
364
364
|
const cwd = process.cwd();
|
|
365
|
-
const { readAdoptionRecords, aggregateBySkill } = await import("./dist-
|
|
365
|
+
const { readAdoptionRecords, aggregateBySkill } = await import("./dist-UMONICND.js");
|
|
366
366
|
const records = readAdoptionRecords(cwd);
|
|
367
367
|
if (records.length === 0) {
|
|
368
368
|
if (globalOpts.json) {
|
|
@@ -398,7 +398,7 @@ function registerRecentCommand(adoption) {
|
|
|
398
398
|
const globalOpts = cmd.optsWithGlobals();
|
|
399
399
|
const limit = Math.max(parseInt(opts.limit, 10) || 20, 1);
|
|
400
400
|
const cwd = process.cwd();
|
|
401
|
-
const { readAdoptionRecords } = await import("./dist-
|
|
401
|
+
const { readAdoptionRecords } = await import("./dist-UMONICND.js");
|
|
402
402
|
const records = readAdoptionRecords(cwd);
|
|
403
403
|
if (records.length === 0) {
|
|
404
404
|
if (globalOpts.json) {
|
|
@@ -435,7 +435,7 @@ function registerSkillCommand(adoption) {
|
|
|
435
435
|
adoption.command("skill <name>").description("Show detail for a specific skill").action(async (name, _opts, cmd) => {
|
|
436
436
|
const globalOpts = cmd.optsWithGlobals();
|
|
437
437
|
const cwd = process.cwd();
|
|
438
|
-
const { readAdoptionRecords, aggregateBySkill } = await import("./dist-
|
|
438
|
+
const { readAdoptionRecords, aggregateBySkill } = await import("./dist-UMONICND.js");
|
|
439
439
|
const records = readAdoptionRecords(cwd);
|
|
440
440
|
const skillRecords = records.filter((r) => r.skill === name);
|
|
441
441
|
if (skillRecords.length === 0) {
|
|
@@ -5428,7 +5428,7 @@ function createMcpCommand() {
|
|
|
5428
5428
|
parseBudget
|
|
5429
5429
|
).action(async (opts) => {
|
|
5430
5430
|
const [{ startServer: startServer2, getToolDefinitions: getToolDefinitions2 }, { selectTier }] = await Promise.all([
|
|
5431
|
-
import("./mcp-
|
|
5431
|
+
import("./mcp-XSU77BZY.js"),
|
|
5432
5432
|
import("./tool-tiers-7QGZ3FKY.js")
|
|
5433
5433
|
]);
|
|
5434
5434
|
if (opts.tools && opts.tools.length > 0) {
|
|
@@ -5494,7 +5494,7 @@ function registerBenchCommand(perf) {
|
|
|
5494
5494
|
perf.command("bench [glob]").description("Run benchmarks via vitest bench").action(async (glob2, _opts, cmd) => {
|
|
5495
5495
|
const globalOpts = cmd.optsWithGlobals();
|
|
5496
5496
|
const cwd = process.cwd();
|
|
5497
|
-
const { BenchmarkRunner } = await import("./dist-
|
|
5497
|
+
const { BenchmarkRunner } = await import("./dist-UMONICND.js");
|
|
5498
5498
|
const runner = new BenchmarkRunner();
|
|
5499
5499
|
const benchFiles = runner.discover(cwd, glob2);
|
|
5500
5500
|
if (benchFiles.length === 0) {
|
|
@@ -5558,7 +5558,7 @@ async function runBaselinesShow(globalOpts) {
|
|
|
5558
5558
|
}
|
|
5559
5559
|
async function runBaselinesUpdate(globalOpts) {
|
|
5560
5560
|
const cwd = process.cwd();
|
|
5561
|
-
const { BenchmarkRunner } = await import("./dist-
|
|
5561
|
+
const { BenchmarkRunner } = await import("./dist-UMONICND.js");
|
|
5562
5562
|
const runner = new BenchmarkRunner();
|
|
5563
5563
|
const manager = new BaselineManager(cwd);
|
|
5564
5564
|
logger.info("Running benchmarks to update baselines...");
|
|
@@ -5599,7 +5599,7 @@ function registerReportCommand(perf) {
|
|
|
5599
5599
|
perf.command("report").description("Full performance report with metrics, trends, and hotspots").action(async (_opts, cmd) => {
|
|
5600
5600
|
const globalOpts = cmd.optsWithGlobals();
|
|
5601
5601
|
const cwd = process.cwd();
|
|
5602
|
-
const { EntropyAnalyzer: EntropyAnalyzer2 } = await import("./dist-
|
|
5602
|
+
const { EntropyAnalyzer: EntropyAnalyzer2 } = await import("./dist-UMONICND.js");
|
|
5603
5603
|
const analyzer = new EntropyAnalyzer2({
|
|
5604
5604
|
rootDir: path40.resolve(cwd),
|
|
5605
5605
|
analyze: { complexity: true, coupling: true }
|
|
@@ -5990,7 +5990,7 @@ async function runPublishAnalyses(opts) {
|
|
|
5990
5990
|
const nameToExternalId = buildNameToExternalIdMap(projectPath);
|
|
5991
5991
|
if (!nameToExternalId) return process.exit(1);
|
|
5992
5992
|
const { AnalysisArchive } = await import("@harness-engineering/orchestrator");
|
|
5993
|
-
const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-
|
|
5993
|
+
const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-UMONICND.js");
|
|
5994
5994
|
const archive = new AnalysisArchive(path42.join(projectPath, ".harness", "analyses"));
|
|
5995
5995
|
const analyses = await archive.list();
|
|
5996
5996
|
if (analyses.length === 0) {
|
|
@@ -6275,10 +6275,10 @@ function prompt(question) {
|
|
|
6275
6275
|
input: process.stdin,
|
|
6276
6276
|
output: process.stdout
|
|
6277
6277
|
});
|
|
6278
|
-
return new Promise((
|
|
6278
|
+
return new Promise((resolve36) => {
|
|
6279
6279
|
rl.question(question, (answer) => {
|
|
6280
6280
|
rl.close();
|
|
6281
|
-
|
|
6281
|
+
resolve36(answer.trim().toLowerCase());
|
|
6282
6282
|
});
|
|
6283
6283
|
});
|
|
6284
6284
|
}
|
|
@@ -6287,10 +6287,10 @@ function promptRaw(question) {
|
|
|
6287
6287
|
input: process.stdin,
|
|
6288
6288
|
output: process.stdout
|
|
6289
6289
|
});
|
|
6290
|
-
return new Promise((
|
|
6290
|
+
return new Promise((resolve36) => {
|
|
6291
6291
|
rl.question(question, (answer) => {
|
|
6292
6292
|
rl.close();
|
|
6293
|
-
|
|
6293
|
+
resolve36(answer.trim());
|
|
6294
6294
|
});
|
|
6295
6295
|
});
|
|
6296
6296
|
}
|
|
@@ -7790,8 +7790,8 @@ async function resolveStatePath(projectPath, stream) {
|
|
|
7790
7790
|
}
|
|
7791
7791
|
async function confirmReset() {
|
|
7792
7792
|
const rl = readline2.createInterface({ input: process.stdin, output: process.stdout });
|
|
7793
|
-
const answer = await new Promise((
|
|
7794
|
-
rl.question("Reset project state? This cannot be undone. [y/N] ",
|
|
7793
|
+
const answer = await new Promise((resolve36) => {
|
|
7794
|
+
rl.question("Reset project state? This cannot be undone. [y/N] ", resolve36);
|
|
7795
7795
|
});
|
|
7796
7796
|
rl.close();
|
|
7797
7797
|
return answer.toLowerCase() === "y" || answer.toLowerCase() === "yes";
|
|
@@ -8019,7 +8019,7 @@ async function runSyncAnalyses(opts) {
|
|
|
8019
8019
|
return;
|
|
8020
8020
|
}
|
|
8021
8021
|
const { AnalysisArchive, loadPublishedIndex: loadPublishedIndex2, savePublishedIndex: savePublishedIndex2 } = await import("@harness-engineering/orchestrator");
|
|
8022
|
-
const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-
|
|
8022
|
+
const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-UMONICND.js");
|
|
8023
8023
|
const adapter = new GitHubIssuesSyncAdapter2({ token, config: trackerConfig });
|
|
8024
8024
|
const archive = new AnalysisArchive(path58.join(projectPath, ".harness", "analyses"));
|
|
8025
8025
|
const publishedIndex = loadPublishedIndex2(projectPath);
|
|
@@ -8135,7 +8135,7 @@ function createTaintCommand() {
|
|
|
8135
8135
|
}
|
|
8136
8136
|
|
|
8137
8137
|
// src/commands/telemetry/index.ts
|
|
8138
|
-
import { Command as
|
|
8138
|
+
import { Command as Command77 } from "commander";
|
|
8139
8139
|
|
|
8140
8140
|
// src/commands/telemetry/identify.ts
|
|
8141
8141
|
init_dist();
|
|
@@ -8257,16 +8257,165 @@ function createStatusCommand() {
|
|
|
8257
8257
|
return cmd;
|
|
8258
8258
|
}
|
|
8259
8259
|
|
|
8260
|
+
// src/commands/telemetry/test.ts
|
|
8261
|
+
init_dist();
|
|
8262
|
+
import { Command as Command76 } from "commander";
|
|
8263
|
+
|
|
8264
|
+
// src/bin/command-telemetry.ts
|
|
8265
|
+
import { existsSync as existsSync36, readFileSync as readFileSync25, mkdirSync as mkdirSync15, appendFileSync, writeFileSync as writeFileSync18 } from "fs";
|
|
8266
|
+
import { join as join45, parse as parsePath, resolve as resolve33 } from "path";
|
|
8267
|
+
import { spawn as spawn2 } from "child_process";
|
|
8268
|
+
var POSTHOG_API_KEY = "phc_wNTdCMcfJXZPgdNeDociZW6vwoGGo4nb7vqEfWThFfsG";
|
|
8269
|
+
var EXCLUDED_COMMANDS = /* @__PURE__ */ new Set(["help", "completion"]);
|
|
8270
|
+
function findProjectRoot(cwd) {
|
|
8271
|
+
let dir = resolve33(cwd);
|
|
8272
|
+
const { root } = parsePath(dir);
|
|
8273
|
+
while (dir !== root) {
|
|
8274
|
+
if (existsSync36(join45(dir, "harness.config.json"))) return dir;
|
|
8275
|
+
dir = resolve33(dir, "..");
|
|
8276
|
+
}
|
|
8277
|
+
return cwd;
|
|
8278
|
+
}
|
|
8279
|
+
var commandName = "";
|
|
8280
|
+
var startTime = 0;
|
|
8281
|
+
var recorded = false;
|
|
8282
|
+
function installCommandTelemetry(program, cwd) {
|
|
8283
|
+
if (typeof program.hook !== "function") return;
|
|
8284
|
+
const projectRoot = findProjectRoot(cwd);
|
|
8285
|
+
flushTelemetryBackground(projectRoot);
|
|
8286
|
+
program.hook("preAction", (thisCommand) => {
|
|
8287
|
+
commandName = resolveCommandName(thisCommand);
|
|
8288
|
+
startTime = Date.now();
|
|
8289
|
+
});
|
|
8290
|
+
process.on("exit", (code) => {
|
|
8291
|
+
if (recorded || !commandName || EXCLUDED_COMMANDS.has(commandName)) return;
|
|
8292
|
+
recorded = true;
|
|
8293
|
+
const duration = Date.now() - startTime;
|
|
8294
|
+
const outcome = code === 0 ? "completed" : "failed";
|
|
8295
|
+
writeCommandRecordSync(projectRoot, commandName, duration, outcome);
|
|
8296
|
+
});
|
|
8297
|
+
}
|
|
8298
|
+
function resolveCommandName(cmd) {
|
|
8299
|
+
const parts = [];
|
|
8300
|
+
let current = cmd;
|
|
8301
|
+
while (current) {
|
|
8302
|
+
const name = current.name();
|
|
8303
|
+
if (name && name !== "harness") {
|
|
8304
|
+
parts.unshift(name);
|
|
8305
|
+
}
|
|
8306
|
+
current = current.parent;
|
|
8307
|
+
}
|
|
8308
|
+
return parts.length > 0 ? `cli/${parts.join(".")}` : "";
|
|
8309
|
+
}
|
|
8310
|
+
function writeCommandRecordSync(cwd, command, duration, outcome) {
|
|
8311
|
+
try {
|
|
8312
|
+
const metricsDir = join45(cwd, ".harness", "metrics");
|
|
8313
|
+
mkdirSync15(metricsDir, { recursive: true });
|
|
8314
|
+
const record = {
|
|
8315
|
+
skill: command,
|
|
8316
|
+
session: `cli-${Date.now()}`,
|
|
8317
|
+
startedAt: new Date(Date.now() - duration).toISOString(),
|
|
8318
|
+
duration,
|
|
8319
|
+
outcome,
|
|
8320
|
+
phasesReached: []
|
|
8321
|
+
};
|
|
8322
|
+
const adoptionFile = join45(metricsDir, "adoption.jsonl");
|
|
8323
|
+
appendFileSync(adoptionFile, JSON.stringify(record) + "\n");
|
|
8324
|
+
} catch {
|
|
8325
|
+
}
|
|
8326
|
+
}
|
|
8327
|
+
function flushTelemetryBackground(cwd) {
|
|
8328
|
+
try {
|
|
8329
|
+
const adoptionFile = join45(cwd, ".harness", "metrics", "adoption.jsonl");
|
|
8330
|
+
if (!existsSync36(adoptionFile)) return;
|
|
8331
|
+
const configPath = join45(cwd, "harness.config.json");
|
|
8332
|
+
if (existsSync36(configPath)) {
|
|
8333
|
+
try {
|
|
8334
|
+
const config = JSON.parse(readFileSync25(configPath, "utf-8"));
|
|
8335
|
+
if (config?.telemetry?.enabled === false) return;
|
|
8336
|
+
} catch {
|
|
8337
|
+
}
|
|
8338
|
+
}
|
|
8339
|
+
if (process.env.DO_NOT_TRACK === "1") return;
|
|
8340
|
+
if (process.env.HARNESS_TELEMETRY_OPTOUT === "1") return;
|
|
8341
|
+
const reporterPath = join45(cwd, ".harness", "hooks", "telemetry-reporter.js");
|
|
8342
|
+
if (!existsSync36(reporterPath)) return;
|
|
8343
|
+
const child = spawn2(process.execPath, [reporterPath], {
|
|
8344
|
+
cwd,
|
|
8345
|
+
stdio: ["pipe", "ignore", "ignore"],
|
|
8346
|
+
detached: true
|
|
8347
|
+
});
|
|
8348
|
+
child.stdin?.write("{}");
|
|
8349
|
+
child.stdin?.end();
|
|
8350
|
+
child.unref();
|
|
8351
|
+
} catch {
|
|
8352
|
+
}
|
|
8353
|
+
}
|
|
8354
|
+
|
|
8355
|
+
// src/commands/telemetry/test.ts
|
|
8356
|
+
var POSTHOG_BATCH_URL = "https://app.posthog.com/batch";
|
|
8357
|
+
function createTestCommand() {
|
|
8358
|
+
return new Command76("test").description("Send a test event to PostHog and verify connectivity").action(async () => {
|
|
8359
|
+
const cwd = process.cwd();
|
|
8360
|
+
const consent = resolveConsent(cwd, void 0);
|
|
8361
|
+
if (!consent.allowed) {
|
|
8362
|
+
logger.error("Telemetry is disabled. Run `harness telemetry status` for details.");
|
|
8363
|
+
process.exitCode = 1;
|
|
8364
|
+
return;
|
|
8365
|
+
}
|
|
8366
|
+
const { installId, identity } = consent;
|
|
8367
|
+
const distinctId = identity.alias ?? installId;
|
|
8368
|
+
const event = {
|
|
8369
|
+
event: "telemetry_test",
|
|
8370
|
+
distinct_id: distinctId,
|
|
8371
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
8372
|
+
properties: {
|
|
8373
|
+
installId,
|
|
8374
|
+
os: process.platform,
|
|
8375
|
+
nodeVersion: process.version,
|
|
8376
|
+
test: true,
|
|
8377
|
+
...identity.project ? { project: identity.project } : {},
|
|
8378
|
+
...identity.team ? { team: identity.team } : {}
|
|
8379
|
+
}
|
|
8380
|
+
};
|
|
8381
|
+
const payload = JSON.stringify({ api_key: POSTHOG_API_KEY, batch: [event] });
|
|
8382
|
+
logger.info(`Sending test event as "${distinctId}"...`);
|
|
8383
|
+
try {
|
|
8384
|
+
const res = await fetch(POSTHOG_BATCH_URL, {
|
|
8385
|
+
method: "POST",
|
|
8386
|
+
headers: { "Content-Type": "application/json" },
|
|
8387
|
+
body: payload,
|
|
8388
|
+
signal: AbortSignal.timeout(1e4)
|
|
8389
|
+
});
|
|
8390
|
+
const body = await res.text();
|
|
8391
|
+
if (res.ok) {
|
|
8392
|
+
logger.success(`PostHog responded ${res.status} OK \u2014 telemetry is working`);
|
|
8393
|
+
logger.info(` distinct_id: ${distinctId}`);
|
|
8394
|
+
if (identity.project) logger.info(` project: ${identity.project}`);
|
|
8395
|
+
if (identity.team) logger.info(` team: ${identity.team}`);
|
|
8396
|
+
} else {
|
|
8397
|
+
logger.error(`PostHog responded ${res.status}: ${body}`);
|
|
8398
|
+
process.exitCode = 1;
|
|
8399
|
+
}
|
|
8400
|
+
} catch (err) {
|
|
8401
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
8402
|
+
logger.error(`Failed to reach PostHog: ${msg}`);
|
|
8403
|
+
process.exitCode = 1;
|
|
8404
|
+
}
|
|
8405
|
+
});
|
|
8406
|
+
}
|
|
8407
|
+
|
|
8260
8408
|
// src/commands/telemetry/index.ts
|
|
8261
8409
|
function createTelemetryCommand() {
|
|
8262
|
-
const command = new
|
|
8410
|
+
const command = new Command77("telemetry").description("Telemetry identity and status management");
|
|
8263
8411
|
command.addCommand(createIdentifyCommand());
|
|
8264
8412
|
command.addCommand(createStatusCommand());
|
|
8413
|
+
command.addCommand(createTestCommand());
|
|
8265
8414
|
return command;
|
|
8266
8415
|
}
|
|
8267
8416
|
|
|
8268
8417
|
// src/commands/traceability.ts
|
|
8269
|
-
import { Command as
|
|
8418
|
+
import { Command as Command78 } from "commander";
|
|
8270
8419
|
import chalk11 from "chalk";
|
|
8271
8420
|
function confidenceLabel(maxConfidence) {
|
|
8272
8421
|
if (maxConfidence >= 0.8) return "explicit";
|
|
@@ -8397,7 +8546,7 @@ async function runTraceability(options) {
|
|
|
8397
8546
|
process.exit(ExitCode.SUCCESS);
|
|
8398
8547
|
}
|
|
8399
8548
|
function createTraceabilityCommand() {
|
|
8400
|
-
return new
|
|
8549
|
+
return new Command78("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) => {
|
|
8401
8550
|
const globalOpts = cmd.optsWithGlobals();
|
|
8402
8551
|
await runTraceability({
|
|
8403
8552
|
spec: opts.spec,
|
|
@@ -8411,7 +8560,7 @@ function createTraceabilityCommand() {
|
|
|
8411
8560
|
|
|
8412
8561
|
// src/commands/uninstall.ts
|
|
8413
8562
|
import * as path60 from "path";
|
|
8414
|
-
import { Command as
|
|
8563
|
+
import { Command as Command79 } from "commander";
|
|
8415
8564
|
async function runUninstall(skillName, options) {
|
|
8416
8565
|
const packageName = resolvePackageName(skillName);
|
|
8417
8566
|
const shortName = extractSkillName(packageName);
|
|
@@ -8448,7 +8597,7 @@ async function runUninstall(skillName, options) {
|
|
|
8448
8597
|
return result;
|
|
8449
8598
|
}
|
|
8450
8599
|
function createUninstallCommand() {
|
|
8451
|
-
const cmd = new
|
|
8600
|
+
const cmd = new Command79("uninstall");
|
|
8452
8601
|
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) => {
|
|
8453
8602
|
try {
|
|
8454
8603
|
const result = await runUninstall(skill, opts);
|
|
@@ -8470,7 +8619,7 @@ function createUninstallCommand() {
|
|
|
8470
8619
|
init_dist();
|
|
8471
8620
|
import * as fs40 from "fs/promises";
|
|
8472
8621
|
import * as path61 from "path";
|
|
8473
|
-
import { Command as
|
|
8622
|
+
import { Command as Command80 } from "commander";
|
|
8474
8623
|
async function runUninstallConstraints(options) {
|
|
8475
8624
|
const { packageName, configPath, lockfilePath } = options;
|
|
8476
8625
|
const lockfileResult = await readLockfile(lockfilePath);
|
|
@@ -8527,7 +8676,7 @@ async function runUninstallConstraints(options) {
|
|
|
8527
8676
|
};
|
|
8528
8677
|
}
|
|
8529
8678
|
function createUninstallConstraintsCommand() {
|
|
8530
|
-
const cmd = new
|
|
8679
|
+
const cmd = new Command80("uninstall-constraints");
|
|
8531
8680
|
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) => {
|
|
8532
8681
|
let configPath;
|
|
8533
8682
|
if (opts.config) {
|
|
@@ -8566,10 +8715,10 @@ function createUninstallConstraintsCommand() {
|
|
|
8566
8715
|
}
|
|
8567
8716
|
|
|
8568
8717
|
// src/commands/update.ts
|
|
8569
|
-
import { Command as
|
|
8718
|
+
import { Command as Command81 } from "commander";
|
|
8570
8719
|
import { execFile, execFileSync as execFileSync6 } from "child_process";
|
|
8571
|
-
import { realpathSync, existsSync as
|
|
8572
|
-
import { join as
|
|
8720
|
+
import { realpathSync, existsSync as existsSync37, readFileSync as readFileSync26 } from "fs";
|
|
8721
|
+
import { join as join48 } from "path";
|
|
8573
8722
|
import { promisify } from "util";
|
|
8574
8723
|
import readline3 from "readline";
|
|
8575
8724
|
import chalk12 from "chalk";
|
|
@@ -8635,10 +8784,10 @@ function prompt2(question) {
|
|
|
8635
8784
|
input: process.stdin,
|
|
8636
8785
|
output: process.stdout
|
|
8637
8786
|
});
|
|
8638
|
-
return new Promise((
|
|
8787
|
+
return new Promise((resolve36) => {
|
|
8639
8788
|
rl.question(question, (answer) => {
|
|
8640
8789
|
rl.close();
|
|
8641
|
-
|
|
8790
|
+
resolve36(answer.trim().toLowerCase());
|
|
8642
8791
|
});
|
|
8643
8792
|
});
|
|
8644
8793
|
}
|
|
@@ -8653,12 +8802,12 @@ async function ensureTelemetryIfNeeded() {
|
|
|
8653
8802
|
}
|
|
8654
8803
|
function refreshHooks() {
|
|
8655
8804
|
const cwd = process.cwd();
|
|
8656
|
-
const configPath =
|
|
8657
|
-
if (!
|
|
8805
|
+
const configPath = join48(cwd, "harness.config.json");
|
|
8806
|
+
if (!existsSync37(configPath)) return;
|
|
8658
8807
|
let profile = "standard";
|
|
8659
|
-
const profilePath =
|
|
8808
|
+
const profilePath = join48(cwd, ".harness", "hooks", "profile.json");
|
|
8660
8809
|
try {
|
|
8661
|
-
const data = JSON.parse(
|
|
8810
|
+
const data = JSON.parse(readFileSync26(profilePath, "utf-8"));
|
|
8662
8811
|
if (data.profile && ["minimal", "standard", "strict"].includes(data.profile)) {
|
|
8663
8812
|
profile = data.profile;
|
|
8664
8813
|
}
|
|
@@ -8784,7 +8933,7 @@ async function runUpdateAction(opts, globalOpts) {
|
|
|
8784
8933
|
process.exit(ExitCode.SUCCESS);
|
|
8785
8934
|
}
|
|
8786
8935
|
function createUpdateCommand() {
|
|
8787
|
-
return new
|
|
8936
|
+
return new Command81("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(
|
|
8788
8937
|
"--regenerate",
|
|
8789
8938
|
"Only regenerate slash commands and agent definitions (skip package updates)"
|
|
8790
8939
|
).action(async (opts, cmd) => {
|
|
@@ -8794,9 +8943,9 @@ function createUpdateCommand() {
|
|
|
8794
8943
|
}
|
|
8795
8944
|
|
|
8796
8945
|
// src/commands/usage.ts
|
|
8797
|
-
import { Command as
|
|
8946
|
+
import { Command as Command82 } from "commander";
|
|
8798
8947
|
async function loadAndPriceRecords(cwd, includeClaudeSessions = false) {
|
|
8799
|
-
const { readCostRecords, loadPricingData, calculateCost, parseCCRecords } = await import("./dist-
|
|
8948
|
+
const { readCostRecords, loadPricingData, calculateCost, parseCCRecords } = await import("./dist-UMONICND.js");
|
|
8800
8949
|
const records = readCostRecords(cwd);
|
|
8801
8950
|
if (includeClaudeSessions) {
|
|
8802
8951
|
const ccRecords = parseCCRecords();
|
|
@@ -8857,7 +9006,7 @@ function registerDailyCommand(usage) {
|
|
|
8857
9006
|
}
|
|
8858
9007
|
return;
|
|
8859
9008
|
}
|
|
8860
|
-
const { aggregateByDay } = await import("./dist-
|
|
9009
|
+
const { aggregateByDay } = await import("./dist-UMONICND.js");
|
|
8861
9010
|
const dailyData = aggregateByDay(records);
|
|
8862
9011
|
const limited = dailyData.slice(0, days);
|
|
8863
9012
|
if (globalOpts.json) {
|
|
@@ -8914,7 +9063,7 @@ function registerSessionsCommand(usage) {
|
|
|
8914
9063
|
}
|
|
8915
9064
|
return;
|
|
8916
9065
|
}
|
|
8917
|
-
const { aggregateBySession } = await import("./dist-
|
|
9066
|
+
const { aggregateBySession } = await import("./dist-UMONICND.js");
|
|
8918
9067
|
const sessionData = aggregateBySession(records);
|
|
8919
9068
|
const limited = sessionData.slice(0, limit);
|
|
8920
9069
|
if (globalOpts.json) {
|
|
@@ -8994,7 +9143,7 @@ function registerSessionCommand(usage) {
|
|
|
8994
9143
|
cwd,
|
|
8995
9144
|
globalOpts.includeClaudeSessions
|
|
8996
9145
|
);
|
|
8997
|
-
const { aggregateBySession } = await import("./dist-
|
|
9146
|
+
const { aggregateBySession } = await import("./dist-UMONICND.js");
|
|
8998
9147
|
const sessionData = aggregateBySession(records);
|
|
8999
9148
|
const match = sessionData.find((s) => s.sessionId === id);
|
|
9000
9149
|
if (!match) {
|
|
@@ -9029,7 +9178,7 @@ function registerLatestCommand(usage) {
|
|
|
9029
9178
|
}
|
|
9030
9179
|
return;
|
|
9031
9180
|
}
|
|
9032
|
-
const { aggregateBySession } = await import("./dist-
|
|
9181
|
+
const { aggregateBySession } = await import("./dist-UMONICND.js");
|
|
9033
9182
|
const sessionData = aggregateBySession(records);
|
|
9034
9183
|
const latest = sessionData[0];
|
|
9035
9184
|
if (!latest) {
|
|
@@ -9055,7 +9204,7 @@ function registerLatestCommand(usage) {
|
|
|
9055
9204
|
});
|
|
9056
9205
|
}
|
|
9057
9206
|
function createUsageCommand() {
|
|
9058
|
-
const usage = new
|
|
9207
|
+
const usage = new Command82("usage").description("Token usage and cost tracking");
|
|
9059
9208
|
usage.option(
|
|
9060
9209
|
"--include-claude-sessions",
|
|
9061
9210
|
"Include Claude Code session data from ~/.claude/projects/"
|
|
@@ -9070,7 +9219,7 @@ function createUsageCommand() {
|
|
|
9070
9219
|
// src/commands/validate.ts
|
|
9071
9220
|
init_dist();
|
|
9072
9221
|
init_dist();
|
|
9073
|
-
import { Command as
|
|
9222
|
+
import { Command as Command83 } from "commander";
|
|
9074
9223
|
import * as path62 from "path";
|
|
9075
9224
|
async function runValidate(options) {
|
|
9076
9225
|
const configResult = resolveConfig(options.configPath);
|
|
@@ -9153,7 +9302,7 @@ function resolveValidateMode(globalOpts) {
|
|
|
9153
9302
|
return OutputMode.TEXT;
|
|
9154
9303
|
}
|
|
9155
9304
|
async function printCrossCheckWarnings(mode) {
|
|
9156
|
-
const { runCrossCheck: runCrossCheck2 } = await import("./validate-cross-check-
|
|
9305
|
+
const { runCrossCheck: runCrossCheck2 } = await import("./validate-cross-check-OWITNCHN.js");
|
|
9157
9306
|
const cwd = process.cwd();
|
|
9158
9307
|
const crossResult = await runCrossCheck2({
|
|
9159
9308
|
specsDir: path62.join(cwd, "docs", "specs"),
|
|
@@ -9169,7 +9318,7 @@ async function printCrossCheckWarnings(mode) {
|
|
|
9169
9318
|
${crossResult.value.warnings} warnings`);
|
|
9170
9319
|
}
|
|
9171
9320
|
function createValidateCommand3() {
|
|
9172
|
-
const command = new
|
|
9321
|
+
const command = new Command83("validate").description("Run all validation checks").option("--cross-check", "Run cross-artifact consistency validation").option(
|
|
9173
9322
|
"--agent-configs",
|
|
9174
9323
|
"Validate agent configs (CLAUDE.md, hooks, skills) via agnix or built-in fallback rules"
|
|
9175
9324
|
).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()));
|
|
@@ -9278,7 +9427,7 @@ var commandCreators = [
|
|
|
9278
9427
|
|
|
9279
9428
|
// src/index.ts
|
|
9280
9429
|
function createProgram() {
|
|
9281
|
-
const program = new
|
|
9430
|
+
const program = new Command84();
|
|
9282
9431
|
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");
|
|
9283
9432
|
for (const creator of commandCreators) {
|
|
9284
9433
|
program.addCommand(creator());
|
|
@@ -9298,6 +9447,7 @@ export {
|
|
|
9298
9447
|
printFirstRunWelcome,
|
|
9299
9448
|
buildPreamble,
|
|
9300
9449
|
runSnapshotCapture,
|
|
9450
|
+
installCommandTelemetry,
|
|
9301
9451
|
runUninstall,
|
|
9302
9452
|
runUninstallConstraints,
|
|
9303
9453
|
createProgram
|
|
@@ -33,7 +33,7 @@ var createSelfReviewDefinition = {
|
|
|
33
33
|
};
|
|
34
34
|
async function handleCreateSelfReview(input) {
|
|
35
35
|
try {
|
|
36
|
-
const { parseDiff, createSelfReview } = await import("./dist-
|
|
36
|
+
const { parseDiff, createSelfReview } = await import("./dist-UMONICND.js");
|
|
37
37
|
const parseResult = parseDiff(input.diff);
|
|
38
38
|
if (!parseResult.ok) {
|
|
39
39
|
return resultToMcpResponse(parseResult);
|
|
@@ -119,7 +119,7 @@ var analyzeDiffDefinition = {
|
|
|
119
119
|
};
|
|
120
120
|
async function handleAnalyzeDiff(input) {
|
|
121
121
|
try {
|
|
122
|
-
const { parseDiff, analyzeDiff } = await import("./dist-
|
|
122
|
+
const { parseDiff, analyzeDiff } = await import("./dist-UMONICND.js");
|
|
123
123
|
const parseResult = parseDiff(input.diff);
|
|
124
124
|
if (!parseResult.ok) {
|
|
125
125
|
return resultToMcpResponse(parseResult);
|
|
@@ -195,7 +195,7 @@ var requestPeerReviewDefinition = {
|
|
|
195
195
|
};
|
|
196
196
|
async function handleRequestPeerReview(input) {
|
|
197
197
|
try {
|
|
198
|
-
const { parseDiff, requestPeerReview } = await import("./dist-
|
|
198
|
+
const { parseDiff, requestPeerReview } = await import("./dist-UMONICND.js");
|
|
199
199
|
const parseResult = parseDiff(input.diff);
|
|
200
200
|
if (!parseResult.ok) {
|
|
201
201
|
return resultToMcpResponse(parseResult);
|