@vanillagreen/pi-claude-bridge 1.0.3 → 1.0.4
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/bundle/index.js +10 -2
- package/package.json +1 -1
- package/src/index.ts +9 -2
package/bundle/index.js
CHANGED
|
@@ -33843,7 +33843,14 @@ function mapToolName(name, customToolNameToPi) {
|
|
|
33843
33843
|
const mapped = customToolNameToPi.get(name) ?? customToolNameToPi.get(normalized);
|
|
33844
33844
|
if (mapped) return mapped;
|
|
33845
33845
|
}
|
|
33846
|
-
|
|
33846
|
+
for (const prefix of [
|
|
33847
|
+
MCP_TOOL_PREFIX,
|
|
33848
|
+
`mcp__${MCP_SERVER_NAME.replace(/-/g, "_")}__`,
|
|
33849
|
+
`mcp/${MCP_SERVER_NAME}/`,
|
|
33850
|
+
`mcp/${MCP_SERVER_NAME.replace(/-/g, "_")}/`
|
|
33851
|
+
]) {
|
|
33852
|
+
if (normalized.startsWith(prefix)) return normalized.slice(prefix.length);
|
|
33853
|
+
}
|
|
33847
33854
|
return name;
|
|
33848
33855
|
}
|
|
33849
33856
|
var SDK_KEY_RENAMES = {
|
|
@@ -34434,5 +34441,6 @@ function index_default(pi) {
|
|
|
34434
34441
|
export {
|
|
34435
34442
|
CLAUDE_BRIDGE_TOOL_ISOLATION,
|
|
34436
34443
|
DISALLOWED_BUILTIN_TOOLS,
|
|
34437
|
-
index_default as default
|
|
34444
|
+
index_default as default,
|
|
34445
|
+
mapToolName
|
|
34438
34446
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -426,7 +426,7 @@ function syncSharedSession(
|
|
|
426
426
|
|
|
427
427
|
// --- Provider helpers: tool name mapping ---
|
|
428
428
|
|
|
429
|
-
function mapToolName(name: string, customToolNameToPi?: Map<string, string>): string {
|
|
429
|
+
export function mapToolName(name: string, customToolNameToPi?: Map<string, string>): string {
|
|
430
430
|
const normalized = name.toLowerCase();
|
|
431
431
|
const builtin = SDK_TO_PI_TOOL_NAME[normalized];
|
|
432
432
|
if (builtin) return builtin;
|
|
@@ -434,7 +434,14 @@ function mapToolName(name: string, customToolNameToPi?: Map<string, string>): st
|
|
|
434
434
|
const mapped = customToolNameToPi.get(name) ?? customToolNameToPi.get(normalized);
|
|
435
435
|
if (mapped) return mapped;
|
|
436
436
|
}
|
|
437
|
-
|
|
437
|
+
for (const prefix of [
|
|
438
|
+
MCP_TOOL_PREFIX,
|
|
439
|
+
`mcp__${MCP_SERVER_NAME.replace(/-/g, "_")}__`,
|
|
440
|
+
`mcp/${MCP_SERVER_NAME}/`,
|
|
441
|
+
`mcp/${MCP_SERVER_NAME.replace(/-/g, "_")}/`,
|
|
442
|
+
]) {
|
|
443
|
+
if (normalized.startsWith(prefix)) return normalized.slice(prefix.length);
|
|
444
|
+
}
|
|
438
445
|
return name;
|
|
439
446
|
}
|
|
440
447
|
|