cowork-harness 0.4.0 → 0.4.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.
- package/CHANGELOG.md +12 -0
- package/dist/runtime/container.js +1 -18
- package/dist/runtime/hostloop.js +2 -16
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ All notable changes to this project are documented here. The format is based on
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.4.1] — 2026-06-18
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Agent-binary newest-staged fallback now applies on the real runtime paths** (container / hostloop, and
|
|
14
|
+
thus `skill` / `run` / `chat`), not just `sync`/tests. `resolveAgentBinary` had two private duplicates
|
|
15
|
+
(`container.ts`, `hostloop.ts`) **without** the 0.4.0 fallback, so a host with a newer staged
|
|
16
|
+
`claude-code-vm/<ver>` than the baseline expects still hard-failed with "Staged agent binary not found".
|
|
17
|
+
The duplicates were consolidated into the single exported resolver; a host that has staged a newer build
|
|
18
|
+
now falls back to it (with a warning) instead of failing. A structural test + CI guard prevent the
|
|
19
|
+
resolver from being re-duplicated.
|
|
20
|
+
|
|
9
21
|
## [0.4.0] — 2026-06-18
|
|
10
22
|
|
|
11
23
|
The parsing/validation hardening + safety release: a current-tree code-review sweep plus fidelity and
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
3
2
|
import { resolve, join } from "node:path";
|
|
4
|
-
import { homedir } from "node:os";
|
|
5
3
|
import { DEFAULT_MAX_THINKING_TOKENS } from "../types.js";
|
|
6
|
-
import { resolveMounts } from "../baseline.js";
|
|
4
|
+
import { resolveMounts, resolveAgentBinary } from "../baseline.js";
|
|
7
5
|
import { agentArgs, spawnEnv, dockerRunArgv, resolveMaxThinkingTokens } from "./argv.js";
|
|
8
6
|
import { runtimeAuthEnv } from "./host-env.js";
|
|
9
7
|
import { stageWorkspace } from "./stage.js";
|
|
@@ -60,18 +58,3 @@ export function spawnContainer(scenario, baseline, plan, outDir, sessionId, opts
|
|
|
60
58
|
});
|
|
61
59
|
return spawn(runner, dockerArgs, { stdio: ["pipe", "pipe", "pipe"] });
|
|
62
60
|
}
|
|
63
|
-
/** Resolve the staged Linux agent binary on the host (override: COWORK_AGENT_BINARY). */
|
|
64
|
-
function resolveAgentBinary(baseline) {
|
|
65
|
-
const override = process.env.COWORK_AGENT_BINARY;
|
|
66
|
-
if (override) {
|
|
67
|
-
if (!existsSync(override))
|
|
68
|
-
throw new Error(`COWORK_AGENT_BINARY not found: ${override}`);
|
|
69
|
-
return resolve(override);
|
|
70
|
-
}
|
|
71
|
-
const staged = (baseline.agentBinary?.stagedPath ?? "").replace(/^~(?=$|\/)/, homedir());
|
|
72
|
-
if (!staged || !existsSync(staged)) {
|
|
73
|
-
throw new Error(`Staged agent binary not found at "${staged}". It is extracted from your Claude Desktop install ` +
|
|
74
|
-
`(claude-code-vm/<ver>/claude). Open Cowork once to stage it, or set COWORK_AGENT_BINARY to its path.`);
|
|
75
|
-
}
|
|
76
|
-
return resolve(staged);
|
|
77
|
-
}
|
package/dist/runtime/hostloop.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { warn } from "../io.js";
|
|
2
2
|
import { spawn } from "node:child_process";
|
|
3
|
-
import {
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
4
|
import { resolve, join } from "node:path";
|
|
5
|
-
import { homedir } from "node:os";
|
|
6
5
|
import { fileURLToPath } from "node:url";
|
|
7
6
|
import { DEFAULT_MAX_THINKING_TOKENS } from "../types.js";
|
|
8
|
-
import { resolveMounts } from "../baseline.js";
|
|
7
|
+
import { resolveMounts, resolveAgentBinary } from "../baseline.js";
|
|
9
8
|
import { makeWorkspaceHandler } from "../hostloop/workspace-handler.js";
|
|
10
9
|
import { agentArgs, spawnEnv, dockerRunArgv, resolveMaxThinkingTokens } from "./argv.js";
|
|
11
10
|
import { runtimeAuthEnv } from "./host-env.js";
|
|
@@ -116,16 +115,3 @@ function hostLoopShellSection(vmMnt, appVersion) {
|
|
|
116
115
|
.join(vmMnt)
|
|
117
116
|
.trim();
|
|
118
117
|
}
|
|
119
|
-
function resolveAgentBinary(baseline) {
|
|
120
|
-
const override = process.env.COWORK_AGENT_BINARY;
|
|
121
|
-
if (override) {
|
|
122
|
-
if (!existsSync(override))
|
|
123
|
-
throw new Error(`COWORK_AGENT_BINARY not found: ${override}`);
|
|
124
|
-
return resolve(override);
|
|
125
|
-
}
|
|
126
|
-
const staged = (baseline.agentBinary?.stagedPath ?? "").replace(/^~(?=$|\/)/, homedir());
|
|
127
|
-
if (!staged || !existsSync(staged)) {
|
|
128
|
-
throw new Error(`Staged agent binary not found at "${staged}". Open Cowork once to stage it, or set COWORK_AGENT_BINARY.`);
|
|
129
|
-
}
|
|
130
|
-
return resolve(staged);
|
|
131
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cowork-harness",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Scriptable, CI-friendly harness for Claude Cowork's runtime contract for testing skills across scenarios — same agent, mounts, egress allowlist, permission protocol, and sandbox limitations.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|