@harness-engineering/cli 1.20.0 → 1.21.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/skills/claude-code/harness-accessibility/skill.yaml +20 -0
- package/dist/agents/skills/claude-code/harness-design/skill.yaml +20 -0
- package/dist/agents/skills/claude-code/harness-design-mobile/skill.yaml +20 -0
- package/dist/agents/skills/claude-code/harness-design-system/skill.yaml +22 -0
- package/dist/agents/skills/claude-code/harness-design-web/skill.yaml +22 -0
- package/dist/agents/skills/claude-code/harness-diagnostics/skill.yaml +19 -0
- package/dist/agents/skills/claude-code/harness-git-workflow/skill.yaml +15 -0
- package/dist/agents/skills/claude-code/harness-i18n/skill.yaml +22 -0
- package/dist/agents/skills/claude-code/harness-i18n-process/skill.yaml +15 -0
- package/dist/agents/skills/claude-code/harness-i18n-workflow/skill.yaml +19 -0
- package/dist/agents/skills/claude-code/harness-perf-tdd/skill.yaml +20 -0
- package/dist/agents/skills/claude-code/harness-pre-commit-review/skill.yaml +18 -0
- package/dist/agents/skills/claude-code/harness-security-review/skill.yaml +23 -0
- package/dist/agents/skills/codex/harness-accessibility/skill.yaml +20 -0
- package/dist/agents/skills/codex/harness-design/skill.yaml +20 -0
- package/dist/agents/skills/codex/harness-design-mobile/skill.yaml +20 -0
- package/dist/agents/skills/codex/harness-design-system/skill.yaml +22 -0
- package/dist/agents/skills/codex/harness-design-web/skill.yaml +22 -0
- package/dist/agents/skills/codex/harness-diagnostics/skill.yaml +19 -0
- package/dist/agents/skills/codex/harness-git-workflow/skill.yaml +15 -0
- package/dist/agents/skills/codex/harness-i18n/skill.yaml +22 -0
- package/dist/agents/skills/codex/harness-i18n-process/skill.yaml +15 -0
- package/dist/agents/skills/codex/harness-i18n-workflow/skill.yaml +19 -0
- package/dist/agents/skills/codex/harness-perf-tdd/skill.yaml +20 -0
- package/dist/agents/skills/codex/harness-pre-commit-review/skill.yaml +18 -0
- package/dist/agents/skills/codex/harness-security-review/skill.yaml +23 -0
- package/dist/agents/skills/cursor/harness-accessibility/skill.yaml +20 -0
- package/dist/agents/skills/cursor/harness-design/skill.yaml +20 -0
- package/dist/agents/skills/cursor/harness-design-mobile/skill.yaml +20 -0
- package/dist/agents/skills/cursor/harness-design-system/skill.yaml +22 -0
- package/dist/agents/skills/cursor/harness-design-web/skill.yaml +22 -0
- package/dist/agents/skills/cursor/harness-diagnostics/skill.yaml +19 -0
- package/dist/agents/skills/cursor/harness-git-workflow/skill.yaml +15 -0
- package/dist/agents/skills/cursor/harness-i18n/skill.yaml +22 -0
- package/dist/agents/skills/cursor/harness-i18n-process/skill.yaml +15 -0
- package/dist/agents/skills/cursor/harness-i18n-workflow/skill.yaml +19 -0
- package/dist/agents/skills/cursor/harness-perf-tdd/skill.yaml +20 -0
- package/dist/agents/skills/cursor/harness-pre-commit-review/skill.yaml +18 -0
- package/dist/agents/skills/cursor/harness-security-review/skill.yaml +23 -0
- package/dist/agents/skills/gemini-cli/harness-accessibility/skill.yaml +20 -0
- package/dist/agents/skills/gemini-cli/harness-design/skill.yaml +20 -0
- package/dist/agents/skills/gemini-cli/harness-design-mobile/skill.yaml +20 -0
- package/dist/agents/skills/gemini-cli/harness-design-system/skill.yaml +22 -0
- package/dist/agents/skills/gemini-cli/harness-design-web/skill.yaml +22 -0
- package/dist/agents/skills/gemini-cli/harness-diagnostics/skill.yaml +19 -0
- package/dist/agents/skills/gemini-cli/harness-git-workflow/skill.yaml +15 -0
- package/dist/agents/skills/gemini-cli/harness-i18n/skill.yaml +22 -0
- package/dist/agents/skills/gemini-cli/harness-i18n-process/skill.yaml +15 -0
- package/dist/agents/skills/gemini-cli/harness-i18n-workflow/skill.yaml +19 -0
- package/dist/agents/skills/gemini-cli/harness-perf-tdd/skill.yaml +20 -0
- package/dist/agents/skills/gemini-cli/harness-pre-commit-review/skill.yaml +18 -0
- package/dist/agents/skills/gemini-cli/harness-security-review/skill.yaml +23 -0
- package/dist/{agents-md-WHXVPOK2.js → agents-md-TDTLYAQU.js} +1 -1
- package/dist/{architecture-45YCLD26.js → architecture-NANP4XPE.js} +2 -2
- package/dist/bin/harness-mcp.js +11 -11
- package/dist/bin/harness.js +13 -13
- package/dist/{check-phase-gate-2VXVOUJ5.js → check-phase-gate-I4NQOCSU.js} +3 -3
- package/dist/{chunk-V73TEHIF.js → chunk-6GEYPBDU.js} +3 -3
- package/dist/{chunk-PDOSLTWP.js → chunk-7G2ZUTZA.js} +1 -1
- package/dist/{chunk-LEWXD6PR.js → chunk-H6LXAH66.js} +1 -1
- package/dist/{chunk-A33LHIRD.js → chunk-HUDEBSR2.js} +1 -1
- package/dist/{chunk-45ZJPG24.js → chunk-L6LTNZQZ.js} +1 -1
- package/dist/{chunk-LVJ7SCD7.js → chunk-SPUK5W4W.js} +2 -2
- package/dist/{chunk-YDOGGQSF.js → chunk-SZ5TGZMI.js} +1 -1
- package/dist/{chunk-YL4UHE52.js → chunk-TMSGI27F.js} +134 -110
- package/dist/{chunk-RJFWCL6M.js → chunk-UEKQ5G3V.js} +14 -14
- package/dist/{chunk-PDEEQJHH.js → chunk-UVJFBKCX.js} +5 -5
- package/dist/{chunk-4U4V7A6U.js → chunk-WXI5ONCU.js} +2 -2
- package/dist/{chunk-H6KZAGHZ.js → chunk-YF5ROTWR.js} +4 -4
- package/dist/{chunk-IC5CZSHF.js → chunk-YZYBQZVL.js} +10 -6
- package/dist/{ci-workflow-HWX5OVLI.js → ci-workflow-Z4IUJBZL.js} +1 -1
- package/dist/{dist-WHL3NN5S.js → dist-KV2ICL5X.js} +1 -1
- package/dist/{docs-FJFY7GF2.js → docs-2PCZVSGB.js} +3 -3
- package/dist/{engine-R5BZHIZB.js → engine-EOXMI5MD.js} +1 -1
- package/dist/{entropy-Y2GE4MYS.js → entropy-VGXXBIGX.js} +2 -2
- package/dist/{feedback-FKZ7GMPO.js → feedback-VTSPL3O7.js} +1 -1
- package/dist/{generate-agent-definitions-LN3A45OL.js → generate-agent-definitions-QICSCGXB.js} +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.js +13 -13
- package/dist/{loader-2TBQUFWX.js → loader-7S4FYAPP.js} +1 -1
- package/dist/{mcp-I7UP73GV.js → mcp-DF25USTE.js} +11 -11
- package/dist/{performance-BSOMMWK5.js → performance-RV4DUMFI.js} +3 -3
- package/dist/{review-pipeline-KUBHP3RV.js → review-pipeline-7KQJB4SI.js} +1 -1
- package/dist/{runtime-BN7KGJAO.js → runtime-XKOHGGRC.js} +1 -1
- package/dist/{security-3T4JGDZP.js → security-NLWTMK3G.js} +1 -1
- package/dist/{validate-R5WGB2AV.js → validate-VHFE6J6O.js} +2 -2
- package/dist/{validate-cross-check-76Z5P6EX.js → validate-cross-check-PFRKABCS.js} +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
detectEntropyDefinition,
|
|
3
3
|
handleDetectEntropy
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WXI5ONCU.js";
|
|
5
5
|
import {
|
|
6
6
|
checkPerformanceDefinition,
|
|
7
7
|
getCriticalPathsDefinition,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
handleGetPerfBaselines,
|
|
12
12
|
handleUpdatePerfBaselines,
|
|
13
13
|
updatePerfBaselinesDefinition
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UVJFBKCX.js";
|
|
15
15
|
import {
|
|
16
16
|
analyzeDiffDefinition,
|
|
17
17
|
createSelfReviewDefinition,
|
|
@@ -19,15 +19,15 @@ import {
|
|
|
19
19
|
handleCreateSelfReview,
|
|
20
20
|
handleRequestPeerReview,
|
|
21
21
|
requestPeerReviewDefinition
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-6GEYPBDU.js";
|
|
23
23
|
import {
|
|
24
24
|
handleRunSecurityScan,
|
|
25
25
|
runSecurityScanDefinition
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-H6LXAH66.js";
|
|
27
27
|
import {
|
|
28
28
|
handleRunCodeReview,
|
|
29
29
|
runCodeReviewDefinition
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-L6LTNZQZ.js";
|
|
31
31
|
import {
|
|
32
32
|
GENERATED_HEADER_CLAUDE,
|
|
33
33
|
GENERATED_HEADER_CODEX,
|
|
@@ -40,25 +40,25 @@ import {
|
|
|
40
40
|
import {
|
|
41
41
|
handleValidateProject,
|
|
42
42
|
validateToolDefinition
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-SPUK5W4W.js";
|
|
44
44
|
import {
|
|
45
45
|
loadGraphStore
|
|
46
46
|
} from "./chunk-CZZXE6BL.js";
|
|
47
47
|
import {
|
|
48
48
|
checkDependenciesDefinition,
|
|
49
49
|
handleCheckDependencies
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-HUDEBSR2.js";
|
|
51
51
|
import {
|
|
52
52
|
resolveProjectConfig
|
|
53
53
|
} from "./chunk-H7Y5CKTM.js";
|
|
54
54
|
import {
|
|
55
55
|
checkDocsDefinition,
|
|
56
56
|
handleCheckDocs
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-YF5ROTWR.js";
|
|
58
58
|
import {
|
|
59
59
|
TrackerConfigSchema,
|
|
60
60
|
resolveConfig
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-SZ5TGZMI.js";
|
|
62
62
|
import {
|
|
63
63
|
resultToMcpResponse
|
|
64
64
|
} from "./chunk-IDZNPTYD.js";
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
checkTaint,
|
|
88
88
|
scanForInjection,
|
|
89
89
|
writeTaint
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-YZYBQZVL.js";
|
|
91
91
|
import {
|
|
92
92
|
Err,
|
|
93
93
|
Ok
|
|
@@ -150,6 +150,7 @@ function isDestructiveOperation(toolName, toolInput, workspaceRoot) {
|
|
|
150
150
|
function wrapWithInjectionGuard(toolName, handler, options = {}) {
|
|
151
151
|
const projectRoot = options.projectRoot ?? process.cwd();
|
|
152
152
|
const sessionId = options.sessionId ?? "default";
|
|
153
|
+
const trustedOutput = options.trustedOutputTools?.has(toolName) ?? false;
|
|
153
154
|
return async (input) => {
|
|
154
155
|
try {
|
|
155
156
|
const taintCheck = checkTaint(projectRoot, sessionId);
|
|
@@ -181,29 +182,31 @@ function wrapWithInjectionGuard(toolName, handler, options = {}) {
|
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
const result = await handler(input);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
if (actionableOutput.length > 0) {
|
|
191
|
-
writeTaint(
|
|
192
|
-
projectRoot,
|
|
193
|
-
sessionId,
|
|
194
|
-
`Injection pattern detected in MCP:${toolName} result`,
|
|
195
|
-
actionableOutput,
|
|
196
|
-
`MCP:${toolName}:output`
|
|
197
|
-
);
|
|
198
|
-
const warningLines = actionableOutput.map(
|
|
199
|
-
(f) => `Sentinel [${f.severity}] ${f.ruleId}: detected in ${toolName} output`
|
|
185
|
+
if (!trustedOutput) {
|
|
186
|
+
const outputText = extractResultText(result);
|
|
187
|
+
if (outputText) {
|
|
188
|
+
const outputFindings = scanForInjection(outputText);
|
|
189
|
+
const actionableOutput = outputFindings.filter(
|
|
190
|
+
(f) => f.severity === "high" || f.severity === "medium"
|
|
200
191
|
);
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
192
|
+
if (actionableOutput.length > 0) {
|
|
193
|
+
writeTaint(
|
|
194
|
+
projectRoot,
|
|
195
|
+
sessionId,
|
|
196
|
+
`Injection pattern detected in MCP:${toolName} result`,
|
|
197
|
+
actionableOutput,
|
|
198
|
+
`MCP:${toolName}:output`
|
|
199
|
+
);
|
|
200
|
+
const warningLines = actionableOutput.map(
|
|
201
|
+
(f) => `Sentinel [${f.severity}] ${f.ruleId}: detected in ${toolName} output`
|
|
202
|
+
);
|
|
203
|
+
result.content.push({
|
|
204
|
+
type: "text",
|
|
205
|
+
text: `
|
|
204
206
|
---
|
|
205
207
|
Sentinel Warning: ${warningLines.join("; ")}`
|
|
206
|
-
|
|
208
|
+
});
|
|
209
|
+
}
|
|
207
210
|
}
|
|
208
211
|
}
|
|
209
212
|
return result;
|
|
@@ -554,7 +557,7 @@ ${skippedMsg}`
|
|
|
554
557
|
async function handleInitProject(input) {
|
|
555
558
|
const i = input;
|
|
556
559
|
try {
|
|
557
|
-
const { TemplateEngine } = await import("./engine-
|
|
560
|
+
const { TemplateEngine } = await import("./engine-EOXMI5MD.js");
|
|
558
561
|
const engine = new TemplateEngine(resolveTemplatesDir());
|
|
559
562
|
const safePath = sanitizePath(i.path);
|
|
560
563
|
const detected = tryDetectFramework(engine, safePath, i);
|
|
@@ -575,7 +578,7 @@ var listPersonasDefinition = {
|
|
|
575
578
|
inputSchema: { type: "object", properties: {} }
|
|
576
579
|
};
|
|
577
580
|
async function handleListPersonas() {
|
|
578
|
-
const { listPersonas } = await import("./loader-
|
|
581
|
+
const { listPersonas } = await import("./loader-7S4FYAPP.js");
|
|
579
582
|
const result = listPersonas(resolvePersonasDir());
|
|
580
583
|
return resultToMcpResponse(result);
|
|
581
584
|
}
|
|
@@ -599,10 +602,10 @@ async function handleGeneratePersonaArtifacts(input) {
|
|
|
599
602
|
if (!/^[a-z0-9][a-z0-9._-]*$/i.test(input.name)) {
|
|
600
603
|
return resultToMcpResponse(Err(new Error(`Invalid persona name: ${input.name}`)));
|
|
601
604
|
}
|
|
602
|
-
const { loadPersona } = await import("./loader-
|
|
603
|
-
const { generateRuntime } = await import("./runtime-
|
|
604
|
-
const { generateAgentsMd } = await import("./agents-md-
|
|
605
|
-
const { generateCIWorkflow } = await import("./ci-workflow-
|
|
605
|
+
const { loadPersona } = await import("./loader-7S4FYAPP.js");
|
|
606
|
+
const { generateRuntime } = await import("./runtime-XKOHGGRC.js");
|
|
607
|
+
const { generateAgentsMd } = await import("./agents-md-TDTLYAQU.js");
|
|
608
|
+
const { generateCIWorkflow } = await import("./ci-workflow-Z4IUJBZL.js");
|
|
606
609
|
const personasDir = resolvePersonasDir();
|
|
607
610
|
const filePath = path3.join(personasDir, `${input.name}.yaml`);
|
|
608
611
|
if (!filePath.startsWith(personasDir)) {
|
|
@@ -657,7 +660,7 @@ async function handleRunPersona(input) {
|
|
|
657
660
|
if (!/^[a-z0-9][a-z0-9._-]*$/i.test(input.persona)) {
|
|
658
661
|
return resultToMcpResponse(Err(new Error(`Invalid persona name: ${input.persona}`)));
|
|
659
662
|
}
|
|
660
|
-
const { loadPersona } = await import("./loader-
|
|
663
|
+
const { loadPersona } = await import("./loader-7S4FYAPP.js");
|
|
661
664
|
const { runPersona } = await import("./runner-VMYLHWOC.js");
|
|
662
665
|
const { executeSkill } = await import("./skill-executor-XEVDGXUM.js");
|
|
663
666
|
const personasDir = resolvePersonasDir();
|
|
@@ -839,13 +842,27 @@ var TIER_1_SKILLS = /* @__PURE__ */ new Set([
|
|
|
839
842
|
function isTier1Skill(skillName) {
|
|
840
843
|
return TIER_1_SKILLS.has(skillName);
|
|
841
844
|
}
|
|
842
|
-
function scoreSkill(entry, queryTerms, profile, recentFiles) {
|
|
845
|
+
function scoreSkill(entry, queryTerms, profile, recentFiles, skillName) {
|
|
843
846
|
const matchedKeywords = entry.keywords.filter(
|
|
844
847
|
(kw) => queryTerms.some(
|
|
845
848
|
(term) => kw.toLowerCase().includes(term.toLowerCase()) || term.toLowerCase().includes(kw.toLowerCase())
|
|
846
849
|
)
|
|
847
850
|
);
|
|
848
851
|
const keywordScore = queryTerms.length > 0 ? matchedKeywords.length / queryTerms.length : 0;
|
|
852
|
+
let nameScore = 0;
|
|
853
|
+
if (skillName.length > 0 && queryTerms.length > 0) {
|
|
854
|
+
const nameSegments = skillName.toLowerCase().split("-").filter((s) => s.length > 2);
|
|
855
|
+
const matchedNameSegments = queryTerms.filter(
|
|
856
|
+
(term) => nameSegments.some((seg) => seg.includes(term) || term.includes(seg))
|
|
857
|
+
);
|
|
858
|
+
nameScore = matchedNameSegments.length / queryTerms.length;
|
|
859
|
+
}
|
|
860
|
+
let descScore = 0;
|
|
861
|
+
if (queryTerms.length > 0) {
|
|
862
|
+
const descLower = entry.description.toLowerCase();
|
|
863
|
+
const matchedDescTerms = queryTerms.filter((term) => descLower.includes(term));
|
|
864
|
+
descScore = matchedDescTerms.length / queryTerms.length;
|
|
865
|
+
}
|
|
849
866
|
let stackScore = 0;
|
|
850
867
|
if (profile && entry.stackSignals.length > 0) {
|
|
851
868
|
const matchedSignals = entry.stackSignals.filter((signal) => {
|
|
@@ -859,19 +876,19 @@ function scoreSkill(entry, queryTerms, profile, recentFiles) {
|
|
|
859
876
|
let recencyBoost = 0;
|
|
860
877
|
if (recentFiles.length > 0) {
|
|
861
878
|
const hasRecentMatch = entry.stackSignals.some((signal) => {
|
|
862
|
-
const cleanSignal = signal.replace(/\*/g, "")
|
|
879
|
+
const cleanSignal = signal.replace(/\*/g, "");
|
|
863
880
|
return recentFiles.some((f) => f.includes(cleanSignal));
|
|
864
881
|
});
|
|
865
882
|
recencyBoost = hasRecentMatch ? 1 : 0;
|
|
866
883
|
}
|
|
867
|
-
return 0.
|
|
884
|
+
return 0.35 * keywordScore + 0.2 * nameScore + 0.1 * descScore + 0.2 * stackScore + 0.15 * recencyBoost;
|
|
868
885
|
}
|
|
869
886
|
function suggest(index, taskDescription, profile, recentFiles, config) {
|
|
870
887
|
const queryTerms = taskDescription.toLowerCase().split(/\s+/).filter((t) => t.length > 2);
|
|
871
888
|
const scored = [];
|
|
872
889
|
for (const [name, entry] of Object.entries(index.skills)) {
|
|
873
890
|
if (config?.neverSuggest?.includes(name)) continue;
|
|
874
|
-
const score = scoreSkill(entry, queryTerms, profile, recentFiles);
|
|
891
|
+
const score = scoreSkill(entry, queryTerms, profile, recentFiles, name);
|
|
875
892
|
const isForced = config?.alwaysSuggest?.includes(name);
|
|
876
893
|
if (score >= 0.4 || isForced) {
|
|
877
894
|
scored.push({
|
|
@@ -1275,7 +1292,7 @@ async function autoSyncRoadmap(projectPath) {
|
|
|
1275
1292
|
try {
|
|
1276
1293
|
const roadmapFile = path11.join(projectPath, "docs", "roadmap.md");
|
|
1277
1294
|
if (!fs10.existsSync(roadmapFile)) return;
|
|
1278
|
-
const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges } = await import("./dist-
|
|
1295
|
+
const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges } = await import("./dist-KV2ICL5X.js");
|
|
1279
1296
|
const raw = fs10.readFileSync(roadmapFile, "utf-8");
|
|
1280
1297
|
const parseResult = parseRoadmap(raw);
|
|
1281
1298
|
if (!parseResult.ok) return;
|
|
@@ -1302,7 +1319,7 @@ async function triggerExternalSync(projectPath, roadmapFile) {
|
|
|
1302
1319
|
}
|
|
1303
1320
|
const token = process.env.GITHUB_TOKEN;
|
|
1304
1321
|
if (!token) return;
|
|
1305
|
-
const { fullSync, GitHubIssuesSyncAdapter } = await import("./dist-
|
|
1322
|
+
const { fullSync, GitHubIssuesSyncAdapter } = await import("./dist-KV2ICL5X.js");
|
|
1306
1323
|
const adapter = new GitHubIssuesSyncAdapter({
|
|
1307
1324
|
token,
|
|
1308
1325
|
config: trackerConfig
|
|
@@ -1414,12 +1431,12 @@ var manageStateDefinition = {
|
|
|
1414
1431
|
}
|
|
1415
1432
|
};
|
|
1416
1433
|
async function handleShow(projectPath, input) {
|
|
1417
|
-
const { loadState } = await import("./dist-
|
|
1434
|
+
const { loadState } = await import("./dist-KV2ICL5X.js");
|
|
1418
1435
|
return resultToMcpResponse(await loadState(projectPath, input.stream, input.session));
|
|
1419
1436
|
}
|
|
1420
1437
|
async function handleLearn(projectPath, input) {
|
|
1421
1438
|
if (!input.learning) return mcpError("Error: learning is required for learn action");
|
|
1422
|
-
const { appendLearning } = await import("./dist-
|
|
1439
|
+
const { appendLearning } = await import("./dist-KV2ICL5X.js");
|
|
1423
1440
|
const result = await appendLearning(
|
|
1424
1441
|
projectPath,
|
|
1425
1442
|
input.learning,
|
|
@@ -1434,7 +1451,7 @@ async function handleLearn(projectPath, input) {
|
|
|
1434
1451
|
async function handleFailure(projectPath, input) {
|
|
1435
1452
|
if (!input.description) return mcpError("Error: description is required for failure action");
|
|
1436
1453
|
if (!input.failureType) return mcpError("Error: failureType is required for failure action");
|
|
1437
|
-
const { appendFailure } = await import("./dist-
|
|
1454
|
+
const { appendFailure } = await import("./dist-KV2ICL5X.js");
|
|
1438
1455
|
const result = await appendFailure(
|
|
1439
1456
|
projectPath,
|
|
1440
1457
|
input.description,
|
|
@@ -1447,24 +1464,24 @@ async function handleFailure(projectPath, input) {
|
|
|
1447
1464
|
return resultToMcpResponse(Ok({ recorded: true }));
|
|
1448
1465
|
}
|
|
1449
1466
|
async function handleArchive(projectPath, input) {
|
|
1450
|
-
const { archiveFailures } = await import("./dist-
|
|
1467
|
+
const { archiveFailures } = await import("./dist-KV2ICL5X.js");
|
|
1451
1468
|
const result = await archiveFailures(projectPath, input.stream, input.session);
|
|
1452
1469
|
if (!result.ok) return resultToMcpResponse(result);
|
|
1453
1470
|
return resultToMcpResponse(Ok({ archived: true }));
|
|
1454
1471
|
}
|
|
1455
1472
|
async function handleReset(projectPath, input) {
|
|
1456
|
-
const { saveState, DEFAULT_STATE } = await import("./dist-
|
|
1473
|
+
const { saveState, DEFAULT_STATE } = await import("./dist-KV2ICL5X.js");
|
|
1457
1474
|
const result = await saveState(projectPath, { ...DEFAULT_STATE }, input.stream, input.session);
|
|
1458
1475
|
if (!result.ok) return resultToMcpResponse(result);
|
|
1459
1476
|
return resultToMcpResponse(Ok({ reset: true }));
|
|
1460
1477
|
}
|
|
1461
1478
|
async function handleGate(projectPath, _input) {
|
|
1462
|
-
const { runMechanicalGate } = await import("./dist-
|
|
1479
|
+
const { runMechanicalGate } = await import("./dist-KV2ICL5X.js");
|
|
1463
1480
|
return resultToMcpResponse(await runMechanicalGate(projectPath));
|
|
1464
1481
|
}
|
|
1465
1482
|
async function handleSaveHandoff(projectPath, input) {
|
|
1466
1483
|
if (!input.handoff) return mcpError("Error: handoff is required for save-handoff action");
|
|
1467
|
-
const { saveHandoff } = await import("./dist-
|
|
1484
|
+
const { saveHandoff } = await import("./dist-KV2ICL5X.js");
|
|
1468
1485
|
const result = await saveHandoff(
|
|
1469
1486
|
projectPath,
|
|
1470
1487
|
input.handoff,
|
|
@@ -1476,7 +1493,7 @@ async function handleSaveHandoff(projectPath, input) {
|
|
|
1476
1493
|
return resultToMcpResponse(Ok({ saved: true }));
|
|
1477
1494
|
}
|
|
1478
1495
|
async function handleLoadHandoff(projectPath, input) {
|
|
1479
|
-
const { loadHandoff } = await import("./dist-
|
|
1496
|
+
const { loadHandoff } = await import("./dist-KV2ICL5X.js");
|
|
1480
1497
|
return resultToMcpResponse(await loadHandoff(projectPath, input.stream, input.session));
|
|
1481
1498
|
}
|
|
1482
1499
|
async function handleAppendEntry(projectPath, input) {
|
|
@@ -1484,7 +1501,7 @@ async function handleAppendEntry(projectPath, input) {
|
|
|
1484
1501
|
if (!input.section) return mcpError("Error: section is required for append_entry action");
|
|
1485
1502
|
if (!input.authorSkill) return mcpError("Error: authorSkill is required for append_entry action");
|
|
1486
1503
|
if (!input.content) return mcpError("Error: content is required for append_entry action");
|
|
1487
|
-
const { appendSessionEntry } = await import("./dist-
|
|
1504
|
+
const { appendSessionEntry } = await import("./dist-KV2ICL5X.js");
|
|
1488
1505
|
const result = await appendSessionEntry(
|
|
1489
1506
|
projectPath,
|
|
1490
1507
|
input.session,
|
|
@@ -1500,7 +1517,7 @@ async function handleUpdateEntryStatus(projectPath, input) {
|
|
|
1500
1517
|
if (!input.entryId) return mcpError("Error: entryId is required for update_entry_status action");
|
|
1501
1518
|
if (!input.newStatus)
|
|
1502
1519
|
return mcpError("Error: newStatus is required for update_entry_status action");
|
|
1503
|
-
const { updateSessionEntryStatus } = await import("./dist-
|
|
1520
|
+
const { updateSessionEntryStatus } = await import("./dist-KV2ICL5X.js");
|
|
1504
1521
|
const result = await updateSessionEntryStatus(
|
|
1505
1522
|
projectPath,
|
|
1506
1523
|
input.session,
|
|
@@ -1513,7 +1530,7 @@ async function handleUpdateEntryStatus(projectPath, input) {
|
|
|
1513
1530
|
async function handleReadSection(projectPath, input) {
|
|
1514
1531
|
if (!input.session) return mcpError("Error: session is required for read_section action");
|
|
1515
1532
|
if (!input.section) return mcpError("Error: section is required for read_section action");
|
|
1516
|
-
const { readSessionSection } = await import("./dist-
|
|
1533
|
+
const { readSessionSection } = await import("./dist-KV2ICL5X.js");
|
|
1517
1534
|
const result = await readSessionSection(
|
|
1518
1535
|
projectPath,
|
|
1519
1536
|
input.session,
|
|
@@ -1523,13 +1540,13 @@ async function handleReadSection(projectPath, input) {
|
|
|
1523
1540
|
}
|
|
1524
1541
|
async function handleReadSections(projectPath, input) {
|
|
1525
1542
|
if (!input.session) return mcpError("Error: session is required for read_sections action");
|
|
1526
|
-
const { readSessionSections } = await import("./dist-
|
|
1543
|
+
const { readSessionSections } = await import("./dist-KV2ICL5X.js");
|
|
1527
1544
|
const result = await readSessionSections(projectPath, input.session);
|
|
1528
1545
|
return resultToMcpResponse(result);
|
|
1529
1546
|
}
|
|
1530
1547
|
async function handleArchiveSession(projectPath, input) {
|
|
1531
1548
|
if (!input.session) return mcpError("Error: session is required for archive_session action");
|
|
1532
|
-
const { archiveSession } = await import("./dist-
|
|
1549
|
+
const { archiveSession } = await import("./dist-KV2ICL5X.js");
|
|
1533
1550
|
const result = await archiveSession(projectPath, input.session);
|
|
1534
1551
|
if (!result.ok) return resultToMcpResponse(result);
|
|
1535
1552
|
await autoSyncRoadmap(projectPath);
|
|
@@ -1593,7 +1610,7 @@ var listStreamsDefinition = {
|
|
|
1593
1610
|
};
|
|
1594
1611
|
async function handleListStreams(input) {
|
|
1595
1612
|
try {
|
|
1596
|
-
const { listStreams, loadStreamIndex } = await import("./dist-
|
|
1613
|
+
const { listStreams, loadStreamIndex } = await import("./dist-KV2ICL5X.js");
|
|
1597
1614
|
const projectPath = sanitizePath(input.path);
|
|
1598
1615
|
const indexResult = await loadStreamIndex(projectPath);
|
|
1599
1616
|
const streamsResult = await listStreams(projectPath);
|
|
@@ -1631,7 +1648,7 @@ var checkPhaseGateDefinition = {
|
|
|
1631
1648
|
};
|
|
1632
1649
|
async function handleCheckPhaseGate(input) {
|
|
1633
1650
|
try {
|
|
1634
|
-
const { runCheckPhaseGate } = await import("./check-phase-gate-
|
|
1651
|
+
const { runCheckPhaseGate } = await import("./check-phase-gate-I4NQOCSU.js");
|
|
1635
1652
|
const result = await runCheckPhaseGate({ cwd: sanitizePath(input.path) });
|
|
1636
1653
|
if (result.ok) {
|
|
1637
1654
|
return { content: [{ type: "text", text: JSON.stringify(result.value) }] };
|
|
@@ -1687,7 +1704,7 @@ async function handleValidateCrossCheck(input) {
|
|
|
1687
1704
|
};
|
|
1688
1705
|
}
|
|
1689
1706
|
try {
|
|
1690
|
-
const { runCrossCheck } = await import("./validate-cross-check-
|
|
1707
|
+
const { runCrossCheck } = await import("./validate-cross-check-PFRKABCS.js");
|
|
1691
1708
|
const specsDir = path12.resolve(projectPath, input.specsDir ?? "docs/specs");
|
|
1692
1709
|
if (!specsDir.startsWith(projectPath)) {
|
|
1693
1710
|
return {
|
|
@@ -2332,7 +2349,7 @@ async function handleGenerateSlashCommands(input) {
|
|
|
2332
2349
|
// src/mcp/resources/state.ts
|
|
2333
2350
|
async function getStateResource(projectRoot) {
|
|
2334
2351
|
try {
|
|
2335
|
-
const { loadState, migrateToStreams } = await import("./dist-
|
|
2352
|
+
const { loadState, migrateToStreams } = await import("./dist-KV2ICL5X.js");
|
|
2336
2353
|
await migrateToStreams(projectRoot);
|
|
2337
2354
|
const result = await loadState(projectRoot);
|
|
2338
2355
|
if (result.ok) {
|
|
@@ -3151,7 +3168,7 @@ var generateAgentDefinitionsDefinition = {
|
|
|
3151
3168
|
}
|
|
3152
3169
|
};
|
|
3153
3170
|
async function handleGenerateAgentDefinitions(input) {
|
|
3154
|
-
const { generateAgentDefinitions } = await import("./generate-agent-definitions-
|
|
3171
|
+
const { generateAgentDefinitions } = await import("./generate-agent-definitions-QICSCGXB.js");
|
|
3155
3172
|
const platforms = input.platform === "all" || !input.platform ? ["claude-code", "gemini-cli"] : [input.platform];
|
|
3156
3173
|
const results = generateAgentDefinitions({
|
|
3157
3174
|
platforms: [...platforms],
|
|
@@ -3448,7 +3465,7 @@ function handleSync(projectPath, input, deps) {
|
|
|
3448
3465
|
}
|
|
3449
3466
|
async function handleManageRoadmap(input) {
|
|
3450
3467
|
try {
|
|
3451
|
-
const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges } = await import("./dist-
|
|
3468
|
+
const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges } = await import("./dist-KV2ICL5X.js");
|
|
3452
3469
|
const { Ok: Ok2 } = await import("./dist-USY2C5JL.js");
|
|
3453
3470
|
const projectPath = sanitizePath(input.path);
|
|
3454
3471
|
const deps = { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges, Ok: Ok2 };
|
|
@@ -3834,6 +3851,20 @@ var emitInteractionDefinition = {
|
|
|
3834
3851
|
required: ["path", "type"]
|
|
3835
3852
|
}
|
|
3836
3853
|
};
|
|
3854
|
+
function dualContent(prompt, metadata) {
|
|
3855
|
+
return [
|
|
3856
|
+
{
|
|
3857
|
+
type: "text",
|
|
3858
|
+
text: prompt,
|
|
3859
|
+
annotations: { audience: ["user", "assistant"], priority: 1 }
|
|
3860
|
+
},
|
|
3861
|
+
{
|
|
3862
|
+
type: "text",
|
|
3863
|
+
text: JSON.stringify(metadata),
|
|
3864
|
+
annotations: { audience: ["assistant"], priority: 0.2 }
|
|
3865
|
+
}
|
|
3866
|
+
];
|
|
3867
|
+
}
|
|
3837
3868
|
function formatZodErrors(issues) {
|
|
3838
3869
|
return issues.map((i) => i.path.length > 0 ? `${i.path.join(".")}: ${i.message}` : i.message).join("; ");
|
|
3839
3870
|
}
|
|
@@ -3845,7 +3876,7 @@ async function handleQuestion(validInput, projectPath, id) {
|
|
|
3845
3876
|
return mcpError(`Error: ${formatZodErrors(questionResult.error.issues)}`);
|
|
3846
3877
|
const prompt = renderQuestion(questionResult.data);
|
|
3847
3878
|
await recordInteraction(projectPath, id, "question", questionResult.data.text, validInput.stream);
|
|
3848
|
-
return { content:
|
|
3879
|
+
return { content: dualContent(prompt, { id }) };
|
|
3849
3880
|
}
|
|
3850
3881
|
async function handleConfirmation(validInput, projectPath, id) {
|
|
3851
3882
|
if (!validInput.confirmation)
|
|
@@ -3863,7 +3894,7 @@ async function handleConfirmation(validInput, projectPath, id) {
|
|
|
3863
3894
|
confirmResult.data.text,
|
|
3864
3895
|
validInput.stream
|
|
3865
3896
|
);
|
|
3866
|
-
return { content:
|
|
3897
|
+
return { content: dualContent(prompt, { id }) };
|
|
3867
3898
|
}
|
|
3868
3899
|
async function handleTransition(validInput, projectPath, id) {
|
|
3869
3900
|
if (!validInput.transition)
|
|
@@ -3876,7 +3907,7 @@ async function handleTransition(validInput, projectPath, id) {
|
|
|
3876
3907
|
const transition = transitionResult.data;
|
|
3877
3908
|
const prompt = renderTransition(transition);
|
|
3878
3909
|
try {
|
|
3879
|
-
const { saveHandoff } = await import("./dist-
|
|
3910
|
+
const { saveHandoff } = await import("./dist-KV2ICL5X.js");
|
|
3880
3911
|
await saveHandoff(
|
|
3881
3912
|
projectPath,
|
|
3882
3913
|
{
|
|
@@ -3903,12 +3934,12 @@ async function handleTransition(validInput, projectPath, id) {
|
|
|
3903
3934
|
`${transition.completedPhase} -> ${transition.suggestedNext}`,
|
|
3904
3935
|
validInput.stream
|
|
3905
3936
|
);
|
|
3906
|
-
const
|
|
3937
|
+
const metadata = { id, handoffWritten: true };
|
|
3907
3938
|
if (!transition.requiresConfirmation) {
|
|
3908
|
-
|
|
3909
|
-
|
|
3939
|
+
metadata.autoTransition = true;
|
|
3940
|
+
metadata.nextAction = `Invoke harness-${transition.suggestedNext} skill now`;
|
|
3910
3941
|
}
|
|
3911
|
-
return { content:
|
|
3942
|
+
return { content: dualContent(prompt, metadata) };
|
|
3912
3943
|
}
|
|
3913
3944
|
async function handleBatch(validInput, projectPath, id) {
|
|
3914
3945
|
if (!validInput.batch) return mcpError("Error: batch payload is required when type is batch");
|
|
@@ -3919,9 +3950,7 @@ async function handleBatch(validInput, projectPath, id) {
|
|
|
3919
3950
|
);
|
|
3920
3951
|
const prompt = renderBatch(batchResult.data);
|
|
3921
3952
|
await recordInteraction(projectPath, id, "batch", batchResult.data.text, validInput.stream);
|
|
3922
|
-
return {
|
|
3923
|
-
content: [{ type: "text", text: JSON.stringify({ id, prompt, batchMode: true }) }]
|
|
3924
|
-
};
|
|
3953
|
+
return { content: dualContent(prompt, { id, batchMode: true }) };
|
|
3925
3954
|
}
|
|
3926
3955
|
var INTERACTION_HANDLERS = {
|
|
3927
3956
|
question: handleQuestion,
|
|
@@ -3946,7 +3975,7 @@ async function handleEmitInteraction(input) {
|
|
|
3946
3975
|
}
|
|
3947
3976
|
async function recordInteraction(projectPath, id, type, decision, stream) {
|
|
3948
3977
|
try {
|
|
3949
|
-
const { loadState, saveState } = await import("./dist-
|
|
3978
|
+
const { loadState, saveState } = await import("./dist-KV2ICL5X.js");
|
|
3950
3979
|
const stateResult = await loadState(projectPath, stream);
|
|
3951
3980
|
if (stateResult.ok) {
|
|
3952
3981
|
const state = stateResult.value;
|
|
@@ -4035,10 +4064,10 @@ async function handleGatherContext(input) {
|
|
|
4035
4064
|
input.include ?? ["state", "learnings", "handoff", "graph", "validation"]
|
|
4036
4065
|
);
|
|
4037
4066
|
const errors = [];
|
|
4038
|
-
const statePromise = includeSet.has("state") ? import("./dist-
|
|
4067
|
+
const statePromise = includeSet.has("state") ? import("./dist-KV2ICL5X.js").then(
|
|
4039
4068
|
(core) => core.loadState(projectPath, void 0, input.session)
|
|
4040
4069
|
) : Promise.resolve(null);
|
|
4041
|
-
const learningsPromise = includeSet.has("learnings") ? import("./dist-
|
|
4070
|
+
const learningsPromise = includeSet.has("learnings") ? import("./dist-KV2ICL5X.js").then(
|
|
4042
4071
|
(core) => core.loadBudgetedLearnings(projectPath, {
|
|
4043
4072
|
intent: input.intent,
|
|
4044
4073
|
tokenBudget: input.learningsBudget ?? 1e3,
|
|
@@ -4047,7 +4076,7 @@ async function handleGatherContext(input) {
|
|
|
4047
4076
|
...input.depth !== void 0 && { depth: input.depth }
|
|
4048
4077
|
})
|
|
4049
4078
|
) : Promise.resolve(null);
|
|
4050
|
-
const handoffPromise = includeSet.has("handoff") ? import("./dist-
|
|
4079
|
+
const handoffPromise = includeSet.has("handoff") ? import("./dist-KV2ICL5X.js").then(
|
|
4051
4080
|
(core) => core.loadHandoff(projectPath, void 0, input.session)
|
|
4052
4081
|
) : Promise.resolve(null);
|
|
4053
4082
|
const graphPromise = includeSet.has("graph") ? (async () => {
|
|
@@ -4091,11 +4120,11 @@ async function handleGatherContext(input) {
|
|
|
4091
4120
|
context: contextBlocks
|
|
4092
4121
|
};
|
|
4093
4122
|
})() : Promise.resolve(null);
|
|
4094
|
-
const sessionsPromise = includeSet.has("sessions") && input.session ? import("./dist-
|
|
4123
|
+
const sessionsPromise = includeSet.has("sessions") && input.session ? import("./dist-KV2ICL5X.js").then(
|
|
4095
4124
|
(core) => core.readSessionSections(projectPath, input.session)
|
|
4096
4125
|
) : Promise.resolve(null);
|
|
4097
4126
|
const shouldIncludeEvents = input.includeEvents !== void 0 ? input.includeEvents : includeSet.has("events") || !!input.session && !input.include;
|
|
4098
|
-
const eventsPromise = shouldIncludeEvents ? import("./dist-
|
|
4127
|
+
const eventsPromise = shouldIncludeEvents ? import("./dist-KV2ICL5X.js").then(async (core) => {
|
|
4099
4128
|
const result = await core.loadEvents(projectPath, {
|
|
4100
4129
|
session: input.session
|
|
4101
4130
|
});
|
|
@@ -4103,7 +4132,7 @@ async function handleGatherContext(input) {
|
|
|
4103
4132
|
return core.formatEventTimeline(result.value);
|
|
4104
4133
|
}) : Promise.resolve(null);
|
|
4105
4134
|
const validationPromise = includeSet.has("validation") ? (async () => {
|
|
4106
|
-
const { handleValidateProject: handleValidateProject2 } = await import("./validate-
|
|
4135
|
+
const { handleValidateProject: handleValidateProject2 } = await import("./validate-VHFE6J6O.js");
|
|
4107
4136
|
const result = await handleValidateProject2({ path: projectPath });
|
|
4108
4137
|
const first = result.content[0];
|
|
4109
4138
|
return first ? JSON.parse(first.text) : null;
|
|
@@ -4197,7 +4226,7 @@ async function handleGatherContext(input) {
|
|
|
4197
4226
|
};
|
|
4198
4227
|
if (input.session) {
|
|
4199
4228
|
try {
|
|
4200
|
-
const core = await import("./dist-
|
|
4229
|
+
const core = await import("./dist-KV2ICL5X.js");
|
|
4201
4230
|
core.updateSessionIndex(
|
|
4202
4231
|
projectPath,
|
|
4203
4232
|
input.session,
|
|
@@ -4267,7 +4296,7 @@ async function handleAssessProject(input) {
|
|
|
4267
4296
|
let validateResult = null;
|
|
4268
4297
|
if (checksToRun.has("validate")) {
|
|
4269
4298
|
try {
|
|
4270
|
-
const { handleValidateProject: handleValidateProject2 } = await import("./validate-
|
|
4299
|
+
const { handleValidateProject: handleValidateProject2 } = await import("./validate-VHFE6J6O.js");
|
|
4271
4300
|
const result = await handleValidateProject2({ path: projectPath });
|
|
4272
4301
|
const first = result.content[0];
|
|
4273
4302
|
const parsed = first ? JSON.parse(first.text) : {};
|
|
@@ -4292,7 +4321,7 @@ async function handleAssessProject(input) {
|
|
|
4292
4321
|
parallelChecks.push(
|
|
4293
4322
|
(async () => {
|
|
4294
4323
|
try {
|
|
4295
|
-
const { handleCheckDependencies: handleCheckDependencies2 } = await import("./architecture-
|
|
4324
|
+
const { handleCheckDependencies: handleCheckDependencies2 } = await import("./architecture-NANP4XPE.js");
|
|
4296
4325
|
const result = await handleCheckDependencies2({ path: projectPath });
|
|
4297
4326
|
const first = result.content[0];
|
|
4298
4327
|
const parsed = first ? JSON.parse(first.text) : {};
|
|
@@ -4319,7 +4348,7 @@ async function handleAssessProject(input) {
|
|
|
4319
4348
|
parallelChecks.push(
|
|
4320
4349
|
(async () => {
|
|
4321
4350
|
try {
|
|
4322
|
-
const { handleCheckDocs: handleCheckDocs2 } = await import("./docs-
|
|
4351
|
+
const { handleCheckDocs: handleCheckDocs2 } = await import("./docs-2PCZVSGB.js");
|
|
4323
4352
|
const result = await handleCheckDocs2({ path: projectPath, scope: "coverage" });
|
|
4324
4353
|
const first = result.content[0];
|
|
4325
4354
|
const parsed = first ? JSON.parse(first.text) : {};
|
|
@@ -4346,7 +4375,7 @@ async function handleAssessProject(input) {
|
|
|
4346
4375
|
parallelChecks.push(
|
|
4347
4376
|
(async () => {
|
|
4348
4377
|
try {
|
|
4349
|
-
const { handleDetectEntropy: handleDetectEntropy2 } = await import("./entropy-
|
|
4378
|
+
const { handleDetectEntropy: handleDetectEntropy2 } = await import("./entropy-VGXXBIGX.js");
|
|
4350
4379
|
const result = await handleDetectEntropy2({ path: projectPath, type: "all" });
|
|
4351
4380
|
const first = result.content[0];
|
|
4352
4381
|
const parsed = first ? JSON.parse(first.text) : {};
|
|
@@ -4373,7 +4402,7 @@ async function handleAssessProject(input) {
|
|
|
4373
4402
|
parallelChecks.push(
|
|
4374
4403
|
(async () => {
|
|
4375
4404
|
try {
|
|
4376
|
-
const { handleRunSecurityScan: handleRunSecurityScan2 } = await import("./security-
|
|
4405
|
+
const { handleRunSecurityScan: handleRunSecurityScan2 } = await import("./security-NLWTMK3G.js");
|
|
4377
4406
|
const result = await handleRunSecurityScan2({ path: projectPath });
|
|
4378
4407
|
const first = result.content[0];
|
|
4379
4408
|
const parsed = first ? JSON.parse(first.text) : {};
|
|
@@ -4405,7 +4434,7 @@ async function handleAssessProject(input) {
|
|
|
4405
4434
|
parallelChecks.push(
|
|
4406
4435
|
(async () => {
|
|
4407
4436
|
try {
|
|
4408
|
-
const { handleCheckPerformance: handleCheckPerformance2 } = await import("./performance-
|
|
4437
|
+
const { handleCheckPerformance: handleCheckPerformance2 } = await import("./performance-RV4DUMFI.js");
|
|
4409
4438
|
const result = await handleCheckPerformance2({ path: projectPath });
|
|
4410
4439
|
if ("isError" in result && result.isError) {
|
|
4411
4440
|
const msg = result.content[0]?.text ?? "Performance check failed";
|
|
@@ -4608,7 +4637,7 @@ async function handleReviewChanges(input) {
|
|
|
4608
4637
|
}
|
|
4609
4638
|
}
|
|
4610
4639
|
async function runQuickReview(projectPath, diff, diffLines, downgraded) {
|
|
4611
|
-
const { handleAnalyzeDiff: handleAnalyzeDiff2 } = await import("./feedback-
|
|
4640
|
+
const { handleAnalyzeDiff: handleAnalyzeDiff2 } = await import("./feedback-VTSPL3O7.js");
|
|
4612
4641
|
const result = await handleAnalyzeDiff2({ diff, path: projectPath });
|
|
4613
4642
|
const firstContent = result.content[0];
|
|
4614
4643
|
if (!firstContent) throw new Error("Empty analyze_diff response");
|
|
@@ -4639,7 +4668,7 @@ function extractFileCount(diffParsed) {
|
|
|
4639
4668
|
return files?.length ?? 0;
|
|
4640
4669
|
}
|
|
4641
4670
|
async function runStandardReview(projectPath, diff, diffLines, downgraded) {
|
|
4642
|
-
const { handleAnalyzeDiff: handleAnalyzeDiff2, handleCreateSelfReview: handleCreateSelfReview2 } = await import("./feedback-
|
|
4671
|
+
const { handleAnalyzeDiff: handleAnalyzeDiff2, handleCreateSelfReview: handleCreateSelfReview2 } = await import("./feedback-VTSPL3O7.js");
|
|
4643
4672
|
const [diffResult, reviewResult] = await Promise.all([
|
|
4644
4673
|
handleAnalyzeDiff2({ diff, path: projectPath }),
|
|
4645
4674
|
handleCreateSelfReview2({ path: projectPath, diff })
|
|
@@ -4671,7 +4700,7 @@ async function runStandardReview(projectPath, diff, diffLines, downgraded) {
|
|
|
4671
4700
|
};
|
|
4672
4701
|
}
|
|
4673
4702
|
async function runDeepReview(projectPath, diff, diffLines, _downgraded) {
|
|
4674
|
-
const { handleRunCodeReview: handleRunCodeReview2 } = await import("./review-pipeline-
|
|
4703
|
+
const { handleRunCodeReview: handleRunCodeReview2 } = await import("./review-pipeline-7KQJB4SI.js");
|
|
4675
4704
|
const result = await handleRunCodeReview2({ path: projectPath, diff });
|
|
4676
4705
|
const deepContent = result.content[0];
|
|
4677
4706
|
if (!deepContent) throw new Error("Empty code review response");
|
|
@@ -4957,7 +4986,7 @@ async function handleDetectStaleConstraints(input) {
|
|
|
4957
4986
|
]
|
|
4958
4987
|
};
|
|
4959
4988
|
}
|
|
4960
|
-
const { detectStaleConstraints } = await import("./dist-
|
|
4989
|
+
const { detectStaleConstraints } = await import("./dist-KV2ICL5X.js");
|
|
4961
4990
|
const result = detectStaleConstraints(
|
|
4962
4991
|
store,
|
|
4963
4992
|
windowDays,
|
|
@@ -4987,7 +5016,7 @@ async function handleDetectStaleConstraints(input) {
|
|
|
4987
5016
|
// src/mcp/tools/search-skills.ts
|
|
4988
5017
|
var searchSkillsDefinition = {
|
|
4989
5018
|
name: "search_skills",
|
|
4990
|
-
description: "Search the skill catalog for domain-specific skills. Returns ranked results based on keyword and stack-signal matching. Use this to discover catalog skills that are not loaded as slash commands.",
|
|
5019
|
+
description: "Search the skill catalog for domain-specific skills. Returns ranked results based on keyword, name, description, and stack-signal matching. Use this to discover catalog skills that are not loaded as slash commands.",
|
|
4991
5020
|
inputSchema: {
|
|
4992
5021
|
type: "object",
|
|
4993
5022
|
properties: {
|
|
@@ -5019,18 +5048,7 @@ async function handleSearchSkills(input) {
|
|
|
5019
5048
|
const queryTerms = query.toLowerCase().split(/\s+/).filter((t) => t.length > 2);
|
|
5020
5049
|
const results = [];
|
|
5021
5050
|
for (const [name, entry] of Object.entries(index.skills)) {
|
|
5022
|
-
const
|
|
5023
|
-
(kw) => queryTerms.some(
|
|
5024
|
-
(term) => kw.toLowerCase().includes(term.toLowerCase()) || term.toLowerCase().includes(kw.toLowerCase())
|
|
5025
|
-
)
|
|
5026
|
-
);
|
|
5027
|
-
const keywordScore = queryTerms.length > 0 ? matchedKeywords.length / queryTerms.length : 0;
|
|
5028
|
-
let stackScore = 0;
|
|
5029
|
-
if (entry.stackSignals.length > 0) {
|
|
5030
|
-
const matchedSignals = entry.stackSignals.filter((signal) => profile.signals[signal]);
|
|
5031
|
-
stackScore = matchedSignals.length / entry.stackSignals.length;
|
|
5032
|
-
}
|
|
5033
|
-
const score = 0.6 * keywordScore + 0.4 * stackScore;
|
|
5051
|
+
const score = scoreSkill(entry, queryTerms, profile, [], name);
|
|
5034
5052
|
if (score > 0 || queryTerms.length === 0) {
|
|
5035
5053
|
results.push({
|
|
5036
5054
|
name,
|
|
@@ -5089,7 +5107,7 @@ async function handleCodeOutline(input) {
|
|
|
5089
5107
|
};
|
|
5090
5108
|
}
|
|
5091
5109
|
try {
|
|
5092
|
-
const { getOutline, formatOutline, EXTENSION_MAP } = await import("./dist-
|
|
5110
|
+
const { getOutline, formatOutline, EXTENSION_MAP } = await import("./dist-KV2ICL5X.js");
|
|
5093
5111
|
const { stat } = await import("fs/promises");
|
|
5094
5112
|
const stats = await stat(targetPath).catch(() => null);
|
|
5095
5113
|
if (stats?.isFile()) {
|
|
@@ -5169,7 +5187,7 @@ async function handleCodeSearch(input) {
|
|
|
5169
5187
|
};
|
|
5170
5188
|
}
|
|
5171
5189
|
try {
|
|
5172
|
-
const { searchSymbols } = await import("./dist-
|
|
5190
|
+
const { searchSymbols } = await import("./dist-KV2ICL5X.js");
|
|
5173
5191
|
const result = await searchSymbols(input.query, directory, input.glob);
|
|
5174
5192
|
const lines = [`Search: "${result.query}" \u2014 ${result.matches.length} matches`];
|
|
5175
5193
|
for (const match of result.matches) {
|
|
@@ -5238,7 +5256,7 @@ async function handleCodeUnfold(input) {
|
|
|
5238
5256
|
}
|
|
5239
5257
|
try {
|
|
5240
5258
|
if (input.symbol) {
|
|
5241
|
-
const { unfoldSymbol } = await import("./dist-
|
|
5259
|
+
const { unfoldSymbol } = await import("./dist-KV2ICL5X.js");
|
|
5242
5260
|
const result = await unfoldSymbol(filePath, input.symbol);
|
|
5243
5261
|
const header = result.warning ? `${result.file}:${result.startLine}-${result.endLine} ${result.warning}
|
|
5244
5262
|
` : `${result.file}:${result.startLine}-${result.endLine}
|
|
@@ -5246,7 +5264,7 @@ async function handleCodeUnfold(input) {
|
|
|
5246
5264
|
return { content: [{ type: "text", text: header + result.content }] };
|
|
5247
5265
|
}
|
|
5248
5266
|
if (input.startLine != null && input.endLine != null) {
|
|
5249
|
-
const { unfoldRange } = await import("./dist-
|
|
5267
|
+
const { unfoldRange } = await import("./dist-KV2ICL5X.js");
|
|
5250
5268
|
const result = await unfoldRange(filePath, input.startLine, input.endLine);
|
|
5251
5269
|
const header = `${result.file}:${result.startLine}-${result.endLine}
|
|
5252
5270
|
`;
|
|
@@ -5325,7 +5343,7 @@ var TOOL_DEFINITIONS = [
|
|
|
5325
5343
|
codeOutlineDefinition,
|
|
5326
5344
|
codeSearchDefinition,
|
|
5327
5345
|
codeUnfoldDefinition
|
|
5328
|
-
];
|
|
5346
|
+
].map((def) => ({ ...def, trustedOutput: true }));
|
|
5329
5347
|
var TOOL_HANDLERS = {
|
|
5330
5348
|
validate_project: handleValidateProject,
|
|
5331
5349
|
check_dependencies: handleCheckDependencies,
|
|
@@ -5461,7 +5479,7 @@ async function appendUpdateNotification(result, resolvedRoot) {
|
|
|
5461
5479
|
shouldRunCheck,
|
|
5462
5480
|
readCheckState,
|
|
5463
5481
|
spawnBackgroundCheck
|
|
5464
|
-
} = await import("./dist-
|
|
5482
|
+
} = await import("./dist-KV2ICL5X.js");
|
|
5465
5483
|
const { CLI_VERSION } = await import("./version-KFFPOQAX.js");
|
|
5466
5484
|
const configInterval = readConfigInterval(resolvedRoot);
|
|
5467
5485
|
const DEFAULT_INTERVAL = 864e5;
|
|
@@ -5493,7 +5511,13 @@ function createHarnessServer(projectRoot, toolFilter) {
|
|
|
5493
5511
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
5494
5512
|
tools: filteredDefinitions
|
|
5495
5513
|
}));
|
|
5496
|
-
const
|
|
5514
|
+
const trustedOutputTools = new Set(
|
|
5515
|
+
filteredDefinitions.filter((t) => t.trustedOutput === true).map((t) => t.name)
|
|
5516
|
+
);
|
|
5517
|
+
const guardedHandlers = applyInjectionGuard(filteredHandlers, {
|
|
5518
|
+
projectRoot: resolvedRoot,
|
|
5519
|
+
trustedOutputTools
|
|
5520
|
+
});
|
|
5497
5521
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
5498
5522
|
const { name, arguments: args } = request.params;
|
|
5499
5523
|
const handler = guardedHandlers[name];
|