acp-extension-claude-pty 0.1.2
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 +75 -0
- package/bin/acp-extension-claude-pty.js +84 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# acp-extension-claude-pty
|
|
2
|
+
|
|
3
|
+
NPM wrapper for `acp-extension-claude-pty`, an ACP adapter for the real Claude Code CLI.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install -g acp-extension-claude-pty
|
|
9
|
+
acp-extension-claude-pty doctor
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The base package requires Node 18+ and installs one optional platform package for your OS and CPU:
|
|
13
|
+
|
|
14
|
+
- `acp-extension-claude-pty-darwin-arm64`
|
|
15
|
+
- `acp-extension-claude-pty-darwin-x64`
|
|
16
|
+
- `acp-extension-claude-pty-linux-arm64`
|
|
17
|
+
- `acp-extension-claude-pty-linux-x64`
|
|
18
|
+
- `acp-extension-claude-pty-win32-arm64`
|
|
19
|
+
- `acp-extension-claude-pty-win32-x64`
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
Install and authenticate Claude Code separately:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npm install -g @anthropic-ai/claude-code
|
|
27
|
+
claude
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`npx acp-extension-claude-pty doctor` is useful for a quick smoke test, but editors should be configured with a stable installed binary.
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
ACP server:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
acp-extension-claude-pty
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Zed custom-agent settings can use the installed binary directly:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"agent_servers": {
|
|
45
|
+
"acp-extension-claude-pty": {
|
|
46
|
+
"type": "custom",
|
|
47
|
+
"command": "acp-extension-claude-pty",
|
|
48
|
+
"args": [],
|
|
49
|
+
"env": {}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Interactive pass-through:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
acp-extension-claude-pty interactive -- --model sonnet
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Print replacement for `claude -p`:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
acp-extension-claude-pty print "summarize this repository" --output-format text
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Doctor:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
acp-extension-claude-pty doctor --live-docs
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Security
|
|
74
|
+
|
|
75
|
+
Claude stores transcripts as plaintext under `~/.claude/projects`. Do not publish debug logs or transcript fixtures without sanitizing message and tool-result bodies.
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
function getPlatformPackage() {
|
|
8
|
+
const platform = process.platform;
|
|
9
|
+
const arch = process.arch;
|
|
10
|
+
|
|
11
|
+
const platformMap = {
|
|
12
|
+
darwin: {
|
|
13
|
+
arm64: "acp-extension-claude-pty-darwin-arm64",
|
|
14
|
+
x64: "acp-extension-claude-pty-darwin-x64",
|
|
15
|
+
},
|
|
16
|
+
linux: {
|
|
17
|
+
arm64: "acp-extension-claude-pty-linux-arm64",
|
|
18
|
+
x64: "acp-extension-claude-pty-linux-x64",
|
|
19
|
+
},
|
|
20
|
+
win32: {
|
|
21
|
+
arm64: "acp-extension-claude-pty-win32-arm64",
|
|
22
|
+
x64: "acp-extension-claude-pty-win32-x64",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const packages = platformMap[platform];
|
|
27
|
+
if (!packages) {
|
|
28
|
+
console.error(`Unsupported platform: ${platform}`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const packageName = packages[arch];
|
|
33
|
+
if (!packageName) {
|
|
34
|
+
console.error(`Unsupported architecture: ${arch} on ${platform}`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return packageName;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getBinaryPath() {
|
|
42
|
+
const packageName = getPlatformPackage();
|
|
43
|
+
const binaryName =
|
|
44
|
+
process.platform === "win32"
|
|
45
|
+
? "acp-extension-claude-pty.exe"
|
|
46
|
+
: "acp-extension-claude-pty";
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
// Try to resolve the platform-specific package
|
|
50
|
+
const binaryPath = fileURLToPath(
|
|
51
|
+
import.meta.resolve(`${packageName}/bin/${binaryName}`),
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
if (existsSync(binaryPath)) {
|
|
55
|
+
return binaryPath;
|
|
56
|
+
}
|
|
57
|
+
} catch (e) {
|
|
58
|
+
console.error(`Error resolving package: ${e}`);
|
|
59
|
+
// Package not found
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
console.error(
|
|
63
|
+
`Failed to locate ${packageName} binary. This usually means the optional dependency was not installed.`,
|
|
64
|
+
);
|
|
65
|
+
console.error(`Platform: ${process.platform}, Architecture: ${process.arch}`);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function run() {
|
|
70
|
+
const binaryPath = getBinaryPath();
|
|
71
|
+
const result = spawnSync(binaryPath, process.argv.slice(2), {
|
|
72
|
+
stdio: "inherit",
|
|
73
|
+
windowsHide: true,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
if (result.error) {
|
|
77
|
+
console.error(`Failed to execute ${binaryPath}:`, result.error);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
process.exit(result.status || 0);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
run();
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "acp-extension-claude-pty",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "ACP adapter for the real Claude Code CLI",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"author": "mkh",
|
|
8
|
+
"homepage": "https://github.com/Leeeon233/acp-extension-claude-pty",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/Leeeon233/acp-extension-claude-pty.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Leeeon233/acp-extension-claude-pty/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"claude",
|
|
18
|
+
"claude-code",
|
|
19
|
+
"acp",
|
|
20
|
+
"agent",
|
|
21
|
+
"coding",
|
|
22
|
+
"ai",
|
|
23
|
+
"assistant"
|
|
24
|
+
],
|
|
25
|
+
"bin": {
|
|
26
|
+
"acp-extension-claude-pty": "bin/acp-extension-claude-pty.js"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18.0.0"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public",
|
|
33
|
+
"registry": "https://registry.npmjs.org/"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"bin"
|
|
37
|
+
],
|
|
38
|
+
"optionalDependencies": {
|
|
39
|
+
"acp-extension-claude-pty-darwin-arm64": "0.1.2",
|
|
40
|
+
"acp-extension-claude-pty-darwin-x64": "0.1.2",
|
|
41
|
+
"acp-extension-claude-pty-linux-arm64": "0.1.2",
|
|
42
|
+
"acp-extension-claude-pty-linux-x64": "0.1.2",
|
|
43
|
+
"acp-extension-claude-pty-win32-arm64": "0.1.2",
|
|
44
|
+
"acp-extension-claude-pty-win32-x64": "0.1.2"
|
|
45
|
+
}
|
|
46
|
+
}
|