codeharness 0.31.0 → 0.31.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.
|
@@ -2895,7 +2895,7 @@ function generateDockerfileTemplate(projectDir, stackOrDetections) {
|
|
|
2895
2895
|
}
|
|
2896
2896
|
|
|
2897
2897
|
// src/modules/infra/init-project.ts
|
|
2898
|
-
var HARNESS_VERSION = true ? "0.31.
|
|
2898
|
+
var HARNESS_VERSION = true ? "0.31.2" : "0.0.0-dev";
|
|
2899
2899
|
function failResult(opts, error) {
|
|
2900
2900
|
return {
|
|
2901
2901
|
status: "fail",
|
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-RC2CEPIY.js";
|
|
44
44
|
|
|
45
45
|
// src/index.ts
|
|
46
46
|
import { Command } from "commander";
|
|
@@ -5105,12 +5105,24 @@ var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834"
|
|
|
5105
5105
|
function isLoopBlock2(step) {
|
|
5106
5106
|
return typeof step === "object" && step !== null && "loop" in step;
|
|
5107
5107
|
}
|
|
5108
|
-
function
|
|
5108
|
+
function driverLabel(driver) {
|
|
5109
|
+
if (!driver) return "";
|
|
5110
|
+
if (driver.includes("opus")) return "opus";
|
|
5111
|
+
if (driver.includes("sonnet")) return "snnt";
|
|
5112
|
+
if (driver.includes("haiku")) return "haiku";
|
|
5113
|
+
if (driver === "codex" || driver === "codex-mini") return "cdx";
|
|
5114
|
+
if (driver === "claude-code") return "cc";
|
|
5115
|
+
if (driver === "opencode") return "oc";
|
|
5116
|
+
return driver.slice(0, 4);
|
|
5117
|
+
}
|
|
5118
|
+
function TaskNode({ name, status, spinnerFrame, driver }) {
|
|
5109
5119
|
const s = status ?? "pending";
|
|
5120
|
+
const tag = driver ? ` [${driverLabel(driver)}]` : "";
|
|
5110
5121
|
switch (s) {
|
|
5111
5122
|
case "done":
|
|
5112
5123
|
return /* @__PURE__ */ jsxs2(Text2, { color: "green", children: [
|
|
5113
5124
|
name,
|
|
5125
|
+
/* @__PURE__ */ jsx2(Text2, { dimColor: true, children: tag }),
|
|
5114
5126
|
" \u2713"
|
|
5115
5127
|
] });
|
|
5116
5128
|
case "active": {
|
|
@@ -5118,17 +5130,22 @@ function TaskNode({ name, status, spinnerFrame }) {
|
|
|
5118
5130
|
return /* @__PURE__ */ jsxs2(Text2, { color: "cyan", children: [
|
|
5119
5131
|
frame,
|
|
5120
5132
|
" ",
|
|
5121
|
-
name
|
|
5133
|
+
name,
|
|
5134
|
+
/* @__PURE__ */ jsx2(Text2, { dimColor: true, children: tag })
|
|
5122
5135
|
] });
|
|
5123
5136
|
}
|
|
5124
5137
|
case "failed":
|
|
5125
5138
|
return /* @__PURE__ */ jsxs2(Text2, { color: "red", children: [
|
|
5126
5139
|
name,
|
|
5140
|
+
/* @__PURE__ */ jsx2(Text2, { dimColor: true, children: tag }),
|
|
5127
5141
|
" \u2717"
|
|
5128
5142
|
] });
|
|
5129
5143
|
case "pending":
|
|
5130
5144
|
default:
|
|
5131
|
-
return /* @__PURE__ */
|
|
5145
|
+
return /* @__PURE__ */ jsxs2(Text2, { dimColor: true, children: [
|
|
5146
|
+
name,
|
|
5147
|
+
tag
|
|
5148
|
+
] });
|
|
5132
5149
|
}
|
|
5133
5150
|
}
|
|
5134
5151
|
function loopIteration(tasks, taskStates) {
|
|
@@ -5138,49 +5155,74 @@ function loopIteration(tasks, taskStates) {
|
|
|
5138
5155
|
});
|
|
5139
5156
|
return anyStarted ? 1 : 0;
|
|
5140
5157
|
}
|
|
5141
|
-
function hasMetaData(taskMeta) {
|
|
5142
|
-
if (!taskMeta) return false;
|
|
5143
|
-
return Object.keys(taskMeta).length > 0;
|
|
5144
|
-
}
|
|
5145
5158
|
function WorkflowGraph({ flow, currentTask, taskStates, taskMeta }) {
|
|
5146
5159
|
if (flow.length === 0 || Object.keys(taskStates).length === 0) {
|
|
5147
5160
|
return null;
|
|
5148
5161
|
}
|
|
5149
5162
|
const meta = taskMeta ?? {};
|
|
5150
|
-
const showMeta = hasMetaData(taskMeta);
|
|
5151
5163
|
const spinnerFrame = Math.floor(Date.now() / 80);
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
elements.push(/* @__PURE__ */ jsx2(Text2, { children: " \u2192 " }, `arrow-${i}`));
|
|
5157
|
-
}
|
|
5164
|
+
let inLoop = false;
|
|
5165
|
+
let loopBlock = null;
|
|
5166
|
+
let loopItCount = 0;
|
|
5167
|
+
for (const step of flow) {
|
|
5158
5168
|
if (isLoopBlock2(step)) {
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5169
|
+
loopBlock = step;
|
|
5170
|
+
loopItCount = loopIteration(step.loop, taskStates);
|
|
5171
|
+
inLoop = loopItCount > 0;
|
|
5172
|
+
break;
|
|
5173
|
+
}
|
|
5174
|
+
}
|
|
5175
|
+
if (inLoop && loopBlock) {
|
|
5176
|
+
const elements2 = [];
|
|
5177
|
+
for (const step of flow) {
|
|
5178
|
+
if (isLoopBlock2(step)) break;
|
|
5179
|
+
if (typeof step === "string") {
|
|
5180
|
+
if (elements2.length > 0) elements2.push(/* @__PURE__ */ jsx2(Text2, { children: " \u2192 " }, `a-${step}`));
|
|
5181
|
+
elements2.push(
|
|
5182
|
+
/* @__PURE__ */ jsx2(TaskNode, { name: step, status: taskStates[step], spinnerFrame, driver: meta[step]?.driver }, `t-${step}`)
|
|
5167
5183
|
);
|
|
5168
5184
|
}
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
/* @__PURE__ */ jsx2(Text2, { children: " ]" })
|
|
5178
|
-
] }, `loop-${i}`)
|
|
5185
|
+
}
|
|
5186
|
+
if (elements2.length > 0) elements2.push(/* @__PURE__ */ jsx2(Text2, { children: " \u2192 " }, "loop-arrow"));
|
|
5187
|
+
elements2.push(/* @__PURE__ */ jsx2(Text2, { children: /* @__PURE__ */ jsx2(Text2, { bold: true, children: `Loop ${loopItCount}: ` }) }, "loop-label"));
|
|
5188
|
+
for (let j = 0; j < loopBlock.loop.length; j++) {
|
|
5189
|
+
if (j > 0) elements2.push(/* @__PURE__ */ jsx2(Text2, { children: " \u2192 " }, `la-${j}`));
|
|
5190
|
+
const tn = loopBlock.loop[j];
|
|
5191
|
+
elements2.push(
|
|
5192
|
+
/* @__PURE__ */ jsx2(TaskNode, { name: tn, status: taskStates[tn], spinnerFrame, driver: meta[tn]?.driver }, `lt-${j}`)
|
|
5179
5193
|
);
|
|
5180
|
-
}
|
|
5194
|
+
}
|
|
5195
|
+
const loopDone = loopBlock.loop.every((t) => taskStates[t] === "done");
|
|
5196
|
+
if (loopDone) {
|
|
5197
|
+
let afterLoop = false;
|
|
5198
|
+
for (const step of flow) {
|
|
5199
|
+
if (afterLoop && typeof step === "string") {
|
|
5200
|
+
elements2.push(/* @__PURE__ */ jsx2(Text2, { children: " \u2192 " }, `post-a-${step}`));
|
|
5201
|
+
elements2.push(
|
|
5202
|
+
/* @__PURE__ */ jsx2(TaskNode, { name: step, status: taskStates[step], spinnerFrame, driver: meta[step]?.driver }, `post-${step}`)
|
|
5203
|
+
);
|
|
5204
|
+
}
|
|
5205
|
+
if (isLoopBlock2(step)) afterLoop = true;
|
|
5206
|
+
}
|
|
5207
|
+
}
|
|
5208
|
+
return /* @__PURE__ */ jsx2(Box2, { flexDirection: "column", children: /* @__PURE__ */ jsxs2(Text2, { children: [
|
|
5209
|
+
" ",
|
|
5210
|
+
elements2
|
|
5211
|
+
] }) });
|
|
5212
|
+
}
|
|
5213
|
+
const elements = [];
|
|
5214
|
+
let passedCurrent = false;
|
|
5215
|
+
for (const step of flow) {
|
|
5216
|
+
if (isLoopBlock2(step)) break;
|
|
5217
|
+
if (typeof step === "string") {
|
|
5218
|
+
if (elements.length > 0) {
|
|
5219
|
+
elements.push(/* @__PURE__ */ jsx2(Text2, { children: " \u2192 " }, `a-${step}`));
|
|
5220
|
+
}
|
|
5181
5221
|
elements.push(
|
|
5182
|
-
/* @__PURE__ */ jsx2(TaskNode, { name: step, status: taskStates[step], spinnerFrame }, `
|
|
5222
|
+
/* @__PURE__ */ jsx2(TaskNode, { name: step, status: taskStates[step], spinnerFrame, driver: meta[step]?.driver }, `t-${step}`)
|
|
5183
5223
|
);
|
|
5224
|
+
if (step === currentTask) passedCurrent = true;
|
|
5225
|
+
if (passedCurrent && step !== currentTask) break;
|
|
5184
5226
|
}
|
|
5185
5227
|
}
|
|
5186
5228
|
return /* @__PURE__ */ jsx2(Box2, { flexDirection: "column", children: /* @__PURE__ */ jsxs2(Text2, { children: [
|
|
@@ -5523,10 +5565,6 @@ function Separator() {
|
|
|
5523
5565
|
const width = process.stdout.columns || 60;
|
|
5524
5566
|
return /* @__PURE__ */ jsx8(Text8, { children: "\u2501".repeat(width) });
|
|
5525
5567
|
}
|
|
5526
|
-
function shortKey(key) {
|
|
5527
|
-
const m = key.match(/^(\d+-\d+)/);
|
|
5528
|
-
return m ? m[1] : key;
|
|
5529
|
-
}
|
|
5530
5568
|
function formatCost2(cost) {
|
|
5531
5569
|
return `$${cost.toFixed(2)}`;
|
|
5532
5570
|
}
|
|
@@ -5571,9 +5609,9 @@ function EpicInfo({ info: info3 }) {
|
|
|
5571
5609
|
function StoryContext({ entries }) {
|
|
5572
5610
|
if (entries.length === 0) return null;
|
|
5573
5611
|
return /* @__PURE__ */ jsx8(Box8, { flexDirection: "column", children: entries.map((e, i) => {
|
|
5574
|
-
if (e.role === "prev") return /* @__PURE__ */ jsx8(Text8, { children: /* @__PURE__ */ jsx8(Text8, { color: "green", children: ` Prev: ${
|
|
5575
|
-
if (e.role === "current") return /* @__PURE__ */ jsx8(Text8, { children: /* @__PURE__ */ jsx8(Text8, { color: "cyan", children: ` This: ${
|
|
5576
|
-
return /* @__PURE__ */ jsx8(Text8, { children: /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: ` Next: ${
|
|
5612
|
+
if (e.role === "prev") return /* @__PURE__ */ jsx8(Text8, { children: /* @__PURE__ */ jsx8(Text8, { color: "green", children: ` Prev: ${e.key} \u2713` }) }, i);
|
|
5613
|
+
if (e.role === "current") return /* @__PURE__ */ jsx8(Text8, { children: /* @__PURE__ */ jsx8(Text8, { color: "cyan", children: ` This: ${e.key} \u25C6 ${e.task ?? ""}` }) }, i);
|
|
5614
|
+
return /* @__PURE__ */ jsx8(Text8, { children: /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: ` Next: ${e.key}` }) }, i);
|
|
5577
5615
|
}) });
|
|
5578
5616
|
}
|
|
5579
5617
|
|
|
@@ -6217,7 +6255,7 @@ function registerRunCommand(program) {
|
|
|
6217
6255
|
const taskMeta = {};
|
|
6218
6256
|
for (const [tn, task] of Object.entries(parsedWorkflow.tasks)) {
|
|
6219
6257
|
taskStates[tn] = "pending";
|
|
6220
|
-
taskMeta[tn] = { driver: task.driver ?? "claude-code" };
|
|
6258
|
+
taskMeta[tn] = { driver: task.model ?? task.driver ?? "claude-code" };
|
|
6221
6259
|
}
|
|
6222
6260
|
const storyEntries = [];
|
|
6223
6261
|
for (const [key, status] of Object.entries(statuses)) {
|
|
@@ -11173,7 +11211,7 @@ function registerTeardownCommand(program) {
|
|
|
11173
11211
|
} else if (otlpMode === "remote-routed") {
|
|
11174
11212
|
if (!options.keepDocker) {
|
|
11175
11213
|
try {
|
|
11176
|
-
const { stopCollectorOnly: stopCollectorOnly2 } = await import("./docker-
|
|
11214
|
+
const { stopCollectorOnly: stopCollectorOnly2 } = await import("./docker-D5IYCSH3.js");
|
|
11177
11215
|
stopCollectorOnly2();
|
|
11178
11216
|
result.docker.stopped = true;
|
|
11179
11217
|
if (!isJson) {
|
|
@@ -11205,7 +11243,7 @@ function registerTeardownCommand(program) {
|
|
|
11205
11243
|
info("Shared stack: kept running (other projects may use it)");
|
|
11206
11244
|
}
|
|
11207
11245
|
} else if (isLegacyStack) {
|
|
11208
|
-
const { isStackRunning: isStackRunning2, stopStack } = await import("./docker-
|
|
11246
|
+
const { isStackRunning: isStackRunning2, stopStack } = await import("./docker-D5IYCSH3.js");
|
|
11209
11247
|
let stackRunning = false;
|
|
11210
11248
|
try {
|
|
11211
11249
|
stackRunning = isStackRunning2(composeFile);
|
|
@@ -13658,6 +13696,36 @@ function parseLine(line) {
|
|
|
13658
13696
|
return null;
|
|
13659
13697
|
}
|
|
13660
13698
|
const type = parsed.type;
|
|
13699
|
+
const item = parsed.item;
|
|
13700
|
+
if (type === "item.started" && item) {
|
|
13701
|
+
const itemType = item.type;
|
|
13702
|
+
if (itemType === "command_execution") {
|
|
13703
|
+
const cmd = item.command;
|
|
13704
|
+
return { type: "tool-start", name: "Bash", id: item.id ?? "" };
|
|
13705
|
+
}
|
|
13706
|
+
if (itemType === "file_edit") {
|
|
13707
|
+
return { type: "tool-start", name: "Edit", id: item.id ?? "" };
|
|
13708
|
+
}
|
|
13709
|
+
if (itemType === "file_read") {
|
|
13710
|
+
return { type: "tool-start", name: "Read", id: item.id ?? "" };
|
|
13711
|
+
}
|
|
13712
|
+
return null;
|
|
13713
|
+
}
|
|
13714
|
+
if (type === "item.completed" && item) {
|
|
13715
|
+
const itemType = item.type;
|
|
13716
|
+
if (itemType === "command_execution") {
|
|
13717
|
+
const cmd = item.command;
|
|
13718
|
+
return { type: "tool-complete" };
|
|
13719
|
+
}
|
|
13720
|
+
if (itemType === "agent_message") {
|
|
13721
|
+
const text = item.text;
|
|
13722
|
+
if (text) return { type: "text", text };
|
|
13723
|
+
}
|
|
13724
|
+
if (itemType === "file_edit" || itemType === "file_read") {
|
|
13725
|
+
return { type: "tool-complete" };
|
|
13726
|
+
}
|
|
13727
|
+
return null;
|
|
13728
|
+
}
|
|
13661
13729
|
if (type === "tool_call") {
|
|
13662
13730
|
const name = parsed.name;
|
|
13663
13731
|
const callId = parsed.call_id;
|
|
@@ -13746,9 +13814,10 @@ var CodexDriver = class {
|
|
|
13746
13814
|
opts.plugins
|
|
13747
13815
|
);
|
|
13748
13816
|
}
|
|
13749
|
-
const args = ["exec"];
|
|
13750
|
-
|
|
13751
|
-
|
|
13817
|
+
const args = ["exec", "--json"];
|
|
13818
|
+
const model = opts.model && !opts.model.startsWith("claude-") ? opts.model : void 0;
|
|
13819
|
+
if (model) {
|
|
13820
|
+
args.push("--model", model);
|
|
13752
13821
|
}
|
|
13753
13822
|
if (opts.cwd) {
|
|
13754
13823
|
args.push("--cd", opts.cwd);
|
|
@@ -14101,7 +14170,7 @@ function registerDriversCommand(program) {
|
|
|
14101
14170
|
}
|
|
14102
14171
|
|
|
14103
14172
|
// src/index.ts
|
|
14104
|
-
var VERSION = true ? "0.31.
|
|
14173
|
+
var VERSION = true ? "0.31.2" : "0.0.0-dev";
|
|
14105
14174
|
function createProgram() {
|
|
14106
14175
|
const program = new Command();
|
|
14107
14176
|
program.name("codeharness").description("Makes autonomous coding agents produce software that actually works").version(VERSION).option("--json", "Output in machine-readable JSON format");
|