@desplega.ai/agent-swarm 2.7.4 → 2.7.5

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.
Files changed (253) hide show
  1. package/README.md +1 -1
  2. package/dist/acp-adapter-g3ads55s.js +15 -0
  3. package/dist/{actions-gfrr9vb7.js → actions-zwfykqqk.js} +18 -18
  4. package/dist/{amp-adapter-0s58gm46.js → amp-adapter-z3s0ssdt.js} +3 -3
  5. package/dist/{app-stvq692g.js → app-vmp4fgep.js} +3 -3
  6. package/dist/{assistant-5s37fr9n.js → assistant-vwde653f.js} +28 -21
  7. package/dist/{boot-reembed-yzy1841n.js → boot-reembed-375t7tbk.js} +1 -1
  8. package/dist/{boot-reembed-cv82gz7y.js → boot-reembed-gq9rcpnj.js} +1 -1
  9. package/dist/{boot-scrub-sweep-8k4q95ap.js → boot-scrub-sweep-nd938kyf.js} +4 -4
  10. package/dist/{boot-seeds-ftt9htah.js → boot-seeds-aykx51v3.js} +4 -4
  11. package/dist/{boxd-515v1t8z.js → boxd-k1j26g3h.js} +1 -1
  12. package/dist/{claude-adapter-t00wrzeh.js → claude-adapter-8j4hm099.js} +7 -7
  13. package/dist/{claude-managed-adapter-g6vmjccb.js → claude-managed-adapter-dvs2xw5n.js} +2 -2
  14. package/dist/{claude-managed-setup-afpa82f7.js → claude-managed-setup-0wyynpn1.js} +3 -3
  15. package/dist/{claude-sdk-session-vj0c2azx.js → claude-sdk-session-q6wj5hmy.js} +9 -9
  16. package/dist/{cli-wndv9p7g.js → cli-0731hvbw.js} +6 -6
  17. package/dist/{cli-d2pzqej1.js → cli-0bxqnvq9.js} +719 -7
  18. package/dist/{cli-jkt52mgt.js → cli-0gey5fzy.js} +2 -2
  19. package/dist/{cli-1yekbyqm.js → cli-1338796d.js} +205 -48
  20. package/dist/{cli-1s1dqn1j.js → cli-1ayk1eas.js} +171 -123
  21. package/dist/{cli-a4btqqft.js → cli-1b7btd38.js} +1 -1
  22. package/dist/{cli-a2jw6ee5.js → cli-1p89xny0.js} +1 -1
  23. package/dist/{cli-v726afdm.js → cli-2pnswgh8.js} +1 -1
  24. package/dist/{cli-kvtc7aez.js → cli-3h4nhjn8.js} +42 -14
  25. package/dist/{cli-655xm9ms.js → cli-583frbyr.js} +1 -1
  26. package/dist/{cli-4r12t6w6.js → cli-5c4hjzne.js} +101 -4
  27. package/dist/{cli-az0bpf8p.js → cli-5pag6rmn.js} +3 -3
  28. package/dist/{cli-36g23z21.js → cli-6s7vdcta.js} +4 -4
  29. package/dist/{cli-rtk9g7av.js → cli-73jzwksr.js} +6 -2
  30. package/dist/{cli-jg0nfda6.js → cli-75gkpjvw.js} +52 -21
  31. package/dist/{cli-a81qevyg.js → cli-7a42nfy0.js} +20 -36
  32. package/dist/{cli-0sbkss7h.js → cli-7wcyk2s5.js} +2 -2
  33. package/dist/{cli-41z8xwj0.js → cli-7wspm5gm.js} +14 -4
  34. package/dist/{cli-byqfbnjw.js → cli-82ae98pz.js} +9 -9
  35. package/dist/{cli-bq2pcphn.js → cli-8hs41zy2.js} +1 -1
  36. package/dist/{cli-vqgnyh76.js → cli-98rw5dt5.js} +15 -3
  37. package/dist/{cli-9cctx1tn.js → cli-a22h291q.js} +1 -1
  38. package/dist/{cli-j4kt1mpb.js → cli-a47xy8eq.js} +3 -3
  39. package/dist/{cli-ycm6180s.js → cli-a7v854rf.js} +5 -3
  40. package/dist/{cli-98pke4vk.js → cli-ae7mrdf9.js} +2 -2
  41. package/dist/{cli-ahd90bwt.js → cli-afrrppsw.js} +6 -6
  42. package/dist/{cli-8yy525ad.js → cli-bhjt02p8.js} +2 -2
  43. package/dist/{cli-v1yw3wha.js → cli-bnz7a7qf.js} +4 -4
  44. package/dist/{cli-j4kw3rsx.js → cli-cm5yqn35.js} +18 -0
  45. package/dist/{cli-h55y2bjc.js → cli-dhar9qay.js} +2 -2
  46. package/dist/{cli-5gr1g711.js → cli-fqzx7gwa.js} +2 -2
  47. package/dist/{cli-tzrpv5sc.js → cli-ftyxyspd.js} +1 -1
  48. package/dist/cli-fw2w0kva.js +47 -0
  49. package/dist/{cli-2dfbv8qr.js → cli-fy6x31ps.js} +1 -0
  50. package/dist/{cli-mvckssyq.js → cli-g61qxmge.js} +5 -5
  51. package/dist/{cli-aq58fk5m.js → cli-g83s9ewh.js} +7 -1
  52. package/dist/{cli-224epwwf.js → cli-hn9hxmz9.js} +3 -3
  53. package/dist/{cli-5hjced2v.js → cli-j3jvnpe8.js} +6 -6
  54. package/dist/{cli-dae4sbgy.js → cli-jm2vfpfd.js} +2 -2
  55. package/dist/{cli-zn15c46z.js → cli-mjzynrse.js} +1 -1
  56. package/dist/{cli-a1fhj4n9.js → cli-mmwm7zbf.js} +2 -2
  57. package/dist/{cli-cq1pf336.js → cli-mry0qzym.js} +5 -5
  58. package/dist/{cli-bwty35gx.js → cli-mthwvjre.js} +1 -1
  59. package/dist/{cli-s0exq74r.js → cli-nmbmy64z.js} +3 -3
  60. package/dist/{cli-wcmnan2g.js → cli-nn4d8dne.js} +5 -5
  61. package/dist/{cli-jg4p5t36.js → cli-nzxr556s.js} +121 -51
  62. package/dist/{cli-bcz074zx.js → cli-p599f1qm.js} +1 -1
  63. package/dist/{cli-k76tgq03.js → cli-pywf3eh5.js} +2 -2
  64. package/dist/{cli-wk9md5px.js → cli-qxnf8z2z.js} +2 -2
  65. package/dist/{cli-je8yeyc5.js → cli-rhw40jgb.js} +5 -5
  66. package/dist/{cli-avgcz4ra.js → cli-rm6hqj3z.js} +406 -35
  67. package/dist/{cli-0fgr1w9b.js → cli-rpm2sgv0.js} +2 -2
  68. package/dist/{cli-t282jgab.js → cli-rqkxrmgw.js} +12 -12
  69. package/dist/{cli-2qpvmmkw.js → cli-s0qnd4wv.js} +1 -1
  70. package/dist/{cli-pwyevs29.js → cli-spknvxbq.js} +22 -21
  71. package/dist/{cli-9y354g3j.js → cli-srye3vdt.js} +1 -1
  72. package/dist/{cli-pe09p6dv.js → cli-tqgg40ek.js} +1 -1
  73. package/dist/{cli-f255yaqn.js → cli-vbyfwh92.js} +3 -3
  74. package/dist/{cli-gcbdjt47.js → cli-vfym7wmz.js} +6 -6
  75. package/dist/{cli-edmm9d9y.js → cli-vqypxzh4.js} +7 -7
  76. package/dist/{cli-1gm8jcyr.js → cli-wvaawacd.js} +13 -13
  77. package/dist/{cli-eny54typ.js → cli-wx3rhnm0.js} +1 -1
  78. package/dist/{cli-b1afgtj3.js → cli-xbkdm710.js} +3 -3
  79. package/dist/{cli-mc97xy2s.js → cli-xtjhfmpc.js} +16 -4
  80. package/dist/{cli-eqx6k993.js → cli-y24sc29k.js} +25 -13
  81. package/dist/{cli-ktmvb20s.js → cli-z6jkx23q.js} +12 -12
  82. package/dist/{cli-7n5sbw0z.js → cli-z8eh3ex8.js} +5 -5
  83. package/dist/cli-zh3fp8v2.js +151 -0
  84. package/dist/{cli-13jvmew3.js → cli-zppwg9p9.js} +7 -7
  85. package/dist/cli.js +18 -18
  86. package/dist/{codex-adapter-g0gctw29.js → codex-adapter-q6k3gnyg.js} +5 -5
  87. package/dist/{codex-hook-vrzz2xhr.js → codex-hook-9efm2x1m.js} +1 -1
  88. package/dist/{codex-login-0gg46ygn.js → codex-login-y0pmff1c.js} +1 -1
  89. package/dist/{codex-session-runner-dr2cxe1c.js → codex-session-runner-3mwmk3d9.js} +6 -6
  90. package/dist/{commands-1p07cvff.js → commands-evrenjn9.js} +2 -2
  91. package/dist/{controller-z0s7sv6r.js → controller-xjp8vswh.js} +4 -4
  92. package/dist/{controllers-connect-x9kvvhyk.js → controllers-connect-pp5jnxvc.js} +20 -20
  93. package/dist/{cursor-adapter-m5b98pvk.js → cursor-adapter-yf47w4t0.js} +2 -2
  94. package/dist/{db-rsh04kh3.js → db-rgfsh91f.js} +2 -2
  95. package/dist/{db-capk2raj.js → db-zxpw6aht.js} +3 -3
  96. package/dist/{devin-adapter-yxm87fe9.js → devin-adapter-r9phbnc9.js} +1 -1
  97. package/dist/{dispatcher-304q6fwa.js → dispatcher-smasgws7.js} +17 -17
  98. package/dist/{docker-7rxt0rry.js → docker-rrjhaqt9.js} +2 -2
  99. package/dist/{dsh-adapter-btewem0y.js → dsh-adapter-ftyy8dnp.js} +2 -2
  100. package/dist/{e2b-renc0k8q.js → e2b-qcaj675y.js} +2 -2
  101. package/dist/{e2b-7fc9b9bd.js → e2b-w1p0bnpm.js} +2 -2
  102. package/dist/{easter-egg-3d-fm1p3n4d.js → easter-egg-3d-yyts7p16.js} +1 -1
  103. package/dist/{embedding-space-s68v49ct.js → embedding-space-1z0mbg95.js} +6 -6
  104. package/dist/{embeddings-4ms3604w.js → embeddings-ygeg7tm7.js} +1 -1
  105. package/dist/{event-bus-dfjx2qdh.js → event-bus-g0ka3pbw.js} +1 -1
  106. package/dist/{execute-mcdgccjs.js → execute-14qhqp4d.js} +1 -1
  107. package/dist/{external-channel-9dxwfztn.js → external-channel-ttgrs3sx.js} +2 -2
  108. package/dist/fx-adapter-gt6pncj2.js +18 -0
  109. package/dist/{grok-adapter-05ecv4h0.js → grok-adapter-sm4m5k4g.js} +8 -8
  110. package/dist/handlers-vwmba1m2.js +31 -0
  111. package/dist/{heartbeat-3n94heh3.js → heartbeat-qahz4p62.js} +20 -20
  112. package/dist/{hook-zxwje86c.js → hook-4fd5wq5w.js} +4 -4
  113. package/dist/{hook-aadrn69x.js → hook-kj3d398m.js} +6 -6
  114. package/dist/{http-xzxk9mst.js → http-1ted0j1k.js} +100 -64
  115. package/dist/index-5r71rf98.js +32 -0
  116. package/dist/{index-d34f6r87.js → index-6rq3r5zb.js} +1 -1
  117. package/dist/{index-9j4zwcht.js → index-7v51awbn.js} +158 -672
  118. package/dist/index-anmwxs87.js +29 -0
  119. package/dist/{index-qeb82z37.js → index-q4b917zs.js} +1 -1
  120. package/dist/index-spp0ra5c.js +36 -0
  121. package/dist/{keepalive-w4aakbyk.js → keepalive-6cf311t5.js} +4 -4
  122. package/dist/lead-fjy418cw.js +69 -0
  123. package/dist/{maintenance-hbptpk6p.js → maintenance-a4bm1bmt.js} +1 -1
  124. package/dist/{oauth-refresh-sweep-217semrv.js → oauth-refresh-sweep-3h0dfw1k.js} +3 -3
  125. package/dist/{onboard-vz2s5df3.js → onboard-myn5hraa.js} +3 -3
  126. package/dist/{opencode-adapter-gtfd7d7v.js → opencode-adapter-p2nkb5am.js} +5 -5
  127. package/dist/{otel-impl-aefave37.js → otel-impl-a1a0ef6b.js} +2 -2
  128. package/dist/{pi-mono-adapter-f8h5yseh.js → pi-mono-adapter-rzmpb72a.js} +117 -23
  129. package/dist/{pricing-refresh-m1yhh9ya.js → pricing-refresh-83drrnxj.js} +3 -3
  130. package/dist/{rbac-roles-svj72cdf.js → rbac-roles-0fb6e7pj.js} +2 -2
  131. package/dist/{rbac-roles-rrw8twdz.js → rbac-roles-s8y6ecb5.js} +1 -1
  132. package/dist/{render-v2-amwbnfxh.js → render-v2-twmbgrz4.js} +3 -3
  133. package/dist/{resume-9cd6wf6z.js → resume-zfqc36xj.js} +7 -7
  134. package/dist/{runtime-fp4vrx7m.js → runtime-qwggdpqr.js} +1 -1
  135. package/dist/{session-access-21t6yjyg.js → session-access-sc9pn9da.js} +4 -4
  136. package/dist/{session-source-backfill-pxbzcsc6.js → session-source-backfill-qh07xr8g.js} +3 -3
  137. package/dist/{setup-4592tqz4.js → setup-4fr0m7a1.js} +1 -1
  138. package/dist/{virtual-modules-gzfnpmnz.js → virtual-modules-fh4ha15b.js} +2 -2
  139. package/dist/{work-objects-t9tcf174.js → work-objects-0wr8zxct.js} +20 -20
  140. package/dist/worker-0c5tyzqe.js +69 -0
  141. package/dist/{worker-follow-up-q32jh4yk.js → worker-follow-up-ktyyazyp.js} +17 -17
  142. package/dist/{x-b6wxntdt.js → x-vmmye1kb.js} +2 -2
  143. package/openapi.json +97 -32
  144. package/package.json +1 -1
  145. package/src/be/db/session-summaries.ts +8 -2
  146. package/src/be/db/session-tree.ts +174 -61
  147. package/src/be/db/session-visibility.ts +5 -4
  148. package/src/be/db.ts +8 -4
  149. package/src/be/migrations/259_session_summaries_open_tasks.sql +111 -0
  150. package/src/be/model-validation.ts +5 -1
  151. package/src/be/pricing-normalize.ts +7 -2
  152. package/src/be/scripts/typecheck.ts +1 -0
  153. package/src/be/seed/schedules-seeder.ts +135 -9
  154. package/src/be/seed/workflows-seeder.ts +65 -1
  155. package/src/be/seed-pricing.ts +23 -0
  156. package/src/be/steering.ts +50 -3
  157. package/src/be/swarm-config-guard.ts +1 -0
  158. package/src/commands/provider-credentials.ts +29 -2
  159. package/src/commands/runner.ts +86 -5
  160. package/src/extensions/contract-types.generated.ts +1 -1
  161. package/src/extensions/contract.ts +27 -1
  162. package/src/extensions/dispatcher.ts +4 -0
  163. package/src/http/agents.ts +1 -0
  164. package/src/http/mcp-bridge.ts +4 -0
  165. package/src/integrations/chat-sdk/inbound.ts +15 -5
  166. package/src/integrations/chat-sdk/steering.ts +3 -1
  167. package/src/kv-reserved-namespaces.ts +2 -0
  168. package/src/prompts/base-prompt.ts +4 -1
  169. package/src/prompts/session-templates.ts +26 -0
  170. package/src/providers/acp-adapter.ts +190 -26
  171. package/src/providers/acp-targets.ts +306 -6
  172. package/src/providers/amp-adapter.ts +1 -1
  173. package/src/providers/codex-adapter.ts +9 -44
  174. package/src/providers/codex-oauth/flow.ts +24 -3
  175. package/src/providers/codex-oauth/storage.ts +56 -17
  176. package/src/providers/codex-oauth/subscription.ts +67 -0
  177. package/src/providers/fx-adapter.ts +211 -0
  178. package/src/providers/index.ts +5 -1
  179. package/src/providers/mcp-loopback-proxy.ts +94 -0
  180. package/src/providers/pi-mono-adapter.ts +98 -13
  181. package/src/providers/pricing-sources.md +8 -0
  182. package/src/providers/reasoning-effort.ts +17 -1
  183. package/src/providers/types.ts +2 -1
  184. package/src/scheduler/scheduler.ts +36 -3
  185. package/src/scripts-runtime/sdk-allowlist.ts +1 -0
  186. package/src/scripts-runtime/types/stdlib.d.ts +5 -0
  187. package/src/scripts-runtime/types/swarm-extension.d.ts +33 -0
  188. package/src/scripts-runtime/types/swarm-sdk.d.ts +5 -0
  189. package/src/server.ts +7 -0
  190. package/src/slack/assistant.ts +17 -1
  191. package/src/slack/handlers.ts +18 -5
  192. package/src/slack/left-threads.ts +65 -0
  193. package/src/slack/steering.ts +3 -0
  194. package/src/slack/thread-buffer.ts +40 -16
  195. package/src/tests/acp-adapter.test.ts +79 -0
  196. package/src/tests/base-prompt.test.ts +12 -0
  197. package/src/tests/chat-sdk-inbound.test.ts +30 -0
  198. package/src/tests/chatgpt-subscription-model-groups.test.ts +62 -0
  199. package/src/tests/chatgpt-subscription-pi.test.ts +170 -0
  200. package/src/tests/chatgpt-subscription-session-bench.test.ts +198 -0
  201. package/src/tests/codex-oauth-credential-info.test.ts +40 -0
  202. package/src/tests/codex-oauth-refresh-egress.test.ts +194 -0
  203. package/src/tests/context-window.test.ts +7 -0
  204. package/src/tests/explicit-model-validation.test.ts +99 -0
  205. package/src/tests/extensions-run-context.test.ts +11 -0
  206. package/src/tests/extensions-steering.test.ts +353 -0
  207. package/src/tests/extensions-validate.test.ts +5 -0
  208. package/src/tests/fixtures/extensions/steering-policy/hooks.ts +39 -0
  209. package/src/tests/fixtures/extensions/steering-policy/manifest.json +7 -0
  210. package/src/tests/fixtures/fake-fx.ts +167 -0
  211. package/src/tests/fixtures/fx/acp-responses-recorded.json +157 -0
  212. package/src/tests/fixtures/fx/acp-updates-recorded.jsonl +15 -0
  213. package/src/tests/fx-adapter.test.ts +771 -0
  214. package/src/tests/grok-adapter.test.ts +36 -0
  215. package/src/tests/mcp-loopback-proxy.test.ts +193 -0
  216. package/src/tests/model-tier-resolution.test.ts +3 -3
  217. package/src/tests/pricing-refresh.test.ts +5 -5
  218. package/src/tests/prompt-template-session.test.ts +5 -3
  219. package/src/tests/provider-registration.test.ts +2 -1
  220. package/src/tests/query-audit-plans.test.ts +3 -2
  221. package/src/tests/script-connections.test.ts +2 -0
  222. package/src/tests/seed-model-profiles.test.ts +2 -2
  223. package/src/tests/seed-schedules.test.ts +138 -0
  224. package/src/tests/session-cost-recompute-unit.test.ts +39 -0
  225. package/src/tests/session-costs-golden.test.ts +26 -0
  226. package/src/tests/session-summaries-plans.test.ts +120 -0
  227. package/src/tests/session-summaries.test.ts +72 -12
  228. package/src/tests/sessions-tree.test.ts +11 -3
  229. package/src/tests/slack-leave-thread.test.ts +431 -0
  230. package/src/tests/tool-annotations.test.ts +2 -1
  231. package/src/tests/workflow-engine-v2.test.ts +42 -0
  232. package/src/tests/workflow-script-principal.test.ts +207 -7
  233. package/src/tools/slack-leave-thread.ts +104 -0
  234. package/src/tools/steer-task.ts +3 -2
  235. package/src/tools/tool-config.ts +2 -1
  236. package/src/types.ts +19 -0
  237. package/src/utils/codex-auth-failure.ts +30 -0
  238. package/src/utils/context-window.ts +4 -1
  239. package/src/utils/credentials.ts +7 -0
  240. package/src/utils/fx-models.ts +43 -0
  241. package/src/workflows/cooldown.ts +3 -2
  242. package/src/workflows/engine.ts +24 -9
  243. package/templates/schedules/dreaming-daily/config.json +1 -1
  244. package/templates/schedules/dreaming-daily/content.md +6 -14
  245. package/templates/skills/swarm-docs/content.md +1 -0
  246. package/templates/workflows/dreaming/content.md +5 -1
  247. package/dist/acp-adapter-96dc64m2.js +0 -15
  248. package/dist/handlers-jg7v74ty.js +0 -31
  249. package/dist/index-8c1zbz59.js +0 -29
  250. package/dist/index-8k8tmfxd.js +0 -32
  251. package/dist/index-hq617xdj.js +0 -36
  252. package/dist/lead-567kw7x3.js +0 -68
  253. package/dist/worker-fjdqra6q.js +0 -68
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  contextBoundNoteThreshold,
3
3
  createContextBoundNote
4
- } from "./cli-h55y2bjc.js";
4
+ } from "./cli-dhar9qay.js";
5
5
  import {
6
6
  SessionErrorTracker
7
- } from "./cli-bwty35gx.js";
7
+ } from "./cli-mthwvjre.js";
8
8
  import {
9
9
  summarizeSession
10
- } from "./cli-j4kt1mpb.js";
10
+ } from "./cli-a47xy8eq.js";
11
11
  import {
12
12
  resolveCodexPrompt
13
13
  } from "./cli-jc1g9ndz.js";
@@ -22,7 +22,7 @@ import {
22
22
  } from "./cli-98rwmcyc.js";
23
23
  import {
24
24
  applyReasoningEffort
25
- } from "./cli-vqgnyh76.js";
25
+ } from "./cli-98rw5dt5.js";
26
26
  import {
27
27
  createSwarmEventHandler
28
28
  } from "./cli-4zsenjhy.js";
@@ -34,7 +34,7 @@ import {
34
34
  computeContextUsedUnified,
35
35
  clampContextPercent,
36
36
  init_context_window
37
- } from "./cli-rtk9g7av.js";
37
+ } from "./cli-73jzwksr.js";
38
38
  import {
39
39
  getMemoryRaterNames,
40
40
  init_memory_raters,
@@ -52,10 +52,10 @@ import {
52
52
  import {
53
53
  credentialsToAuthJson,
54
54
  init_auth_json,
55
- CodexOAuthRefreshError,
55
+ buildPoolRevalidationFailureReason,
56
56
  getValidCodexOAuth,
57
57
  init_storage
58
- } from "./cli-jg0nfda6.js";
58
+ } from "./cli-75gkpjvw.js";
59
59
  import {
60
60
  swarmRuntimeInstanceId,
61
61
  init_multi_runtime2
@@ -63,7 +63,11 @@ import {
63
63
  import {
64
64
  DEFAULT_MODEL_TIER_MAP,
65
65
  init_types4
66
- } from "./cli-41z8xwj0.js";
66
+ } from "./cli-7wspm5gm.js";
67
+ import {
68
+ isCodexRejectedAccessError,
69
+ init_codex_auth_failure
70
+ } from "./cli-fw2w0kva.js";
67
71
  import {
68
72
  routeCredentialStatus,
69
73
  CODEX_GATEWAY_API_KEY,
@@ -72,15 +76,15 @@ import {
72
76
  init_src,
73
77
  selectCredential,
74
78
  init_credentials2
75
- } from "./cli-aq58fk5m.js";
79
+ } from "./cli-g83s9ewh.js";
76
80
  import {
77
81
  runtimeCatalogModel,
78
82
  init_runtime_model_catalog
79
- } from "./cli-a2jw6ee5.js";
83
+ } from "./cli-1p89xny0.js";
80
84
  import {
81
85
  init_package,
82
86
  package_default
83
- } from "./cli-pe09p6dv.js";
87
+ } from "./cli-tqgg40ek.js";
84
88
  import {
85
89
  isEnvFlagEnabled,
86
90
  isSessionSummarySkipped,
@@ -93,10 +97,10 @@ import {
93
97
  import {
94
98
  scrubSecrets,
95
99
  init_secret_scrubber
96
- } from "./cli-a4btqqft.js";
100
+ } from "./cli-1b7btd38.js";
97
101
  import {
98
102
  init_src2
99
- } from "./cli-4r12t6w6.js";
103
+ } from "./cli-5c4hjzne.js";
100
104
 
101
105
  // src/providers/codex-oauth/home.ts
102
106
  import os from "node:os";
@@ -110,6 +114,7 @@ init_llm();
110
114
  import { existsSync as nodeExistsSync } from "node:fs";
111
115
  import { join as join3 } from "node:path";
112
116
  init_api_key();
117
+ init_codex_auth_failure();
113
118
  init_context_window();
114
119
  init_credentials2();
115
120
  init_env_flag();
@@ -588,6 +593,7 @@ function createCodexSwarmEventHandler(opts) {
588
593
  }
589
594
 
590
595
  // src/providers/codex-adapter.ts
596
+ init_storage();
591
597
  var CODEX_GATEWAY_PROVIDER_ID = "swarm-gateway";
592
598
  function codexGatewayConfig(route) {
593
599
  return {
@@ -703,16 +709,6 @@ async function resolveCodexAuthMode(config, emit, deps = {}) {
703
709
  }
704
710
  return currentMode;
705
711
  }
706
- function buildPoolRevalidationFailureReason(err, slot) {
707
- if (err instanceof CodexOAuthRefreshError) {
708
- if (err.reason === "lock_timeout") {
709
- return `[auth-error] Codex pool slot ${slot} [...${err.keySuffix}] revalidation failed: timed out waiting for the refresh lock — transient, will retry on next task.`;
710
- }
711
- return `[auth-error] Codex pool slot ${slot} [...${err.keySuffix}] revalidation failed: refresh rejected (${err.status ?? "unknown status"} ${err.body ?? ""}) — credential likely revoked; re-run codex-login for this slot.`;
712
- }
713
- const message = err instanceof Error ? err.message : String(err);
714
- return `[auth-error] Codex pool slot ${slot} revalidation failed (not a confirmed auth rejection, transient): ${message}`;
715
- }
716
712
  async function buildCodexConfig(config, model, emit) {
717
713
  const mcpServers = {};
718
714
  const runtimeInstanceId = swarmRuntimeInstanceId();
@@ -1535,19 +1531,7 @@ class CodexSession {
1535
1531
  category: "rate_limit"
1536
1532
  };
1537
1533
  }
1538
- const authPatterns = [
1539
- "unauthorized",
1540
- "http 401",
1541
- " 401 ",
1542
- "invalid api key",
1543
- "invalid_api_key",
1544
- "missing api key",
1545
- "no api key",
1546
- "authentication failed",
1547
- "failed to refresh token",
1548
- "invalid 'refresh_token'"
1549
- ];
1550
- if (authPatterns.some((p) => normalized.includes(p))) {
1534
+ if (isCodexRejectedAccessError(normalized)) {
1551
1535
  const slot = this.config.codexSlot;
1552
1536
  const guidance = slot === undefined ? "Codex authentication failed — check OPENAI_API_KEY or ChatGPT login." : `Codex pool slot ${slot} authentication failed — re-run agent-swarm codex-login --slot ${slot}.`;
1553
1537
  return {
@@ -9,7 +9,7 @@ import {
9
9
  acquireOAuthRefreshLock,
10
10
  releaseOAuthRefreshLock,
11
11
  init_oauth
12
- } from "./cli-1s1dqn1j.js";
12
+ } from "./cli-1ayk1eas.js";
13
13
  import {
14
14
  generateRandomCodeVerifier,
15
15
  generateRandomState,
@@ -20,7 +20,7 @@ import {
20
20
  scrubSecrets,
21
21
  registerVolatileSecret,
22
22
  init_secret_scrubber
23
- } from "./cli-a4btqqft.js";
23
+ } from "./cli-1b7btd38.js";
24
24
  import {
25
25
  __esm
26
26
  } from "./cli-242037k3.js";
@@ -1774,6 +1774,12 @@ var init_types4 = __esm(() => {
1774
1774
  smart: "grok-4.6",
1775
1775
  ultra: "grok-4.7"
1776
1776
  },
1777
+ fx: {
1778
+ smol: "openrouter/deepseek/deepseek-v4.1-flash",
1779
+ regular: "openrouter/deepseek/deepseek-v4.1-flash",
1780
+ smart: "openrouter/deepseek/deepseek-v4-pro-0813",
1781
+ ultra: "openrouter/anthropic/claude-opus-5.5"
1782
+ },
1777
1783
  acp: {
1778
1784
  smol: "",
1779
1785
  regular: "",
@@ -1856,7 +1862,8 @@ var init_types4 = __esm(() => {
1856
1862
  "dsh",
1857
1863
  "amp",
1858
1864
  "cursor",
1859
- "grok"
1865
+ "grok",
1866
+ "fx"
1860
1867
  ]);
1861
1868
  ModelProfileNameSchema = string2().trim().regex(/^[a-z0-9][a-z0-9._-]{0,99}$/, "lowercase letters, digits, '.', '_' or '-', max 100");
1862
1869
  ModelProfileSchema = object2({
@@ -1929,7 +1936,8 @@ var init_types4 = __esm(() => {
1929
1936
  dsh: [],
1930
1937
  amp: ["queue"],
1931
1938
  cursor: ["steer", "queue"],
1932
- grok: []
1939
+ grok: [],
1940
+ fx: ["steer"]
1933
1941
  };
1934
1942
  FollowUpConfigSchema = object2({
1935
1943
  disabled: boolean().optional(),
@@ -2976,7 +2984,8 @@ var init_types4 = __esm(() => {
2976
2984
  CooldownConfigSchema = object2({
2977
2985
  hours: number2().min(0).optional(),
2978
2986
  minutes: number2().min(0).optional(),
2979
- seconds: number2().min(0).optional()
2987
+ seconds: number2().min(0).optional(),
2988
+ from: _enum2(["finish", "start"]).optional()
2980
2989
  }).refine((v) => v.hours !== undefined || v.minutes !== undefined || v.seconds !== undefined, {
2981
2990
  message: "At least one of hours, minutes, or seconds is required"
2982
2991
  });
@@ -3647,7 +3656,8 @@ var init_types4 = __esm(() => {
3647
3656
  "dsh",
3648
3657
  "amp",
3649
3658
  "cursor",
3650
- "grok"
3659
+ "grok",
3660
+ "fx"
3651
3661
  ]);
3652
3662
  PricingTokenClassSchema = _enum2([
3653
3663
  "input",
@@ -2,16 +2,16 @@ import {
2
2
  contextStatePath,
3
3
  contextBoundNoteMarkerPath,
4
4
  recordContextState
5
- } from "./cli-h55y2bjc.js";
5
+ } from "./cli-dhar9qay.js";
6
6
  import {
7
7
  runStopHookSessionSummarySubprocess
8
- } from "./cli-wndv9p7g.js";
8
+ } from "./cli-0731hvbw.js";
9
9
  import {
10
10
  redactRateLimitEventLine,
11
11
  SessionErrorTracker,
12
12
  trackErrorFromJson,
13
13
  parseStderrForErrors
14
- } from "./cli-bwty35gx.js";
14
+ } from "./cli-mthwvjre.js";
15
15
  import {
16
16
  resolveSlashSkillPrompt
17
17
  } from "./cli-jc1g9ndz.js";
@@ -24,7 +24,7 @@ import {
24
24
  } from "./cli-98rwmcyc.js";
25
25
  import {
26
26
  applyReasoningEffort
27
- } from "./cli-vqgnyh76.js";
27
+ } from "./cli-98rw5dt5.js";
28
28
  import {
29
29
  fetchInstalledMcpServers
30
30
  } from "./cli-bst1vp7e.js";
@@ -34,7 +34,7 @@ import {
34
34
  computeContextUsedUnified,
35
35
  clampContextPercent,
36
36
  init_context_window
37
- } from "./cli-rtk9g7av.js";
37
+ } from "./cli-73jzwksr.js";
38
38
  import {
39
39
  resolveClaudeTransport,
40
40
  isClaudeBridgeEffective
@@ -55,7 +55,7 @@ import {
55
55
  import {
56
56
  withFileLock,
57
57
  init_file_lock
58
- } from "./cli-ycm6180s.js";
58
+ } from "./cli-a7v854rf.js";
59
59
  import {
60
60
  getOpenRouterAttributionHeaders,
61
61
  init_openrouter_base_url
@@ -68,7 +68,7 @@ import {
68
68
  CLAUDE_CREDENTIALS_HINT,
69
69
  validateClaudeCredentials,
70
70
  init_credentials2
71
- } from "./cli-aq58fk5m.js";
71
+ } from "./cli-g83s9ewh.js";
72
72
  import {
73
73
  isEnvFlagEnabled,
74
74
  init_env_flag
@@ -76,7 +76,7 @@ import {
76
76
  import {
77
77
  scrubSecrets,
78
78
  init_secret_scrubber
79
- } from "./cli-a4btqqft.js";
79
+ } from "./cli-1b7btd38.js";
80
80
  import {
81
81
  __toESM
82
82
  } from "./cli-242037k3.js";
@@ -1263,7 +1263,7 @@ class ClaudeAdapter2 {
1263
1263
  if (transport === "sdk" && isClaudeBridgeEffective(sourceEnv)) {
1264
1264
  throw new Error("CLAUDE_TRANSPORT=sdk cannot run with an effective Claude Bridge configuration. Select CLI transport or disable the bridge.");
1265
1265
  }
1266
- const claudeSdk = transport === "sdk" ? await import("./claude-sdk-session-vj0c2azx.js") : undefined;
1266
+ const claudeSdk = transport === "sdk" ? await import("./claude-sdk-session-q6wj5hmy.js") : undefined;
1267
1267
  claudeSdk?.validateClaudeSdkAdditionalArgs([
1268
1268
  ...claudeBinaryArgv.slice(1),
1269
1269
  ...config.additionalArgs ?? []
@@ -4,7 +4,7 @@ import {
4
4
  invalidateTelemetryUserRole,
5
5
  init_telemetry_identity,
6
6
  init_db4
7
- } from "./cli-1s1dqn1j.js";
7
+ } from "./cli-1ayk1eas.js";
8
8
  import {
9
9
  PermissionVerbSchema,
10
10
  init_rbac
@@ -2,15 +2,17 @@ import {
2
2
  runtimeCatalogSection,
3
3
  runtimeCatalogModel,
4
4
  init_runtime_model_catalog
5
- } from "./cli-a2jw6ee5.js";
5
+ } from "./cli-1p89xny0.js";
6
6
  import {
7
+ CHATGPT_SUBSCRIPTION_PROVIDER,
7
8
  dshCatalogRef,
8
9
  grokCatalogRef,
10
+ fxCatalogRef,
9
11
  cursorCatalogRef,
10
12
  reasoningLevelsFor,
11
13
  claudeCatalogModelId,
12
14
  init_src2
13
- } from "./cli-4r12t6w6.js";
15
+ } from "./cli-5c4hjzne.js";
14
16
 
15
17
  // src/providers/reasoning-effort.ts
16
18
  init_src2();
@@ -38,10 +40,17 @@ function lookupModel(harness, model) {
38
40
  ({ providerId, modelId } = cursorCatalogRef(model));
39
41
  } else if (harness === "grok") {
40
42
  ({ providerId, modelId } = grokCatalogRef(model));
43
+ } else if (harness === "fx") {
44
+ const ref = fxCatalogRef(model);
45
+ if (!ref)
46
+ return;
47
+ ({ providerId, modelId } = ref);
41
48
  } else {
42
49
  ({ providerId, modelId } = splitProviderModel(model));
43
50
  if (!providerId)
44
51
  return;
52
+ if (providerId.toLowerCase() === CHATGPT_SUBSCRIPTION_PROVIDER)
53
+ providerId = "openai";
45
54
  }
46
55
  const facts = runtimeCatalogModel(providerId, modelId);
47
56
  return facts ? { id: modelId, facts } : undefined;
@@ -124,6 +133,8 @@ function applyReasoningEffort(harness, model, level) {
124
133
  return { kind: "cursor-effort", reasoningEffort: level };
125
134
  case "grok":
126
135
  return { kind: "grok-effort", reasoningEffort: level };
136
+ case "fx":
137
+ return { kind: "fx-effort", reasoningEffort: level };
127
138
  default: {
128
139
  const _exhaustive = harness;
129
140
  return _exhaustive;
@@ -138,7 +149,8 @@ var REASONING_HARNESSES = new Set([
138
149
  "dsh",
139
150
  "cursor",
140
151
  "amp",
141
- "grok"
152
+ "grok",
153
+ "fx"
142
154
  ]);
143
155
  function supportedReasoningLevels(harness, model) {
144
156
  if (!REASONING_HARNESSES.has(harness))
@@ -2,7 +2,7 @@ import {
2
2
  openAICompatibleKeyVars,
3
3
  openAICompatibleBaseUrlVars,
4
4
  init_src2
5
- } from "./cli-4r12t6w6.js";
5
+ } from "./cli-5c4hjzne.js";
6
6
 
7
7
  // src/providers/acp-target-catalog.ts
8
8
  init_src2();
@@ -19,7 +19,7 @@ import {
19
19
  init_models,
20
20
  resolveCredential,
21
21
  init_credentials
22
- } from "./cli-wk9md5px.js";
22
+ } from "./cli-qxnf8z2z.js";
23
23
  import {
24
24
  DEFAULT_OPENROUTER_BASE_URL,
25
25
  getOpenRouterBaseUrl,
@@ -29,7 +29,7 @@ import {
29
29
  import {
30
30
  selectCredential,
31
31
  init_credentials2
32
- } from "./cli-aq58fk5m.js";
32
+ } from "./cli-g83s9ewh.js";
33
33
  import {
34
34
  init_zod
35
35
  } from "./cli-k5671be5.js";
@@ -39,7 +39,7 @@ import {
39
39
  import {
40
40
  scrubSecrets,
41
41
  init_secret_scrubber
42
- } from "./cli-a4btqqft.js";
42
+ } from "./cli-1b7btd38.js";
43
43
 
44
44
  // src/utils/internal-ai/complete-structured.ts
45
45
  init_compat();
@@ -8,12 +8,12 @@ import {
8
8
  } from "./cli-4sydckyj.js";
9
9
  import {
10
10
  init_templates4
11
- } from "./cli-v726afdm.js";
11
+ } from "./cli-2pnswgh8.js";
12
12
  import {
13
13
  resolveTemplateAsync,
14
14
  init_resolver,
15
15
  init_session_templates
16
- } from "./cli-j4kw3rsx.js";
16
+ } from "./cli-cm5yqn35.js";
17
17
  import {
18
18
  MAX_PROFILE_FILE_LENGTH,
19
19
  getAppUrl,
@@ -26,7 +26,7 @@ import {
26
26
  import {
27
27
  scrubSecrets,
28
28
  init_secret_scrubber
29
- } from "./cli-a4btqqft.js";
29
+ } from "./cli-1b7btd38.js";
30
30
  import {
31
31
  __esm
32
32
  } from "./cli-242037k3.js";
@@ -262,6 +262,8 @@ function toolDiscoveryEvent(provider, hasToolSearch) {
262
262
  switch (provider) {
263
263
  case "amp":
264
264
  return "system.agent.tool_discovery.amp";
265
+ case "fx":
266
+ return "system.agent.tool_discovery.fx";
265
267
  case "codex":
266
268
  return "system.agent.tool_discovery.codex";
267
269
  case "opencode":
@@ -6,12 +6,12 @@ import {
6
6
  isSensitiveKey,
7
7
  scrubSecrets,
8
8
  init_secret_scrubber
9
- } from "./cli-a4btqqft.js";
9
+ } from "./cli-1b7btd38.js";
10
10
  import {
11
11
  openAICompatibleKeyVars,
12
12
  openAICompatibleBaseUrlVars,
13
13
  init_src2
14
- } from "./cli-4r12t6w6.js";
14
+ } from "./cli-5c4hjzne.js";
15
15
  import {
16
16
  __esm
17
17
  } from "./cli-242037k3.js";
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  contextBoundNoteThreshold,
3
3
  createContextBoundNote
4
- } from "./cli-h55y2bjc.js";
4
+ } from "./cli-dhar9qay.js";
5
5
  import {
6
6
  resolveSlashSkillPrompt
7
7
  } from "./cli-jc1g9ndz.js";
8
8
  import {
9
9
  applyReasoningEffort
10
- } from "./cli-vqgnyh76.js";
10
+ } from "./cli-98rw5dt5.js";
11
11
  import {
12
12
  CONTEXT_FORMULA,
13
13
  computeContextUsedUnified,
14
14
  clampContextPercent,
15
15
  init_context_window
16
- } from "./cli-rtk9g7av.js";
16
+ } from "./cli-73jzwksr.js";
17
17
  import {
18
18
  ampBillsCacheWrites,
19
19
  resolveAmpModel,
20
20
  init_amp_models
21
- } from "./cli-zn15c46z.js";
21
+ } from "./cli-mjzynrse.js";
22
22
  import {
23
23
  detachedProcessGroup,
24
24
  registerProcessGroup,
@@ -36,7 +36,7 @@ import {
36
36
  scrubSecrets,
37
37
  registerVolatileSecret,
38
38
  init_secret_scrubber
39
- } from "./cli-a4btqqft.js";
39
+ } from "./cli-1b7btd38.js";
40
40
 
41
41
  // src/providers/amp-adapter.ts
42
42
  import { existsSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
@@ -48,7 +48,7 @@ init_context_window();
48
48
  init_multi_runtime2();
49
49
  init_process_group();
50
50
  init_secret_scrubber();
51
- var AMP_PACKAGE = "@ampcode/cli@0.0.1793246451-g9e5ffe";
51
+ var AMP_PACKAGE = "@ampcode/cli@0.0.1793275344-g17bf52";
52
52
  var AMP_MCP_SERVER_NAME = "agent-swarm";
53
53
  var AMP_PLUGIN_MODE_KEY = "agent-swarm";
54
54
  var AMP_LIVE_TEST_TIMEOUT_MS = 5000;
@@ -5,12 +5,12 @@ import {
5
5
  validateRuntimeTokenTtlHours,
6
6
  init_swarm_config_guard,
7
7
  init_db4
8
- } from "./cli-1s1dqn1j.js";
8
+ } from "./cli-1ayk1eas.js";
9
9
  import {
10
10
  registerVolatileSecret,
11
11
  unregisterVolatileSecret,
12
12
  init_secret_scrubber
13
- } from "./cli-a4btqqft.js";
13
+ } from "./cli-1b7btd38.js";
14
14
  import {
15
15
  __esm
16
16
  } from "./cli-242037k3.js";
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  reasoningCapability,
6
6
  applyReasoningEffort
7
- } from "./cli-vqgnyh76.js";
7
+ } from "./cli-98rw5dt5.js";
8
8
  import {
9
9
  CONTEXT_FORMULA,
10
10
  getContextWindowSize,
11
11
  clampContextPercent,
12
12
  init_context_window
13
- } from "./cli-rtk9g7av.js";
13
+ } from "./cli-73jzwksr.js";
14
14
  import {
15
15
  detachedProcessGroup,
16
16
  registerProcessGroup,
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  DEFAULT_MODEL_TIER_MAP,
26
26
  init_types4
27
- } from "./cli-41z8xwj0.js";
27
+ } from "./cli-7wspm5gm.js";
28
28
  import {
29
29
  getOpenRouterBaseUrl,
30
30
  getOpenRouterAttributionHeaders,
@@ -34,7 +34,7 @@ import {
34
34
  scrubSecrets,
35
35
  registerVolatileSecret,
36
36
  init_secret_scrubber
37
- } from "./cli-a4btqqft.js";
37
+ } from "./cli-1b7btd38.js";
38
38
 
39
39
  // src/providers/dsh-adapter.ts
40
40
  init_types4();
@@ -451,6 +451,7 @@ The engine posts the thread tree and the outcome card. You post at most one mess
451
451
  The outcome card publishes your \`output\` verbatim. Keep free-text \`output\` under 120 words by default, with the exceptions in How you write.
452
452
  A Slack task from an unknown user: register them with \`manage-user\` first.
453
453
  You MUST use the \`slack-interaction\` skill before you post to Slack.
454
+ Call \`slack-leave-thread\` with your taskId when a thread no longer needs you: people are talking among themselves, someone tells you to stop or back off, or the thread's work is done. The swarm then ignores the thread until someone @mentions it. Leave quietly, with no goodbye message.
454
455
  `,
455
456
  variables: [],
456
457
  category: "system"
@@ -512,6 +513,15 @@ Task: {{task}}{{progressLine}}
512
513
  ],
513
514
  category: "system"
514
515
  });
516
+ registerTemplate({
517
+ eventType: "system.agent.fx.system_prompt_file",
518
+ header: "",
519
+ defaultBody: "These instructions are cut short. Read {{path}} before you start: it holds the complete swarm instructions, of which the text above is only the first part.",
520
+ variables: [
521
+ { name: "path", description: "Absolute path of the file with the full system prompt" }
522
+ ],
523
+ category: "system"
524
+ });
515
525
  registerTemplate({
516
526
  eventType: "system.agent.cursor.first_message",
517
527
  header: "",
@@ -547,6 +557,13 @@ Task: {{task}}{{progressLine}}
547
557
  variables: [],
548
558
  category: "system"
549
559
  });
560
+ registerTemplate({
561
+ eventType: "system.agent.tool_discovery.fx",
562
+ header: "",
563
+ defaultBody: "Most swarm tools are deferred behind `capability_search`. Each one is named `mcp_swarm_<tool>`, so `store-progress` is `mcp_swarm_store-progress`. Call a tool you know by that name directly. To find one, use `capability_search`.",
564
+ variables: [],
565
+ category: "system"
566
+ });
550
567
  registerTemplate({
551
568
  eventType: "system.agent.tool_discovery.codex",
552
569
  header: "",
@@ -657,6 +674,7 @@ Rules of the road:
657
674
  ## Slack (scripts-only)
658
675
 
659
676
  This task originated from Slack (channel: \`{{slackChannelId}}\`). The engine maintains the thread tree and publishes the top-level outcome card. Post at most one distinct agent-authored message per task, concrete, sized to what the user asked for. Progress, start, completion, failure, acknowledgment messages, and relayed raw task output stay out of Slack. Named Slack tools are not exposed in scripts-only mode, so use \`script-run\` with inline source calling \`ctx.swarm.slack_reply({ taskId, message })\` (your taskId carries the thread context).
677
+ When the thread no longer needs you (people are talking among themselves, someone tells you to stop, or the work is done), call \`ctx.swarm.slack_leaveThread({ taskId })\` the same way. The swarm then ignores the thread until someone @mentions it. Leave quietly, with no goodbye message.
660
678
  The outcome card publishes your \`output\` verbatim. Keep free-text \`output\` under 120 words by default, with the exceptions in How you write.
661
679
  `,
662
680
  variables: [
@@ -2,13 +2,13 @@ import {
2
2
  getKnownContextWindowSize,
3
3
  clampContextPercent,
4
4
  init_context_window
5
- } from "./cli-rtk9g7av.js";
5
+ } from "./cli-73jzwksr.js";
6
6
  import {
7
7
  resolveTemplateFromCode,
8
8
  resolveTemplateAsync,
9
9
  init_resolver,
10
10
  init_session_templates
11
- } from "./cli-j4kw3rsx.js";
11
+ } from "./cli-cm5yqn35.js";
12
12
 
13
13
  // src/hooks/context-bound-note.ts
14
14
  import { renameSync, writeFileSync } from "node:fs";
@@ -8,12 +8,12 @@ import {
8
8
  resolveConfigValueOrThrow,
9
9
  resolveHeadersOrThrow,
10
10
  FileAuthStorageBackend
11
- } from "./cli-edmm9d9y.js";
11
+ } from "./cli-vqypxzh4.js";
12
12
  import {
13
13
  oauthSuccessHtml,
14
14
  oauthErrorHtml,
15
15
  init_oauth_page
16
- } from "./cli-wk9md5px.js";
16
+ } from "./cli-qxnf8z2z.js";
17
17
  import {
18
18
  __toESM
19
19
  } from "./cli-242037k3.js";
@@ -2,7 +2,7 @@ import {
2
2
  resolveTemplateAsync,
3
3
  init_resolver,
4
4
  init_session_templates
5
- } from "./cli-j4kw3rsx.js";
5
+ } from "./cli-cm5yqn35.js";
6
6
 
7
7
  // src/prompts/steering-delivery.ts
8
8
  init_session_templates();
@@ -0,0 +1,47 @@
1
+ import {
2
+ __esm
3
+ } from "./cli-242037k3.js";
4
+
5
+ // src/utils/codex-auth-failure.ts
6
+ function isCodexAuthFailureReason(failureReason) {
7
+ if (!failureReason || !failureReason.includes("[auth-error]"))
8
+ return false;
9
+ const lower = failureReason.toLowerCase();
10
+ return !TRANSIENT_AUTH_ERROR_MARKERS.some((m) => lower.includes(m));
11
+ }
12
+ function isCodexRejectedAccessError(text) {
13
+ const lower = text.toLowerCase();
14
+ return REJECTED_ACCESS_PATTERNS.some((p) => lower.includes(p));
15
+ }
16
+ var CODEX_AUTH_FAILURE_BENCH_THRESHOLD = 2, CODEX_AUTH_FAILURE_BENCH_MS, CODEX_AUTH_WATCH_NAMESPACE = "codex-auth-watch", codexAuthBenchMarkerKey = (keySuffix) => `bench:${keySuffix}`, TRANSIENT_AUTH_ERROR_MARKERS, REJECTED_ACCESS_PATTERNS;
17
+ var init_codex_auth_failure = __esm(() => {
18
+ CODEX_AUTH_FAILURE_BENCH_MS = 365 * 24 * 60 * 60 * 1000;
19
+ TRANSIENT_AUTH_ERROR_MARKERS = [
20
+ "waiting for the refresh lock",
21
+ "refresh rejected (429",
22
+ "refresh rejected (5",
23
+ "refresh rejected (unknown status",
24
+ "out of credits",
25
+ "no credentials found in config store",
26
+ "not a confirmed auth rejection"
27
+ ];
28
+ REJECTED_ACCESS_PATTERNS = [
29
+ "unauthorized",
30
+ "http 401",
31
+ " 401 ",
32
+ "invalid api key",
33
+ "invalid_api_key",
34
+ "missing api key",
35
+ "no api key",
36
+ "authentication failed",
37
+ "failed to refresh token",
38
+ "invalid 'refresh_token'",
39
+ "token_invalidated",
40
+ "authentication token has been invalidated",
41
+ "authentication token is expired",
42
+ "refresh token was revoked",
43
+ "could not parse your authentication token"
44
+ ];
45
+ });
46
+
47
+ export { CODEX_AUTH_FAILURE_BENCH_THRESHOLD, CODEX_AUTH_FAILURE_BENCH_MS, CODEX_AUTH_WATCH_NAMESPACE, codexAuthBenchMarkerKey, isCodexAuthFailureReason, isCodexRejectedAccessError, init_codex_auth_failure };