acp-extension-codex-linux-x64 0.0.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/README.md +61 -0
- package/bin/codex-acp.js +86 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# ACP adapter for Codex
|
|
2
|
+
|
|
3
|
+
Use [Codex](https://github.com/openai/codex) from [ACP-compatible](https://agentclientprotocol.com) clients such as [Zed](https://zed.dev)!
|
|
4
|
+
|
|
5
|
+
This tool implements an ACP adapter around the Codex CLI, supporting:
|
|
6
|
+
|
|
7
|
+
- Context @-mentions
|
|
8
|
+
- Images
|
|
9
|
+
- Tool calls (with permission requests)
|
|
10
|
+
- Following
|
|
11
|
+
- Edit review
|
|
12
|
+
- TODO lists
|
|
13
|
+
- Slash commands:
|
|
14
|
+
- /review (with optional instructions)
|
|
15
|
+
- /review-branch
|
|
16
|
+
- /review-commit
|
|
17
|
+
- /init
|
|
18
|
+
- /compact
|
|
19
|
+
- /logout
|
|
20
|
+
- Custom Prompts
|
|
21
|
+
- Client MCP servers
|
|
22
|
+
- Auth Methods:
|
|
23
|
+
- ChatGPT subscription (requires paid subscription and doesn't work in remote projects)
|
|
24
|
+
- CODEX_API_KEY
|
|
25
|
+
- OPENAI_API_KEY
|
|
26
|
+
|
|
27
|
+
Learn more about the [Agent Client Protocol](https://agentclientprotocol.com/).
|
|
28
|
+
|
|
29
|
+
## How to use
|
|
30
|
+
|
|
31
|
+
### Zed
|
|
32
|
+
|
|
33
|
+
The latest version of Zed can already use this adapter out of the box.
|
|
34
|
+
|
|
35
|
+
To use Codex, open the Agent Panel and click "New Codex Thread" from the `+` button menu in the top-right.
|
|
36
|
+
|
|
37
|
+
Read the docs on [External Agent](https://zed.dev/docs/ai/external-agents) support.
|
|
38
|
+
|
|
39
|
+
### Other clients
|
|
40
|
+
|
|
41
|
+
[Submit a PR](https://github.com/Leeeon233/acp-extension/pulls) to add yours!
|
|
42
|
+
|
|
43
|
+
#### Installation
|
|
44
|
+
|
|
45
|
+
Install the adapter from the latest release for your architecture and OS: https://github.com/Leeeon233/acp-extension/releases
|
|
46
|
+
|
|
47
|
+
You can then use `codex-acp` as a regular ACP agent:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
OPENAI_API_KEY=sk-... codex-acp
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or via npm:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
npx acp-extension-codex
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
Apache-2.0
|
package/bin/codex-acp.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
// Map Node.js platform/arch to package names
|
|
8
|
+
function getPlatformPackage() {
|
|
9
|
+
const platform = process.platform;
|
|
10
|
+
const arch = process.arch;
|
|
11
|
+
const baseName = "acp-extension-codex";
|
|
12
|
+
|
|
13
|
+
const platformMap = {
|
|
14
|
+
darwin: {
|
|
15
|
+
arm64: `${baseName}-darwin-arm64`,
|
|
16
|
+
x64: `${baseName}-darwin-x64`,
|
|
17
|
+
},
|
|
18
|
+
linux: {
|
|
19
|
+
arm64: `${baseName}-linux-arm64`,
|
|
20
|
+
x64: `${baseName}-linux-x64`,
|
|
21
|
+
},
|
|
22
|
+
win32: {
|
|
23
|
+
arm64: `${baseName}-win32-arm64`,
|
|
24
|
+
x64: `${baseName}-win32-x64`,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const packages = platformMap[platform];
|
|
29
|
+
if (!packages) {
|
|
30
|
+
console.error(`Unsupported platform: ${platform}`);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const packageName = packages[arch];
|
|
35
|
+
if (!packageName) {
|
|
36
|
+
console.error(`Unsupported architecture: ${arch} on ${platform}`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return packageName;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Locate the binary
|
|
44
|
+
function getBinaryPath() {
|
|
45
|
+
const packageName = getPlatformPackage();
|
|
46
|
+
const binaryName =
|
|
47
|
+
process.platform === "win32" ? "codex-acp.exe" : "codex-acp";
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
// Try to resolve the platform-specific package
|
|
51
|
+
const binaryPath = fileURLToPath(
|
|
52
|
+
import.meta.resolve(`${packageName}/bin/${binaryName}`),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
if (existsSync(binaryPath)) {
|
|
56
|
+
return binaryPath;
|
|
57
|
+
}
|
|
58
|
+
} catch (e) {
|
|
59
|
+
console.error(`Error resolving package: ${e}`);
|
|
60
|
+
// Package not found
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
console.error(
|
|
64
|
+
`Failed to locate ${packageName} binary. This usually means the optional dependency was not installed.`,
|
|
65
|
+
);
|
|
66
|
+
console.error(`Platform: ${process.platform}, Architecture: ${process.arch}`);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Execute the binary
|
|
71
|
+
function run() {
|
|
72
|
+
const binaryPath = getBinaryPath();
|
|
73
|
+
const result = spawnSync(binaryPath, process.argv.slice(2), {
|
|
74
|
+
stdio: "inherit",
|
|
75
|
+
windowsHide: true,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
if (result.error) {
|
|
79
|
+
console.error(`Failed to execute ${binaryPath}:`, result.error);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
process.exit(result.status || 0);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
run();
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "acp-extension-codex-linux-x64",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "An ACP-compatible coding agent powered by Codex",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"author": "lody <agent@lody.ai>",
|
|
8
|
+
"homepage": "https://github.com/Leeeon233/acp-extension",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/Leeeon233/acp-extension.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Leeeon233/acp-extension/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"codex",
|
|
18
|
+
"acp",
|
|
19
|
+
"agent",
|
|
20
|
+
"coding",
|
|
21
|
+
"ai",
|
|
22
|
+
"assistant"
|
|
23
|
+
],
|
|
24
|
+
"bin": {
|
|
25
|
+
"codex-acp": "bin/codex-acp.js"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"bin"
|
|
29
|
+
],
|
|
30
|
+
"optionalDependencies": {
|
|
31
|
+
"acp-extension-codex-darwin-arm64": "0.8.2",
|
|
32
|
+
"acp-extension-codex-darwin-x64": "0.8.2",
|
|
33
|
+
"acp-extension-codex-linux-arm64": "0.8.2",
|
|
34
|
+
"acp-extension-codex-linux-x64": "0.8.2",
|
|
35
|
+
"acp-extension-codex-win32-arm64": "0.8.2",
|
|
36
|
+
"acp-extension-codex-win32-x64": "0.8.2"
|
|
37
|
+
}
|
|
38
|
+
}
|