@desplega.ai/agent-swarm 2.7.10 → 2.8.0
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-t949vbbp.js +15 -0
- package/dist/{actions-b8aqhrsg.js → actions-7e9czc7s.js} +18 -19
- package/dist/{amp-adapter-4c165vgn.js → amp-adapter-gv6cbb7d.js} +2 -3
- package/dist/{app-m9khefrh.js → app-b9fbkp9v.js} +3 -3
- package/dist/{assistant-rh4v3ntz.js → assistant-wjb7v4c7.js} +20 -21
- package/dist/{boot-args-schema-hwkc8bzv.js → boot-args-schema-2t37e0fe.js} +1 -1
- package/dist/{boot-reembed-5y6yw9sj.js → boot-reembed-a35nkyr1.js} +1 -1
- package/dist/{boot-reembed-fdyk55h4.js → boot-reembed-gka3zas7.js} +1 -1
- package/dist/{boot-scrub-sweep-r5r8kqsn.js → boot-scrub-sweep-65sdnp6c.js} +3 -3
- package/dist/{boot-seeds-8f9zt5cm.js → boot-seeds-x42tzytw.js} +4 -5
- package/dist/{claude-adapter-s5df247c.js → claude-adapter-v221b2fd.js} +7 -8
- package/dist/{claude-managed-adapter-h74d06yz.js → claude-managed-adapter-29eq09wd.js} +2 -2
- package/dist/{claude-managed-setup-9gsmwzyx.js → claude-managed-setup-9m6450zk.js} +2 -2
- package/dist/{claude-sdk-session-dq1j4nz9.js → claude-sdk-session-0q0ptaba.js} +9066 -8818
- package/dist/{cli-n5yexkdg.js → cli-0b4zam62.js} +1 -0
- package/dist/{cli-5wfz00be.js → cli-0jzra9ad.js} +2 -2
- package/dist/{cli-eqtfgfr6.js → cli-2gxeg5gr.js} +1 -1
- package/dist/{cli-eqk5p56g.js → cli-2wnq8jkz.js} +9 -9
- package/dist/{cli-hfkwwy1h.js → cli-2zp0et3v.js} +21 -2
- package/dist/{cli-rt0ag4x1.js → cli-334z18y3.js} +4 -4
- package/dist/{cli-6m6b4bep.js → cli-3rkdne1h.js} +2 -2
- package/dist/{cli-3xddv0rk.js → cli-4txa0ter.js} +5 -7
- package/dist/{cli-jc1g9ndz.js → cli-5j88qqa8.js} +10 -5
- package/dist/{cli-xfjrc279.js → cli-5mrq3ake.js} +48 -14
- package/dist/{cli-n07eecjs.js → cli-6t09sdhy.js} +3 -3
- package/dist/{cli-38yww4e9.js → cli-6wxjceza.js} +8 -8
- package/dist/{cli-5xcb8gxq.js → cli-7b8sbmag.js} +8 -8
- package/dist/{cli-3xj33nrx.js → cli-7cp6aa1q.js} +10 -3
- package/dist/{cli-mp9aa8g5.js → cli-7p1kvkck.js} +6 -6
- package/dist/{cli-w3bk0dgv.js → cli-8aes17e4.js} +2 -2
- package/dist/{cli-n9abj89w.js → cli-8fknbnhw.js} +8 -8
- package/dist/{cli-xd5ebp64.js → cli-8kzasymh.js} +3 -3
- package/dist/{cli-2tsfpc70.js → cli-a7wvp2km.js} +1 -1
- package/dist/{cli-kx4c8j05.js → cli-abejgen1.js} +63 -19
- package/dist/{cli-36wdfzgn.js → cli-bsywb58a.js} +8 -8
- package/dist/{cli-yz7v0sh4.js → cli-c55z5chy.js} +4 -6
- package/dist/{cli-18qt3few.js → cli-deefvewm.js} +1 -1
- package/dist/{cli-jg24scat.js → cli-ee0b971j.js} +3 -3
- package/dist/cli-f3vq58d2.js +242 -0
- package/dist/{cli-3xcwp3z8.js → cli-ffhtssbp.js} +2 -2
- package/dist/{cli-rjyghzg4.js → cli-g70vxtjh.js} +2 -2
- package/dist/{cli-g1px1g2e.js → cli-gxkx0zzp.js} +1 -1
- package/dist/{cli-j7d73g1y.js → cli-h38x262p.js} +3035 -354
- package/dist/{cli-zjphdj1a.js → cli-j790gp2w.js} +40 -18
- package/dist/{cli-f2zenhja.js → cli-kc7v1nfv.js} +1 -1
- package/dist/{cli-td33w98c.js → cli-m23zjcy2.js} +10 -10
- package/dist/{cli-8ewkreqd.js → cli-m28atx8q.js} +7 -9
- package/dist/{cli-x9exydey.js → cli-m4dqmnbp.js} +1 -1
- package/dist/{cli-ybjdc978.js → cli-mrt48bx7.js} +7 -4
- package/dist/{cli-mr97t7cc.js → cli-p1bq50aa.js} +263 -14
- package/dist/{cli-ttbqe3q4.js → cli-p1w18yhx.js} +1 -1
- package/dist/{cli-nj3x45rw.js → cli-p2gfst4m.js} +52 -43
- package/dist/{cli-z9cs5m0w.js → cli-pasjcnmj.js} +12 -12
- package/dist/{cli-an1knn2k.js → cli-qa4wdgsy.js} +5 -5
- package/dist/{cli-xncjscpm.js → cli-qfedvmcr.js} +50 -24
- package/dist/{cli-tmft5dz2.js → cli-qmqk2yc2.js} +1 -1
- package/dist/{cli-bxz823sz.js → cli-qsnnd04k.js} +1 -1
- package/dist/{cli-cr14kftt.js → cli-qwca7s44.js} +3 -3
- package/dist/{cli-7wz05bx3.js → cli-rfywm85n.js} +460 -737
- package/dist/{cli-v2fwbnsk.js → cli-rmmpt0wm.js} +6 -6
- package/dist/{cli-xbtq4d6s.js → cli-rzsy6nc6.js} +12 -8
- package/dist/{cli-0m7rtm11.js → cli-s7t6p9my.js} +1 -1
- package/dist/{cli-16phend6.js → cli-sdtt3men.js} +1 -1
- package/dist/{cli-pyrxt9gw.js → cli-tk7cjj8h.js} +1 -1
- package/dist/{cli-xvymtmv4.js → cli-tqegb8eq.js} +3 -3
- package/dist/{cli-kf3pxxdg.js → cli-v1dv1r37.js} +1 -1
- package/dist/{cli-h49ejvmc.js → cli-wcg8x116.js} +1 -1
- package/dist/{cli-q581b386.js → cli-wk18cm92.js} +5 -5
- package/dist/{cli-4vwxp550.js → cli-x1wa213s.js} +1 -1
- package/dist/{cli-jrp1dt73.js → cli-xzm9vcfg.js} +1 -1
- package/dist/{cli-eb2azq8n.js → cli-y97qxcfx.js} +9 -9
- package/dist/{cli-55bkx8hh.js → cli-yq3zak69.js} +1 -1
- package/dist/cli.js +17 -17
- package/dist/{codex-adapter-yr60sme6.js → codex-adapter-30j9bpzd.js} +5 -6
- package/dist/{codex-hook-fac6175r.js → codex-hook-h3vk6xzr.js} +1 -1
- package/dist/{codex-session-runner-pch8x584.js → codex-session-runner-8vp57v8w.js} +5 -6
- package/dist/{commands-phjfbkv0.js → commands-bngnz9g7.js} +3 -3
- package/dist/{controller-jkx994pz.js → controller-hxx8wwy1.js} +2 -2
- package/dist/{controllers-connect-c4448kwa.js → controllers-connect-e2b4gyxc.js} +19 -20
- package/dist/{cursor-adapter-ndebqnm8.js → cursor-adapter-n5nc3mfe.js} +1 -2
- package/dist/{db-ez6egt6v.js → db-bgm7vkc0.js} +3 -3
- package/dist/{db-ef32tbfc.js → db-c6np41ca.js} +10 -2
- package/dist/{devin-adapter-z46ep5ph.js → devin-adapter-xedz98zv.js} +1 -1
- package/dist/{dispatcher-g3tt9hs9.js → dispatcher-jnybck15.js} +17 -18
- package/dist/{dsh-adapter-tcyn3099.js → dsh-adapter-nrhbrjz8.js} +1 -2
- package/dist/{easter-egg-3d-e36hk5td.js → easter-egg-3d-533knw22.js} +1 -1
- package/dist/{embedding-space-4kyh5qqj.js → embedding-space-crsm2zp0.js} +6 -6
- package/dist/{embeddings-6a8v4a6t.js → embeddings-e7z3f27f.js} +1 -1
- package/dist/{execute-3cbg0twf.js → execute-b3mrb1mv.js} +1 -1
- package/dist/{external-channel-se646snz.js → external-channel-m77wf5z3.js} +2 -2
- package/dist/{fx-adapter-yw795hqq.js → fx-adapter-b6w0kf56.js} +7 -8
- package/dist/{grok-adapter-ttmcss2j.js → grok-adapter-4sqtebdk.js} +7 -8
- package/dist/handlers-kdjcyzdj.js +32 -0
- package/dist/heartbeat-xgb036sx.js +43 -0
- package/dist/{hook-g3nhexsy.js → hook-5h02c9ga.js} +6 -6
- package/dist/{hook-hq93y5ej.js → hook-xsk1jbha.js} +5 -5
- package/dist/{http-5a9p4h6y.js → http-txe7qhvn.js} +282 -140
- package/dist/{index-6haqt3v5.js → index-4a0670yh.js} +8917 -8476
- package/dist/index-835xdgnm.js +33 -0
- package/dist/index-d469300x.js +37 -0
- package/dist/index-rzqwp11g.js +32 -0
- package/dist/{index-s72rqgsx.js → index-tvfafeyy.js} +1 -1
- package/dist/{index-hgn3c961.js → index-vk63emp7.js} +978 -35
- package/dist/{index-3c5pxbge.js → index-ysvbhg5m.js} +1 -1
- package/dist/{keepalive-1j4n4dmk.js → keepalive-4zsrce78.js} +3 -3
- package/dist/lead-yqt47dkr.js +70 -0
- package/dist/{maintenance-dmghacy5.js → maintenance-86jvartk.js} +1 -1
- package/dist/{oauth-refresh-sweep-yy06c03c.js → oauth-refresh-sweep-j52kg9pr.js} +2 -2
- package/dist/{onboard-52f9t5dm.js → onboard-c2aj5p8q.js} +3 -3
- package/dist/{opencode-adapter-krnh9jkn.js → opencode-adapter-dsagkhtw.js} +5 -6
- package/dist/{otel-impl-xjqz6wjj.js → otel-impl-yyy203z8.js} +1 -1
- package/dist/{pi-mono-adapter-dbxyp0qv.js → pi-mono-adapter-546cd1cc.js} +9 -9
- package/dist/{pricing-refresh-ctdr74pd.js → pricing-refresh-1rgzqyzz.js} +2 -3
- package/dist/{rbac-roles-q0gr8eyj.js → rbac-roles-e70xfeyj.js} +4 -6
- package/dist/{rbac-roles-ehv8s10n.js → rbac-roles-q89qe8er.js} +3 -3
- package/dist/{registry-hpjfmcfz.js → registry-32b1mft6.js} +1 -1
- package/dist/{render-v2-5b6chvcq.js → render-v2-k6tt107q.js} +3 -3
- package/dist/{resume-5a5d2845.js → resume-cnnrjfxa.js} +6 -6
- package/dist/{runtime-khxszyfp.js → runtime-1hv06jsn.js} +1 -1
- package/dist/{session-access-gj0bjhqg.js → session-access-xkxkjw3n.js} +4 -4
- package/dist/{session-source-backfill-2sy0krfk.js → session-source-backfill-1d5pdwww.js} +2 -2
- package/dist/{setup-7ssfakk1.js → setup-se8q7gkc.js} +1 -1
- package/dist/{virtual-modules-pjj0knwf.js → virtual-modules-gazyapte.js} +3 -3
- package/dist/{work-objects-bf3syvhq.js → work-objects-1kxnbzy5.js} +20 -21
- package/dist/{worker-follow-up-38xevga6.js → worker-follow-up-zqm8apt4.js} +17 -18
- package/dist/worker-j6xxtq7p.js +70 -0
- package/openapi.json +334 -7
- package/package.json +4 -4
- package/src/apps/definition.ts +11 -0
- package/src/apps/store.ts +28 -8
- package/src/be/db/model-profiles.ts +147 -38
- package/src/be/db/tasks/read.ts +5 -1
- package/src/be/db/workflow-run-definitions.ts +117 -0
- package/src/be/db.ts +24 -3
- package/src/be/memory/constants.ts +14 -1
- package/src/be/memory/key-paths.ts +8 -0
- package/src/be/memory/providers/sqlite-store.ts +160 -10
- package/src/be/memory/task-learning.ts +79 -14
- package/src/be/memory/types.ts +24 -1
- package/src/be/migrations/279_backfill_learning_expiry.sql +15 -0
- package/src/be/migrations/281_model_profiles_pr2.sql +28 -0
- package/src/be/migrations/283_workflow_run_definitions.sql +14 -0
- package/src/be/model-profile-check.ts +284 -0
- package/src/be/model-tier-resolution.ts +112 -12
- package/src/be/multi-runtime.ts +27 -0
- package/src/be/runtime-pools/routing.ts +52 -4
- package/src/be/scripts/typecheck.ts +1 -0
- package/src/be/seed-scripts/catalog/dreaming-learnings.ts +552 -0
- package/src/be/seed-scripts/catalog/dreaming-memtax-create.ts +389 -14
- package/src/be/seed-scripts/catalog/dreaming-memtax.ts +6 -3
- package/src/be/seed-scripts/index.ts +9 -0
- package/src/be/steering.ts +8 -2
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/runner.ts +32 -1
- package/src/fs/provider.ts +17 -3
- package/src/heartbeat/heartbeat.ts +12 -1
- package/src/heartbeat/index.ts +1 -0
- package/src/http/agents.ts +56 -4
- package/src/http/apps.ts +3 -1
- package/src/http/config.ts +2 -6
- package/src/http/index.ts +2 -3
- package/src/http/model-profiles.ts +58 -10
- package/src/http/poll.ts +36 -3
- package/src/http/schedules.ts +42 -3
- package/src/http/tasks.ts +37 -12
- package/src/http/workflows.ts +15 -2
- package/src/prompts/session-templates.ts +1 -1
- package/src/providers/acp-targets.ts +11 -6
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-sdk-session.ts +132 -23
- package/src/providers/codex-skill-resolver.ts +10 -4
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/providers/devin-skill-resolver.ts +5 -5
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/scheduler/schedule-task.ts +1 -0
- package/src/scripts-runtime/sdk-allowlist.ts +1 -0
- package/src/scripts-runtime/swarm-sdk.ts +18 -1
- package/src/scripts-runtime/types/stdlib.d.ts +1 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +1 -0
- package/src/server.ts +2 -0
- package/src/slack/app.ts +93 -0
- package/src/slack/inbound-dispatch.ts +18 -1
- package/src/slack/workspace-guard.ts +345 -0
- package/src/tasks/task-terminal-effects.ts +4 -0
- package/src/tasks/worker-follow-up.ts +102 -2
- package/src/tests/acp-adapter.test.ts +82 -0
- package/src/tests/apps-icon.test.ts +120 -0
- package/src/tests/chained-task-follow-up.test.ts +248 -0
- package/src/tests/check-pr-body.test.ts +40 -0
- package/src/tests/claude-sdk-lifecycle.test.ts +216 -1
- package/src/tests/claude-sdk-process.fixture.ts +57 -0
- package/src/tests/codex-skill-resolver.test.ts +31 -0
- package/src/tests/credentials-allowlist.test.ts +470 -0
- package/src/tests/db-task-read-contract.test.ts +5 -0
- package/src/tests/db-task-write-contract.test.ts +5 -0
- package/src/tests/deferred-wake-follow-up.test.ts +47 -0
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/dreaming-learnings.test.ts +1395 -0
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/explicit-model-validation.test.ts +2 -0
- package/src/tests/fs-provider.test.ts +42 -0
- package/src/tests/heartbeat.test.ts +28 -1
- package/src/tests/human-free-reclassify.test.ts +5 -1
- package/src/tests/list-endpoint-slimming.test.ts +17 -0
- package/src/tests/migration-283-workflow-run-definitions.test.ts +69 -0
- package/src/tests/model-profile-check.test.ts +387 -0
- package/src/tests/model-profiles-api.test.ts +528 -1
- package/src/tests/profile-claim.test.ts +415 -3
- package/src/tests/profile-tier-alias.test.ts +382 -0
- package/src/tests/schedule-profile.test.ts +359 -0
- package/src/tests/script-connections.test.ts +6 -0
- package/src/tests/script-per-script-executor.test.ts +1 -0
- package/src/tests/scripts-sdk-bridge-tool-failure.test.ts +141 -0
- package/src/tests/seed-scripts.test.ts +2 -2
- package/src/tests/slack-inbound-receipts.test.ts +22 -2
- package/src/tests/slack-socket-ack.test.ts +16 -1
- package/src/tests/slack-workspace-guard.test.ts +905 -0
- package/src/tests/steering-core.test.ts +40 -0
- package/src/tests/store-progress-learning.test.ts +605 -20
- package/src/tests/tool-annotations.test.ts +1 -1
- package/src/tests/workflow-convergence.test.ts +46 -40
- package/src/tests/workflow-definition-pinning-recovery.test.ts +552 -0
- package/src/tests/workflow-definition-pinning.test.ts +645 -0
- package/src/tests/workflow-executors.test.ts +16 -7
- package/src/tests/workflow-foreach.test.ts +43 -20
- package/src/tests/workflow-notify-slack-ready.test.ts +161 -0
- package/src/tests/workflow-profile.test.ts +328 -0
- package/src/tools/app-upsert.ts +1 -1
- package/src/tools/memory-edit.ts +2 -1
- package/src/tools/model-profiles/check-model-profile.ts +63 -0
- package/src/tools/schedules/create-schedule.ts +45 -4
- package/src/tools/schedules/patch-schedule.ts +50 -4
- package/src/tools/schedules/update-schedule.ts +50 -4
- package/src/tools/send-task.ts +17 -2
- package/src/tools/store-progress.ts +15 -3
- package/src/tools/task-action.ts +9 -1
- package/src/tools/templates.ts +13 -0
- package/src/tools/tool-config.ts +2 -1
- package/src/tools/utils.ts +61 -4
- package/src/tools/workflows/create-workflow.ts +1 -1
- package/src/tools/workflows/retry-workflow-run.ts +1 -1
- package/src/tools/workflows/update-workflow.ts +10 -1
- package/src/types.ts +56 -1
- package/src/utils/credentials.ts +89 -12
- package/src/workflows/engine.ts +10 -1
- package/src/workflows/executors/agent-task.ts +21 -2
- package/src/workflows/executors/foreach.ts +4 -1
- package/src/workflows/executors/notify.ts +62 -6
- package/src/workflows/executors/sub-workflow.ts +1 -1
- package/src/workflows/executors/swarm-script.ts +4 -1
- package/src/workflows/foreach-driver.ts +8 -5
- package/src/workflows/limits.ts +2 -1
- package/src/workflows/model-validation.ts +27 -2
- package/src/workflows/patch-definition.ts +3 -1
- package/src/workflows/recovery.ts +6 -6
- package/src/workflows/resume.ts +9 -9
- package/src/workflows/retry-poller.ts +2 -2
- package/templates/skills/apps/SKILL.md +2 -0
- package/templates/skills/apps/content.md +2 -0
- package/templates/skills/code-quality/content.md +12 -0
- package/templates/skills/memory/content.md +8 -0
- package/templates/skills/scheduling/config.json +1 -1
- package/templates/skills/scheduling/content.md +2 -2
- package/templates/skills/swarm-docs/content.md +4 -0
- package/templates/skills/swarm-extensions/content.md +1 -1
- package/templates/skills/swarm-scripts/SKILL.md +1 -1
- package/templates/skills/swarm-scripts/content.md +1 -1
- package/templates/skills/work-on-task/SKILL.md +2 -0
- package/templates/skills/work-on-task/content.md +2 -0
- package/templates/workflows/dreaming/content.md +174 -7
- package/dist/acp-adapter-srfhs1s9.js +0 -16
- package/dist/cli-bzvs88tv.js +0 -339
- package/dist/cli-cyn9v8zr.js +0 -748
- package/dist/cli-ed6yqpf1.js +0 -779
- package/dist/handlers-17wha3ze.js +0 -33
- package/dist/heartbeat-gwewgdms.js +0 -42
- package/dist/index-8arwq8mw.js +0 -34
- package/dist/index-tpw054az.js +0 -38
- package/dist/index-waq75j2j.js +0 -31
- package/dist/lead-re73kdgc.js +0 -72
- package/dist/worker-r8mz7a65.js +0 -72
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
contextBoundNoteThreshold,
|
|
3
3
|
createContextBoundNote
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import {
|
|
6
|
-
resolveSlashSkillPrompt
|
|
7
|
-
} from "./cli-jc1g9ndz.js";
|
|
4
|
+
} from "./cli-xzm9vcfg.js";
|
|
8
5
|
import {
|
|
9
6
|
applyReasoningEffort
|
|
10
7
|
} from "./cli-jrzkw01m.js";
|
|
8
|
+
import {
|
|
9
|
+
resolveSlashSkillPrompt
|
|
10
|
+
} from "./cli-5j88qqa8.js";
|
|
11
11
|
import {
|
|
12
12
|
CONTEXT_FORMULA,
|
|
13
13
|
computeContextUsedUnified,
|
|
14
14
|
clampContextPercent,
|
|
15
15
|
init_context_window
|
|
16
16
|
} from "./cli-m88rpzkh.js";
|
|
17
|
-
import {
|
|
18
|
-
ampBillsCacheWrites,
|
|
19
|
-
resolveAmpModel,
|
|
20
|
-
init_amp_models
|
|
21
|
-
} from "./cli-ttbqe3q4.js";
|
|
22
17
|
import {
|
|
23
18
|
detachedProcessGroup,
|
|
24
19
|
registerProcessGroup,
|
|
@@ -32,6 +27,11 @@ import {
|
|
|
32
27
|
swarmRuntimeInstanceId,
|
|
33
28
|
init_multi_runtime2
|
|
34
29
|
} from "./cli-mdb054w3.js";
|
|
30
|
+
import {
|
|
31
|
+
ampBillsCacheWrites,
|
|
32
|
+
resolveAmpModel,
|
|
33
|
+
init_amp_models
|
|
34
|
+
} from "./cli-p1w18yhx.js";
|
|
35
35
|
import {
|
|
36
36
|
scrubSecrets,
|
|
37
37
|
registerVolatileSecret,
|
|
@@ -48,7 +48,7 @@ init_context_window();
|
|
|
48
48
|
init_multi_runtime2();
|
|
49
49
|
init_process_group();
|
|
50
50
|
init_secret_scrubber();
|
|
51
|
-
var AMP_PACKAGE = "@ampcode/cli@0.0.
|
|
51
|
+
var AMP_PACKAGE = "@ampcode/cli@0.0.1793804260-g12625e";
|
|
52
52
|
var AMP_MCP_SERVER_NAME = "agent-swarm";
|
|
53
53
|
var AMP_PLUGIN_MODE_KEY = "agent-swarm";
|
|
54
54
|
var AMP_LIVE_TEST_TIMEOUT_MS = 5000;
|
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
isOperatorAuth,
|
|
5
5
|
init_request_auth_context,
|
|
6
6
|
getDbClient2,
|
|
7
|
+
isRbacEnabled,
|
|
8
|
+
can,
|
|
9
|
+
init_rbac,
|
|
7
10
|
getActiveTaskCount2,
|
|
8
11
|
getTaskById2,
|
|
9
12
|
getAgentCurrentTask2,
|
|
@@ -11,22 +14,17 @@ import {
|
|
|
11
14
|
init_active_sessions,
|
|
12
15
|
getSteeringMessageById2,
|
|
13
16
|
init_db4
|
|
14
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-h38x262p.js";
|
|
15
18
|
import {
|
|
16
19
|
userHoldsExplicitVerb2,
|
|
17
20
|
getUserGrant2,
|
|
18
21
|
init_rbac_roles
|
|
19
|
-
} from "./cli-
|
|
20
|
-
import {
|
|
21
|
-
isRbacEnabled,
|
|
22
|
-
can,
|
|
23
|
-
init_rbac
|
|
24
|
-
} from "./cli-cyn9v8zr.js";
|
|
22
|
+
} from "./cli-c55z5chy.js";
|
|
25
23
|
import {
|
|
26
24
|
findUserById,
|
|
27
25
|
findUserByExternalId,
|
|
28
26
|
init_users
|
|
29
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-gxkx0zzp.js";
|
|
30
28
|
import {
|
|
31
29
|
init_zod
|
|
32
30
|
} from "./cli-zcfpsfzf.js";
|
|
@@ -504,7 +502,7 @@ function route(def) {
|
|
|
504
502
|
try {
|
|
505
503
|
const rawBody = def.body ? await parseBody(req, def.maxBodyBytes) : undefined;
|
|
506
504
|
if (def.session && "bodyTaskIds" in def.session) {
|
|
507
|
-
const { bodySessionDenial } = await import("./session-access-
|
|
505
|
+
const { bodySessionDenial } = await import("./session-access-xkxkjw3n.js");
|
|
508
506
|
const denial = await bodySessionDenial(req, def.session.bodyTaskIds(rawBody));
|
|
509
507
|
if (denial) {
|
|
510
508
|
jsonError(res, denial, 403);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getMaxSkillChars
|
|
3
|
+
} from "./cli-5j88qqa8.js";
|
|
1
4
|
import {
|
|
2
5
|
scrubSecrets,
|
|
3
6
|
init_secret_scrubber
|
|
@@ -124,7 +127,6 @@ async function getOrCreatePlaybook(orgId, apiKey, title, body, swarmApiUrl, swar
|
|
|
124
127
|
// src/providers/devin-skill-resolver.ts
|
|
125
128
|
import { join } from "node:path";
|
|
126
129
|
var SKILL_COMMAND_REGEX = /^@skills:([a-z0-9:_-]+)(?:\s+(.*))?$/;
|
|
127
|
-
var MAX_SKILL_CHARS = Number(process.env.MAX_SKILL_CHARS) || 1e5;
|
|
128
130
|
function defaultSkillsDir() {
|
|
129
131
|
if (process.env.DEVIN_SKILLS_DIR) {
|
|
130
132
|
return process.env.DEVIN_SKILLS_DIR;
|
|
@@ -169,13 +171,14 @@ async function resolveDevinPrompt(prompt, skillsDir, emit) {
|
|
|
169
171
|
});
|
|
170
172
|
return prompt;
|
|
171
173
|
}
|
|
172
|
-
|
|
174
|
+
const maxSkillChars = getMaxSkillChars();
|
|
175
|
+
if (skillContent.length > maxSkillChars) {
|
|
173
176
|
emit?.({
|
|
174
177
|
type: "raw_stderr",
|
|
175
|
-
content: `[devin] skill resolver: SKILL.md for @skills:${commandName} exceeds ${
|
|
178
|
+
content: `[devin] skill resolver: SKILL.md for @skills:${commandName} exceeds ${maxSkillChars} chars (${skillContent.length}), truncating
|
|
176
179
|
`
|
|
177
180
|
});
|
|
178
|
-
skillContent = skillContent.slice(0,
|
|
181
|
+
skillContent = skillContent.slice(0, maxSkillChars);
|
|
179
182
|
}
|
|
180
183
|
const userRequestBody = trailingArgs && rest ? `${trailingArgs}
|
|
181
184
|
${rest}` : trailingArgs || rest;
|
|
@@ -56,11 +56,11 @@ import {
|
|
|
56
56
|
checkDependencies2,
|
|
57
57
|
emitBuiltInIntegrationConnectedOnce2,
|
|
58
58
|
init_db4
|
|
59
|
-
} from "./cli-
|
|
59
|
+
} from "./cli-h38x262p.js";
|
|
60
60
|
import {
|
|
61
61
|
getChannelBlockReason2,
|
|
62
62
|
init_external_channel
|
|
63
|
-
} from "./cli-
|
|
63
|
+
} from "./cli-qsnnd04k.js";
|
|
64
64
|
import {
|
|
65
65
|
workflowEventBus2,
|
|
66
66
|
init_event_bus
|
|
@@ -90,11 +90,11 @@ import {
|
|
|
90
90
|
import {
|
|
91
91
|
isTerminalTaskStatus,
|
|
92
92
|
init_types4
|
|
93
|
-
} from "./cli-
|
|
93
|
+
} from "./cli-2zp0et3v.js";
|
|
94
94
|
import {
|
|
95
95
|
taskAttachmentDisplayUrl,
|
|
96
96
|
init_task_attachment_links
|
|
97
|
-
} from "./cli-
|
|
97
|
+
} from "./cli-tk7cjj8h.js";
|
|
98
98
|
import {
|
|
99
99
|
getSlackConfiguration,
|
|
100
100
|
init_config4
|
|
@@ -11421,6 +11421,179 @@ var init_slack_inbound = __esm(() => {
|
|
|
11421
11421
|
};
|
|
11422
11422
|
});
|
|
11423
11423
|
|
|
11424
|
+
// src/slack/workspace-guard.ts
|
|
11425
|
+
function asRecord(value) {
|
|
11426
|
+
return value && typeof value === "object" ? value : undefined;
|
|
11427
|
+
}
|
|
11428
|
+
function asId(value) {
|
|
11429
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
11430
|
+
}
|
|
11431
|
+
function asFlag(value) {
|
|
11432
|
+
if (value === true || value === "true")
|
|
11433
|
+
return true;
|
|
11434
|
+
if (value === false || value === "false")
|
|
11435
|
+
return false;
|
|
11436
|
+
return null;
|
|
11437
|
+
}
|
|
11438
|
+
function toInstallation(teamId, enterpriseId, flag) {
|
|
11439
|
+
const installation = {
|
|
11440
|
+
teamId: asId(teamId),
|
|
11441
|
+
enterpriseId: asId(enterpriseId),
|
|
11442
|
+
isEnterpriseInstall: asFlag(flag)
|
|
11443
|
+
};
|
|
11444
|
+
return installation.teamId || installation.enterpriseId ? installation : null;
|
|
11445
|
+
}
|
|
11446
|
+
function readInboundInstallations(body) {
|
|
11447
|
+
const record = asRecord(body);
|
|
11448
|
+
if (!record)
|
|
11449
|
+
return [];
|
|
11450
|
+
const authorizations = Array.isArray(record.authorizations) ? record.authorizations : [];
|
|
11451
|
+
const fromAuthorizations = [];
|
|
11452
|
+
for (const entry of authorizations) {
|
|
11453
|
+
const authorization = asRecord(entry);
|
|
11454
|
+
const installation = toInstallation(authorization?.team_id, authorization?.enterprise_id, authorization?.is_enterprise_install);
|
|
11455
|
+
if (installation)
|
|
11456
|
+
fromAuthorizations.push(installation);
|
|
11457
|
+
}
|
|
11458
|
+
if (fromAuthorizations.length > 0 || record.type === "event_callback")
|
|
11459
|
+
return fromAuthorizations;
|
|
11460
|
+
const team = asRecord(record.team);
|
|
11461
|
+
const view = asRecord(record.view);
|
|
11462
|
+
const installation = toInstallation(asId(view?.app_installed_team_id) ?? record.team_id ?? team?.id, record.enterprise_id ?? asRecord(record.enterprise)?.id ?? team?.enterprise_id, record.is_enterprise_install);
|
|
11463
|
+
if (!installation)
|
|
11464
|
+
return [];
|
|
11465
|
+
const botId = asId(view?.bot_id) ?? (record.type === "block_actions" ? asId(asRecord(record.message)?.bot_id) : null);
|
|
11466
|
+
return [botId ? { ...installation, botId } : installation];
|
|
11467
|
+
}
|
|
11468
|
+
function classifyInboundOwnership(identity, installations) {
|
|
11469
|
+
if (!identity || installations.length === 0) {
|
|
11470
|
+
return { own: false, reason: "unverified_workspace" };
|
|
11471
|
+
}
|
|
11472
|
+
const owns = (installation) => {
|
|
11473
|
+
if (identity.isEnterpriseInstall) {
|
|
11474
|
+
if (identity.enterpriseId === null || installation.enterpriseId !== identity.enterpriseId) {
|
|
11475
|
+
return false;
|
|
11476
|
+
}
|
|
11477
|
+
if (installation.isEnterpriseInstall !== null)
|
|
11478
|
+
return installation.isEnterpriseInstall;
|
|
11479
|
+
if (installation.botId)
|
|
11480
|
+
return installation.botId === identity.botId;
|
|
11481
|
+
return installation.teamId === null;
|
|
11482
|
+
}
|
|
11483
|
+
if (identity.teamId === null || installation.teamId !== identity.teamId)
|
|
11484
|
+
return false;
|
|
11485
|
+
if (installation.isEnterpriseInstall !== null)
|
|
11486
|
+
return !installation.isEnterpriseInstall;
|
|
11487
|
+
if (installation.botId)
|
|
11488
|
+
return installation.botId === identity.botId;
|
|
11489
|
+
return true;
|
|
11490
|
+
};
|
|
11491
|
+
return installations.some(owns) ? { own: true } : { own: false, reason: "foreign_workspace" };
|
|
11492
|
+
}
|
|
11493
|
+
function inboundPayloadType(body) {
|
|
11494
|
+
const record = asRecord(body);
|
|
11495
|
+
if (!record)
|
|
11496
|
+
return "unknown";
|
|
11497
|
+
const eventType = asRecord(record.event)?.type;
|
|
11498
|
+
if (typeof eventType === "string")
|
|
11499
|
+
return `event:${eventType}`;
|
|
11500
|
+
if (typeof record.command === "string")
|
|
11501
|
+
return "command";
|
|
11502
|
+
return typeof record.type === "string" ? record.type : "unknown";
|
|
11503
|
+
}
|
|
11504
|
+
async function resolveSlackIdentity(client, isEnterpriseInstall) {
|
|
11505
|
+
return identityFromAuthTest(await client.auth.test(), isEnterpriseInstall);
|
|
11506
|
+
}
|
|
11507
|
+
function isSlackEnterpriseInstall(env = process.env) {
|
|
11508
|
+
return isEnvFlagEnabled("SLACK_ENTERPRISE_INSTALL", false, env);
|
|
11509
|
+
}
|
|
11510
|
+
function identityFromAuthTest(result, isEnterpriseInstall) {
|
|
11511
|
+
const teamId = asId(result.team_id);
|
|
11512
|
+
const enterpriseId = asId(result.enterprise_id);
|
|
11513
|
+
const botId = asId(result.bot_id);
|
|
11514
|
+
if (isEnterpriseInstall && !enterpriseId) {
|
|
11515
|
+
throw new Error("SLACK_ENTERPRISE_INSTALL is set but auth.test returned no enterprise_id");
|
|
11516
|
+
}
|
|
11517
|
+
if (!isEnterpriseInstall && !teamId) {
|
|
11518
|
+
throw new Error("auth.test returned no team_id");
|
|
11519
|
+
}
|
|
11520
|
+
return {
|
|
11521
|
+
teamId: isEnterpriseInstall ? null : teamId,
|
|
11522
|
+
enterpriseId,
|
|
11523
|
+
isEnterpriseInstall,
|
|
11524
|
+
...botId ? { botId } : {}
|
|
11525
|
+
};
|
|
11526
|
+
}
|
|
11527
|
+
function setSlackWorkspaceIdentitySource(source) {
|
|
11528
|
+
resolveIdentity = source;
|
|
11529
|
+
identity = null;
|
|
11530
|
+
pending = null;
|
|
11531
|
+
}
|
|
11532
|
+
function getCachedSlackWorkspaceIdentity() {
|
|
11533
|
+
return identity;
|
|
11534
|
+
}
|
|
11535
|
+
async function getSlackWorkspaceIdentity() {
|
|
11536
|
+
if (identity)
|
|
11537
|
+
return identity;
|
|
11538
|
+
if (!resolveIdentity)
|
|
11539
|
+
return null;
|
|
11540
|
+
if (pending)
|
|
11541
|
+
return pending;
|
|
11542
|
+
const source = resolveIdentity;
|
|
11543
|
+
pending = (async () => {
|
|
11544
|
+
try {
|
|
11545
|
+
const resolved = await source();
|
|
11546
|
+
if (resolveIdentity !== source)
|
|
11547
|
+
return null;
|
|
11548
|
+
identity = resolved;
|
|
11549
|
+
console.log(`[Slack] Workspace guard: team=${resolved.teamId ?? "none"} enterprise=${resolved.enterpriseId ?? "none"} enterpriseInstall=${resolved.isEnterpriseInstall}`);
|
|
11550
|
+
return resolved;
|
|
11551
|
+
} catch (error) {
|
|
11552
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
11553
|
+
console.error(`[Slack] Workspace guard: identity lookup failed: ${message}`);
|
|
11554
|
+
return null;
|
|
11555
|
+
} finally {
|
|
11556
|
+
if (resolveIdentity === source)
|
|
11557
|
+
pending = null;
|
|
11558
|
+
}
|
|
11559
|
+
})();
|
|
11560
|
+
return pending;
|
|
11561
|
+
}
|
|
11562
|
+
function checkInboundWorkspace(body, own = identity) {
|
|
11563
|
+
const installations = readInboundInstallations(body);
|
|
11564
|
+
const ownership = classifyInboundOwnership(own, installations);
|
|
11565
|
+
if (ownership.own)
|
|
11566
|
+
return ownership;
|
|
11567
|
+
const team = installations.map((i) => i.teamId ?? "-").join(",") || "none";
|
|
11568
|
+
const enterprise = installations.map((i) => i.enterpriseId ?? "-").join(",") || "none";
|
|
11569
|
+
const type = inboundPayloadType(body);
|
|
11570
|
+
const key = `${ownership.reason}|${team}|${enterprise}|${type}`;
|
|
11571
|
+
const now = Date.now();
|
|
11572
|
+
if (now - (lastWithheldLogAt.get(key) ?? 0) >= WITHHELD_LOG_INTERVAL_MS) {
|
|
11573
|
+
if (lastWithheldLogAt.size >= 1000)
|
|
11574
|
+
lastWithheldLogAt.clear();
|
|
11575
|
+
lastWithheldLogAt.set(key, now);
|
|
11576
|
+
console.warn(`[Slack] Withheld inbound delivery (${ownership.reason}): team=${team} enterprise=${enterprise} type=${type}`);
|
|
11577
|
+
}
|
|
11578
|
+
return ownership;
|
|
11579
|
+
}
|
|
11580
|
+
function installSocketWorkspaceGate(client, getIdentity = getCachedSlackWorkspaceIdentity) {
|
|
11581
|
+
const emit = client.emit.bind(client);
|
|
11582
|
+
client.emit = (event, ...args) => {
|
|
11583
|
+
if (event !== "slack_event")
|
|
11584
|
+
return emit(event, ...args);
|
|
11585
|
+
const body = args[0]?.body;
|
|
11586
|
+
if (checkInboundWorkspace(body, getIdentity()).own)
|
|
11587
|
+
return emit(event, ...args);
|
|
11588
|
+
return true;
|
|
11589
|
+
};
|
|
11590
|
+
}
|
|
11591
|
+
var resolveIdentity = null, identity = null, pending = null, WITHHELD_LOG_INTERVAL_MS = 60000, lastWithheldLogAt;
|
|
11592
|
+
var init_workspace_guard = __esm(() => {
|
|
11593
|
+
init_env_flag();
|
|
11594
|
+
lastWithheldLogAt = new Map;
|
|
11595
|
+
});
|
|
11596
|
+
|
|
11424
11597
|
// src/slack/inbound-dispatch.ts
|
|
11425
11598
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11426
11599
|
import { createHash } from "node:crypto";
|
|
@@ -11488,10 +11661,19 @@ function recordSlackSocketAckNotReady() {
|
|
|
11488
11661
|
counters.socket.ackNotReady += 1;
|
|
11489
11662
|
}
|
|
11490
11663
|
function slackInboundOutcomeMiddleware() {
|
|
11491
|
-
return async ({ next }) => {
|
|
11664
|
+
return async ({ next, body }) => {
|
|
11665
|
+
const identity = getCachedSlackWorkspaceIdentity();
|
|
11666
|
+
const ownership = checkInboundWorkspace(body, identity);
|
|
11492
11667
|
const existing = deliveryStorage.getStore();
|
|
11493
11668
|
if (existing) {
|
|
11494
11669
|
existing.dispatched = true;
|
|
11670
|
+
if (!ownership.own) {
|
|
11671
|
+
if (!identity)
|
|
11672
|
+
existing.failures.push("workspace_identity_unavailable");
|
|
11673
|
+
else
|
|
11674
|
+
existing.ignoredReasons.push(ownership.reason);
|
|
11675
|
+
return;
|
|
11676
|
+
}
|
|
11495
11677
|
try {
|
|
11496
11678
|
await next();
|
|
11497
11679
|
} catch (error) {
|
|
@@ -11502,6 +11684,11 @@ function slackInboundOutcomeMiddleware() {
|
|
|
11502
11684
|
}
|
|
11503
11685
|
const state = newDeliveryState("socket", false);
|
|
11504
11686
|
state.dispatched = true;
|
|
11687
|
+
if (!ownership.own) {
|
|
11688
|
+
state.ignoredReasons.push(ownership.reason);
|
|
11689
|
+
recordOutcome("socket", resolveSlackInboundOutcome(state));
|
|
11690
|
+
return;
|
|
11691
|
+
}
|
|
11505
11692
|
await deliveryStorage.run(state, async () => {
|
|
11506
11693
|
try {
|
|
11507
11694
|
await next();
|
|
@@ -11737,6 +11924,7 @@ var init_inbound_dispatch = __esm(() => {
|
|
|
11737
11924
|
init_slack_inbound();
|
|
11738
11925
|
init_secret_scrubber();
|
|
11739
11926
|
init_config4();
|
|
11927
|
+
init_workspace_guard();
|
|
11740
11928
|
deliveryStorage = new AsyncLocalStorage;
|
|
11741
11929
|
counters = {
|
|
11742
11930
|
socket: emptyCounters(),
|
|
@@ -11967,7 +12155,7 @@ async function initOtel(serviceRole = process.env.AGENT_ROLE || "api") {
|
|
|
11967
12155
|
return;
|
|
11968
12156
|
initialized = true;
|
|
11969
12157
|
try {
|
|
11970
|
-
const impl = await import("./otel-impl-
|
|
12158
|
+
const impl = await import("./otel-impl-yyy203z8.js");
|
|
11971
12159
|
await impl.boot(serviceRole, {
|
|
11972
12160
|
exportConsoleLogs: serviceRole === "api" && isApiLogExportEnabled()
|
|
11973
12161
|
});
|
|
@@ -16143,22 +16331,27 @@ async function initSlackApp2() {
|
|
|
16143
16331
|
receiver,
|
|
16144
16332
|
socketMode: true,
|
|
16145
16333
|
logLevel,
|
|
16334
|
+
deferInitialization: true,
|
|
16146
16335
|
...clientOptions ? { clientOptions } : {}
|
|
16147
16336
|
});
|
|
16148
16337
|
inboundDrain = installSocketAckRecovery(receiver.client, app);
|
|
16338
|
+
const authClient = app.client;
|
|
16339
|
+
const enterpriseInstall = isSlackEnterpriseInstall();
|
|
16340
|
+
setSlackWorkspaceIdentitySource(() => resolveSlackIdentity(authClient, enterpriseInstall));
|
|
16341
|
+
installSocketWorkspaceGate(receiver.client);
|
|
16149
16342
|
initialized2 = true;
|
|
16150
16343
|
app.use(slackInboundOutcomeMiddleware());
|
|
16151
|
-
const { registerMessageHandler } = await import("./handlers-
|
|
16152
|
-
const { registerCommandHandler } = await import("./commands-
|
|
16153
|
-
const { registerActionHandlers } = await import("./actions-
|
|
16154
|
-
const { registerWorkObjectHandlers } = await import("./work-objects-
|
|
16344
|
+
const { registerMessageHandler } = await import("./handlers-kdjcyzdj.js");
|
|
16345
|
+
const { registerCommandHandler } = await import("./commands-bngnz9g7.js");
|
|
16346
|
+
const { registerActionHandlers } = await import("./actions-7e9czc7s.js");
|
|
16347
|
+
const { registerWorkObjectHandlers } = await import("./work-objects-1kxnbzy5.js");
|
|
16155
16348
|
registerMessageHandler(app);
|
|
16156
16349
|
registerCommandHandler(app);
|
|
16157
16350
|
registerActionHandlers(app);
|
|
16158
16351
|
registerWorkObjectHandlers(app);
|
|
16159
|
-
const { createAssistant } = await import("./assistant-
|
|
16352
|
+
const { createAssistant } = await import("./assistant-wjb7v4c7.js");
|
|
16160
16353
|
app.assistant(createAssistant());
|
|
16161
|
-
const { isBlockExternalEnabled, scanExternalChannelsOnBoot } = await import("./external-channel-
|
|
16354
|
+
const { isBlockExternalEnabled, scanExternalChannelsOnBoot } = await import("./external-channel-m77wf5z3.js");
|
|
16162
16355
|
if (isBlockExternalEnabled()) {
|
|
16163
16356
|
scanExternalChannelsOnBoot(app.client).catch((error) => {
|
|
16164
16357
|
console.error("[Slack] External channel boot scan failed:", error);
|
|
@@ -16173,8 +16366,19 @@ async function startSlackApp2() {
|
|
|
16173
16366
|
}
|
|
16174
16367
|
const current = app;
|
|
16175
16368
|
if (current && generation === lifecycleGeneration) {
|
|
16369
|
+
clearStartRetry();
|
|
16370
|
+
const verified = await verifySlackIdentity(current);
|
|
16371
|
+
if (generation !== lifecycleGeneration)
|
|
16372
|
+
return false;
|
|
16373
|
+
if (!verified) {
|
|
16374
|
+
const delay = scheduleStartRetry();
|
|
16375
|
+
setSlackConnectionState("disconnected");
|
|
16376
|
+
console.error(`[Slack] Socket Mode not started: this swarm's workspace is unknown. Retrying in ${seconds(delay)}s`);
|
|
16377
|
+
return false;
|
|
16378
|
+
}
|
|
16379
|
+
startRetryAttempt = 0;
|
|
16176
16380
|
startSocketWatchdog();
|
|
16177
|
-
const { isSlackRenderV2Enabled } = await import("./render-v2-
|
|
16381
|
+
const { isSlackRenderV2Enabled } = await import("./render-v2-k6tt107q.js");
|
|
16178
16382
|
if (isSlackRenderV2Enabled())
|
|
16179
16383
|
await ensureSlackRenderV2Activation2();
|
|
16180
16384
|
await recoverSlackInboundAfterRestart();
|
|
@@ -16193,6 +16397,44 @@ async function startSlackApp2() {
|
|
|
16193
16397
|
}
|
|
16194
16398
|
return false;
|
|
16195
16399
|
}
|
|
16400
|
+
async function verifySlackIdentity(current) {
|
|
16401
|
+
if (!await getSlackWorkspaceIdentity())
|
|
16402
|
+
return false;
|
|
16403
|
+
if (boltInitialized)
|
|
16404
|
+
return true;
|
|
16405
|
+
try {
|
|
16406
|
+
await current.init();
|
|
16407
|
+
} catch (error) {
|
|
16408
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
16409
|
+
console.error(`[Slack] Bolt initialization failed: ${message}`);
|
|
16410
|
+
return false;
|
|
16411
|
+
}
|
|
16412
|
+
boltInitialized = true;
|
|
16413
|
+
return true;
|
|
16414
|
+
}
|
|
16415
|
+
function clearStartRetry() {
|
|
16416
|
+
if (startRetryTimer)
|
|
16417
|
+
clearTimeout(startRetryTimer);
|
|
16418
|
+
startRetryTimer = null;
|
|
16419
|
+
}
|
|
16420
|
+
function scheduleStartRetry() {
|
|
16421
|
+
const delay = startRetryDelaysMs[Math.min(startRetryAttempt, startRetryDelaysMs.length - 1)];
|
|
16422
|
+
startRetryAttempt += 1;
|
|
16423
|
+
const generation = lifecycleGeneration;
|
|
16424
|
+
startRetryTimer = setTimeout(() => {
|
|
16425
|
+
startRetryTimer = null;
|
|
16426
|
+
runSlackLifecycleExclusive(async () => {
|
|
16427
|
+
if (generation !== lifecycleGeneration)
|
|
16428
|
+
return;
|
|
16429
|
+
await startSlackApp2();
|
|
16430
|
+
}).catch((error) => {
|
|
16431
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
16432
|
+
console.error(`[Slack] Start retry failed: ${scrubSecrets(message)}`);
|
|
16433
|
+
});
|
|
16434
|
+
}, delay);
|
|
16435
|
+
startRetryTimer.unref?.();
|
|
16436
|
+
return delay;
|
|
16437
|
+
}
|
|
16196
16438
|
async function stopSlackApp2() {
|
|
16197
16439
|
const locked = runSlackLifecycleExclusive(stopSlackAppUnderLifecycleLock2);
|
|
16198
16440
|
const waitMs = watchdogOptions.stopLockWaitMs;
|
|
@@ -16234,18 +16476,22 @@ function detachSlackApp() {
|
|
|
16234
16476
|
socketFence?.retire();
|
|
16235
16477
|
socketFence = null;
|
|
16236
16478
|
lifecycleGeneration += 1;
|
|
16479
|
+
clearStartRetry();
|
|
16480
|
+
startRetryAttempt = 0;
|
|
16481
|
+
boltInitialized = false;
|
|
16237
16482
|
stopTaskWatcher();
|
|
16238
16483
|
inboundDrain?.stop();
|
|
16239
16484
|
inboundDrain = null;
|
|
16240
16485
|
const detached = app;
|
|
16241
16486
|
app = null;
|
|
16242
16487
|
receiver = null;
|
|
16488
|
+
setSlackWorkspaceIdentitySource(null);
|
|
16243
16489
|
lastSocketActivityAt = null;
|
|
16244
16490
|
setSlackConnectionState("disconnected");
|
|
16245
16491
|
initialized2 = false;
|
|
16246
16492
|
return detached;
|
|
16247
16493
|
}
|
|
16248
|
-
var import_bolt4, app = null, receiver = null, initialized2 = false, inboundDrain = null, socketFence = null, lifecycleGeneration = 0, lastSocketActivityAt = null, SOCKET_EVENT_STATES, SLACK_SOCKET_WATCHDOG_DEFAULTS, watchdogTimer = null, watchdogOptions;
|
|
16494
|
+
var import_bolt4, app = null, receiver = null, initialized2 = false, inboundDrain = null, socketFence = null, lifecycleGeneration = 0, lastSocketActivityAt = null, DEFAULT_START_RETRY_DELAYS_MS, startRetryDelaysMs, startRetryTimer = null, startRetryAttempt = 0, boltInitialized = false, SOCKET_EVENT_STATES, SLACK_SOCKET_WATCHDOG_DEFAULTS, watchdogTimer = null, watchdogOptions;
|
|
16249
16495
|
var init_app3 = __esm(() => {
|
|
16250
16496
|
init_db4();
|
|
16251
16497
|
init_node_env();
|
|
@@ -16260,7 +16506,10 @@ var init_app3 = __esm(() => {
|
|
|
16260
16506
|
init_socket_fence();
|
|
16261
16507
|
init_socket_mode_guard();
|
|
16262
16508
|
init_watcher();
|
|
16509
|
+
init_workspace_guard();
|
|
16263
16510
|
import_bolt4 = __toESM(require_dist5(), 1);
|
|
16511
|
+
DEFAULT_START_RETRY_DELAYS_MS = [5000, 15000, 30000, 60000, 120000, 300000];
|
|
16512
|
+
startRetryDelaysMs = DEFAULT_START_RETRY_DELAYS_MS;
|
|
16264
16513
|
SOCKET_EVENT_STATES = {
|
|
16265
16514
|
connecting: "connecting",
|
|
16266
16515
|
reconnecting: "connecting",
|