@desplega.ai/agent-swarm 2.13.2 → 2.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acp-adapter-t2q6nsqv.js +17 -0
- package/dist/{acp-targets-mz8c5dnt.js → acp-targets-k8xs4tj8.js} +7 -7
- package/dist/{actions-5ft3qp5a.js → actions-pg5fxjer.js} +23 -23
- package/dist/{agent-fs-provision-6fgz7wvz.js → agent-fs-provision-vbk3fppw.js} +4 -4
- package/dist/{amp-adapter-nthn8ezm.js → amp-adapter-adbhxsz9.js} +2 -2
- package/dist/{app-535m78qw.js → app-b267ggx1.js} +6 -6
- package/dist/{approval-notifications-dewbk403.js → approval-notifications-evc1a9z5.js} +7 -7
- package/dist/{assistant-39zyabv2.js → assistant-wgz2ab84.js} +24 -24
- package/dist/{boot-args-schema-bqv5bf77.js → boot-args-schema-6tpk28j4.js} +1 -1
- package/dist/{boot-reembed-fas7z3zn.js → boot-reembed-ankp369c.js} +1 -1
- package/dist/{boot-reembed-157c0gcz.js → boot-reembed-r1zyvefv.js} +1 -1
- package/dist/{boot-scrub-sweep-tmec0be2.js → boot-scrub-sweep-cgb6r5bd.js} +2 -2
- package/dist/{boot-seeds-32zm50x2.js → boot-seeds-bjceqg7b.js} +4 -4
- package/dist/{claude-adapter-gwq7x2nj.js → claude-adapter-knztdnff.js} +9 -6
- package/dist/{claude-managed-adapter-rkvw6fvq.js → claude-managed-adapter-qwejzqkk.js} +2 -2
- package/dist/{claude-sdk-session-5wbwxy8c.js → claude-sdk-session-c3g6dv0g.js} +22 -8
- package/dist/{cli-cs26ed89.js → cli-0j4qmc80.js} +7 -7
- package/dist/{cli-dnvmwsvc.js → cli-1606qw3n.js} +32 -32
- package/dist/{cli-b0kqw55g.js → cli-1gnf5c7x.js} +1 -1
- package/dist/{cli-31vt7baf.js → cli-1wew39p0.js} +10 -10
- package/dist/{cli-tceqvv6h.js → cli-268b3dgn.js} +2 -2
- package/dist/cli-2ap1the6.js +11 -0
- package/dist/{cli-e87fg3en.js → cli-4dyhzhpx.js} +1 -1
- package/dist/{cli-t9nxq30h.js → cli-55fqpd9q.js} +8 -8
- package/dist/{cli-nvqq3232.js → cli-61fzwtjk.js} +7 -7
- package/dist/{cli-c9bwawf9.js → cli-61p7ty8d.js} +2 -2
- package/dist/{cli-d528acsw.js → cli-7fa6yv98.js} +2 -2
- package/dist/{cli-bp2rt28p.js → cli-7kv5d674.js} +3 -3
- package/dist/{cli-tbdw3f92.js → cli-80d5g0fa.js} +2 -2
- package/dist/{cli-0xwb7zpt.js → cli-88np9va3.js} +1 -1
- package/dist/{cli-zm6bkx3e.js → cli-8m6gqnf1.js} +2 -2
- package/dist/{cli-r4fphq38.js → cli-8pnawt98.js} +3 -3
- package/dist/{cli-xerdrnqs.js → cli-8sayvj48.js} +2 -2
- package/dist/{cli-d0jb2qnt.js → cli-9gmkw6xn.js} +53 -32
- package/dist/{cli-a6rzw649.js → cli-a21cwm89.js} +2 -2
- package/dist/{cli-s6fhqbz1.js → cli-aytna2fm.js} +1 -1
- package/dist/{cli-mwxez0pz.js → cli-b768ek79.js} +1 -1
- package/dist/{cli-ewb028rs.js → cli-bh53ppqm.js} +2 -2
- package/dist/{cli-zqy28rwx.js → cli-czeh7x13.js} +3 -3
- package/dist/{cli-s08zsqva.js → cli-djwt4mtn.js} +71 -5
- package/dist/{cli-fgm2mad9.js → cli-dq30fq3q.js} +2 -2
- package/dist/{cli-2wde56gv.js → cli-dw43pnzp.js} +5 -5
- package/dist/{cli-erh1rgh4.js → cli-e4gx499y.js} +12 -12
- package/dist/{cli-69eq6gdk.js → cli-ea367bdn.js} +31 -22
- package/dist/{cli-cmgdptmx.js → cli-ef590376.js} +29 -5
- package/dist/{cli-8qvte9hn.js → cli-fbmgpt72.js} +2 -2
- package/dist/{cli-tgmate57.js → cli-g4dhd3pr.js} +2 -2
- package/dist/{cli-0f7n3td3.js → cli-gc715jrc.js} +1 -1
- package/dist/{cli-xysy1g8x.js → cli-gkjw33x5.js} +1 -1
- package/dist/{cli-getrvmtx.js → cli-grk77aen.js} +1 -1
- package/dist/{cli-f1sdh8ca.js → cli-gxqwm3k3.js} +5 -5
- package/dist/{cli-m1wddksc.js → cli-h3drhntp.js} +1 -1
- package/dist/{cli-qn79645p.js → cli-h9d3sdnc.js} +1 -1
- package/dist/{cli-7m6bbtab.js → cli-hd2a204w.js} +6 -6
- package/dist/{cli-jkkcm72j.js → cli-hhb8kbwd.js} +9 -9
- package/dist/{cli-fcwrd7bh.js → cli-hpxcfvdm.js} +3 -3
- package/dist/{cli-ka13xx6b.js → cli-hxj888w3.js} +1 -1
- package/dist/{cli-82j36f2m.js → cli-jjzxsk47.js} +9 -3
- package/dist/{cli-nkfv398a.js → cli-ka4tqjzd.js} +6 -6
- package/dist/{cli-n46d87mj.js → cli-kh973792.js} +3 -3
- package/dist/{cli-x5yb8zc8.js → cli-kwm1bek7.js} +1 -1
- package/dist/{cli-5k1hvycs.js → cli-mgr3gatr.js} +4 -4
- package/dist/{cli-8a4qg44m.js → cli-nbawx3s0.js} +2 -2
- package/dist/{cli-1gevjrc1.js → cli-ppf9ap9n.js} +1 -1
- package/dist/{cli-6rmryz03.js → cli-pzsedyb0.js} +4 -4
- package/dist/{cli-g0b3ma7r.js → cli-r6xnchva.js} +1 -1
- package/dist/{cli-j2ybkdk2.js → cli-snwz16eg.js} +1 -1
- package/dist/{cli-sjk85d7v.js → cli-sy2ge2ye.js} +3 -3
- package/dist/{cli-rvhaahfv.js → cli-syqcny89.js} +3 -3
- package/dist/{cli-n14r8h4n.js → cli-tjf1bh1v.js} +2 -2
- package/dist/{cli-xhkek467.js → cli-v1v49t36.js} +28 -2
- package/dist/{cli-4djg31jh.js → cli-v8rpjrnx.js} +1 -1
- package/dist/{cli-62fjschk.js → cli-vgh5adn9.js} +5 -5
- package/dist/{cli-wdtqkqnq.js → cli-w24741sm.js} +3 -3
- package/dist/{cli-gq6qhmrr.js → cli-wsnradtk.js} +3 -3
- package/dist/{cli-gc7jkf4a.js → cli-wtffytm8.js} +3 -3
- package/dist/{cli-1f48qdnb.js → cli-xc8m5cjn.js} +2 -2
- package/dist/{cli-x7aqhxj5.js → cli-y0q92v4r.js} +2 -2
- package/dist/{cli-gedf48yw.js → cli-y754psdt.js} +4 -4
- package/dist/cli.js +14 -14
- package/dist/{codex-adapter-x25xfbnh.js → codex-adapter-493vb8cv.js} +5 -5
- package/dist/{codex-hook-c0nvm30r.js → codex-hook-ej8hn6z5.js} +9 -2
- package/dist/{codex-session-runner-kn5xnrvp.js → codex-session-runner-ps5m4z1g.js} +5 -5
- package/dist/{commands-8n59gxmy.js → commands-shktk0b8.js} +3 -3
- package/dist/{controllers-connect-09gvkrhc.js → controllers-connect-yft057ws.js} +22 -22
- package/dist/{core-2b8bv6ny.js → core-nheayfgm.js} +21 -21
- package/dist/{cursor-adapter-w1681kp1.js → cursor-adapter-8fpm4dng.js} +1 -1
- package/dist/{db-e71keqxk.js → db-0ezhdhz5.js} +3 -3
- package/dist/{db-spg81qtr.js → db-84pz2w5c.js} +2 -2
- package/dist/{dispatcher-fr4vawwb.js → dispatcher-h2rz69f6.js} +21 -21
- package/dist/{easter-egg-3d-ac9tv9a6.js → easter-egg-3d-m41ad78v.js} +1 -1
- package/dist/{embedding-space-an77f45k.js → embedding-space-yam9zwzj.js} +6 -6
- package/dist/{embeddings-jkrehejr.js → embeddings-g2be0y8q.js} +1 -1
- package/dist/{execute-3mys4nta.js → execute-hhdejgzf.js} +1 -1
- package/dist/{external-channel-s6zxpts9.js → external-channel-kjt2yzfj.js} +2 -2
- package/dist/fx-adapter-8g7xsp8q.js +20 -0
- package/dist/{grok-adapter-8ge6tw7m.js → grok-adapter-ztk2zkz1.js} +9 -9
- package/dist/handlers-9ywssz71.js +41 -0
- package/dist/{heartbeat-jjpb44e5.js → heartbeat-2e5jdexj.js} +23 -23
- package/dist/{hook-y6n23zzj.js → hook-34s8cmgn.js} +9 -6
- package/dist/{hook-68gbs87k.js → hook-acg9saz7.js} +8 -5
- package/dist/{http-8c6y008s.js → http-ra2zr2f8.js} +58 -65
- package/dist/{index-xcw7hjt5.js → index-2z1z7qx6.js} +24 -24
- package/dist/{index-p2f5xg64.js → index-3j803vnb.js} +36259 -34299
- package/dist/index-6mgbdtv1.js +44 -0
- package/dist/{index-6h3r0vpe.js → index-93bw5wds.js} +1 -1
- package/dist/{index-we3nd2t0.js → index-9q42cr54.js} +1 -1
- package/dist/{index-0vthtbc2.js → index-9r4j0a60.js} +23 -15
- package/dist/index-hqdsn2t2.js +39 -0
- package/dist/index-st231bqv.js +40 -0
- package/dist/{keepalive-7e9r5dvp.js → keepalive-vjnnqbkm.js} +4 -4
- package/dist/lead-mk0xkth2.js +82 -0
- package/dist/{maintenance-d3erjvcg.js → maintenance-px2g599e.js} +1 -1
- package/dist/{oauth-refresh-sweep-0qh70988.js → oauth-refresh-sweep-nkykf09m.js} +3 -3
- package/dist/{object-webhooks-ac7v2q5p.js → object-webhooks-gt9xnq21.js} +7 -7
- package/dist/{onboard-5yphtken.js → onboard-1f134p65.js} +3 -3
- package/dist/{opencode-adapter-0xvyba4m.js → opencode-adapter-94976yab.js} +6 -6
- package/dist/{otel-impl-svqp691q.js → otel-impl-5d4p2fqs.js} +1 -1
- package/dist/{pending-bn4xe5br.js → pending-vkk0vx6n.js} +22 -22
- package/dist/{pi-mono-adapter-763s8a3w.js → pi-mono-adapter-cyzdv5er.js} +8 -8
- package/dist/{pricing-refresh-kfc215mf.js → pricing-refresh-jtmjwss9.js} +2 -2
- package/dist/{rbac-roles-6r4h2ghj.js → rbac-roles-1fvmdyeb.js} +2 -2
- package/dist/{rbac-roles-3bznvkpt.js → rbac-roles-yd1fgpsn.js} +3 -3
- package/dist/{render-v2-f3qedbpy.js → render-v2-kb5s3vx4.js} +6 -6
- package/dist/{resume-vcag4ann.js → resume-z1vs44n5.js} +9 -9
- package/dist/{runtime-x0s55z2t.js → runtime-gk6ct7r7.js} +1 -1
- package/dist/{session-access-nwzve8q2.js → session-access-nz6nre4d.js} +5 -5
- package/dist/{session-source-backfill-jpqfzmgz.js → session-source-backfill-wb60zjkd.js} +1 -1
- package/dist/{setup-d2smwaem.js → setup-2x8g8j4s.js} +1 -1
- package/dist/thread-buffer-d50rqpev.js +42 -0
- package/dist/{tree-visibility-dwzc8en0.js → tree-visibility-ts3z30kw.js} +2 -2
- package/dist/{user-merge-jobs-4ce7kma2.js → user-merge-jobs-zetg26e0.js} +3 -3
- package/dist/{virtual-modules-78a6yw71.js → virtual-modules-674fka8x.js} +3 -3
- package/dist/{work-objects-m0w1e7q8.js → work-objects-w52yyjxm.js} +24 -24
- package/dist/worker-662x1vse.js +82 -0
- package/dist/{worker-follow-up-e3t6f895.js → worker-follow-up-dyfxyjbj.js} +21 -21
- package/openapi.json +4 -1
- package/package.json +3 -3
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/runner.ts +62 -6
- package/src/hooks/codex-hook.ts +15 -4
- package/src/hooks/hook.ts +7 -0
- package/src/http/session-cost-recompute.ts +3 -1
- package/src/http/session-data.ts +3 -0
- package/src/prompts/base-prompt.ts +1 -1
- package/src/prompts/session-templates.ts +1 -1
- package/src/providers/acp-targets.ts +2 -2
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-adapter.ts +21 -1
- package/src/providers/claude-sdk-session.ts +22 -3
- package/src/providers/claude-session-events.ts +76 -1
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/providers/fx-adapter.ts +2 -2
- package/src/providers/pricing-sources.md +3 -0
- package/src/providers/types.ts +13 -0
- package/src/slack/render-v2.ts +27 -7
- package/src/tests/base-prompt.test.ts +6 -2
- package/src/tests/claude-adapter.test.ts +115 -0
- package/src/tests/fixtures/fx/acp-updates-recorded.jsonl +1 -1
- package/src/tests/internal-ai/complete-structured.test.ts +105 -0
- package/src/tests/internal-ai/credentials.test.ts +149 -0
- package/src/tests/internal-ai/task-title.test.ts +78 -0
- package/src/tests/mcp-input-caps.test.ts +16 -11
- package/src/tests/runner-slot-reconcile.test.ts +102 -0
- package/src/tests/slack-render-v2.test.ts +85 -0
- package/src/types.ts +2 -1
- package/src/utils/internal-ai/complete-structured.ts +36 -5
- package/src/utils/internal-ai/credentials.ts +78 -2
- package/src/utils/internal-ai/models.ts +37 -1
- package/src/utils/internal-ai/task-title.ts +31 -1
- package/templates/skills/swarm-docs/content.md +8 -0
- package/dist/acp-adapter-x1qqgzwx.js +0 -17
- package/dist/fx-adapter-4yet1c4f.js +0 -20
- package/dist/handlers-0r9evrdj.js +0 -41
- package/dist/index-1v23363p.js +0 -39
- package/dist/index-30qw6vyw.js +0 -44
- package/dist/index-6bm3w6cn.js +0 -40
- package/dist/lead-3jpc7kcr.js +0 -79
- package/dist/thread-buffer-8fc703jc.js +0 -42
- package/dist/worker-3p2vq107.js +0 -79
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
bodySessionDenial2,
|
|
15
15
|
userAgentIdentityDenial2,
|
|
16
16
|
init_session_access
|
|
17
|
-
} from "./cli-
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
17
|
+
} from "./cli-dw43pnzp.js";
|
|
18
|
+
import"./cli-1gnf5c7x.js";
|
|
19
|
+
import"./cli-tjf1bh1v.js";
|
|
20
|
+
import"./cli-grk77aen.js";
|
|
21
|
+
import"./cli-e4gx499y.js";
|
|
22
22
|
init_session_access();
|
|
23
23
|
|
|
24
24
|
export {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
bufferThreadMessage2,
|
|
3
|
+
restoreBufferedSlackMessages2,
|
|
4
|
+
getBufferMessageCount2,
|
|
5
|
+
instantFlush2,
|
|
6
|
+
init_thread_buffer
|
|
7
|
+
} from "./cli-0j4qmc80.js";
|
|
8
|
+
import"./cli-wtffytm8.js";
|
|
9
|
+
import"./cli-1606qw3n.js";
|
|
10
|
+
import"./cli-fbmgpt72.js";
|
|
11
|
+
import"./cli-h3drhntp.js";
|
|
12
|
+
import"./cli-ka4tqjzd.js";
|
|
13
|
+
import"./cli-8sayvj48.js";
|
|
14
|
+
import"./cli-w24741sm.js";
|
|
15
|
+
import"./cli-snwz16eg.js";
|
|
16
|
+
import"./cli-y260hgep.js";
|
|
17
|
+
import"./cli-v8rpjrnx.js";
|
|
18
|
+
import"./cli-hpxcfvdm.js";
|
|
19
|
+
import"./cli-hhb8kbwd.js";
|
|
20
|
+
import"./cli-gxqwm3k3.js";
|
|
21
|
+
import"./cli-dw43pnzp.js";
|
|
22
|
+
import"./cli-268b3dgn.js";
|
|
23
|
+
import"./cli-ea367bdn.js";
|
|
24
|
+
import"./cli-4dyhzhpx.js";
|
|
25
|
+
import"./cli-hxj888w3.js";
|
|
26
|
+
import"./cli-r8ddn0hf.js";
|
|
27
|
+
import"./cli-b0m3bg0f.js";
|
|
28
|
+
import"./cli-vr4eyq6p.js";
|
|
29
|
+
import"./cli-1gnf5c7x.js";
|
|
30
|
+
import"./cli-vx9acp12.js";
|
|
31
|
+
import"./cli-gkjw33x5.js";
|
|
32
|
+
import"./cli-tjf1bh1v.js";
|
|
33
|
+
import"./cli-grk77aen.js";
|
|
34
|
+
import"./cli-e4gx499y.js";
|
|
35
|
+
init_thread_buffer();
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
bufferThreadMessage2 as bufferThreadMessage,
|
|
39
|
+
getBufferMessageCount2 as getBufferMessageCount,
|
|
40
|
+
instantFlush2 as instantFlush,
|
|
41
|
+
restoreBufferedSlackMessages2 as restoreBufferedSlackMessages
|
|
42
|
+
};
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
requeueUserMergeJob2,
|
|
8
8
|
runUserMergeJobs2,
|
|
9
9
|
resumeUserMergeJobs2
|
|
10
|
-
} from "./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
10
|
+
} from "./cli-80d5g0fa.js";
|
|
11
|
+
import"./cli-czeh7x13.js";
|
|
12
|
+
import"./cli-e4gx499y.js";
|
|
13
13
|
export {
|
|
14
14
|
createUserMergeJob2 as createUserMergeJob,
|
|
15
15
|
findActiveUserMergeJob2 as findActiveUserMergeJob,
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
exports_value,
|
|
5
5
|
exports_compile,
|
|
6
6
|
exports_dist3
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-55fqpd9q.js";
|
|
8
8
|
import {
|
|
9
9
|
Unsafe,
|
|
10
10
|
exports_typebox,
|
|
11
11
|
exports_build
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-ef590376.js";
|
|
13
13
|
import {
|
|
14
14
|
envApiKeyAuth,
|
|
15
15
|
lazyOAuth,
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
streamSimple2,
|
|
88
88
|
completeSimple,
|
|
89
89
|
init_compat
|
|
90
|
-
} from "./cli-
|
|
90
|
+
} from "./cli-v1v49t36.js";
|
|
91
91
|
import {
|
|
92
92
|
uuidv7
|
|
93
93
|
} from "./cli-4se3x6qm.js";
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
getAgentById2,
|
|
3
3
|
getTaskById2,
|
|
4
4
|
init_db4
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-e4gx499y.js";
|
|
6
6
|
import {
|
|
7
7
|
shouldBlockChannel2,
|
|
8
8
|
init_external_channel
|
|
9
|
-
} from "./cli-
|
|
10
|
-
import"./cli-
|
|
9
|
+
} from "./cli-hxj888w3.js";
|
|
10
|
+
import"./cli-4dyhzhpx.js";
|
|
11
11
|
import"./cli-vr4eyq6p.js";
|
|
12
12
|
import"./cli-r8ddn0hf.js";
|
|
13
13
|
import"./cli-vx9acp12.js";
|
|
@@ -20,37 +20,37 @@ import {
|
|
|
20
20
|
init_blocks,
|
|
21
21
|
withUiSpecFallback,
|
|
22
22
|
init_fallback
|
|
23
|
-
} from "./cli-
|
|
24
|
-
import"./cli-
|
|
25
|
-
import"./cli-
|
|
26
|
-
import"./cli-
|
|
27
|
-
import"./cli-
|
|
28
|
-
import"./cli-
|
|
29
|
-
import"./cli-
|
|
23
|
+
} from "./cli-ea367bdn.js";
|
|
24
|
+
import"./cli-gxqwm3k3.js";
|
|
25
|
+
import"./cli-hpxcfvdm.js";
|
|
26
|
+
import"./cli-1606qw3n.js";
|
|
27
|
+
import"./cli-tjf1bh1v.js";
|
|
28
|
+
import"./cli-fbmgpt72.js";
|
|
29
|
+
import"./cli-h3drhntp.js";
|
|
30
30
|
import"./cli-y260hgep.js";
|
|
31
|
-
import"./cli-
|
|
32
|
-
import"./cli-
|
|
33
|
-
import"./cli-
|
|
31
|
+
import"./cli-268b3dgn.js";
|
|
32
|
+
import"./cli-dw43pnzp.js";
|
|
33
|
+
import"./cli-0j4qmc80.js";
|
|
34
34
|
import {
|
|
35
35
|
LOOKUP_USER_TEAM2,
|
|
36
36
|
isUserAllowed2,
|
|
37
37
|
init_handlers
|
|
38
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-61fzwtjk.js";
|
|
39
39
|
import {
|
|
40
40
|
wasEventSeen,
|
|
41
41
|
init_event_dedup
|
|
42
42
|
} from "./cli-kj0hyr43.js";
|
|
43
|
-
import"./cli-
|
|
44
|
-
import"./cli-
|
|
45
|
-
import"./cli-
|
|
46
|
-
import"./cli-
|
|
47
|
-
import"./cli-
|
|
48
|
-
import"./cli-
|
|
49
|
-
import"./cli-
|
|
43
|
+
import"./cli-wtffytm8.js";
|
|
44
|
+
import"./cli-ka4tqjzd.js";
|
|
45
|
+
import"./cli-8sayvj48.js";
|
|
46
|
+
import"./cli-w24741sm.js";
|
|
47
|
+
import"./cli-snwz16eg.js";
|
|
48
|
+
import"./cli-v8rpjrnx.js";
|
|
49
|
+
import"./cli-hhb8kbwd.js";
|
|
50
50
|
import"./cli-b0m3bg0f.js";
|
|
51
|
-
import"./cli-
|
|
52
|
-
import"./cli-
|
|
53
|
-
import"./cli-
|
|
51
|
+
import"./cli-1gnf5c7x.js";
|
|
52
|
+
import"./cli-gkjw33x5.js";
|
|
53
|
+
import"./cli-grk77aen.js";
|
|
54
54
|
import {
|
|
55
55
|
isEnvFlagEnabled,
|
|
56
56
|
init_env_flag
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import"./cli-e4gx499y.js";
|
|
2
|
+
import"./cli-tjf1bh1v.js";
|
|
3
|
+
import"./cli-fbmgpt72.js";
|
|
4
|
+
import"./cli-h3drhntp.js";
|
|
5
|
+
import"./cli-vx9acp12.js";
|
|
6
|
+
import"./cli-hxj888w3.js";
|
|
7
|
+
import"./cli-4dyhzhpx.js";
|
|
8
|
+
import"./cli-vr4eyq6p.js";
|
|
9
|
+
import"./cli-r8ddn0hf.js";
|
|
10
|
+
import"./cli-ea367bdn.js";
|
|
11
|
+
import"./cli-gxqwm3k3.js";
|
|
12
|
+
import"./cli-hpxcfvdm.js";
|
|
13
|
+
import {
|
|
14
|
+
getEnabledCapabilities,
|
|
15
|
+
init_server
|
|
16
|
+
} from "./cli-1606qw3n.js";
|
|
17
|
+
import"./cli-y260hgep.js";
|
|
18
|
+
import"./cli-268b3dgn.js";
|
|
19
|
+
import"./cli-dw43pnzp.js";
|
|
20
|
+
import"./cli-g4dhd3pr.js";
|
|
21
|
+
import"./cli-h9d3sdnc.js";
|
|
22
|
+
import {
|
|
23
|
+
runAgent
|
|
24
|
+
} from "./cli-9gmkw6xn.js";
|
|
25
|
+
import"./cli-vdfngx2g.js";
|
|
26
|
+
import"./cli-8m6gqnf1.js";
|
|
27
|
+
import"./cli-77cd6gy8.js";
|
|
28
|
+
import"./cli-zkbz8m2q.js";
|
|
29
|
+
import"./cli-hv3820ez.js";
|
|
30
|
+
import"./cli-88np9va3.js";
|
|
31
|
+
import"./cli-nbawx3s0.js";
|
|
32
|
+
import"./cli-6p8p2e6r.js";
|
|
33
|
+
import"./cli-2ap1the6.js";
|
|
34
|
+
import"./cli-kwm1bek7.js";
|
|
35
|
+
import"./cli-ef590376.js";
|
|
36
|
+
import"./cli-wsnradtk.js";
|
|
37
|
+
import"./cli-2v4xxnx2.js";
|
|
38
|
+
import"./cli-d82btycs.js";
|
|
39
|
+
import"./cli-0726awxw.js";
|
|
40
|
+
import"./cli-vgh5adn9.js";
|
|
41
|
+
import"./cli-djwt4mtn.js";
|
|
42
|
+
import"./cli-snxhtehz.js";
|
|
43
|
+
import"./cli-cah298e5.js";
|
|
44
|
+
import"./cli-r6xnchva.js";
|
|
45
|
+
import"./cli-at67kvnp.js";
|
|
46
|
+
import"./cli-kr5tjjtz.js";
|
|
47
|
+
import"./cli-pzsedyb0.js";
|
|
48
|
+
import"./cli-y754psdt.js";
|
|
49
|
+
import"./cli-je587f74.js";
|
|
50
|
+
import"./cli-t25rq8mg.js";
|
|
51
|
+
import"./cli-7fa6yv98.js";
|
|
52
|
+
import"./cli-xc8m5cjn.js";
|
|
53
|
+
import"./cli-7kv5d674.js";
|
|
54
|
+
import"./cli-syqcny89.js";
|
|
55
|
+
import"./cli-bh53ppqm.js";
|
|
56
|
+
import"./cli-61p7ty8d.js";
|
|
57
|
+
import"./cli-ka4tqjzd.js";
|
|
58
|
+
import"./cli-8sayvj48.js";
|
|
59
|
+
import"./cli-w24741sm.js";
|
|
60
|
+
import"./cli-snwz16eg.js";
|
|
61
|
+
import"./cli-v8rpjrnx.js";
|
|
62
|
+
import"./cli-hhb8kbwd.js";
|
|
63
|
+
import"./cli-b0m3bg0f.js";
|
|
64
|
+
import"./cli-1gnf5c7x.js";
|
|
65
|
+
import"./cli-gkjw33x5.js";
|
|
66
|
+
import"./cli-v41kn3cd.js";
|
|
67
|
+
import"./cli-grk77aen.js";
|
|
68
|
+
|
|
69
|
+
// src/commands/worker.ts
|
|
70
|
+
init_server();
|
|
71
|
+
var workerConfig = {
|
|
72
|
+
role: "worker",
|
|
73
|
+
defaultPrompt: "/start-worker",
|
|
74
|
+
metadataType: "worker_metadata",
|
|
75
|
+
capabilities: getEnabledCapabilities()
|
|
76
|
+
};
|
|
77
|
+
async function runWorker(opts) {
|
|
78
|
+
return runAgent(workerConfig, opts);
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
runWorker
|
|
82
|
+
};
|
|
@@ -11,32 +11,32 @@ import {
|
|
|
11
11
|
createRerouteDecisionTask2,
|
|
12
12
|
createPoolStarvationDecisionTask2,
|
|
13
13
|
init_worker_follow_up
|
|
14
|
-
} from "./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
14
|
+
} from "./cli-1606qw3n.js";
|
|
15
|
+
import"./cli-fbmgpt72.js";
|
|
16
|
+
import"./cli-h3drhntp.js";
|
|
17
|
+
import"./cli-ka4tqjzd.js";
|
|
18
|
+
import"./cli-8sayvj48.js";
|
|
19
|
+
import"./cli-w24741sm.js";
|
|
20
|
+
import"./cli-snwz16eg.js";
|
|
21
21
|
import"./cli-y260hgep.js";
|
|
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-
|
|
22
|
+
import"./cli-v8rpjrnx.js";
|
|
23
|
+
import"./cli-hpxcfvdm.js";
|
|
24
|
+
import"./cli-hhb8kbwd.js";
|
|
25
|
+
import"./cli-gxqwm3k3.js";
|
|
26
|
+
import"./cli-dw43pnzp.js";
|
|
27
|
+
import"./cli-268b3dgn.js";
|
|
28
|
+
import"./cli-ea367bdn.js";
|
|
29
|
+
import"./cli-4dyhzhpx.js";
|
|
30
|
+
import"./cli-hxj888w3.js";
|
|
31
31
|
import"./cli-r8ddn0hf.js";
|
|
32
32
|
import"./cli-b0m3bg0f.js";
|
|
33
33
|
import"./cli-vr4eyq6p.js";
|
|
34
|
-
import"./cli-
|
|
34
|
+
import"./cli-1gnf5c7x.js";
|
|
35
35
|
import"./cli-vx9acp12.js";
|
|
36
|
-
import"./cli-
|
|
37
|
-
import"./cli-
|
|
38
|
-
import"./cli-
|
|
39
|
-
import"./cli-
|
|
36
|
+
import"./cli-gkjw33x5.js";
|
|
37
|
+
import"./cli-tjf1bh1v.js";
|
|
38
|
+
import"./cli-grk77aen.js";
|
|
39
|
+
import"./cli-e4gx499y.js";
|
|
40
40
|
init_worker_follow_up();
|
|
41
41
|
|
|
42
42
|
export {
|
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.13.
|
|
5
|
+
"version": "2.13.3",
|
|
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": [
|
|
@@ -56243,6 +56243,9 @@
|
|
|
56243
56243
|
"harnessCostBilled": {
|
|
56244
56244
|
"type": "boolean"
|
|
56245
56245
|
},
|
|
56246
|
+
"estimated": {
|
|
56247
|
+
"type": "boolean"
|
|
56248
|
+
},
|
|
56246
56249
|
"taskId": {
|
|
56247
56250
|
"type": "string"
|
|
56248
56251
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@desplega.ai/agent-swarm",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.3",
|
|
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",
|
|
@@ -219,8 +219,8 @@
|
|
|
219
219
|
"@chat-adapter/slack": "4.45.0",
|
|
220
220
|
"@chat-adapter/teams": "4.45.0",
|
|
221
221
|
"@chat-adapter/telegram": "4.45.0",
|
|
222
|
-
"@cursor/sdk": "1.
|
|
223
|
-
"@desplega.ai/agent-fs-just-bash": "0.18.
|
|
222
|
+
"@cursor/sdk": "1.4.0",
|
|
223
|
+
"@desplega.ai/agent-fs-just-bash": "0.18.29",
|
|
224
224
|
"@desplega.ai/business-use": "^0.4.2",
|
|
225
225
|
"@earendil-works/pi-agent-core": "^1.5.2",
|
|
226
226
|
"@earendil-works/pi-ai": "^1.5.2",
|
package/src/commands/runner.ts
CHANGED
|
@@ -2894,6 +2894,11 @@ export interface RunningTask {
|
|
|
2894
2894
|
lastReconcileAt?: number;
|
|
2895
2895
|
/** When the runner asked the session to abort (cancel or reconcile). */
|
|
2896
2896
|
abortRequestedAt?: number;
|
|
2897
|
+
/**
|
|
2898
|
+
* When reconcile found the task terminal and ended the session's input
|
|
2899
|
+
* instead of aborting it, so its final cost report can still arrive.
|
|
2900
|
+
*/
|
|
2901
|
+
terminalGraceStartedAt?: number;
|
|
2897
2902
|
/**
|
|
2898
2903
|
* Terminal status the server already holds for this task, found by
|
|
2899
2904
|
* `reconcileActiveTasks` or set by an API-drain handoff. Completion then only
|
|
@@ -5630,6 +5635,20 @@ export async function spawnProviderProcess(
|
|
|
5630
5635
|
export const DEFAULT_TASK_RECONCILE_INTERVAL_MS = 30_000;
|
|
5631
5636
|
/** How long an aborted session gets to settle before the runner settles it. */
|
|
5632
5637
|
export const ABORT_SETTLE_GRACE_MS = 10_000;
|
|
5638
|
+
/**
|
|
5639
|
+
* How long a session whose task turned terminal server-side may finish its
|
|
5640
|
+
* turn (and emit its cost report) after its input closes, before the abort.
|
|
5641
|
+
*/
|
|
5642
|
+
export const DEFAULT_TERMINAL_TASK_GRACE_MS = 45_000;
|
|
5643
|
+
|
|
5644
|
+
/** `RUNNER_TERMINAL_TASK_GRACE_MS` (0 aborts at once), or the default when unset or invalid. */
|
|
5645
|
+
export function resolveTerminalTaskGraceMs(
|
|
5646
|
+
env: Record<string, string | undefined> = process.env,
|
|
5647
|
+
): number {
|
|
5648
|
+
const raw = env.RUNNER_TERMINAL_TASK_GRACE_MS;
|
|
5649
|
+
const value = raw === undefined || raw.trim() === "" ? Number.NaN : Number(raw);
|
|
5650
|
+
return Number.isFinite(value) && value >= 0 ? value : DEFAULT_TERMINAL_TASK_GRACE_MS;
|
|
5651
|
+
}
|
|
5633
5652
|
|
|
5634
5653
|
/** `RUNNER_TASK_RECONCILE_INTERVAL_MS`, or the default when unset or invalid. */
|
|
5635
5654
|
export function resolveTaskReconcileIntervalMs(
|
|
@@ -5648,6 +5667,8 @@ export interface ReconcileActiveTasksOptions {
|
|
|
5648
5667
|
fetchStatus: (taskId: string) => Promise<string | null>;
|
|
5649
5668
|
intervalMs: number;
|
|
5650
5669
|
abortGraceMs?: number;
|
|
5670
|
+
/** Grace after ending input for a server-terminal task; default `DEFAULT_TERMINAL_TASK_GRACE_MS`. */
|
|
5671
|
+
terminalGraceMs?: number;
|
|
5651
5672
|
now?: () => number;
|
|
5652
5673
|
/** In push mode, fetch cancellation only for these tasks. Abort settlement still runs. */
|
|
5653
5674
|
cancelTaskIds?: ReadonlySet<string>;
|
|
@@ -5730,7 +5751,10 @@ export async function handOffTasksForApiDrain(
|
|
|
5730
5751
|
* never settles cannot hold an execution slot forever:
|
|
5731
5752
|
* - a task the server cancelled gets its session aborted (every call);
|
|
5732
5753
|
* - every `intervalMs`, a task the server already holds as terminal (for
|
|
5733
|
-
* example failed by the heartbeat sweep) gets
|
|
5754
|
+
* example completed by its own agent, or failed by the heartbeat sweep) gets
|
|
5755
|
+
* its session aborted too. A session with `finishInput` first gets its input
|
|
5756
|
+
* closed and `terminalGraceMs` to end its turn, so Claude can still emit the
|
|
5757
|
+
* `result` that carries its cost;
|
|
5734
5758
|
* - a session that has not settled `abortGraceMs` after an abort is settled
|
|
5735
5759
|
* here, and `checkCompletedProcesses` frees the slot on its next pass.
|
|
5736
5760
|
* Exported for tests.
|
|
@@ -5742,6 +5766,7 @@ export async function reconcileActiveTasks(
|
|
|
5742
5766
|
): Promise<void> {
|
|
5743
5767
|
const now = opts.now ?? Date.now;
|
|
5744
5768
|
const graceMs = opts.abortGraceMs ?? ABORT_SETTLE_GRACE_MS;
|
|
5769
|
+
const terminalGraceMs = opts.terminalGraceMs ?? DEFAULT_TERMINAL_TASK_GRACE_MS;
|
|
5745
5770
|
|
|
5746
5771
|
// Each task touches only its own entry (plus an add to the shared
|
|
5747
5772
|
// cancelledSignaled set), and both API reads swallow their errors, so the
|
|
@@ -5766,21 +5791,50 @@ export async function reconcileActiveTasks(
|
|
|
5766
5791
|
}
|
|
5767
5792
|
}
|
|
5768
5793
|
|
|
5769
|
-
if (
|
|
5794
|
+
if (
|
|
5795
|
+
task.abortRequestedAt === undefined &&
|
|
5796
|
+
task.terminalGraceStartedAt === undefined &&
|
|
5797
|
+
opts.checkStatus !== false
|
|
5798
|
+
) {
|
|
5770
5799
|
const lastCheck = task.lastReconcileAt ?? task.startTime.getTime();
|
|
5771
5800
|
if (now() - lastCheck >= opts.intervalMs) {
|
|
5772
5801
|
task.lastReconcileAt = now();
|
|
5773
5802
|
const status = await opts.fetchStatus(taskId).catch(() => null);
|
|
5774
5803
|
if (status && isTerminalTaskStatus(status)) {
|
|
5775
|
-
console.warn(
|
|
5776
|
-
`[${role}] Task ${taskId.slice(0, 8)} is ${status} server-side but its session is still running — aborting it`,
|
|
5777
|
-
);
|
|
5778
5804
|
task.serverTerminalStatus = status;
|
|
5779
|
-
|
|
5805
|
+
// A cancel means stop now; the other terminal states let the turn end.
|
|
5806
|
+
if (task.session.finishInput && terminalGraceMs > 0 && status !== "cancelled") {
|
|
5807
|
+
console.warn(
|
|
5808
|
+
`[${role}] Task ${taskId.slice(0, 8)} is ${status} server-side but its session is still running — closing its input, abort in ${terminalGraceMs}ms`,
|
|
5809
|
+
);
|
|
5810
|
+
task.terminalGraceStartedAt = now();
|
|
5811
|
+
try {
|
|
5812
|
+
task.session.finishInput();
|
|
5813
|
+
} catch {
|
|
5814
|
+
// The abort below still runs when the grace ends.
|
|
5815
|
+
}
|
|
5816
|
+
} else {
|
|
5817
|
+
console.warn(
|
|
5818
|
+
`[${role}] Task ${taskId.slice(0, 8)} is ${status} server-side but its session is still running — aborting it`,
|
|
5819
|
+
);
|
|
5820
|
+
requestSessionAbort(task, `server task ${status}`, now());
|
|
5821
|
+
}
|
|
5780
5822
|
}
|
|
5781
5823
|
}
|
|
5782
5824
|
}
|
|
5783
5825
|
|
|
5826
|
+
if (
|
|
5827
|
+
task.terminalGraceStartedAt !== undefined &&
|
|
5828
|
+
task.abortRequestedAt === undefined &&
|
|
5829
|
+
task.result === null &&
|
|
5830
|
+
now() - task.terminalGraceStartedAt >= terminalGraceMs
|
|
5831
|
+
) {
|
|
5832
|
+
console.warn(
|
|
5833
|
+
`[${role}] Task ${taskId.slice(0, 8)} session did not end ${terminalGraceMs}ms after its input closed — aborting it`,
|
|
5834
|
+
);
|
|
5835
|
+
requestSessionAbort(task, `server task ${task.serverTerminalStatus}`, now());
|
|
5836
|
+
}
|
|
5837
|
+
|
|
5784
5838
|
if (
|
|
5785
5839
|
task.abortRequestedAt !== undefined &&
|
|
5786
5840
|
task.result === null &&
|
|
@@ -7550,6 +7604,7 @@ export async function runAgent(config: RunnerConfig, opts: RunnerOptions) {
|
|
|
7550
7604
|
let lastOrphanRecoveryAt = 0;
|
|
7551
7605
|
const ORPHAN_RECOVERY_INTERVAL_MS = 60_000;
|
|
7552
7606
|
const taskReconcileIntervalMs = resolveTaskReconcileIntervalMs();
|
|
7607
|
+
const terminalTaskGraceMs = resolveTerminalTaskGraceMs();
|
|
7553
7608
|
|
|
7554
7609
|
while (shouldRunDeliveryLoop(state.deliveryMode, shuttingDown)) {
|
|
7555
7610
|
const deliveryChecks = pushDelivery.checks(state.deliveryMode ?? "poll");
|
|
@@ -7663,6 +7718,7 @@ export async function runAgent(config: RunnerConfig, opts: RunnerOptions) {
|
|
|
7663
7718
|
isCancelled: (taskId) => fetchTaskCancelled(apiUrl, apiKey, agentId, taskId),
|
|
7664
7719
|
fetchStatus: (taskId) => fetchTaskStatus(apiUrl, apiKey, taskId),
|
|
7665
7720
|
intervalMs: taskReconcileIntervalMs,
|
|
7721
|
+
terminalGraceMs: terminalTaskGraceMs,
|
|
7666
7722
|
...taskReconciliation(deliveryChecks),
|
|
7667
7723
|
});
|
|
7668
7724
|
}
|
package/src/hooks/codex-hook.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
*
|
|
26
26
|
* Native tool calls (Bash, apply_patch) also go to `POST /api/tool-hooks`
|
|
27
27
|
* (`native-tool-hooks.ts`), so an extension with `toolSources: ["native"]`
|
|
28
|
-
* can observe, block (exit 2) or rewrite a Bash command (`updatedInput`).
|
|
28
|
+
* can observe, block (exit 2) or rewrite a Bash command or an apply_patch patch (`updatedInput`).
|
|
29
29
|
*
|
|
30
30
|
* One-shot guarantee: a message is included in hook output only after its
|
|
31
31
|
* `/delivered` POST succeeded, so a message is injected at most once. A
|
|
@@ -220,6 +220,12 @@ function nativeTargetOf(config: CodexHookConfig | null): NativeHookTarget | unde
|
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
/**
|
|
224
|
+
* Codex tools whose `hookSpecificOutput.updatedInput` rewrite a real codex-cli 0.169.0 run applied
|
|
225
|
+
* (the rewritten patch, not the original, landed on disk). Re-check on a codex upgrade.
|
|
226
|
+
*/
|
|
227
|
+
const CODEX_REWRITABLE_TOOLS = new Set(["bash", "apply_patch"]);
|
|
228
|
+
|
|
223
229
|
export type CodexNativePre =
|
|
224
230
|
| { action: "continue" }
|
|
225
231
|
| { action: "block"; reason: string }
|
|
@@ -238,9 +244,14 @@ export async function codexNativePre(
|
|
|
238
244
|
if (msg.hook_event_name !== "PreToolUse" || !call || !target) return { action: "continue" };
|
|
239
245
|
const decision = await runNativePre(target, call, fetchImpl);
|
|
240
246
|
if (decision.action === "block") return decision;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
247
|
+
if (decision.action === "modify") {
|
|
248
|
+
// A rewrite codex was never seen to apply fails closed, so it is never silently dropped.
|
|
249
|
+
if (!CODEX_REWRITABLE_TOOLS.has(call.tool)) {
|
|
250
|
+
return {
|
|
251
|
+
action: "block",
|
|
252
|
+
reason: `An extension rewrote this ${call.nativeTool} call, but codex cannot apply the rewrite in place. Retry with these arguments: ${JSON.stringify(decision.args)}`,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
244
255
|
// The rewrite is input the PreToolUse guards never saw: check the final command too.
|
|
245
256
|
const reason = await codexPreToolUseBlock(
|
|
246
257
|
{ ...msg, tool_input: decision.args },
|
package/src/hooks/hook.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
3
|
import pkg from "../../package.json";
|
|
4
|
+
// Side-effect import, FIRST: the Stop hook is the claude session-summary path,
|
|
5
|
+
// and this file is also a standalone entry (`bun src/hooks/hook.ts`) that does
|
|
6
|
+
// not pass through `src/cli.tsx`. A compiled worker binary resolves pi-ai's
|
|
7
|
+
// lazy Bedrock import only when the module has been wired statically, so without
|
|
8
|
+
// this the summarizer silently could not use Bedrock. No-op when running from
|
|
9
|
+
// node_modules.
|
|
10
|
+
import "../utils/internal-ai/register-bedrock.ts";
|
|
4
11
|
import {
|
|
5
12
|
buildRatingsFromLlm,
|
|
6
13
|
dedupeRetrievalsForRater,
|
|
@@ -33,6 +33,8 @@ interface SessionCostRecomputeInput {
|
|
|
33
33
|
harnessCostUsd: number;
|
|
34
34
|
/** `harnessCostUsd` is the provider's bill, not a token estimate. */
|
|
35
35
|
harnessCostBilled?: boolean;
|
|
36
|
+
/** The token counts are a fallback sum, so a priced row is tagged `estimated`. */
|
|
37
|
+
estimated?: boolean;
|
|
36
38
|
inputTokens: number;
|
|
37
39
|
outputTokens: number;
|
|
38
40
|
cacheReadTokens: number;
|
|
@@ -278,7 +280,7 @@ export async function recomputeSessionCost(
|
|
|
278
280
|
|
|
279
281
|
return {
|
|
280
282
|
totalCostUsd: pricedCostUsd + sessionFeesUsd,
|
|
281
|
-
costSource: "pricing-table",
|
|
283
|
+
costSource: input.estimated ? "estimated" : "pricing-table",
|
|
282
284
|
modelBreakdown: modelUsageEntries ? pricedModels : undefined,
|
|
283
285
|
};
|
|
284
286
|
}
|
package/src/http/session-data.ts
CHANGED
|
@@ -202,6 +202,8 @@ const createSessionCostRoute = route({
|
|
|
202
202
|
// The adapter's totalCostUsd is the provider's bill (e.g. OpenRouter's
|
|
203
203
|
// `usage.cost`), so it wins over the pricing table.
|
|
204
204
|
harnessCostBilled: z.boolean().optional(),
|
|
205
|
+
// Token counts summed from per-message usage; the priced row is tagged `estimated`.
|
|
206
|
+
estimated: z.boolean().optional(),
|
|
205
207
|
taskId: z.string().optional(),
|
|
206
208
|
// Phase 3: non-negative — the recompute no longer clamps, so negative
|
|
207
209
|
// token counts must be rejected at the wire instead of pricing below $0.
|
|
@@ -451,6 +453,7 @@ export async function handleSessionData(
|
|
|
451
453
|
model,
|
|
452
454
|
harnessCostUsd: parsed.body.totalCostUsd,
|
|
453
455
|
harnessCostBilled: parsed.body.harnessCostBilled,
|
|
456
|
+
estimated: parsed.body.estimated,
|
|
454
457
|
inputTokens,
|
|
455
458
|
outputTokens,
|
|
456
459
|
cacheReadTokens: cachedInputTokens,
|
|
@@ -84,7 +84,7 @@ const REPO_CLAUDE_MD_INLINE_PROVIDERS: ReadonlySet<string> = new Set(["opencode"
|
|
|
84
84
|
/**
|
|
85
85
|
* Template event for the tool-discovery line. Amp, Codex and OpenCode run MCP
|
|
86
86
|
* tools inside their own code sandbox (`code_exec`, `exec`, `execute`), each
|
|
87
|
-
* with its own call shape, and fx defers them behind `
|
|
87
|
+
* with its own call shape, and fx defers them behind `toolbox` (search, then run) under
|
|
88
88
|
* `mcp_<server>_<tool>` names, so the generic lines are wrong for them.
|
|
89
89
|
*/
|
|
90
90
|
function toolDiscoveryEvent(provider: string, hasToolSearch: boolean): string {
|
|
@@ -525,7 +525,7 @@ registerTemplate({
|
|
|
525
525
|
eventType: "system.agent.tool_discovery.fx",
|
|
526
526
|
header: "",
|
|
527
527
|
defaultBody:
|
|
528
|
-
"Most swarm tools are deferred behind `
|
|
528
|
+
"Most swarm tools are deferred behind `toolbox`. Each one is named `mcp_swarm_<tool>`, so `store-progress` is `mcp_swarm_store-progress`. Call a tool in your tool list directly. A deferred tool fails when called directly: find it with `toolbox` `search`, then call `toolbox` with `run` set to its name and `arguments` set to its arguments.",
|
|
529
529
|
variables: [],
|
|
530
530
|
category: "system",
|
|
531
531
|
});
|