@desplega.ai/agent-swarm 2.7.4 → 2.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/acp-adapter-bp91d37f.js +15 -0
- package/dist/{actions-gfrr9vb7.js → actions-yj0eeaqh.js} +19 -18
- package/dist/{amp-adapter-0s58gm46.js → amp-adapter-4pg9h34q.js} +3 -3
- package/dist/{app-stvq692g.js → app-909e97cr.js} +3 -3
- package/dist/{assistant-5s37fr9n.js → assistant-qdyb5fyy.js} +32 -23
- package/dist/{boot-reembed-yzy1841n.js → boot-reembed-fk0s9z18.js} +1 -1
- package/dist/{boot-reembed-cv82gz7y.js → boot-reembed-gs1rzrnh.js} +1 -1
- package/dist/{boot-scrub-sweep-8k4q95ap.js → boot-scrub-sweep-4qfd4kfx.js} +4 -4
- package/dist/{boot-seeds-ftt9htah.js → boot-seeds-yr00k13d.js} +4 -4
- package/dist/{boxd-515v1t8z.js → boxd-vdmfssd9.js} +5 -5
- package/dist/{claude-adapter-t00wrzeh.js → claude-adapter-qta1f1xn.js} +7 -7
- package/dist/{claude-managed-adapter-g6vmjccb.js → claude-managed-adapter-dvs2xw5n.js} +2 -2
- package/dist/{claude-managed-setup-afpa82f7.js → claude-managed-setup-sc6j4dm0.js} +3 -3
- package/dist/{claude-sdk-session-vj0c2azx.js → claude-sdk-session-zgrz6yvc.js} +9175 -9076
- package/dist/{cli-gjr2y2xk.js → cli-0agcv1v5.js} +4 -1
- package/dist/{cli-edmm9d9y.js → cli-0at8w34w.js} +7 -7
- package/dist/{cli-a81qevyg.js → cli-0qatpy8q.js} +20 -36
- package/dist/{cli-bcz074zx.js → cli-0yv5z2pg.js} +1 -1
- package/dist/{cli-a4btqqft.js → cli-1b7btd38.js} +1 -1
- package/dist/{cli-a2jw6ee5.js → cli-1p89xny0.js} +1 -1
- package/dist/{cli-v726afdm.js → cli-2pnswgh8.js} +1 -1
- package/dist/{cli-jkt52mgt.js → cli-386tyxxg.js} +2 -2
- package/dist/{cli-az0bpf8p.js → cli-3ypk9vk1.js} +3 -3
- package/dist/{cli-wk9md5px.js → cli-436532ck.js} +4 -4
- package/dist/{cli-7n5sbw0z.js → cli-4necwtsv.js} +5 -5
- package/dist/cli-54t00gt8.js +151 -0
- package/dist/{cli-655xm9ms.js → cli-583frbyr.js} +1 -1
- package/dist/{cli-4r12t6w6.js → cli-5c4hjzne.js} +101 -4
- package/dist/{cli-hf6zt5m6.js → cli-69szn7w7.js} +17 -1
- package/dist/{cli-rtk9g7av.js → cli-73jzwksr.js} +6 -2
- package/dist/{cli-jg0nfda6.js → cli-75gkpjvw.js} +52 -21
- package/dist/{cli-wcmnan2g.js → cli-89knwags.js} +5 -5
- package/dist/{cli-pwyevs29.js → cli-8bc1w0tw.js} +22 -21
- package/dist/{cli-t282jgab.js → cli-8snvgs5r.js} +41 -16
- package/dist/{cli-vqgnyh76.js → cli-98rw5dt5.js} +15 -3
- package/dist/{cli-9cctx1tn.js → cli-a22h291q.js} +1 -1
- package/dist/{cli-ycm6180s.js → cli-a7v854rf.js} +5 -3
- package/dist/{cli-98pke4vk.js → cli-ae7mrdf9.js} +2 -2
- package/dist/{cli-je8yeyc5.js → cli-bjb3z51z.js} +5 -5
- package/dist/{cli-mc97xy2s.js → cli-c60vetmm.js} +16 -4
- package/dist/{cli-j4kw3rsx.js → cli-cm5yqn35.js} +18 -0
- package/dist/{cli-wndv9p7g.js → cli-decfb6v8.js} +6 -6
- package/dist/{cli-h55y2bjc.js → cli-dhar9qay.js} +2 -2
- package/dist/{cli-8yy525ad.js → cli-drr5v6av.js} +2 -2
- package/dist/{cli-5gr1g711.js → cli-dxae2yg7.js} +2 -2
- package/dist/{cli-pe09p6dv.js → cli-e3r2neck.js} +8 -7
- package/dist/{cli-13jvmew3.js → cli-ekwks2vs.js} +7 -7
- package/dist/{cli-jg4p5t36.js → cli-es6va8jk.js} +121 -51
- package/dist/{cli-j4kt1mpb.js → cli-faxe6thg.js} +3 -3
- package/dist/{cli-tzrpv5sc.js → cli-ftyxyspd.js} +1 -1
- package/dist/cli-fw2w0kva.js +47 -0
- package/dist/{cli-2dfbv8qr.js → cli-fy6x31ps.js} +1 -0
- package/dist/{cli-aq58fk5m.js → cli-g83s9ewh.js} +7 -1
- package/dist/cli-gdhpcbhf.js +55 -0
- package/dist/{cli-82jg7fp9.js → cli-he5nxaa8.js} +1 -1
- package/dist/{cli-8veytvbh.js → cli-he9wchme.js} +1 -1
- package/dist/{cli-k76tgq03.js → cli-hgaazk69.js} +2 -2
- package/dist/{cli-d2pzqej1.js → cli-hr2e2fft.js} +741 -7
- package/dist/{cli-dae4sbgy.js → cli-jm2vfpfd.js} +2 -2
- package/dist/{cli-1s1dqn1j.js → cli-k2gzwsj2.js} +297 -140
- package/dist/{cli-b1afgtj3.js → cli-kqdg1bsb.js} +3 -3
- package/dist/cli-m2z8jagn.js +12078 -0
- package/dist/{cli-mvckssyq.js → cli-m48g6p95.js} +5 -5
- package/dist/{cli-bwty35gx.js → cli-mthwvjre.js} +1 -1
- package/dist/{cli-41z8xwj0.js → cli-nhrvpaj7.js} +34 -8
- package/dist/{cli-ahd90bwt.js → cli-nwj0ee2w.js} +6 -6
- package/dist/{cli-kvtc7aez.js → cli-p5gp8pcx.js} +44 -14
- package/dist/{cli-avgcz4ra.js → cli-pd7vagab.js} +436 -171
- package/dist/{cli-zn15c46z.js → cli-q0k1w5zd.js} +1 -1
- package/dist/{cli-bq2pcphn.js → cli-rmmmrjkd.js} +1 -1
- package/dist/{cli-2qpvmmkw.js → cli-s0qnd4wv.js} +1 -1
- package/dist/{cli-kg8hchyg.js → cli-sa02jsqt.js} +1 -1
- package/dist/{cli-1yekbyqm.js → cli-shpbx5ee.js} +283 -82
- package/dist/{cli-9y354g3j.js → cli-srye3vdt.js} +1 -1
- package/dist/{cli-byqfbnjw.js → cli-svj5090z.js} +9 -9
- package/dist/{cli-gcbdjt47.js → cli-vfym7wmz.js} +6 -6
- package/dist/{cli-v1yw3wha.js → cli-vvpx3gsx.js} +4 -4
- package/dist/{cli-a1fhj4n9.js → cli-w6dt9ged.js} +2 -2
- package/dist/{cli-1gm8jcyr.js → cli-waqbxg08.js} +5232 -68
- package/dist/{cli-5hjced2v.js → cli-wp9sp1qb.js} +6 -6
- package/dist/{cli-eny54typ.js → cli-wx3rhnm0.js} +1 -1
- package/dist/{cli-s0exq74r.js → cli-xbbndvjy.js} +3 -3
- package/dist/{cli-f255yaqn.js → cli-xds5f77d.js} +3 -3
- package/dist/{cli-0sbkss7h.js → cli-xnqgpshy.js} +2 -2
- package/dist/{cli-0fgr1w9b.js → cli-xnrwazav.js} +20 -3
- package/dist/{cli-gf5hbmdr.js → cli-yjdgea32.js} +3 -3
- package/dist/{cli-cq1pf336.js → cli-yn4kxs06.js} +124 -11
- package/dist/{cli-224epwwf.js → cli-yx4kfngt.js} +3 -3
- package/dist/{cli-eqx6k993.js → cli-yy3rhsdw.js} +47 -13
- package/dist/{cli-36g23z21.js → cli-zbbwez0r.js} +4 -4
- package/dist/{cli-ktmvb20s.js → cli-zm72anhg.js} +12 -12
- package/dist/cli.js +26 -25
- package/dist/{codex-adapter-g0gctw29.js → codex-adapter-ayd1fb6h.js} +5 -5
- package/dist/{codex-hook-vrzz2xhr.js → codex-hook-9efm2x1m.js} +1 -1
- package/dist/{codex-login-0gg46ygn.js → codex-login-y0pmff1c.js} +1 -1
- package/dist/{codex-session-runner-dr2cxe1c.js → codex-session-runner-jesa32xc.js} +6 -6
- package/dist/{commands-1p07cvff.js → commands-hanewgf2.js} +9 -3
- package/dist/{controller-z0s7sv6r.js → controller-dt1n3c1q.js} +9 -4
- package/dist/{controllers-connect-x9kvvhyk.js → controllers-connect-xx8x64n5.js} +22 -21
- package/dist/{cursor-adapter-m5b98pvk.js → cursor-adapter-9s4dwwdw.js} +2 -2
- package/dist/{db-capk2raj.js → db-3vttcbv4.js} +3 -3
- package/dist/{db-rsh04kh3.js → db-9dv0g1ab.js} +12 -4
- package/dist/{devin-adapter-yxm87fe9.js → devin-adapter-r9phbnc9.js} +1 -1
- package/dist/{devtools-82fzqra8.js → devtools-qxfgbsqz.js} +1 -1
- package/dist/{dispatcher-304q6fwa.js → dispatcher-tx9hd1sv.js} +18 -17
- package/dist/{docker-7rxt0rry.js → docker-c1a3gqmf.js} +91 -24
- package/dist/{dsh-adapter-btewem0y.js → dsh-adapter-007y4ejs.js} +2 -2
- package/dist/{e2b-renc0k8q.js → e2b-a19d28rz.js} +4 -4
- package/dist/{e2b-7fc9b9bd.js → e2b-we6hs6q5.js} +6 -6
- package/dist/{easter-egg-3d-fm1p3n4d.js → easter-egg-3d-rgbrqb8s.js} +1 -1
- package/dist/{embedding-space-s68v49ct.js → embedding-space-ny1e2940.js} +6 -6
- package/dist/{embeddings-4ms3604w.js → embeddings-2t386t13.js} +1 -1
- package/dist/{event-bus-dfjx2qdh.js → event-bus-g0ka3pbw.js} +1 -1
- package/dist/{execute-mcdgccjs.js → execute-pksh0ceh.js} +1 -1
- package/dist/{external-channel-9dxwfztn.js → external-channel-phgmhmd7.js} +2 -2
- package/dist/fx-adapter-fy8rr921.js +18 -0
- package/dist/{google-generative-ai-yvmdxyxa.js → google-generative-ai-8y3m3k4b.js} +1 -1
- package/dist/{google-vertex-jrtdh9gs.js → google-vertex-w3v98n7b.js} +1 -1
- package/dist/{grok-adapter-05ecv4h0.js → grok-adapter-q0abvpaj.js} +8 -8
- package/dist/handlers-by3sfxyx.js +32 -0
- package/dist/{heartbeat-3n94heh3.js → heartbeat-kadyek8p.js} +21 -20
- package/dist/{hook-aadrn69x.js → hook-5zs3msf6.js} +6 -6
- package/dist/{hook-zxwje86c.js → hook-9k551xnj.js} +4 -4
- package/dist/{http-xzxk9mst.js → http-mhz9vw1f.js} +272 -103
- package/dist/index-4f2pvxae.js +37 -0
- package/dist/index-98gz7tmp.js +30 -0
- package/dist/{index-5rk6rfzr.js → index-fvzke5kx.js} +1 -1
- package/dist/index-k08z2cak.js +33 -0
- package/dist/{index-yqhz88yy.js → index-pxn30mse.js} +8 -8
- package/dist/{index-d34f6r87.js → index-q361cg2f.js} +1 -1
- package/dist/{index-9j4zwcht.js → index-rvr00sg7.js} +168 -675
- package/dist/{index-qeb82z37.js → index-vdygbq10.js} +1 -1
- package/dist/{keepalive-w4aakbyk.js → keepalive-w56f32cg.js} +4 -4
- package/dist/lead-enq35nqp.js +70 -0
- package/dist/{maintenance-hbptpk6p.js → maintenance-7mdgxcea.js} +1 -1
- package/dist/{oauth-refresh-sweep-217semrv.js → oauth-refresh-sweep-29txy9vk.js} +3 -3
- package/dist/{onboard-vz2s5df3.js → onboard-kpsrkarj.js} +5 -5
- package/dist/{opencode-adapter-gtfd7d7v.js → opencode-adapter-j25vm3rr.js} +5 -5
- package/dist/{otel-impl-aefave37.js → otel-impl-6kkct7a8.js} +2 -2
- package/dist/{pi-mono-adapter-f8h5yseh.js → pi-mono-adapter-exhkzhn2.js} +117 -23
- package/dist/{pricing-refresh-m1yhh9ya.js → pricing-refresh-n2x7jh6k.js} +3 -3
- package/dist/{rbac-roles-rrw8twdz.js → rbac-roles-81ypx6es.js} +1 -1
- package/dist/{rbac-roles-svj72cdf.js → rbac-roles-b5htkjby.js} +2 -2
- package/dist/{render-v2-amwbnfxh.js → render-v2-qn6jmpk4.js} +3 -3
- package/dist/{resume-9cd6wf6z.js → resume-wd30wx23.js} +7 -7
- package/dist/{runtime-fp4vrx7m.js → runtime-4hsg7h60.js} +1 -1
- package/dist/{session-access-21t6yjyg.js → session-access-5qvfevhk.js} +4 -4
- package/dist/{session-source-backfill-pxbzcsc6.js → session-source-backfill-n1czavbr.js} +3 -3
- package/dist/{setup-4592tqz4.js → setup-dnb56qy5.js} +3 -3
- package/dist/{virtual-modules-gzfnpmnz.js → virtual-modules-76xxv9fs.js} +2 -2
- package/dist/{work-objects-t9tcf174.js → work-objects-4n21tfkm.js} +21 -20
- package/dist/{worker-follow-up-q32jh4yk.js → worker-follow-up-77hvzxww.js} +18 -17
- package/dist/worker-gg1576j3.js +70 -0
- package/dist/{x-b6wxntdt.js → x-vmmye1kb.js} +2 -2
- package/openapi.json +189 -32
- package/package.json +8 -7
- package/src/be/db/script-runs.ts +23 -0
- package/src/be/db/session-summaries.ts +8 -2
- package/src/be/db/session-tree.ts +174 -61
- package/src/be/db/session-visibility.ts +5 -4
- package/src/be/db/tasks/read.ts +122 -3
- package/src/be/db-client.ts +8 -5
- package/src/be/db.ts +23 -8
- package/src/be/memory/providers/sqlite-store.ts +49 -12
- package/src/be/migrations/259_session_summaries_open_tasks.sql +111 -0
- package/src/be/migrations/260_runtime_pool_cache.sql +20 -0
- package/src/be/migrations/262_session_visibility_indexes.sql +18 -0
- package/src/be/migrations/263_task_list_filter_index.sql +11 -0
- package/src/be/migrations/264_slack_thread_cover_index.sql +9 -0
- package/src/be/migrations/266_script_runs_source_task.sql +11 -0
- package/src/be/model-validation.ts +5 -1
- package/src/be/pricing-normalize.ts +7 -2
- package/src/be/runtime-pools/cache-cleanup.ts +109 -0
- package/src/be/runtime-pools/db.ts +65 -6
- package/src/be/runtime-pools/remote-controller.ts +5 -0
- package/src/be/runtime-pools/supervisor.ts +33 -2
- package/src/be/scripts/typecheck.ts +23 -0
- package/src/be/seed/schedules-seeder.ts +135 -9
- package/src/be/seed/workflows-seeder.ts +65 -1
- package/src/be/seed-pricing.ts +23 -0
- package/src/be/seed-scripts/catalog/task-failure-audit.ts +5 -1
- package/src/be/steering.ts +50 -3
- package/src/be/swarm-config-guard.ts +1 -0
- package/src/commands/controller.ts +4 -0
- package/src/commands/entrypoint-api-readiness.ts +74 -0
- package/src/commands/provider-credentials.ts +29 -2
- package/src/commands/runner.ts +86 -5
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/extensions/contract.ts +27 -1
- package/src/extensions/dispatcher.ts +4 -0
- package/src/http/agents.ts +1 -0
- package/src/http/index.ts +1 -1
- package/src/http/list-total-cache.ts +14 -7
- package/src/http/mcp-bridge.ts +4 -0
- package/src/http/memory.ts +38 -9
- package/src/http/script-runs.ts +174 -5
- package/src/http/status.ts +10 -2
- package/src/http/tasks.ts +4 -2
- package/src/integrations/chat-sdk/inbound.ts +15 -5
- package/src/integrations/chat-sdk/steering.ts +3 -1
- package/src/kv-reserved-namespaces.ts +2 -0
- package/src/prompts/base-prompt.ts +4 -1
- package/src/prompts/session-templates.ts +26 -0
- package/src/providers/acp-adapter.ts +190 -26
- package/src/providers/acp-targets.ts +306 -6
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/codex-adapter.ts +9 -44
- package/src/providers/codex-oauth/flow.ts +24 -3
- package/src/providers/codex-oauth/storage.ts +56 -17
- package/src/providers/codex-oauth/subscription.ts +67 -0
- package/src/providers/fx-adapter.ts +211 -0
- package/src/providers/index.ts +5 -1
- package/src/providers/mcp-loopback-proxy.ts +94 -0
- package/src/providers/pi-mono-adapter.ts +98 -13
- package/src/providers/pricing-sources.md +8 -0
- package/src/providers/reasoning-effort.ts +17 -1
- package/src/providers/types.ts +2 -1
- package/src/runtime-providers/controller-protocol.ts +14 -1
- package/src/runtime-providers/controller.ts +5 -0
- package/src/runtime-providers/docker.ts +108 -23
- package/src/runtime-providers/types.ts +16 -0
- package/src/scheduler/scheduler.ts +36 -3
- package/src/script-workflows/workflow-ctx.ts +8 -0
- package/src/scripts-runtime/sdk-allowlist.ts +1 -0
- package/src/scripts-runtime/types/stdlib.d.ts +27 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +33 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +27 -0
- package/src/server-user.ts +1 -0
- package/src/server.ts +7 -0
- package/src/slack/assistant.ts +17 -1
- package/src/slack/commands.ts +5 -1
- package/src/slack/handlers.ts +53 -5
- package/src/slack/left-threads.ts +88 -0
- package/src/slack/steering.ts +3 -0
- package/src/slack/thread-buffer.ts +40 -16
- package/src/tasks/follow-up-redelegation-guard.ts +155 -0
- package/src/tests/acp-adapter.test.ts +79 -0
- package/src/tests/base-prompt.test.ts +12 -0
- package/src/tests/chat-sdk-inbound.test.ts +30 -0
- package/src/tests/chatgpt-subscription-model-groups.test.ts +62 -0
- package/src/tests/chatgpt-subscription-pi.test.ts +170 -0
- package/src/tests/chatgpt-subscription-session-bench.test.ts +198 -0
- package/src/tests/claude-artifacts-read-script.test.ts +209 -0
- package/src/tests/codex-oauth-credential-info.test.ts +40 -0
- package/src/tests/codex-oauth-refresh-egress.test.ts +194 -0
- package/src/tests/context-window.test.ts +7 -0
- package/src/tests/db-client.test.ts +21 -0
- package/src/tests/db-task-read-contract.test.ts +8 -2
- package/src/tests/db-task-write-contract.test.ts +5 -1
- package/src/tests/entrypoint-api-readiness.test.ts +416 -210
- package/src/tests/explicit-model-validation.test.ts +113 -8
- package/src/tests/extensions-run-context.test.ts +11 -0
- package/src/tests/extensions-steering.test.ts +353 -0
- package/src/tests/extensions-validate.test.ts +5 -0
- package/src/tests/fixtures/extensions/steering-policy/hooks.ts +39 -0
- package/src/tests/fixtures/extensions/steering-policy/manifest.json +7 -0
- package/src/tests/fixtures/fake-fx.ts +167 -0
- package/src/tests/fixtures/fx/acp-responses-recorded.json +157 -0
- package/src/tests/fixtures/fx/acp-updates-recorded.jsonl +15 -0
- package/src/tests/follow-up-redelivery-guard.test.ts +432 -202
- package/src/tests/fx-adapter.test.ts +771 -0
- package/src/tests/grok-adapter.test.ts +36 -0
- package/src/tests/list-total-cache.test.ts +27 -2
- package/src/tests/mcp-loopback-proxy.test.ts +193 -0
- package/src/tests/memory-fts-populate.test.ts +11 -9
- package/src/tests/memory-retrieval-purge.test.ts +80 -0
- package/src/tests/migration-260-runtime-pool-cache.test.ts +118 -0
- package/src/tests/model-tier-resolution.test.ts +3 -3
- package/src/tests/pricing-refresh.test.ts +5 -5
- package/src/tests/prompt-template-session.test.ts +5 -3
- package/src/tests/provider-registration.test.ts +2 -1
- package/src/tests/query-audit-plans.test.ts +30 -2
- package/src/tests/runtime-cache-cleanup.test.ts +367 -0
- package/src/tests/runtime-e2b-pools.test.ts +41 -0
- package/src/tests/runtime-pools-db.test.ts +98 -0
- package/src/tests/runtime-pools-http.test.ts +29 -0
- package/src/tests/runtime-providers-docker.test.ts +253 -0
- package/src/tests/runtime-remote-controller.test.ts +66 -2
- package/src/tests/runtime-supervisor.test.ts +66 -2
- package/src/tests/script-connections.test.ts +13 -0
- package/src/tests/script-runs-http.test.ts +684 -2
- package/src/tests/seed-model-profiles.test.ts +2 -2
- package/src/tests/seed-schedules.test.ts +138 -0
- package/src/tests/seed-scripts.test.ts +26 -0
- package/src/tests/session-cost-recompute-unit.test.ts +39 -0
- package/src/tests/session-costs-golden.test.ts +26 -0
- package/src/tests/session-summaries-plans.test.ts +120 -0
- package/src/tests/session-summaries.test.ts +72 -12
- package/src/tests/sessions-tree.test.ts +11 -3
- package/src/tests/slack-leave-thread.test.ts +571 -0
- package/src/tests/slack-render-v2-query-plans.test.ts +24 -2
- package/src/tests/status.test.ts +11 -0
- package/src/tests/tasks-readable-row.test.ts +155 -0
- package/src/tests/tool-annotations.test.ts +2 -1
- package/src/tests/workflow-engine-v2.test.ts +42 -0
- package/src/tests/workflow-script-principal.test.ts +207 -7
- package/src/tools/send-task.ts +35 -47
- package/src/tools/slack-leave-thread.ts +104 -0
- package/src/tools/steer-task.ts +3 -2
- package/src/tools/task-dedup.ts +45 -21
- package/src/tools/tool-config.ts +2 -1
- package/src/types.ts +57 -0
- package/src/utils/codex-auth-failure.ts +30 -0
- package/src/utils/context-window.ts +4 -1
- package/src/utils/credentials.ts +7 -0
- package/src/utils/fx-models.ts +43 -0
- package/src/workflows/cooldown.ts +3 -2
- package/src/workflows/engine.ts +24 -9
- package/templates/schedules/dreaming-daily/config.json +1 -1
- package/templates/schedules/dreaming-daily/content.md +6 -14
- package/templates/skills/composio-google-docs/content.md +10 -0
- package/templates/skills/script-workflows/content.md +19 -1
- package/templates/skills/swarm-docs/content.md +2 -0
- package/templates/skills/swarm-scripts/SKILL.md +2 -0
- package/templates/skills/swarm-scripts/content.md +2 -0
- package/templates/workflows/dreaming/content.md +5 -1
- package/dist/acp-adapter-96dc64m2.js +0 -15
- package/dist/cli-dznrgaep.js +0 -30
- package/dist/cli-w3hcrxht.js +0 -6985
- package/dist/handlers-jg7v74ty.js +0 -31
- package/dist/index-8c1zbz59.js +0 -29
- package/dist/index-8k8tmfxd.js +0 -32
- package/dist/index-hq617xdj.js +0 -36
- package/dist/lead-567kw7x3.js +0 -68
- package/dist/worker-fjdqra6q.js +0 -68
|
@@ -2,6 +2,23 @@ import {
|
|
|
2
2
|
__esm
|
|
3
3
|
} from "./cli-242037k3.js";
|
|
4
4
|
|
|
5
|
+
// packages/model-catalog/src/chatgpt-subscription.ts
|
|
6
|
+
function chatgptSubscriptionModelId(model) {
|
|
7
|
+
const trimmed = model?.trim() ?? "";
|
|
8
|
+
const prefix = `${CHATGPT_SUBSCRIPTION_PROVIDER}/`;
|
|
9
|
+
if (!trimmed.toLowerCase().startsWith(prefix))
|
|
10
|
+
return null;
|
|
11
|
+
const id = trimmed.slice(prefix.length);
|
|
12
|
+
return id && !id.includes("/") ? id : null;
|
|
13
|
+
}
|
|
14
|
+
function isChatgptSubscriptionModel(model) {
|
|
15
|
+
return chatgptSubscriptionModelId(model) !== null;
|
|
16
|
+
}
|
|
17
|
+
var CHATGPT_SUBSCRIPTION_PROVIDER = "openai-codex", CHATGPT_SUBSCRIPTION_HARNESSES;
|
|
18
|
+
var init_chatgpt_subscription = __esm(() => {
|
|
19
|
+
CHATGPT_SUBSCRIPTION_HARNESSES = ["pi"];
|
|
20
|
+
});
|
|
21
|
+
|
|
5
22
|
// packages/model-catalog/src/display.ts
|
|
6
23
|
var init_display = () => {};
|
|
7
24
|
|
|
@@ -153,7 +170,27 @@ function harnessCatalogSection(harness) {
|
|
|
153
170
|
return HARNESS_CATALOG_SECTION[harness] ?? null;
|
|
154
171
|
}
|
|
155
172
|
function isHarnessModelJudged(harness) {
|
|
156
|
-
return !!harness && (harnessCatalogSection(harness) !== null || harness === "grok");
|
|
173
|
+
return !!harness && (harnessCatalogSection(harness) !== null || harness === "grok" || harness === "fx");
|
|
174
|
+
}
|
|
175
|
+
function fxModelRoute(model) {
|
|
176
|
+
const id = model.trim();
|
|
177
|
+
if (!id)
|
|
178
|
+
return { error: `An empty model has no fx route. ${FX_ROUTES_HINT}` };
|
|
179
|
+
const slash = id.indexOf("/");
|
|
180
|
+
if (slash < 0)
|
|
181
|
+
return { fxProvider: "openai", fxModel: id, keyVar: "OPENAI_API_KEY" };
|
|
182
|
+
const namespace = id.slice(0, slash).toLowerCase();
|
|
183
|
+
const rest = id.slice(slash + 1).trim();
|
|
184
|
+
if (namespace === "openrouter" && rest) {
|
|
185
|
+
return { fxProvider: "openrouter", fxModel: rest, keyVar: "OPENROUTER_API_KEY" };
|
|
186
|
+
}
|
|
187
|
+
if (namespace === "vercel" && rest) {
|
|
188
|
+
return { fxProvider: "gateway", fxModel: rest, keyVar: "AI_GATEWAY_API_KEY" };
|
|
189
|
+
}
|
|
190
|
+
const reason = FX_REJECTED_NAMESPACES[namespace];
|
|
191
|
+
return {
|
|
192
|
+
error: `Model "${id}" has no fx route${reason ? `: ${reason}` : ""}. ${FX_ROUTES_HINT}`
|
|
193
|
+
};
|
|
157
194
|
}
|
|
158
195
|
function normalizeGrokModel(model) {
|
|
159
196
|
return model.trim().replace(XAI_PREFIX_RE, "");
|
|
@@ -228,8 +265,14 @@ function buildClaudeShortnameMap(models) {
|
|
|
228
265
|
return out;
|
|
229
266
|
}
|
|
230
267
|
function harnessModelMismatch(model, harness, sections, context = {}) {
|
|
268
|
+
const subscriptionId = chatgptSubscriptionModelId(model);
|
|
269
|
+
if (harness && subscriptionId && !CHATGPT_SUBSCRIPTION_HARNESSES.includes(harness)) {
|
|
270
|
+
return subscriptionMismatchMessage(model.trim(), subscriptionId, harness, context);
|
|
271
|
+
}
|
|
231
272
|
if (harness === "grok")
|
|
232
273
|
return grokModelMismatch(model, sections, context);
|
|
274
|
+
if (harness === "fx")
|
|
275
|
+
return fxModelMismatch(model, sections, context);
|
|
233
276
|
const section = harness ? harnessCatalogSection(harness) : null;
|
|
234
277
|
if (!harness || !section)
|
|
235
278
|
return null;
|
|
@@ -291,6 +334,37 @@ function grokModelMismatch(model, sections, context) {
|
|
|
291
334
|
}
|
|
292
335
|
return null;
|
|
293
336
|
}
|
|
337
|
+
function fxModelMismatch(model, sections, context) {
|
|
338
|
+
const id = model.trim();
|
|
339
|
+
if (!id)
|
|
340
|
+
return null;
|
|
341
|
+
const agent = context.agentId ? ` of agent "${context.agentName ?? context.agentId}" (${context.agentId})` : "";
|
|
342
|
+
const fail = (reason) => `Model "${id}" does not run on the fx harness${agent}. ${reason} Use modelTier (smol, regular, smart, ultra) for portable intent, or omit model and let the assignee resolve it.`;
|
|
343
|
+
if (isAlias(id)) {
|
|
344
|
+
const parsed = parseAlias(id);
|
|
345
|
+
if (!parsed)
|
|
346
|
+
return null;
|
|
347
|
+
return parsed.kind === "openrouter" || parsed.kind === "openai" ? null : fail(`A latest:${parsed.kind} alias resolves to an id fx cannot route. ${FX_ROUTES_HINT}`);
|
|
348
|
+
}
|
|
349
|
+
const route = fxModelRoute(id);
|
|
350
|
+
if ("error" in route)
|
|
351
|
+
return fail(route.error);
|
|
352
|
+
if (route.fxProvider !== "openai")
|
|
353
|
+
return null;
|
|
354
|
+
if (Object.hasOwn(sections.openai?.models ?? {}, id))
|
|
355
|
+
return null;
|
|
356
|
+
for (const [name, other] of Object.entries(sections)) {
|
|
357
|
+
if (name === "openai" || !other?.models)
|
|
358
|
+
continue;
|
|
359
|
+
if (Object.hasOwn(other.models, id) || name === "anthropic" && isClaudeShortname(id, other)) {
|
|
360
|
+
return fail(`A bare id runs on OpenAI (OPENAI_API_KEY), and "${id}" is in the ${name} catalog, not openai. ${FX_ROUTES_HINT}`);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return null;
|
|
364
|
+
}
|
|
365
|
+
function isClaudeShortname(id, section) {
|
|
366
|
+
return Object.hasOwn(buildClaudeShortnameMap(section.models), id);
|
|
367
|
+
}
|
|
294
368
|
function grokMismatchMessage(model, sections, context) {
|
|
295
369
|
const agent = context.agentId ? ` of agent "${context.agentName ?? context.agentId}" (${context.agentId})` : "";
|
|
296
370
|
const pool = sections.xai?.models ? [sections.xai.models] : Object.values(sections).map((section) => section?.models ?? {});
|
|
@@ -307,6 +381,11 @@ function grokMismatchMessage(model, sections, context) {
|
|
|
307
381
|
const examples = ids.length ? ` (for example: ${ids.slice(0, MAX_EXAMPLE_IDS).join(", ")}${extra > 0 ? ` and ${extra} more` : ""})` : "";
|
|
308
382
|
return `Model "${model}" does not run on the grok harness${agent}. The grok harness accepts xai catalog models${examples} and openrouter/<vendor>/<id>. Use modelTier (smol, regular, smart, ultra) for portable intent, or omit model and let the assignee resolve it.`;
|
|
309
383
|
}
|
|
384
|
+
function subscriptionMismatchMessage(model, bareId, harness, context) {
|
|
385
|
+
const agent = context.agentId ? ` of agent "${context.agentName ?? context.agentId}" (${context.agentId})` : "";
|
|
386
|
+
const codexHint = harness === "codex" ? ` On codex, use "${bareId}": codex runs it on the pool directly.` : "";
|
|
387
|
+
return `Model "${model}" does not run on the ${harness} harness${agent}. The ChatGPT subscription prefix (openai-codex/) is for the ${CHATGPT_SUBSCRIPTION_HARNESSES.join(" and ")} harness.${codexHint}`;
|
|
388
|
+
}
|
|
310
389
|
function harnessMismatchMessage(model, harness, section, own, context) {
|
|
311
390
|
const agent = context.agentId ? ` of agent "${context.agentName ?? context.agentId}" (${context.agentId})` : "";
|
|
312
391
|
const ids = harnessModelIds(harness, own);
|
|
@@ -314,14 +393,20 @@ function harnessMismatchMessage(model, harness, section, own, context) {
|
|
|
314
393
|
const examples = ids.slice(0, MAX_EXAMPLE_IDS).join(", ") + (extra > 0 ? ` and ${extra} more` : "");
|
|
315
394
|
return `Model "${model}" does not run on the ${harness} harness${agent}. The ${harness} harness accepts ${section} catalog models, for example: ${examples}. Use modelTier (smol, regular, smart, ultra) for portable intent, or omit model and let the assignee resolve it.`;
|
|
316
395
|
}
|
|
317
|
-
var HARNESS_CATALOG_SECTION, XAI_PREFIX_RE, GROK_ID_RE, DATED_ID_RE3, ISO_DATED_ID_RE, CODEX_EXCLUDED_TOKENS, CODEX_MIN_GPT_MAJOR = 5, CONTEXT_SUFFIX_RE, MAX_EXAMPLE_IDS = 8;
|
|
396
|
+
var HARNESS_CATALOG_SECTION, FX_REJECTED_NAMESPACES, FX_ROUTES_HINT = "The fx harness runs openrouter/<vendor>/<id> (OPENROUTER_API_KEY), vercel/<vendor>/<id> (AI_GATEWAY_API_KEY) or a bare OpenAI id (OPENAI_API_KEY).", XAI_PREFIX_RE, GROK_ID_RE, DATED_ID_RE3, ISO_DATED_ID_RE, CODEX_EXCLUDED_TOKENS, CODEX_MIN_GPT_MAJOR = 5, CONTEXT_SUFFIX_RE, MAX_EXAMPLE_IDS = 8;
|
|
318
397
|
var init_harness_models = __esm(() => {
|
|
398
|
+
init_chatgpt_subscription();
|
|
319
399
|
init_resolve_alias();
|
|
320
400
|
HARNESS_CATALOG_SECTION = {
|
|
321
401
|
claude: "anthropic",
|
|
322
402
|
"claude-managed": "anthropic",
|
|
323
403
|
codex: "openai"
|
|
324
404
|
};
|
|
405
|
+
FX_REJECTED_NAMESPACES = {
|
|
406
|
+
nan: "fx rejects NaN's streams (InconsistentFinishReason on its trailing usage chunk, fx 0.0.15)",
|
|
407
|
+
helmcode: "Helmcode is not verified on fx yet",
|
|
408
|
+
anthropic: "fx cannot speak the Anthropic Messages API; use openrouter/anthropic/<id> or vercel/anthropic/<id>"
|
|
409
|
+
};
|
|
325
410
|
XAI_PREFIX_RE = /^xai\//i;
|
|
326
411
|
GROK_ID_RE = /^grok-[^/]+$/i;
|
|
327
412
|
DATED_ID_RE3 = /-\d{8}$/;
|
|
@@ -671,6 +756,12 @@ function grokCatalogRef(model) {
|
|
|
671
756
|
}
|
|
672
757
|
return { providerId: "xai", modelId: id };
|
|
673
758
|
}
|
|
759
|
+
function fxCatalogRef(model) {
|
|
760
|
+
const route = fxModelRoute(model);
|
|
761
|
+
if ("error" in route || route.fxProvider !== "gateway")
|
|
762
|
+
return null;
|
|
763
|
+
return { providerId: "vercel", modelId: route.fxModel };
|
|
764
|
+
}
|
|
674
765
|
function cursorCatalogRef(model) {
|
|
675
766
|
const id = model.trim().toLowerCase();
|
|
676
767
|
if (/^(gpt-|o\d)/.test(id))
|
|
@@ -713,6 +804,9 @@ function applyHarnessOverrides(harness, modelId, facts, levels) {
|
|
|
713
804
|
} else if (harness !== "codex" && harness !== "cursor" && harness !== "opencode" && harness !== "pi") {
|
|
714
805
|
result = result.filter((l) => l !== "max");
|
|
715
806
|
}
|
|
807
|
+
if (harness === "fx") {
|
|
808
|
+
result = result.filter((l) => l !== "off");
|
|
809
|
+
}
|
|
716
810
|
if (harness === "codex") {
|
|
717
811
|
const isCodexMax = /-codex-max$/.test(modelId);
|
|
718
812
|
const isCodexNonMax = /-codex$/.test(modelId) && !isCodexMax;
|
|
@@ -738,6 +832,7 @@ function claudeCatalogModelId(modelId, models) {
|
|
|
738
832
|
}
|
|
739
833
|
var REASONING_EFFORT_LEVELS, REASONING_HARNESSES, FALLBACK_LEVELS, EFFORT_VALUE_MAP;
|
|
740
834
|
var init_reasoning = __esm(() => {
|
|
835
|
+
init_chatgpt_subscription();
|
|
741
836
|
init_harness_models();
|
|
742
837
|
REASONING_EFFORT_LEVELS = ["off", "low", "medium", "high", "xhigh", "max"];
|
|
743
838
|
REASONING_HARNESSES = [
|
|
@@ -748,7 +843,8 @@ var init_reasoning = __esm(() => {
|
|
|
748
843
|
"dsh",
|
|
749
844
|
"cursor",
|
|
750
845
|
"amp",
|
|
751
|
-
"grok"
|
|
846
|
+
"grok",
|
|
847
|
+
"fx"
|
|
752
848
|
];
|
|
753
849
|
FALLBACK_LEVELS = ["low", "medium", "high"];
|
|
754
850
|
EFFORT_VALUE_MAP = {
|
|
@@ -763,6 +859,7 @@ var init_reasoning = __esm(() => {
|
|
|
763
859
|
|
|
764
860
|
// packages/model-catalog/src/index.ts
|
|
765
861
|
var init_src2 = __esm(() => {
|
|
862
|
+
init_chatgpt_subscription();
|
|
766
863
|
init_display();
|
|
767
864
|
init_harness_models();
|
|
768
865
|
init_merge();
|
|
@@ -773,4 +870,4 @@ var init_src2 = __esm(() => {
|
|
|
773
870
|
init_resolve_alias();
|
|
774
871
|
});
|
|
775
872
|
|
|
776
|
-
export { isAlias, parseAlias, resolveAlias, harnessCatalogSection, isHarnessModelJudged, normalizeGrokModel, harnessModelIds, modelFamilyKey, buildClaudeShortnameMap, harnessModelMismatch, openAICompatibleProviders, openAICompatibleProviderIds, providerKeyVars, openAICompatibleKeyVars, baseUrlEnvVar, openAICompatibleBaseUrlVars, baseUrlOverride, ignoredBaseUrlVar, providerBaseUrl, openAICompatibleProvider, providerForModel, providerForKeyVar, providerKeyFromEnv, providerHarnessModels, withAgentChatRegistrySections, registryCatalogSections, withRegistryCatalogSections, dshCatalogRef, grokCatalogRef, cursorCatalogRef, reasoningLevelsFor, claudeCatalogModelId, init_src2 };
|
|
873
|
+
export { CHATGPT_SUBSCRIPTION_PROVIDER, chatgptSubscriptionModelId, isChatgptSubscriptionModel, isAlias, parseAlias, resolveAlias, harnessCatalogSection, isHarnessModelJudged, fxModelRoute, normalizeGrokModel, harnessModelIds, modelFamilyKey, buildClaudeShortnameMap, harnessModelMismatch, openAICompatibleProviders, openAICompatibleProviderIds, providerKeyVars, openAICompatibleKeyVars, baseUrlEnvVar, openAICompatibleBaseUrlVars, baseUrlOverride, ignoredBaseUrlVar, providerBaseUrl, openAICompatibleProvider, providerForModel, providerForKeyVar, providerKeyFromEnv, providerHarnessModels, withAgentChatRegistrySections, registryCatalogSections, withRegistryCatalogSections, dshCatalogRef, grokCatalogRef, fxCatalogRef, cursorCatalogRef, reasoningLevelsFor, claudeCatalogModelId, init_src2 };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
__toESM,
|
|
2
3
|
__commonJS,
|
|
4
|
+
__esm,
|
|
3
5
|
__require
|
|
4
6
|
} from "./cli-242037k3.js";
|
|
5
7
|
|
|
@@ -2886,4 +2888,18 @@ var require_websocket_server = __commonJS(function(exports, module) {
|
|
|
2886
2888
|
}
|
|
2887
2889
|
});
|
|
2888
2890
|
|
|
2889
|
-
|
|
2891
|
+
// node_modules/ws/wrapper.mjs
|
|
2892
|
+
var import_stream, import_extension, import_permessage_deflate, import_receiver, import_sender, import_subprotocol, import_websocket, import_websocket_server, wrapper_default;
|
|
2893
|
+
var init_wrapper2 = __esm(() => {
|
|
2894
|
+
import_stream = __toESM(require_stream(), 1);
|
|
2895
|
+
import_extension = __toESM(require_extension(), 1);
|
|
2896
|
+
import_permessage_deflate = __toESM(require_permessage_deflate(), 1);
|
|
2897
|
+
import_receiver = __toESM(require_receiver(), 1);
|
|
2898
|
+
import_sender = __toESM(require_sender(), 1);
|
|
2899
|
+
import_subprotocol = __toESM(require_subprotocol(), 1);
|
|
2900
|
+
import_websocket = __toESM(require_websocket(), 1);
|
|
2901
|
+
import_websocket_server = __toESM(require_websocket_server(), 1);
|
|
2902
|
+
wrapper_default = import_websocket.default;
|
|
2903
|
+
});
|
|
2904
|
+
|
|
2905
|
+
export { import_websocket, import_websocket_server, wrapper_default, init_wrapper2 };
|
|
@@ -2,11 +2,12 @@ import {
|
|
|
2
2
|
runtimeCatalogSection,
|
|
3
3
|
runtimeCatalogModel,
|
|
4
4
|
init_runtime_model_catalog
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-1p89xny0.js";
|
|
6
6
|
import {
|
|
7
|
+
chatgptSubscriptionModelId,
|
|
7
8
|
buildClaudeShortnameMap,
|
|
8
9
|
init_src2
|
|
9
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-5c4hjzne.js";
|
|
10
11
|
import {
|
|
11
12
|
__esm
|
|
12
13
|
} from "./cli-242037k3.js";
|
|
@@ -32,6 +33,9 @@ function getContextWindowSize(model) {
|
|
|
32
33
|
function getKnownContextWindowSize(model) {
|
|
33
34
|
if (!model)
|
|
34
35
|
return;
|
|
36
|
+
const subscriptionId = chatgptSubscriptionModelId(model);
|
|
37
|
+
if (subscriptionId)
|
|
38
|
+
return catalogContext("openai", subscriptionId);
|
|
35
39
|
const slash = model.indexOf("/");
|
|
36
40
|
if (slash > 0) {
|
|
37
41
|
const scoped = catalogContext(model.slice(0, slash), model.slice(slash + 1));
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
scrubSecrets,
|
|
7
7
|
init_secret_scrubber
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-1b7btd38.js";
|
|
9
9
|
import {
|
|
10
10
|
__esm
|
|
11
11
|
} from "./cli-242037k3.js";
|
|
@@ -116,13 +116,13 @@ async function refreshAccessToken(refreshToken) {
|
|
|
116
116
|
})
|
|
117
117
|
});
|
|
118
118
|
if (!response.ok) {
|
|
119
|
-
const text = await response.text().catch(() => "");
|
|
119
|
+
const text = redactTokens(await response.text().catch(() => ""), [refreshToken]);
|
|
120
120
|
console.error("[codex-oauth] Token refresh failed:", response.status, text);
|
|
121
121
|
return { type: "failed", status: response.status, error: text.slice(0, 300) };
|
|
122
122
|
}
|
|
123
123
|
const json = await response.json();
|
|
124
124
|
if (!json.access_token || !json.refresh_token || typeof json.expires_in !== "number") {
|
|
125
|
-
console.error("[codex-oauth] Token refresh response missing fields:", json);
|
|
125
|
+
console.error("[codex-oauth] Token refresh response missing fields; got keys:", Object.keys(json).join(", "));
|
|
126
126
|
return { type: "failed" };
|
|
127
127
|
}
|
|
128
128
|
return {
|
|
@@ -132,10 +132,22 @@ async function refreshAccessToken(refreshToken) {
|
|
|
132
132
|
expires: Date.now() + json.expires_in * 1000
|
|
133
133
|
};
|
|
134
134
|
} catch (error) {
|
|
135
|
-
|
|
135
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
136
|
+
console.error("[codex-oauth] Token refresh error:", redactTokens(message, [refreshToken]));
|
|
136
137
|
return { type: "failed" };
|
|
137
138
|
}
|
|
138
139
|
}
|
|
140
|
+
function redactTokens(text, tokens) {
|
|
141
|
+
let out = text;
|
|
142
|
+
for (const token of tokens) {
|
|
143
|
+
if (!token)
|
|
144
|
+
continue;
|
|
145
|
+
const forms = new Set([token, encodeURIComponent(token), JSON.stringify(token).slice(1, -1)]);
|
|
146
|
+
for (const form of forms)
|
|
147
|
+
out = out.split(form).join("[REDACTED:codex_oauth_token]");
|
|
148
|
+
}
|
|
149
|
+
return scrubSecrets(out);
|
|
150
|
+
}
|
|
139
151
|
function getAccountId(accessToken) {
|
|
140
152
|
const payload = decodeJwt(accessToken);
|
|
141
153
|
const auth = payload?.[JWT_CLAIM_PATH];
|
|
@@ -384,6 +396,16 @@ function isStaleByAge(expires, maxAgeMs) {
|
|
|
384
396
|
const issuedAt = expires - ACCESS_TOKEN_TTL_MS;
|
|
385
397
|
return Date.now() - issuedAt > maxAgeMs;
|
|
386
398
|
}
|
|
399
|
+
function buildPoolRevalidationFailureReason(err, slot) {
|
|
400
|
+
if (err instanceof CodexOAuthRefreshError) {
|
|
401
|
+
if (err.reason === "lock_timeout") {
|
|
402
|
+
return `[auth-error] Codex pool slot ${slot} [...${err.keySuffix}] revalidation failed: timed out waiting for the refresh lock — transient, will retry on next task.`;
|
|
403
|
+
}
|
|
404
|
+
return `[auth-error] Codex pool slot ${slot} [...${err.keySuffix}] revalidation failed: refresh rejected (${err.status ?? "unknown status"} ${scrubSecrets(err.body ?? "")}) — credential likely revoked; re-run codex-login for this slot.`;
|
|
405
|
+
}
|
|
406
|
+
const message = scrubSecrets(err instanceof Error ? err.message : String(err));
|
|
407
|
+
return `[auth-error] Codex pool slot ${slot} revalidation failed (not a confirmed auth rejection, transient): ${message}`;
|
|
408
|
+
}
|
|
387
409
|
async function acquireCodexRefreshLock(apiUrl, apiKey, slot) {
|
|
388
410
|
const key = codexOAuthKeyForSlot(slot);
|
|
389
411
|
const res = await fetch(`${apiUrl}/api/oauth/refresh-locks/${encodeURIComponent(key)}`, {
|
|
@@ -465,22 +487,29 @@ async function loadAllCodexOAuthSlots(apiUrl, apiKey, options = {}) {
|
|
|
465
487
|
}
|
|
466
488
|
async function storeCodexOAuth(apiUrl, apiKey, creds, slot = 0) {
|
|
467
489
|
const key = codexOAuthKeyForSlot(slot);
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
490
|
+
const redact = (text) => redactTokens(text, [creds.access, creds.refresh]);
|
|
491
|
+
let res;
|
|
492
|
+
try {
|
|
493
|
+
res = await fetch(`${apiUrl}/api/config`, {
|
|
494
|
+
method: "PUT",
|
|
495
|
+
headers: {
|
|
496
|
+
"Content-Type": "application/json",
|
|
497
|
+
Authorization: `Bearer ${apiKey}`
|
|
498
|
+
},
|
|
499
|
+
body: JSON.stringify({
|
|
500
|
+
scope: "global",
|
|
501
|
+
key,
|
|
502
|
+
value: JSON.stringify(creds),
|
|
503
|
+
isSecret: true,
|
|
504
|
+
description: `Codex ChatGPT OAuth credentials slot ${slot} (stored by codex-login)`
|
|
505
|
+
})
|
|
506
|
+
});
|
|
507
|
+
} catch (error) {
|
|
508
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
509
|
+
throw new Error(`Failed to store ${key} config: ${redact(message)}`);
|
|
510
|
+
}
|
|
482
511
|
if (!res.ok) {
|
|
483
|
-
const text = await res.text().catch(() => "");
|
|
512
|
+
const text = redact(await res.text().catch(() => ""));
|
|
484
513
|
throw new Error(`Failed to store ${key} config: HTTP ${res.status} ${text}`);
|
|
485
514
|
}
|
|
486
515
|
}
|
|
@@ -531,7 +560,8 @@ async function persistCodexOAuth(apiUrl, apiKey, creds, slot = 0) {
|
|
|
531
560
|
try {
|
|
532
561
|
await storeCodexOAuth(apiUrl, apiKey, creds, slot);
|
|
533
562
|
} catch (err) {
|
|
534
|
-
|
|
563
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
564
|
+
console.error("[codex-oauth] persistCodexOAuth failed (non-fatal):", redactTokens(message, [creds.access, creds.refresh]));
|
|
535
565
|
}
|
|
536
566
|
}
|
|
537
567
|
async function getValidCodexOAuth(apiUrl, apiKey, slot = 0, opts) {
|
|
@@ -591,6 +621,7 @@ async function getValidCodexOAuth(apiUrl, apiKey, slot = 0, opts) {
|
|
|
591
621
|
}
|
|
592
622
|
var CODEX_OAUTH_KEY_LEGACY = "codex_oauth", MAX_CODEX_OAUTH_SLOT = 100, REFRESH_LOCK_TTL_MS, REFRESH_LOCK_WAIT_MS, REFRESH_LOCK_POLL_MS = 250, REFRESH_SKEW_MS, ACCESS_TOKEN_TTL_MS, CodexOAuthRefreshError;
|
|
593
623
|
var init_storage = __esm(() => {
|
|
624
|
+
init_secret_scrubber();
|
|
594
625
|
init_auth_json();
|
|
595
626
|
init_flow();
|
|
596
627
|
REFRESH_LOCK_TTL_MS = 2 * 60 * 1000;
|
|
@@ -615,4 +646,4 @@ var init_storage = __esm(() => {
|
|
|
615
646
|
};
|
|
616
647
|
});
|
|
617
648
|
|
|
618
|
-
export { _fetchHolder, CLIENT_ID, decodeJwt, exchangeAuthorizationCode2, getAccountId, extractChatgptPlanType, extractChatgptUserId, loginCodexOAuth, init_flow, deriveCodexKeySuffix, authJsonToCredentialSelection, credentialsToAuthJson, init_auth_json, MAX_CODEX_OAUTH_SLOT,
|
|
649
|
+
export { _fetchHolder, CLIENT_ID, decodeJwt, exchangeAuthorizationCode2, getAccountId, extractChatgptPlanType, extractChatgptUserId, loginCodexOAuth, init_flow, deriveCodexKeySuffix, authJsonToCredentialSelection, credentialsToAuthJson, init_auth_json, MAX_CODEX_OAUTH_SLOT, buildPoolRevalidationFailureReason, codexOAuthKeyForSlot, loadAllCodexOAuthSlots, storeCodexOAuth, persistCodexOAuth, getValidCodexOAuth, init_storage };
|
|
@@ -4,27 +4,27 @@ import {
|
|
|
4
4
|
getActivePricingRow2,
|
|
5
5
|
insertPricingRow2,
|
|
6
6
|
init_db4
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-k2gzwsj2.js";
|
|
8
8
|
import {
|
|
9
9
|
loadModelsDevCache,
|
|
10
10
|
init_modelsdev_cache,
|
|
11
11
|
buildModelsDevSeedRows,
|
|
12
12
|
init_seed_pricing
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-c60vetmm.js";
|
|
14
14
|
import {
|
|
15
15
|
setRuntimeModelCatalog,
|
|
16
16
|
init_runtime_model_catalog
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-1p89xny0.js";
|
|
18
18
|
import {
|
|
19
19
|
scrubSecrets,
|
|
20
20
|
init_secret_scrubber
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-1b7btd38.js";
|
|
22
22
|
import {
|
|
23
23
|
openAICompatibleProviderIds,
|
|
24
24
|
withAgentChatRegistrySections,
|
|
25
25
|
registryCatalogSections,
|
|
26
26
|
init_src2
|
|
27
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-5c4hjzne.js";
|
|
28
28
|
import {
|
|
29
29
|
__esm
|
|
30
30
|
} from "./cli-242037k3.js";
|
|
@@ -56,22 +56,22 @@ import {
|
|
|
56
56
|
releaseApprovalCancellationNotificationClaim2,
|
|
57
57
|
updateApprovalRequestNotifications2,
|
|
58
58
|
init_db4
|
|
59
|
-
} from "./cli-
|
|
59
|
+
} from "./cli-k2gzwsj2.js";
|
|
60
60
|
import {
|
|
61
61
|
externalChannelToolError2,
|
|
62
62
|
isBlockExternalEnabled2,
|
|
63
63
|
getChannelBlockReason2,
|
|
64
64
|
init_external_channel
|
|
65
|
-
} from "./cli-
|
|
65
|
+
} from "./cli-w6dt9ged.js";
|
|
66
66
|
import {
|
|
67
67
|
getSlackApp2,
|
|
68
68
|
init_app3
|
|
69
|
-
} from "./cli-
|
|
69
|
+
} from "./cli-waqbxg08.js";
|
|
70
70
|
import {
|
|
71
71
|
DEFAULT_MODEL,
|
|
72
72
|
resolveCredential,
|
|
73
73
|
init_credentials
|
|
74
|
-
} from "./cli-
|
|
74
|
+
} from "./cli-436532ck.js";
|
|
75
75
|
import {
|
|
76
76
|
isMultiRuntimeEnabled,
|
|
77
77
|
init_multi_runtime2
|
|
@@ -79,11 +79,11 @@ import {
|
|
|
79
79
|
import {
|
|
80
80
|
revokeRuntimeTokensForRuntime,
|
|
81
81
|
init_users
|
|
82
|
-
} from "./cli-
|
|
82
|
+
} from "./cli-drr5v6av.js";
|
|
83
83
|
import {
|
|
84
84
|
TERMINAL_TASK_STATUSES,
|
|
85
85
|
init_types4
|
|
86
|
-
} from "./cli-
|
|
86
|
+
} from "./cli-nhrvpaj7.js";
|
|
87
87
|
import {
|
|
88
88
|
getSlackConfiguration,
|
|
89
89
|
isSlackConfigured,
|
|
@@ -98,13 +98,13 @@ import {
|
|
|
98
98
|
import {
|
|
99
99
|
selectCredential,
|
|
100
100
|
init_credentials2
|
|
101
|
-
} from "./cli-
|
|
101
|
+
} from "./cli-g83s9ewh.js";
|
|
102
102
|
import {
|
|
103
103
|
deepInterpolate,
|
|
104
104
|
init_template2,
|
|
105
105
|
resolveTemplate,
|
|
106
106
|
init_resolver
|
|
107
|
-
} from "./cli-
|
|
107
|
+
} from "./cli-cm5yqn35.js";
|
|
108
108
|
import {
|
|
109
109
|
init_zod
|
|
110
110
|
} from "./cli-k5671be5.js";
|
|
@@ -136,13 +136,13 @@ import {
|
|
|
136
136
|
isSensitiveKey,
|
|
137
137
|
scrubSecrets,
|
|
138
138
|
init_secret_scrubber
|
|
139
|
-
} from "./cli-
|
|
139
|
+
} from "./cli-1b7btd38.js";
|
|
140
140
|
import {
|
|
141
141
|
providerKeyVars,
|
|
142
142
|
providerBaseUrl,
|
|
143
143
|
providerForModel,
|
|
144
144
|
init_src2
|
|
145
|
-
} from "./cli-
|
|
145
|
+
} from "./cli-5c4hjzne.js";
|
|
146
146
|
import {
|
|
147
147
|
__esm
|
|
148
148
|
} from "./cli-242037k3.js";
|
|
@@ -155,7 +155,7 @@ async function notifyAutomationPreflightFailure(preflight) {
|
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
157
|
try {
|
|
158
|
-
const { getSlackApp } = await import("./app-
|
|
158
|
+
const { getSlackApp } = await import("./app-909e97cr.js");
|
|
159
159
|
const app = getSlackApp();
|
|
160
160
|
if (!app) {
|
|
161
161
|
console.warn("[Automation Preflight] Slack not available, cannot send notification");
|
|
@@ -3608,7 +3608,7 @@ function cooldownToMs(cooldown) {
|
|
|
3608
3608
|
async function shouldSkipCooldown(workflowId, cooldown) {
|
|
3609
3609
|
const cooldownMs = cooldownToMs(cooldown);
|
|
3610
3610
|
const now = Date.now();
|
|
3611
|
-
const lastSuccess = await getLastSuccessfulRun2(workflowId);
|
|
3611
|
+
const lastSuccess = cooldown.from === "start" ? null : await getLastSuccessfulRun2(workflowId);
|
|
3612
3612
|
if (lastSuccess?.finishedAt) {
|
|
3613
3613
|
const lastFinished = new Date(lastSuccess.finishedAt).getTime();
|
|
3614
3614
|
if (now - lastFinished < cooldownMs)
|
|
@@ -4014,7 +4014,7 @@ async function startWorkflowExecution2(workflow, triggerData, registry, options
|
|
|
4014
4014
|
const newRunId = crypto.randomUUID();
|
|
4015
4015
|
const release = holdWorkflowRun(newRunId);
|
|
4016
4016
|
try {
|
|
4017
|
-
const { runId, created, preflightAlert } = await createRunWithInitialState(workflow, triggerData, options, initial, newRunId);
|
|
4017
|
+
const { runId, created, preflightAlert, status } = await createRunWithInitialState(workflow, triggerData, options, initial, newRunId);
|
|
4018
4018
|
if (!created)
|
|
4019
4019
|
return runId;
|
|
4020
4020
|
if (initial.status === "failed" && initial.preflight) {
|
|
@@ -4022,7 +4022,7 @@ async function startWorkflowExecution2(workflow, triggerData, registry, options
|
|
|
4022
4022
|
await notifyAutomationPreflightFailure(preflight);
|
|
4023
4023
|
return runId;
|
|
4024
4024
|
}
|
|
4025
|
-
if (
|
|
4025
|
+
if (status === "skipped")
|
|
4026
4026
|
return runId;
|
|
4027
4027
|
telemetry.workflow("started", {
|
|
4028
4028
|
workflowId: workflow.id,
|
|
@@ -4085,6 +4085,7 @@ async function createRunWithInitialState(workflow, triggerData, options, initial
|
|
|
4085
4085
|
if (existingId)
|
|
4086
4086
|
return { runId: existingId, created: false };
|
|
4087
4087
|
}
|
|
4088
|
+
const state = !initial.status && workflow.cooldown && await shouldSkipCooldown(workflow.id, workflow.cooldown) ? { status: "skipped", error: "cooldown", finishedAt: new Date().toISOString() } : initial;
|
|
4088
4089
|
await createWorkflowRun2({
|
|
4089
4090
|
id: runId,
|
|
4090
4091
|
workflowId: workflow.id,
|
|
@@ -4095,10 +4096,10 @@ async function createRunWithInitialState(workflow, triggerData, options, initial
|
|
|
4095
4096
|
parentStepAttempt: parentStepId ? attempt : undefined,
|
|
4096
4097
|
triggeredByAgentId: options.triggeredByAgentId
|
|
4097
4098
|
});
|
|
4098
|
-
await updateWorkflowRun2(runId,
|
|
4099
|
-
const preflightAlert =
|
|
4100
|
-
await options.accept?.({ runId, skipped:
|
|
4101
|
-
return { runId, created: true, preflightAlert };
|
|
4099
|
+
await updateWorkflowRun2(runId, state.status ? { status: state.status, error: state.error, finishedAt: state.finishedAt } : { context: state.context });
|
|
4100
|
+
const preflightAlert = state.status === "failed" && state.preflight ? await isFirstWorkflowPreflightFailureToday(workflow.id, runId) : undefined;
|
|
4101
|
+
await options.accept?.({ runId, skipped: state.status === "skipped" });
|
|
4102
|
+
return { runId, created: true, preflightAlert, status: state.status };
|
|
4102
4103
|
});
|
|
4103
4104
|
}
|
|
4104
4105
|
async function failRunOnUnreadableReplay(runId, err, stepId) {
|
|
@@ -4550,7 +4551,7 @@ async function runClaimedStep(def, runId, ctx, node, registry, existingStep, ste
|
|
|
4550
4551
|
}
|
|
4551
4552
|
const waiting = await checkpointStepWaiting(runId, stepId, ctx);
|
|
4552
4553
|
if (waiting && result.waitFor === "workflow.child.finished") {
|
|
4553
|
-
const { resumeFromChildRun } = await import("./resume-
|
|
4554
|
+
const { resumeFromChildRun } = await import("./resume-wd30wx23.js");
|
|
4554
4555
|
await resumeFromChildRun(stepId, registry);
|
|
4555
4556
|
}
|
|
4556
4557
|
return { outcome: waiting ? "waiting" : "completed", successors: [] };
|
|
@@ -5055,7 +5056,7 @@ async function runForeachDrive(runId, parentNodeId, registry) {
|
|
|
5055
5056
|
if (drive.successors.length > 0) {
|
|
5056
5057
|
await walkGraph(workflow.definition, runId, ctx, drive.successors, registry, workflow.id, getSecretInputKeys(workflow.input));
|
|
5057
5058
|
} else {
|
|
5058
|
-
const { finalizeOrWait } = await import("./resume-
|
|
5059
|
+
const { finalizeOrWait } = await import("./resume-wd30wx23.js");
|
|
5059
5060
|
await finalizeOrWait(runId);
|
|
5060
5061
|
}
|
|
5061
5062
|
return drive;
|
|
@@ -5198,7 +5199,7 @@ async function startChild(input) {
|
|
|
5198
5199
|
const parked = await getDbClient2().get("UPDATE workflow_run_steps SET status = 'waiting' WHERE id = ? AND status = 'running' RETURNING id", [child.id]);
|
|
5199
5200
|
if (parked && result.waitFor === "workflow.child.finished") {
|
|
5200
5201
|
ownedChildren.delete(child.id);
|
|
5201
|
-
const { resumeFromChildRun } = await import("./resume-
|
|
5202
|
+
const { resumeFromChildRun } = await import("./resume-wd30wx23.js");
|
|
5202
5203
|
await resumeFromChildRun(child.id, registry);
|
|
5203
5204
|
}
|
|
5204
5205
|
return null;
|