claude-code-rust 0.7.0 → 0.7.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 +7 -4
- package/agent-sdk/README.md +12 -0
- package/agent-sdk/dist/bridge.test.js +4 -4
- package/bin/claude-rs.js +1 -1
- package/package.json +6 -5
- package/scripts/postinstall.js +1 -1
package/README.md
CHANGED
|
@@ -19,14 +19,17 @@ Claude Code Rust replaces the stock Claude Code terminal interface with a native
|
|
|
19
19
|
|
|
20
20
|
## Install
|
|
21
21
|
|
|
22
|
-
###
|
|
22
|
+
### npm (global, recommended)
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
|
|
25
|
+
npm install -g claude-code-rust
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
The published package installs a `claude-rs` command and
|
|
29
|
-
prebuilt release binary for your platform during
|
|
28
|
+
The published package installs a `claude-rs` command and fetches the matching
|
|
29
|
+
prebuilt release binary for your platform during install.
|
|
30
|
+
|
|
31
|
+
If `claude-rs` resolves to an older global shim, ensure your npm global bin
|
|
32
|
+
directory comes first on `PATH` or remove the stale shim before retrying.
|
|
30
33
|
|
|
31
34
|
## Usage
|
|
32
35
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# claude-rs agent-sdk bridge
|
|
2
|
+
|
|
3
|
+
Initial scaffold for the NDJSON stdio bridge that will connect Rust (`claude-code-rust`) with `@anthropic-ai/claude-agent-sdk`.
|
|
4
|
+
|
|
5
|
+
## Local build
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install
|
|
9
|
+
npm run build
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Build output is written to `dist/bridge.mjs`.
|
|
@@ -395,7 +395,7 @@ test("permissionOptionsFromSuggestions uses persistent label when settings scope
|
|
|
395
395
|
type: "addRules",
|
|
396
396
|
behavior: "allow",
|
|
397
397
|
destination: "localSettings",
|
|
398
|
-
rules: [{ toolName: "Bash", ruleContent: "
|
|
398
|
+
rules: [{ toolName: "Bash", ruleContent: "npm install" }],
|
|
399
399
|
},
|
|
400
400
|
]);
|
|
401
401
|
assert.deepEqual(options, [
|
|
@@ -405,13 +405,13 @@ test("permissionOptionsFromSuggestions uses persistent label when settings scope
|
|
|
405
405
|
]);
|
|
406
406
|
});
|
|
407
407
|
test("permissionResultFromOutcome keeps Bash allow_always suggestions unchanged", () => {
|
|
408
|
-
const allow = permissionResultFromOutcome({ outcome: "selected", option_id: "allow_always" }, "tool-1", { command: "
|
|
408
|
+
const allow = permissionResultFromOutcome({ outcome: "selected", option_id: "allow_always" }, "tool-1", { command: "npm install" }, [
|
|
409
409
|
{
|
|
410
410
|
type: "addRules",
|
|
411
411
|
behavior: "allow",
|
|
412
412
|
destination: "localSettings",
|
|
413
413
|
rules: [
|
|
414
|
-
{ toolName: "Bash", ruleContent: "
|
|
414
|
+
{ toolName: "Bash", ruleContent: "npm install" },
|
|
415
415
|
{ toolName: "WebFetch", ruleContent: "https://example.com" },
|
|
416
416
|
{ toolName: "Bash", ruleContent: "dir /B" },
|
|
417
417
|
],
|
|
@@ -427,7 +427,7 @@ test("permissionResultFromOutcome keeps Bash allow_always suggestions unchanged"
|
|
|
427
427
|
behavior: "allow",
|
|
428
428
|
destination: "localSettings",
|
|
429
429
|
rules: [
|
|
430
|
-
{ toolName: "Bash", ruleContent: "
|
|
430
|
+
{ toolName: "Bash", ruleContent: "npm install" },
|
|
431
431
|
{ toolName: "WebFetch", ruleContent: "https://example.com" },
|
|
432
432
|
{ toolName: "Bash", ruleContent: "dir /B" },
|
|
433
433
|
],
|
package/bin/claude-rs.js
CHANGED
|
@@ -24,7 +24,7 @@ function resolveInstall() {
|
|
|
24
24
|
return {
|
|
25
25
|
error:
|
|
26
26
|
`Missing binary at ${binaryPath}\n` +
|
|
27
|
-
"Reinstall with `
|
|
27
|
+
"Reinstall with `npm install -g claude-code-rust` to fetch release artifacts."
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-rust",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Claude Code Rust - native Rust terminal interface for Claude Code",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -31,13 +31,14 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@anthropic-ai/claude-agent-sdk": "0.2.63"
|
|
33
33
|
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"postinstall": "node ./scripts/postinstall.js",
|
|
36
|
+
"prepack": "npm --prefix agent-sdk run build"
|
|
37
|
+
},
|
|
34
38
|
"engines": {
|
|
35
39
|
"node": ">=18"
|
|
36
40
|
},
|
|
37
41
|
"publishConfig": {
|
|
38
42
|
"access": "public"
|
|
39
|
-
},
|
|
40
|
-
"scripts": {
|
|
41
|
-
"postinstall": "node ./scripts/postinstall.js"
|
|
42
43
|
}
|
|
43
|
-
}
|
|
44
|
+
}
|
package/scripts/postinstall.js
CHANGED
|
@@ -27,7 +27,7 @@ async function downloadFile(url, outPath, redirects = 0) {
|
|
|
27
27
|
await new Promise((resolve, reject) => {
|
|
28
28
|
const req = https.get(
|
|
29
29
|
url,
|
|
30
|
-
{ headers: { "User-Agent": "claude-code-rust-
|
|
30
|
+
{ headers: { "User-Agent": "claude-code-rust-installer" } },
|
|
31
31
|
(res) => {
|
|
32
32
|
const status = res.statusCode ?? 0;
|
|
33
33
|
|