@parcha/agentrun-harness-codex 0.0.0-stage → 0.1.0-beta.100
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 +349 -0
- package/LICENSE +202 -0
- package/NOTICE +6 -0
- package/README.md +80 -2
- package/dist/adapter.d.ts +93 -0
- package/dist/adapter.js +375 -0
- package/dist/app-server.d.ts +53 -0
- package/dist/app-server.js +105 -0
- package/dist/binary.d.ts +31 -0
- package/dist/binary.js +74 -0
- package/dist/catalog.d.ts +35 -0
- package/dist/catalog.js +104 -0
- package/dist/code-mode.d.ts +171 -0
- package/dist/code-mode.js +514 -0
- package/dist/config.d.ts +84 -0
- package/dist/config.js +214 -0
- package/dist/facts.d.ts +2 -0
- package/dist/facts.js +40 -0
- package/dist/harness.d.ts +210 -0
- package/dist/harness.js +1112 -0
- package/dist/host/kernel.d.ts +20 -0
- package/dist/host/kernel.js +3 -0
- package/dist/host/machine.d.ts +81 -0
- package/dist/host/machine.js +355 -0
- package/dist/host/policy.d.ts +113 -0
- package/dist/host/policy.js +683 -0
- package/dist/host/process.d.ts +151 -0
- package/dist/host/process.js +50 -0
- package/dist/host/sandbox.d.ts +36 -0
- package/dist/host/sandbox.js +35 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +10 -0
- package/dist/rollout.d.ts +96 -0
- package/dist/rollout.js +170 -0
- package/dist/schema.d.ts +14 -0
- package/dist/schema.js +178 -0
- package/dist/scripts.d.ts +218 -0
- package/dist/scripts.js +409 -0
- package/dist/tool-images.d.ts +7 -0
- package/dist/tool-images.js +18 -0
- package/dist/transcript.d.ts +20 -0
- package/dist/transcript.js +73 -0
- package/dist/verify.d.ts +62 -0
- package/dist/verify.js +155 -0
- package/dist/versions.d.ts +43 -0
- package/dist/versions.js +72 -0
- package/package.json +72 -4
- package/vendor/durable-harness/UPSTREAM.json +39 -0
package/dist/verify.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// The installed Codex checked against the pins (src/versions.ts) before anything runs, with the typed errors a host maps
|
|
2
|
+
// to a run's failure line. Written for AgentRun.
|
|
3
|
+
import { existsSync, realpathSync, statSync } from "node:fs";
|
|
4
|
+
import { dirname, join, resolve } from "node:path";
|
|
5
|
+
import { env } from "node:process";
|
|
6
|
+
import { checkedOnce, checkedOnceAsync } from "@parcha/agentrun-kernel/host";
|
|
7
|
+
import { codexTarget, findCodex } from "./binary.js";
|
|
8
|
+
import { CODE_MODE_HOST_SHA256, CODEX_BINARY_SHA256, CODEX_VERSION, CodexNotInstalled, CodexPinMismatch } from "./versions.js";
|
|
9
|
+
/** The pins for this platform's binary. */
|
|
10
|
+
export function codexPins(target = codexTarget()) {
|
|
11
|
+
return { version: CODEX_VERSION, sha256: target ? CODEX_BINARY_SHA256[target.target] : undefined, packageVersion: target ? `${CODEX_VERSION}-${target.pkg}` : undefined, hostSha256: target ? CODE_MODE_HOST_SHA256[target.target] : undefined };
|
|
12
|
+
}
|
|
13
|
+
const HOST = "codex-code-mode-host";
|
|
14
|
+
const isFile = (path) => {
|
|
15
|
+
try {
|
|
16
|
+
return statSync(path).isFile();
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
/** The folder Codex at `codex` runs from: its real path's, as Codex reads its own executable (current_exe), so a link to
|
|
23
|
+
* Codex leads to the folder of the file it links to. */
|
|
24
|
+
const exeOf = (codex) => {
|
|
25
|
+
try {
|
|
26
|
+
return realpathSync(codex);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return codex;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/** The code-mode host Codex at `codex` runs, as Codex finds it (codex-rs install-context, code_mode_host_program), from
|
|
33
|
+
* its own executable's real path: in its package's layout (a codex-package.json in the folder above its own), the
|
|
34
|
+
* package's `codex-resources/codex-code-mode-host` when that is a file; else, and with no codex-package.json, the
|
|
35
|
+
* `codex-code-mode-host` beside Codex. */
|
|
36
|
+
export function codeModeHostOf(codex) {
|
|
37
|
+
const exe = exeOf(codex);
|
|
38
|
+
const pkg = dirname(dirname(exe));
|
|
39
|
+
const resources = join(pkg, "codex-resources", HOST);
|
|
40
|
+
return isFile(join(pkg, "codex-package.json")) && isFile(resources) ? resources : join(dirname(exe), HOST);
|
|
41
|
+
}
|
|
42
|
+
/** Every code-mode host by Codex at `codex` that is there: the one it runs (codeModeHostOf) first, then the other place
|
|
43
|
+
* it could look, so a host there is held to the pin too and no reading of Codex's rule leaves one unchecked. */
|
|
44
|
+
function codeModeHostsOf(codex) {
|
|
45
|
+
const runs = codeModeHostOf(codex);
|
|
46
|
+
const exe = exeOf(codex);
|
|
47
|
+
const others = [join(dirname(exe), HOST), join(dirname(dirname(exe)), "codex-resources", HOST)].filter((each) => each !== runs && isFile(each));
|
|
48
|
+
return [runs, ...others];
|
|
49
|
+
}
|
|
50
|
+
/** What the check of the binary at `path` against `pins` is kept by, besides the binary itself: the pins, and each
|
|
51
|
+
* code-mode host as the file it is now, so a host changed or swapped after a check that passed is checked again. */
|
|
52
|
+
function checkKey(path, pins) {
|
|
53
|
+
if (!pins.hostSha256)
|
|
54
|
+
return JSON.stringify(pins);
|
|
55
|
+
const hosts = codeModeHostsOf(resolve(path)).map((host) => {
|
|
56
|
+
try {
|
|
57
|
+
const st = statSync(host, { bigint: true });
|
|
58
|
+
return [host, st.dev, st.ino, st.size, st.mtimeNs, st.ctimeNs].join(":");
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return `${host}:none`;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return JSON.stringify({ pins, hosts });
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The binary at `found.path` checked against `pins`, in order: the platform package's version, the binary's sha256,
|
|
68
|
+
* the sha256 of each code-mode host it could run (codeModeHostOf, from its real path; none pinned for the platform is a
|
|
69
|
+
* refusal), then the version it reports. Returns the path, or the typed error (not thrown) naming the pin, what was expected and
|
|
70
|
+
* what was found. No path, or a binary that cannot be read or run, is `CodexNotInstalled`. The path is made absolute
|
|
71
|
+
* first, from this process's working directory, and that is the one checked and returned: a session starts the binary
|
|
72
|
+
* from its own directory, where a relative `CODEX_BIN` names nothing. The sha256 is read a chunk at a time, never the
|
|
73
|
+
* whole binary in memory, and a check that passed holds for this process while the binary and each code-mode host stay
|
|
74
|
+
* the same files, unchanged (the kernel's checkedOnce, keyed by the hosts too): a host that checks it for each model it resolves, and a run's process that makes its
|
|
75
|
+
* adapter, check it once. Its reads hold the event loop: a host checks with verifyCodexBinaryAsync first.
|
|
76
|
+
*/
|
|
77
|
+
export function verifyCodexBinary(found, pins = codexPins()) {
|
|
78
|
+
const at = located(found, pins);
|
|
79
|
+
return at instanceof Error ? at : checkedOnce(at.path, checkKey(at.path, pins), () => checkBinary(at.path, pins), passed);
|
|
80
|
+
}
|
|
81
|
+
/** verifyCodexBinary without holding the event loop (the kernel's checkedOnceAsync), its pass kept for it too. */
|
|
82
|
+
export async function verifyCodexBinaryAsync(found, pins = codexPins()) {
|
|
83
|
+
const at = located(found, pins);
|
|
84
|
+
return at instanceof Error ? at : checkedOnceAsync(at.path, checkKey(at.path, pins), () => checkBinary(at.path, pins), passed);
|
|
85
|
+
}
|
|
86
|
+
const passed = (result) => !(result instanceof Error);
|
|
87
|
+
/** The absolute path of `found`, there and of the pinned package's version; or why not. */
|
|
88
|
+
function located(found, pins) {
|
|
89
|
+
if (!found)
|
|
90
|
+
return new CodexNotInstalled("no Codex binary found for this platform, and CODEX_BIN is not set");
|
|
91
|
+
const path = resolve(found.path);
|
|
92
|
+
if (!existsSync(path))
|
|
93
|
+
return new CodexNotInstalled(`no file at ${path}`);
|
|
94
|
+
if (pins.packageVersion && found.packageVersion !== undefined && found.packageVersion !== pins.packageVersion) {
|
|
95
|
+
return new CodexPinMismatch("package_version", pins.packageVersion, found.packageVersion, path);
|
|
96
|
+
}
|
|
97
|
+
return { path };
|
|
98
|
+
}
|
|
99
|
+
/** The binary at `path` (absolute, there) against `pins`' sha256 and version, as the steps it reads (the kernel's
|
|
100
|
+
* BinaryCheck). */
|
|
101
|
+
function* checkBinary(path, pins) {
|
|
102
|
+
if (pins.sha256) {
|
|
103
|
+
let sha256;
|
|
104
|
+
try {
|
|
105
|
+
sha256 = yield { kind: "sha256", path };
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
return new CodexNotInstalled(`${path} could not be read: ${String(error?.message ?? error).slice(0, 120)}`);
|
|
109
|
+
}
|
|
110
|
+
if (sha256 !== pins.sha256)
|
|
111
|
+
return new CodexPinMismatch("binary_sha256", pins.sha256, sha256, path);
|
|
112
|
+
}
|
|
113
|
+
// No host pinned for this target: refused, since the host Codex would run is checked against nothing.
|
|
114
|
+
if (pins.hostSha256 === undefined)
|
|
115
|
+
return new CodexPinMismatch("code_mode_host_sha256", "a pinned sha256", "unpinned on this platform", codeModeHostOf(path));
|
|
116
|
+
if (pins.hostSha256 !== null) {
|
|
117
|
+
for (const host of codeModeHostsOf(path)) {
|
|
118
|
+
let sha256;
|
|
119
|
+
try {
|
|
120
|
+
sha256 = yield { kind: "sha256", path: host };
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
return new CodexNotInstalled(`its code-mode host ${host} could not be read: ${String(error?.message ?? error).slice(0, 120)}`);
|
|
124
|
+
}
|
|
125
|
+
if (sha256 !== pins.hostSha256)
|
|
126
|
+
return new CodexPinMismatch("code_mode_host_sha256", pins.hostSha256, sha256, host);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
let reported;
|
|
130
|
+
try {
|
|
131
|
+
reported = (yield { kind: "run", path, args: ["--version"], env: { PATH: env.PATH ?? "/usr/bin:/bin" }, timeoutMs: 10_000 }).trim();
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
return new CodexNotInstalled(`${path} could not be run: ${String(error?.message ?? error).slice(0, 120)}`);
|
|
135
|
+
}
|
|
136
|
+
const version = /^codex-cli (\S+)$/.exec(reported)?.[1] ?? JSON.stringify(reported.slice(0, 60));
|
|
137
|
+
if (version !== pins.version)
|
|
138
|
+
return new CodexPinMismatch("version", pins.version, version, path);
|
|
139
|
+
return { path };
|
|
140
|
+
}
|
|
141
|
+
/** This machine's Codex checked against the pins: its path, or the typed error thrown. */
|
|
142
|
+
export function verifyCodex(found = findCodex(), pins = codexPins()) {
|
|
143
|
+
const result = verifyCodexBinary(found, pins);
|
|
144
|
+
if (result instanceof Error)
|
|
145
|
+
throw result;
|
|
146
|
+
return result;
|
|
147
|
+
}
|
|
148
|
+
/** verifyCodex without holding the event loop: what a host awaits before it makes the adapter, whose own check then
|
|
149
|
+
* answers from what this kept. */
|
|
150
|
+
export async function verifyCodexAsync(found = findCodex(), pins = codexPins()) {
|
|
151
|
+
const result = await verifyCodexBinaryAsync(found, pins);
|
|
152
|
+
if (result instanceof Error)
|
|
153
|
+
throw result;
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CODEX_VERSION } from "./binary.js";
|
|
2
|
+
/** The Codex CLI release this adapter is built and tested with (`codex --version` prints `codex-cli <it>`); binary.ts,
|
|
3
|
+
* a copy of upstream's, holds it. */
|
|
4
|
+
export { CODEX_VERSION };
|
|
5
|
+
/** The install line for the pinned release (npm installs this platform's binary package with it). */
|
|
6
|
+
export declare const CODEX_INSTALL = "npm install --save-exact @openai/codex@0.164.0";
|
|
7
|
+
/** The input tokens the pinned Codex (0.164.0) sends in its first model request before the agent's own prompt: its own
|
|
8
|
+
* instructions and tool definitions. Measured from billing, not counted: a Codex run on gpt-6.1-sol wrote 12,198 tokens
|
|
9
|
+
* to the provider's cache on its first request, so about 12,200. The facts' `baseInputTokens`: a save under a cap
|
|
10
|
+
* prices a least step on it. Re-measure on a Codex bump. */
|
|
11
|
+
export declare const CODEX_BASE_INPUT_TOKENS = 12200;
|
|
12
|
+
/**
|
|
13
|
+
* npm's integrity of the pinned launcher and of each platform package (an npm alias of
|
|
14
|
+
* `@openai/codex@<version>-<platform>`), as the registry publishes them. npm checks a download against the lockfile's
|
|
15
|
+
* copy of these; test/pins.test.mjs keeps the repository's lockfile equal to them.
|
|
16
|
+
*/
|
|
17
|
+
export declare const CODEX_NPM_INTEGRITY: Readonly<Record<string, string>>;
|
|
18
|
+
/** The sha256 of the pinned native binary (`vendor/<target>/bin/codex` in the platform package), per target, read from
|
|
19
|
+
* the published packages those integrities name. A binary for a target listed here runs only if it matches. */
|
|
20
|
+
export declare const CODEX_BINARY_SHA256: Readonly<Record<string, string>>;
|
|
21
|
+
/** The sha256 of the pinned code-mode host (`vendor/<target>/bin/codex-code-mode-host` in the platform package), per
|
|
22
|
+
* target, read from the same published packages: the binary Codex runs a code-mode model's `exec` in (config.ts
|
|
23
|
+
* code_mode_host). It runs only if it matches, wherever Codex finds it (verify.ts codeModeHostOf). */
|
|
24
|
+
export declare const CODE_MODE_HOST_SHA256: Readonly<Record<string, string>>;
|
|
25
|
+
/** Which pin a mismatch is about: the binary's sha256, the version it reports, the platform package's version, or the
|
|
26
|
+
* code-mode host's sha256. */
|
|
27
|
+
export type CodexPin = "binary_sha256" | "version" | "package_version" | "code_mode_host_sha256";
|
|
28
|
+
/** The installed Codex is not the build this adapter is pinned to and checked with: nothing runs. */
|
|
29
|
+
export declare class CodexPinMismatch extends Error {
|
|
30
|
+
readonly pin: CodexPin;
|
|
31
|
+
readonly expected: string;
|
|
32
|
+
readonly found: string;
|
|
33
|
+
readonly path?: string | undefined;
|
|
34
|
+
readonly code = "CODEX_PIN_MISMATCH";
|
|
35
|
+
constructor(pin: CodexPin, expected: string, found: string, path?: string | undefined);
|
|
36
|
+
}
|
|
37
|
+
/** No Codex binary to run: the host has not installed `@openai/codex` (or this platform's package), or the binary named
|
|
38
|
+
* could not be run. */
|
|
39
|
+
export declare class CodexNotInstalled extends Error {
|
|
40
|
+
readonly detail?: string | undefined;
|
|
41
|
+
readonly code = "CODEX_NOT_INSTALLED";
|
|
42
|
+
constructor(detail?: string | undefined);
|
|
43
|
+
}
|
package/dist/versions.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// The Codex build this adapter is pinned to and checked against, and the typed errors a host maps to a run's failure
|
|
2
|
+
// line when the installed build is not it. Written for AgentRun.
|
|
3
|
+
import { CODEX_VERSION } from "./binary.js";
|
|
4
|
+
/** The Codex CLI release this adapter is built and tested with (`codex --version` prints `codex-cli <it>`); binary.ts,
|
|
5
|
+
* a copy of upstream's, holds it. */
|
|
6
|
+
export { CODEX_VERSION };
|
|
7
|
+
/** The install line for the pinned release (npm installs this platform's binary package with it). */
|
|
8
|
+
export const CODEX_INSTALL = `npm install --save-exact @openai/codex@${CODEX_VERSION}`;
|
|
9
|
+
/** The input tokens the pinned Codex (0.164.0) sends in its first model request before the agent's own prompt: its own
|
|
10
|
+
* instructions and tool definitions. Measured from billing, not counted: a Codex run on gpt-6.1-sol wrote 12,198 tokens
|
|
11
|
+
* to the provider's cache on its first request, so about 12,200. The facts' `baseInputTokens`: a save under a cap
|
|
12
|
+
* prices a least step on it. Re-measure on a Codex bump. */
|
|
13
|
+
export const CODEX_BASE_INPUT_TOKENS = 12_200;
|
|
14
|
+
/**
|
|
15
|
+
* npm's integrity of the pinned launcher and of each platform package (an npm alias of
|
|
16
|
+
* `@openai/codex@<version>-<platform>`), as the registry publishes them. npm checks a download against the lockfile's
|
|
17
|
+
* copy of these; test/pins.test.mjs keeps the repository's lockfile equal to them.
|
|
18
|
+
*/
|
|
19
|
+
export const CODEX_NPM_INTEGRITY = Object.freeze({
|
|
20
|
+
"@openai/codex": "sha512-TWj7UGyPRe3Pj/A3ddNAxs1te3a/W/xAd+J0LHrrFTmsSfahGMOLF/vn88D3QCIgAT3B1rm1y/Z3NYE0rx6cZQ==",
|
|
21
|
+
"@openai/codex-linux-x64": "sha512-XLAoaWsGOT2khzl+P4FYDPTkzAr9W0VFXFaVkqlFdkM0soa1gH/4S0wSD57Ek3HHwkirAEGz2/Mwehseh+l5Mg==",
|
|
22
|
+
"@openai/codex-linux-arm64": "sha512-LL5iTQjyDL4YRX44EWqhIfEQ5uGnmgxkQBJSxjZSeJ8L1Og83pdlzUJW/PRJ76oaVwOVgh6HXwuPEiBNEHU4lg==",
|
|
23
|
+
"@openai/codex-darwin-x64": "sha512-lIe+udnguPGzBezkgbkj2Eaz0YqOhNXT7jja136Fj0sXfI+UKNS2icmaK14GcoRAgeVEpDTtC1ftamWBPmD1zg==",
|
|
24
|
+
"@openai/codex-darwin-arm64": "sha512-pDizgOUAtq3/k3AbUFHbaU19WpYKCja+oFpNSTLKrDQj4lTUNSDuTPJip4uQVn2/1EipQdpQrGMOQBVuI1znAA==",
|
|
25
|
+
"@openai/codex-win32-x64": "sha512-urWPhwh9YavuoAPIkmVYKBTtd5OtGVL4Ki0Fb28dhK/Mz6Pt4LSy+gbRrZFz5+RXrw9ubvXuXDCcd8beYcWhDg==",
|
|
26
|
+
"@openai/codex-win32-arm64": "sha512-Zkzt8HNmB/vOnlDo5D7IOlrt5rHaxYQB7iGbNP7bHcXZtrk6gaD7UriwaieGYJpcf8DqAT/0tqzY4xbs8ZwbmQ==",
|
|
27
|
+
});
|
|
28
|
+
/** The sha256 of the pinned native binary (`vendor/<target>/bin/codex` in the platform package), per target, read from
|
|
29
|
+
* the published packages those integrities name. A binary for a target listed here runs only if it matches. */
|
|
30
|
+
export const CODEX_BINARY_SHA256 = Object.freeze({
|
|
31
|
+
"x86_64-unknown-linux-musl": "b93f6811d3f653f0fb83be4050d857fb9abbb111dfa2ce160563327daff7f306",
|
|
32
|
+
"aarch64-unknown-linux-musl": "8813c8d8a4cea2eeba271b72ab22f49628b184b24ab18dbef06b4ce41e9a8d39",
|
|
33
|
+
"x86_64-apple-darwin": "d7e19691e0c1945612475ee8ab32e59ead55472e976b5cea1682d827d34dbba1",
|
|
34
|
+
"aarch64-apple-darwin": "d8990e3ee7acfbc26f91265b12a1a83f0fee40d0e0f8f1f40a37d4ec21f499cf",
|
|
35
|
+
});
|
|
36
|
+
/** The sha256 of the pinned code-mode host (`vendor/<target>/bin/codex-code-mode-host` in the platform package), per
|
|
37
|
+
* target, read from the same published packages: the binary Codex runs a code-mode model's `exec` in (config.ts
|
|
38
|
+
* code_mode_host). It runs only if it matches, wherever Codex finds it (verify.ts codeModeHostOf). */
|
|
39
|
+
export const CODE_MODE_HOST_SHA256 = Object.freeze({
|
|
40
|
+
"x86_64-unknown-linux-musl": "8ee4f472e92ac226a189e98998633b2d07f989f208515750764db660369f2926",
|
|
41
|
+
"aarch64-unknown-linux-musl": "7d28b996b825b13ea058af67655b619a26a125d61d4fb2985694a9c4e77d2e21",
|
|
42
|
+
"x86_64-apple-darwin": "067f9c14f67b02bdb984d4fc4740da14cd397da7ee60b4506eb378921afe3e7d",
|
|
43
|
+
"aarch64-apple-darwin": "416721e33af8822041dc650793512b3e58d43e0be4f3a5c6187eb4dfaad3148a",
|
|
44
|
+
});
|
|
45
|
+
/** The installed Codex is not the build this adapter is pinned to and checked with: nothing runs. */
|
|
46
|
+
export class CodexPinMismatch extends Error {
|
|
47
|
+
pin;
|
|
48
|
+
expected;
|
|
49
|
+
found;
|
|
50
|
+
path;
|
|
51
|
+
code = "CODEX_PIN_MISMATCH";
|
|
52
|
+
constructor(pin, expected, found, path) {
|
|
53
|
+
const what = pin === "package_version" ? "platform package" : pin === "code_mode_host_sha256" ? "code-mode host" : "binary";
|
|
54
|
+
super(`agentrun-harness-codex: the Codex ${what}${path ? ` at ${path}` : ""} is not the pinned build: its ${pin === "code_mode_host_sha256" ? "sha256" : pin.replace("_", " ")} is ${found}, not ${expected}`);
|
|
55
|
+
this.pin = pin;
|
|
56
|
+
this.expected = expected;
|
|
57
|
+
this.found = found;
|
|
58
|
+
this.path = path;
|
|
59
|
+
this.name = "CodexPinMismatch";
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** No Codex binary to run: the host has not installed `@openai/codex` (or this platform's package), or the binary named
|
|
63
|
+
* could not be run. */
|
|
64
|
+
export class CodexNotInstalled extends Error {
|
|
65
|
+
detail;
|
|
66
|
+
code = "CODEX_NOT_INSTALLED";
|
|
67
|
+
constructor(detail) {
|
|
68
|
+
super(`agentrun-harness-codex: Codex ${CODEX_VERSION} is not installed${detail ? ` (${detail})` : ""}; ${CODEX_INSTALL}`);
|
|
69
|
+
this.detail = detail;
|
|
70
|
+
this.name = "CodexNotInstalled";
|
|
71
|
+
}
|
|
72
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,74 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcha/agentrun-harness-codex",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-beta.100",
|
|
4
|
+
"description": "Codex as an AgentRun harness: a tool-less Codex app-server behind a loopback model proxy, durable in AgentRun's own store, with the host's tools as its only tools.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agentrun",
|
|
7
|
+
"agent",
|
|
8
|
+
"harness",
|
|
9
|
+
"codex",
|
|
10
|
+
"durable"
|
|
11
|
+
],
|
|
12
|
+
"type": "module",
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"author": "Parcha Labs, Inc.",
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=24.22.3"
|
|
17
|
+
},
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./facts": {
|
|
26
|
+
"types": "./dist/facts.d.ts",
|
|
27
|
+
"default": "./dist/facts.js"
|
|
28
|
+
},
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"CHANGELOG.md",
|
|
35
|
+
"LICENSE",
|
|
36
|
+
"NOTICE",
|
|
37
|
+
"vendor/durable-harness/UPSTREAM.json"
|
|
38
|
+
],
|
|
39
|
+
"sideEffects": false,
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
42
|
+
"prepack": "npm run build",
|
|
43
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
44
|
+
"test": "node --test --test-concurrency=8 'test/*.test.mjs'"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@parcha/agentrun-kernel": "0.1.0-beta.100"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@openai/codex": "0.164.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"@openai/codex": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@openai/codex": "0.164.0",
|
|
59
|
+
"@parcha/agentrun-dsl": "0.1.0-beta.100"
|
|
60
|
+
},
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "git+https://github.com/Parcha-ai/agentrun.git",
|
|
64
|
+
"directory": "packages/run-adapters-codex"
|
|
65
|
+
},
|
|
66
|
+
"bugs": {
|
|
67
|
+
"url": "https://github.com/Parcha-ai/agentrun/issues"
|
|
68
|
+
},
|
|
69
|
+
"homepage": "https://agentrun.ai",
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"access": "public",
|
|
72
|
+
"tag": "beta"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"repo": "github.com/vercel-labs/durable-harness",
|
|
3
|
+
"commit": "ea8aa4060cf4fb8cd39737ce8ab21c4e0f40c741",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"copyright": "Copyright 2026 Vercel Inc.",
|
|
6
|
+
"notice": null,
|
|
7
|
+
"files": {
|
|
8
|
+
"src/app-server.ts": {
|
|
9
|
+
"upstream": "packages/harness-codex/src/app-server.ts",
|
|
10
|
+
"blob": "df53e6b9cb8db8e195d179564150129104e36129",
|
|
11
|
+
"sha256": "b31185e4c330adc5c83dddf29bdc86b5729241adb2321a53a552f0a172623cb7"
|
|
12
|
+
},
|
|
13
|
+
"src/rollout.ts": {
|
|
14
|
+
"upstream": "packages/harness-codex/src/rollout.ts",
|
|
15
|
+
"blob": "975fb055c93c62b379a78a0c337af033460ce1ec",
|
|
16
|
+
"sha256": "af9494d6e8c00841113b98fabe89a75f1d4ee1b6fe7e741f67d0221b978e2aec"
|
|
17
|
+
},
|
|
18
|
+
"src/config.ts": {
|
|
19
|
+
"upstream": "packages/harness-codex/src/config.ts",
|
|
20
|
+
"blob": "fc464abd83f3139ddfcddfede325fb5ba60055d5",
|
|
21
|
+
"sha256": "6c19fb4de4c5f58b66457d1e83f986429109e1187cede279a56663a1441ec9d4"
|
|
22
|
+
},
|
|
23
|
+
"src/binary.ts": {
|
|
24
|
+
"upstream": "packages/harness-codex/src/binary.ts",
|
|
25
|
+
"blob": "7b70dfaca4b6299db7e82cd0a609bac069a6a49c",
|
|
26
|
+
"sha256": "cc3682c425c428359334911dd9cb6acda81b10d90a95a46f20bd2cd6464b891a"
|
|
27
|
+
},
|
|
28
|
+
"src/harness.ts": {
|
|
29
|
+
"upstream": "packages/harness-codex/src/harness.ts",
|
|
30
|
+
"blob": "346548455036be098f2cf3c39b30f31f6bcbfba4",
|
|
31
|
+
"sha256": "4585716a2b31127a59440f59ec695d046efe41f0fe6c157df621a08fd898e6ae"
|
|
32
|
+
},
|
|
33
|
+
"test/fake-app-server.mjs": {
|
|
34
|
+
"upstream": "packages/harness-codex/test/fake-app-server.mjs",
|
|
35
|
+
"blob": "2b907d5a61c50b2d44d6e380972e9e2bb1e8e3e7",
|
|
36
|
+
"sha256": "23cf1b2e62d58634f9af6542c1fe56ad0b04d1d1b67a03e9f04d5d4cd81456da"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|