@harness-engineering/cli 1.26.0 → 1.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/skills/README.md +1 -0
- package/dist/agents/skills/claude-code/harness-brainstorming/SKILL.md +33 -5
- package/dist/agents/skills/claude-code/harness-execution/SKILL.md +6 -0
- package/dist/agents/skills/claude-code/harness-planning/SKILL.md +25 -1
- package/dist/agents/skills/claude-code/initialize-harness-project/SKILL.md +22 -6
- package/dist/agents/skills/claude-code/initialize-harness-project/skill.yaml +2 -1
- package/dist/agents/skills/claude-code/initialize-test-suite-project/SKILL.md +415 -0
- package/dist/agents/skills/claude-code/initialize-test-suite-project/skill.yaml +35 -0
- package/dist/agents/skills/codex/harness-brainstorming/SKILL.md +33 -5
- package/dist/agents/skills/codex/harness-execution/SKILL.md +6 -0
- package/dist/agents/skills/codex/harness-planning/SKILL.md +25 -1
- package/dist/agents/skills/codex/initialize-harness-project/SKILL.md +22 -6
- package/dist/agents/skills/codex/initialize-harness-project/skill.yaml +2 -1
- package/dist/agents/skills/codex/initialize-test-suite-project/SKILL.md +415 -0
- package/dist/agents/skills/codex/initialize-test-suite-project/skill.yaml +35 -0
- package/dist/agents/skills/cursor/harness-brainstorming/SKILL.md +33 -5
- package/dist/agents/skills/cursor/harness-execution/SKILL.md +6 -0
- package/dist/agents/skills/cursor/harness-planning/SKILL.md +25 -1
- package/dist/agents/skills/cursor/initialize-harness-project/SKILL.md +22 -6
- package/dist/agents/skills/cursor/initialize-harness-project/skill.yaml +2 -1
- package/dist/agents/skills/cursor/initialize-test-suite-project/SKILL.md +415 -0
- package/dist/agents/skills/cursor/initialize-test-suite-project/skill.yaml +35 -0
- package/dist/agents/skills/gemini-cli/harness-brainstorming/SKILL.md +33 -5
- package/dist/agents/skills/gemini-cli/harness-execution/SKILL.md +6 -0
- package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +25 -1
- package/dist/agents/skills/gemini-cli/initialize-harness-project/SKILL.md +22 -6
- package/dist/agents/skills/gemini-cli/initialize-harness-project/skill.yaml +2 -1
- package/dist/agents/skills/gemini-cli/initialize-test-suite-project/SKILL.md +415 -0
- package/dist/agents/skills/gemini-cli/initialize-test-suite-project/skill.yaml +35 -0
- package/dist/agents/skills/tests/initialize-test-suite-project.test.ts +152 -0
- package/dist/{agents-md-OPOZA5L7.js → agents-md-VI3HLR7E.js} +3 -3
- package/dist/{architecture-PMVMO6SF.js → architecture-ZDDKEVID.js} +4 -4
- package/dist/{assess-project-ZW7EKNIT.js → assess-project-Y6W7YDUA.js} +1 -1
- package/dist/bin/harness-mcp.js +16 -15
- package/dist/bin/harness.js +27 -27
- package/dist/{check-phase-gate-NTLAU3LO.js → check-phase-gate-CXR3VM22.js} +4 -4
- package/dist/{chunk-CAS3TS4Y.js → chunk-2BPPS6YQ.js} +793 -94
- package/dist/{chunk-VV2PJT4K.js → chunk-2FPUPRCY.js} +777 -598
- package/dist/{chunk-IFHAUFJX.js → chunk-3AMQYWGT.js} +2 -2
- package/dist/{chunk-FI3D6D7U.js → chunk-56A6OXVA.js} +9 -9
- package/dist/{chunk-QYSWNPXZ.js → chunk-7GY6WNEI.js} +1 -1
- package/dist/{chunk-ZBQ3ZY75.js → chunk-AMRC4FU2.js} +44 -41
- package/dist/{chunk-JZ6GORAK.js → chunk-B66LRB5M.js} +1 -1
- package/dist/{chunk-KFE2X7LG.js → chunk-BK4DJIIY.js} +4 -4
- package/dist/{chunk-G6SYTGOH.js → chunk-DBIX3X4H.js} +2 -2
- package/dist/{chunk-KXIAHHHP.js → chunk-FUND5WJR.js} +2 -2
- package/dist/{chunk-JWSVLC4I.js → chunk-JV4Y2U5F.js} +1 -1
- package/dist/{chunk-RNAGPTKF.js → chunk-K56DTX7G.js} +6 -6
- package/dist/{chunk-EXTWTJRF.js → chunk-N6B6RKQQ.js} +1 -1
- package/dist/{chunk-JBJ4AVE4.js → chunk-NY7DTZ6K.js} +3 -3
- package/dist/{chunk-Z2JORLRT.js → chunk-OLW7BJ5N.js} +1 -1
- package/dist/{chunk-HAOBHL3W.js → chunk-ORNEK65Y.js} +1 -1
- package/dist/{chunk-7JNZXJKY.js → chunk-PNNFCVW4.js} +5 -5
- package/dist/{chunk-NIOB6FTG.js → chunk-Q3ZLVMQM.js} +1 -1
- package/dist/{chunk-NVGQO4VM.js → chunk-RAVD7QLY.js} +8 -8
- package/dist/{chunk-J3O64D2A.js → chunk-TSVYBDDE.js} +1 -1
- package/dist/{chunk-KSFUJT5B.js → chunk-TY2ESLVL.js} +1 -1
- package/dist/{chunk-4KSKV5MK.js → chunk-VKS3F46M.js} +1 -1
- package/dist/{chunk-UBRD5FH4.js → chunk-WZ7UHPT3.js} +9 -9
- package/dist/{chunk-77EZGPSR.js → chunk-YC4EYIER.js} +8 -2
- package/dist/{chunk-6SCA4NEZ.js → chunk-ZN6ROTYP.js} +1 -1
- package/dist/{ci-workflow-H52EMCL6.js → ci-workflow-EW37KVPS.js} +3 -3
- package/dist/{create-skill-6QWJHQYS.js → create-skill-4T5CBSJ2.js} +2 -2
- package/dist/{dist-TG63OKA5.js → dist-CJDGASPP.js} +2 -2
- package/dist/{dist-PGQ32ZI7.js → dist-NCNAXUFD.js} +1 -1
- package/dist/{docs-GP4VUSIB.js → docs-4XI2FQW2.js} +4 -4
- package/dist/{engine-KQG5RVXX.js → engine-4L4CDTHU.js} +3 -3
- package/dist/{entropy-RXESIYKC.js → entropy-PBYSIQYS.js} +3 -3
- package/dist/{feedback-HS7ZYXOU.js → feedback-OTIFW5MK.js} +1 -1
- package/dist/{generate-agent-definitions-I4B7CVOB.js → generate-agent-definitions-CZGUXIIN.js} +4 -4
- package/dist/{graph-loader-TIVI6NQ7.js → graph-loader-RDXSEBD7.js} +1 -1
- package/dist/index.js +27 -27
- package/dist/{loader-CWAH6B4H.js → loader-UZOXCWFC.js} +3 -3
- package/dist/{mcp-KHK5KYER.js → mcp-GWVVV6LH.js} +16 -15
- package/dist/{performance-WDW5WS3J.js → performance-5UQPP3XX.js} +4 -4
- package/dist/{review-pipeline-QOZGWCTY.js → review-pipeline-65V4EO6O.js} +3 -3
- package/dist/{runtime-SFEFRPLX.js → runtime-PXX7HNB3.js} +3 -3
- package/dist/{scan-IJ7EYTF7.js → scan-WM7XDUF7.js} +1 -1
- package/dist/{security-2K7UUK6T.js → security-CAYDRZIZ.js} +1 -1
- package/dist/{validate-HXM6DXRZ.js → validate-CWGXR7QM.js} +4 -4
- package/dist/{validate-cross-check-ULQLEOME.js → validate-cross-check-BKCNLZYG.js} +3 -3
- package/package.json +4 -4
- package/dist/agents/commands/claude-code/harness/harness.md +0 -36
- package/dist/agents/commands/codex/AGENTS.md +0 -39
- package/dist/agents/commands/codex/harness/add-harness-component/SKILL.md +0 -204
- package/dist/agents/commands/codex/harness/add-harness-component/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/cleanup-dead-code/SKILL.md +0 -257
- package/dist/agents/commands/codex/harness/cleanup-dead-code/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/detect-doc-drift/SKILL.md +0 -191
- package/dist/agents/commands/codex/harness/detect-doc-drift/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/enforce-architecture/SKILL.md +0 -289
- package/dist/agents/commands/codex/harness/enforce-architecture/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-architecture-advisor/SKILL.md +0 -442
- package/dist/agents/commands/codex/harness/harness-architecture-advisor/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-autopilot/SKILL.md +0 -929
- package/dist/agents/commands/codex/harness/harness-autopilot/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-brainstorming/SKILL.md +0 -418
- package/dist/agents/commands/codex/harness/harness-brainstorming/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-code-review/SKILL.md +0 -850
- package/dist/agents/commands/codex/harness/harness-code-review/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-codebase-cleanup/SKILL.md +0 -236
- package/dist/agents/commands/codex/harness/harness-codebase-cleanup/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-debugging/SKILL.md +0 -378
- package/dist/agents/commands/codex/harness/harness-debugging/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-dependency-health/SKILL.md +0 -190
- package/dist/agents/commands/codex/harness/harness-dependency-health/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-docs-pipeline/SKILL.md +0 -472
- package/dist/agents/commands/codex/harness/harness-docs-pipeline/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-execution/SKILL.md +0 -522
- package/dist/agents/commands/codex/harness/harness-execution/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-hotspot-detector/SKILL.md +0 -172
- package/dist/agents/commands/codex/harness/harness-hotspot-detector/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-impact-analysis/SKILL.md +0 -195
- package/dist/agents/commands/codex/harness/harness-impact-analysis/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-integrity/SKILL.md +0 -178
- package/dist/agents/commands/codex/harness/harness-integrity/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-onboarding/SKILL.md +0 -299
- package/dist/agents/commands/codex/harness/harness-onboarding/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-perf/SKILL.md +0 -272
- package/dist/agents/commands/codex/harness/harness-perf/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-planning/SKILL.md +0 -592
- package/dist/agents/commands/codex/harness/harness-planning/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-refactoring/SKILL.md +0 -181
- package/dist/agents/commands/codex/harness/harness-refactoring/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-release-readiness/SKILL.md +0 -701
- package/dist/agents/commands/codex/harness/harness-release-readiness/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-roadmap/SKILL.md +0 -607
- package/dist/agents/commands/codex/harness/harness-roadmap/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-security-scan/SKILL.md +0 -147
- package/dist/agents/commands/codex/harness/harness-security-scan/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-skill-authoring/SKILL.md +0 -314
- package/dist/agents/commands/codex/harness/harness-skill-authoring/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-soundness-review/SKILL.md +0 -1280
- package/dist/agents/commands/codex/harness/harness-soundness-review/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-supply-chain-audit/SKILL.md +0 -255
- package/dist/agents/commands/codex/harness/harness-supply-chain-audit/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-tdd/SKILL.md +0 -189
- package/dist/agents/commands/codex/harness/harness-tdd/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-test-advisor/SKILL.md +0 -171
- package/dist/agents/commands/codex/harness/harness-test-advisor/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-verification/SKILL.md +0 -433
- package/dist/agents/commands/codex/harness/harness-verification/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-verify/SKILL.md +0 -170
- package/dist/agents/commands/codex/harness/harness-verify/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/initialize-harness-project/SKILL.md +0 -244
- package/dist/agents/commands/codex/harness/initialize-harness-project/agents/openai.yaml +0 -3
- package/dist/agents/commands/cursor/harness/add-harness-component.mdc +0 -200
- package/dist/agents/commands/cursor/harness/cleanup-dead-code.mdc +0 -253
- package/dist/agents/commands/cursor/harness/detect-doc-drift.mdc +0 -187
- package/dist/agents/commands/cursor/harness/enforce-architecture.mdc +0 -304
- package/dist/agents/commands/cursor/harness/harness-architecture-advisor.mdc +0 -457
- package/dist/agents/commands/cursor/harness/harness-autopilot.mdc +0 -924
- package/dist/agents/commands/cursor/harness/harness-brainstorming.mdc +0 -414
- package/dist/agents/commands/cursor/harness/harness-code-review.mdc +0 -865
- package/dist/agents/commands/cursor/harness/harness-codebase-cleanup.mdc +0 -232
- package/dist/agents/commands/cursor/harness/harness-debugging.mdc +0 -374
- package/dist/agents/commands/cursor/harness/harness-dependency-health.mdc +0 -187
- package/dist/agents/commands/cursor/harness/harness-docs-pipeline.mdc +0 -468
- package/dist/agents/commands/cursor/harness/harness-execution.mdc +0 -518
- package/dist/agents/commands/cursor/harness/harness-hotspot-detector.mdc +0 -169
- package/dist/agents/commands/cursor/harness/harness-impact-analysis.mdc +0 -192
- package/dist/agents/commands/cursor/harness/harness-integrity.mdc +0 -175
- package/dist/agents/commands/cursor/harness/harness-onboarding.mdc +0 -296
- package/dist/agents/commands/cursor/harness/harness-perf.mdc +0 -268
- package/dist/agents/commands/cursor/harness/harness-planning.mdc +0 -587
- package/dist/agents/commands/cursor/harness/harness-refactoring.mdc +0 -177
- package/dist/agents/commands/cursor/harness/harness-release-readiness.mdc +0 -697
- package/dist/agents/commands/cursor/harness/harness-roadmap.mdc +0 -603
- package/dist/agents/commands/cursor/harness/harness-security-scan.mdc +0 -162
- package/dist/agents/commands/cursor/harness/harness-skill-authoring.mdc +0 -300
- package/dist/agents/commands/cursor/harness/harness-soundness-review.mdc +0 -1275
- package/dist/agents/commands/cursor/harness/harness-supply-chain-audit.mdc +0 -252
- package/dist/agents/commands/cursor/harness/harness-tdd.mdc +0 -185
- package/dist/agents/commands/cursor/harness/harness-test-advisor.mdc +0 -168
- package/dist/agents/commands/cursor/harness/harness-verification.mdc +0 -429
- package/dist/agents/commands/cursor/harness/harness-verify.mdc +0 -167
- package/dist/agents/commands/cursor/harness/initialize-harness-project.mdc +0 -240
- package/dist/agents/commands/gemini-cli/harness/harness.toml +0 -277
- package/dist/{chunk-RRHUCDRD.js → chunk-ZP5E7YET.js} +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assessProjectDefinition,
|
|
3
3
|
handleAssessProject
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-K56DTX7G.js";
|
|
5
5
|
import {
|
|
6
6
|
getBusinessKnowledgeResource
|
|
7
7
|
} from "./chunk-RC5ZY3EV.js";
|
|
@@ -12,37 +12,37 @@ import {
|
|
|
12
12
|
handleCreateSelfReview,
|
|
13
13
|
handleRequestPeerReview,
|
|
14
14
|
requestPeerReviewDefinition
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WZ7UHPT3.js";
|
|
16
16
|
import {
|
|
17
17
|
getSecurityTrendsDefinition,
|
|
18
18
|
handleGetSecurityTrends,
|
|
19
19
|
handleRunSecurityScan,
|
|
20
20
|
runSecurityScanDefinition
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-3AMQYWGT.js";
|
|
22
22
|
import {
|
|
23
23
|
handleRunCodeReview,
|
|
24
24
|
runCodeReviewDefinition,
|
|
25
25
|
sortFindingsBySeverity
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DBIX3X4H.js";
|
|
27
27
|
import {
|
|
28
28
|
handleValidateProject,
|
|
29
29
|
validateToolDefinition
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-NY7DTZ6K.js";
|
|
31
31
|
import {
|
|
32
32
|
checkDependenciesDefinition,
|
|
33
33
|
handleCheckDependencies
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-BK4DJIIY.js";
|
|
35
35
|
import {
|
|
36
36
|
resolveProjectConfig
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-TSVYBDDE.js";
|
|
38
38
|
import {
|
|
39
39
|
checkDocsDefinition,
|
|
40
40
|
handleCheckDocs
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-56A6OXVA.js";
|
|
42
42
|
import {
|
|
43
43
|
detectEntropyDefinition,
|
|
44
44
|
handleDetectEntropy
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-PNNFCVW4.js";
|
|
46
46
|
import {
|
|
47
47
|
checkPerformanceDefinition,
|
|
48
48
|
getCriticalPathsDefinition,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
handleGetPerfBaselines,
|
|
53
53
|
handleUpdatePerfBaselines,
|
|
54
54
|
updatePerfBaselinesDefinition
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-RAVD7QLY.js";
|
|
56
56
|
import {
|
|
57
57
|
resultToMcpResponse
|
|
58
58
|
} from "./chunk-EPUKTTJZ.js";
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
} from "./chunk-W6Y7ZW3Y.js";
|
|
62
62
|
import {
|
|
63
63
|
resolveConfig
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-VKS3F46M.js";
|
|
65
65
|
import {
|
|
66
66
|
GENERATED_HEADER_CLAUDE,
|
|
67
67
|
GENERATED_HEADER_CODEX,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
} from "./chunk-6B6UN6SG.js";
|
|
84
84
|
import {
|
|
85
85
|
loadGraphStore
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-OLW7BJ5N.js";
|
|
87
87
|
import {
|
|
88
88
|
CompactionPipeline,
|
|
89
89
|
DEFAULT_TOKEN_BUDGET,
|
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
scanForInjection,
|
|
102
102
|
serializeEnvelope,
|
|
103
103
|
writeTaint
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-YC4EYIER.js";
|
|
105
105
|
import {
|
|
106
106
|
Err,
|
|
107
107
|
Ok
|
|
@@ -109,6 +109,9 @@ import {
|
|
|
109
109
|
import {
|
|
110
110
|
SkillMetadataSchema
|
|
111
111
|
} from "./chunk-HIK6OEUF.js";
|
|
112
|
+
import {
|
|
113
|
+
logger
|
|
114
|
+
} from "./chunk-EBJQ6N4M.js";
|
|
112
115
|
import {
|
|
113
116
|
CLIError,
|
|
114
117
|
ExitCode,
|
|
@@ -701,7 +704,7 @@ ${skippedMsg}`
|
|
|
701
704
|
async function handleInitProject(input) {
|
|
702
705
|
const i = input;
|
|
703
706
|
try {
|
|
704
|
-
const { TemplateEngine } = await import("./engine-
|
|
707
|
+
const { TemplateEngine } = await import("./engine-4L4CDTHU.js");
|
|
705
708
|
const engine = new TemplateEngine(resolveTemplatesDir());
|
|
706
709
|
const safePath = sanitizePath(i.path);
|
|
707
710
|
const detected = tryDetectFramework(engine, safePath, i);
|
|
@@ -723,7 +726,7 @@ var listPersonasDefinition = {
|
|
|
723
726
|
inputSchema: { type: "object", properties: {} }
|
|
724
727
|
};
|
|
725
728
|
async function handleListPersonas() {
|
|
726
|
-
const { listPersonas } = await import("./loader-
|
|
729
|
+
const { listPersonas } = await import("./loader-UZOXCWFC.js");
|
|
727
730
|
const result = listPersonas(resolvePersonasDir());
|
|
728
731
|
return resultToMcpResponse(result);
|
|
729
732
|
}
|
|
@@ -747,10 +750,10 @@ async function handleGeneratePersonaArtifacts(input) {
|
|
|
747
750
|
if (!/^[a-z0-9][a-z0-9._-]*$/i.test(input.name)) {
|
|
748
751
|
return resultToMcpResponse(Err(new Error(`Invalid persona name: ${input.name}`)));
|
|
749
752
|
}
|
|
750
|
-
const { loadPersona } = await import("./loader-
|
|
751
|
-
const { generateRuntime } = await import("./runtime-
|
|
752
|
-
const { generateAgentsMd } = await import("./agents-md-
|
|
753
|
-
const { generateCIWorkflow } = await import("./ci-workflow-
|
|
753
|
+
const { loadPersona } = await import("./loader-UZOXCWFC.js");
|
|
754
|
+
const { generateRuntime } = await import("./runtime-PXX7HNB3.js");
|
|
755
|
+
const { generateAgentsMd } = await import("./agents-md-VI3HLR7E.js");
|
|
756
|
+
const { generateCIWorkflow } = await import("./ci-workflow-EW37KVPS.js");
|
|
754
757
|
const personasDir = resolvePersonasDir();
|
|
755
758
|
const filePath = path3.join(personasDir, `${input.name}.yaml`);
|
|
756
759
|
if (!filePath.startsWith(personasDir)) {
|
|
@@ -805,7 +808,7 @@ async function handleRunPersona(input) {
|
|
|
805
808
|
if (!/^[a-z0-9][a-z0-9._-]*$/i.test(input.persona)) {
|
|
806
809
|
return resultToMcpResponse(Err(new Error(`Invalid persona name: ${input.persona}`)));
|
|
807
810
|
}
|
|
808
|
-
const { loadPersona } = await import("./loader-
|
|
811
|
+
const { loadPersona } = await import("./loader-UZOXCWFC.js");
|
|
809
812
|
const { runPersona } = await import("./runner-AAEF2TXY.js");
|
|
810
813
|
const { executeSkill } = await import("./skill-executor-MOCUIAYS.js");
|
|
811
814
|
const personasDir = resolvePersonasDir();
|
|
@@ -1344,7 +1347,7 @@ function loadOrGenerateProfile(projectRoot) {
|
|
|
1344
1347
|
// src/mcp/tools/event-emitter.ts
|
|
1345
1348
|
async function emitSkillEvent(projectPath, event) {
|
|
1346
1349
|
try {
|
|
1347
|
-
const { emitEvent } = await import("./dist-
|
|
1350
|
+
const { emitEvent } = await import("./dist-CJDGASPP.js");
|
|
1348
1351
|
await emitEvent(projectPath, event);
|
|
1349
1352
|
} catch {
|
|
1350
1353
|
}
|
|
@@ -1494,7 +1497,7 @@ var createSkillDefinition = {
|
|
|
1494
1497
|
};
|
|
1495
1498
|
async function handleCreateSkill(input) {
|
|
1496
1499
|
try {
|
|
1497
|
-
const { generateSkillFiles } = await import("./create-skill-
|
|
1500
|
+
const { generateSkillFiles } = await import("./create-skill-4T5CBSJ2.js");
|
|
1498
1501
|
const result = generateSkillFiles({
|
|
1499
1502
|
name: input.name,
|
|
1500
1503
|
description: input.description,
|
|
@@ -1616,7 +1619,7 @@ async function autoSyncRoadmap(projectPath) {
|
|
|
1616
1619
|
try {
|
|
1617
1620
|
const roadmapFile = path11.join(projectPath, "docs", "roadmap.md");
|
|
1618
1621
|
if (!fs10.existsSync(roadmapFile)) return;
|
|
1619
|
-
const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges } = await import("./dist-
|
|
1622
|
+
const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges } = await import("./dist-CJDGASPP.js");
|
|
1620
1623
|
const raw = fs10.readFileSync(roadmapFile, "utf-8");
|
|
1621
1624
|
const parseResult = parseRoadmap(raw);
|
|
1622
1625
|
if (!parseResult.ok) return;
|
|
@@ -1646,7 +1649,7 @@ async function triggerExternalSync(projectPath, roadmapFile) {
|
|
|
1646
1649
|
console.warn("[roadmap-sync] GITHUB_TOKEN not found \u2014 external sync skipped");
|
|
1647
1650
|
return;
|
|
1648
1651
|
}
|
|
1649
|
-
const { fullSync, GitHubIssuesSyncAdapter } = await import("./dist-
|
|
1652
|
+
const { fullSync, GitHubIssuesSyncAdapter } = await import("./dist-CJDGASPP.js");
|
|
1650
1653
|
const adapter = new GitHubIssuesSyncAdapter({
|
|
1651
1654
|
token,
|
|
1652
1655
|
config: trackerConfig
|
|
@@ -1743,12 +1746,12 @@ var manageStateDefinition = {
|
|
|
1743
1746
|
}
|
|
1744
1747
|
};
|
|
1745
1748
|
async function handleShow(projectPath, input) {
|
|
1746
|
-
const { loadState } = await import("./dist-
|
|
1749
|
+
const { loadState } = await import("./dist-CJDGASPP.js");
|
|
1747
1750
|
return resultToMcpResponse(await loadState(projectPath, input.stream, input.session));
|
|
1748
1751
|
}
|
|
1749
1752
|
async function handleLearn(projectPath, input) {
|
|
1750
1753
|
if (!input.learning) return mcpError("Error: learning is required for learn action");
|
|
1751
|
-
const { appendLearning } = await import("./dist-
|
|
1754
|
+
const { appendLearning } = await import("./dist-CJDGASPP.js");
|
|
1752
1755
|
const result = await appendLearning(
|
|
1753
1756
|
projectPath,
|
|
1754
1757
|
input.learning,
|
|
@@ -1763,7 +1766,7 @@ async function handleLearn(projectPath, input) {
|
|
|
1763
1766
|
async function handleFailure(projectPath, input) {
|
|
1764
1767
|
if (!input.description) return mcpError("Error: description is required for failure action");
|
|
1765
1768
|
if (!input.failureType) return mcpError("Error: failureType is required for failure action");
|
|
1766
|
-
const { appendFailure } = await import("./dist-
|
|
1769
|
+
const { appendFailure } = await import("./dist-CJDGASPP.js");
|
|
1767
1770
|
const result = await appendFailure(
|
|
1768
1771
|
projectPath,
|
|
1769
1772
|
input.description,
|
|
@@ -1782,19 +1785,19 @@ async function handleFailure(projectPath, input) {
|
|
|
1782
1785
|
return resultToMcpResponse(Ok({ recorded: true }));
|
|
1783
1786
|
}
|
|
1784
1787
|
async function handleArchive(projectPath, input) {
|
|
1785
|
-
const { archiveFailures } = await import("./dist-
|
|
1788
|
+
const { archiveFailures } = await import("./dist-CJDGASPP.js");
|
|
1786
1789
|
const result = await archiveFailures(projectPath, input.stream, input.session);
|
|
1787
1790
|
if (!result.ok) return resultToMcpResponse(result);
|
|
1788
1791
|
return resultToMcpResponse(Ok({ archived: true }));
|
|
1789
1792
|
}
|
|
1790
1793
|
async function handleReset(projectPath, input) {
|
|
1791
|
-
const { saveState, DEFAULT_STATE } = await import("./dist-
|
|
1794
|
+
const { saveState, DEFAULT_STATE } = await import("./dist-CJDGASPP.js");
|
|
1792
1795
|
const result = await saveState(projectPath, { ...DEFAULT_STATE }, input.stream, input.session);
|
|
1793
1796
|
if (!result.ok) return resultToMcpResponse(result);
|
|
1794
1797
|
return resultToMcpResponse(Ok({ reset: true }));
|
|
1795
1798
|
}
|
|
1796
1799
|
async function handleGate(projectPath, input) {
|
|
1797
|
-
const { runMechanicalGate } = await import("./dist-
|
|
1800
|
+
const { runMechanicalGate } = await import("./dist-CJDGASPP.js");
|
|
1798
1801
|
const result = await runMechanicalGate(projectPath);
|
|
1799
1802
|
if (result.ok) {
|
|
1800
1803
|
await emitSkillEvent(projectPath, {
|
|
@@ -1814,7 +1817,7 @@ async function handleGate(projectPath, input) {
|
|
|
1814
1817
|
}
|
|
1815
1818
|
async function handleSaveHandoff(projectPath, input) {
|
|
1816
1819
|
if (!input.handoff) return mcpError("Error: handoff is required for save-handoff action");
|
|
1817
|
-
const { saveHandoff } = await import("./dist-
|
|
1820
|
+
const { saveHandoff } = await import("./dist-CJDGASPP.js");
|
|
1818
1821
|
const result = await saveHandoff(
|
|
1819
1822
|
projectPath,
|
|
1820
1823
|
input.handoff,
|
|
@@ -1836,7 +1839,7 @@ async function handleSaveHandoff(projectPath, input) {
|
|
|
1836
1839
|
return resultToMcpResponse(Ok({ saved: true }));
|
|
1837
1840
|
}
|
|
1838
1841
|
async function handleLoadHandoff(projectPath, input) {
|
|
1839
|
-
const { loadHandoff } = await import("./dist-
|
|
1842
|
+
const { loadHandoff } = await import("./dist-CJDGASPP.js");
|
|
1840
1843
|
return resultToMcpResponse(await loadHandoff(projectPath, input.stream, input.session));
|
|
1841
1844
|
}
|
|
1842
1845
|
async function handleAppendEntry(projectPath, input) {
|
|
@@ -1844,7 +1847,7 @@ async function handleAppendEntry(projectPath, input) {
|
|
|
1844
1847
|
if (!input.authorSkill) return mcpError("Error: authorSkill is required for append_entry action");
|
|
1845
1848
|
if (!input.content) return mcpError("Error: content is required for append_entry action");
|
|
1846
1849
|
if (input.session) {
|
|
1847
|
-
const { appendSessionEntry } = await import("./dist-
|
|
1850
|
+
const { appendSessionEntry } = await import("./dist-CJDGASPP.js");
|
|
1848
1851
|
const result = await appendSessionEntry(
|
|
1849
1852
|
projectPath,
|
|
1850
1853
|
input.session,
|
|
@@ -1857,7 +1860,7 @@ async function handleAppendEntry(projectPath, input) {
|
|
|
1857
1860
|
if (input.section !== "decisions") {
|
|
1858
1861
|
return mcpError("Error: session is required for non-decisions sections");
|
|
1859
1862
|
}
|
|
1860
|
-
const { loadState, saveState } = await import("./dist-
|
|
1863
|
+
const { loadState, saveState } = await import("./dist-CJDGASPP.js");
|
|
1861
1864
|
const lr = await loadState(projectPath, input.stream);
|
|
1862
1865
|
if (!lr.ok) return resultToMcpResponse(lr);
|
|
1863
1866
|
lr.value.decisions.push({
|
|
@@ -1875,7 +1878,7 @@ async function handleUpdateEntryStatus(projectPath, input) {
|
|
|
1875
1878
|
if (!input.entryId) return mcpError("Error: entryId is required for update_entry_status action");
|
|
1876
1879
|
if (!input.newStatus)
|
|
1877
1880
|
return mcpError("Error: newStatus is required for update_entry_status action");
|
|
1878
|
-
const { updateSessionEntryStatus } = await import("./dist-
|
|
1881
|
+
const { updateSessionEntryStatus } = await import("./dist-CJDGASPP.js");
|
|
1879
1882
|
const result = await updateSessionEntryStatus(
|
|
1880
1883
|
projectPath,
|
|
1881
1884
|
input.session,
|
|
@@ -1888,7 +1891,7 @@ async function handleUpdateEntryStatus(projectPath, input) {
|
|
|
1888
1891
|
async function handleReadSection(projectPath, input) {
|
|
1889
1892
|
if (!input.session) return mcpError("Error: session is required for read_section action");
|
|
1890
1893
|
if (!input.section) return mcpError("Error: section is required for read_section action");
|
|
1891
|
-
const { readSessionSection } = await import("./dist-
|
|
1894
|
+
const { readSessionSection } = await import("./dist-CJDGASPP.js");
|
|
1892
1895
|
const result = await readSessionSection(
|
|
1893
1896
|
projectPath,
|
|
1894
1897
|
input.session,
|
|
@@ -1898,13 +1901,13 @@ async function handleReadSection(projectPath, input) {
|
|
|
1898
1901
|
}
|
|
1899
1902
|
async function handleReadSections(projectPath, input) {
|
|
1900
1903
|
if (!input.session) return mcpError("Error: session is required for read_sections action");
|
|
1901
|
-
const { readSessionSections } = await import("./dist-
|
|
1904
|
+
const { readSessionSections } = await import("./dist-CJDGASPP.js");
|
|
1902
1905
|
const result = await readSessionSections(projectPath, input.session);
|
|
1903
1906
|
return resultToMcpResponse(result);
|
|
1904
1907
|
}
|
|
1905
1908
|
async function handleArchiveSession(projectPath, input) {
|
|
1906
1909
|
if (!input.session) return mcpError("Error: session is required for archive_session action");
|
|
1907
|
-
const { archiveSession } = await import("./dist-
|
|
1910
|
+
const { archiveSession } = await import("./dist-CJDGASPP.js");
|
|
1908
1911
|
const result = await archiveSession(projectPath, input.session);
|
|
1909
1912
|
if (!result.ok) return resultToMcpResponse(result);
|
|
1910
1913
|
await autoSyncRoadmap(projectPath);
|
|
@@ -1984,7 +1987,7 @@ var listStreamsDefinition = {
|
|
|
1984
1987
|
};
|
|
1985
1988
|
async function handleListStreams(input) {
|
|
1986
1989
|
try {
|
|
1987
|
-
const { listStreams, loadStreamIndex } = await import("./dist-
|
|
1990
|
+
const { listStreams, loadStreamIndex } = await import("./dist-CJDGASPP.js");
|
|
1988
1991
|
const projectPath = sanitizePath(input.path);
|
|
1989
1992
|
const indexResult = await loadStreamIndex(projectPath);
|
|
1990
1993
|
const streamsResult = await listStreams(projectPath);
|
|
@@ -2022,7 +2025,7 @@ var checkPhaseGateDefinition = {
|
|
|
2022
2025
|
};
|
|
2023
2026
|
async function handleCheckPhaseGate(input) {
|
|
2024
2027
|
try {
|
|
2025
|
-
const { runCheckPhaseGate } = await import("./check-phase-gate-
|
|
2028
|
+
const { runCheckPhaseGate } = await import("./check-phase-gate-CXR3VM22.js");
|
|
2026
2029
|
const result = await runCheckPhaseGate({ cwd: sanitizePath(input.path) });
|
|
2027
2030
|
if (result.ok) {
|
|
2028
2031
|
return { content: [{ type: "text", text: JSON.stringify(result.value) }] };
|
|
@@ -2078,7 +2081,7 @@ async function handleValidateCrossCheck(input) {
|
|
|
2078
2081
|
};
|
|
2079
2082
|
}
|
|
2080
2083
|
try {
|
|
2081
|
-
const { runCrossCheck } = await import("./validate-cross-check-
|
|
2084
|
+
const { runCrossCheck } = await import("./validate-cross-check-BKCNLZYG.js");
|
|
2082
2085
|
const specsDir = path12.resolve(projectPath, input.specsDir ?? "docs/specs");
|
|
2083
2086
|
if (!specsDir.startsWith(projectPath)) {
|
|
2084
2087
|
return {
|
|
@@ -2801,7 +2804,7 @@ async function handleGenerateSlashCommands(input) {
|
|
|
2801
2804
|
// src/mcp/resources/state.ts
|
|
2802
2805
|
async function getStateResource(projectRoot) {
|
|
2803
2806
|
try {
|
|
2804
|
-
const { loadState, migrateToStreams } = await import("./dist-
|
|
2807
|
+
const { loadState, migrateToStreams } = await import("./dist-CJDGASPP.js");
|
|
2805
2808
|
await migrateToStreams(projectRoot);
|
|
2806
2809
|
const result = await loadState(projectRoot);
|
|
2807
2810
|
if (result.ok) {
|
|
@@ -2919,7 +2922,7 @@ async function handleQueryGraph(input) {
|
|
|
2919
2922
|
const projectPath = sanitizePath(input.path);
|
|
2920
2923
|
const store = await loadGraphStore(projectPath);
|
|
2921
2924
|
if (!store) return graphNotFoundError();
|
|
2922
|
-
const { ContextQL } = await import("./dist-
|
|
2925
|
+
const { ContextQL } = await import("./dist-NCNAXUFD.js");
|
|
2923
2926
|
const cql = new ContextQL(store);
|
|
2924
2927
|
const result = cql.execute({
|
|
2925
2928
|
rootNodeIds: input.rootNodeIds,
|
|
@@ -3001,7 +3004,7 @@ async function handleSearchSimilar(input) {
|
|
|
3001
3004
|
const projectPath = sanitizePath(input.path);
|
|
3002
3005
|
const store = await loadGraphStore(projectPath);
|
|
3003
3006
|
if (!store) return graphNotFoundError();
|
|
3004
|
-
const { FusionLayer } = await import("./dist-
|
|
3007
|
+
const { FusionLayer } = await import("./dist-NCNAXUFD.js");
|
|
3005
3008
|
const fusion = new FusionLayer(store);
|
|
3006
3009
|
const results = fusion.search(input.query, input.topK ?? 10);
|
|
3007
3010
|
if (input.mode === "summary") {
|
|
@@ -3056,7 +3059,7 @@ async function handleFindContextFor(input) {
|
|
|
3056
3059
|
const projectPath = sanitizePath(input.path);
|
|
3057
3060
|
const store = await loadGraphStore(projectPath);
|
|
3058
3061
|
if (!store) return graphNotFoundError();
|
|
3059
|
-
const { FusionLayer, ContextQL } = await import("./dist-
|
|
3062
|
+
const { FusionLayer, ContextQL } = await import("./dist-NCNAXUFD.js");
|
|
3060
3063
|
const fusion = new FusionLayer(store);
|
|
3061
3064
|
const cql = new ContextQL(store);
|
|
3062
3065
|
const tokenBudget = input.tokenBudget ?? 4e3;
|
|
@@ -3161,7 +3164,7 @@ async function handleGetRelationships(input) {
|
|
|
3161
3164
|
const projectPath = sanitizePath(input.path);
|
|
3162
3165
|
const store = await loadGraphStore(projectPath);
|
|
3163
3166
|
if (!store) return graphNotFoundError();
|
|
3164
|
-
const { ContextQL } = await import("./dist-
|
|
3167
|
+
const { ContextQL } = await import("./dist-NCNAXUFD.js");
|
|
3165
3168
|
const cql = new ContextQL(store);
|
|
3166
3169
|
const direction = input.direction ?? "both";
|
|
3167
3170
|
const bidirectional = direction === "both" || direction === "inbound";
|
|
@@ -3279,7 +3282,7 @@ async function handleGetImpact(input) {
|
|
|
3279
3282
|
const projectPath = sanitizePath(input.path);
|
|
3280
3283
|
const store = await loadGraphStore(projectPath);
|
|
3281
3284
|
if (!store) return graphNotFoundError();
|
|
3282
|
-
const { ContextQL } = await import("./dist-
|
|
3285
|
+
const { ContextQL } = await import("./dist-NCNAXUFD.js");
|
|
3283
3286
|
let targetNodeId = input.nodeId;
|
|
3284
3287
|
if (!targetNodeId && input.filePath) {
|
|
3285
3288
|
const fileNodes = store.findNodes({ type: "file" });
|
|
@@ -3411,9 +3414,9 @@ async function handleIngestSource(input) {
|
|
|
3411
3414
|
try {
|
|
3412
3415
|
const projectPath = sanitizePath(input.path);
|
|
3413
3416
|
const graphDir = path16.join(projectPath, ".harness", "graph");
|
|
3414
|
-
const { GraphStore, CodeIngestor, TopologicalLinker, KnowledgeIngestor, GitIngestor } = await import("./dist-
|
|
3415
|
-
const
|
|
3416
|
-
await
|
|
3417
|
+
const { GraphStore, CodeIngestor, TopologicalLinker, KnowledgeIngestor, GitIngestor } = await import("./dist-NCNAXUFD.js");
|
|
3418
|
+
const fs18 = await import("fs/promises");
|
|
3419
|
+
await fs18.mkdir(graphDir, { recursive: true });
|
|
3417
3420
|
const store = new GraphStore();
|
|
3418
3421
|
await store.load(graphDir);
|
|
3419
3422
|
const results = [];
|
|
@@ -3435,13 +3438,13 @@ async function handleIngestSource(input) {
|
|
|
3435
3438
|
results.push(gitResult);
|
|
3436
3439
|
}
|
|
3437
3440
|
if (input.source === "business-signals" || input.source === "all") {
|
|
3438
|
-
const { createExtractionRunner } = await import("./dist-
|
|
3441
|
+
const { createExtractionRunner } = await import("./dist-NCNAXUFD.js");
|
|
3439
3442
|
const extractedDir = path16.join(projectPath, ".harness", "knowledge", "extracted");
|
|
3440
3443
|
const signalsResult = await createExtractionRunner().run(projectPath, store, extractedDir);
|
|
3441
3444
|
results.push(signalsResult);
|
|
3442
3445
|
}
|
|
3443
3446
|
if (input.source === "diagrams" || input.source === "all") {
|
|
3444
|
-
const { DiagramParser } = await import("./dist-
|
|
3447
|
+
const { DiagramParser } = await import("./dist-NCNAXUFD.js");
|
|
3445
3448
|
const diagramParser = new DiagramParser(store);
|
|
3446
3449
|
const diagramResult = await diagramParser.ingest(projectPath);
|
|
3447
3450
|
results.push(diagramResult);
|
|
@@ -3507,7 +3510,7 @@ async function handleDetectAnomalies(input) {
|
|
|
3507
3510
|
const projectPath = sanitizePath(input.path);
|
|
3508
3511
|
const store = await loadGraphStore(projectPath);
|
|
3509
3512
|
if (!store) return graphNotFoundError();
|
|
3510
|
-
const { GraphAnomalyAdapter } = await import("./dist-
|
|
3513
|
+
const { GraphAnomalyAdapter } = await import("./dist-NCNAXUFD.js");
|
|
3511
3514
|
const adapter = new GraphAnomalyAdapter(store);
|
|
3512
3515
|
const report = adapter.detect({
|
|
3513
3516
|
...input.threshold !== void 0 && { threshold: input.threshold },
|
|
@@ -3556,7 +3559,7 @@ async function handleAskGraph(input) {
|
|
|
3556
3559
|
const projectPath = sanitizePath(input.path);
|
|
3557
3560
|
const store = await loadGraphStore(projectPath);
|
|
3558
3561
|
if (!store) return graphNotFoundError();
|
|
3559
|
-
const { askGraph } = await import("./dist-
|
|
3562
|
+
const { askGraph } = await import("./dist-NCNAXUFD.js");
|
|
3560
3563
|
const result = await askGraph(store, input.question);
|
|
3561
3564
|
return {
|
|
3562
3565
|
content: [{ type: "text", text: JSON.stringify(result) }]
|
|
@@ -3620,7 +3623,7 @@ async function handleComputeBlastRadius(input) {
|
|
|
3620
3623
|
const projectPath = sanitizePath(input.path);
|
|
3621
3624
|
const store = await loadGraphStore(projectPath);
|
|
3622
3625
|
if (!store) return graphNotFoundError();
|
|
3623
|
-
const { CascadeSimulator } = await import("./dist-
|
|
3626
|
+
const { CascadeSimulator } = await import("./dist-NCNAXUFD.js");
|
|
3624
3627
|
let targetNodeId = input.nodeId;
|
|
3625
3628
|
if (!targetNodeId && input.file) {
|
|
3626
3629
|
const fileNodes = store.findNodes({ type: "file" });
|
|
@@ -3821,7 +3824,7 @@ var generateAgentDefinitionsDefinition = {
|
|
|
3821
3824
|
}
|
|
3822
3825
|
};
|
|
3823
3826
|
async function handleGenerateAgentDefinitions(input) {
|
|
3824
|
-
const { generateAgentDefinitions } = await import("./generate-agent-definitions-
|
|
3827
|
+
const { generateAgentDefinitions } = await import("./generate-agent-definitions-CZGUXIIN.js");
|
|
3825
3828
|
const platforms = input.platform === "all" || !input.platform ? ["claude-code", "gemini-cli"] : [input.platform];
|
|
3826
3829
|
const results = generateAgentDefinitions({
|
|
3827
3830
|
platforms: [...platforms],
|
|
@@ -4149,7 +4152,7 @@ function shouldTriggerExternalSync(input, response) {
|
|
|
4149
4152
|
}
|
|
4150
4153
|
async function handleManageRoadmap(input) {
|
|
4151
4154
|
try {
|
|
4152
|
-
const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges, assignFeature } = await import("./dist-
|
|
4155
|
+
const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges, assignFeature } = await import("./dist-CJDGASPP.js");
|
|
4153
4156
|
const { Ok: Ok2 } = await import("./dist-3EWNRFFQ.js");
|
|
4154
4157
|
const projectPath = sanitizePath(input.path);
|
|
4155
4158
|
const deps = {
|
|
@@ -4588,7 +4591,7 @@ async function handleTransition(validInput, projectPath, id) {
|
|
|
4588
4591
|
const transition = transitionResult.data;
|
|
4589
4592
|
const prompt = renderTransition(transition);
|
|
4590
4593
|
try {
|
|
4591
|
-
const { saveHandoff } = await import("./dist-
|
|
4594
|
+
const { saveHandoff } = await import("./dist-CJDGASPP.js");
|
|
4592
4595
|
await saveHandoff(
|
|
4593
4596
|
projectPath,
|
|
4594
4597
|
{
|
|
@@ -4669,7 +4672,7 @@ async function handleEmitInteraction(input) {
|
|
|
4669
4672
|
}
|
|
4670
4673
|
async function recordInteraction(projectPath, id, type, decision, stream) {
|
|
4671
4674
|
try {
|
|
4672
|
-
const { loadState, saveState } = await import("./dist-
|
|
4675
|
+
const { loadState, saveState } = await import("./dist-CJDGASPP.js");
|
|
4673
4676
|
const stateResult = await loadState(projectPath, stream);
|
|
4674
4677
|
if (stateResult.ok) {
|
|
4675
4678
|
const state = stateResult.value;
|
|
@@ -4830,10 +4833,10 @@ async function handleGatherContext(input) {
|
|
|
4830
4833
|
input.include ?? ["state", "learnings", "handoff", "graph", "validation"]
|
|
4831
4834
|
);
|
|
4832
4835
|
const errors = [];
|
|
4833
|
-
const statePromise = includeSet.has("state") ? import("./dist-
|
|
4836
|
+
const statePromise = includeSet.has("state") ? import("./dist-CJDGASPP.js").then(
|
|
4834
4837
|
(core) => core.loadState(projectPath, void 0, input.session)
|
|
4835
4838
|
) : Promise.resolve(null);
|
|
4836
|
-
const learningsPromise = includeSet.has("learnings") ? import("./dist-
|
|
4839
|
+
const learningsPromise = includeSet.has("learnings") ? import("./dist-CJDGASPP.js").then(
|
|
4837
4840
|
(core) => core.loadBudgetedLearnings(projectPath, {
|
|
4838
4841
|
intent: input.intent,
|
|
4839
4842
|
tokenBudget: input.learningsBudget ?? 1e3,
|
|
@@ -4842,14 +4845,14 @@ async function handleGatherContext(input) {
|
|
|
4842
4845
|
...input.depth !== void 0 && { depth: input.depth }
|
|
4843
4846
|
})
|
|
4844
4847
|
) : Promise.resolve(null);
|
|
4845
|
-
const handoffPromise = includeSet.has("handoff") ? import("./dist-
|
|
4848
|
+
const handoffPromise = includeSet.has("handoff") ? import("./dist-CJDGASPP.js").then(
|
|
4846
4849
|
(core) => core.loadHandoff(projectPath, void 0, input.session)
|
|
4847
4850
|
) : Promise.resolve(null);
|
|
4848
4851
|
const graphPromise = includeSet.has("graph") ? (async () => {
|
|
4849
|
-
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-
|
|
4852
|
+
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-RDXSEBD7.js");
|
|
4850
4853
|
const store = await loadGraphStore2(projectPath);
|
|
4851
4854
|
if (!store) return null;
|
|
4852
|
-
const { FusionLayer, ContextQL } = await import("./dist-
|
|
4855
|
+
const { FusionLayer, ContextQL } = await import("./dist-NCNAXUFD.js");
|
|
4853
4856
|
const fusion = new FusionLayer(store);
|
|
4854
4857
|
const cql = new ContextQL(store);
|
|
4855
4858
|
const tokenBudget = input.tokenBudget ?? 4e3;
|
|
@@ -4886,11 +4889,11 @@ async function handleGatherContext(input) {
|
|
|
4886
4889
|
context: contextBlocks
|
|
4887
4890
|
};
|
|
4888
4891
|
})() : Promise.resolve(null);
|
|
4889
|
-
const sessionsPromise = includeSet.has("sessions") && input.session ? import("./dist-
|
|
4892
|
+
const sessionsPromise = includeSet.has("sessions") && input.session ? import("./dist-CJDGASPP.js").then(
|
|
4890
4893
|
(core) => core.readSessionSections(projectPath, input.session)
|
|
4891
4894
|
) : Promise.resolve(null);
|
|
4892
4895
|
const shouldIncludeEvents = input.includeEvents !== void 0 ? input.includeEvents : includeSet.has("events") || !!input.session && !input.include;
|
|
4893
|
-
const eventsPromise = shouldIncludeEvents ? import("./dist-
|
|
4896
|
+
const eventsPromise = shouldIncludeEvents ? import("./dist-CJDGASPP.js").then(async (core) => {
|
|
4894
4897
|
const result = await core.loadEvents(projectPath, {
|
|
4895
4898
|
session: input.session
|
|
4896
4899
|
});
|
|
@@ -4898,7 +4901,7 @@ async function handleGatherContext(input) {
|
|
|
4898
4901
|
return core.formatEventTimeline(result.value);
|
|
4899
4902
|
}) : Promise.resolve(null);
|
|
4900
4903
|
const validationPromise = includeSet.has("validation") ? (async () => {
|
|
4901
|
-
const { handleValidateProject: handleValidateProject2 } = await import("./validate-
|
|
4904
|
+
const { handleValidateProject: handleValidateProject2 } = await import("./validate-CWGXR7QM.js");
|
|
4902
4905
|
const result = await handleValidateProject2({ path: projectPath });
|
|
4903
4906
|
const first = result.content[0];
|
|
4904
4907
|
return first ? JSON.parse(first.text) : null;
|
|
@@ -5001,7 +5004,7 @@ async function handleGatherContext(input) {
|
|
|
5001
5004
|
};
|
|
5002
5005
|
if (input.session) {
|
|
5003
5006
|
try {
|
|
5004
|
-
const core = await import("./dist-
|
|
5007
|
+
const core = await import("./dist-CJDGASPP.js");
|
|
5005
5008
|
core.updateSessionIndex(
|
|
5006
5009
|
projectPath,
|
|
5007
5010
|
input.session,
|
|
@@ -5153,7 +5156,7 @@ async function handleReviewChanges(input) {
|
|
|
5153
5156
|
}
|
|
5154
5157
|
}
|
|
5155
5158
|
async function runQuickReview(projectPath, diff, diffLines, downgraded, offset, limit) {
|
|
5156
|
-
const { handleAnalyzeDiff: handleAnalyzeDiff2 } = await import("./feedback-
|
|
5159
|
+
const { handleAnalyzeDiff: handleAnalyzeDiff2 } = await import("./feedback-OTIFW5MK.js");
|
|
5157
5160
|
const result = await handleAnalyzeDiff2({ diff, path: projectPath });
|
|
5158
5161
|
const firstContent = result.content[0];
|
|
5159
5162
|
if (!firstContent) throw new Error("Empty analyze_diff response");
|
|
@@ -5188,7 +5191,7 @@ function extractFileCount(diffParsed) {
|
|
|
5188
5191
|
return files?.length ?? 0;
|
|
5189
5192
|
}
|
|
5190
5193
|
async function runStandardReview(projectPath, diff, diffLines, downgraded, offset, limit) {
|
|
5191
|
-
const { handleAnalyzeDiff: handleAnalyzeDiff2, handleCreateSelfReview: handleCreateSelfReview2 } = await import("./feedback-
|
|
5194
|
+
const { handleAnalyzeDiff: handleAnalyzeDiff2, handleCreateSelfReview: handleCreateSelfReview2 } = await import("./feedback-OTIFW5MK.js");
|
|
5192
5195
|
const [diffResult, reviewResult] = await Promise.all([
|
|
5193
5196
|
handleAnalyzeDiff2({ diff, path: projectPath }),
|
|
5194
5197
|
handleCreateSelfReview2({ path: projectPath, diff })
|
|
@@ -5223,7 +5226,7 @@ async function runStandardReview(projectPath, diff, diffLines, downgraded, offse
|
|
|
5223
5226
|
};
|
|
5224
5227
|
}
|
|
5225
5228
|
async function runDeepReview(projectPath, diff, diffLines, _downgraded, offset, limit) {
|
|
5226
|
-
const { handleRunCodeReview: handleRunCodeReview2 } = await import("./review-pipeline-
|
|
5229
|
+
const { handleRunCodeReview: handleRunCodeReview2 } = await import("./review-pipeline-65V4EO6O.js");
|
|
5227
5230
|
const result = await handleRunCodeReview2({
|
|
5228
5231
|
path: projectPath,
|
|
5229
5232
|
diff,
|
|
@@ -5302,7 +5305,7 @@ async function handleCheckTaskIndependence(input) {
|
|
|
5302
5305
|
try {
|
|
5303
5306
|
const projectPath = sanitizePath(input.path);
|
|
5304
5307
|
const store = await loadGraphStore(projectPath);
|
|
5305
|
-
const { TaskIndependenceAnalyzer } = await import("./dist-
|
|
5308
|
+
const { TaskIndependenceAnalyzer } = await import("./dist-NCNAXUFD.js");
|
|
5306
5309
|
const analyzer = new TaskIndependenceAnalyzer(store ?? void 0);
|
|
5307
5310
|
const result = analyzer.analyze({
|
|
5308
5311
|
tasks: input.tasks,
|
|
@@ -5390,7 +5393,7 @@ async function handlePredictConflicts(input) {
|
|
|
5390
5393
|
try {
|
|
5391
5394
|
const projectPath = sanitizePath(input.path);
|
|
5392
5395
|
const store = await loadGraphStore(projectPath);
|
|
5393
|
-
const { ConflictPredictor } = await import("./dist-
|
|
5396
|
+
const { ConflictPredictor } = await import("./dist-NCNAXUFD.js");
|
|
5394
5397
|
const predictor = new ConflictPredictor(store ?? void 0);
|
|
5395
5398
|
const result = predictor.predict({
|
|
5396
5399
|
tasks: input.tasks,
|
|
@@ -5496,7 +5499,7 @@ async function handleDetectStaleConstraints(input) {
|
|
|
5496
5499
|
isError: true
|
|
5497
5500
|
};
|
|
5498
5501
|
}
|
|
5499
|
-
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-
|
|
5502
|
+
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-RDXSEBD7.js");
|
|
5500
5503
|
const store = await loadGraphStore2(projectPath);
|
|
5501
5504
|
if (!store) {
|
|
5502
5505
|
return {
|
|
@@ -5517,7 +5520,7 @@ async function handleDetectStaleConstraints(input) {
|
|
|
5517
5520
|
]
|
|
5518
5521
|
};
|
|
5519
5522
|
}
|
|
5520
|
-
const { detectStaleConstraints } = await import("./dist-
|
|
5523
|
+
const { detectStaleConstraints } = await import("./dist-CJDGASPP.js");
|
|
5521
5524
|
const result = detectStaleConstraints(
|
|
5522
5525
|
store,
|
|
5523
5526
|
windowDays,
|
|
@@ -5637,10 +5640,10 @@ function countCriticalFindings(securityData) {
|
|
|
5637
5640
|
return findings.filter((f) => f.severity === "error").length;
|
|
5638
5641
|
}
|
|
5639
5642
|
async function runHealthChecks(projectPath) {
|
|
5640
|
-
const { handleAssessProject: handleAssessProject2 } = await import("./assess-project-
|
|
5641
|
-
const { handleCheckDependencies: handleCheckDependencies2 } = await import("./architecture-
|
|
5642
|
-
const { handleDetectEntropy: handleDetectEntropy2 } = await import("./entropy-
|
|
5643
|
-
const { handleRunSecurityScan: handleRunSecurityScan2 } = await import("./security-
|
|
5643
|
+
const { handleAssessProject: handleAssessProject2 } = await import("./assess-project-Y6W7YDUA.js");
|
|
5644
|
+
const { handleCheckDependencies: handleCheckDependencies2 } = await import("./architecture-ZDDKEVID.js");
|
|
5645
|
+
const { handleDetectEntropy: handleDetectEntropy2 } = await import("./entropy-PBYSIQYS.js");
|
|
5646
|
+
const { handleRunSecurityScan: handleRunSecurityScan2 } = await import("./security-CAYDRZIZ.js");
|
|
5644
5647
|
const [assessResult, depsResult, entropyResult, securityResult] = await Promise.all([
|
|
5645
5648
|
handleAssessProject2({
|
|
5646
5649
|
path: projectPath,
|
|
@@ -5695,10 +5698,10 @@ function avg(values) {
|
|
|
5695
5698
|
}
|
|
5696
5699
|
async function runGraphMetrics(projectPath) {
|
|
5697
5700
|
try {
|
|
5698
|
-
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-
|
|
5701
|
+
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-RDXSEBD7.js");
|
|
5699
5702
|
const store = await loadGraphStore2(projectPath);
|
|
5700
5703
|
if (!store) return ZERO_METRICS;
|
|
5701
|
-
const { GraphCouplingAdapter, GraphComplexityAdapter, GraphAnomalyAdapter } = await import("./dist-
|
|
5704
|
+
const { GraphCouplingAdapter, GraphComplexityAdapter, GraphAnomalyAdapter } = await import("./dist-NCNAXUFD.js");
|
|
5702
5705
|
const couplingAdapter = new GraphCouplingAdapter(store);
|
|
5703
5706
|
const couplingData = couplingAdapter.computeCouplingData();
|
|
5704
5707
|
const files = couplingData.files;
|
|
@@ -6437,7 +6440,7 @@ async function handleGetDecayTrends(input) {
|
|
|
6437
6440
|
};
|
|
6438
6441
|
}
|
|
6439
6442
|
try {
|
|
6440
|
-
const core = await import("./dist-
|
|
6443
|
+
const core = await import("./dist-CJDGASPP.js");
|
|
6441
6444
|
const { TimelineManager } = core;
|
|
6442
6445
|
const manager = new TimelineManager(projectPath);
|
|
6443
6446
|
const timeline = manager.load();
|
|
@@ -6572,7 +6575,7 @@ async function handleCodeOutline(input) {
|
|
|
6572
6575
|
};
|
|
6573
6576
|
}
|
|
6574
6577
|
try {
|
|
6575
|
-
const { getOutline, formatOutline, EXTENSION_MAP } = await import("./dist-
|
|
6578
|
+
const { getOutline, formatOutline, EXTENSION_MAP } = await import("./dist-CJDGASPP.js");
|
|
6576
6579
|
const { stat } = await import("fs/promises");
|
|
6577
6580
|
const stats = await stat(targetPath).catch(() => null);
|
|
6578
6581
|
if (stats?.isFile()) {
|
|
@@ -6591,7 +6594,7 @@ async function handleCodeOutline(input) {
|
|
|
6591
6594
|
})
|
|
6592
6595
|
);
|
|
6593
6596
|
fileStats.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
6594
|
-
const { paginate: paginate2 } = await import("./dist-
|
|
6597
|
+
const { paginate: paginate2 } = await import("./dist-CJDGASPP.js");
|
|
6595
6598
|
const paged = paginate2(fileStats, input.offset ?? 0, input.limit ?? 30);
|
|
6596
6599
|
const results = [];
|
|
6597
6600
|
for (const entry of paged.items) {
|
|
@@ -6664,7 +6667,7 @@ async function handleCodeSearch(input) {
|
|
|
6664
6667
|
};
|
|
6665
6668
|
}
|
|
6666
6669
|
try {
|
|
6667
|
-
const { searchSymbols } = await import("./dist-
|
|
6670
|
+
const { searchSymbols } = await import("./dist-CJDGASPP.js");
|
|
6668
6671
|
const result = await searchSymbols(input.query, directory, input.glob);
|
|
6669
6672
|
const lines = [`Search: "${result.query}" \u2014 ${result.matches.length} matches`];
|
|
6670
6673
|
for (const match of result.matches) {
|
|
@@ -6733,7 +6736,7 @@ async function handleCodeUnfold(input) {
|
|
|
6733
6736
|
}
|
|
6734
6737
|
try {
|
|
6735
6738
|
if (input.symbol) {
|
|
6736
|
-
const { unfoldSymbol } = await import("./dist-
|
|
6739
|
+
const { unfoldSymbol } = await import("./dist-CJDGASPP.js");
|
|
6737
6740
|
const result = await unfoldSymbol(filePath, input.symbol);
|
|
6738
6741
|
const header = result.warning ? `${result.file}:${result.startLine}-${result.endLine} ${result.warning}
|
|
6739
6742
|
` : `${result.file}:${result.startLine}-${result.endLine}
|
|
@@ -6741,7 +6744,7 @@ async function handleCodeUnfold(input) {
|
|
|
6741
6744
|
return { content: [{ type: "text", text: header + result.content }] };
|
|
6742
6745
|
}
|
|
6743
6746
|
if (input.startLine != null && input.endLine != null) {
|
|
6744
|
-
const { unfoldRange } = await import("./dist-
|
|
6747
|
+
const { unfoldRange } = await import("./dist-CJDGASPP.js");
|
|
6745
6748
|
const result = await unfoldRange(filePath, input.startLine, input.endLine);
|
|
6746
6749
|
const header = `${result.file}:${result.startLine}-${result.endLine}
|
|
6747
6750
|
`;
|
|
@@ -6803,7 +6806,7 @@ async function handleCheckTraceability(input) {
|
|
|
6803
6806
|
isError: true
|
|
6804
6807
|
};
|
|
6805
6808
|
}
|
|
6806
|
-
const { queryTraceability } = await import("./dist-
|
|
6809
|
+
const { queryTraceability } = await import("./dist-NCNAXUFD.js");
|
|
6807
6810
|
const options = {};
|
|
6808
6811
|
if (input.spec) options.specPath = input.spec;
|
|
6809
6812
|
if (input.feature) options.featureName = input.feature;
|
|
@@ -6926,7 +6929,7 @@ async function handlePredictFailures(input) {
|
|
|
6926
6929
|
};
|
|
6927
6930
|
}
|
|
6928
6931
|
try {
|
|
6929
|
-
const core = await import("./dist-
|
|
6932
|
+
const core = await import("./dist-CJDGASPP.js");
|
|
6930
6933
|
const { TimelineManager, PredictionEngine, SpecImpactEstimator } = core;
|
|
6931
6934
|
const manager = new TimelineManager(projectPath);
|
|
6932
6935
|
const includeRoadmap = input.includeRoadmap !== false;
|
|
@@ -7028,6 +7031,699 @@ async function handleRecommendSkills(input) {
|
|
|
7028
7031
|
};
|
|
7029
7032
|
}
|
|
7030
7033
|
|
|
7034
|
+
// src/mcp/tools/advise-skills.ts
|
|
7035
|
+
import path21 from "path";
|
|
7036
|
+
|
|
7037
|
+
// src/commands/advise-skills.ts
|
|
7038
|
+
import { Command as Command2 } from "commander";
|
|
7039
|
+
import fs17 from "fs";
|
|
7040
|
+
import path20 from "path";
|
|
7041
|
+
import chalk from "chalk";
|
|
7042
|
+
|
|
7043
|
+
// src/skill/content-matcher-types.ts
|
|
7044
|
+
var TIER_THRESHOLDS = {
|
|
7045
|
+
apply: 0.6,
|
|
7046
|
+
reference: 0.35,
|
|
7047
|
+
consider: 0.15
|
|
7048
|
+
};
|
|
7049
|
+
var SCORING_WEIGHTS = {
|
|
7050
|
+
keyword: 0.35,
|
|
7051
|
+
stack: 0.25,
|
|
7052
|
+
termOverlap: 0.25,
|
|
7053
|
+
domain: 0.15
|
|
7054
|
+
};
|
|
7055
|
+
var DOMAIN_KEYWORD_MAP = {
|
|
7056
|
+
design: [
|
|
7057
|
+
"layout",
|
|
7058
|
+
"responsive",
|
|
7059
|
+
"typography",
|
|
7060
|
+
"color",
|
|
7061
|
+
"theme",
|
|
7062
|
+
"dark mode",
|
|
7063
|
+
"ui",
|
|
7064
|
+
"ux",
|
|
7065
|
+
"component",
|
|
7066
|
+
"palette",
|
|
7067
|
+
"breakpoint",
|
|
7068
|
+
"grid",
|
|
7069
|
+
"elevation",
|
|
7070
|
+
"shadow",
|
|
7071
|
+
"motion",
|
|
7072
|
+
"animation",
|
|
7073
|
+
"css"
|
|
7074
|
+
],
|
|
7075
|
+
auth: [
|
|
7076
|
+
"authentication",
|
|
7077
|
+
"authorization",
|
|
7078
|
+
"oauth",
|
|
7079
|
+
"session",
|
|
7080
|
+
"token",
|
|
7081
|
+
"jwt",
|
|
7082
|
+
"login",
|
|
7083
|
+
"signup",
|
|
7084
|
+
"password",
|
|
7085
|
+
"credential",
|
|
7086
|
+
"rbac",
|
|
7087
|
+
"permission",
|
|
7088
|
+
"identity"
|
|
7089
|
+
],
|
|
7090
|
+
data: [
|
|
7091
|
+
"database",
|
|
7092
|
+
"schema",
|
|
7093
|
+
"migration",
|
|
7094
|
+
"query",
|
|
7095
|
+
"sql",
|
|
7096
|
+
"nosql",
|
|
7097
|
+
"orm",
|
|
7098
|
+
"model",
|
|
7099
|
+
"table",
|
|
7100
|
+
"transaction",
|
|
7101
|
+
"prisma",
|
|
7102
|
+
"drizzle"
|
|
7103
|
+
],
|
|
7104
|
+
security: [
|
|
7105
|
+
"security",
|
|
7106
|
+
"vulnerability",
|
|
7107
|
+
"xss",
|
|
7108
|
+
"csrf",
|
|
7109
|
+
"injection",
|
|
7110
|
+
"sanitiz",
|
|
7111
|
+
"encrypt",
|
|
7112
|
+
"hash",
|
|
7113
|
+
"owasp",
|
|
7114
|
+
"cve",
|
|
7115
|
+
"audit"
|
|
7116
|
+
],
|
|
7117
|
+
a11y: [
|
|
7118
|
+
"accessibility",
|
|
7119
|
+
"a11y",
|
|
7120
|
+
"aria",
|
|
7121
|
+
"screen reader",
|
|
7122
|
+
"screen-reader",
|
|
7123
|
+
"wcag",
|
|
7124
|
+
"contrast",
|
|
7125
|
+
"keyboard navigation",
|
|
7126
|
+
"focus management"
|
|
7127
|
+
],
|
|
7128
|
+
perf: [
|
|
7129
|
+
"performance",
|
|
7130
|
+
"latency",
|
|
7131
|
+
"throughput",
|
|
7132
|
+
"cache",
|
|
7133
|
+
"lazy load",
|
|
7134
|
+
"bundle size",
|
|
7135
|
+
"tree shaking",
|
|
7136
|
+
"code splitting",
|
|
7137
|
+
"lighthouse",
|
|
7138
|
+
"optimization",
|
|
7139
|
+
"bundle"
|
|
7140
|
+
],
|
|
7141
|
+
testing: [
|
|
7142
|
+
"test",
|
|
7143
|
+
"coverage",
|
|
7144
|
+
"mock",
|
|
7145
|
+
"stub",
|
|
7146
|
+
"fixture",
|
|
7147
|
+
"assertion",
|
|
7148
|
+
"snapshot",
|
|
7149
|
+
"e2e",
|
|
7150
|
+
"integration test",
|
|
7151
|
+
"unit test",
|
|
7152
|
+
"tdd"
|
|
7153
|
+
],
|
|
7154
|
+
api: [
|
|
7155
|
+
"api",
|
|
7156
|
+
"endpoint",
|
|
7157
|
+
"rest",
|
|
7158
|
+
"graphql",
|
|
7159
|
+
"openapi",
|
|
7160
|
+
"swagger",
|
|
7161
|
+
"route",
|
|
7162
|
+
"middleware",
|
|
7163
|
+
"webhook",
|
|
7164
|
+
"grpc"
|
|
7165
|
+
],
|
|
7166
|
+
infra: [
|
|
7167
|
+
"docker",
|
|
7168
|
+
"kubernetes",
|
|
7169
|
+
"ci/cd",
|
|
7170
|
+
"ci",
|
|
7171
|
+
"cd",
|
|
7172
|
+
"deploy",
|
|
7173
|
+
"terraform",
|
|
7174
|
+
"aws",
|
|
7175
|
+
"gcp",
|
|
7176
|
+
"azure",
|
|
7177
|
+
"cloud",
|
|
7178
|
+
"container",
|
|
7179
|
+
"helm"
|
|
7180
|
+
],
|
|
7181
|
+
mobile: [
|
|
7182
|
+
"mobile",
|
|
7183
|
+
"ios",
|
|
7184
|
+
"android",
|
|
7185
|
+
"react native",
|
|
7186
|
+
"react-native",
|
|
7187
|
+
"flutter",
|
|
7188
|
+
"app store",
|
|
7189
|
+
"push notification"
|
|
7190
|
+
]
|
|
7191
|
+
};
|
|
7192
|
+
|
|
7193
|
+
// src/skill/signal-extractor.ts
|
|
7194
|
+
var STEM_SUFFIXES = [
|
|
7195
|
+
"ation",
|
|
7196
|
+
"tion",
|
|
7197
|
+
"sion",
|
|
7198
|
+
"ment",
|
|
7199
|
+
"ness",
|
|
7200
|
+
"ible",
|
|
7201
|
+
"able",
|
|
7202
|
+
"ive",
|
|
7203
|
+
"ous",
|
|
7204
|
+
"ful",
|
|
7205
|
+
"ing",
|
|
7206
|
+
"ity",
|
|
7207
|
+
"ly",
|
|
7208
|
+
"ed",
|
|
7209
|
+
"er",
|
|
7210
|
+
"es",
|
|
7211
|
+
"s"
|
|
7212
|
+
];
|
|
7213
|
+
function simpleStem(word) {
|
|
7214
|
+
const w = word.toLowerCase();
|
|
7215
|
+
if (w.length <= 4) return w;
|
|
7216
|
+
for (const suffix of STEM_SUFFIXES) {
|
|
7217
|
+
if (w.endsWith(suffix) && w.length - suffix.length >= 3) {
|
|
7218
|
+
return w.slice(0, -suffix.length);
|
|
7219
|
+
}
|
|
7220
|
+
}
|
|
7221
|
+
return w;
|
|
7222
|
+
}
|
|
7223
|
+
function extractSpecKeywords(specText) {
|
|
7224
|
+
const match = specText.match(/\*\*Keywords?:\*\*\s*(.+)/i);
|
|
7225
|
+
if (!match?.[1]) return [];
|
|
7226
|
+
return match[1].split(",").map((k) => k.trim()).filter((k) => k.length > 0);
|
|
7227
|
+
}
|
|
7228
|
+
var STACK_SIGNAL_MAP = {
|
|
7229
|
+
react: "react",
|
|
7230
|
+
"react-dom": "react",
|
|
7231
|
+
"react-native": "react-native",
|
|
7232
|
+
next: "next",
|
|
7233
|
+
vue: "vue",
|
|
7234
|
+
nuxt: "nuxt",
|
|
7235
|
+
angular: "angular",
|
|
7236
|
+
svelte: "svelte",
|
|
7237
|
+
express: "express",
|
|
7238
|
+
fastify: "fastify",
|
|
7239
|
+
nestjs: "nest",
|
|
7240
|
+
"@nestjs/core": "nest",
|
|
7241
|
+
typescript: "typescript",
|
|
7242
|
+
tailwindcss: "tailwind",
|
|
7243
|
+
prisma: "prisma",
|
|
7244
|
+
"@prisma/client": "prisma",
|
|
7245
|
+
"drizzle-orm": "drizzle",
|
|
7246
|
+
graphql: "graphql",
|
|
7247
|
+
"@trpc/server": "trpc",
|
|
7248
|
+
trpc: "trpc",
|
|
7249
|
+
vitest: "vitest",
|
|
7250
|
+
jest: "jest",
|
|
7251
|
+
playwright: "playwright",
|
|
7252
|
+
cypress: "cypress",
|
|
7253
|
+
vite: "vite",
|
|
7254
|
+
webpack: "webpack",
|
|
7255
|
+
zod: "zod",
|
|
7256
|
+
mongoose: "mongoose",
|
|
7257
|
+
redis: "redis",
|
|
7258
|
+
ioredis: "redis",
|
|
7259
|
+
"socket.io": "websocket",
|
|
7260
|
+
ws: "websocket"
|
|
7261
|
+
};
|
|
7262
|
+
function detectStackFromDeps(dependencies, devDependencies) {
|
|
7263
|
+
const signals = /* @__PURE__ */ new Set();
|
|
7264
|
+
const allDeps = { ...dependencies, ...devDependencies };
|
|
7265
|
+
for (const pkgName of Object.keys(allDeps)) {
|
|
7266
|
+
const signal = STACK_SIGNAL_MAP[pkgName];
|
|
7267
|
+
if (signal) {
|
|
7268
|
+
signals.add(signal);
|
|
7269
|
+
}
|
|
7270
|
+
}
|
|
7271
|
+
return [...signals].sort();
|
|
7272
|
+
}
|
|
7273
|
+
function inferDomain(specText) {
|
|
7274
|
+
const lower = specText.toLowerCase();
|
|
7275
|
+
const domains = [];
|
|
7276
|
+
for (const [domain, markers] of Object.entries(DOMAIN_KEYWORD_MAP)) {
|
|
7277
|
+
const hits = markers.filter((m) => lower.includes(m)).length;
|
|
7278
|
+
if (hits >= 2) {
|
|
7279
|
+
domains.push(domain);
|
|
7280
|
+
}
|
|
7281
|
+
}
|
|
7282
|
+
return domains.sort();
|
|
7283
|
+
}
|
|
7284
|
+
function extractSignals(specText, dependencies, devDependencies, contextKeywords, taskText) {
|
|
7285
|
+
const specKeywords = extractSpecKeywords(specText);
|
|
7286
|
+
if (contextKeywords) {
|
|
7287
|
+
const existing = new Set(specKeywords);
|
|
7288
|
+
for (const kw of contextKeywords) {
|
|
7289
|
+
if (!existing.has(kw)) {
|
|
7290
|
+
specKeywords.push(kw);
|
|
7291
|
+
existing.add(kw);
|
|
7292
|
+
}
|
|
7293
|
+
}
|
|
7294
|
+
}
|
|
7295
|
+
const stackSignals = detectStackFromDeps(dependencies, devDependencies);
|
|
7296
|
+
const featureDomain = inferDomain(specText);
|
|
7297
|
+
return {
|
|
7298
|
+
specKeywords,
|
|
7299
|
+
specText,
|
|
7300
|
+
stackSignals,
|
|
7301
|
+
featureDomain,
|
|
7302
|
+
...taskText !== void 0 && { taskText }
|
|
7303
|
+
};
|
|
7304
|
+
}
|
|
7305
|
+
|
|
7306
|
+
// src/skill/content-matcher.ts
|
|
7307
|
+
function computeKeywordOverlap(skillKeywords, specKeywords) {
|
|
7308
|
+
if (skillKeywords.length === 0 || specKeywords.length === 0) return 0;
|
|
7309
|
+
const stemTokens = (keywords) => {
|
|
7310
|
+
const tokens = /* @__PURE__ */ new Set();
|
|
7311
|
+
for (const kw of keywords) {
|
|
7312
|
+
const parts = kw.toLowerCase().split(/[-_\s]+/);
|
|
7313
|
+
for (const part of parts) {
|
|
7314
|
+
if (part.length > 0) {
|
|
7315
|
+
tokens.add(simpleStem(part));
|
|
7316
|
+
}
|
|
7317
|
+
}
|
|
7318
|
+
}
|
|
7319
|
+
return tokens;
|
|
7320
|
+
};
|
|
7321
|
+
const skillStems = stemTokens(skillKeywords);
|
|
7322
|
+
const specStems = stemTokens(specKeywords);
|
|
7323
|
+
let intersectionCount = 0;
|
|
7324
|
+
for (const stem of skillStems) {
|
|
7325
|
+
if (specStems.has(stem)) intersectionCount++;
|
|
7326
|
+
}
|
|
7327
|
+
const unionSize = (/* @__PURE__ */ new Set([...skillStems, ...specStems])).size;
|
|
7328
|
+
return unionSize > 0 ? intersectionCount / unionSize : 0;
|
|
7329
|
+
}
|
|
7330
|
+
function computeStackMatch(skillSignals, projectSignals) {
|
|
7331
|
+
if (skillSignals.length === 0) return 0;
|
|
7332
|
+
const projectSet = new Set(projectSignals.map((s) => s.toLowerCase()));
|
|
7333
|
+
const matched = skillSignals.filter((s) => projectSet.has(s.toLowerCase())).length;
|
|
7334
|
+
return matched / skillSignals.length;
|
|
7335
|
+
}
|
|
7336
|
+
function computeTermOverlap(skillDescription, specText) {
|
|
7337
|
+
if (!skillDescription || !specText) return 0;
|
|
7338
|
+
const tokenize = (text) => text.toLowerCase().split(/[\s\-_,.;:!?()[\]{}"'`]+/).filter((t) => t.length > 3).map(simpleStem);
|
|
7339
|
+
const descTokens = tokenize(skillDescription);
|
|
7340
|
+
if (descTokens.length === 0) return 0;
|
|
7341
|
+
const specTokenSet = new Set(tokenize(specText));
|
|
7342
|
+
const matched = descTokens.filter((t) => specTokenSet.has(t)).length;
|
|
7343
|
+
return matched / descTokens.length;
|
|
7344
|
+
}
|
|
7345
|
+
function computeDomainMatch(entry, featureDomains) {
|
|
7346
|
+
if (featureDomains.length === 0 || entry.keywords.length === 0) return 0;
|
|
7347
|
+
const skillKeywordsLower = entry.keywords.map((k) => k.toLowerCase());
|
|
7348
|
+
for (const domain of featureDomains) {
|
|
7349
|
+
const domainKeywords = DOMAIN_KEYWORD_MAP[domain];
|
|
7350
|
+
if (!domainKeywords) continue;
|
|
7351
|
+
const hasMatch = skillKeywordsLower.some(
|
|
7352
|
+
(kw) => domainKeywords.some((dk) => kw.includes(dk) || dk.includes(kw))
|
|
7353
|
+
);
|
|
7354
|
+
if (hasMatch) return 1;
|
|
7355
|
+
}
|
|
7356
|
+
return 0;
|
|
7357
|
+
}
|
|
7358
|
+
function classifyTier(score) {
|
|
7359
|
+
if (score >= TIER_THRESHOLDS.apply) return "apply";
|
|
7360
|
+
if (score >= TIER_THRESHOLDS.reference) return "reference";
|
|
7361
|
+
if (score >= TIER_THRESHOLDS.consider) return "consider";
|
|
7362
|
+
return null;
|
|
7363
|
+
}
|
|
7364
|
+
var WHEN_RULES = [
|
|
7365
|
+
{ name: /scan|audit|i18n|lint/, when: "End of phase" },
|
|
7366
|
+
{ name: /test/, keywords: /test|tdd|coverage|mock|e2e|snapshot/, when: "Testing" },
|
|
7367
|
+
{
|
|
7368
|
+
name: /a11y|contrast|wcag|color.accessib/,
|
|
7369
|
+
keywords: /contrast|wcag/,
|
|
7370
|
+
when: "After styling"
|
|
7371
|
+
},
|
|
7372
|
+
{ keywords: /css|tailwind|typography|font|color|palette/, when: "During styling" },
|
|
7373
|
+
{ keywords: /alignment|whitespace|spacing|grid/, when: "Layout review" },
|
|
7374
|
+
{ keywords: /motion|animation|transition|parallax/, when: "During polish" },
|
|
7375
|
+
{ keywords: /architect|pattern|api|schema|data.model/, when: "Architecture decisions" },
|
|
7376
|
+
{ name: /^(gof-|js-)/, when: "Architecture decisions" }
|
|
7377
|
+
];
|
|
7378
|
+
function matchesWhenRule(rule, nameLower, keywordsLower) {
|
|
7379
|
+
const nameHit = rule.name ? rule.name.test(nameLower) : false;
|
|
7380
|
+
const kwHit = rule.keywords ? rule.keywords.test(keywordsLower) : false;
|
|
7381
|
+
if (rule.name && rule.keywords) return nameHit || kwHit;
|
|
7382
|
+
return nameHit || kwHit;
|
|
7383
|
+
}
|
|
7384
|
+
function inferWhen(name, entry) {
|
|
7385
|
+
const nameLower = name.toLowerCase();
|
|
7386
|
+
const keywordsLower = entry.keywords.map((k) => k.toLowerCase()).join(" ");
|
|
7387
|
+
for (const rule of WHEN_RULES) {
|
|
7388
|
+
if (matchesWhenRule(rule, nameLower, keywordsLower)) return rule.when;
|
|
7389
|
+
}
|
|
7390
|
+
return "During implementation";
|
|
7391
|
+
}
|
|
7392
|
+
function scoreSkillByContent(entry, signals) {
|
|
7393
|
+
const keywordScore = computeKeywordOverlap(entry.keywords, signals.specKeywords);
|
|
7394
|
+
const stackScore = computeStackMatch(entry.stackSignals, signals.stackSignals);
|
|
7395
|
+
const textToMatch = signals.taskText ?? signals.specText;
|
|
7396
|
+
const descScore = computeTermOverlap(entry.description, textToMatch);
|
|
7397
|
+
const domainScore = computeDomainMatch(entry, signals.featureDomain);
|
|
7398
|
+
return SCORING_WEIGHTS.keyword * keywordScore + SCORING_WEIGHTS.stack * stackScore + SCORING_WEIGHTS.termOverlap * descScore + SCORING_WEIGHTS.domain * domainScore;
|
|
7399
|
+
}
|
|
7400
|
+
function buildMatchReasons(entry, signals) {
|
|
7401
|
+
const reasons = [];
|
|
7402
|
+
const matchedKeywords = entry.keywords.filter(
|
|
7403
|
+
(kw) => signals.specKeywords.some(
|
|
7404
|
+
(sk) => kw.toLowerCase().includes(sk.toLowerCase()) || sk.toLowerCase().includes(kw.toLowerCase())
|
|
7405
|
+
)
|
|
7406
|
+
);
|
|
7407
|
+
if (matchedKeywords.length > 0) {
|
|
7408
|
+
reasons.push(`Keywords: ${matchedKeywords.join(", ")}`);
|
|
7409
|
+
}
|
|
7410
|
+
const projectSignalSet = new Set(signals.stackSignals.map((s) => s.toLowerCase()));
|
|
7411
|
+
const matchedStack = entry.stackSignals.filter((s) => projectSignalSet.has(s.toLowerCase()));
|
|
7412
|
+
if (matchedStack.length > 0) {
|
|
7413
|
+
reasons.push(`Stack: ${matchedStack.join(", ")}`);
|
|
7414
|
+
}
|
|
7415
|
+
if (signals.featureDomain.length > 0) {
|
|
7416
|
+
reasons.push(`Domain: ${signals.featureDomain.join(", ")}`);
|
|
7417
|
+
}
|
|
7418
|
+
return reasons;
|
|
7419
|
+
}
|
|
7420
|
+
function inferCategory(entry) {
|
|
7421
|
+
const keywordsLower = entry.keywords.map((k) => k.toLowerCase()).join(" ");
|
|
7422
|
+
if (/design|layout|responsive|css|ui|ux|theme|color/.test(keywordsLower)) return "design";
|
|
7423
|
+
if (/auth|oauth|session|token|jwt|login/.test(keywordsLower)) return "security";
|
|
7424
|
+
if (/a11y|accessibility|aria|wcag/.test(keywordsLower)) return "a11y";
|
|
7425
|
+
if (/perf|performance|cache|optimization|lighthouse/.test(keywordsLower)) return "perf";
|
|
7426
|
+
if (/test|tdd|coverage|mock|e2e/.test(keywordsLower)) return "testing";
|
|
7427
|
+
if (/database|sql|orm|migration|schema/.test(keywordsLower)) return "data";
|
|
7428
|
+
if (/api|rest|graphql|endpoint/.test(keywordsLower)) return "api";
|
|
7429
|
+
if (/docker|kubernetes|deploy|ci|terraform/.test(keywordsLower)) return "infra";
|
|
7430
|
+
if (/react|vue|angular|svelte|next/.test(keywordsLower)) return "framework";
|
|
7431
|
+
return "patterns";
|
|
7432
|
+
}
|
|
7433
|
+
function scoreAllSkills(index, signals) {
|
|
7434
|
+
const scored = [];
|
|
7435
|
+
for (const [name, entry] of Object.entries(index.skills)) {
|
|
7436
|
+
const score = scoreSkillByContent(entry, signals);
|
|
7437
|
+
if (score >= TIER_THRESHOLDS.consider) {
|
|
7438
|
+
scored.push({ name, entry, score });
|
|
7439
|
+
}
|
|
7440
|
+
}
|
|
7441
|
+
return scored;
|
|
7442
|
+
}
|
|
7443
|
+
function expandRelatedSkills(scored, index) {
|
|
7444
|
+
const matchedNames = new Set(scored.map((s) => s.name));
|
|
7445
|
+
const expansions = [];
|
|
7446
|
+
for (const match of scored) {
|
|
7447
|
+
if (match.score < TIER_THRESHOLDS.reference) continue;
|
|
7448
|
+
for (const relatedName of match.entry.relatedSkills) {
|
|
7449
|
+
if (matchedNames.has(relatedName)) continue;
|
|
7450
|
+
const relatedEntry = index.skills[relatedName];
|
|
7451
|
+
if (!relatedEntry) continue;
|
|
7452
|
+
const boostedScore = match.score * 0.6;
|
|
7453
|
+
if (boostedScore >= TIER_THRESHOLDS.consider) {
|
|
7454
|
+
matchedNames.add(relatedName);
|
|
7455
|
+
expansions.push({
|
|
7456
|
+
name: relatedName,
|
|
7457
|
+
entry: relatedEntry,
|
|
7458
|
+
score: boostedScore,
|
|
7459
|
+
parentName: match.name
|
|
7460
|
+
});
|
|
7461
|
+
}
|
|
7462
|
+
}
|
|
7463
|
+
}
|
|
7464
|
+
return expansions;
|
|
7465
|
+
}
|
|
7466
|
+
function buildMatchList(scored, expansions, signals) {
|
|
7467
|
+
const matches = [];
|
|
7468
|
+
for (const { name, entry, score } of scored) {
|
|
7469
|
+
const tier = classifyTier(score);
|
|
7470
|
+
if (!tier) continue;
|
|
7471
|
+
matches.push({
|
|
7472
|
+
skillName: name,
|
|
7473
|
+
score: Math.round(score * 100) / 100,
|
|
7474
|
+
tier,
|
|
7475
|
+
matchReasons: buildMatchReasons(entry, signals),
|
|
7476
|
+
category: inferCategory(entry),
|
|
7477
|
+
when: inferWhen(name, entry)
|
|
7478
|
+
});
|
|
7479
|
+
}
|
|
7480
|
+
for (const { name, entry, score, parentName } of expansions) {
|
|
7481
|
+
const tier = classifyTier(score);
|
|
7482
|
+
if (!tier) continue;
|
|
7483
|
+
matches.push({
|
|
7484
|
+
skillName: name,
|
|
7485
|
+
score: Math.round(score * 100) / 100,
|
|
7486
|
+
tier,
|
|
7487
|
+
matchReasons: [`Related to: ${parentName}`, ...buildMatchReasons(entry, signals)],
|
|
7488
|
+
category: inferCategory(entry),
|
|
7489
|
+
when: inferWhen(name, entry)
|
|
7490
|
+
});
|
|
7491
|
+
}
|
|
7492
|
+
matches.sort((a, b) => b.score - a.score);
|
|
7493
|
+
return matches;
|
|
7494
|
+
}
|
|
7495
|
+
function matchContent(index, signals) {
|
|
7496
|
+
const startTime = performance.now();
|
|
7497
|
+
const scored = scoreAllSkills(index, signals);
|
|
7498
|
+
const expansions = expandRelatedSkills(scored, index);
|
|
7499
|
+
const matches = buildMatchList(scored, expansions, signals);
|
|
7500
|
+
return {
|
|
7501
|
+
matches,
|
|
7502
|
+
signalsUsed: signals,
|
|
7503
|
+
scanDuration: Math.round(performance.now() - startTime)
|
|
7504
|
+
};
|
|
7505
|
+
}
|
|
7506
|
+
|
|
7507
|
+
// src/skill/skills-md-writer.ts
|
|
7508
|
+
function generateSkillsMd(featureName, result, totalSkillCount) {
|
|
7509
|
+
const lines = [];
|
|
7510
|
+
lines.push(`# Recommended Skills: ${featureName}`);
|
|
7511
|
+
lines.push("");
|
|
7512
|
+
lines.push("> Auto-generated by Pipeline Skill Advisor. Review and adjust as needed.");
|
|
7513
|
+
const apply = result.matches.filter((m) => m.tier === "apply");
|
|
7514
|
+
const reference = result.matches.filter((m) => m.tier === "reference");
|
|
7515
|
+
const consider = result.matches.filter((m) => m.tier === "consider");
|
|
7516
|
+
if (apply.length > 0) {
|
|
7517
|
+
lines.push("");
|
|
7518
|
+
lines.push("## Apply (invoke during execution)");
|
|
7519
|
+
lines.push("");
|
|
7520
|
+
lines.push(...renderTable(apply));
|
|
7521
|
+
}
|
|
7522
|
+
if (reference.length > 0) {
|
|
7523
|
+
lines.push("");
|
|
7524
|
+
lines.push("## Reference (load as context)");
|
|
7525
|
+
lines.push("");
|
|
7526
|
+
lines.push(...renderTable(reference));
|
|
7527
|
+
}
|
|
7528
|
+
if (consider.length > 0) {
|
|
7529
|
+
lines.push("");
|
|
7530
|
+
lines.push("## Consider");
|
|
7531
|
+
lines.push("");
|
|
7532
|
+
lines.push(...renderTable(consider));
|
|
7533
|
+
}
|
|
7534
|
+
lines.push("");
|
|
7535
|
+
lines.push("---");
|
|
7536
|
+
const skillsScanned = totalSkillCount ?? result.matches.length;
|
|
7537
|
+
const keywords = result.signalsUsed.specKeywords.length;
|
|
7538
|
+
const stack = result.signalsUsed.stackSignals.length;
|
|
7539
|
+
const domains = result.signalsUsed.featureDomain.length;
|
|
7540
|
+
lines.push(
|
|
7541
|
+
`*Scanned ${skillsScanned} skills in ${result.scanDuration}ms. Signals: ${keywords} keywords, ${stack} stack markers, ${domains} domains.*`
|
|
7542
|
+
);
|
|
7543
|
+
lines.push("");
|
|
7544
|
+
return lines.join("\n");
|
|
7545
|
+
}
|
|
7546
|
+
function renderTable(matches) {
|
|
7547
|
+
const lines = [];
|
|
7548
|
+
lines.push("| Skill | Purpose | When | Relevance |");
|
|
7549
|
+
lines.push("|-------|---------|------|-----------|");
|
|
7550
|
+
for (const match of matches) {
|
|
7551
|
+
const purpose = match.matchReasons.join("; ");
|
|
7552
|
+
lines.push(`| \`${match.skillName}\` | ${purpose} | ${match.when} | ${match.score} |`);
|
|
7553
|
+
}
|
|
7554
|
+
return lines;
|
|
7555
|
+
}
|
|
7556
|
+
|
|
7557
|
+
// src/commands/advise-skills.ts
|
|
7558
|
+
function readPackageDeps(cwd) {
|
|
7559
|
+
const pkgPath = path20.join(cwd, "package.json");
|
|
7560
|
+
if (!fs17.existsSync(pkgPath)) return { deps: {}, devDeps: {} };
|
|
7561
|
+
try {
|
|
7562
|
+
const pkg = JSON.parse(fs17.readFileSync(pkgPath, "utf-8"));
|
|
7563
|
+
const deps = typeof pkg.dependencies === "object" && pkg.dependencies !== null ? pkg.dependencies : {};
|
|
7564
|
+
const devDeps = typeof pkg.devDependencies === "object" && pkg.devDependencies !== null ? pkg.devDependencies : {};
|
|
7565
|
+
return { deps, devDeps };
|
|
7566
|
+
} catch {
|
|
7567
|
+
return { deps: {}, devDeps: {} };
|
|
7568
|
+
}
|
|
7569
|
+
}
|
|
7570
|
+
function readSpecText(specPath) {
|
|
7571
|
+
if (!fs17.existsSync(specPath)) {
|
|
7572
|
+
throw new Error(`Spec not found: ${specPath}`);
|
|
7573
|
+
}
|
|
7574
|
+
return fs17.readFileSync(specPath, "utf-8");
|
|
7575
|
+
}
|
|
7576
|
+
function filterMatchesByTier(result, top, thorough) {
|
|
7577
|
+
const applySkills = result.matches.filter((m) => m.tier === "apply").slice(0, top);
|
|
7578
|
+
const refSkills = result.matches.filter((m) => m.tier === "reference").slice(0, top * 2);
|
|
7579
|
+
const considerSkills = thorough ? result.matches.filter((m) => m.tier === "consider").slice(0, top) : [];
|
|
7580
|
+
return { ...result, matches: [...applySkills, ...refSkills, ...considerSkills] };
|
|
7581
|
+
}
|
|
7582
|
+
function extractFeatureName(specText, specPath) {
|
|
7583
|
+
const titleMatch = specText.match(/^#\s+(.+)/m);
|
|
7584
|
+
return titleMatch?.[1] ?? path20.basename(path20.dirname(specPath));
|
|
7585
|
+
}
|
|
7586
|
+
async function runAdviseSkills(options) {
|
|
7587
|
+
const cwd = options.cwd ?? process.cwd();
|
|
7588
|
+
const specPath = path20.resolve(cwd, options.specPath);
|
|
7589
|
+
const specText = readSpecText(specPath);
|
|
7590
|
+
const { deps, devDeps } = readPackageDeps(cwd);
|
|
7591
|
+
const signals = extractSignals(specText, deps, devDeps);
|
|
7592
|
+
const configResult = resolveConfig();
|
|
7593
|
+
const tierOverrides = configResult.ok ? configResult.value.skills?.tierOverrides : void 0;
|
|
7594
|
+
const index = loadOrRebuildIndex("claude-code", cwd, tierOverrides);
|
|
7595
|
+
const totalSkills = Object.keys(index.skills).length;
|
|
7596
|
+
const result = matchContent(index, signals);
|
|
7597
|
+
const filteredResult = filterMatchesByTier(result, options.top ?? 5, !!options.thorough);
|
|
7598
|
+
const featureName = extractFeatureName(specText, specPath);
|
|
7599
|
+
const skillsMdPath = path20.join(path20.dirname(specPath), "SKILLS.md");
|
|
7600
|
+
const md = generateSkillsMd(featureName, filteredResult, totalSkills);
|
|
7601
|
+
fs17.writeFileSync(skillsMdPath, md, "utf-8");
|
|
7602
|
+
return { result: filteredResult, skillsMdPath, featureName, totalSkills };
|
|
7603
|
+
}
|
|
7604
|
+
function formatOutput(featureName, result, skillsMdPath, totalSkills) {
|
|
7605
|
+
const apply = result.matches.filter((m) => m.tier === "apply");
|
|
7606
|
+
const ref = result.matches.filter((m) => m.tier === "reference");
|
|
7607
|
+
const consider = result.matches.filter((m) => m.tier === "consider");
|
|
7608
|
+
const lines = [];
|
|
7609
|
+
lines.push(`Skill Advisor: Found ${result.matches.length} relevant skills for "${featureName}"`);
|
|
7610
|
+
lines.push("");
|
|
7611
|
+
if (apply.length > 0) {
|
|
7612
|
+
lines.push(chalk.green(` Apply (${apply.length}):`));
|
|
7613
|
+
for (const m of apply) {
|
|
7614
|
+
lines.push(` ${m.skillName} (${m.score}) \u2014 ${m.when}`);
|
|
7615
|
+
}
|
|
7616
|
+
}
|
|
7617
|
+
if (ref.length > 0) {
|
|
7618
|
+
lines.push(chalk.blue(` Reference (${ref.length}):`));
|
|
7619
|
+
for (const m of ref) {
|
|
7620
|
+
lines.push(` ${m.skillName} (${m.score}) \u2014 ${m.when}`);
|
|
7621
|
+
}
|
|
7622
|
+
}
|
|
7623
|
+
if (consider.length > 0) {
|
|
7624
|
+
lines.push(chalk.dim(` Consider (${consider.length}):`));
|
|
7625
|
+
for (const m of consider) {
|
|
7626
|
+
lines.push(` ${m.skillName} (${m.score}) \u2014 ${m.when}`);
|
|
7627
|
+
}
|
|
7628
|
+
}
|
|
7629
|
+
lines.push("");
|
|
7630
|
+
lines.push(`Scanned ${totalSkills} skills in ${result.scanDuration}ms`);
|
|
7631
|
+
lines.push(`Written to ${skillsMdPath}`);
|
|
7632
|
+
return lines.join("\n");
|
|
7633
|
+
}
|
|
7634
|
+
function createAdviseSkillsCommand() {
|
|
7635
|
+
return new Command2("advise-skills").description("Content-based skill recommendations for a spec").requiredOption("--spec-path <path>", "Path to the spec (proposal.md)").option("--thorough", "Include Consider tier in output").option("--top <n>", "Max skills per tier (default 5)", parseInt).option("--json", "Output as JSON").action(async (opts) => {
|
|
7636
|
+
try {
|
|
7637
|
+
const { result, skillsMdPath, featureName, totalSkills } = await runAdviseSkills({
|
|
7638
|
+
specPath: opts.specPath,
|
|
7639
|
+
thorough: opts.thorough,
|
|
7640
|
+
top: opts.top
|
|
7641
|
+
});
|
|
7642
|
+
if (opts.json) {
|
|
7643
|
+
logger.info(JSON.stringify(result, null, 2));
|
|
7644
|
+
} else {
|
|
7645
|
+
logger.info(formatOutput(featureName, result, skillsMdPath, totalSkills));
|
|
7646
|
+
}
|
|
7647
|
+
} catch (err) {
|
|
7648
|
+
logger.error(err.message);
|
|
7649
|
+
process.exit(1);
|
|
7650
|
+
}
|
|
7651
|
+
});
|
|
7652
|
+
}
|
|
7653
|
+
|
|
7654
|
+
// src/mcp/tools/advise-skills.ts
|
|
7655
|
+
var adviseSkillsDefinition = {
|
|
7656
|
+
name: "advise_skills",
|
|
7657
|
+
description: "Content-based skill recommendations for a spec or feature description. Returns tiered matches with purpose and timing guidance.",
|
|
7658
|
+
inputSchema: {
|
|
7659
|
+
type: "object",
|
|
7660
|
+
properties: {
|
|
7661
|
+
path: {
|
|
7662
|
+
type: "string",
|
|
7663
|
+
description: "Project root path (defaults to cwd)"
|
|
7664
|
+
},
|
|
7665
|
+
specPath: {
|
|
7666
|
+
type: "string",
|
|
7667
|
+
description: "Path to the spec file (proposal.md), relative to project root"
|
|
7668
|
+
},
|
|
7669
|
+
thorough: {
|
|
7670
|
+
type: "boolean",
|
|
7671
|
+
description: "Include Consider tier in output"
|
|
7672
|
+
},
|
|
7673
|
+
top: {
|
|
7674
|
+
type: "number",
|
|
7675
|
+
description: "Max skills per tier (default 5 apply, 10 reference)"
|
|
7676
|
+
}
|
|
7677
|
+
},
|
|
7678
|
+
required: ["specPath"]
|
|
7679
|
+
}
|
|
7680
|
+
};
|
|
7681
|
+
async function handleAdviseSkills(input) {
|
|
7682
|
+
const projectRoot = input.path || process.cwd();
|
|
7683
|
+
const specRelPath = input.specPath;
|
|
7684
|
+
const thorough = input.thorough || false;
|
|
7685
|
+
const top = input.top || 5;
|
|
7686
|
+
try {
|
|
7687
|
+
const { result, skillsMdPath, featureName, totalSkills } = await runAdviseSkills({
|
|
7688
|
+
specPath: specRelPath,
|
|
7689
|
+
cwd: projectRoot,
|
|
7690
|
+
thorough,
|
|
7691
|
+
top
|
|
7692
|
+
});
|
|
7693
|
+
const response = {
|
|
7694
|
+
featureName,
|
|
7695
|
+
skillsPath: path21.relative(projectRoot, skillsMdPath).replaceAll("\\", "/"),
|
|
7696
|
+
totalScanned: totalSkills,
|
|
7697
|
+
scanDuration: result.scanDuration,
|
|
7698
|
+
apply: result.matches.filter((m) => m.tier === "apply").map((m) => ({
|
|
7699
|
+
skill: m.skillName,
|
|
7700
|
+
score: m.score,
|
|
7701
|
+
when: m.when,
|
|
7702
|
+
reasons: m.matchReasons
|
|
7703
|
+
})),
|
|
7704
|
+
reference: result.matches.filter((m) => m.tier === "reference").map((m) => ({
|
|
7705
|
+
skill: m.skillName,
|
|
7706
|
+
score: m.score,
|
|
7707
|
+
when: m.when,
|
|
7708
|
+
reasons: m.matchReasons
|
|
7709
|
+
})),
|
|
7710
|
+
consider: result.matches.filter((m) => m.tier === "consider").map((m) => ({
|
|
7711
|
+
skill: m.skillName,
|
|
7712
|
+
score: m.score,
|
|
7713
|
+
when: m.when,
|
|
7714
|
+
reasons: m.matchReasons
|
|
7715
|
+
}))
|
|
7716
|
+
};
|
|
7717
|
+
return {
|
|
7718
|
+
content: [{ type: "text", text: JSON.stringify(response, null, 2) }]
|
|
7719
|
+
};
|
|
7720
|
+
} catch (err) {
|
|
7721
|
+
return {
|
|
7722
|
+
content: [{ type: "text", text: JSON.stringify({ error: err.message }) }]
|
|
7723
|
+
};
|
|
7724
|
+
}
|
|
7725
|
+
}
|
|
7726
|
+
|
|
7031
7727
|
// src/mcp/tools/compact.ts
|
|
7032
7728
|
init_dist();
|
|
7033
7729
|
var COMPACT_TOOL_DEFAULT_BUDGET = 2e3;
|
|
@@ -7116,7 +7812,7 @@ function handleContentMode(content, pipeline, budget, source) {
|
|
|
7116
7812
|
};
|
|
7117
7813
|
}
|
|
7118
7814
|
async function handleIntentMode(projectPath, intent, pipeline, budget, filterContent) {
|
|
7119
|
-
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-
|
|
7815
|
+
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-RDXSEBD7.js");
|
|
7120
7816
|
const store = await loadGraphStore2(projectPath);
|
|
7121
7817
|
if (!store) {
|
|
7122
7818
|
return {
|
|
@@ -7129,7 +7825,7 @@ async function handleIntentMode(projectPath, intent, pipeline, budget, filterCon
|
|
|
7129
7825
|
isError: true
|
|
7130
7826
|
};
|
|
7131
7827
|
}
|
|
7132
|
-
const { PackedSummaryCache, FusionLayer, ContextQL } = await import("./dist-
|
|
7828
|
+
const { PackedSummaryCache, FusionLayer, ContextQL } = await import("./dist-NCNAXUFD.js");
|
|
7133
7829
|
const cache = new PackedSummaryCache(store);
|
|
7134
7830
|
const cachedEnvelope = cache.get(intent);
|
|
7135
7831
|
if (cachedEnvelope) {
|
|
@@ -7342,7 +8038,7 @@ async function handleDetectConstraintEmergence(input) {
|
|
|
7342
8038
|
}
|
|
7343
8039
|
const nodePath = await import("path");
|
|
7344
8040
|
const historyPath = nodePath.resolve(projectPath, ".harness/arch/violation-history.json");
|
|
7345
|
-
const { ViolationHistoryManager, detectEmergentConstraints } = await import("./dist-
|
|
8041
|
+
const { ViolationHistoryManager, detectEmergentConstraints } = await import("./dist-CJDGASPP.js");
|
|
7346
8042
|
const manager = new ViolationHistoryManager(historyPath);
|
|
7347
8043
|
const history = manager.load();
|
|
7348
8044
|
const options = { windowWeeks, minOccurrences };
|
|
@@ -7427,6 +8123,7 @@ var TOOL_DEFINITIONS = [
|
|
|
7427
8123
|
checkTraceabilityDefinition,
|
|
7428
8124
|
predictFailuresDefinition,
|
|
7429
8125
|
recommendSkillsDefinition,
|
|
8126
|
+
adviseSkillsDefinition,
|
|
7430
8127
|
computeBlastRadiusDefinition,
|
|
7431
8128
|
dispatchSkillsDefinition,
|
|
7432
8129
|
compactToolDefinition,
|
|
@@ -7487,6 +8184,7 @@ var TOOL_HANDLERS = {
|
|
|
7487
8184
|
check_traceability: handleCheckTraceability,
|
|
7488
8185
|
predict_failures: handlePredictFailures,
|
|
7489
8186
|
recommend_skills: handleRecommendSkills,
|
|
8187
|
+
advise_skills: handleAdviseSkills,
|
|
7490
8188
|
compute_blast_radius: handleComputeBlastRadius,
|
|
7491
8189
|
dispatch_skills: handleDispatchSkills,
|
|
7492
8190
|
compact: handleCompact,
|
|
@@ -7592,7 +8290,7 @@ async function appendUpdateNotification(result, resolvedRoot) {
|
|
|
7592
8290
|
shouldRunCheck,
|
|
7593
8291
|
readCheckState,
|
|
7594
8292
|
spawnBackgroundCheck
|
|
7595
|
-
} = await import("./dist-
|
|
8293
|
+
} = await import("./dist-CJDGASPP.js");
|
|
7596
8294
|
const { CLI_VERSION } = await import("./version-CUI434OP.js");
|
|
7597
8295
|
const configInterval = readConfigInterval(resolvedRoot);
|
|
7598
8296
|
const DEFAULT_INTERVAL = 864e5;
|
|
@@ -7686,6 +8384,8 @@ async function startServer(toolFilter) {
|
|
|
7686
8384
|
}
|
|
7687
8385
|
|
|
7688
8386
|
export {
|
|
8387
|
+
loadOrRebuildIndex,
|
|
8388
|
+
createAdviseSkillsCommand,
|
|
7689
8389
|
generateSlashCommands,
|
|
7690
8390
|
handleOrphanDeletion,
|
|
7691
8391
|
createGenerateSlashCommandsCommand,
|
|
@@ -7693,7 +8393,6 @@ export {
|
|
|
7693
8393
|
persistToolingConfig,
|
|
7694
8394
|
ensureHarnessGitignore,
|
|
7695
8395
|
appendFrameworkAgents,
|
|
7696
|
-
loadOrRebuildIndex,
|
|
7697
8396
|
isSnapshotFresh,
|
|
7698
8397
|
loadCachedSnapshot,
|
|
7699
8398
|
captureHealthSnapshot,
|