@vanillagreen/pi-claude-bridge 1.1.1 → 1.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 +43 -32
- package/bundle/index.js +1 -2
- package/package.json +2 -2
- package/src/config.ts +3 -2
package/README.md
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
# pi-claude-bridge
|
|
2
|
+
|
|
2
3
|

|
|
3
4
|

|
|
4
5
|
|
|
5
|
-
Claude Code
|
|
6
|
+
Run Claude Code as a Pi provider. Adds `claude-bridge/*` models to `/model` and routes Pi turns through the Claude Agent SDK while keeping Pi's tools and TUI.
|
|
7
|
+
|
|
8
|
+
Forked from [`elidickinson/pi-claude-bridge`](https://github.com/elidickinson/pi-claude-bridge). The provider, MCP bridge, session sync, and SDK plumbing come from upstream; this fork removes the AskClaude tool and adds opt-in forwarding for Pi prompt context.
|
|
9
|
+
|
|
10
|
+
## Highlights
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
- `claude-bridge/claude-opus-4-7`, Sonnet, and Haiku in `/model`.
|
|
13
|
+
- Pi tool calls run on Pi; Claude Code handles reasoning.
|
|
14
|
+
- Session continuity across normal turns, `/compact`, tree navigation, and abort recovery.
|
|
15
|
+
- Thinking-level forwarding with summarized Opus thinking display.
|
|
16
|
+
- MCP isolation and Claude cloud-MCP suppression to keep tokens lean.
|
|
17
|
+
- Opt-in forwarding of `APPEND_SYSTEM.md` and recognized Pi prompt hooks.
|
|
8
18
|
|
|
9
19
|
## Install
|
|
10
20
|
|
|
@@ -23,47 +33,48 @@ vstack add vanillagreencom/vstack --pi-extension pi-claude-bridge --harness pi -
|
|
|
23
33
|
|
|
24
34
|
Restart Pi after installation.
|
|
25
35
|
|
|
26
|
-
## What it provides
|
|
27
|
-
|
|
28
|
-
- `claude-bridge/claude-opus-4-7`, Sonnet, and Haiku models in `/model`.
|
|
29
|
-
- Pi tool calls bridged to Claude Code through a local MCP server.
|
|
30
|
-
- Session reuse/rebuild so Claude Code follows Pi history across normal turns, `/compact`, tree navigation, and abort recovery. Forks rebuild on the first turn so the fork never inherits the parent's external Claude jsonl.
|
|
31
|
-
- Thinking-level forwarding, summarized Opus thinking display, MCP isolation, and Claude cloud-MCP suppression to reduce token overhead.
|
|
32
|
-
- Optional forwarding of Pi-only context that upstream does not pass to Claude Code.
|
|
33
|
-
|
|
34
36
|
## Prompt context
|
|
35
37
|
|
|
36
38
|
Default behavior matches upstream: append `AGENTS.md` plus Pi's skills block to Claude Code's `claude_code` preset prompt.
|
|
37
39
|
|
|
38
|
-
Extra Pi
|
|
40
|
+
Extra Pi context is off by default. Enable per item in the extension manager when you want Claude Code to see prompt blocks that other Pi extensions add to your session.
|
|
41
|
+
|
|
42
|
+
## Settings
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
| --- | --- | --- |
|
|
42
|
-
| `includeAppendSystemPromptMd` | off | Forward project/global `APPEND_SYSTEM.md`, including `.pi/APPEND_SYSTEM.md`. |
|
|
43
|
-
| `includeProjectAgentsHook` | off | Forward recognized `pi-agents-tmux` `before_agent_start` additions such as the Project Agents/Subagents list. |
|
|
44
|
-
| `includeTaskPanelHook` | off | Forward recognized `pi-task-panel` workflow reminders. |
|
|
45
|
-
| `includeCavemanHook` | off | Forward recognized `pi-caveman` response-style prompt additions. |
|
|
44
|
+
All settings live in the extension manager under **Claude Bridge**.
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
### General
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
| Setting | What it does |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| Enable Claude bridge provider | Register `claude-bridge/*` models. Reload required. |
|
|
51
|
+
|
|
52
|
+
### Base prompt
|
|
53
|
+
|
|
54
|
+
| Setting | What it does |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| Forward AGENTS.md + skills | Append AGENTS.md and Pi's skills block. |
|
|
57
|
+
|
|
58
|
+
### Pi prompt context
|
|
59
|
+
|
|
60
|
+
| Setting | What it does |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| Forward APPEND_SYSTEM.md | Forward project/global `APPEND_SYSTEM.md` content. |
|
|
50
63
|
|
|
51
|
-
|
|
52
|
-
| --- | --- | --- |
|
|
53
|
-
| `enabled` | on | Register the Claude bridge provider; reload required. |
|
|
54
|
-
| `appendSystemPrompt` | on | Forward `AGENTS.md` + skills. |
|
|
55
|
-
| `strictMcpConfig` | on | When Claude Code filesystem settings are loaded, block filesystem MCP auto-loads; Pi owns tool execution. |
|
|
56
|
-
| `pathToClaudeCodeExecutable` | auto | Explicit `claude` binary path; empty auto-detects `claude` or `claude-code` on PATH. |
|
|
64
|
+
### Pi prompt hooks
|
|
57
65
|
|
|
58
|
-
|
|
66
|
+
| Setting | What it does |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| Forward project agents hook | Forward `pi-agents-tmux` Project Agents/Subagents list. |
|
|
69
|
+
| Forward task panel hook | Forward `pi-task-panel` workflow reminders. |
|
|
70
|
+
| Forward caveman hook | Forward `pi-caveman` response-style directives. |
|
|
59
71
|
|
|
60
|
-
|
|
72
|
+
### Claude Code
|
|
61
73
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- Keeps upstream provider fixes: ID-based tool-result matching, compact/session rebuild handling, abort recovery, skill read-tool rewriting, strict MCP config, cloud MCP suppression, and Opus 4.7 thinking display forcing.
|
|
74
|
+
| Setting | What it does |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| Strict MCP config | Block filesystem MCP auto-loads; Pi owns tools. |
|
|
77
|
+
| Claude executable path | Explicit `claude` binary path; empty auto-detects. |
|
|
67
78
|
|
|
68
79
|
## Debugging
|
|
69
80
|
|
package/bundle/index.js
CHANGED
|
@@ -19597,8 +19597,7 @@ function tryParseJson(path) {
|
|
|
19597
19597
|
if (!existsSync3(path)) return {};
|
|
19598
19598
|
try {
|
|
19599
19599
|
return JSON.parse(readFileSync4(path, "utf-8"));
|
|
19600
|
-
} catch
|
|
19601
|
-
console.error(`claude-bridge: failed to parse ${path}: ${e2}`);
|
|
19600
|
+
} catch {
|
|
19602
19601
|
return {};
|
|
19603
19602
|
}
|
|
19604
19603
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vanillagreen/pi-claude-bridge",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Pi provider bridge that runs Claude Code through the Claude Agent SDK, with opt-in forwarding for Pi prompt context.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"build": "esbuild src/index.ts --bundle --platform=node --format=esm --target=node20 --outfile=bundle/index.js --external:@earendil-works/pi-ai --external:@earendil-works/pi-coding-agent",
|
|
120
120
|
"prepack": "npm run build",
|
|
121
121
|
"test:unit": "node --import tsx --test tests/unit-*.mjs",
|
|
122
|
-
"test": "set -a && [ -f .env.test ] && .
|
|
122
|
+
"test": "set -a && [ -f .env.test ] && . ./.env.test; set +a && npm run test:unit && tests/int-smoke.sh && tests/int-multi-turn.sh && tests/int-cache.sh && node --import tsx --test tests/int-*.mjs",
|
|
123
123
|
"test:usage": "tests/usage-test.sh",
|
|
124
124
|
"typecheck": "tsc --noEmit"
|
|
125
125
|
},
|
package/src/config.ts
CHANGED
|
@@ -73,8 +73,9 @@ export function tryParseJson(path: string): Partial<Config> {
|
|
|
73
73
|
if (!existsSync(path)) return {};
|
|
74
74
|
try {
|
|
75
75
|
return JSON.parse(readFileSync(path, "utf-8"));
|
|
76
|
-
} catch
|
|
77
|
-
|
|
76
|
+
} catch {
|
|
77
|
+
// Malformed optional config should not write raw terminal diagnostics;
|
|
78
|
+
// stdout/stderr output can corrupt active Pi TUI widgets.
|
|
78
79
|
return {};
|
|
79
80
|
}
|
|
80
81
|
}
|