@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.
- package/dist/auth/middleware.js +7 -7
- package/dist/backends/claude/args.js +5 -5
- package/dist/backends/claude/index.js +7 -7
- package/dist/backends/claude/tool-bridge.js +3 -1
- package/dist/backends/codex/auth.js +5 -5
- package/dist/backends/codex/index.js +6 -6
- package/dist/backends/factory/auth.js +5 -5
- package/dist/backends/factory/index.js +6 -6
- package/dist/backends/gemini/auth.js +5 -5
- package/dist/backends/gemini/index.js +6 -6
- package/dist/backends/opencode/auth.js +5 -5
- package/dist/backends/opencode/index.js +6 -6
- package/dist/backends/pi/auth.js +5 -5
- package/dist/backends/pi/index.js +6 -6
- package/dist/backends/registry.js +18 -18
- package/dist/{chunk-TY3HD5I5.js → chunk-2DRBKIGQ.js} +1 -1
- package/dist/{chunk-ATGDKD4W.js → chunk-2JKOYBUO.js} +1 -1
- package/dist/{chunk-4IFVESQO.js → chunk-3KLJGU75.js} +17 -14
- package/dist/{chunk-ZP5VMV5O.js → chunk-46XURNM7.js} +4 -4
- package/dist/{chunk-P525BPB2.js → chunk-4B7PQTTS.js} +6 -6
- package/dist/{chunk-5GZEX4HV.js → chunk-4C7XJI2V.js} +1 -1
- package/dist/chunk-4FDEJHH7.js +128 -0
- package/dist/{chunk-R5OZHLAD.js → chunk-4PVPM2WC.js} +1 -1
- package/dist/{chunk-O45IQUWS.js → chunk-5NBZZZKH.js} +2 -2
- package/dist/{chunk-S3SKODVV.js → chunk-5QTDZQ2H.js} +4 -4
- package/dist/{chunk-JNHADPQ3.js → chunk-65XR7JU6.js} +11 -5
- package/dist/{chunk-X2CAT5MN.js → chunk-67D4I5AE.js} +1 -1
- package/dist/{chunk-EHCGLMPC.js → chunk-6EQZSMIZ.js} +1 -1
- package/dist/{chunk-HQACDTN4.js → chunk-6VENJOPG.js} +5 -5
- package/dist/{chunk-VHZML3D5.js → chunk-7DSZOBSQ.js} +2 -2
- package/dist/{chunk-VIGJQU6V.js → chunk-7GNSB22P.js} +3 -3
- package/dist/{chunk-4TF2EKVQ.js → chunk-7UJ2PIXJ.js} +2 -2
- package/dist/{chunk-NUINUAXO.js → chunk-7V277COF.js} +2 -2
- package/dist/{chunk-4RNCKCDV.js → chunk-AP2N4R6D.js} +1 -1
- package/dist/{chunk-WJUWZKRP.js → chunk-AXISFTHX.js} +2 -2
- package/dist/{chunk-JDELTTHV.js → chunk-BBYQMNGK.js} +1 -1
- package/dist/{chunk-FEHDZT7I.js → chunk-BJK4SGWG.js} +2 -2
- package/dist/{chunk-4WMYJM36.js → chunk-BKBC43KV.js} +1 -1
- package/dist/{chunk-CGPTH3JC.js → chunk-BQOFXJSK.js} +3 -3
- package/dist/{chunk-PF6W4L5F.js → chunk-BSVZAXLI.js} +11 -8
- package/dist/{chunk-UO2N4Q3V.js → chunk-CL3DUJRJ.js} +7 -4
- package/dist/{chunk-UZJI64HR.js → chunk-DL2BACWC.js} +12 -9
- package/dist/{chunk-B7L5XD24.js → chunk-DNV6JZLZ.js} +1 -1
- package/dist/{chunk-AU2DTTBR.js → chunk-EFCCO74P.js} +8 -5
- package/dist/{chunk-EF5QCTEQ.js → chunk-EFDAVLKN.js} +1 -1
- package/dist/{chunk-WFIMX3HG.js → chunk-EIR2TG5I.js} +1 -1
- package/dist/{chunk-F3M4HKEJ.js → chunk-EN3ICYTL.js} +9 -9
- package/dist/{chunk-Y2KDIPCT.js → chunk-F3BVYYRX.js} +5 -5
- package/dist/{chunk-ZMMDLKR3.js → chunk-FGQFNIRI.js} +3 -3
- package/dist/{chunk-DNGLD7VN.js → chunk-FIJTBRZ5.js} +1 -1
- package/dist/{chunk-AMWWPUSK.js → chunk-H3O7QBOQ.js} +1 -1
- package/dist/{chunk-AYNYP3G3.js → chunk-H62LRJJP.js} +19 -18
- package/dist/{chunk-FRDJNX6Z.js → chunk-H7Z4BWRI.js} +2 -2
- package/dist/{chunk-I44FSUBC.js → chunk-HA5FIXGQ.js} +1 -1
- package/dist/{chunk-NWW4246M.js → chunk-HEDK5J34.js} +1 -1
- package/dist/{chunk-M4CTE7EH.js → chunk-HF6HORZZ.js} +2 -2
- package/dist/{chunk-34BN2SJC.js → chunk-HFBC2TOG.js} +2 -2
- package/dist/{chunk-DO4WVWW7.js → chunk-IFXD4DH5.js} +1 -1
- package/dist/{chunk-ATTHVKNE.js → chunk-JN3G4Y4L.js} +4 -4
- package/dist/{chunk-ZQGJKPPY.js → chunk-JSKZXF5J.js} +31 -6
- package/dist/{chunk-Y2J7CAME.js → chunk-JYUJQHPR.js} +3 -3
- package/dist/{chunk-HLNTWWAZ.js → chunk-KA33M67F.js} +2 -2
- package/dist/{chunk-T45NOW43.js → chunk-L43UD7PK.js} +1 -1
- package/dist/{chunk-3QIIJADA.js → chunk-LOAFGJWC.js} +2 -2
- package/dist/{chunk-DWAA3F5Y.js → chunk-LR4TA74O.js} +15 -15
- package/dist/{chunk-MJ5J57UJ.js → chunk-M36DF445.js} +1 -1
- package/dist/{chunk-MHQXDTJB.js → chunk-NC4FHDIP.js} +1 -1
- package/dist/{chunk-NIOWKTIF.js → chunk-NT2AI5IE.js} +1 -1
- package/dist/{chunk-5D5P37FY.js → chunk-NZATVUV2.js} +1 -1
- package/dist/{chunk-ES5VD2ML.js → chunk-PFWTQ43U.js} +1 -1
- package/dist/{chunk-SVYLMMBI.js → chunk-QV5WI73T.js} +19 -6
- package/dist/{chunk-I5ZA45YL.js → chunk-QWGJS6V6.js} +4 -4
- package/dist/{chunk-YCXELHKG.js → chunk-REGPK5NG.js} +1 -1
- package/dist/{chunk-NUO56TF7.js → chunk-S5HVHCAK.js} +2 -2
- package/dist/{chunk-SXE7H3VK.js → chunk-SLAOS6JN.js} +1 -1
- package/dist/{chunk-NXRJ7Z4G.js → chunk-SW75SNDB.js} +1 -1
- package/dist/{chunk-JK5TPJHH.js → chunk-SXTHM67U.js} +1 -1
- package/dist/{chunk-NWFYV2VI.js → chunk-TRGHIMCR.js} +4 -4
- package/dist/{chunk-BMPB7XJH.js → chunk-TRQX5AIZ.js} +4 -4
- package/dist/{chunk-JEI7I3EH.js → chunk-TXUUUO5R.js} +2 -2
- package/dist/{chunk-P6NCA7G5.js → chunk-TZZMVXFM.js} +4 -4
- package/dist/{chunk-ND7BRD6B.js → chunk-UF3NB27E.js} +8 -8
- package/dist/{chunk-36VCC3BY.js → chunk-ULJVEN67.js} +3 -3
- package/dist/{chunk-UXMCHRGA.js → chunk-ULQOJ3WO.js} +2 -2
- package/dist/{chunk-B2JLKTBJ.js → chunk-VC25NYHW.js} +1 -1
- package/dist/{chunk-CCE6MVB3.js → chunk-VMILIALE.js} +18 -15
- package/dist/chunk-VUADJZRV.js +212 -0
- package/dist/{chunk-ADK2TYO4.js → chunk-WHV4YUQB.js} +1 -1
- package/dist/{chunk-AWHHLOWE.js → chunk-WP5EWNGJ.js} +4 -4
- package/dist/{chunk-HDSLSNN5.js → chunk-X2EEOO6Q.js} +5 -5
- package/dist/{chunk-AQXCXWAZ.js → chunk-XQEMI2MI.js} +1 -1
- package/dist/{chunk-OWP537VU.js → chunk-XTTHH5MF.js} +1 -1
- package/dist/{chunk-2BDD6OHG.js → chunk-XUNTHJIE.js} +7 -0
- package/dist/{chunk-BZ6HFTHU.js → chunk-YGTC5UP5.js} +1 -1
- package/dist/{chunk-YGAHGTVZ.js → chunk-YIOKUA23.js} +2 -2
- package/dist/{chunk-YY3NF45U.js → chunk-YTC6ST5T.js} +5 -5
- package/dist/config/index.js +4 -4
- package/dist/containers/client.js +5 -5
- package/dist/containers/exec.js +5 -5
- package/dist/containers/lifecycle.js +30 -30
- package/dist/containers/setup.js +7 -7
- package/dist/db/agents.js +5 -5
- package/dist/db/api_keys.js +4 -4
- package/dist/db/audit.js +3 -3
- package/dist/db/batch.js +9 -9
- package/dist/db/client.js +2 -2
- package/dist/db/credentials.js +3 -3
- package/dist/db/drizzle.js +3 -3
- package/dist/db/environments.js +5 -5
- package/dist/db/events.js +4 -4
- package/dist/db/files.js +4 -4
- package/dist/db/memory.js +4 -4
- package/dist/db/migrations.js +1 -1
- package/dist/db/proxy.js +4 -4
- package/dist/db/session-resources.js +4 -4
- package/dist/db/sessions.js +6 -6
- package/dist/db/sync.js +4 -4
- package/dist/db/tenants.js +3 -3
- package/dist/db/traces.js +4 -4
- package/dist/db/upstream_keys.js +3 -3
- package/dist/db/vaults.js +5 -5
- package/dist/handlers/agents.js +45 -45
- package/dist/handlers/api_keys.js +46 -46
- package/dist/handlers/audit.js +46 -46
- package/dist/handlers/batch.js +46 -46
- package/dist/handlers/credentials.js +46 -46
- package/dist/handlers/environments.js +46 -46
- package/dist/handlers/events.js +49 -49
- package/dist/handlers/files.js +46 -46
- package/dist/handlers/index.js +81 -81
- package/dist/handlers/license.js +45 -45
- package/dist/handlers/memory.js +46 -46
- package/dist/handlers/metrics.js +45 -45
- package/dist/handlers/models.js +46 -46
- package/dist/handlers/providers.js +45 -45
- package/dist/handlers/resources.js +45 -45
- package/dist/handlers/sessions.js +48 -48
- package/dist/handlers/settings.js +45 -45
- package/dist/handlers/skills-write.js +45 -45
- package/dist/handlers/skills.js +46 -46
- package/dist/handlers/stream.js +45 -45
- package/dist/handlers/tenants.js +46 -46
- package/dist/handlers/threads.js +45 -45
- package/dist/handlers/traces.js +46 -46
- package/dist/handlers/upstream_keys.js +48 -48
- package/dist/handlers/vaults.js +45 -45
- package/dist/handlers/whoami.js +45 -45
- package/dist/http.js +44 -44
- package/dist/index.js +48 -48
- package/dist/init.js +41 -41
- package/dist/lib/model-registry.js +5 -5
- package/dist/lib/skills-cache.js +5 -5
- package/dist/observability/otlp.js +11 -11
- package/dist/observability/redactor.js +7 -7
- package/dist/providers/fly.js +4 -4
- package/dist/providers/modal.js +4 -4
- package/dist/providers/registry.js +1 -1
- package/dist/providers/resolve-secrets.js +6 -6
- package/dist/providers/sprites.js +6 -6
- package/dist/providers/upstream-keys.js +10 -10
- package/dist/providers/vercel.js +4 -4
- package/dist/proxy/forward.js +5 -5
- package/dist/queue/index.js +5 -5
- package/dist/sessions/bus.js +9 -9
- package/dist/sessions/driver.js +34 -34
- package/dist/sessions/grader.js +4 -4
- package/dist/sessions/secrets.js +7 -7
- package/dist/sessions/sweeper.js +31 -31
- package/dist/sessions/threads.js +34 -34
- package/dist/shutdown.js +32 -32
- package/dist/sync/anthropic.js +9 -9
- package/dist/sync/container-file-sync.js +5 -5
- package/dist/sync/file-sync.js +16 -16
- package/package.json +1 -1
- package/dist/chunk-ALVC7G6R.js +0 -187
- package/dist/chunk-JLZO6TQL.js +0 -131
- /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-
|
|
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-
|
|
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-
|
|
3
|
+
} from "./chunk-QWGJS6V6.js";
|
|
4
4
|
import {
|
|
5
5
|
createEnvironment,
|
|
6
6
|
deleteEnvironment,
|
|
7
7
|
getEnvironment
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-S5HVHCAK.js";
|
|
9
9
|
import {
|
|
10
10
|
archiveAgent,
|
|
11
11
|
createAgent,
|
|
12
12
|
getAgent
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TXUUUO5R.js";
|
|
14
14
|
import {
|
|
15
15
|
getDrizzle,
|
|
16
16
|
init_drizzle
|
|
17
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
19
|
+
} from "./chunk-7GNSB22P.js";
|
|
20
20
|
import {
|
|
21
21
|
getAgent
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TXUUUO5R.js";
|
|
23
23
|
import {
|
|
24
24
|
getDb,
|
|
25
25
|
init_client
|
|
26
|
-
} from "./chunk-
|
|
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({
|
|
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
|
buildClaudeArgs,
|
|
3
3
|
buildClaudeAuthEnv
|
|
4
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
4
|
+
} from "./chunk-5QTDZQ2H.js";
|
|
5
5
|
import {
|
|
6
6
|
jsonOk,
|
|
7
7
|
routeWrap
|
|
8
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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("
|
|
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-
|
|
4
|
+
} from "./chunk-LOAFGJWC.js";
|
|
5
5
|
import {
|
|
6
6
|
readSetting,
|
|
7
7
|
writeSetting
|
|
8
|
-
} from "./chunk-
|
|
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-
|
|
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("
|
|
50
|
+
const id = newId("memstore");
|
|
51
51
|
const now = nowMs();
|
|
52
52
|
db.insert(schema_exports.memoryStores).values({
|
|
53
53
|
id,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
markStopping
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TRGHIMCR.js";
|
|
4
4
|
import {
|
|
5
5
|
closeDb,
|
|
6
6
|
init_client,
|
|
7
7
|
syncDb
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-4C7XJI2V.js";
|
|
9
9
|
import {
|
|
10
10
|
getRuntime
|
|
11
11
|
} from "./chunk-UYTSKFGK.js";
|
|
@@ -11,18 +11,18 @@ import {
|
|
|
11
11
|
getFileRecord,
|
|
12
12
|
listFiles,
|
|
13
13
|
updateFileStoragePath
|
|
14
|
-
} from "./chunk-
|
|
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-
|
|
21
|
+
} from "./chunk-LOAFGJWC.js";
|
|
22
22
|
import {
|
|
23
23
|
getDb,
|
|
24
24
|
init_client
|
|
25
|
-
} from "./chunk-
|
|
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-
|
|
9
|
+
} from "./chunk-LOAFGJWC.js";
|
|
10
10
|
import {
|
|
11
11
|
forwardToAnthropic,
|
|
12
12
|
validateAnthropicProxy
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-L43UD7PK.js";
|
|
14
14
|
import {
|
|
15
15
|
getProxiedTenantId,
|
|
16
16
|
isProxied,
|
|
17
17
|
markProxied,
|
|
18
18
|
unmarkProxied
|
|
19
|
-
} from "./chunk-
|
|
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-
|
|
26
|
+
} from "./chunk-TXUUUO5R.js";
|
|
27
27
|
import {
|
|
28
28
|
resolveBackend
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-4B7PQTTS.js";
|
|
30
30
|
import {
|
|
31
31
|
getDb,
|
|
32
32
|
init_client
|
|
33
|
-
} from "./chunk-
|
|
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:
|
|
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
|
-
|
|
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-
|
|
7
|
+
} from "./chunk-NC4FHDIP.js";
|
|
8
8
|
import {
|
|
9
9
|
jsonOk,
|
|
10
10
|
routeWrap
|
|
11
|
-
} from "./chunk-
|
|
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:
|
|
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
|
-
|
|
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-
|
|
8
|
+
} from "./chunk-KA33M67F.js";
|
|
9
9
|
import {
|
|
10
10
|
jsonOk,
|
|
11
11
|
routeWrap
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LOAFGJWC.js";
|
|
13
13
|
import {
|
|
14
14
|
forwardToAnthropic
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-L43UD7PK.js";
|
|
16
16
|
import {
|
|
17
17
|
getProxiedTenantId,
|
|
18
18
|
isProxied,
|
|
19
19
|
markProxied,
|
|
20
20
|
unmarkProxied
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NT2AI5IE.js";
|
|
22
22
|
import {
|
|
23
23
|
resolveContainerProvider
|
|
24
|
-
} from "./chunk-
|
|
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-
|
|
33
|
+
} from "./chunk-S5HVHCAK.js";
|
|
34
34
|
import {
|
|
35
35
|
getDb,
|
|
36
36
|
init_client
|
|
37
|
-
} from "./chunk-
|
|
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:
|
|
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
|
-
|
|
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
|
}
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
jsonOk,
|
|
7
7
|
routeWrap
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LOAFGJWC.js";
|
|
9
9
|
import {
|
|
10
10
|
getSession,
|
|
11
11
|
listSessions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QWGJS6V6.js";
|
|
13
13
|
import {
|
|
14
14
|
getDb,
|
|
15
15
|
init_client
|
|
16
|
-
} from "./chunk-
|
|
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:
|
|
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
|
-
|
|
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
|
}
|