@vanillagreen/pi-claude-bridge 1.0.0 → 1.0.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 +19 -2
- package/assets/bridge-demo.png +0 -0
- package/assets/settings-panel.png +0 -0
- package/bundle/index.js +19 -2
- package/package.json +1 -1
- package/src/index.ts +18 -5
- package/assets/claude-bridge1.png +0 -0
- package/assets/claude-bridge2.png +0 -0
package/README.md
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
# pi-claude-bridge
|
|
2
|
-
|
|
3
|
-

|
|
3
|
+

|
|
4
4
|
|
|
5
5
|
Claude Code provider bridge for Pi. It registers `claude-bridge/*` models and routes Pi turns through the Claude Agent SDK while keeping Pi's tools in the Pi TUI.
|
|
6
6
|
|
|
7
7
|
This package is a vstack fork of [`elidickinson/pi-claude-bridge`](https://github.com/elidickinson/pi-claude-bridge). The provider, MCP tool bridge, session sync, streaming, and Claude Code SDK plumbing come from that project; this fork removes the AskClaude tool and adds vstack-controlled prompt-context forwarding.
|
|
8
8
|
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
Via [npm](https://www.npmjs.com/package/@vanillagreen/pi-claude-bridge):
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pi install npm:@vanillagreen/pi-claude-bridge
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Via [vstack](https://github.com/vanillagreencom/vstack):
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
cargo install --git https://github.com/vanillagreencom/vstack.git vstack
|
|
21
|
+
vstack add vanillagreencom/vstack --pi-extension pi-claude-bridge --harness pi -y
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Restart Pi after installation.
|
|
25
|
+
|
|
9
26
|
## What it provides
|
|
10
27
|
|
|
11
28
|
- `claude-bridge/claude-opus-4-7`, Sonnet, and Haiku models in `/model`.
|
|
Binary file
|
|
Binary file
|
package/bundle/index.js
CHANGED
|
@@ -33642,17 +33642,28 @@ var DISALLOWED_BUILTIN_TOOLS = [
|
|
|
33642
33642
|
"Read",
|
|
33643
33643
|
"Write",
|
|
33644
33644
|
"Edit",
|
|
33645
|
+
"MultiEdit",
|
|
33645
33646
|
"Glob",
|
|
33646
33647
|
"Grep",
|
|
33647
33648
|
"Bash",
|
|
33648
33649
|
"Agent",
|
|
33650
|
+
"Task",
|
|
33649
33651
|
"NotebookEdit",
|
|
33650
33652
|
"EnterWorktree",
|
|
33651
33653
|
"ExitWorktree",
|
|
33654
|
+
"CronList",
|
|
33652
33655
|
"CronCreate",
|
|
33653
33656
|
"CronDelete",
|
|
33654
33657
|
"TeamCreate",
|
|
33655
33658
|
"TeamDelete",
|
|
33659
|
+
"TaskOutput",
|
|
33660
|
+
"TaskStop",
|
|
33661
|
+
"SendMessage",
|
|
33662
|
+
"Skill",
|
|
33663
|
+
"TodoRead",
|
|
33664
|
+
"TodoWrite",
|
|
33665
|
+
"ListMcpResources",
|
|
33666
|
+
"ReadMcpResource",
|
|
33656
33667
|
"WebFetch",
|
|
33657
33668
|
"WebSearch",
|
|
33658
33669
|
"AskUserQuestion",
|
|
@@ -33661,6 +33672,11 @@ var DISALLOWED_BUILTIN_TOOLS = [
|
|
|
33661
33672
|
"ToolSearch",
|
|
33662
33673
|
"ScheduleWakeup"
|
|
33663
33674
|
];
|
|
33675
|
+
var CLAUDE_BRIDGE_TOOL_ISOLATION = {
|
|
33676
|
+
tools: [],
|
|
33677
|
+
disallowedTools: DISALLOWED_BUILTIN_TOOLS,
|
|
33678
|
+
allowedTools: [`mcp__${MCP_SERVER_NAME}__*`]
|
|
33679
|
+
};
|
|
33664
33680
|
var sharedSession = null;
|
|
33665
33681
|
function convertAndImportMessages(session, messages, customToolNameToSdk) {
|
|
33666
33682
|
const { anthropicMessages, sanitizedIds } = convertPiMessages(messages, customToolNameToSdk);
|
|
@@ -34235,8 +34251,7 @@ function streamClaudeAgentSdk(model, context, options) {
|
|
|
34235
34251
|
const queryOptions = {
|
|
34236
34252
|
cwd,
|
|
34237
34253
|
env: childEnv,
|
|
34238
|
-
|
|
34239
|
-
allowedTools: [`mcp__${MCP_SERVER_NAME}__*`],
|
|
34254
|
+
...CLAUDE_BRIDGE_TOOL_ISOLATION,
|
|
34240
34255
|
permissionMode: "bypassPermissions",
|
|
34241
34256
|
includePartialMessages: true,
|
|
34242
34257
|
systemPrompt: {
|
|
@@ -34418,5 +34433,7 @@ function index_default(pi) {
|
|
|
34418
34433
|
}
|
|
34419
34434
|
}
|
|
34420
34435
|
export {
|
|
34436
|
+
CLAUDE_BRIDGE_TOOL_ISOLATION,
|
|
34437
|
+
DISALLOWED_BUILTIN_TOOLS,
|
|
34421
34438
|
index_default as default
|
|
34422
34439
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -138,15 +138,29 @@ const MODELS = buildModels(getModels("anthropic"));
|
|
|
138
138
|
|
|
139
139
|
// Disable Claude Code built-ins in the provider path. Pi owns tool execution;
|
|
140
140
|
// Claude reaches Pi tools through the bridged MCP server instead.
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
//
|
|
142
|
+
// `allowedTools` is a permission auto-allow list in the Claude Agent SDK, not a
|
|
143
|
+
// visibility allowlist. Use `tools: []` to remove the built-in tool set, and keep
|
|
144
|
+
// this disallow list as a belt-and-suspenders guard for SDK/CLI built-ins that may
|
|
145
|
+
// otherwise leak into the model context (e.g. TodoWrite, CronList, SendMessage).
|
|
146
|
+
export const DISALLOWED_BUILTIN_TOOLS = [
|
|
147
|
+
"Read", "Write", "Edit", "MultiEdit", "Glob", "Grep", "Bash", "Agent", "Task",
|
|
143
148
|
"NotebookEdit", "EnterWorktree", "ExitWorktree",
|
|
144
|
-
"CronCreate", "CronDelete", "TeamCreate", "TeamDelete",
|
|
149
|
+
"CronList", "CronCreate", "CronDelete", "TeamCreate", "TeamDelete",
|
|
150
|
+
"TaskOutput", "TaskStop", "SendMessage", "Skill",
|
|
151
|
+
"TodoRead", "TodoWrite",
|
|
152
|
+
"ListMcpResources", "ReadMcpResource",
|
|
145
153
|
"WebFetch", "WebSearch",
|
|
146
154
|
"AskUserQuestion", "EnterPlanMode", "ExitPlanMode",
|
|
147
155
|
"ToolSearch", "ScheduleWakeup",
|
|
148
156
|
];
|
|
149
157
|
|
|
158
|
+
export const CLAUDE_BRIDGE_TOOL_ISOLATION = {
|
|
159
|
+
tools: [] as string[],
|
|
160
|
+
disallowedTools: DISALLOWED_BUILTIN_TOOLS,
|
|
161
|
+
allowedTools: [`mcp__${MCP_SERVER_NAME}__*`],
|
|
162
|
+
} satisfies Pick<NonNullable<Parameters<typeof query>[0]["options"]>, "tools" | "allowedTools" | "disallowedTools">;
|
|
163
|
+
|
|
150
164
|
// --- Session persistence ---
|
|
151
165
|
|
|
152
166
|
interface SessionState {
|
|
@@ -987,8 +1001,7 @@ function streamClaudeAgentSdk(model: Model<any>, context: Context, options?: Sim
|
|
|
987
1001
|
const queryOptions: NonNullable<Parameters<typeof query>[0]["options"]> = {
|
|
988
1002
|
cwd,
|
|
989
1003
|
env: childEnv,
|
|
990
|
-
|
|
991
|
-
allowedTools: [`mcp__${MCP_SERVER_NAME}__*`],
|
|
1004
|
+
...CLAUDE_BRIDGE_TOOL_ISOLATION,
|
|
992
1005
|
permissionMode: "bypassPermissions",
|
|
993
1006
|
includePartialMessages: true,
|
|
994
1007
|
systemPrompt: {
|
|
Binary file
|
|
Binary file
|