codeharness 0.25.2 → 0.25.4
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.
|
@@ -151,7 +151,10 @@ import { dirname, resolve } from "path";
|
|
|
151
151
|
import { fileURLToPath } from "url";
|
|
152
152
|
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
153
153
|
function getPackageRoot() {
|
|
154
|
-
|
|
154
|
+
if (__dirname.endsWith("/src/lib") || __dirname.endsWith("\\src\\lib")) {
|
|
155
|
+
return resolve(__dirname, "..", "..");
|
|
156
|
+
}
|
|
157
|
+
return resolve(__dirname, "..");
|
|
155
158
|
}
|
|
156
159
|
function generateFile(targetPath, content) {
|
|
157
160
|
mkdirSync2(dirname(targetPath), { recursive: true });
|
|
@@ -3204,7 +3207,7 @@ function generateDockerfileTemplate(projectDir, stackOrDetections) {
|
|
|
3204
3207
|
}
|
|
3205
3208
|
|
|
3206
3209
|
// src/modules/infra/init-project.ts
|
|
3207
|
-
var HARNESS_VERSION = true ? "0.25.
|
|
3210
|
+
var HARNESS_VERSION = true ? "0.25.4" : "0.0.0-dev";
|
|
3208
3211
|
function failResult(opts, error) {
|
|
3209
3212
|
return {
|
|
3210
3213
|
status: "fail",
|
|
@@ -3648,6 +3651,7 @@ export {
|
|
|
3648
3651
|
getStackProvider,
|
|
3649
3652
|
detectStacks,
|
|
3650
3653
|
detectStack,
|
|
3654
|
+
getPackageRoot,
|
|
3651
3655
|
renderTemplateFile,
|
|
3652
3656
|
getStatePath,
|
|
3653
3657
|
writeState,
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
getComposeFilePath,
|
|
18
18
|
getElkComposeFilePath,
|
|
19
19
|
getNestedValue,
|
|
20
|
+
getPackageRoot,
|
|
20
21
|
getStackDir,
|
|
21
22
|
getStackHealth,
|
|
22
23
|
getStackProvider,
|
|
@@ -50,7 +51,7 @@ import {
|
|
|
50
51
|
validateDockerfile,
|
|
51
52
|
warn,
|
|
52
53
|
writeState
|
|
53
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-NVY7K5NE.js";
|
|
54
55
|
|
|
55
56
|
// src/index.ts
|
|
56
57
|
import { Command } from "commander";
|
|
@@ -169,7 +170,7 @@ function registerBridgeCommand(program) {
|
|
|
169
170
|
|
|
170
171
|
// src/commands/run.ts
|
|
171
172
|
import { existsSync as existsSync8, mkdirSync as mkdirSync2, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "fs";
|
|
172
|
-
import { join as join6, dirname as
|
|
173
|
+
import { join as join6, dirname as dirname3 } from "path";
|
|
173
174
|
import { StringDecoder as StringDecoder2 } from "string_decoder";
|
|
174
175
|
|
|
175
176
|
// src/modules/sprint/state.ts
|
|
@@ -1922,8 +1923,7 @@ function parseResultEvent(parsed) {
|
|
|
1922
1923
|
// src/lib/agents/ralph.ts
|
|
1923
1924
|
import { spawn } from "child_process";
|
|
1924
1925
|
import { existsSync as existsSync7 } from "fs";
|
|
1925
|
-
import {
|
|
1926
|
-
import { fileURLToPath } from "url";
|
|
1926
|
+
import { join as join5 } from "path";
|
|
1927
1927
|
var ANSI_ESCAPE = /\x1b\[[0-9;]*m/g;
|
|
1928
1928
|
var TIMESTAMP_PREFIX = /^\[[\d-]+\s[\d:]+\]\s*/;
|
|
1929
1929
|
var SUCCESS_STORY = /\[SUCCESS\]\s+Story\s+([\w-]+):\s+DONE(.*)/;
|
|
@@ -2011,13 +2011,7 @@ function buildSpawnArgs(opts) {
|
|
|
2011
2011
|
return args;
|
|
2012
2012
|
}
|
|
2013
2013
|
function resolveRalphPath() {
|
|
2014
|
-
|
|
2015
|
-
const currentDir = dirname3(currentFile);
|
|
2016
|
-
let root = dirname3(dirname3(currentDir));
|
|
2017
|
-
if (root.endsWith("/src") || root.endsWith("\\src")) {
|
|
2018
|
-
root = dirname3(root);
|
|
2019
|
-
}
|
|
2020
|
-
return join5(root, "ralph", "ralph.sh");
|
|
2014
|
+
return join5(getPackageRoot(), "ralph", "ralph.sh");
|
|
2021
2015
|
}
|
|
2022
2016
|
var RalphDriver = class {
|
|
2023
2017
|
name = "ralph";
|
|
@@ -2279,7 +2273,7 @@ function registerRunCommand(program) {
|
|
|
2279
2273
|
flaggedStories
|
|
2280
2274
|
});
|
|
2281
2275
|
try {
|
|
2282
|
-
mkdirSync2(
|
|
2276
|
+
mkdirSync2(dirname3(promptFile), { recursive: true });
|
|
2283
2277
|
writeFileSync4(promptFile, promptContent, "utf-8");
|
|
2284
2278
|
} catch (err) {
|
|
2285
2279
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -4885,7 +4879,7 @@ function getACById(id) {
|
|
|
4885
4879
|
// src/modules/verify/validation-runner.ts
|
|
4886
4880
|
import { execSync as execSync4 } from "child_process";
|
|
4887
4881
|
import { writeFileSync as writeFileSync11, mkdirSync as mkdirSync5 } from "fs";
|
|
4888
|
-
import { join as join18, dirname as
|
|
4882
|
+
import { join as join18, dirname as dirname4 } from "path";
|
|
4889
4883
|
var MAX_VALIDATION_ATTEMPTS = 10;
|
|
4890
4884
|
var AC_COMMAND_TIMEOUT_MS = 3e4;
|
|
4891
4885
|
var VAL_KEY_PREFIX = "val-";
|
|
@@ -5037,7 +5031,7 @@ function createFixStory(ac, error) {
|
|
|
5037
5031
|
"Fix the root cause so the validation command passes.",
|
|
5038
5032
|
""
|
|
5039
5033
|
].join("\n");
|
|
5040
|
-
mkdirSync5(
|
|
5034
|
+
mkdirSync5(dirname4(storyPath), { recursive: true });
|
|
5041
5035
|
writeFileSync11(storyPath, markdown, "utf-8");
|
|
5042
5036
|
return ok2(storyKey);
|
|
5043
5037
|
} catch (err) {
|
|
@@ -5978,8 +5972,8 @@ function resolveEndpoints(state) {
|
|
|
5978
5972
|
|
|
5979
5973
|
// src/lib/onboard-checks.ts
|
|
5980
5974
|
import { existsSync as existsSync26 } from "fs";
|
|
5981
|
-
import { join as join23, dirname as
|
|
5982
|
-
import { fileURLToPath
|
|
5975
|
+
import { join as join23, dirname as dirname5 } from "path";
|
|
5976
|
+
import { fileURLToPath } from "url";
|
|
5983
5977
|
|
|
5984
5978
|
// src/lib/coverage/parser.ts
|
|
5985
5979
|
import { existsSync as existsSync23, readFileSync as readFileSync20 } from "fs";
|
|
@@ -6417,8 +6411,8 @@ function checkBmadInstalled(dir) {
|
|
|
6417
6411
|
return { ok: isBmadInstalled(dir) };
|
|
6418
6412
|
}
|
|
6419
6413
|
function checkHooksRegistered(dir) {
|
|
6420
|
-
const __filename =
|
|
6421
|
-
const __dirname =
|
|
6414
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6415
|
+
const __dirname = dirname5(__filename);
|
|
6422
6416
|
const hooksPath = join23(__dirname, "..", "..", "hooks", "hooks.json");
|
|
6423
6417
|
return { ok: existsSync26(hooksPath) };
|
|
6424
6418
|
}
|
|
@@ -7257,7 +7251,7 @@ function formatAuditJson(result) {
|
|
|
7257
7251
|
|
|
7258
7252
|
// src/modules/audit/fix-generator.ts
|
|
7259
7253
|
import { existsSync as existsSync28, writeFileSync as writeFileSync13, mkdirSync as mkdirSync7 } from "fs";
|
|
7260
|
-
import { join as join25, dirname as
|
|
7254
|
+
import { join as join25, dirname as dirname6 } from "path";
|
|
7261
7255
|
function buildStoryKey(gap2, index) {
|
|
7262
7256
|
const safeDimension = gap2.dimension.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
7263
7257
|
return `audit-fix-${safeDimension}-${index}`;
|
|
@@ -7311,7 +7305,7 @@ function generateFixStories(auditResult) {
|
|
|
7311
7305
|
continue;
|
|
7312
7306
|
}
|
|
7313
7307
|
const markdown = buildStoryMarkdown(gap2, key);
|
|
7314
|
-
mkdirSync7(
|
|
7308
|
+
mkdirSync7(dirname6(filePath), { recursive: true });
|
|
7315
7309
|
writeFileSync13(filePath, markdown, "utf-8");
|
|
7316
7310
|
stories.push({ key, filePath, gap: gap2, skipped: false });
|
|
7317
7311
|
created++;
|
|
@@ -7535,7 +7529,7 @@ function registerTeardownCommand(program) {
|
|
|
7535
7529
|
} else if (otlpMode === "remote-routed") {
|
|
7536
7530
|
if (!options.keepDocker) {
|
|
7537
7531
|
try {
|
|
7538
|
-
const { stopCollectorOnly: stopCollectorOnly2 } = await import("./docker-
|
|
7532
|
+
const { stopCollectorOnly: stopCollectorOnly2 } = await import("./docker-276E6ITK.js");
|
|
7539
7533
|
stopCollectorOnly2();
|
|
7540
7534
|
result.docker.stopped = true;
|
|
7541
7535
|
if (!isJson) {
|
|
@@ -7567,7 +7561,7 @@ function registerTeardownCommand(program) {
|
|
|
7567
7561
|
info("Shared stack: kept running (other projects may use it)");
|
|
7568
7562
|
}
|
|
7569
7563
|
} else if (isLegacyStack) {
|
|
7570
|
-
const { isStackRunning: isStackRunning2, stopStack } = await import("./docker-
|
|
7564
|
+
const { isStackRunning: isStackRunning2, stopStack } = await import("./docker-276E6ITK.js");
|
|
7571
7565
|
let stackRunning = false;
|
|
7572
7566
|
try {
|
|
7573
7567
|
stackRunning = isStackRunning2(composeFile);
|
|
@@ -9466,7 +9460,7 @@ function registerAuditCommand(program) {
|
|
|
9466
9460
|
}
|
|
9467
9461
|
|
|
9468
9462
|
// src/index.ts
|
|
9469
|
-
var VERSION = true ? "0.25.
|
|
9463
|
+
var VERSION = true ? "0.25.4" : "0.0.0-dev";
|
|
9470
9464
|
function createProgram() {
|
|
9471
9465
|
const program = new Command();
|
|
9472
9466
|
program.name("codeharness").description("Makes autonomous coding agents produce software that actually works").version(VERSION).option("--json", "Output in machine-readable JSON format");
|