@harness-engineering/cli 3.0.1 → 4.0.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/personas/harness-pm.yaml +33 -0
- package/dist/agents/skills/claude-code/acceptance-eval/SKILL.md +92 -0
- package/dist/agents/skills/claude-code/acceptance-eval/skill.yaml +54 -0
- package/dist/agents/skills/claude-code/harness-brainstorming/SKILL.md +46 -38
- package/dist/agents/skills/claude-code/harness-brainstorming/skill.yaml +1 -0
- package/dist/agents/skills/claude-code/harness-code-review/SKILL.md +10 -11
- package/dist/agents/skills/claude-code/harness-execution/SKILL.md +59 -26
- package/dist/agents/skills/claude-code/harness-integration/SKILL.md +21 -19
- package/dist/agents/skills/claude-code/harness-maintenance-pipeline/SKILL.md +173 -0
- package/dist/agents/skills/claude-code/harness-maintenance-pipeline/skill.yaml +43 -0
- package/dist/agents/skills/claude-code/harness-onboarding/SKILL.md +2 -0
- package/dist/agents/skills/claude-code/harness-planning/SKILL.md +17 -40
- package/dist/agents/skills/claude-code/harness-pulse/SKILL.md +1 -1
- package/dist/agents/skills/claude-code/harness-roadmap/SKILL.md +17 -0
- package/dist/agents/skills/claude-code/harness-roadmap-pilot/SKILL.md +40 -43
- package/dist/agents/skills/claude-code/harness-verification/SKILL.md +9 -12
- package/dist/agents/skills/claude-code/initialize-harness-project/SKILL.md +112 -126
- package/dist/agents/skills/claude-code/outcome-eval/SKILL.md +1 -0
- package/dist/agents/skills/codex/acceptance-eval/SKILL.md +92 -0
- package/dist/agents/skills/codex/acceptance-eval/skill.yaml +54 -0
- package/dist/agents/skills/codex/harness-brainstorming/SKILL.md +46 -38
- package/dist/agents/skills/codex/harness-brainstorming/skill.yaml +1 -0
- package/dist/agents/skills/codex/harness-code-review/SKILL.md +10 -11
- package/dist/agents/skills/codex/harness-execution/SKILL.md +59 -26
- package/dist/agents/skills/codex/harness-integration/SKILL.md +21 -19
- package/dist/agents/skills/codex/harness-maintenance-pipeline/SKILL.md +173 -0
- package/dist/agents/skills/codex/harness-maintenance-pipeline/skill.yaml +43 -0
- package/dist/agents/skills/codex/harness-onboarding/SKILL.md +2 -0
- package/dist/agents/skills/codex/harness-planning/SKILL.md +17 -40
- package/dist/agents/skills/codex/harness-pulse/SKILL.md +1 -1
- package/dist/agents/skills/codex/harness-roadmap/SKILL.md +17 -0
- package/dist/agents/skills/codex/harness-roadmap-pilot/SKILL.md +40 -43
- package/dist/agents/skills/codex/harness-verification/SKILL.md +9 -12
- package/dist/agents/skills/codex/initialize-harness-project/SKILL.md +112 -126
- package/dist/agents/skills/codex/outcome-eval/SKILL.md +1 -0
- package/dist/agents/skills/cursor/acceptance-eval/SKILL.md +92 -0
- package/dist/agents/skills/cursor/acceptance-eval/skill.yaml +54 -0
- package/dist/agents/skills/cursor/harness-brainstorming/SKILL.md +46 -38
- package/dist/agents/skills/cursor/harness-brainstorming/skill.yaml +1 -0
- package/dist/agents/skills/cursor/harness-code-review/SKILL.md +10 -11
- package/dist/agents/skills/cursor/harness-execution/SKILL.md +59 -26
- package/dist/agents/skills/cursor/harness-integration/SKILL.md +21 -19
- package/dist/agents/skills/cursor/harness-maintenance-pipeline/SKILL.md +173 -0
- package/dist/agents/skills/cursor/harness-maintenance-pipeline/skill.yaml +43 -0
- package/dist/agents/skills/cursor/harness-onboarding/SKILL.md +2 -0
- package/dist/agents/skills/cursor/harness-planning/SKILL.md +17 -40
- package/dist/agents/skills/cursor/harness-pulse/SKILL.md +1 -1
- package/dist/agents/skills/cursor/harness-roadmap/SKILL.md +17 -0
- package/dist/agents/skills/cursor/harness-roadmap-pilot/SKILL.md +40 -43
- package/dist/agents/skills/cursor/harness-verification/SKILL.md +9 -12
- package/dist/agents/skills/cursor/initialize-harness-project/SKILL.md +112 -126
- package/dist/agents/skills/cursor/outcome-eval/SKILL.md +1 -0
- package/dist/agents/skills/gemini-cli/acceptance-eval/SKILL.md +92 -0
- package/dist/agents/skills/gemini-cli/acceptance-eval/skill.yaml +54 -0
- package/dist/agents/skills/gemini-cli/harness-brainstorming/SKILL.md +46 -38
- package/dist/agents/skills/gemini-cli/harness-brainstorming/skill.yaml +1 -0
- package/dist/agents/skills/gemini-cli/harness-code-review/SKILL.md +10 -11
- package/dist/agents/skills/gemini-cli/harness-execution/SKILL.md +59 -26
- package/dist/agents/skills/gemini-cli/harness-integration/SKILL.md +21 -19
- package/dist/agents/skills/gemini-cli/harness-maintenance-pipeline/SKILL.md +173 -0
- package/dist/agents/skills/gemini-cli/harness-maintenance-pipeline/skill.yaml +43 -0
- package/dist/agents/skills/gemini-cli/harness-onboarding/SKILL.md +2 -0
- package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +17 -40
- package/dist/agents/skills/gemini-cli/harness-pulse/SKILL.md +1 -1
- package/dist/agents/skills/gemini-cli/harness-roadmap/SKILL.md +17 -0
- package/dist/agents/skills/gemini-cli/harness-roadmap-pilot/SKILL.md +40 -43
- package/dist/agents/skills/gemini-cli/harness-verification/SKILL.md +9 -12
- package/dist/agents/skills/gemini-cli/initialize-harness-project/SKILL.md +112 -126
- package/dist/agents/skills/gemini-cli/outcome-eval/SKILL.md +1 -0
- package/dist/agents/skills/tests/interaction-channel.test.ts +64 -0
- package/dist/{agents-md-XOJE5ETA.js → agents-md-7OSNWU52.js} +2 -2
- package/dist/{architecture-JEZPJ725.js → architecture-2XYGJGT3.js} +3 -3
- package/dist/{assess-project-RHXOQNMM.js → assess-project-3KPP2D6M.js} +1 -1
- package/dist/bin/harness-mcp.js +16 -15
- package/dist/bin/harness.js +27 -25
- package/dist/{check-phase-gate-GNDOMS35.js → check-phase-gate-46U5AAXE.js} +4 -3
- package/dist/{chunk-MGUPSE6D.js → chunk-363V6GPR.js} +5 -5
- package/dist/{chunk-HEIMJJI4.js → chunk-6NCREWWM.js} +2 -2
- package/dist/{chunk-XFU6SB2Q.js → chunk-6YXCZV33.js} +2171 -924
- package/dist/{chunk-HWTUUQOW.js → chunk-AK67S3O4.js} +3 -3
- package/dist/{chunk-BYVT5LVO.js → chunk-BV45354Q.js} +3 -3
- package/dist/{chunk-WWEVS7RO.js → chunk-ERILXQBP.js} +1181 -486
- package/dist/{chunk-UX3PQKVZ.js → chunk-FZ4Q73HA.js} +1 -1
- package/dist/{chunk-Z4AWEIBY.js → chunk-GXCPDAS5.js} +3 -3
- package/dist/{chunk-XX4OLNWQ.js → chunk-HMW3C5DP.js} +2 -2
- package/dist/{chunk-PC2R5RUJ.js → chunk-HXMAIVV2.js} +1 -1
- package/dist/{chunk-QBC7DI4Q.js → chunk-IYWT3JJW.js} +1 -1
- package/dist/{chunk-N24HCQA4.js → chunk-KLPX55TI.js} +3015 -1138
- package/dist/{chunk-527G27VI.js → chunk-MSBJ445U.js} +4 -4
- package/dist/{chunk-NWLGL3IR.js → chunk-MYVTYFQD.js} +2 -2
- package/dist/{chunk-KAJOS3BA.js → chunk-PHX45JYN.js} +5 -9
- package/dist/{chunk-6WQCLCBO.js → chunk-S2RQPPL6.js} +1 -1
- package/dist/chunk-SPE7P4GL.js +61 -0
- package/dist/{chunk-YQSYCBAH.js → chunk-TTWNGOBT.js} +6 -6
- package/dist/{chunk-6B6UN6SG.js → chunk-UTJJJDNN.js} +11 -1
- package/dist/{chunk-WWACIIBA.js → chunk-V3ZQUCRH.js} +1 -1
- package/dist/{chunk-GSP2XIVS.js → chunk-VTU3QOJT.js} +48 -4
- package/dist/{chunk-3ISHDWO7.js → chunk-VTUINXWR.js} +1 -1
- package/dist/{chunk-27AJKSQY.js → chunk-WBVCN35T.js} +1 -1
- package/dist/{chunk-ONCPJGHY.js → chunk-WL3O2PKJ.js} +6 -6
- package/dist/{chunk-GGKRA7A7.js → chunk-XFHZ7GCI.js} +1 -1
- package/dist/chunk-Y6SUQC32.js +9 -0
- package/dist/{chunk-DE5U6KOL.js → chunk-ZEYAOYJL.js} +1 -1
- package/dist/{ci-workflow-ORZ4F45F.js → ci-workflow-XJN4UO3Q.js} +2 -2
- package/dist/{dist-LHINSVK4.js → dist-IPVFYGY2.js} +85 -15
- package/dist/{docs-AU3DXFFO.js → docs-RSFZTNPG.js} +3 -3
- package/dist/{engine-6GPWOYQH.js → engine-DJIHY4JT.js} +2 -2
- package/dist/{entropy-VLKDRMRT.js → entropy-EAEKJKRM.js} +2 -2
- package/dist/{feedback-YXYY44ZC.js → feedback-JT5X3DBC.js} +1 -1
- package/dist/{generate-agent-definitions-XIHQPKG3.js → generate-agent-definitions-CC6KED3E.js} +4 -4
- package/dist/hooks/adoption-tracker.js +6 -5
- package/dist/hooks/format-check.js +202 -0
- package/dist/hooks/protect-config.js +15 -5
- package/dist/hooks/quality-warner.js +32 -0
- package/dist/hooks/strict-quality-gate.js +48 -0
- package/dist/{index-builder-3AOQ3ZII.js → index-builder-52IJJHJC.js} +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.js +27 -25
- package/dist/{loader-YAN56MT3.js → loader-UWNVTYBY.js} +2 -2
- package/dist/{mcp-RK3SFVYB.js → mcp-TCLNK7HG.js} +18 -17
- package/dist/{performance-64DPTLLQ.js → performance-R6O3N3UB.js} +3 -3
- package/dist/{review-pipeline-NENG6LW7.js → review-pipeline-MOOWXWSQ.js} +2 -2
- package/dist/{runtime-FFIIRT2T.js → runtime-RIWQUKBQ.js} +2 -2
- package/dist/{security-3PIBN35B.js → security-U76C54W6.js} +1 -1
- package/dist/{skill-executor-MOCUIAYS.js → skill-executor-BGUCAVBU.js} +2 -2
- package/dist/state-events-F44CUUZG.js +25 -0
- package/dist/{validate-7IAF2ES3.js → validate-IUAV7MOU.js} +3 -3
- package/dist/{validate-cross-check-QPSAOZKD.js → validate-cross-check-M2ZM6RFY.js} +2 -2
- package/package.json +7 -7
- package/dist/hooks/quality-gate.js +0 -131
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveProjectConfig
|
|
3
|
-
} from "./chunk-DE5U6KOL.js";
|
|
4
1
|
import {
|
|
5
2
|
resultToMcpResponse
|
|
6
3
|
} from "./chunk-RC3OI5NK.js";
|
|
4
|
+
import {
|
|
5
|
+
resolveProjectConfig
|
|
6
|
+
} from "./chunk-ZEYAOYJL.js";
|
|
7
7
|
import {
|
|
8
8
|
sanitizePath
|
|
9
9
|
} from "./chunk-W6Y7ZW3Y.js";
|
|
@@ -38,7 +38,7 @@ async function handleCheckDependencies(input) {
|
|
|
38
38
|
const configResult = resolveProjectConfig(projectPath);
|
|
39
39
|
if (!configResult.ok) return resultToMcpResponse(configResult);
|
|
40
40
|
try {
|
|
41
|
-
const { validateDependencies, TypeScriptParser } = await import("./dist-
|
|
41
|
+
const { validateDependencies, TypeScriptParser } = await import("./dist-IPVFYGY2.js");
|
|
42
42
|
const config = configResult.value;
|
|
43
43
|
const rawLayers = Array.isArray(config.layers) ? config.layers : [];
|
|
44
44
|
const layers = rawLayers.map((l) => ({
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
listPersonas,
|
|
6
6
|
loadPersona
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HXMAIVV2.js";
|
|
8
8
|
import {
|
|
9
9
|
GENERATED_HEADER_AGENT,
|
|
10
10
|
VALID_PLATFORMS,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
resolvePersonasDir,
|
|
16
16
|
resolveSkillsDir
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UTJJJDNN.js";
|
|
18
18
|
import {
|
|
19
19
|
CLIError,
|
|
20
20
|
ExitCode,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findFiles
|
|
3
|
+
} from "./chunk-Y6SUQC32.js";
|
|
1
4
|
import {
|
|
2
5
|
resolveConfig
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XFHZ7GCI.js";
|
|
4
7
|
import {
|
|
5
8
|
logger
|
|
6
9
|
} from "./chunk-EBJQ6N4M.js";
|
|
@@ -9,7 +12,7 @@ import {
|
|
|
9
12
|
} from "./chunk-3WGJMBKH.js";
|
|
10
13
|
import {
|
|
11
14
|
init_dist
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-KLPX55TI.js";
|
|
13
16
|
import {
|
|
14
17
|
Ok
|
|
15
18
|
} from "./chunk-BDGTZRZ6.js";
|
|
@@ -20,12 +23,6 @@ import { Command } from "commander";
|
|
|
20
23
|
import * as path from "path";
|
|
21
24
|
import * as fs from "fs";
|
|
22
25
|
|
|
23
|
-
// src/utils/files.ts
|
|
24
|
-
import { glob } from "glob";
|
|
25
|
-
async function findFiles(pattern, cwd = process.cwd()) {
|
|
26
|
-
return glob(pattern, { cwd, absolute: true });
|
|
27
|
-
}
|
|
28
|
-
|
|
29
26
|
// src/output/formatter.ts
|
|
30
27
|
import chalk from "chalk";
|
|
31
28
|
var OutputMode = {
|
|
@@ -248,7 +245,6 @@ function createCheckPhaseGateCommand() {
|
|
|
248
245
|
export {
|
|
249
246
|
OutputMode,
|
|
250
247
|
OutputFormatter,
|
|
251
|
-
findFiles,
|
|
252
248
|
runCheckPhaseGate,
|
|
253
249
|
createCheckPhaseGateCommand
|
|
254
250
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
event_sourcing_exports,
|
|
3
|
+
init_dist
|
|
4
|
+
} from "./chunk-KLPX55TI.js";
|
|
5
|
+
import {
|
|
6
|
+
Ok
|
|
7
|
+
} from "./chunk-BDGTZRZ6.js";
|
|
8
|
+
|
|
9
|
+
// src/shared/state-events.ts
|
|
10
|
+
init_dist();
|
|
11
|
+
var { importLegacyState, readSnapshot, toHarnessState, emitEvent, formatAuditTimeline } = event_sourcing_exports;
|
|
12
|
+
async function readHarnessState(projectPath, scope) {
|
|
13
|
+
await importLegacyState(projectPath, scope);
|
|
14
|
+
const snap = await readSnapshot(projectPath, scope);
|
|
15
|
+
if (!snap.ok) return snap;
|
|
16
|
+
return Ok(toHarnessState(snap.value.coreState));
|
|
17
|
+
}
|
|
18
|
+
function isEmptyHarnessState(s) {
|
|
19
|
+
return s.decisions.length === 0 && s.blockers.length === 0 && Object.keys(s.progress).length === 0 && !s.position.phase && !s.position.task && !s.lastSession;
|
|
20
|
+
}
|
|
21
|
+
async function emitCoreEvent(projectPath, event, scope) {
|
|
22
|
+
await importLegacyState(projectPath, scope);
|
|
23
|
+
return emitEvent(projectPath, event, scope);
|
|
24
|
+
}
|
|
25
|
+
async function emitUserInputCaptured(projectPath, text, interactionId, scope) {
|
|
26
|
+
const payload = interactionId ? { text, interactionId } : { text };
|
|
27
|
+
return emitCoreEvent(
|
|
28
|
+
projectPath,
|
|
29
|
+
{ type: "user_input_captured", payload },
|
|
30
|
+
scope
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
async function emitApprovalRequested(projectPath, interactionId, kind, prompt, scope) {
|
|
34
|
+
return emitCoreEvent(
|
|
35
|
+
projectPath,
|
|
36
|
+
{ type: "approval_requested", payload: { interactionId, kind, prompt } },
|
|
37
|
+
scope
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
async function emitApprovalResolved(projectPath, interactionId, response, scope) {
|
|
41
|
+
return emitCoreEvent(
|
|
42
|
+
projectPath,
|
|
43
|
+
{ type: "approval_resolved", payload: { interactionId, response } },
|
|
44
|
+
scope
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
async function readAuditTimeline(projectPath, scope) {
|
|
48
|
+
const snap = await readSnapshot(projectPath, scope);
|
|
49
|
+
if (!snap.ok) return "";
|
|
50
|
+
return formatAuditTimeline(snap.value.audit);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
readHarnessState,
|
|
55
|
+
isEmptyHarnessState,
|
|
56
|
+
emitCoreEvent,
|
|
57
|
+
emitUserInputCaptured,
|
|
58
|
+
emitApprovalRequested,
|
|
59
|
+
emitApprovalResolved,
|
|
60
|
+
readAuditTimeline
|
|
61
|
+
};
|
|
@@ -75,7 +75,7 @@ async function handleAssessProject(input) {
|
|
|
75
75
|
let validateResult = null;
|
|
76
76
|
if (checksToRun.has("validate")) {
|
|
77
77
|
try {
|
|
78
|
-
const { handleValidateProject } = await import("./validate-
|
|
78
|
+
const { handleValidateProject } = await import("./validate-IUAV7MOU.js");
|
|
79
79
|
const result = await handleValidateProject({ path: projectPath });
|
|
80
80
|
const out = parseToolResponse(result, "validate");
|
|
81
81
|
if ("error" in out) {
|
|
@@ -104,7 +104,7 @@ async function handleAssessProject(input) {
|
|
|
104
104
|
parallelChecks.push(
|
|
105
105
|
(async () => {
|
|
106
106
|
try {
|
|
107
|
-
const { handleCheckDependencies } = await import("./architecture-
|
|
107
|
+
const { handleCheckDependencies } = await import("./architecture-2XYGJGT3.js");
|
|
108
108
|
const result = await handleCheckDependencies({ path: projectPath });
|
|
109
109
|
const out = parseToolResponse(result, "deps");
|
|
110
110
|
if ("error" in out) return out.error;
|
|
@@ -132,7 +132,7 @@ async function handleAssessProject(input) {
|
|
|
132
132
|
parallelChecks.push(
|
|
133
133
|
(async () => {
|
|
134
134
|
try {
|
|
135
|
-
const { handleCheckDocs } = await import("./docs-
|
|
135
|
+
const { handleCheckDocs } = await import("./docs-RSFZTNPG.js");
|
|
136
136
|
const result = await handleCheckDocs({ path: projectPath, scope: "coverage" });
|
|
137
137
|
const out = parseToolResponse(result, "docs");
|
|
138
138
|
if ("error" in out) return out.error;
|
|
@@ -160,7 +160,7 @@ async function handleAssessProject(input) {
|
|
|
160
160
|
parallelChecks.push(
|
|
161
161
|
(async () => {
|
|
162
162
|
try {
|
|
163
|
-
const { handleDetectEntropy } = await import("./entropy-
|
|
163
|
+
const { handleDetectEntropy } = await import("./entropy-EAEKJKRM.js");
|
|
164
164
|
const result = await handleDetectEntropy({ path: projectPath, type: "all" });
|
|
165
165
|
const out = parseToolResponse(result, "entropy");
|
|
166
166
|
if ("error" in out) return out.error;
|
|
@@ -191,7 +191,7 @@ async function handleAssessProject(input) {
|
|
|
191
191
|
parallelChecks.push(
|
|
192
192
|
(async () => {
|
|
193
193
|
try {
|
|
194
|
-
const { handleRunSecurityScan } = await import("./security-
|
|
194
|
+
const { handleRunSecurityScan } = await import("./security-U76C54W6.js");
|
|
195
195
|
const result = await handleRunSecurityScan({ path: projectPath });
|
|
196
196
|
const out = parseToolResponse(result, "security");
|
|
197
197
|
if ("error" in out) return out.error;
|
|
@@ -224,7 +224,7 @@ async function handleAssessProject(input) {
|
|
|
224
224
|
parallelChecks.push(
|
|
225
225
|
(async () => {
|
|
226
226
|
try {
|
|
227
|
-
const { handleCheckPerformance } = await import("./performance-
|
|
227
|
+
const { handleCheckPerformance } = await import("./performance-R6O3N3UB.js");
|
|
228
228
|
const result = await handleCheckPerformance({ path: projectPath });
|
|
229
229
|
if ("isError" in result && result.isError) {
|
|
230
230
|
const msg = result.content[0]?.text ?? "Performance check failed";
|
|
@@ -98,6 +98,15 @@ function resolveAllSkillsDirs(platform = "claude-code") {
|
|
|
98
98
|
}
|
|
99
99
|
return dirs;
|
|
100
100
|
}
|
|
101
|
+
function resolveSkillDir(name, platform = "claude-code") {
|
|
102
|
+
for (const dir of resolveAllSkillsDirs(platform)) {
|
|
103
|
+
const candidate = path.join(dir, name);
|
|
104
|
+
if (fs.existsSync(candidate) && fs.statSync(candidate).isDirectory()) {
|
|
105
|
+
return candidate;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
101
110
|
|
|
102
111
|
export {
|
|
103
112
|
resolveTemplatesDir,
|
|
@@ -108,5 +117,6 @@ export {
|
|
|
108
117
|
resolveCommunitySkillsDir,
|
|
109
118
|
resolveGlobalCommunitySkillsDir,
|
|
110
119
|
resolveGlobalCommunityBaseDir,
|
|
111
|
-
resolveAllSkillsDirs
|
|
120
|
+
resolveAllSkillsDirs,
|
|
121
|
+
resolveSkillDir
|
|
112
122
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_dist
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KLPX55TI.js";
|
|
4
4
|
import {
|
|
5
5
|
Err,
|
|
6
6
|
Ok
|
|
@@ -32,18 +32,62 @@ function buildGitHubTriggers(triggers) {
|
|
|
32
32
|
}
|
|
33
33
|
return on;
|
|
34
34
|
}
|
|
35
|
+
function buildGitLabRules(triggers) {
|
|
36
|
+
const rules = [];
|
|
37
|
+
for (const trigger of triggers) {
|
|
38
|
+
switch (trigger.event) {
|
|
39
|
+
case "on_pr": {
|
|
40
|
+
const rule = {
|
|
41
|
+
if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
42
|
+
};
|
|
43
|
+
if (trigger.conditions?.paths) rule.changes = trigger.conditions.paths;
|
|
44
|
+
rules.push(rule);
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case "on_commit": {
|
|
48
|
+
const branches = trigger.conditions?.branches;
|
|
49
|
+
if (branches?.length) {
|
|
50
|
+
for (const branch of branches) rules.push({ if: `$CI_COMMIT_BRANCH == "${branch}"` });
|
|
51
|
+
} else {
|
|
52
|
+
rules.push({ if: '$CI_PIPELINE_SOURCE == "push"' });
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
case "scheduled":
|
|
57
|
+
rules.push({ if: '$CI_PIPELINE_SOURCE == "schedule"' });
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return rules;
|
|
62
|
+
}
|
|
35
63
|
function generateCIWorkflow(persona, platform) {
|
|
36
64
|
try {
|
|
37
|
-
if (platform === "gitlab") return Err(new Error("GitLab CI generation is not yet supported"));
|
|
38
65
|
const severity = persona.config.severity;
|
|
66
|
+
const severityFlag = severity ? ` --severity ${severity}` : "";
|
|
67
|
+
const commandSteps = persona.steps.filter((s) => "command" in s);
|
|
68
|
+
if (platform === "gitlab") {
|
|
69
|
+
const script = commandSteps.map((step) => `npx harness ${step.command}${severityFlag}`);
|
|
70
|
+
const rules = buildGitLabRules(persona.triggers);
|
|
71
|
+
const enforce = {
|
|
72
|
+
image: "node:20",
|
|
73
|
+
...rules.length ? { rules } : {},
|
|
74
|
+
before_script: ["corepack enable", "pnpm install --frozen-lockfile"],
|
|
75
|
+
// GitLab requires a non-empty `script`; fall back to a no-op when a
|
|
76
|
+
// persona has only skill steps (which CI cannot run).
|
|
77
|
+
script: script.length ? script : ['echo "No command steps to run in CI"']
|
|
78
|
+
};
|
|
79
|
+
const pipeline = {
|
|
80
|
+
workflow: { name: persona.name },
|
|
81
|
+
enforce
|
|
82
|
+
};
|
|
83
|
+
return Ok(YAML.stringify(pipeline, { lineWidth: 0 }));
|
|
84
|
+
}
|
|
39
85
|
const steps = [
|
|
40
86
|
{ uses: "actions/checkout@v4" },
|
|
41
87
|
{ uses: "actions/setup-node@v4", with: { "node-version": "20" } },
|
|
42
88
|
{ uses: "pnpm/action-setup@v4", with: { run_install: "frozen" } }
|
|
43
89
|
];
|
|
44
|
-
const commandSteps = persona.steps.filter((s) => "command" in s);
|
|
45
90
|
for (const step of commandSteps) {
|
|
46
|
-
const severityFlag = severity ? ` --severity ${severity}` : "";
|
|
47
91
|
steps.push({ run: `npx harness ${step.command}${severityFlag}` });
|
|
48
92
|
}
|
|
49
93
|
const workflow = {
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
findConfigFile,
|
|
9
9
|
loadConfig
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XFHZ7GCI.js";
|
|
11
11
|
import {
|
|
12
12
|
init_dist
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KLPX55TI.js";
|
|
14
14
|
import {
|
|
15
15
|
Ok
|
|
16
16
|
} from "./chunk-BDGTZRZ6.js";
|
|
@@ -35,7 +35,7 @@ var checkPerformanceDefinition = {
|
|
|
35
35
|
};
|
|
36
36
|
async function handleCheckPerformance(input) {
|
|
37
37
|
try {
|
|
38
|
-
const { EntropyAnalyzer } = await import("./dist-
|
|
38
|
+
const { EntropyAnalyzer } = await import("./dist-IPVFYGY2.js");
|
|
39
39
|
const typeFilter = input.type ?? "all";
|
|
40
40
|
const projectPath = sanitizePath(input.path);
|
|
41
41
|
let entryPoints;
|
|
@@ -98,7 +98,7 @@ var getPerfBaselinesDefinition = {
|
|
|
98
98
|
};
|
|
99
99
|
async function handleGetPerfBaselines(input) {
|
|
100
100
|
try {
|
|
101
|
-
const { BaselineManager } = await import("./dist-
|
|
101
|
+
const { BaselineManager } = await import("./dist-IPVFYGY2.js");
|
|
102
102
|
const manager = new BaselineManager(sanitizePath(input.path));
|
|
103
103
|
const baselines = manager.load();
|
|
104
104
|
return resultToMcpResponse(
|
|
@@ -146,7 +146,7 @@ var updatePerfBaselinesDefinition = {
|
|
|
146
146
|
};
|
|
147
147
|
async function handleUpdatePerfBaselines(input) {
|
|
148
148
|
try {
|
|
149
|
-
const { BaselineManager } = await import("./dist-
|
|
149
|
+
const { BaselineManager } = await import("./dist-IPVFYGY2.js");
|
|
150
150
|
const manager = new BaselineManager(sanitizePath(input.path));
|
|
151
151
|
manager.save(input.results, input.commitHash);
|
|
152
152
|
const updated = manager.load();
|
|
@@ -176,7 +176,7 @@ var getCriticalPathsDefinition = {
|
|
|
176
176
|
};
|
|
177
177
|
async function handleGetCriticalPaths(input) {
|
|
178
178
|
try {
|
|
179
|
-
const { CriticalPathResolver } = await import("./dist-
|
|
179
|
+
const { CriticalPathResolver } = await import("./dist-IPVFYGY2.js");
|
|
180
180
|
const resolver = new CriticalPathResolver(sanitizePath(input.path));
|
|
181
181
|
const result = await resolver.resolve();
|
|
182
182
|
return resultToMcpResponse(Ok(result));
|