@desplega.ai/agent-swarm 2.7.5 → 2.7.6
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-g3ads55s.js → acp-adapter-bp91d37f.js} +4 -4
- package/dist/{actions-zwfykqqk.js → actions-yj0eeaqh.js} +18 -17
- package/dist/{amp-adapter-z3s0ssdt.js → amp-adapter-4pg9h34q.js} +1 -1
- package/dist/{app-vmp4fgep.js → app-909e97cr.js} +3 -3
- package/dist/{assistant-vwde653f.js → assistant-qdyb5fyy.js} +24 -22
- package/dist/{boot-reembed-375t7tbk.js → boot-reembed-fk0s9z18.js} +1 -1
- package/dist/{boot-reembed-gq9rcpnj.js → boot-reembed-gs1rzrnh.js} +1 -1
- package/dist/{boot-scrub-sweep-nd938kyf.js → boot-scrub-sweep-4qfd4kfx.js} +2 -2
- package/dist/{boot-seeds-aykx51v3.js → boot-seeds-yr00k13d.js} +4 -4
- package/dist/{boxd-k1j26g3h.js → boxd-vdmfssd9.js} +4 -4
- package/dist/{claude-adapter-8j4hm099.js → claude-adapter-qta1f1xn.js} +3 -3
- package/dist/{claude-managed-setup-0wyynpn1.js → claude-managed-setup-sc6j4dm0.js} +1 -1
- package/dist/{claude-sdk-session-q6wj5hmy.js → claude-sdk-session-zgrz6yvc.js} +9169 -9070
- package/dist/{cli-gjr2y2xk.js → cli-0agcv1v5.js} +4 -1
- package/dist/{cli-vqypxzh4.js → cli-0at8w34w.js} +7 -7
- package/dist/{cli-7a42nfy0.js → cli-0qatpy8q.js} +3 -3
- package/dist/{cli-p599f1qm.js → cli-0yv5z2pg.js} +1 -1
- package/dist/{cli-0gey5fzy.js → cli-386tyxxg.js} +2 -2
- package/dist/{cli-5pag6rmn.js → cli-3ypk9vk1.js} +1 -1
- package/dist/{cli-qxnf8z2z.js → cli-436532ck.js} +2 -2
- package/dist/{cli-z8eh3ex8.js → cli-4necwtsv.js} +4 -4
- package/dist/{cli-zh3fp8v2.js → cli-54t00gt8.js} +1 -1
- package/dist/{cli-hf6zt5m6.js → cli-69szn7w7.js} +17 -1
- package/dist/{cli-nn4d8dne.js → cli-89knwags.js} +2 -2
- package/dist/{cli-spknvxbq.js → cli-8bc1w0tw.js} +10 -10
- package/dist/{cli-rqkxrmgw.js → cli-8snvgs5r.js} +38 -13
- package/dist/{cli-rhw40jgb.js → cli-bjb3z51z.js} +2 -2
- package/dist/{cli-xtjhfmpc.js → cli-c60vetmm.js} +1 -1
- package/dist/{cli-0731hvbw.js → cli-decfb6v8.js} +2 -2
- package/dist/{cli-bhjt02p8.js → cli-drr5v6av.js} +1 -1
- package/dist/{cli-fqzx7gwa.js → cli-dxae2yg7.js} +2 -2
- package/dist/{cli-tqgg40ek.js → cli-e3r2neck.js} +8 -7
- package/dist/{cli-zppwg9p9.js → cli-ekwks2vs.js} +1 -1
- package/dist/{cli-nzxr556s.js → cli-es6va8jk.js} +26 -26
- package/dist/{cli-a47xy8eq.js → cli-faxe6thg.js} +1 -1
- package/dist/cli-gdhpcbhf.js +55 -0
- package/dist/{cli-82jg7fp9.js → cli-he5nxaa8.js} +1 -1
- package/dist/{cli-8veytvbh.js → cli-he9wchme.js} +1 -1
- package/dist/{cli-pywf3eh5.js → cli-hgaazk69.js} +1 -1
- package/dist/{cli-0bxqnvq9.js → cli-hr2e2fft.js} +28 -6
- package/dist/{cli-1ayk1eas.js → cli-k2gzwsj2.js} +135 -26
- package/dist/{cli-xbkdm710.js → cli-kqdg1bsb.js} +3 -3
- package/dist/cli-m2z8jagn.js +12078 -0
- package/dist/{cli-g61qxmge.js → cli-m48g6p95.js} +3 -3
- package/dist/{cli-7wspm5gm.js → cli-nhrvpaj7.js} +20 -4
- package/dist/{cli-afrrppsw.js → cli-nwj0ee2w.js} +2 -2
- package/dist/{cli-3h4nhjn8.js → cli-p5gp8pcx.js} +9 -7
- package/dist/{cli-rm6hqj3z.js → cli-pd7vagab.js} +33 -139
- package/dist/{cli-mjzynrse.js → cli-q0k1w5zd.js} +1 -1
- package/dist/{cli-8hs41zy2.js → cli-rmmmrjkd.js} +1 -1
- package/dist/{cli-kg8hchyg.js → cli-sa02jsqt.js} +1 -1
- package/dist/{cli-1338796d.js → cli-shpbx5ee.js} +142 -98
- package/dist/{cli-82ae98pz.js → cli-svj5090z.js} +2 -2
- package/dist/{cli-bnz7a7qf.js → cli-vvpx3gsx.js} +1 -1
- package/dist/{cli-mmwm7zbf.js → cli-w6dt9ged.js} +1 -1
- package/dist/{cli-wvaawacd.js → cli-waqbxg08.js} +5230 -66
- package/dist/{cli-j3jvnpe8.js → cli-wp9sp1qb.js} +1 -1
- package/dist/{cli-nmbmy64z.js → cli-xbbndvjy.js} +3 -3
- package/dist/{cli-vbyfwh92.js → cli-xds5f77d.js} +2 -2
- package/dist/{cli-7wcyk2s5.js → cli-xnqgpshy.js} +1 -1
- package/dist/{cli-rpm2sgv0.js → cli-xnrwazav.js} +19 -2
- package/dist/{cli-gf5hbmdr.js → cli-yjdgea32.js} +3 -3
- package/dist/{cli-mry0qzym.js → cli-yn4kxs06.js} +123 -10
- package/dist/{cli-hn9hxmz9.js → cli-yx4kfngt.js} +1 -1
- package/dist/{cli-y24sc29k.js → cli-yy3rhsdw.js} +30 -8
- package/dist/{cli-6s7vdcta.js → cli-zbbwez0r.js} +4 -4
- package/dist/{cli-z6jkx23q.js → cli-zm72anhg.js} +9 -9
- package/dist/cli.js +22 -21
- package/dist/{codex-adapter-q6k3gnyg.js → codex-adapter-ayd1fb6h.js} +2 -2
- package/dist/{codex-session-runner-3mwmk3d9.js → codex-session-runner-jesa32xc.js} +2 -2
- package/dist/{commands-evrenjn9.js → commands-hanewgf2.js} +9 -3
- package/dist/{controller-xjp8vswh.js → controller-dt1n3c1q.js} +8 -3
- package/dist/{controllers-connect-pp5jnxvc.js → controllers-connect-xx8x64n5.js} +20 -19
- package/dist/{cursor-adapter-yf47w4t0.js → cursor-adapter-9s4dwwdw.js} +1 -1
- package/dist/{db-zxpw6aht.js → db-3vttcbv4.js} +3 -3
- package/dist/{db-rgfsh91f.js → db-9dv0g1ab.js} +11 -3
- package/dist/{devtools-82fzqra8.js → devtools-qxfgbsqz.js} +1 -1
- package/dist/{dispatcher-smasgws7.js → dispatcher-tx9hd1sv.js} +17 -16
- package/dist/{docker-rrjhaqt9.js → docker-c1a3gqmf.js} +89 -22
- package/dist/{dsh-adapter-ftyy8dnp.js → dsh-adapter-007y4ejs.js} +1 -1
- package/dist/{e2b-qcaj675y.js → e2b-a19d28rz.js} +2 -2
- package/dist/{e2b-w1p0bnpm.js → e2b-we6hs6q5.js} +4 -4
- package/dist/{easter-egg-3d-yyts7p16.js → easter-egg-3d-rgbrqb8s.js} +1 -1
- package/dist/{embedding-space-1z0mbg95.js → embedding-space-ny1e2940.js} +6 -6
- package/dist/{embeddings-ygeg7tm7.js → embeddings-2t386t13.js} +1 -1
- package/dist/{execute-14qhqp4d.js → execute-pksh0ceh.js} +1 -1
- package/dist/{external-channel-ttgrs3sx.js → external-channel-phgmhmd7.js} +2 -2
- package/dist/{fx-adapter-gt6pncj2.js → fx-adapter-fy8rr921.js} +5 -5
- package/dist/{google-generative-ai-yvmdxyxa.js → google-generative-ai-8y3m3k4b.js} +1 -1
- package/dist/{google-vertex-jrtdh9gs.js → google-vertex-w3v98n7b.js} +1 -1
- package/dist/{grok-adapter-sm4m5k4g.js → grok-adapter-q0abvpaj.js} +5 -5
- package/dist/handlers-by3sfxyx.js +32 -0
- package/dist/{heartbeat-qahz4p62.js → heartbeat-kadyek8p.js} +20 -19
- package/dist/{hook-kj3d398m.js → hook-5zs3msf6.js} +2 -2
- package/dist/{hook-4fd5wq5w.js → hook-9k551xnj.js} +2 -2
- package/dist/{http-1ted0j1k.js → http-mhz9vw1f.js} +213 -80
- package/dist/index-4f2pvxae.js +37 -0
- package/dist/index-98gz7tmp.js +30 -0
- package/dist/{index-5rk6rfzr.js → index-fvzke5kx.js} +1 -1
- package/dist/index-k08z2cak.js +33 -0
- package/dist/{index-yqhz88yy.js → index-pxn30mse.js} +8 -8
- package/dist/{index-6rq3r5zb.js → index-q361cg2f.js} +1 -1
- package/dist/{index-7v51awbn.js → index-rvr00sg7.js} +20 -13
- package/dist/{index-q4b917zs.js → index-vdygbq10.js} +1 -1
- package/dist/{keepalive-6cf311t5.js → keepalive-w56f32cg.js} +3 -3
- package/dist/{lead-fjy418cw.js → lead-enq35nqp.js} +31 -30
- package/dist/{maintenance-a4bm1bmt.js → maintenance-7mdgxcea.js} +1 -1
- package/dist/{oauth-refresh-sweep-3h0dfw1k.js → oauth-refresh-sweep-29txy9vk.js} +2 -2
- package/dist/{onboard-myn5hraa.js → onboard-kpsrkarj.js} +4 -4
- package/dist/{opencode-adapter-p2nkb5am.js → opencode-adapter-j25vm3rr.js} +3 -3
- package/dist/{otel-impl-a1a0ef6b.js → otel-impl-6kkct7a8.js} +1 -1
- package/dist/{pi-mono-adapter-rzmpb72a.js → pi-mono-adapter-exhkzhn2.js} +4 -4
- package/dist/{pricing-refresh-83drrnxj.js → pricing-refresh-n2x7jh6k.js} +3 -3
- package/dist/{rbac-roles-s8y6ecb5.js → rbac-roles-81ypx6es.js} +1 -1
- package/dist/{rbac-roles-0fb6e7pj.js → rbac-roles-b5htkjby.js} +2 -2
- package/dist/{render-v2-twmbgrz4.js → render-v2-qn6jmpk4.js} +3 -3
- package/dist/{resume-zfqc36xj.js → resume-wd30wx23.js} +6 -6
- package/dist/{runtime-qwggdpqr.js → runtime-4hsg7h60.js} +1 -1
- package/dist/{session-access-sc9pn9da.js → session-access-5qvfevhk.js} +4 -4
- package/dist/{session-source-backfill-qh07xr8g.js → session-source-backfill-n1czavbr.js} +2 -2
- package/dist/{setup-4fr0m7a1.js → setup-dnb56qy5.js} +3 -3
- package/dist/{virtual-modules-fh4ha15b.js → virtual-modules-76xxv9fs.js} +2 -2
- package/dist/{work-objects-0wr8zxct.js → work-objects-4n21tfkm.js} +20 -19
- package/dist/{worker-follow-up-ktyyazyp.js → worker-follow-up-77hvzxww.js} +17 -16
- package/dist/{worker-0c5tyzqe.js → worker-gg1576j3.js} +31 -30
- package/openapi.json +93 -1
- package/package.json +8 -7
- package/src/be/db/script-runs.ts +23 -0
- package/src/be/db/tasks/read.ts +122 -3
- package/src/be/db-client.ts +8 -5
- package/src/be/db.ts +15 -4
- package/src/be/memory/providers/sqlite-store.ts +49 -12
- package/src/be/migrations/260_runtime_pool_cache.sql +20 -0
- package/src/be/migrations/262_session_visibility_indexes.sql +18 -0
- package/src/be/migrations/263_task_list_filter_index.sql +11 -0
- package/src/be/migrations/264_slack_thread_cover_index.sql +9 -0
- package/src/be/migrations/266_script_runs_source_task.sql +11 -0
- package/src/be/runtime-pools/cache-cleanup.ts +109 -0
- package/src/be/runtime-pools/db.ts +65 -6
- package/src/be/runtime-pools/remote-controller.ts +5 -0
- package/src/be/runtime-pools/supervisor.ts +33 -2
- package/src/be/scripts/typecheck.ts +22 -0
- package/src/be/seed-scripts/catalog/task-failure-audit.ts +5 -1
- package/src/commands/controller.ts +4 -0
- package/src/commands/entrypoint-api-readiness.ts +74 -0
- package/src/http/index.ts +1 -1
- package/src/http/list-total-cache.ts +14 -7
- package/src/http/memory.ts +38 -9
- package/src/http/script-runs.ts +174 -5
- package/src/http/status.ts +10 -2
- package/src/http/tasks.ts +4 -2
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/fx-adapter.ts +1 -1
- package/src/runtime-providers/controller-protocol.ts +14 -1
- package/src/runtime-providers/controller.ts +5 -0
- package/src/runtime-providers/docker.ts +108 -23
- package/src/runtime-providers/types.ts +16 -0
- package/src/script-workflows/workflow-ctx.ts +8 -0
- package/src/scripts-runtime/types/stdlib.d.ts +22 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +22 -0
- package/src/server-user.ts +1 -0
- package/src/slack/commands.ts +5 -1
- package/src/slack/handlers.ts +37 -2
- package/src/slack/left-threads.ts +27 -4
- package/src/tasks/follow-up-redelegation-guard.ts +155 -0
- package/src/tests/claude-artifacts-read-script.test.ts +209 -0
- package/src/tests/db-client.test.ts +21 -0
- package/src/tests/db-task-read-contract.test.ts +8 -2
- package/src/tests/db-task-write-contract.test.ts +5 -1
- package/src/tests/entrypoint-api-readiness.test.ts +416 -210
- package/src/tests/explicit-model-validation.test.ts +14 -8
- package/src/tests/follow-up-redelivery-guard.test.ts +432 -202
- package/src/tests/list-total-cache.test.ts +27 -2
- package/src/tests/memory-fts-populate.test.ts +11 -9
- package/src/tests/memory-retrieval-purge.test.ts +80 -0
- package/src/tests/migration-260-runtime-pool-cache.test.ts +118 -0
- package/src/tests/query-audit-plans.test.ts +27 -0
- package/src/tests/runtime-cache-cleanup.test.ts +367 -0
- package/src/tests/runtime-e2b-pools.test.ts +41 -0
- package/src/tests/runtime-pools-db.test.ts +98 -0
- package/src/tests/runtime-pools-http.test.ts +29 -0
- package/src/tests/runtime-providers-docker.test.ts +253 -0
- package/src/tests/runtime-remote-controller.test.ts +66 -2
- package/src/tests/runtime-supervisor.test.ts +66 -2
- package/src/tests/script-connections.test.ts +11 -0
- package/src/tests/script-runs-http.test.ts +684 -2
- package/src/tests/seed-scripts.test.ts +26 -0
- package/src/tests/slack-leave-thread.test.ts +145 -5
- package/src/tests/slack-render-v2-query-plans.test.ts +24 -2
- package/src/tests/status.test.ts +11 -0
- package/src/tests/tasks-readable-row.test.ts +155 -0
- package/src/tools/send-task.ts +35 -47
- package/src/tools/slack-leave-thread.ts +1 -1
- package/src/tools/task-dedup.ts +45 -21
- package/src/types.ts +38 -0
- package/templates/skills/composio-google-docs/content.md +10 -0
- package/templates/skills/script-workflows/content.md +19 -1
- package/templates/skills/swarm-docs/content.md +1 -0
- package/templates/skills/swarm-scripts/SKILL.md +2 -0
- package/templates/skills/swarm-scripts/content.md +2 -0
- package/dist/cli-dznrgaep.js +0 -30
- package/dist/cli-w3hcrxht.js +0 -6985
- package/dist/handlers-vwmba1m2.js +0 -31
- package/dist/index-5r71rf98.js +0 -32
- package/dist/index-anmwxs87.js +0 -29
- package/dist/index-spp0ra5c.js +0 -36
|
@@ -269,6 +269,8 @@ import {
|
|
|
269
269
|
retirePoolKeyStatus,
|
|
270
270
|
init_api_keys,
|
|
271
271
|
getScriptRunExecutionArgs2,
|
|
272
|
+
getScriptRunFollowUpGuard2,
|
|
273
|
+
setScriptRunFollowUpGuard2,
|
|
272
274
|
updateTaskVcs2,
|
|
273
275
|
upsertAssetKeyMapping2,
|
|
274
276
|
listAssetSummaries2,
|
|
@@ -475,7 +477,7 @@ import {
|
|
|
475
477
|
countScriptRunJournalSteps2,
|
|
476
478
|
countScriptRunJournalAgentTaskSteps2,
|
|
477
479
|
init_db4
|
|
478
|
-
} from "./cli-
|
|
480
|
+
} from "./cli-k2gzwsj2.js";
|
|
479
481
|
import {
|
|
480
482
|
PRIMARY_ROLE_NAMES2,
|
|
481
483
|
getUserGrant2,
|
|
@@ -486,8 +488,8 @@ import {
|
|
|
486
488
|
assertNotLastAdmin2,
|
|
487
489
|
setUserRoles2,
|
|
488
490
|
init_rbac_roles
|
|
489
|
-
} from "./cli-
|
|
490
|
-
import"./cli-
|
|
491
|
+
} from "./cli-rmmmrjkd.js";
|
|
492
|
+
import"./cli-zbbwez0r.js";
|
|
491
493
|
import {
|
|
492
494
|
upsertModelCatalogOverlay,
|
|
493
495
|
deleteModelCatalogOverlay,
|
|
@@ -495,13 +497,14 @@ import {
|
|
|
495
497
|
init_model_catalog_store,
|
|
496
498
|
requestModelCatalogRefresh2,
|
|
497
499
|
init_pricing_refresh
|
|
498
|
-
} from "./cli-
|
|
500
|
+
} from "./cli-89knwags.js";
|
|
499
501
|
import {
|
|
500
502
|
workflowEventBus2,
|
|
501
503
|
init_event_bus
|
|
502
504
|
} from "./cli-wx3rhnm0.js";
|
|
503
|
-
import"./cli-
|
|
505
|
+
import"./cli-w6dt9ged.js";
|
|
504
506
|
import {
|
|
507
|
+
require_dist4,
|
|
505
508
|
getSlackConnectionState,
|
|
506
509
|
init_connection_state,
|
|
507
510
|
getSlackInboundDiagnostics,
|
|
@@ -530,12 +533,12 @@ import {
|
|
|
530
533
|
startSlackApp2,
|
|
531
534
|
stopSlackApp2,
|
|
532
535
|
init_app3
|
|
533
|
-
} from "./cli-
|
|
536
|
+
} from "./cli-waqbxg08.js";
|
|
534
537
|
import {
|
|
535
538
|
retryFailedRun2,
|
|
536
539
|
cancelWorkflowRun2,
|
|
537
540
|
init_resume
|
|
538
|
-
} from "./cli-
|
|
541
|
+
} from "./cli-m48g6p95.js";
|
|
539
542
|
import {
|
|
540
543
|
DEFAULT_NEGOTIATED_PROTOCOL_VERSION,
|
|
541
544
|
SUPPORTED_PROTOCOL_VERSIONS,
|
|
@@ -914,6 +917,9 @@ import {
|
|
|
914
917
|
mergeScheduleTiming,
|
|
915
918
|
validateRecurringTiming,
|
|
916
919
|
init_validate,
|
|
920
|
+
followUpThreadForSourceTask,
|
|
921
|
+
evaluateFollowUpRedelegation,
|
|
922
|
+
init_follow_up_redelegation_guard,
|
|
917
923
|
checkOutputSchemaShape,
|
|
918
924
|
sendTaskOutputSchema,
|
|
919
925
|
sendTaskHandler,
|
|
@@ -941,7 +947,7 @@ import {
|
|
|
941
947
|
getEnabledCapabilities,
|
|
942
948
|
createServer,
|
|
943
949
|
init_server
|
|
944
|
-
} from "./cli-
|
|
950
|
+
} from "./cli-shpbx5ee.js";
|
|
945
951
|
import {
|
|
946
952
|
FilesError,
|
|
947
953
|
normalizeFilesError,
|
|
@@ -973,7 +979,7 @@ import {
|
|
|
973
979
|
resolvePoolDelivery2,
|
|
974
980
|
createPoolAgent2,
|
|
975
981
|
init_db2
|
|
976
|
-
} from "./cli-
|
|
982
|
+
} from "./cli-yn4kxs06.js";
|
|
977
983
|
import {
|
|
978
984
|
duplicateGuardedQueryKey,
|
|
979
985
|
warnIfCorsAllowsAnyOrigin,
|
|
@@ -1027,7 +1033,7 @@ import {
|
|
|
1027
1033
|
describeRequestRoute,
|
|
1028
1034
|
route,
|
|
1029
1035
|
init_route_def
|
|
1030
|
-
} from "./cli-
|
|
1036
|
+
} from "./cli-4necwtsv.js";
|
|
1031
1037
|
import {
|
|
1032
1038
|
startPoolRouting,
|
|
1033
1039
|
stopPoolRouting,
|
|
@@ -1040,13 +1046,13 @@ import {
|
|
|
1040
1046
|
checkHeartbeatChecklist2,
|
|
1041
1047
|
runHeartbeatSweep2,
|
|
1042
1048
|
stopHeartbeat2
|
|
1043
|
-
} from "./cli-
|
|
1044
|
-
import"./cli-
|
|
1049
|
+
} from "./cli-zm72anhg.js";
|
|
1050
|
+
import"./cli-xnrwazav.js";
|
|
1045
1051
|
import {
|
|
1046
1052
|
runtimeSupervisorStatus,
|
|
1047
1053
|
startRuntimeSupervisor,
|
|
1048
1054
|
stopRuntimeSupervisor
|
|
1049
|
-
} from "./cli-
|
|
1055
|
+
} from "./cli-8snvgs5r.js";
|
|
1050
1056
|
import"./cli-ns59dc6r.js";
|
|
1051
1057
|
import {
|
|
1052
1058
|
ACP_TARGET_IDS
|
|
@@ -1067,11 +1073,11 @@ import {
|
|
|
1067
1073
|
isUnknownModelError,
|
|
1068
1074
|
checkProviderPoolKey,
|
|
1069
1075
|
writeSkillsToFilesystem
|
|
1070
|
-
} from "./cli-
|
|
1076
|
+
} from "./cli-bjb3z51z.js";
|
|
1071
1077
|
import {
|
|
1072
1078
|
inviteEmailToSharedOrg,
|
|
1073
1079
|
ensureAgentFsCredentialsForAgent
|
|
1074
|
-
} from "./cli-
|
|
1080
|
+
} from "./cli-xds5f77d.js";
|
|
1075
1081
|
import {
|
|
1076
1082
|
Anthropic
|
|
1077
1083
|
} from "./cli-318r69gq.js";
|
|
@@ -1087,7 +1093,7 @@ import {
|
|
|
1087
1093
|
ampBillsCacheWrites,
|
|
1088
1094
|
resolveAmpModel,
|
|
1089
1095
|
init_amp_models
|
|
1090
|
-
} from "./cli-
|
|
1096
|
+
} from "./cli-q0k1w5zd.js";
|
|
1091
1097
|
import {
|
|
1092
1098
|
RATING_MODEL_MAX_LENGTH,
|
|
1093
1099
|
REFERENCES_SOURCE_MAX_LENGTH,
|
|
@@ -1097,7 +1103,7 @@ import {
|
|
|
1097
1103
|
import {
|
|
1098
1104
|
normalizeModelKey,
|
|
1099
1105
|
init_pricing_normalize
|
|
1100
|
-
} from "./cli-
|
|
1106
|
+
} from "./cli-c60vetmm.js";
|
|
1101
1107
|
import {
|
|
1102
1108
|
require_dist2,
|
|
1103
1109
|
getMcpOAuthToken,
|
|
@@ -1186,7 +1192,7 @@ import {
|
|
|
1186
1192
|
init_typecheck,
|
|
1187
1193
|
parseSkillContent,
|
|
1188
1194
|
init_skill_parser
|
|
1189
|
-
} from "./cli-
|
|
1195
|
+
} from "./cli-hr2e2fft.js";
|
|
1190
1196
|
import {
|
|
1191
1197
|
signalProcessGroup,
|
|
1192
1198
|
detachedProcessGroup,
|
|
@@ -1203,7 +1209,7 @@ import {
|
|
|
1203
1209
|
forceRefreshAuthorizationOrThrow,
|
|
1204
1210
|
forceRefreshTokenOrThrow,
|
|
1205
1211
|
init_ensure_token
|
|
1206
|
-
} from "./cli-
|
|
1212
|
+
} from "./cli-xnqgpshy.js";
|
|
1207
1213
|
import {
|
|
1208
1214
|
automationIntegrationFixUrl,
|
|
1209
1215
|
preflightAutomation,
|
|
@@ -1247,7 +1253,7 @@ import {
|
|
|
1247
1253
|
definitionNodeIds,
|
|
1248
1254
|
validateDefinition,
|
|
1249
1255
|
init_definition2
|
|
1250
|
-
} from "./cli-
|
|
1256
|
+
} from "./cli-8bc1w0tw.js";
|
|
1251
1257
|
import {
|
|
1252
1258
|
_fetchHolder,
|
|
1253
1259
|
CLIENT_ID,
|
|
@@ -1270,10 +1276,8 @@ import {
|
|
|
1270
1276
|
} from "./cli-mdb054w3.js";
|
|
1271
1277
|
import {
|
|
1272
1278
|
require_content_type
|
|
1273
|
-
} from "./cli-
|
|
1274
|
-
import
|
|
1275
|
-
require_dist9
|
|
1276
|
-
} from "./cli-w3hcrxht.js";
|
|
1279
|
+
} from "./cli-yjdgea32.js";
|
|
1280
|
+
import"./cli-gdhpcbhf.js";
|
|
1277
1281
|
import {
|
|
1278
1282
|
isInvalidClientError,
|
|
1279
1283
|
publicEndpointSsrfOptions,
|
|
@@ -1291,11 +1295,11 @@ import {
|
|
|
1291
1295
|
revokeMcpToken,
|
|
1292
1296
|
computeExpiresAt,
|
|
1293
1297
|
init_mcp_wrapper
|
|
1294
|
-
} from "./cli-
|
|
1298
|
+
} from "./cli-hgaazk69.js";
|
|
1295
1299
|
import {
|
|
1296
1300
|
createRuntimeProvider,
|
|
1297
1301
|
init_runtime_providers
|
|
1298
|
-
} from "./cli-
|
|
1302
|
+
} from "./cli-kqdg1bsb.js";
|
|
1299
1303
|
import {
|
|
1300
1304
|
registerSessionTokenConnection,
|
|
1301
1305
|
init_session_token_connections,
|
|
@@ -1322,7 +1326,7 @@ import {
|
|
|
1322
1326
|
revokeAgentTokens,
|
|
1323
1327
|
fingerprintApiKey,
|
|
1324
1328
|
init_users
|
|
1325
|
-
} from "./cli-
|
|
1329
|
+
} from "./cli-drr5v6av.js";
|
|
1326
1330
|
import"./cli-v41kn3cd.js";
|
|
1327
1331
|
import {
|
|
1328
1332
|
setBedrockProviderModule,
|
|
@@ -1332,7 +1336,7 @@ import {
|
|
|
1332
1336
|
import_websocket,
|
|
1333
1337
|
import_websocket_server,
|
|
1334
1338
|
init_wrapper2
|
|
1335
|
-
} from "./cli-
|
|
1339
|
+
} from "./cli-69szn7w7.js";
|
|
1336
1340
|
import {
|
|
1337
1341
|
isRbacEnabled,
|
|
1338
1342
|
decideToolAdmission,
|
|
@@ -1494,7 +1498,7 @@ import {
|
|
|
1494
1498
|
KvKeySchema,
|
|
1495
1499
|
KvEntrySchema,
|
|
1496
1500
|
init_types4
|
|
1497
|
-
} from "./cli-
|
|
1501
|
+
} from "./cli-nhrvpaj7.js";
|
|
1498
1502
|
import {
|
|
1499
1503
|
CODEX_AUTH_FAILURE_BENCH_THRESHOLD,
|
|
1500
1504
|
CODEX_AUTH_WATCH_NAMESPACE,
|
|
@@ -1578,7 +1582,7 @@ import {
|
|
|
1578
1582
|
import {
|
|
1579
1583
|
init_package,
|
|
1580
1584
|
package_default
|
|
1581
|
-
} from "./cli-
|
|
1585
|
+
} from "./cli-e3r2neck.js";
|
|
1582
1586
|
import {
|
|
1583
1587
|
realtimeBus,
|
|
1584
1588
|
init_bus
|
|
@@ -15880,7 +15884,7 @@ async function registerTelegramWebhook() {
|
|
|
15880
15884
|
|
|
15881
15885
|
// src/slack/app-icon.ts
|
|
15882
15886
|
init_app3();
|
|
15883
|
-
var import_web_api = __toESM(
|
|
15887
|
+
var import_web_api = __toESM(require_dist4(), 1);
|
|
15884
15888
|
var TTL_MS = 60 * 60 * 1000;
|
|
15885
15889
|
var REQUEST_TIMEOUT_MS = 2500;
|
|
15886
15890
|
var cached = null;
|
|
@@ -19766,6 +19770,7 @@ function createUserServer(user) {
|
|
|
19766
19770
|
offerMode: false,
|
|
19767
19771
|
leadOnly: false,
|
|
19768
19772
|
allowDuplicate: false,
|
|
19773
|
+
allowRedelegation: false,
|
|
19769
19774
|
overrideSlackContext: false
|
|
19770
19775
|
});
|
|
19771
19776
|
});
|
|
@@ -21375,11 +21380,20 @@ async function handleMemory(req, res, pathSegments, callerAgentId) {
|
|
|
21375
21380
|
var MEMORY_GC_INTERVAL_MS = 60 * 60 * 1000;
|
|
21376
21381
|
var memoryGcTimer = null;
|
|
21377
21382
|
var SEARCH_RETRIEVAL_TTL_DAYS = 90;
|
|
21378
|
-
|
|
21383
|
+
var SEARCH_RETRIEVAL_PURGE_BATCH = 2000;
|
|
21384
|
+
async function purgeStaleSearchRetrievals(batchSize = SEARCH_RETRIEVAL_PURGE_BATCH) {
|
|
21379
21385
|
try {
|
|
21380
21386
|
const cutoff = new Date(Date.now() - SEARCH_RETRIEVAL_TTL_DAYS * 24 * 60 * 60 * 1000).toISOString();
|
|
21381
|
-
|
|
21382
|
-
|
|
21387
|
+
let purged = 0;
|
|
21388
|
+
for (;; ) {
|
|
21389
|
+
const result = await getDbClient2().run(`DELETE FROM memory_retrieval WHERE rowid IN (
|
|
21390
|
+
SELECT rowid FROM memory_retrieval
|
|
21391
|
+
WHERE +eventType = 'search' AND retrievedAt < ? LIMIT ?)`, [cutoff, batchSize]);
|
|
21392
|
+
purged += result.changes;
|
|
21393
|
+
if (result.changes < batchSize)
|
|
21394
|
+
return purged;
|
|
21395
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
21396
|
+
}
|
|
21383
21397
|
} catch (err) {
|
|
21384
21398
|
console.error("[memory-gc] Search retrieval purge failed:", err.message);
|
|
21385
21399
|
return 0;
|
|
@@ -21399,10 +21413,17 @@ async function runMemoryGcTick(label) {
|
|
|
21399
21413
|
console.error(`[memory-gc] ${label} purge failed:`, err);
|
|
21400
21414
|
}
|
|
21401
21415
|
}
|
|
21402
|
-
|
|
21416
|
+
var MEMORY_GC_INITIAL_DELAY_MS = 2 * 60 * 1000;
|
|
21417
|
+
var memoryGcInitialTimer = null;
|
|
21418
|
+
async function startMemoryGc(intervalMs = MEMORY_GC_INTERVAL_MS, initialDelayMs = MEMORY_GC_INITIAL_DELAY_MS) {
|
|
21403
21419
|
if (memoryGcTimer)
|
|
21404
21420
|
return;
|
|
21405
|
-
|
|
21421
|
+
memoryGcInitialTimer = setTimeout(() => {
|
|
21422
|
+
memoryGcInitialTimer = null;
|
|
21423
|
+
runMemoryGcTick("Initial");
|
|
21424
|
+
}, initialDelayMs);
|
|
21425
|
+
if (typeof memoryGcInitialTimer?.unref === "function")
|
|
21426
|
+
memoryGcInitialTimer.unref();
|
|
21406
21427
|
memoryGcTimer = setInterval(() => {
|
|
21407
21428
|
runMemoryGcTick("Periodic");
|
|
21408
21429
|
}, intervalMs);
|
|
@@ -21410,6 +21431,10 @@ async function startMemoryGc(intervalMs = MEMORY_GC_INTERVAL_MS) {
|
|
|
21410
21431
|
memoryGcTimer.unref();
|
|
21411
21432
|
}
|
|
21412
21433
|
function stopMemoryGc() {
|
|
21434
|
+
if (memoryGcInitialTimer) {
|
|
21435
|
+
clearTimeout(memoryGcInitialTimer);
|
|
21436
|
+
memoryGcInitialTimer = null;
|
|
21437
|
+
}
|
|
21413
21438
|
if (memoryGcTimer) {
|
|
21414
21439
|
clearInterval(memoryGcTimer);
|
|
21415
21440
|
memoryGcTimer = null;
|
|
@@ -23056,7 +23081,8 @@ var StatusIdentitySchema = object2({
|
|
|
23056
23081
|
is_cloud: boolean(),
|
|
23057
23082
|
marketing_url: string2().nullable(),
|
|
23058
23083
|
hide_cloud_promo: boolean(),
|
|
23059
|
-
org_id: string2().nullable()
|
|
23084
|
+
org_id: string2().nullable(),
|
|
23085
|
+
dashboard_url: string2().nullable().optional()
|
|
23060
23086
|
});
|
|
23061
23087
|
var StatusActivitySchema = object2({
|
|
23062
23088
|
agents_online: number2().int().nonnegative(),
|
|
@@ -23162,7 +23188,7 @@ async function rollupCredStatusForProvider(provider) {
|
|
|
23162
23188
|
oldestReportAgeMs
|
|
23163
23189
|
};
|
|
23164
23190
|
}
|
|
23165
|
-
function buildIdentity() {
|
|
23191
|
+
function buildIdentity(dashboardUrl) {
|
|
23166
23192
|
const cloudRaw = process.env.SWARM_CLOUD;
|
|
23167
23193
|
const hideRaw = process.env.SWARM_HIDE_CLOUD_PROMO;
|
|
23168
23194
|
return {
|
|
@@ -23172,7 +23198,8 @@ function buildIdentity() {
|
|
|
23172
23198
|
is_cloud: cloudRaw === "true" || cloudRaw === "1",
|
|
23173
23199
|
marketing_url: process.env.SWARM_MARKETING_URL?.trim() || null,
|
|
23174
23200
|
hide_cloud_promo: hideRaw === "true" || hideRaw === "1",
|
|
23175
|
-
org_id: process.env.SWARM_ORG_ID?.trim() || null
|
|
23201
|
+
org_id: process.env.SWARM_ORG_ID?.trim() || null,
|
|
23202
|
+
dashboard_url: dashboardUrl
|
|
23176
23203
|
};
|
|
23177
23204
|
}
|
|
23178
23205
|
function describeRoll(roll) {
|
|
@@ -23474,7 +23501,7 @@ async function buildStatusPayload() {
|
|
|
23474
23501
|
const instance = await getInstanceFeedbackSignals();
|
|
23475
23502
|
return {
|
|
23476
23503
|
runtime_pools: { enabled: isRuntimePoolsEnabled(), supervisor: runtimeSupervisorStatus() },
|
|
23477
|
-
identity: buildIdentity(),
|
|
23504
|
+
identity: buildIdentity(await resolveAppUrl()),
|
|
23478
23505
|
setup,
|
|
23479
23506
|
activity: { ...activity, leads_ready: readyLeads },
|
|
23480
23507
|
agent_fs: {
|
|
@@ -24177,19 +24204,20 @@ var MAX_ENTRIES2 = 500;
|
|
|
24177
24204
|
function filterKey(value) {
|
|
24178
24205
|
return JSON.stringify(value, (_key, v) => v && typeof v === "object" && !Array.isArray(v) ? Object.fromEntries(Object.entries(v).sort(([a], [b]) => a.localeCompare(b))) : v);
|
|
24179
24206
|
}
|
|
24180
|
-
function createListTotalCache(ttlMs = LIST_TOTAL_TTL_MS) {
|
|
24207
|
+
function createListTotalCache(ttlMs = LIST_TOTAL_TTL_MS, firstPageTtlMs = 0) {
|
|
24181
24208
|
const entries = new Map;
|
|
24182
24209
|
return {
|
|
24183
24210
|
get(filters, offset, compute) {
|
|
24184
24211
|
const key = filterKey(filters);
|
|
24185
24212
|
const now = Date.now();
|
|
24186
24213
|
const hit = entries.get(key);
|
|
24187
|
-
|
|
24214
|
+
const maxAge = (offset ?? 0) > 0 ? ttlMs : Math.min(ttlMs, firstPageTtlMs);
|
|
24215
|
+
if (hit && hit.countedAt + maxAge > now)
|
|
24188
24216
|
return hit.total;
|
|
24189
24217
|
if (hit)
|
|
24190
24218
|
entries.delete(key);
|
|
24191
24219
|
const total = compute();
|
|
24192
|
-
entries.set(key, {
|
|
24220
|
+
entries.set(key, { countedAt: now, total });
|
|
24193
24221
|
total.catch(() => {
|
|
24194
24222
|
if (entries.get(key)?.total === total)
|
|
24195
24223
|
entries.delete(key);
|
|
@@ -24335,7 +24363,7 @@ var SupersedeTaskResponseSchema = object2({
|
|
|
24335
24363
|
resumeTaskId: string2().nullable(),
|
|
24336
24364
|
resumeTaskStatus: AgentTaskStatusSchema.optional()
|
|
24337
24365
|
});
|
|
24338
|
-
var taskTotals = createListTotalCache();
|
|
24366
|
+
var taskTotals = createListTotalCache(LIST_TOTAL_TTL_MS, 15000);
|
|
24339
24367
|
var listTasks = route({
|
|
24340
24368
|
method: "get",
|
|
24341
24369
|
path: "/api/tasks",
|
|
@@ -33498,6 +33526,9 @@ function refuseSourceWithSecrets(source) {
|
|
|
33498
33526
|
};
|
|
33499
33527
|
}
|
|
33500
33528
|
|
|
33529
|
+
// src/http/script-runs.ts
|
|
33530
|
+
init_rbac();
|
|
33531
|
+
|
|
33501
33532
|
// src/script-workflows/label-lint.ts
|
|
33502
33533
|
var import_typescript = __toESM(require_typescript2(), 1);
|
|
33503
33534
|
var ITERATION_CALLBACK_METHODS = new Set([
|
|
@@ -33567,6 +33598,7 @@ function lintWorkflowLabels(source) {
|
|
|
33567
33598
|
}
|
|
33568
33599
|
|
|
33569
33600
|
// src/http/script-runs.ts
|
|
33601
|
+
init_follow_up_redelegation_guard();
|
|
33570
33602
|
init_types4();
|
|
33571
33603
|
init_constants3();
|
|
33572
33604
|
init_secret_scrubber();
|
|
@@ -33626,7 +33658,8 @@ var agentTaskBodySchema = object2({
|
|
|
33626
33658
|
allowCustomModel: boolean().optional(),
|
|
33627
33659
|
parentTaskId: string2().uuid().optional(),
|
|
33628
33660
|
requestedByUserId: string2().optional(),
|
|
33629
|
-
outputSchema: record2(string2(), unknown()).optional()
|
|
33661
|
+
outputSchema: record2(string2(), unknown()).optional(),
|
|
33662
|
+
allowRedelegation: boolean().optional()
|
|
33630
33663
|
});
|
|
33631
33664
|
var scriptRunCreatedSchema = object2({
|
|
33632
33665
|
id: string2().uuid(),
|
|
@@ -33792,9 +33825,41 @@ var agentTaskRoute = route({
|
|
|
33792
33825
|
description: "Agent task created or still running",
|
|
33793
33826
|
schema: object2({ taskId: string2(), status: AgentTaskStatusSchema })
|
|
33794
33827
|
},
|
|
33795
|
-
|
|
33828
|
+
403: {
|
|
33829
|
+
description: "Script run belongs to another agent, or the run's agent may not create a child task under parentTaskId"
|
|
33830
|
+
},
|
|
33831
|
+
404: { description: "Script run not found" },
|
|
33832
|
+
409: { description: "Agent task failed, was cancelled, or was superseded" },
|
|
33833
|
+
422: { description: "Blocked by the follow-up re-delegation guard" }
|
|
33796
33834
|
}
|
|
33797
33835
|
});
|
|
33836
|
+
async function stepParentRefusal(runAgentId, parentTaskId) {
|
|
33837
|
+
const parentTask = await getTaskById2(parentTaskId);
|
|
33838
|
+
if (!parentTask)
|
|
33839
|
+
return null;
|
|
33840
|
+
const runAgent = await getAgentById2(runAgentId);
|
|
33841
|
+
const decision = can({
|
|
33842
|
+
principal: { kind: "agent", agentId: runAgentId, isLead: runAgent?.isLead ?? false },
|
|
33843
|
+
verb: "task.parent.attach",
|
|
33844
|
+
resource: {
|
|
33845
|
+
kind: "task",
|
|
33846
|
+
taskId: parentTask.id,
|
|
33847
|
+
requestedByUserId: parentTask.requestedByUserId,
|
|
33848
|
+
creatorAgentId: parentTask.creatorAgentId,
|
|
33849
|
+
agentId: parentTask.agentId
|
|
33850
|
+
},
|
|
33851
|
+
source: "http"
|
|
33852
|
+
});
|
|
33853
|
+
return decision.allow ? null : `You don't have context for parent task ${parentTaskId}. Only its assignee, its creator, or a lead can create a child task under it.`;
|
|
33854
|
+
}
|
|
33855
|
+
async function resolveRunSourceTaskId(req, agentId) {
|
|
33856
|
+
const raw = req.headers["x-source-task-id"];
|
|
33857
|
+
const sourceTaskId = Array.isArray(raw) ? raw[0] : raw;
|
|
33858
|
+
if (!sourceTaskId)
|
|
33859
|
+
return;
|
|
33860
|
+
const task = await getTaskById2(sourceTaskId);
|
|
33861
|
+
return task?.agentId === agentId ? task.id : undefined;
|
|
33862
|
+
}
|
|
33798
33863
|
async function requireAgent(res, agentId) {
|
|
33799
33864
|
if (!agentId) {
|
|
33800
33865
|
jsonError(res, "X-Agent-ID required for script runs API", 400);
|
|
@@ -33872,6 +33937,7 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
|
|
|
33872
33937
|
}
|
|
33873
33938
|
}
|
|
33874
33939
|
const cap = scriptRunConcurrencyCap();
|
|
33940
|
+
const sourceTaskId = await resolveRunSourceTaskId(req, agent.id);
|
|
33875
33941
|
const creation = await getDbClient2().transaction(async () => {
|
|
33876
33942
|
if (await countActiveScriptRuns2() >= cap)
|
|
33877
33943
|
return null;
|
|
@@ -33883,6 +33949,7 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
|
|
|
33883
33949
|
scriptName: parsed.body.scriptName,
|
|
33884
33950
|
idempotencyKey: parsed.body.idempotencyKey,
|
|
33885
33951
|
requestedByUserId: parsed.body.requestedByUserId,
|
|
33952
|
+
sourceTaskId,
|
|
33886
33953
|
createdBy: parsed.body.requestedByUserId
|
|
33887
33954
|
});
|
|
33888
33955
|
});
|
|
@@ -34079,9 +34146,22 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
|
|
|
34079
34146
|
jsonError(res, "Script run not found", 404);
|
|
34080
34147
|
return true;
|
|
34081
34148
|
}
|
|
34149
|
+
if (agentId !== run.agentId) {
|
|
34150
|
+
jsonError(res, "Script run belongs to another agent", 403);
|
|
34151
|
+
return true;
|
|
34152
|
+
}
|
|
34153
|
+
if (parsed.body.parentTaskId) {
|
|
34154
|
+
const refusal = await stepParentRefusal(run.agentId, parsed.body.parentTaskId);
|
|
34155
|
+
if (refusal) {
|
|
34156
|
+
jsonError(res, refusal, 403);
|
|
34157
|
+
return true;
|
|
34158
|
+
}
|
|
34159
|
+
}
|
|
34082
34160
|
const contextKey = `script-run:${run.id}:${parsed.body.stepKey}`;
|
|
34083
34161
|
let task = await getLatestScriptRunStepTaskByContextKey2(contextKey);
|
|
34162
|
+
let dispatchedHere = false;
|
|
34084
34163
|
if (!task) {
|
|
34164
|
+
const taskDescription = parsed.body.template ?? parsed.body.task ?? parsed.body.stepKey;
|
|
34085
34165
|
const modelError = await explicitModelErrorForAgent({
|
|
34086
34166
|
model: parsed.body.model,
|
|
34087
34167
|
allowCustomModel: parsed.body.allowCustomModel,
|
|
@@ -34091,25 +34171,62 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
|
|
|
34091
34171
|
jsonError(res, modelError, 400);
|
|
34092
34172
|
return true;
|
|
34093
34173
|
}
|
|
34174
|
+
const followUpThread = await followUpThreadForSourceTask(run.sourceTaskId);
|
|
34175
|
+
let dispatched;
|
|
34094
34176
|
try {
|
|
34095
|
-
|
|
34096
|
-
|
|
34097
|
-
|
|
34098
|
-
|
|
34099
|
-
|
|
34100
|
-
|
|
34101
|
-
|
|
34102
|
-
|
|
34103
|
-
|
|
34104
|
-
|
|
34105
|
-
|
|
34106
|
-
|
|
34107
|
-
|
|
34108
|
-
|
|
34109
|
-
|
|
34110
|
-
|
|
34111
|
-
|
|
34112
|
-
|
|
34177
|
+
dispatched = await getDbClient2().transaction(async () => {
|
|
34178
|
+
const replayed = await getLatestScriptRunStepTaskByContextKey2(contextKey);
|
|
34179
|
+
if (replayed)
|
|
34180
|
+
return { task: replayed };
|
|
34181
|
+
let override;
|
|
34182
|
+
if (followUpThread) {
|
|
34183
|
+
const decision = await getScriptRunFollowUpGuard2(run.id);
|
|
34184
|
+
if (decision !== "passed") {
|
|
34185
|
+
const blocked = decision === null ? await evaluateFollowUpRedelegation({
|
|
34186
|
+
...followUpThread,
|
|
34187
|
+
creatorAgentId: run.agentId,
|
|
34188
|
+
taskDescription,
|
|
34189
|
+
targetAgentId: parsed.body.agentId
|
|
34190
|
+
}) : {
|
|
34191
|
+
rule: decision,
|
|
34192
|
+
message: `Blocked by the follow-up re-delegation guard (${decision} rule): an earlier step of this script run was blocked, and a run counts as one dispatch. If it must run, pass allowRedelegation: true.`
|
|
34193
|
+
};
|
|
34194
|
+
if (blocked && !parsed.body.allowRedelegation) {
|
|
34195
|
+
if (decision === null)
|
|
34196
|
+
await setScriptRunFollowUpGuard2(run.id, blocked.rule);
|
|
34197
|
+
return { blocked };
|
|
34198
|
+
}
|
|
34199
|
+
override = blocked?.rule;
|
|
34200
|
+
await setScriptRunFollowUpGuard2(run.id, "passed");
|
|
34201
|
+
}
|
|
34202
|
+
}
|
|
34203
|
+
const created = await createTaskExtended2(taskDescription, {
|
|
34204
|
+
agentId: parsed.body.agentId,
|
|
34205
|
+
routingReason: parsed.body.routingReason ?? (parsed.body.agentId ? "human_pinned" : undefined),
|
|
34206
|
+
routingNote: parsed.body.routingNote,
|
|
34207
|
+
routingSource: parsed.body.routingReason ? "declared" : parsed.body.agentId ? "engine_default" : undefined,
|
|
34208
|
+
tags: parsed.body.tags,
|
|
34209
|
+
priority: parsed.body.priority,
|
|
34210
|
+
dependsOn: parsed.body.dependsOn,
|
|
34211
|
+
offeredTo: parsed.body.offerMode ? parsed.body.agentId : undefined,
|
|
34212
|
+
taskType: "script-run-step",
|
|
34213
|
+
source: "mcp",
|
|
34214
|
+
creatorAgentId: run.agentId,
|
|
34215
|
+
sourceTaskId: run.sourceTaskId,
|
|
34216
|
+
...followUpThread ? {
|
|
34217
|
+
slackChannelId: followUpThread.channelId,
|
|
34218
|
+
slackThreadTs: followUpThread.threadTs,
|
|
34219
|
+
slackUserId: followUpThread.userId
|
|
34220
|
+
} : {},
|
|
34221
|
+
dir: parsed.body.dir,
|
|
34222
|
+
vcsRepo: parsed.body.vcsRepo,
|
|
34223
|
+
model: parsed.body.model,
|
|
34224
|
+
parentTaskId: parsed.body.parentTaskId,
|
|
34225
|
+
requestedByUserId: parsed.body.requestedByUserId ?? run.requestedByUserId,
|
|
34226
|
+
outputSchema: parsed.body.outputSchema,
|
|
34227
|
+
contextKey
|
|
34228
|
+
});
|
|
34229
|
+
return { task: created, created: true, override };
|
|
34113
34230
|
});
|
|
34114
34231
|
} catch (error) {
|
|
34115
34232
|
if (error instanceof ExtensionAgentAssignmentError2) {
|
|
@@ -34118,6 +34235,22 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
|
|
|
34118
34235
|
}
|
|
34119
34236
|
throw error;
|
|
34120
34237
|
}
|
|
34238
|
+
if (dispatched.override) {
|
|
34239
|
+
console.log(`[script-runs] follow-up re-delegation override: rule=${dispatched.override} runId=${run.id} creatorAgentId=${run.agentId} sourceTaskId=${run.sourceTaskId} thread=${followUpThread?.channelId}/${followUpThread?.threadTs}`);
|
|
34240
|
+
}
|
|
34241
|
+
if (!dispatched.task) {
|
|
34242
|
+
json(res, { error: dispatched.blocked.message, rule: dispatched.blocked.rule }, 422);
|
|
34243
|
+
return true;
|
|
34244
|
+
}
|
|
34245
|
+
task = dispatched.task;
|
|
34246
|
+
dispatchedHere = dispatched.created === true;
|
|
34247
|
+
}
|
|
34248
|
+
if (!dispatchedHere && task.parentTaskId) {
|
|
34249
|
+
const refusal = await stepParentRefusal(run.agentId, task.parentTaskId);
|
|
34250
|
+
if (refusal) {
|
|
34251
|
+
jsonError(res, refusal, 403);
|
|
34252
|
+
return true;
|
|
34253
|
+
}
|
|
34121
34254
|
}
|
|
34122
34255
|
const deadline = Date.now() + 30000;
|
|
34123
34256
|
while (Date.now() < deadline) {
|
|
@@ -42912,7 +43045,7 @@ var httpServer = createHttpServer(async (req, res) => {
|
|
|
42912
43045
|
});
|
|
42913
43046
|
});
|
|
42914
43047
|
var detachRealtime = attachRealtimeTransport(httpServer);
|
|
42915
|
-
var { attachControllerTransport } = await import("./controllers-connect-
|
|
43048
|
+
var { attachControllerTransport } = await import("./controllers-connect-xx8x64n5.js");
|
|
42916
43049
|
var detachControllers = attachControllerTransport(httpServer);
|
|
42917
43050
|
var stopWorkerNudges = startWorkerNudgeListener();
|
|
42918
43051
|
var stopRoomDeletion = realtimeBus.subscribe("room:namespace-deleted", (namespace) => {
|
|
@@ -42941,7 +43074,7 @@ async function shutdown() {
|
|
|
42941
43074
|
sessionsProcessed: getServerSessionsProcessed()
|
|
42942
43075
|
});
|
|
42943
43076
|
if (hasCapability("scheduling")) {
|
|
42944
|
-
const { stopScheduler } = await import("./index-
|
|
43077
|
+
const { stopScheduler } = await import("./index-k08z2cak.js");
|
|
42945
43078
|
stopScheduler();
|
|
42946
43079
|
}
|
|
42947
43080
|
stopHeartbeat2();
|
|
@@ -42953,7 +43086,7 @@ async function shutdown() {
|
|
|
42953
43086
|
await stopSlackApp2();
|
|
42954
43087
|
await stopChatSdk();
|
|
42955
43088
|
if (!isEnvFlagEnabled("OAUTH_KEEPALIVE_DISABLE", false)) {
|
|
42956
|
-
const { stopOAuthKeepalive } = await import("./keepalive-
|
|
43089
|
+
const { stopOAuthKeepalive } = await import("./keepalive-w56f32cg.js");
|
|
42957
43090
|
await stopOAuthKeepalive();
|
|
42958
43091
|
}
|
|
42959
43092
|
stopOAuthPendingGc();
|
|
@@ -43035,21 +43168,21 @@ try {
|
|
|
43035
43168
|
console.warn("[startup] CAPABILITIES upgrade seed failed (non-fatal):", err);
|
|
43036
43169
|
}
|
|
43037
43170
|
try {
|
|
43038
|
-
const { ensurePricingSeeded } = await import("./boot-seeds-
|
|
43171
|
+
const { ensurePricingSeeded } = await import("./boot-seeds-yr00k13d.js");
|
|
43039
43172
|
ensurePricingSeeded();
|
|
43040
|
-
const { startPricingRefreshLoop } = await import("./pricing-refresh-
|
|
43173
|
+
const { startPricingRefreshLoop } = await import("./pricing-refresh-n2x7jh6k.js");
|
|
43041
43174
|
startPricingRefreshLoop();
|
|
43042
43175
|
} catch (err) {
|
|
43043
43176
|
console.error("[startup] Failed to seed pricing rows:", err);
|
|
43044
43177
|
}
|
|
43045
43178
|
try {
|
|
43046
|
-
const { ensureModelProfilesSeeded } = await import("./boot-seeds-
|
|
43179
|
+
const { ensureModelProfilesSeeded } = await import("./boot-seeds-yr00k13d.js");
|
|
43047
43180
|
await ensureModelProfilesSeeded();
|
|
43048
43181
|
} catch (err) {
|
|
43049
43182
|
console.error("[startup] Failed to seed model profiles:", err);
|
|
43050
43183
|
}
|
|
43051
43184
|
try {
|
|
43052
|
-
const { ensureRbacSeeded } = await import("./boot-seeds-
|
|
43185
|
+
const { ensureRbacSeeded } = await import("./boot-seeds-yr00k13d.js");
|
|
43053
43186
|
ensureRbacSeeded();
|
|
43054
43187
|
} catch (err) {
|
|
43055
43188
|
console.error("[startup] Failed to sync RBAC seed rows:", err);
|
|
@@ -43057,7 +43190,7 @@ try {
|
|
|
43057
43190
|
throw err;
|
|
43058
43191
|
}
|
|
43059
43192
|
try {
|
|
43060
|
-
const { runAllSeeders } = await import("./index-
|
|
43193
|
+
const { runAllSeeders } = await import("./index-rvr00sg7.js");
|
|
43061
43194
|
await runAllSeeders({ scriptEmbeddingMode: "skip" });
|
|
43062
43195
|
} catch (err) {
|
|
43063
43196
|
console.error("[startup] Failed to seed built-in entities:", err);
|
|
@@ -43120,26 +43253,26 @@ httpServer.listen(port, async () => {
|
|
|
43120
43253
|
await initWorkflows2();
|
|
43121
43254
|
await startScriptRunSupervisor(getMcpBaseUrl());
|
|
43122
43255
|
if (hasCapability("scheduling")) {
|
|
43123
|
-
const { startScheduler } = await import("./index-
|
|
43124
|
-
const { getExecutorRegistry } = await import("./index-
|
|
43256
|
+
const { startScheduler } = await import("./index-k08z2cak.js");
|
|
43257
|
+
const { getExecutorRegistry } = await import("./index-4f2pvxae.js");
|
|
43125
43258
|
const intervalMs = Number(process.env.SCHEDULER_INTERVAL_MS) || 1e4;
|
|
43126
43259
|
startScheduler(getExecutorRegistry(), intervalMs, {
|
|
43127
43260
|
runId: globalState.__runId
|
|
43128
43261
|
});
|
|
43129
43262
|
}
|
|
43130
43263
|
if (!isEnvFlagEnabled("HEARTBEAT_DISABLE", false)) {
|
|
43131
|
-
const { startHeartbeat } = await import("./index-
|
|
43264
|
+
const { startHeartbeat } = await import("./index-98gz7tmp.js");
|
|
43132
43265
|
const heartbeatMs = Number(process.env.HEARTBEAT_INTERVAL_MS) || 90000;
|
|
43133
43266
|
startHeartbeat(heartbeatMs);
|
|
43134
43267
|
}
|
|
43135
43268
|
startPoolRouting();
|
|
43136
43269
|
startRuntimeSupervisor();
|
|
43137
43270
|
if (!isEnvFlagEnabled("OAUTH_KEEPALIVE_DISABLE", false)) {
|
|
43138
|
-
const { startOAuthKeepalive } = await import("./keepalive-
|
|
43271
|
+
const { startOAuthKeepalive } = await import("./keepalive-w56f32cg.js");
|
|
43139
43272
|
startOAuthKeepalive();
|
|
43140
43273
|
}
|
|
43141
43274
|
if (!isEnvFlagEnabled("OAUTH_REFRESH_SWEEP_DISABLE", false)) {
|
|
43142
|
-
const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-
|
|
43275
|
+
const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-29txy9vk.js");
|
|
43143
43276
|
startOAuthRefreshSweep();
|
|
43144
43277
|
}
|
|
43145
43278
|
startOAuthPendingGc();
|
|
@@ -43148,16 +43281,16 @@ httpServer.listen(port, async () => {
|
|
|
43148
43281
|
await startDbRetention();
|
|
43149
43282
|
startHumanFreeDrain();
|
|
43150
43283
|
startTaskSearchBackfill();
|
|
43151
|
-
import("./embedding-space-
|
|
43284
|
+
import("./embedding-space-ny1e2940.js").then(({ runEmbeddingMaintenance, setDeploymentEnvReader }) => {
|
|
43152
43285
|
setDeploymentEnvReader(getDeploymentEnvValue);
|
|
43153
43286
|
return runEmbeddingMaintenance({ backfill: true });
|
|
43154
43287
|
}).catch((err) => {
|
|
43155
43288
|
console.error("[embedding-space] startup maintenance failed (non-fatal):", err);
|
|
43156
43289
|
});
|
|
43157
|
-
import("./boot-scrub-sweep-
|
|
43290
|
+
import("./boot-scrub-sweep-4qfd4kfx.js").then(({ runBootScrubSweep }) => runBootScrubSweep()).catch((err) => {
|
|
43158
43291
|
console.error("[boot-scrub-sweep] startup scrub failed (non-fatal):", err);
|
|
43159
43292
|
});
|
|
43160
|
-
import("./session-source-backfill-
|
|
43293
|
+
import("./session-source-backfill-n1czavbr.js").then(({ runSessionSourceBackfill }) => runSessionSourceBackfill()).catch((err) => {
|
|
43161
43294
|
console.error("[session-source-backfill] startup run failed (non-fatal):", err);
|
|
43162
43295
|
});
|
|
43163
43296
|
}).on("error", (err) => {
|