@desplega.ai/agent-swarm 2.7.10 → 2.8.1
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-pdy3qsvg.js +15 -0
- package/dist/{actions-b8aqhrsg.js → actions-pwjpn0j6.js} +19 -20
- package/dist/{amp-adapter-4c165vgn.js → amp-adapter-cq9jgj6x.js} +2 -3
- package/dist/{app-m9khefrh.js → app-cnfffgwg.js} +3 -3
- package/dist/{assistant-rh4v3ntz.js → assistant-kpn317y1.js} +21 -22
- package/dist/{boot-args-schema-hwkc8bzv.js → boot-args-schema-pbbnhmc3.js} +1 -1
- package/dist/{boot-reembed-fdyk55h4.js → boot-reembed-9m0ysxma.js} +1 -1
- package/dist/{boot-reembed-5y6yw9sj.js → boot-reembed-majbn53m.js} +1 -1
- package/dist/{boot-scrub-sweep-r5r8kqsn.js → boot-scrub-sweep-app8g8ym.js} +3 -3
- package/dist/{boot-seeds-8f9zt5cm.js → boot-seeds-pbtmvcjm.js} +4 -5
- package/dist/{claude-adapter-s5df247c.js → claude-adapter-wn1g3qp5.js} +7 -8
- package/dist/{claude-managed-adapter-h74d06yz.js → claude-managed-adapter-jh6c523j.js} +3 -3
- package/dist/{claude-managed-setup-9gsmwzyx.js → claude-managed-setup-pd47nzch.js} +6 -6
- package/dist/{claude-sdk-session-dq1j4nz9.js → claude-sdk-session-3a2a6589.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-zjphdj1a.js → cli-0ntbxyaa.js} +40 -18
- package/dist/{cli-yz7v0sh4.js → cli-1xh9a7hn.js} +4 -6
- package/dist/{cli-eqtfgfr6.js → cli-2gxeg5gr.js} +1 -1
- package/dist/{cli-hfkwwy1h.js → cli-2zp0et3v.js} +21 -2
- package/dist/{cli-6m6b4bep.js → cli-3rkdne1h.js} +2 -2
- package/dist/{cli-mr97t7cc.js → cli-4r05hnqa.js} +263 -14
- package/dist/{cli-jc1g9ndz.js → cli-5j88qqa8.js} +10 -5
- package/dist/{cli-xfjrc279.js → cli-5mrq3ake.js} +48 -14
- package/dist/{cli-an1knn2k.js → cli-6mma83xa.js} +5 -5
- package/dist/{cli-tph5wt3y.js → cli-6wj7p986.js} +1 -1
- package/dist/{cli-t73cas91.js → cli-7349va39.js} +8100 -7620
- 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-j7d73g1y.js → cli-7w69ne2f.js} +3035 -354
- package/dist/{cli-cr14kftt.js → cli-89cqnasv.js} +3 -3
- package/dist/{cli-w3bk0dgv.js → cli-8aes17e4.js} +2 -2
- package/dist/{cli-7wz05bx3.js → cli-93k32c37.js} +468 -745
- package/dist/{cli-eqk5p56g.js → cli-9vhebtjz.js} +9 -9
- package/dist/{cli-td33w98c.js → cli-9wngrawf.js} +10 -10
- package/dist/cli-a3b239vq.js +242 -0
- package/dist/{cli-kx4c8j05.js → cli-b085njxz.js} +63 -19
- package/dist/{cli-8ewkreqd.js → cli-b5rs97a6.js} +7 -9
- package/dist/{cli-bxz823sz.js → cli-b8e9nb04.js} +1 -1
- package/dist/{cli-nj3x45rw.js → cli-bb431xey.js} +52 -43
- package/dist/{cli-36wdfzgn.js → cli-bsywb58a.js} +8 -8
- package/dist/{cli-18qt3few.js → cli-cyhbbd1z.js} +1 -1
- package/dist/{cli-eb2azq8n.js → cli-d3p5vwbk.js} +9 -9
- package/dist/{cli-2tsfpc70.js → cli-dy32zecz.js} +1 -1
- package/dist/{cli-rjyghzg4.js → cli-g70vxtjh.js} +2 -2
- package/dist/{cli-55bkx8hh.js → cli-gax7fk3t.js} +1 -1
- package/dist/{cli-jg24scat.js → cli-jcpr5smb.js} +3 -3
- package/dist/{cli-n07eecjs.js → cli-jywyhqws.js} +3 -3
- package/dist/{cli-38yww4e9.js → cli-k0615eh8.js} +8 -8
- package/dist/{cli-3xddv0rk.js → cli-k26bkr9t.js} +5 -7
- package/dist/{cli-xd5ebp64.js → cli-k93bq1wq.js} +3 -3
- package/dist/{cli-f2zenhja.js → cli-kc7v1nfv.js} +1 -1
- package/dist/{cli-x9exydey.js → cli-m4dqmnbp.js} +1 -1
- package/dist/{cli-gpwhbgx0.js → cli-m9s2qff2.js} +57 -25
- package/dist/{cli-ybjdc978.js → cli-mrt48bx7.js} +7 -4
- package/dist/{cli-ttbqe3q4.js → cli-p1w18yhx.js} +1 -1
- package/dist/{cli-h49ejvmc.js → cli-pcad4cb1.js} +1 -1
- package/dist/{cli-tmft5dz2.js → cli-qmqk2yc2.js} +1 -1
- package/dist/{cli-g1px1g2e.js → cli-re4raaj0.js} +1 -1
- package/dist/{cli-xbtq4d6s.js → cli-sn7rtnj4.js} +12 -8
- package/dist/{cli-n9abj89w.js → cli-syybb0p1.js} +8 -8
- package/dist/{cli-v2fwbnsk.js → cli-tacge1w0.js} +6 -6
- 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-z9cs5m0w.js → cli-vbh10fqa.js} +12 -12
- package/dist/{cli-3xcwp3z8.js → cli-vj75tyaw.js} +3 -3
- package/dist/{cli-xncjscpm.js → cli-vqptjbr7.js} +50 -24
- package/dist/{cli-q581b386.js → cli-wk18cm92.js} +5 -5
- package/dist/{cli-4vwxp550.js → cli-x1wa213s.js} +1 -1
- package/dist/{cli-n9ftpys4.js → cli-x6t50dmw.js} +7 -7
- package/dist/{cli-jrp1dt73.js → cli-xzm9vcfg.js} +1 -1
- package/dist/{cli-16phend6.js → cli-yn2bbre9.js} +1 -1
- package/dist/{cli-rt0ag4x1.js → cli-yncmerje.js} +5 -5
- package/dist/{cli-0m7rtm11.js → cli-zcsw143p.js} +1 -1
- package/dist/cli.js +18 -18
- package/dist/{codex-adapter-yr60sme6.js → codex-adapter-nha71q3n.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-ak9x1k1h.js} +5 -6
- package/dist/{commands-phjfbkv0.js → commands-f587qpq8.js} +3 -3
- package/dist/{controller-jkx994pz.js → controller-hxx8wwy1.js} +2 -2
- package/dist/{controllers-connect-c4448kwa.js → controllers-connect-k5sg9m9h.js} +20 -21
- package/dist/{cursor-adapter-ndebqnm8.js → cursor-adapter-n5nc3mfe.js} +1 -2
- package/dist/{db-ef32tbfc.js → db-amm8w15a.js} +10 -2
- package/dist/{db-ez6egt6v.js → db-nzf8zb5z.js} +3 -3
- package/dist/{devin-adapter-z46ep5ph.js → devin-adapter-xedz98zv.js} +1 -1
- package/dist/{dispatcher-g3tt9hs9.js → dispatcher-89zrts8f.js} +18 -19
- 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-ezwenjmj.js} +6 -6
- package/dist/{embeddings-6a8v4a6t.js → embeddings-np74ht6g.js} +1 -1
- package/dist/{execute-3cbg0twf.js → execute-b3mrb1mv.js} +1 -1
- package/dist/{external-channel-se646snz.js → external-channel-z46yx9d7.js} +2 -2
- package/dist/{fx-adapter-yw795hqq.js → fx-adapter-3q12snn6.js} +7 -8
- package/dist/{grok-adapter-ttmcss2j.js → grok-adapter-ahb1w033.js} +7 -8
- package/dist/handlers-vbww69re.js +32 -0
- package/dist/heartbeat-dt9qw9c8.js +43 -0
- package/dist/{hook-hq93y5ej.js → hook-8k6fbz9b.js} +5 -5
- package/dist/{hook-g3nhexsy.js → hook-jgcgygex.js} +6 -6
- package/dist/{http-5a9p4h6y.js → http-haw4r8ne.js} +284 -142
- package/dist/{index-0eny15vj.js → index-2skqtd76.js} +2 -2
- package/dist/{index-6haqt3v5.js → index-4a0670yh.js} +8917 -8476
- package/dist/index-4xwaf5th.js +32 -0
- package/dist/{index-3c5pxbge.js → index-5gk12my8.js} +1 -1
- package/dist/{index-w7em4ktq.js → index-d6wkh8ar.js} +2 -2
- package/dist/index-f0hcrs8e.js +33 -0
- package/dist/{index-rvccek1w.js → index-gjwaqaq8.js} +5 -5
- package/dist/{index-e5pfbsys.js → index-hjhfk3ra.js} +3 -3
- package/dist/{index-1qw6f2dc.js → index-khe3gp0k.js} +4 -4
- package/dist/index-s4ewdma4.js +37 -0
- package/dist/{index-hgn3c961.js → index-tez78qj3.js} +979 -36
- package/dist/{index-s72rqgsx.js → index-tvfafeyy.js} +1 -1
- package/dist/{keepalive-1j4n4dmk.js → keepalive-xn6s7rmg.js} +3 -3
- package/dist/lead-6ygbfhbh.js +70 -0
- package/dist/{maintenance-dmghacy5.js → maintenance-vdts800b.js} +1 -1
- package/dist/{node-je82wjet.js → node-4c5jqxr3.js} +1 -1
- package/dist/{oauth-refresh-sweep-yy06c03c.js → oauth-refresh-sweep-094c8wfk.js} +2 -2
- package/dist/{onboard-52f9t5dm.js → onboard-v99eh56m.js} +3 -3
- package/dist/{opencode-adapter-krnh9jkn.js → opencode-adapter-dsagkhtw.js} +5 -6
- package/dist/{otel-impl-xjqz6wjj.js → otel-impl-q7yr9yp0.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-7dh2yase.js} +2 -3
- package/dist/{rbac-roles-ehv8s10n.js → rbac-roles-mdmc96p4.js} +3 -3
- package/dist/{rbac-roles-q0gr8eyj.js → rbac-roles-npbmdh77.js} +4 -6
- package/dist/{registry-hpjfmcfz.js → registry-32b1mft6.js} +1 -1
- package/dist/{render-v2-5b6chvcq.js → render-v2-twhhwmms.js} +3 -3
- package/dist/{resume-5a5d2845.js → resume-5gsrjd5e.js} +6 -6
- package/dist/{runtime-khxszyfp.js → runtime-1hv06jsn.js} +1 -1
- package/dist/{session-access-gj0bjhqg.js → session-access-m191x30x.js} +4 -4
- package/dist/{session-source-backfill-2sy0krfk.js → session-source-backfill-nt923ask.js} +2 -2
- package/dist/{setup-7ssfakk1.js → setup-wv467afy.js} +1 -1
- package/dist/{virtual-modules-pjj0knwf.js → virtual-modules-gazyapte.js} +3 -3
- package/dist/{work-objects-bf3syvhq.js → work-objects-8zkrpy13.js} +21 -22
- package/dist/{worker-follow-up-38xevga6.js → worker-follow-up-cecqszem.js} +18 -19
- package/dist/worker-mz5z7kj0.js +70 -0
- package/openapi.json +334 -7
- package/package.json +5 -5
- 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/eval-harness.ts +14 -1
- package/src/scripts-runtime/executors/types.ts +3 -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/mcp-tools.test.ts +1 -1
- 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-native-unawaited-drain.test.ts +167 -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/script-run.ts +1 -1
- 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 +2 -2
- package/templates/skills/swarm-scripts/content.md +2 -2
- 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
|
@@ -3,19 +3,17 @@ import {
|
|
|
3
3
|
init_db_client,
|
|
4
4
|
getDb2,
|
|
5
5
|
getDbClient2,
|
|
6
|
+
PermissionVerbSchema,
|
|
7
|
+
init_rbac,
|
|
6
8
|
invalidateTelemetryUserRole,
|
|
7
9
|
init_telemetry_identity,
|
|
8
10
|
init_db4
|
|
9
|
-
} from "./cli-
|
|
10
|
-
import {
|
|
11
|
-
PermissionVerbSchema,
|
|
12
|
-
init_rbac
|
|
13
|
-
} from "./cli-cyn9v8zr.js";
|
|
11
|
+
} from "./cli-7w69ne2f.js";
|
|
14
12
|
import {
|
|
15
13
|
revokeAllUserCredentials,
|
|
16
14
|
isLiveUserToken,
|
|
17
15
|
init_users
|
|
18
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-re4raaj0.js";
|
|
19
17
|
import {
|
|
20
18
|
init_env_flag
|
|
21
19
|
} from "./cli-cebvbc9t.js";
|
|
@@ -2173,7 +2173,7 @@ function checkExtensionInstallSource(body, ctx) {
|
|
|
2173
2173
|
ctx.addIssue({ code: "custom", path: ["files"], message: "files is required with manifest" });
|
|
2174
2174
|
}
|
|
2175
2175
|
}
|
|
2176
|
-
var AssetKeySchema, AssetEntityTypeSchema, AssetProviderRefSchema, AssetKeyMappingSchema, AssetSummarySchema, ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, LEGACY_MODEL_TO_TIER, DEFAULT_MODEL_TIER_MAP, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, OPEN_TASK_STATUSES, InboxMessageStatusSchema, InboxMessageSchema, AgentTaskSourceSchema, RoutingReasonSchema, RoutingSourceSchema, ProviderNameSchema, ModelProfileNameSchema, ModelProfileSchema, SessionShareAccessSchema, SessionAccessSchema, SessionOwnerSchema, SessionSharesSchema, SessionSharesUpdateSchema, SteerModeSchema, SteeringStatusSchema, SteeringSourceSchema, SteeringMessageSchema, SteerOutcomeSchema, OnUnsupportedSchema, SteerResultSchema, PROVIDER_STEER_CAPABILITIES, FollowUpConfigSchema, RoutingAffinitySchema, AgentTaskSchema, CreateTaskOptionsSchema, TaskAttachmentKindSchema, SERVER_GENERATED_ATTACHMENT_CAPABILITY = "_agentSwarmGeneratedBy", attachmentCapabilitiesSchema, attachmentCommonFields, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, RbacRoleSchema, UserRbacRolesSchema, UserCommsPrefsSchema, IdentityEventTypeSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, FavoriteItemTypeSchema, UserFavoriteSchema, TaskTemplateKindSchema, TaskTemplateSchema, AgentStatusSchema, AgentAvatarSchema, AgentSlackIconSchema, AgentSchema, AgentCredStatusKeyResultSchema, AgentCredStatusLiveTestSchema, AgentLatestModelSchema, AgentBedrockStatusSchema, AgentOpencodeGoStatusSchema, AcpSessionConfigSelectValueSchema, AcpSessionConfigSelectGroupSchema, AcpSessionConfigOptionSchema, AgentAcpStatusSchema, AgentCredStatusSchema, AgentWithTasksSchema, ChangeSourceSchema, VersionableFieldSchema, ContextVersionSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, AgentLogEventTypeSchema, ResumeReasonSchema, AgentLogSchema, SessionLogSchema, SessionCostSourceSchema, SessionCostModelBreakdownSchema, SessionCostSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, SwarmEventSchema, AutomationIntegrationIdSchema, ScheduledTaskTargetTypeSchema, ScheduledTaskSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, REPO_GUIDELINES_MAX_ENTRIES = 50, RepoGuidelinesInputSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, ActiveSessionSchema, WorkerNudgeSchema, RuntimeInstanceStatusSchema, RuntimeProviderKindSchema, DeliveryModeSchema, PoolLifecycleSchema, RuntimeResourcesSchema, RuntimeControllerCreateSchema, RuntimeControllerUpdateSchema, RuntimeControllerSchema, RuntimePoolCacheSchema, RuntimePoolCreateSchema, RuntimePoolUpdateSchema, RuntimePoolSchema, RuntimePoolCreateAgentSchema, RuntimeInstanceSchema, RetryPolicySchema, SUPERSEDED_WORKFLOW_TASK_REASON = "superseded_workflow_task", ExecutorMetaSchema, ValidationResultSchema, StepValidationConfigSchema, SwarmScriptNodeConfigSchema, WorkflowNodeSchema, WorkflowEdgeSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, WebhookVerificationSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, WorkflowTemplateSchema, WorkflowSnapshotSchema, WorkflowSchema, WorkflowVersionSchema, PageContentTypeSchema, PageAuthModeSchema, PageThemeTokensSchema, PageThemeTokensInputSchema, PageSnapshotSchema, PageSchema, PageVersionSchema, MetricParamSchema, MetricVariableTypeSchema, MetricFormatSchema, MetricVisualizationSchema, MetricQuerySchema, MetricVariableSchema, MetricVizConfigSchema, MetricWidgetSchema, MetricDefinitionSchema, MetricSnapshotSchema, MetricSchema, MetricVersionSchema, WorkflowRunStatusSchema, WorkflowRunSchema, WorkflowRunParentSchema, WorkflowRunSummarySchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, ScriptRunKindSchema, ScriptRunSchema, ScriptRunListItemSchema, ScriptRunJournalEntrySchema, WorkflowRunStepStatusSchema, WorkflowRunStepSchema, WorkflowRunStepSlimSchema, WaitModeSchema, WaitStateStatusSchema, WaitStateRowSchema, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptExecutorNameSchema, ScriptRecordSchema, ScriptVersionRecordSchema, ExtensionNameSchema, SemverSchema, ExtensionBundlePathSchema, ExtensionAssetNameSchema, ExtensionScriptAssetSchema, ExtensionScheduleAssetSchema, ExtensionWorkflowAssetSchema, ExtensionSkillAssetSchema, ExtensionWorkflowFileSchema, ExtensionManifestSchema, ExtensionStatusSchema, ExtensionSchema, ExtensionFileSchema, ExtensionVersionSchema, ExtensionRunSchema, ExtensionInstallBodySchema, ScriptApiAuthModeSchema, ScriptApiRecordSchema, SkillTypeSchema, SkillScopeSchema, SkillSchema, AgentSkillSchema, SkillWithInstallInfoSchema, SkillFileSchema, McpServerTransportSchema, McpServerScopeSchema, McpAuthMethodSchema, McpServerSchema, AgentMcpServerSchema, McpServerWithInstallInfoSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, ContextSnapshotSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, BudgetRefusedTriggerSchema, KvValueTypeSchema, KV_NAME_REGEX, KvNamespaceSchema, KvKeySchema, KvEntrySchema;
|
|
2176
|
+
var AssetKeySchema, AssetEntityTypeSchema, AssetProviderRefSchema, AssetKeyMappingSchema, AssetSummarySchema, ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, LEGACY_MODEL_TO_TIER, DEFAULT_MODEL_TIER_MAP, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, OPEN_TASK_STATUSES, InboxMessageStatusSchema, InboxMessageSchema, AgentTaskSourceSchema, RoutingReasonSchema, RoutingSourceSchema, ProviderNameSchema, ModelProfileNameSchema, ModelProfileCredentialsSchema, ModelProfileSchema, ProfileCheckStateSchema, ProfileCheckRowSchema, ProfileCheckResultSchema, SessionShareAccessSchema, SessionAccessSchema, SessionOwnerSchema, SessionSharesSchema, SessionSharesUpdateSchema, SteerModeSchema, SteeringStatusSchema, SteeringSourceSchema, SteeringMessageSchema, SteerOutcomeSchema, OnUnsupportedSchema, SteerResultSchema, PROVIDER_STEER_CAPABILITIES, FollowUpConfigSchema, RoutingAffinitySchema, AgentTaskSchema, CreateTaskOptionsSchema, TaskAttachmentKindSchema, SERVER_GENERATED_ATTACHMENT_CAPABILITY = "_agentSwarmGeneratedBy", attachmentCapabilitiesSchema, attachmentCommonFields, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, RbacRoleSchema, UserRbacRolesSchema, UserCommsPrefsSchema, IdentityEventTypeSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, FavoriteItemTypeSchema, UserFavoriteSchema, TaskTemplateKindSchema, TaskTemplateSchema, AgentStatusSchema, AgentAvatarSchema, AppIconSchema, AgentSlackIconSchema, AgentSchema, AgentCredStatusKeyResultSchema, AgentCredStatusLiveTestSchema, AgentLatestModelSchema, AgentBedrockStatusSchema, AgentOpencodeGoStatusSchema, AcpSessionConfigSelectValueSchema, AcpSessionConfigSelectGroupSchema, AcpSessionConfigOptionSchema, AgentAcpStatusSchema, AgentCredStatusSchema, AgentWithTasksSchema, ChangeSourceSchema, VersionableFieldSchema, ContextVersionSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, AgentLogEventTypeSchema, ResumeReasonSchema, AgentLogSchema, SessionLogSchema, SessionCostSourceSchema, SessionCostModelBreakdownSchema, SessionCostSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, SwarmEventSchema, AutomationIntegrationIdSchema, ScheduledTaskTargetTypeSchema, ScheduledTaskSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, REPO_GUIDELINES_MAX_ENTRIES = 50, RepoGuidelinesInputSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, ActiveSessionSchema, WorkerNudgeSchema, RuntimeInstanceStatusSchema, RuntimeProviderKindSchema, DeliveryModeSchema, PoolLifecycleSchema, RuntimeResourcesSchema, RuntimeControllerCreateSchema, RuntimeControllerUpdateSchema, RuntimeControllerSchema, RuntimePoolCacheSchema, RuntimePoolCreateSchema, RuntimePoolUpdateSchema, RuntimePoolSchema, RuntimePoolCreateAgentSchema, RuntimeInstanceSchema, RetryPolicySchema, SUPERSEDED_WORKFLOW_TASK_REASON = "superseded_workflow_task", ExecutorMetaSchema, ValidationResultSchema, StepValidationConfigSchema, SwarmScriptNodeConfigSchema, WorkflowNodeSchema, WorkflowEdgeSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, WebhookVerificationSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, WorkflowTemplateSchema, WorkflowSnapshotSchema, WorkflowSchema, WorkflowVersionSchema, PageContentTypeSchema, PageAuthModeSchema, PageThemeTokensSchema, PageThemeTokensInputSchema, PageSnapshotSchema, PageSchema, PageVersionSchema, MetricParamSchema, MetricVariableTypeSchema, MetricFormatSchema, MetricVisualizationSchema, MetricQuerySchema, MetricVariableSchema, MetricVizConfigSchema, MetricWidgetSchema, MetricDefinitionSchema, MetricSnapshotSchema, MetricSchema, MetricVersionSchema, WorkflowRunStatusSchema, WorkflowRunSchema, WorkflowRunParentSchema, WorkflowRunSummarySchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, ScriptRunKindSchema, ScriptRunSchema, ScriptRunListItemSchema, ScriptRunJournalEntrySchema, WorkflowRunStepStatusSchema, WorkflowRunStepSchema, WorkflowRunStepSlimSchema, WaitModeSchema, WaitStateStatusSchema, WaitStateRowSchema, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptExecutorNameSchema, ScriptRecordSchema, ScriptVersionRecordSchema, ExtensionNameSchema, SemverSchema, ExtensionBundlePathSchema, ExtensionAssetNameSchema, ExtensionScriptAssetSchema, ExtensionScheduleAssetSchema, ExtensionWorkflowAssetSchema, ExtensionSkillAssetSchema, ExtensionWorkflowFileSchema, ExtensionManifestSchema, ExtensionStatusSchema, ExtensionSchema, ExtensionFileSchema, ExtensionVersionSchema, ExtensionRunSchema, ExtensionInstallBodySchema, ScriptApiAuthModeSchema, ScriptApiRecordSchema, SkillTypeSchema, SkillScopeSchema, SkillSchema, AgentSkillSchema, SkillWithInstallInfoSchema, SkillFileSchema, McpServerTransportSchema, McpServerScopeSchema, McpAuthMethodSchema, McpServerSchema, AgentMcpServerSchema, McpServerWithInstallInfoSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, ContextSnapshotSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, BudgetRefusedTriggerSchema, KvValueTypeSchema, KV_NAME_REGEX, KvNamespaceSchema, KvKeySchema, KvEntrySchema;
|
|
2177
2177
|
var init_types4 = __esm(() => {
|
|
2178
2178
|
init_key();
|
|
2179
2179
|
init_bundle_path();
|
|
@@ -2396,6 +2396,7 @@ var init_types4 = __esm(() => {
|
|
|
2396
2396
|
"fx"
|
|
2397
2397
|
]);
|
|
2398
2398
|
ModelProfileNameSchema = string2().trim().regex(/^[a-z0-9][a-z0-9._-]{0,99}$/, "lowercase letters, digits, '.', '_' or '-', max 100");
|
|
2399
|
+
ModelProfileCredentialsSchema = record2(string2(), array2(string2().length(5)).min(1));
|
|
2399
2400
|
ModelProfileSchema = object2({
|
|
2400
2401
|
id: string2(),
|
|
2401
2402
|
name: string2(),
|
|
@@ -2405,9 +2406,25 @@ var init_types4 = __esm(() => {
|
|
|
2405
2406
|
allowCustomModel: boolean(),
|
|
2406
2407
|
description: string2().nullable(),
|
|
2407
2408
|
seededFrom: string2().nullable(),
|
|
2409
|
+
credentials: ModelProfileCredentialsSchema.nullable(),
|
|
2408
2410
|
createdAt: string2(),
|
|
2409
2411
|
lastUpdatedAt: string2()
|
|
2410
2412
|
});
|
|
2413
|
+
ProfileCheckStateSchema = _enum2(["pass", "warn", "fail", "unverified"]);
|
|
2414
|
+
ProfileCheckRowSchema = object2({
|
|
2415
|
+
check: _enum2(["harness", "model", "harness-credentials", "credential-allowlist"]),
|
|
2416
|
+
state: ProfileCheckStateSchema,
|
|
2417
|
+
detail: string2().optional()
|
|
2418
|
+
});
|
|
2419
|
+
ProfileCheckResultSchema = object2({
|
|
2420
|
+
agentId: string2(),
|
|
2421
|
+
ok: boolean(),
|
|
2422
|
+
profiles: array2(object2({
|
|
2423
|
+
name: string2(),
|
|
2424
|
+
ok: boolean(),
|
|
2425
|
+
checks: array2(ProfileCheckRowSchema)
|
|
2426
|
+
}))
|
|
2427
|
+
}).openapi("ProfileCheckResult");
|
|
2411
2428
|
SessionShareAccessSchema = _enum2(["read", "write"]);
|
|
2412
2429
|
SessionAccessSchema = _enum2(["owner", "write", "read"]);
|
|
2413
2430
|
SessionOwnerSchema = object2({ id: string2(), name: string2() }).openapi("SessionOwner");
|
|
@@ -2783,6 +2800,7 @@ var init_types4 = __esm(() => {
|
|
|
2783
2800
|
color: string2().regex(/^#[0-9a-fA-F]{6}$/).optional()
|
|
2784
2801
|
})
|
|
2785
2802
|
]);
|
|
2803
|
+
AppIconSchema = AgentAvatarSchema;
|
|
2786
2804
|
AgentSlackIconSchema = discriminatedUnion("type", [
|
|
2787
2805
|
object2({
|
|
2788
2806
|
type: literal2("emoji"),
|
|
@@ -3171,6 +3189,7 @@ var init_types4 = __esm(() => {
|
|
|
3171
3189
|
lastErrorMessage: string2().optional(),
|
|
3172
3190
|
model: string2().optional(),
|
|
3173
3191
|
modelTier: ModelTierSchema.optional(),
|
|
3192
|
+
profile: string2().optional(),
|
|
3174
3193
|
scheduleType: _enum2(["recurring", "one_time"]).default("recurring"),
|
|
3175
3194
|
targetType: ScheduledTaskTargetTypeSchema.default("agent-task"),
|
|
3176
3195
|
workflowId: uuid().optional(),
|
|
@@ -4284,4 +4303,4 @@ var init_types4 = __esm(() => {
|
|
|
4284
4303
|
}).openapi("KvEntry");
|
|
4285
4304
|
});
|
|
4286
4305
|
|
|
4287
|
-
export { ASSET_KEY_MAX_LENGTH, normalizeAssetKey, defaultAssetKey, keyPrefixRange, SESSION_RESOURCE_KINDS, SESSION_LEAF_KINDS, NO_GROUP_LEAF_KINDS, isResourceGroupPrefix, RESOURCE_GROUPS_READ_ONLY, sessionResourceGroupOf, sessionGroupKey, parseAssetKey, isCanonicalAssetKey, canWriteAssetKey, init_key, isSafeBundlePath, init_bundle_path, PAGE_THEME_COLOR_TOKENS, PAGE_THEME_SHARED_TOKENS, PAGE_THEME_TOKENS, HIVE_PAGE_TOKENS, init_tokens2, ThemeImportError, importThemeTokens, init_import, $OpenAPIRegistry, $OpenApiGeneratorV31, init_dist7, init_zod_openapi, AssetKeySchema, AssetEntityTypeSchema, AssetKeyMappingSchema, AssetSummarySchema, ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, DEFAULT_MODEL_TIER_MAP, parseModelTier, splitLegacyModelAlias, parseWorkerModelTierOverrides, resolveTaskModelSelection, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, isTerminalTaskStatus, OPEN_TASK_STATUSES, AgentTaskSourceSchema, RoutingReasonSchema, ProviderNameSchema, ModelProfileNameSchema, ModelProfileSchema, SessionAccessSchema, SessionOwnerSchema, SessionSharesSchema, SessionSharesUpdateSchema, SteerModeSchema, SteeringSourceSchema, SteeringMessageSchema, SteerOutcomeSchema, OnUnsupportedSchema, SteerResultSchema, PROVIDER_STEER_CAPABILITIES, FollowUpConfigSchema, RoutingAffinitySchema, AgentTaskSchema, CreateTaskOptionsSchema, SERVER_GENERATED_ATTACHMENT_CAPABILITY, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, RbacRoleSchema, UserRbacRolesSchema, UserCommsPrefsSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, FavoriteItemTypeSchema, UserFavoriteSchema, TaskTemplateKindSchema, TaskTemplateSchema, AgentStatusSchema, AgentAvatarSchema, AgentSlackIconSchema, AgentSchema, AgentLatestModelSchema, AgentAcpStatusSchema, AgentCredStatusSchema, AgentWithTasksSchema, VersionableFieldSchema, ChannelTypeSchema, ResumeReasonSchema, AgentLogSchema, SessionLogSchema, SessionCostModelBreakdownSchema, SessionCostSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, SwarmEventSchema, AutomationIntegrationIdSchema, ScheduledTaskTargetTypeSchema, ScheduledTaskSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesInputSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, ActiveSessionSchema, WorkerNudgeSchema, RuntimeProviderKindSchema, DeliveryModeSchema, RuntimeControllerCreateSchema, RuntimeControllerUpdateSchema, RuntimeControllerSchema, RuntimePoolCacheSchema, RuntimePoolCreateSchema, RuntimePoolUpdateSchema, RuntimePoolSchema, RuntimePoolCreateAgentSchema, RuntimeInstanceSchema, RetryPolicySchema, SUPERSEDED_WORKFLOW_TASK_REASON, WorkflowEdgeSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, WorkflowSchema, WorkflowVersionSchema, PageContentTypeSchema, PageAuthModeSchema, PageThemeTokensSchema, PageThemeTokensInputSchema, PageSchema, PageVersionSchema, MetricWidgetSchema, MetricDefinitionSchema, MetricSchema, MetricVersionSchema, WorkflowRunStatusSchema, WorkflowRunSchema, WorkflowRunParentSchema, WorkflowRunSummarySchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, ScriptRunSchema, ScriptRunListItemSchema, ScriptRunJournalEntrySchema, WorkflowRunStepSchema, WorkflowRunStepSlimSchema, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptExecutorNameSchema, ScriptRecordSchema, ScriptVersionRecordSchema, ExtensionWorkflowFileSchema, ExtensionManifestSchema, ExtensionSchema, ExtensionVersionSchema, ExtensionRunSchema, checkExtensionInstallSource, ExtensionInstallBodySchema, ScriptApiAuthModeSchema, ScriptApiRecordSchema, SkillSchema, AgentSkillSchema, SkillWithInstallInfoSchema, SkillFileSchema, McpAuthMethodSchema, McpServerSchema, AgentMcpServerSchema, McpServerWithInstallInfoSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, ContextSnapshotSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, BudgetRefusedTriggerSchema, KvValueTypeSchema, KvNamespaceSchema, KvKeySchema, KvEntrySchema, init_types4 };
|
|
4306
|
+
export { ASSET_KEY_MAX_LENGTH, normalizeAssetKey, defaultAssetKey, keyPrefixRange, SESSION_RESOURCE_KINDS, SESSION_LEAF_KINDS, NO_GROUP_LEAF_KINDS, isResourceGroupPrefix, RESOURCE_GROUPS_READ_ONLY, sessionResourceGroupOf, sessionGroupKey, parseAssetKey, isCanonicalAssetKey, canWriteAssetKey, init_key, isSafeBundlePath, init_bundle_path, PAGE_THEME_COLOR_TOKENS, PAGE_THEME_SHARED_TOKENS, PAGE_THEME_TOKENS, HIVE_PAGE_TOKENS, init_tokens2, ThemeImportError, importThemeTokens, init_import, $OpenAPIRegistry, $OpenApiGeneratorV31, init_dist7, init_zod_openapi, AssetKeySchema, AssetEntityTypeSchema, AssetKeyMappingSchema, AssetSummarySchema, ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, DEFAULT_MODEL_TIER_MAP, parseModelTier, splitLegacyModelAlias, parseWorkerModelTierOverrides, resolveTaskModelSelection, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, isTerminalTaskStatus, OPEN_TASK_STATUSES, AgentTaskSourceSchema, RoutingReasonSchema, ProviderNameSchema, ModelProfileNameSchema, ModelProfileCredentialsSchema, ModelProfileSchema, ProfileCheckResultSchema, SessionAccessSchema, SessionOwnerSchema, SessionSharesSchema, SessionSharesUpdateSchema, SteerModeSchema, SteeringSourceSchema, SteeringMessageSchema, SteerOutcomeSchema, OnUnsupportedSchema, SteerResultSchema, PROVIDER_STEER_CAPABILITIES, FollowUpConfigSchema, RoutingAffinitySchema, AgentTaskSchema, CreateTaskOptionsSchema, SERVER_GENERATED_ATTACHMENT_CAPABILITY, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, RbacRoleSchema, UserRbacRolesSchema, UserCommsPrefsSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, FavoriteItemTypeSchema, UserFavoriteSchema, TaskTemplateKindSchema, TaskTemplateSchema, AgentStatusSchema, AgentAvatarSchema, AppIconSchema, AgentSlackIconSchema, AgentSchema, AgentLatestModelSchema, AgentAcpStatusSchema, AgentCredStatusSchema, AgentWithTasksSchema, VersionableFieldSchema, ChannelTypeSchema, ResumeReasonSchema, AgentLogSchema, SessionLogSchema, SessionCostModelBreakdownSchema, SessionCostSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, SwarmEventSchema, AutomationIntegrationIdSchema, ScheduledTaskTargetTypeSchema, ScheduledTaskSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesInputSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, ActiveSessionSchema, WorkerNudgeSchema, RuntimeProviderKindSchema, DeliveryModeSchema, RuntimeControllerCreateSchema, RuntimeControllerUpdateSchema, RuntimeControllerSchema, RuntimePoolCacheSchema, RuntimePoolCreateSchema, RuntimePoolUpdateSchema, RuntimePoolSchema, RuntimePoolCreateAgentSchema, RuntimeInstanceSchema, RetryPolicySchema, SUPERSEDED_WORKFLOW_TASK_REASON, WorkflowEdgeSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, WorkflowSchema, WorkflowVersionSchema, PageContentTypeSchema, PageAuthModeSchema, PageThemeTokensSchema, PageThemeTokensInputSchema, PageSchema, PageVersionSchema, MetricWidgetSchema, MetricDefinitionSchema, MetricSchema, MetricVersionSchema, WorkflowRunStatusSchema, WorkflowRunSchema, WorkflowRunParentSchema, WorkflowRunSummarySchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, ScriptRunSchema, ScriptRunListItemSchema, ScriptRunJournalEntrySchema, WorkflowRunStepSchema, WorkflowRunStepSlimSchema, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptExecutorNameSchema, ScriptRecordSchema, ScriptVersionRecordSchema, ExtensionWorkflowFileSchema, ExtensionManifestSchema, ExtensionSchema, ExtensionVersionSchema, ExtensionRunSchema, checkExtensionInstallSource, ExtensionInstallBodySchema, ScriptApiAuthModeSchema, ScriptApiRecordSchema, SkillSchema, AgentSkillSchema, SkillWithInstallInfoSchema, SkillFileSchema, McpAuthMethodSchema, McpServerSchema, AgentMcpServerSchema, McpServerWithInstallInfoSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, ContextSnapshotSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, BudgetRefusedTriggerSchema, KvValueTypeSchema, KvNamespaceSchema, KvKeySchema, KvEntrySchema, init_types4 };
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
resolveConfigValueOrThrow,
|
|
10
10
|
resolveHeadersOrThrow,
|
|
11
11
|
FileAuthStorageBackend
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-bsywb58a.js";
|
|
13
13
|
import {
|
|
14
14
|
oauthSuccessHtml,
|
|
15
15
|
oauthErrorHtml,
|
|
16
16
|
init_oauth_page
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-x1wa213s.js";
|
|
18
18
|
import {
|
|
19
19
|
__toESM
|
|
20
20
|
} from "./cli-242037k3.js";
|
|
@@ -56,11 +56,11 @@ import {
|
|
|
56
56
|
checkDependencies2,
|
|
57
57
|
emitBuiltInIntegrationConnectedOnce2,
|
|
58
58
|
init_db4
|
|
59
|
-
} from "./cli-
|
|
59
|
+
} from "./cli-7w69ne2f.js";
|
|
60
60
|
import {
|
|
61
61
|
getChannelBlockReason2,
|
|
62
62
|
init_external_channel
|
|
63
|
-
} from "./cli-
|
|
63
|
+
} from "./cli-b8e9nb04.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-q7yr9yp0.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-vbww69re.js");
|
|
16345
|
+
const { registerCommandHandler } = await import("./commands-f587qpq8.js");
|
|
16346
|
+
const { registerActionHandlers } = await import("./actions-pwjpn0j6.js");
|
|
16347
|
+
const { registerWorkObjectHandlers } = await import("./work-objects-8zkrpy13.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-kpn317y1.js");
|
|
16160
16353
|
app.assistant(createAssistant());
|
|
16161
|
-
const { isBlockExternalEnabled, scanExternalChannelsOnBoot } = await import("./external-channel-
|
|
16354
|
+
const { isBlockExternalEnabled, scanExternalChannelsOnBoot } = await import("./external-channel-z46yx9d7.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-twhhwmms.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",
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
var SLASH_COMMAND_REGEX = /^\/([a-z0-9:_-]+)(?:\s+(.*))?$/;
|
|
5
|
-
var
|
|
5
|
+
var DEFAULT_MAX_SKILL_CHARS = 1e5;
|
|
6
|
+
function getMaxSkillChars() {
|
|
7
|
+
const parsed = Number(process.env.MAX_SKILL_CHARS);
|
|
8
|
+
return Number.isInteger(parsed) && parsed > 0 ? parsed : DEFAULT_MAX_SKILL_CHARS;
|
|
9
|
+
}
|
|
6
10
|
function defaultSkillsDir() {
|
|
7
11
|
if (process.env.CODEX_SKILLS_DIR) {
|
|
8
12
|
return process.env.CODEX_SKILLS_DIR;
|
|
@@ -55,13 +59,14 @@ async function resolveSlashSkillPrompt(prompt, opts) {
|
|
|
55
59
|
});
|
|
56
60
|
return prompt;
|
|
57
61
|
}
|
|
58
|
-
|
|
62
|
+
const maxSkillChars = getMaxSkillChars();
|
|
63
|
+
if (skillContent.length > maxSkillChars) {
|
|
59
64
|
opts.emit?.({
|
|
60
65
|
type: "raw_stderr",
|
|
61
|
-
content: `[${opts.providerLabel}] skill resolver: SKILL.md for /${commandName} exceeds ${
|
|
66
|
+
content: `[${opts.providerLabel}] skill resolver: SKILL.md for /${commandName} exceeds ${maxSkillChars} chars (${skillContent.length}), truncating
|
|
62
67
|
`
|
|
63
68
|
});
|
|
64
|
-
skillContent = skillContent.slice(0,
|
|
69
|
+
skillContent = skillContent.slice(0, maxSkillChars);
|
|
65
70
|
}
|
|
66
71
|
if (opts.stripFrontmatter) {
|
|
67
72
|
skillContent = skillContent.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n/, "").trimStart();
|
|
@@ -76,4 +81,4 @@ ${rest}` : trailingArgs || rest;
|
|
|
76
81
|
User request: ${userRequestBody}`;
|
|
77
82
|
}
|
|
78
83
|
|
|
79
|
-
export { resolveCodexPrompt, resolveSlashSkillPrompt };
|
|
84
|
+
export { getMaxSkillChars, resolveCodexPrompt, resolveSlashSkillPrompt };
|