codeharness 0.28.0 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1957,8 +1957,10 @@ var DEPENDENCY_REGISTRY = [
1957
1957
  name: "showboat",
1958
1958
  displayName: "Showboat",
1959
1959
  installCommands: [
1960
- { cmd: "pip", args: ["install", "showboat"] },
1961
- { cmd: "pipx", args: ["install", "showboat"] }
1960
+ { cmd: "npx", args: ["showboat", "--version"] },
1961
+ { cmd: "uvx", args: ["install", "showboat"] },
1962
+ { cmd: "pipx", args: ["install", "showboat"] },
1963
+ { cmd: "brew", args: ["install", "showboat"] }
1962
1964
  ],
1963
1965
  checkCommand: { cmd: "showboat", args: ["--version"] },
1964
1966
  critical: false
@@ -1970,24 +1972,16 @@ var DEPENDENCY_REGISTRY = [
1970
1972
  { cmd: "npm", args: ["install", "-g", "@anthropic/agent-browser"] }
1971
1973
  ],
1972
1974
  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
1975
+ critical: false,
1976
+ stacks: ["nodejs", "python"]
1984
1977
  },
1985
1978
  {
1986
1979
  name: "semgrep",
1987
1980
  displayName: "Semgrep",
1988
1981
  installCommands: [
1989
1982
  { cmd: "pipx", args: ["install", "semgrep"] },
1990
- { cmd: "pip", args: ["install", "semgrep"] }
1983
+ { cmd: "uvx", args: ["install", "semgrep"] },
1984
+ { cmd: "brew", args: ["install", "semgrep"] }
1991
1985
  ],
1992
1986
  checkCommand: { cmd: "semgrep", args: ["--version"] },
1993
1987
  critical: false
@@ -2007,7 +2001,8 @@ var DEPENDENCY_REGISTRY = [
2007
2001
  displayName: "cargo-tarpaulin",
2008
2002
  installCommands: [{ cmd: "cargo", args: ["install", "cargo-tarpaulin"] }],
2009
2003
  checkCommand: { cmd: "cargo", args: ["tarpaulin", "--version"] },
2010
- critical: false
2004
+ critical: false,
2005
+ stacks: ["rust"]
2011
2006
  }
2012
2007
  ];
2013
2008
  function checkInstalled(spec) {
@@ -2023,16 +2018,55 @@ function parseVersion(output) {
2023
2018
  const match = /(\d+\.\d+[\w.-]*)/.exec(output);
2024
2019
  return match ? match[1] : null;
2025
2020
  }
2026
- function installDependency(spec) {
2027
- const check = checkInstalled(spec);
2028
- if (check.installed) {
2029
- return {
2030
- name: spec.name,
2031
- displayName: spec.displayName,
2032
- status: "already-installed",
2033
- version: check.version
2034
- };
2021
+ function filterDepsForStacks(stacks) {
2022
+ return DEPENDENCY_REGISTRY.filter((spec) => {
2023
+ if (!spec.stacks) return true;
2024
+ return spec.stacks.some((s) => stacks.includes(s));
2025
+ });
2026
+ }
2027
+ function installAllDependencies(opts) {
2028
+ const specs = opts.stacks ? filterDepsForStacks(opts.stacks) : [...DEPENDENCY_REGISTRY];
2029
+ const results = [];
2030
+ const checks = specs.map((spec) => ({ spec, ...checkInstalled(spec) }));
2031
+ const missing = [];
2032
+ for (const { spec, installed, version } of checks) {
2033
+ if (installed) {
2034
+ const result = {
2035
+ name: spec.name,
2036
+ displayName: spec.displayName,
2037
+ status: "already-installed",
2038
+ version
2039
+ };
2040
+ results.push(result);
2041
+ if (!opts.json) {
2042
+ const versionStr = version ? ` (v${version})` : "";
2043
+ ok(`${spec.displayName}: already installed${versionStr}`);
2044
+ }
2045
+ } else {
2046
+ missing.push(spec);
2047
+ }
2035
2048
  }
2049
+ for (const spec of missing) {
2050
+ const result = installMissing(spec);
2051
+ results.push(result);
2052
+ if (!opts.json) {
2053
+ if (result.status === "installed") {
2054
+ const versionStr = result.version ? ` (v${result.version})` : "";
2055
+ ok(`${spec.displayName}: installed${versionStr}`);
2056
+ } else if (result.status === "failed") {
2057
+ fail(`${spec.displayName}: install failed. ${result.error ?? ""}`);
2058
+ if (!spec.critical) {
2059
+ info(`${spec.displayName} is optional \u2014 continuing without it`);
2060
+ }
2061
+ }
2062
+ }
2063
+ if (result.status === "failed" && spec.critical) {
2064
+ throw new CriticalDependencyError(spec.displayName, result.error ?? "Install failed");
2065
+ }
2066
+ }
2067
+ return results;
2068
+ }
2069
+ function installMissing(spec) {
2036
2070
  for (const installCmd of spec.installCommands) {
2037
2071
  try {
2038
2072
  execFileSync8(installCmd.cmd, installCmd.args, { stdio: "pipe", timeout: 3e5 });
@@ -2058,31 +2092,6 @@ function installDependency(spec) {
2058
2092
  error: `Install failed. Try: ${remedy}`
2059
2093
  };
2060
2094
  }
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
2095
  var CriticalDependencyError = class extends Error {
2087
2096
  constructor(dependencyName, reason) {
2088
2097
  super(`Critical dependency '${dependencyName}' failed to install: ${reason}`);
@@ -2095,7 +2104,7 @@ var CriticalDependencyError = class extends Error {
2095
2104
  // src/modules/infra/deps-install.ts
2096
2105
  function installDeps(opts) {
2097
2106
  try {
2098
- const depResults = installAllDependencies({ json: opts.isJson });
2107
+ const depResults = installAllDependencies({ json: opts.isJson, stacks: opts.stacks });
2099
2108
  return ok2(depResults);
2100
2109
  } catch (err) {
2101
2110
  if (err instanceof CriticalDependencyError) {
@@ -2105,9 +2114,10 @@ function installDeps(opts) {
2105
2114
  return fail2(`Dependency install error: ${message}`);
2106
2115
  }
2107
2116
  }
2108
- function verifyDeps(isJson) {
2117
+ function verifyDeps(isJson, stacks) {
2118
+ const specs = stacks ? filterDepsForStacks(stacks) : [...DEPENDENCY_REGISTRY];
2109
2119
  const depResults = [];
2110
- for (const spec of DEPENDENCY_REGISTRY) {
2120
+ for (const spec of specs) {
2111
2121
  const check = checkInstalled(spec);
2112
2122
  const depResult = {
2113
2123
  name: spec.name,
@@ -2886,7 +2896,7 @@ function generateDockerfileTemplate(projectDir, stackOrDetections) {
2886
2896
  }
2887
2897
 
2888
2898
  // src/modules/infra/init-project.ts
2889
- var HARNESS_VERSION = true ? "0.28.0" : "0.0.0-dev";
2899
+ var HARNESS_VERSION = true ? "0.28.1" : "0.0.0-dev";
2890
2900
  function failResult(opts, error) {
2891
2901
  return {
2892
2902
  status: "fail",
@@ -2988,7 +2998,7 @@ async function initProjectInner(opts) {
2988
2998
  process.exitCode = 1;
2989
2999
  return ok2(result);
2990
3000
  }
2991
- const depResult = installDeps({ isJson });
3001
+ const depResult = installDeps({ isJson, stacks: result.stacks });
2992
3002
  if (!isOk(depResult)) {
2993
3003
  result.status = "fail";
2994
3004
  result.error = depResult.error;
@@ -3114,7 +3124,7 @@ function handleRerun(opts, result) {
3114
3124
  result.workflow = { status: "created", path: workflowRelPath };
3115
3125
  if (!isJson) ok(`Workflow: ${workflowRelPath} created`);
3116
3126
  }
3117
- result.dependencies = verifyDeps(isJson);
3127
+ result.dependencies = verifyDeps(isJson, result.stacks);
3118
3128
  result.docker = existingState.docker ? { compose_file: existingState.docker.compose_file, stack_running: existingState.docker.stack_running, services: [], ports: existingState.docker.ports } : null;
3119
3129
  const bmadResult = verifyBmadOnRerun(projectDir, isJson);
3120
3130
  if (bmadResult) result.bmad = bmadResult;
@@ -16,7 +16,7 @@ import {
16
16
  stopCollectorOnly,
17
17
  stopSharedStack,
18
18
  stopStack
19
- } from "./chunk-2BBYPR57.js";
19
+ } from "./chunk-AK47LBEG.js";
20
20
  export {
21
21
  checkRemoteEndpoint,
22
22
  cleanupOrphanedContainers,
package/dist/index.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  validateDockerfile,
41
41
  warn,
42
42
  writeState
43
- } from "./chunk-2BBYPR57.js";
43
+ } from "./chunk-AK47LBEG.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-72QTSBOK.js");
9910
+ const { stopCollectorOnly: stopCollectorOnly2 } = await import("./docker-IXLAFPH2.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-72QTSBOK.js");
9942
+ const { isStackRunning: isStackRunning2, stopStack } = await import("./docker-IXLAFPH2.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.0" : "0.0.0-dev";
12820
+ var VERSION = true ? "0.28.1" : "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");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeharness",
3
- "version": "0.28.0",
3
+ "version": "0.28.1",
4
4
  "type": "module",
5
5
  "description": "CLI for codeharness — makes autonomous coding agents produce software that actually works",
6
6
  "bin": {