@desplega.ai/agent-swarm 2.7.7 → 2.7.8
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-7b4vk3h5.js → acp-adapter-vg5hqkvj.js} +6 -6
- package/dist/{actions-3tt153af.js → actions-4m1ct4nh.js} +18 -18
- package/dist/{amp-adapter-njpts0yr.js → amp-adapter-txqh7eqj.js} +2 -2
- package/dist/{app-nky4378f.js → app-e00m45gn.js} +3 -3
- package/dist/{assistant-jnb669pa.js → assistant-gd08kr9e.js} +20 -20
- package/dist/boot-args-schema-tjrkpbvm.js +89 -0
- package/dist/{boot-reembed-9mgvaztt.js → boot-reembed-21hbck22.js} +1 -1
- package/dist/{boot-reembed-qs2djdej.js → boot-reembed-mdxd3wgp.js} +1 -1
- package/dist/{boot-scrub-sweep-yjpdj7s1.js → boot-scrub-sweep-qy0zr9t2.js} +3 -3
- package/dist/{boot-seeds-5cm6ambd.js → boot-seeds-n46eaxdv.js} +4 -4
- package/dist/{claude-adapter-fn287zmm.js → claude-adapter-j37w2eds.js} +6 -6
- package/dist/{claude-managed-adapter-dvs2xw5n.js → claude-managed-adapter-8jvcma9a.js} +3 -3
- package/dist/{claude-managed-setup-wtdz2mj2.js → claude-managed-setup-rzkjmgc1.js} +3 -3
- package/dist/{claude-sdk-session-x91kqyhm.js → claude-sdk-session-4k7w73t0.js} +7 -7
- package/dist/{cli-rtt8g4v9.js → cli-0ykgn1h5.js} +1 -1
- package/dist/{cli-5b456bpf.js → cli-1cxrbkk6.js} +2 -2
- package/dist/{cli-5jnhv72d.js → cli-269q28a1.js} +4 -2
- package/dist/{cli-k1nje3v3.js → cli-32m9eda8.js} +49 -37
- package/dist/{cli-35rsp8ye.js → cli-3e4snnzf.js} +1 -1
- package/dist/{cli-5zx699j9.js → cli-4t50yq3j.js} +2 -2
- package/dist/{cli-n6bv12jn.js → cli-5j0m12ns.js} +10 -3
- package/dist/{cli-dhar9qay.js → cli-5ja3b75e.js} +2 -2
- package/dist/{cli-g08zdaec.js → cli-66ww7fer.js} +1 -1
- package/dist/{cli-nmzhp1b5.js → cli-7axf41jq.js} +25 -14
- package/dist/{cli-gz6q4eve.js → cli-84rj785g.js} +5 -5
- package/dist/{cli-fyt2g4wd.js → cli-85gzce7b.js} +5 -5
- package/dist/{cli-3fg0bdcv.js → cli-8h0ayw8c.js} +1 -1
- package/dist/{cli-qghe0h66.js → cli-8rpcng8j.js} +2 -2
- package/dist/{cli-ws19768n.js → cli-8sdejs1f.js} +115 -51
- package/dist/{cli-8305gbq0.js → cli-9m8hdawy.js} +3 -3
- package/dist/{cli-excnnjg2.js → cli-ae0dnfee.js} +1 -1
- package/dist/{cli-e0kmphd6.js → cli-bb0mmdk8.js} +2 -2
- package/dist/{cli-1c6tzt8g.js → cli-bbw9wj9m.js} +8 -8
- package/dist/{cli-pjctyea3.js → cli-bshb7jas.js} +2 -2
- package/dist/{cli-08bmz9z9.js → cli-btfsp3mv.js} +3 -3
- package/dist/{cli-4zsenjhy.js → cli-c0kqky8y.js} +16 -3
- package/dist/{cli-tgrv9cjx.js → cli-dq8x79v8.js} +1 -1
- package/dist/{cli-ftyxyspd.js → cli-eqtfgfr6.js} +1 -1
- package/dist/{cli-ddaanqkd.js → cli-eyg1pa00.js} +3 -3
- package/dist/{cli-8sckt74b.js → cli-fyhr5h4s.js} +34 -12
- package/dist/{cli-q3tkegby.js → cli-fzachfnf.js} +1 -1
- package/dist/{cli-ayayvfg4.js → cli-ga786dzg.js} +13 -10
- package/dist/{cli-yyj3j5m4.js → cli-gazw7kpa.js} +2 -2
- package/dist/{cli-e46hg0xw.js → cli-gvx71kqv.js} +2 -2
- package/dist/{cli-pc6n7fre.js → cli-jdv6ypxs.js} +1 -1
- package/dist/{cli-cm5yqn35.js → cli-kf3pxxdg.js} +1 -0
- package/dist/{cli-6g0hb4cp.js → cli-kyr67fgx.js} +7 -7
- package/dist/{cli-95jzxcp3.js → cli-m0hmeqma.js} +2 -2
- package/dist/{cli-6pfd54vx.js → cli-msg9m2ny.js} +3 -1
- package/dist/{cli-afkqkrtw.js → cli-nbsf8yvn.js} +15 -3
- package/dist/{cli-tfyyvzx6.js → cli-njwac61j.js} +5 -0
- package/dist/{cli-vz22fyqv.js → cli-nn3ysbqk.js} +1 -1
- package/dist/{cli-m0da8j35.js → cli-p3vsj0d3.js} +5 -5
- package/dist/{cli-72v799xn.js → cli-ppjxh6ah.js} +3 -3
- package/dist/{cli-k899ehvh.js → cli-q4ebh7h7.js} +4 -4
- package/dist/{cli-75gkpjvw.js → cli-qd57hhhh.js} +2 -2
- package/dist/{cli-qh4d4tvk.js → cli-rjknb2ae.js} +4 -4
- package/dist/{cli-caj33vcq.js → cli-s4ss5g59.js} +1 -1
- package/dist/{cli-cb2a8pna.js → cli-sq4n7af4.js} +1 -1
- package/dist/{cli-vfym7wmz.js → cli-ssnjfg5p.js} +5 -5
- package/dist/{cli-je518txm.js → cli-t60ajbbp.js} +8 -8
- package/dist/{cli-adeegh7d.js → cli-tpksw2nr.js} +21 -17
- package/dist/{cli-wk5yrfwd.js → cli-w4xnbm46.js} +150 -58
- package/dist/{cli-k8196sh2.js → cli-wemma3jd.js} +8 -7
- package/dist/{cli-cppkf404.js → cli-xq9r2wtt.js} +45 -21
- package/dist/{cli-bfv7vdg6.js → cli-xr8908my.js} +11 -11
- package/dist/{cli-73jzwksr.js → cli-ycscb2ar.js} +4 -1
- package/dist/{cli-p82cnnjq.js → cli-yqefz277.js} +1 -1
- package/dist/{cli-jtjtabxe.js → cli-z1srzaf6.js} +11 -3
- package/dist/{cli-pq73h5mz.js → cli-z75yxkjh.js} +3 -3
- package/dist/{cli-e5bzrn01.js → cli-zkky4t5g.js} +1 -1
- package/dist/cli.js +17 -15
- package/dist/{codex-adapter-cf2yxe9m.js → codex-adapter-88z6psm4.js} +5 -5
- package/dist/{codex-hook-a0c6g6t6.js → codex-hook-fac6175r.js} +1 -1
- package/dist/{codex-login-y0pmff1c.js → codex-login-74wa4hmq.js} +1 -1
- package/dist/{codex-session-runner-6vfzdgbd.js → codex-session-runner-zwbcwzvx.js} +5 -5
- package/dist/{commands-t3mfy7vn.js → commands-7amxs716.js} +3 -3
- package/dist/{controller-q7xrbaz0.js → controller-5rkkc37m.js} +2 -2
- package/dist/{controllers-connect-c6nm70kg.js → controllers-connect-m7d4vxxb.js} +19 -19
- package/dist/{cursor-adapter-ftd81ga8.js → cursor-adapter-x1q18693.js} +1 -1
- package/dist/{db-vemtpmcc.js → db-athc68zt.js} +4 -2
- package/dist/{db-dk572x25.js → db-h2fsfve3.js} +3 -3
- package/dist/{dispatcher-kh7ecxh9.js → dispatcher-b1yz2bnn.js} +17 -17
- package/dist/{dsh-adapter-v8628r89.js → dsh-adapter-e33bkxq9.js} +1 -1
- package/dist/{easter-egg-3d-nenw4x63.js → easter-egg-3d-pv5qnzc8.js} +1 -1
- package/dist/{embedding-space-0jepb239.js → embedding-space-b4txbwrk.js} +6 -6
- package/dist/{embeddings-xxt49yxg.js → embeddings-m6zn6tad.js} +1 -1
- package/dist/{execute-1mhw6e4x.js → execute-68nwny8m.js} +1 -1
- package/dist/{external-channel-55v12e60.js → external-channel-gkckmhzh.js} +2 -2
- package/dist/{fx-adapter-bs8wqrk5.js → fx-adapter-m5jbgd5q.js} +7 -7
- package/dist/{grok-adapter-gpjqmkcq.js → grok-adapter-csvv7sac.js} +7 -7
- package/dist/handlers-8x5gfbzx.js +32 -0
- package/dist/{heartbeat-k42svnr0.js → heartbeat-6c2y3267.js} +20 -20
- package/dist/{hook-6nphweh0.js → hook-q5fv0jy2.js} +6 -6
- package/dist/{hook-114m7hap.js → hook-w0q2wcrv.js} +5 -5
- package/dist/{http-r8cc4wz7.js → http-bxat8dg3.js} +260 -120
- package/dist/{index-nh3wyqdt.js → index-bxrexmfy.js} +13 -13
- package/dist/{index-e3s8wmxy.js → index-cqhqpgrv.js} +1 -1
- package/dist/{index-fpk4bcd9.js → index-fm0czesf.js} +1 -1
- package/dist/index-hpfte8jd.js +33 -0
- package/dist/index-ncf7yb5s.js +30 -0
- package/dist/index-vte6dyeh.js +37 -0
- package/dist/{keepalive-x060nt9p.js → keepalive-qnt21cv0.js} +3 -3
- package/dist/lead-4bvftzm6.js +71 -0
- package/dist/{maintenance-2xxfexhf.js → maintenance-btdr68y4.js} +1 -1
- package/dist/{oauth-refresh-sweep-fckc4ar5.js → oauth-refresh-sweep-vczabeh4.js} +2 -2
- package/dist/{onboard-zc48j237.js → onboard-k33ezyq8.js} +2 -2
- package/dist/{opencode-adapter-r690h1cr.js → opencode-adapter-3dst2ka7.js} +5 -5
- package/dist/{otel-impl-r5xbh81q.js → otel-impl-13am7a65.js} +1 -1
- package/dist/{pi-mono-adapter-c7v8sdec.js → pi-mono-adapter-c53de1gd.js} +15 -9
- package/dist/{pricing-refresh-3pmre11v.js → pricing-refresh-9fcbnq3f.js} +3 -3
- package/dist/{rbac-roles-910mmkgz.js → rbac-roles-66j5h4y5.js} +5 -3
- package/dist/{rbac-roles-3vbshwsb.js → rbac-roles-gw0p9h3j.js} +2 -2
- package/dist/{render-v2-pxykkbab.js → render-v2-fg8bmdn4.js} +3 -3
- package/dist/{resume-adda0bwy.js → resume-1c8kr3nh.js} +6 -6
- package/dist/{runtime-fnbm7stk.js → runtime-tzf9j7tc.js} +1 -1
- package/dist/{session-access-2fvamrdc.js → session-access-d0atq10j.js} +7 -5
- package/dist/{session-source-backfill-08xvv0sm.js → session-source-backfill-0vscqmsa.js} +2 -2
- package/dist/{setup-1aqmvmh1.js → setup-tvfa7rwe.js} +1 -1
- package/dist/{virtual-modules-d2pjk9j1.js → virtual-modules-efxcp740.js} +2 -2
- package/dist/{work-objects-9s0yrm5j.js → work-objects-ks71xqeb.js} +20 -20
- package/dist/worker-e7v2bvm9.js +71 -0
- package/dist/{worker-follow-up-3q78fqmr.js → worker-follow-up-bfx0h9hg.js} +17 -17
- package/openapi.json +104 -24
- package/package.json +3 -1
- package/src/be/db/model-profiles.ts +1 -1
- package/src/be/db/session-tree.ts +9 -5
- package/src/be/db/session-visibility.ts +25 -9
- package/src/be/db/tasks/read.ts +11 -6
- package/src/be/db/tasks/write.ts +77 -7
- package/src/be/db-queries/tracker.ts +4 -2
- package/src/be/db.ts +49 -17
- package/src/be/migrations/271_subscription_usage_model.sql +30 -0
- package/src/be/model-validation.ts +19 -1
- package/src/be/rbac-roles.ts +21 -0
- package/src/be/runtime-pools/routing.ts +1 -1
- package/src/be/scripts/boot-args-schema.ts +95 -0
- package/src/be/scripts/extract-schema.ts +15 -10
- package/src/be/seed-scripts/catalog/boot-triage.inline.ts +1 -1
- package/src/be/seed-scripts/catalog/boot-triage.ts +1 -1
- package/src/be/seed-scripts/catalog/get-child-outputs.ts +1 -1
- package/src/be/seed-scripts/catalog/wait-for-task.ts +1 -1
- package/src/be/swarm-config-guard.ts +7 -0
- package/src/be/users.ts +6 -4
- package/src/commands/claude-managed-setup.ts +1 -1
- package/src/commands/runner.ts +26 -9
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/http/agents.ts +7 -1
- package/src/http/approval-requests.ts +30 -6
- package/src/http/codex-oauth-device.ts +2 -2
- package/src/http/index.ts +8 -0
- package/src/http/mcp-oauth.ts +6 -0
- package/src/http/mcp-servers.ts +8 -0
- package/src/http/models-catalog.ts +1 -1
- package/src/http/pages-public.ts +38 -1
- package/src/http/poll.ts +3 -4
- package/src/http/prompt-templates.ts +1 -1
- package/src/http/schedules.ts +4 -0
- package/src/http/script-runs.ts +6 -1
- package/src/http/session-access.ts +61 -6
- package/src/http/sessions.ts +23 -7
- package/src/http/tasks.ts +53 -9
- package/src/http/users.ts +30 -1
- package/src/http/utils.ts +2 -1
- package/src/http/workflows.ts +11 -7
- package/src/prompts/session-templates.ts +1 -0
- package/src/providers/acp-targets.ts +1 -1
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/codex-adapter.ts +9 -2
- package/src/providers/codex-oauth/device.ts +49 -15
- package/src/providers/codex-oauth/flow.ts +2 -1
- package/src/providers/pi-mono-adapter.ts +8 -0
- package/src/providers/pricing-sources.md +16 -1
- package/src/providers/swarm-events-shared.ts +15 -2
- package/src/rbac/legacy-policy.ts +1 -0
- package/src/rbac/permissions.ts +5 -0
- package/src/scheduler/deferred-task-waits.ts +9 -4
- package/src/scripts-runtime/extract-args-schema.ts +3 -1
- package/src/scripts-runtime/swarm-sdk.ts +1 -1
- package/src/scripts-runtime/types/swarm-extension.d.ts +29 -28
- package/src/server-user.ts +1 -1
- package/src/slack/ack.ts +48 -12
- package/src/slack/blocks.ts +1 -0
- package/src/slack/reaction-shortcode.ts +8 -2
- package/src/slack/render-v2.ts +30 -3
- package/src/slack/task-output.ts +4 -1
- package/src/slack/thread-buffer.ts +2 -2
- package/src/tasks/task-skip.ts +28 -0
- package/src/tasks/terminal-result-guard.ts +3 -2
- package/src/telemetry.ts +28 -1
- package/src/tests/agentmail-inbox-mapping.test.ts +73 -0
- package/src/tests/approval-requests.test.ts +58 -0
- package/src/tests/claude-managed-setup.test.ts +36 -0
- package/src/tests/codex-adapter.test.ts +2 -2
- package/src/tests/codex-oauth-device.test.ts +60 -0
- package/src/tests/codex-swarm-events.test.ts +43 -1
- package/src/tests/context-window.test.ts +14 -0
- package/src/tests/db-queries-tracker.test.ts +2 -1
- package/src/tests/db-task-read-contract.test.ts +1 -0
- package/src/tests/db-task-write-contract.test.ts +2 -0
- package/src/tests/deferred-task-wake.test.ts +7 -2
- package/src/tests/e2e-coverage-contract.test.ts +235 -0
- package/src/tests/empty-output-schema.test.ts +160 -0
- package/src/tests/env-flag.test.ts +1 -0
- package/src/tests/explicit-model-validation.test.ts +14 -0
- package/src/tests/http-api-integration.test.ts +2 -2
- package/src/tests/http-users.test.ts +63 -0
- package/src/tests/mcp-input-caps.test.ts +4 -3
- package/src/tests/merge-gate-detect-changes.test.ts +22 -0
- package/src/tests/pages-authed-mode.test.ts +13 -2
- package/src/tests/pi-mono-adapter.test.ts +39 -4
- package/src/tests/rbac-engine.test.ts +1 -0
- package/src/tests/runner-context-usage.test.ts +119 -0
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/script-executor-quickjs.test.ts +2 -0
- package/src/tests/script-runs-http.test.ts +57 -0
- package/src/tests/scripts-boot-args-schema.test.ts +181 -0
- package/src/tests/scripts-runtime.test.ts +24 -0
- package/src/tests/sdk-store-progress-skipped.test.ts +155 -0
- package/src/tests/session-costs-model-key-normalize.test.ts +59 -0
- package/src/tests/session-sharing.test.ts +212 -2
- package/src/tests/slack-reaction-config.test.ts +1 -0
- package/src/tests/slack-render-v2.test.ts +73 -0
- package/src/tests/slack-skip-reaction.test.ts +203 -0
- package/src/tests/store-progress-skipped.test.ts +159 -0
- package/src/tests/subscription-usage-migration.test.ts +57 -0
- package/src/tests/swarm-config-reserved-keys.test.ts +3 -0
- package/src/tests/telemetry-endpoint-override.test.ts +27 -0
- package/src/tests/trigger-claiming.test.ts +2 -0
- package/src/tests/workflow-system-one-extraction.test.ts +29 -0
- package/src/tools/create-channel.ts +1 -1
- package/src/tools/defer-task.ts +1 -1
- package/src/tools/register-agentmail-inbox.ts +5 -0
- package/src/tools/repos/update-repo.ts +1 -1
- package/src/tools/request-human-input.ts +1 -1
- package/src/tools/send-task.ts +1 -1
- package/src/tools/store-progress.ts +39 -8
- package/src/tools/tracker/tracker-unlink.ts +2 -1
- package/src/tools/workflows/retry-workflow-run.ts +3 -0
- package/src/types.ts +11 -2
- package/src/utils/context-window.ts +6 -1
- package/src/utils/output-schema.ts +23 -0
- package/src/workflows/executors/system-one-providers.ts +25 -6
- package/src/workflows/recovery.ts +8 -4
- package/src/workflows/resume.ts +19 -0
- package/dist/handlers-zxmp1ta4.js +0 -32
- package/dist/index-a8phxqnk.js +0 -37
- package/dist/index-k6h00t4c.js +0 -30
- package/dist/index-xrz7te8h.js +0 -33
- package/dist/lead-956sd2yc.js +0 -71
- package/dist/worker-y15hy08h.js +0 -71
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
getAgentById2,
|
|
3
3
|
getTaskById2,
|
|
4
4
|
init_db4
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-w4xnbm46.js";
|
|
6
6
|
import {
|
|
7
7
|
shouldBlockChannel2,
|
|
8
8
|
init_external_channel
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-0ykgn1h5.js";
|
|
10
10
|
import {
|
|
11
11
|
isAdmittedSlackDelivery,
|
|
12
12
|
init_inbound_dispatch,
|
|
@@ -14,32 +14,32 @@ import {
|
|
|
14
14
|
init_task_output,
|
|
15
15
|
getTaskUrl,
|
|
16
16
|
init_blocks
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-xq9r2wtt.js";
|
|
18
18
|
import"./cli-wx3rhnm0.js";
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-
|
|
23
|
-
import"./cli-
|
|
19
|
+
import"./cli-nbsf8yvn.js";
|
|
20
|
+
import"./cli-8sdejs1f.js";
|
|
21
|
+
import"./cli-z1srzaf6.js";
|
|
22
|
+
import"./cli-rjknb2ae.js";
|
|
23
|
+
import"./cli-1cxrbkk6.js";
|
|
24
24
|
import"./cli-3xj33nrx.js";
|
|
25
|
-
import"./cli-
|
|
26
|
-
import"./cli-
|
|
25
|
+
import"./cli-eyg1pa00.js";
|
|
26
|
+
import"./cli-fyhr5h4s.js";
|
|
27
27
|
import {
|
|
28
28
|
isUserAllowed2,
|
|
29
29
|
init_handlers
|
|
30
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-bbw9wj9m.js";
|
|
31
31
|
import {
|
|
32
32
|
wasEventSeen,
|
|
33
33
|
init_event_dedup
|
|
34
|
-
} from "./cli-
|
|
35
|
-
import"./cli-
|
|
36
|
-
import"./cli-
|
|
37
|
-
import"./cli-
|
|
38
|
-
import"./cli-
|
|
39
|
-
import"./cli-
|
|
40
|
-
import"./cli-
|
|
41
|
-
import"./cli-
|
|
42
|
-
import"./cli-
|
|
34
|
+
} from "./cli-wemma3jd.js";
|
|
35
|
+
import"./cli-z75yxkjh.js";
|
|
36
|
+
import"./cli-jdv6ypxs.js";
|
|
37
|
+
import"./cli-tpksw2nr.js";
|
|
38
|
+
import"./cli-fzachfnf.js";
|
|
39
|
+
import"./cli-7axf41jq.js";
|
|
40
|
+
import"./cli-66ww7fer.js";
|
|
41
|
+
import"./cli-s4ss5g59.js";
|
|
42
|
+
import"./cli-269q28a1.js";
|
|
43
43
|
import {
|
|
44
44
|
isEnvFlagEnabled,
|
|
45
45
|
init_env_flag
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import"./cli-w4xnbm46.js";
|
|
2
|
+
import"./cli-z1srzaf6.js";
|
|
3
|
+
import"./cli-rjknb2ae.js";
|
|
4
|
+
import"./cli-1cxrbkk6.js";
|
|
5
|
+
import"./cli-wx3rhnm0.js";
|
|
6
|
+
import"./cli-0ykgn1h5.js";
|
|
7
|
+
import"./cli-xq9r2wtt.js";
|
|
8
|
+
import"./cli-nbsf8yvn.js";
|
|
9
|
+
import {
|
|
10
|
+
getEnabledCapabilities,
|
|
11
|
+
init_server
|
|
12
|
+
} from "./cli-8sdejs1f.js";
|
|
13
|
+
import"./cli-3xj33nrx.js";
|
|
14
|
+
import"./cli-eyg1pa00.js";
|
|
15
|
+
import"./cli-fyhr5h4s.js";
|
|
16
|
+
import"./cli-gazw7kpa.js";
|
|
17
|
+
import"./cli-eqtfgfr6.js";
|
|
18
|
+
import {
|
|
19
|
+
runAgent
|
|
20
|
+
} from "./cli-32m9eda8.js";
|
|
21
|
+
import"./cli-98rw5dt5.js";
|
|
22
|
+
import"./cli-77cd6gy8.js";
|
|
23
|
+
import"./cli-mthwvjre.js";
|
|
24
|
+
import"./cli-a22h291q.js";
|
|
25
|
+
import"./cli-5ja3b75e.js";
|
|
26
|
+
import"./cli-jc1g9ndz.js";
|
|
27
|
+
import"./cli-q4ebh7h7.js";
|
|
28
|
+
import"./cli-zkky4t5g.js";
|
|
29
|
+
import"./cli-nn3ysbqk.js";
|
|
30
|
+
import"./cli-8rpcng8j.js";
|
|
31
|
+
import"./cli-d82btycs.js";
|
|
32
|
+
import"./cli-0726awxw.js";
|
|
33
|
+
import"./cli-p3vsj0d3.js";
|
|
34
|
+
import"./cli-84rj785g.js";
|
|
35
|
+
import"./cli-4bd1rck6.js";
|
|
36
|
+
import"./cli-98rwmcyc.js";
|
|
37
|
+
import"./cli-318r69gq.js";
|
|
38
|
+
import"./cli-ssnjfg5p.js";
|
|
39
|
+
import"./cli-c0kqky8y.js";
|
|
40
|
+
import"./cli-kr5tjjtz.js";
|
|
41
|
+
import"./cli-ga786dzg.js";
|
|
42
|
+
import"./cli-btfsp3mv.js";
|
|
43
|
+
import"./cli-srye3vdt.js";
|
|
44
|
+
import"./cli-m0hmeqma.js";
|
|
45
|
+
import"./cli-85gzce7b.js";
|
|
46
|
+
import"./cli-9m8hdawy.js";
|
|
47
|
+
import"./cli-ppjxh6ah.js";
|
|
48
|
+
import"./cli-gvx71kqv.js";
|
|
49
|
+
import"./cli-sq4n7af4.js";
|
|
50
|
+
import"./cli-jdv6ypxs.js";
|
|
51
|
+
import"./cli-tpksw2nr.js";
|
|
52
|
+
import"./cli-fzachfnf.js";
|
|
53
|
+
import"./cli-7axf41jq.js";
|
|
54
|
+
import"./cli-66ww7fer.js";
|
|
55
|
+
import"./cli-s4ss5g59.js";
|
|
56
|
+
import"./cli-269q28a1.js";
|
|
57
|
+
|
|
58
|
+
// src/commands/worker.ts
|
|
59
|
+
init_server();
|
|
60
|
+
var workerConfig = {
|
|
61
|
+
role: "worker",
|
|
62
|
+
defaultPrompt: "/start-worker",
|
|
63
|
+
metadataType: "worker_metadata",
|
|
64
|
+
capabilities: getEnabledCapabilities()
|
|
65
|
+
};
|
|
66
|
+
async function runWorker(opts) {
|
|
67
|
+
return runAgent(workerConfig, opts);
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
runWorker
|
|
71
|
+
};
|
|
@@ -10,24 +10,24 @@ import {
|
|
|
10
10
|
createRerouteDecisionTask2,
|
|
11
11
|
createPoolStarvationDecisionTask2,
|
|
12
12
|
init_worker_follow_up
|
|
13
|
-
} from "./cli-
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
13
|
+
} from "./cli-8sdejs1f.js";
|
|
14
|
+
import"./cli-rjknb2ae.js";
|
|
15
|
+
import"./cli-1cxrbkk6.js";
|
|
16
|
+
import"./cli-jdv6ypxs.js";
|
|
17
|
+
import"./cli-tpksw2nr.js";
|
|
18
|
+
import"./cli-fzachfnf.js";
|
|
19
19
|
import"./cli-3xj33nrx.js";
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-
|
|
25
|
-
import"./cli-
|
|
26
|
-
import"./cli-
|
|
27
|
-
import"./cli-
|
|
28
|
-
import"./cli-
|
|
29
|
-
import"./cli-
|
|
30
|
-
import"./cli-
|
|
20
|
+
import"./cli-fyhr5h4s.js";
|
|
21
|
+
import"./cli-nbsf8yvn.js";
|
|
22
|
+
import"./cli-7axf41jq.js";
|
|
23
|
+
import"./cli-xq9r2wtt.js";
|
|
24
|
+
import"./cli-66ww7fer.js";
|
|
25
|
+
import"./cli-0ykgn1h5.js";
|
|
26
|
+
import"./cli-s4ss5g59.js";
|
|
27
|
+
import"./cli-eyg1pa00.js";
|
|
28
|
+
import"./cli-269q28a1.js";
|
|
29
|
+
import"./cli-z1srzaf6.js";
|
|
30
|
+
import"./cli-w4xnbm46.js";
|
|
31
31
|
import"./cli-wx3rhnm0.js";
|
|
32
32
|
init_worker_follow_up();
|
|
33
33
|
|
package/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Agent Swarm API",
|
|
5
|
-
"version": "2.7.
|
|
5
|
+
"version": "2.7.8",
|
|
6
6
|
"description": "Multi-agent orchestration API for Claude Code, Codex, and Gemini CLI. Enables task distribution, agent communication, and service discovery.\n\nMCP tools are documented separately in [MCP.md](./MCP.md)."
|
|
7
7
|
},
|
|
8
8
|
"servers": [
|
|
@@ -153,7 +153,8 @@
|
|
|
153
153
|
"completed",
|
|
154
154
|
"failed",
|
|
155
155
|
"cancelled",
|
|
156
|
-
"superseded"
|
|
156
|
+
"superseded",
|
|
157
|
+
"skipped"
|
|
157
158
|
]
|
|
158
159
|
},
|
|
159
160
|
"source": {
|
|
@@ -3719,6 +3720,7 @@
|
|
|
3719
3720
|
"url",
|
|
3720
3721
|
"name",
|
|
3721
3722
|
"clonePath",
|
|
3723
|
+
"hooks",
|
|
3722
3724
|
"createdAt",
|
|
3723
3725
|
"lastUpdatedAt"
|
|
3724
3726
|
]
|
|
@@ -3731,9 +3733,7 @@
|
|
|
3731
3733
|
"default": false
|
|
3732
3734
|
}
|
|
3733
3735
|
},
|
|
3734
|
-
"
|
|
3735
|
-
"enabled": false
|
|
3736
|
-
}
|
|
3736
|
+
"description": "Worker hook installation. Enabled by default: a repo created without `hooks` stores { enabled: true }. Disable with { enabled: false }. A repo with no stored hooks config reads as disabled."
|
|
3737
3737
|
},
|
|
3738
3738
|
"RepoGuidelines": {
|
|
3739
3739
|
"type": [
|
|
@@ -10185,7 +10185,8 @@
|
|
|
10185
10185
|
"completed",
|
|
10186
10186
|
"failed",
|
|
10187
10187
|
"cancelled",
|
|
10188
|
-
"superseded"
|
|
10188
|
+
"superseded",
|
|
10189
|
+
"skipped"
|
|
10189
10190
|
]
|
|
10190
10191
|
}
|
|
10191
10192
|
},
|
|
@@ -12123,7 +12124,7 @@
|
|
|
12123
12124
|
}
|
|
12124
12125
|
},
|
|
12125
12126
|
"404": {
|
|
12126
|
-
"description": "Agent not found",
|
|
12127
|
+
"description": "Agent not found, or changedByAgentId names no agent",
|
|
12127
12128
|
"content": {
|
|
12128
12129
|
"application/json": {
|
|
12129
12130
|
"schema": {
|
|
@@ -13731,7 +13732,8 @@
|
|
|
13731
13732
|
"type": "string"
|
|
13732
13733
|
},
|
|
13733
13734
|
"required": {
|
|
13734
|
-
"type": "boolean"
|
|
13735
|
+
"type": "boolean",
|
|
13736
|
+
"default": true
|
|
13735
13737
|
},
|
|
13736
13738
|
"description": {
|
|
13737
13739
|
"type": "string"
|
|
@@ -28814,7 +28816,7 @@
|
|
|
28814
28816
|
"/api/models-catalog": {
|
|
28815
28817
|
"get": {
|
|
28816
28818
|
"summary": "Get the live model catalog for the picker-reachable providers",
|
|
28817
|
-
"description": "Slim projection of the models.dev payload (
|
|
28819
|
+
"description": "Slim projection of the models.dev payload (the vendored models.dev snapshot, or the live fetch once one succeeds) plus the OpenAI-compatible registry providers; see the `providers` field for the live list. Refreshed server-side at boot and every 12h by the pricing-refresh loop. `source` is 'snapshot' with `updatedAt: null` until the first successful fetch (or when models.dev is unreachable), in which case the vendored snapshot is served instead.",
|
|
28818
28820
|
"tags": [
|
|
28819
28821
|
"Pricing"
|
|
28820
28822
|
],
|
|
@@ -29949,6 +29951,16 @@
|
|
|
29949
29951
|
}
|
|
29950
29952
|
}
|
|
29951
29953
|
}
|
|
29954
|
+
},
|
|
29955
|
+
"502": {
|
|
29956
|
+
"description": "Metadata discovery failed: the protected-resource or authorization-server metadata could not be fetched or was refused by the egress guard",
|
|
29957
|
+
"content": {
|
|
29958
|
+
"application/json": {
|
|
29959
|
+
"schema": {
|
|
29960
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
29961
|
+
}
|
|
29962
|
+
}
|
|
29963
|
+
}
|
|
29952
29964
|
}
|
|
29953
29965
|
}
|
|
29954
29966
|
}
|
|
@@ -30426,6 +30438,7 @@
|
|
|
30426
30438
|
"/api/mcp-oauth/{mcpServerId}": {
|
|
30427
30439
|
"delete": {
|
|
30428
30440
|
"summary": "Revoke and delete the OAuth token for an MCP server",
|
|
30441
|
+
"description": "Idempotent: the connection row is kept with status revoked (its tokens are cleared) and the server returns to static auth, so a repeat call answers 200 and /status keeps returning the revoked token object.",
|
|
30429
30442
|
"tags": [
|
|
30430
30443
|
"MCP OAuth"
|
|
30431
30444
|
],
|
|
@@ -33981,7 +33994,7 @@
|
|
|
33981
33994
|
"/api/tasks": {
|
|
33982
33995
|
"get": {
|
|
33983
33996
|
"summary": "List tasks with filters",
|
|
33984
|
-
"description": "Returns tasks with the full `task` text replaced by a bounded `taskPreview` and completion/integration blobs dropped by default — list views only need the preview. Pass `fields=full` to restore the full `AgentTask`, or `fields=timeline` for the narrow shape the dashboard timeline draws. Every shape gives a user caller only tasks of sessions they can read. Fetch a single task in full via `GET /api/tasks/{id}`. `total` (the filtered row count, ignoring limit/offset) is computed only with `includeTotal=true`.",
|
|
33997
|
+
"description": "Returns tasks with the full `task` text replaced by a bounded `taskPreview` and completion/integration blobs dropped by default — list views only need the preview. Pass `fields=full` to restore the full `AgentTask`, or `fields=timeline` for the narrow shape the dashboard timeline draws. Every shape gives a user caller only tasks of sessions they can read, unless `scope=all` applies. Fetch a single task in full via `GET /api/tasks/{id}`. `total` (the filtered row count, ignoring limit/offset) is computed only with `includeTotal=true`.",
|
|
33985
33998
|
"tags": [
|
|
33986
33999
|
"Tasks"
|
|
33987
34000
|
],
|
|
@@ -34163,6 +34176,19 @@
|
|
|
34163
34176
|
"required": false,
|
|
34164
34177
|
"name": "includeTotal",
|
|
34165
34178
|
"in": "query"
|
|
34179
|
+
},
|
|
34180
|
+
{
|
|
34181
|
+
"schema": {
|
|
34182
|
+
"type": "string",
|
|
34183
|
+
"enum": [
|
|
34184
|
+
"all"
|
|
34185
|
+
],
|
|
34186
|
+
"description": "all: every user's tasks, read-only, for a user with an admin role or session.read.all; ignored for anyone else. The X-Swarm-Session-Scope: all header opts in the same way."
|
|
34187
|
+
},
|
|
34188
|
+
"required": false,
|
|
34189
|
+
"description": "all: every user's tasks, read-only, for a user with an admin role or session.read.all; ignored for anyone else. The X-Swarm-Session-Scope: all header opts in the same way.",
|
|
34190
|
+
"name": "scope",
|
|
34191
|
+
"in": "query"
|
|
34166
34192
|
}
|
|
34167
34193
|
],
|
|
34168
34194
|
"responses": {
|
|
@@ -34226,7 +34252,8 @@
|
|
|
34226
34252
|
"completed",
|
|
34227
34253
|
"failed",
|
|
34228
34254
|
"cancelled",
|
|
34229
|
-
"superseded"
|
|
34255
|
+
"superseded",
|
|
34256
|
+
"skipped"
|
|
34230
34257
|
]
|
|
34231
34258
|
},
|
|
34232
34259
|
"source": {
|
|
@@ -34426,7 +34453,8 @@
|
|
|
34426
34453
|
"completed",
|
|
34427
34454
|
"failed",
|
|
34428
34455
|
"cancelled",
|
|
34429
|
-
"superseded"
|
|
34456
|
+
"superseded",
|
|
34457
|
+
"skipped"
|
|
34430
34458
|
]
|
|
34431
34459
|
},
|
|
34432
34460
|
"createdAt": {
|
|
@@ -35797,7 +35825,8 @@
|
|
|
35797
35825
|
"completed",
|
|
35798
35826
|
"failed",
|
|
35799
35827
|
"cancelled",
|
|
35800
|
-
"superseded"
|
|
35828
|
+
"superseded",
|
|
35829
|
+
"skipped"
|
|
35801
35830
|
]
|
|
35802
35831
|
},
|
|
35803
35832
|
"source": {
|
|
@@ -36083,7 +36112,8 @@
|
|
|
36083
36112
|
},
|
|
36084
36113
|
"/api/tasks/{id}/finish": {
|
|
36085
36114
|
"post": {
|
|
36086
|
-
"summary": "Mark task as completed or
|
|
36115
|
+
"summary": "Mark task as completed, failed, or skipped (runner endpoint)",
|
|
36116
|
+
"description": "`skipped` ends a task that is not the caller's to handle. It needs a one-line reason in `failureReason` (or `output`), keeps `output` empty, posts nothing, and creates no follow-up.",
|
|
36087
36117
|
"tags": [
|
|
36088
36118
|
"Tasks"
|
|
36089
36119
|
],
|
|
@@ -36112,7 +36142,8 @@
|
|
|
36112
36142
|
"type": "string",
|
|
36113
36143
|
"enum": [
|
|
36114
36144
|
"completed",
|
|
36115
|
-
"failed"
|
|
36145
|
+
"failed",
|
|
36146
|
+
"skipped"
|
|
36116
36147
|
]
|
|
36117
36148
|
},
|
|
36118
36149
|
"output": {
|
|
@@ -36195,7 +36226,7 @@
|
|
|
36195
36226
|
}
|
|
36196
36227
|
},
|
|
36197
36228
|
"400": {
|
|
36198
|
-
"description": "Invalid status",
|
|
36229
|
+
"description": "Invalid status, or a skip without a reason",
|
|
36199
36230
|
"content": {
|
|
36200
36231
|
"application/json": {
|
|
36201
36232
|
"schema": {
|
|
@@ -36605,7 +36636,8 @@
|
|
|
36605
36636
|
"completed",
|
|
36606
36637
|
"failed",
|
|
36607
36638
|
"cancelled",
|
|
36608
|
-
"superseded"
|
|
36639
|
+
"superseded",
|
|
36640
|
+
"skipped"
|
|
36609
36641
|
]
|
|
36610
36642
|
}
|
|
36611
36643
|
},
|
|
@@ -49077,6 +49109,7 @@
|
|
|
49077
49109
|
"post": {
|
|
49078
49110
|
"operationId": "script_runs_internal_step_create",
|
|
49079
49111
|
"summary": "Write a script run journal step",
|
|
49112
|
+
"description": "Write-once per stepKey; a replay keeps the first journal entry and still answers 201.",
|
|
49080
49113
|
"tags": [
|
|
49081
49114
|
"Script Runs"
|
|
49082
49115
|
],
|
|
@@ -49543,7 +49576,8 @@
|
|
|
49543
49576
|
"completed",
|
|
49544
49577
|
"failed",
|
|
49545
49578
|
"cancelled",
|
|
49546
|
-
"superseded"
|
|
49579
|
+
"superseded",
|
|
49580
|
+
"skipped"
|
|
49547
49581
|
]
|
|
49548
49582
|
}
|
|
49549
49583
|
},
|
|
@@ -51382,12 +51416,13 @@
|
|
|
51382
51416
|
"enum": [
|
|
51383
51417
|
"mine",
|
|
51384
51418
|
"shared",
|
|
51385
|
-
"tree"
|
|
51419
|
+
"tree",
|
|
51420
|
+
"all"
|
|
51386
51421
|
],
|
|
51387
|
-
"description": "mine: owned sessions. shared: sessions shared with me. tree: Sessions that GET /api/session-tree counts: mine plus shared with me, no ownerless roots. A bypass actor sees every root with tree scope."
|
|
51422
|
+
"description": "mine: owned sessions. shared: sessions shared with me. tree: Sessions that GET /api/session-tree counts: mine plus shared with me, no ownerless roots. A bypass actor sees every root with tree scope. all: every user's sessions, read-only, for a user with an admin role or session.read.all; ignored for anyone else. The X-Swarm-Session-Scope: all header opts in the same way, also for tree."
|
|
51388
51423
|
},
|
|
51389
51424
|
"required": false,
|
|
51390
|
-
"description": "mine: owned sessions. shared: sessions shared with me. tree: Sessions that GET /api/session-tree counts: mine plus shared with me, no ownerless roots. A bypass actor sees every root with tree scope.",
|
|
51425
|
+
"description": "mine: owned sessions. shared: sessions shared with me. tree: Sessions that GET /api/session-tree counts: mine plus shared with me, no ownerless roots. A bypass actor sees every root with tree scope. all: every user's sessions, read-only, for a user with an admin role or session.read.all; ignored for anyone else. The X-Swarm-Session-Scope: all header opts in the same way, also for tree.",
|
|
51391
51426
|
"name": "scope",
|
|
51392
51427
|
"in": "query"
|
|
51393
51428
|
},
|
|
@@ -51487,7 +51522,8 @@
|
|
|
51487
51522
|
"completed",
|
|
51488
51523
|
"failed",
|
|
51489
51524
|
"cancelled",
|
|
51490
|
-
"superseded"
|
|
51525
|
+
"superseded",
|
|
51526
|
+
"skipped"
|
|
51491
51527
|
]
|
|
51492
51528
|
},
|
|
51493
51529
|
"source": {
|
|
@@ -51649,7 +51685,8 @@
|
|
|
51649
51685
|
"completed",
|
|
51650
51686
|
"failed",
|
|
51651
51687
|
"cancelled",
|
|
51652
|
-
"superseded"
|
|
51688
|
+
"superseded",
|
|
51689
|
+
"skipped"
|
|
51653
51690
|
]
|
|
51654
51691
|
},
|
|
51655
51692
|
"readState": {
|
|
@@ -56955,6 +56992,16 @@
|
|
|
56955
56992
|
}
|
|
56956
56993
|
}
|
|
56957
56994
|
}
|
|
56995
|
+
},
|
|
56996
|
+
"409": {
|
|
56997
|
+
"description": "A server with this name already exists in the same scope and owner (mcp_server_name_taken)",
|
|
56998
|
+
"content": {
|
|
56999
|
+
"application/json": {
|
|
57000
|
+
"schema": {
|
|
57001
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
57002
|
+
}
|
|
57003
|
+
}
|
|
57004
|
+
}
|
|
56958
57005
|
}
|
|
56959
57006
|
}
|
|
56960
57007
|
}
|
|
@@ -60374,6 +60421,9 @@
|
|
|
60374
60421
|
"verbs",
|
|
60375
60422
|
"roles"
|
|
60376
60423
|
]
|
|
60424
|
+
},
|
|
60425
|
+
"sessionReadAll": {
|
|
60426
|
+
"type": "boolean"
|
|
60377
60427
|
}
|
|
60378
60428
|
},
|
|
60379
60429
|
"required": [
|
|
@@ -60819,6 +60869,16 @@
|
|
|
60819
60869
|
}
|
|
60820
60870
|
}
|
|
60821
60871
|
}
|
|
60872
|
+
},
|
|
60873
|
+
"409": {
|
|
60874
|
+
"description": "A user with this email already exists (user_exists)",
|
|
60875
|
+
"content": {
|
|
60876
|
+
"application/json": {
|
|
60877
|
+
"schema": {
|
|
60878
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
60879
|
+
}
|
|
60880
|
+
}
|
|
60881
|
+
}
|
|
60822
60882
|
}
|
|
60823
60883
|
}
|
|
60824
60884
|
}
|
|
@@ -63051,7 +63111,7 @@
|
|
|
63051
63111
|
}
|
|
63052
63112
|
},
|
|
63053
63113
|
"400": {
|
|
63054
|
-
"description": "Validation error
|
|
63114
|
+
"description": "Validation error",
|
|
63055
63115
|
"content": {
|
|
63056
63116
|
"application/json": {
|
|
63057
63117
|
"schema": {
|
|
@@ -63079,6 +63139,16 @@
|
|
|
63079
63139
|
}
|
|
63080
63140
|
}
|
|
63081
63141
|
}
|
|
63142
|
+
},
|
|
63143
|
+
"409": {
|
|
63144
|
+
"description": "The (kind, externalId) identity is already linked (identity_taken)",
|
|
63145
|
+
"content": {
|
|
63146
|
+
"application/json": {
|
|
63147
|
+
"schema": {
|
|
63148
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
63149
|
+
}
|
|
63150
|
+
}
|
|
63151
|
+
}
|
|
63082
63152
|
}
|
|
63083
63153
|
}
|
|
63084
63154
|
}
|
|
@@ -65678,6 +65748,16 @@
|
|
|
65678
65748
|
}
|
|
65679
65749
|
}
|
|
65680
65750
|
}
|
|
65751
|
+
},
|
|
65752
|
+
"404": {
|
|
65753
|
+
"description": "Run not found",
|
|
65754
|
+
"content": {
|
|
65755
|
+
"application/json": {
|
|
65756
|
+
"schema": {
|
|
65757
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
65758
|
+
}
|
|
65759
|
+
}
|
|
65760
|
+
}
|
|
65681
65761
|
}
|
|
65682
65762
|
}
|
|
65683
65763
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@desplega.ai/agent-swarm",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.8",
|
|
4
4
|
"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.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-swarm.dev",
|
|
@@ -106,6 +106,8 @@
|
|
|
106
106
|
"mono:dev": "turbo run dev",
|
|
107
107
|
"test:root": "bash scripts/run-bun-tests.sh",
|
|
108
108
|
"e2e": "bun scripts/e2e/run.ts",
|
|
109
|
+
"e2e:strict": "bun scripts/e2e/run.ts --strict",
|
|
110
|
+
"e2e:bench": "bun scripts/e2e/bench.ts",
|
|
109
111
|
"e2e:ui": "bun packages/ui-e2e/boot/run.ts",
|
|
110
112
|
"e2e:ui:tsc": "bun tsc --noEmit -p packages/ui-e2e/tsconfig.json && bun tsc --noEmit -p packages/ui-e2e/tsconfig.boot.json",
|
|
111
113
|
"e2e:visuals": "bun scripts/e2e/visuals.ts",
|
|
@@ -156,7 +156,7 @@ export async function updateModelProfile(
|
|
|
156
156
|
* oldest `finishedAt` the repair still covers.
|
|
157
157
|
*/
|
|
158
158
|
const TASK_HOLDS_PROFILE_SQL = `(
|
|
159
|
-
t.status NOT IN ('completed', 'failed', 'cancelled', 'superseded')
|
|
159
|
+
t.status NOT IN ('completed', 'failed', 'cancelled', 'superseded', 'skipped')
|
|
160
160
|
OR (t.status = 'superseded'
|
|
161
161
|
AND t.workflowRunStepId IS NULL
|
|
162
162
|
AND (t.finishedAt IS NULL OR t.finishedAt > ?)
|
|
@@ -305,7 +305,7 @@ export function sessionRootFilter(opts: SessionFilters = {}): SqlFragment {
|
|
|
305
305
|
add(sessionViewerCondition(opts.viewer));
|
|
306
306
|
// Unary +: a full pass over the narrow summaries beats the partial thread index here.
|
|
307
307
|
if (opts.tree) conditions.push("+r.requestedByUserId IS NOT NULL");
|
|
308
|
-
if (opts.mine) add(sessionMineCondition(opts.viewer.userId));
|
|
308
|
+
if (opts.mine) add(sessionMineCondition(opts.viewer.userId, opts.viewer.readAll));
|
|
309
309
|
}
|
|
310
310
|
if (opts.keyPrefix) {
|
|
311
311
|
const { lo, hi } = keyPrefixRange(opts.keyPrefix);
|
|
@@ -504,8 +504,9 @@ export async function getSessionReadState(
|
|
|
504
504
|
rootId: string,
|
|
505
505
|
userId: string,
|
|
506
506
|
now?: string,
|
|
507
|
+
readAll?: boolean,
|
|
507
508
|
): Promise<{ readState: SessionReadState; lastActivityAt: string } | null> {
|
|
508
|
-
const query = sessionSummaryQuery({ rootId, viewer: { userId, scope: "all" }, now });
|
|
509
|
+
const query = sessionSummaryQuery({ rootId, viewer: { userId, scope: "all", readAll }, now });
|
|
509
510
|
const row = await getDbClient().get<{ readState: SessionReadState; lastActivityAt: string }>(
|
|
510
511
|
`SELECT readState, lastActivityAt FROM (${query.sql})`,
|
|
511
512
|
query.params,
|
|
@@ -662,14 +663,16 @@ function threadPromptPreview(prompt: string): string {
|
|
|
662
663
|
}
|
|
663
664
|
|
|
664
665
|
export async function getSessionTree(
|
|
665
|
-
actor: { kind: "bypass" } | { kind: "user"; userId: string | null },
|
|
666
|
+
actor: { kind: "bypass" } | { kind: "user"; userId: string | null; readAll?: boolean },
|
|
666
667
|
now?: string,
|
|
667
668
|
opts: { mine?: boolean; hideSource?: string[]; showSource?: string[] } = {},
|
|
668
669
|
): Promise<SessionTree> {
|
|
669
670
|
// No source filter in SQL: the source counts must include hidden sources,
|
|
670
671
|
// so the filter menu can offer them back. The loop skips them instead.
|
|
671
672
|
const query = sessionSummaryQuery({
|
|
672
|
-
...(actor.kind === "user"
|
|
673
|
+
...(actor.kind === "user"
|
|
674
|
+
? { viewer: { userId: actor.userId, scope: "all", readAll: actor.readAll } as const }
|
|
675
|
+
: {}),
|
|
673
676
|
now,
|
|
674
677
|
tree: true,
|
|
675
678
|
mine: opts.mine,
|
|
@@ -795,12 +798,13 @@ export async function triageSessionList(
|
|
|
795
798
|
"triage" | "noGroup" | "groupKey" | "mine" | "hideSource" | "showSource" | "now"
|
|
796
799
|
>,
|
|
797
800
|
action: SessionListTriage,
|
|
801
|
+
readAll?: boolean,
|
|
798
802
|
): Promise<number> {
|
|
799
803
|
const now = filters.now ?? new Date().toISOString();
|
|
800
804
|
const query = sessionSummaryQuery({
|
|
801
805
|
...filters,
|
|
802
806
|
now,
|
|
803
|
-
viewer: { userId, scope: "all" },
|
|
807
|
+
viewer: { userId, scope: "all", readAll },
|
|
804
808
|
tree: true,
|
|
805
809
|
});
|
|
806
810
|
const status = action === "done" ? "done" : "open";
|
|
@@ -5,8 +5,13 @@
|
|
|
5
5
|
* or everyone.
|
|
6
6
|
* `mine`: owned by the viewer. `shared`: owned by someone else and shared with
|
|
7
7
|
* the viewer or everyone. A null `userId` (a guest page session) owns nothing.
|
|
8
|
+
* `readAll` (the all-users read scope) lifts the `all` filter: every root.
|
|
8
9
|
*/
|
|
9
|
-
export type SessionViewer = {
|
|
10
|
+
export type SessionViewer = {
|
|
11
|
+
userId: string | null;
|
|
12
|
+
scope: "all" | "mine" | "shared";
|
|
13
|
+
readAll?: boolean;
|
|
14
|
+
};
|
|
10
15
|
|
|
11
16
|
/** SQL condition + params restricting root tasks (alias `r`) to what `viewer` may open. */
|
|
12
17
|
export function sessionViewerCondition(viewer: SessionViewer): {
|
|
@@ -16,6 +21,7 @@ export function sessionViewerCondition(viewer: SessionViewer): {
|
|
|
16
21
|
// Uncorrelated, so SQLite builds the shared set once instead of probing per root.
|
|
17
22
|
const shared = `r.id IN (SELECT s.rootTaskId FROM session_shares s
|
|
18
23
|
WHERE s.revokedAt IS NULL AND (s.userId IS NULL OR s.userId = ?))`;
|
|
24
|
+
if (viewer.scope === "all" && viewer.readAll) return { sql: "1", params: [] };
|
|
19
25
|
if (viewer.scope === "mine") {
|
|
20
26
|
return { sql: "r.requestedByUserId = ?", params: [viewer.userId] };
|
|
21
27
|
}
|
|
@@ -47,17 +53,27 @@ const HUMAN_SYSTEM_TASK_TYPES = ["kapso-inbound"] as const;
|
|
|
47
53
|
* sessions shared with this user or everyone. A list filter only: it narrows
|
|
48
54
|
* what a list shows and never changes who can open a session.
|
|
49
55
|
*/
|
|
50
|
-
export function sessionMineCondition(
|
|
56
|
+
export function sessionMineCondition(
|
|
57
|
+
userId: string | null,
|
|
58
|
+
readAll?: boolean,
|
|
59
|
+
): {
|
|
51
60
|
sql: string;
|
|
52
61
|
params: (string | null)[];
|
|
53
62
|
} {
|
|
54
63
|
const machine = MACHINE_SESSION_SOURCES.map(() => "?").join(",");
|
|
55
64
|
const humanSystem = HUMAN_SYSTEM_TASK_TYPES.map(() => "?").join(",");
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
WHERE s.revokedAt IS NULL AND (s.userId IS NULL OR s.userId = ?))
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
const humanStarted = `(r.source NOT IN (${machine})
|
|
66
|
+
OR (r.source = 'system' AND r.taskType IN (${humanSystem})))`;
|
|
67
|
+
const humanParams = [...MACHINE_SESSION_SOURCES, ...HUMAN_SYSTEM_TASK_TYPES];
|
|
68
|
+
const shared = `r.id IN (SELECT s.rootTaskId FROM session_shares s
|
|
69
|
+
WHERE s.revokedAt IS NULL AND (s.userId IS NULL OR s.userId = ?))`;
|
|
70
|
+
// The all-users read scope widens the owner check to every user's
|
|
71
|
+
// human-started roots. Sessions shared with the viewer stay in Mine, so a
|
|
72
|
+
// shared machine-started root never drops out when the scope turns on.
|
|
73
|
+
return readAll
|
|
74
|
+
? { sql: `(${humanStarted} OR ${shared})`, params: [...humanParams, userId] }
|
|
75
|
+
: {
|
|
76
|
+
sql: `((r.requestedByUserId = ? AND ${humanStarted}) OR ${shared})`,
|
|
77
|
+
params: [userId, ...humanParams, userId],
|
|
78
|
+
};
|
|
63
79
|
}
|