@harness-engineering/cli 2.4.0 → 2.4.2
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-md-2M46KG4F.js +10 -0
- package/dist/{architecture-I2G7PNQB.js → architecture-3ZSN5RDQ.js} +5 -5
- package/dist/{assess-project-LO6NCLE7.js → assess-project-KZWFQEJE.js} +5 -3
- package/dist/bin/harness-mcp.js +16 -16
- package/dist/bin/harness.js +29 -27
- package/dist/{check-phase-gate-52SQFNJB.js → check-phase-gate-EWV5VYTG.js} +5 -5
- package/dist/{chunk-GDJ2MRYH.js → chunk-2TGCYJMT.js} +259 -5
- package/dist/{chunk-TIQU5VY7.js → chunk-5FDBXUFW.js} +1 -1
- package/dist/{chunk-7BNK4M23.js → chunk-5XLLIYYL.js} +1 -1
- package/dist/{chunk-U4XK4BB3.js → chunk-73KZ2E47.js} +9 -9
- package/dist/{chunk-NGCM4B4V.js → chunk-7RZZV73V.js} +5 -5
- package/dist/{chunk-WY2J54IZ.js → chunk-B2ZYMQGT.js} +64 -30
- package/dist/{chunk-XPRGWHBL.js → chunk-BCFDGOMA.js} +1 -1
- package/dist/{chunk-27EHWQPK.js → chunk-GLKASJZE.js} +6 -6
- package/dist/{chunk-TCR5PKMU.js → chunk-GOSUZC5H.js} +514 -208
- package/dist/{chunk-MQRKPF46.js → chunk-I2KULMPD.js} +10 -10
- package/dist/{chunk-4XB37LST.js → chunk-IEHXZB6J.js} +9 -9
- package/dist/{chunk-5YOHXTK3.js → chunk-KOK7BFP2.js} +3 -3
- package/dist/{chunk-2L2A6W6I.js → chunk-KRQTN46U.js} +3 -3
- package/dist/{chunk-GN2CSZC6.js → chunk-LHHO7AH4.js} +3 -3
- package/dist/{chunk-OFMQEUYN.js → chunk-LJF6UY4R.js} +2 -2
- package/dist/{chunk-KPWUZSHL.js → chunk-MXOQEI72.js} +25 -8
- package/dist/{chunk-54JTO4NZ.js → chunk-NM3ZIWVN.js} +2 -2
- package/dist/{chunk-JGPOQJ73.js → chunk-NTOKQJOX.js} +2 -2
- package/dist/chunk-O63AAPIZ.js +190 -0
- package/dist/{chunk-TVJZX53C.js → chunk-OUXYITL5.js} +2 -2
- package/dist/{chunk-MSBVH6ER.js → chunk-PPQ3TY2R.js} +2 -2
- package/dist/{chunk-RYVL76ZF.js → chunk-QV5EBDWA.js} +1 -1
- package/dist/{chunk-FJJYQWUP.js → chunk-RRTTJ3VB.js} +2 -2
- package/dist/{chunk-Q43LM7CO.js → chunk-TPNA2I4J.js} +206 -97
- package/dist/{chunk-RZASDABE.js → chunk-UPV7VDUB.js} +2 -2
- package/dist/{chunk-DJRRTZGD.js → chunk-UQJV7NNM.js} +2 -2
- package/dist/ci-workflow-5TBUHJFC.js +10 -0
- package/dist/{dist-ZJGFXGIB.js → dist-HA6IIPRC.js} +39 -3
- package/dist/dist-O733ZU6I.js +49 -0
- package/dist/{dist-SQAOKWXM.js → dist-QPWXPCPL.js} +1 -1
- package/dist/{docs-7CW7WUFB.js → docs-D6WI2LCF.js} +5 -5
- package/dist/engine-GBEVIZZQ.js +10 -0
- package/dist/{entropy-P6QELTFA.js → entropy-V6M4KJDC.js} +4 -4
- package/dist/{feedback-PJWCDRRZ.js → feedback-22I4HHXM.js} +1 -1
- package/dist/{generate-agent-definitions-ONDIJHHK.js → generate-agent-definitions-UM7T3WLA.js} +5 -5
- package/dist/{glob-helper-JE3MO4UD.js → glob-helper-XE2UGEOV.js} +1 -1
- package/dist/{graph-loader-TJU4E7KL.js → graph-loader-EQBOIHFZ.js} +1 -1
- package/dist/index.d.ts +100 -10
- package/dist/index.js +26 -26
- package/dist/loader-5V72NYMF.js +12 -0
- package/dist/{mcp-UUNLS3MC.js → mcp-5KQGFG5U.js} +16 -16
- package/dist/{performance-7X3EFAOD.js → performance-MVORVVMG.js} +5 -5
- package/dist/{review-pipeline-GAJ22PBC.js → review-pipeline-JYSVCNGJ.js} +4 -4
- package/dist/runtime-KZC2OQI7.js +11 -0
- package/dist/{scan-SFX5U3TE.js → scan-4PPP6ZXT.js} +1 -1
- package/dist/{security-ZSU643D7.js → security-WOVOBLCI.js} +1 -1
- package/dist/{tool-tiers-7QGZ3FKY.js → tool-tiers-QVWKAZX4.js} +5 -1
- package/dist/{validate-IDX6RI3U.js → validate-55HGQKWR.js} +5 -5
- package/dist/validate-cross-check-H3PSV4VY.js +10 -0
- package/package.json +6 -6
- package/dist/agents-md-ROTDQOXM.js +0 -10
- package/dist/chunk-RL4VMEXL.js +0 -53
- package/dist/ci-workflow-MYBH64CR.js +0 -10
- package/dist/dist-3EWNRFFQ.js +0 -21
- package/dist/engine-Y75QZW6N.js +0 -10
- package/dist/loader-DQRNWKOZ.js +0 -12
- package/dist/runtime-6TK6U72R.js +0 -11
- package/dist/validate-cross-check-5YEWZ3EW.js +0 -10
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateRuntime
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OUXYITL5.js";
|
|
4
4
|
import {
|
|
5
5
|
generateAgentsMd
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RRTTJ3VB.js";
|
|
7
7
|
import {
|
|
8
8
|
generateCIWorkflow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UQJV7NNM.js";
|
|
10
10
|
import {
|
|
11
11
|
TemplateEngine
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NM3ZIWVN.js";
|
|
13
13
|
import {
|
|
14
14
|
generate,
|
|
15
15
|
validate
|
|
@@ -28,22 +28,22 @@ import {
|
|
|
28
28
|
OutputMode,
|
|
29
29
|
createCheckPhaseGateCommand,
|
|
30
30
|
findFiles
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-KOK7BFP2.js";
|
|
32
32
|
import {
|
|
33
33
|
createGenerateAgentDefinitionsCommand,
|
|
34
34
|
generateAgentDefinitions
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-QV5EBDWA.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-NTOKQJOX.js";
|
|
43
43
|
import {
|
|
44
44
|
createScanCommand,
|
|
45
45
|
loadIngestOptions
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-5XLLIYYL.js";
|
|
47
47
|
import {
|
|
48
48
|
appendFrameworkAgents,
|
|
49
49
|
captureHealthSnapshot,
|
|
@@ -57,10 +57,10 @@ import {
|
|
|
57
57
|
loadCachedSnapshot,
|
|
58
58
|
persistToolingConfig,
|
|
59
59
|
recommend
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-TPNA2I4J.js";
|
|
61
61
|
import {
|
|
62
62
|
loadGraphStore
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-5FDBXUFW.js";
|
|
64
64
|
import {
|
|
65
65
|
loadOrRebuildIndex
|
|
66
66
|
} from "./chunk-27AJKSQY.js";
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
BranchingConfigSchema,
|
|
69
69
|
findConfigFile,
|
|
70
70
|
resolveConfig
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-MXOQEI72.js";
|
|
72
72
|
import {
|
|
73
73
|
VALID_PLATFORMS
|
|
74
74
|
} from "./chunk-3ISINLYT.js";
|
|
@@ -132,6 +132,7 @@ import {
|
|
|
132
132
|
getOrCreateInstallId,
|
|
133
133
|
gitScan,
|
|
134
134
|
init_dist as init_dist2,
|
|
135
|
+
invalidateCheckState,
|
|
135
136
|
isoWeek,
|
|
136
137
|
listStreams,
|
|
137
138
|
listTaintedSessions,
|
|
@@ -172,15 +173,15 @@ import {
|
|
|
172
173
|
validateSolutionsDir,
|
|
173
174
|
writeConfig,
|
|
174
175
|
writeLockfile
|
|
175
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-2TGCYJMT.js";
|
|
176
177
|
import {
|
|
177
178
|
Err,
|
|
178
179
|
Ok
|
|
179
|
-
} from "./chunk-
|
|
180
|
+
} from "./chunk-O63AAPIZ.js";
|
|
180
181
|
import {
|
|
181
182
|
DEFAULT_SKIP_DIRS,
|
|
182
183
|
init_dist
|
|
183
|
-
} from "./chunk-
|
|
184
|
+
} from "./chunk-BCFDGOMA.js";
|
|
184
185
|
import {
|
|
185
186
|
createCreateSkillCommand
|
|
186
187
|
} from "./chunk-ZP5E7YET.js";
|
|
@@ -201,7 +202,7 @@ import {
|
|
|
201
202
|
} from "./chunk-KFQGP6VL.js";
|
|
202
203
|
|
|
203
204
|
// src/index.ts
|
|
204
|
-
import { Command as
|
|
205
|
+
import { Command as Command97 } from "commander";
|
|
205
206
|
|
|
206
207
|
// src/commands/add.ts
|
|
207
208
|
init_dist2();
|
|
@@ -390,7 +391,7 @@ function registerSkillsCommand(adoption) {
|
|
|
390
391
|
const globalOpts = cmd.optsWithGlobals();
|
|
391
392
|
const limit = Math.max(parseInt(opts.limit, 10) || 20, 1);
|
|
392
393
|
const cwd = process.cwd();
|
|
393
|
-
const { readAdoptionRecords, aggregateBySkill } = await import("./dist-
|
|
394
|
+
const { readAdoptionRecords, aggregateBySkill } = await import("./dist-HA6IIPRC.js");
|
|
394
395
|
const records = readAdoptionRecords(cwd);
|
|
395
396
|
if (records.length === 0) {
|
|
396
397
|
if (globalOpts.json) {
|
|
@@ -426,7 +427,7 @@ function registerRecentCommand(adoption) {
|
|
|
426
427
|
const globalOpts = cmd.optsWithGlobals();
|
|
427
428
|
const limit = Math.max(parseInt(opts.limit, 10) || 20, 1);
|
|
428
429
|
const cwd = process.cwd();
|
|
429
|
-
const { readAdoptionRecords } = await import("./dist-
|
|
430
|
+
const { readAdoptionRecords } = await import("./dist-HA6IIPRC.js");
|
|
430
431
|
const records = readAdoptionRecords(cwd);
|
|
431
432
|
if (records.length === 0) {
|
|
432
433
|
if (globalOpts.json) {
|
|
@@ -504,7 +505,7 @@ function registerSkillCommand(adoption) {
|
|
|
504
505
|
adoption.command("skill <name>").description("Show detail for a specific skill").action(async (name, _opts, cmd) => {
|
|
505
506
|
const globalOpts = cmd.optsWithGlobals();
|
|
506
507
|
const cwd = process.cwd();
|
|
507
|
-
const { readAdoptionRecords, aggregateBySkill } = await import("./dist-
|
|
508
|
+
const { readAdoptionRecords, aggregateBySkill } = await import("./dist-HA6IIPRC.js");
|
|
508
509
|
const records = readAdoptionRecords(cwd);
|
|
509
510
|
const skillRecords = records.filter((r) => r.skill === name);
|
|
510
511
|
if (skillRecords.length === 0) {
|
|
@@ -2828,8 +2829,168 @@ function createFixDriftCommand() {
|
|
|
2828
2829
|
return command;
|
|
2829
2830
|
}
|
|
2830
2831
|
|
|
2831
|
-
// src/commands/
|
|
2832
|
+
// src/commands/gateway/index.ts
|
|
2833
|
+
import { Command as Command26 } from "commander";
|
|
2834
|
+
|
|
2835
|
+
// src/commands/gateway/token.ts
|
|
2832
2836
|
import { Command as Command24 } from "commander";
|
|
2837
|
+
import { resolve as resolve14 } from "path";
|
|
2838
|
+
import { TokenStore } from "@harness-engineering/orchestrator";
|
|
2839
|
+
function getStore() {
|
|
2840
|
+
const p = process.env["HARNESS_TOKENS_PATH"] ?? resolve14(".harness", "tokens.json");
|
|
2841
|
+
return new TokenStore(p);
|
|
2842
|
+
}
|
|
2843
|
+
async function runTokenCreate(opts) {
|
|
2844
|
+
const store = getStore();
|
|
2845
|
+
const result = await store.create(opts);
|
|
2846
|
+
return { id: result.id, token: result.token };
|
|
2847
|
+
}
|
|
2848
|
+
async function runTokenList() {
|
|
2849
|
+
const store = getStore();
|
|
2850
|
+
return store.list();
|
|
2851
|
+
}
|
|
2852
|
+
async function runTokenRevoke(id) {
|
|
2853
|
+
const store = getStore();
|
|
2854
|
+
return store.revoke(id);
|
|
2855
|
+
}
|
|
2856
|
+
function createTokenCommand() {
|
|
2857
|
+
const cmd = new Command24("token").description("Manage Gateway API tokens");
|
|
2858
|
+
cmd.command("create").description("Create a new auth token. Secret is shown ONCE.").requiredOption("--name <name>", "Human label").requiredOption("--scopes <scopes>", "Comma-separated scopes").option("--bridge <kind>", "slack | discord | github-app | custom").option("--tenant <id>", "Tenant identifier").option("--expires <iso>", "Expiry ISO-8601").action(
|
|
2859
|
+
async (opts) => {
|
|
2860
|
+
const scopes = opts.scopes.split(",").map((s) => s.trim());
|
|
2861
|
+
const input = { name: opts.name, scopes };
|
|
2862
|
+
if (opts.bridge) input.bridgeKind = opts.bridge;
|
|
2863
|
+
if (opts.tenant) input.tenantId = opts.tenant;
|
|
2864
|
+
if (opts.expires) input.expiresAt = opts.expires;
|
|
2865
|
+
const out = await runTokenCreate(input);
|
|
2866
|
+
console.log(JSON.stringify(out, null, 2));
|
|
2867
|
+
console.log("\nWARNING: Save this token now \u2014 it will NEVER be shown again.");
|
|
2868
|
+
}
|
|
2869
|
+
);
|
|
2870
|
+
cmd.command("list").description("List all tokens (secrets redacted)").action(async () => {
|
|
2871
|
+
const tokens = await runTokenList();
|
|
2872
|
+
console.log(JSON.stringify(tokens, null, 2));
|
|
2873
|
+
});
|
|
2874
|
+
cmd.command("revoke <id>").description("Delete a token by id").action(async (id) => {
|
|
2875
|
+
const ok = await runTokenRevoke(id);
|
|
2876
|
+
if (ok) console.log(`Revoked ${id}`);
|
|
2877
|
+
else {
|
|
2878
|
+
console.error(`No such token: ${id}`);
|
|
2879
|
+
process.exitCode = 1;
|
|
2880
|
+
}
|
|
2881
|
+
});
|
|
2882
|
+
return cmd;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
// src/commands/gateway/deliveries.ts
|
|
2886
|
+
import { Command as Command25 } from "commander";
|
|
2887
|
+
import { createInterface } from "readline";
|
|
2888
|
+
import { resolve as resolve15 } from "path";
|
|
2889
|
+
import { WebhookQueue } from "@harness-engineering/orchestrator";
|
|
2890
|
+
function resolveQueuePath() {
|
|
2891
|
+
return process.env["HARNESS_WEBHOOK_QUEUE_PATH"] ?? resolve15(".harness", "webhook-queue.sqlite");
|
|
2892
|
+
}
|
|
2893
|
+
function getQueue() {
|
|
2894
|
+
return new WebhookQueue(resolveQueuePath());
|
|
2895
|
+
}
|
|
2896
|
+
function runDeliveriesList(queue, filter) {
|
|
2897
|
+
return queue.list(filter);
|
|
2898
|
+
}
|
|
2899
|
+
function runDeliveriesRetry(queue, id) {
|
|
2900
|
+
return queue.retryDead(id);
|
|
2901
|
+
}
|
|
2902
|
+
async function runDeliveriesPurge(queue, opts, runOpts = {}) {
|
|
2903
|
+
const errOut = runOpts.errOut ?? process.stderr;
|
|
2904
|
+
if (!opts.deadOnly && opts.olderThanMs === void 0 && !opts.all) {
|
|
2905
|
+
errOut.write("purge requires one of: --dead-only, --older-than <ms>, --all\n");
|
|
2906
|
+
return -1;
|
|
2907
|
+
}
|
|
2908
|
+
if (runOpts.confirm) {
|
|
2909
|
+
const count = queue.previewPurge(opts);
|
|
2910
|
+
const ok = await runOpts.confirm(count);
|
|
2911
|
+
if (!ok) return -1;
|
|
2912
|
+
}
|
|
2913
|
+
return queue.purge(opts);
|
|
2914
|
+
}
|
|
2915
|
+
function promptYesNo(message) {
|
|
2916
|
+
return new Promise((resolveAns) => {
|
|
2917
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
2918
|
+
rl.question(message, (answer) => {
|
|
2919
|
+
rl.close();
|
|
2920
|
+
const a = answer.trim().toLowerCase();
|
|
2921
|
+
resolveAns(a === "y" || a === "yes");
|
|
2922
|
+
});
|
|
2923
|
+
});
|
|
2924
|
+
}
|
|
2925
|
+
function createDeliveriesCommand() {
|
|
2926
|
+
const cmd = new Command25("deliveries").description("Inspect and manage webhook delivery queue");
|
|
2927
|
+
cmd.command("list").description("List delivery queue entries (newest first; capped at 200 rows)").option("--status <status>", "Filter by status: pending|failed|delivered|dead").option("--subscription <id>", "Filter by subscription ID").action((opts) => {
|
|
2928
|
+
const queue = getQueue();
|
|
2929
|
+
try {
|
|
2930
|
+
const filter = {};
|
|
2931
|
+
if (opts.status) filter.status = opts.status;
|
|
2932
|
+
if (opts.subscription) filter.subscriptionId = opts.subscription;
|
|
2933
|
+
const rows = runDeliveriesList(queue, filter);
|
|
2934
|
+
console.log(JSON.stringify(rows, null, 2));
|
|
2935
|
+
} finally {
|
|
2936
|
+
queue.close();
|
|
2937
|
+
}
|
|
2938
|
+
});
|
|
2939
|
+
cmd.command("retry <id>").description("Re-enqueue a dead-lettered delivery by ID").action((id) => {
|
|
2940
|
+
const queue = getQueue();
|
|
2941
|
+
try {
|
|
2942
|
+
const ok = runDeliveriesRetry(queue, id);
|
|
2943
|
+
if (ok) {
|
|
2944
|
+
console.log(`Delivery ${id} re-enqueued.`);
|
|
2945
|
+
} else {
|
|
2946
|
+
console.error(`Delivery ${id} not found or not in dead status.`);
|
|
2947
|
+
process.exitCode = 1;
|
|
2948
|
+
}
|
|
2949
|
+
} finally {
|
|
2950
|
+
queue.close();
|
|
2951
|
+
}
|
|
2952
|
+
});
|
|
2953
|
+
cmd.command("purge").description("Delete delivery rows from the queue (requires at least one filter)").option("--dead-only", "Delete only dead-lettered rows").option("--older-than <ms>", "Delete delivered rows older than N milliseconds").option("--all", "Delete every row in the queue (use with caution)").action(async (opts) => {
|
|
2954
|
+
const queue = getQueue();
|
|
2955
|
+
try {
|
|
2956
|
+
const purgeOpts = {};
|
|
2957
|
+
if (opts.deadOnly) purgeOpts.deadOnly = true;
|
|
2958
|
+
if (opts.olderThan !== void 0) purgeOpts.olderThanMs = Number(opts.olderThan);
|
|
2959
|
+
if (opts.all) purgeOpts.all = true;
|
|
2960
|
+
const isTty = Boolean(process.stdout.isTTY);
|
|
2961
|
+
const runOpts = {};
|
|
2962
|
+
if (isTty) {
|
|
2963
|
+
runOpts.confirm = (count) => {
|
|
2964
|
+
if (count === 0) {
|
|
2965
|
+
console.log("No matching rows to delete.");
|
|
2966
|
+
return false;
|
|
2967
|
+
}
|
|
2968
|
+
return promptYesNo(`Delete ${count} row(s)? [y/N] `);
|
|
2969
|
+
};
|
|
2970
|
+
}
|
|
2971
|
+
const result = await runDeliveriesPurge(queue, purgeOpts, runOpts);
|
|
2972
|
+
if (result === -1) {
|
|
2973
|
+
process.exitCode = 1;
|
|
2974
|
+
return;
|
|
2975
|
+
}
|
|
2976
|
+
console.log(`Deleted ${result} row(s).`);
|
|
2977
|
+
} finally {
|
|
2978
|
+
queue.close();
|
|
2979
|
+
}
|
|
2980
|
+
});
|
|
2981
|
+
return cmd;
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
// src/commands/gateway/index.ts
|
|
2985
|
+
function createGatewayCommand() {
|
|
2986
|
+
const cmd = new Command26("gateway").description("Gateway API administration");
|
|
2987
|
+
cmd.addCommand(createTokenCommand());
|
|
2988
|
+
cmd.addCommand(createDeliveriesCommand());
|
|
2989
|
+
return cmd;
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
// src/commands/generate.ts
|
|
2993
|
+
import { Command as Command27 } from "commander";
|
|
2833
2994
|
function validatePlatforms(platforms) {
|
|
2834
2995
|
for (const p of platforms) {
|
|
2835
2996
|
if (!VALID_PLATFORMS.includes(p)) {
|
|
@@ -2889,13 +3050,13 @@ async function runGenerateAction(opts, globalOpts) {
|
|
|
2889
3050
|
}
|
|
2890
3051
|
}
|
|
2891
3052
|
function createGenerateCommand() {
|
|
2892
|
-
return new
|
|
3053
|
+
return new Command27("generate").description("Generate all platform integrations (slash commands + agent definitions)").option("--platforms <list>", "Target platforms (comma-separated)", "claude-code,gemini-cli").option("--global", "Write to global directories", false).option("--include-global", "Include built-in global skills", false).option("--output <dir>", "Custom output directory").option("--dry-run", "Show what would change without writing", false).option("--yes", "Skip deletion confirmation prompts", false).action(async (opts, cmd) => {
|
|
2893
3054
|
await runGenerateAction(opts, cmd.optsWithGlobals());
|
|
2894
3055
|
});
|
|
2895
3056
|
}
|
|
2896
3057
|
|
|
2897
3058
|
// src/commands/graph/index.ts
|
|
2898
|
-
import { Command as
|
|
3059
|
+
import { Command as Command30 } from "commander";
|
|
2899
3060
|
|
|
2900
3061
|
// src/commands/graph/status.ts
|
|
2901
3062
|
import * as path15 from "path";
|
|
@@ -2913,7 +3074,7 @@ async function readConnectorSyncStatus(graphDir) {
|
|
|
2913
3074
|
return result;
|
|
2914
3075
|
}
|
|
2915
3076
|
async function runGraphStatus(projectPath) {
|
|
2916
|
-
const { GraphStore, loadGraphMetadata } = await import("./dist-
|
|
3077
|
+
const { GraphStore, loadGraphMetadata } = await import("./dist-QPWXPCPL.js");
|
|
2917
3078
|
const graphDir = path15.join(projectPath, ".harness", "graph");
|
|
2918
3079
|
const metaResult = await loadGraphMetadata(graphDir);
|
|
2919
3080
|
if (metaResult.status === "not_found") {
|
|
@@ -2965,7 +3126,7 @@ async function runGraphStatus(projectPath) {
|
|
|
2965
3126
|
// src/commands/graph/export.ts
|
|
2966
3127
|
import * as path16 from "path";
|
|
2967
3128
|
async function runGraphExport(projectPath, format) {
|
|
2968
|
-
const { GraphStore } = await import("./dist-
|
|
3129
|
+
const { GraphStore } = await import("./dist-QPWXPCPL.js");
|
|
2969
3130
|
const graphDir = path16.join(projectPath, ".harness", "graph");
|
|
2970
3131
|
const store = new GraphStore();
|
|
2971
3132
|
const loaded = await store.load(graphDir);
|
|
@@ -2998,10 +3159,10 @@ async function runGraphExport(projectPath, format) {
|
|
|
2998
3159
|
import * as path19 from "path";
|
|
2999
3160
|
|
|
3000
3161
|
// src/commands/graph/query.ts
|
|
3001
|
-
import { Command as
|
|
3162
|
+
import { Command as Command28 } from "commander";
|
|
3002
3163
|
import * as path17 from "path";
|
|
3003
3164
|
async function runQuery(projectPath, rootNodeId, opts) {
|
|
3004
|
-
const { GraphStore, ContextQL } = await import("./dist-
|
|
3165
|
+
const { GraphStore, ContextQL } = await import("./dist-QPWXPCPL.js");
|
|
3005
3166
|
const store = new GraphStore();
|
|
3006
3167
|
const graphDir = path17.join(projectPath, ".harness", "graph");
|
|
3007
3168
|
const loaded = await store.load(graphDir);
|
|
@@ -3044,13 +3205,13 @@ async function runQueryAction(rootNodeId, opts, globalOpts) {
|
|
|
3044
3205
|
}
|
|
3045
3206
|
}
|
|
3046
3207
|
function createQueryCommand() {
|
|
3047
|
-
return new
|
|
3208
|
+
return new Command28("query").description("Query the knowledge graph").argument("<rootNodeId>", "Starting node ID").option("--depth <n>", "Max traversal depth", "3").option("--types <types>", "Comma-separated node types to include").option("--edges <edges>", "Comma-separated edge types to include").option("--bidirectional", "Traverse both directions").action(async (rootNodeId, opts, cmd) => {
|
|
3048
3209
|
await runQueryAction(rootNodeId, opts, cmd.optsWithGlobals());
|
|
3049
3210
|
});
|
|
3050
3211
|
}
|
|
3051
3212
|
|
|
3052
3213
|
// src/commands/graph/ingest.ts
|
|
3053
|
-
import { Command as
|
|
3214
|
+
import { Command as Command29 } from "commander";
|
|
3054
3215
|
import * as path18 from "path";
|
|
3055
3216
|
async function loadConnectorConfig(projectPath, source) {
|
|
3056
3217
|
try {
|
|
@@ -3098,7 +3259,7 @@ async function runIngest(projectPath, source, opts) {
|
|
|
3098
3259
|
ConfluenceConnector,
|
|
3099
3260
|
FigmaConnector,
|
|
3100
3261
|
MiroConnector
|
|
3101
|
-
} = await import("./dist-
|
|
3262
|
+
} = await import("./dist-QPWXPCPL.js");
|
|
3102
3263
|
const graphDir = path18.join(projectPath, ".harness", "graph");
|
|
3103
3264
|
const store = new GraphStore();
|
|
3104
3265
|
await store.load(graphDir);
|
|
@@ -3112,7 +3273,7 @@ async function runIngest(projectPath, source, opts) {
|
|
|
3112
3273
|
path18.join(projectPath, "docs", "changes")
|
|
3113
3274
|
);
|
|
3114
3275
|
const gitResult = await new GitIngestor(store).ingest(projectPath);
|
|
3115
|
-
const { createExtractionRunner } = await import("./dist-
|
|
3276
|
+
const { createExtractionRunner } = await import("./dist-QPWXPCPL.js");
|
|
3116
3277
|
const extractedDir = path18.join(projectPath, ".harness", "knowledge", "extracted");
|
|
3117
3278
|
const signalsResult = await createExtractionRunner().run(projectPath, store, extractedDir);
|
|
3118
3279
|
const syncManager = new SyncManager(store, graphDir);
|
|
@@ -3158,7 +3319,7 @@ async function runIngest(projectPath, source, opts) {
|
|
|
3158
3319
|
);
|
|
3159
3320
|
break;
|
|
3160
3321
|
case "business-signals": {
|
|
3161
|
-
const { createExtractionRunner } = await import("./dist-
|
|
3322
|
+
const { createExtractionRunner } = await import("./dist-QPWXPCPL.js");
|
|
3162
3323
|
const extractedDir = path18.join(projectPath, ".harness", "knowledge", "extracted");
|
|
3163
3324
|
result = await createExtractionRunner().run(projectPath, store, extractedDir);
|
|
3164
3325
|
break;
|
|
@@ -3195,7 +3356,7 @@ async function runIngest(projectPath, source, opts) {
|
|
|
3195
3356
|
return result;
|
|
3196
3357
|
}
|
|
3197
3358
|
function createIngestCommand() {
|
|
3198
|
-
return new
|
|
3359
|
+
return new Command29("ingest").description("Ingest data into the knowledge graph").option(
|
|
3199
3360
|
"--source <name>",
|
|
3200
3361
|
"Source to ingest (code, knowledge, git, requirements, business-signals, jira, slack, ci, confluence, figma, miro)"
|
|
3201
3362
|
).option("--all", "Run all sources (code, knowledge, git, and configured connectors)").option("--full", "Force full re-ingestion").action(async (opts, cmd) => {
|
|
@@ -3273,17 +3434,17 @@ async function runExportAction(opts, cmd) {
|
|
|
3273
3434
|
}
|
|
3274
3435
|
}
|
|
3275
3436
|
function createGraphCommand() {
|
|
3276
|
-
const graph = new
|
|
3437
|
+
const graph = new Command30("graph").description("Knowledge graph management");
|
|
3277
3438
|
graph.command("status").description("Show graph statistics").action(runStatusAction);
|
|
3278
3439
|
graph.command("export").description("Export graph").requiredOption("--format <format>", "Output format (json, mermaid)").action(runExportAction);
|
|
3279
3440
|
return graph;
|
|
3280
3441
|
}
|
|
3281
3442
|
|
|
3282
3443
|
// src/commands/hooks/index.ts
|
|
3283
|
-
import { Command as
|
|
3444
|
+
import { Command as Command35 } from "commander";
|
|
3284
3445
|
|
|
3285
3446
|
// src/commands/hooks/init.ts
|
|
3286
|
-
import { Command as
|
|
3447
|
+
import { Command as Command31 } from "commander";
|
|
3287
3448
|
import * as fs8 from "fs";
|
|
3288
3449
|
import * as path20 from "path";
|
|
3289
3450
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
@@ -3405,7 +3566,7 @@ function initHooks(options) {
|
|
|
3405
3566
|
return { copiedScripts, settingsPath, profilePath };
|
|
3406
3567
|
}
|
|
3407
3568
|
function createInitCommand2() {
|
|
3408
|
-
return new
|
|
3569
|
+
return new Command31("init").description("Install Claude Code hook configurations into the current project").option("--profile <profile>", "Hook profile: minimal, standard, or strict", "standard").action(async (opts, cmd) => {
|
|
3409
3570
|
const globalOpts = cmd.optsWithGlobals();
|
|
3410
3571
|
const profile = opts.profile;
|
|
3411
3572
|
if (!VALID_PROFILES.includes(profile)) {
|
|
@@ -3443,7 +3604,7 @@ function createInitCommand2() {
|
|
|
3443
3604
|
}
|
|
3444
3605
|
|
|
3445
3606
|
// src/commands/hooks/list.ts
|
|
3446
|
-
import { Command as
|
|
3607
|
+
import { Command as Command32 } from "commander";
|
|
3447
3608
|
import * as fs9 from "fs";
|
|
3448
3609
|
import * as path21 from "path";
|
|
3449
3610
|
function listHooks(projectDir) {
|
|
@@ -3476,7 +3637,7 @@ function listHooks(projectDir) {
|
|
|
3476
3637
|
return result;
|
|
3477
3638
|
}
|
|
3478
3639
|
function createListCommand() {
|
|
3479
|
-
return new
|
|
3640
|
+
return new Command32("list").description("Show installed hooks and active profile").action(async (_opts, cmd) => {
|
|
3480
3641
|
const globalOpts = cmd.optsWithGlobals();
|
|
3481
3642
|
const projectDir = process.cwd();
|
|
3482
3643
|
const result = listHooks(projectDir);
|
|
@@ -3497,7 +3658,7 @@ function createListCommand() {
|
|
|
3497
3658
|
}
|
|
3498
3659
|
|
|
3499
3660
|
// src/commands/hooks/remove.ts
|
|
3500
|
-
import { Command as
|
|
3661
|
+
import { Command as Command33 } from "commander";
|
|
3501
3662
|
import * as fs10 from "fs";
|
|
3502
3663
|
import * as path22 from "path";
|
|
3503
3664
|
function removeHooks(projectDir) {
|
|
@@ -3527,7 +3688,7 @@ function removeHooks(projectDir) {
|
|
|
3527
3688
|
return { removed, hooksDir, settingsCleaned };
|
|
3528
3689
|
}
|
|
3529
3690
|
function createRemoveCommand() {
|
|
3530
|
-
return new
|
|
3691
|
+
return new Command33("remove").description("Remove harness-managed hooks from the current project").action(async (_opts, cmd) => {
|
|
3531
3692
|
const globalOpts = cmd.optsWithGlobals();
|
|
3532
3693
|
const projectDir = process.cwd();
|
|
3533
3694
|
const result = removeHooks(projectDir);
|
|
@@ -3549,7 +3710,7 @@ function createRemoveCommand() {
|
|
|
3549
3710
|
}
|
|
3550
3711
|
|
|
3551
3712
|
// src/commands/hooks/add.ts
|
|
3552
|
-
import { Command as
|
|
3713
|
+
import { Command as Command34 } from "commander";
|
|
3553
3714
|
import * as fs11 from "fs";
|
|
3554
3715
|
import * as path23 from "path";
|
|
3555
3716
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
@@ -3606,7 +3767,7 @@ function addHooks(hookName, projectDir) {
|
|
|
3606
3767
|
return result;
|
|
3607
3768
|
}
|
|
3608
3769
|
function createAddCommand2() {
|
|
3609
|
-
return new
|
|
3770
|
+
return new Command34("add").argument("<hook-name>", "Hook name or alias (e.g., sentinel)").description("Add a hook without changing the profile").action(async (hookName, _opts, cmd) => {
|
|
3610
3771
|
const projectDir = process.cwd();
|
|
3611
3772
|
try {
|
|
3612
3773
|
const res = addHooks(hookName, projectDir);
|
|
@@ -3631,7 +3792,7 @@ function createAddCommand2() {
|
|
|
3631
3792
|
|
|
3632
3793
|
// src/commands/hooks/index.ts
|
|
3633
3794
|
function createHooksCommand() {
|
|
3634
|
-
const command = new
|
|
3795
|
+
const command = new Command35("hooks").description("Manage Claude Code hook configurations");
|
|
3635
3796
|
command.addCommand(createInitCommand2());
|
|
3636
3797
|
command.addCommand(createListCommand());
|
|
3637
3798
|
command.addCommand(createRemoveCommand());
|
|
@@ -3640,7 +3801,7 @@ function createHooksCommand() {
|
|
|
3640
3801
|
}
|
|
3641
3802
|
|
|
3642
3803
|
// src/commands/impact-preview.ts
|
|
3643
|
-
import { Command as
|
|
3804
|
+
import { Command as Command36 } from "commander";
|
|
3644
3805
|
import { execSync as execSync4 } from "child_process";
|
|
3645
3806
|
import * as path24 from "path";
|
|
3646
3807
|
import * as fs12 from "fs";
|
|
@@ -3839,7 +4000,7 @@ async function runImpactPreview(options) {
|
|
|
3839
4000
|
return formatImpactOutput(stagedFiles, acc, options);
|
|
3840
4001
|
}
|
|
3841
4002
|
function createImpactPreviewCommand() {
|
|
3842
|
-
const command = new
|
|
4003
|
+
const command = new Command36("impact-preview").description("Show blast radius of staged changes using the knowledge graph").option("--detailed", "Show all affected files instead of top items").option("--per-file", "Show impact per staged file instead of aggregate").option("--path <dir>", "Project root (default: cwd)").action(async (opts) => {
|
|
3843
4004
|
const output = await runImpactPreview({
|
|
3844
4005
|
detailed: opts.detailed,
|
|
3845
4006
|
perFile: opts.perFile,
|
|
@@ -3853,13 +4014,13 @@ function createImpactPreviewCommand() {
|
|
|
3853
4014
|
|
|
3854
4015
|
// src/commands/init.ts
|
|
3855
4016
|
init_dist2();
|
|
3856
|
-
import { Command as
|
|
4017
|
+
import { Command as Command38 } from "commander";
|
|
3857
4018
|
import chalk3 from "chalk";
|
|
3858
4019
|
import * as fs15 from "fs";
|
|
3859
4020
|
import * as path27 from "path";
|
|
3860
4021
|
|
|
3861
4022
|
// src/commands/setup-mcp.ts
|
|
3862
|
-
import { Command as
|
|
4023
|
+
import { Command as Command37 } from "commander";
|
|
3863
4024
|
import * as fs14 from "fs";
|
|
3864
4025
|
import * as path26 from "path";
|
|
3865
4026
|
import * as os2 from "os";
|
|
@@ -4020,7 +4181,12 @@ var ALL_MCP_TOOLS = [
|
|
|
4020
4181
|
"compact",
|
|
4021
4182
|
"detect_constraint_emergence",
|
|
4022
4183
|
"run_ci_checks",
|
|
4023
|
-
"generate_blueprint"
|
|
4184
|
+
"generate_blueprint",
|
|
4185
|
+
// Phase 2 Task 11 — Gateway API MCP wrappers
|
|
4186
|
+
"trigger_maintenance_job",
|
|
4187
|
+
"list_gateway_tokens",
|
|
4188
|
+
// Phase 3 Task 9 — Gateway API webhook wrapper
|
|
4189
|
+
"subscribe_webhook"
|
|
4024
4190
|
];
|
|
4025
4191
|
async function runCursorToolPicker() {
|
|
4026
4192
|
try {
|
|
@@ -4193,7 +4359,7 @@ function printMcpResult(configured, skipped, trustedFolder) {
|
|
|
4193
4359
|
console.log("");
|
|
4194
4360
|
}
|
|
4195
4361
|
function createSetupMcpCommand() {
|
|
4196
|
-
return new
|
|
4362
|
+
return new Command37("setup-mcp").description("Configure MCP server for AI agent integration").option(
|
|
4197
4363
|
"--client <client>",
|
|
4198
4364
|
"Client to configure (claude, gemini, codex, cursor, opencode, all)",
|
|
4199
4365
|
"all"
|
|
@@ -4339,7 +4505,7 @@ async function runInitAction2(opts) {
|
|
|
4339
4505
|
process.exit(ExitCode.SUCCESS);
|
|
4340
4506
|
}
|
|
4341
4507
|
function createInitCommand3() {
|
|
4342
|
-
const command = new
|
|
4508
|
+
const command = new Command38("init").description("Initialize a new harness-engineering project").option("-n, --name <name>", "Project name").option("-l, --level <level>", "Adoption level (basic, intermediate, advanced)", "basic").option("-t, --template <template>", "Specific template name (e.g. orchestrator)").option("--framework <framework>", "Framework overlay (nextjs)").option("--language <language>", "Target language (typescript, python, go, rust, java)").option("-f, --force", "Overwrite existing files").option("-y, --yes", "Use defaults without prompting").action(async (opts, cmd) => {
|
|
4343
4509
|
const globalOpts = cmd.optsWithGlobals();
|
|
4344
4510
|
await runInitAction2({
|
|
4345
4511
|
name: opts.name,
|
|
@@ -4358,7 +4524,7 @@ import * as fs20 from "fs";
|
|
|
4358
4524
|
import * as os5 from "os";
|
|
4359
4525
|
import * as path32 from "path";
|
|
4360
4526
|
import { execFileSync as execFileSync3 } from "child_process";
|
|
4361
|
-
import { Command as
|
|
4527
|
+
import { Command as Command39 } from "commander";
|
|
4362
4528
|
import { parse as yamlParse } from "yaml";
|
|
4363
4529
|
|
|
4364
4530
|
// src/registry/npm-client.ts
|
|
@@ -4919,7 +5085,7 @@ async function runInstall(skillName, options) {
|
|
|
4919
5085
|
return result;
|
|
4920
5086
|
}
|
|
4921
5087
|
function createInstallCommand() {
|
|
4922
|
-
const cmd = new
|
|
5088
|
+
const cmd = new Command39("install");
|
|
4923
5089
|
cmd.description("Install skills from npm registry, local directory, or GitHub repository").argument("<skill>", 'Skill name, @harness-skills/scoped package, or "." for bulk install').option("--version <range>", "Semver range or exact version to install").option("--force", "Force reinstall even if same version is already installed").option(
|
|
4924
5090
|
"--from <source>",
|
|
4925
5091
|
"Install from local path, directory, or GitHub (github:owner/repo, https://github.com/owner/repo)"
|
|
@@ -4955,7 +5121,7 @@ function createInstallCommand() {
|
|
|
4955
5121
|
init_dist2();
|
|
4956
5122
|
import * as fs21 from "fs/promises";
|
|
4957
5123
|
import * as path33 from "path";
|
|
4958
|
-
import { Command as
|
|
5124
|
+
import { Command as Command40 } from "commander";
|
|
4959
5125
|
import semver3 from "semver";
|
|
4960
5126
|
async function runInstallConstraints(options) {
|
|
4961
5127
|
const { source, configPath, lockfilePath } = options;
|
|
@@ -5209,17 +5375,17 @@ async function handleInstallConstraints(source, opts) {
|
|
|
5209
5375
|
logInstallResult(result.value, opts);
|
|
5210
5376
|
}
|
|
5211
5377
|
function createInstallConstraintsCommand() {
|
|
5212
|
-
const cmd = new
|
|
5378
|
+
const cmd = new Command40("install-constraints");
|
|
5213
5379
|
cmd.description("Install a constraints bundle into the local harness config").argument("<source>", "Path to a .harness-constraints.json bundle file").option("--force-local", "Resolve all conflicts by keeping local values").option("--force-package", "Resolve all conflicts by using package values").option("--dry-run", "Show what would change without writing files").option("-c, --config <path>", "Path to harness.config.json").action(handleInstallConstraints);
|
|
5214
5380
|
return cmd;
|
|
5215
5381
|
}
|
|
5216
5382
|
|
|
5217
5383
|
// src/commands/integrations/index.ts
|
|
5218
|
-
import { Command as
|
|
5384
|
+
import { Command as Command45 } from "commander";
|
|
5219
5385
|
|
|
5220
5386
|
// src/commands/integrations/add.ts
|
|
5221
5387
|
init_dist2();
|
|
5222
|
-
import { Command as
|
|
5388
|
+
import { Command as Command41 } from "commander";
|
|
5223
5389
|
import * as fs22 from "fs";
|
|
5224
5390
|
import * as path34 from "path";
|
|
5225
5391
|
import chalk4 from "chalk";
|
|
@@ -5283,7 +5449,7 @@ function printAddSuccess(value) {
|
|
|
5283
5449
|
}
|
|
5284
5450
|
}
|
|
5285
5451
|
function createAddIntegrationCommand() {
|
|
5286
|
-
return new
|
|
5452
|
+
return new Command41("add").description("Enable an MCP integration").argument("<name>", "Integration name (e.g. perplexity, augment-code)").action(async (name, _opts, cmd) => {
|
|
5287
5453
|
const globalOpts = cmd.optsWithGlobals();
|
|
5288
5454
|
const result = addIntegration(process.cwd(), name);
|
|
5289
5455
|
if (!result.ok) {
|
|
@@ -5297,7 +5463,7 @@ function createAddIntegrationCommand() {
|
|
|
5297
5463
|
}
|
|
5298
5464
|
|
|
5299
5465
|
// src/commands/integrations/list.ts
|
|
5300
|
-
import { Command as
|
|
5466
|
+
import { Command as Command42 } from "commander";
|
|
5301
5467
|
import * as path35 from "path";
|
|
5302
5468
|
import chalk5 from "chalk";
|
|
5303
5469
|
function printTier0Integrations(tier0, mcpServers) {
|
|
@@ -5354,12 +5520,12 @@ async function runListIntegrations(globalOpts) {
|
|
|
5354
5520
|
process.exit(ExitCode.SUCCESS);
|
|
5355
5521
|
}
|
|
5356
5522
|
function createListIntegrationsCommand() {
|
|
5357
|
-
return new
|
|
5523
|
+
return new Command42("list").description("Show all MCP integrations with status").action(async (_opts, cmd) => runListIntegrations(cmd.optsWithGlobals()));
|
|
5358
5524
|
}
|
|
5359
5525
|
|
|
5360
5526
|
// src/commands/integrations/remove.ts
|
|
5361
5527
|
init_dist2();
|
|
5362
|
-
import { Command as
|
|
5528
|
+
import { Command as Command43 } from "commander";
|
|
5363
5529
|
import * as fs23 from "fs";
|
|
5364
5530
|
import * as path36 from "path";
|
|
5365
5531
|
function removeIntegration(cwd, name) {
|
|
@@ -5386,7 +5552,7 @@ function removeIntegration(cwd, name) {
|
|
|
5386
5552
|
return Ok(def.displayName);
|
|
5387
5553
|
}
|
|
5388
5554
|
function createRemoveIntegrationCommand() {
|
|
5389
|
-
return new
|
|
5555
|
+
return new Command43("remove").description("Remove an MCP integration").argument("<name>", "Integration name (e.g. perplexity, augment-code)").action(async (name, _opts, cmd) => {
|
|
5390
5556
|
const globalOpts = cmd.optsWithGlobals();
|
|
5391
5557
|
const cwd = process.cwd();
|
|
5392
5558
|
const result = removeIntegration(cwd, name);
|
|
@@ -5408,7 +5574,7 @@ function createRemoveIntegrationCommand() {
|
|
|
5408
5574
|
|
|
5409
5575
|
// src/commands/integrations/dismiss.ts
|
|
5410
5576
|
init_dist2();
|
|
5411
|
-
import { Command as
|
|
5577
|
+
import { Command as Command44 } from "commander";
|
|
5412
5578
|
import * as path37 from "path";
|
|
5413
5579
|
function dismissIntegration(cwd, name) {
|
|
5414
5580
|
const def = INTEGRATION_REGISTRY.find((i) => i.name === name);
|
|
@@ -5430,7 +5596,7 @@ function dismissIntegration(cwd, name) {
|
|
|
5430
5596
|
return Ok(def.displayName);
|
|
5431
5597
|
}
|
|
5432
5598
|
function createDismissIntegrationCommand() {
|
|
5433
|
-
return new
|
|
5599
|
+
return new Command44("dismiss").description("Suppress doctor recommendations for an integration").argument("<name>", "Integration name (e.g. perplexity, augment-code)").action(async (name, _opts, cmd) => {
|
|
5434
5600
|
const globalOpts = cmd.optsWithGlobals();
|
|
5435
5601
|
const cwd = process.cwd();
|
|
5436
5602
|
const result = dismissIntegration(cwd, name);
|
|
@@ -5454,7 +5620,7 @@ function createDismissIntegrationCommand() {
|
|
|
5454
5620
|
|
|
5455
5621
|
// src/commands/integrations/index.ts
|
|
5456
5622
|
function createIntegrationsCommand() {
|
|
5457
|
-
const command = new
|
|
5623
|
+
const command = new Command45("integrations").description(
|
|
5458
5624
|
"Manage MCP peer integrations (add, list, remove, dismiss)"
|
|
5459
5625
|
);
|
|
5460
5626
|
command.addCommand(createListIntegrationsCommand());
|
|
@@ -5465,18 +5631,18 @@ function createIntegrationsCommand() {
|
|
|
5465
5631
|
}
|
|
5466
5632
|
|
|
5467
5633
|
// src/commands/knowledge-pipeline.ts
|
|
5468
|
-
import { Command as
|
|
5634
|
+
import { Command as Command46 } from "commander";
|
|
5469
5635
|
import * as path38 from "path";
|
|
5470
5636
|
import chalk6 from "chalk";
|
|
5471
5637
|
function createKnowledgePipelineCommand() {
|
|
5472
|
-
return new
|
|
5638
|
+
return new Command46("knowledge-pipeline").description("Run knowledge extraction, drift detection, and gap analysis").option("--fix", "Enable convergence-based auto-remediation (default: detect-only)").option("--ci", "Non-interactive mode \u2014 apply safe fixes only, report everything else").option("--domain <name>", "Limit pipeline to a specific knowledge domain").option("--drift-check", "Exit 1 if unresolved drift exists (CI gate mode)").option("--analyze-images", "Enable vision model analysis of image files").option("--image-paths <paths>", "Comma-separated image file paths for analysis").option("--coverage", "Display per-domain coverage report").option("--check-contradictions", "Display cross-source contradiction report").action(async (opts, cmd) => {
|
|
5473
5639
|
const globalOpts = cmd.optsWithGlobals();
|
|
5474
5640
|
const projectDir = process.cwd();
|
|
5475
5641
|
try {
|
|
5476
5642
|
const graphDir = path38.join(projectDir, ".harness", "graph");
|
|
5477
5643
|
const fs44 = await import("fs/promises");
|
|
5478
5644
|
await fs44.mkdir(graphDir, { recursive: true });
|
|
5479
|
-
const { GraphStore, KnowledgePipelineRunner } = await import("./dist-
|
|
5645
|
+
const { GraphStore, KnowledgePipelineRunner } = await import("./dist-QPWXPCPL.js");
|
|
5480
5646
|
const store = new GraphStore();
|
|
5481
5647
|
try {
|
|
5482
5648
|
await store.load(graphDir);
|
|
@@ -5633,11 +5799,11 @@ function createKnowledgePipelineCommand() {
|
|
|
5633
5799
|
}
|
|
5634
5800
|
|
|
5635
5801
|
// src/commands/learnings/index.ts
|
|
5636
|
-
import { Command as
|
|
5802
|
+
import { Command as Command48 } from "commander";
|
|
5637
5803
|
|
|
5638
5804
|
// src/commands/learnings/prune.ts
|
|
5639
5805
|
init_dist2();
|
|
5640
|
-
import { Command as
|
|
5806
|
+
import { Command as Command47 } from "commander";
|
|
5641
5807
|
import * as path39 from "path";
|
|
5642
5808
|
async function handlePrune(opts) {
|
|
5643
5809
|
const projectPath = path39.resolve(opts.path);
|
|
@@ -5679,23 +5845,23 @@ function printPatternProposals(patterns) {
|
|
|
5679
5845
|
);
|
|
5680
5846
|
}
|
|
5681
5847
|
function createPruneCommand() {
|
|
5682
|
-
return new
|
|
5848
|
+
return new Command47("prune").description(
|
|
5683
5849
|
"Analyze global learnings for patterns, present improvement proposals, and archive old entries"
|
|
5684
5850
|
).option("--path <path>", "Project root path", ".").option("--stream <name>", "Target a specific stream").action(handlePrune);
|
|
5685
5851
|
}
|
|
5686
5852
|
|
|
5687
5853
|
// src/commands/learnings/index.ts
|
|
5688
5854
|
function createLearningsCommand() {
|
|
5689
|
-
const command = new
|
|
5855
|
+
const command = new Command48("learnings").description("Learnings management commands");
|
|
5690
5856
|
command.addCommand(createPruneCommand());
|
|
5691
5857
|
return command;
|
|
5692
5858
|
}
|
|
5693
5859
|
|
|
5694
5860
|
// src/commands/linter/index.ts
|
|
5695
|
-
import { Command as
|
|
5861
|
+
import { Command as Command51 } from "commander";
|
|
5696
5862
|
|
|
5697
5863
|
// src/commands/linter/generate.ts
|
|
5698
|
-
import { Command as
|
|
5864
|
+
import { Command as Command49 } from "commander";
|
|
5699
5865
|
function formatGenerateError(e) {
|
|
5700
5866
|
switch (e.type) {
|
|
5701
5867
|
case "parse":
|
|
@@ -5739,7 +5905,7 @@ function handleSuccess(result, useJson) {
|
|
|
5739
5905
|
Generated ${result.rulesGenerated.length} rules to ${result.outputDir}`);
|
|
5740
5906
|
}
|
|
5741
5907
|
function createGenerateCommand2() {
|
|
5742
|
-
return new
|
|
5908
|
+
return new Command49("generate").description("Generate ESLint rules from harness-linter.yml").option("-c, --config <path>", "Path to harness-linter.yml", "./harness-linter.yml").option("-o, --output <dir>", "Override output directory").option("--clean", "Remove existing files before generating").option("--dry-run", "Preview without writing files").option("--json", "Output as JSON").option("--verbose", "Show detailed output").action(async (options) => {
|
|
5743
5909
|
try {
|
|
5744
5910
|
if (options.verbose) logger.info(`Parsing config: ${options.config}`);
|
|
5745
5911
|
const result = await generate({
|
|
@@ -5761,9 +5927,9 @@ function createGenerateCommand2() {
|
|
|
5761
5927
|
}
|
|
5762
5928
|
|
|
5763
5929
|
// src/commands/linter/validate.ts
|
|
5764
|
-
import { Command as
|
|
5930
|
+
import { Command as Command50 } from "commander";
|
|
5765
5931
|
function createValidateCommand() {
|
|
5766
|
-
return new
|
|
5932
|
+
return new Command50("validate").description("Validate harness-linter.yml config").option("-c, --config <path>", "Path to harness-linter.yml", "./harness-linter.yml").option("--json", "Output as JSON").action(async (options) => {
|
|
5767
5933
|
try {
|
|
5768
5934
|
const result = await validate({ configPath: options.config });
|
|
5769
5935
|
if (options.json) {
|
|
@@ -5782,7 +5948,7 @@ function createValidateCommand() {
|
|
|
5782
5948
|
|
|
5783
5949
|
// src/commands/linter/index.ts
|
|
5784
5950
|
function createLinterCommand() {
|
|
5785
|
-
const linter = new
|
|
5951
|
+
const linter = new Command51("linter").description(
|
|
5786
5952
|
"Generate and validate ESLint rules from YAML config"
|
|
5787
5953
|
);
|
|
5788
5954
|
linter.addCommand(createGenerateCommand2());
|
|
@@ -5791,7 +5957,7 @@ function createLinterCommand() {
|
|
|
5791
5957
|
}
|
|
5792
5958
|
|
|
5793
5959
|
// src/commands/mcp.ts
|
|
5794
|
-
import { Command as
|
|
5960
|
+
import { Command as Command52 } from "commander";
|
|
5795
5961
|
var VALID_TIERS = /* @__PURE__ */ new Set(["core", "standard", "full"]);
|
|
5796
5962
|
function parseTier(value) {
|
|
5797
5963
|
const lower = value.toLowerCase();
|
|
@@ -5808,7 +5974,7 @@ function parseBudget(value) {
|
|
|
5808
5974
|
return n;
|
|
5809
5975
|
}
|
|
5810
5976
|
function createMcpCommand() {
|
|
5811
|
-
return new
|
|
5977
|
+
return new Command52("mcp").description("Start the MCP (Model Context Protocol) server on stdio").option("--tools <tools...>", "Only register the specified tools (used by Cursor integration)").option(
|
|
5812
5978
|
"--tier <core|standard|full>",
|
|
5813
5979
|
"Load a preset tool tier instead of all tools",
|
|
5814
5980
|
parseTier
|
|
@@ -5818,8 +5984,8 @@ function createMcpCommand() {
|
|
|
5818
5984
|
parseBudget
|
|
5819
5985
|
).action(async (opts) => {
|
|
5820
5986
|
const [{ startServer: startServer2, getToolDefinitions: getToolDefinitions2 }, { selectTier }] = await Promise.all([
|
|
5821
|
-
import("./mcp-
|
|
5822
|
-
import("./tool-tiers-
|
|
5987
|
+
import("./mcp-5KQGFG5U.js"),
|
|
5988
|
+
import("./tool-tiers-QVWKAZX4.js")
|
|
5823
5989
|
]);
|
|
5824
5990
|
if (opts.tools && opts.tools.length > 0) {
|
|
5825
5991
|
await startServer2(opts.tools);
|
|
@@ -5841,7 +6007,7 @@ function createMcpCommand() {
|
|
|
5841
6007
|
// src/commands/migrate.ts
|
|
5842
6008
|
init_dist2();
|
|
5843
6009
|
init_dist();
|
|
5844
|
-
import { Command as
|
|
6010
|
+
import { Command as Command53 } from "commander";
|
|
5845
6011
|
import * as fs24 from "fs";
|
|
5846
6012
|
import * as path40 from "path";
|
|
5847
6013
|
import * as readline from "readline";
|
|
@@ -6084,7 +6250,7 @@ function updateReferences(plan) {
|
|
|
6084
6250
|
}
|
|
6085
6251
|
async function prompt(question, def = "n") {
|
|
6086
6252
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
6087
|
-
const answer = await new Promise((
|
|
6253
|
+
const answer = await new Promise((resolve42) => rl.question(question, resolve42));
|
|
6088
6254
|
rl.close();
|
|
6089
6255
|
return (answer.trim() || def).toLowerCase();
|
|
6090
6256
|
}
|
|
@@ -6247,7 +6413,7 @@ async function runMigrate(opts) {
|
|
|
6247
6413
|
});
|
|
6248
6414
|
}
|
|
6249
6415
|
function createMigrateCommand() {
|
|
6250
|
-
return new
|
|
6416
|
+
return new Command53("migrate").description("Migrate legacy harness artifact locations to current layout").option("--dry-run", "Show the migration plan without moving files", false).option("--yes", "Skip confirmation prompt", false).option(
|
|
6251
6417
|
"--skip-references",
|
|
6252
6418
|
"Do not update path references in docs/sessions after moves",
|
|
6253
6419
|
false
|
|
@@ -6269,11 +6435,11 @@ function createMigrateCommand() {
|
|
|
6269
6435
|
}
|
|
6270
6436
|
|
|
6271
6437
|
// src/commands/orchestrator.ts
|
|
6272
|
-
import { Command as
|
|
6438
|
+
import { Command as Command54 } from "commander";
|
|
6273
6439
|
import * as path41 from "path";
|
|
6274
6440
|
import { Orchestrator, WorkflowLoader, launchTUI } from "@harness-engineering/orchestrator";
|
|
6275
6441
|
function createOrchestratorCommand() {
|
|
6276
|
-
const orchestrator = new
|
|
6442
|
+
const orchestrator = new Command54("orchestrator");
|
|
6277
6443
|
orchestrator.command("run").description("Run the orchestrator daemon").option("-w, --workflow <path>", "Path to harness.orchestrator.md", "harness.orchestrator.md").option("--headless", "Run without TUI (server-only mode for use with web dashboard)").action(async (opts) => {
|
|
6278
6444
|
const workflowPath = path41.resolve(process.cwd(), opts.workflow);
|
|
6279
6445
|
const loader = new WorkflowLoader();
|
|
@@ -6308,13 +6474,13 @@ function createOrchestratorCommand() {
|
|
|
6308
6474
|
|
|
6309
6475
|
// src/commands/perf.ts
|
|
6310
6476
|
init_dist2();
|
|
6311
|
-
import { Command as
|
|
6477
|
+
import { Command as Command55 } from "commander";
|
|
6312
6478
|
import * as path42 from "path";
|
|
6313
6479
|
function registerBenchCommand(perf) {
|
|
6314
6480
|
perf.command("bench [glob]").description("Run benchmarks via vitest bench").action(async (glob2, _opts, cmd) => {
|
|
6315
6481
|
const globalOpts = cmd.optsWithGlobals();
|
|
6316
6482
|
const cwd = process.cwd();
|
|
6317
|
-
const { BenchmarkRunner } = await import("./dist-
|
|
6483
|
+
const { BenchmarkRunner } = await import("./dist-HA6IIPRC.js");
|
|
6318
6484
|
const runner = new BenchmarkRunner();
|
|
6319
6485
|
const benchFiles = runner.discover(cwd, glob2);
|
|
6320
6486
|
if (benchFiles.length === 0) {
|
|
@@ -6378,7 +6544,7 @@ async function runBaselinesShow(globalOpts) {
|
|
|
6378
6544
|
}
|
|
6379
6545
|
async function runBaselinesUpdate(globalOpts) {
|
|
6380
6546
|
const cwd = process.cwd();
|
|
6381
|
-
const { BenchmarkRunner } = await import("./dist-
|
|
6547
|
+
const { BenchmarkRunner } = await import("./dist-HA6IIPRC.js");
|
|
6382
6548
|
const runner = new BenchmarkRunner();
|
|
6383
6549
|
const manager = new BaselineManager(cwd);
|
|
6384
6550
|
logger.info("Running benchmarks to update baselines...");
|
|
@@ -6419,7 +6585,7 @@ function registerReportCommand(perf) {
|
|
|
6419
6585
|
perf.command("report").description("Full performance report with metrics, trends, and hotspots").action(async (_opts, cmd) => {
|
|
6420
6586
|
const globalOpts = cmd.optsWithGlobals();
|
|
6421
6587
|
const cwd = process.cwd();
|
|
6422
|
-
const { EntropyAnalyzer: EntropyAnalyzer2 } = await import("./dist-
|
|
6588
|
+
const { EntropyAnalyzer: EntropyAnalyzer2 } = await import("./dist-HA6IIPRC.js");
|
|
6423
6589
|
const analyzer = new EntropyAnalyzer2({
|
|
6424
6590
|
rootDir: path42.resolve(cwd),
|
|
6425
6591
|
analyze: { complexity: true, coupling: true }
|
|
@@ -6480,7 +6646,7 @@ function registerCriticalPathsCommand(perf) {
|
|
|
6480
6646
|
});
|
|
6481
6647
|
}
|
|
6482
6648
|
function createPerfCommand() {
|
|
6483
|
-
const perf = new
|
|
6649
|
+
const perf = new Command55("perf").description("Performance benchmark and baseline management");
|
|
6484
6650
|
registerBenchCommand(perf);
|
|
6485
6651
|
registerBaselinesCommands(perf);
|
|
6486
6652
|
registerReportCommand(perf);
|
|
@@ -6489,10 +6655,10 @@ function createPerfCommand() {
|
|
|
6489
6655
|
}
|
|
6490
6656
|
|
|
6491
6657
|
// src/commands/persona/index.ts
|
|
6492
|
-
import { Command as
|
|
6658
|
+
import { Command as Command58 } from "commander";
|
|
6493
6659
|
|
|
6494
6660
|
// src/commands/persona/list.ts
|
|
6495
|
-
import { Command as
|
|
6661
|
+
import { Command as Command56 } from "commander";
|
|
6496
6662
|
function printPersonaList(personas) {
|
|
6497
6663
|
if (personas.length === 0) {
|
|
6498
6664
|
logger.info("No personas found.");
|
|
@@ -6506,7 +6672,7 @@ function printPersonaList(personas) {
|
|
|
6506
6672
|
}
|
|
6507
6673
|
}
|
|
6508
6674
|
function createListCommand2() {
|
|
6509
|
-
return new
|
|
6675
|
+
return new Command56("list").description("List available agent personas").action(async (_opts, cmd) => {
|
|
6510
6676
|
const globalOpts = cmd.optsWithGlobals();
|
|
6511
6677
|
const personasDir = resolvePersonasDir();
|
|
6512
6678
|
const result = listPersonas(personasDir);
|
|
@@ -6526,7 +6692,7 @@ function createListCommand2() {
|
|
|
6526
6692
|
}
|
|
6527
6693
|
|
|
6528
6694
|
// src/commands/persona/generate.ts
|
|
6529
|
-
import { Command as
|
|
6695
|
+
import { Command as Command57 } from "commander";
|
|
6530
6696
|
import * as fs25 from "fs";
|
|
6531
6697
|
import * as path43 from "path";
|
|
6532
6698
|
function generatePersonaArtifacts(persona, outputDir, only) {
|
|
@@ -6561,7 +6727,7 @@ function generatePersonaArtifacts(persona, outputDir, only) {
|
|
|
6561
6727
|
return generated;
|
|
6562
6728
|
}
|
|
6563
6729
|
function createGenerateCommand3() {
|
|
6564
|
-
return new
|
|
6730
|
+
return new Command57("generate").description("Generate artifacts from a persona config").argument("<name>", "Persona name (e.g., architecture-enforcer)").option("--output-dir <dir>", "Output directory", ".").option("--only <type>", "Generate only: ci, agents-md, runtime").action(async (name, opts, cmd) => {
|
|
6565
6731
|
const globalOpts = cmd.optsWithGlobals();
|
|
6566
6732
|
const personaResult = loadPersona(path43.join(resolvePersonasDir(), `${name}.yaml`));
|
|
6567
6733
|
if (!personaResult.ok) {
|
|
@@ -6583,7 +6749,7 @@ function createGenerateCommand3() {
|
|
|
6583
6749
|
|
|
6584
6750
|
// src/commands/persona/index.ts
|
|
6585
6751
|
function createPersonaCommand() {
|
|
6586
|
-
const command = new
|
|
6752
|
+
const command = new Command58("persona").description("Agent persona management commands");
|
|
6587
6753
|
command.addCommand(createListCommand2());
|
|
6588
6754
|
command.addCommand(createGenerateCommand3());
|
|
6589
6755
|
return command;
|
|
@@ -6591,7 +6757,7 @@ function createPersonaCommand() {
|
|
|
6591
6757
|
|
|
6592
6758
|
// src/commands/predict.ts
|
|
6593
6759
|
init_dist2();
|
|
6594
|
-
import { Command as
|
|
6760
|
+
import { Command as Command59 } from "commander";
|
|
6595
6761
|
import chalk8 from "chalk";
|
|
6596
6762
|
var CATEGORY_ORDER = [
|
|
6597
6763
|
"circular-deps",
|
|
@@ -6697,7 +6863,7 @@ function handlePredictError(err, mode) {
|
|
|
6697
6863
|
process.exit(ExitCode.ERROR);
|
|
6698
6864
|
}
|
|
6699
6865
|
function createPredictCommand() {
|
|
6700
|
-
const command = new
|
|
6866
|
+
const command = new Command59("predict").description("Predict which architectural constraints will break and when").option("--category <name>", "Filter to a single metric category").option("--no-roadmap", "Baseline only \u2014 skip roadmap spec impact").option("--horizon <weeks>", "Forecast horizon in weeks (default: 12)", "12").action(async (opts, cmd) => {
|
|
6701
6867
|
const globalOpts = cmd.optsWithGlobals();
|
|
6702
6868
|
const mode = globalOpts.json ? OutputMode.JSON : OutputMode.TEXT;
|
|
6703
6869
|
try {
|
|
@@ -6722,7 +6888,7 @@ function createPredictCommand() {
|
|
|
6722
6888
|
// src/commands/publish-analyses.ts
|
|
6723
6889
|
import * as fs26 from "fs";
|
|
6724
6890
|
import * as path44 from "path";
|
|
6725
|
-
import { Command as
|
|
6891
|
+
import { Command as Command60 } from "commander";
|
|
6726
6892
|
init_dist2();
|
|
6727
6893
|
import {
|
|
6728
6894
|
renderAnalysisComment,
|
|
@@ -6835,7 +7001,7 @@ async function runPublishAnalyses(opts) {
|
|
|
6835
7001
|
const nameToExternalId = await buildNameToExternalIdMap(projectPath);
|
|
6836
7002
|
if (!nameToExternalId) return process.exit(1);
|
|
6837
7003
|
const { AnalysisArchive } = await import("@harness-engineering/orchestrator");
|
|
6838
|
-
const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-
|
|
7004
|
+
const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-HA6IIPRC.js");
|
|
6839
7005
|
const archive = new AnalysisArchive(path44.join(projectPath, ".harness", "analyses"));
|
|
6840
7006
|
const analyses = await archive.list();
|
|
6841
7007
|
if (analyses.length === 0) {
|
|
@@ -6858,7 +7024,7 @@ async function runPublishAnalyses(opts) {
|
|
|
6858
7024
|
}
|
|
6859
7025
|
}
|
|
6860
7026
|
function createPublishAnalysesCommand() {
|
|
6861
|
-
const command = new
|
|
7027
|
+
const command = new Command60("publish-analyses").description(
|
|
6862
7028
|
"Publishes locally generated intelligence analyses to the external issue tracker (e.g., GitHub)"
|
|
6863
7029
|
).option("-d, --dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
6864
7030
|
try {
|
|
@@ -6874,13 +7040,13 @@ function createPublishAnalysesCommand() {
|
|
|
6874
7040
|
}
|
|
6875
7041
|
|
|
6876
7042
|
// src/commands/pulse/index.ts
|
|
6877
|
-
import { Command as
|
|
7043
|
+
import { Command as Command62 } from "commander";
|
|
6878
7044
|
|
|
6879
7045
|
// src/commands/pulse/run.ts
|
|
6880
7046
|
init_dist2();
|
|
6881
7047
|
import { readFileSync as readFileSync15, mkdirSync as mkdirSync13, writeFileSync as writeFileSync14 } from "fs";
|
|
6882
|
-
import { dirname as dirname17, join as join35, resolve as
|
|
6883
|
-
import { Command as
|
|
7048
|
+
import { dirname as dirname17, join as join35, resolve as resolve30 } from "path";
|
|
7049
|
+
import { Command as Command61 } from "commander";
|
|
6884
7050
|
async function runPulseRunCommand(opts) {
|
|
6885
7051
|
const startedAt = Date.now();
|
|
6886
7052
|
let raw;
|
|
@@ -6945,7 +7111,7 @@ function emit2(status, nonInteractive) {
|
|
|
6945
7111
|
return status;
|
|
6946
7112
|
}
|
|
6947
7113
|
function createRunCommand2() {
|
|
6948
|
-
return new
|
|
7114
|
+
return new Command61("run").description("Run a pulse: query configured adapters, sanitize, assemble single-page report").option(
|
|
6949
7115
|
"--lookback <window>",
|
|
6950
7116
|
"Lookback window (e.g. 24h, 7d). Defaults to pulse.lookbackDefault."
|
|
6951
7117
|
).option(
|
|
@@ -6955,8 +7121,8 @@ function createRunCommand2() {
|
|
|
6955
7121
|
async (options) => {
|
|
6956
7122
|
const nonInteractive = options.nonInteractive === true || !process.stdout.isTTY;
|
|
6957
7123
|
const status = await runPulseRunCommand({
|
|
6958
|
-
configPath:
|
|
6959
|
-
outputDir:
|
|
7124
|
+
configPath: resolve30(process.cwd(), options.config),
|
|
7125
|
+
outputDir: resolve30(process.cwd(), options.outputDir),
|
|
6960
7126
|
nonInteractive,
|
|
6961
7127
|
lookback: options.lookback
|
|
6962
7128
|
});
|
|
@@ -6969,13 +7135,13 @@ function createRunCommand2() {
|
|
|
6969
7135
|
|
|
6970
7136
|
// src/commands/pulse/index.ts
|
|
6971
7137
|
function createPulseCommand() {
|
|
6972
|
-
const command = new
|
|
7138
|
+
const command = new Command62("pulse").description("Pulse (read-side observability) commands");
|
|
6973
7139
|
command.addCommand(createRunCommand2());
|
|
6974
7140
|
return command;
|
|
6975
7141
|
}
|
|
6976
7142
|
|
|
6977
7143
|
// src/commands/recommend.ts
|
|
6978
|
-
import { Command as
|
|
7144
|
+
import { Command as Command63 } from "commander";
|
|
6979
7145
|
import chalk9 from "chalk";
|
|
6980
7146
|
async function resolveSnapshot(cwd, noCache) {
|
|
6981
7147
|
if (!noCache) {
|
|
@@ -7039,7 +7205,7 @@ function printRecommendations(result) {
|
|
|
7039
7205
|
console.log("");
|
|
7040
7206
|
}
|
|
7041
7207
|
function createRecommendCommand() {
|
|
7042
|
-
const command = new
|
|
7208
|
+
const command = new Command63("recommend").description("Recommend skills based on codebase health analysis").option("--no-cache", "Force fresh health snapshot").option("--top <n>", "Max recommendations (default 5)", "5").action(async (opts, cmd) => {
|
|
7043
7209
|
const globalOpts = cmd.optsWithGlobals();
|
|
7044
7210
|
const mode = globalOpts.json ? OutputMode.JSON : OutputMode.TEXT;
|
|
7045
7211
|
try {
|
|
@@ -7075,11 +7241,11 @@ function createRecommendCommand() {
|
|
|
7075
7241
|
}
|
|
7076
7242
|
|
|
7077
7243
|
// src/commands/roadmap/index.ts
|
|
7078
|
-
import { Command as
|
|
7244
|
+
import { Command as Command65 } from "commander";
|
|
7079
7245
|
|
|
7080
7246
|
// src/commands/roadmap/migrate.ts
|
|
7081
7247
|
init_dist2();
|
|
7082
|
-
import { Command as
|
|
7248
|
+
import { Command as Command64 } from "commander";
|
|
7083
7249
|
import * as fs28 from "fs";
|
|
7084
7250
|
import * as path46 from "path";
|
|
7085
7251
|
import chalk10 from "chalk";
|
|
@@ -7349,7 +7515,7 @@ async function runRoadmapMigrate(opts) {
|
|
|
7349
7515
|
}
|
|
7350
7516
|
}
|
|
7351
7517
|
function createRoadmapMigrateCommand() {
|
|
7352
|
-
return new
|
|
7518
|
+
return new Command64("migrate").description("Migrate the project roadmap to a different storage mode").requiredOption("--to <target>", 'Migration target (only "file-less" supported today)').option("--dry-run", "Print the migration plan without making any changes", false).option(
|
|
7353
7519
|
"--format <fmt>",
|
|
7354
7520
|
'Output format: "human" (default) or "json" (single JSON object for CI consumers)',
|
|
7355
7521
|
"human"
|
|
@@ -7384,14 +7550,14 @@ function createRoadmapMigrateCommand() {
|
|
|
7384
7550
|
|
|
7385
7551
|
// src/commands/roadmap/index.ts
|
|
7386
7552
|
function createRoadmapCommand() {
|
|
7387
|
-
const roadmap = new
|
|
7553
|
+
const roadmap = new Command65("roadmap").description("Roadmap management");
|
|
7388
7554
|
roadmap.addCommand(createRoadmapMigrateCommand());
|
|
7389
7555
|
return roadmap;
|
|
7390
7556
|
}
|
|
7391
7557
|
|
|
7392
7558
|
// src/commands/scan-config.ts
|
|
7393
7559
|
init_dist2();
|
|
7394
|
-
import { Command as
|
|
7560
|
+
import { Command as Command66 } from "commander";
|
|
7395
7561
|
import { existsSync as existsSync25, readFileSync as readFileSync18, writeFileSync as writeFileSync17 } from "fs";
|
|
7396
7562
|
import { join as join38, relative as relative3 } from "path";
|
|
7397
7563
|
var CONFIG_FILES = ["CLAUDE.md", "AGENTS.md", ".gemini/settings.json", "skill.yaml"];
|
|
@@ -7480,7 +7646,7 @@ function formatTextOutput(result) {
|
|
|
7480
7646
|
}
|
|
7481
7647
|
}
|
|
7482
7648
|
function createScanConfigCommand() {
|
|
7483
|
-
const command = new
|
|
7649
|
+
const command = new Command66("scan-config").description(
|
|
7484
7650
|
"Scan CLAUDE.md, AGENTS.md, .gemini/settings.json, and skill.yaml for prompt injection patterns"
|
|
7485
7651
|
).option("--path <dir>", "Target directory to scan (default: cwd)").option("--fix", "Strip high-severity patterns from files in-place").action(async (opts, cmd) => {
|
|
7486
7652
|
const globalOpts = cmd.optsWithGlobals();
|
|
@@ -7497,7 +7663,7 @@ function createScanConfigCommand() {
|
|
|
7497
7663
|
}
|
|
7498
7664
|
|
|
7499
7665
|
// src/commands/setup.ts
|
|
7500
|
-
import { Command as
|
|
7666
|
+
import { Command as Command67 } from "commander";
|
|
7501
7667
|
import * as fs31 from "fs";
|
|
7502
7668
|
import * as os8 from "os";
|
|
7503
7669
|
import * as path49 from "path";
|
|
@@ -7536,10 +7702,10 @@ function prompt2(question) {
|
|
|
7536
7702
|
input: process.stdin,
|
|
7537
7703
|
output: process.stdout
|
|
7538
7704
|
});
|
|
7539
|
-
return new Promise((
|
|
7705
|
+
return new Promise((resolve42) => {
|
|
7540
7706
|
rl.question(question, (answer) => {
|
|
7541
7707
|
rl.close();
|
|
7542
|
-
|
|
7708
|
+
resolve42(answer.trim().toLowerCase());
|
|
7543
7709
|
});
|
|
7544
7710
|
});
|
|
7545
7711
|
}
|
|
@@ -7548,10 +7714,10 @@ function promptRaw(question) {
|
|
|
7548
7714
|
input: process.stdin,
|
|
7549
7715
|
output: process.stdout
|
|
7550
7716
|
});
|
|
7551
|
-
return new Promise((
|
|
7717
|
+
return new Promise((resolve42) => {
|
|
7552
7718
|
rl.question(question, (answer) => {
|
|
7553
7719
|
rl.close();
|
|
7554
|
-
|
|
7720
|
+
resolve42(answer.trim());
|
|
7555
7721
|
});
|
|
7556
7722
|
});
|
|
7557
7723
|
}
|
|
@@ -7803,7 +7969,7 @@ async function detectLegacyLayout(cwd) {
|
|
|
7803
7969
|
}
|
|
7804
7970
|
async function runInitialGraphScan(cwd) {
|
|
7805
7971
|
try {
|
|
7806
|
-
const { runScan: runScan2 } = await import("./scan-
|
|
7972
|
+
const { runScan: runScan2 } = await import("./scan-4PPP6ZXT.js");
|
|
7807
7973
|
const result = await runScan2(cwd);
|
|
7808
7974
|
return {
|
|
7809
7975
|
status: "pass",
|
|
@@ -7842,7 +8008,7 @@ async function runSetup(cwd) {
|
|
|
7842
8008
|
return { steps, success };
|
|
7843
8009
|
}
|
|
7844
8010
|
function createSetupCommand() {
|
|
7845
|
-
return new
|
|
8011
|
+
return new Command67("setup").description("Configure harness environment: slash commands, MCP, and more").action(async () => {
|
|
7846
8012
|
const cwd = process.cwd();
|
|
7847
8013
|
console.log("");
|
|
7848
8014
|
console.log(` ${chalk12.bold("harness setup")}`);
|
|
@@ -7865,7 +8031,7 @@ function createSetupCommand() {
|
|
|
7865
8031
|
|
|
7866
8032
|
// src/commands/share.ts
|
|
7867
8033
|
init_dist2();
|
|
7868
|
-
import { Command as
|
|
8034
|
+
import { Command as Command68 } from "commander";
|
|
7869
8035
|
import * as fs32 from "fs";
|
|
7870
8036
|
import * as path50 from "path";
|
|
7871
8037
|
import { parse as parseYaml } from "yaml";
|
|
@@ -7924,16 +8090,16 @@ Create a constraints.yaml in your project root to define what to share.`
|
|
|
7924
8090
|
logger.success(`Bundle written to ${outputPath}`);
|
|
7925
8091
|
}
|
|
7926
8092
|
function createShareCommand() {
|
|
7927
|
-
return new
|
|
8093
|
+
return new Command68("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) => {
|
|
7928
8094
|
await runShareAction(projectPath, options);
|
|
7929
8095
|
});
|
|
7930
8096
|
}
|
|
7931
8097
|
|
|
7932
8098
|
// src/commands/skill/index.ts
|
|
7933
|
-
import { Command as
|
|
8099
|
+
import { Command as Command76 } from "commander";
|
|
7934
8100
|
|
|
7935
8101
|
// src/commands/skill/list.ts
|
|
7936
|
-
import { Command as
|
|
8102
|
+
import { Command as Command69 } from "commander";
|
|
7937
8103
|
import * as fs33 from "fs";
|
|
7938
8104
|
import * as path51 from "path";
|
|
7939
8105
|
import { parse } from "yaml";
|
|
@@ -8036,7 +8202,7 @@ function printSkillsVerbose(skills) {
|
|
|
8036
8202
|
for (const s of skills) printSkillEntry(s);
|
|
8037
8203
|
}
|
|
8038
8204
|
function createListCommand3() {
|
|
8039
|
-
return new
|
|
8205
|
+
return new Command69("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) => {
|
|
8040
8206
|
const globalOpts = cmd.optsWithGlobals();
|
|
8041
8207
|
const skills = collectSkills({ filter: resolveFilter(opts) });
|
|
8042
8208
|
if (globalOpts.json) {
|
|
@@ -8051,7 +8217,7 @@ function createListCommand3() {
|
|
|
8051
8217
|
}
|
|
8052
8218
|
|
|
8053
8219
|
// src/commands/skill/run.ts
|
|
8054
|
-
import { Command as
|
|
8220
|
+
import { Command as Command70 } from "commander";
|
|
8055
8221
|
import * as fs34 from "fs";
|
|
8056
8222
|
import * as path52 from "path";
|
|
8057
8223
|
import { parse as parse2 } from "yaml";
|
|
@@ -8263,11 +8429,11 @@ async function runSkill(name, opts) {
|
|
|
8263
8429
|
process.exit(ExitCode.SUCCESS);
|
|
8264
8430
|
}
|
|
8265
8431
|
function createRunCommand3() {
|
|
8266
|
-
return new
|
|
8432
|
+
return new Command70("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").action(async (name, opts) => runSkill(name, opts));
|
|
8267
8433
|
}
|
|
8268
8434
|
|
|
8269
8435
|
// src/commands/skill/validate.ts
|
|
8270
|
-
import { Command as
|
|
8436
|
+
import { Command as Command71 } from "commander";
|
|
8271
8437
|
import * as fs35 from "fs";
|
|
8272
8438
|
import * as path53 from "path";
|
|
8273
8439
|
import { parse as parse3 } from "yaml";
|
|
@@ -8331,7 +8497,7 @@ function validateSkillEntry(name, skillsDir, errors) {
|
|
|
8331
8497
|
}
|
|
8332
8498
|
}
|
|
8333
8499
|
function createValidateCommand2() {
|
|
8334
|
-
return new
|
|
8500
|
+
return new Command71("validate").description("Validate all skill.yaml files and SKILL.md structure").action(async (_opts, cmd) => {
|
|
8335
8501
|
const globalOpts = cmd.optsWithGlobals();
|
|
8336
8502
|
const skillsDir = resolveSkillsDir();
|
|
8337
8503
|
if (!fs35.existsSync(skillsDir)) {
|
|
@@ -8361,7 +8527,7 @@ function createValidateCommand2() {
|
|
|
8361
8527
|
}
|
|
8362
8528
|
|
|
8363
8529
|
// src/commands/skill/info.ts
|
|
8364
|
-
import { Command as
|
|
8530
|
+
import { Command as Command72 } from "commander";
|
|
8365
8531
|
import * as fs36 from "fs";
|
|
8366
8532
|
import * as path54 from "path";
|
|
8367
8533
|
import { parse as parse4 } from "yaml";
|
|
@@ -8407,7 +8573,7 @@ function printSkillInfo(skill) {
|
|
|
8407
8573
|
console.log(`Persistent: ${skill.state.persistent}`);
|
|
8408
8574
|
}
|
|
8409
8575
|
function createInfoCommand() {
|
|
8410
|
-
return new
|
|
8576
|
+
return new Command72("info").description("Show metadata for a skill").argument("<name>", "Skill name (e.g., harness-tdd)").action(async (name, _opts, cmd) => {
|
|
8411
8577
|
const globalOpts = cmd.optsWithGlobals();
|
|
8412
8578
|
const loaded = loadSkillMetadata2(name);
|
|
8413
8579
|
if (!loaded.ok) {
|
|
@@ -8424,7 +8590,7 @@ function createInfoCommand() {
|
|
|
8424
8590
|
}
|
|
8425
8591
|
|
|
8426
8592
|
// src/commands/skill/search.ts
|
|
8427
|
-
import { Command as
|
|
8593
|
+
import { Command as Command73 } from "commander";
|
|
8428
8594
|
async function runSearch(query, opts) {
|
|
8429
8595
|
const results = await searchNpmRegistry(query, opts.registry);
|
|
8430
8596
|
return results.filter((r) => {
|
|
@@ -8469,13 +8635,13 @@ async function runSearchAction(query, opts, globalOpts) {
|
|
|
8469
8635
|
}
|
|
8470
8636
|
}
|
|
8471
8637
|
function createSearchCommand() {
|
|
8472
|
-
return new
|
|
8638
|
+
return new Command73("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) => {
|
|
8473
8639
|
await runSearchAction(query, opts, cmd.optsWithGlobals());
|
|
8474
8640
|
});
|
|
8475
8641
|
}
|
|
8476
8642
|
|
|
8477
8643
|
// src/commands/skill/create.ts
|
|
8478
|
-
import { Command as
|
|
8644
|
+
import { Command as Command74 } from "commander";
|
|
8479
8645
|
import * as path55 from "path";
|
|
8480
8646
|
import * as fs37 from "fs";
|
|
8481
8647
|
import YAML from "yaml";
|
|
@@ -8595,7 +8761,7 @@ Next steps:`);
|
|
|
8595
8761
|
logger.info(` 3. Run: harness skills publish`);
|
|
8596
8762
|
}
|
|
8597
8763
|
function createCreateCommand() {
|
|
8598
|
-
return new
|
|
8764
|
+
return new Command74("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) => {
|
|
8599
8765
|
const globalOpts = cmd.optsWithGlobals();
|
|
8600
8766
|
try {
|
|
8601
8767
|
const result = runCreate(name, {
|
|
@@ -8618,7 +8784,7 @@ function createCreateCommand() {
|
|
|
8618
8784
|
}
|
|
8619
8785
|
|
|
8620
8786
|
// src/commands/skill/publish.ts
|
|
8621
|
-
import { Command as
|
|
8787
|
+
import { Command as Command75 } from "commander";
|
|
8622
8788
|
import * as fs39 from "fs";
|
|
8623
8789
|
import * as path57 from "path";
|
|
8624
8790
|
import { execFileSync as execFileSync6 } from "child_process";
|
|
@@ -8787,7 +8953,7 @@ ${skillMdContent}`;
|
|
|
8787
8953
|
};
|
|
8788
8954
|
}
|
|
8789
8955
|
function createPublishCommand() {
|
|
8790
|
-
return new
|
|
8956
|
+
return new Command75("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) => {
|
|
8791
8957
|
const globalOpts = cmd.optsWithGlobals();
|
|
8792
8958
|
const skillDir = opts.dir || process.cwd();
|
|
8793
8959
|
try {
|
|
@@ -8812,7 +8978,7 @@ function createPublishCommand() {
|
|
|
8812
8978
|
|
|
8813
8979
|
// src/commands/skill/index.ts
|
|
8814
8980
|
function createSkillCommand() {
|
|
8815
|
-
const command = new
|
|
8981
|
+
const command = new Command76("skill").description("Skill management commands");
|
|
8816
8982
|
command.addCommand(createListCommand3());
|
|
8817
8983
|
command.addCommand(createRunCommand3());
|
|
8818
8984
|
command.addCommand(createValidateCommand2());
|
|
@@ -8825,7 +8991,7 @@ function createSkillCommand() {
|
|
|
8825
8991
|
|
|
8826
8992
|
// src/commands/snapshot.ts
|
|
8827
8993
|
init_dist2();
|
|
8828
|
-
import { Command as
|
|
8994
|
+
import { Command as Command77 } from "commander";
|
|
8829
8995
|
import { execSync as execSync5 } from "child_process";
|
|
8830
8996
|
import chalk13 from "chalk";
|
|
8831
8997
|
function getCommitHash3(cwd) {
|
|
@@ -9007,7 +9173,7 @@ function registerListCommand(parent) {
|
|
|
9007
9173
|
});
|
|
9008
9174
|
}
|
|
9009
9175
|
function createSnapshotCommand() {
|
|
9010
|
-
const command = new
|
|
9176
|
+
const command = new Command77("snapshot").description("Architecture timeline snapshot commands");
|
|
9011
9177
|
registerCaptureCommand(command);
|
|
9012
9178
|
registerTrendsCommand(command);
|
|
9013
9179
|
registerListCommand(command);
|
|
@@ -9015,11 +9181,11 @@ function createSnapshotCommand() {
|
|
|
9015
9181
|
}
|
|
9016
9182
|
|
|
9017
9183
|
// src/commands/state/index.ts
|
|
9018
|
-
import { Command as
|
|
9184
|
+
import { Command as Command82 } from "commander";
|
|
9019
9185
|
|
|
9020
9186
|
// src/commands/state/show.ts
|
|
9021
9187
|
init_dist2();
|
|
9022
|
-
import { Command as
|
|
9188
|
+
import { Command as Command78 } from "commander";
|
|
9023
9189
|
import * as path58 from "path";
|
|
9024
9190
|
function printStateText(state, stream) {
|
|
9025
9191
|
if (stream) console.log(`Stream: ${stream}`);
|
|
@@ -9044,7 +9210,7 @@ function printStateProgress(progress) {
|
|
|
9044
9210
|
}
|
|
9045
9211
|
}
|
|
9046
9212
|
function createShowCommand() {
|
|
9047
|
-
return new
|
|
9213
|
+
return new Command78("show").description("Show current project state").option("--path <path>", "Project root path", ".").option("--stream <name>", "Target a specific stream").action(async (opts, cmd) => {
|
|
9048
9214
|
const globalOpts = cmd.optsWithGlobals();
|
|
9049
9215
|
const result = await loadState(path58.resolve(opts.path), opts.stream);
|
|
9050
9216
|
if (!result.ok) {
|
|
@@ -9062,7 +9228,7 @@ function createShowCommand() {
|
|
|
9062
9228
|
|
|
9063
9229
|
// src/commands/state/reset.ts
|
|
9064
9230
|
init_dist2();
|
|
9065
|
-
import { Command as
|
|
9231
|
+
import { Command as Command79 } from "commander";
|
|
9066
9232
|
import * as fs40 from "fs";
|
|
9067
9233
|
import * as path59 from "path";
|
|
9068
9234
|
import * as readline3 from "readline";
|
|
@@ -9079,8 +9245,8 @@ async function resolveStatePath(projectPath, stream) {
|
|
|
9079
9245
|
}
|
|
9080
9246
|
async function confirmReset() {
|
|
9081
9247
|
const rl = readline3.createInterface({ input: process.stdin, output: process.stdout });
|
|
9082
|
-
const answer = await new Promise((
|
|
9083
|
-
rl.question("Reset project state? This cannot be undone. [y/N] ",
|
|
9248
|
+
const answer = await new Promise((resolve42) => {
|
|
9249
|
+
rl.question("Reset project state? This cannot be undone. [y/N] ", resolve42);
|
|
9084
9250
|
});
|
|
9085
9251
|
rl.close();
|
|
9086
9252
|
return answer.toLowerCase() === "y" || answer.toLowerCase() === "yes";
|
|
@@ -9106,15 +9272,15 @@ async function runReset(opts) {
|
|
|
9106
9272
|
process.exit(ExitCode.SUCCESS);
|
|
9107
9273
|
}
|
|
9108
9274
|
function createResetCommand() {
|
|
9109
|
-
return new
|
|
9275
|
+
return new Command79("reset").description("Reset project state (deletes .harness/state.json)").option("--path <path>", "Project root path", ".").option("--stream <name>", "Target a specific stream").option("--yes", "Skip confirmation prompt").action(async (opts) => runReset(opts));
|
|
9110
9276
|
}
|
|
9111
9277
|
|
|
9112
9278
|
// src/commands/state/learn.ts
|
|
9113
9279
|
init_dist2();
|
|
9114
|
-
import { Command as
|
|
9280
|
+
import { Command as Command80 } from "commander";
|
|
9115
9281
|
import * as path60 from "path";
|
|
9116
9282
|
function createLearnCommand() {
|
|
9117
|
-
return new
|
|
9283
|
+
return new Command80("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) => {
|
|
9118
9284
|
const projectPath = path60.resolve(opts.path);
|
|
9119
9285
|
const result = await appendLearning(projectPath, message, void 0, void 0, opts.stream);
|
|
9120
9286
|
if (!result.ok) {
|
|
@@ -9129,7 +9295,7 @@ function createLearnCommand() {
|
|
|
9129
9295
|
|
|
9130
9296
|
// src/commands/state/streams.ts
|
|
9131
9297
|
init_dist2();
|
|
9132
|
-
import { Command as
|
|
9298
|
+
import { Command as Command81 } from "commander";
|
|
9133
9299
|
import * as path61 from "path";
|
|
9134
9300
|
async function runListStreams(opts, globalOpts) {
|
|
9135
9301
|
const projectPath = path61.resolve(opts.path);
|
|
@@ -9180,7 +9346,7 @@ async function runActivateStream(name, opts) {
|
|
|
9180
9346
|
process.exit(ExitCode.SUCCESS);
|
|
9181
9347
|
}
|
|
9182
9348
|
function createStreamsCommand() {
|
|
9183
|
-
const command = new
|
|
9349
|
+
const command = new Command81("streams").description("Manage state streams");
|
|
9184
9350
|
command.command("list").description("List all known streams").option("--path <path>", "Project root path", ".").action(async (opts, cmd) => runListStreams(opts, cmd.optsWithGlobals()));
|
|
9185
9351
|
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));
|
|
9186
9352
|
command.command("archive <name>").description("Archive a stream").option("--path <path>", "Project root path", ".").action(async (name, opts) => runArchiveStream(name, opts));
|
|
@@ -9190,7 +9356,7 @@ function createStreamsCommand() {
|
|
|
9190
9356
|
|
|
9191
9357
|
// src/commands/state/index.ts
|
|
9192
9358
|
function createStateCommand() {
|
|
9193
|
-
const command = new
|
|
9359
|
+
const command = new Command82("state").description("Project state management commands");
|
|
9194
9360
|
command.addCommand(createShowCommand());
|
|
9195
9361
|
command.addCommand(createResetCommand());
|
|
9196
9362
|
command.addCommand(createLearnCommand());
|
|
@@ -9201,7 +9367,7 @@ function createStateCommand() {
|
|
|
9201
9367
|
// src/commands/sync-analyses.ts
|
|
9202
9368
|
import * as fs41 from "fs";
|
|
9203
9369
|
import * as path62 from "path";
|
|
9204
|
-
import { Command as
|
|
9370
|
+
import { Command as Command83 } from "commander";
|
|
9205
9371
|
init_dist2();
|
|
9206
9372
|
function isValidRecord(record) {
|
|
9207
9373
|
return typeof record.issueId === "string" && !!record.issueId && typeof record.identifier === "string" && !!record.identifier && typeof record.analyzedAt === "string" && !/[/\\]/.test(record.issueId);
|
|
@@ -9327,7 +9493,7 @@ async function runSyncAnalyses(opts) {
|
|
|
9327
9493
|
return;
|
|
9328
9494
|
}
|
|
9329
9495
|
const { AnalysisArchive, loadPublishedIndex: loadPublishedIndex2, savePublishedIndex: savePublishedIndex2 } = await import("@harness-engineering/orchestrator");
|
|
9330
|
-
const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-
|
|
9496
|
+
const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-HA6IIPRC.js");
|
|
9331
9497
|
const adapter = new GitHubIssuesSyncAdapter2({ token, config: trackerConfig });
|
|
9332
9498
|
const archive = new AnalysisArchive(path62.join(projectPath, ".harness", "analyses"));
|
|
9333
9499
|
const publishedIndex = loadPublishedIndex2(projectPath);
|
|
@@ -9349,7 +9515,7 @@ async function runSyncAnalyses(opts) {
|
|
|
9349
9515
|
}
|
|
9350
9516
|
}
|
|
9351
9517
|
function createSyncAnalysesCommand() {
|
|
9352
|
-
const command = new
|
|
9518
|
+
const command = new Command83("sync-analyses").description(
|
|
9353
9519
|
"Pull published intelligence analyses from the external issue tracker into the local .harness/analyses/ directory"
|
|
9354
9520
|
).option("-d, --dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
9355
9521
|
try {
|
|
@@ -9363,7 +9529,7 @@ function createSyncAnalysesCommand() {
|
|
|
9363
9529
|
}
|
|
9364
9530
|
|
|
9365
9531
|
// src/commands/sync-main.ts
|
|
9366
|
-
import { Command as
|
|
9532
|
+
import { Command as Command84 } from "commander";
|
|
9367
9533
|
import * as path63 from "path";
|
|
9368
9534
|
import {
|
|
9369
9535
|
syncMain as defaultSyncMain
|
|
@@ -9394,7 +9560,7 @@ function formatHuman(r) {
|
|
|
9394
9560
|
}
|
|
9395
9561
|
}
|
|
9396
9562
|
function createSyncMainCommand() {
|
|
9397
|
-
return new
|
|
9563
|
+
return new Command84("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) => {
|
|
9398
9564
|
const cwd = path63.resolve(opts.path ?? ".");
|
|
9399
9565
|
const exitCode = await runSyncMain({ cwd, json: Boolean(opts.json) });
|
|
9400
9566
|
process.exit(exitCode);
|
|
@@ -9403,7 +9569,7 @@ function createSyncMainCommand() {
|
|
|
9403
9569
|
|
|
9404
9570
|
// src/commands/taint.ts
|
|
9405
9571
|
init_dist2();
|
|
9406
|
-
import { Command as
|
|
9572
|
+
import { Command as Command85 } from "commander";
|
|
9407
9573
|
function getProjectRoot() {
|
|
9408
9574
|
return process.cwd();
|
|
9409
9575
|
}
|
|
@@ -9475,18 +9641,18 @@ function registerStatusCommand(taint) {
|
|
|
9475
9641
|
});
|
|
9476
9642
|
}
|
|
9477
9643
|
function createTaintCommand() {
|
|
9478
|
-
const taint = new
|
|
9644
|
+
const taint = new Command85("taint").description("Manage sentinel session taint state");
|
|
9479
9645
|
registerClearCommand(taint);
|
|
9480
9646
|
registerStatusCommand(taint);
|
|
9481
9647
|
return taint;
|
|
9482
9648
|
}
|
|
9483
9649
|
|
|
9484
9650
|
// src/commands/telemetry/index.ts
|
|
9485
|
-
import { Command as
|
|
9651
|
+
import { Command as Command89 } from "commander";
|
|
9486
9652
|
|
|
9487
9653
|
// src/commands/telemetry/identify.ts
|
|
9488
9654
|
init_dist2();
|
|
9489
|
-
import { Command as
|
|
9655
|
+
import { Command as Command86 } from "commander";
|
|
9490
9656
|
import * as fs42 from "fs";
|
|
9491
9657
|
import * as path64 from "path";
|
|
9492
9658
|
function telemetryFilePath(cwd) {
|
|
@@ -9510,7 +9676,7 @@ function printIdentity(identity) {
|
|
|
9510
9676
|
}
|
|
9511
9677
|
}
|
|
9512
9678
|
function createIdentifyCommand() {
|
|
9513
|
-
const cmd = new
|
|
9679
|
+
const cmd = new Command86("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) => {
|
|
9514
9680
|
const cwd = process.cwd();
|
|
9515
9681
|
if (opts.clear) {
|
|
9516
9682
|
writeTelemetryFile(cwd, { identity: {} });
|
|
@@ -9535,7 +9701,7 @@ function createIdentifyCommand() {
|
|
|
9535
9701
|
|
|
9536
9702
|
// src/commands/telemetry/status.ts
|
|
9537
9703
|
init_dist2();
|
|
9538
|
-
import { Command as
|
|
9704
|
+
import { Command as Command87 } from "commander";
|
|
9539
9705
|
function gatherEnvOverrides() {
|
|
9540
9706
|
const overrides = {};
|
|
9541
9707
|
if (process.env.DO_NOT_TRACK) overrides.DO_NOT_TRACK = process.env.DO_NOT_TRACK;
|
|
@@ -9577,7 +9743,7 @@ function printHumanStatus(result) {
|
|
|
9577
9743
|
printEnvOverrides(result.envOverrides);
|
|
9578
9744
|
}
|
|
9579
9745
|
function createStatusCommand() {
|
|
9580
|
-
const cmd = new
|
|
9746
|
+
const cmd = new Command87("status").description("Show current telemetry consent state, install ID, and identity").option("--json", "Output as JSON").action((opts) => {
|
|
9581
9747
|
const cwd = process.cwd();
|
|
9582
9748
|
const envOverrides = gatherEnvOverrides();
|
|
9583
9749
|
const consent = resolveConsent(cwd, void 0);
|
|
@@ -9610,20 +9776,20 @@ function createStatusCommand() {
|
|
|
9610
9776
|
|
|
9611
9777
|
// src/commands/telemetry/test.ts
|
|
9612
9778
|
init_dist2();
|
|
9613
|
-
import { Command as
|
|
9779
|
+
import { Command as Command88 } from "commander";
|
|
9614
9780
|
|
|
9615
9781
|
// src/bin/command-telemetry.ts
|
|
9616
9782
|
import { existsSync as existsSync39, readFileSync as readFileSync29, mkdirSync as mkdirSync19, appendFileSync, writeFileSync as writeFileSync23 } from "fs";
|
|
9617
|
-
import { join as join53, parse as parsePath, resolve as
|
|
9783
|
+
import { join as join53, parse as parsePath, resolve as resolve39 } from "path";
|
|
9618
9784
|
import { spawn as spawn2 } from "child_process";
|
|
9619
9785
|
var POSTHOG_API_KEY = "phc_wNTdCMcfJXZPgdNeDociZW6vwoGGo4nb7vqEfWThFfsG";
|
|
9620
9786
|
var EXCLUDED_COMMANDS = /* @__PURE__ */ new Set(["help", "completion"]);
|
|
9621
9787
|
function findProjectRoot(cwd) {
|
|
9622
|
-
let dir =
|
|
9788
|
+
let dir = resolve39(cwd);
|
|
9623
9789
|
const { root } = parsePath(dir);
|
|
9624
9790
|
while (dir !== root) {
|
|
9625
9791
|
if (existsSync39(join53(dir, "harness.config.json"))) return dir;
|
|
9626
|
-
dir =
|
|
9792
|
+
dir = resolve39(dir, "..");
|
|
9627
9793
|
}
|
|
9628
9794
|
return cwd;
|
|
9629
9795
|
}
|
|
@@ -9732,7 +9898,7 @@ function reportTestSuccess(status, distinctId, identity) {
|
|
|
9732
9898
|
if (identity.team) logger.info(` team: ${identity.team}`);
|
|
9733
9899
|
}
|
|
9734
9900
|
function createTestCommand() {
|
|
9735
|
-
return new
|
|
9901
|
+
return new Command88("test").description("Send a test event to PostHog and verify connectivity").action(async () => {
|
|
9736
9902
|
const cwd = process.cwd();
|
|
9737
9903
|
const consent = resolveConsent(cwd, void 0);
|
|
9738
9904
|
if (!consent.allowed) {
|
|
@@ -9769,7 +9935,7 @@ function createTestCommand() {
|
|
|
9769
9935
|
|
|
9770
9936
|
// src/commands/telemetry/index.ts
|
|
9771
9937
|
function createTelemetryCommand() {
|
|
9772
|
-
const command = new
|
|
9938
|
+
const command = new Command89("telemetry").description("Telemetry identity and status management");
|
|
9773
9939
|
command.addCommand(createIdentifyCommand());
|
|
9774
9940
|
command.addCommand(createStatusCommand());
|
|
9775
9941
|
command.addCommand(createTestCommand());
|
|
@@ -9777,7 +9943,7 @@ function createTelemetryCommand() {
|
|
|
9777
9943
|
}
|
|
9778
9944
|
|
|
9779
9945
|
// src/commands/traceability.ts
|
|
9780
|
-
import { Command as
|
|
9946
|
+
import { Command as Command90 } from "commander";
|
|
9781
9947
|
import chalk14 from "chalk";
|
|
9782
9948
|
function confidenceLabel(maxConfidence) {
|
|
9783
9949
|
if (maxConfidence >= 0.8) return "explicit";
|
|
@@ -9898,7 +10064,7 @@ async function runTraceability(options) {
|
|
|
9898
10064
|
const projectPath = process.cwd();
|
|
9899
10065
|
const store = await loadGraphStore(projectPath);
|
|
9900
10066
|
if (!store) handleNoStore(mode);
|
|
9901
|
-
const graphModule = await import("./dist-
|
|
10067
|
+
const graphModule = await import("./dist-QPWXPCPL.js");
|
|
9902
10068
|
const filterOptions = buildFilterOptions(options);
|
|
9903
10069
|
const results = graphModule.queryTraceability(store, filterOptions);
|
|
9904
10070
|
if (results.length === 0) handleEmptyResults(mode);
|
|
@@ -9913,7 +10079,7 @@ async function runTraceability(options) {
|
|
|
9913
10079
|
process.exit(ExitCode.SUCCESS);
|
|
9914
10080
|
}
|
|
9915
10081
|
function createTraceabilityCommand() {
|
|
9916
|
-
return new
|
|
10082
|
+
return new Command90("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) => {
|
|
9917
10083
|
const globalOpts = cmd.optsWithGlobals();
|
|
9918
10084
|
await runTraceability({
|
|
9919
10085
|
spec: opts.spec,
|
|
@@ -9927,7 +10093,7 @@ function createTraceabilityCommand() {
|
|
|
9927
10093
|
|
|
9928
10094
|
// src/commands/uninstall.ts
|
|
9929
10095
|
import * as path65 from "path";
|
|
9930
|
-
import { Command as
|
|
10096
|
+
import { Command as Command91 } from "commander";
|
|
9931
10097
|
async function runUninstall(skillName, options) {
|
|
9932
10098
|
const packageName = resolvePackageName(skillName);
|
|
9933
10099
|
const shortName = extractSkillName(packageName);
|
|
@@ -9964,7 +10130,7 @@ async function runUninstall(skillName, options) {
|
|
|
9964
10130
|
return result;
|
|
9965
10131
|
}
|
|
9966
10132
|
function createUninstallCommand() {
|
|
9967
|
-
const cmd = new
|
|
10133
|
+
const cmd = new Command91("uninstall");
|
|
9968
10134
|
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) => {
|
|
9969
10135
|
try {
|
|
9970
10136
|
const result = await runUninstall(skill, opts);
|
|
@@ -9986,7 +10152,7 @@ function createUninstallCommand() {
|
|
|
9986
10152
|
init_dist2();
|
|
9987
10153
|
import * as fs43 from "fs/promises";
|
|
9988
10154
|
import * as path66 from "path";
|
|
9989
|
-
import { Command as
|
|
10155
|
+
import { Command as Command92 } from "commander";
|
|
9990
10156
|
async function runUninstallConstraints(options) {
|
|
9991
10157
|
const { packageName, configPath, lockfilePath } = options;
|
|
9992
10158
|
const lockfileResult = await readLockfile(lockfilePath);
|
|
@@ -10043,7 +10209,7 @@ async function runUninstallConstraints(options) {
|
|
|
10043
10209
|
};
|
|
10044
10210
|
}
|
|
10045
10211
|
function createUninstallConstraintsCommand() {
|
|
10046
|
-
const cmd = new
|
|
10212
|
+
const cmd = new Command92("uninstall-constraints");
|
|
10047
10213
|
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) => {
|
|
10048
10214
|
let configPath;
|
|
10049
10215
|
if (opts.config) {
|
|
@@ -10082,30 +10248,34 @@ function createUninstallConstraintsCommand() {
|
|
|
10082
10248
|
}
|
|
10083
10249
|
|
|
10084
10250
|
// src/commands/update.ts
|
|
10085
|
-
|
|
10251
|
+
init_dist2();
|
|
10252
|
+
import { Command as Command93 } from "commander";
|
|
10086
10253
|
import { execFile, execFileSync as execFileSync7 } from "child_process";
|
|
10087
10254
|
import { realpathSync, existsSync as existsSync40, readFileSync as readFileSync30 } from "fs";
|
|
10088
|
-
import { join as join56 } from "path";
|
|
10255
|
+
import { dirname as dirname22, join as join56 } from "path";
|
|
10089
10256
|
import { promisify } from "util";
|
|
10090
10257
|
import readline4 from "readline";
|
|
10091
10258
|
import chalk15 from "chalk";
|
|
10092
10259
|
var CLI_PACKAGE = "@harness-engineering/cli";
|
|
10260
|
+
function detectPackageManagerFromPath(resolvedPath) {
|
|
10261
|
+
const normalizedBin = resolvedPath.replace(/\\/g, "/");
|
|
10262
|
+
if (normalizedBin.includes("pnpm/global/") || // eslint-disable-line @harness-engineering/no-hardcoded-path-separator -- platform-safe
|
|
10263
|
+
normalizedBin.includes("pnpm-global/")) {
|
|
10264
|
+
return "pnpm";
|
|
10265
|
+
}
|
|
10266
|
+
if (normalizedBin.includes(".yarn/")) {
|
|
10267
|
+
return "yarn";
|
|
10268
|
+
}
|
|
10269
|
+
return "npm";
|
|
10270
|
+
}
|
|
10093
10271
|
function detectPackageManager() {
|
|
10094
10272
|
try {
|
|
10095
10273
|
const argv1 = process.argv[1];
|
|
10096
10274
|
if (!argv1) return "npm";
|
|
10097
|
-
|
|
10098
|
-
const normalizedBin = binPath.replace(/\\/g, "/");
|
|
10099
|
-
if (normalizedBin.includes("pnpm/global/") || // eslint-disable-line @harness-engineering/no-hardcoded-path-separator -- platform-safe
|
|
10100
|
-
normalizedBin.includes("pnpm-global/")) {
|
|
10101
|
-
return "pnpm";
|
|
10102
|
-
}
|
|
10103
|
-
if (normalizedBin.includes(".yarn/")) {
|
|
10104
|
-
return "yarn";
|
|
10105
|
-
}
|
|
10275
|
+
return detectPackageManagerFromPath(realpathSync(argv1));
|
|
10106
10276
|
} catch {
|
|
10277
|
+
return "npm";
|
|
10107
10278
|
}
|
|
10108
|
-
return "npm";
|
|
10109
10279
|
}
|
|
10110
10280
|
var execFileAsync = promisify(execFile);
|
|
10111
10281
|
async function getLatestVersionAsync(pkg) {
|
|
@@ -10159,13 +10329,145 @@ function prompt3(question) {
|
|
|
10159
10329
|
input: process.stdin,
|
|
10160
10330
|
output: process.stdout
|
|
10161
10331
|
});
|
|
10162
|
-
return new Promise((
|
|
10332
|
+
return new Promise((resolve42) => {
|
|
10163
10333
|
rl.question(question, (answer) => {
|
|
10164
10334
|
rl.close();
|
|
10165
|
-
|
|
10335
|
+
resolve42(answer.trim().toLowerCase());
|
|
10166
10336
|
});
|
|
10167
10337
|
});
|
|
10168
10338
|
}
|
|
10339
|
+
function findPackageDir(resolvedBin) {
|
|
10340
|
+
let dir = dirname22(resolvedBin);
|
|
10341
|
+
for (let i = 0; i < 6; i++) {
|
|
10342
|
+
if (existsSync40(join56(dir, "package.json"))) {
|
|
10343
|
+
try {
|
|
10344
|
+
const pkg = JSON.parse(readFileSync30(join56(dir, "package.json"), "utf-8"));
|
|
10345
|
+
if (pkg?.name === CLI_PACKAGE) return dir;
|
|
10346
|
+
} catch {
|
|
10347
|
+
}
|
|
10348
|
+
}
|
|
10349
|
+
const parent = dirname22(dir);
|
|
10350
|
+
if (parent === dir) return null;
|
|
10351
|
+
dir = parent;
|
|
10352
|
+
}
|
|
10353
|
+
return null;
|
|
10354
|
+
}
|
|
10355
|
+
function derivePrefix(packageDir) {
|
|
10356
|
+
const normalized = packageDir.replace(/\\/g, "/");
|
|
10357
|
+
const marker = "/lib/node_modules/@harness-engineering/cli";
|
|
10358
|
+
if (!normalized.endsWith(marker)) return null;
|
|
10359
|
+
return packageDir.slice(0, packageDir.length - marker.length);
|
|
10360
|
+
}
|
|
10361
|
+
function findAllInstalls() {
|
|
10362
|
+
const isWindows = process.platform === "win32";
|
|
10363
|
+
const cmd = isWindows ? "where" : "which";
|
|
10364
|
+
const args = isWindows ? ["harness"] : ["-a", "harness"];
|
|
10365
|
+
let output;
|
|
10366
|
+
try {
|
|
10367
|
+
const raw = execFileSync7(cmd, args, { encoding: "utf-8", timeout: 5e3 });
|
|
10368
|
+
if (typeof raw !== "string") return [];
|
|
10369
|
+
output = raw;
|
|
10370
|
+
} catch {
|
|
10371
|
+
return [];
|
|
10372
|
+
}
|
|
10373
|
+
const paths = output.split(/\r?\n/).map((p) => p.trim()).filter(Boolean);
|
|
10374
|
+
const seen = /* @__PURE__ */ new Set();
|
|
10375
|
+
const installs = [];
|
|
10376
|
+
for (const binPath of paths) {
|
|
10377
|
+
let resolved;
|
|
10378
|
+
try {
|
|
10379
|
+
resolved = realpathSync(binPath);
|
|
10380
|
+
} catch {
|
|
10381
|
+
continue;
|
|
10382
|
+
}
|
|
10383
|
+
if (seen.has(resolved)) continue;
|
|
10384
|
+
seen.add(resolved);
|
|
10385
|
+
const packageDir = findPackageDir(resolved);
|
|
10386
|
+
if (!packageDir) continue;
|
|
10387
|
+
let version = null;
|
|
10388
|
+
try {
|
|
10389
|
+
const pkg = JSON.parse(readFileSync30(join56(packageDir, "package.json"), "utf-8"));
|
|
10390
|
+
if (typeof pkg?.version === "string") version = pkg.version;
|
|
10391
|
+
} catch {
|
|
10392
|
+
}
|
|
10393
|
+
installs.push({
|
|
10394
|
+
binPath,
|
|
10395
|
+
resolvedBin: resolved,
|
|
10396
|
+
packageDir,
|
|
10397
|
+
prefix: derivePrefix(packageDir),
|
|
10398
|
+
version,
|
|
10399
|
+
packageManager: detectPackageManagerFromPath(resolved)
|
|
10400
|
+
});
|
|
10401
|
+
}
|
|
10402
|
+
return installs;
|
|
10403
|
+
}
|
|
10404
|
+
function getActiveInstallDir() {
|
|
10405
|
+
try {
|
|
10406
|
+
const argv1 = process.argv[1];
|
|
10407
|
+
if (!argv1) return null;
|
|
10408
|
+
return findPackageDir(realpathSync(argv1));
|
|
10409
|
+
} catch {
|
|
10410
|
+
return null;
|
|
10411
|
+
}
|
|
10412
|
+
}
|
|
10413
|
+
async function offerCleanupOfOtherInstalls(activeDir) {
|
|
10414
|
+
const installs = findAllInstalls();
|
|
10415
|
+
if (installs.length <= 1) return;
|
|
10416
|
+
const others = installs.filter((i) => i.packageDir !== activeDir);
|
|
10417
|
+
if (others.length === 0) return;
|
|
10418
|
+
console.log("");
|
|
10419
|
+
logger.warn(
|
|
10420
|
+
`Found ${installs.length} harness installs on PATH. Only the active one was updated.`
|
|
10421
|
+
);
|
|
10422
|
+
for (const install of installs) {
|
|
10423
|
+
const tag = install.packageDir === activeDir ? chalk15.green(" (active, just updated)") : chalk15.yellow(" (stale)");
|
|
10424
|
+
const versionStr = install.version ? `v${install.version}` : "unknown";
|
|
10425
|
+
console.log(` ${install.binPath} -> ${versionStr}${tag}`);
|
|
10426
|
+
}
|
|
10427
|
+
console.log("");
|
|
10428
|
+
const commands = others.map((install) => buildUninstallCommand(install));
|
|
10429
|
+
console.log("Cleanup commands:");
|
|
10430
|
+
for (const { display } of commands) {
|
|
10431
|
+
console.log(` ${chalk15.cyan(display)}`);
|
|
10432
|
+
}
|
|
10433
|
+
console.log("");
|
|
10434
|
+
const answer = await prompt3(`Run these now to remove stale installs? (y/N) `);
|
|
10435
|
+
if (answer !== "y" && answer !== "yes") return;
|
|
10436
|
+
for (const cmd of commands) {
|
|
10437
|
+
if (!cmd.runnable) {
|
|
10438
|
+
logger.warn(`Skipped ${cmd.install.binPath} (no automatic uninstall for this layout).`);
|
|
10439
|
+
console.log(` Run manually: ${chalk15.cyan(cmd.display)}`);
|
|
10440
|
+
continue;
|
|
10441
|
+
}
|
|
10442
|
+
try {
|
|
10443
|
+
logger.info(`Uninstalling: ${cmd.display}`);
|
|
10444
|
+
execFileSync7(cmd.bin, cmd.args, { stdio: "inherit", timeout: 12e4 });
|
|
10445
|
+
} catch {
|
|
10446
|
+
logger.warn(`Uninstall failed for ${cmd.install.binPath}.`);
|
|
10447
|
+
console.log(` Run manually: ${chalk15.cyan(cmd.display)}`);
|
|
10448
|
+
}
|
|
10449
|
+
}
|
|
10450
|
+
}
|
|
10451
|
+
function buildUninstallCommand(install) {
|
|
10452
|
+
if (install.packageManager === "npm" && install.prefix) {
|
|
10453
|
+
const args = [`--prefix=${install.prefix}`, "uninstall", "-g", CLI_PACKAGE];
|
|
10454
|
+
return {
|
|
10455
|
+
install,
|
|
10456
|
+
runnable: true,
|
|
10457
|
+
bin: "npm",
|
|
10458
|
+
args,
|
|
10459
|
+
display: `npm ${args.join(" ")}`
|
|
10460
|
+
};
|
|
10461
|
+
}
|
|
10462
|
+
const pmCmd = install.packageManager === "yarn" ? "yarn global remove" : "pnpm remove -g";
|
|
10463
|
+
return {
|
|
10464
|
+
install,
|
|
10465
|
+
runnable: false,
|
|
10466
|
+
bin: install.packageManager,
|
|
10467
|
+
args: [],
|
|
10468
|
+
display: `${pmCmd} ${CLI_PACKAGE}`
|
|
10469
|
+
};
|
|
10470
|
+
}
|
|
10169
10471
|
async function ensureTelemetryIfNeeded() {
|
|
10170
10472
|
const cwd = process.cwd();
|
|
10171
10473
|
const result = await ensureTelemetryConfigured(cwd);
|
|
@@ -10276,6 +10578,7 @@ async function runUpdateAction(opts, globalOpts) {
|
|
|
10276
10578
|
logger.success("All packages are up to date");
|
|
10277
10579
|
refreshHooks();
|
|
10278
10580
|
await ensureTelemetryIfNeeded();
|
|
10581
|
+
await offerCleanupOfOtherInstalls(getActiveInstallDir());
|
|
10279
10582
|
await offerRegeneration();
|
|
10280
10583
|
process.exit(ExitCode.SUCCESS);
|
|
10281
10584
|
}
|
|
@@ -10296,6 +10599,7 @@ async function runUpdateAction(opts, globalOpts) {
|
|
|
10296
10599
|
execFileSync7(pm, ["install", "-g", ...installPkgs], { stdio: "inherit", timeout: 12e4 });
|
|
10297
10600
|
console.log("");
|
|
10298
10601
|
logger.success("Update complete");
|
|
10602
|
+
invalidateCheckState();
|
|
10299
10603
|
} catch {
|
|
10300
10604
|
console.log("");
|
|
10301
10605
|
logger.error("Update failed. You can try manually:");
|
|
@@ -10304,11 +10608,12 @@ async function runUpdateAction(opts, globalOpts) {
|
|
|
10304
10608
|
}
|
|
10305
10609
|
refreshHooks();
|
|
10306
10610
|
await ensureTelemetryIfNeeded();
|
|
10611
|
+
await offerCleanupOfOtherInstalls(getActiveInstallDir());
|
|
10307
10612
|
await offerRegeneration();
|
|
10308
10613
|
process.exit(ExitCode.SUCCESS);
|
|
10309
10614
|
}
|
|
10310
10615
|
function createUpdateCommand() {
|
|
10311
|
-
return new
|
|
10616
|
+
return new Command93("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(
|
|
10312
10617
|
"--regenerate",
|
|
10313
10618
|
"Only regenerate slash commands and agent definitions (skip package updates)"
|
|
10314
10619
|
).action(async (opts, cmd) => {
|
|
@@ -10318,9 +10623,9 @@ function createUpdateCommand() {
|
|
|
10318
10623
|
}
|
|
10319
10624
|
|
|
10320
10625
|
// src/commands/usage.ts
|
|
10321
|
-
import { Command as
|
|
10626
|
+
import { Command as Command94 } from "commander";
|
|
10322
10627
|
async function loadAndPriceRecords(cwd, includeClaudeSessions = false) {
|
|
10323
|
-
const { readCostRecords, loadPricingData, calculateCost, parseCCRecords } = await import("./dist-
|
|
10628
|
+
const { readCostRecords, loadPricingData, calculateCost, parseCCRecords } = await import("./dist-HA6IIPRC.js");
|
|
10324
10629
|
const records = readCostRecords(cwd);
|
|
10325
10630
|
if (includeClaudeSessions) {
|
|
10326
10631
|
const ccRecords = parseCCRecords();
|
|
@@ -10413,7 +10718,7 @@ function registerDailyCommand(usage) {
|
|
|
10413
10718
|
else logger.info("No usage data found. Run some harness sessions first.");
|
|
10414
10719
|
return;
|
|
10415
10720
|
}
|
|
10416
|
-
const { aggregateByDay } = await import("./dist-
|
|
10721
|
+
const { aggregateByDay } = await import("./dist-HA6IIPRC.js");
|
|
10417
10722
|
const limited = aggregateByDay(records).slice(0, days);
|
|
10418
10723
|
if (globalOpts.json) {
|
|
10419
10724
|
console.log(
|
|
@@ -10442,7 +10747,7 @@ function registerSessionsCommand(usage) {
|
|
|
10442
10747
|
}
|
|
10443
10748
|
return;
|
|
10444
10749
|
}
|
|
10445
|
-
const { aggregateBySession } = await import("./dist-
|
|
10750
|
+
const { aggregateBySession } = await import("./dist-HA6IIPRC.js");
|
|
10446
10751
|
const sessionData = aggregateBySession(records);
|
|
10447
10752
|
const limited = sessionData.slice(0, limit);
|
|
10448
10753
|
if (globalOpts.json) {
|
|
@@ -10522,7 +10827,7 @@ function registerSessionCommand(usage) {
|
|
|
10522
10827
|
cwd,
|
|
10523
10828
|
globalOpts.includeClaudeSessions
|
|
10524
10829
|
);
|
|
10525
|
-
const { aggregateBySession } = await import("./dist-
|
|
10830
|
+
const { aggregateBySession } = await import("./dist-HA6IIPRC.js");
|
|
10526
10831
|
const sessionData = aggregateBySession(records);
|
|
10527
10832
|
const match = sessionData.find((s) => s.sessionId === id);
|
|
10528
10833
|
if (!match) {
|
|
@@ -10557,7 +10862,7 @@ function registerLatestCommand(usage) {
|
|
|
10557
10862
|
}
|
|
10558
10863
|
return;
|
|
10559
10864
|
}
|
|
10560
|
-
const { aggregateBySession } = await import("./dist-
|
|
10865
|
+
const { aggregateBySession } = await import("./dist-HA6IIPRC.js");
|
|
10561
10866
|
const sessionData = aggregateBySession(records);
|
|
10562
10867
|
const latest = sessionData[0];
|
|
10563
10868
|
if (!latest) {
|
|
@@ -10583,7 +10888,7 @@ function registerLatestCommand(usage) {
|
|
|
10583
10888
|
});
|
|
10584
10889
|
}
|
|
10585
10890
|
function createUsageCommand() {
|
|
10586
|
-
const usage = new
|
|
10891
|
+
const usage = new Command94("usage").description("Token usage and cost tracking");
|
|
10587
10892
|
usage.option(
|
|
10588
10893
|
"--include-claude-sessions",
|
|
10589
10894
|
"Include Claude Code session data from ~/.claude/projects/"
|
|
@@ -10598,7 +10903,7 @@ function createUsageCommand() {
|
|
|
10598
10903
|
// src/commands/validate.ts
|
|
10599
10904
|
init_dist2();
|
|
10600
10905
|
init_dist2();
|
|
10601
|
-
import { Command as
|
|
10906
|
+
import { Command as Command95 } from "commander";
|
|
10602
10907
|
import * as path67 from "path";
|
|
10603
10908
|
async function runValidate(options) {
|
|
10604
10909
|
const configResult = resolveConfig(options.configPath);
|
|
@@ -10726,7 +11031,7 @@ function resolveValidateMode(globalOpts) {
|
|
|
10726
11031
|
return OutputMode.TEXT;
|
|
10727
11032
|
}
|
|
10728
11033
|
async function printCrossCheckWarnings(mode) {
|
|
10729
|
-
const { runCrossCheck: runCrossCheck2 } = await import("./validate-cross-check-
|
|
11034
|
+
const { runCrossCheck: runCrossCheck2 } = await import("./validate-cross-check-H3PSV4VY.js");
|
|
10730
11035
|
const cwd = process.cwd();
|
|
10731
11036
|
const crossResult = await runCrossCheck2({
|
|
10732
11037
|
specsDir: path67.join(cwd, "docs", "specs"),
|
|
@@ -10742,7 +11047,7 @@ async function printCrossCheckWarnings(mode) {
|
|
|
10742
11047
|
${crossResult.value.warnings} warnings`);
|
|
10743
11048
|
}
|
|
10744
11049
|
function createValidateCommand3() {
|
|
10745
|
-
const command = new
|
|
11050
|
+
const command = new Command95("validate").description("Run all validation checks").option("--cross-check", "Run cross-artifact consistency validation").option(
|
|
10746
11051
|
"--agent-configs",
|
|
10747
11052
|
"Validate agent configs (CLAUDE.md, hooks, skills) via agnix or built-in fallback rules"
|
|
10748
11053
|
).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()));
|
|
@@ -10791,7 +11096,7 @@ Agent configs checked via ${engineLabel}${note}`);
|
|
|
10791
11096
|
|
|
10792
11097
|
// src/commands/verify.ts
|
|
10793
11098
|
init_dist2();
|
|
10794
|
-
import { Command as
|
|
11099
|
+
import { Command as Command96 } from "commander";
|
|
10795
11100
|
import { execSync as execSync6 } from "child_process";
|
|
10796
11101
|
function loadBranchingConfig(configPath) {
|
|
10797
11102
|
const shouldLoad = configPath !== void 0 || findConfigFile().ok;
|
|
@@ -10854,7 +11159,7 @@ async function runVerify(options) {
|
|
|
10854
11159
|
process.exit(ExitCode.VALIDATION_FAILED);
|
|
10855
11160
|
}
|
|
10856
11161
|
function createVerifyCommand() {
|
|
10857
|
-
return new
|
|
11162
|
+
return new Command96("verify").description(
|
|
10858
11163
|
"Verify project conventions (currently: branch naming). Works with or without a harness.config.json."
|
|
10859
11164
|
).option(
|
|
10860
11165
|
"--branch <name>",
|
|
@@ -10891,6 +11196,7 @@ var commandCreators = [
|
|
|
10891
11196
|
createDashboardCommand,
|
|
10892
11197
|
createDoctorCommand,
|
|
10893
11198
|
createFixDriftCommand,
|
|
11199
|
+
createGatewayCommand,
|
|
10894
11200
|
createGenerateAgentDefinitionsCommand,
|
|
10895
11201
|
createGenerateCommand,
|
|
10896
11202
|
createGenerateSlashCommandsCommand,
|
|
@@ -10939,7 +11245,7 @@ var commandCreators = [
|
|
|
10939
11245
|
|
|
10940
11246
|
// src/index.ts
|
|
10941
11247
|
function createProgram() {
|
|
10942
|
-
const program = new
|
|
11248
|
+
const program = new Command97();
|
|
10943
11249
|
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");
|
|
10944
11250
|
for (const creator of commandCreators) {
|
|
10945
11251
|
program.addCommand(creator());
|