@agentstep/agent-sdk 0.4.28 → 0.4.30

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 (177) hide show
  1. package/dist/auth/middleware.js +7 -7
  2. package/dist/backends/claude/args.js +5 -5
  3. package/dist/backends/claude/index.js +7 -7
  4. package/dist/backends/claude/tool-bridge.js +3 -1
  5. package/dist/backends/codex/auth.js +5 -5
  6. package/dist/backends/codex/index.js +6 -6
  7. package/dist/backends/factory/auth.js +5 -5
  8. package/dist/backends/factory/index.js +6 -6
  9. package/dist/backends/gemini/auth.js +5 -5
  10. package/dist/backends/gemini/index.js +6 -6
  11. package/dist/backends/opencode/auth.js +5 -5
  12. package/dist/backends/opencode/index.js +6 -6
  13. package/dist/backends/pi/auth.js +5 -5
  14. package/dist/backends/pi/index.js +6 -6
  15. package/dist/backends/registry.js +18 -18
  16. package/dist/{chunk-TY3HD5I5.js → chunk-2DRBKIGQ.js} +1 -1
  17. package/dist/{chunk-ATGDKD4W.js → chunk-2JKOYBUO.js} +1 -1
  18. package/dist/{chunk-4IFVESQO.js → chunk-3KLJGU75.js} +17 -14
  19. package/dist/{chunk-ZP5VMV5O.js → chunk-46XURNM7.js} +4 -4
  20. package/dist/{chunk-P525BPB2.js → chunk-4B7PQTTS.js} +6 -6
  21. package/dist/{chunk-5GZEX4HV.js → chunk-4C7XJI2V.js} +1 -1
  22. package/dist/chunk-4FDEJHH7.js +128 -0
  23. package/dist/{chunk-R5OZHLAD.js → chunk-4PVPM2WC.js} +1 -1
  24. package/dist/{chunk-O45IQUWS.js → chunk-5NBZZZKH.js} +2 -2
  25. package/dist/{chunk-S3SKODVV.js → chunk-5QTDZQ2H.js} +4 -4
  26. package/dist/{chunk-JNHADPQ3.js → chunk-65XR7JU6.js} +11 -5
  27. package/dist/{chunk-X2CAT5MN.js → chunk-67D4I5AE.js} +1 -1
  28. package/dist/{chunk-EHCGLMPC.js → chunk-6EQZSMIZ.js} +1 -1
  29. package/dist/{chunk-HQACDTN4.js → chunk-6VENJOPG.js} +5 -5
  30. package/dist/{chunk-VHZML3D5.js → chunk-7DSZOBSQ.js} +2 -2
  31. package/dist/{chunk-VIGJQU6V.js → chunk-7GNSB22P.js} +3 -3
  32. package/dist/{chunk-4TF2EKVQ.js → chunk-7UJ2PIXJ.js} +2 -2
  33. package/dist/{chunk-NUINUAXO.js → chunk-7V277COF.js} +2 -2
  34. package/dist/{chunk-4RNCKCDV.js → chunk-AP2N4R6D.js} +1 -1
  35. package/dist/{chunk-WJUWZKRP.js → chunk-AXISFTHX.js} +2 -2
  36. package/dist/{chunk-JDELTTHV.js → chunk-BBYQMNGK.js} +1 -1
  37. package/dist/{chunk-FEHDZT7I.js → chunk-BJK4SGWG.js} +2 -2
  38. package/dist/{chunk-4WMYJM36.js → chunk-BKBC43KV.js} +1 -1
  39. package/dist/{chunk-CGPTH3JC.js → chunk-BQOFXJSK.js} +3 -3
  40. package/dist/{chunk-PF6W4L5F.js → chunk-BSVZAXLI.js} +11 -8
  41. package/dist/{chunk-UO2N4Q3V.js → chunk-CL3DUJRJ.js} +7 -4
  42. package/dist/{chunk-UZJI64HR.js → chunk-DL2BACWC.js} +12 -9
  43. package/dist/{chunk-B7L5XD24.js → chunk-DNV6JZLZ.js} +1 -1
  44. package/dist/{chunk-AU2DTTBR.js → chunk-EFCCO74P.js} +8 -5
  45. package/dist/{chunk-EF5QCTEQ.js → chunk-EFDAVLKN.js} +1 -1
  46. package/dist/{chunk-WFIMX3HG.js → chunk-EIR2TG5I.js} +1 -1
  47. package/dist/{chunk-F3M4HKEJ.js → chunk-EN3ICYTL.js} +9 -9
  48. package/dist/{chunk-Y2KDIPCT.js → chunk-F3BVYYRX.js} +5 -5
  49. package/dist/{chunk-ZMMDLKR3.js → chunk-FGQFNIRI.js} +3 -3
  50. package/dist/{chunk-DNGLD7VN.js → chunk-FIJTBRZ5.js} +1 -1
  51. package/dist/{chunk-AMWWPUSK.js → chunk-H3O7QBOQ.js} +1 -1
  52. package/dist/{chunk-AYNYP3G3.js → chunk-H62LRJJP.js} +19 -18
  53. package/dist/{chunk-FRDJNX6Z.js → chunk-H7Z4BWRI.js} +2 -2
  54. package/dist/{chunk-I44FSUBC.js → chunk-HA5FIXGQ.js} +1 -1
  55. package/dist/{chunk-NWW4246M.js → chunk-HEDK5J34.js} +1 -1
  56. package/dist/{chunk-M4CTE7EH.js → chunk-HF6HORZZ.js} +2 -2
  57. package/dist/{chunk-34BN2SJC.js → chunk-HFBC2TOG.js} +2 -2
  58. package/dist/{chunk-DO4WVWW7.js → chunk-IFXD4DH5.js} +1 -1
  59. package/dist/{chunk-ATTHVKNE.js → chunk-JN3G4Y4L.js} +4 -4
  60. package/dist/{chunk-ZQGJKPPY.js → chunk-JSKZXF5J.js} +31 -6
  61. package/dist/{chunk-Y2J7CAME.js → chunk-JYUJQHPR.js} +3 -3
  62. package/dist/{chunk-HLNTWWAZ.js → chunk-KA33M67F.js} +2 -2
  63. package/dist/{chunk-T45NOW43.js → chunk-L43UD7PK.js} +1 -1
  64. package/dist/{chunk-3QIIJADA.js → chunk-LOAFGJWC.js} +2 -2
  65. package/dist/{chunk-DWAA3F5Y.js → chunk-LR4TA74O.js} +15 -15
  66. package/dist/{chunk-MJ5J57UJ.js → chunk-M36DF445.js} +1 -1
  67. package/dist/{chunk-MHQXDTJB.js → chunk-NC4FHDIP.js} +1 -1
  68. package/dist/{chunk-NIOWKTIF.js → chunk-NT2AI5IE.js} +1 -1
  69. package/dist/{chunk-5D5P37FY.js → chunk-NZATVUV2.js} +1 -1
  70. package/dist/{chunk-ES5VD2ML.js → chunk-PFWTQ43U.js} +1 -1
  71. package/dist/{chunk-SVYLMMBI.js → chunk-QV5WI73T.js} +19 -6
  72. package/dist/{chunk-I5ZA45YL.js → chunk-QWGJS6V6.js} +4 -4
  73. package/dist/{chunk-YCXELHKG.js → chunk-REGPK5NG.js} +1 -1
  74. package/dist/{chunk-NUO56TF7.js → chunk-S5HVHCAK.js} +2 -2
  75. package/dist/{chunk-SXE7H3VK.js → chunk-SLAOS6JN.js} +1 -1
  76. package/dist/{chunk-NXRJ7Z4G.js → chunk-SW75SNDB.js} +1 -1
  77. package/dist/{chunk-JK5TPJHH.js → chunk-SXTHM67U.js} +1 -1
  78. package/dist/{chunk-NWFYV2VI.js → chunk-TRGHIMCR.js} +4 -4
  79. package/dist/{chunk-BMPB7XJH.js → chunk-TRQX5AIZ.js} +4 -4
  80. package/dist/{chunk-JEI7I3EH.js → chunk-TXUUUO5R.js} +2 -2
  81. package/dist/{chunk-P6NCA7G5.js → chunk-TZZMVXFM.js} +4 -4
  82. package/dist/{chunk-ND7BRD6B.js → chunk-UF3NB27E.js} +8 -8
  83. package/dist/{chunk-36VCC3BY.js → chunk-ULJVEN67.js} +3 -3
  84. package/dist/{chunk-UXMCHRGA.js → chunk-ULQOJ3WO.js} +2 -2
  85. package/dist/{chunk-B2JLKTBJ.js → chunk-VC25NYHW.js} +1 -1
  86. package/dist/{chunk-CCE6MVB3.js → chunk-VMILIALE.js} +18 -15
  87. package/dist/chunk-VUADJZRV.js +212 -0
  88. package/dist/{chunk-ADK2TYO4.js → chunk-WHV4YUQB.js} +1 -1
  89. package/dist/{chunk-AWHHLOWE.js → chunk-WP5EWNGJ.js} +4 -4
  90. package/dist/{chunk-HDSLSNN5.js → chunk-X2EEOO6Q.js} +5 -5
  91. package/dist/{chunk-AQXCXWAZ.js → chunk-XQEMI2MI.js} +1 -1
  92. package/dist/{chunk-OWP537VU.js → chunk-XTTHH5MF.js} +1 -1
  93. package/dist/{chunk-2BDD6OHG.js → chunk-XUNTHJIE.js} +7 -0
  94. package/dist/{chunk-BZ6HFTHU.js → chunk-YGTC5UP5.js} +1 -1
  95. package/dist/{chunk-YGAHGTVZ.js → chunk-YIOKUA23.js} +2 -2
  96. package/dist/{chunk-YY3NF45U.js → chunk-YTC6ST5T.js} +5 -5
  97. package/dist/config/index.js +4 -4
  98. package/dist/containers/client.js +5 -5
  99. package/dist/containers/exec.js +5 -5
  100. package/dist/containers/lifecycle.js +30 -30
  101. package/dist/containers/setup.js +7 -7
  102. package/dist/db/agents.js +5 -5
  103. package/dist/db/api_keys.js +4 -4
  104. package/dist/db/audit.js +3 -3
  105. package/dist/db/batch.js +9 -9
  106. package/dist/db/client.js +2 -2
  107. package/dist/db/credentials.js +3 -3
  108. package/dist/db/drizzle.js +3 -3
  109. package/dist/db/environments.js +5 -5
  110. package/dist/db/events.js +4 -4
  111. package/dist/db/files.js +4 -4
  112. package/dist/db/memory.js +4 -4
  113. package/dist/db/migrations.js +1 -1
  114. package/dist/db/proxy.js +4 -4
  115. package/dist/db/session-resources.js +4 -4
  116. package/dist/db/sessions.js +6 -6
  117. package/dist/db/sync.js +4 -4
  118. package/dist/db/tenants.js +3 -3
  119. package/dist/db/traces.js +4 -4
  120. package/dist/db/upstream_keys.js +3 -3
  121. package/dist/db/vaults.js +5 -5
  122. package/dist/handlers/agents.js +45 -45
  123. package/dist/handlers/api_keys.js +46 -46
  124. package/dist/handlers/audit.js +46 -46
  125. package/dist/handlers/batch.js +46 -46
  126. package/dist/handlers/credentials.js +46 -46
  127. package/dist/handlers/environments.js +46 -46
  128. package/dist/handlers/events.js +49 -49
  129. package/dist/handlers/files.js +46 -46
  130. package/dist/handlers/index.js +81 -81
  131. package/dist/handlers/license.js +45 -45
  132. package/dist/handlers/memory.js +46 -46
  133. package/dist/handlers/metrics.js +45 -45
  134. package/dist/handlers/models.js +46 -46
  135. package/dist/handlers/providers.js +45 -45
  136. package/dist/handlers/resources.js +45 -45
  137. package/dist/handlers/sessions.js +48 -48
  138. package/dist/handlers/settings.js +45 -45
  139. package/dist/handlers/skills-write.js +45 -45
  140. package/dist/handlers/skills.js +46 -46
  141. package/dist/handlers/stream.js +45 -45
  142. package/dist/handlers/tenants.js +46 -46
  143. package/dist/handlers/threads.js +45 -45
  144. package/dist/handlers/traces.js +46 -46
  145. package/dist/handlers/upstream_keys.js +48 -48
  146. package/dist/handlers/vaults.js +45 -45
  147. package/dist/handlers/whoami.js +45 -45
  148. package/dist/http.js +44 -44
  149. package/dist/index.js +48 -48
  150. package/dist/init.js +41 -41
  151. package/dist/lib/model-registry.js +5 -5
  152. package/dist/lib/skills-cache.js +5 -5
  153. package/dist/observability/otlp.js +11 -11
  154. package/dist/observability/redactor.js +7 -7
  155. package/dist/providers/fly.js +4 -4
  156. package/dist/providers/modal.js +4 -4
  157. package/dist/providers/registry.js +1 -1
  158. package/dist/providers/resolve-secrets.js +6 -6
  159. package/dist/providers/sprites.js +6 -6
  160. package/dist/providers/upstream-keys.js +10 -10
  161. package/dist/providers/vercel.js +4 -4
  162. package/dist/proxy/forward.js +5 -5
  163. package/dist/queue/index.js +5 -5
  164. package/dist/sessions/bus.js +9 -9
  165. package/dist/sessions/driver.js +34 -34
  166. package/dist/sessions/grader.js +4 -4
  167. package/dist/sessions/secrets.js +7 -7
  168. package/dist/sessions/sweeper.js +31 -31
  169. package/dist/sessions/threads.js +34 -34
  170. package/dist/shutdown.js +32 -32
  171. package/dist/sync/anthropic.js +9 -9
  172. package/dist/sync/container-file-sync.js +5 -5
  173. package/dist/sync/file-sync.js +16 -16
  174. package/package.json +1 -1
  175. package/dist/chunk-ALVC7G6R.js +0 -187
  176. package/dist/chunk-JLZO6TQL.js +0 -131
  177. /package/dist/{chunk-QUJNG4RA.js → chunk-C6JEPQ7T.js} +0 -0
@@ -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
  getDrizzle,
7
7
  init_drizzle
8
- } from "./chunk-SXE7H3VK.js";
8
+ } from "./chunk-SLAOS6JN.js";
9
9
  import {
10
10
  schema_exports
11
11
  } from "./chunk-LHHBOQUR.js";
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  getDrizzle,
7
7
  init_drizzle
8
- } from "./chunk-SXE7H3VK.js";
8
+ } from "./chunk-SLAOS6JN.js";
9
9
  import {
10
10
  schema_exports
11
11
  } from "./chunk-LHHBOQUR.js";
@@ -17,7 +17,7 @@ import {
17
17
  import {
18
18
  getDb,
19
19
  init_client
20
- } from "./chunk-5GZEX4HV.js";
20
+ } from "./chunk-4C7XJI2V.js";
21
21
 
22
22
  // src/db/events.ts
23
23
  init_client();
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  createSession
3
- } from "./chunk-I5ZA45YL.js";
3
+ } from "./chunk-QWGJS6V6.js";
4
4
  import {
5
5
  createEnvironment,
6
6
  deleteEnvironment,
7
7
  getEnvironment
8
- } from "./chunk-NUO56TF7.js";
8
+ } from "./chunk-S5HVHCAK.js";
9
9
  import {
10
10
  archiveAgent,
11
11
  createAgent,
12
12
  getAgent
13
- } from "./chunk-JEI7I3EH.js";
13
+ } from "./chunk-TXUUUO5R.js";
14
14
  import {
15
15
  getDrizzle,
16
16
  init_drizzle
17
- } from "./chunk-SXE7H3VK.js";
17
+ } from "./chunk-SLAOS6JN.js";
18
18
 
19
19
  // src/db/batch.ts
20
20
  init_drizzle();
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  jsonOk,
8
8
  routeWrap
9
- } from "./chunk-3QIIJADA.js";
9
+ } from "./chunk-LOAFGJWC.js";
10
10
  import {
11
11
  createVault,
12
12
  deleteEntry,
@@ -16,14 +16,14 @@ import {
16
16
  listEntries,
17
17
  listVaults,
18
18
  setEntry
19
- } from "./chunk-VIGJQU6V.js";
19
+ } from "./chunk-7GNSB22P.js";
20
20
  import {
21
21
  getAgent
22
- } from "./chunk-JEI7I3EH.js";
22
+ } from "./chunk-TXUUUO5R.js";
23
23
  import {
24
24
  getDb,
25
25
  init_client
26
- } from "./chunk-5GZEX4HV.js";
26
+ } from "./chunk-4C7XJI2V.js";
27
27
  import {
28
28
  badRequest,
29
29
  conflict,
@@ -101,8 +101,14 @@ function handleListVaults(request) {
101
101
  return routeWrap(request, async ({ auth, request: req }) => {
102
102
  const url = new URL(req.url);
103
103
  const agentId = url.searchParams.get("agent_id") ?? void 0;
104
+ const requestedLimit = Number(url.searchParams.get("limit") || "100");
104
105
  const data = listVaults({ agent_id: agentId, tenantFilter: tenantFilter(auth) });
105
- return jsonOk({ data });
106
+ return jsonOk({
107
+ data,
108
+ has_more: data.length === requestedLimit,
109
+ first_id: data.length > 0 ? data[0].id : null,
110
+ last_id: data.length > 0 ? data[data.length - 1].id : null
111
+ });
106
112
  });
107
113
  }
108
114
  function handleGetVault(request, id) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildCodexAuthEnv,
3
3
  validateCodexRuntime
4
- } from "./chunk-NWW4246M.js";
4
+ } from "./chunk-HEDK5J34.js";
5
5
  import {
6
6
  prepareCodexOnSandbox
7
7
  } from "./chunk-M2LUXIXU.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  buildGeminiAuthEnv,
6
6
  validateGeminiRuntime
7
- } from "./chunk-MJ5J57UJ.js";
7
+ } from "./chunk-M36DF445.js";
8
8
  import {
9
9
  prepareGeminiOnSandbox
10
10
  } from "./chunk-XG4UIGDH.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildClaudeArgs,
3
3
  buildClaudeAuthEnv
4
- } from "./chunk-WFIMX3HG.js";
4
+ } from "./chunk-EIR2TG5I.js";
5
5
  import {
6
6
  PERMISSION_BRIDGE_DIR,
7
7
  PERMISSION_HOOK_SCRIPT_PATH,
@@ -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";
@@ -25,7 +25,7 @@ import {
25
25
  } from "./chunk-IU457W7Q.js";
26
26
  import {
27
27
  getConfig
28
- } from "./chunk-EF5QCTEQ.js";
28
+ } from "./chunk-EFDAVLKN.js";
29
29
 
30
30
  // src/backends/claude/index.ts
31
31
  function buildTurn(input) {
@@ -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) {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  BatchError,
3
3
  executeBatch
4
- } from "./chunk-S3SKODVV.js";
4
+ } from "./chunk-5QTDZQ2H.js";
5
5
  import {
6
6
  jsonOk,
7
7
  routeWrap
8
- } from "./chunk-3QIIJADA.js";
8
+ } from "./chunk-LOAFGJWC.js";
9
9
  import {
10
10
  badRequest
11
11
  } from "./chunk-EZYKRG4W.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-AIBH32FN.js";
5
5
  import {
6
6
  DEFAULT_TENANT_ID
7
- } from "./chunk-JDELTTHV.js";
7
+ } from "./chunk-BBYQMNGK.js";
8
8
  import {
9
9
  init_ids,
10
10
  newId
@@ -12,7 +12,7 @@ import {
12
12
  import {
13
13
  getDrizzle,
14
14
  init_drizzle
15
- } from "./chunk-SXE7H3VK.js";
15
+ } from "./chunk-SLAOS6JN.js";
16
16
  import {
17
17
  schema_exports
18
18
  } from "./chunk-LHHBOQUR.js";
@@ -39,7 +39,7 @@ function hydrateVault(row) {
39
39
  }
40
40
  function createVault(input) {
41
41
  const db = getDrizzle();
42
- const id = newId("vault");
42
+ const id = newId("vlt");
43
43
  const now = nowMs();
44
44
  db.insert(schema_exports.vaults).values({
45
45
  id,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  jsonOk,
3
3
  routeWrap
4
- } from "./chunk-3QIIJADA.js";
4
+ } from "./chunk-LOAFGJWC.js";
5
5
  import {
6
6
  readSetting,
7
7
  writeSetting
8
- } from "./chunk-EF5QCTEQ.js";
8
+ } from "./chunk-EFDAVLKN.js";
9
9
  import {
10
10
  badRequest
11
11
  } from "./chunk-EZYKRG4W.js";
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  getDrizzle,
7
7
  init_drizzle
8
- } from "./chunk-SXE7H3VK.js";
8
+ } from "./chunk-SLAOS6JN.js";
9
9
  import {
10
10
  schema_exports
11
11
  } from "./chunk-LHHBOQUR.js";
@@ -47,7 +47,7 @@ function sha256(content) {
47
47
  }
48
48
  function createMemoryStore(input) {
49
49
  const db = getDrizzle();
50
- const id = newId("ms");
50
+ const id = newId("memstore");
51
51
  const now = nowMs();
52
52
  db.insert(schema_exports.memoryStores).values({
53
53
  id,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getConfig
3
- } from "./chunk-EF5QCTEQ.js";
3
+ } from "./chunk-EFDAVLKN.js";
4
4
  import {
5
5
  ApiError
6
6
  } from "./chunk-EZYKRG4W.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  markStopping
3
- } from "./chunk-NWFYV2VI.js";
3
+ } from "./chunk-TRGHIMCR.js";
4
4
  import {
5
5
  closeDb,
6
6
  init_client,
7
7
  syncDb
8
- } from "./chunk-5GZEX4HV.js";
8
+ } from "./chunk-4C7XJI2V.js";
9
9
  import {
10
10
  getRuntime
11
11
  } from "./chunk-UYTSKFGK.js";
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  getDb,
12
12
  init_client
13
- } from "./chunk-5GZEX4HV.js";
13
+ } from "./chunk-4C7XJI2V.js";
14
14
 
15
15
  // src/db/tenants.ts
16
16
  init_client();
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getModels
3
- } from "./chunk-4WMYJM36.js";
3
+ } from "./chunk-BKBC43KV.js";
4
4
  import {
5
5
  jsonOk,
6
6
  routeWrap
7
- } from "./chunk-3QIIJADA.js";
7
+ } from "./chunk-LOAFGJWC.js";
8
8
 
9
9
  // src/handlers/models.ts
10
10
  function handleListModels(request) {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  getConfig,
6
6
  readSetting
7
- } from "./chunk-EF5QCTEQ.js";
7
+ } from "./chunk-EFDAVLKN.js";
8
8
  import {
9
9
  __commonJS
10
10
  } from "./chunk-2ESYSVXG.js";
@@ -11,18 +11,18 @@ import {
11
11
  getFileRecord,
12
12
  listFiles,
13
13
  updateFileStoragePath
14
- } from "./chunk-NXRJ7Z4G.js";
14
+ } from "./chunk-SW75SNDB.js";
15
15
  import {
16
16
  assertResourceTenant
17
17
  } from "./chunk-23UKWXJH.js";
18
18
  import {
19
19
  jsonOk,
20
20
  routeWrap
21
- } from "./chunk-3QIIJADA.js";
21
+ } from "./chunk-LOAFGJWC.js";
22
22
  import {
23
23
  getDb,
24
24
  init_client
25
- } from "./chunk-5GZEX4HV.js";
25
+ } from "./chunk-4C7XJI2V.js";
26
26
  import {
27
27
  badRequest,
28
28
  notFound
@@ -6,31 +6,31 @@ import {
6
6
  import {
7
7
  jsonOk,
8
8
  routeWrap
9
- } from "./chunk-3QIIJADA.js";
9
+ } from "./chunk-LOAFGJWC.js";
10
10
  import {
11
11
  forwardToAnthropic,
12
12
  validateAnthropicProxy
13
- } from "./chunk-T45NOW43.js";
13
+ } from "./chunk-L43UD7PK.js";
14
14
  import {
15
15
  getProxiedTenantId,
16
16
  isProxied,
17
17
  markProxied,
18
18
  unmarkProxied
19
- } from "./chunk-NIOWKTIF.js";
19
+ } from "./chunk-NT2AI5IE.js";
20
20
  import {
21
21
  archiveAgent,
22
22
  createAgent,
23
23
  getAgent,
24
24
  listAgents,
25
25
  updateAgent
26
- } from "./chunk-JEI7I3EH.js";
26
+ } from "./chunk-TXUUUO5R.js";
27
27
  import {
28
28
  resolveBackend
29
- } from "./chunk-P525BPB2.js";
29
+ } from "./chunk-4B7PQTTS.js";
30
30
  import {
31
31
  getDb,
32
32
  init_client
33
- } from "./chunk-5GZEX4HV.js";
33
+ } from "./chunk-4C7XJI2V.js";
34
34
  import {
35
35
  badRequest,
36
36
  conflict,
@@ -216,8 +216,9 @@ function handleListAgents(request) {
216
216
  const order = url.searchParams.get("order");
217
217
  const includeArchived = url.searchParams.get("include_archived") === "true";
218
218
  const cursor = url.searchParams.get("page") ?? void 0;
219
+ const requestedLimit = limit ? Number(limit) : 20;
219
220
  const data = listAgents({
220
- limit: limit ? Number(limit) : void 0,
221
+ limit: requestedLimit,
221
222
  order: order ?? void 0,
222
223
  includeArchived,
223
224
  cursor,
@@ -225,7 +226,9 @@ function handleListAgents(request) {
225
226
  });
226
227
  return jsonOk({
227
228
  data,
228
- next_page: data.length > 0 ? data[data.length - 1].id : null
229
+ has_more: data.length === requestedLimit,
230
+ first_id: data.length > 0 ? data[0].id : null,
231
+ last_id: data.length > 0 ? data[data.length - 1].id : null
229
232
  });
230
233
  });
231
234
  }
@@ -4,11 +4,11 @@ import {
4
4
  } from "./chunk-23UKWXJH.js";
5
5
  import {
6
6
  listAudit
7
- } from "./chunk-MHQXDTJB.js";
7
+ } from "./chunk-NC4FHDIP.js";
8
8
  import {
9
9
  jsonOk,
10
10
  routeWrap
11
- } from "./chunk-3QIIJADA.js";
11
+ } from "./chunk-LOAFGJWC.js";
12
12
  import {
13
13
  badRequest
14
14
  } from "./chunk-EZYKRG4W.js";
@@ -44,8 +44,9 @@ function handleListAudit(request) {
44
44
  }
45
45
  outcome = outcomeRaw;
46
46
  }
47
+ const requestedLimit = limit ? Number(limit) : 100;
47
48
  const data = listAudit({
48
- limit: limit ? Number(limit) : void 0,
49
+ limit: requestedLimit,
49
50
  cursor,
50
51
  action,
51
52
  actor_key_id: actorKeyId,
@@ -58,7 +59,9 @@ function handleListAudit(request) {
58
59
  });
59
60
  return jsonOk({
60
61
  data,
61
- next_page: data.length > 0 ? data[data.length - 1].id : null
62
+ has_more: data.length === requestedLimit,
63
+ first_id: data.length > 0 ? data[0].id : null,
64
+ last_id: data.length > 0 ? data[data.length - 1].id : null
62
65
  });
63
66
  });
64
67
  }
@@ -5,23 +5,23 @@ import {
5
5
  } from "./chunk-23UKWXJH.js";
6
6
  import {
7
7
  kickoffEnvironmentSetup
8
- } from "./chunk-HLNTWWAZ.js";
8
+ } from "./chunk-KA33M67F.js";
9
9
  import {
10
10
  jsonOk,
11
11
  routeWrap
12
- } from "./chunk-3QIIJADA.js";
12
+ } from "./chunk-LOAFGJWC.js";
13
13
  import {
14
14
  forwardToAnthropic
15
- } from "./chunk-T45NOW43.js";
15
+ } from "./chunk-L43UD7PK.js";
16
16
  import {
17
17
  getProxiedTenantId,
18
18
  isProxied,
19
19
  markProxied,
20
20
  unmarkProxied
21
- } from "./chunk-NIOWKTIF.js";
21
+ } from "./chunk-NT2AI5IE.js";
22
22
  import {
23
23
  resolveContainerProvider
24
- } from "./chunk-QUJNG4RA.js";
24
+ } from "./chunk-C6JEPQ7T.js";
25
25
  import {
26
26
  archiveEnvironment,
27
27
  createEnvironment,
@@ -30,11 +30,11 @@ import {
30
30
  hasSessionsAttached,
31
31
  listEnvironments,
32
32
  updateEnvironment
33
- } from "./chunk-NUO56TF7.js";
33
+ } from "./chunk-S5HVHCAK.js";
34
34
  import {
35
35
  getDb,
36
36
  init_client
37
- } from "./chunk-5GZEX4HV.js";
37
+ } from "./chunk-4C7XJI2V.js";
38
38
  import {
39
39
  badRequest,
40
40
  conflict,
@@ -155,8 +155,9 @@ function handleListEnvironments(request) {
155
155
  const order = url.searchParams.get("order");
156
156
  const includeArchived = url.searchParams.get("include_archived") === "true";
157
157
  const cursor = url.searchParams.get("page") ?? void 0;
158
+ const requestedLimit = limit ? Number(limit) : 20;
158
159
  const data = listEnvironments({
159
- limit: limit ? Number(limit) : void 0,
160
+ limit: requestedLimit,
160
161
  order: order ?? void 0,
161
162
  includeArchived,
162
163
  cursor,
@@ -164,7 +165,9 @@ function handleListEnvironments(request) {
164
165
  });
165
166
  return jsonOk({
166
167
  data,
167
- next_page: data.length > 0 ? data[data.length - 1].id : null
168
+ has_more: data.length === requestedLimit,
169
+ first_id: data.length > 0 ? data[0].id : null,
170
+ last_id: data.length > 0 ? data[data.length - 1].id : null
168
171
  });
169
172
  });
170
173
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  jsonOk,
3
3
  routeWrap
4
- } from "./chunk-3QIIJADA.js";
4
+ } from "./chunk-LOAFGJWC.js";
5
5
 
6
6
  // src/handlers/whoami.ts
7
7
  function handleWhoami(request) {
@@ -5,15 +5,15 @@ import {
5
5
  import {
6
6
  jsonOk,
7
7
  routeWrap
8
- } from "./chunk-3QIIJADA.js";
8
+ } from "./chunk-LOAFGJWC.js";
9
9
  import {
10
10
  getSession,
11
11
  listSessions
12
- } from "./chunk-I5ZA45YL.js";
12
+ } from "./chunk-QWGJS6V6.js";
13
13
  import {
14
14
  getDb,
15
15
  init_client
16
- } from "./chunk-5GZEX4HV.js";
16
+ } from "./chunk-4C7XJI2V.js";
17
17
  import {
18
18
  notFound
19
19
  } from "./chunk-EZYKRG4W.js";
@@ -30,9 +30,10 @@ function handleListThreads(request, sessionId) {
30
30
  const url = new URL(request.url);
31
31
  const limit = url.searchParams.get("limit");
32
32
  const order = url.searchParams.get("order");
33
+ const requestedLimit = limit ? Number(limit) : 50;
33
34
  const data = listSessions({
34
35
  parent_session_id: sessionId,
35
- limit: limit ? Number(limit) : void 0,
36
+ limit: requestedLimit,
36
37
  order: order ?? void 0,
37
38
  includeArchived: true,
38
39
  // show all threads including completed ones
@@ -40,7 +41,9 @@ function handleListThreads(request, sessionId) {
40
41
  });
41
42
  return jsonOk({
42
43
  data,
43
- next_page: data.length > 0 ? data[data.length - 1].id : null
44
+ has_more: data.length === requestedLimit,
45
+ first_id: data.length > 0 ? data[0].id : null,
46
+ last_id: data.length > 0 ? data[data.length - 1].id : null
44
47
  });
45
48
  });
46
49
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDrizzle,
3
3
  init_drizzle
4
- } from "./chunk-SXE7H3VK.js";
4
+ } from "./chunk-SLAOS6JN.js";
5
5
  import {
6
6
  schema_exports
7
7
  } from "./chunk-LHHBOQUR.js";