@harness-engineering/cli 2.4.3 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents-md-KAD3L2NO.js +13 -0
- package/dist/analyzer-VY6DJVOU-NI56JRFK.js +26 -0
- package/dist/{architecture-TUJ2FWM7.js → architecture-OC7TFCFF.js} +7 -4
- package/dist/{assess-project-SIG4QAZA.js → assess-project-ZGMRPTS3.js} +1 -1
- package/dist/bin/harness-mcp.js +20 -17
- package/dist/bin/harness.js +38 -35
- package/dist/{check-phase-gate-JX522QQH.js → check-phase-gate-PD5MVEZT.js} +8 -5
- package/dist/{chunk-O63AAPIZ.js → chunk-2LPUIBVH.js} +75 -1
- package/dist/{chunk-NDTH6MGG.js → chunk-2RNGLYOG.js} +2 -2
- package/dist/{chunk-OOXNZABU.js → chunk-4CWFVEVV.js} +1 -1
- package/dist/{chunk-LA3VGBU6.js → chunk-57TS3UGN.js} +2 -2
- package/dist/{chunk-IWUKWHXV.js → chunk-65MJPWFN.js} +6 -6
- package/dist/{chunk-O7ZZ3FN4.js → chunk-6SRKI77C.js} +3 -3
- package/dist/{chunk-MTJ2LOXB.js → chunk-7DOGGXQU.js} +2 -2
- package/dist/{chunk-54S2MJZI.js → chunk-A3EBWI7U.js} +2 -2
- package/dist/{chunk-JAS63FFQ.js → chunk-DOUS4ULX.js} +6 -6
- package/dist/{chunk-Y2ZVBLOR.js → chunk-ELMV6QU2.js} +2 -2
- package/dist/{chunk-GNZABDPB.js → chunk-HIZXUWWC.js} +8 -6
- package/dist/{chunk-52ATJ5JD.js → chunk-IGBQIXPS.js} +2 -2
- package/dist/chunk-IWRYCUDO.js +3337 -0
- package/dist/{chunk-P542RBCL.js → chunk-IXKGMPMT.js} +2 -2
- package/dist/{chunk-TW4NGPAW.js → chunk-JE5GQVCQ.js} +2 -2
- package/dist/{chunk-5O3PNHUQ.js → chunk-KQ6TDRPS.js} +3932 -7323
- package/dist/{chunk-NDS6XSHS.js → chunk-LT244Y6E.js} +497 -300
- package/dist/{chunk-IPFGVYNC.js → chunk-N6VWCISQ.js} +2 -2
- package/dist/{chunk-URHLDRYH.js → chunk-NOOPJD5R.js} +3 -3
- package/dist/chunk-QCLOIUMX.js +395 -0
- package/dist/{chunk-GDGEFHXV.js → chunk-TCSNO7YW.js} +2 -2
- package/dist/{chunk-AK7T7NG7.js → chunk-UCL3UZIC.js} +779 -274
- package/dist/{chunk-AP73KZP6.js → chunk-UF7BKRH4.js} +4 -4
- package/dist/chunk-XARGEOJV.js +21 -0
- package/dist/{chunk-JDOL6YP7.js → chunk-XIW24BJY.js} +7 -7
- package/dist/{chunk-LZXZQQKP.js → chunk-XSI3RDH6.js} +7 -7
- package/dist/ci-workflow-WAG4TOV6.js +13 -0
- package/dist/{dist-O733ZU6I.js → dist-HVJUGPSY.js} +23 -1
- package/dist/{dist-RYZFURLL.js → dist-TKHVYUWZ.js} +79 -48
- package/dist/{docs-VVCOB35D.js → docs-4WPBYSCF.js} +8 -5
- package/dist/engine-5BXDQT5T.js +13 -0
- package/dist/{entropy-TNA7IRJY.js → entropy-7FIUFACI.js} +6 -3
- package/dist/{feedback-BAVIWDHH.js → feedback-ER2HRTFD.js} +1 -1
- package/dist/{generate-agent-definitions-6UTHCELR.js → generate-agent-definitions-5PV4O3BD.js} +8 -5
- package/dist/index.js +49 -46
- package/dist/loader-6RTEYN5Q.js +15 -0
- package/dist/{mcp-BMCVFQJG.js → mcp-QWSDEYMN.js} +20 -17
- package/dist/{performance-HH7SQOTB.js → performance-AZJAT35R.js} +8 -5
- package/dist/{review-pipeline-QB3AND3K.js → review-pipeline-4VF73V4V.js} +6 -3
- package/dist/runtime-SAZGLILX.js +14 -0
- package/dist/{security-UISVYDES.js → security-ZWRABJNE.js} +1 -1
- package/dist/timeline-manager-FPYKJRHR-VVX7CSGW.js +24 -0
- package/dist/{tool-tiers-QVWKAZX4.js → tool-tiers-LTQNNAFU.js} +7 -2
- package/dist/{validate-QWQMHJFD.js → validate-AFJVI4OX.js} +7 -4
- package/dist/validate-cross-check-7PO7CBVT.js +13 -0
- package/package.json +6 -6
- package/dist/agents-md-WN2DOL7N.js +0 -10
- package/dist/ci-workflow-TIFZJZNY.js +0 -10
- package/dist/engine-AAJLFT45.js +0 -10
- package/dist/loader-TMZCNQWN.js +0 -12
- package/dist/runtime-RITOSII6.js +0 -11
- package/dist/validate-cross-check-3QIA7O4F.js +0 -10
|
@@ -1,19 +1,37 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateRuntime
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A3EBWI7U.js";
|
|
4
4
|
import {
|
|
5
5
|
generateAgentsMd
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IGBQIXPS.js";
|
|
7
7
|
import {
|
|
8
8
|
generateCIWorkflow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ELMV6QU2.js";
|
|
10
|
+
import {
|
|
11
|
+
createGenerateAgentDefinitionsCommand,
|
|
12
|
+
generateAgentDefinitions
|
|
13
|
+
} from "./chunk-4CWFVEVV.js";
|
|
14
|
+
import {
|
|
15
|
+
toKebabCase
|
|
16
|
+
} from "./chunk-KET4QQZB.js";
|
|
17
|
+
import {
|
|
18
|
+
createScanCommand,
|
|
19
|
+
loadIngestOptions
|
|
20
|
+
} from "./chunk-5XLLIYYL.js";
|
|
10
21
|
import {
|
|
11
22
|
TemplateEngine
|
|
12
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-IXKGMPMT.js";
|
|
13
24
|
import {
|
|
14
25
|
generate,
|
|
15
26
|
validate
|
|
16
27
|
} from "./chunk-CQ553GZO.js";
|
|
28
|
+
import {
|
|
29
|
+
createCreateSkillCommand
|
|
30
|
+
} from "./chunk-ZP5E7YET.js";
|
|
31
|
+
import {
|
|
32
|
+
listPersonas,
|
|
33
|
+
loadPersona
|
|
34
|
+
} from "./chunk-57TS3UGN.js";
|
|
17
35
|
import {
|
|
18
36
|
runPersona
|
|
19
37
|
} from "./chunk-GISMXMVL.js";
|
|
@@ -28,22 +46,7 @@ import {
|
|
|
28
46
|
OutputMode,
|
|
29
47
|
createCheckPhaseGateCommand,
|
|
30
48
|
findFiles
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import {
|
|
33
|
-
createGenerateAgentDefinitionsCommand,
|
|
34
|
-
generateAgentDefinitions
|
|
35
|
-
} from "./chunk-OOXNZABU.js";
|
|
36
|
-
import {
|
|
37
|
-
toKebabCase
|
|
38
|
-
} from "./chunk-KET4QQZB.js";
|
|
39
|
-
import {
|
|
40
|
-
listPersonas,
|
|
41
|
-
loadPersona
|
|
42
|
-
} from "./chunk-LA3VGBU6.js";
|
|
43
|
-
import {
|
|
44
|
-
createScanCommand,
|
|
45
|
-
loadIngestOptions
|
|
46
|
-
} from "./chunk-5XLLIYYL.js";
|
|
49
|
+
} from "./chunk-XIW24BJY.js";
|
|
47
50
|
import {
|
|
48
51
|
appendFrameworkAgents,
|
|
49
52
|
captureHealthSnapshot,
|
|
@@ -57,21 +60,16 @@ import {
|
|
|
57
60
|
loadCachedSnapshot,
|
|
58
61
|
persistToolingConfig,
|
|
59
62
|
recommend
|
|
60
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-LT244Y6E.js";
|
|
64
|
+
import {
|
|
65
|
+
VALID_PLATFORMS
|
|
66
|
+
} from "./chunk-3ISINLYT.js";
|
|
61
67
|
import {
|
|
62
68
|
loadGraphStore
|
|
63
69
|
} from "./chunk-5FDBXUFW.js";
|
|
64
70
|
import {
|
|
65
71
|
loadOrRebuildIndex
|
|
66
72
|
} from "./chunk-27AJKSQY.js";
|
|
67
|
-
import {
|
|
68
|
-
BranchingConfigSchema,
|
|
69
|
-
findConfigFile,
|
|
70
|
-
resolveConfig
|
|
71
|
-
} from "./chunk-GNZABDPB.js";
|
|
72
|
-
import {
|
|
73
|
-
VALID_PLATFORMS
|
|
74
|
-
} from "./chunk-3ISINLYT.js";
|
|
75
73
|
import {
|
|
76
74
|
resolveGlobalCommunityBaseDir,
|
|
77
75
|
resolveGlobalSkillsDir,
|
|
@@ -81,32 +79,40 @@ import {
|
|
|
81
79
|
resolveTemplatesDir
|
|
82
80
|
} from "./chunk-6B6UN6SG.js";
|
|
83
81
|
import {
|
|
84
|
-
|
|
85
|
-
} from "./chunk-
|
|
82
|
+
SkillMetadataSchema
|
|
83
|
+
} from "./chunk-HIK6OEUF.js";
|
|
84
|
+
import {
|
|
85
|
+
BranchingConfigSchema,
|
|
86
|
+
findConfigFile,
|
|
87
|
+
resolveConfig
|
|
88
|
+
} from "./chunk-HIZXUWWC.js";
|
|
89
|
+
import {
|
|
90
|
+
logger
|
|
91
|
+
} from "./chunk-EBJQ6N4M.js";
|
|
92
|
+
import {
|
|
93
|
+
CLIError,
|
|
94
|
+
ExitCode,
|
|
95
|
+
handleError
|
|
96
|
+
} from "./chunk-3WGJMBKH.js";
|
|
86
97
|
import {
|
|
87
98
|
ArchBaselineManager,
|
|
88
|
-
ArchConfigSchema,
|
|
89
99
|
BaselineManager,
|
|
90
100
|
BlueprintGenerator,
|
|
91
101
|
BundleSchema,
|
|
92
102
|
CINotifier,
|
|
93
103
|
CriticalPathResolver,
|
|
94
|
-
EntropyAnalyzer,
|
|
95
104
|
GitHubIssuesSyncAdapter,
|
|
96
105
|
PredictionEngine,
|
|
97
106
|
ProjectScanner,
|
|
98
107
|
SecurityScanner,
|
|
99
108
|
SecurityTimelineManager,
|
|
100
109
|
SpecImpactEstimator,
|
|
101
|
-
TimelineManager,
|
|
102
|
-
TypeScriptParser,
|
|
103
110
|
addProvenance,
|
|
104
111
|
appendLearning,
|
|
105
112
|
applyFixes,
|
|
106
113
|
archiveStream,
|
|
107
114
|
assembleCandidateReport,
|
|
108
115
|
assembleReport,
|
|
109
|
-
buildSnapshot,
|
|
110
116
|
checkDocCoverage,
|
|
111
117
|
checkTaint,
|
|
112
118
|
clearTaint,
|
|
@@ -119,23 +125,20 @@ import {
|
|
|
119
125
|
createTrackerClient,
|
|
120
126
|
crossReferenceUndocumentedFixes,
|
|
121
127
|
deepMergeConstraints,
|
|
122
|
-
defineLayer,
|
|
123
128
|
detectCircularDepsInFiles,
|
|
124
|
-
detectDeadCode,
|
|
125
|
-
detectDocDrift,
|
|
126
129
|
diff,
|
|
127
130
|
dist_exports,
|
|
128
131
|
extractBundle,
|
|
129
132
|
extractHeadlines,
|
|
130
133
|
formatIsoWeek,
|
|
131
|
-
generateSuggestions,
|
|
132
134
|
getOrCreateInstallId,
|
|
133
135
|
gitScan,
|
|
134
|
-
init_dist as
|
|
136
|
+
init_dist as init_dist3,
|
|
135
137
|
invalidateCheckState,
|
|
136
138
|
isoWeek,
|
|
137
139
|
listStreams,
|
|
138
140
|
listTaintedSessions,
|
|
141
|
+
loadNotificationsConfig,
|
|
139
142
|
loadProjectRoadmapMode,
|
|
140
143
|
loadState,
|
|
141
144
|
loadStreamIndex,
|
|
@@ -166,46 +169,51 @@ import {
|
|
|
166
169
|
validateAgentConfigs,
|
|
167
170
|
validateAgentsMap,
|
|
168
171
|
validateBranchName,
|
|
169
|
-
validateDependencies,
|
|
170
172
|
validateKnowledgeMap,
|
|
171
173
|
validatePulseConfig,
|
|
172
174
|
validateRoadmapMode,
|
|
173
175
|
validateSolutionsDir,
|
|
174
176
|
writeConfig,
|
|
175
177
|
writeLockfile
|
|
176
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-KQ6TDRPS.js";
|
|
179
|
+
import {
|
|
180
|
+
CLI_VERSION
|
|
181
|
+
} from "./chunk-BM3PWGXQ.js";
|
|
182
|
+
import {
|
|
183
|
+
EntropyAnalyzer,
|
|
184
|
+
TypeScriptParser,
|
|
185
|
+
buildSnapshot,
|
|
186
|
+
defineLayer,
|
|
187
|
+
detectDeadCode,
|
|
188
|
+
detectDocDrift,
|
|
189
|
+
generateSuggestions,
|
|
190
|
+
validateDependencies
|
|
191
|
+
} from "./chunk-IWRYCUDO.js";
|
|
177
192
|
import {
|
|
178
193
|
Err,
|
|
179
|
-
|
|
180
|
-
|
|
194
|
+
INDEXED_FILE_KINDS,
|
|
195
|
+
INSIGHTS_KEYS,
|
|
196
|
+
Ok,
|
|
197
|
+
init_dist
|
|
198
|
+
} from "./chunk-2LPUIBVH.js";
|
|
181
199
|
import {
|
|
182
200
|
DEFAULT_SKIP_DIRS,
|
|
183
|
-
init_dist
|
|
201
|
+
init_dist as init_dist2
|
|
184
202
|
} from "./chunk-BCFDGOMA.js";
|
|
185
203
|
import {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
SkillMetadataSchema
|
|
190
|
-
} from "./chunk-HIK6OEUF.js";
|
|
191
|
-
import {
|
|
192
|
-
logger
|
|
193
|
-
} from "./chunk-EBJQ6N4M.js";
|
|
194
|
-
import {
|
|
195
|
-
CLIError,
|
|
196
|
-
ExitCode,
|
|
197
|
-
handleError
|
|
198
|
-
} from "./chunk-3WGJMBKH.js";
|
|
204
|
+
ArchConfigSchema,
|
|
205
|
+
TimelineManager
|
|
206
|
+
} from "./chunk-QCLOIUMX.js";
|
|
199
207
|
import {
|
|
200
208
|
__require,
|
|
201
209
|
__toCommonJS
|
|
202
210
|
} from "./chunk-KFQGP6VL.js";
|
|
203
211
|
|
|
204
212
|
// src/index.ts
|
|
205
|
-
import { Command as
|
|
213
|
+
import { Command as Command101 } from "commander";
|
|
206
214
|
|
|
207
215
|
// src/commands/add.ts
|
|
208
|
-
|
|
216
|
+
init_dist3();
|
|
209
217
|
import { Command } from "commander";
|
|
210
218
|
import * as fs from "fs";
|
|
211
219
|
import * as path from "path";
|
|
@@ -391,7 +399,7 @@ function registerSkillsCommand(adoption) {
|
|
|
391
399
|
const globalOpts = cmd.optsWithGlobals();
|
|
392
400
|
const limit = Math.max(parseInt(opts.limit, 10) || 20, 1);
|
|
393
401
|
const cwd = process.cwd();
|
|
394
|
-
const { readAdoptionRecords, aggregateBySkill } = await import("./dist-
|
|
402
|
+
const { readAdoptionRecords, aggregateBySkill } = await import("./dist-TKHVYUWZ.js");
|
|
395
403
|
const records = readAdoptionRecords(cwd);
|
|
396
404
|
if (records.length === 0) {
|
|
397
405
|
if (globalOpts.json) {
|
|
@@ -427,7 +435,7 @@ function registerRecentCommand(adoption) {
|
|
|
427
435
|
const globalOpts = cmd.optsWithGlobals();
|
|
428
436
|
const limit = Math.max(parseInt(opts.limit, 10) || 20, 1);
|
|
429
437
|
const cwd = process.cwd();
|
|
430
|
-
const { readAdoptionRecords } = await import("./dist-
|
|
438
|
+
const { readAdoptionRecords } = await import("./dist-TKHVYUWZ.js");
|
|
431
439
|
const records = readAdoptionRecords(cwd);
|
|
432
440
|
if (records.length === 0) {
|
|
433
441
|
if (globalOpts.json) {
|
|
@@ -505,7 +513,7 @@ function registerSkillCommand(adoption) {
|
|
|
505
513
|
adoption.command("skill <name>").description("Show detail for a specific skill").action(async (name, _opts, cmd) => {
|
|
506
514
|
const globalOpts = cmd.optsWithGlobals();
|
|
507
515
|
const cwd = process.cwd();
|
|
508
|
-
const { readAdoptionRecords, aggregateBySkill } = await import("./dist-
|
|
516
|
+
const { readAdoptionRecords, aggregateBySkill } = await import("./dist-TKHVYUWZ.js");
|
|
509
517
|
const records = readAdoptionRecords(cwd);
|
|
510
518
|
const skillRecords = records.filter((r) => r.skill === name);
|
|
511
519
|
if (skillRecords.length === 0) {
|
|
@@ -536,8 +544,8 @@ function createAdoptionCommand() {
|
|
|
536
544
|
import { Command as Command5 } from "commander";
|
|
537
545
|
|
|
538
546
|
// src/commands/agent/run.ts
|
|
539
|
-
|
|
540
|
-
|
|
547
|
+
init_dist3();
|
|
548
|
+
init_dist3();
|
|
541
549
|
import { Command as Command3 } from "commander";
|
|
542
550
|
import * as path2 from "path";
|
|
543
551
|
import * as childProcess from "child_process";
|
|
@@ -659,7 +667,7 @@ function createRunCommand() {
|
|
|
659
667
|
}
|
|
660
668
|
|
|
661
669
|
// src/commands/agent/review.ts
|
|
662
|
-
|
|
670
|
+
init_dist3();
|
|
663
671
|
import { Command as Command4 } from "commander";
|
|
664
672
|
import { execSync } from "child_process";
|
|
665
673
|
async function runAgentReview(options) {
|
|
@@ -796,7 +804,7 @@ function createAgentCommand() {
|
|
|
796
804
|
}
|
|
797
805
|
|
|
798
806
|
// src/commands/audit-protected.ts
|
|
799
|
-
|
|
807
|
+
init_dist3();
|
|
800
808
|
import { Command as Command6 } from "commander";
|
|
801
809
|
import * as path3 from "path";
|
|
802
810
|
import * as fs2 from "fs";
|
|
@@ -904,7 +912,7 @@ function createAuditProtectedCommand() {
|
|
|
904
912
|
}
|
|
905
913
|
|
|
906
914
|
// src/commands/blueprint.ts
|
|
907
|
-
|
|
915
|
+
init_dist3();
|
|
908
916
|
import { Command as Command7 } from "commander";
|
|
909
917
|
import * as path4 from "path";
|
|
910
918
|
function createBlueprintCommand() {
|
|
@@ -929,7 +937,7 @@ function createBlueprintCommand() {
|
|
|
929
937
|
}
|
|
930
938
|
|
|
931
939
|
// src/commands/check-arch.ts
|
|
932
|
-
|
|
940
|
+
init_dist3();
|
|
933
941
|
import { Command as Command8 } from "commander";
|
|
934
942
|
import { execSync as execSync2 } from "child_process";
|
|
935
943
|
function getCommitHash(cwd) {
|
|
@@ -1089,8 +1097,8 @@ function createCheckArchCommand() {
|
|
|
1089
1097
|
}
|
|
1090
1098
|
|
|
1091
1099
|
// src/commands/check-deps.ts
|
|
1092
|
-
|
|
1093
|
-
|
|
1100
|
+
init_dist3();
|
|
1101
|
+
init_dist3();
|
|
1094
1102
|
import { Command as Command9 } from "commander";
|
|
1095
1103
|
import * as path5 from "path";
|
|
1096
1104
|
async function runCheckDeps(options) {
|
|
@@ -1190,8 +1198,8 @@ function createCheckDepsCommand() {
|
|
|
1190
1198
|
}
|
|
1191
1199
|
|
|
1192
1200
|
// src/commands/check-docs.ts
|
|
1193
|
-
|
|
1194
|
-
|
|
1201
|
+
init_dist3();
|
|
1202
|
+
init_dist3();
|
|
1195
1203
|
import { Command as Command10 } from "commander";
|
|
1196
1204
|
import * as path6 from "path";
|
|
1197
1205
|
async function runCheckDocs(options) {
|
|
@@ -1300,7 +1308,7 @@ function createCheckDocsCommand() {
|
|
|
1300
1308
|
}
|
|
1301
1309
|
|
|
1302
1310
|
// src/commands/check-perf.ts
|
|
1303
|
-
|
|
1311
|
+
init_dist3();
|
|
1304
1312
|
import { Command as Command11 } from "commander";
|
|
1305
1313
|
import * as path7 from "path";
|
|
1306
1314
|
async function runCheckPerf(cwd, options) {
|
|
@@ -1425,7 +1433,7 @@ function createCheckPerfCommand() {
|
|
|
1425
1433
|
}
|
|
1426
1434
|
|
|
1427
1435
|
// src/commands/check-security.ts
|
|
1428
|
-
|
|
1436
|
+
init_dist3();
|
|
1429
1437
|
import { Command as Command12 } from "commander";
|
|
1430
1438
|
import * as path8 from "path";
|
|
1431
1439
|
import { execSync as execSync3 } from "child_process";
|
|
@@ -1547,7 +1555,7 @@ function createCheckSecurityCommand() {
|
|
|
1547
1555
|
import { Command as Command16 } from "commander";
|
|
1548
1556
|
|
|
1549
1557
|
// src/commands/ci/check.ts
|
|
1550
|
-
|
|
1558
|
+
init_dist3();
|
|
1551
1559
|
import { Command as Command13 } from "commander";
|
|
1552
1560
|
var VALID_CHECKS = [
|
|
1553
1561
|
"validate",
|
|
@@ -1644,7 +1652,7 @@ function createCheckCommand() {
|
|
|
1644
1652
|
}
|
|
1645
1653
|
|
|
1646
1654
|
// src/commands/ci/init.ts
|
|
1647
|
-
|
|
1655
|
+
init_dist3();
|
|
1648
1656
|
import { Command as Command14 } from "commander";
|
|
1649
1657
|
import * as fs3 from "fs";
|
|
1650
1658
|
import * as path9 from "path";
|
|
@@ -1788,7 +1796,7 @@ function createInitCommand() {
|
|
|
1788
1796
|
}
|
|
1789
1797
|
|
|
1790
1798
|
// src/commands/ci/notify.ts
|
|
1791
|
-
|
|
1799
|
+
init_dist3();
|
|
1792
1800
|
import { Command as Command15 } from "commander";
|
|
1793
1801
|
import * as fs4 from "fs";
|
|
1794
1802
|
function loadReport(reportPath) {
|
|
@@ -1901,7 +1909,7 @@ function createCICommand() {
|
|
|
1901
1909
|
}
|
|
1902
1910
|
|
|
1903
1911
|
// src/commands/cleanup.ts
|
|
1904
|
-
|
|
1912
|
+
init_dist3();
|
|
1905
1913
|
import { Command as Command17 } from "commander";
|
|
1906
1914
|
import * as path10 from "path";
|
|
1907
1915
|
async function runCleanup(options) {
|
|
@@ -2021,7 +2029,7 @@ function createCleanupCommand() {
|
|
|
2021
2029
|
}
|
|
2022
2030
|
|
|
2023
2031
|
// src/commands/cleanup-sessions.ts
|
|
2024
|
-
|
|
2032
|
+
init_dist3();
|
|
2025
2033
|
import { Command as Command18 } from "commander";
|
|
2026
2034
|
import * as fs5 from "fs";
|
|
2027
2035
|
import * as path11 from "path";
|
|
@@ -2130,7 +2138,7 @@ function createCleanupSessionsCommand() {
|
|
|
2130
2138
|
import { Command as Command20 } from "commander";
|
|
2131
2139
|
|
|
2132
2140
|
// src/commands/compound/scan-candidates.ts
|
|
2133
|
-
|
|
2141
|
+
init_dist3();
|
|
2134
2142
|
import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
2135
2143
|
import { dirname as dirname2, join as join7, resolve as resolve11 } from "path";
|
|
2136
2144
|
import { Command as Command19 } from "commander";
|
|
@@ -2616,12 +2624,282 @@ function checkIntegrations(cwd) {
|
|
|
2616
2624
|
}
|
|
2617
2625
|
return results;
|
|
2618
2626
|
}
|
|
2627
|
+
var LIVE_PING_CREDENTIALS = [
|
|
2628
|
+
{
|
|
2629
|
+
envVar: "ANTHROPIC_API_KEY",
|
|
2630
|
+
displayName: "Anthropic API key",
|
|
2631
|
+
prefix: "sk-ant-",
|
|
2632
|
+
minLength: 30
|
|
2633
|
+
},
|
|
2634
|
+
{ envVar: "OPENAI_API_KEY", displayName: "OpenAI API key", prefix: "sk-", minLength: 20 },
|
|
2635
|
+
{ envVar: "GITHUB_TOKEN", displayName: "GitHub token", minLength: 30 }
|
|
2636
|
+
];
|
|
2637
|
+
function checkLivePings(env = process.env) {
|
|
2638
|
+
const results = [];
|
|
2639
|
+
for (const cred of LIVE_PING_CREDENTIALS) {
|
|
2640
|
+
const value = env[cred.envVar];
|
|
2641
|
+
if (!value) {
|
|
2642
|
+
results.push({
|
|
2643
|
+
name: `live-pings-${cred.envVar.toLowerCase()}`,
|
|
2644
|
+
status: "info",
|
|
2645
|
+
message: `${cred.displayName} (${cred.envVar}) not set \u2014 skip if you do not use this integration`
|
|
2646
|
+
});
|
|
2647
|
+
continue;
|
|
2648
|
+
}
|
|
2649
|
+
const tooShort = cred.minLength !== void 0 && value.length < cred.minLength;
|
|
2650
|
+
const wrongPrefix = cred.prefix !== void 0 && !value.startsWith(cred.prefix);
|
|
2651
|
+
if (tooShort || wrongPrefix) {
|
|
2652
|
+
const issue = wrongPrefix ? `expected prefix '${cred.prefix}'` : `length ${value.length} < ${cred.minLength}`;
|
|
2653
|
+
results.push({
|
|
2654
|
+
name: `live-pings-${cred.envVar.toLowerCase()}`,
|
|
2655
|
+
status: "warn",
|
|
2656
|
+
message: `${cred.displayName} (${cred.envVar}) looks malformed: ${issue}`,
|
|
2657
|
+
fix: `Re-check the value for ${cred.envVar}`
|
|
2658
|
+
});
|
|
2659
|
+
} else {
|
|
2660
|
+
results.push({
|
|
2661
|
+
name: `live-pings-${cred.envVar.toLowerCase()}`,
|
|
2662
|
+
status: "pass",
|
|
2663
|
+
message: `${cred.displayName} (${cred.envVar}) present`
|
|
2664
|
+
});
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
return results;
|
|
2668
|
+
}
|
|
2669
|
+
function listHookFiles(cwd) {
|
|
2670
|
+
const hooksDir = path13.join(cwd, ".harness", "hooks");
|
|
2671
|
+
if (!fs7.existsSync(hooksDir)) return [];
|
|
2672
|
+
try {
|
|
2673
|
+
return fs7.readdirSync(hooksDir).filter((f) => !f.startsWith(".")).map((f) => ({
|
|
2674
|
+
relativePath: path13.join(".harness", "hooks", f),
|
|
2675
|
+
absolutePath: path13.join(hooksDir, f)
|
|
2676
|
+
}));
|
|
2677
|
+
} catch {
|
|
2678
|
+
return [];
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
function validateJsonHook(entry, content) {
|
|
2682
|
+
try {
|
|
2683
|
+
JSON.parse(content);
|
|
2684
|
+
return {
|
|
2685
|
+
name: `hook-validity-${entry.relativePath}`,
|
|
2686
|
+
status: "pass",
|
|
2687
|
+
message: `Hook ${entry.relativePath} parses as JSON`
|
|
2688
|
+
};
|
|
2689
|
+
} catch (err) {
|
|
2690
|
+
return {
|
|
2691
|
+
name: `hook-validity-${entry.relativePath}`,
|
|
2692
|
+
status: "fail",
|
|
2693
|
+
message: `Hook ${entry.relativePath} is not valid JSON: ${err instanceof Error ? err.message : String(err)}`,
|
|
2694
|
+
fix: `Edit ${entry.relativePath} and fix the JSON syntax`
|
|
2695
|
+
};
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
function validateShellHook(entry, content) {
|
|
2699
|
+
if (content.length === 0) {
|
|
2700
|
+
return {
|
|
2701
|
+
name: `hook-validity-${entry.relativePath}`,
|
|
2702
|
+
status: "fail",
|
|
2703
|
+
message: `Hook ${entry.relativePath} is empty`,
|
|
2704
|
+
fix: `Remove the empty file or add a script body`
|
|
2705
|
+
};
|
|
2706
|
+
}
|
|
2707
|
+
const firstLine = content.split("\n", 1)[0] ?? "";
|
|
2708
|
+
if (!firstLine.startsWith("#!")) {
|
|
2709
|
+
return {
|
|
2710
|
+
name: `hook-validity-${entry.relativePath}`,
|
|
2711
|
+
status: "warn",
|
|
2712
|
+
message: `Hook ${entry.relativePath} has no shebang \u2014 may not be executable`,
|
|
2713
|
+
fix: `Add a shebang (e.g., '#!/usr/bin/env bash')`
|
|
2714
|
+
};
|
|
2715
|
+
}
|
|
2716
|
+
return {
|
|
2717
|
+
name: `hook-validity-${entry.relativePath}`,
|
|
2718
|
+
status: "pass",
|
|
2719
|
+
message: `Hook ${entry.relativePath} OK`
|
|
2720
|
+
};
|
|
2721
|
+
}
|
|
2722
|
+
function validateHookEntry(entry) {
|
|
2723
|
+
let content;
|
|
2724
|
+
try {
|
|
2725
|
+
content = fs7.readFileSync(entry.absolutePath, "utf-8");
|
|
2726
|
+
} catch (err) {
|
|
2727
|
+
return {
|
|
2728
|
+
name: `hook-validity-${entry.relativePath}`,
|
|
2729
|
+
status: "fail",
|
|
2730
|
+
message: `Cannot read ${entry.relativePath}: ${err instanceof Error ? err.message : String(err)}`,
|
|
2731
|
+
fix: `Check file permissions on ${entry.relativePath}`
|
|
2732
|
+
};
|
|
2733
|
+
}
|
|
2734
|
+
return entry.relativePath.endsWith(".json") ? validateJsonHook(entry, content) : validateShellHook(entry, content);
|
|
2735
|
+
}
|
|
2736
|
+
function checkHookValidity(cwd) {
|
|
2737
|
+
const entries = listHookFiles(cwd);
|
|
2738
|
+
if (entries.length === 0) {
|
|
2739
|
+
return [
|
|
2740
|
+
{
|
|
2741
|
+
name: "hook-validity",
|
|
2742
|
+
status: "info",
|
|
2743
|
+
message: "No hooks configured under .harness/hooks/ (optional)"
|
|
2744
|
+
}
|
|
2745
|
+
];
|
|
2746
|
+
}
|
|
2747
|
+
return entries.map(validateHookEntry);
|
|
2748
|
+
}
|
|
2749
|
+
var BASELINE_FILES = [
|
|
2750
|
+
{
|
|
2751
|
+
relativePath: ".harness/arch/baselines.json",
|
|
2752
|
+
displayName: "architecture baselines",
|
|
2753
|
+
fix: "Run: harness check-arch --update"
|
|
2754
|
+
},
|
|
2755
|
+
{
|
|
2756
|
+
relativePath: "benchmark-baselines.json",
|
|
2757
|
+
displayName: "benchmark baselines",
|
|
2758
|
+
fix: "Run: harness check-perf --update"
|
|
2759
|
+
},
|
|
2760
|
+
{
|
|
2761
|
+
relativePath: "coverage-baselines.json",
|
|
2762
|
+
displayName: "coverage baselines",
|
|
2763
|
+
fix: "Run: harness ci coverage --update"
|
|
2764
|
+
}
|
|
2765
|
+
];
|
|
2766
|
+
var BASELINE_WARN_DAYS = 30;
|
|
2767
|
+
var BASELINE_FAIL_DAYS = 90;
|
|
2768
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
2769
|
+
function checkBaselineFreshness(cwd, now = Date.now()) {
|
|
2770
|
+
const results = [];
|
|
2771
|
+
for (const def of BASELINE_FILES) {
|
|
2772
|
+
const absolutePath = path13.join(cwd, def.relativePath);
|
|
2773
|
+
if (!fs7.existsSync(absolutePath)) {
|
|
2774
|
+
results.push({
|
|
2775
|
+
name: `baseline-freshness-${def.relativePath}`,
|
|
2776
|
+
status: "info",
|
|
2777
|
+
message: `${def.displayName} (${def.relativePath}) not present \u2014 optional`
|
|
2778
|
+
});
|
|
2779
|
+
continue;
|
|
2780
|
+
}
|
|
2781
|
+
let mtimeMs;
|
|
2782
|
+
try {
|
|
2783
|
+
mtimeMs = fs7.statSync(absolutePath).mtimeMs;
|
|
2784
|
+
} catch (err) {
|
|
2785
|
+
results.push({
|
|
2786
|
+
name: `baseline-freshness-${def.relativePath}`,
|
|
2787
|
+
status: "fail",
|
|
2788
|
+
message: `Cannot stat ${def.relativePath}: ${err instanceof Error ? err.message : String(err)}`,
|
|
2789
|
+
fix: def.fix
|
|
2790
|
+
});
|
|
2791
|
+
continue;
|
|
2792
|
+
}
|
|
2793
|
+
const ageDays = Math.floor((now - mtimeMs) / DAY_MS);
|
|
2794
|
+
if (ageDays >= BASELINE_FAIL_DAYS) {
|
|
2795
|
+
results.push({
|
|
2796
|
+
name: `baseline-freshness-${def.relativePath}`,
|
|
2797
|
+
status: "fail",
|
|
2798
|
+
message: `${def.displayName} is ${ageDays}d old (>= ${BASELINE_FAIL_DAYS}d)`,
|
|
2799
|
+
fix: def.fix
|
|
2800
|
+
});
|
|
2801
|
+
} else if (ageDays >= BASELINE_WARN_DAYS) {
|
|
2802
|
+
results.push({
|
|
2803
|
+
name: `baseline-freshness-${def.relativePath}`,
|
|
2804
|
+
status: "warn",
|
|
2805
|
+
message: `${def.displayName} is ${ageDays}d old`,
|
|
2806
|
+
fix: def.fix
|
|
2807
|
+
});
|
|
2808
|
+
} else {
|
|
2809
|
+
results.push({
|
|
2810
|
+
name: `baseline-freshness-${def.relativePath}`,
|
|
2811
|
+
status: "pass",
|
|
2812
|
+
message: `${def.displayName} fresh (${ageDays}d old)`
|
|
2813
|
+
});
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
return results;
|
|
2817
|
+
}
|
|
2818
|
+
var SESSIONS_SAMPLE_SIZE = 5;
|
|
2819
|
+
function listRecentSessions(cwd) {
|
|
2820
|
+
const sessionsDir = path13.join(cwd, ".harness", "sessions");
|
|
2821
|
+
if (!fs7.existsSync(sessionsDir)) return [];
|
|
2822
|
+
let entries;
|
|
2823
|
+
try {
|
|
2824
|
+
entries = fs7.readdirSync(sessionsDir);
|
|
2825
|
+
} catch {
|
|
2826
|
+
return [];
|
|
2827
|
+
}
|
|
2828
|
+
const dirs = [];
|
|
2829
|
+
for (const name of entries) {
|
|
2830
|
+
if (name.startsWith(".")) continue;
|
|
2831
|
+
const absolutePath = path13.join(sessionsDir, name);
|
|
2832
|
+
try {
|
|
2833
|
+
const stat = fs7.statSync(absolutePath);
|
|
2834
|
+
if (!stat.isDirectory()) continue;
|
|
2835
|
+
dirs.push({ name, absolutePath, mtimeMs: stat.mtimeMs });
|
|
2836
|
+
} catch {
|
|
2837
|
+
continue;
|
|
2838
|
+
}
|
|
2839
|
+
}
|
|
2840
|
+
dirs.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
2841
|
+
return dirs.slice(0, SESSIONS_SAMPLE_SIZE);
|
|
2842
|
+
}
|
|
2843
|
+
function scanSessionSummaries(sessions) {
|
|
2844
|
+
let parsed = 0;
|
|
2845
|
+
let missing = 0;
|
|
2846
|
+
const corrupt = [];
|
|
2847
|
+
for (const session of sessions) {
|
|
2848
|
+
const summaryPath = path13.join(session.absolutePath, "session-summary.json");
|
|
2849
|
+
if (!fs7.existsSync(summaryPath)) {
|
|
2850
|
+
missing += 1;
|
|
2851
|
+
continue;
|
|
2852
|
+
}
|
|
2853
|
+
try {
|
|
2854
|
+
JSON.parse(fs7.readFileSync(summaryPath, "utf-8"));
|
|
2855
|
+
parsed += 1;
|
|
2856
|
+
} catch {
|
|
2857
|
+
corrupt.push(session.name);
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
return { parsed, missing, corrupt };
|
|
2861
|
+
}
|
|
2862
|
+
function checkSessionCorruption(cwd) {
|
|
2863
|
+
const sessions = listRecentSessions(cwd);
|
|
2864
|
+
if (sessions.length === 0) {
|
|
2865
|
+
return [
|
|
2866
|
+
{
|
|
2867
|
+
name: "session-corruption",
|
|
2868
|
+
status: "info",
|
|
2869
|
+
message: "No session archives under .harness/sessions/"
|
|
2870
|
+
}
|
|
2871
|
+
];
|
|
2872
|
+
}
|
|
2873
|
+
const { parsed, missing, corrupt } = scanSessionSummaries(sessions);
|
|
2874
|
+
if (corrupt.length === 0) {
|
|
2875
|
+
return [
|
|
2876
|
+
{
|
|
2877
|
+
name: "session-corruption",
|
|
2878
|
+
status: "pass",
|
|
2879
|
+
message: `Sampled ${sessions.length} session(s): ${parsed} parsed, ${missing} without summary`
|
|
2880
|
+
}
|
|
2881
|
+
];
|
|
2882
|
+
}
|
|
2883
|
+
const allCorrupt = corrupt.length === sessions.length;
|
|
2884
|
+
return [
|
|
2885
|
+
{
|
|
2886
|
+
name: "session-corruption",
|
|
2887
|
+
status: allCorrupt ? "fail" : "warn",
|
|
2888
|
+
message: allCorrupt ? `All ${corrupt.length} sampled session summaries failed to parse` : `${corrupt.length}/${sessions.length} session summaries malformed: ${corrupt.join(", ")}`,
|
|
2889
|
+
fix: "Run: harness cleanup-sessions"
|
|
2890
|
+
}
|
|
2891
|
+
];
|
|
2892
|
+
}
|
|
2619
2893
|
function runDoctor(cwd) {
|
|
2620
2894
|
const checks = [];
|
|
2621
2895
|
checks.push(checkNodeVersion2());
|
|
2622
2896
|
checks.push(...checkSlashCommands());
|
|
2623
2897
|
checks.push(...checkMcpConfig(cwd));
|
|
2624
2898
|
checks.push(...checkIntegrations(cwd));
|
|
2899
|
+
checks.push(...checkLivePings());
|
|
2900
|
+
checks.push(...checkHookValidity(cwd));
|
|
2901
|
+
checks.push(...checkBaselineFreshness(cwd));
|
|
2902
|
+
checks.push(...checkSessionCorruption(cwd));
|
|
2625
2903
|
const allPassed = checks.every((c) => c.status !== "fail");
|
|
2626
2904
|
return { checks, allPassed };
|
|
2627
2905
|
}
|
|
@@ -2641,7 +2919,9 @@ function formatCheck(check) {
|
|
|
2641
2919
|
return line;
|
|
2642
2920
|
}
|
|
2643
2921
|
function createDoctorCommand() {
|
|
2644
|
-
return new Command22("doctor").description(
|
|
2922
|
+
return new Command22("doctor").description(
|
|
2923
|
+
"Check environment health: Node, slash commands, MCP, integrations, integration credentials, hooks, baselines, sessions"
|
|
2924
|
+
).action((_opts, cmd) => {
|
|
2645
2925
|
const globalOpts = cmd.optsWithGlobals();
|
|
2646
2926
|
const cwd = process.cwd();
|
|
2647
2927
|
const useJson = globalOpts.json;
|
|
@@ -2666,7 +2946,7 @@ function createDoctorCommand() {
|
|
|
2666
2946
|
}
|
|
2667
2947
|
|
|
2668
2948
|
// src/commands/fix-drift.ts
|
|
2669
|
-
|
|
2949
|
+
init_dist3();
|
|
2670
2950
|
import { Command as Command23 } from "commander";
|
|
2671
2951
|
import * as path14 from "path";
|
|
2672
2952
|
async function runFixDrift(options) {
|
|
@@ -4013,7 +4293,7 @@ function createImpactPreviewCommand() {
|
|
|
4013
4293
|
}
|
|
4014
4294
|
|
|
4015
4295
|
// src/commands/init.ts
|
|
4016
|
-
|
|
4296
|
+
init_dist3();
|
|
4017
4297
|
import { Command as Command38 } from "commander";
|
|
4018
4298
|
import chalk3 from "chalk";
|
|
4019
4299
|
import * as fs15 from "fs";
|
|
@@ -4186,7 +4466,11 @@ var ALL_MCP_TOOLS = [
|
|
|
4186
4466
|
"trigger_maintenance_job",
|
|
4187
4467
|
"list_gateway_tokens",
|
|
4188
4468
|
// Phase 3 Task 9 — Gateway API webhook wrapper
|
|
4189
|
-
"subscribe_webhook"
|
|
4469
|
+
"subscribe_webhook",
|
|
4470
|
+
// Hermes Phase 1 — session search, summarization, insights aggregator
|
|
4471
|
+
"search_sessions",
|
|
4472
|
+
"summarize_session",
|
|
4473
|
+
"insights_summary"
|
|
4190
4474
|
];
|
|
4191
4475
|
async function runCursorToolPicker() {
|
|
4192
4476
|
try {
|
|
@@ -4519,12 +4803,67 @@ function createInitCommand3() {
|
|
|
4519
4803
|
return command;
|
|
4520
4804
|
}
|
|
4521
4805
|
|
|
4806
|
+
// src/commands/insights.ts
|
|
4807
|
+
init_dist();
|
|
4808
|
+
import { Command as Command39 } from "commander";
|
|
4809
|
+
function parseSkip2(raw) {
|
|
4810
|
+
if (!raw) return [];
|
|
4811
|
+
const valid = new Set(INSIGHTS_KEYS);
|
|
4812
|
+
return raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0).filter((s) => valid.has(s));
|
|
4813
|
+
}
|
|
4814
|
+
function renderPretty(report) {
|
|
4815
|
+
logger.info(`Insights for ${report.project.name ?? report.project.root}`);
|
|
4816
|
+
logger.info(`Generated: ${report.generatedAt}
|
|
4817
|
+
`);
|
|
4818
|
+
if (report.health) {
|
|
4819
|
+
console.log(`Health : ${report.health.passed ? "PASS" : "FAIL"}`);
|
|
4820
|
+
console.log(` : ${report.health.summary}`);
|
|
4821
|
+
}
|
|
4822
|
+
if (report.entropy) {
|
|
4823
|
+
const e = report.entropy;
|
|
4824
|
+
console.log(
|
|
4825
|
+
`Entropy : drift=${e.driftCount} deadFiles=${e.deadFiles} deadExports=${e.deadExports}`
|
|
4826
|
+
);
|
|
4827
|
+
}
|
|
4828
|
+
if (report.decay) {
|
|
4829
|
+
const top = report.decay.topAffected.join(", ") || "(none)";
|
|
4830
|
+
console.log(`Decay : recentBumps=${report.decay.recentBumps} topAffected=${top}`);
|
|
4831
|
+
}
|
|
4832
|
+
if (report.attention) {
|
|
4833
|
+
const a = report.attention;
|
|
4834
|
+
console.log(`Attention : active=${a.activeThreadCount} stale=${a.staleThreadCount}`);
|
|
4835
|
+
}
|
|
4836
|
+
if (report.impact) {
|
|
4837
|
+
const radii = report.impact.recentBlastRadius.map((r) => `${r.node}(${r.affected})`).join(", ") || "(none)";
|
|
4838
|
+
console.log(`Impact : ${radii}`);
|
|
4839
|
+
}
|
|
4840
|
+
if (report.warnings.length > 0) {
|
|
4841
|
+
console.log("\nWarnings:");
|
|
4842
|
+
for (const w of report.warnings) console.log(` - ${w}`);
|
|
4843
|
+
}
|
|
4844
|
+
}
|
|
4845
|
+
function createInsightsCommand() {
|
|
4846
|
+
return new Command39("insights").description(
|
|
4847
|
+
"Composite project report \u2014 health, entropy, decay, attention, impact (Hermes Phase 1)."
|
|
4848
|
+
).option("--json", "Emit JSON to stdout instead of pretty text").option("--skip <list>", `Comma-separated keys to skip (${INSIGHTS_KEYS.join(",")})`).action(async (opts) => {
|
|
4849
|
+
const cwd = process.cwd();
|
|
4850
|
+
const skip = parseSkip2(opts.skip);
|
|
4851
|
+
const { composeInsights } = await import("./dist-TKHVYUWZ.js");
|
|
4852
|
+
const report = await composeInsights(cwd, { skip });
|
|
4853
|
+
if (opts.json) {
|
|
4854
|
+
console.log(JSON.stringify(report, null, 2));
|
|
4855
|
+
return;
|
|
4856
|
+
}
|
|
4857
|
+
renderPretty(report);
|
|
4858
|
+
});
|
|
4859
|
+
}
|
|
4860
|
+
|
|
4522
4861
|
// src/commands/install.ts
|
|
4523
4862
|
import * as fs20 from "fs";
|
|
4524
4863
|
import * as os5 from "os";
|
|
4525
4864
|
import * as path32 from "path";
|
|
4526
4865
|
import { execFileSync as execFileSync3 } from "child_process";
|
|
4527
|
-
import { Command as
|
|
4866
|
+
import { Command as Command40 } from "commander";
|
|
4528
4867
|
import { parse as yamlParse } from "yaml";
|
|
4529
4868
|
|
|
4530
4869
|
// src/registry/npm-client.ts
|
|
@@ -4832,7 +5171,7 @@ function getBundledSkillNames(bundledSkillsDir) {
|
|
|
4832
5171
|
}
|
|
4833
5172
|
|
|
4834
5173
|
// src/commands/install.ts
|
|
4835
|
-
|
|
5174
|
+
init_dist2();
|
|
4836
5175
|
function validateSkillYaml(parsed) {
|
|
4837
5176
|
const result = SkillMetadataSchema.safeParse(parsed);
|
|
4838
5177
|
if (!result.success) {
|
|
@@ -5085,7 +5424,7 @@ async function runInstall(skillName, options) {
|
|
|
5085
5424
|
return result;
|
|
5086
5425
|
}
|
|
5087
5426
|
function createInstallCommand() {
|
|
5088
|
-
const cmd = new
|
|
5427
|
+
const cmd = new Command40("install");
|
|
5089
5428
|
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(
|
|
5090
5429
|
"--from <source>",
|
|
5091
5430
|
"Install from local path, directory, or GitHub (github:owner/repo, https://github.com/owner/repo)"
|
|
@@ -5118,10 +5457,10 @@ function createInstallCommand() {
|
|
|
5118
5457
|
}
|
|
5119
5458
|
|
|
5120
5459
|
// src/commands/install-constraints.ts
|
|
5121
|
-
|
|
5460
|
+
init_dist3();
|
|
5122
5461
|
import * as fs21 from "fs/promises";
|
|
5123
5462
|
import * as path33 from "path";
|
|
5124
|
-
import { Command as
|
|
5463
|
+
import { Command as Command41 } from "commander";
|
|
5125
5464
|
import semver3 from "semver";
|
|
5126
5465
|
async function runInstallConstraints(options) {
|
|
5127
5466
|
const { source, configPath, lockfilePath } = options;
|
|
@@ -5375,17 +5714,17 @@ async function handleInstallConstraints(source, opts) {
|
|
|
5375
5714
|
logInstallResult(result.value, opts);
|
|
5376
5715
|
}
|
|
5377
5716
|
function createInstallConstraintsCommand() {
|
|
5378
|
-
const cmd = new
|
|
5717
|
+
const cmd = new Command41("install-constraints");
|
|
5379
5718
|
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);
|
|
5380
5719
|
return cmd;
|
|
5381
5720
|
}
|
|
5382
5721
|
|
|
5383
5722
|
// src/commands/integrations/index.ts
|
|
5384
|
-
import { Command as
|
|
5723
|
+
import { Command as Command46 } from "commander";
|
|
5385
5724
|
|
|
5386
5725
|
// src/commands/integrations/add.ts
|
|
5387
|
-
|
|
5388
|
-
import { Command as
|
|
5726
|
+
init_dist3();
|
|
5727
|
+
import { Command as Command42 } from "commander";
|
|
5389
5728
|
import * as fs22 from "fs";
|
|
5390
5729
|
import * as path34 from "path";
|
|
5391
5730
|
import chalk4 from "chalk";
|
|
@@ -5449,7 +5788,7 @@ function printAddSuccess(value) {
|
|
|
5449
5788
|
}
|
|
5450
5789
|
}
|
|
5451
5790
|
function createAddIntegrationCommand() {
|
|
5452
|
-
return new
|
|
5791
|
+
return new Command42("add").description("Enable an MCP integration").argument("<name>", "Integration name (e.g. perplexity, augment-code)").action(async (name, _opts, cmd) => {
|
|
5453
5792
|
const globalOpts = cmd.optsWithGlobals();
|
|
5454
5793
|
const result = addIntegration(process.cwd(), name);
|
|
5455
5794
|
if (!result.ok) {
|
|
@@ -5463,7 +5802,7 @@ function createAddIntegrationCommand() {
|
|
|
5463
5802
|
}
|
|
5464
5803
|
|
|
5465
5804
|
// src/commands/integrations/list.ts
|
|
5466
|
-
import { Command as
|
|
5805
|
+
import { Command as Command43 } from "commander";
|
|
5467
5806
|
import * as path35 from "path";
|
|
5468
5807
|
import chalk5 from "chalk";
|
|
5469
5808
|
function printTier0Integrations(tier0, mcpServers) {
|
|
@@ -5520,12 +5859,12 @@ async function runListIntegrations(globalOpts) {
|
|
|
5520
5859
|
process.exit(ExitCode.SUCCESS);
|
|
5521
5860
|
}
|
|
5522
5861
|
function createListIntegrationsCommand() {
|
|
5523
|
-
return new
|
|
5862
|
+
return new Command43("list").description("Show all MCP integrations with status").action(async (_opts, cmd) => runListIntegrations(cmd.optsWithGlobals()));
|
|
5524
5863
|
}
|
|
5525
5864
|
|
|
5526
5865
|
// src/commands/integrations/remove.ts
|
|
5527
|
-
|
|
5528
|
-
import { Command as
|
|
5866
|
+
init_dist3();
|
|
5867
|
+
import { Command as Command44 } from "commander";
|
|
5529
5868
|
import * as fs23 from "fs";
|
|
5530
5869
|
import * as path36 from "path";
|
|
5531
5870
|
function removeIntegration(cwd, name) {
|
|
@@ -5552,7 +5891,7 @@ function removeIntegration(cwd, name) {
|
|
|
5552
5891
|
return Ok(def.displayName);
|
|
5553
5892
|
}
|
|
5554
5893
|
function createRemoveIntegrationCommand() {
|
|
5555
|
-
return new
|
|
5894
|
+
return new Command44("remove").description("Remove an MCP integration").argument("<name>", "Integration name (e.g. perplexity, augment-code)").action(async (name, _opts, cmd) => {
|
|
5556
5895
|
const globalOpts = cmd.optsWithGlobals();
|
|
5557
5896
|
const cwd = process.cwd();
|
|
5558
5897
|
const result = removeIntegration(cwd, name);
|
|
@@ -5573,8 +5912,8 @@ function createRemoveIntegrationCommand() {
|
|
|
5573
5912
|
}
|
|
5574
5913
|
|
|
5575
5914
|
// src/commands/integrations/dismiss.ts
|
|
5576
|
-
|
|
5577
|
-
import { Command as
|
|
5915
|
+
init_dist3();
|
|
5916
|
+
import { Command as Command45 } from "commander";
|
|
5578
5917
|
import * as path37 from "path";
|
|
5579
5918
|
function dismissIntegration(cwd, name) {
|
|
5580
5919
|
const def = INTEGRATION_REGISTRY.find((i) => i.name === name);
|
|
@@ -5596,7 +5935,7 @@ function dismissIntegration(cwd, name) {
|
|
|
5596
5935
|
return Ok(def.displayName);
|
|
5597
5936
|
}
|
|
5598
5937
|
function createDismissIntegrationCommand() {
|
|
5599
|
-
return new
|
|
5938
|
+
return new Command45("dismiss").description("Suppress doctor recommendations for an integration").argument("<name>", "Integration name (e.g. perplexity, augment-code)").action(async (name, _opts, cmd) => {
|
|
5600
5939
|
const globalOpts = cmd.optsWithGlobals();
|
|
5601
5940
|
const cwd = process.cwd();
|
|
5602
5941
|
const result = dismissIntegration(cwd, name);
|
|
@@ -5620,7 +5959,7 @@ function createDismissIntegrationCommand() {
|
|
|
5620
5959
|
|
|
5621
5960
|
// src/commands/integrations/index.ts
|
|
5622
5961
|
function createIntegrationsCommand() {
|
|
5623
|
-
const command = new
|
|
5962
|
+
const command = new Command46("integrations").description(
|
|
5624
5963
|
"Manage MCP peer integrations (add, list, remove, dismiss)"
|
|
5625
5964
|
);
|
|
5626
5965
|
command.addCommand(createListIntegrationsCommand());
|
|
@@ -5631,11 +5970,11 @@ function createIntegrationsCommand() {
|
|
|
5631
5970
|
}
|
|
5632
5971
|
|
|
5633
5972
|
// src/commands/knowledge-pipeline.ts
|
|
5634
|
-
import { Command as
|
|
5973
|
+
import { Command as Command47 } from "commander";
|
|
5635
5974
|
import * as path38 from "path";
|
|
5636
5975
|
import chalk6 from "chalk";
|
|
5637
5976
|
function createKnowledgePipelineCommand() {
|
|
5638
|
-
return new
|
|
5977
|
+
return new Command47("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) => {
|
|
5639
5978
|
const globalOpts = cmd.optsWithGlobals();
|
|
5640
5979
|
const projectDir = process.cwd();
|
|
5641
5980
|
try {
|
|
@@ -5799,11 +6138,11 @@ function createKnowledgePipelineCommand() {
|
|
|
5799
6138
|
}
|
|
5800
6139
|
|
|
5801
6140
|
// src/commands/learnings/index.ts
|
|
5802
|
-
import { Command as
|
|
6141
|
+
import { Command as Command49 } from "commander";
|
|
5803
6142
|
|
|
5804
6143
|
// src/commands/learnings/prune.ts
|
|
5805
|
-
|
|
5806
|
-
import { Command as
|
|
6144
|
+
init_dist3();
|
|
6145
|
+
import { Command as Command48 } from "commander";
|
|
5807
6146
|
import * as path39 from "path";
|
|
5808
6147
|
async function handlePrune(opts) {
|
|
5809
6148
|
const projectPath = path39.resolve(opts.path);
|
|
@@ -5845,23 +6184,23 @@ function printPatternProposals(patterns) {
|
|
|
5845
6184
|
);
|
|
5846
6185
|
}
|
|
5847
6186
|
function createPruneCommand() {
|
|
5848
|
-
return new
|
|
6187
|
+
return new Command48("prune").description(
|
|
5849
6188
|
"Analyze global learnings for patterns, present improvement proposals, and archive old entries"
|
|
5850
6189
|
).option("--path <path>", "Project root path", ".").option("--stream <name>", "Target a specific stream").action(handlePrune);
|
|
5851
6190
|
}
|
|
5852
6191
|
|
|
5853
6192
|
// src/commands/learnings/index.ts
|
|
5854
6193
|
function createLearningsCommand() {
|
|
5855
|
-
const command = new
|
|
6194
|
+
const command = new Command49("learnings").description("Learnings management commands");
|
|
5856
6195
|
command.addCommand(createPruneCommand());
|
|
5857
6196
|
return command;
|
|
5858
6197
|
}
|
|
5859
6198
|
|
|
5860
6199
|
// src/commands/linter/index.ts
|
|
5861
|
-
import { Command as
|
|
6200
|
+
import { Command as Command52 } from "commander";
|
|
5862
6201
|
|
|
5863
6202
|
// src/commands/linter/generate.ts
|
|
5864
|
-
import { Command as
|
|
6203
|
+
import { Command as Command50 } from "commander";
|
|
5865
6204
|
function formatGenerateError(e) {
|
|
5866
6205
|
switch (e.type) {
|
|
5867
6206
|
case "parse":
|
|
@@ -5905,7 +6244,7 @@ function handleSuccess(result, useJson) {
|
|
|
5905
6244
|
Generated ${result.rulesGenerated.length} rules to ${result.outputDir}`);
|
|
5906
6245
|
}
|
|
5907
6246
|
function createGenerateCommand2() {
|
|
5908
|
-
return new
|
|
6247
|
+
return new Command50("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) => {
|
|
5909
6248
|
try {
|
|
5910
6249
|
if (options.verbose) logger.info(`Parsing config: ${options.config}`);
|
|
5911
6250
|
const result = await generate({
|
|
@@ -5927,9 +6266,9 @@ function createGenerateCommand2() {
|
|
|
5927
6266
|
}
|
|
5928
6267
|
|
|
5929
6268
|
// src/commands/linter/validate.ts
|
|
5930
|
-
import { Command as
|
|
6269
|
+
import { Command as Command51 } from "commander";
|
|
5931
6270
|
function createValidateCommand() {
|
|
5932
|
-
return new
|
|
6271
|
+
return new Command51("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) => {
|
|
5933
6272
|
try {
|
|
5934
6273
|
const result = await validate({ configPath: options.config });
|
|
5935
6274
|
if (options.json) {
|
|
@@ -5948,7 +6287,7 @@ function createValidateCommand() {
|
|
|
5948
6287
|
|
|
5949
6288
|
// src/commands/linter/index.ts
|
|
5950
6289
|
function createLinterCommand() {
|
|
5951
|
-
const linter = new
|
|
6290
|
+
const linter = new Command52("linter").description(
|
|
5952
6291
|
"Generate and validate ESLint rules from YAML config"
|
|
5953
6292
|
);
|
|
5954
6293
|
linter.addCommand(createGenerateCommand2());
|
|
@@ -5957,7 +6296,7 @@ function createLinterCommand() {
|
|
|
5957
6296
|
}
|
|
5958
6297
|
|
|
5959
6298
|
// src/commands/mcp.ts
|
|
5960
|
-
import { Command as
|
|
6299
|
+
import { Command as Command53 } from "commander";
|
|
5961
6300
|
var VALID_TIERS = /* @__PURE__ */ new Set(["core", "standard", "full"]);
|
|
5962
6301
|
function parseTier(value) {
|
|
5963
6302
|
const lower = value.toLowerCase();
|
|
@@ -5974,7 +6313,7 @@ function parseBudget(value) {
|
|
|
5974
6313
|
return n;
|
|
5975
6314
|
}
|
|
5976
6315
|
function createMcpCommand() {
|
|
5977
|
-
return new
|
|
6316
|
+
return new Command53("mcp").description("Start the MCP (Model Context Protocol) server on stdio").option("--tools <tools...>", "Only register the specified tools (used by Cursor integration)").option(
|
|
5978
6317
|
"--tier <core|standard|full>",
|
|
5979
6318
|
"Load a preset tool tier instead of all tools",
|
|
5980
6319
|
parseTier
|
|
@@ -5984,8 +6323,8 @@ function createMcpCommand() {
|
|
|
5984
6323
|
parseBudget
|
|
5985
6324
|
).action(async (opts) => {
|
|
5986
6325
|
const [{ startServer: startServer2, getToolDefinitions: getToolDefinitions2 }, { selectTier }] = await Promise.all([
|
|
5987
|
-
import("./mcp-
|
|
5988
|
-
import("./tool-tiers-
|
|
6326
|
+
import("./mcp-QWSDEYMN.js"),
|
|
6327
|
+
import("./tool-tiers-LTQNNAFU.js")
|
|
5989
6328
|
]);
|
|
5990
6329
|
if (opts.tools && opts.tools.length > 0) {
|
|
5991
6330
|
await startServer2(opts.tools);
|
|
@@ -6005,9 +6344,9 @@ function createMcpCommand() {
|
|
|
6005
6344
|
}
|
|
6006
6345
|
|
|
6007
6346
|
// src/commands/migrate.ts
|
|
6347
|
+
init_dist3();
|
|
6008
6348
|
init_dist2();
|
|
6009
|
-
|
|
6010
|
-
import { Command as Command53 } from "commander";
|
|
6349
|
+
import { Command as Command54 } from "commander";
|
|
6011
6350
|
import * as fs24 from "fs";
|
|
6012
6351
|
import * as path40 from "path";
|
|
6013
6352
|
import * as readline from "readline";
|
|
@@ -6250,7 +6589,7 @@ function updateReferences(plan) {
|
|
|
6250
6589
|
}
|
|
6251
6590
|
async function prompt(question, def = "n") {
|
|
6252
6591
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
6253
|
-
const answer = await new Promise((
|
|
6592
|
+
const answer = await new Promise((resolve43) => rl.question(question, resolve43));
|
|
6254
6593
|
rl.close();
|
|
6255
6594
|
return (answer.trim() || def).toLowerCase();
|
|
6256
6595
|
}
|
|
@@ -6413,7 +6752,7 @@ async function runMigrate(opts) {
|
|
|
6413
6752
|
});
|
|
6414
6753
|
}
|
|
6415
6754
|
function createMigrateCommand() {
|
|
6416
|
-
return new
|
|
6755
|
+
return new Command54("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(
|
|
6417
6756
|
"--skip-references",
|
|
6418
6757
|
"Do not update path references in docs/sessions after moves",
|
|
6419
6758
|
false
|
|
@@ -6434,12 +6773,93 @@ function createMigrateCommand() {
|
|
|
6434
6773
|
});
|
|
6435
6774
|
}
|
|
6436
6775
|
|
|
6776
|
+
// src/commands/notifications/index.ts
|
|
6777
|
+
import { Command as Command56 } from "commander";
|
|
6778
|
+
|
|
6779
|
+
// src/commands/notifications/test.ts
|
|
6780
|
+
init_dist3();
|
|
6781
|
+
import { Command as Command55 } from "commander";
|
|
6782
|
+
import { randomBytes } from "crypto";
|
|
6783
|
+
import { resolve as resolve26 } from "path";
|
|
6784
|
+
import { SinkRegistry, SinkConfigError, wrapAsEnvelope } from "@harness-engineering/orchestrator";
|
|
6785
|
+
function makeTestEvent(message) {
|
|
6786
|
+
return {
|
|
6787
|
+
id: `evt_${randomBytes(8).toString("hex")}`,
|
|
6788
|
+
type: "notification.test",
|
|
6789
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6790
|
+
data: { message, triggeredAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
6791
|
+
};
|
|
6792
|
+
}
|
|
6793
|
+
async function runNotificationsTest(sinkId, opts, projectRoot = process.cwd()) {
|
|
6794
|
+
const cfgResult = loadNotificationsConfig(projectRoot);
|
|
6795
|
+
if (!cfgResult.ok) {
|
|
6796
|
+
return { ok: false, error: `Config error: ${cfgResult.error.message}` };
|
|
6797
|
+
}
|
|
6798
|
+
if (cfgResult.value.sinks.length === 0) {
|
|
6799
|
+
return {
|
|
6800
|
+
ok: false,
|
|
6801
|
+
error: "No notification sinks configured. Add a `notifications.sinks[]` entry to harness.config.json."
|
|
6802
|
+
};
|
|
6803
|
+
}
|
|
6804
|
+
let registry;
|
|
6805
|
+
try {
|
|
6806
|
+
registry = SinkRegistry.fromConfig(cfgResult.value, { env: process.env });
|
|
6807
|
+
} catch (err) {
|
|
6808
|
+
if (err instanceof SinkConfigError) {
|
|
6809
|
+
return { ok: false, error: err.message };
|
|
6810
|
+
}
|
|
6811
|
+
return { ok: false, error: err instanceof Error ? err.message : String(err) };
|
|
6812
|
+
}
|
|
6813
|
+
const entry = registry.get(sinkId);
|
|
6814
|
+
if (!entry) {
|
|
6815
|
+
const available = registry.ids().join(", ") || "(none)";
|
|
6816
|
+
return {
|
|
6817
|
+
ok: false,
|
|
6818
|
+
error: `No sink named '${sinkId}'. Available: ${available}`
|
|
6819
|
+
};
|
|
6820
|
+
}
|
|
6821
|
+
const message = opts.message ?? "Test notification from harness \u2014 if you see this, your sink is working.";
|
|
6822
|
+
const event = makeTestEvent(message);
|
|
6823
|
+
const wrap = entry.config.wrap_response;
|
|
6824
|
+
const payload = wrap ? wrapAsEnvelope(event) : event;
|
|
6825
|
+
const result = await entry.adapter.deliver({ payload, wrapped: wrap });
|
|
6826
|
+
await registry.dispose();
|
|
6827
|
+
if (result.ok) {
|
|
6828
|
+
return { ok: true, deliveredAt: result.deliveredAt };
|
|
6829
|
+
}
|
|
6830
|
+
return { ok: false, error: result.error };
|
|
6831
|
+
}
|
|
6832
|
+
function createNotificationsTestSubcommand() {
|
|
6833
|
+
return new Command55("test").description("Send a synthetic notification.test event through the named sink").argument("<sink-id>", "Sink id from harness.config.json `notifications.sinks[].id`").option("--message <text>", "Override the default test message").action(async (sinkId, opts, cmd) => {
|
|
6834
|
+
const globalOpts = cmd.optsWithGlobals();
|
|
6835
|
+
const projectRoot = typeof globalOpts["cwd"] === "string" ? resolve26(globalOpts["cwd"]) : process.cwd();
|
|
6836
|
+
const result = await runNotificationsTest(sinkId, opts, projectRoot);
|
|
6837
|
+
if (globalOpts["json"]) {
|
|
6838
|
+
console.log(JSON.stringify(result, null, 2));
|
|
6839
|
+
} else if (result.ok) {
|
|
6840
|
+
logger.success(`Delivered to sink '${sinkId}'`);
|
|
6841
|
+
} else {
|
|
6842
|
+
logger.error(result.error ?? "unknown error");
|
|
6843
|
+
}
|
|
6844
|
+
process.exit(result.ok ? ExitCode.SUCCESS : ExitCode.ERROR);
|
|
6845
|
+
});
|
|
6846
|
+
}
|
|
6847
|
+
|
|
6848
|
+
// src/commands/notifications/index.ts
|
|
6849
|
+
function createNotificationsCommand() {
|
|
6850
|
+
const cmd = new Command56("notifications").description(
|
|
6851
|
+
"Manage notification sinks (Slack and others)"
|
|
6852
|
+
);
|
|
6853
|
+
cmd.addCommand(createNotificationsTestSubcommand());
|
|
6854
|
+
return cmd;
|
|
6855
|
+
}
|
|
6856
|
+
|
|
6437
6857
|
// src/commands/orchestrator.ts
|
|
6438
|
-
import { Command as
|
|
6858
|
+
import { Command as Command57 } from "commander";
|
|
6439
6859
|
import * as path41 from "path";
|
|
6440
6860
|
import { Orchestrator, WorkflowLoader, launchTUI } from "@harness-engineering/orchestrator";
|
|
6441
6861
|
function createOrchestratorCommand() {
|
|
6442
|
-
const orchestrator = new
|
|
6862
|
+
const orchestrator = new Command57("orchestrator");
|
|
6443
6863
|
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) => {
|
|
6444
6864
|
const workflowPath = path41.resolve(process.cwd(), opts.workflow);
|
|
6445
6865
|
const loader = new WorkflowLoader();
|
|
@@ -6473,14 +6893,14 @@ function createOrchestratorCommand() {
|
|
|
6473
6893
|
}
|
|
6474
6894
|
|
|
6475
6895
|
// src/commands/perf.ts
|
|
6476
|
-
|
|
6477
|
-
import { Command as
|
|
6896
|
+
init_dist3();
|
|
6897
|
+
import { Command as Command58 } from "commander";
|
|
6478
6898
|
import * as path42 from "path";
|
|
6479
6899
|
function registerBenchCommand(perf) {
|
|
6480
6900
|
perf.command("bench [glob]").description("Run benchmarks via vitest bench").action(async (glob2, _opts, cmd) => {
|
|
6481
6901
|
const globalOpts = cmd.optsWithGlobals();
|
|
6482
6902
|
const cwd = process.cwd();
|
|
6483
|
-
const { BenchmarkRunner } = await import("./dist-
|
|
6903
|
+
const { BenchmarkRunner } = await import("./dist-TKHVYUWZ.js");
|
|
6484
6904
|
const runner = new BenchmarkRunner();
|
|
6485
6905
|
const benchFiles = runner.discover(cwd, glob2);
|
|
6486
6906
|
if (benchFiles.length === 0) {
|
|
@@ -6544,7 +6964,7 @@ async function runBaselinesShow(globalOpts) {
|
|
|
6544
6964
|
}
|
|
6545
6965
|
async function runBaselinesUpdate(globalOpts) {
|
|
6546
6966
|
const cwd = process.cwd();
|
|
6547
|
-
const { BenchmarkRunner } = await import("./dist-
|
|
6967
|
+
const { BenchmarkRunner } = await import("./dist-TKHVYUWZ.js");
|
|
6548
6968
|
const runner = new BenchmarkRunner();
|
|
6549
6969
|
const manager = new BaselineManager(cwd);
|
|
6550
6970
|
logger.info("Running benchmarks to update baselines...");
|
|
@@ -6585,7 +7005,7 @@ function registerReportCommand(perf) {
|
|
|
6585
7005
|
perf.command("report").description("Full performance report with metrics, trends, and hotspots").action(async (_opts, cmd) => {
|
|
6586
7006
|
const globalOpts = cmd.optsWithGlobals();
|
|
6587
7007
|
const cwd = process.cwd();
|
|
6588
|
-
const { EntropyAnalyzer: EntropyAnalyzer2 } = await import("./dist-
|
|
7008
|
+
const { EntropyAnalyzer: EntropyAnalyzer2 } = await import("./dist-TKHVYUWZ.js");
|
|
6589
7009
|
const analyzer = new EntropyAnalyzer2({
|
|
6590
7010
|
rootDir: path42.resolve(cwd),
|
|
6591
7011
|
analyze: { complexity: true, coupling: true }
|
|
@@ -6646,7 +7066,7 @@ function registerCriticalPathsCommand(perf) {
|
|
|
6646
7066
|
});
|
|
6647
7067
|
}
|
|
6648
7068
|
function createPerfCommand() {
|
|
6649
|
-
const perf = new
|
|
7069
|
+
const perf = new Command58("perf").description("Performance benchmark and baseline management");
|
|
6650
7070
|
registerBenchCommand(perf);
|
|
6651
7071
|
registerBaselinesCommands(perf);
|
|
6652
7072
|
registerReportCommand(perf);
|
|
@@ -6655,10 +7075,10 @@ function createPerfCommand() {
|
|
|
6655
7075
|
}
|
|
6656
7076
|
|
|
6657
7077
|
// src/commands/persona/index.ts
|
|
6658
|
-
import { Command as
|
|
7078
|
+
import { Command as Command61 } from "commander";
|
|
6659
7079
|
|
|
6660
7080
|
// src/commands/persona/list.ts
|
|
6661
|
-
import { Command as
|
|
7081
|
+
import { Command as Command59 } from "commander";
|
|
6662
7082
|
function printPersonaList(personas) {
|
|
6663
7083
|
if (personas.length === 0) {
|
|
6664
7084
|
logger.info("No personas found.");
|
|
@@ -6672,7 +7092,7 @@ function printPersonaList(personas) {
|
|
|
6672
7092
|
}
|
|
6673
7093
|
}
|
|
6674
7094
|
function createListCommand2() {
|
|
6675
|
-
return new
|
|
7095
|
+
return new Command59("list").description("List available agent personas").action(async (_opts, cmd) => {
|
|
6676
7096
|
const globalOpts = cmd.optsWithGlobals();
|
|
6677
7097
|
const personasDir = resolvePersonasDir();
|
|
6678
7098
|
const result = listPersonas(personasDir);
|
|
@@ -6692,7 +7112,7 @@ function createListCommand2() {
|
|
|
6692
7112
|
}
|
|
6693
7113
|
|
|
6694
7114
|
// src/commands/persona/generate.ts
|
|
6695
|
-
import { Command as
|
|
7115
|
+
import { Command as Command60 } from "commander";
|
|
6696
7116
|
import * as fs25 from "fs";
|
|
6697
7117
|
import * as path43 from "path";
|
|
6698
7118
|
function generatePersonaArtifacts(persona, outputDir, only) {
|
|
@@ -6727,7 +7147,7 @@ function generatePersonaArtifacts(persona, outputDir, only) {
|
|
|
6727
7147
|
return generated;
|
|
6728
7148
|
}
|
|
6729
7149
|
function createGenerateCommand3() {
|
|
6730
|
-
return new
|
|
7150
|
+
return new Command60("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) => {
|
|
6731
7151
|
const globalOpts = cmd.optsWithGlobals();
|
|
6732
7152
|
const personaResult = loadPersona(path43.join(resolvePersonasDir(), `${name}.yaml`));
|
|
6733
7153
|
if (!personaResult.ok) {
|
|
@@ -6749,15 +7169,15 @@ function createGenerateCommand3() {
|
|
|
6749
7169
|
|
|
6750
7170
|
// src/commands/persona/index.ts
|
|
6751
7171
|
function createPersonaCommand() {
|
|
6752
|
-
const command = new
|
|
7172
|
+
const command = new Command61("persona").description("Agent persona management commands");
|
|
6753
7173
|
command.addCommand(createListCommand2());
|
|
6754
7174
|
command.addCommand(createGenerateCommand3());
|
|
6755
7175
|
return command;
|
|
6756
7176
|
}
|
|
6757
7177
|
|
|
6758
7178
|
// src/commands/predict.ts
|
|
6759
|
-
|
|
6760
|
-
import { Command as
|
|
7179
|
+
init_dist3();
|
|
7180
|
+
import { Command as Command62 } from "commander";
|
|
6761
7181
|
import chalk8 from "chalk";
|
|
6762
7182
|
var CATEGORY_ORDER = [
|
|
6763
7183
|
"circular-deps",
|
|
@@ -6863,7 +7283,7 @@ function handlePredictError(err, mode) {
|
|
|
6863
7283
|
process.exit(ExitCode.ERROR);
|
|
6864
7284
|
}
|
|
6865
7285
|
function createPredictCommand() {
|
|
6866
|
-
const command = new
|
|
7286
|
+
const command = new Command62("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) => {
|
|
6867
7287
|
const globalOpts = cmd.optsWithGlobals();
|
|
6868
7288
|
const mode = globalOpts.json ? OutputMode.JSON : OutputMode.TEXT;
|
|
6869
7289
|
try {
|
|
@@ -6888,8 +7308,8 @@ function createPredictCommand() {
|
|
|
6888
7308
|
// src/commands/publish-analyses.ts
|
|
6889
7309
|
import * as fs26 from "fs";
|
|
6890
7310
|
import * as path44 from "path";
|
|
6891
|
-
import { Command as
|
|
6892
|
-
|
|
7311
|
+
import { Command as Command63 } from "commander";
|
|
7312
|
+
init_dist3();
|
|
6893
7313
|
import {
|
|
6894
7314
|
renderAnalysisComment,
|
|
6895
7315
|
loadPublishedIndex,
|
|
@@ -6950,7 +7370,7 @@ async function buildNameToExternalIdMap(projectPath) {
|
|
|
6950
7370
|
logger.error("No docs/roadmap.md found. Cannot map issue hashes to external IDs.");
|
|
6951
7371
|
return null;
|
|
6952
7372
|
}
|
|
6953
|
-
const { parseRoadmap: parseRoadmap2 } = (
|
|
7373
|
+
const { parseRoadmap: parseRoadmap2 } = (init_dist3(), __toCommonJS(dist_exports));
|
|
6954
7374
|
const roadmapParsed = parseRoadmap2(fs26.readFileSync(roadmapFile, "utf-8"));
|
|
6955
7375
|
if (!roadmapParsed.ok) {
|
|
6956
7376
|
logger.error("Failed to parse docs/roadmap.md");
|
|
@@ -7001,7 +7421,7 @@ async function runPublishAnalyses(opts) {
|
|
|
7001
7421
|
const nameToExternalId = await buildNameToExternalIdMap(projectPath);
|
|
7002
7422
|
if (!nameToExternalId) return process.exit(1);
|
|
7003
7423
|
const { AnalysisArchive } = await import("@harness-engineering/orchestrator");
|
|
7004
|
-
const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-
|
|
7424
|
+
const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-TKHVYUWZ.js");
|
|
7005
7425
|
const archive = new AnalysisArchive(path44.join(projectPath, ".harness", "analyses"));
|
|
7006
7426
|
const analyses = await archive.list();
|
|
7007
7427
|
if (analyses.length === 0) {
|
|
@@ -7024,7 +7444,7 @@ async function runPublishAnalyses(opts) {
|
|
|
7024
7444
|
}
|
|
7025
7445
|
}
|
|
7026
7446
|
function createPublishAnalysesCommand() {
|
|
7027
|
-
const command = new
|
|
7447
|
+
const command = new Command63("publish-analyses").description(
|
|
7028
7448
|
"Publishes locally generated intelligence analyses to the external issue tracker (e.g., GitHub)"
|
|
7029
7449
|
).option("-d, --dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
7030
7450
|
try {
|
|
@@ -7040,18 +7460,18 @@ function createPublishAnalysesCommand() {
|
|
|
7040
7460
|
}
|
|
7041
7461
|
|
|
7042
7462
|
// src/commands/pulse/index.ts
|
|
7043
|
-
import { Command as
|
|
7463
|
+
import { Command as Command65 } from "commander";
|
|
7044
7464
|
|
|
7045
7465
|
// src/commands/pulse/run.ts
|
|
7046
|
-
|
|
7047
|
-
import { readFileSync as
|
|
7048
|
-
import { dirname as dirname17, join as join35, resolve as
|
|
7049
|
-
import { Command as
|
|
7466
|
+
init_dist3();
|
|
7467
|
+
import { readFileSync as readFileSync16, mkdirSync as mkdirSync13, writeFileSync as writeFileSync14 } from "fs";
|
|
7468
|
+
import { dirname as dirname17, join as join35, resolve as resolve31 } from "path";
|
|
7469
|
+
import { Command as Command64 } from "commander";
|
|
7050
7470
|
async function runPulseRunCommand(opts) {
|
|
7051
7471
|
const startedAt = Date.now();
|
|
7052
7472
|
let raw;
|
|
7053
7473
|
try {
|
|
7054
|
-
raw = JSON.parse(
|
|
7474
|
+
raw = JSON.parse(readFileSync16(opts.configPath, "utf-8"));
|
|
7055
7475
|
} catch (err) {
|
|
7056
7476
|
return emit2(
|
|
7057
7477
|
{
|
|
@@ -7111,7 +7531,7 @@ function emit2(status, nonInteractive) {
|
|
|
7111
7531
|
return status;
|
|
7112
7532
|
}
|
|
7113
7533
|
function createRunCommand2() {
|
|
7114
|
-
return new
|
|
7534
|
+
return new Command64("run").description("Run a pulse: query configured adapters, sanitize, assemble single-page report").option(
|
|
7115
7535
|
"--lookback <window>",
|
|
7116
7536
|
"Lookback window (e.g. 24h, 7d). Defaults to pulse.lookbackDefault."
|
|
7117
7537
|
).option(
|
|
@@ -7121,8 +7541,8 @@ function createRunCommand2() {
|
|
|
7121
7541
|
async (options) => {
|
|
7122
7542
|
const nonInteractive = options.nonInteractive === true || !process.stdout.isTTY;
|
|
7123
7543
|
const status = await runPulseRunCommand({
|
|
7124
|
-
configPath:
|
|
7125
|
-
outputDir:
|
|
7544
|
+
configPath: resolve31(process.cwd(), options.config),
|
|
7545
|
+
outputDir: resolve31(process.cwd(), options.outputDir),
|
|
7126
7546
|
nonInteractive,
|
|
7127
7547
|
lookback: options.lookback
|
|
7128
7548
|
});
|
|
@@ -7135,13 +7555,13 @@ function createRunCommand2() {
|
|
|
7135
7555
|
|
|
7136
7556
|
// src/commands/pulse/index.ts
|
|
7137
7557
|
function createPulseCommand() {
|
|
7138
|
-
const command = new
|
|
7558
|
+
const command = new Command65("pulse").description("Pulse (read-side observability) commands");
|
|
7139
7559
|
command.addCommand(createRunCommand2());
|
|
7140
7560
|
return command;
|
|
7141
7561
|
}
|
|
7142
7562
|
|
|
7143
7563
|
// src/commands/recommend.ts
|
|
7144
|
-
import { Command as
|
|
7564
|
+
import { Command as Command66 } from "commander";
|
|
7145
7565
|
import chalk9 from "chalk";
|
|
7146
7566
|
async function resolveSnapshot(cwd, noCache) {
|
|
7147
7567
|
if (!noCache) {
|
|
@@ -7205,7 +7625,7 @@ function printRecommendations(result) {
|
|
|
7205
7625
|
console.log("");
|
|
7206
7626
|
}
|
|
7207
7627
|
function createRecommendCommand() {
|
|
7208
|
-
const command = new
|
|
7628
|
+
const command = new Command66("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) => {
|
|
7209
7629
|
const globalOpts = cmd.optsWithGlobals();
|
|
7210
7630
|
const mode = globalOpts.json ? OutputMode.JSON : OutputMode.TEXT;
|
|
7211
7631
|
try {
|
|
@@ -7241,11 +7661,11 @@ function createRecommendCommand() {
|
|
|
7241
7661
|
}
|
|
7242
7662
|
|
|
7243
7663
|
// src/commands/roadmap/index.ts
|
|
7244
|
-
import { Command as
|
|
7664
|
+
import { Command as Command68 } from "commander";
|
|
7245
7665
|
|
|
7246
7666
|
// src/commands/roadmap/migrate.ts
|
|
7247
|
-
|
|
7248
|
-
import { Command as
|
|
7667
|
+
init_dist3();
|
|
7668
|
+
import { Command as Command67 } from "commander";
|
|
7249
7669
|
import * as fs28 from "fs";
|
|
7250
7670
|
import * as path46 from "path";
|
|
7251
7671
|
import chalk10 from "chalk";
|
|
@@ -7515,7 +7935,7 @@ async function runRoadmapMigrate(opts) {
|
|
|
7515
7935
|
}
|
|
7516
7936
|
}
|
|
7517
7937
|
function createRoadmapMigrateCommand() {
|
|
7518
|
-
return new
|
|
7938
|
+
return new Command67("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(
|
|
7519
7939
|
"--format <fmt>",
|
|
7520
7940
|
'Output format: "human" (default) or "json" (single JSON object for CI consumers)',
|
|
7521
7941
|
"human"
|
|
@@ -7550,15 +7970,15 @@ function createRoadmapMigrateCommand() {
|
|
|
7550
7970
|
|
|
7551
7971
|
// src/commands/roadmap/index.ts
|
|
7552
7972
|
function createRoadmapCommand() {
|
|
7553
|
-
const roadmap = new
|
|
7973
|
+
const roadmap = new Command68("roadmap").description("Roadmap management");
|
|
7554
7974
|
roadmap.addCommand(createRoadmapMigrateCommand());
|
|
7555
7975
|
return roadmap;
|
|
7556
7976
|
}
|
|
7557
7977
|
|
|
7558
7978
|
// src/commands/scan-config.ts
|
|
7559
|
-
|
|
7560
|
-
import { Command as
|
|
7561
|
-
import { existsSync as existsSync25, readFileSync as
|
|
7979
|
+
init_dist3();
|
|
7980
|
+
import { Command as Command69 } from "commander";
|
|
7981
|
+
import { existsSync as existsSync25, readFileSync as readFileSync19, writeFileSync as writeFileSync17 } from "fs";
|
|
7562
7982
|
import { join as join38, relative as relative3 } from "path";
|
|
7563
7983
|
var CONFIG_FILES = ["CLAUDE.md", "AGENTS.md", ".gemini/settings.json", "skill.yaml"];
|
|
7564
7984
|
function stripHighSeverityPatterns(content, injectionFindings) {
|
|
@@ -7595,7 +8015,7 @@ function scanSingleFile(filePath, targetDir, scanner, options) {
|
|
|
7595
8015
|
if (!existsSync25(filePath)) return null;
|
|
7596
8016
|
let content;
|
|
7597
8017
|
try {
|
|
7598
|
-
content =
|
|
8018
|
+
content = readFileSync19(filePath, "utf8");
|
|
7599
8019
|
} catch {
|
|
7600
8020
|
return null;
|
|
7601
8021
|
}
|
|
@@ -7646,7 +8066,7 @@ function formatTextOutput(result) {
|
|
|
7646
8066
|
}
|
|
7647
8067
|
}
|
|
7648
8068
|
function createScanConfigCommand() {
|
|
7649
|
-
const command = new
|
|
8069
|
+
const command = new Command69("scan-config").description(
|
|
7650
8070
|
"Scan CLAUDE.md, AGENTS.md, .gemini/settings.json, and skill.yaml for prompt injection patterns"
|
|
7651
8071
|
).option("--path <dir>", "Target directory to scan (default: cwd)").option("--fix", "Strip high-severity patterns from files in-place").action(async (opts, cmd) => {
|
|
7652
8072
|
const globalOpts = cmd.optsWithGlobals();
|
|
@@ -7662,8 +8082,90 @@ function createScanConfigCommand() {
|
|
|
7662
8082
|
return command;
|
|
7663
8083
|
}
|
|
7664
8084
|
|
|
8085
|
+
// src/commands/search.ts
|
|
8086
|
+
init_dist();
|
|
8087
|
+
import { Command as Command70 } from "commander";
|
|
8088
|
+
function parseFileKinds(raw) {
|
|
8089
|
+
if (!raw) return void 0;
|
|
8090
|
+
const set = /* @__PURE__ */ new Set();
|
|
8091
|
+
for (const token of raw.split(",").map((t) => t.trim()).filter(Boolean)) {
|
|
8092
|
+
if (INDEXED_FILE_KINDS.includes(token)) {
|
|
8093
|
+
set.add(token);
|
|
8094
|
+
} else {
|
|
8095
|
+
throw new Error(
|
|
8096
|
+
`unknown --file-kinds value: ${token} (allowed: ${INDEXED_FILE_KINDS.join(", ")})`
|
|
8097
|
+
);
|
|
8098
|
+
}
|
|
8099
|
+
}
|
|
8100
|
+
return [...set];
|
|
8101
|
+
}
|
|
8102
|
+
function fmtBytes(n) {
|
|
8103
|
+
if (n < 1) return n.toFixed(2);
|
|
8104
|
+
if (n < 10) return n.toFixed(1);
|
|
8105
|
+
return n.toFixed(0);
|
|
8106
|
+
}
|
|
8107
|
+
function createSearchCommand() {
|
|
8108
|
+
return new Command70("search").description("Full-text search over archived + live session content (Hermes Phase 1).").argument(
|
|
8109
|
+
"<query>",
|
|
8110
|
+
"FTS5 query (bare words AND-joined; quotes/AND/OR/NOT/column: for advanced syntax)"
|
|
8111
|
+
).option("-n, --limit <n>", "Max results", "20").option("--archived-only", "Skip live sessions, only search archived ones").option("--json", "Emit JSON to stdout instead of pretty text").option(
|
|
8112
|
+
"--reindex",
|
|
8113
|
+
"Drop and rebuild the index from .harness/archive/sessions before searching"
|
|
8114
|
+
).option("--file-kinds <list>", `Comma-separated subset of {${INDEXED_FILE_KINDS.join(",")}}`).action(async (query, opts) => {
|
|
8115
|
+
const cwd = process.cwd();
|
|
8116
|
+
const limit = Math.max(parseInt(opts.limit ?? "20", 10) || 20, 1);
|
|
8117
|
+
let fileKinds;
|
|
8118
|
+
try {
|
|
8119
|
+
fileKinds = parseFileKinds(opts.fileKinds);
|
|
8120
|
+
} catch (e) {
|
|
8121
|
+
logger.error(e instanceof Error ? e.message : String(e));
|
|
8122
|
+
process.exit(2);
|
|
8123
|
+
return;
|
|
8124
|
+
}
|
|
8125
|
+
const orchestrator = await import("@harness-engineering/orchestrator");
|
|
8126
|
+
if (opts.reindex) {
|
|
8127
|
+
const stats = orchestrator.reindexFromArchive(cwd);
|
|
8128
|
+
if (!opts.json) {
|
|
8129
|
+
logger.info(
|
|
8130
|
+
`Reindexed ${stats.sessionsIndexed} sessions (${stats.docsWritten} docs, ${fmtBytes(stats.durationMs)} ms).`
|
|
8131
|
+
);
|
|
8132
|
+
}
|
|
8133
|
+
}
|
|
8134
|
+
const idx = orchestrator.openSearchIndex(cwd);
|
|
8135
|
+
try {
|
|
8136
|
+
const result = idx.search(query, {
|
|
8137
|
+
limit,
|
|
8138
|
+
...opts.archivedOnly && { archivedOnly: true },
|
|
8139
|
+
...fileKinds && { fileKinds }
|
|
8140
|
+
});
|
|
8141
|
+
if (opts.json) {
|
|
8142
|
+
console.log(JSON.stringify(result, null, 2));
|
|
8143
|
+
return;
|
|
8144
|
+
}
|
|
8145
|
+
if (result.matches.length === 0) {
|
|
8146
|
+
logger.info(
|
|
8147
|
+
`No matches for "${query}" (corpus: ${result.totalIndexed} docs, ${result.durationMs} ms).`
|
|
8148
|
+
);
|
|
8149
|
+
return;
|
|
8150
|
+
}
|
|
8151
|
+
logger.info(
|
|
8152
|
+
`Results for "${query}" (${result.matches.length} match${result.matches.length === 1 ? "" : "es"}, ${result.durationMs} ms, corpus ${result.totalIndexed} docs)
|
|
8153
|
+
`
|
|
8154
|
+
);
|
|
8155
|
+
result.matches.forEach((match, i) => {
|
|
8156
|
+
const tag = `${match.archived ? "archived" : "live"}, ${match.fileKind}`;
|
|
8157
|
+
const idxLabel = `${(i + 1).toString().padStart(2, " ")}.`;
|
|
8158
|
+
console.log(` ${idxLabel} ${match.sessionId} [${tag}]`);
|
|
8159
|
+
console.log(` ${match.snippet}`);
|
|
8160
|
+
});
|
|
8161
|
+
} finally {
|
|
8162
|
+
idx.close();
|
|
8163
|
+
}
|
|
8164
|
+
});
|
|
8165
|
+
}
|
|
8166
|
+
|
|
7665
8167
|
// src/commands/setup.ts
|
|
7666
|
-
import { Command as
|
|
8168
|
+
import { Command as Command71 } from "commander";
|
|
7667
8169
|
import * as fs31 from "fs";
|
|
7668
8170
|
import * as os8 from "os";
|
|
7669
8171
|
import * as path49 from "path";
|
|
@@ -7702,10 +8204,10 @@ function prompt2(question) {
|
|
|
7702
8204
|
input: process.stdin,
|
|
7703
8205
|
output: process.stdout
|
|
7704
8206
|
});
|
|
7705
|
-
return new Promise((
|
|
8207
|
+
return new Promise((resolve43) => {
|
|
7706
8208
|
rl.question(question, (answer) => {
|
|
7707
8209
|
rl.close();
|
|
7708
|
-
|
|
8210
|
+
resolve43(answer.trim().toLowerCase());
|
|
7709
8211
|
});
|
|
7710
8212
|
});
|
|
7711
8213
|
}
|
|
@@ -7714,10 +8216,10 @@ function promptRaw(question) {
|
|
|
7714
8216
|
input: process.stdin,
|
|
7715
8217
|
output: process.stdout
|
|
7716
8218
|
});
|
|
7717
|
-
return new Promise((
|
|
8219
|
+
return new Promise((resolve43) => {
|
|
7718
8220
|
rl.question(question, (answer) => {
|
|
7719
8221
|
rl.close();
|
|
7720
|
-
|
|
8222
|
+
resolve43(answer.trim());
|
|
7721
8223
|
});
|
|
7722
8224
|
});
|
|
7723
8225
|
}
|
|
@@ -8008,7 +8510,7 @@ async function runSetup(cwd) {
|
|
|
8008
8510
|
return { steps, success };
|
|
8009
8511
|
}
|
|
8010
8512
|
function createSetupCommand() {
|
|
8011
|
-
return new
|
|
8513
|
+
return new Command71("setup").description("Configure harness environment: slash commands, MCP, and more").action(async () => {
|
|
8012
8514
|
const cwd = process.cwd();
|
|
8013
8515
|
console.log("");
|
|
8014
8516
|
console.log(` ${chalk12.bold("harness setup")}`);
|
|
@@ -8030,8 +8532,8 @@ function createSetupCommand() {
|
|
|
8030
8532
|
}
|
|
8031
8533
|
|
|
8032
8534
|
// src/commands/share.ts
|
|
8033
|
-
|
|
8034
|
-
import { Command as
|
|
8535
|
+
init_dist3();
|
|
8536
|
+
import { Command as Command72 } from "commander";
|
|
8035
8537
|
import * as fs32 from "fs";
|
|
8036
8538
|
import * as path50 from "path";
|
|
8037
8539
|
import { parse as parseYaml } from "yaml";
|
|
@@ -8090,16 +8592,16 @@ Create a constraints.yaml in your project root to define what to share.`
|
|
|
8090
8592
|
logger.success(`Bundle written to ${outputPath}`);
|
|
8091
8593
|
}
|
|
8092
8594
|
function createShareCommand() {
|
|
8093
|
-
return new
|
|
8595
|
+
return new Command72("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) => {
|
|
8094
8596
|
await runShareAction(projectPath, options);
|
|
8095
8597
|
});
|
|
8096
8598
|
}
|
|
8097
8599
|
|
|
8098
8600
|
// src/commands/skill/index.ts
|
|
8099
|
-
import { Command as
|
|
8601
|
+
import { Command as Command80 } from "commander";
|
|
8100
8602
|
|
|
8101
8603
|
// src/commands/skill/list.ts
|
|
8102
|
-
import { Command as
|
|
8604
|
+
import { Command as Command73 } from "commander";
|
|
8103
8605
|
import * as fs33 from "fs";
|
|
8104
8606
|
import * as path51 from "path";
|
|
8105
8607
|
import { parse } from "yaml";
|
|
@@ -8202,7 +8704,7 @@ function printSkillsVerbose(skills) {
|
|
|
8202
8704
|
for (const s of skills) printSkillEntry(s);
|
|
8203
8705
|
}
|
|
8204
8706
|
function createListCommand3() {
|
|
8205
|
-
return new
|
|
8707
|
+
return new Command73("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) => {
|
|
8206
8708
|
const globalOpts = cmd.optsWithGlobals();
|
|
8207
8709
|
const skills = collectSkills({ filter: resolveFilter(opts) });
|
|
8208
8710
|
if (globalOpts.json) {
|
|
@@ -8217,7 +8719,7 @@ function createListCommand3() {
|
|
|
8217
8719
|
}
|
|
8218
8720
|
|
|
8219
8721
|
// src/commands/skill/run.ts
|
|
8220
|
-
import { Command as
|
|
8722
|
+
import { Command as Command74 } from "commander";
|
|
8221
8723
|
import * as fs34 from "fs";
|
|
8222
8724
|
import * as path52 from "path";
|
|
8223
8725
|
import { parse as parse2 } from "yaml";
|
|
@@ -8429,11 +8931,11 @@ async function runSkill(name, opts) {
|
|
|
8429
8931
|
process.exit(ExitCode.SUCCESS);
|
|
8430
8932
|
}
|
|
8431
8933
|
function createRunCommand3() {
|
|
8432
|
-
return new
|
|
8934
|
+
return new Command74("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));
|
|
8433
8935
|
}
|
|
8434
8936
|
|
|
8435
8937
|
// src/commands/skill/validate.ts
|
|
8436
|
-
import { Command as
|
|
8938
|
+
import { Command as Command75 } from "commander";
|
|
8437
8939
|
import * as fs35 from "fs";
|
|
8438
8940
|
import * as path53 from "path";
|
|
8439
8941
|
import { parse as parse3 } from "yaml";
|
|
@@ -8497,7 +8999,7 @@ function validateSkillEntry(name, skillsDir, errors) {
|
|
|
8497
8999
|
}
|
|
8498
9000
|
}
|
|
8499
9001
|
function createValidateCommand2() {
|
|
8500
|
-
return new
|
|
9002
|
+
return new Command75("validate").description("Validate all skill.yaml files and SKILL.md structure").action(async (_opts, cmd) => {
|
|
8501
9003
|
const globalOpts = cmd.optsWithGlobals();
|
|
8502
9004
|
const skillsDir = resolveSkillsDir();
|
|
8503
9005
|
if (!fs35.existsSync(skillsDir)) {
|
|
@@ -8527,7 +9029,7 @@ function createValidateCommand2() {
|
|
|
8527
9029
|
}
|
|
8528
9030
|
|
|
8529
9031
|
// src/commands/skill/info.ts
|
|
8530
|
-
import { Command as
|
|
9032
|
+
import { Command as Command76 } from "commander";
|
|
8531
9033
|
import * as fs36 from "fs";
|
|
8532
9034
|
import * as path54 from "path";
|
|
8533
9035
|
import { parse as parse4 } from "yaml";
|
|
@@ -8573,7 +9075,7 @@ function printSkillInfo(skill) {
|
|
|
8573
9075
|
console.log(`Persistent: ${skill.state.persistent}`);
|
|
8574
9076
|
}
|
|
8575
9077
|
function createInfoCommand() {
|
|
8576
|
-
return new
|
|
9078
|
+
return new Command76("info").description("Show metadata for a skill").argument("<name>", "Skill name (e.g., harness-tdd)").action(async (name, _opts, cmd) => {
|
|
8577
9079
|
const globalOpts = cmd.optsWithGlobals();
|
|
8578
9080
|
const loaded = loadSkillMetadata2(name);
|
|
8579
9081
|
if (!loaded.ok) {
|
|
@@ -8590,7 +9092,7 @@ function createInfoCommand() {
|
|
|
8590
9092
|
}
|
|
8591
9093
|
|
|
8592
9094
|
// src/commands/skill/search.ts
|
|
8593
|
-
import { Command as
|
|
9095
|
+
import { Command as Command77 } from "commander";
|
|
8594
9096
|
async function runSearch(query, opts) {
|
|
8595
9097
|
const results = await searchNpmRegistry(query, opts.registry);
|
|
8596
9098
|
return results.filter((r) => {
|
|
@@ -8634,14 +9136,14 @@ async function runSearchAction(query, opts, globalOpts) {
|
|
|
8634
9136
|
process.exit(ExitCode.VALIDATION_FAILED);
|
|
8635
9137
|
}
|
|
8636
9138
|
}
|
|
8637
|
-
function
|
|
8638
|
-
return new
|
|
9139
|
+
function createSearchCommand2() {
|
|
9140
|
+
return new Command77("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) => {
|
|
8639
9141
|
await runSearchAction(query, opts, cmd.optsWithGlobals());
|
|
8640
9142
|
});
|
|
8641
9143
|
}
|
|
8642
9144
|
|
|
8643
9145
|
// src/commands/skill/create.ts
|
|
8644
|
-
import { Command as
|
|
9146
|
+
import { Command as Command78 } from "commander";
|
|
8645
9147
|
import * as path55 from "path";
|
|
8646
9148
|
import * as fs37 from "fs";
|
|
8647
9149
|
import YAML from "yaml";
|
|
@@ -8761,7 +9263,7 @@ Next steps:`);
|
|
|
8761
9263
|
logger.info(` 3. Run: harness skills publish`);
|
|
8762
9264
|
}
|
|
8763
9265
|
function createCreateCommand() {
|
|
8764
|
-
return new
|
|
9266
|
+
return new Command78("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) => {
|
|
8765
9267
|
const globalOpts = cmd.optsWithGlobals();
|
|
8766
9268
|
try {
|
|
8767
9269
|
const result = runCreate(name, {
|
|
@@ -8784,7 +9286,7 @@ function createCreateCommand() {
|
|
|
8784
9286
|
}
|
|
8785
9287
|
|
|
8786
9288
|
// src/commands/skill/publish.ts
|
|
8787
|
-
import { Command as
|
|
9289
|
+
import { Command as Command79 } from "commander";
|
|
8788
9290
|
import * as fs39 from "fs";
|
|
8789
9291
|
import * as path57 from "path";
|
|
8790
9292
|
import { execFileSync as execFileSync6 } from "child_process";
|
|
@@ -8953,7 +9455,7 @@ ${skillMdContent}`;
|
|
|
8953
9455
|
};
|
|
8954
9456
|
}
|
|
8955
9457
|
function createPublishCommand() {
|
|
8956
|
-
return new
|
|
9458
|
+
return new Command79("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) => {
|
|
8957
9459
|
const globalOpts = cmd.optsWithGlobals();
|
|
8958
9460
|
const skillDir = opts.dir || process.cwd();
|
|
8959
9461
|
try {
|
|
@@ -8978,20 +9480,20 @@ function createPublishCommand() {
|
|
|
8978
9480
|
|
|
8979
9481
|
// src/commands/skill/index.ts
|
|
8980
9482
|
function createSkillCommand() {
|
|
8981
|
-
const command = new
|
|
9483
|
+
const command = new Command80("skill").description("Skill management commands");
|
|
8982
9484
|
command.addCommand(createListCommand3());
|
|
8983
9485
|
command.addCommand(createRunCommand3());
|
|
8984
9486
|
command.addCommand(createValidateCommand2());
|
|
8985
9487
|
command.addCommand(createInfoCommand());
|
|
8986
|
-
command.addCommand(
|
|
9488
|
+
command.addCommand(createSearchCommand2());
|
|
8987
9489
|
command.addCommand(createCreateCommand());
|
|
8988
9490
|
command.addCommand(createPublishCommand());
|
|
8989
9491
|
return command;
|
|
8990
9492
|
}
|
|
8991
9493
|
|
|
8992
9494
|
// src/commands/snapshot.ts
|
|
8993
|
-
|
|
8994
|
-
import { Command as
|
|
9495
|
+
init_dist3();
|
|
9496
|
+
import { Command as Command81 } from "commander";
|
|
8995
9497
|
import { execSync as execSync5 } from "child_process";
|
|
8996
9498
|
import chalk13 from "chalk";
|
|
8997
9499
|
function getCommitHash3(cwd) {
|
|
@@ -9173,7 +9675,7 @@ function registerListCommand(parent) {
|
|
|
9173
9675
|
});
|
|
9174
9676
|
}
|
|
9175
9677
|
function createSnapshotCommand() {
|
|
9176
|
-
const command = new
|
|
9678
|
+
const command = new Command81("snapshot").description("Architecture timeline snapshot commands");
|
|
9177
9679
|
registerCaptureCommand(command);
|
|
9178
9680
|
registerTrendsCommand(command);
|
|
9179
9681
|
registerListCommand(command);
|
|
@@ -9181,11 +9683,11 @@ function createSnapshotCommand() {
|
|
|
9181
9683
|
}
|
|
9182
9684
|
|
|
9183
9685
|
// src/commands/state/index.ts
|
|
9184
|
-
import { Command as
|
|
9686
|
+
import { Command as Command86 } from "commander";
|
|
9185
9687
|
|
|
9186
9688
|
// src/commands/state/show.ts
|
|
9187
|
-
|
|
9188
|
-
import { Command as
|
|
9689
|
+
init_dist3();
|
|
9690
|
+
import { Command as Command82 } from "commander";
|
|
9189
9691
|
import * as path58 from "path";
|
|
9190
9692
|
function printStateText(state, stream) {
|
|
9191
9693
|
if (stream) console.log(`Stream: ${stream}`);
|
|
@@ -9210,7 +9712,7 @@ function printStateProgress(progress) {
|
|
|
9210
9712
|
}
|
|
9211
9713
|
}
|
|
9212
9714
|
function createShowCommand() {
|
|
9213
|
-
return new
|
|
9715
|
+
return new Command82("show").description("Show current project state").option("--path <path>", "Project root path", ".").option("--stream <name>", "Target a specific stream").action(async (opts, cmd) => {
|
|
9214
9716
|
const globalOpts = cmd.optsWithGlobals();
|
|
9215
9717
|
const result = await loadState(path58.resolve(opts.path), opts.stream);
|
|
9216
9718
|
if (!result.ok) {
|
|
@@ -9227,8 +9729,8 @@ function createShowCommand() {
|
|
|
9227
9729
|
}
|
|
9228
9730
|
|
|
9229
9731
|
// src/commands/state/reset.ts
|
|
9230
|
-
|
|
9231
|
-
import { Command as
|
|
9732
|
+
init_dist3();
|
|
9733
|
+
import { Command as Command83 } from "commander";
|
|
9232
9734
|
import * as fs40 from "fs";
|
|
9233
9735
|
import * as path59 from "path";
|
|
9234
9736
|
import * as readline3 from "readline";
|
|
@@ -9245,8 +9747,8 @@ async function resolveStatePath(projectPath, stream) {
|
|
|
9245
9747
|
}
|
|
9246
9748
|
async function confirmReset() {
|
|
9247
9749
|
const rl = readline3.createInterface({ input: process.stdin, output: process.stdout });
|
|
9248
|
-
const answer = await new Promise((
|
|
9249
|
-
rl.question("Reset project state? This cannot be undone. [y/N] ",
|
|
9750
|
+
const answer = await new Promise((resolve43) => {
|
|
9751
|
+
rl.question("Reset project state? This cannot be undone. [y/N] ", resolve43);
|
|
9250
9752
|
});
|
|
9251
9753
|
rl.close();
|
|
9252
9754
|
return answer.toLowerCase() === "y" || answer.toLowerCase() === "yes";
|
|
@@ -9272,15 +9774,15 @@ async function runReset(opts) {
|
|
|
9272
9774
|
process.exit(ExitCode.SUCCESS);
|
|
9273
9775
|
}
|
|
9274
9776
|
function createResetCommand() {
|
|
9275
|
-
return new
|
|
9777
|
+
return new Command83("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));
|
|
9276
9778
|
}
|
|
9277
9779
|
|
|
9278
9780
|
// src/commands/state/learn.ts
|
|
9279
|
-
|
|
9280
|
-
import { Command as
|
|
9781
|
+
init_dist3();
|
|
9782
|
+
import { Command as Command84 } from "commander";
|
|
9281
9783
|
import * as path60 from "path";
|
|
9282
9784
|
function createLearnCommand() {
|
|
9283
|
-
return new
|
|
9785
|
+
return new Command84("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) => {
|
|
9284
9786
|
const projectPath = path60.resolve(opts.path);
|
|
9285
9787
|
const result = await appendLearning(projectPath, message, void 0, void 0, opts.stream);
|
|
9286
9788
|
if (!result.ok) {
|
|
@@ -9294,8 +9796,8 @@ function createLearnCommand() {
|
|
|
9294
9796
|
}
|
|
9295
9797
|
|
|
9296
9798
|
// src/commands/state/streams.ts
|
|
9297
|
-
|
|
9298
|
-
import { Command as
|
|
9799
|
+
init_dist3();
|
|
9800
|
+
import { Command as Command85 } from "commander";
|
|
9299
9801
|
import * as path61 from "path";
|
|
9300
9802
|
async function runListStreams(opts, globalOpts) {
|
|
9301
9803
|
const projectPath = path61.resolve(opts.path);
|
|
@@ -9346,7 +9848,7 @@ async function runActivateStream(name, opts) {
|
|
|
9346
9848
|
process.exit(ExitCode.SUCCESS);
|
|
9347
9849
|
}
|
|
9348
9850
|
function createStreamsCommand() {
|
|
9349
|
-
const command = new
|
|
9851
|
+
const command = new Command85("streams").description("Manage state streams");
|
|
9350
9852
|
command.command("list").description("List all known streams").option("--path <path>", "Project root path", ".").action(async (opts, cmd) => runListStreams(opts, cmd.optsWithGlobals()));
|
|
9351
9853
|
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));
|
|
9352
9854
|
command.command("archive <name>").description("Archive a stream").option("--path <path>", "Project root path", ".").action(async (name, opts) => runArchiveStream(name, opts));
|
|
@@ -9356,7 +9858,7 @@ function createStreamsCommand() {
|
|
|
9356
9858
|
|
|
9357
9859
|
// src/commands/state/index.ts
|
|
9358
9860
|
function createStateCommand() {
|
|
9359
|
-
const command = new
|
|
9861
|
+
const command = new Command86("state").description("Project state management commands");
|
|
9360
9862
|
command.addCommand(createShowCommand());
|
|
9361
9863
|
command.addCommand(createResetCommand());
|
|
9362
9864
|
command.addCommand(createLearnCommand());
|
|
@@ -9367,8 +9869,8 @@ function createStateCommand() {
|
|
|
9367
9869
|
// src/commands/sync-analyses.ts
|
|
9368
9870
|
import * as fs41 from "fs";
|
|
9369
9871
|
import * as path62 from "path";
|
|
9370
|
-
import { Command as
|
|
9371
|
-
|
|
9872
|
+
import { Command as Command87 } from "commander";
|
|
9873
|
+
init_dist3();
|
|
9372
9874
|
function isValidRecord(record) {
|
|
9373
9875
|
return typeof record.issueId === "string" && !!record.issueId && typeof record.identifier === "string" && !!record.identifier && typeof record.analyzedAt === "string" && !/[/\\]/.test(record.issueId);
|
|
9374
9876
|
}
|
|
@@ -9441,7 +9943,7 @@ async function loadRoadmapFeatures(projectPath) {
|
|
|
9441
9943
|
logger.error("No docs/roadmap.md found. Cannot discover features with externalIds.");
|
|
9442
9944
|
return null;
|
|
9443
9945
|
}
|
|
9444
|
-
const { parseRoadmap: parseRoadmap2 } = (
|
|
9946
|
+
const { parseRoadmap: parseRoadmap2 } = (init_dist3(), __toCommonJS(dist_exports));
|
|
9445
9947
|
const roadmapParsed = parseRoadmap2(fs41.readFileSync(roadmapFile, "utf-8"));
|
|
9446
9948
|
if (!roadmapParsed.ok) {
|
|
9447
9949
|
logger.error("Failed to parse docs/roadmap.md");
|
|
@@ -9493,7 +9995,7 @@ async function runSyncAnalyses(opts) {
|
|
|
9493
9995
|
return;
|
|
9494
9996
|
}
|
|
9495
9997
|
const { AnalysisArchive, loadPublishedIndex: loadPublishedIndex2, savePublishedIndex: savePublishedIndex2 } = await import("@harness-engineering/orchestrator");
|
|
9496
|
-
const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-
|
|
9998
|
+
const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-TKHVYUWZ.js");
|
|
9497
9999
|
const adapter = new GitHubIssuesSyncAdapter2({ token, config: trackerConfig });
|
|
9498
10000
|
const archive = new AnalysisArchive(path62.join(projectPath, ".harness", "analyses"));
|
|
9499
10001
|
const publishedIndex = loadPublishedIndex2(projectPath);
|
|
@@ -9515,7 +10017,7 @@ async function runSyncAnalyses(opts) {
|
|
|
9515
10017
|
}
|
|
9516
10018
|
}
|
|
9517
10019
|
function createSyncAnalysesCommand() {
|
|
9518
|
-
const command = new
|
|
10020
|
+
const command = new Command87("sync-analyses").description(
|
|
9519
10021
|
"Pull published intelligence analyses from the external issue tracker into the local .harness/analyses/ directory"
|
|
9520
10022
|
).option("-d, --dir <path>", "Workspace directory", process.cwd()).action(async (opts) => {
|
|
9521
10023
|
try {
|
|
@@ -9529,7 +10031,7 @@ function createSyncAnalysesCommand() {
|
|
|
9529
10031
|
}
|
|
9530
10032
|
|
|
9531
10033
|
// src/commands/sync-main.ts
|
|
9532
|
-
import { Command as
|
|
10034
|
+
import { Command as Command88 } from "commander";
|
|
9533
10035
|
import * as path63 from "path";
|
|
9534
10036
|
import {
|
|
9535
10037
|
syncMain as defaultSyncMain
|
|
@@ -9560,7 +10062,7 @@ function formatHuman(r) {
|
|
|
9560
10062
|
}
|
|
9561
10063
|
}
|
|
9562
10064
|
function createSyncMainCommand() {
|
|
9563
|
-
return new
|
|
10065
|
+
return new Command88("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) => {
|
|
9564
10066
|
const cwd = path63.resolve(opts.path ?? ".");
|
|
9565
10067
|
const exitCode = await runSyncMain({ cwd, json: Boolean(opts.json) });
|
|
9566
10068
|
process.exit(exitCode);
|
|
@@ -9568,8 +10070,8 @@ function createSyncMainCommand() {
|
|
|
9568
10070
|
}
|
|
9569
10071
|
|
|
9570
10072
|
// src/commands/taint.ts
|
|
9571
|
-
|
|
9572
|
-
import { Command as
|
|
10073
|
+
init_dist3();
|
|
10074
|
+
import { Command as Command89 } from "commander";
|
|
9573
10075
|
function getProjectRoot() {
|
|
9574
10076
|
return process.cwd();
|
|
9575
10077
|
}
|
|
@@ -9641,18 +10143,18 @@ function registerStatusCommand(taint) {
|
|
|
9641
10143
|
});
|
|
9642
10144
|
}
|
|
9643
10145
|
function createTaintCommand() {
|
|
9644
|
-
const taint = new
|
|
10146
|
+
const taint = new Command89("taint").description("Manage sentinel session taint state");
|
|
9645
10147
|
registerClearCommand(taint);
|
|
9646
10148
|
registerStatusCommand(taint);
|
|
9647
10149
|
return taint;
|
|
9648
10150
|
}
|
|
9649
10151
|
|
|
9650
10152
|
// src/commands/telemetry/index.ts
|
|
9651
|
-
import { Command as
|
|
10153
|
+
import { Command as Command93 } from "commander";
|
|
9652
10154
|
|
|
9653
10155
|
// src/commands/telemetry/identify.ts
|
|
9654
|
-
|
|
9655
|
-
import { Command as
|
|
10156
|
+
init_dist3();
|
|
10157
|
+
import { Command as Command90 } from "commander";
|
|
9656
10158
|
import * as fs42 from "fs";
|
|
9657
10159
|
import * as path64 from "path";
|
|
9658
10160
|
function telemetryFilePath(cwd) {
|
|
@@ -9676,7 +10178,7 @@ function printIdentity(identity) {
|
|
|
9676
10178
|
}
|
|
9677
10179
|
}
|
|
9678
10180
|
function createIdentifyCommand() {
|
|
9679
|
-
const cmd = new
|
|
10181
|
+
const cmd = new Command90("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) => {
|
|
9680
10182
|
const cwd = process.cwd();
|
|
9681
10183
|
if (opts.clear) {
|
|
9682
10184
|
writeTelemetryFile(cwd, { identity: {} });
|
|
@@ -9700,8 +10202,8 @@ function createIdentifyCommand() {
|
|
|
9700
10202
|
}
|
|
9701
10203
|
|
|
9702
10204
|
// src/commands/telemetry/status.ts
|
|
9703
|
-
|
|
9704
|
-
import { Command as
|
|
10205
|
+
init_dist3();
|
|
10206
|
+
import { Command as Command91 } from "commander";
|
|
9705
10207
|
function gatherEnvOverrides() {
|
|
9706
10208
|
const overrides = {};
|
|
9707
10209
|
if (process.env.DO_NOT_TRACK) overrides.DO_NOT_TRACK = process.env.DO_NOT_TRACK;
|
|
@@ -9743,7 +10245,7 @@ function printHumanStatus(result) {
|
|
|
9743
10245
|
printEnvOverrides(result.envOverrides);
|
|
9744
10246
|
}
|
|
9745
10247
|
function createStatusCommand() {
|
|
9746
|
-
const cmd = new
|
|
10248
|
+
const cmd = new Command91("status").description("Show current telemetry consent state, install ID, and identity").option("--json", "Output as JSON").action((opts) => {
|
|
9747
10249
|
const cwd = process.cwd();
|
|
9748
10250
|
const envOverrides = gatherEnvOverrides();
|
|
9749
10251
|
const consent = resolveConsent(cwd, void 0);
|
|
@@ -9775,21 +10277,21 @@ function createStatusCommand() {
|
|
|
9775
10277
|
}
|
|
9776
10278
|
|
|
9777
10279
|
// src/commands/telemetry/test.ts
|
|
9778
|
-
|
|
9779
|
-
import { Command as
|
|
10280
|
+
init_dist3();
|
|
10281
|
+
import { Command as Command92 } from "commander";
|
|
9780
10282
|
|
|
9781
10283
|
// src/bin/command-telemetry.ts
|
|
9782
|
-
import { existsSync as existsSync39, readFileSync as
|
|
9783
|
-
import { join as join53, parse as parsePath, resolve as
|
|
10284
|
+
import { existsSync as existsSync39, readFileSync as readFileSync30, mkdirSync as mkdirSync19, appendFileSync, writeFileSync as writeFileSync23 } from "fs";
|
|
10285
|
+
import { join as join53, parse as parsePath, resolve as resolve40 } from "path";
|
|
9784
10286
|
import { spawn as spawn2 } from "child_process";
|
|
9785
10287
|
var POSTHOG_API_KEY = "phc_wNTdCMcfJXZPgdNeDociZW6vwoGGo4nb7vqEfWThFfsG";
|
|
9786
10288
|
var EXCLUDED_COMMANDS = /* @__PURE__ */ new Set(["help", "completion"]);
|
|
9787
10289
|
function findProjectRoot(cwd) {
|
|
9788
|
-
let dir =
|
|
10290
|
+
let dir = resolve40(cwd);
|
|
9789
10291
|
const { root } = parsePath(dir);
|
|
9790
10292
|
while (dir !== root) {
|
|
9791
10293
|
if (existsSync39(join53(dir, "harness.config.json"))) return dir;
|
|
9792
|
-
dir =
|
|
10294
|
+
dir = resolve40(dir, "..");
|
|
9793
10295
|
}
|
|
9794
10296
|
return cwd;
|
|
9795
10297
|
}
|
|
@@ -9845,7 +10347,7 @@ function isTelemetryDisabledByConfig(cwd) {
|
|
|
9845
10347
|
const configPath = join53(cwd, "harness.config.json");
|
|
9846
10348
|
if (!existsSync39(configPath)) return false;
|
|
9847
10349
|
try {
|
|
9848
|
-
const config = JSON.parse(
|
|
10350
|
+
const config = JSON.parse(readFileSync30(configPath, "utf-8"));
|
|
9849
10351
|
return config?.telemetry?.enabled === false;
|
|
9850
10352
|
} catch {
|
|
9851
10353
|
return false;
|
|
@@ -9898,7 +10400,7 @@ function reportTestSuccess(status, distinctId, identity) {
|
|
|
9898
10400
|
if (identity.team) logger.info(` team: ${identity.team}`);
|
|
9899
10401
|
}
|
|
9900
10402
|
function createTestCommand() {
|
|
9901
|
-
return new
|
|
10403
|
+
return new Command92("test").description("Send a test event to PostHog and verify connectivity").action(async () => {
|
|
9902
10404
|
const cwd = process.cwd();
|
|
9903
10405
|
const consent = resolveConsent(cwd, void 0);
|
|
9904
10406
|
if (!consent.allowed) {
|
|
@@ -9935,7 +10437,7 @@ function createTestCommand() {
|
|
|
9935
10437
|
|
|
9936
10438
|
// src/commands/telemetry/index.ts
|
|
9937
10439
|
function createTelemetryCommand() {
|
|
9938
|
-
const command = new
|
|
10440
|
+
const command = new Command93("telemetry").description("Telemetry identity and status management");
|
|
9939
10441
|
command.addCommand(createIdentifyCommand());
|
|
9940
10442
|
command.addCommand(createStatusCommand());
|
|
9941
10443
|
command.addCommand(createTestCommand());
|
|
@@ -9943,7 +10445,7 @@ function createTelemetryCommand() {
|
|
|
9943
10445
|
}
|
|
9944
10446
|
|
|
9945
10447
|
// src/commands/traceability.ts
|
|
9946
|
-
import { Command as
|
|
10448
|
+
import { Command as Command94 } from "commander";
|
|
9947
10449
|
import chalk14 from "chalk";
|
|
9948
10450
|
function confidenceLabel(maxConfidence) {
|
|
9949
10451
|
if (maxConfidence >= 0.8) return "explicit";
|
|
@@ -10079,7 +10581,7 @@ async function runTraceability(options) {
|
|
|
10079
10581
|
process.exit(ExitCode.SUCCESS);
|
|
10080
10582
|
}
|
|
10081
10583
|
function createTraceabilityCommand() {
|
|
10082
|
-
return new
|
|
10584
|
+
return new Command94("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) => {
|
|
10083
10585
|
const globalOpts = cmd.optsWithGlobals();
|
|
10084
10586
|
await runTraceability({
|
|
10085
10587
|
spec: opts.spec,
|
|
@@ -10093,7 +10595,7 @@ function createTraceabilityCommand() {
|
|
|
10093
10595
|
|
|
10094
10596
|
// src/commands/uninstall.ts
|
|
10095
10597
|
import * as path65 from "path";
|
|
10096
|
-
import { Command as
|
|
10598
|
+
import { Command as Command95 } from "commander";
|
|
10097
10599
|
async function runUninstall(skillName, options) {
|
|
10098
10600
|
const packageName = resolvePackageName(skillName);
|
|
10099
10601
|
const shortName = extractSkillName(packageName);
|
|
@@ -10130,7 +10632,7 @@ async function runUninstall(skillName, options) {
|
|
|
10130
10632
|
return result;
|
|
10131
10633
|
}
|
|
10132
10634
|
function createUninstallCommand() {
|
|
10133
|
-
const cmd = new
|
|
10635
|
+
const cmd = new Command95("uninstall");
|
|
10134
10636
|
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) => {
|
|
10135
10637
|
try {
|
|
10136
10638
|
const result = await runUninstall(skill, opts);
|
|
@@ -10149,10 +10651,10 @@ function createUninstallCommand() {
|
|
|
10149
10651
|
}
|
|
10150
10652
|
|
|
10151
10653
|
// src/commands/uninstall-constraints.ts
|
|
10152
|
-
|
|
10654
|
+
init_dist3();
|
|
10153
10655
|
import * as fs43 from "fs/promises";
|
|
10154
10656
|
import * as path66 from "path";
|
|
10155
|
-
import { Command as
|
|
10657
|
+
import { Command as Command96 } from "commander";
|
|
10156
10658
|
async function runUninstallConstraints(options) {
|
|
10157
10659
|
const { packageName, configPath, lockfilePath } = options;
|
|
10158
10660
|
const lockfileResult = await readLockfile(lockfilePath);
|
|
@@ -10209,7 +10711,7 @@ async function runUninstallConstraints(options) {
|
|
|
10209
10711
|
};
|
|
10210
10712
|
}
|
|
10211
10713
|
function createUninstallConstraintsCommand() {
|
|
10212
|
-
const cmd = new
|
|
10714
|
+
const cmd = new Command96("uninstall-constraints");
|
|
10213
10715
|
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) => {
|
|
10214
10716
|
let configPath;
|
|
10215
10717
|
if (opts.config) {
|
|
@@ -10248,10 +10750,10 @@ function createUninstallConstraintsCommand() {
|
|
|
10248
10750
|
}
|
|
10249
10751
|
|
|
10250
10752
|
// src/commands/update.ts
|
|
10251
|
-
|
|
10252
|
-
import { Command as
|
|
10753
|
+
init_dist3();
|
|
10754
|
+
import { Command as Command97 } from "commander";
|
|
10253
10755
|
import { execFile, execFileSync as execFileSync7 } from "child_process";
|
|
10254
|
-
import { realpathSync, existsSync as existsSync40, readFileSync as
|
|
10756
|
+
import { realpathSync, existsSync as existsSync40, readFileSync as readFileSync31 } from "fs";
|
|
10255
10757
|
import { dirname as dirname22, join as join56 } from "path";
|
|
10256
10758
|
import { promisify } from "util";
|
|
10257
10759
|
import readline4 from "readline";
|
|
@@ -10329,10 +10831,10 @@ function prompt3(question) {
|
|
|
10329
10831
|
input: process.stdin,
|
|
10330
10832
|
output: process.stdout
|
|
10331
10833
|
});
|
|
10332
|
-
return new Promise((
|
|
10834
|
+
return new Promise((resolve43) => {
|
|
10333
10835
|
rl.question(question, (answer) => {
|
|
10334
10836
|
rl.close();
|
|
10335
|
-
|
|
10837
|
+
resolve43(answer.trim().toLowerCase());
|
|
10336
10838
|
});
|
|
10337
10839
|
});
|
|
10338
10840
|
}
|
|
@@ -10341,7 +10843,7 @@ function findPackageDir(resolvedBin) {
|
|
|
10341
10843
|
for (let i = 0; i < 6; i++) {
|
|
10342
10844
|
if (existsSync40(join56(dir, "package.json"))) {
|
|
10343
10845
|
try {
|
|
10344
|
-
const pkg = JSON.parse(
|
|
10846
|
+
const pkg = JSON.parse(readFileSync31(join56(dir, "package.json"), "utf-8"));
|
|
10345
10847
|
if (pkg?.name === CLI_PACKAGE) return dir;
|
|
10346
10848
|
} catch {
|
|
10347
10849
|
}
|
|
@@ -10386,7 +10888,7 @@ function findAllInstalls() {
|
|
|
10386
10888
|
if (!packageDir) continue;
|
|
10387
10889
|
let version = null;
|
|
10388
10890
|
try {
|
|
10389
|
-
const pkg = JSON.parse(
|
|
10891
|
+
const pkg = JSON.parse(readFileSync31(join56(packageDir, "package.json"), "utf-8"));
|
|
10390
10892
|
if (typeof pkg?.version === "string") version = pkg.version;
|
|
10391
10893
|
} catch {
|
|
10392
10894
|
}
|
|
@@ -10484,7 +10986,7 @@ function refreshHooks() {
|
|
|
10484
10986
|
let profile = "standard";
|
|
10485
10987
|
const profilePath = join56(cwd, ".harness", "hooks", "profile.json");
|
|
10486
10988
|
try {
|
|
10487
|
-
const data = JSON.parse(
|
|
10989
|
+
const data = JSON.parse(readFileSync31(profilePath, "utf-8"));
|
|
10488
10990
|
if (data.profile && ["minimal", "standard", "strict"].includes(data.profile)) {
|
|
10489
10991
|
profile = data.profile;
|
|
10490
10992
|
}
|
|
@@ -10613,7 +11115,7 @@ async function runUpdateAction(opts, globalOpts) {
|
|
|
10613
11115
|
process.exit(ExitCode.SUCCESS);
|
|
10614
11116
|
}
|
|
10615
11117
|
function createUpdateCommand() {
|
|
10616
|
-
return new
|
|
11118
|
+
return new Command97("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(
|
|
10617
11119
|
"--regenerate",
|
|
10618
11120
|
"Only regenerate slash commands and agent definitions (skip package updates)"
|
|
10619
11121
|
).action(async (opts, cmd) => {
|
|
@@ -10623,9 +11125,9 @@ function createUpdateCommand() {
|
|
|
10623
11125
|
}
|
|
10624
11126
|
|
|
10625
11127
|
// src/commands/usage.ts
|
|
10626
|
-
import { Command as
|
|
11128
|
+
import { Command as Command98 } from "commander";
|
|
10627
11129
|
async function loadAndPriceRecords(cwd, includeClaudeSessions = false) {
|
|
10628
|
-
const { readCostRecords, loadPricingData, calculateCost, parseCCRecords } = await import("./dist-
|
|
11130
|
+
const { readCostRecords, loadPricingData, calculateCost, parseCCRecords } = await import("./dist-TKHVYUWZ.js");
|
|
10629
11131
|
const records = readCostRecords(cwd);
|
|
10630
11132
|
if (includeClaudeSessions) {
|
|
10631
11133
|
const ccRecords = parseCCRecords();
|
|
@@ -10718,7 +11220,7 @@ function registerDailyCommand(usage) {
|
|
|
10718
11220
|
else logger.info("No usage data found. Run some harness sessions first.");
|
|
10719
11221
|
return;
|
|
10720
11222
|
}
|
|
10721
|
-
const { aggregateByDay } = await import("./dist-
|
|
11223
|
+
const { aggregateByDay } = await import("./dist-TKHVYUWZ.js");
|
|
10722
11224
|
const limited = aggregateByDay(records).slice(0, days);
|
|
10723
11225
|
if (globalOpts.json) {
|
|
10724
11226
|
console.log(
|
|
@@ -10747,7 +11249,7 @@ function registerSessionsCommand(usage) {
|
|
|
10747
11249
|
}
|
|
10748
11250
|
return;
|
|
10749
11251
|
}
|
|
10750
|
-
const { aggregateBySession } = await import("./dist-
|
|
11252
|
+
const { aggregateBySession } = await import("./dist-TKHVYUWZ.js");
|
|
10751
11253
|
const sessionData = aggregateBySession(records);
|
|
10752
11254
|
const limited = sessionData.slice(0, limit);
|
|
10753
11255
|
if (globalOpts.json) {
|
|
@@ -10827,7 +11329,7 @@ function registerSessionCommand(usage) {
|
|
|
10827
11329
|
cwd,
|
|
10828
11330
|
globalOpts.includeClaudeSessions
|
|
10829
11331
|
);
|
|
10830
|
-
const { aggregateBySession } = await import("./dist-
|
|
11332
|
+
const { aggregateBySession } = await import("./dist-TKHVYUWZ.js");
|
|
10831
11333
|
const sessionData = aggregateBySession(records);
|
|
10832
11334
|
const match = sessionData.find((s) => s.sessionId === id);
|
|
10833
11335
|
if (!match) {
|
|
@@ -10862,7 +11364,7 @@ function registerLatestCommand(usage) {
|
|
|
10862
11364
|
}
|
|
10863
11365
|
return;
|
|
10864
11366
|
}
|
|
10865
|
-
const { aggregateBySession } = await import("./dist-
|
|
11367
|
+
const { aggregateBySession } = await import("./dist-TKHVYUWZ.js");
|
|
10866
11368
|
const sessionData = aggregateBySession(records);
|
|
10867
11369
|
const latest = sessionData[0];
|
|
10868
11370
|
if (!latest) {
|
|
@@ -10888,7 +11390,7 @@ function registerLatestCommand(usage) {
|
|
|
10888
11390
|
});
|
|
10889
11391
|
}
|
|
10890
11392
|
function createUsageCommand() {
|
|
10891
|
-
const usage = new
|
|
11393
|
+
const usage = new Command98("usage").description("Token usage and cost tracking");
|
|
10892
11394
|
usage.option(
|
|
10893
11395
|
"--include-claude-sessions",
|
|
10894
11396
|
"Include Claude Code session data from ~/.claude/projects/"
|
|
@@ -10901,9 +11403,9 @@ function createUsageCommand() {
|
|
|
10901
11403
|
}
|
|
10902
11404
|
|
|
10903
11405
|
// src/commands/validate.ts
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
import { Command as
|
|
11406
|
+
init_dist3();
|
|
11407
|
+
init_dist3();
|
|
11408
|
+
import { Command as Command99 } from "commander";
|
|
10907
11409
|
import * as path67 from "path";
|
|
10908
11410
|
async function runValidate(options) {
|
|
10909
11411
|
const configResult = resolveConfig(options.configPath);
|
|
@@ -11031,7 +11533,7 @@ function resolveValidateMode(globalOpts) {
|
|
|
11031
11533
|
return OutputMode.TEXT;
|
|
11032
11534
|
}
|
|
11033
11535
|
async function printCrossCheckWarnings(mode) {
|
|
11034
|
-
const { runCrossCheck: runCrossCheck2 } = await import("./validate-cross-check-
|
|
11536
|
+
const { runCrossCheck: runCrossCheck2 } = await import("./validate-cross-check-7PO7CBVT.js");
|
|
11035
11537
|
const cwd = process.cwd();
|
|
11036
11538
|
const crossResult = await runCrossCheck2({
|
|
11037
11539
|
specsDir: path67.join(cwd, "docs", "specs"),
|
|
@@ -11047,7 +11549,7 @@ async function printCrossCheckWarnings(mode) {
|
|
|
11047
11549
|
${crossResult.value.warnings} warnings`);
|
|
11048
11550
|
}
|
|
11049
11551
|
function createValidateCommand3() {
|
|
11050
|
-
const command = new
|
|
11552
|
+
const command = new Command99("validate").description("Run all validation checks").option("--cross-check", "Run cross-artifact consistency validation").option(
|
|
11051
11553
|
"--agent-configs",
|
|
11052
11554
|
"Validate agent configs (CLAUDE.md, hooks, skills) via agnix or built-in fallback rules"
|
|
11053
11555
|
).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()));
|
|
@@ -11095,8 +11597,8 @@ Agent configs checked via ${engineLabel}${note}`);
|
|
|
11095
11597
|
}
|
|
11096
11598
|
|
|
11097
11599
|
// src/commands/verify.ts
|
|
11098
|
-
|
|
11099
|
-
import { Command as
|
|
11600
|
+
init_dist3();
|
|
11601
|
+
import { Command as Command100 } from "commander";
|
|
11100
11602
|
import { execSync as execSync6 } from "child_process";
|
|
11101
11603
|
function loadBranchingConfig(configPath) {
|
|
11102
11604
|
const shouldLoad = configPath !== void 0 || findConfigFile().ok;
|
|
@@ -11159,7 +11661,7 @@ async function runVerify(options) {
|
|
|
11159
11661
|
process.exit(ExitCode.VALIDATION_FAILED);
|
|
11160
11662
|
}
|
|
11161
11663
|
function createVerifyCommand() {
|
|
11162
|
-
return new
|
|
11664
|
+
return new Command100("verify").description(
|
|
11163
11665
|
"Verify project conventions (currently: branch naming). Works with or without a harness.config.json."
|
|
11164
11666
|
).option(
|
|
11165
11667
|
"--branch <name>",
|
|
@@ -11205,6 +11707,7 @@ var commandCreators = [
|
|
|
11205
11707
|
createImpactPreviewCommand,
|
|
11206
11708
|
createIngestCommand,
|
|
11207
11709
|
createInitCommand3,
|
|
11710
|
+
createInsightsCommand,
|
|
11208
11711
|
createInstallCommand,
|
|
11209
11712
|
createInstallConstraintsCommand,
|
|
11210
11713
|
createIntegrationsCommand,
|
|
@@ -11213,6 +11716,7 @@ var commandCreators = [
|
|
|
11213
11716
|
createLinterCommand,
|
|
11214
11717
|
createMcpCommand,
|
|
11215
11718
|
createMigrateCommand,
|
|
11719
|
+
createNotificationsCommand,
|
|
11216
11720
|
createOrchestratorCommand,
|
|
11217
11721
|
createPerfCommand,
|
|
11218
11722
|
createPersonaCommand,
|
|
@@ -11224,6 +11728,7 @@ var commandCreators = [
|
|
|
11224
11728
|
createRoadmapCommand,
|
|
11225
11729
|
createScanCommand,
|
|
11226
11730
|
createScanConfigCommand,
|
|
11731
|
+
createSearchCommand,
|
|
11227
11732
|
createSetupCommand,
|
|
11228
11733
|
createSetupMcpCommand,
|
|
11229
11734
|
createShareCommand,
|
|
@@ -11245,7 +11750,7 @@ var commandCreators = [
|
|
|
11245
11750
|
|
|
11246
11751
|
// src/index.ts
|
|
11247
11752
|
function createProgram() {
|
|
11248
|
-
const program = new
|
|
11753
|
+
const program = new Command101();
|
|
11249
11754
|
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");
|
|
11250
11755
|
for (const creator of commandCreators) {
|
|
11251
11756
|
program.addCommand(creator());
|