@desplega.ai/agent-swarm 2.4.3 → 2.4.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/{acp-adapter-1885dpr7.js → acp-adapter-2wdkktv6.js} +1 -2
- package/dist/{actions-pn76n32q.js → actions-c40ebcm4.js} +18 -18
- package/dist/{amp-adapter-af84rx1d.js → amp-adapter-wb67m95z.js} +2 -2
- package/dist/{app-6sv8mhzm.js → app-353vre8g.js} +3 -3
- package/dist/{assistant-sc2tf825.js → assistant-sj1njh23.js} +21 -21
- package/dist/{boot-reembed-y3m0ydzj.js → boot-reembed-b9c3az3c.js} +1 -1
- package/dist/{boot-reembed-gvxjs2py.js → boot-reembed-qdkvxeem.js} +1 -1
- package/dist/{boot-scrub-sweep-1j9mk05f.js → boot-scrub-sweep-m3wh8eks.js} +2 -2
- package/dist/{boot-seeds-37sp626b.js → boot-seeds-j2273s54.js} +4 -4
- package/dist/{claude-adapter-rp0jtnwr.js → claude-adapter-m7q0a085.js} +2 -2
- package/dist/{claude-managed-adapter-h2y889ge.js → claude-managed-adapter-5ptb6tzs.js} +2 -2
- package/dist/{claude-managed-setup-rdt248k7.js → claude-managed-setup-smrqk5j5.js} +3 -3
- package/dist/{claude-sdk-session-53rcw5we.js → claude-sdk-session-38xnz21e.js} +8284 -8267
- package/dist/{cli-6eyncg0y.js → cli-018r4jq6.js} +34 -6
- package/dist/{cli-sds5zzs8.js → cli-1f3qzw6y.js} +78 -12
- package/dist/{cli-f0p0f6ja.js → cli-1sp861s4.js} +7 -7
- package/dist/{cli-dm8p2dpf.js → cli-1syn2xy1.js} +10 -10
- package/dist/{cli-tkf4x6ha.js → cli-37j04k05.js} +11 -11
- package/dist/{cli-v87dr6e3.js → cli-3a45zcgm.js} +1 -1
- package/dist/{cli-1n9gdg56.js → cli-43x64hv3.js} +4 -4
- package/dist/{cli-p0qerd2r.js → cli-4zfqgjc5.js} +2 -2
- package/dist/{cli-aa3tb29r.js → cli-7c9qs530.js} +1 -1
- package/dist/{cli-9qtjfd60.js → cli-848hxdwj.js} +1 -1
- package/dist/{cli-1xsraagq.js → cli-94gwyg7m.js} +8 -8
- package/dist/{cli-0dxxwfkt.js → cli-9hstj09h.js} +17 -14
- package/dist/{cli-1012xb7j.js → cli-9yqgm9nd.js} +22 -22
- package/dist/{cli-pygdsgh8.js → cli-a92r1127.js} +1 -1
- package/dist/{cli-8vverzf7.js → cli-ba8ne1es.js} +5 -0
- package/dist/{cli-bxrqvpg5.js → cli-be2161h1.js} +7 -7
- package/dist/{cli-npfe9t1s.js → cli-bnes4z6b.js} +2 -2
- package/dist/{cli-aypbg9r2.js → cli-cxxe61f6.js} +1 -1
- package/dist/{cli-vq9gqarq.js → cli-dk44dxec.js} +1 -1
- package/dist/{cli-836ehxmt.js → cli-eww120g8.js} +3 -2
- package/dist/{cli-a0kcty51.js → cli-f01h25yt.js} +1 -1
- package/dist/{cli-mzkwkbdy.js → cli-f0g3pgvf.js} +1 -1
- package/dist/{cli-1ma335fz.js → cli-ftc1g5tj.js} +2 -2
- package/dist/{cli-4yef8ghv.js → cli-fv5hepyy.js} +3 -3
- package/dist/{cli-58vwn100.js → cli-g35m2xwm.js} +4 -4
- package/dist/{cli-qje9k2nh.js → cli-g9ypd5en.js} +12 -2
- package/dist/{cli-gx0j2khs.js → cli-j99azg3g.js} +3 -3
- package/dist/{cli-er83cjbn.js → cli-k8g16gz3.js} +416 -116
- package/dist/{cli-qp2m4btv.js → cli-kpw04va0.js} +2 -2
- package/dist/{cli-8y99kfey.js → cli-ms85309d.js} +33 -15
- package/dist/{cli-kgnkyabk.js → cli-n72rg53p.js} +1555 -645
- package/dist/{cli-e4d78xsv.js → cli-p14m2cnp.js} +1 -1
- package/dist/{cli-1eszr343.js → cli-qfxc84gh.js} +1 -1
- package/dist/{cli-wk28hzqn.js → cli-qwhy2qma.js} +1 -1
- package/dist/{cli-73ezfhha.js → cli-st8aw1m6.js} +228 -11
- package/dist/{cli-zvbb4n0e.js → cli-tw4p90jb.js} +92 -192
- package/dist/{cli-038fga5k.js → cli-v0yrfmdh.js} +148 -183
- package/dist/{cli-6aen3ezb.js → cli-v8fjakwf.js} +1 -1
- package/dist/{cli-99jez72r.js → cli-w9etnnxk.js} +6 -1
- package/dist/{cli-vcgscaan.js → cli-wt0jf9hm.js} +217 -80
- package/dist/{cli-s9rr4gr2.js → cli-xpa64rek.js} +1065 -305
- package/dist/{cli-h0mgxann.js → cli-z7d29rw9.js} +2 -2
- package/dist/cli.js +45 -20
- package/dist/{codex-adapter-2zrmab9b.js → codex-adapter-tn6k5mkg.js} +1 -1
- package/dist/{codex-session-runner-kbkz62vc.js → codex-session-runner-7vjt7jbw.js} +1 -1
- package/dist/{commands-hd574th6.js → commands-t7rz9146.js} +2 -2
- package/dist/{controller-pz5mcfg4.js → controller-m2jasma5.js} +2 -2
- package/dist/{controllers-connect-5rgq2hfk.js → controllers-connect-9ftpex99.js} +19 -19
- package/dist/{cursor-adapter-mgaprq0j.js → cursor-adapter-mjv79e4z.js} +1 -1
- package/dist/{db-6nf1207q.js → db-6sfrn9g3.js} +1 -1
- package/dist/{db-h06dxp05.js → db-rn673r06.js} +3 -3
- package/dist/{dispatcher-zthpy4m1.js → dispatcher-c155xz0p.js} +17 -17
- package/dist/{dsh-adapter-64dhw0j7.js → dsh-adapter-3mmszc1x.js} +1 -1
- package/dist/{external-channel-x01t7ke6.js → external-channel-35k6tkv8.js} +2 -2
- package/dist/{grok-adapter-h21jv594.js → grok-adapter-tfrq7tg1.js} +2 -3
- package/dist/handlers-7gw64dxw.js +39 -0
- package/dist/{heartbeat-zzfksckz.js → heartbeat-dyg4npkp.js} +20 -20
- package/dist/{hook-z4zhzj1f.js → hook-drspbwpe.js} +1 -1
- package/dist/{hook-3xfqhh2s.js → hook-x26b31bg.js} +1 -1
- package/dist/{http-q813tmya.js → http-pk972xyw.js} +571 -294
- package/dist/{index-va3y63es.js → index-6srwvd5b.js} +1 -2
- package/dist/{index-x8xbyn1t.js → index-arytgj5q.js} +1 -1
- package/dist/{index-wbbs14c5.js → index-bgdyvcnv.js} +17 -17
- package/dist/{index-s98037v0.js → index-cbxkmfc5.js} +1 -2
- package/dist/{index-c4ykd0f1.js → index-dr94zbnh.js} +13348 -11611
- package/dist/{index-m0a4ydqj.js → index-gabbcdn2.js} +17 -17
- package/dist/{index-220tk9bw.js → index-jwxkkex2.js} +139 -76
- package/dist/index-tfb26zhy.js +41 -0
- package/dist/{keepalive-y5t1my7m.js → keepalive-7yrng7px.js} +3 -3
- package/dist/{lead-2xwtq66b.js → lead-7e02z839.js} +29 -30
- package/dist/{maintenance-ybfsaedv.js → maintenance-e6cemdqt.js} +1 -1
- package/dist/{node-3v3f08f7.js → node-de6akczr.js} +10 -9
- package/dist/{oauth-refresh-sweep-909jmn12.js → oauth-refresh-sweep-yw3xdbcj.js} +2 -2
- package/dist/{onboard-xn6fkkys.js → onboard-0a9y5yrc.js} +2 -2
- package/dist/{otel-impl-e6mn0z13.js → otel-impl-trjpkfb7.js} +1 -1
- package/dist/{pricing-refresh-ygd362ep.js → pricing-refresh-d2b5my0y.js} +3 -3
- package/dist/{rbac-roles-mb470p4e.js → rbac-roles-hey3yv9d.js} +2 -2
- package/dist/{rbac-roles-c9axvfnz.js → rbac-roles-nxh5ahwk.js} +2 -2
- package/dist/{registry-rxw10xzg.js → registry-ajhexe44.js} +1 -1
- package/dist/{render-v2-g0306nh1.js → render-v2-rr3p2atg.js} +3 -3
- package/dist/{resume-v315hnq6.js → resume-2efkf1s1.js} +5 -5
- package/dist/{session-access-2zg285a1.js → session-access-s2mttxpw.js} +6 -4
- package/dist/{setup-a4mtf02k.js → setup-vypma5yt.js} +1 -1
- package/dist/{work-objects-9fr0fgtn.js → work-objects-rvhckdkp.js} +20 -20
- package/dist/{worker-qae22jeb.js → worker-5snytpbd.js} +29 -30
- package/dist/worker-token-xf11yyds.js +136 -0
- package/openapi.json +303 -13
- package/package.json +8 -8
- package/src/apps/action-runner.ts +4 -0
- package/src/apps/catalog.generated.json +209 -4
- package/src/apps/page-validator.ts +21 -3
- package/src/be/chunking.ts +42 -9
- package/src/be/db/tasks/draft-text.ts +15 -0
- package/src/be/db/tasks/read.ts +14 -1
- package/src/be/db.ts +5 -1
- package/src/be/memory/index-content.ts +36 -17
- package/src/be/memory/providers/openai-embedding.ts +115 -61
- package/src/be/memory/providers/sqlite-store.ts +69 -23
- package/src/be/memory/reranker.ts +31 -1
- package/src/be/memory/search-candidates.ts +47 -0
- package/src/be/memory/types.ts +14 -0
- package/src/be/migrations/232_agent_session_tokens.sql +41 -0
- package/src/be/scripts/typecheck.ts +2 -0
- package/src/be/seed-scripts/catalog/heartbeat-jev-gate.ts +116 -55
- package/src/be/seed-scripts/index.ts +2 -2
- package/src/be/swarm-config-guard.ts +40 -1
- package/src/be/task-attachment-store.ts +30 -0
- package/src/be/users.ts +169 -12
- package/src/cli.tsx +24 -0
- package/src/commands/worker-token.ts +164 -0
- package/src/extensions/catalog.generated.json +4 -4
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/extensions/contract.ts +7 -0
- package/src/fs/provider.ts +13 -1
- package/src/heartbeat/heartbeat.ts +31 -11
- package/src/http/apps.ts +43 -5
- package/src/http/codex-oauth-keep-warm.ts +27 -9
- package/src/http/config.ts +5 -3
- package/src/http/core.ts +2 -0
- package/src/http/fs.ts +54 -34
- package/src/http/mcp-body.ts +37 -0
- package/src/http/mcp-user.ts +3 -5
- package/src/http/mcp.ts +6 -7
- package/src/http/memory.ts +26 -15
- package/src/http/page-proxy.ts +61 -5
- package/src/http/pages-public.ts +27 -44
- package/src/http/pages.ts +4 -4
- package/src/http/script-runs.ts +2 -0
- package/src/http/session-access.ts +51 -2
- package/src/http/sessions.ts +249 -10
- package/src/http/tasks.ts +4 -32
- package/src/http/users.ts +12 -1
- package/src/integrations/chat-sdk/adapters.ts +7 -3
- package/src/integrations/chat-sdk/attachments.ts +90 -12
- package/src/integrations/chat-sdk/facts.ts +120 -0
- package/src/integrations/chat-sdk/inbound.ts +156 -8
- package/src/integrations/chat-sdk/limits.ts +24 -0
- package/src/integrations/chat-sdk/outbound-files.ts +186 -0
- package/src/integrations/chat-sdk/outbound.ts +234 -4
- package/src/integrations/chat-sdk/relay.ts +4 -1
- package/src/integrations/chat-sdk/router.ts +28 -2
- package/src/integrations/chat-sdk/steering.ts +9 -0
- package/src/integrations/chat-sdk/templates.ts +14 -0
- package/src/integrations/chat-sdk/thread-buffer.ts +4 -0
- package/src/mcp-limits.ts +20 -0
- package/src/pages/browser-sdk.ts +8 -3
- package/src/pages/feedback-overlay.ts +1 -1
- package/src/providers/acp-adapter.ts +33 -13
- package/src/providers/acp-swarm-events.ts +1 -1
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/codex-adapter.ts +106 -119
- package/src/providers/codex-agents-md.ts +35 -229
- package/src/providers/codex-oauth/storage.ts +1 -1
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/rbac/legacy-policy.ts +3 -1
- package/src/rbac/permissions.ts +4 -0
- package/src/realtime/transport.ts +1 -2
- package/src/script-workflows/workflow-ctx.ts +1 -0
- package/src/scripts-runtime/types/stdlib.d.ts +2 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +8 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +2 -0
- package/src/server-user.ts +2 -0
- package/src/server.ts +2 -0
- package/src/slack/assistant.ts +2 -2
- package/src/slack/files.ts +2 -0
- package/src/slack/handlers.ts +4 -4
- package/src/slack/inbound-files.ts +39 -6
- package/src/slack/thread-buffer.ts +2 -1
- package/src/tasks/task-terminal-effects.ts +21 -17
- package/src/tests/acp-adapter.test.ts +10 -23
- package/src/tests/acp-fake-agent.ts +36 -0
- package/src/tests/acp-swarm-events.test.ts +1 -1
- package/src/tests/agent-session-tokens.test.ts +452 -0
- package/src/tests/apps-action-parent-task.test.ts +295 -0
- package/src/tests/apps-card-grid.test.ts +197 -0
- package/src/tests/apps-catalog-additions.test.ts +120 -0
- package/src/tests/apps-tree.test.ts +129 -0
- package/src/tests/chat-sdk-attachments-reply.test.ts +52 -0
- package/src/tests/chat-sdk-config.test.ts +11 -0
- package/src/tests/chat-sdk-facts.test.ts +23 -0
- package/src/tests/chat-sdk-inbound.test.ts +558 -4
- package/src/tests/chat-sdk-outbound-files.test.ts +652 -0
- package/src/tests/codex-adapter.test.ts +167 -242
- package/src/tests/codex-oauth-keep-warm.test.ts +85 -1
- package/src/tests/config-api-only-keys.test.ts +9 -0
- package/src/tests/config-session-auth.test.ts +14 -0
- package/src/tests/cors-allowlist.test.ts +1 -1
- package/src/tests/docs-index-footprint.test.js +2 -2
- package/src/tests/extensions-example-slack-reply-gate.test.ts +262 -91
- package/src/tests/grok-adapter.test.ts +3 -3
- package/src/tests/heartbeat-checklist.test.ts +33 -0
- package/src/tests/heartbeat-jev-gate-credentials.test.ts +44 -0
- package/src/tests/heartbeat-jev-gate.test.ts +265 -1
- package/src/tests/kv-page-proxy.test.ts +91 -5
- package/src/tests/launch-password-rejection.test.ts +2 -2
- package/src/tests/mcp-input-caps.test.ts +294 -0
- package/src/tests/memory-chunked-search-starvation.test.ts +200 -0
- package/src/tests/memory-embedding-input-cap.test.ts +114 -0
- package/src/tests/memory.test.ts +14 -0
- package/src/tests/migration-232-agent-session-tokens.test.ts +67 -0
- package/src/tests/page-guest-session.test.ts +19 -8
- package/src/tests/page-proxy-authed.test.ts +1 -1
- package/src/tests/page-proxy.test.ts +17 -10
- package/src/tests/page-session.test.ts +102 -1
- package/src/tests/pages-authed-mode.test.ts +82 -12
- package/src/tests/pages-password-mode.test.ts +5 -5
- package/src/tests/rbac-engine.test.ts +1 -0
- package/src/tests/realtime-transport.test.ts +13 -7
- package/src/tests/runtime-child-token-cleanup.test.ts +3 -3
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/script-runs-http.test.ts +84 -0
- package/src/tests/scripts-http.test.ts +10 -1
- package/src/tests/session-route-posture.test.ts +2 -0
- package/src/tests/swarm-config-export-to-env.test.ts +22 -3
- package/src/tests/task-audio-transcription.test.ts +299 -0
- package/src/tests/task-completion-memory-chunking.test.ts +434 -0
- package/src/tests/task-terminal-secret-scrub.test.ts +6 -1
- package/src/tests/transcription.test.ts +299 -0
- package/src/tests/worker-token-cli.test.ts +76 -0
- package/src/tests/workflow-executors.test.ts +4 -2
- package/src/tests/workflow-system-one-decision-providers.test.ts +98 -1
- package/src/tests/workflow-system-one-decision.test.ts +2 -1
- package/src/tests/workflow-system-one-extraction.test.ts +805 -0
- package/src/tools/chat-access.ts +10 -0
- package/src/tools/chat-post.ts +31 -11
- package/src/tools/chat-reply.ts +32 -10
- package/src/tools/memory-search.ts +3 -1
- package/src/tools/system-one-decide.ts +17 -4
- package/src/types.ts +8 -1
- package/src/utils/config-env-export.ts +3 -1
- package/src/utils/page-session.ts +133 -20
- package/src/utils/request-auth-context.ts +2 -1
- package/src/utils/transcription.ts +246 -0
- package/src/workflows/definition.ts +7 -1
- package/src/workflows/engine.ts +18 -12
- package/src/workflows/executors/index.ts +1 -0
- package/src/workflows/executors/registry.ts +2 -0
- package/src/workflows/executors/system-one-decision.ts +84 -262
- package/src/workflows/executors/system-one-extract-wire.ts +57 -0
- package/src/workflows/executors/system-one-extraction.ts +830 -0
- package/src/workflows/executors/system-one-providers.ts +316 -114
- package/src/workflows/executors/system-one-transport.ts +264 -0
- package/templates/extensions/slack-reply-gate/README.md +24 -22
- package/templates/extensions/slack-reply-gate/hooks.ts +146 -95
- package/templates/extensions/slack-reply-gate/manifest.json +2 -2
- package/templates/official/lead/HEARTBEAT.md +1 -1
- package/templates/skills/apps/SKILL.md +31 -7
- package/templates/skills/apps/content.md +31 -7
- package/templates/skills/chat-sdk/content.md +6 -2
- package/templates/skills/code-quality/content.md +2 -1
- package/templates/skills/heartbeat-runbook/content.md +8 -8
- package/templates/skills/pages/content.md +6 -4
- package/templates/skills/swarm-scripts/SKILL.md +2 -2
- package/templates/skills/swarm-scripts/content.md +2 -2
- package/dist/cli-v1sjhn52.js +0 -7
- package/dist/handlers-2qjw434w.js +0 -39
- package/dist/index-d0g18bax.js +0 -41
|
@@ -9,20 +9,21 @@ import {
|
|
|
9
9
|
init_active_sessions,
|
|
10
10
|
getSteeringMessageById2,
|
|
11
11
|
init_db3
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-wt0jf9hm.js";
|
|
13
13
|
import {
|
|
14
14
|
getUserGrant2,
|
|
15
15
|
init_rbac_roles
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-kpw04va0.js";
|
|
17
17
|
import {
|
|
18
18
|
findUserById,
|
|
19
19
|
findUserByExternalId,
|
|
20
20
|
init_users
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-1f3qzw6y.js";
|
|
22
22
|
import {
|
|
23
23
|
isRbacEnabled,
|
|
24
|
+
can,
|
|
24
25
|
init_rbac
|
|
25
|
-
} from "./cli-
|
|
26
|
+
} from "./cli-ba8ne1es.js";
|
|
26
27
|
import {
|
|
27
28
|
init_zod
|
|
28
29
|
} from "./cli-4chz1hye.js";
|
|
@@ -502,7 +503,7 @@ function route(def) {
|
|
|
502
503
|
try {
|
|
503
504
|
const rawBody = def.body ? await parseBody(req, def.maxBodyBytes) : undefined;
|
|
504
505
|
if (def.session && "bodyTaskIds" in def.session) {
|
|
505
|
-
const { bodySessionDenial } = await import("./session-access-
|
|
506
|
+
const { bodySessionDenial } = await import("./session-access-s2mttxpw.js");
|
|
506
507
|
const denial = await bodySessionDenial(req, def.session.bodyTaskIds(rawBody));
|
|
507
508
|
if (denial) {
|
|
508
509
|
jsonError(res, denial, 403);
|
|
@@ -770,6 +771,33 @@ function readableByFor2(actor) {
|
|
|
770
771
|
return actor.kind === "user" ? { userId: actor.userId } : undefined;
|
|
771
772
|
}
|
|
772
773
|
var SESSION_WRITE_DENIED2 = "You can't write in this session. Ask the owner to share it with edit access.";
|
|
774
|
+
async function hasSessionWrite(req, myAgentId, taskId) {
|
|
775
|
+
const access = await sessionAccessFor2(await resolveSessionActor2(req, myAgentId), taskId);
|
|
776
|
+
return hasSessionAccess(access, "write");
|
|
777
|
+
}
|
|
778
|
+
async function denyParentAttach2(req, res, myAgentId, parentTask, principal) {
|
|
779
|
+
const attach = can({
|
|
780
|
+
principal,
|
|
781
|
+
verb: "task.parent.attach",
|
|
782
|
+
resource: {
|
|
783
|
+
kind: "task",
|
|
784
|
+
taskId: parentTask.id,
|
|
785
|
+
requestedByUserId: parentTask.requestedByUserId,
|
|
786
|
+
creatorAgentId: parentTask.creatorAgentId,
|
|
787
|
+
agentId: parentTask.agentId
|
|
788
|
+
},
|
|
789
|
+
source: "http"
|
|
790
|
+
});
|
|
791
|
+
if (!attach.allow) {
|
|
792
|
+
jsonError(res, `You don't have context for parent task ${parentTask.id}.`, 403);
|
|
793
|
+
return true;
|
|
794
|
+
}
|
|
795
|
+
if (!await hasSessionWrite(req, myAgentId, parentTask.id)) {
|
|
796
|
+
jsonError(res, SESSION_WRITE_DENIED2, 403);
|
|
797
|
+
return true;
|
|
798
|
+
}
|
|
799
|
+
return false;
|
|
800
|
+
}
|
|
773
801
|
async function denialFor(actor, taskId, needed) {
|
|
774
802
|
if (actor.kind === "bypass")
|
|
775
803
|
return null;
|
|
@@ -845,4 +873,4 @@ async function userAgentIdentityDenial2(req, def, pathSegments) {
|
|
|
845
873
|
return USER_AGENT_HEADER_DENIED;
|
|
846
874
|
}
|
|
847
875
|
|
|
848
|
-
export { duplicateGuardedQueryKey, warnIfCorsAllowsAnyOrigin, isOriginAllowedForCredentials, allowedCredentialRedirect, setCorsHeaders, parseQueryParams, getPathSegments, wireHttpSpanLifecycle, safeRequestUrlForLog, agentWithCapacity, parseBody, BODY_TOO_LARGE, enforceContentLengthCap, json, jsonError, writeUnhandledError, triggerSchemaErrorResponse, deriveApiBaseUrl, httpServerSemconvAttributes, hasSessionAccess, getSessionRoot, sessionAccessForRoot, listActiveSessionShares, toSessionSharesState, setSessionShares, resolveTaskAuditUserId, resolveHttpAuditUserId, dashboardUserIdHeader, resolveHttpFavoriteOwner, resolveSessionActor2, sessionAccessFor2, SESSION_READ_DENIED2, canReadSession2, readableByFor2, SESSION_WRITE_DENIED2, pathSessionDenial2, bodySessionDenial2, userAgentIdentityDenial2, runtimeInstanceHeader, bodyTask, bodyListTask, routeRegistry, isPublicRoute, findRoute, describeRequestRoute, route };
|
|
876
|
+
export { duplicateGuardedQueryKey, warnIfCorsAllowsAnyOrigin, isOriginAllowedForCredentials, allowedCredentialRedirect, setCorsHeaders, parseQueryParams, getPathSegments, wireHttpSpanLifecycle, safeRequestUrlForLog, agentWithCapacity, RequestBodyTooLargeError, parseBody, BODY_TOO_LARGE, enforceContentLengthCap, json, jsonError, writeUnhandledError, triggerSchemaErrorResponse, deriveApiBaseUrl, httpServerSemconvAttributes, hasSessionAccess, getSessionRoot, sessionAccessForRoot, listActiveSessionShares, toSessionSharesState, setSessionShares, resolveTaskAuditUserId, resolveHttpAuditUserId, dashboardUserIdHeader, resolveHttpFavoriteOwner, resolveSessionActor2, sessionAccessFor2, SESSION_READ_DENIED2, canReadSession2, readableByFor2, SESSION_WRITE_DENIED2, denyParentAttach2, pathSessionDenial2, bodySessionDenial2, userAgentIdentityDenial2, runtimeInstanceHeader, bodyTask, bodyListTask, routeRegistry, isPublicRoute, findRoute, describeRequestRoute, route };
|
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
validateRuntimeTokenTtlHours,
|
|
6
6
|
init_swarm_config_guard,
|
|
7
7
|
init_db3
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-wt0jf9hm.js";
|
|
9
9
|
import {
|
|
10
|
+
registerVolatileSecret,
|
|
10
11
|
unregisterVolatileSecret,
|
|
11
12
|
init_secret_scrubber
|
|
12
13
|
} from "./cli-xf234ws8.js";
|
|
@@ -264,11 +265,12 @@ async function resolveUserByToken(plaintext) {
|
|
|
264
265
|
async function mintSessionToken(agentId, taskId, ttlMs, parent) {
|
|
265
266
|
if (parent) {
|
|
266
267
|
return await getDbClient2().transaction(async (client) => {
|
|
267
|
-
const row = await client.get(`SELECT expiresAt FROM session_tokens WHERE id = ? AND agentId = ? AND runtimeId = ?
|
|
268
|
-
|
|
268
|
+
const row = await client.get(parent.runtimeId ? `SELECT expiresAt FROM session_tokens WHERE id = ? AND agentId = ? AND runtimeId = ?
|
|
269
|
+
AND revokedAt IS NULL AND expiresAt > ?` : `SELECT expiresAt FROM session_tokens WHERE id = ? AND agentId = ? AND ${AGENT_TOKEN_BINDING}
|
|
270
|
+
AND revokedAt IS NULL AND expiresAt > ?`, parent.runtimeId ? [parent.tokenId, agentId, parent.runtimeId, new Date().toISOString()] : [parent.tokenId, agentId, new Date().toISOString()]);
|
|
269
271
|
if (!row)
|
|
270
272
|
throw new InvalidRuntimeTokenError;
|
|
271
|
-
return await insertSessionToken(agentId, taskId, null, ttlMs, parent.runtimeId, row.expiresAt);
|
|
273
|
+
return await insertSessionToken(agentId, taskId, null, ttlMs, parent.runtimeId, row.expiresAt, null, parent.runtimeId ? null : parent.tokenId);
|
|
272
274
|
});
|
|
273
275
|
}
|
|
274
276
|
return await insertSessionToken(agentId, taskId, null, ttlMs);
|
|
@@ -280,7 +282,7 @@ function runtimeTokenTtlMs() {
|
|
|
280
282
|
async function mintRuntimeToken(agentId, runtimeId, ttlMs = runtimeTokenTtlMs()) {
|
|
281
283
|
return await insertSessionToken(agentId, null, runtimeId, ttlMs);
|
|
282
284
|
}
|
|
283
|
-
async function insertSessionToken(agentId, taskId, runtimeId, ttlMs, parentRuntimeId = null, expiresAtCeiling, controllerId = null) {
|
|
285
|
+
async function insertSessionToken(agentId, taskId, runtimeId, ttlMs, parentRuntimeId = null, expiresAtCeiling, controllerId = null, parentTokenId = null) {
|
|
284
286
|
const plaintext = `${SESSION_TOKEN_PREFIX}${base62(randomBytes(24))}`;
|
|
285
287
|
const tokenId = randomUUID().replace(/-/g, "");
|
|
286
288
|
const hash = sha256Hex(plaintext);
|
|
@@ -288,8 +290,8 @@ async function insertSessionToken(agentId, taskId, runtimeId, ttlMs, parentRunti
|
|
|
288
290
|
const now = new Date;
|
|
289
291
|
const expiresAt = new Date(Math.min(now.getTime() + ttlMs, expiresAtCeiling ? Date.parse(expiresAtCeiling) : Infinity)).toISOString();
|
|
290
292
|
await getDbClient2().run(`INSERT INTO session_tokens
|
|
291
|
-
(id, tokenHash, tokenPreview, agentId, taskId, runtimeId, parentRuntimeId, expiresAt, createdAt, controllerId)
|
|
292
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
293
|
+
(id, tokenHash, tokenPreview, agentId, taskId, runtimeId, parentRuntimeId, expiresAt, createdAt, controllerId, parentTokenId)
|
|
294
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
293
295
|
tokenId,
|
|
294
296
|
hash,
|
|
295
297
|
preview,
|
|
@@ -299,7 +301,8 @@ async function insertSessionToken(agentId, taskId, runtimeId, ttlMs, parentRunti
|
|
|
299
301
|
parentRuntimeId,
|
|
300
302
|
expiresAt,
|
|
301
303
|
now.toISOString(),
|
|
302
|
-
controllerId
|
|
304
|
+
controllerId,
|
|
305
|
+
parentTokenId
|
|
303
306
|
]);
|
|
304
307
|
return { tokenId, plaintext };
|
|
305
308
|
}
|
|
@@ -309,11 +312,24 @@ async function revokeSessionToken(tokenId) {
|
|
|
309
312
|
if (row?.runtimeId) {
|
|
310
313
|
await revokeRuntimeTokensForRuntime(row.runtimeId);
|
|
311
314
|
} else {
|
|
312
|
-
await client
|
|
313
|
-
getDbClient2().afterCommit(() => closeSessionTokenConnections([tokenId]));
|
|
315
|
+
await revokeTokensWithChildren(client, [tokenId]);
|
|
314
316
|
}
|
|
315
317
|
});
|
|
316
318
|
}
|
|
319
|
+
async function revokeTokensWithChildren(client, tokenIds) {
|
|
320
|
+
if (tokenIds.length === 0)
|
|
321
|
+
return;
|
|
322
|
+
const placeholders = tokenIds.map(() => "?").join(", ");
|
|
323
|
+
const children = await client.query(`SELECT id FROM session_tokens WHERE parentTokenId IN (${placeholders})`, tokenIds);
|
|
324
|
+
const ids = [...tokenIds, ...children.map((row) => row.id)];
|
|
325
|
+
await client.run(`UPDATE session_tokens SET revokedAt = ?
|
|
326
|
+
WHERE id IN (${ids.map(() => "?").join(", ")}) AND revokedAt IS NULL`, [new Date().toISOString(), ...ids]);
|
|
327
|
+
getDbClient2().afterCommit(() => {
|
|
328
|
+
for (const id of tokenIds)
|
|
329
|
+
unregisterVolatileSecret(`agent-token:${id}`);
|
|
330
|
+
closeSessionTokenConnections(ids);
|
|
331
|
+
});
|
|
332
|
+
}
|
|
317
333
|
async function revokeRuntimeTokensForRuntime(runtimeId) {
|
|
318
334
|
await getDbClient2().transaction(async (client) => {
|
|
319
335
|
const rows = await client.query("SELECT id FROM session_tokens WHERE runtimeId = ? OR parentRuntimeId = ?", [runtimeId, runtimeId]);
|
|
@@ -325,6 +341,50 @@ async function revokeRuntimeTokensForRuntime(runtimeId) {
|
|
|
325
341
|
});
|
|
326
342
|
});
|
|
327
343
|
}
|
|
344
|
+
function storedExpiry(ttlMs) {
|
|
345
|
+
return ttlMs === null ? AGENT_TOKEN_NO_EXPIRY : new Date(Date.now() + ttlMs).toISOString();
|
|
346
|
+
}
|
|
347
|
+
function publicExpiry(expiresAt) {
|
|
348
|
+
return expiresAt === AGENT_TOKEN_NO_EXPIRY ? null : expiresAt;
|
|
349
|
+
}
|
|
350
|
+
async function activeAgentTokenIds(client, agentId) {
|
|
351
|
+
const rows = await client.query(`SELECT id FROM session_tokens WHERE agentId = ? AND ${AGENT_TOKEN_BINDING}
|
|
352
|
+
AND revokedAt IS NULL AND expiresAt > ?`, [agentId, new Date().toISOString()]);
|
|
353
|
+
return rows.map((row) => row.id);
|
|
354
|
+
}
|
|
355
|
+
async function insertAgentToken(agentId, ttlMs) {
|
|
356
|
+
const expiresAt = storedExpiry(ttlMs);
|
|
357
|
+
const token = await insertSessionToken(agentId, null, null, Number.MAX_SAFE_INTEGER, null, expiresAt);
|
|
358
|
+
getDbClient2().afterCommit(() => registerVolatileSecret(token.plaintext, `agent-token:${token.tokenId}`));
|
|
359
|
+
return { ...token, expiresAt: publicExpiry(expiresAt) };
|
|
360
|
+
}
|
|
361
|
+
async function mintAgentToken(agentId, ttlMs = AGENT_TOKEN_DEFAULT_TTL_MS) {
|
|
362
|
+
return await getDbClient2().transaction(async (client) => {
|
|
363
|
+
if ((await activeAgentTokenIds(client, agentId)).length > 0) {
|
|
364
|
+
throw new AgentTokenExistsError;
|
|
365
|
+
}
|
|
366
|
+
return await insertAgentToken(agentId, ttlMs);
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
async function rotateAgentToken(agentId, graceMs, ttlMs = AGENT_TOKEN_DEFAULT_TTL_MS) {
|
|
370
|
+
return await getDbClient2().transaction(async (client) => {
|
|
371
|
+
const previous = await activeAgentTokenIds(client, agentId);
|
|
372
|
+
if (previous.length === 0)
|
|
373
|
+
return null;
|
|
374
|
+
const previousExpiresAt = new Date(Date.now() + graceMs).toISOString();
|
|
375
|
+
const placeholders = previous.map(() => "?").join(", ");
|
|
376
|
+
await client.run(`UPDATE session_tokens SET expiresAt = ?
|
|
377
|
+
WHERE (id IN (${placeholders}) OR parentTokenId IN (${placeholders})) AND expiresAt > ?`, [previousExpiresAt, ...previous, ...previous, previousExpiresAt]);
|
|
378
|
+
return { ...await insertAgentToken(agentId, ttlMs), previousExpiresAt };
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
async function revokeAgentTokens(agentId) {
|
|
382
|
+
return await getDbClient2().transaction(async (client) => {
|
|
383
|
+
const ids = await activeAgentTokenIds(client, agentId);
|
|
384
|
+
await revokeTokensWithChildren(client, ids);
|
|
385
|
+
return ids.length;
|
|
386
|
+
});
|
|
387
|
+
}
|
|
328
388
|
async function resolveSessionToken(plaintext, options = {}) {
|
|
329
389
|
if (!plaintext.startsWith(SESSION_TOKEN_PREFIX))
|
|
330
390
|
return null;
|
|
@@ -356,6 +416,7 @@ async function resolveSessionToken(plaintext, options = {}) {
|
|
|
356
416
|
return {
|
|
357
417
|
kind: "agent",
|
|
358
418
|
tokenId: row.id,
|
|
419
|
+
tokenKind: row.taskId !== null ? "task" : row.runtimeId !== null ? "runtime" : "agent",
|
|
359
420
|
agentId: row.agentId,
|
|
360
421
|
taskId: row.taskId,
|
|
361
422
|
runtimeId: row.runtimeId,
|
|
@@ -365,7 +426,7 @@ async function resolveSessionToken(plaintext, options = {}) {
|
|
|
365
426
|
function fingerprintApiKey(rawKey) {
|
|
366
427
|
return `op:${sha256Hex(rawKey).slice(0, 16)}`;
|
|
367
428
|
}
|
|
368
|
-
var TOKEN_PREFIX = "aswt_", SESSION_TOKEN_PREFIX = "aseph_", InvalidRuntimeTokenError;
|
|
429
|
+
var TOKEN_PREFIX = "aswt_", SESSION_TOKEN_PREFIX = "aseph_", InvalidRuntimeTokenError, AGENT_TOKEN_BINDING = "taskId IS NULL AND runtimeId IS NULL AND controllerId IS NULL AND parentRuntimeId IS NULL", AGENT_TOKEN_NO_EXPIRY = "9999-12-31T23:59:59.999Z", AGENT_TOKEN_DEFAULT_TTL_MS = null, AgentTokenExistsError;
|
|
369
430
|
var init_users = __esm(() => {
|
|
370
431
|
init_telemetry_identity();
|
|
371
432
|
init_secret_scrubber();
|
|
@@ -377,6 +438,11 @@ var init_users = __esm(() => {
|
|
|
377
438
|
super("Runtime token is no longer valid");
|
|
378
439
|
}
|
|
379
440
|
};
|
|
441
|
+
AgentTokenExistsError = class AgentTokenExistsError extends Error {
|
|
442
|
+
constructor() {
|
|
443
|
+
super("Agent already has an active token; rotate or revoke it");
|
|
444
|
+
}
|
|
445
|
+
};
|
|
380
446
|
});
|
|
381
447
|
|
|
382
|
-
export { registerSessionTokenConnection, closeSessionTokenConnections, init_session_token_connections, findUserById, findUserByExternalId, findUserByEmail, findUsersByName, getUserIdentities, listUserEvents, listUserTokens, recordIdentityEvent, findOrCreateUserByEmail, linkIdentity, unlinkIdentity, mintToken, revokeToken, resolveUserByToken, InvalidRuntimeTokenError, mintSessionToken, mintRuntimeToken, insertSessionToken, revokeSessionToken, revokeRuntimeTokensForRuntime, resolveSessionToken, fingerprintApiKey, init_users };
|
|
448
|
+
export { registerSessionTokenConnection, closeSessionTokenConnections, init_session_token_connections, findUserById, findUserByExternalId, findUserByEmail, findUsersByName, getUserIdentities, listUserEvents, listUserTokens, recordIdentityEvent, findOrCreateUserByEmail, linkIdentity, unlinkIdentity, mintToken, revokeToken, resolveUserByToken, InvalidRuntimeTokenError, mintSessionToken, mintRuntimeToken, insertSessionToken, revokeSessionToken, revokeRuntimeTokensForRuntime, AgentTokenExistsError, mintAgentToken, rotateAgentToken, revokeAgentTokens, resolveSessionToken, fingerprintApiKey, init_users };
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
CONTROLLER_COMMAND_TIMEOUT_MS,
|
|
5
5
|
RuntimeHandleSchema,
|
|
6
6
|
ControllerStatusResultSchema
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-f0g3pgvf.js";
|
|
8
8
|
import {
|
|
9
9
|
getDbClient2,
|
|
10
10
|
isRuntimePoolsEnabled,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
upsertSwarmConfig2,
|
|
22
22
|
getResolvedConfig2,
|
|
23
23
|
init_db3
|
|
24
|
-
} from "./cli-
|
|
24
|
+
} from "./cli-wt0jf9hm.js";
|
|
25
25
|
import {
|
|
26
26
|
runtimeStaleThresholdMinutes,
|
|
27
27
|
getRuntimeInstanceById,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
listRuntimeInstancesForPool,
|
|
32
32
|
createWorkerTaskFollowUp,
|
|
33
33
|
canClaim
|
|
34
|
-
} from "./cli-
|
|
34
|
+
} from "./cli-n72rg53p.js";
|
|
35
35
|
import {
|
|
36
36
|
getRuntimeController2,
|
|
37
37
|
getRuntimeControllerTarget2,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
getPoolForAgent2,
|
|
43
43
|
resolvePoolDelivery2,
|
|
44
44
|
init_db
|
|
45
|
-
} from "./cli-
|
|
45
|
+
} from "./cli-j99azg3g.js";
|
|
46
46
|
import {
|
|
47
47
|
workflowEventBus2,
|
|
48
48
|
init_event_bus
|
|
@@ -61,12 +61,12 @@ import {
|
|
|
61
61
|
import {
|
|
62
62
|
mintRuntimeToken,
|
|
63
63
|
init_users
|
|
64
|
-
} from "./cli-
|
|
64
|
+
} from "./cli-1f3qzw6y.js";
|
|
65
65
|
import {
|
|
66
66
|
TERMINAL_TASK_STATUSES,
|
|
67
67
|
isTerminalTaskStatus,
|
|
68
68
|
init_types
|
|
69
|
-
} from "./cli-
|
|
69
|
+
} from "./cli-eww120g8.js";
|
|
70
70
|
import {
|
|
71
71
|
init_zod
|
|
72
72
|
} from "./cli-4chz1hye.js";
|
|
@@ -522,7 +522,7 @@ async function recoverSessions(runtimeId, reason) {
|
|
|
522
522
|
}
|
|
523
523
|
if (!sessions.length)
|
|
524
524
|
return;
|
|
525
|
-
const { remediateTaskForDeadRuntime } = await import("./heartbeat-
|
|
525
|
+
const { remediateTaskForDeadRuntime } = await import("./heartbeat-dyg4npkp.js");
|
|
526
526
|
for (const session of sessions) {
|
|
527
527
|
try {
|
|
528
528
|
const task = await getTaskById2(session.taskId);
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
getMostRecentTaskInThread2,
|
|
11
11
|
reactionName,
|
|
12
12
|
init_db3
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-wt0jf9hm.js";
|
|
14
14
|
import {
|
|
15
15
|
TaskCreationBlockedError,
|
|
16
16
|
buildEffectiveText,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
extractTaskFromMessage,
|
|
24
24
|
extractSlackMessageText,
|
|
25
25
|
dispatchPre2
|
|
26
|
-
} from "./cli-
|
|
26
|
+
} from "./cli-n72rg53p.js";
|
|
27
27
|
import {
|
|
28
28
|
noteSlackInboundSideEffect,
|
|
29
29
|
ignoreSlackInbound,
|
|
@@ -34,14 +34,14 @@ import {
|
|
|
34
34
|
isSlackRenderV2Enabled2,
|
|
35
35
|
ensureSlackThreadTree2,
|
|
36
36
|
registerTreeMessage
|
|
37
|
-
} from "./cli-
|
|
37
|
+
} from "./cli-37j04k05.js";
|
|
38
38
|
import {
|
|
39
39
|
isBlockExternalEnabled2,
|
|
40
40
|
invalidateChannelExternality2,
|
|
41
41
|
getChannelBlockReason2,
|
|
42
42
|
shouldBlockChannel2,
|
|
43
43
|
leaveExternalChannel2
|
|
44
|
-
} from "./cli-
|
|
44
|
+
} from "./cli-3a45zcgm.js";
|
|
45
45
|
import {
|
|
46
46
|
workflowEventBus2,
|
|
47
47
|
init_event_bus
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
enrichSlackUserEmail,
|
|
51
51
|
resolveSlackUserId,
|
|
52
52
|
rewriteSlackMentions
|
|
53
|
-
} from "./cli-
|
|
53
|
+
} from "./cli-fv5hepyy.js";
|
|
54
54
|
import {
|
|
55
55
|
wasEventSeen,
|
|
56
56
|
requestSlackThreadSteering,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
bufferThreadMessage,
|
|
59
59
|
getBufferMessageCount,
|
|
60
60
|
instantFlush
|
|
61
|
-
} from "./cli-
|
|
61
|
+
} from "./cli-be2161h1.js";
|
|
62
62
|
import {
|
|
63
63
|
resolveTemplate,
|
|
64
64
|
init_resolver
|
|
@@ -400,8 +400,8 @@ function registerMessageHandler2(app) {
|
|
|
400
400
|
}
|
|
401
401
|
return ignoreSlackInbound("rate_limited");
|
|
402
402
|
}
|
|
403
|
-
const inbound = __using(__stack, await fetchSlackFiles(client, msg.files), 1);
|
|
404
|
-
const taskText = buildEffectiveText(msg.text, inbound.files, inbound.failed);
|
|
403
|
+
const inbound = __using(__stack, await fetchSlackFiles(client, msg.files, { transcribe: true }), 1);
|
|
404
|
+
const taskText = buildEffectiveText(msg.text, inbound.files, inbound.failed, inbound.notes);
|
|
405
405
|
const taskDescription = isImplicitMention ? taskText : extractTaskFromMessage(taskText, botUserId);
|
|
406
406
|
if (!taskDescription) {
|
|
407
407
|
if (!isImplicitMention && !isSlackRenderV2Enabled2()) {
|
|
@@ -465,8 +465,8 @@ ${taskDescription}`;
|
|
|
465
465
|
}
|
|
466
466
|
return ignoreSlackInbound("rate_limited");
|
|
467
467
|
}
|
|
468
|
-
const inbound = __using(__stack2, await fetchSlackFiles(client, msg.files), 1);
|
|
469
|
-
const taskDescription = extractTaskFromMessage(buildEffectiveText(msg.text, inbound.files, inbound.failed), botUserId);
|
|
468
|
+
const inbound = __using(__stack2, await fetchSlackFiles(client, msg.files, { transcribe: true }), 1);
|
|
469
|
+
const taskDescription = extractTaskFromMessage(buildEffectiveText(msg.text, inbound.files, inbound.failed, inbound.notes), botUserId);
|
|
470
470
|
if (!taskDescription) {
|
|
471
471
|
if (!isSlackRenderV2Enabled2()) {
|
|
472
472
|
await say({
|
|
@@ -47,10 +47,10 @@ import {
|
|
|
47
47
|
checkDependencies2,
|
|
48
48
|
emitBuiltInIntegrationConnectedOnce2,
|
|
49
49
|
init_db3
|
|
50
|
-
} from "./cli-
|
|
50
|
+
} from "./cli-wt0jf9hm.js";
|
|
51
51
|
import {
|
|
52
52
|
getChannelBlockReason2
|
|
53
|
-
} from "./cli-
|
|
53
|
+
} from "./cli-3a45zcgm.js";
|
|
54
54
|
import {
|
|
55
55
|
require_dist5,
|
|
56
56
|
require_axios,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
import {
|
|
68
68
|
isTerminalTaskStatus,
|
|
69
69
|
init_types
|
|
70
|
-
} from "./cli-
|
|
70
|
+
} from "./cli-eww120g8.js";
|
|
71
71
|
import {
|
|
72
72
|
taskAttachmentDisplayUrl,
|
|
73
73
|
init_task_attachment_links
|
|
@@ -6235,7 +6235,7 @@ async function initOtel(serviceRole = process.env.AGENT_ROLE || "api") {
|
|
|
6235
6235
|
return;
|
|
6236
6236
|
initialized = true;
|
|
6237
6237
|
try {
|
|
6238
|
-
const impl = await import("./otel-impl-
|
|
6238
|
+
const impl = await import("./otel-impl-trjpkfb7.js");
|
|
6239
6239
|
await impl.boot(serviceRole, {
|
|
6240
6240
|
exportConsoleLogs: serviceRole === "api" && isApiLogExportEnabled()
|
|
6241
6241
|
});
|
|
@@ -10080,17 +10080,17 @@ async function initSlackApp2() {
|
|
|
10080
10080
|
});
|
|
10081
10081
|
initialized2 = true;
|
|
10082
10082
|
app.use(slackInboundOutcomeMiddleware());
|
|
10083
|
-
const { registerMessageHandler } = await import("./handlers-
|
|
10084
|
-
const { registerCommandHandler } = await import("./commands-
|
|
10085
|
-
const { registerActionHandlers } = await import("./actions-
|
|
10086
|
-
const { registerWorkObjectHandlers } = await import("./work-objects-
|
|
10083
|
+
const { registerMessageHandler } = await import("./handlers-7gw64dxw.js");
|
|
10084
|
+
const { registerCommandHandler } = await import("./commands-t7rz9146.js");
|
|
10085
|
+
const { registerActionHandlers } = await import("./actions-c40ebcm4.js");
|
|
10086
|
+
const { registerWorkObjectHandlers } = await import("./work-objects-rvhckdkp.js");
|
|
10087
10087
|
registerMessageHandler(app);
|
|
10088
10088
|
registerCommandHandler(app);
|
|
10089
10089
|
registerActionHandlers(app);
|
|
10090
10090
|
registerWorkObjectHandlers(app);
|
|
10091
|
-
const { createAssistant } = await import("./assistant-
|
|
10091
|
+
const { createAssistant } = await import("./assistant-sj1njh23.js");
|
|
10092
10092
|
app.assistant(createAssistant());
|
|
10093
|
-
const { isBlockExternalEnabled, scanExternalChannelsOnBoot } = await import("./external-channel-
|
|
10093
|
+
const { isBlockExternalEnabled, scanExternalChannelsOnBoot } = await import("./external-channel-35k6tkv8.js");
|
|
10094
10094
|
if (isBlockExternalEnabled()) {
|
|
10095
10095
|
scanExternalChannelsOnBoot(app.client).catch((error) => {
|
|
10096
10096
|
console.error("[Slack] External channel boot scan failed:", error);
|
|
@@ -10103,7 +10103,7 @@ async function startSlackApp2() {
|
|
|
10103
10103
|
await initSlackApp2();
|
|
10104
10104
|
}
|
|
10105
10105
|
if (app) {
|
|
10106
|
-
const { isSlackRenderV2Enabled } = await import("./render-v2-
|
|
10106
|
+
const { isSlackRenderV2Enabled } = await import("./render-v2-rr3p2atg.js");
|
|
10107
10107
|
if (isSlackRenderV2Enabled())
|
|
10108
10108
|
await ensureSlackRenderV2Activation2();
|
|
10109
10109
|
await app.start();
|
|
@@ -7,20 +7,20 @@ import {
|
|
|
7
7
|
tierConfigKey,
|
|
8
8
|
init_model_tier_keys,
|
|
9
9
|
init_db3
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-wt0jf9hm.js";
|
|
11
11
|
import {
|
|
12
12
|
ensureRbacSeedsSynced2,
|
|
13
13
|
init_rbac_roles
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-kpw04va0.js";
|
|
15
15
|
import {
|
|
16
16
|
seedPricingFromModelsDev
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-dk44dxec.js";
|
|
18
18
|
import {
|
|
19
19
|
MODEL_TIERS,
|
|
20
20
|
DEFAULT_MODEL_TIER_MAP,
|
|
21
21
|
ProviderNameSchema,
|
|
22
22
|
init_types
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-eww120g8.js";
|
|
24
24
|
|
|
25
25
|
// src/be/boot-seeds.ts
|
|
26
26
|
init_db3();
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getResolvedConfig2,
|
|
7
7
|
getAllUsers2,
|
|
8
8
|
init_db3
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-wt0jf9hm.js";
|
|
10
10
|
import {
|
|
11
11
|
scrubSecrets,
|
|
12
12
|
init_secret_scrubber
|
|
@@ -122,7 +122,7 @@ async function ensureAgentFsSharedProvisioning(options) {
|
|
|
122
122
|
await upsertSwarmConfig2({ scope: "global", key, value, isSecret: false, description });
|
|
123
123
|
}
|
|
124
124
|
process.env.AGENT_FS_API_URL = apiUrl;
|
|
125
|
-
const { resetFileStorageProvider } = await import("./registry-
|
|
125
|
+
const { resetFileStorageProvider } = await import("./registry-ajhexe44.js");
|
|
126
126
|
resetFileStorageProvider();
|
|
127
127
|
return { apiUrl, apiKey, orgId, driveId, authHeaders };
|
|
128
128
|
}
|
|
@@ -320,7 +320,7 @@ var formatRequestDetails = (details) => {
|
|
|
320
320
|
if (details.headers) {
|
|
321
321
|
details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value]) => [
|
|
322
322
|
name,
|
|
323
|
-
name.toLowerCase() === "authorization" || name.toLowerCase() === "proxy-authorization" || name.toLowerCase() === "api-key" || name.toLowerCase() === "x-api-key" || name.toLowerCase() === "cookie" || name.toLowerCase() === "set-cookie" ? "***" : value
|
|
323
|
+
name.toLowerCase() === "authorization" || name.toLowerCase() === "proxy-authorization" || name.toLowerCase() === "api-key" || name.toLowerCase() === "x-api-key" || name.toLowerCase() === "x-amz-security-token" || name.toLowerCase() === "cookie" || name.toLowerCase() === "set-cookie" ? "***" : value
|
|
324
324
|
]));
|
|
325
325
|
}
|
|
326
326
|
if ("retryOfRequestLogID" in details) {
|
|
@@ -7,7 +7,7 @@ var package_default;
|
|
|
7
7
|
var init_package = __esm(() => {
|
|
8
8
|
package_default = {
|
|
9
9
|
name: "@desplega.ai/agent-swarm",
|
|
10
|
-
version: "2.4.
|
|
10
|
+
version: "2.4.5",
|
|
11
11
|
description: "agent-swarm.dev — an open-source operating system for AI work: a lead agent breaks goals into tasks, routes them to specialized workers such as Claude Code or Codex, runs each worker in an isolated container, and preserves shared memory, tools, schedules, and review gates so delegated work compounds across sessions.",
|
|
12
12
|
keywords: [
|
|
13
13
|
"agent-swarm.dev",
|
|
@@ -186,8 +186,8 @@ var init_package = __esm(() => {
|
|
|
186
186
|
"@desplega/model-catalog": "workspace:*",
|
|
187
187
|
"@desplega/model-routing": "workspace:*",
|
|
188
188
|
"@faker-js/faker": "^10.4.0",
|
|
189
|
-
"@opencode/plugin": "2.
|
|
190
|
-
"@opencode/sdk": "2.
|
|
189
|
+
"@opencode/plugin": "2.1.2",
|
|
190
|
+
"@opencode/sdk": "2.1.2",
|
|
191
191
|
"@oxlint/plugins": "1.78.0",
|
|
192
192
|
"@types/bun": "latest",
|
|
193
193
|
"dependency-cruiser": "^18.0.0",
|
|
@@ -205,17 +205,17 @@ var init_package = __esm(() => {
|
|
|
205
205
|
bun: ">=1.3.12"
|
|
206
206
|
},
|
|
207
207
|
dependencies: {
|
|
208
|
-
"@agentclientprotocol/sdk": "
|
|
208
|
+
"@agentclientprotocol/sdk": "2.0.0",
|
|
209
209
|
"@ai-sdk/openai": "^3.0.41",
|
|
210
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
211
|
-
"@anthropic-ai/sdk": "^0.
|
|
210
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.306",
|
|
211
|
+
"@anthropic-ai/sdk": "^0.137.0",
|
|
212
212
|
"@asteasolutions/zod-to-openapi": "^8.0.0",
|
|
213
213
|
"@aws-sdk/client-bedrock": "3.1048.0",
|
|
214
214
|
"@chat-adapter/discord": "4.41.1",
|
|
215
215
|
"@chat-adapter/slack": "4.41.1",
|
|
216
216
|
"@chat-adapter/teams": "4.41.1",
|
|
217
217
|
"@chat-adapter/telegram": "4.41.1",
|
|
218
|
-
"@cursor/sdk": "1.0.
|
|
218
|
+
"@cursor/sdk": "1.0.40",
|
|
219
219
|
"@desplega.ai/agent-fs-just-bash": "0.18.5",
|
|
220
220
|
"@desplega.ai/business-use": "^0.4.2",
|
|
221
221
|
"@earendil-works/pi-agent-core": "^1.3.0",
|
|
@@ -224,7 +224,7 @@ var init_package = __esm(() => {
|
|
|
224
224
|
"@inkjs/ui": "^2.0.0",
|
|
225
225
|
"@jitl/quickjs-singlefile-mjs-release-sync": "0.32.0",
|
|
226
226
|
"@linear/sdk": "^77.0.0",
|
|
227
|
-
"@modelcontextprotocol/sdk": "1.
|
|
227
|
+
"@modelcontextprotocol/sdk": "1.32.1",
|
|
228
228
|
"@openai/codex": "0.163.0",
|
|
229
229
|
"@openfort/openfort-node": "^0.9.1",
|
|
230
230
|
"@opentelemetry/api": "^1.9.1",
|
|
@@ -39,18 +39,18 @@ import {
|
|
|
39
39
|
getPendingWaitsByEvent2,
|
|
40
40
|
resolveWaitState2,
|
|
41
41
|
init_db3
|
|
42
|
-
} from "./cli-
|
|
42
|
+
} from "./cli-wt0jf9hm.js";
|
|
43
43
|
import {
|
|
44
44
|
BaseExecutor,
|
|
45
45
|
postApprovalCancellationUpdates,
|
|
46
|
-
|
|
46
|
+
isSystemOneNodeType,
|
|
47
47
|
systemOneRetryViolations,
|
|
48
48
|
systemOneUnresolvedError,
|
|
49
49
|
getNextTargets,
|
|
50
50
|
findEntryNodes,
|
|
51
51
|
resolveValidationPort,
|
|
52
52
|
getSuccessors
|
|
53
|
-
} from "./cli-
|
|
53
|
+
} from "./cli-xpa64rek.js";
|
|
54
54
|
import {
|
|
55
55
|
workflowEventBus2,
|
|
56
56
|
init_event_bus
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
RetryPolicySchema,
|
|
60
60
|
SUPERSEDED_WORKFLOW_TASK_REASON,
|
|
61
61
|
init_types
|
|
62
|
-
} from "./cli-
|
|
62
|
+
} from "./cli-eww120g8.js";
|
|
63
63
|
import {
|
|
64
64
|
getSlackConfiguration,
|
|
65
65
|
isSlackConfigured,
|
|
@@ -107,7 +107,7 @@ async function notifyAutomationPreflightFailure(preflight) {
|
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
109
|
try {
|
|
110
|
-
const { getSlackApp } = await import("./app-
|
|
110
|
+
const { getSlackApp } = await import("./app-353vre8g.js");
|
|
111
111
|
const app = getSlackApp();
|
|
112
112
|
if (!app) {
|
|
113
113
|
console.warn("[Automation Preflight] Slack not available, cannot send notification");
|
|
@@ -1380,7 +1380,7 @@ async function runClaimedStep(def, runId, ctx, node, registry, existingStep, ste
|
|
|
1380
1380
|
return { outcome: "failed", successors: [] };
|
|
1381
1381
|
}
|
|
1382
1382
|
if (strictUnresolved && strictUnresolved.length > 0) {
|
|
1383
|
-
await checkpointStepFailure(runId, stepId, systemOneUnresolvedError(node.id, strictUnresolved), 0);
|
|
1383
|
+
await checkpointStepFailure(runId, stepId, systemOneUnresolvedError(node.id, strictUnresolved, node.type), 0);
|
|
1384
1384
|
return { outcome: "failed", successors: [] };
|
|
1385
1385
|
}
|
|
1386
1386
|
if (unresolved.length > 0) {
|
|
@@ -1435,7 +1435,7 @@ async function runClaimedStep(def, runId, ctx, node, registry, existingStep, ste
|
|
|
1435
1435
|
if ("async" in result && result.async) {
|
|
1436
1436
|
const waiting = await checkpointStepWaiting(runId, stepId, ctx);
|
|
1437
1437
|
if (waiting && result.waitFor === "workflow.child.finished") {
|
|
1438
|
-
const { resumeFromChildRun } = await import("./resume-
|
|
1438
|
+
const { resumeFromChildRun } = await import("./resume-2efkf1s1.js");
|
|
1439
1439
|
await resumeFromChildRun(stepId, registry);
|
|
1440
1440
|
}
|
|
1441
1441
|
return { outcome: waiting ? "waiting" : "completed", successors: [] };
|
|
@@ -1549,15 +1549,18 @@ function buildScriptBodyCtx(node, interpolationCtx) {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
return safe;
|
|
1551
1551
|
}
|
|
1552
|
+
var SYSTEM_ONE_DATA_FIELDS = new Set(["state", "questions", "fields", "images"]);
|
|
1552
1553
|
function interpolateNodeConfig(node, interpolationCtx) {
|
|
1553
|
-
if (node.type
|
|
1554
|
-
const
|
|
1555
|
-
const restResult = deepInterpolate(rest, interpolationCtx);
|
|
1554
|
+
if (isSystemOneNodeType(node.type)) {
|
|
1555
|
+
const rest = {};
|
|
1556
1556
|
const dynamic = {};
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1557
|
+
for (const [key, value] of Object.entries(node.config)) {
|
|
1558
|
+
if (SYSTEM_ONE_DATA_FIELDS.has(key))
|
|
1559
|
+
dynamic[key] = value;
|
|
1560
|
+
else
|
|
1561
|
+
rest[key] = value;
|
|
1562
|
+
}
|
|
1563
|
+
const restResult = deepInterpolate(rest, interpolationCtx);
|
|
1561
1564
|
const dynamicResult = deepInterpolate(dynamic, interpolationCtx, { preserveRawTokens: true });
|
|
1562
1565
|
const unresolved = [...restResult.unresolved, ...dynamicResult.unresolved];
|
|
1563
1566
|
return {
|