@agentstep/agent-sdk 0.5.1 → 0.5.3
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 +8 -8
- package/dist/backends/claude/args.js +7 -7
- package/dist/backends/claude/index.js +11 -11
- package/dist/backends/codex/auth.js +6 -6
- package/dist/backends/codex/index.js +11 -11
- package/dist/backends/factory/auth.js +6 -6
- package/dist/backends/factory/index.js +13 -13
- package/dist/backends/gemini/auth.js +6 -6
- package/dist/backends/gemini/index.js +11 -11
- package/dist/backends/opencode/auth.js +6 -6
- package/dist/backends/opencode/index.js +15 -15
- package/dist/backends/pi/auth.js +6 -6
- package/dist/backends/pi/index.js +13 -13
- package/dist/backends/registry.js +30 -30
- package/dist/backends/shared/wrap-prompt.js +1 -1
- package/dist/{chunk-4LHJJXH3.js → chunk-23CUQSLR.js} +2 -2
- package/dist/{chunk-57LAR6EM.js → chunk-2FKWZKV2.js} +4 -4
- package/dist/chunk-2YPJLPTR.js +166 -0
- package/dist/{chunk-FYBHPBWY.js → chunk-335F7KSU.js} +2 -2
- package/dist/chunk-3LUY2POB.js +50 -0
- package/dist/{chunk-HMOSAXVZ.js → chunk-4A4F4L4H.js} +2 -2
- package/dist/{chunk-JWHSUEDE.js → chunk-5NCA624D.js} +23 -7
- package/dist/{chunk-7SY65LWY.js → chunk-62CZZBEE.js} +4 -4
- package/dist/{chunk-GD3WXIHX.js → chunk-65XQ72BF.js} +1 -1
- package/dist/{chunk-RT5S5KRX.js → chunk-6DPJVMEC.js} +1 -1
- package/dist/{chunk-NBYCX6L4.js → chunk-6KJS42ZL.js} +7 -6
- package/dist/{chunk-QJ6QQO6D.js → chunk-6KQFP32G.js} +2 -2
- package/dist/{chunk-GIUB2OPA.js → chunk-6TJBZXD4.js} +1 -1
- package/dist/{chunk-UMVZZQKD.js → chunk-6ZM7XNH3.js} +1 -1
- package/dist/{chunk-ZY2U24QP.js → chunk-75XURMV5.js} +51 -12
- package/dist/{chunk-H6OT5GUL.js → chunk-7APAOJIZ.js} +3 -3
- package/dist/{chunk-HVLYE4S5.js → chunk-7EDLLXFQ.js} +1 -1
- package/dist/chunk-7IYL2O7H.js +185 -0
- package/dist/{chunk-KGBKIJPF.js → chunk-7JAUY5SG.js} +3 -3
- package/dist/{chunk-T7BHW3CP.js → chunk-7JWW4ZQI.js} +70 -24
- package/dist/{chunk-YZZHDZ7B.js → chunk-7XIAKW75.js} +1 -1
- package/dist/{chunk-USIMPXUH.js → chunk-A2W3USEZ.js} +1 -1
- package/dist/{chunk-WU74DV5R.js → chunk-A7AXD5AM.js} +2 -2
- package/dist/chunk-ACPP4KN7.js +164 -0
- package/dist/{chunk-22OUZJAV.js → chunk-AESA3ARX.js} +3 -3
- package/dist/{chunk-37C5BNVV.js → chunk-AIAF5ZZA.js} +1 -1
- package/dist/{chunk-YYMUSVUI.js → chunk-ANS2TQYT.js} +3 -3
- package/dist/{chunk-T3FQPTOA.js → chunk-BCBDHUFY.js} +2 -2
- package/dist/{chunk-COZG53R3.js → chunk-BCBRLP33.js} +2 -2
- package/dist/{chunk-MCWCRZM4.js → chunk-BLTCDZ3O.js} +4 -4
- package/dist/{chunk-VP527YC5.js → chunk-BYIU4WAQ.js} +3 -3
- package/dist/{chunk-R6EXYBCT.js → chunk-C52BVTYC.js} +8 -8
- package/dist/{chunk-DMMNAQUM.js → chunk-C5GVKLNS.js} +10 -18
- package/dist/{chunk-B5EY2VJC.js → chunk-C7BU4RX6.js} +3 -3
- package/dist/{chunk-T3IGOI6Z.js → chunk-DTQ7J35Q.js} +2 -2
- package/dist/{chunk-5M47X54D.js → chunk-DZGFZMUE.js} +5 -5
- package/dist/{chunk-3NKK4M23.js → chunk-E2OYBE5D.js} +2 -2
- package/dist/{chunk-L35CBI7F.js → chunk-E35XHOFL.js} +5 -5
- package/dist/{chunk-CE366H6Z.js → chunk-EHMKMOXH.js} +5 -5
- package/dist/{chunk-3S4CGFKJ.js → chunk-EQ32JFKT.js} +3 -3
- package/dist/{chunk-PZNAQBHQ.js → chunk-FILGQF2G.js} +2 -2
- package/dist/{chunk-MZYJFU4K.js → chunk-FSVDF57K.js} +5 -5
- package/dist/{chunk-XSNJ7NT2.js → chunk-G4DTLYOD.js} +1 -1
- package/dist/{chunk-IEZFRNLC.js → chunk-GBLR2CPP.js} +107 -9
- package/dist/{chunk-C35ZTCBP.js → chunk-IAKR572X.js} +8 -8
- package/dist/{chunk-W3JMIUHV.js → chunk-KQTTKYZY.js} +1 -1
- package/dist/{chunk-LIXSR7BG.js → chunk-LHFEBLOE.js} +7 -7
- package/dist/{chunk-BCIFFAGW.js → chunk-M3752GFZ.js} +15 -5
- package/dist/{chunk-5U5LRAFJ.js → chunk-MTLM36QD.js} +2 -2
- package/dist/{chunk-CKFJN5XK.js → chunk-MV42BTU3.js} +1 -1
- package/dist/{chunk-ZWC5V2DB.js → chunk-NJ6KNTZR.js} +17 -17
- package/dist/{chunk-5MERXOLJ.js → chunk-NRX5WHHN.js} +4 -4
- package/dist/{chunk-2YIMCZJK.js → chunk-NUOCXBFP.js} +68 -20
- package/dist/{chunk-T3HMVHDG.js → chunk-O2X4XBU7.js} +1 -1
- package/dist/{chunk-2YZOIFVN.js → chunk-P4NU74SP.js} +47 -0
- package/dist/{chunk-BJP5BIHE.js → chunk-PGJSOKPH.js} +3 -3
- package/dist/{chunk-IMPLRDOV.js → chunk-Q2JYAAJO.js} +9 -9
- package/dist/{chunk-56XDLNEW.js → chunk-RJDYM2HR.js} +1 -1
- package/dist/{chunk-4MKBT3KA.js → chunk-T6F4TFHD.js} +4 -4
- package/dist/{chunk-74E7GKUG.js → chunk-TE6KCRPP.js} +1 -1
- package/dist/{chunk-VJWNFMMQ.js → chunk-TF36SWHG.js} +2 -2
- package/dist/{chunk-KUWJJD6O.js → chunk-TSR33JMZ.js} +14 -5
- package/dist/{chunk-L3IACZ72.js → chunk-TWH4UH6G.js} +1 -1
- package/dist/{chunk-445EL6J5.js → chunk-UAEVL47I.js} +1 -1
- package/dist/{chunk-6RFQCFL2.js → chunk-UALRSWXY.js} +44 -14
- package/dist/{chunk-GQYSSSVA.js → chunk-UGH5JDXX.js} +2 -2
- package/dist/{chunk-I26QP3A3.js → chunk-UQZFFG7U.js} +1 -1
- package/dist/{chunk-Q4XF3OBK.js → chunk-UYP3VGYB.js} +8 -8
- package/dist/{chunk-ILHIHMO3.js → chunk-VC5DELR4.js} +37 -2
- package/dist/{chunk-O56RNR7B.js → chunk-VMLXV2H6.js} +1 -1
- package/dist/{chunk-FCUXFLNK.js → chunk-VY6IWBSK.js} +17 -4
- package/dist/{chunk-NL4UNA53.js → chunk-VYY4RHIF.js} +2 -2
- package/dist/{chunk-NRXTWATQ.js → chunk-WFRHLTKI.js} +3 -3
- package/dist/{chunk-UMRDMOB6.js → chunk-WRLCJNQF.js} +1 -1
- package/dist/{chunk-DRNZ24RF.js → chunk-WXMEJVLS.js} +4 -4
- package/dist/{chunk-63AKPSCV.js → chunk-X4ARJS6I.js} +10 -10
- package/dist/{chunk-MXMXJYN4.js → chunk-XXGVNVPI.js} +5 -5
- package/dist/{chunk-A46RUKGA.js → chunk-Y4MI27HU.js} +1 -1
- package/dist/{chunk-TG3S4RVJ.js → chunk-Y7NMJ662.js} +2 -2
- package/dist/{chunk-FVBDEOTZ.js → chunk-YE2RMJY7.js} +18 -4
- package/dist/{chunk-EDUTIJAU.js → chunk-YIY47OVD.js} +6 -6
- package/dist/{chunk-HZZ6ZLKP.js → chunk-YL6IQUJC.js} +4 -4
- package/dist/{chunk-WDACZSRU.js → chunk-Z6OPLBPQ.js} +1 -1
- package/dist/{chunk-UQ3LKJPM.js → chunk-ZG3PHDZJ.js} +3 -3
- package/dist/{chunk-2YFS435Z.js → chunk-ZGI6YG2G.js} +42 -4
- package/dist/config/index.js +5 -5
- package/dist/containers/client.js +6 -6
- package/dist/containers/exec.js +6 -6
- package/dist/containers/lifecycle.js +44 -42
- package/dist/containers/setup.js +8 -8
- package/dist/db/agents.js +6 -6
- package/dist/db/api_keys.js +5 -5
- package/dist/db/audit.js +3 -3
- package/dist/db/batch.js +10 -10
- package/dist/db/client.js +2 -2
- package/dist/db/credentials.js +3 -3
- package/dist/db/drizzle.js +4 -4
- package/dist/db/environments.js +6 -6
- package/dist/db/events.js +5 -5
- package/dist/db/files.js +5 -5
- package/dist/db/memory.js +13 -5
- package/dist/db/migrations.js +1 -1
- package/dist/db/proxy.js +5 -5
- package/dist/db/schema.js +5 -1
- package/dist/db/session-resources.js +5 -5
- package/dist/db/sessions.js +8 -8
- package/dist/db/sync.js +5 -5
- package/dist/db/tenants.js +3 -3
- package/dist/db/threads.js +27 -0
- package/dist/db/traces.js +5 -5
- package/dist/db/upstream_keys.js +3 -3
- package/dist/db/vaults.js +6 -6
- package/dist/dreaming/prompts.js +9 -0
- package/dist/dreaming/review.js +22 -0
- package/dist/handlers/agents.js +58 -58
- package/dist/handlers/api_keys.js +59 -59
- package/dist/handlers/audit.js +59 -59
- package/dist/handlers/batch.js +59 -59
- package/dist/handlers/credentials.js +59 -59
- package/dist/handlers/environments.js +59 -59
- package/dist/handlers/events.js +62 -62
- package/dist/handlers/files.js +59 -59
- package/dist/handlers/index.js +158 -143
- package/dist/handlers/license.js +58 -58
- package/dist/handlers/memory.js +65 -59
- package/dist/handlers/metrics.js +58 -58
- package/dist/handlers/models.js +59 -59
- package/dist/handlers/providers.js +58 -58
- package/dist/handlers/resources.js +58 -58
- package/dist/handlers/sessions.js +62 -61
- package/dist/handlers/settings.js +58 -58
- package/dist/handlers/skills-write.js +58 -58
- package/dist/handlers/skills.js +59 -59
- package/dist/handlers/stream.js +58 -58
- package/dist/handlers/tenants.js +59 -59
- package/dist/handlers/threads.js +69 -60
- package/dist/handlers/traces.js +59 -59
- package/dist/handlers/upstream_keys.js +61 -61
- package/dist/handlers/vaults.js +58 -58
- package/dist/handlers/whoami.js +58 -58
- package/dist/http.js +57 -57
- package/dist/index.js +71 -66
- package/dist/init.js +54 -54
- package/dist/lib/model-registry.js +6 -6
- package/dist/lib/skills-cache.js +6 -6
- package/dist/observability/otlp.js +12 -12
- package/dist/observability/redactor.js +8 -8
- package/dist/providers/fly.js +5 -5
- package/dist/providers/modal.js +5 -5
- package/dist/providers/registry.js +1 -1
- package/dist/providers/resolve-secrets.js +7 -7
- package/dist/providers/sprites.js +7 -7
- package/dist/providers/upstream-keys.js +12 -12
- package/dist/providers/vercel.js +6 -6
- package/dist/proxy/forward.js +6 -6
- package/dist/queue/index.js +6 -6
- package/dist/sessions/bus.js +10 -10
- package/dist/sessions/driver.js +47 -47
- package/dist/sessions/grader.js +5 -5
- package/dist/sessions/secrets.js +8 -8
- package/dist/sessions/sweeper.js +43 -43
- package/dist/sessions/threads.js +120 -54
- package/dist/shutdown.js +44 -44
- package/dist/sync/anthropic.js +10 -10
- package/dist/sync/container-file-sync.js +24 -6
- package/dist/sync/file-sync.js +17 -17
- package/dist/sync/memory-sync.js +79 -0
- package/package.json +1 -1
- package/dist/chunk-AQB3P5ZP.js +0 -48
- package/dist/{chunk-JRQB3SHR.js → chunk-LT5PRO54.js} +0 -0
- package/dist/{dist-EY25RQ2S.js → dist-S64ZABZX.js} +3 -3
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
getDrizzle,
|
|
7
7
|
init_drizzle
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FILGQF2G.js";
|
|
9
9
|
import {
|
|
10
10
|
schema_exports
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VC5DELR4.js";
|
|
12
12
|
|
|
13
13
|
// src/config/index.ts
|
|
14
14
|
init_drizzle();
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveRemoteSessionId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AESA3ARX.js";
|
|
4
4
|
import {
|
|
5
5
|
assertResourceTenant
|
|
6
6
|
} from "./chunk-23UKWXJH.js";
|
|
7
7
|
import {
|
|
8
8
|
authenticateAndIntercept
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WFRHLTKI.js";
|
|
10
10
|
import {
|
|
11
11
|
forwardToAnthropic
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Y4MI27HU.js";
|
|
13
13
|
import {
|
|
14
14
|
ensureInitialized
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NJ6KNTZR.js";
|
|
16
16
|
import {
|
|
17
17
|
getProxiedTenantId,
|
|
18
18
|
isProxied
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-MTLM36QD.js";
|
|
20
20
|
import {
|
|
21
21
|
subscribe
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-NRX5WHHN.js";
|
|
23
23
|
import {
|
|
24
24
|
getSession
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-TSR33JMZ.js";
|
|
26
26
|
import {
|
|
27
27
|
getDb,
|
|
28
28
|
init_client
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-KQTTKYZY.js";
|
|
30
30
|
import {
|
|
31
31
|
notFound,
|
|
32
32
|
toResponse
|
|
@@ -15,15 +15,17 @@ __export(schema_exports, {
|
|
|
15
15
|
files: () => files,
|
|
16
16
|
memories: () => memories,
|
|
17
17
|
memoryStores: () => memoryStores,
|
|
18
|
+
memoryVersions: () => memoryVersions,
|
|
18
19
|
proxyResources: () => proxyResources,
|
|
19
20
|
sessionResources: () => sessionResources,
|
|
21
|
+
sessionThreads: () => sessionThreads,
|
|
20
22
|
sessions: () => sessions,
|
|
21
23
|
settings: () => settings,
|
|
22
24
|
vaultEntries: () => vaultEntries,
|
|
23
25
|
vaults: () => vaults
|
|
24
26
|
});
|
|
25
27
|
import { sqliteTable, text, integer, real, primaryKey } from "drizzle-orm/sqlite-core";
|
|
26
|
-
var settings, proxyResources, apiKeys, agents, agentVersions, environments, sessions, events, vaults, vaultEntries, memoryStores, memories, files, sessionResources, anthropicSync;
|
|
28
|
+
var settings, proxyResources, apiKeys, agents, agentVersions, environments, sessions, events, sessionThreads, vaults, vaultEntries, memoryStores, memoryVersions, memories, files, sessionResources, anthropicSync;
|
|
27
29
|
var init_schema = __esm({
|
|
28
30
|
"src/db/schema.ts"() {
|
|
29
31
|
settings = sqliteTable("settings", {
|
|
@@ -84,6 +86,8 @@ var init_schema = __esm({
|
|
|
84
86
|
model_config_json: text("model_config_json").notNull().default("{}"),
|
|
85
87
|
// v0.5 ALTER TABLE addition:
|
|
86
88
|
webhook_secret: text("webhook_secret"),
|
|
89
|
+
// Multi-agent orchestration config:
|
|
90
|
+
multiagent_json: text("multiagent_json"),
|
|
87
91
|
created_at: integer("created_at").notNull()
|
|
88
92
|
}, (table) => [
|
|
89
93
|
primaryKey({ columns: [table.agent_id, table.version] })
|
|
@@ -156,7 +160,24 @@ var init_schema = __esm({
|
|
|
156
160
|
idempotency_key: text("idempotency_key"),
|
|
157
161
|
trace_id: text("trace_id"),
|
|
158
162
|
span_id: text("span_id"),
|
|
159
|
-
parent_span_id: text("parent_span_id")
|
|
163
|
+
parent_span_id: text("parent_span_id"),
|
|
164
|
+
thread_id: text("thread_id")
|
|
165
|
+
});
|
|
166
|
+
sessionThreads = sqliteTable("session_threads", {
|
|
167
|
+
id: text("id").primaryKey(),
|
|
168
|
+
session_id: text("session_id").notNull(),
|
|
169
|
+
agent_id: text("agent_id").notNull(),
|
|
170
|
+
agent_version: integer("agent_version").notNull(),
|
|
171
|
+
parent_thread_id: text("parent_thread_id"),
|
|
172
|
+
status: text("status").notNull().default("idle"),
|
|
173
|
+
stop_reason: text("stop_reason"),
|
|
174
|
+
usage_input_tokens: integer("usage_input_tokens").notNull().default(0),
|
|
175
|
+
usage_output_tokens: integer("usage_output_tokens").notNull().default(0),
|
|
176
|
+
usage_cache_read_input_tokens: integer("usage_cache_read_input_tokens").notNull().default(0),
|
|
177
|
+
usage_cache_creation_input_tokens: integer("usage_cache_creation_input_tokens").notNull().default(0),
|
|
178
|
+
created_at: integer("created_at").notNull(),
|
|
179
|
+
updated_at: integer("updated_at").notNull(),
|
|
180
|
+
archived_at: integer("archived_at")
|
|
160
181
|
});
|
|
161
182
|
vaults = sqliteTable("vaults", {
|
|
162
183
|
id: text("id").primaryKey(),
|
|
@@ -183,9 +204,21 @@ var init_schema = __esm({
|
|
|
183
204
|
description: text("description"),
|
|
184
205
|
agent_id: text("agent_id"),
|
|
185
206
|
metadata_json: text("metadata_json").notNull().default("{}"),
|
|
207
|
+
archived_at: integer("archived_at"),
|
|
186
208
|
created_at: integer("created_at").notNull(),
|
|
187
209
|
updated_at: integer("updated_at").notNull()
|
|
188
210
|
});
|
|
211
|
+
memoryVersions = sqliteTable("memory_versions", {
|
|
212
|
+
id: text("id").primaryKey(),
|
|
213
|
+
store_id: text("store_id").notNull(),
|
|
214
|
+
memory_id: text("memory_id").notNull(),
|
|
215
|
+
operation: text("operation").notNull(),
|
|
216
|
+
path: text("path").notNull(),
|
|
217
|
+
content: text("content"),
|
|
218
|
+
content_sha256: text("content_sha256"),
|
|
219
|
+
session_id: text("session_id"),
|
|
220
|
+
created_at: integer("created_at").notNull()
|
|
221
|
+
});
|
|
189
222
|
memories = sqliteTable("memories", {
|
|
190
223
|
id: text("id").primaryKey(),
|
|
191
224
|
store_id: text("store_id").notNull(),
|
|
@@ -242,9 +275,11 @@ export {
|
|
|
242
275
|
environments,
|
|
243
276
|
sessions,
|
|
244
277
|
events,
|
|
278
|
+
sessionThreads,
|
|
245
279
|
vaults,
|
|
246
280
|
vaultEntries,
|
|
247
281
|
memoryStores,
|
|
282
|
+
memoryVersions,
|
|
248
283
|
memories,
|
|
249
284
|
files,
|
|
250
285
|
sessionResources,
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
getDrizzle,
|
|
12
12
|
init_drizzle
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FILGQF2G.js";
|
|
14
14
|
import {
|
|
15
15
|
schema_exports
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VC5DELR4.js";
|
|
17
17
|
import {
|
|
18
18
|
__esm,
|
|
19
19
|
__export
|
|
@@ -42,7 +42,14 @@ function hydrate(row) {
|
|
|
42
42
|
if (row.url) record.url = row.url;
|
|
43
43
|
if (row.checkout_json) {
|
|
44
44
|
try {
|
|
45
|
-
|
|
45
|
+
const parsed = JSON.parse(row.checkout_json);
|
|
46
|
+
if (row.type === "memory_store") {
|
|
47
|
+
record.memory_store_id = parsed.memory_store_id;
|
|
48
|
+
record.access = parsed.access;
|
|
49
|
+
record.instructions = parsed.instructions;
|
|
50
|
+
} else {
|
|
51
|
+
record.checkout = parsed;
|
|
52
|
+
}
|
|
46
53
|
} catch {
|
|
47
54
|
}
|
|
48
55
|
}
|
|
@@ -53,7 +60,13 @@ function createResource(sessionId, input) {
|
|
|
53
60
|
const id = newId("sesrsc");
|
|
54
61
|
const now = nowMs();
|
|
55
62
|
let checkoutJson = null;
|
|
56
|
-
if (input.
|
|
63
|
+
if (input.type === "memory_store") {
|
|
64
|
+
checkoutJson = JSON.stringify({
|
|
65
|
+
memory_store_id: input.memory_store_id,
|
|
66
|
+
access: input.access ?? "read_write",
|
|
67
|
+
instructions: input.instructions
|
|
68
|
+
});
|
|
69
|
+
} else if (input.checkout) {
|
|
57
70
|
checkoutJson = JSON.stringify(input.checkout);
|
|
58
71
|
} else if (input.branch) {
|
|
59
72
|
checkoutJson = JSON.stringify({ type: "branch", name: input.branch });
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
jsonOk,
|
|
3
3
|
routeWrap
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DTQ7J35Q.js";
|
|
5
5
|
import {
|
|
6
6
|
readSetting,
|
|
7
7
|
writeSetting
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UGH5JDXX.js";
|
|
9
9
|
import {
|
|
10
10
|
badRequest
|
|
11
11
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
forwardToAnthropic
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y4MI27HU.js";
|
|
4
4
|
import {
|
|
5
5
|
isAnthropicApiKey,
|
|
6
6
|
isPassthroughAllowedPath
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
findByRawKey,
|
|
10
10
|
hydratePermissions
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BCBDHUFY.js";
|
|
12
12
|
import {
|
|
13
13
|
getConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UGH5JDXX.js";
|
|
15
15
|
import {
|
|
16
16
|
unauthorized
|
|
17
17
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listTraces
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G4DTLYOD.js";
|
|
4
4
|
import {
|
|
5
5
|
jsonOk,
|
|
6
6
|
routeWrap
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DTQ7J35Q.js";
|
|
8
8
|
import {
|
|
9
9
|
exportTrace
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FSVDF57K.js";
|
|
11
11
|
import {
|
|
12
12
|
listEventsByTrace,
|
|
13
13
|
rowToManagedEvent
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7JAUY5SG.js";
|
|
15
15
|
import {
|
|
16
16
|
badRequest,
|
|
17
17
|
notFound
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
buildOpencodeArgs
|
|
3
|
-
} from "./chunk-P56WU3UT.js";
|
|
4
|
-
import {
|
|
5
|
-
buildOpencodeAuthEnv,
|
|
6
|
-
validateOpencodeRuntime
|
|
7
|
-
} from "./chunk-UMRDMOB6.js";
|
|
8
1
|
import {
|
|
9
2
|
buildOpencodeConfigEnv
|
|
10
3
|
} from "./chunk-V5DH3OAC.js";
|
|
11
4
|
import {
|
|
12
5
|
prepareOpencodeOnSandbox
|
|
13
6
|
} from "./chunk-P7P2NWZD.js";
|
|
7
|
+
import {
|
|
8
|
+
createOpencodeTranslator
|
|
9
|
+
} from "./chunk-ETWGCBIQ.js";
|
|
14
10
|
import {
|
|
15
11
|
OPENCODE_WRAPPER_PATH
|
|
16
12
|
} from "./chunk-SWIP7JBQ.js";
|
|
17
13
|
import {
|
|
18
|
-
|
|
19
|
-
} from "./chunk-
|
|
14
|
+
buildOpencodeArgs
|
|
15
|
+
} from "./chunk-P56WU3UT.js";
|
|
16
|
+
import {
|
|
17
|
+
buildOpencodeAuthEnv,
|
|
18
|
+
validateOpencodeRuntime
|
|
19
|
+
} from "./chunk-WRLCJNQF.js";
|
|
20
20
|
import {
|
|
21
21
|
wrapPromptWithSystem
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-YE2RMJY7.js";
|
|
23
23
|
import {
|
|
24
24
|
ApiError
|
|
25
25
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
jsonOk,
|
|
6
6
|
routeWrap
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DTQ7J35Q.js";
|
|
8
8
|
import {
|
|
9
9
|
getProxiedTenantId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MTLM36QD.js";
|
|
11
11
|
import {
|
|
12
12
|
getSession,
|
|
13
13
|
updateSessionResources
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TSR33JMZ.js";
|
|
15
15
|
import {
|
|
16
16
|
countResources,
|
|
17
17
|
createResource,
|
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
getResource,
|
|
20
20
|
init_session_resources,
|
|
21
21
|
listResources
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VY6IWBSK.js";
|
|
23
23
|
import {
|
|
24
24
|
getDb,
|
|
25
25
|
init_client
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-KQTTKYZY.js";
|
|
27
27
|
import {
|
|
28
28
|
badRequest,
|
|
29
29
|
notFound
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
} from "./chunk-23UKWXJH.js";
|
|
5
5
|
import {
|
|
6
6
|
listAudit
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TWH4UH6G.js";
|
|
8
8
|
import {
|
|
9
9
|
paginatedOk,
|
|
10
10
|
routeWrap
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DTQ7J35Q.js";
|
|
12
12
|
import {
|
|
13
13
|
badRequest
|
|
14
14
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
// src/backends/shared/wrap-prompt.ts
|
|
2
2
|
var GATEWAY_PREAMBLE = "You are running inside an AgentStep sandboxed container. Execute tools directly \u2014 never announce what you will do before doing it. All tools are already available; do not search for or discover tools. If custom tools are defined, use them by name immediately.";
|
|
3
|
-
function withGatewayPreamble(system) {
|
|
4
|
-
|
|
3
|
+
function withGatewayPreamble(system, memoryStores) {
|
|
4
|
+
let preamble = system ? `${system}
|
|
5
5
|
|
|
6
6
|
${GATEWAY_PREAMBLE}` : GATEWAY_PREAMBLE;
|
|
7
|
+
if (memoryStores && memoryStores.length > 0) {
|
|
8
|
+
const lines = memoryStores.map((s) => {
|
|
9
|
+
const parts = [];
|
|
10
|
+
parts.push(`- /mnt/memory/${s.name.replace(/[^a-zA-Z0-9_.-]/g, "_")}/ (${s.access})`);
|
|
11
|
+
if (s.description) parts[0] += ` \u2014 ${s.description}`;
|
|
12
|
+
if (s.instructions) parts[0] += `. ${s.instructions}`;
|
|
13
|
+
return parts[0];
|
|
14
|
+
});
|
|
15
|
+
preamble += `
|
|
16
|
+
|
|
17
|
+
Memory stores are mounted at /mnt/memory/:
|
|
18
|
+
${lines.join("\n")}`;
|
|
19
|
+
}
|
|
20
|
+
return preamble;
|
|
7
21
|
}
|
|
8
|
-
function wrapPromptWithSystem(prompt, systemPrompt, skills) {
|
|
9
|
-
let systemBlock = withGatewayPreamble(systemPrompt);
|
|
22
|
+
function wrapPromptWithSystem(prompt, systemPrompt, skills, memoryStores) {
|
|
23
|
+
let systemBlock = withGatewayPreamble(systemPrompt, memoryStores);
|
|
10
24
|
if (skills && skills.length > 0) {
|
|
11
25
|
const skillsText = skills.map(
|
|
12
26
|
(s) => `<skill name="${s.name}">
|
|
@@ -6,29 +6,29 @@ import {
|
|
|
6
6
|
reconcileDockerOrphanSandboxes,
|
|
7
7
|
reconcileOrphanSandboxes,
|
|
8
8
|
releaseSession
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-75XURMV5.js";
|
|
10
10
|
import {
|
|
11
11
|
appendEvent,
|
|
12
12
|
dropEmitter
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NRX5WHHN.js";
|
|
14
14
|
import {
|
|
15
15
|
archiveSession,
|
|
16
16
|
getSessionRow,
|
|
17
17
|
listIdleSessions,
|
|
18
18
|
updateSessionStatus
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-TSR33JMZ.js";
|
|
20
20
|
import {
|
|
21
21
|
resolveContainerProvider
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-LT5PRO54.js";
|
|
23
23
|
import {
|
|
24
24
|
getEnvironment
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-7APAOJIZ.js";
|
|
26
26
|
import {
|
|
27
27
|
expireWarm
|
|
28
28
|
} from "./chunk-G7KUVNDY.js";
|
|
29
29
|
import {
|
|
30
30
|
getConfig
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-UGH5JDXX.js";
|
|
32
32
|
import {
|
|
33
33
|
init_clock,
|
|
34
34
|
nowMs
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
disableUpstreamKey,
|
|
3
3
|
selectNextUpstreamKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UAEVL47I.js";
|
|
5
5
|
import {
|
|
6
6
|
listEntries
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BYIU4WAQ.js";
|
|
8
8
|
import {
|
|
9
9
|
getSession
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TSR33JMZ.js";
|
|
11
11
|
import {
|
|
12
12
|
getConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UGH5JDXX.js";
|
|
14
14
|
|
|
15
15
|
// src/providers/upstream-keys.ts
|
|
16
16
|
var CONSECUTIVE_FAIL_THRESHOLD = 3;
|
|
@@ -11,18 +11,18 @@ import {
|
|
|
11
11
|
getFileRecord,
|
|
12
12
|
listFiles,
|
|
13
13
|
updateFileStoragePath
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-C5GVKLNS.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-DTQ7J35Q.js";
|
|
22
22
|
import {
|
|
23
23
|
getDb,
|
|
24
24
|
init_client
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-KQTTKYZY.js";
|
|
26
26
|
import {
|
|
27
27
|
badRequest,
|
|
28
28
|
notFound
|
|
@@ -3,25 +3,28 @@ import {
|
|
|
3
3
|
tenantFilter
|
|
4
4
|
} from "./chunk-23UKWXJH.js";
|
|
5
5
|
import {
|
|
6
|
+
archiveMemoryStore,
|
|
6
7
|
createMemoryStore,
|
|
7
8
|
createOrUpsertMemory,
|
|
8
9
|
deleteMemory,
|
|
9
10
|
deleteMemoryStore,
|
|
10
11
|
getMemory,
|
|
11
12
|
getMemoryStore,
|
|
13
|
+
getMemoryVersion,
|
|
12
14
|
listMemories,
|
|
13
15
|
listMemoryStores,
|
|
16
|
+
listMemoryVersions,
|
|
14
17
|
updateMemory
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GBLR2CPP.js";
|
|
16
19
|
import {
|
|
17
20
|
jsonOk,
|
|
18
21
|
paginatedOk,
|
|
19
22
|
routeWrap
|
|
20
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-DTQ7J35Q.js";
|
|
21
24
|
import {
|
|
22
25
|
getDb,
|
|
23
26
|
init_client
|
|
24
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-KQTTKYZY.js";
|
|
25
28
|
import {
|
|
26
29
|
badRequest,
|
|
27
30
|
conflict,
|
|
@@ -156,6 +159,38 @@ function handleDeleteMemory(request, storeId, memId) {
|
|
|
156
159
|
return jsonOk({ id: memId, type: "memory_deleted" });
|
|
157
160
|
});
|
|
158
161
|
}
|
|
162
|
+
function handleListMemoryVersions(request, storeId) {
|
|
163
|
+
return routeWrap(request, async ({ auth, request: req }) => {
|
|
164
|
+
loadStoreForCaller(auth, storeId);
|
|
165
|
+
const url = new URL(req.url);
|
|
166
|
+
const memoryId = url.searchParams.get("memory_id") ?? void 0;
|
|
167
|
+
const requestedLimit = Number(url.searchParams.get("limit") || "100");
|
|
168
|
+
const cursor = url.searchParams.get("cursor") ?? void 0;
|
|
169
|
+
const data = listMemoryVersions(storeId, {
|
|
170
|
+
memoryId,
|
|
171
|
+
limit: requestedLimit,
|
|
172
|
+
cursor
|
|
173
|
+
});
|
|
174
|
+
return paginatedOk(data, requestedLimit);
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function handleGetMemoryVersion(request, storeId, versionId) {
|
|
178
|
+
return routeWrap(request, async ({ auth }) => {
|
|
179
|
+
loadStoreForCaller(auth, storeId);
|
|
180
|
+
const version = getMemoryVersion(storeId, versionId);
|
|
181
|
+
if (!version) throw notFound(`memory version not found: ${versionId}`);
|
|
182
|
+
return jsonOk(version);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
function handleArchiveMemoryStore(request, storeId) {
|
|
186
|
+
return routeWrap(request, async ({ auth }) => {
|
|
187
|
+
loadStoreForCaller(auth, storeId);
|
|
188
|
+
const archived = archiveMemoryStore(storeId);
|
|
189
|
+
if (!archived) throw notFound(`memory store not found: ${storeId}`);
|
|
190
|
+
const store = getMemoryStore(storeId);
|
|
191
|
+
return jsonOk(store);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
159
194
|
|
|
160
195
|
export {
|
|
161
196
|
handleCreateMemoryStore,
|
|
@@ -166,5 +201,8 @@ export {
|
|
|
166
201
|
handleListMemories,
|
|
167
202
|
handleGetMemory,
|
|
168
203
|
handleUpdateMemory,
|
|
169
|
-
handleDeleteMemory
|
|
204
|
+
handleDeleteMemory,
|
|
205
|
+
handleListMemoryVersions,
|
|
206
|
+
handleGetMemoryVersion,
|
|
207
|
+
handleArchiveMemoryStore
|
|
170
208
|
};
|
package/dist/config/index.js
CHANGED
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
readSetting,
|
|
6
6
|
writeSetting,
|
|
7
7
|
writeTokenSetting
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-UGH5JDXX.js";
|
|
9
9
|
import "../chunk-HFDLUBWN.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-FILGQF2G.js";
|
|
11
|
+
import "../chunk-VC5DELR4.js";
|
|
12
|
+
import "../chunk-KQTTKYZY.js";
|
|
13
|
+
import "../chunk-P4NU74SP.js";
|
|
14
14
|
import "../chunk-2ESYSVXG.js";
|
|
15
15
|
export {
|
|
16
16
|
getConfig,
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
killExecSession,
|
|
8
8
|
listSprites,
|
|
9
9
|
restoreCheckpoint
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-VMLXV2H6.js";
|
|
11
|
+
import "../chunk-UGH5JDXX.js";
|
|
12
12
|
import "../chunk-HFDLUBWN.js";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-FILGQF2G.js";
|
|
14
|
+
import "../chunk-VC5DELR4.js";
|
|
15
|
+
import "../chunk-KQTTKYZY.js";
|
|
16
|
+
import "../chunk-P4NU74SP.js";
|
|
17
17
|
import "../chunk-EZYKRG4W.js";
|
|
18
18
|
import "../chunk-2ESYSVXG.js";
|
|
19
19
|
export {
|
package/dist/containers/exec.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
startExec
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-A2W3USEZ.js";
|
|
4
|
+
import "../chunk-UGH5JDXX.js";
|
|
5
5
|
import "../chunk-HFDLUBWN.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-FILGQF2G.js";
|
|
7
|
+
import "../chunk-VC5DELR4.js";
|
|
8
|
+
import "../chunk-KQTTKYZY.js";
|
|
9
|
+
import "../chunk-P4NU74SP.js";
|
|
10
10
|
import "../chunk-EZYKRG4W.js";
|
|
11
11
|
import "../chunk-2ESYSVXG.js";
|
|
12
12
|
export {
|