codeharness 0.28.0 → 0.28.2
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.
|
@@ -1957,7 +1957,8 @@ var DEPENDENCY_REGISTRY = [
|
|
|
1957
1957
|
name: "showboat",
|
|
1958
1958
|
displayName: "Showboat",
|
|
1959
1959
|
installCommands: [
|
|
1960
|
-
{ cmd: "
|
|
1960
|
+
{ cmd: "npm", args: ["install", "-g", "showboat"] },
|
|
1961
|
+
{ cmd: "brew", args: ["install", "showboat"] },
|
|
1961
1962
|
{ cmd: "pipx", args: ["install", "showboat"] }
|
|
1962
1963
|
],
|
|
1963
1964
|
checkCommand: { cmd: "showboat", args: ["--version"] },
|
|
@@ -1970,24 +1971,16 @@ var DEPENDENCY_REGISTRY = [
|
|
|
1970
1971
|
{ cmd: "npm", args: ["install", "-g", "@anthropic/agent-browser"] }
|
|
1971
1972
|
],
|
|
1972
1973
|
checkCommand: { cmd: "agent-browser", args: ["--version"] },
|
|
1973
|
-
critical: false
|
|
1974
|
-
|
|
1975
|
-
{
|
|
1976
|
-
name: "beads",
|
|
1977
|
-
displayName: "beads",
|
|
1978
|
-
installCommands: [
|
|
1979
|
-
{ cmd: "pip", args: ["install", "beads"] },
|
|
1980
|
-
{ cmd: "pipx", args: ["install", "beads"] }
|
|
1981
|
-
],
|
|
1982
|
-
checkCommand: { cmd: "bd", args: ["--version"] },
|
|
1983
|
-
critical: false
|
|
1974
|
+
critical: false,
|
|
1975
|
+
stacks: ["nodejs", "python"]
|
|
1984
1976
|
},
|
|
1985
1977
|
{
|
|
1986
1978
|
name: "semgrep",
|
|
1987
1979
|
displayName: "Semgrep",
|
|
1988
1980
|
installCommands: [
|
|
1989
1981
|
{ cmd: "pipx", args: ["install", "semgrep"] },
|
|
1990
|
-
{ cmd: "
|
|
1982
|
+
{ cmd: "uvx", args: ["install", "semgrep"] },
|
|
1983
|
+
{ cmd: "brew", args: ["install", "semgrep"] }
|
|
1991
1984
|
],
|
|
1992
1985
|
checkCommand: { cmd: "semgrep", args: ["--version"] },
|
|
1993
1986
|
critical: false
|
|
@@ -2007,7 +2000,8 @@ var DEPENDENCY_REGISTRY = [
|
|
|
2007
2000
|
displayName: "cargo-tarpaulin",
|
|
2008
2001
|
installCommands: [{ cmd: "cargo", args: ["install", "cargo-tarpaulin"] }],
|
|
2009
2002
|
checkCommand: { cmd: "cargo", args: ["tarpaulin", "--version"] },
|
|
2010
|
-
critical: false
|
|
2003
|
+
critical: false,
|
|
2004
|
+
stacks: ["rust"]
|
|
2011
2005
|
}
|
|
2012
2006
|
];
|
|
2013
2007
|
function checkInstalled(spec) {
|
|
@@ -2023,16 +2017,55 @@ function parseVersion(output) {
|
|
|
2023
2017
|
const match = /(\d+\.\d+[\w.-]*)/.exec(output);
|
|
2024
2018
|
return match ? match[1] : null;
|
|
2025
2019
|
}
|
|
2026
|
-
function
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
return
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2020
|
+
function filterDepsForStacks(stacks) {
|
|
2021
|
+
return DEPENDENCY_REGISTRY.filter((spec) => {
|
|
2022
|
+
if (!spec.stacks) return true;
|
|
2023
|
+
return spec.stacks.some((s) => stacks.includes(s));
|
|
2024
|
+
});
|
|
2025
|
+
}
|
|
2026
|
+
function installAllDependencies(opts) {
|
|
2027
|
+
const specs = opts.stacks ? filterDepsForStacks(opts.stacks) : [...DEPENDENCY_REGISTRY];
|
|
2028
|
+
const results = [];
|
|
2029
|
+
const checks = specs.map((spec) => ({ spec, ...checkInstalled(spec) }));
|
|
2030
|
+
const missing = [];
|
|
2031
|
+
for (const { spec, installed, version } of checks) {
|
|
2032
|
+
if (installed) {
|
|
2033
|
+
const result = {
|
|
2034
|
+
name: spec.name,
|
|
2035
|
+
displayName: spec.displayName,
|
|
2036
|
+
status: "already-installed",
|
|
2037
|
+
version
|
|
2038
|
+
};
|
|
2039
|
+
results.push(result);
|
|
2040
|
+
if (!opts.json) {
|
|
2041
|
+
const versionStr = version ? ` (v${version})` : "";
|
|
2042
|
+
ok(`${spec.displayName}: already installed${versionStr}`);
|
|
2043
|
+
}
|
|
2044
|
+
} else {
|
|
2045
|
+
missing.push(spec);
|
|
2046
|
+
}
|
|
2035
2047
|
}
|
|
2048
|
+
for (const spec of missing) {
|
|
2049
|
+
const result = installMissing(spec);
|
|
2050
|
+
results.push(result);
|
|
2051
|
+
if (!opts.json) {
|
|
2052
|
+
if (result.status === "installed") {
|
|
2053
|
+
const versionStr = result.version ? ` (v${result.version})` : "";
|
|
2054
|
+
ok(`${spec.displayName}: installed${versionStr}`);
|
|
2055
|
+
} else if (result.status === "failed") {
|
|
2056
|
+
fail(`${spec.displayName}: install failed. ${result.error ?? ""}`);
|
|
2057
|
+
if (!spec.critical) {
|
|
2058
|
+
info(`${spec.displayName} is optional \u2014 continuing without it`);
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
if (result.status === "failed" && spec.critical) {
|
|
2063
|
+
throw new CriticalDependencyError(spec.displayName, result.error ?? "Install failed");
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
return results;
|
|
2067
|
+
}
|
|
2068
|
+
function installMissing(spec) {
|
|
2036
2069
|
for (const installCmd of spec.installCommands) {
|
|
2037
2070
|
try {
|
|
2038
2071
|
execFileSync8(installCmd.cmd, installCmd.args, { stdio: "pipe", timeout: 3e5 });
|
|
@@ -2058,31 +2091,6 @@ function installDependency(spec) {
|
|
|
2058
2091
|
error: `Install failed. Try: ${remedy}`
|
|
2059
2092
|
};
|
|
2060
2093
|
}
|
|
2061
|
-
function installAllDependencies(opts) {
|
|
2062
|
-
const results = [];
|
|
2063
|
-
for (const spec of DEPENDENCY_REGISTRY) {
|
|
2064
|
-
const result = installDependency(spec);
|
|
2065
|
-
results.push(result);
|
|
2066
|
-
if (!opts.json) {
|
|
2067
|
-
if (result.status === "installed") {
|
|
2068
|
-
const versionStr = result.version ? ` (v${result.version})` : "";
|
|
2069
|
-
ok(`${spec.displayName}: installed${versionStr}`);
|
|
2070
|
-
} else if (result.status === "already-installed") {
|
|
2071
|
-
const versionStr = result.version ? ` (v${result.version})` : "";
|
|
2072
|
-
ok(`${spec.displayName}: already installed${versionStr}`);
|
|
2073
|
-
} else if (result.status === "failed") {
|
|
2074
|
-
fail(`${spec.displayName}: install failed. ${result.error ?? ""}`);
|
|
2075
|
-
if (!spec.critical) {
|
|
2076
|
-
info(`${spec.displayName} is optional \u2014 continuing without it`);
|
|
2077
|
-
}
|
|
2078
|
-
}
|
|
2079
|
-
}
|
|
2080
|
-
if (result.status === "failed" && spec.critical) {
|
|
2081
|
-
throw new CriticalDependencyError(spec.displayName, result.error ?? "Install failed");
|
|
2082
|
-
}
|
|
2083
|
-
}
|
|
2084
|
-
return results;
|
|
2085
|
-
}
|
|
2086
2094
|
var CriticalDependencyError = class extends Error {
|
|
2087
2095
|
constructor(dependencyName, reason) {
|
|
2088
2096
|
super(`Critical dependency '${dependencyName}' failed to install: ${reason}`);
|
|
@@ -2095,7 +2103,7 @@ var CriticalDependencyError = class extends Error {
|
|
|
2095
2103
|
// src/modules/infra/deps-install.ts
|
|
2096
2104
|
function installDeps(opts) {
|
|
2097
2105
|
try {
|
|
2098
|
-
const depResults = installAllDependencies({ json: opts.isJson });
|
|
2106
|
+
const depResults = installAllDependencies({ json: opts.isJson, stacks: opts.stacks });
|
|
2099
2107
|
return ok2(depResults);
|
|
2100
2108
|
} catch (err) {
|
|
2101
2109
|
if (err instanceof CriticalDependencyError) {
|
|
@@ -2105,9 +2113,10 @@ function installDeps(opts) {
|
|
|
2105
2113
|
return fail2(`Dependency install error: ${message}`);
|
|
2106
2114
|
}
|
|
2107
2115
|
}
|
|
2108
|
-
function verifyDeps(isJson) {
|
|
2116
|
+
function verifyDeps(isJson, stacks) {
|
|
2117
|
+
const specs = stacks ? filterDepsForStacks(stacks) : [...DEPENDENCY_REGISTRY];
|
|
2109
2118
|
const depResults = [];
|
|
2110
|
-
for (const spec of
|
|
2119
|
+
for (const spec of specs) {
|
|
2111
2120
|
const check = checkInstalled(spec);
|
|
2112
2121
|
const depResult = {
|
|
2113
2122
|
name: spec.name,
|
|
@@ -2886,7 +2895,7 @@ function generateDockerfileTemplate(projectDir, stackOrDetections) {
|
|
|
2886
2895
|
}
|
|
2887
2896
|
|
|
2888
2897
|
// src/modules/infra/init-project.ts
|
|
2889
|
-
var HARNESS_VERSION = true ? "0.28.
|
|
2898
|
+
var HARNESS_VERSION = true ? "0.28.2" : "0.0.0-dev";
|
|
2890
2899
|
function failResult(opts, error) {
|
|
2891
2900
|
return {
|
|
2892
2901
|
status: "fail",
|
|
@@ -2988,7 +2997,7 @@ async function initProjectInner(opts) {
|
|
|
2988
2997
|
process.exitCode = 1;
|
|
2989
2998
|
return ok2(result);
|
|
2990
2999
|
}
|
|
2991
|
-
const depResult = installDeps({ isJson });
|
|
3000
|
+
const depResult = installDeps({ isJson, stacks: result.stacks });
|
|
2992
3001
|
if (!isOk(depResult)) {
|
|
2993
3002
|
result.status = "fail";
|
|
2994
3003
|
result.error = depResult.error;
|
|
@@ -3114,7 +3123,7 @@ function handleRerun(opts, result) {
|
|
|
3114
3123
|
result.workflow = { status: "created", path: workflowRelPath };
|
|
3115
3124
|
if (!isJson) ok(`Workflow: ${workflowRelPath} created`);
|
|
3116
3125
|
}
|
|
3117
|
-
result.dependencies = verifyDeps(isJson);
|
|
3126
|
+
result.dependencies = verifyDeps(isJson, result.stacks);
|
|
3118
3127
|
result.docker = existingState.docker ? { compose_file: existingState.docker.compose_file, stack_running: existingState.docker.stack_running, services: [], ports: existingState.docker.ports } : null;
|
|
3119
3128
|
const bmadResult = verifyBmadOnRerun(projectDir, isJson);
|
|
3120
3129
|
if (bmadResult) result.bmad = bmadResult;
|
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
validateDockerfile,
|
|
41
41
|
warn,
|
|
42
42
|
writeState
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-WGRLLVWV.js";
|
|
44
44
|
|
|
45
45
|
// src/index.ts
|
|
46
46
|
import { Command } from "commander";
|
|
@@ -9907,7 +9907,7 @@ function registerTeardownCommand(program) {
|
|
|
9907
9907
|
} else if (otlpMode === "remote-routed") {
|
|
9908
9908
|
if (!options.keepDocker) {
|
|
9909
9909
|
try {
|
|
9910
|
-
const { stopCollectorOnly: stopCollectorOnly2 } = await import("./docker-
|
|
9910
|
+
const { stopCollectorOnly: stopCollectorOnly2 } = await import("./docker-77PSA3RN.js");
|
|
9911
9911
|
stopCollectorOnly2();
|
|
9912
9912
|
result.docker.stopped = true;
|
|
9913
9913
|
if (!isJson) {
|
|
@@ -9939,7 +9939,7 @@ function registerTeardownCommand(program) {
|
|
|
9939
9939
|
info("Shared stack: kept running (other projects may use it)");
|
|
9940
9940
|
}
|
|
9941
9941
|
} else if (isLegacyStack) {
|
|
9942
|
-
const { isStackRunning: isStackRunning2, stopStack } = await import("./docker-
|
|
9942
|
+
const { isStackRunning: isStackRunning2, stopStack } = await import("./docker-77PSA3RN.js");
|
|
9943
9943
|
let stackRunning = false;
|
|
9944
9944
|
try {
|
|
9945
9945
|
stackRunning = isStackRunning2(composeFile);
|
|
@@ -12817,7 +12817,7 @@ function registerDriversCommand(program) {
|
|
|
12817
12817
|
}
|
|
12818
12818
|
|
|
12819
12819
|
// src/index.ts
|
|
12820
|
-
var VERSION = true ? "0.28.
|
|
12820
|
+
var VERSION = true ? "0.28.2" : "0.0.0-dev";
|
|
12821
12821
|
function createProgram() {
|
|
12822
12822
|
const program = new Command();
|
|
12823
12823
|
program.name("codeharness").description("Makes autonomous coding agents produce software that actually works").version(VERSION).option("--json", "Output in machine-readable JSON format");
|
|
@@ -12846,6 +12846,7 @@ function createProgram() {
|
|
|
12846
12846
|
registerStatsCommand(program);
|
|
12847
12847
|
registerIssueCommand(program);
|
|
12848
12848
|
registerDriversCommand(program);
|
|
12849
|
+
ensureDriversRegistered();
|
|
12849
12850
|
return program;
|
|
12850
12851
|
}
|
|
12851
12852
|
if (!process.env["VITEST"]) {
|