@harness-engineering/cli 1.9.0 → 1.10.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-autopilot/SKILL.md +7 -2
- package/dist/agents/skills/claude-code/harness-brainstorming/SKILL.md +10 -1
- package/dist/agents/skills/claude-code/harness-execution/SKILL.md +2 -2
- package/dist/agents/skills/gemini-cli/harness-autopilot/SKILL.md +7 -2
- package/dist/agents/skills/gemini-cli/harness-brainstorming/SKILL.md +10 -1
- package/dist/agents/skills/gemini-cli/harness-execution/SKILL.md +2 -2
- package/dist/agents-md-EMRFLNBC.js +8 -0
- package/dist/architecture-5JNN5L3M.js +13 -0
- package/dist/bin/harness-mcp.d.ts +1 -0
- package/dist/bin/harness-mcp.js +28 -0
- package/dist/bin/harness.js +42 -8
- package/dist/check-phase-gate-WOKIYGAM.js +12 -0
- package/dist/chunk-46YA6FI3.js +293 -0
- package/dist/chunk-4PFMY3H7.js +248 -0
- package/dist/{chunk-6JIT7CEM.js → chunk-72GHBOL2.js} +1 -1
- package/dist/chunk-7X7ZAYMY.js +373 -0
- package/dist/chunk-B7HFEHWP.js +35 -0
- package/dist/chunk-BM3PWGXQ.js +14 -0
- package/dist/chunk-C2ERUR3L.js +255 -0
- package/dist/chunk-CWZ4Y2PO.js +189 -0
- package/dist/{chunk-ULSRSP53.js → chunk-ECUJQS3B.js} +11 -112
- package/dist/chunk-EOLRW32Q.js +72 -0
- package/dist/chunk-F3YDAJFQ.js +125 -0
- package/dist/chunk-F4PTVZWA.js +116 -0
- package/dist/chunk-FPIPT36X.js +187 -0
- package/dist/chunk-FX7SQHGD.js +103 -0
- package/dist/chunk-HIOXKZYF.js +15 -0
- package/dist/chunk-IDZNPTYD.js +16 -0
- package/dist/chunk-JSTQ3AWB.js +31 -0
- package/dist/chunk-K6XAPGML.js +27 -0
- package/dist/chunk-KET4QQZB.js +8 -0
- package/dist/chunk-LXU5M77O.js +4028 -0
- package/dist/chunk-MDUK2J2O.js +67 -0
- package/dist/chunk-MHBMTPW7.js +29 -0
- package/dist/chunk-MO4YQOMB.js +85 -0
- package/dist/chunk-NKDM3FMH.js +52 -0
- package/dist/{chunk-CGSHUJES.js → chunk-NX6DSZSM.js} +7 -26
- package/dist/chunk-OPXH4CQN.js +62 -0
- package/dist/{chunk-RTPHUDZS.js → chunk-PAHHT2IK.js} +466 -2714
- package/dist/chunk-PMTFPOCT.js +122 -0
- package/dist/chunk-PSXF277V.js +89 -0
- package/dist/chunk-Q6AB7W5Z.js +135 -0
- package/dist/chunk-QPEH2QPG.js +347 -0
- package/dist/chunk-TEFCFC4H.js +15 -0
- package/dist/chunk-TRAPF4IX.js +185 -0
- package/dist/chunk-VUCPTQ6G.js +67 -0
- package/dist/chunk-W6Y7ZW3Y.js +13 -0
- package/dist/chunk-ZOAWBDWU.js +72 -0
- package/dist/ci-workflow-ZBBUNTHQ.js +8 -0
- package/dist/constants-5JGUXPEK.js +6 -0
- package/dist/create-skill-LUWO46WF.js +11 -0
- package/dist/dist-D4RYGUZE.js +14 -0
- package/dist/dist-L7LAAQAS.js +18 -0
- package/dist/{dist-C5PYIQPF.js → dist-PBTNVK6K.js} +8 -6
- package/dist/docs-PTJGD6XI.js +12 -0
- package/dist/engine-SCMZ3G3E.js +8 -0
- package/dist/entropy-YIUBGKY7.js +12 -0
- package/dist/feedback-WEVQSLAA.js +18 -0
- package/dist/generate-agent-definitions-BU5LOJTI.js +15 -0
- package/dist/glob-helper-5OHBUQAI.js +52 -0
- package/dist/graph-loader-RLO3KRIX.js +8 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.js +84 -33
- package/dist/loader-6S6PVGSF.js +10 -0
- package/dist/mcp-BNLBTCXZ.js +34 -0
- package/dist/performance-5TVW6SA6.js +24 -0
- package/dist/review-pipeline-4JTQAWKW.js +9 -0
- package/dist/runner-VMYLHWOC.js +6 -0
- package/dist/runtime-PXIM7UV6.js +9 -0
- package/dist/security-URYTKLGK.js +9 -0
- package/dist/skill-executor-KVS47DAU.js +8 -0
- package/dist/validate-KSDUUK2M.js +12 -0
- package/dist/validate-cross-check-WZAX357V.js +8 -0
- package/dist/version-KFFPOQAX.js +6 -0
- package/package.json +6 -4
- package/dist/create-skill-UZOHMXRU.js +0 -8
- package/dist/validate-cross-check-VG573VZO.js +0 -7
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// src/skill/schema.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var SkillPhaseSchema = z.object({
|
|
4
|
+
name: z.string(),
|
|
5
|
+
description: z.string(),
|
|
6
|
+
required: z.boolean().default(true)
|
|
7
|
+
});
|
|
8
|
+
var SkillCliSchema = z.object({
|
|
9
|
+
command: z.string(),
|
|
10
|
+
args: z.array(
|
|
11
|
+
z.object({
|
|
12
|
+
name: z.string(),
|
|
13
|
+
description: z.string(),
|
|
14
|
+
required: z.boolean().default(false)
|
|
15
|
+
})
|
|
16
|
+
).default([])
|
|
17
|
+
});
|
|
18
|
+
var SkillMcpSchema = z.object({
|
|
19
|
+
tool: z.string(),
|
|
20
|
+
input: z.record(z.string())
|
|
21
|
+
});
|
|
22
|
+
var SkillStateSchema = z.object({
|
|
23
|
+
persistent: z.boolean().default(false),
|
|
24
|
+
files: z.array(z.string()).default([])
|
|
25
|
+
});
|
|
26
|
+
var ALLOWED_TRIGGERS = [
|
|
27
|
+
"manual",
|
|
28
|
+
"on_pr",
|
|
29
|
+
"on_commit",
|
|
30
|
+
"on_new_feature",
|
|
31
|
+
"on_bug_fix",
|
|
32
|
+
"on_refactor",
|
|
33
|
+
"on_project_init",
|
|
34
|
+
"on_review",
|
|
35
|
+
"on_milestone",
|
|
36
|
+
"on_task_complete",
|
|
37
|
+
"on_doc_check"
|
|
38
|
+
];
|
|
39
|
+
var ALLOWED_PLATFORMS = ["claude-code", "gemini-cli"];
|
|
40
|
+
var ALLOWED_COGNITIVE_MODES = [
|
|
41
|
+
"adversarial-reviewer",
|
|
42
|
+
"constructive-architect",
|
|
43
|
+
"meticulous-implementer",
|
|
44
|
+
"diagnostic-investigator",
|
|
45
|
+
"advisory-guide",
|
|
46
|
+
"meticulous-verifier"
|
|
47
|
+
];
|
|
48
|
+
var SkillMetadataSchema = z.object({
|
|
49
|
+
name: z.string().regex(/^[a-z][a-z0-9-]*$/, "Name must be lowercase with hyphens"),
|
|
50
|
+
version: z.string().regex(/^\d+\.\d+\.\d+$/, "Version must be semver format"),
|
|
51
|
+
description: z.string(),
|
|
52
|
+
cognitive_mode: z.string().regex(/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/, "Cognitive mode must be kebab-case").optional(),
|
|
53
|
+
triggers: z.array(z.enum(ALLOWED_TRIGGERS)),
|
|
54
|
+
platforms: z.array(z.enum(ALLOWED_PLATFORMS)),
|
|
55
|
+
tools: z.array(z.string()),
|
|
56
|
+
cli: SkillCliSchema.optional(),
|
|
57
|
+
mcp: SkillMcpSchema.optional(),
|
|
58
|
+
type: z.enum(["rigid", "flexible"]),
|
|
59
|
+
phases: z.array(SkillPhaseSchema).optional(),
|
|
60
|
+
state: SkillStateSchema.default({}),
|
|
61
|
+
depends_on: z.array(z.string()).default([])
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
ALLOWED_COGNITIVE_MODES,
|
|
66
|
+
SkillMetadataSchema
|
|
67
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// ../types/dist/index.mjs
|
|
2
|
+
function Ok(value) {
|
|
3
|
+
return { ok: true, value };
|
|
4
|
+
}
|
|
5
|
+
function Err(error) {
|
|
6
|
+
return { ok: false, error };
|
|
7
|
+
}
|
|
8
|
+
function isOk(result) {
|
|
9
|
+
return result.ok === true;
|
|
10
|
+
}
|
|
11
|
+
function isErr(result) {
|
|
12
|
+
return result.ok === false;
|
|
13
|
+
}
|
|
14
|
+
var STANDARD_COGNITIVE_MODES = [
|
|
15
|
+
"adversarial-reviewer",
|
|
16
|
+
"constructive-architect",
|
|
17
|
+
"meticulous-implementer",
|
|
18
|
+
"diagnostic-investigator",
|
|
19
|
+
"advisory-guide",
|
|
20
|
+
"meticulous-verifier"
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
Ok,
|
|
25
|
+
Err,
|
|
26
|
+
isOk,
|
|
27
|
+
isErr,
|
|
28
|
+
STANDARD_COGNITIVE_MODES
|
|
29
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveProjectConfig
|
|
3
|
+
} from "./chunk-K6XAPGML.js";
|
|
4
|
+
import {
|
|
5
|
+
resultToMcpResponse
|
|
6
|
+
} from "./chunk-IDZNPTYD.js";
|
|
7
|
+
import {
|
|
8
|
+
sanitizePath
|
|
9
|
+
} from "./chunk-W6Y7ZW3Y.js";
|
|
10
|
+
|
|
11
|
+
// src/mcp/tools/architecture.ts
|
|
12
|
+
var checkDependenciesDefinition = {
|
|
13
|
+
name: "check_dependencies",
|
|
14
|
+
description: "Validate layer boundaries and detect circular dependencies",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
path: { type: "string", description: "Path to project root" }
|
|
19
|
+
},
|
|
20
|
+
required: ["path"]
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
async function handleCheckDependencies(input) {
|
|
24
|
+
let projectPath;
|
|
25
|
+
try {
|
|
26
|
+
projectPath = sanitizePath(input.path);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: "text",
|
|
32
|
+
text: `Error: ${error instanceof Error ? error.message : String(error)}`
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
isError: true
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const configResult = resolveProjectConfig(projectPath);
|
|
39
|
+
if (!configResult.ok) return resultToMcpResponse(configResult);
|
|
40
|
+
try {
|
|
41
|
+
const { validateDependencies, TypeScriptParser } = await import("./dist-PBTNVK6K.js");
|
|
42
|
+
const config = configResult.value;
|
|
43
|
+
const rawLayers = Array.isArray(config.layers) ? config.layers : [];
|
|
44
|
+
const layers = rawLayers.map((l) => ({
|
|
45
|
+
name: l.name,
|
|
46
|
+
patterns: [l.pattern],
|
|
47
|
+
allowedDependencies: l.allowedDependencies
|
|
48
|
+
}));
|
|
49
|
+
const parser = new TypeScriptParser();
|
|
50
|
+
const { loadGraphStore } = await import("./graph-loader-RLO3KRIX.js");
|
|
51
|
+
const store = await loadGraphStore(projectPath);
|
|
52
|
+
let graphDependencyData;
|
|
53
|
+
if (store) {
|
|
54
|
+
const { GraphConstraintAdapter } = await import("./dist-I7DB5VKB.js");
|
|
55
|
+
const adapter = new GraphConstraintAdapter(store);
|
|
56
|
+
const graphData = adapter.computeDependencyGraph();
|
|
57
|
+
graphDependencyData = {
|
|
58
|
+
nodes: [...graphData.nodes],
|
|
59
|
+
edges: graphData.edges.map((e) => ({ ...e }))
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const result = await validateDependencies({
|
|
63
|
+
layers,
|
|
64
|
+
rootDir: projectPath,
|
|
65
|
+
parser,
|
|
66
|
+
...graphDependencyData !== void 0 && { graphDependencyData }
|
|
67
|
+
});
|
|
68
|
+
return resultToMcpResponse(result);
|
|
69
|
+
} catch (error) {
|
|
70
|
+
return {
|
|
71
|
+
content: [
|
|
72
|
+
{
|
|
73
|
+
type: "text",
|
|
74
|
+
text: `Error: ${error instanceof Error ? error.message : String(error)}`
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
isError: true
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export {
|
|
83
|
+
checkDependenciesDefinition,
|
|
84
|
+
handleCheckDependencies
|
|
85
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Err,
|
|
3
|
+
Ok
|
|
4
|
+
} from "./chunk-MHBMTPW7.js";
|
|
5
|
+
|
|
6
|
+
// src/persona/generators/agents-md.ts
|
|
7
|
+
function formatTrigger(trigger) {
|
|
8
|
+
switch (trigger.event) {
|
|
9
|
+
case "on_pr": {
|
|
10
|
+
const paths = trigger.conditions?.paths?.join(", ") ?? "all files";
|
|
11
|
+
return `On PR (${paths})`;
|
|
12
|
+
}
|
|
13
|
+
case "on_commit": {
|
|
14
|
+
const branches = trigger.conditions?.branches?.join(", ") ?? "all branches";
|
|
15
|
+
return `On commit (${branches})`;
|
|
16
|
+
}
|
|
17
|
+
case "scheduled":
|
|
18
|
+
return `Scheduled (cron: ${trigger.cron})`;
|
|
19
|
+
case "manual":
|
|
20
|
+
return "Manual";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function generateAgentsMd(persona) {
|
|
24
|
+
try {
|
|
25
|
+
const triggers = persona.triggers.map(formatTrigger).join(", ");
|
|
26
|
+
const skills = persona.skills.join(", ");
|
|
27
|
+
const commands = persona.steps.filter((s) => "command" in s).map((s) => `\`harness ${s.command}\``).join(", ");
|
|
28
|
+
const stepSkills = persona.steps.filter((s) => "skill" in s).map((s) => `\`harness skill run ${s.skill}\``).join(", ");
|
|
29
|
+
const allCommands = [commands, stepSkills].filter(Boolean).join(", ");
|
|
30
|
+
const fragment = `## ${persona.name} Agent
|
|
31
|
+
|
|
32
|
+
**Role:** ${persona.role}
|
|
33
|
+
|
|
34
|
+
**Triggers:** ${triggers}
|
|
35
|
+
|
|
36
|
+
**Skills:** ${skills}
|
|
37
|
+
|
|
38
|
+
**When this agent flags an issue:** Fix violations before merging. Run ${allCommands} locally to validate.
|
|
39
|
+
`;
|
|
40
|
+
return Ok(fragment);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
return Err(
|
|
43
|
+
new Error(
|
|
44
|
+
`Failed to generate AGENTS.md fragment: ${error instanceof Error ? error.message : String(error)}`
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
generateAgentsMd
|
|
52
|
+
};
|
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
function Err(error) {
|
|
6
|
-
return { ok: false, error };
|
|
7
|
-
}
|
|
8
|
-
function isOk(result) {
|
|
9
|
-
return result.ok === true;
|
|
10
|
-
}
|
|
11
|
-
function isErr(result) {
|
|
12
|
-
return result.ok === false;
|
|
13
|
-
}
|
|
14
|
-
var STANDARD_COGNITIVE_MODES = [
|
|
15
|
-
"adversarial-reviewer",
|
|
16
|
-
"constructive-architect",
|
|
17
|
-
"meticulous-implementer",
|
|
18
|
-
"diagnostic-investigator",
|
|
19
|
-
"advisory-guide",
|
|
20
|
-
"meticulous-verifier"
|
|
21
|
-
];
|
|
1
|
+
import {
|
|
2
|
+
Err,
|
|
3
|
+
Ok
|
|
4
|
+
} from "./chunk-MHBMTPW7.js";
|
|
22
5
|
|
|
23
6
|
// ../core/dist/index.mjs
|
|
24
7
|
import { access, constants, readFile } from "fs";
|
|
@@ -5057,6 +5040,7 @@ ${entry}`);
|
|
|
5057
5040
|
} else {
|
|
5058
5041
|
fs4.appendFileSync(learningsPath, entry);
|
|
5059
5042
|
}
|
|
5043
|
+
learningsCacheMap.delete(learningsPath);
|
|
5060
5044
|
return Ok(void 0);
|
|
5061
5045
|
} catch (error) {
|
|
5062
5046
|
return Err(
|
|
@@ -5136,6 +5120,7 @@ ${entry}`);
|
|
|
5136
5120
|
} else {
|
|
5137
5121
|
fs4.appendFileSync(failuresPath, entry);
|
|
5138
5122
|
}
|
|
5123
|
+
failuresCacheMap.delete(failuresPath);
|
|
5139
5124
|
return Ok(void 0);
|
|
5140
5125
|
} catch (error) {
|
|
5141
5126
|
return Err(
|
|
@@ -5203,6 +5188,7 @@ async function archiveFailures(projectPath, stream) {
|
|
|
5203
5188
|
counter++;
|
|
5204
5189
|
}
|
|
5205
5190
|
fs4.renameSync(failuresPath, path3.join(archiveDir, archiveName));
|
|
5191
|
+
failuresCacheMap.delete(failuresPath);
|
|
5206
5192
|
return Ok(void 0);
|
|
5207
5193
|
} catch (error) {
|
|
5208
5194
|
return Err(
|
|
@@ -8255,11 +8241,6 @@ Run "harness update" to upgrade.`;
|
|
|
8255
8241
|
var VERSION = "1.8.2";
|
|
8256
8242
|
|
|
8257
8243
|
export {
|
|
8258
|
-
Ok,
|
|
8259
|
-
Err,
|
|
8260
|
-
isOk,
|
|
8261
|
-
isErr,
|
|
8262
|
-
STANDARD_COGNITIVE_MODES,
|
|
8263
8244
|
createError,
|
|
8264
8245
|
validateFileStructure,
|
|
8265
8246
|
validateConfig,
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// src/mcp/utils/graph-loader.ts
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import { stat } from "fs/promises";
|
|
4
|
+
var MAX_CACHE_ENTRIES = 8;
|
|
5
|
+
var cache = /* @__PURE__ */ new Map();
|
|
6
|
+
var pending = /* @__PURE__ */ new Map();
|
|
7
|
+
function clearGraphStoreCache() {
|
|
8
|
+
cache.clear();
|
|
9
|
+
pending.clear();
|
|
10
|
+
}
|
|
11
|
+
function evictIfNeeded() {
|
|
12
|
+
if (cache.size > MAX_CACHE_ENTRIES) {
|
|
13
|
+
const oldest = cache.keys().next().value;
|
|
14
|
+
if (oldest !== void 0) cache.delete(oldest);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
async function doLoadGraphStore(projectRoot) {
|
|
18
|
+
const { GraphStore } = await import("./dist-I7DB5VKB.js");
|
|
19
|
+
const graphDir = path.join(projectRoot, ".harness", "graph");
|
|
20
|
+
const store = new GraphStore();
|
|
21
|
+
const loaded = await store.load(graphDir);
|
|
22
|
+
if (!loaded) return null;
|
|
23
|
+
return store;
|
|
24
|
+
}
|
|
25
|
+
async function loadGraphStore(projectRoot) {
|
|
26
|
+
const graphDir = path.join(projectRoot, ".harness", "graph");
|
|
27
|
+
const graphPath = path.join(graphDir, "graph.json");
|
|
28
|
+
let mtimeMs;
|
|
29
|
+
try {
|
|
30
|
+
const stats = await stat(graphPath);
|
|
31
|
+
mtimeMs = stats.mtimeMs;
|
|
32
|
+
} catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const cached = cache.get(projectRoot);
|
|
36
|
+
if (cached && cached.mtimeMs === mtimeMs) {
|
|
37
|
+
return cached.store;
|
|
38
|
+
}
|
|
39
|
+
const pendingLoad = pending.get(projectRoot);
|
|
40
|
+
let promise;
|
|
41
|
+
if (pendingLoad && pendingLoad.mtimeMs === mtimeMs) {
|
|
42
|
+
promise = pendingLoad.promise;
|
|
43
|
+
} else {
|
|
44
|
+
promise = doLoadGraphStore(projectRoot);
|
|
45
|
+
pending.set(projectRoot, { promise, mtimeMs });
|
|
46
|
+
}
|
|
47
|
+
const store = await promise;
|
|
48
|
+
const currentPending = pending.get(projectRoot);
|
|
49
|
+
if (currentPending && currentPending.promise === promise) {
|
|
50
|
+
pending.delete(projectRoot);
|
|
51
|
+
}
|
|
52
|
+
if (store !== null) {
|
|
53
|
+
cache.set(projectRoot, { store, mtimeMs });
|
|
54
|
+
evictIfNeeded();
|
|
55
|
+
}
|
|
56
|
+
return store;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
clearGraphStoreCache,
|
|
61
|
+
loadGraphStore
|
|
62
|
+
};
|