@desplega.ai/agent-swarm 2.7.2 → 2.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/{acp-adapter-624yge7a.js → acp-adapter-pdzw76ja.js} +1 -1
- package/dist/{actions-rd9xn281.js → actions-a90cfpca.js} +21 -21
- package/dist/{amp-adapter-k27hc00p.js → amp-adapter-4vtywcjk.js} +2 -2
- package/dist/{app-sjm3xc7g.js → app-8k68gygk.js} +3 -3
- package/dist/{assistant-6jbzs8wa.js → assistant-ck01q2yg.js} +32 -21
- package/dist/{boot-reembed-e2348eqc.js → boot-reembed-33spavpd.js} +1 -1
- package/dist/{boot-reembed-w53pd5xt.js → boot-reembed-xzge83a2.js} +1 -1
- package/dist/{boot-scrub-sweep-cpy4yg97.js → boot-scrub-sweep-mxvb8dr3.js} +3 -3
- package/dist/{boot-seeds-f6j4t6k6.js → boot-seeds-rpm8bb5r.js} +4 -4
- package/dist/{claude-adapter-v3ac8esd.js → claude-adapter-q12bcfj9.js} +3 -3
- package/dist/{claude-managed-setup-yyrkqvtm.js → claude-managed-setup-11vb6q89.js} +1 -1
- package/dist/{claude-sdk-session-85j69v6d.js → claude-sdk-session-gkv1107j.js} +10325 -10243
- package/dist/{cli-rs59z1qx.js → cli-07pcqwaj.js} +1 -1
- package/dist/{cli-6vq3ymqm.js → cli-0tkm519n.js} +1 -1
- package/dist/{cli-s7cm1927.js → cli-0xzbk52h.js} +4 -4
- package/dist/{cli-g0zc1b40.js → cli-0zae6bs6.js} +2 -2
- package/dist/{cli-p8yrsmfn.js → cli-10kjx0dm.js} +1 -1
- package/dist/{cli-7xsq63pe.js → cli-157ykn37.js} +10 -9
- package/dist/{cli-vjcj9k2p.js → cli-2h0rfmqk.js} +1 -1
- package/dist/{cli-9wasax9f.js → cli-35nzvqaf.js} +1 -1
- package/dist/{cli-e1p7dqe1.js → cli-4aydmmdy.js} +24 -3
- package/dist/{cli-942pp3bc.js → cli-54ax65rn.js} +3 -3
- package/dist/{cli-10cp92df.js → cli-5ke7gxwr.js} +6 -6
- package/dist/{cli-femw4q81.js → cli-6151a7dr.js} +2 -2
- package/dist/{cli-3cywb44q.js → cli-77eq8txs.js} +85 -3
- package/dist/{cli-atpfk4yd.js → cli-7cwrwb5x.js} +5 -5
- package/dist/{cli-bfbpvccx.js → cli-8a1k6mat.js} +61 -49
- package/dist/{cli-c18941tx.js → cli-8ch3b2r7.js} +3 -3
- package/dist/{cli-rs2s1t05.js → cli-9fk56y8c.js} +4 -4
- package/dist/{cli-0wx63vvw.js → cli-9km88w11.js} +1 -1
- package/dist/{cli-qy0z3mfj.js → cli-9vttw9nz.js} +56 -46
- package/dist/{cli-mzgppb7q.js → cli-a0w50zw9.js} +4 -4
- package/dist/{cli-z8a4mfz1.js → cli-aqp59jmv.js} +4 -4
- package/dist/{cli-5d8wd50e.js → cli-bs0fwb23.js} +1 -1
- package/dist/{cli-fa4kxxx3.js → cli-ct5920jb.js} +2 -2
- package/dist/{cli-0awbtmv2.js → cli-dek8hqjc.js} +10 -10
- package/dist/{cli-qp6adcmw.js → cli-e24w2mvk.js} +1 -1
- package/dist/{cli-t3npd8hm.js → cli-ghfhn1qc.js} +1 -1
- package/dist/{cli-jmcf8cnz.js → cli-ja369zab.js} +1 -1
- package/dist/{cli-wtjg6je3.js → cli-jhh7tbx6.js} +1 -1
- package/dist/{cli-e19bgatr.js → cli-jmk31131.js} +2 -2
- package/dist/{cli-2cj8fqv1.js → cli-kjcdzea8.js} +1 -1
- package/dist/{cli-1xpr5992.js → cli-kjha1q9k.js} +3 -3
- package/dist/{cli-9jfty8px.js → cli-ktcdczth.js} +538 -30
- package/dist/{cli-exd52qn4.js → cli-mcmpbpcc.js} +2 -2
- package/dist/{cli-2m2p3snc.js → cli-mmf43vcp.js} +6 -6
- package/dist/{cli-b2rhbaty.js → cli-pnm99spe.js} +10 -10
- package/dist/{cli-9jn9cj0q.js → cli-v9jk2k63.js} +1 -1
- package/dist/{cli-mt7bxjfd.js → cli-vhgcwppn.js} +1 -1
- package/dist/{cli-qa4hgda3.js → cli-vvz64zc5.js} +14 -13
- package/dist/{cli-txr0z97c.js → cli-wmhajw68.js} +171 -32
- package/dist/{cli-hzrmv8pg.js → cli-x38rmhap.js} +3 -3
- package/dist/{cli-hq9hd4hp.js → cli-xz6qjdqj.js} +1 -1
- package/dist/{cli-g9ypd5en.js → cli-z52gq55b.js} +4 -0
- package/dist/{cli-2qbmjfta.js → cli-z6219sd3.js} +4 -4
- package/dist/cli.js +19 -19
- package/dist/{codex-adapter-zm1bkdde.js → codex-adapter-46kbvvkx.js} +1 -1
- package/dist/{codex-hook-tkag7fxq.js → codex-hook-tm9ecrd5.js} +1 -1
- package/dist/{codex-session-runner-8k02mqw2.js → codex-session-runner-qy93hdrv.js} +1 -1
- package/dist/{commands-nw1dn4av.js → commands-hwdhacfx.js} +2 -2
- package/dist/{controller-3kkkmps0.js → controller-hjza5p1f.js} +3 -3
- package/dist/{controllers-connect-n2c4167r.js → controllers-connect-7m25cay2.js} +20 -20
- package/dist/{cursor-adapter-h5028emw.js → cursor-adapter-1qh7ps8w.js} +1 -1
- package/dist/{db-76y2msnf.js → db-w23k9301.js} +2 -2
- package/dist/{db-8rk0p8j1.js → db-wm8by383.js} +3 -3
- package/dist/{dispatcher-xp4wsx30.js → dispatcher-en25ebgc.js} +18 -18
- package/dist/{dsh-adapter-vyrr31bn.js → dsh-adapter-zkme32vd.js} +1 -1
- package/dist/{e2b-eesfj689.js → e2b-9z9mvt2p.js} +1 -1
- package/dist/{e2b-03nha1wz.js → e2b-yhvn70es.js} +1 -1
- package/dist/{embedding-space-ejefyep1.js → embedding-space-rgf4aypt.js} +6 -6
- package/dist/{embeddings-w297xaw0.js → embeddings-z9cmxhx1.js} +1 -1
- package/dist/{external-channel-mf9vp1fe.js → external-channel-g6vv85zv.js} +2 -2
- package/dist/{grok-adapter-mpzyyprz.js → grok-adapter-f6n1tpq3.js} +2 -2
- package/dist/handlers-ss5948rq.js +42 -0
- package/dist/{heartbeat-qnaycjzs.js → heartbeat-5xcdzz45.js} +21 -21
- package/dist/{hook-h6sqfzxr.js → hook-6423rme3.js} +2 -2
- package/dist/{hook-4zqdgea4.js → hook-8dk1csdd.js} +4 -4
- package/dist/{http-65ts210h.js → http-6mfh2ww9.js} +255 -60
- package/dist/{index-sqe7f6mj.js → index-0js6bgff.js} +1 -1
- package/dist/{index-farm1zsn.js → index-0ng1dd1t.js} +10937 -9527
- package/dist/{index-k3ewf1jg.js → index-5eyn1wc5.js} +18 -18
- package/dist/{index-vp4wa3qn.js → index-71gnebsn.js} +18 -18
- package/dist/{index-hdfad00b.js → index-q5gzpjdd.js} +12 -10
- package/dist/index-z3b1vfjx.js +44 -0
- package/dist/{keepalive-52k6skha.js → keepalive-cymckeg6.js} +3 -3
- package/dist/{lead-y9rj0gr1.js → lead-baknj2dh.js} +29 -29
- package/dist/{maintenance-f86wqfq6.js → maintenance-dfrnsx3n.js} +1 -1
- package/dist/{oauth-refresh-sweep-vddv9ky7.js → oauth-refresh-sweep-5dztk8x6.js} +2 -2
- package/dist/{onboard-8z2qk6gq.js → onboard-h36vja6y.js} +11 -6
- package/dist/{otel-impl-epet9j18.js → otel-impl-jerq8vz8.js} +1 -1
- package/dist/{pricing-refresh-6wm42a51.js → pricing-refresh-t3nx5krn.js} +3 -3
- package/dist/{rbac-roles-2kfcs1sc.js → rbac-roles-dw1awawd.js} +2 -2
- package/dist/{rbac-roles-13a0vj6d.js → rbac-roles-km0fc3e8.js} +1 -1
- package/dist/{registry-ajhexe44.js → registry-hzfh268v.js} +1 -1
- package/dist/{render-v2-cy8zsfsf.js → render-v2-65x4ayj8.js} +3 -3
- package/dist/{resume-c783qe6b.js → resume-61znk3hj.js} +6 -6
- package/dist/{session-access-s4tv0az8.js → session-access-4yc9htrg.js} +4 -4
- package/dist/{session-source-backfill-qzapz0ne.js → session-source-backfill-kr5bdjtp.js} +2 -2
- package/dist/{setup-st7htx1k.js → setup-9h61yr2p.js} +1 -1
- package/dist/{work-objects-ftj4zw70.js → work-objects-x7rb53qn.js} +27 -22
- package/dist/{worker-859fk25k.js → worker-7f3khgn0.js} +29 -29
- package/openapi.json +134 -3
- package/package.json +5 -5
- package/src/be/db/agents.ts +16 -1
- package/src/be/db/runtime.ts +25 -15
- package/src/be/db/session-summaries.ts +120 -0
- package/src/be/db/tasks/read.ts +7 -4
- package/src/be/db/tasks/search-index.ts +159 -0
- package/src/be/db/tasks/write.ts +3 -0
- package/src/be/db-queries/slack-inbound.ts +77 -0
- package/src/be/db.ts +27 -8
- package/src/be/mcp-overflow-sweep.ts +39 -0
- package/src/be/migrations/253_session_summaries.sql +300 -0
- package/src/be/migrations/254_query_audit_indexes.sql +25 -0
- package/src/be/migrations/256_agent_slack_icon.sql +2 -0
- package/src/be/migrations/257_agent_tasks_fts.sql +55 -0
- package/src/comb/config.ts +6 -2
- package/src/comb/requester.ts +69 -0
- package/src/comb/review-batch.ts +24 -2
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/onboard/compose-generator.ts +7 -2
- package/src/commands/onboard/env-generator.ts +8 -3
- package/src/commands/runner.ts +41 -24
- package/src/fs/agent-fs-provider.ts +9 -0
- package/src/heartbeat/heartbeat.ts +13 -6
- package/src/http/agents.ts +10 -2
- package/src/http/index.ts +15 -0
- package/src/http/integrations.ts +20 -0
- package/src/http/list-total-cache.ts +62 -0
- package/src/http/sessions.ts +9 -2
- package/src/http/slack-inbound.ts +1 -0
- package/src/http/status.ts +4 -1
- package/src/http/tasks.ts +12 -2
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/queue-stall-alarm.ts +4 -1
- package/src/slack/actions.ts +2 -2
- package/src/slack/app-icon.ts +50 -0
- package/src/slack/app.ts +13 -1
- package/src/slack/assistant.ts +22 -1
- package/src/slack/event-dedup.test.ts +11 -0
- package/src/slack/event-dedup.ts +8 -4
- package/src/slack/inbound-dispatch.ts +58 -0
- package/src/slack/render-v2.ts +7 -8
- package/src/slack/responses.ts +21 -8
- package/src/slack/socket-ack.ts +237 -0
- package/src/slack/thread-buffer.ts +3 -5
- package/src/slack/watcher.ts +2 -2
- package/src/slack/work-objects.ts +5 -1
- package/src/tests/agent-fs-release-notes.test.ts +40 -0
- package/src/tests/agent-slack-icon.test.ts +85 -0
- package/src/tests/approval-cancellation-migration.test.ts +2 -0
- package/src/tests/asset-key-migration.test.ts +26 -0
- package/src/tests/comb-default.test.ts +159 -0
- package/src/tests/comb-review-batch.test.ts +192 -4
- package/src/tests/comb-status.test.ts +65 -2
- package/src/tests/db-agents.test.ts +13 -0
- package/src/tests/db-tasks-read.test.ts +10 -15
- package/src/tests/deploy-one-box.test.ts +161 -0
- package/src/tests/deploy-stubs.ts +68 -0
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/e2e-codex-auth-chain.test.ts +18 -1
- package/src/tests/fixtures/deploy-stubs/bun +3 -0
- package/src/tests/fixtures/deploy-stubs/bunx +27 -0
- package/src/tests/fixtures/deploy-stubs/curl +26 -0
- package/src/tests/fixtures/deploy-stubs/docker +122 -0
- package/src/tests/fixtures/onboard/content.compose.yml.txt +5 -5
- package/src/tests/fixtures/onboard/dev.compose.yml.txt +4 -4
- package/src/tests/fixtures/onboard/full-all.compose.yml.txt +12 -12
- package/src/tests/fixtures/onboard/full.compose.yml.txt +12 -12
- package/src/tests/fixtures/onboard/research.compose.yml.txt +4 -4
- package/src/tests/fixtures/onboard/solo.compose.yml.txt +2 -2
- package/src/tests/heartbeat-expiry.test.ts +151 -25
- package/src/tests/http-api-integration.test.ts +31 -0
- package/src/tests/human-free-reclassify.test.ts +6 -0
- package/src/tests/install-sh-bind.test.ts +242 -0
- package/src/tests/install-sh-tunnel.test.ts +89 -0
- package/src/tests/kv-storage.test.ts +28 -0
- package/src/tests/list-endpoint-slimming.test.ts +3 -0
- package/src/tests/list-total-cache.test.ts +63 -0
- package/src/tests/mcp-overflow-sweep.test.ts +84 -0
- package/src/tests/onboard-compose.test.ts +17 -3
- package/src/tests/onboard-env.test.ts +13 -0
- package/src/tests/onboarding.test.ts +1 -1
- package/src/tests/preload.ts +1 -0
- package/src/tests/query-audit-plans.test.ts +314 -0
- package/src/tests/script-connections.test.ts +6 -0
- package/src/tests/session-summaries.test.ts +384 -0
- package/src/tests/sessions-tree.test.ts +5 -1
- package/src/tests/slack-app-icon.test.ts +90 -0
- package/src/tests/slack-external-channel-egress.test.ts +1 -1
- package/src/tests/slack-inbound-receipts.test.ts +34 -0
- package/src/tests/slack-inline-output.test.ts +29 -2
- package/src/tests/slack-render-v2-query-plans.test.ts +3 -2
- package/src/tests/slack-render-v2.test.ts +35 -0
- package/src/tests/slack-socket-ack.test.ts +553 -0
- package/src/tests/task-lineage.test.ts +3 -0
- package/src/tests/task-search-filter.test.ts +4 -4
- package/src/tests/task-search-fts.test.ts +320 -0
- package/src/tests/update-profile-auth.test.ts +28 -0
- package/src/tools/get-swarm.ts +1 -0
- package/src/tools/get-tasks.ts +6 -1
- package/src/tools/join-swarm.ts +1 -0
- package/src/tools/my-agent-info.ts +1 -0
- package/src/tools/slack-post.ts +2 -2
- package/src/tools/slack-reply.ts +2 -2
- package/src/tools/slack-start-thread.ts +2 -2
- package/src/tools/slack-update.ts +1 -1
- package/src/tools/update-profile.ts +20 -4
- package/src/tools/utils.ts +3 -4
- package/src/types.ts +47 -0
- package/src/utils/constants.ts +127 -5
- package/templates/official/lead/HEARTBEAT.md +4 -2
- package/templates/official/lead/config.json +2 -2
- package/templates/skills/swarm-docs/content.md +2 -0
- package/dist/handlers-7x8sywgr.js +0 -42
- package/dist/index-mc30r1hs.js +0 -44
|
@@ -68,6 +68,7 @@ import {
|
|
|
68
68
|
listExtensionRuns,
|
|
69
69
|
SDK_ALLOWLIST,
|
|
70
70
|
mcpToolNameForSdkMethod,
|
|
71
|
+
MCP_OVERFLOW_NAMESPACE,
|
|
71
72
|
mcpOverflowAuthError,
|
|
72
73
|
hasKvViewArgs,
|
|
73
74
|
resolveKvView,
|
|
@@ -297,7 +298,7 @@ import {
|
|
|
297
298
|
hasCapability,
|
|
298
299
|
getEnabledCapabilities,
|
|
299
300
|
createServer
|
|
300
|
-
} from "./cli-
|
|
301
|
+
} from "./cli-9vttw9nz.js";
|
|
301
302
|
import {
|
|
302
303
|
chatThreadOfContextKey,
|
|
303
304
|
agentContextKey,
|
|
@@ -405,6 +406,9 @@ import {
|
|
|
405
406
|
recordApprovalVotes2,
|
|
406
407
|
getPendingApprovalsForTasks2,
|
|
407
408
|
computeContentHash2,
|
|
409
|
+
startTaskSearchBackfill,
|
|
410
|
+
stopTaskSearchBackfill,
|
|
411
|
+
init_search_index,
|
|
408
412
|
getTaskById2,
|
|
409
413
|
TASK_LINEAGE_LIMITS2,
|
|
410
414
|
getTaskLineage2,
|
|
@@ -748,6 +752,7 @@ import {
|
|
|
748
752
|
hasFirstCompletedTask2,
|
|
749
753
|
getKv2,
|
|
750
754
|
sweepExpiredKv2,
|
|
755
|
+
sweepExpiredKvPrefix2,
|
|
751
756
|
upsertKv2,
|
|
752
757
|
claimKv2,
|
|
753
758
|
deleteKv2,
|
|
@@ -772,7 +777,7 @@ import {
|
|
|
772
777
|
countScriptRunJournalSteps2,
|
|
773
778
|
countScriptRunJournalAgentTaskSteps2,
|
|
774
779
|
init_db3
|
|
775
|
-
} from "./cli-
|
|
780
|
+
} from "./cli-wmhajw68.js";
|
|
776
781
|
import {
|
|
777
782
|
PRIMARY_ROLE_NAMES2,
|
|
778
783
|
getUserGrant2,
|
|
@@ -783,22 +788,22 @@ import {
|
|
|
783
788
|
assertNotLastAdmin2,
|
|
784
789
|
setUserRoles2,
|
|
785
790
|
init_rbac_roles
|
|
786
|
-
} from "./cli-
|
|
787
|
-
import"./cli-
|
|
791
|
+
} from "./cli-ja369zab.js";
|
|
792
|
+
import"./cli-a0w50zw9.js";
|
|
788
793
|
import {
|
|
789
794
|
normalizeModelKey
|
|
790
|
-
} from "./cli-
|
|
795
|
+
} from "./cli-10kjx0dm.js";
|
|
791
796
|
import {
|
|
792
797
|
upsertModelCatalogOverlay,
|
|
793
798
|
deleteModelCatalogOverlay,
|
|
794
799
|
loadModelsCatalog,
|
|
795
800
|
requestModelCatalogRefresh2
|
|
796
|
-
} from "./cli-
|
|
801
|
+
} from "./cli-jmk31131.js";
|
|
797
802
|
import {
|
|
798
803
|
AMP_ESTIMATE_MODELS,
|
|
799
804
|
ampBillsCacheWrites,
|
|
800
805
|
resolveAmpModel
|
|
801
|
-
} from "./cli-
|
|
806
|
+
} from "./cli-e24w2mvk.js";
|
|
802
807
|
import {
|
|
803
808
|
workflowEventBus2,
|
|
804
809
|
init_event_bus
|
|
@@ -838,7 +843,7 @@ import {
|
|
|
838
843
|
generateEdges,
|
|
839
844
|
definitionNodeIds,
|
|
840
845
|
validateDefinition
|
|
841
|
-
} from "./cli-
|
|
846
|
+
} from "./cli-pnm99spe.js";
|
|
842
847
|
import {
|
|
843
848
|
require_dist2,
|
|
844
849
|
getMcpOAuthToken,
|
|
@@ -905,14 +910,14 @@ import {
|
|
|
905
910
|
typecheckWithAmbient,
|
|
906
911
|
typecheckScript,
|
|
907
912
|
parseSkillContent
|
|
908
|
-
} from "./cli-
|
|
913
|
+
} from "./cli-5ke7gxwr.js";
|
|
909
914
|
import {
|
|
910
915
|
buildAuthorizationUrl,
|
|
911
916
|
exchangeAuthorizationCode,
|
|
912
917
|
oauthAppRowToProviderConfig,
|
|
913
918
|
forceRefreshAuthorizationOrThrow,
|
|
914
919
|
forceRefreshTokenOrThrow
|
|
915
|
-
} from "./cli-
|
|
920
|
+
} from "./cli-ghfhn1qc.js";
|
|
916
921
|
import {
|
|
917
922
|
signalProcessGroup,
|
|
918
923
|
detachedProcessGroup,
|
|
@@ -945,8 +950,8 @@ import {
|
|
|
945
950
|
getSlackApp2,
|
|
946
951
|
startSlackApp2,
|
|
947
952
|
stopSlackApp2
|
|
948
|
-
} from "./cli-
|
|
949
|
-
import"./cli-
|
|
953
|
+
} from "./cli-ktcdczth.js";
|
|
954
|
+
import"./cli-0tkm519n.js";
|
|
950
955
|
import"./cli-n0ysjjtv.js";
|
|
951
956
|
import {
|
|
952
957
|
_fetchHolder,
|
|
@@ -964,7 +969,7 @@ import {
|
|
|
964
969
|
import {
|
|
965
970
|
retryFailedRun2,
|
|
966
971
|
cancelWorkflowRun2
|
|
967
|
-
} from "./cli-
|
|
972
|
+
} from "./cli-kjha1q9k.js";
|
|
968
973
|
import {
|
|
969
974
|
duplicateGuardedQueryKey,
|
|
970
975
|
warnIfCorsAllowsAnyOrigin,
|
|
@@ -1012,14 +1017,14 @@ import {
|
|
|
1012
1017
|
bodyListTask,
|
|
1013
1018
|
describeRequestRoute,
|
|
1014
1019
|
route
|
|
1015
|
-
} from "./cli-
|
|
1020
|
+
} from "./cli-0xzbk52h.js";
|
|
1016
1021
|
import {
|
|
1017
1022
|
FilesError,
|
|
1018
1023
|
normalizeFilesError,
|
|
1019
1024
|
agentFsRequestTimeoutMs,
|
|
1020
1025
|
AgentFsProvider,
|
|
1021
1026
|
getFileStorageProvider2
|
|
1022
|
-
} from "./cli-
|
|
1027
|
+
} from "./cli-z52gq55b.js";
|
|
1023
1028
|
import {
|
|
1024
1029
|
RuntimePoolError2,
|
|
1025
1030
|
mintControllerToken,
|
|
@@ -1040,7 +1045,7 @@ import {
|
|
|
1040
1045
|
resolvePoolDelivery2,
|
|
1041
1046
|
createPoolAgent2,
|
|
1042
1047
|
init_db
|
|
1043
|
-
} from "./cli-
|
|
1048
|
+
} from "./cli-z6219sd3.js";
|
|
1044
1049
|
import {
|
|
1045
1050
|
RATING_MODEL_MAX_LENGTH,
|
|
1046
1051
|
REFERENCES_SOURCE_MAX_LENGTH,
|
|
@@ -1059,8 +1064,8 @@ import {
|
|
|
1059
1064
|
checkHeartbeatChecklist2,
|
|
1060
1065
|
runHeartbeatSweep2,
|
|
1061
1066
|
stopHeartbeat2
|
|
1062
|
-
} from "./cli-
|
|
1063
|
-
import"./cli-
|
|
1067
|
+
} from "./cli-vvz64zc5.js";
|
|
1068
|
+
import"./cli-bs0fwb23.js";
|
|
1064
1069
|
import {
|
|
1065
1070
|
import_websocket,
|
|
1066
1071
|
import_websocket_server
|
|
@@ -1069,7 +1074,7 @@ import {
|
|
|
1069
1074
|
runtimeSupervisorStatus,
|
|
1070
1075
|
startRuntimeSupervisor,
|
|
1071
1076
|
stopRuntimeSupervisor
|
|
1072
|
-
} from "./cli-
|
|
1077
|
+
} from "./cli-dek8hqjc.js";
|
|
1073
1078
|
import"./cli-ns59dc6r.js";
|
|
1074
1079
|
import {
|
|
1075
1080
|
ACP_TARGET_IDS
|
|
@@ -1090,11 +1095,11 @@ import {
|
|
|
1090
1095
|
isUnknownModelError,
|
|
1091
1096
|
checkProviderPoolKey,
|
|
1092
1097
|
writeSkillsToFilesystem
|
|
1093
|
-
} from "./cli-
|
|
1098
|
+
} from "./cli-6151a7dr.js";
|
|
1094
1099
|
import {
|
|
1095
1100
|
inviteEmailToSharedOrg,
|
|
1096
1101
|
ensureAgentFsCredentialsForAgent
|
|
1097
|
-
} from "./cli-
|
|
1102
|
+
} from "./cli-x38rmhap.js";
|
|
1098
1103
|
import {
|
|
1099
1104
|
Anthropic
|
|
1100
1105
|
} from "./cli-prcyzecg.js";
|
|
@@ -1107,6 +1112,9 @@ import {
|
|
|
1107
1112
|
} from "./cli-9fzgd3hg.js";
|
|
1108
1113
|
import"./cli-13p25grh.js";
|
|
1109
1114
|
import"./cli-0adyhvq2.js";
|
|
1115
|
+
import {
|
|
1116
|
+
require_dist8
|
|
1117
|
+
} from "./cli-3k9jej0c.js";
|
|
1110
1118
|
import {
|
|
1111
1119
|
require_content_type
|
|
1112
1120
|
} from "./cli-1jx0srjt.js";
|
|
@@ -1118,6 +1126,7 @@ import {
|
|
|
1118
1126
|
registerSessionTokenConnection,
|
|
1119
1127
|
init_session_token_connections,
|
|
1120
1128
|
findUserById,
|
|
1129
|
+
findUserByExternalId,
|
|
1121
1130
|
findUserByEmail,
|
|
1122
1131
|
getUserIdentities,
|
|
1123
1132
|
listUserEvents,
|
|
@@ -1139,7 +1148,7 @@ import {
|
|
|
1139
1148
|
revokeAgentTokens,
|
|
1140
1149
|
fingerprintApiKey,
|
|
1141
1150
|
init_users
|
|
1142
|
-
} from "./cli-
|
|
1151
|
+
} from "./cli-v9jk2k63.js";
|
|
1143
1152
|
import"./cli-v41kn3cd.js";
|
|
1144
1153
|
import"./cli-wgtk7xxr.js";
|
|
1145
1154
|
import"./cli-1f0gp9vz.js";
|
|
@@ -1172,7 +1181,7 @@ import {
|
|
|
1172
1181
|
revokeMcpToken,
|
|
1173
1182
|
computeExpiresAt,
|
|
1174
1183
|
init_mcp_wrapper
|
|
1175
|
-
} from "./cli-
|
|
1184
|
+
} from "./cli-kjcdzea8.js";
|
|
1176
1185
|
import {
|
|
1177
1186
|
ASSET_KEY_MAX_LENGTH,
|
|
1178
1187
|
normalizeAssetKey,
|
|
@@ -1222,6 +1231,7 @@ import {
|
|
|
1222
1231
|
TaskTemplateSchema,
|
|
1223
1232
|
AgentStatusSchema,
|
|
1224
1233
|
AgentAvatarSchema,
|
|
1234
|
+
AgentSlackIconSchema,
|
|
1225
1235
|
AgentSchema,
|
|
1226
1236
|
AgentLatestModelSchema,
|
|
1227
1237
|
AgentAcpStatusSchema,
|
|
@@ -1324,12 +1334,12 @@ import {
|
|
|
1324
1334
|
KvKeySchema,
|
|
1325
1335
|
KvEntrySchema,
|
|
1326
1336
|
init_types2
|
|
1327
|
-
} from "./cli-
|
|
1337
|
+
} from "./cli-4aydmmdy.js";
|
|
1328
1338
|
import {
|
|
1329
1339
|
IDENTITY_FIELD_BUDGETS,
|
|
1330
1340
|
IdentityFieldBudgetError,
|
|
1331
1341
|
init_identity_field_budget
|
|
1332
|
-
} from "./cli-
|
|
1342
|
+
} from "./cli-9km88w11.js";
|
|
1333
1343
|
import {
|
|
1334
1344
|
isSteeringEnabled2,
|
|
1335
1345
|
init_steering_enabled
|
|
@@ -1390,6 +1400,7 @@ import {
|
|
|
1390
1400
|
partialRecord,
|
|
1391
1401
|
_enum2,
|
|
1392
1402
|
literal2,
|
|
1403
|
+
lazy,
|
|
1393
1404
|
preprocess,
|
|
1394
1405
|
ZodIssueCode,
|
|
1395
1406
|
exports_coerce
|
|
@@ -1401,7 +1412,7 @@ import {
|
|
|
1401
1412
|
import {
|
|
1402
1413
|
init_package,
|
|
1403
1414
|
package_default
|
|
1404
|
-
} from "./cli-
|
|
1415
|
+
} from "./cli-7cwrwb5x.js";
|
|
1405
1416
|
import {
|
|
1406
1417
|
MAX_PROFILE_FILE_LENGTH,
|
|
1407
1418
|
DEFAULT_APP_URL,
|
|
@@ -1413,7 +1424,7 @@ import {
|
|
|
1413
1424
|
isCombEnabled,
|
|
1414
1425
|
isAgentFsProxyEnabled,
|
|
1415
1426
|
init_constants2
|
|
1416
|
-
} from "./cli-
|
|
1427
|
+
} from "./cli-77eq8txs.js";
|
|
1417
1428
|
import {
|
|
1418
1429
|
parseEnvFlag,
|
|
1419
1430
|
isEnvFlagEnabled,
|
|
@@ -1491,6 +1502,7 @@ import {
|
|
|
1491
1502
|
createServer as createHttpServer
|
|
1492
1503
|
} from "node:http";
|
|
1493
1504
|
init_db3();
|
|
1505
|
+
init_search_index();
|
|
1494
1506
|
|
|
1495
1507
|
// src/be/db-retention.ts
|
|
1496
1508
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -2073,6 +2085,38 @@ function stopHumanFreeDrain() {
|
|
|
2073
2085
|
passTimer = null;
|
|
2074
2086
|
}
|
|
2075
2087
|
|
|
2088
|
+
// src/be/mcp-overflow-sweep.ts
|
|
2089
|
+
init_db3();
|
|
2090
|
+
var MCP_OVERFLOW_SWEEP_INTERVAL_MS = 10 * 60 * 1000;
|
|
2091
|
+
var sweepTimer = null;
|
|
2092
|
+
async function runMcpOverflowSweep(now = Date.now()) {
|
|
2093
|
+
try {
|
|
2094
|
+
const removed = await sweepExpiredKvPrefix2(MCP_OVERFLOW_NAMESPACE, now);
|
|
2095
|
+
if (removed > 0) {
|
|
2096
|
+
console.debug(`[mcp-overflow] Sweep removed ${removed} expired value(s)`);
|
|
2097
|
+
}
|
|
2098
|
+
return removed;
|
|
2099
|
+
} catch (err) {
|
|
2100
|
+
console.error("[mcp-overflow] Sweep failed:", err);
|
|
2101
|
+
return 0;
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
function startMcpOverflowSweep(intervalMs = MCP_OVERFLOW_SWEEP_INTERVAL_MS) {
|
|
2105
|
+
if (sweepTimer)
|
|
2106
|
+
return;
|
|
2107
|
+
sweepTimer = setInterval(() => {
|
|
2108
|
+
runMcpOverflowSweep();
|
|
2109
|
+
}, intervalMs);
|
|
2110
|
+
if (typeof sweepTimer?.unref === "function")
|
|
2111
|
+
sweepTimer.unref();
|
|
2112
|
+
}
|
|
2113
|
+
function stopMcpOverflowSweep() {
|
|
2114
|
+
if (sweepTimer) {
|
|
2115
|
+
clearInterval(sweepTimer);
|
|
2116
|
+
sweepTimer = null;
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2076
2120
|
// src/be/runtime-pools/seed.ts
|
|
2077
2121
|
init_runtime_pools_flag();
|
|
2078
2122
|
init_db3();
|
|
@@ -2378,7 +2422,7 @@ async function getQueueStallSnapshot(now = new Date) {
|
|
|
2378
2422
|
const pickupCutoff = new Date(now.getTime() - QUEUE_STALL_THRESHOLD_MS).toISOString();
|
|
2379
2423
|
const recentPickupCount = (await getDbClient2().get(`SELECT COUNT(*) AS count
|
|
2380
2424
|
FROM agent_log
|
|
2381
|
-
WHERE eventType IN ('task_status_change', 'task_claimed')
|
|
2425
|
+
WHERE +eventType IN ('task_status_change', 'task_claimed')
|
|
2382
2426
|
AND oldValue IN ('pending', 'unassigned')
|
|
2383
2427
|
AND newValue = 'in_progress'
|
|
2384
2428
|
AND createdAt >= ?`, [pickupCutoff]))?.count ?? 0;
|
|
@@ -4994,6 +5038,7 @@ var updateAgentProfileRoute = route({
|
|
|
4994
5038
|
toolsMd: string2().optional(),
|
|
4995
5039
|
heartbeatMd: string2().max(MAX_PROFILE_FILE_LENGTH).optional(),
|
|
4996
5040
|
avatar: AgentAvatarSchema.nullable().optional(),
|
|
5041
|
+
slackIcon: lazy(() => AgentSlackIconSchema).nullable().optional(),
|
|
4997
5042
|
changeSource: string2().optional(),
|
|
4998
5043
|
changedByAgentId: string2().optional(),
|
|
4999
5044
|
changeReason: string2().optional(),
|
|
@@ -5319,8 +5364,8 @@ async function handleAgentsRest(req, res, pathSegments, queryParams, myAgentId)
|
|
|
5319
5364
|
if (!parsed)
|
|
5320
5365
|
return true;
|
|
5321
5366
|
const body = parsed.body;
|
|
5322
|
-
if (body.role === undefined && body.description === undefined && body.capabilities === undefined && body.claudeMd === undefined && body.soulMd === undefined && body.identityMd === undefined && body.setupScript === undefined && body.toolsMd === undefined && body.heartbeatMd === undefined && body.avatar === undefined) {
|
|
5323
|
-
jsonError(res, "At least one field (role, description, capabilities, claudeMd, soulMd, identityMd, setupScript, toolsMd, heartbeatMd, or
|
|
5367
|
+
if (body.role === undefined && body.description === undefined && body.capabilities === undefined && body.claudeMd === undefined && body.soulMd === undefined && body.identityMd === undefined && body.setupScript === undefined && body.toolsMd === undefined && body.heartbeatMd === undefined && body.avatar === undefined && body.slackIcon === undefined) {
|
|
5368
|
+
jsonError(res, "At least one field (role, description, capabilities, claudeMd, soulMd, identityMd, setupScript, toolsMd, heartbeatMd, avatar, or slackIcon) must be provided", 400);
|
|
5324
5369
|
return true;
|
|
5325
5370
|
}
|
|
5326
5371
|
const validChangeSources = ["self_edit", "lead_coaching", "api", "system", "session_sync"];
|
|
@@ -5342,7 +5387,8 @@ async function handleAgentsRest(req, res, pathSegments, queryParams, myAgentId)
|
|
|
5342
5387
|
setupScript: body.setupScript,
|
|
5343
5388
|
toolsMd: body.toolsMd,
|
|
5344
5389
|
heartbeatMd: body.heartbeatMd,
|
|
5345
|
-
...body.avatar !== undefined ? { avatar: body.avatar } : {}
|
|
5390
|
+
...body.avatar !== undefined ? { avatar: body.avatar } : {},
|
|
5391
|
+
...body.slackIcon !== undefined ? { slackIcon: body.slackIcon } : {}
|
|
5346
5392
|
}, versionMeta, {
|
|
5347
5393
|
expectedHashes: body.expectedHashes,
|
|
5348
5394
|
onConflict: (conflict) => conflicts.push(conflict)
|
|
@@ -9835,6 +9881,48 @@ function sentTaskId(thread, replies, serviceUserId) {
|
|
|
9835
9881
|
return null;
|
|
9836
9882
|
}
|
|
9837
9883
|
|
|
9884
|
+
// src/comb/requester.ts
|
|
9885
|
+
init_users();
|
|
9886
|
+
init_secret_scrubber();
|
|
9887
|
+
var AGENT_FS_IDENTITY_KIND = "agent-fs";
|
|
9888
|
+
async function commentAuthorUsers(agentFs, drive, comments, serviceUserId) {
|
|
9889
|
+
const authors = [...new Set(comments.map((comment) => comment.author))].filter((author) => author && author !== serviceUserId);
|
|
9890
|
+
const users = new Map;
|
|
9891
|
+
const unlinked = [];
|
|
9892
|
+
for (const author of authors) {
|
|
9893
|
+
const user = await findUserByExternalId(AGENT_FS_IDENTITY_KIND, author);
|
|
9894
|
+
if (user)
|
|
9895
|
+
users.set(author, user.id);
|
|
9896
|
+
else
|
|
9897
|
+
unlinked.push(author);
|
|
9898
|
+
}
|
|
9899
|
+
if (unlinked.length === 0)
|
|
9900
|
+
return users;
|
|
9901
|
+
const members = await agentFs.getDriveMembers(drive).catch((error) => {
|
|
9902
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
9903
|
+
console.warn(scrubSecrets(`[comb] could not read the drive members: ${message}`));
|
|
9904
|
+
return [];
|
|
9905
|
+
});
|
|
9906
|
+
for (const author of unlinked) {
|
|
9907
|
+
const email = members.find((member) => member.userId === author)?.email;
|
|
9908
|
+
const user = email ? await findUserByEmail(email) : null;
|
|
9909
|
+
if (user)
|
|
9910
|
+
users.set(author, user.id);
|
|
9911
|
+
}
|
|
9912
|
+
return users;
|
|
9913
|
+
}
|
|
9914
|
+
function batchRequester(comments, users) {
|
|
9915
|
+
let newest = null;
|
|
9916
|
+
for (const comment of comments) {
|
|
9917
|
+
if (!users.has(comment.author))
|
|
9918
|
+
continue;
|
|
9919
|
+
if (!newest || Date.parse(comment.createdAt) > Date.parse(newest.createdAt)) {
|
|
9920
|
+
newest = comment;
|
|
9921
|
+
}
|
|
9922
|
+
}
|
|
9923
|
+
return newest ? users.get(newest.author) ?? null : null;
|
|
9924
|
+
}
|
|
9925
|
+
|
|
9838
9926
|
// src/comb/review-batch.ts
|
|
9839
9927
|
init_templates();
|
|
9840
9928
|
var REVIEW_BATCH_MAX = 50;
|
|
@@ -9892,6 +9980,7 @@ async function sendReviewBatch(input, deps = {}) {
|
|
|
9892
9980
|
else
|
|
9893
9981
|
candidates.push(read);
|
|
9894
9982
|
}
|
|
9983
|
+
const authorUsers = input.requestedByUserId || !serviceUserId || process.env.TRUST_BODY_REQUESTED_BY_USER_ID === "false" ? null : await commentAuthorUsers(agentFs, drive, candidates.map(commentOf), serviceUserId);
|
|
9895
9984
|
const claim = crypto.randomUUID();
|
|
9896
9985
|
const { won, lost } = await claimComments(candidates, claim);
|
|
9897
9986
|
const repairs = [];
|
|
@@ -9907,8 +9996,9 @@ async function sendReviewBatch(input, deps = {}) {
|
|
|
9907
9996
|
let taskId = null;
|
|
9908
9997
|
let leadState = "none";
|
|
9909
9998
|
if (won.length > 0) {
|
|
9999
|
+
const requestedByUserId = input.requestedByUserId ?? (authorUsers ? batchRequester(won.map(commentOf), authorUsers) : null);
|
|
9910
10000
|
try {
|
|
9911
|
-
const text = await renderTaskText(input, won);
|
|
10001
|
+
const text = await renderTaskText({ ...input, requestedByUserId }, won);
|
|
9912
10002
|
if (text === null) {
|
|
9913
10003
|
throw new ReviewBatchError(503, "The Comb review template is disabled", [
|
|
9914
10004
|
...skipped,
|
|
@@ -9924,7 +10014,7 @@ async function sendReviewBatch(input, deps = {}) {
|
|
|
9924
10014
|
source: "comb",
|
|
9925
10015
|
taskType: "comb-review",
|
|
9926
10016
|
tags: ["comb"],
|
|
9927
|
-
requestedByUserId:
|
|
10017
|
+
requestedByUserId: requestedByUserId ?? undefined
|
|
9928
10018
|
}, { origin: "rest" });
|
|
9929
10019
|
taskId = task.id;
|
|
9930
10020
|
} catch (error) {
|
|
@@ -9980,6 +10070,9 @@ async function readComment(agentFs, drive, versionOf, id) {
|
|
|
9980
10070
|
const version = comment.fileVersion ?? (comment.parentId ? undefined : await versionOf(comment));
|
|
9981
10071
|
return { id, thread, version };
|
|
9982
10072
|
}
|
|
10073
|
+
function commentOf(read) {
|
|
10074
|
+
return read.thread.comment;
|
|
10075
|
+
}
|
|
9983
10076
|
function skipOf({ id, thread }, serviceUserId) {
|
|
9984
10077
|
if (!thread)
|
|
9985
10078
|
return { id, reason: "not-found" };
|
|
@@ -15392,6 +15485,46 @@ async function registerTelegramWebhook() {
|
|
|
15392
15485
|
}
|
|
15393
15486
|
return { webhookUrl, webhookInfo: info };
|
|
15394
15487
|
}
|
|
15488
|
+
|
|
15489
|
+
// src/slack/app-icon.ts
|
|
15490
|
+
var import_web_api = __toESM(require_dist8(), 1);
|
|
15491
|
+
var TTL_MS = 60 * 60 * 1000;
|
|
15492
|
+
var REQUEST_TIMEOUT_MS = 2500;
|
|
15493
|
+
var cached = null;
|
|
15494
|
+
var inFlight2 = null;
|
|
15495
|
+
async function lookUp(client) {
|
|
15496
|
+
const auth = await client.auth.test();
|
|
15497
|
+
if (!auth.bot_id)
|
|
15498
|
+
return null;
|
|
15499
|
+
const info = await client.bots.info({ bot: auth.bot_id });
|
|
15500
|
+
const icons = info.bot?.icons;
|
|
15501
|
+
return icons?.image_72 ?? icons?.image_48 ?? icons?.image_36 ?? null;
|
|
15502
|
+
}
|
|
15503
|
+
async function getSlackAppIconUrl() {
|
|
15504
|
+
const app = getSlackApp2()?.client;
|
|
15505
|
+
if (!app?.token)
|
|
15506
|
+
return null;
|
|
15507
|
+
const key = `${app.slackApiUrl} ${app.token}`;
|
|
15508
|
+
if (cached?.key === key && Date.now() - cached.at < TTL_MS)
|
|
15509
|
+
return cached.url;
|
|
15510
|
+
if (inFlight2?.key === key)
|
|
15511
|
+
return await inFlight2.promise;
|
|
15512
|
+
const client = new import_web_api.WebClient(app.token, {
|
|
15513
|
+
slackApiUrl: app.slackApiUrl,
|
|
15514
|
+
retryConfig: { retries: 0 },
|
|
15515
|
+
rejectRateLimitedCalls: true,
|
|
15516
|
+
timeout: REQUEST_TIMEOUT_MS
|
|
15517
|
+
});
|
|
15518
|
+
const promise = lookUp(client).then((url) => {
|
|
15519
|
+
cached = { key, url, at: Date.now() };
|
|
15520
|
+
return url;
|
|
15521
|
+
}).catch(() => null).finally(() => {
|
|
15522
|
+
if (inFlight2?.promise === promise)
|
|
15523
|
+
inFlight2 = null;
|
|
15524
|
+
});
|
|
15525
|
+
inFlight2 = { key, promise };
|
|
15526
|
+
return await promise;
|
|
15527
|
+
}
|
|
15395
15528
|
// slack-manifest.json
|
|
15396
15529
|
var slack_manifest_default = {
|
|
15397
15530
|
display_information: {
|
|
@@ -15621,6 +15754,19 @@ var slackManifestRoute = route({
|
|
|
15621
15754
|
200: { description: "Slack app manifest", schema: SlackManifestSchema }
|
|
15622
15755
|
}
|
|
15623
15756
|
});
|
|
15757
|
+
var slackAppIconRoute = route({
|
|
15758
|
+
method: "get",
|
|
15759
|
+
path: "/api/integrations/slack/app-icon",
|
|
15760
|
+
pattern: ["api", "integrations", "slack", "app-icon"],
|
|
15761
|
+
summary: "The Slack app's own avatar, shown on posts with no icon override",
|
|
15762
|
+
tags: ["Integrations"],
|
|
15763
|
+
responses: {
|
|
15764
|
+
200: {
|
|
15765
|
+
description: "`imageUrl` is null when Slack is off or the lookup fails.",
|
|
15766
|
+
schema: object2({ imageUrl: string2().nullable() })
|
|
15767
|
+
}
|
|
15768
|
+
}
|
|
15769
|
+
});
|
|
15624
15770
|
var chatSdkStatusRoute = route({
|
|
15625
15771
|
method: "get",
|
|
15626
15772
|
path: "/api/integrations/chat/status",
|
|
@@ -15659,6 +15805,10 @@ function createIntegrationsHandler(deps = {}) {
|
|
|
15659
15805
|
slackManifestRoute.respond(res, 200, buildSlackManifest(parsed.query.name));
|
|
15660
15806
|
return true;
|
|
15661
15807
|
}
|
|
15808
|
+
if (slackAppIconRoute.match(req.method, pathSegments)) {
|
|
15809
|
+
slackAppIconRoute.respond(res, 200, { imageUrl: await getSlackAppIconUrl() });
|
|
15810
|
+
return true;
|
|
15811
|
+
}
|
|
15662
15812
|
if (chatSdkStatusRoute.match(req.method, pathSegments)) {
|
|
15663
15813
|
chatSdkStatusRoute.respond(res, 200, await getChatSdkStatus());
|
|
15664
15814
|
return true;
|
|
@@ -22425,6 +22575,7 @@ var StatusActivitySchema = object2({
|
|
|
22425
22575
|
});
|
|
22426
22576
|
var StatusCombSchema = object2({
|
|
22427
22577
|
enabled: boolean(),
|
|
22578
|
+
reason: string2().nullable(),
|
|
22428
22579
|
api_url: string2().nullable(),
|
|
22429
22580
|
live_url: string2(),
|
|
22430
22581
|
org_id: string2().nullable(),
|
|
@@ -22851,6 +23002,7 @@ function getCombStatus(serviceUserId) {
|
|
|
22851
23002
|
const comb = getCombConfig();
|
|
22852
23003
|
return {
|
|
22853
23004
|
enabled: comb.enabled,
|
|
23005
|
+
reason: comb.reason,
|
|
22854
23006
|
api_url: comb.apiUrl,
|
|
22855
23007
|
live_url: comb.liveUrl,
|
|
22856
23008
|
org_id: comb.orgId,
|
|
@@ -22877,7 +23029,7 @@ var getStatus = route({
|
|
|
22877
23029
|
path: "/status",
|
|
22878
23030
|
pattern: ["status"],
|
|
22879
23031
|
summary: "Identity + setup readiness + live activity for the swarm dashboard",
|
|
22880
|
-
description: "Single source of truth consumed by the UI home page. Identity comes from SWARM_* envs; setup milestones each emit `unverified | configured | verified`; automations report `running | needs_setup` from the same runtime preflight used at dispatch; activity counts agents alive in the last 5 min, leads that can take work (status idle or busy), and tasks created in the last 24h; agent_fs reports whether AGENT_FS_API_URL is set, plus the Comb settings (
|
|
23032
|
+
description: "Single source of truth consumed by the UI home page. Identity comes from SWARM_* envs; setup milestones each emit `unverified | configured | verified`; automations report `running | needs_setup` from the same runtime preflight used at dispatch; activity counts agents alive in the last 5 min, leads that can take work (status idle or busy), and tasks created in the last 24h; agent_fs reports whether AGENT_FS_API_URL is set, plus the Comb settings (whether Files is on and, when off, what is missing; the browser-facing agent-fs URL, the shared org and drive ids, and the agent-fs user id of the swarm service account); telemetry reports the effective ANONYMIZED_TELEMETRY opt-out state.",
|
|
22881
23033
|
tags: ["Status"],
|
|
22882
23034
|
responses: {
|
|
22883
23035
|
200: { description: "Status payload", schema: StatusResponseSchema },
|
|
@@ -23506,6 +23658,40 @@ init_types2();
|
|
|
23506
23658
|
init_request_auth_context();
|
|
23507
23659
|
init_secret_scrubber();
|
|
23508
23660
|
|
|
23661
|
+
// src/http/list-total-cache.ts
|
|
23662
|
+
var LIST_TOTAL_TTL_MS = 30000;
|
|
23663
|
+
var MAX_ENTRIES2 = 500;
|
|
23664
|
+
function filterKey(value) {
|
|
23665
|
+
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);
|
|
23666
|
+
}
|
|
23667
|
+
function createListTotalCache(ttlMs = LIST_TOTAL_TTL_MS) {
|
|
23668
|
+
const entries = new Map;
|
|
23669
|
+
return {
|
|
23670
|
+
get(filters, offset, compute) {
|
|
23671
|
+
const key = filterKey(filters);
|
|
23672
|
+
const now = Date.now();
|
|
23673
|
+
const hit = entries.get(key);
|
|
23674
|
+
if (hit && hit.expiresAt > now && (offset ?? 0) > 0)
|
|
23675
|
+
return hit.total;
|
|
23676
|
+
if (hit)
|
|
23677
|
+
entries.delete(key);
|
|
23678
|
+
const total = compute();
|
|
23679
|
+
entries.set(key, { expiresAt: now + ttlMs, total });
|
|
23680
|
+
total.catch(() => {
|
|
23681
|
+
if (entries.get(key)?.total === total)
|
|
23682
|
+
entries.delete(key);
|
|
23683
|
+
});
|
|
23684
|
+
while (entries.size > MAX_ENTRIES2) {
|
|
23685
|
+
const oldest = entries.keys().next().value;
|
|
23686
|
+
if (oldest === undefined)
|
|
23687
|
+
break;
|
|
23688
|
+
entries.delete(oldest);
|
|
23689
|
+
}
|
|
23690
|
+
return total;
|
|
23691
|
+
}
|
|
23692
|
+
};
|
|
23693
|
+
}
|
|
23694
|
+
|
|
23509
23695
|
// src/http/requested-by.ts
|
|
23510
23696
|
init_zod();
|
|
23511
23697
|
init_db3();
|
|
@@ -23628,6 +23814,7 @@ var SupersedeTaskResponseSchema = object2({
|
|
|
23628
23814
|
resumeTaskId: string2().nullable(),
|
|
23629
23815
|
resumeTaskStatus: AgentTaskStatusSchema.optional()
|
|
23630
23816
|
});
|
|
23817
|
+
var taskTotals = createListTotalCache();
|
|
23631
23818
|
var listTasks = route({
|
|
23632
23819
|
method: "get",
|
|
23633
23820
|
path: "/api/tasks",
|
|
@@ -23642,7 +23829,7 @@ var listTasks = route({
|
|
|
23642
23829
|
workflowRunId: string2().uuid().optional(),
|
|
23643
23830
|
key: AssetKeySchema.optional(),
|
|
23644
23831
|
keyPrefix: AssetKeySchema.optional(),
|
|
23645
|
-
search: string2().optional(),
|
|
23832
|
+
search: string2().optional().describe("Search task text and title by word or phrase, with a prefix match on the last word, or a task id by prefix. Not a substring match: '2443' does not find '12443', and '%' and '_' are not wildcards."),
|
|
23646
23833
|
includeHeartbeat: _enum2(["true", "false"]).optional(),
|
|
23647
23834
|
createdAfter: string2().datetime().optional(),
|
|
23648
23835
|
createdBefore: string2().datetime().optional(),
|
|
@@ -24252,7 +24439,8 @@ async function handleTasks(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
24252
24439
|
};
|
|
24253
24440
|
const tasks = parsed.query.fields === "full" ? await getAllTasks2(filters) : parsed.query.fields === "timeline" ? await getAllTasks2(filters, { fields: "timeline" }) : await getAllTasks2(filters, { slim: true });
|
|
24254
24441
|
if (parsed.query.includeTotal === "true") {
|
|
24255
|
-
const
|
|
24442
|
+
const { limit: _limit, offset: _offset, orderBy: _orderBy, ...totalKey } = filters;
|
|
24443
|
+
const total = await taskTotals.get(totalKey, filters.offset, () => getTasksCount2(filters));
|
|
24256
24444
|
listTasks.respond(res, 200, { tasks, total });
|
|
24257
24445
|
} else {
|
|
24258
24446
|
listTasks.respond(res, 200, { tasks });
|
|
@@ -34830,7 +35018,7 @@ var LABEL_TTL_MS = 24 * 60 * 60 * 1000;
|
|
|
34830
35018
|
var FAILURE_TTL_MS = 10 * 60 * 1000;
|
|
34831
35019
|
var FAILURE_CACHE_MAX = 500;
|
|
34832
35020
|
var LOOKUP_QUEUE_MAX = 50;
|
|
34833
|
-
var
|
|
35021
|
+
var inFlight3 = new Set;
|
|
34834
35022
|
var failedUntil = new Map;
|
|
34835
35023
|
var pending = Promise.resolve();
|
|
34836
35024
|
async function channelLabel(client, id) {
|
|
@@ -34862,21 +35050,21 @@ function warmSlackChannelLabels(groupKeys) {
|
|
|
34862
35050
|
const id = CHANNEL_GROUP_KEY.exec(groupKey)?.[1];
|
|
34863
35051
|
if (!id)
|
|
34864
35052
|
continue;
|
|
34865
|
-
if (
|
|
35053
|
+
if (inFlight3.has(id) || (failedUntil.get(id) ?? 0) > Date.now())
|
|
34866
35054
|
continue;
|
|
34867
35055
|
failedUntil.delete(id);
|
|
34868
|
-
if (
|
|
35056
|
+
if (inFlight3.size >= LOOKUP_QUEUE_MAX)
|
|
34869
35057
|
continue;
|
|
34870
|
-
if (failedUntil.size +
|
|
35058
|
+
if (failedUntil.size + inFlight3.size >= FAILURE_CACHE_MAX) {
|
|
34871
35059
|
const now = Date.now();
|
|
34872
35060
|
for (const [failedId, until] of failedUntil) {
|
|
34873
35061
|
if (until <= now)
|
|
34874
35062
|
failedUntil.delete(failedId);
|
|
34875
35063
|
}
|
|
34876
|
-
if (failedUntil.size +
|
|
35064
|
+
if (failedUntil.size + inFlight3.size >= FAILURE_CACHE_MAX)
|
|
34877
35065
|
continue;
|
|
34878
35066
|
}
|
|
34879
|
-
|
|
35067
|
+
inFlight3.add(id);
|
|
34880
35068
|
pending = pending.then(async () => {
|
|
34881
35069
|
try {
|
|
34882
35070
|
const label = await channelLabel(client, id);
|
|
@@ -34885,7 +35073,7 @@ function warmSlackChannelLabels(groupKeys) {
|
|
|
34885
35073
|
failedUntil.set(id, Date.now() + FAILURE_TTL_MS);
|
|
34886
35074
|
console.warn(`[Slack] Could not cache a session channel label: ${slackErrorCode2(error) ?? "unknown error"}`);
|
|
34887
35075
|
} finally {
|
|
34888
|
-
|
|
35076
|
+
inFlight3.delete(id);
|
|
34889
35077
|
}
|
|
34890
35078
|
});
|
|
34891
35079
|
}
|
|
@@ -35221,6 +35409,7 @@ async function handleAgentTokens(req, res, pathSegments, queryParams) {
|
|
|
35221
35409
|
var SessionShowSchema = _enum2(["mine", "all"]).optional().describe("Sessions v2 view, for a user viewer with tree scope. mine (default): roots the user started from a human channel (not workflow, schedule, or system) plus sessions shared with the user. all: every tree session. Lists only: access is unchanged.");
|
|
35222
35410
|
var SessionHideSourceSchema = string2().refine((value) => value.split(",").length <= 32, "hideSource takes at most 32 sources.").optional().transform((value) => value?.split(",").map((source) => source.trim()).filter(Boolean)).describe("Comma-separated root sources to leave out, e.g. `slack,chat`. Older sessions v2 clients send this; `showSource` replaces it.");
|
|
35223
35411
|
var SessionShowSourceSchema = string2().refine((value) => value.split(",").length <= 32, "showSource takes at most 32 sources.").optional().transform((value) => value?.split(",").map((source) => source.trim()).filter(Boolean)).describe("Comma-separated root sources to keep (the sessions v2 source filter), e.g. `ui,slack`. Present and empty keeps none; omit to keep every source.");
|
|
35412
|
+
var sessionTotals = createListTotalCache();
|
|
35224
35413
|
var listSessions = route({
|
|
35225
35414
|
method: "get",
|
|
35226
35415
|
path: "/api/sessions",
|
|
@@ -35591,7 +35780,8 @@ async function handleSessions(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
35591
35780
|
offset: parsed.query.offset
|
|
35592
35781
|
};
|
|
35593
35782
|
const sessions = parsed.query.fields === "full" ? await listRecentSessions2(baseOpts) : await listRecentSessions2({ ...baseOpts, slim: true });
|
|
35594
|
-
const
|
|
35783
|
+
const { now: _now, ...totalKey } = filterOpts;
|
|
35784
|
+
const total = await sessionTotals.get(totalKey, parsed.query.offset, () => countSessions2(filterOpts));
|
|
35595
35785
|
listSessions.respond(res, 200, {
|
|
35596
35786
|
sessions,
|
|
35597
35787
|
total,
|
|
@@ -37034,6 +37224,7 @@ var OutcomeCountersSchema = object2({
|
|
|
37034
37224
|
ignored: number2(),
|
|
37035
37225
|
failed: number2(),
|
|
37036
37226
|
uncertain: number2(),
|
|
37227
|
+
ackNotReady: number2(),
|
|
37037
37228
|
lastOutcomeAt: string2().nullable(),
|
|
37038
37229
|
lastFailure: FailureSchema
|
|
37039
37230
|
});
|
|
@@ -42000,7 +42191,7 @@ var httpServer = createHttpServer(async (req, res) => {
|
|
|
42000
42191
|
});
|
|
42001
42192
|
});
|
|
42002
42193
|
var detachRealtime = attachRealtimeTransport(httpServer);
|
|
42003
|
-
var { attachControllerTransport } = await import("./controllers-connect-
|
|
42194
|
+
var { attachControllerTransport } = await import("./controllers-connect-7m25cay2.js");
|
|
42004
42195
|
var detachControllers = attachControllerTransport(httpServer);
|
|
42005
42196
|
var stopWorkerNudges = startWorkerNudgeListener();
|
|
42006
42197
|
var stopRoomDeletion = realtimeBus.subscribe("room:namespace-deleted", (namespace) => {
|
|
@@ -42029,7 +42220,7 @@ async function shutdown() {
|
|
|
42029
42220
|
sessionsProcessed: getServerSessionsProcessed()
|
|
42030
42221
|
});
|
|
42031
42222
|
if (hasCapability("scheduling")) {
|
|
42032
|
-
const { stopScheduler } = await import("./index-
|
|
42223
|
+
const { stopScheduler } = await import("./index-5eyn1wc5.js");
|
|
42033
42224
|
stopScheduler();
|
|
42034
42225
|
}
|
|
42035
42226
|
stopHeartbeat2();
|
|
@@ -42041,13 +42232,15 @@ async function shutdown() {
|
|
|
42041
42232
|
await stopSlackApp2();
|
|
42042
42233
|
await stopChatSdk();
|
|
42043
42234
|
if (!isEnvFlagEnabled("OAUTH_KEEPALIVE_DISABLE", false)) {
|
|
42044
|
-
const { stopOAuthKeepalive } = await import("./keepalive-
|
|
42235
|
+
const { stopOAuthKeepalive } = await import("./keepalive-cymckeg6.js");
|
|
42045
42236
|
await stopOAuthKeepalive();
|
|
42046
42237
|
}
|
|
42047
42238
|
stopOAuthPendingGc();
|
|
42239
|
+
stopMcpOverflowSweep();
|
|
42048
42240
|
stopMemoryGc();
|
|
42049
42241
|
await stopDbRetention();
|
|
42050
42242
|
stopHumanFreeDrain();
|
|
42243
|
+
await stopTaskSearchBackfill();
|
|
42051
42244
|
stopScratchScriptGc();
|
|
42052
42245
|
await stopExtensionRuntime();
|
|
42053
42246
|
stopAuditGc();
|
|
@@ -42121,21 +42314,21 @@ try {
|
|
|
42121
42314
|
console.warn("[startup] CAPABILITIES upgrade seed failed (non-fatal):", err);
|
|
42122
42315
|
}
|
|
42123
42316
|
try {
|
|
42124
|
-
const { ensurePricingSeeded } = await import("./boot-seeds-
|
|
42317
|
+
const { ensurePricingSeeded } = await import("./boot-seeds-rpm8bb5r.js");
|
|
42125
42318
|
ensurePricingSeeded();
|
|
42126
|
-
const { startPricingRefreshLoop } = await import("./pricing-refresh-
|
|
42319
|
+
const { startPricingRefreshLoop } = await import("./pricing-refresh-t3nx5krn.js");
|
|
42127
42320
|
startPricingRefreshLoop();
|
|
42128
42321
|
} catch (err) {
|
|
42129
42322
|
console.error("[startup] Failed to seed pricing rows:", err);
|
|
42130
42323
|
}
|
|
42131
42324
|
try {
|
|
42132
|
-
const { ensureModelProfilesSeeded } = await import("./boot-seeds-
|
|
42325
|
+
const { ensureModelProfilesSeeded } = await import("./boot-seeds-rpm8bb5r.js");
|
|
42133
42326
|
await ensureModelProfilesSeeded();
|
|
42134
42327
|
} catch (err) {
|
|
42135
42328
|
console.error("[startup] Failed to seed model profiles:", err);
|
|
42136
42329
|
}
|
|
42137
42330
|
try {
|
|
42138
|
-
const { ensureRbacSeeded } = await import("./boot-seeds-
|
|
42331
|
+
const { ensureRbacSeeded } = await import("./boot-seeds-rpm8bb5r.js");
|
|
42139
42332
|
ensureRbacSeeded();
|
|
42140
42333
|
} catch (err) {
|
|
42141
42334
|
console.error("[startup] Failed to sync RBAC seed rows:", err);
|
|
@@ -42143,7 +42336,7 @@ try {
|
|
|
42143
42336
|
throw err;
|
|
42144
42337
|
}
|
|
42145
42338
|
try {
|
|
42146
|
-
const { runAllSeeders } = await import("./index-
|
|
42339
|
+
const { runAllSeeders } = await import("./index-q5gzpjdd.js");
|
|
42147
42340
|
await runAllSeeders({ scriptEmbeddingMode: "skip" });
|
|
42148
42341
|
} catch (err) {
|
|
42149
42342
|
console.error("[startup] Failed to seed built-in entities:", err);
|
|
@@ -42206,42 +42399,44 @@ httpServer.listen(port, async () => {
|
|
|
42206
42399
|
await initWorkflows2();
|
|
42207
42400
|
await startScriptRunSupervisor(getMcpBaseUrl());
|
|
42208
42401
|
if (hasCapability("scheduling")) {
|
|
42209
|
-
const { startScheduler } = await import("./index-
|
|
42210
|
-
const { getExecutorRegistry } = await import("./index-
|
|
42402
|
+
const { startScheduler } = await import("./index-5eyn1wc5.js");
|
|
42403
|
+
const { getExecutorRegistry } = await import("./index-71gnebsn.js");
|
|
42211
42404
|
const intervalMs = Number(process.env.SCHEDULER_INTERVAL_MS) || 1e4;
|
|
42212
42405
|
startScheduler(getExecutorRegistry(), intervalMs, {
|
|
42213
42406
|
runId: globalState.__runId
|
|
42214
42407
|
});
|
|
42215
42408
|
}
|
|
42216
42409
|
if (!isEnvFlagEnabled("HEARTBEAT_DISABLE", false)) {
|
|
42217
|
-
const { startHeartbeat } = await import("./index-
|
|
42410
|
+
const { startHeartbeat } = await import("./index-z3b1vfjx.js");
|
|
42218
42411
|
const heartbeatMs = Number(process.env.HEARTBEAT_INTERVAL_MS) || 90000;
|
|
42219
42412
|
startHeartbeat(heartbeatMs);
|
|
42220
42413
|
}
|
|
42221
42414
|
startPoolRouting();
|
|
42222
42415
|
startRuntimeSupervisor();
|
|
42223
42416
|
if (!isEnvFlagEnabled("OAUTH_KEEPALIVE_DISABLE", false)) {
|
|
42224
|
-
const { startOAuthKeepalive } = await import("./keepalive-
|
|
42417
|
+
const { startOAuthKeepalive } = await import("./keepalive-cymckeg6.js");
|
|
42225
42418
|
startOAuthKeepalive();
|
|
42226
42419
|
}
|
|
42227
42420
|
if (!isEnvFlagEnabled("OAUTH_REFRESH_SWEEP_DISABLE", false)) {
|
|
42228
|
-
const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-
|
|
42421
|
+
const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-5dztk8x6.js");
|
|
42229
42422
|
startOAuthRefreshSweep();
|
|
42230
42423
|
}
|
|
42231
42424
|
startOAuthPendingGc();
|
|
42425
|
+
startMcpOverflowSweep();
|
|
42232
42426
|
await startMemoryGc();
|
|
42233
42427
|
await startDbRetention();
|
|
42234
42428
|
startHumanFreeDrain();
|
|
42235
|
-
|
|
42429
|
+
startTaskSearchBackfill();
|
|
42430
|
+
import("./embedding-space-rgf4aypt.js").then(({ runEmbeddingMaintenance, setDeploymentEnvReader }) => {
|
|
42236
42431
|
setDeploymentEnvReader(getDeploymentEnvValue);
|
|
42237
42432
|
return runEmbeddingMaintenance({ backfill: true });
|
|
42238
42433
|
}).catch((err) => {
|
|
42239
42434
|
console.error("[embedding-space] startup maintenance failed (non-fatal):", err);
|
|
42240
42435
|
});
|
|
42241
|
-
import("./boot-scrub-sweep-
|
|
42436
|
+
import("./boot-scrub-sweep-mxvb8dr3.js").then(({ runBootScrubSweep }) => runBootScrubSweep()).catch((err) => {
|
|
42242
42437
|
console.error("[boot-scrub-sweep] startup scrub failed (non-fatal):", err);
|
|
42243
42438
|
});
|
|
42244
|
-
import("./session-source-backfill-
|
|
42439
|
+
import("./session-source-backfill-kr5bdjtp.js").then(({ runSessionSourceBackfill }) => runSessionSourceBackfill()).catch((err) => {
|
|
42245
42440
|
console.error("[session-source-backfill] startup run failed (non-fatal):", err);
|
|
42246
42441
|
});
|
|
42247
42442
|
}).on("error", (err) => {
|