Skip to content

Commit 619e2a7

Browse files
LLM-26485: prepare codex-acp for npm release
1 parent b441398 commit 619e2a7

3 files changed

Lines changed: 46 additions & 19 deletions

File tree

package-lock.json

Lines changed: 26 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@
33
"version": "0.0.31",
44
"description": "",
55
"main": "dist/index.js",
6+
"bin": {
7+
"codex-acp": "dist/index.js"
8+
},
9+
"files": [
10+
"dist/",
11+
"README.md",
12+
"LICENSE",
13+
"package.json"
14+
],
615
"scripts": {
16+
"prepublishOnly": "npm run build",
17+
"build": "esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --external:@openai/codex --banner:js=\"import { createRequire as __createRequire } from 'module'; const require = __createRequire(import.meta.url);\"",
718
"bundle:all": "npm run bundle:linux-x64 && npm run bundle:linux-arm64 && npm run bundle:darwin-x64 && npm run bundle:darwin-arm64 && npm run bundle:win-x64",
819
"bundle:linux-x64": "bun build src/index.ts --minify --sourcemap --compile --target=bun-linux-x64-baseline --outfile dist/bin/codex-acp-x64-linux",
920
"bundle:linux-arm64": "bun build src/index.ts --minify --sourcemap --compile --target=bun-linux-arm64 --outfile dist/bin/codex-acp-arm64-linux",
@@ -28,17 +39,18 @@
2839
"license": "ISC",
2940
"type": "module",
3041
"devDependencies": {
31-
"@openai/codex": "^0.114.0",
42+
"@agentclientprotocol/sdk": "^0.12.0",
43+
"vscode-jsonrpc": "^8.2.1",
44+
"open": "^11.0.0",
45+
"diff": "^8.0.3",
46+
"esbuild": "^0.25.0",
3247
"@types/node": "^24.10.1",
3348
"mcp-hello-world": "^1.1.2",
3449
"tsx": "^4.20.6",
3550
"typescript": "^5.9.3",
3651
"vitest": "^4.0.10"
3752
},
3853
"dependencies": {
39-
"@agentclientprotocol/sdk": "^0.12.0",
40-
"diff": "^8.0.3",
41-
"open": "^11.0.0",
42-
"vscode-jsonrpc": "^8.2.1"
54+
"@openai/codex": "^0.114.0"
4355
}
4456
}

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env node
22

3+
import {createRequire} from "node:module";
34
import * as acp from "@agentclientprotocol/sdk";
45
import {startCodexConnection} from "./CodexJsonRpcConnection";
56
import {CodexAcpServer} from "./CodexAcpServer";
@@ -29,7 +30,8 @@ if (process.argv[2] === "login") {
2930
}
3031

3132
function startAcpServer() {
32-
const codexPath = process.env["CODEX_PATH"] ?? "codex";
33+
const defaultCodexPath = createRequire(import.meta.url).resolve("@openai/codex/bin/codex.js");
34+
const codexPath = process.env["CODEX_PATH"] ?? defaultCodexPath;
3335
const configString = process.env["CODEX_CONFIG"];
3436
const authRequestString = process.env["DEFAULT_AUTH_REQUEST"];
3537
const modelProvider = process.env["MODEL_PROVIDER"];

0 commit comments

Comments
 (0)