@desplega.ai/agent-swarm 1.149.0 → 1.150.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/README.md +7 -3
- package/dist/{acp-adapter-4jncb126.js → acp-adapter-d5mzggyk.js} +1 -1
- package/dist/{actions-31vp3ae7.js → actions-wn6ew0p7.js} +11 -10
- package/dist/{anthropic-messages-vs2rabzp.js → anthropic-messages-ec35ktvx.js} +4 -4
- package/dist/{app-1hh67x8w.js → app-dty7p9hg.js} +7 -7
- package/dist/{artifact-gj9arwrr.js → artifact-td4q4dch.js} +1 -1
- package/dist/{assistant-z66dmz6p.js → assistant-q4vhgjtx.js} +16 -17
- package/dist/{boot-reembed-wxa8ya0s.js → boot-reembed-92292pgf.js} +9 -9
- package/dist/{boot-reembed-fqzxxzjh.js → boot-reembed-n15q6s9x.js} +8 -8
- package/dist/{boot-scrub-logs-jnyndh79.js → boot-scrub-logs-44pc955m.js} +5 -5
- package/dist/{claude-adapter-3qpa9w0j.js → claude-adapter-cjegjbje.js} +14 -14
- package/dist/{claude-managed-adapter-qvsmh6mv.js → claude-managed-adapter-p3ts5m9m.js} +2 -2
- package/dist/{claude-sdk-session-2yxgjs5d.js → claude-sdk-session-7ywbn12v.js} +14 -14
- package/dist/{cli-cr12paw2.js → cli-111ey3ra.js} +5 -5
- package/dist/{cli-4wtq5jjv.js → cli-1mx65de9.js} +1 -1
- package/dist/{cli-9d8ntetj.js → cli-2658f6at.js} +1 -1
- package/dist/{cli-n3dz2942.js → cli-3ckzxdt1.js} +10 -6
- package/dist/{cli-yb9qhqam.js → cli-3mh119qv.js} +184 -67
- package/dist/{cli-ykxrnd1q.js → cli-72xdszyx.js} +2 -2
- package/dist/{cli-xm87hzbw.js → cli-7fesa1ky.js} +1 -1
- package/dist/{cli-3q5ejx9p.js → cli-7kwmt3r5.js} +2 -2
- package/dist/{cli-2qts1hys.js → cli-8chp8xab.js} +2 -2
- package/dist/{cli-qaacms9y.js → cli-9gqddmxs.js} +122 -97
- package/dist/{cli-zvz62chv.js → cli-a45d5v9b.js} +4 -4
- package/dist/{cli-9xvdm3bx.js → cli-asvrh7kj.js} +1 -1
- package/dist/{cli-kgz4np97.js → cli-b8x19vbh.js} +4 -4
- package/dist/{cli-9fy6nk6g.js → cli-ceb5y160.js} +1 -1
- package/dist/{cli-k0cr4kat.js → cli-ck1vqzdj.js} +1 -1
- package/dist/{cli-e29gmdmw.js → cli-dv6cdjs2.js} +2 -1
- package/dist/{cli-jecc01cb.js → cli-dyx0237s.js} +1 -1
- package/dist/{cli-kjwt6hdf.js → cli-gm0fhz13.js} +3 -3
- package/dist/{cli-sd5pv3b1.js → cli-h505yhex.js} +2 -2
- package/dist/{handlers-nbzdzn9k.js → cli-hbagregr.js} +15 -38
- package/dist/{cli-08b07b4r.js → cli-hmyynq9b.js} +1 -1
- package/dist/{cli-d8ftsp62.js → cli-kt7wevqh.js} +20 -13
- package/dist/{cli-gjhjfeeg.js → cli-kyysm7m3.js} +1 -1
- package/dist/{cli-1ebpar1q.js → cli-mzb0n642.js} +6 -6
- package/dist/{cli-q50ef8g0.js → cli-n1yj5fd5.js} +1 -1
- package/dist/{cli-3apbzgyk.js → cli-n75jt793.js} +13 -9
- package/dist/{cli-19f354qr.js → cli-q04q68be.js} +2 -2
- package/dist/{cli-yab68w40.js → cli-qp69dd5d.js} +29 -14
- package/dist/{cli-6pqcb4q0.js → cli-rnsr8asm.js} +12 -11
- package/dist/{cli-ygweqcn4.js → cli-rwp3ksm7.js} +91 -108
- package/dist/{cli-phsxnkp6.js → cli-ryz8q8p1.js} +74 -58
- package/dist/{cli-e95cx1eb.js → cli-taym3dmg.js} +10 -10
- package/dist/{cli-nye12xk5.js → cli-ttje5a4z.js} +7 -4
- package/dist/{cli-9hspd3dp.js → cli-vr6qj104.js} +1 -1
- package/dist/{cli-mnmsfd1w.js → cli-xjb9wghj.js} +7 -3
- package/dist/{cli-gv88e1vf.js → cli-ydk0wjj8.js} +1 -1
- package/dist/{cli-aae6hz6a.js → cli-zd21jrrc.js} +3 -3
- package/dist/{cli-7smrsr25.js → cli-zthatyrx.js} +23 -11
- package/dist/cli.js +19 -19
- package/dist/{codex-adapter-8meawydj.js → codex-adapter-rn3aq7jm.js} +7 -7
- package/dist/{codex-hook-hfrt9shr.js → codex-hook-gthcmm0g.js} +3 -3
- package/dist/{codex-session-runner-gjgxyp5j.js → codex-session-runner-bge0cbsw.js} +7 -7
- package/dist/{commands-hz3nb95f.js → commands-26phw0pc.js} +5 -5
- package/dist/{db-ggz97zbm.js → db-jxjx6s1b.js} +6 -6
- package/dist/{e2b-p04vmtx0.js → e2b-413b8t4v.js} +1 -1
- package/dist/handlers-vr1djg4n.js +41 -0
- package/dist/{hook-bks2q1f6.js → hook-jw0ztn96.js} +9 -9
- package/dist/{hook-kq9wp0ep.js → hook-t6fqsggw.js} +10 -10
- package/dist/{http-hrf77v87.js → http-hyc7s57s.js} +80 -71
- package/dist/{index-n28pw1zt.js → index-1d9r6a74.js} +18 -18
- package/dist/{index-cqtebbhb.js → index-bcyx5djw.js} +17 -17
- package/dist/{index-6nsbg88z.js → index-sfhaq59d.js} +408 -74
- package/dist/{index-8hmeg8j1.js → index-wtwpthe1.js} +17 -17
- package/dist/{keepalive-dxc12gvg.js → keepalive-fbsak4ya.js} +7 -7
- package/dist/{lead-yckfn18d.js → lead-rdzdm627.js} +39 -39
- package/dist/{maintenance-6kfb2m5e.js → maintenance-25z1c1vf.js} +9 -9
- package/dist/{node-x1g4v0pq.js → node-209sxmg3.js} +9 -9
- package/dist/{oauth-refresh-sweep-1x1ac722.js → oauth-refresh-sweep-j3d7gtse.js} +6 -6
- package/dist/{onboard-dcyt1609.js → onboard-dkcwrc75.js} +2 -2
- package/dist/{otel-impl-tbk3e5dr.js → otel-impl-8rgyy3j8.js} +1 -1
- package/dist/{pi-mono-adapter-zvshk5cj.js → pi-mono-adapter-4s2bbkgq.js} +8 -8
- package/dist/{pricing-refresh-kaqg567e.js → pricing-refresh-9cek71nq.js} +7 -7
- package/dist/{rbac-roles-cf97v1vd.js → rbac-roles-vk8mqp9v.js} +6 -6
- package/dist/{rbac-roles-ammq6rd2.js → rbac-roles-z98s2ypy.js} +5 -5
- package/dist/{render-v2-80w603vy.js → render-v2-3j26g0qh.js} +7 -7
- package/dist/{seed-pricing-zbrn83xv.js → seed-pricing-7rxhcnzm.js} +6 -6
- package/dist/{setup-fe66kczs.js → setup-e2t7vz0c.js} +2 -2
- package/dist/work-objects-8d3nd3x2.js +141 -0
- package/dist/{worker-qmb2d1e2.js → worker-0x9fn7nq.js} +39 -39
- package/openapi.json +15 -4
- package/package.json +3 -3
- package/src/agentmail/handlers.ts +5 -0
- package/src/be/budget-refusal-notify.ts +1 -0
- package/src/be/db/tasks/read.ts +3 -0
- package/src/be/db/tasks/write.ts +13 -1
- package/src/be/db.ts +4 -2
- package/src/be/migrations/153_deferred_task_wait_members.sql +25 -0
- package/src/be/migrations/154_routing_source.sql +3 -0
- package/src/be/scripts/typecheck.ts +7 -3
- package/src/be/seed/automation-toggle.ts +69 -0
- package/src/be/seed/schedules-seeder.ts +53 -8
- package/src/be/seed/workflows-seeder.ts +35 -6
- package/src/be/seed-scripts/catalog/delegate.ts +3 -1
- package/src/be/seed-skills/bundled-files.generated.json +1 -1
- package/src/be/steering.ts +1 -0
- package/src/be/swarm-config-guard.ts +1 -0
- package/src/commands/credential-refresh.ts +70 -0
- package/src/commands/provider-credentials.ts +2 -25
- package/src/commands/runner.ts +23 -56
- package/src/github/handlers.ts +9 -0
- package/src/gitlab/handlers.ts +4 -0
- package/src/heartbeat/heartbeat.ts +3 -0
- package/src/http/approval-requests.ts +1 -0
- package/src/http/apps.ts +1 -0
- package/src/http/config.ts +4 -1
- package/src/http/core.ts +4 -2
- package/src/http/index.ts +16 -3
- package/src/http/script-runs.ts +5 -0
- package/src/http/tasks.ts +5 -0
- package/src/integrations/kapso/inbound.ts +1 -0
- package/src/jira/sync.ts +2 -0
- package/src/linear/sync.ts +2 -0
- package/src/prompts/session-templates.ts +13 -9
- package/src/providers/claude-adapter.ts +21 -8
- package/src/scheduler/deferred-task-waits.ts +34 -5
- package/src/scheduler/schedule-task.ts +5 -1
- package/src/scheduler/scheduler.ts +104 -123
- package/src/scripts-runtime/types/stdlib.d.ts +7 -3
- package/src/scripts-runtime/types/swarm-sdk.d.ts +7 -3
- package/src/slack/HEURISTICS.md +2 -0
- package/src/slack/actions.ts +1 -0
- package/src/slack/app.ts +2 -0
- package/src/slack/assistant.ts +4 -12
- package/src/slack/handlers.ts +9 -14
- package/src/slack/inbound-files.ts +3 -3
- package/src/slack/render-v2.ts +17 -3
- package/src/slack/thread-buffer.ts +66 -23
- package/src/slack/work-objects.test.ts +252 -0
- package/src/slack/work-objects.ts +118 -0
- package/src/tasks/worker-follow-up.ts +4 -0
- package/src/tests/acp-adapter.test.ts +10 -10
- package/src/tests/agent-fs-live-url.test.ts +40 -0
- package/src/tests/agent-fs-provision-seeder.test.ts +12 -12
- package/src/tests/api-key-tracking.test.ts +18 -18
- package/src/tests/api-key.test.ts +4 -2
- package/src/tests/apps-rbac.test.ts +1 -1
- package/src/tests/apps-spike5.test.ts +1 -1
- package/src/tests/apps-sync-engine.test.ts +8 -8
- package/src/tests/apps-user-config.test.ts +1 -1
- package/src/tests/artifact-sdk.test.ts +8 -8
- package/src/tests/asset-key-mcp.test.ts +2 -0
- package/src/tests/automation-preflight-alert.test.ts +1 -1
- package/src/tests/base-prompt.test.ts +6 -6
- package/src/tests/budget-user-scope.test.ts +1 -1
- package/src/tests/budgets-routes.test.ts +1 -1
- package/src/tests/claude-adapter-binary.test.ts +22 -40
- package/src/tests/claude-adapter-otel.test.ts +13 -7
- package/src/tests/claude-adapter.test.ts +8 -6
- package/src/tests/claude-hook-credentials.test.ts +3 -3
- package/src/tests/claude-managed-adapter.test.ts +4 -4
- package/src/tests/claude-managed-setup.test.ts +3 -3
- package/src/tests/claude-sdk-lifecycle.test.ts +1 -1
- package/src/tests/claude-sdk-transport.test.ts +6 -6
- package/src/tests/claude-stop-hook.test.ts +8 -8
- package/src/tests/claude-worker-parity.test.ts +3 -3
- package/src/tests/codex-adapter-pool-auth-revalidate.test.ts +5 -5
- package/src/tests/codex-adapter.test.ts +7 -5
- package/src/tests/codex-app-server.test.ts +2 -2
- package/src/tests/codex-login.test.ts +15 -15
- package/src/tests/codex-oauth-credential-info.test.ts +4 -4
- package/src/tests/codex-oauth-keep-warm.test.ts +4 -4
- package/src/tests/codex-oauth-refresh-lock.test.ts +1 -1
- package/src/tests/codex-oauth-storage.test.ts +7 -7
- package/src/tests/codex-pool.test.ts +1 -1
- package/src/tests/codex-steering-hook.test.ts +1 -1
- package/src/tests/codex-swarm-events.test.ts +1 -1
- package/src/tests/config-api-only-keys.test.ts +1 -1
- package/src/tests/config-session-auth.test.ts +2 -2
- package/src/tests/connection-embedded-auth.test.ts +20 -18
- package/src/tests/core-auth.test.ts +1 -1
- package/src/tests/create-page-tool.test.ts +3 -3
- package/src/tests/credential-refresh.test.ts +115 -0
- package/src/tests/credential-wait.test.ts +2 -2
- package/src/tests/credentials.test.ts +6 -4
- package/src/tests/db-queries-oauth.test.ts +40 -40
- package/src/tests/defer-task.test.ts +73 -8
- package/src/tests/deferred-task-wait-migration.test.ts +64 -0
- package/src/tests/deferred-task-wake.test.ts +190 -1
- package/src/tests/devin-adapter.test.ts +1 -1
- package/src/tests/devin-api.test.ts +1 -1
- package/src/tests/e2b-dispatch.test.ts +21 -19
- package/src/tests/e2e-claude-transport.test.ts +3 -3
- package/src/tests/e2e-redact.test.ts +6 -6
- package/src/tests/ensure-token.test.ts +68 -68
- package/src/tests/entrypoint-api-readiness.test.ts +1 -1
- package/src/tests/entrypoint-codex-oauth-seed.test.ts +13 -13
- package/src/tests/events-http.test.ts +1 -1
- package/src/tests/fs-routes.test.ts +1 -1
- package/src/tests/gitlab-auth.test.ts +10 -10
- package/src/tests/harness-provider-resolution.test.ts +8 -5
- package/src/tests/heartbeat-reroute-decision.test.ts +1 -0
- package/src/tests/helper-credentials.test.ts +137 -0
- package/src/tests/http/context-routes.test.ts +2 -2
- package/src/tests/http-api-integration.test.ts +5 -2
- package/src/tests/http-users.test.ts +1 -1
- package/src/tests/identity-refresh.test.ts +2 -2
- package/src/tests/internal-ai/complete-structured.test.ts +2 -2
- package/src/tests/internal-ai/credentials.test.ts +19 -17
- package/src/tests/jira-metadata.test.ts +1 -1
- package/src/tests/jira-oauth.test.ts +5 -5
- package/src/tests/jira-sync.test.ts +1 -1
- package/src/tests/jira-webhook-lifecycle.test.ts +3 -3
- package/src/tests/jira-webhook.test.ts +2 -2
- package/src/tests/kapso-inbound.test.ts +2 -2
- package/src/tests/kv-http.test.ts +1 -1
- package/src/tests/kv-namespace-resolution.test.ts +1 -1
- package/src/tests/kv-page-proxy.test.ts +2 -2
- package/src/tests/launch-password-rejection.test.ts +2 -2
- package/src/tests/linear-webhook.test.ts +1 -1
- package/src/tests/mcp-oauth-dcr-reuse.test.ts +6 -6
- package/src/tests/mcp-oauth-ensure-token.test.ts +28 -22
- package/src/tests/mcp-oauth-manual-client.test.ts +16 -12
- package/src/tests/mcp-oauth-queries.test.ts +35 -32
- package/src/tests/mcp-oauth-resolve-secrets.test.ts +8 -8
- package/src/tests/mcp-oauth-wrapper.test.ts +20 -20
- package/src/tests/mcp-user-route.test.ts +1 -1
- package/src/tests/memory-edges.test.ts +1 -1
- package/src/tests/memory-rate-endpoint.test.ts +1 -1
- package/src/tests/memory-rate-tool.test.ts +2 -2
- package/src/tests/memory-rater-e2e.test.ts +1 -1
- package/src/tests/memory-rater-llm-summarizer.test.ts +3 -3
- package/src/tests/memory-rater-llm.test.ts +1 -1
- package/src/tests/model-control.test.ts +3 -0
- package/src/tests/multi-runtime-registration.test.ts +97 -3
- package/src/tests/oauth-access-token-tool.test.ts +18 -18
- package/src/tests/oauth-callback-flow.test.ts +8 -8
- package/src/tests/oauth-credential-bindings.test.ts +29 -27
- package/src/tests/oauth-keepalive.test.ts +10 -10
- package/src/tests/oauth-presets.test.ts +13 -5
- package/src/tests/oauth-refresh-failure.test.ts +9 -9
- package/src/tests/oauth-refresh-sweep.test.ts +20 -13
- package/src/tests/oauth-wrapper.test.ts +1 -1
- package/src/tests/onboard-compose.test.ts +3 -3
- package/src/tests/onboard-env.test.ts +26 -26
- package/src/tests/onboard-non-interactive.test.ts +4 -4
- package/src/tests/opencode-adapter.test.ts +1 -1
- package/src/tests/opencode-plugin.test.ts +2 -2
- package/src/tests/otel-session-cost-metrics.test.ts +1 -1
- package/src/tests/page-proxy-authed.test.ts +2 -2
- package/src/tests/page-proxy.test.ts +2 -2
- package/src/tests/page-session.test.ts +7 -7
- package/src/tests/page-viewer-auth.test.ts +2 -2
- package/src/tests/pages-authed-mode.test.ts +1 -1
- package/src/tests/pages-http.test.ts +1 -1
- package/src/tests/pages-password-mode.test.ts +1 -1
- package/src/tests/pages-public-authed-401.test.ts +1 -1
- package/src/tests/pages-public-html.test.ts +2 -2
- package/src/tests/pages-view-count.test.ts +1 -1
- package/src/tests/pi-mono-adapter.test.ts +10 -10
- package/src/tests/pi-mono-extension.test.ts +2 -2
- package/src/tests/pricing-routes.test.ts +1 -1
- package/src/tests/profile-sync-warning.test.ts +8 -8
- package/src/tests/profile-sync.test.ts +8 -8
- package/src/tests/prompt-template-session.test.ts +36 -5
- package/src/tests/provider-process-group.test.ts +95 -4
- package/src/tests/providers/pi-cost.test.ts +1 -1
- package/src/tests/queue-stall-alarm.test.ts +1 -1
- package/src/tests/rbac-admission.test.ts +1 -1
- package/src/tests/rbac-charact-http.test.ts +1 -1
- package/src/tests/rbac-e2e-helpers.ts +1 -1
- package/src/tests/realtime-room-surfaces.test.ts +1 -1
- package/src/tests/reload-config.test.ts +1 -1
- package/src/tests/routing-reason-contract.test.ts +76 -3
- package/src/tests/routing-reason-inventory.test.ts +11 -6
- package/src/tests/routing-source.test.ts +53 -0
- package/src/tests/runner-agent-fs-provision-retry.test.ts +1 -1
- package/src/tests/runner-context-preamble.test.ts +1 -1
- package/src/tests/runner-deployment-resume.test.ts +1 -1
- package/src/tests/runner-fallback-output.test.ts +1 -1
- package/src/tests/runner-identity-refresh.test.ts +1 -1
- package/src/tests/runner-skills-refresh.test.ts +1 -1
- package/src/tests/schedule-target-type.test.ts +3 -3
- package/src/tests/scheduled-tasks.test.ts +14 -5
- package/src/tests/scheduler-occurrence.test.ts +347 -0
- package/src/tests/script-apis-mcp.test.ts +1 -1
- package/src/tests/script-connections-http.test.ts +61 -58
- package/src/tests/script-connections-mcp.test.ts +1 -1
- package/src/tests/script-connections.test.ts +1 -1
- package/src/tests/script-runs-http.test.ts +15 -7
- package/src/tests/script-workflows-runtime-e2e.test.ts +1 -1
- package/src/tests/scripts-external-api.test.ts +1 -1
- package/src/tests/scripts-http.test.ts +1 -1
- package/src/tests/scripts-mcp-e2e.test.ts +1 -1
- package/src/tests/scripts-only-gating.test.ts +2 -2
- package/src/tests/scripts-retention.test.ts +1 -1
- package/src/tests/scripts-runtime-identity.test.ts +1 -1
- package/src/tests/scripts-runtime-secret-egress.test.ts +1 -1
- package/src/tests/scripts-runtime.test.ts +6 -4
- package/src/tests/scripts-typecheck.test.ts +21 -0
- package/src/tests/sdk-allowlist.test.ts +1 -1
- package/src/tests/secret-scrubber.test.ts +38 -31
- package/src/tests/seed-registry.test.ts +46 -8
- package/src/tests/seed-schedules.test.ts +139 -8
- package/src/tests/seed-workflows.test.ts +93 -7
- package/src/tests/send-task-output-schema.test.ts +9 -1
- package/src/tests/send-task-requested-by.test.ts +1 -0
- package/src/tests/send-task-slack-routing-guard.test.ts +2 -0
- package/src/tests/session-costs-codex-recompute.test.ts +1 -1
- package/src/tests/session-costs-golden.test.ts +2 -2
- package/src/tests/session-costs-model-key-normalize.test.ts +2 -2
- package/src/tests/session-costs-recompute-all-providers.test.ts +1 -1
- package/src/tests/session-tokens.test.ts +1 -1
- package/src/tests/shutdown-error-scrubbing.test.ts +1 -1
- package/src/tests/slack-file-tools-attachments.test.ts +1 -1
- package/src/tests/slack-inbound-files.test.ts +222 -86
- package/src/tests/slack-reaction-config.test.ts +5 -4
- package/src/tests/slack-read-boundaries.test.ts +1 -1
- package/src/tests/slack-render-v2.test.ts +120 -1
- package/src/tests/status.test.ts +7 -7
- package/src/tests/steering-core.test.ts +1 -1
- package/src/tests/steering-transport.test.ts +4 -4
- package/src/tests/store-progress-output-guidance.test.ts +34 -0
- package/src/tests/swarm-tool-result-gate.test.ts +11 -11
- package/src/tests/swarm-x-tool.test.ts +7 -5
- package/src/tests/sync-ai-toolbox-skills.test.ts +19 -0
- package/src/tests/task-supersede-resume.test.ts +1 -1
- package/src/tests/task-tools-ctx.test.ts +2 -0
- package/src/tests/tasks-requested-by-filter.test.ts +2 -2
- package/src/tests/telemetry-init.test.ts +11 -3
- package/src/tests/tool-output-agent-id.test.ts +1 -0
- package/src/tests/tracker-fold.test.ts +7 -7
- package/src/tests/tracker-tools.test.ts +3 -3
- package/src/tests/ui-followup-lead-delegation.test.ts +1 -0
- package/src/tests/unified-oauth-migration.test.ts +5 -5
- package/src/tests/user-token-rest-auth.test.ts +1 -1
- package/src/tests/user-token-routes.test.ts +1 -1
- package/src/tests/whoami-route.test.ts +1 -1
- package/src/tests/workflow-agent-task.test.ts +15 -13
- package/src/tests/workflow-ctx.test.ts +1 -1
- package/src/tests/workflow-e2e.test.ts +1 -1
- package/src/tests/workflow-engine-v2.test.ts +3 -1
- package/src/tests/workflow-executors.test.ts +2 -2
- package/src/tests/workflow-http-v2.test.ts +8 -6
- package/src/tests/workflow-input-redaction.test.ts +7 -5
- package/src/tests/workflow-integration-io.test.ts +2 -2
- package/src/tests/workflow-llm.test.ts +5 -5
- package/src/tests/workflow-registry.test.ts +1 -1
- package/src/tests/workflow-swarm-script.test.ts +1 -1
- package/src/tests/workflow-triggers-v2.test.ts +23 -21
- package/src/tests/x-composio.test.ts +9 -7
- package/src/tests/x402-client.test.ts +1 -1
- package/src/tests/x402-config.test.ts +28 -41
- package/src/tools/defer-task.ts +156 -24
- package/src/tools/send-task.ts +21 -1
- package/src/tools/skills/skill-publish.ts +1 -0
- package/src/tools/store-progress.ts +1 -1
- package/src/tools/templates.ts +2 -1
- package/src/types.ts +11 -0
- package/src/utils/constants.ts +7 -1
- package/src/utils/credentials.test.ts +16 -16
- package/src/workflows/executors/agent-task.ts +5 -0
- package/templates/ai-toolbox.manifest.json +7 -1
- package/templates/schedules/daily-blocker-digest/config.json +6 -1
- package/templates/schedules/daily-compounding-reflection/config.json +1 -0
- package/templates/schedules/daily-hn-briefing/config.json +1 -1
- package/templates/schedules/daily-status-report/config.json +6 -1
- package/templates/schedules/daily-swarm-update-check/config.json +19 -0
- package/templates/schedules/daily-swarm-update-check/content.md +49 -0
- package/templates/schedules/daily-workflow-health-audit/config.json +6 -1
- package/templates/schedules/gtm-weekly-review/config.json +1 -1
- package/templates/schedules/weekly-code-health-reports/config.json +1 -1
- package/templates/schedules/weekly-dependabot-triage/config.json +1 -1
- package/templates/schedules/weekly-dora-metrics/config.json +1 -1
- package/templates/schedules/weekly-harness-upgrade-check/config.json +1 -1
- package/templates/skills/delegate-work/files/scripts/codex-exec.sh +1 -1
- package/templates/skills/serply-search/SKILL.md +95 -0
- package/templates/skills/serply-search/config.json +13 -0
- package/templates/skills/serply-search/content.md +90 -0
- package/templates/skills/swarm-scripts/SKILL.md +2 -2
- package/templates/skills/swarm-scripts/content.md +2 -2
- package/templates/workflows/claude-code-changelog-watch/config.json +1 -1
- package/templates/workflows/gsc-topic-miner/config.json +1 -1
- package/templates/workflows/linear-drain-loop/config.json +1 -1
- package/templates/workflows/llm-safe-release-context/config.json +1 -1
- package/templates/workflows/ralph-loop/config.json +1 -1
- package/dist/{azure-openai-responses-cqar64rc.js → azure-openai-responses-g85jv7m8.js} +8 -8
- package/dist/{cli-4xz3pmrq.js → cli-8qx7jnrk.js} +5 -5
- package/dist/{cli-6664w7y4.js → cli-wk0gjrn3.js} +3 -3
- package/dist/{google-vertex-ppw8ydpa.js → google-vertex-pkhpkbq9.js} +3 -3
- package/dist/{openai-codex-responses-g7w48y30.js → openai-codex-responses-pm5gnyfa.js} +4 -4
- package/dist/{openai-completions-0bqmsajw.js → openai-completions-qdcmkfnr.js} +12 -12
- package/dist/{openai-responses-nmeyptke.js → openai-responses-vwvk1taj.js} +13 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
contentSha256,
|
|
3
3
|
init_profile_sync
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-a45d5v9b.js";
|
|
5
5
|
import {
|
|
6
6
|
OpenAI,
|
|
7
7
|
init_openai
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getDbClient,
|
|
12
12
|
init_db,
|
|
13
13
|
isSqliteVecAvailable
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-qp69dd5d.js";
|
|
15
15
|
import {
|
|
16
16
|
__esm,
|
|
17
17
|
__export,
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
getEmbeddingProvider,
|
|
5
5
|
init_embedding,
|
|
6
6
|
serializeEmbedding
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-7kwmt3r5.js";
|
|
8
8
|
import {
|
|
9
9
|
getDbClient,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-qp69dd5d.js";
|
|
12
12
|
import {
|
|
13
13
|
init_secret_scrubber,
|
|
14
14
|
scrubSecrets
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
+
bufferedFileFailures,
|
|
3
|
+
buildEffectiveText,
|
|
2
4
|
createAdditiveBuffer,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
createSlackTaskWithFiles,
|
|
6
|
+
extractSlackMessageText,
|
|
7
|
+
fetchSlackFiles,
|
|
8
|
+
notifySlackFileFailures
|
|
9
|
+
} from "./cli-b8x19vbh.js";
|
|
5
10
|
import {
|
|
6
11
|
rewriteSlackMentions
|
|
7
|
-
} from "./cli-
|
|
8
|
-
import {
|
|
9
|
-
createTaskWithSiblingAwareness
|
|
10
|
-
} from "./cli-q50ef8g0.js";
|
|
12
|
+
} from "./cli-72xdszyx.js";
|
|
11
13
|
import {
|
|
12
14
|
buildBufferFlushBlocks,
|
|
13
15
|
ensureSlackThreadTree,
|
|
@@ -16,7 +18,7 @@ import {
|
|
|
16
18
|
getSlackApp,
|
|
17
19
|
isSlackRenderV2Enabled,
|
|
18
20
|
registerTreeMessage
|
|
19
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-kt7wevqh.js";
|
|
20
22
|
import {
|
|
21
23
|
createLogEntry,
|
|
22
24
|
getAgentById,
|
|
@@ -29,11 +31,15 @@ import {
|
|
|
29
31
|
init_steering,
|
|
30
32
|
requestSteering,
|
|
31
33
|
slackContextKey
|
|
32
|
-
} from "./cli-
|
|
34
|
+
} from "./cli-qp69dd5d.js";
|
|
33
35
|
import {
|
|
34
36
|
init_steering_enabled,
|
|
35
37
|
isSteeringEnabled
|
|
36
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-n75jt793.js";
|
|
39
|
+
import {
|
|
40
|
+
__callDispose,
|
|
41
|
+
__using
|
|
42
|
+
} from "./cli-bc05qbss.js";
|
|
37
43
|
|
|
38
44
|
// src/slack/event-dedup.ts
|
|
39
45
|
var DEFAULT_TTL_MS = 300000;
|
|
@@ -148,13 +154,14 @@ var slackBuffer = createAdditiveBuffer({
|
|
|
148
154
|
await slackFlush(items, key, reason === "manual");
|
|
149
155
|
}
|
|
150
156
|
});
|
|
151
|
-
function bufferThreadMessage(channelId, threadTs, text, userId, ts) {
|
|
157
|
+
function bufferThreadMessage(channelId, threadTs, text, userId, ts, files) {
|
|
152
158
|
slackBuffer.enqueue(makeKey(channelId, threadTs), {
|
|
153
159
|
text,
|
|
154
160
|
userId,
|
|
155
161
|
ts,
|
|
156
162
|
channelId,
|
|
157
|
-
threadTs
|
|
163
|
+
threadTs,
|
|
164
|
+
files
|
|
158
165
|
});
|
|
159
166
|
}
|
|
160
167
|
function getBufferMessageCount(key) {
|
|
@@ -194,106 +201,124 @@ async function getThreadContextForBuffer(channelId, threadTs) {
|
|
|
194
201
|
}
|
|
195
202
|
}
|
|
196
203
|
async function slackFlush(items, key, immediate) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
204
|
+
let __stack = [];
|
|
205
|
+
try {
|
|
206
|
+
if (items.length === 0)
|
|
207
|
+
return;
|
|
208
|
+
const split = splitKey(key);
|
|
209
|
+
if (!split) {
|
|
210
|
+
console.warn(`[Slack] Buffer flush: malformed key ${key}`);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const { channelId, threadTs } = split;
|
|
214
|
+
const originalRequesterId = items[0].userId;
|
|
215
|
+
console.log(`[Slack] Flushing buffer: ${key} (${items.length} messages, immediate=${immediate})`);
|
|
216
|
+
const app = getSlackApp();
|
|
217
|
+
const files = items.flatMap((item) => item.files ?? []);
|
|
218
|
+
const inbound = __using(__stack, app ? await fetchSlackFiles(app.client, files) : {
|
|
219
|
+
files,
|
|
220
|
+
fetched: [],
|
|
221
|
+
failed: bufferedFileFailures(files),
|
|
222
|
+
async[Symbol.asyncDispose]() {}
|
|
223
|
+
}, 1);
|
|
224
|
+
const resolvedFiles = new Map(inbound.files.map((file) => [file.id, file]));
|
|
225
|
+
const combinedText = await rewriteSlackMentions(items.map((item) => buildEffectiveText(item.text, item.files?.map((file) => resolvedFiles.get(file.id) ?? file), inbound.failed)).join(`
|
|
208
226
|
---
|
|
209
227
|
`));
|
|
210
|
-
|
|
228
|
+
const description = `[Thread follow-up — ${items.length} message(s) buffered]
|
|
211
229
|
|
|
212
230
|
${combinedText}`;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
})
|
|
238
|
-
|
|
239
|
-
|
|
231
|
+
const latestActiveTask = await getLatestActiveTaskInThread(channelId, threadTs);
|
|
232
|
+
if (latestActiveTask) {
|
|
233
|
+
console.log(`[Slack] Dependency chaining: latest active task ${latestActiveTask.id} (status: ${latestActiveTask.status})`);
|
|
234
|
+
}
|
|
235
|
+
const steering = files.length === 0 ? await requestSlackThreadSteering({
|
|
236
|
+
channelId,
|
|
237
|
+
threadTs,
|
|
238
|
+
message: combinedText,
|
|
239
|
+
messageTimestamps: items.map((item) => item.ts)
|
|
240
|
+
}) : null;
|
|
241
|
+
if (steering) {
|
|
242
|
+
console.log(`[Slack] Buffer flushed → steering ${steering.result.outcome} for task ${steering.task.id}`);
|
|
243
|
+
const agent = steering.task.agentId ? await getAgentById(steering.task.agentId) : undefined;
|
|
244
|
+
if (app) {
|
|
245
|
+
if (!isSlackRenderV2Enabled()) {
|
|
246
|
+
try {
|
|
247
|
+
await app.client.chat.postMessage({
|
|
248
|
+
channel: channelId,
|
|
249
|
+
thread_ts: threadTs,
|
|
250
|
+
text: formatSlackSteeringAck(steering.result),
|
|
251
|
+
unfurl_links: false,
|
|
252
|
+
unfurl_media: false,
|
|
253
|
+
...agent ? { username: getAgentDisplayName(agent), icon_emoji: getAgentEmoji(agent) } : {}
|
|
254
|
+
});
|
|
255
|
+
} catch (error) {
|
|
256
|
+
console.error("[Slack] Failed to post steering feedback:", error);
|
|
257
|
+
}
|
|
240
258
|
}
|
|
241
259
|
}
|
|
260
|
+
return;
|
|
242
261
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
const threadContext = await getThreadContextForBuffer(channelId, threadTs);
|
|
247
|
-
const fullDescription = threadContext ? `<thread_context>
|
|
262
|
+
const lead = await getLeadAgent();
|
|
263
|
+
const threadContext = await getThreadContextForBuffer(channelId, threadTs);
|
|
264
|
+
const fullDescription = threadContext ? `<thread_context>
|
|
248
265
|
${threadContext}
|
|
249
266
|
</thread_context>
|
|
250
267
|
|
|
251
268
|
${description}` : description;
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
try {
|
|
281
|
-
const result = await app.client.chat.postMessage({
|
|
282
|
-
channel: channelId,
|
|
283
|
-
thread_ts: threadTs,
|
|
284
|
-
text: fallbackText,
|
|
285
|
-
unfurl_links: false,
|
|
286
|
-
unfurl_media: false,
|
|
287
|
-
...lead ? { username: getAgentDisplayName(lead), icon_emoji: getAgentEmoji(lead) } : {},
|
|
288
|
-
blocks
|
|
269
|
+
const dependsOn = !immediate && latestActiveTask ? [latestActiveTask.id] : undefined;
|
|
270
|
+
const mostRecentTask = await getMostRecentTaskInThread(channelId, threadTs);
|
|
271
|
+
const { task, unattached } = await createSlackTaskWithFiles(fullDescription, {
|
|
272
|
+
agentId: lead?.id,
|
|
273
|
+
routingReason: lead && mostRecentTask?.agentId === lead.id ? "continuity" : lead ? "skill" : undefined,
|
|
274
|
+
routingSource: lead ? "engine_default" : undefined,
|
|
275
|
+
source: "slack",
|
|
276
|
+
slackChannelId: channelId,
|
|
277
|
+
slackThreadTs: threadTs,
|
|
278
|
+
slackTriggerMessageTs: items.at(-1).ts,
|
|
279
|
+
slackUserId: originalRequesterId,
|
|
280
|
+
dependsOn,
|
|
281
|
+
parentTaskId: mostRecentTask?.id,
|
|
282
|
+
contextKey: slackContextKey({ channelId, threadTs })
|
|
283
|
+
}, inbound);
|
|
284
|
+
if (app)
|
|
285
|
+
await notifySlackFileFailures(app.client, channelId, threadTs, unattached);
|
|
286
|
+
console.log(`[Slack] Buffer flushed → task ${task.id} (dependsOn: ${dependsOn ? dependsOn.join(", ") : "none"})`);
|
|
287
|
+
if (isSlackRenderV2Enabled()) {
|
|
288
|
+
await ensureSlackThreadTree([task.id]);
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (app) {
|
|
292
|
+
const hasDependency = !immediate && !!latestActiveTask;
|
|
293
|
+
const blocks = buildBufferFlushBlocks({
|
|
294
|
+
messageCount: items.length,
|
|
295
|
+
taskId: task.id,
|
|
296
|
+
hasDependency
|
|
289
297
|
});
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
298
|
+
const fallbackText = hasDependency ? `${items.length} follow-up message(s) queued pending completion of current task` : `${items.length} follow-up message(s) batched into task`;
|
|
299
|
+
try {
|
|
300
|
+
const result = await app.client.chat.postMessage({
|
|
301
|
+
channel: channelId,
|
|
302
|
+
thread_ts: threadTs,
|
|
303
|
+
text: fallbackText,
|
|
304
|
+
unfurl_links: false,
|
|
305
|
+
unfurl_media: false,
|
|
306
|
+
...lead ? { username: getAgentDisplayName(lead), icon_emoji: getAgentEmoji(lead) } : {},
|
|
307
|
+
blocks
|
|
308
|
+
});
|
|
309
|
+
if (result.ts && task) {
|
|
310
|
+
await registerTreeMessage(task.id, channelId, threadTs, result.ts);
|
|
311
|
+
console.log(`[Slack] Registered batched task ${task.id.slice(0, 8)} tree message from buffer flush`);
|
|
312
|
+
}
|
|
313
|
+
} catch (error) {
|
|
314
|
+
console.error("[Slack] Failed to post buffer flush feedback:", error);
|
|
293
315
|
}
|
|
294
|
-
} catch (error) {
|
|
295
|
-
console.error("[Slack] Failed to post buffer flush feedback:", error);
|
|
296
316
|
}
|
|
317
|
+
} catch (_catch) {
|
|
318
|
+
var _err = _catch, _hasErr = 1;
|
|
319
|
+
} finally {
|
|
320
|
+
var _promise = __callDispose(__stack, _err, _hasErr);
|
|
321
|
+
_promise && await _promise;
|
|
297
322
|
}
|
|
298
323
|
}
|
|
299
324
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_task_attachment_links,
|
|
3
3
|
taskAttachmentDisplayUrl
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-2658f6at.js";
|
|
5
5
|
import {
|
|
6
6
|
IDENTITY_FIELD_BUDGETS,
|
|
7
7
|
init_identity_field_budget,
|
|
8
8
|
init_templates
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-hmyynq9b.js";
|
|
10
10
|
import {
|
|
11
11
|
init_resolver,
|
|
12
12
|
init_steering_enabled,
|
|
13
13
|
isSteeringEnabled,
|
|
14
14
|
resolveTemplateAsync
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-n75jt793.js";
|
|
16
16
|
import {
|
|
17
17
|
MAX_PROFILE_FILE_LENGTH,
|
|
18
18
|
init_constants
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-dv6cdjs2.js";
|
|
20
20
|
import {
|
|
21
21
|
init_secret_scrubber,
|
|
22
22
|
scrubSecrets
|
|
@@ -3966,7 +3966,7 @@ _EnvironmentWorker_signal = new WeakMap, _EnvironmentWorker_instances = new Weak
|
|
|
3966
3966
|
const ctrl = new AbortController;
|
|
3967
3967
|
const detachExternal = linkAbort(externalSignal, ctrl);
|
|
3968
3968
|
const lease = new Lease(ctrl);
|
|
3969
|
-
const agentToolset = await import("./node-
|
|
3969
|
+
const agentToolset = await import("./node-209sxmg3.js");
|
|
3970
3970
|
let leaseTtlMs;
|
|
3971
3971
|
let runner;
|
|
3972
3972
|
const heartbeatPromise = heartbeatLoop(sessionClient, work, lease, log2, this.requestOptions, (ttlMs) => {
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
} from "./cli-jsp14b6c.js";
|
|
5
5
|
import {
|
|
6
6
|
createTaskWithSiblingAwareness
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-n1yj5fd5.js";
|
|
8
8
|
import {
|
|
9
9
|
init_task_attachment_links,
|
|
10
10
|
taskAttachmentFetchCommand
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-2658f6at.js";
|
|
12
12
|
import {
|
|
13
13
|
getAgentById,
|
|
14
14
|
getAgentWorkingOnThread,
|
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
insertTaskAttachment,
|
|
20
20
|
promoteDraftTask,
|
|
21
21
|
refreshDraftTaskLease
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-qp69dd5d.js";
|
|
23
23
|
import {
|
|
24
24
|
init_registry,
|
|
25
25
|
init_resolver,
|
|
26
26
|
registerTemplate,
|
|
27
27
|
resolveTemplate
|
|
28
|
-
} from "./cli-
|
|
28
|
+
} from "./cli-n75jt793.js";
|
|
29
29
|
import {
|
|
30
30
|
init_env_flag,
|
|
31
31
|
isEnvFlagEnabled
|
|
@@ -42,7 +42,8 @@ function buildAgentFsLiveUrl(opts) {
|
|
|
42
42
|
return null;
|
|
43
43
|
const host = getAgentFsLiveUrl();
|
|
44
44
|
const normalizedPath = path.replace(/^\/+/, "");
|
|
45
|
-
|
|
45
|
+
const encodedPath = normalizedPath.split("/").map((segment) => encodeURIComponent(segment).replace(/%25([0-9a-f]{2})/gi, "%$1")).join("/");
|
|
46
|
+
return `${host}/file/~/${orgId}/${driveId}/${encodedPath}`;
|
|
46
47
|
}
|
|
47
48
|
var MAX_PROFILE_FILE_LENGTH, DEFAULT_APP_URL = "https://app.agent-swarm.dev", DEFAULT_AGENT_FS_LIVE_URL = "https://live.agent-fs.dev";
|
|
48
49
|
var init_constants = __esm(() => {
|
|
@@ -7,7 +7,7 @@ var package_default;
|
|
|
7
7
|
var init_package = __esm(() => {
|
|
8
8
|
package_default = {
|
|
9
9
|
name: "@desplega.ai/agent-swarm",
|
|
10
|
-
version: "1.
|
|
10
|
+
version: "1.150.0",
|
|
11
11
|
description: "agent-swarm.dev — an open-source operating system for AI work: a lead agent breaks goals into tasks, routes them to specialized workers such as Claude Code or Codex, runs each worker in an isolated container, and preserves shared memory, tools, schedules, and review gates so delegated work compounds across sessions.",
|
|
12
12
|
keywords: [
|
|
13
13
|
"agent-swarm.dev",
|
|
@@ -200,8 +200,8 @@ var init_package = __esm(() => {
|
|
|
200
200
|
"@inkjs/ui": "^2.0.0",
|
|
201
201
|
"@linear/sdk": "^77.0.0",
|
|
202
202
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
203
|
-
"@openai/codex": "0.
|
|
204
|
-
"@opencode-ai/sdk": "^1.18.
|
|
203
|
+
"@openai/codex": "0.154.0",
|
|
204
|
+
"@opencode-ai/sdk": "^1.18.31",
|
|
205
205
|
"@openfort/openfort-node": "^0.9.1",
|
|
206
206
|
"@opentelemetry/api": "^1.9.1",
|
|
207
207
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildModelsDevSeedRows,
|
|
3
3
|
loadModelsDevCache
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-ceb5y160.js";
|
|
5
5
|
import {
|
|
6
6
|
createLogEntry,
|
|
7
7
|
getActivePricingRow,
|
|
8
8
|
getDbClient,
|
|
9
9
|
init_db,
|
|
10
10
|
insertPricingRow
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-qp69dd5d.js";
|
|
12
12
|
import {
|
|
13
13
|
init_secret_scrubber,
|
|
14
14
|
scrubSecrets
|
|
@@ -5,9 +5,8 @@ import {
|
|
|
5
5
|
instantFlush,
|
|
6
6
|
requestSlackThreadSteering,
|
|
7
7
|
wasEventSeen
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-9gqddmxs.js";
|
|
9
9
|
import {
|
|
10
|
-
bufferedFileFailures,
|
|
11
10
|
buildEffectiveText,
|
|
12
11
|
createSlackTaskWithFiles,
|
|
13
12
|
extractSlackMessageText,
|
|
@@ -16,25 +15,19 @@ import {
|
|
|
16
15
|
hasOtherUserMention,
|
|
17
16
|
notifySlackFileFailures,
|
|
18
17
|
routeMessage
|
|
19
|
-
} from "./cli-
|
|
20
|
-
import"./cli-jsp14b6c.js";
|
|
18
|
+
} from "./cli-b8x19vbh.js";
|
|
21
19
|
import {
|
|
22
20
|
enrichSlackUserEmail,
|
|
23
21
|
resolveSlackUserId,
|
|
24
22
|
rewriteSlackMentions
|
|
25
|
-
} from "./cli-
|
|
26
|
-
import"./cli-gv88e1vf.js";
|
|
27
|
-
import"./cli-q50ef8g0.js";
|
|
23
|
+
} from "./cli-72xdszyx.js";
|
|
28
24
|
import {
|
|
29
25
|
ackSlackMessage,
|
|
30
26
|
buildTreeBlocks,
|
|
31
27
|
ensureSlackThreadTree,
|
|
32
28
|
isSlackRenderV2Enabled,
|
|
33
29
|
registerTreeMessage
|
|
34
|
-
} from "./cli-
|
|
35
|
-
import"./cli-q51yprfq.js";
|
|
36
|
-
import"./cli-9d8ntetj.js";
|
|
37
|
-
import"./cli-yatxqynm.js";
|
|
30
|
+
} from "./cli-kt7wevqh.js";
|
|
38
31
|
import {
|
|
39
32
|
getAgentById,
|
|
40
33
|
getAgentWorkingOnThread,
|
|
@@ -45,29 +38,19 @@ import {
|
|
|
45
38
|
init_db,
|
|
46
39
|
reactionName,
|
|
47
40
|
slackContextKey
|
|
48
|
-
} from "./cli-
|
|
49
|
-
import"./cli-08b07b4r.js";
|
|
41
|
+
} from "./cli-qp69dd5d.js";
|
|
50
42
|
import {
|
|
51
43
|
init_resolver,
|
|
52
44
|
resolveTemplate
|
|
53
|
-
} from "./cli-
|
|
54
|
-
import"./cli-e29gmdmw.js";
|
|
55
|
-
import"./cli-c2mk1kgf.js";
|
|
45
|
+
} from "./cli-n75jt793.js";
|
|
56
46
|
import {
|
|
57
47
|
init_env_flag,
|
|
58
48
|
isEnvFlagEnabled
|
|
59
49
|
} from "./cli-ej6gbxfb.js";
|
|
60
|
-
import"./cli-sd0mxa3c.js";
|
|
61
|
-
import"./cli-w5e1d1vv.js";
|
|
62
|
-
import"./cli-kjwt6hdf.js";
|
|
63
|
-
import"./cli-r2ap2czm.js";
|
|
64
|
-
import"./cli-pzxba7gw.js";
|
|
65
50
|
import {
|
|
66
51
|
init_event_bus,
|
|
67
52
|
workflowEventBus
|
|
68
53
|
} from "./cli-f7kvq46p.js";
|
|
69
|
-
import"./cli-zf8jjwex.js";
|
|
70
|
-
import"./cli-bd957dgb.js";
|
|
71
54
|
import {
|
|
72
55
|
__callDispose,
|
|
73
56
|
__using
|
|
@@ -308,18 +291,16 @@ function registerMessageHandler(app) {
|
|
|
308
291
|
const additiveSlack = isEnvFlagEnabled("ADDITIVE_SLACK", false);
|
|
309
292
|
const requireMentionForThreadFollowup = isEnvFlagEnabled("SLACK_THREAD_FOLLOWUP_REQUIRE_MENTION", false);
|
|
310
293
|
if (additiveSlack && msg.thread_ts) {
|
|
311
|
-
const
|
|
312
|
-
const stripped = buildEffectiveText(msg.text, msg.files, unattached2).replace(/<@[A-Z0-9]+>/g, "").trim();
|
|
294
|
+
const stripped = (msg.text ?? "").replace(/<@[A-Z0-9]+>/g, "").trim();
|
|
313
295
|
if (stripped.startsWith("!now") && await hasSwarmThreadActivity(client, msg.channel, msg.thread_ts)) {
|
|
314
296
|
const nowMessage = stripped.replace(/^!now\s*/, "").trim();
|
|
315
297
|
const threadKey = `${msg.channel}:${msg.thread_ts}`;
|
|
316
298
|
console.log(`[Slack] !now command detected in thread ${threadKey}${nowMessage ? ` with message: "${nowMessage}"` : ""}`);
|
|
317
|
-
if (nowMessage) {
|
|
318
|
-
bufferThreadMessage(msg.channel, msg.thread_ts, nowMessage, msg.user, msg.ts);
|
|
299
|
+
if (nowMessage || msg.files?.length) {
|
|
300
|
+
bufferThreadMessage(msg.channel, msg.thread_ts, nowMessage, msg.user, msg.ts, msg.files);
|
|
319
301
|
}
|
|
320
302
|
await instantFlush(threadKey);
|
|
321
303
|
await ackSlackMessage(client, msg.channel, msg.ts, reactionName("now"), "now");
|
|
322
|
-
await notifySlackFileFailures(client, msg.channel, msg.thread_ts, unattached2);
|
|
323
304
|
return;
|
|
324
305
|
}
|
|
325
306
|
}
|
|
@@ -331,14 +312,12 @@ function registerMessageHandler(app) {
|
|
|
331
312
|
const hasSwarmActivity = await hasSwarmThreadActivity(client, msg.channel, msg.thread_ts);
|
|
332
313
|
if (hasSwarmActivity) {
|
|
333
314
|
const threadKey = `${msg.channel}:${msg.thread_ts}`;
|
|
334
|
-
|
|
335
|
-
bufferThreadMessage(msg.channel, msg.thread_ts, buildEffectiveText(msg.text, msg.files, unattached2), msg.user, msg.ts);
|
|
315
|
+
bufferThreadMessage(msg.channel, msg.thread_ts, msg.text ?? "", msg.user, msg.ts, msg.files);
|
|
336
316
|
const count = getBufferMessageCount(threadKey);
|
|
337
317
|
const event2 = count === 1 ? "accepted" : "buffered";
|
|
338
318
|
const name = reactionName(event2);
|
|
339
319
|
console.log(`[Slack] Additive buffer: ${threadKey} (message #${count}, reaction: ${name})`);
|
|
340
320
|
await ackSlackMessage(client, msg.channel, msg.ts, name, event2);
|
|
341
|
-
await notifySlackFileFailures(client, msg.channel, msg.thread_ts, unattached2);
|
|
342
321
|
return;
|
|
343
322
|
}
|
|
344
323
|
}
|
|
@@ -388,6 +367,7 @@ ${taskDescription2}`;
|
|
|
388
367
|
const { task, unattached: unattached2 } = await createSlackTaskWithFiles(fullTaskDescription2, {
|
|
389
368
|
agentId: lead?.id,
|
|
390
369
|
routingReason: lead ? "skill" : undefined,
|
|
370
|
+
routingSource: lead ? "engine_default" : undefined,
|
|
391
371
|
source: "slack",
|
|
392
372
|
slackChannelId: msg.channel,
|
|
393
373
|
slackThreadTs: threadTs2,
|
|
@@ -476,6 +456,7 @@ ${taskDescription}`;
|
|
|
476
456
|
const created2 = await createSlackTaskWithFiles(fullTaskDescription, {
|
|
477
457
|
agentId: agent.id,
|
|
478
458
|
routingReason: "human_pinned",
|
|
459
|
+
routingSource: "engine_default",
|
|
479
460
|
source: "slack",
|
|
480
461
|
slackChannelId: msg.channel,
|
|
481
462
|
slackThreadTs: threadTs,
|
|
@@ -494,6 +475,7 @@ ${taskDescription}`;
|
|
|
494
475
|
const created = await createSlackTaskWithFiles(fullTaskDescription, {
|
|
495
476
|
agentId: agent.id,
|
|
496
477
|
routingReason: "human_pinned",
|
|
478
|
+
routingSource: "engine_default",
|
|
497
479
|
source: "slack",
|
|
498
480
|
slackChannelId: msg.channel,
|
|
499
481
|
slackThreadTs: threadTs,
|
|
@@ -597,10 +579,5 @@ ${taskDescription}`;
|
|
|
597
579
|
console.log(`[Slack] App mentioned in channel ${event.channel}`);
|
|
598
580
|
});
|
|
599
581
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
isBotMessage,
|
|
603
|
-
isSwarmThreadRoot,
|
|
604
|
-
registerMessageHandler,
|
|
605
|
-
resetSlackHandlerCachesForTesting
|
|
606
|
-
};
|
|
582
|
+
|
|
583
|
+
export { checkUserAccess, isUserAllowed, isBotMessage, resetSlackHandlerCachesForTesting, isSwarmThreadRoot, registerMessageHandler };
|