@agentstep/agent-sdk 0.4.28 → 0.4.29

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.
Files changed (73) hide show
  1. package/dist/backends/claude/index.js +2 -2
  2. package/dist/backends/claude/tool-bridge.js +3 -1
  3. package/dist/backends/registry.js +3 -3
  4. package/dist/{chunk-B7L5XD24.js → chunk-2NAUMCWE.js} +1 -1
  5. package/dist/{chunk-YY3NF45U.js → chunk-4DTL7OKD.js} +1 -1
  6. package/dist/chunk-4FDEJHH7.js +128 -0
  7. package/dist/{chunk-VHZML3D5.js → chunk-4GC7D5GD.js} +1 -1
  8. package/dist/{chunk-JLZO6TQL.js → chunk-AE5JQORN.js} +2 -2
  9. package/dist/{chunk-CCE6MVB3.js → chunk-BFXQ3IOS.js} +2 -2
  10. package/dist/{chunk-DWAA3F5Y.js → chunk-DT57EZQB.js} +4 -4
  11. package/dist/{chunk-34BN2SJC.js → chunk-EGCAA6KI.js} +1 -1
  12. package/dist/{chunk-3QIIJADA.js → chunk-ESXH27JB.js} +1 -1
  13. package/dist/{chunk-NWFYV2VI.js → chunk-FJAWIVSD.js} +1 -1
  14. package/dist/{chunk-AU2DTTBR.js → chunk-GQFC44YI.js} +1 -1
  15. package/dist/{chunk-SVYLMMBI.js → chunk-HGZ6R6ST.js} +1 -1
  16. package/dist/{chunk-4IFVESQO.js → chunk-HMBJOI5F.js} +2 -2
  17. package/dist/{chunk-ND7BRD6B.js → chunk-JURAGCGR.js} +1 -1
  18. package/dist/{chunk-P525BPB2.js → chunk-KOGG7CSN.js} +1 -1
  19. package/dist/{chunk-AYNYP3G3.js → chunk-KZ4AECAK.js} +8 -4
  20. package/dist/{chunk-JNHADPQ3.js → chunk-LLYP77OL.js} +1 -1
  21. package/dist/{chunk-4TF2EKVQ.js → chunk-LMHXLYUV.js} +1 -1
  22. package/dist/{chunk-ES5VD2ML.js → chunk-LYTHR3HC.js} +1 -1
  23. package/dist/{chunk-WJUWZKRP.js → chunk-NX6SIEN6.js} +1 -1
  24. package/dist/{chunk-UO2N4Q3V.js → chunk-O3Z7JWR7.js} +1 -1
  25. package/dist/{chunk-CGPTH3JC.js → chunk-OA3CLTYY.js} +1 -1
  26. package/dist/{chunk-PF6W4L5F.js → chunk-OC2RYYTW.js} +2 -2
  27. package/dist/{chunk-FEHDZT7I.js → chunk-OONL25NZ.js} +1 -1
  28. package/dist/{chunk-AWHHLOWE.js → chunk-OTLXV4RO.js} +1 -1
  29. package/dist/{chunk-HDSLSNN5.js → chunk-RK3QBYXO.js} +1 -1
  30. package/dist/{chunk-HQACDTN4.js → chunk-RZKUB4JQ.js} +3 -3
  31. package/dist/{chunk-ATGDKD4W.js → chunk-UIVEK3MD.js} +1 -1
  32. package/dist/{chunk-Y2J7CAME.js → chunk-W26HCKWX.js} +1 -1
  33. package/dist/{chunk-UZJI64HR.js → chunk-WHASPTF3.js} +1 -1
  34. package/dist/{chunk-F3M4HKEJ.js → chunk-XGUSWFDD.js} +1 -1
  35. package/dist/{chunk-36VCC3BY.js → chunk-XZOBOKL6.js} +1 -1
  36. package/dist/{chunk-FRDJNX6Z.js → chunk-YIVJ3JTW.js} +1 -1
  37. package/dist/{chunk-P6NCA7G5.js → chunk-ZNQD65DN.js} +1 -1
  38. package/dist/containers/lifecycle.js +4 -4
  39. package/dist/handlers/agents.js +10 -10
  40. package/dist/handlers/api_keys.js +10 -10
  41. package/dist/handlers/audit.js +10 -10
  42. package/dist/handlers/batch.js +10 -10
  43. package/dist/handlers/credentials.js +11 -11
  44. package/dist/handlers/environments.js +10 -10
  45. package/dist/handlers/events.js +10 -10
  46. package/dist/handlers/files.js +10 -10
  47. package/dist/handlers/index.js +34 -34
  48. package/dist/handlers/license.js +10 -10
  49. package/dist/handlers/memory.js +10 -10
  50. package/dist/handlers/metrics.js +10 -10
  51. package/dist/handlers/models.js +10 -10
  52. package/dist/handlers/providers.js +10 -10
  53. package/dist/handlers/resources.js +10 -10
  54. package/dist/handlers/sessions.js +10 -10
  55. package/dist/handlers/settings.js +10 -10
  56. package/dist/handlers/skills-write.js +10 -10
  57. package/dist/handlers/skills.js +10 -10
  58. package/dist/handlers/stream.js +9 -9
  59. package/dist/handlers/tenants.js +10 -10
  60. package/dist/handlers/threads.js +10 -10
  61. package/dist/handlers/traces.js +10 -10
  62. package/dist/handlers/upstream_keys.js +10 -10
  63. package/dist/handlers/vaults.js +10 -10
  64. package/dist/handlers/whoami.js +10 -10
  65. package/dist/http.js +9 -9
  66. package/dist/index.js +9 -9
  67. package/dist/init.js +8 -8
  68. package/dist/sessions/driver.js +5 -5
  69. package/dist/sessions/sweeper.js +5 -5
  70. package/dist/sessions/threads.js +5 -5
  71. package/dist/shutdown.js +6 -6
  72. package/package.json +1 -1
  73. package/dist/chunk-ALVC7G6R.js +0 -187
@@ -2,14 +2,14 @@ import {
2
2
  claudeBackend,
3
3
  installPermissionHook,
4
4
  installToolBridge
5
- } from "../../chunk-HQACDTN4.js";
5
+ } from "../../chunk-RZKUB4JQ.js";
6
6
  import {
7
7
  buildClaudeArgs,
8
8
  buildClaudeAuthEnv
9
9
  } from "../../chunk-WFIMX3HG.js";
10
10
  import "../../chunk-FVBDEOTZ.js";
11
11
  import "../../chunk-CY6AWCC6.js";
12
- import "../../chunk-ALVC7G6R.js";
12
+ import "../../chunk-4FDEJHH7.js";
13
13
  import {
14
14
  createClaudeTranslator
15
15
  } from "../../chunk-JFYE5BFI.js";
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  TOOL_BRIDGE_DIR,
3
+ TOOL_BRIDGE_MCP_CONFIG_PATH,
3
4
  TOOL_BRIDGE_PENDING_PATH,
4
5
  TOOL_BRIDGE_REQUEST_PATH,
5
6
  TOOL_BRIDGE_RESPONSE_PATH,
@@ -8,10 +9,11 @@ import {
8
9
  buildBridgeMcpConfig,
9
10
  generateBridgeScript,
10
11
  toolsToJson
11
- } from "../../chunk-ALVC7G6R.js";
12
+ } from "../../chunk-4FDEJHH7.js";
12
13
  import "../../chunk-2ESYSVXG.js";
13
14
  export {
14
15
  TOOL_BRIDGE_DIR,
16
+ TOOL_BRIDGE_MCP_CONFIG_PATH,
15
17
  TOOL_BRIDGE_PENDING_PATH,
16
18
  TOOL_BRIDGE_REQUEST_PATH,
17
19
  TOOL_BRIDGE_RESPONSE_PATH,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  listBackends,
3
3
  resolveBackend
4
- } from "../chunk-P525BPB2.js";
4
+ } from "../chunk-KOGG7CSN.js";
5
5
  import "../chunk-I44FSUBC.js";
6
6
  import "../chunk-T5VRE77P.js";
7
7
  import "../chunk-TY3HD5I5.js";
@@ -32,11 +32,11 @@ import "../chunk-7TSTCMII.js";
32
32
  import "../chunk-QQDSHL27.js";
33
33
  import "../chunk-IAF6VMPO.js";
34
34
  import "../chunk-OWP537VU.js";
35
- import "../chunk-HQACDTN4.js";
35
+ import "../chunk-RZKUB4JQ.js";
36
36
  import "../chunk-WFIMX3HG.js";
37
37
  import "../chunk-FVBDEOTZ.js";
38
38
  import "../chunk-CY6AWCC6.js";
39
- import "../chunk-ALVC7G6R.js";
39
+ import "../chunk-4FDEJHH7.js";
40
40
  import "../chunk-JFYE5BFI.js";
41
41
  import "../chunk-NQX7WBA4.js";
42
42
  import "../chunk-XBHDQK4Z.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  jsonOk,
3
3
  routeWrap
4
- } from "./chunk-3QIIJADA.js";
4
+ } from "./chunk-ESXH27JB.js";
5
5
 
6
6
  // src/handlers/whoami.ts
7
7
  function handleWhoami(request) {
@@ -15,7 +15,7 @@ import {
15
15
  import {
16
16
  jsonOk,
17
17
  routeWrap
18
- } from "./chunk-3QIIJADA.js";
18
+ } from "./chunk-ESXH27JB.js";
19
19
  import {
20
20
  createApiKey,
21
21
  getApiKeyById,
@@ -0,0 +1,128 @@
1
+ // src/backends/claude/tool-bridge.ts
2
+ var TOOL_BRIDGE_DIR = "/tmp/tool-bridge";
3
+ var TOOL_BRIDGE_SCRIPT_PATH = `${TOOL_BRIDGE_DIR}/bridge.sh`;
4
+ var TOOL_BRIDGE_TOOLS_PATH = `${TOOL_BRIDGE_DIR}/tools.json`;
5
+ var TOOL_BRIDGE_REQUEST_PATH = `${TOOL_BRIDGE_DIR}/request.json`;
6
+ var TOOL_BRIDGE_RESPONSE_PATH = `${TOOL_BRIDGE_DIR}/response.json`;
7
+ var TOOL_BRIDGE_MCP_CONFIG_PATH = `${TOOL_BRIDGE_DIR}/mcp.json`;
8
+ var TOOL_BRIDGE_PENDING_PATH = `${TOOL_BRIDGE_DIR}/pending`;
9
+ function generateBridgeScript() {
10
+ return `#!/bin/bash
11
+ # Auto-generated MCP stdio server for custom tool bridge.
12
+ # Pure bash \u2014 no Node.js dependency. Instant startup on Firecracker VMs.
13
+
14
+ TOOLS_PATH="${TOOL_BRIDGE_TOOLS_PATH}"
15
+ REQUEST_PATH="${TOOL_BRIDGE_REQUEST_PATH}"
16
+ RESPONSE_PATH="${TOOL_BRIDGE_RESPONSE_PATH}"
17
+ PENDING_PATH="${TOOL_BRIDGE_PENDING_PATH}"
18
+
19
+ send_response() {
20
+ printf '%s\\n' "$1"
21
+ }
22
+
23
+ TOOLS_LIST_JSON=""
24
+ if [ -f "$TOOLS_PATH" ]; then
25
+ TOOLS_LIST_JSON=$(sed 's/input_schema/inputSchema/g' "$TOOLS_PATH")
26
+ fi
27
+
28
+ handle_request() {
29
+ local body="$1"
30
+ local method id
31
+ method=$(echo "$body" | grep -o '"method":"[^"]*"' | head -1 | cut -d'"' -f4)
32
+ id=$(echo "$body" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
33
+
34
+ case "$method" in
35
+ initialize)
36
+ send_response '{"jsonrpc":"2.0","id":'"$id"',"result":{"protocolVersion":"2025-11-25","capabilities":{"tools":{"listChanged":false}},"serverInfo":{"name":"tool-bridge","version":"1.0.0"}}}'
37
+ ;;
38
+ notifications/initialized) ;;
39
+ tools/list)
40
+ send_response '{"jsonrpc":"2.0","id":'"$id"',"result":{"tools":'"$TOOLS_LIST_JSON"'}}'
41
+ ;;
42
+ tools/call)
43
+ local tool_name tool_args
44
+ tool_name=$(echo "$body" | grep -o '"name":"[^"]*"' | tail -1 | cut -d'"' -f4)
45
+ tool_args=$(echo "$body" | grep -o '"arguments":{[^}]*}' | head -1 | sed 's/^"arguments"://')
46
+ [ -z "$tool_args" ] && tool_args="{}"
47
+
48
+ # Replay case: response.json already exists (--resume re-entry)
49
+ if [ -f "$RESPONSE_PATH" ]; then
50
+ local rdata
51
+ rdata=$(cat "$RESPONSE_PATH" | tr -d '\\n' | sed 's/\\\\/\\\\\\\\/g; s/"/\\\\"/g')
52
+ rm -f "$RESPONSE_PATH"
53
+ send_response '{"jsonrpc":"2.0","id":'"$id"',"result":{"content":[{"type":"text","text":"'"$rdata"'"}],"isError":false}}'
54
+ return
55
+ fi
56
+
57
+ # Write request and create pending sentinel
58
+ printf '{"tool_use_id":%s,"name":"%s","input":%s}' "$id" "$tool_name" "$tool_args" > "$REQUEST_PATH"
59
+ touch "$PENDING_PATH"
60
+
61
+ # Poll for response.json (200ms interval, 5min timeout)
62
+ local elapsed=0
63
+ while [ $elapsed -lt 1500 ]; do
64
+ if [ -f "$RESPONSE_PATH" ]; then
65
+ local rdata
66
+ rdata=$(cat "$RESPONSE_PATH" | tr -d '\\n' | sed 's/\\\\/\\\\\\\\/g; s/"/\\\\"/g')
67
+ rm -f "$RESPONSE_PATH" "$PENDING_PATH"
68
+ send_response '{"jsonrpc":"2.0","id":'"$id"',"result":{"content":[{"type":"text","text":"'"$rdata"'"}],"isError":false}}'
69
+ return
70
+ fi
71
+ sleep 0.2
72
+ elapsed=$((elapsed + 1))
73
+ done
74
+ # Timeout
75
+ rm -f "$PENDING_PATH"
76
+ send_response '{"jsonrpc":"2.0","id":'"$id"',"error":{"code":-32603,"message":"Timeout waiting for tool response"}}'
77
+ ;;
78
+ *)
79
+ [ -n "$id" ] && send_response '{"jsonrpc":"2.0","id":'"$id"',"error":{"code":-32601,"message":"Method not found"}}'
80
+ ;;
81
+ esac
82
+ }
83
+
84
+ # Main loop: handle both raw JSON lines and Content-Length framed messages
85
+ while IFS= read -r line; do
86
+ line=\${line%$'\\r'}
87
+ [ -z "$line" ] && continue
88
+ case "$line" in
89
+ Content-Length:*)
90
+ while IFS= read -r hdr; do hdr=\${hdr%$'\\r'}; [ -z "$hdr" ] && break; done
91
+ body=$(head -c "\${line#Content-Length: }")
92
+ handle_request "$body" ;;
93
+ "{"*) handle_request "$line" ;;
94
+ esac
95
+ done
96
+ `;
97
+ }
98
+ function buildBridgeMcpConfig(existingServers) {
99
+ return {
100
+ ...existingServers,
101
+ "tool-bridge": {
102
+ command: "bash",
103
+ args: [TOOL_BRIDGE_SCRIPT_PATH]
104
+ }
105
+ };
106
+ }
107
+ function toolsToJson(tools) {
108
+ return JSON.stringify(
109
+ tools.map((t) => ({
110
+ name: t.name,
111
+ description: t.description,
112
+ input_schema: t.input_schema
113
+ }))
114
+ );
115
+ }
116
+
117
+ export {
118
+ TOOL_BRIDGE_DIR,
119
+ TOOL_BRIDGE_SCRIPT_PATH,
120
+ TOOL_BRIDGE_TOOLS_PATH,
121
+ TOOL_BRIDGE_REQUEST_PATH,
122
+ TOOL_BRIDGE_RESPONSE_PATH,
123
+ TOOL_BRIDGE_MCP_CONFIG_PATH,
124
+ TOOL_BRIDGE_PENDING_PATH,
125
+ generateBridgeScript,
126
+ buildBridgeMcpConfig,
127
+ toolsToJson
128
+ };
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  jsonOk,
7
7
  routeWrap
8
- } from "./chunk-3QIIJADA.js";
8
+ } from "./chunk-ESXH27JB.js";
9
9
  import {
10
10
  badRequest
11
11
  } from "./chunk-EZYKRG4W.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  loadVaultForCaller
3
- } from "./chunk-JNHADPQ3.js";
3
+ } from "./chunk-LLYP77OL.js";
4
4
  import {
5
5
  jsonOk,
6
6
  routeWrap
7
- } from "./chunk-3QIIJADA.js";
7
+ } from "./chunk-ESXH27JB.js";
8
8
  import {
9
9
  createCredential,
10
10
  deleteCredential,
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  jsonOk,
26
26
  routeWrap
27
- } from "./chunk-3QIIJADA.js";
27
+ } from "./chunk-ESXH27JB.js";
28
28
  import {
29
29
  forwardToAnthropic
30
30
  } from "./chunk-T45NOW43.js";
@@ -34,7 +34,7 @@ import {
34
34
  import {
35
35
  runTurn,
36
36
  writePermissionResponse
37
- } from "./chunk-AYNYP3G3.js";
37
+ } from "./chunk-KZ4AECAK.js";
38
38
  import {
39
39
  getProxiedTenantId,
40
40
  isProxied
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-AQXCXWAZ.js";
4
4
  import {
5
5
  runTurn
6
- } from "./chunk-AYNYP3G3.js";
6
+ } from "./chunk-KZ4AECAK.js";
7
7
  import {
8
8
  installOtlpExporter
9
9
  } from "./chunk-Y2KDIPCT.js";
@@ -19,14 +19,14 @@ import {
19
19
  } from "./chunk-3MQ2FWXS.js";
20
20
  import {
21
21
  installShutdownHandlers
22
- } from "./chunk-WJUWZKRP.js";
22
+ } from "./chunk-NX6SIEN6.js";
23
23
  import {
24
24
  runSweep
25
- } from "./chunk-NWFYV2VI.js";
25
+ } from "./chunk-FJAWIVSD.js";
26
26
  import {
27
27
  reconcileDockerOrphanSandboxes,
28
28
  reconcileOrphanSandboxes
29
- } from "./chunk-F3M4HKEJ.js";
29
+ } from "./chunk-XGUSWFDD.js";
30
30
  import {
31
31
  appendEvent,
32
32
  installPayloadRedactor
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  jsonOk,
10
10
  routeWrap
11
- } from "./chunk-3QIIJADA.js";
11
+ } from "./chunk-ESXH27JB.js";
12
12
  import {
13
13
  snapshotApiMetrics
14
14
  } from "./chunk-D2XITRN6.js";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-HVUWXUUI.js";
11
11
  import {
12
12
  ensureInitialized
13
- } from "./chunk-DWAA3F5Y.js";
13
+ } from "./chunk-DT57EZQB.js";
14
14
  import {
15
15
  captureException
16
16
  } from "./chunk-3MQ2FWXS.js";
@@ -6,7 +6,7 @@ import {
6
6
  reconcileDockerOrphanSandboxes,
7
7
  reconcileOrphanSandboxes,
8
8
  releaseSession
9
- } from "./chunk-F3M4HKEJ.js";
9
+ } from "./chunk-XGUSWFDD.js";
10
10
  import {
11
11
  appendEvent,
12
12
  dropEmitter
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  jsonOk,
7
7
  routeWrap
8
- } from "./chunk-3QIIJADA.js";
8
+ } from "./chunk-ESXH27JB.js";
9
9
  import {
10
10
  getSession,
11
11
  listSessions
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  jsonOk,
18
18
  routeWrap
19
- } from "./chunk-3QIIJADA.js";
19
+ } from "./chunk-ESXH27JB.js";
20
20
  import {
21
21
  getDb,
22
22
  init_client
@@ -18,7 +18,7 @@ import {
18
18
  import {
19
19
  jsonOk,
20
20
  routeWrap
21
- } from "./chunk-3QIIJADA.js";
21
+ } from "./chunk-ESXH27JB.js";
22
22
  import {
23
23
  forwardToAnthropic
24
24
  } from "./chunk-T45NOW43.js";
@@ -38,7 +38,7 @@ import {
38
38
  } from "./chunk-LAWTTG2E.js";
39
39
  import {
40
40
  releaseSession
41
- } from "./chunk-F3M4HKEJ.js";
41
+ } from "./chunk-XGUSWFDD.js";
42
42
  import {
43
43
  appendEvent,
44
44
  dropEmitter
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-T45NOW43.js";
13
13
  import {
14
14
  ensureInitialized
15
- } from "./chunk-DWAA3F5Y.js";
15
+ } from "./chunk-DT57EZQB.js";
16
16
  import {
17
17
  getProxiedTenantId,
18
18
  isProxied
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-5D5P37FY.js";
16
16
  import {
17
17
  claudeBackend
18
- } from "./chunk-HQACDTN4.js";
18
+ } from "./chunk-RZKUB4JQ.js";
19
19
 
20
20
  // src/backends/registry.ts
21
21
  var BACKENDS = {
@@ -30,7 +30,7 @@ import {
30
30
  installSkills,
31
31
  provisionResources,
32
32
  wrapProviderWithSecrets
33
- } from "./chunk-F3M4HKEJ.js";
33
+ } from "./chunk-XGUSWFDD.js";
34
34
  import {
35
35
  BLOCKED_ENV_KEYS,
36
36
  resolveVaultSecrets
@@ -68,7 +68,7 @@ import {
68
68
  } from "./chunk-JEI7I3EH.js";
69
69
  import {
70
70
  resolveBackend
71
- } from "./chunk-P525BPB2.js";
71
+ } from "./chunk-KOGG7CSN.js";
72
72
  import {
73
73
  PERMISSION_BRIDGE_PENDING_PATH,
74
74
  PERMISSION_BRIDGE_REQUEST_PATH,
@@ -78,7 +78,7 @@ import {
78
78
  TOOL_BRIDGE_PENDING_PATH,
79
79
  TOOL_BRIDGE_REQUEST_PATH,
80
80
  TOOL_BRIDGE_RESPONSE_PATH
81
- } from "./chunk-ALVC7G6R.js";
81
+ } from "./chunk-4FDEJHH7.js";
82
82
  import {
83
83
  resolveToolset
84
84
  } from "./chunk-XBHDQK4Z.js";
@@ -277,6 +277,9 @@ async function runTurn(sessionId, inputs, _depth = 0, parentTrace) {
277
277
  if (freshSession?.resources && freshSession.resources.length > 0) {
278
278
  turnBuild.env.RESOURCES_DIR = "/tmp/resources";
279
279
  }
280
+ if (agent.engine === "claude" && !turnBuild.env.MCP_TIMEOUT) {
281
+ turnBuild.env.MCP_TIMEOUT = "30000";
282
+ }
280
283
  const MCP_KEY_RE = /^MCP_(AUTH|HEADER)_/i;
281
284
  for (const entry of vaultEntries) {
282
285
  if (!BLOCKED_ENV_KEYS.has(entry.key) && !MCP_KEY_RE.test(entry.key)) {
@@ -813,7 +816,8 @@ async function checkToolBridgeSentinel(sessionId, sandboxName, provider, secrets
813
816
  ["cat", TOOL_BRIDGE_REQUEST_PATH],
814
817
  { secrets }
815
818
  );
816
- request = JSON.parse(result.stdout);
819
+ const clean = result.stdout.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, "");
820
+ request = JSON.parse(clean);
817
821
  } catch (err) {
818
822
  console.warn(`[driver] failed to read tool bridge request for ${sessionId}:`, err);
819
823
  return;
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  jsonOk,
8
8
  routeWrap
9
- } from "./chunk-3QIIJADA.js";
9
+ } from "./chunk-ESXH27JB.js";
10
10
  import {
11
11
  createVault,
12
12
  deleteEntry,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  jsonOk,
3
3
  routeWrap
4
- } from "./chunk-3QIIJADA.js";
4
+ } from "./chunk-ESXH27JB.js";
5
5
  import {
6
6
  readSetting,
7
7
  writeSetting
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  routeWrap
3
- } from "./chunk-3QIIJADA.js";
3
+ } from "./chunk-ESXH27JB.js";
4
4
  import {
5
5
  ApiError
6
6
  } from "./chunk-EZYKRG4W.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  markStopping
3
- } from "./chunk-NWFYV2VI.js";
3
+ } from "./chunk-FJAWIVSD.js";
4
4
  import {
5
5
  closeDb,
6
6
  init_client,
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  jsonOk,
10
10
  routeWrap
11
- } from "./chunk-3QIIJADA.js";
11
+ } from "./chunk-ESXH27JB.js";
12
12
  import {
13
13
  badRequest
14
14
  } from "./chunk-EZYKRG4W.js";
@@ -18,7 +18,7 @@ import {
18
18
  import {
19
19
  jsonOk,
20
20
  routeWrap
21
- } from "./chunk-3QIIJADA.js";
21
+ } from "./chunk-ESXH27JB.js";
22
22
  import {
23
23
  getDb,
24
24
  init_client
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  jsonOk,
8
8
  routeWrap
9
- } from "./chunk-3QIIJADA.js";
9
+ } from "./chunk-ESXH27JB.js";
10
10
  import {
11
11
  forwardToAnthropic,
12
12
  validateAnthropicProxy
@@ -26,7 +26,7 @@ import {
26
26
  } from "./chunk-JEI7I3EH.js";
27
27
  import {
28
28
  resolveBackend
29
- } from "./chunk-P525BPB2.js";
29
+ } from "./chunk-KOGG7CSN.js";
30
30
  import {
31
31
  getDb,
32
32
  init_client
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  jsonOk,
6
6
  routeWrap
7
- } from "./chunk-3QIIJADA.js";
7
+ } from "./chunk-ESXH27JB.js";
8
8
 
9
9
  // src/handlers/models.ts
10
10
  function handleListModels(request) {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  jsonOk,
6
6
  routeWrap
7
- } from "./chunk-3QIIJADA.js";
7
+ } from "./chunk-ESXH27JB.js";
8
8
  import {
9
9
  exportTrace
10
10
  } from "./chunk-Y2KDIPCT.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  jsonOk,
6
6
  routeWrap
7
- } from "./chunk-3QIIJADA.js";
7
+ } from "./chunk-ESXH27JB.js";
8
8
  import {
9
9
  getProxiedTenantId
10
10
  } from "./chunk-NIOWKTIF.js";
@@ -15,7 +15,7 @@ import {
15
15
  buildBridgeMcpConfig,
16
16
  generateBridgeScript,
17
17
  toolsToJson
18
- } from "./chunk-ALVC7G6R.js";
18
+ } from "./chunk-4FDEJHH7.js";
19
19
  import {
20
20
  createClaudeTranslator
21
21
  } from "./chunk-JFYE5BFI.js";
@@ -38,7 +38,7 @@ function buildTurn(input) {
38
38
  const env = buildClaudeAuthEnv();
39
39
  const customTools = agent.tools.filter((t) => t.type === "custom");
40
40
  const hasBridgeTools = customTools.length > 0 || agent.threads_enabled;
41
- if (hasBridgeTools) {
41
+ if (hasBridgeTools || agent.mcp_servers && Object.keys(agent.mcp_servers).length > 0) {
42
42
  const mcpIdx = argsBase.indexOf("--mcp-config");
43
43
  let existingServers = {};
44
44
  if (mcpIdx >= 0 && mcpIdx + 1 < argsBase.length) {
@@ -49,7 +49,7 @@ function buildTurn(input) {
49
49
  }
50
50
  argsBase.splice(mcpIdx, 2);
51
51
  }
52
- const merged = buildBridgeMcpConfig(existingServers);
52
+ const merged = hasBridgeTools ? buildBridgeMcpConfig(existingServers) : existingServers;
53
53
  argsBase.push("--mcp-config", JSON.stringify({ mcpServers: merged }));
54
54
  }
55
55
  if (toolResults.length > 0) {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  jsonOk,
6
6
  routeWrap
7
- } from "./chunk-3QIIJADA.js";
7
+ } from "./chunk-ESXH27JB.js";
8
8
 
9
9
  // src/handlers/license.ts
10
10
  function handleGetLicense(request) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  jsonOk,
3
3
  routeWrap
4
- } from "./chunk-3QIIJADA.js";
4
+ } from "./chunk-ESXH27JB.js";
5
5
  import {
6
6
  resolveContainerProvider
7
7
  } from "./chunk-QUJNG4RA.js";
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  jsonOk,
11
11
  routeWrap
12
- } from "./chunk-3QIIJADA.js";
12
+ } from "./chunk-ESXH27JB.js";
13
13
  import {
14
14
  forwardToAnthropic
15
15
  } from "./chunk-T45NOW43.js";
@@ -34,7 +34,7 @@ import {
34
34
  } from "./chunk-JEI7I3EH.js";
35
35
  import {
36
36
  resolveBackend
37
- } from "./chunk-P525BPB2.js";
37
+ } from "./chunk-KOGG7CSN.js";
38
38
  import {
39
39
  getConfig
40
40
  } from "./chunk-EF5QCTEQ.js";
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  jsonOk,
12
12
  routeWrap
13
- } from "./chunk-3QIIJADA.js";
13
+ } from "./chunk-ESXH27JB.js";
14
14
  import {
15
15
  archiveTenant,
16
16
  createTenant,
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  jsonOk,
10
10
  routeWrap
11
- } from "./chunk-3QIIJADA.js";
11
+ } from "./chunk-ESXH27JB.js";
12
12
 
13
13
  // src/handlers/skills.ts
14
14
  async function handleGetSkillsCatalog(request) {
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  jsonOk,
23
23
  routeWrap
24
- } from "./chunk-3QIIJADA.js";
24
+ } from "./chunk-ESXH27JB.js";
25
25
  import {
26
26
  badRequest,
27
27
  notFound
@@ -6,7 +6,7 @@ import {
6
6
  reconcileOrphanSandboxes,
7
7
  releaseSession,
8
8
  wrapProviderWithSecrets
9
- } from "../chunk-F3M4HKEJ.js";
9
+ } from "../chunk-XGUSWFDD.js";
10
10
  import "../chunk-DO4WVWW7.js";
11
11
  import "../chunk-RMZRSYIJ.js";
12
12
  import "../chunk-5ZFOKZGR.js";
@@ -23,7 +23,7 @@ import "../chunk-QUJNG4RA.js";
23
23
  import "../chunk-NUO56TF7.js";
24
24
  import "../chunk-JEI7I3EH.js";
25
25
  import "../chunk-JDELTTHV.js";
26
- import "../chunk-P525BPB2.js";
26
+ import "../chunk-KOGG7CSN.js";
27
27
  import "../chunk-I44FSUBC.js";
28
28
  import "../chunk-T5VRE77P.js";
29
29
  import "../chunk-TY3HD5I5.js";
@@ -54,11 +54,11 @@ import "../chunk-7TSTCMII.js";
54
54
  import "../chunk-QQDSHL27.js";
55
55
  import "../chunk-IAF6VMPO.js";
56
56
  import "../chunk-OWP537VU.js";
57
- import "../chunk-HQACDTN4.js";
57
+ import "../chunk-RZKUB4JQ.js";
58
58
  import "../chunk-WFIMX3HG.js";
59
59
  import "../chunk-FVBDEOTZ.js";
60
60
  import "../chunk-CY6AWCC6.js";
61
- import "../chunk-ALVC7G6R.js";
61
+ import "../chunk-4FDEJHH7.js";
62
62
  import "../chunk-JFYE5BFI.js";
63
63
  import "../chunk-NQX7WBA4.js";
64
64
  import "../chunk-XBHDQK4Z.js";