@agentstep/agent-sdk 0.5.3 → 0.5.5
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 +6 -6
- package/dist/backends/claude/index.js +7 -7
- package/dist/backends/codex/auth.js +6 -6
- package/dist/backends/codex/index.js +13 -13
- package/dist/backends/factory/auth.js +6 -6
- package/dist/backends/factory/index.js +10 -10
- package/dist/backends/gemini/auth.js +6 -6
- package/dist/backends/gemini/index.js +7 -7
- package/dist/backends/opencode/auth.js +6 -6
- package/dist/backends/opencode/index.js +9 -9
- package/dist/backends/pi/auth.js +6 -6
- package/dist/backends/pi/index.js +7 -7
- package/dist/backends/registry.js +26 -26
- package/dist/{chunk-VY6IWBSK.js → chunk-2GIAAUSW.js} +20 -3
- package/dist/{chunk-TF36SWHG.js → chunk-2LTNC5C7.js} +2 -2
- package/dist/{chunk-YIY47OVD.js → chunk-2RIOHWZW.js} +6 -6
- package/dist/{chunk-AESA3ARX.js → chunk-3ST3YLED.js} +3 -3
- package/dist/{chunk-C52BVTYC.js → chunk-5435RAMR.js} +4 -4
- package/dist/{chunk-TSR33JMZ.js → chunk-5TOLDBBJ.js} +5 -5
- package/dist/{chunk-65XQ72BF.js → chunk-5WY3LSCS.js} +1 -1
- package/dist/{chunk-Q2JYAAJO.js → chunk-64AWIKIO.js} +10 -10
- package/dist/{chunk-UQZFFG7U.js → chunk-64M4Z6HW.js} +1 -1
- package/dist/{chunk-P4NU74SP.js → chunk-6ZODIFRZ.js} +38 -0
- package/dist/{chunk-MV42BTU3.js → chunk-7OM5LP3K.js} +1 -1
- package/dist/{chunk-7IYL2O7H.js → chunk-A7DBW4MD.js} +3 -3
- package/dist/{chunk-Y7NMJ662.js → chunk-ADSZ2OCX.js} +2 -2
- package/dist/{chunk-Z6OPLBPQ.js → chunk-AJOG6UYH.js} +1 -1
- package/dist/{chunk-NJ6KNTZR.js → chunk-B2VM6IRJ.js} +15 -15
- package/dist/{chunk-IAKR572X.js → chunk-B374MDPO.js} +1 -1
- package/dist/{chunk-2YPJLPTR.js → chunk-BZYAXHRB.js} +6 -6
- package/dist/{chunk-X4ARJS6I.js → chunk-C3PD6T4A.js} +4 -4
- package/dist/{chunk-PGJSOKPH.js → chunk-C4GMG6IB.js} +3 -3
- package/dist/{chunk-EHMKMOXH.js → chunk-C4YHYPOW.js} +5 -5
- package/dist/{chunk-6ZM7XNH3.js → chunk-CZH5FQSF.js} +1 -1
- package/dist/{chunk-C7BU4RX6.js → chunk-D5E5XJAU.js} +3 -3
- package/dist/{chunk-TE6KCRPP.js → chunk-DAKCDGWV.js} +1 -1
- package/dist/{chunk-Y4MI27HU.js → chunk-DL7IPOZF.js} +1 -1
- package/dist/{chunk-YL6IQUJC.js → chunk-DMROEZYE.js} +4 -4
- package/dist/{chunk-XXGVNVPI.js → chunk-DPR6K7Y4.js} +24 -6
- package/dist/{chunk-G4DTLYOD.js → chunk-DQW2QEK5.js} +1 -1
- package/dist/{chunk-7EDLLXFQ.js → chunk-DXRTOMZP.js} +13 -3
- package/dist/{chunk-23CUQSLR.js → chunk-DYRGMJTC.js} +2 -2
- package/dist/{chunk-GBLR2CPP.js → chunk-FSQ6I3C7.js} +37 -2
- package/dist/{chunk-UYP3VGYB.js → chunk-GOFQ63N3.js} +8 -8
- package/dist/{chunk-BCBRLP33.js → chunk-H355W724.js} +2 -2
- package/dist/{chunk-DZGFZMUE.js → chunk-HRBNDS5T.js} +1 -1
- package/dist/{chunk-ANS2TQYT.js → chunk-HWVBBUL2.js} +1 -1
- package/dist/{chunk-ACPP4KN7.js → chunk-IN3EHQ4Z.js} +4 -4
- package/dist/{chunk-6TJBZXD4.js → chunk-IUMA4QRX.js} +1 -1
- package/dist/{chunk-DTQ7J35Q.js → chunk-IYVGGJMH.js} +2 -2
- package/dist/{chunk-T6F4TFHD.js → chunk-J2SP5UND.js} +4 -4
- package/dist/{chunk-C5GVKLNS.js → chunk-J6WSFODH.js} +2 -2
- package/dist/{chunk-335F7KSU.js → chunk-JCOR7AIY.js} +2 -2
- package/dist/{chunk-ZGI6YG2G.js → chunk-JP4HHXHY.js} +85 -6
- package/dist/{chunk-VYY4RHIF.js → chunk-JPONGXV5.js} +2 -2
- package/dist/{chunk-FILGQF2G.js → chunk-JWVVF66Q.js} +2 -2
- package/dist/{chunk-7JAUY5SG.js → chunk-K2UJFAGD.js} +3 -3
- package/dist/{chunk-AIAF5ZZA.js → chunk-KB7MV6VS.js} +1 -1
- package/dist/chunk-KYLDNVV7.js +176 -0
- package/dist/{chunk-7XIAKW75.js → chunk-LII6JJQT.js} +1 -1
- package/dist/{chunk-62CZZBEE.js → chunk-MFSO7IGE.js} +4 -4
- package/dist/{chunk-5NCA624D.js → chunk-NOJ3ERIN.js} +50 -17
- package/dist/{chunk-7JWW4ZQI.js → chunk-OACMO7AL.js} +15 -15
- package/dist/{chunk-UGH5JDXX.js → chunk-P2NWS65Y.js} +2 -2
- package/dist/{chunk-BCBDHUFY.js → chunk-P4B4V4SV.js} +2 -2
- package/dist/{chunk-75XURMV5.js → chunk-P5DSHKKP.js} +9 -9
- package/dist/{chunk-WFRHLTKI.js → chunk-P5X2DSGQ.js} +3 -3
- package/dist/{chunk-M3752GFZ.js → chunk-P7TV5XP4.js} +3 -3
- package/dist/{chunk-A2W3USEZ.js → chunk-PEEKWYYE.js} +1 -1
- package/dist/{chunk-WXMEJVLS.js → chunk-PKWN44LF.js} +4 -4
- package/dist/{chunk-VMLXV2H6.js → chunk-PUH4LEJZ.js} +1 -1
- package/dist/{chunk-TWH4UH6G.js → chunk-PVVJCRII.js} +1 -1
- package/dist/{chunk-E2OYBE5D.js → chunk-R6M4V3IG.js} +2 -2
- package/dist/{chunk-NUOCXBFP.js → chunk-RA25CUV4.js} +13 -13
- package/dist/{chunk-6KJS42ZL.js → chunk-SMM7YOM2.js} +2 -2
- package/dist/{chunk-VC5DELR4.js → chunk-SZNZZB7J.js} +23 -1
- package/dist/{chunk-4A4F4L4H.js → chunk-TC7UW22R.js} +2 -2
- package/dist/{chunk-BYIU4WAQ.js → chunk-TWX2D563.js} +3 -3
- package/dist/{chunk-UALRSWXY.js → chunk-TXOB3PZH.js} +13 -13
- package/dist/{chunk-LHFEBLOE.js → chunk-UFAYAE3A.js} +7 -7
- package/dist/{chunk-WRLCJNQF.js → chunk-UK3ZFCQP.js} +1 -1
- package/dist/{chunk-ZG3PHDZJ.js → chunk-UKCIGI3T.js} +3 -3
- package/dist/{chunk-7APAOJIZ.js → chunk-UKCRJFFC.js} +3 -3
- package/dist/{chunk-FSVDF57K.js → chunk-UKIOGRMN.js} +5 -5
- package/dist/chunk-V5EEO7MU.js +129 -0
- package/dist/{chunk-KQTTKYZY.js → chunk-W3YXUIPS.js} +1 -1
- package/dist/{chunk-O2X4XBU7.js → chunk-W4FZ4HYD.js} +1 -1
- package/dist/{chunk-E35XHOFL.js → chunk-WOL4EVCE.js} +7 -7
- package/dist/{chunk-NRX5WHHN.js → chunk-X65C4UZH.js} +4 -4
- package/dist/{chunk-MTLM36QD.js → chunk-X7Y4TV6O.js} +2 -2
- package/dist/{chunk-BLTCDZ3O.js → chunk-XNEUJKY4.js} +4 -4
- package/dist/{chunk-6KQFP32G.js → chunk-YICDEIRE.js} +2 -2
- package/dist/{chunk-UAEVL47I.js → chunk-YSZLX4WE.js} +1 -1
- package/dist/{chunk-EQ32JFKT.js → chunk-YTZQ5J6L.js} +13 -3
- package/dist/{chunk-A7AXD5AM.js → chunk-ZFMAACZT.js} +2 -2
- package/dist/{chunk-6DPJVMEC.js → chunk-ZIZU3B65.js} +1 -1
- package/dist/{chunk-2FKWZKV2.js → chunk-ZXJTXNUX.js} +4 -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 +38 -38
- 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 +5 -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 +11 -7
- 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 +9 -7
- package/dist/db/sessions.js +8 -8
- package/dist/db/skills.js +27 -0
- package/dist/db/sync.js +5 -5
- package/dist/db/tenants.js +3 -3
- package/dist/db/threads.js +7 -7
- 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/review.js +11 -11
- package/dist/handlers/agents.js +54 -54
- package/dist/handlers/api_keys.js +55 -55
- package/dist/handlers/audit.js +55 -55
- package/dist/handlers/batch.js +55 -55
- package/dist/handlers/credentials.js +57 -55
- package/dist/handlers/environments.js +55 -55
- package/dist/handlers/events.js +58 -58
- package/dist/handlers/files.js +55 -55
- package/dist/handlers/index.js +129 -106
- package/dist/handlers/license.js +54 -54
- package/dist/handlers/memory.js +65 -57
- package/dist/handlers/metrics.js +54 -54
- package/dist/handlers/models.js +55 -55
- package/dist/handlers/providers.js +54 -54
- package/dist/handlers/resources.js +58 -56
- package/dist/handlers/sessions.js +58 -58
- package/dist/handlers/settings.js +54 -54
- package/dist/handlers/skills-write.js +68 -56
- package/dist/handlers/skills.js +55 -55
- package/dist/handlers/stream.js +54 -54
- package/dist/handlers/tenants.js +55 -55
- package/dist/handlers/threads.js +55 -55
- package/dist/handlers/traces.js +55 -55
- package/dist/handlers/upstream_keys.js +57 -57
- package/dist/handlers/vaults.js +54 -54
- package/dist/handlers/whoami.js +54 -54
- package/dist/http.js +53 -53
- package/dist/index.js +62 -62
- package/dist/init.js +50 -50
- 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 +43 -43
- package/dist/sessions/grader.js +5 -5
- package/dist/sessions/secrets.js +8 -8
- package/dist/sessions/sweeper.js +39 -39
- package/dist/sessions/threads.js +45 -45
- package/dist/shutdown.js +40 -40
- package/dist/sync/anthropic.js +10 -10
- package/dist/sync/container-file-sync.js +6 -6
- package/dist/sync/file-sync.js +17 -17
- package/package.json +1 -1
- package/dist/chunk-RJDYM2HR.js +0 -31
- package/dist/{chunk-LT5PRO54.js → chunk-ZJERBDQE.js} +0 -0
- package/dist/{dist-S64ZABZX.js → dist-EY25RQ2S.js} +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
syncAndCreateSession
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MFSO7IGE.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveRemoteSessionId,
|
|
6
6
|
upsertSync
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3ST3YLED.js";
|
|
8
8
|
import {
|
|
9
9
|
assertResourceTenant,
|
|
10
10
|
tenantFilter
|
|
@@ -14,19 +14,19 @@ import {
|
|
|
14
14
|
} from "./chunk-DC2UMEQH.js";
|
|
15
15
|
import {
|
|
16
16
|
getMemoryStore
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FSQ6I3C7.js";
|
|
18
18
|
import {
|
|
19
19
|
kickoffEnvironmentSetup
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YICDEIRE.js";
|
|
21
21
|
import {
|
|
22
22
|
decodeCursor,
|
|
23
23
|
jsonOk,
|
|
24
24
|
paginatedOk,
|
|
25
25
|
routeWrap
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-IYVGGJMH.js";
|
|
27
27
|
import {
|
|
28
28
|
forwardToAnthropic
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-DL7IPOZF.js";
|
|
30
30
|
import {
|
|
31
31
|
errors_exports,
|
|
32
32
|
init_errors
|
|
@@ -36,18 +36,18 @@ import {
|
|
|
36
36
|
isProxied,
|
|
37
37
|
markProxied,
|
|
38
38
|
unmarkProxied
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-X7Y4TV6O.js";
|
|
40
40
|
import {
|
|
41
41
|
dropActor,
|
|
42
42
|
getActor
|
|
43
43
|
} from "./chunk-LAWTTG2E.js";
|
|
44
44
|
import {
|
|
45
45
|
releaseSession
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-P5DSHKKP.js";
|
|
47
47
|
import {
|
|
48
48
|
appendEvent,
|
|
49
49
|
dropEmitter
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-X65C4UZH.js";
|
|
51
51
|
import {
|
|
52
52
|
archiveSession,
|
|
53
53
|
createSession,
|
|
@@ -55,13 +55,13 @@ import {
|
|
|
55
55
|
listSessions,
|
|
56
56
|
updateSessionMutable,
|
|
57
57
|
updateSessionStatus
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-5TOLDBBJ.js";
|
|
59
59
|
import {
|
|
60
60
|
getEnvironment
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-UKCRJFFC.js";
|
|
62
62
|
import {
|
|
63
63
|
getAgent
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-P7TV5XP4.js";
|
|
65
65
|
import {
|
|
66
66
|
init_clock,
|
|
67
67
|
nowMs
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
import {
|
|
70
70
|
getDb,
|
|
71
71
|
init_client
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-W3YXUIPS.js";
|
|
73
73
|
import {
|
|
74
74
|
badRequest,
|
|
75
75
|
notFound
|
|
@@ -5,25 +5,25 @@ import {
|
|
|
5
5
|
} from "./chunk-23UKWXJH.js";
|
|
6
6
|
import {
|
|
7
7
|
kickoffEnvironmentSetup
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YICDEIRE.js";
|
|
9
9
|
import {
|
|
10
10
|
decodeCursor,
|
|
11
11
|
jsonOk,
|
|
12
12
|
paginatedOk,
|
|
13
13
|
routeWrap
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IYVGGJMH.js";
|
|
15
15
|
import {
|
|
16
16
|
forwardToAnthropic
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DL7IPOZF.js";
|
|
18
18
|
import {
|
|
19
19
|
getProxiedTenantId,
|
|
20
20
|
isProxied,
|
|
21
21
|
markProxied,
|
|
22
22
|
unmarkProxied
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-X7Y4TV6O.js";
|
|
24
24
|
import {
|
|
25
25
|
resolveContainerProvider
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ZJERBDQE.js";
|
|
27
27
|
import {
|
|
28
28
|
archiveEnvironment,
|
|
29
29
|
createEnvironment,
|
|
@@ -32,11 +32,11 @@ import {
|
|
|
32
32
|
hasSessionsAttached,
|
|
33
33
|
listEnvironments,
|
|
34
34
|
updateEnvironment
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-UKCRJFFC.js";
|
|
36
36
|
import {
|
|
37
37
|
getDb,
|
|
38
38
|
init_client
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-W3YXUIPS.js";
|
|
40
40
|
import {
|
|
41
41
|
badRequest,
|
|
42
42
|
conflict,
|
|
@@ -11,18 +11,18 @@ import {
|
|
|
11
11
|
getFileRecord,
|
|
12
12
|
listFiles,
|
|
13
13
|
updateFileStoragePath
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-J6WSFODH.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-IYVGGJMH.js";
|
|
22
22
|
import {
|
|
23
23
|
getDb,
|
|
24
24
|
init_client
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-W3YXUIPS.js";
|
|
26
26
|
import {
|
|
27
27
|
badRequest,
|
|
28
28
|
notFound
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_TENANT_ID
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-64M4Z6HW.js";
|
|
4
4
|
import {
|
|
5
5
|
init_ids,
|
|
6
6
|
newId
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
getDrizzle,
|
|
15
15
|
init_drizzle
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JWVVF66Q.js";
|
|
17
17
|
import {
|
|
18
18
|
schema_exports
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SZNZZB7J.js";
|
|
20
20
|
|
|
21
21
|
// src/db/environments.ts
|
|
22
22
|
init_drizzle();
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
onAfterCommit
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X65C4UZH.js";
|
|
4
4
|
import {
|
|
5
5
|
getSessionRow
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5TOLDBBJ.js";
|
|
7
7
|
import {
|
|
8
8
|
listEventsByTrace
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-K2UJFAGD.js";
|
|
10
10
|
import {
|
|
11
11
|
getAgent
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-P7TV5XP4.js";
|
|
13
13
|
import {
|
|
14
14
|
getConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-P2NWS65Y.js";
|
|
16
16
|
|
|
17
17
|
// src/observability/otlp.ts
|
|
18
18
|
import { createHash } from "crypto";
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSkill,
|
|
3
|
+
createSkillVersion,
|
|
4
|
+
deleteSkill,
|
|
5
|
+
deleteSkillVersion,
|
|
6
|
+
getSkill,
|
|
7
|
+
getSkillVersion,
|
|
8
|
+
listSkillVersions
|
|
9
|
+
} from "./chunk-KYLDNVV7.js";
|
|
10
|
+
import {
|
|
11
|
+
resolveCreateTenant
|
|
12
|
+
} from "./chunk-23UKWXJH.js";
|
|
13
|
+
import {
|
|
14
|
+
decodeCursor,
|
|
15
|
+
jsonOk,
|
|
16
|
+
paginatedOk,
|
|
17
|
+
routeWrap
|
|
18
|
+
} from "./chunk-IYVGGJMH.js";
|
|
19
|
+
import {
|
|
20
|
+
badRequest,
|
|
21
|
+
notFound
|
|
22
|
+
} from "./chunk-EZYKRG4W.js";
|
|
23
|
+
|
|
24
|
+
// src/handlers/skills-write.ts
|
|
25
|
+
import { z } from "zod";
|
|
26
|
+
var CreateSkillSchema = z.object({
|
|
27
|
+
name: z.string().min(1).max(256),
|
|
28
|
+
description: z.string().max(2048).optional(),
|
|
29
|
+
content: z.string().min(1).max(256 * 1024),
|
|
30
|
+
// 256 KB
|
|
31
|
+
tenant_id: z.string().optional()
|
|
32
|
+
});
|
|
33
|
+
var CreateVersionSchema = z.object({
|
|
34
|
+
content: z.string().min(1).max(256 * 1024),
|
|
35
|
+
version: z.string().min(1).max(64).optional()
|
|
36
|
+
});
|
|
37
|
+
function handleCreateSkill(request) {
|
|
38
|
+
return routeWrap(request, async ({ auth }) => {
|
|
39
|
+
const body = await request.json().catch(() => null);
|
|
40
|
+
const parsed = CreateSkillSchema.safeParse(body);
|
|
41
|
+
if (!parsed.success) {
|
|
42
|
+
throw badRequest(
|
|
43
|
+
`invalid body: ${parsed.error.issues.map((i) => i.message).join("; ")}`
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
const tenantId = resolveCreateTenant(auth, parsed.data.tenant_id);
|
|
47
|
+
const skill = createSkill({
|
|
48
|
+
name: parsed.data.name,
|
|
49
|
+
description: parsed.data.description,
|
|
50
|
+
content: parsed.data.content,
|
|
51
|
+
tenantId
|
|
52
|
+
});
|
|
53
|
+
return jsonOk(skill, 201);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function handleGetSkill(request, skillId) {
|
|
57
|
+
return routeWrap(request, async () => {
|
|
58
|
+
const skill = getSkill(skillId);
|
|
59
|
+
if (!skill) throw notFound(`skill ${skillId} not found`);
|
|
60
|
+
return jsonOk(skill);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function handleDeleteSkill(request, skillId) {
|
|
64
|
+
return routeWrap(request, async () => {
|
|
65
|
+
const ok = deleteSkill(skillId);
|
|
66
|
+
if (!ok) throw notFound(`skill ${skillId} not found`);
|
|
67
|
+
return jsonOk({ id: skillId, type: "skill_deleted" });
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function handleCreateSkillVersion(request, skillId) {
|
|
71
|
+
return routeWrap(request, async () => {
|
|
72
|
+
const body = await request.json().catch(() => null);
|
|
73
|
+
const parsed = CreateVersionSchema.safeParse(body);
|
|
74
|
+
if (!parsed.success) {
|
|
75
|
+
throw badRequest(
|
|
76
|
+
`invalid body: ${parsed.error.issues.map((i) => i.message).join("; ")}`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
const sv = createSkillVersion(skillId, {
|
|
80
|
+
content: parsed.data.content,
|
|
81
|
+
version: parsed.data.version
|
|
82
|
+
});
|
|
83
|
+
if (!sv) throw notFound(`skill ${skillId} not found`);
|
|
84
|
+
return jsonOk(sv, 201);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function handleListSkillVersions(request, skillId) {
|
|
88
|
+
return routeWrap(request, async ({ request: req }) => {
|
|
89
|
+
const skill = getSkill(skillId);
|
|
90
|
+
if (!skill) throw notFound(`skill ${skillId} not found`);
|
|
91
|
+
const url = new URL(req.url);
|
|
92
|
+
const limit = Math.min(
|
|
93
|
+
Math.max(Number(url.searchParams.get("limit") || "20"), 1),
|
|
94
|
+
100
|
|
95
|
+
);
|
|
96
|
+
const cursor = decodeCursor(url.searchParams.get("after_id"));
|
|
97
|
+
const versions = listSkillVersions(skillId, { limit, cursor });
|
|
98
|
+
return paginatedOk(versions, limit);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function handleGetSkillVersion(request, skillId, version) {
|
|
102
|
+
return routeWrap(request, async () => {
|
|
103
|
+
const sv = getSkillVersion(skillId, version);
|
|
104
|
+
if (!sv) throw notFound(`skill version ${version} not found`);
|
|
105
|
+
return jsonOk(sv);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function handleDeleteSkillVersion(request, skillId, version) {
|
|
109
|
+
return routeWrap(request, async () => {
|
|
110
|
+
const result = deleteSkillVersion(skillId, version);
|
|
111
|
+
if (!result.ok) {
|
|
112
|
+
if (result.reason === "cannot delete the current version") {
|
|
113
|
+
throw badRequest(result.reason);
|
|
114
|
+
}
|
|
115
|
+
throw notFound(`skill version ${version} not found`);
|
|
116
|
+
}
|
|
117
|
+
return jsonOk({ skill_id: skillId, version, type: "skill_version_deleted" });
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
handleCreateSkill,
|
|
123
|
+
handleGetSkill,
|
|
124
|
+
handleDeleteSkill,
|
|
125
|
+
handleCreateSkillVersion,
|
|
126
|
+
handleListSkillVersions,
|
|
127
|
+
handleGetSkillVersion,
|
|
128
|
+
handleDeleteSkillVersion
|
|
129
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
prepareCodexOnSandbox
|
|
3
|
+
} from "./chunk-M2LUXIXU.js";
|
|
1
4
|
import {
|
|
2
5
|
createCodexTranslator
|
|
3
6
|
} from "./chunk-CULYZ3VA.js";
|
|
7
|
+
import {
|
|
8
|
+
CODEX_WRAPPER_PATH
|
|
9
|
+
} from "./chunk-E4FQRMHV.js";
|
|
4
10
|
import {
|
|
5
11
|
buildCodexArgs
|
|
6
12
|
} from "./chunk-PJYCPDV5.js";
|
|
7
13
|
import {
|
|
8
14
|
buildCodexAuthEnv,
|
|
9
15
|
validateCodexRuntime
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
prepareCodexOnSandbox
|
|
13
|
-
} from "./chunk-M2LUXIXU.js";
|
|
14
|
-
import {
|
|
15
|
-
CODEX_WRAPPER_PATH
|
|
16
|
-
} from "./chunk-E4FQRMHV.js";
|
|
16
|
+
} from "./chunk-IUMA4QRX.js";
|
|
17
17
|
import {
|
|
18
18
|
wrapPromptWithSystem
|
|
19
19
|
} from "./chunk-YE2RMJY7.js";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSession
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5TOLDBBJ.js";
|
|
4
4
|
import {
|
|
5
5
|
appendEvent,
|
|
6
6
|
appendEventsBatch,
|
|
7
7
|
listEvents,
|
|
8
8
|
rowToManagedEvent
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-K2UJFAGD.js";
|
|
10
10
|
import {
|
|
11
11
|
getAgent
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-P7TV5XP4.js";
|
|
13
13
|
import {
|
|
14
14
|
getDb,
|
|
15
15
|
init_client
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-W3YXUIPS.js";
|
|
17
17
|
|
|
18
18
|
// src/sessions/bus.ts
|
|
19
19
|
import { EventEmitter } from "events";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSession
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5TOLDBBJ.js";
|
|
4
4
|
import {
|
|
5
5
|
createEnvironment,
|
|
6
6
|
deleteEnvironment,
|
|
7
7
|
getEnvironment
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UKCRJFFC.js";
|
|
9
9
|
import {
|
|
10
10
|
archiveAgent,
|
|
11
11
|
createAgent,
|
|
12
12
|
getAgent
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-P7TV5XP4.js";
|
|
14
14
|
import {
|
|
15
15
|
getDrizzle,
|
|
16
16
|
init_drizzle
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-JWVVF66Q.js";
|
|
18
18
|
|
|
19
19
|
// src/db/batch.ts
|
|
20
20
|
init_drizzle();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveContainerProvider
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZJERBDQE.js";
|
|
4
4
|
import {
|
|
5
5
|
getEnvironmentRow,
|
|
6
6
|
updateEnvironmentState
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UKCRJFFC.js";
|
|
8
8
|
import {
|
|
9
9
|
installClaudeWrapper
|
|
10
10
|
} from "./chunk-QBJOYOVF.js";
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadVaultForCaller
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-J2SP5UND.js";
|
|
4
4
|
import {
|
|
5
5
|
jsonOk,
|
|
6
6
|
paginatedOk,
|
|
7
7
|
routeWrap
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IYVGGJMH.js";
|
|
9
9
|
import {
|
|
10
|
+
archiveCredential,
|
|
10
11
|
createCredential,
|
|
11
12
|
deleteCredential,
|
|
12
13
|
getCredential,
|
|
13
14
|
listCredentials,
|
|
14
15
|
updateCredential
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-DXRTOMZP.js";
|
|
16
17
|
import {
|
|
17
18
|
badRequest,
|
|
18
19
|
conflict,
|
|
@@ -186,6 +187,14 @@ function handleUpdateCredential(request, vaultId, credentialId) {
|
|
|
186
187
|
}
|
|
187
188
|
});
|
|
188
189
|
}
|
|
190
|
+
function handleArchiveCredential(request, vaultId, credentialId) {
|
|
191
|
+
return routeWrap(request, async ({ auth }) => {
|
|
192
|
+
loadVaultForCaller(auth, vaultId);
|
|
193
|
+
const cred = archiveCredential(vaultId, credentialId);
|
|
194
|
+
if (!cred) throw notFound(`credential not found: ${credentialId}`);
|
|
195
|
+
return jsonOk(cred);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
189
198
|
function handleDeleteCredential(request, vaultId, credentialId) {
|
|
190
199
|
return routeWrap(request, async ({ auth }) => {
|
|
191
200
|
loadVaultForCaller(auth, vaultId);
|
|
@@ -204,5 +213,6 @@ export {
|
|
|
204
213
|
handleListCredentials,
|
|
205
214
|
handleGetCredential,
|
|
206
215
|
handleUpdateCredential,
|
|
216
|
+
handleArchiveCredential,
|
|
207
217
|
handleDeleteCredential
|
|
208
218
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BatchError,
|
|
3
3
|
executeBatch
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XNEUJKY4.js";
|
|
5
5
|
import {
|
|
6
6
|
jsonOk,
|
|
7
7
|
routeWrap
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IYVGGJMH.js";
|
|
9
9
|
import {
|
|
10
10
|
badRequest
|
|
11
11
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SUPPORTED_PROVIDERS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DMROEZYE.js";
|
|
4
4
|
import {
|
|
5
5
|
addUpstreamKey,
|
|
6
6
|
deleteUpstreamKey,
|
|
@@ -8,20 +8,20 @@ import {
|
|
|
8
8
|
enableUpstreamKey,
|
|
9
9
|
getUpstreamKey,
|
|
10
10
|
listUpstreamKeys
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YSZLX4WE.js";
|
|
12
12
|
import {
|
|
13
13
|
requireGlobalAdmin
|
|
14
14
|
} from "./chunk-23UKWXJH.js";
|
|
15
15
|
import {
|
|
16
16
|
recordAudit
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-PVVJCRII.js";
|
|
18
18
|
import {
|
|
19
19
|
requireFeature
|
|
20
20
|
} from "./chunk-2N2KL4KM.js";
|
|
21
21
|
import {
|
|
22
22
|
jsonOk,
|
|
23
23
|
routeWrap
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-IYVGGJMH.js";
|
|
25
25
|
import {
|
|
26
26
|
badRequest,
|
|
27
27
|
notFound
|
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-P2NWS65Y.js";
|
|
9
9
|
import "../chunk-HFDLUBWN.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-JWVVF66Q.js";
|
|
11
|
+
import "../chunk-SZNZZB7J.js";
|
|
12
|
+
import "../chunk-W3YXUIPS.js";
|
|
13
|
+
import "../chunk-6ZODIFRZ.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-PUH4LEJZ.js";
|
|
11
|
+
import "../chunk-P2NWS65Y.js";
|
|
12
12
|
import "../chunk-HFDLUBWN.js";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-JWVVF66Q.js";
|
|
14
|
+
import "../chunk-SZNZZB7J.js";
|
|
15
|
+
import "../chunk-W3YXUIPS.js";
|
|
16
|
+
import "../chunk-6ZODIFRZ.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-PEEKWYYE.js";
|
|
4
|
+
import "../chunk-P2NWS65Y.js";
|
|
5
5
|
import "../chunk-HFDLUBWN.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-JWVVF66Q.js";
|
|
7
|
+
import "../chunk-SZNZZB7J.js";
|
|
8
|
+
import "../chunk-W3YXUIPS.js";
|
|
9
|
+
import "../chunk-6ZODIFRZ.js";
|
|
10
10
|
import "../chunk-EZYKRG4W.js";
|
|
11
11
|
import "../chunk-2ESYSVXG.js";
|
|
12
12
|
export {
|