Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { build } from 'esbuild';

await build({
entryPoints: ['src/index.ts'],
bundle: true,
platform: 'node',
format: 'esm',
outfile: 'dist/index.js',
external: ['@openai/codex'],
// Polyfill `require` for CJS modules bundled into ESM output
banner: {
js: "import { createRequire as __createRequire } from 'module'; const require = __createRequire(import.meta.url);",
},
});
43 changes: 28 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
{
"name": "codex-acp",
"name": "@jetbrains/codex-acp",
Comment thread
AlexandrSuhinin marked this conversation as resolved.
"version": "0.0.31",
"description": "",
"main": "dist/index.js",
"bin": {
"codex-acp": "dist/index.js"
},
"files": [
"dist/",
"README.md",
"LICENSE",
"package.json"
],
"scripts": {
"prepublishOnly": "npm run build",
"build": "node build.mjs",
"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 && npm run bundle:win-arm64",
"bundle:linux-x64": "bun build src/index.ts --minify --sourcemap --compile --target=bun-linux-x64-baseline --outfile dist/bin/codex-acp-x64-linux",
"bundle:linux-arm64": "bun build src/index.ts --minify --sourcemap --compile --target=bun-linux-arm64 --outfile dist/bin/codex-acp-arm64-linux",
Expand All @@ -30,7 +41,7 @@
"license": "ISC",
"type": "module",
"devDependencies": {
"@openai/codex": "^0.114.0",
"esbuild": "^0.25.0",
"@types/node": "^24.10.1",
"mcp-hello-world": "^1.1.2",
"tsx": "^4.20.6",
Expand All @@ -39,8 +50,9 @@
},
"dependencies": {
"@agentclientprotocol/sdk": "^0.12.0",
Comment thread
AlexandrSuhinin marked this conversation as resolved.
"diff": "^8.0.3",
"vscode-jsonrpc": "^8.2.1",
"open": "^11.0.0",
"vscode-jsonrpc": "^8.2.1"
"diff": "^8.0.3",
"@openai/codex": "^0.114.0"
}
}
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env node

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

function startAcpServer() {
const codexPath = process.env["CODEX_PATH"] ?? "codex";
const defaultCodexPath = createRequire(import.meta.url).resolve("@openai/codex/bin/codex.js");
const codexPath = process.env["CODEX_PATH"] ?? defaultCodexPath;
const configString = process.env["CODEX_CONFIG"];
const authRequestString = process.env["DEFAULT_AUTH_REQUEST"];
const modelProvider = process.env["MODEL_PROVIDER"];
Expand Down
Loading