@desplega.ai/agent-swarm 2.7.9 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acp-adapter-t949vbbp.js +15 -0
- package/dist/{actions-g563mbn2.js → actions-7e9czc7s.js} +19 -19
- package/dist/{amp-adapter-q61w05eb.js → amp-adapter-gv6cbb7d.js} +2 -3
- package/dist/app-b9fbkp9v.js +20 -0
- package/dist/{assistant-p477rjwj.js → assistant-wjb7v4c7.js} +22 -22
- package/dist/{boot-args-schema-h4qj462e.js → boot-args-schema-2t37e0fe.js} +1 -1
- package/dist/{boot-reembed-n1ehfbsw.js → boot-reembed-a35nkyr1.js} +1 -1
- package/dist/{boot-reembed-qw4mc0pt.js → boot-reembed-gka3zas7.js} +1 -1
- package/dist/{boot-scrub-sweep-9w9jp4sm.js → boot-scrub-sweep-65sdnp6c.js} +3 -3
- package/dist/{boot-seeds-qdaf3sdy.js → boot-seeds-x42tzytw.js} +4 -5
- package/dist/{claude-adapter-348p5hx9.js → claude-adapter-v221b2fd.js} +7 -8
- package/dist/{claude-managed-adapter-h74d06yz.js → claude-managed-adapter-29eq09wd.js} +2 -2
- package/dist/{claude-managed-setup-7787fxtp.js → claude-managed-setup-9m6450zk.js} +2 -2
- package/dist/{claude-sdk-session-hbszbt8a.js → claude-sdk-session-0q0ptaba.js} +9066 -8818
- package/dist/{cli-n5yexkdg.js → cli-0b4zam62.js} +1 -0
- package/dist/{cli-21159vea.js → cli-0jzra9ad.js} +2 -2
- package/dist/{cli-eqtfgfr6.js → cli-2gxeg5gr.js} +1 -1
- package/dist/{cli-k70e3x9e.js → cli-2wnq8jkz.js} +9 -9
- package/dist/{cli-cvs2r2vq.js → cli-2zp0et3v.js} +59 -6
- package/dist/{cli-650zv9q9.js → cli-334z18y3.js} +4 -4
- package/dist/{cli-12xyjhws.js → cli-3rkdne1h.js} +2 -2
- package/dist/{cli-2a8py3sx.js → cli-4txa0ter.js} +5 -7
- package/dist/{cli-jc1g9ndz.js → cli-5j88qqa8.js} +10 -5
- package/dist/{cli-xfjrc279.js → cli-5mrq3ake.js} +48 -14
- package/dist/{cli-v3cf1ts9.js → cli-6t09sdhy.js} +3 -3
- package/dist/{cli-qzt90yze.js → cli-6wxjceza.js} +8 -8
- package/dist/{cli-9aezs55w.js → cli-7b8sbmag.js} +8 -8
- package/dist/{cli-3xj33nrx.js → cli-7cp6aa1q.js} +10 -3
- package/dist/{cli-jfx48xrj.js → cli-7p1kvkck.js} +6 -6
- package/dist/{cli-b932gexn.js → cli-8aes17e4.js} +2 -2
- package/dist/{cli-3tqcamp6.js → cli-8fknbnhw.js} +14 -13
- package/dist/{cli-587857ys.js → cli-8kzasymh.js} +3 -3
- package/dist/{cli-sgs5k6yd.js → cli-a7wvp2km.js} +1 -1
- package/dist/{cli-varqt4d1.js → cli-abejgen1.js} +69 -22
- package/dist/{cli-rwymrnaz.js → cli-bsywb58a.js} +8 -8
- package/dist/{cli-btc9cb4c.js → cli-c55z5chy.js} +4 -6
- package/dist/{cli-ms5m5r1y.js → cli-deefvewm.js} +1 -1
- package/dist/{cli-p17970qv.js → cli-ee0b971j.js} +3 -3
- package/dist/cli-f3vq58d2.js +242 -0
- package/dist/{cli-3xcwp3z8.js → cli-ffhtssbp.js} +2 -2
- package/dist/{cli-hwprv9e4.js → cli-g70vxtjh.js} +2 -2
- package/dist/{cli-4t0fmf3z.js → cli-gxkx0zzp.js} +1 -1
- package/dist/{cli-neyag5p6.js → cli-h38x262p.js} +3365 -429
- package/dist/{cli-2ccpqyyf.js → cli-j790gp2w.js} +105 -22
- package/dist/{cli-f2zenhja.js → cli-kc7v1nfv.js} +1 -1
- package/dist/{cli-vxh6acp7.js → cli-m23zjcy2.js} +10 -10
- package/dist/{cli-y8nbefpb.js → cli-m28atx8q.js} +12 -10
- package/dist/{cli-serm8zrx.js → cli-m4dqmnbp.js} +1 -1
- package/dist/{cli-ybjdc978.js → cli-mrt48bx7.js} +7 -4
- package/dist/{cli-y5rbvxhc.js → cli-n515ex5z.js} +14 -14
- package/dist/{cli-ypff1qwp.js → cli-n9ftpys4.js} +7 -7
- package/dist/{cli-605nn699.js → cli-p1bq50aa.js} +894 -226
- package/dist/{cli-qkdmz8c8.js → cli-p1w18yhx.js} +1 -1
- package/dist/{cli-xk879m3k.js → cli-p2gfst4m.js} +52 -43
- package/dist/{cli-sya22y84.js → cli-pasjcnmj.js} +12 -12
- package/dist/{cli-0whpms1z.js → cli-qa4wdgsy.js} +5 -5
- package/dist/{cli-ejkvvqbe.js → cli-qfedvmcr.js} +50 -24
- package/dist/{cli-tqq0hspb.js → cli-qmqk2yc2.js} +1 -1
- package/dist/{cli-qmd3mse0.js → cli-qsnnd04k.js} +1 -1
- package/dist/{cli-agyaeef4.js → cli-qwca7s44.js} +3 -3
- package/dist/{cli-fayav105.js → cli-rfywm85n.js} +724 -792
- package/dist/{cli-zgv8gxgs.js → cli-rmmpt0wm.js} +6 -6
- package/dist/{cli-hae9j8sv.js → cli-rzsy6nc6.js} +12 -8
- package/dist/{cli-btf6fw39.js → cli-s7t6p9my.js} +1 -1
- package/dist/{cli-cseh6f8w.js → cli-sdtt3men.js} +1 -1
- package/dist/{cli-9r5gtwjr.js → cli-tk7cjj8h.js} +197 -2
- package/dist/{cli-q26b9wre.js → cli-tph5wt3y.js} +4 -4
- package/dist/{cli-gce09r66.js → cli-tqegb8eq.js} +3 -3
- package/dist/{cli-kf3pxxdg.js → cli-v1dv1r37.js} +1 -1
- package/dist/{cli-09kmfkmq.js → cli-wcg8x116.js} +1 -1
- package/dist/{cli-mnrkgg60.js → cli-wk18cm92.js} +5 -5
- package/dist/{cli-p0m0p34z.js → cli-x1wa213s.js} +3 -3
- package/dist/{cli-jrp1dt73.js → cli-xzm9vcfg.js} +1 -1
- package/dist/{cli-715t1gx6.js → cli-y97qxcfx.js} +9 -9
- package/dist/{cli-bc779n4v.js → cli-yq3zak69.js} +1 -1
- package/dist/cli.js +17 -17
- package/dist/{codex-adapter-ysq6bzha.js → codex-adapter-30j9bpzd.js} +5 -6
- package/dist/{codex-hook-fac6175r.js → codex-hook-h3vk6xzr.js} +1 -1
- package/dist/{codex-session-runner-qakzfx93.js → codex-session-runner-8vp57v8w.js} +5 -6
- package/dist/{commands-rs7hkv9r.js → commands-bngnz9g7.js} +3 -3
- package/dist/{controller-r5x9bg6e.js → controller-hxx8wwy1.js} +2 -2
- package/dist/{controllers-connect-498hrxvk.js → controllers-connect-e2b4gyxc.js} +20 -20
- package/dist/{cursor-adapter-d46qszer.js → cursor-adapter-n5nc3mfe.js} +1 -2
- package/dist/{db-s13dqhr6.js → db-bgm7vkc0.js} +3 -3
- package/dist/{db-pm96nhdb.js → db-c6np41ca.js} +12 -2
- package/dist/{devin-adapter-z46ep5ph.js → devin-adapter-xedz98zv.js} +1 -1
- package/dist/{dispatcher-j3h81t7m.js → dispatcher-jnybck15.js} +18 -18
- package/dist/{dsh-adapter-rw0d5rc4.js → dsh-adapter-nrhbrjz8.js} +1 -2
- package/dist/{easter-egg-3d-qtgfxgze.js → easter-egg-3d-533knw22.js} +1 -1
- package/dist/{embedding-space-xh8p4q4x.js → embedding-space-crsm2zp0.js} +6 -6
- package/dist/{embeddings-wp745m91.js → embeddings-e7z3f27f.js} +1 -1
- package/dist/{execute-2fzb9z74.js → execute-b3mrb1mv.js} +1 -1
- package/dist/{external-channel-ys21h3sy.js → external-channel-m77wf5z3.js} +2 -2
- package/dist/{fx-adapter-vz0b9z3g.js → fx-adapter-b6w0kf56.js} +7 -8
- package/dist/{google-generative-ai-ytpgncx9.js → google-generative-ai-h7s3e9kk.js} +1 -1
- package/dist/{google-vertex-tqhze5j7.js → google-vertex-fhxaafzw.js} +1 -1
- package/dist/{grok-adapter-spea7zkj.js → grok-adapter-4sqtebdk.js} +7 -8
- package/dist/handlers-kdjcyzdj.js +32 -0
- package/dist/heartbeat-xgb036sx.js +43 -0
- package/dist/{hook-amcj4s10.js → hook-5h02c9ga.js} +6 -6
- package/dist/{hook-bc6n49qn.js → hook-xsk1jbha.js} +5 -5
- package/dist/{http-7374brv5.js → http-txe7qhvn.js} +448 -165
- package/dist/{index-pxn30mse.js → index-0eny15vj.js} +8 -8
- package/dist/{index-5a9jtqde.js → index-0rvk3vd4.js} +46 -46
- package/dist/{index-fvzke5kx.js → index-1qw6f2dc.js} +10 -10
- package/dist/{index-q5cmtbz5.js → index-4a0670yh.js} +15939 -14244
- package/dist/index-835xdgnm.js +33 -0
- package/dist/index-d469300x.js +37 -0
- package/dist/{index-h7f61sy9.js → index-e5pfbsys.js} +3 -3
- package/dist/{index-hsad2t3r.js → index-m5gx1xd6.js} +38 -38
- package/dist/{index-5fx3b3kw.js → index-rvccek1w.js} +9 -9
- package/dist/index-rzqwp11g.js +32 -0
- package/dist/{index-w4m9z29z.js → index-tvfafeyy.js} +1 -1
- package/dist/{index-c9y31ytf.js → index-vk63emp7.js} +979 -35
- package/dist/{index-514d9pf6.js → index-w7em4ktq.js} +8 -8
- package/dist/{index-p4hjwbvw.js → index-ysvbhg5m.js} +1 -1
- package/dist/{keepalive-wy29kbrg.js → keepalive-4zsrce78.js} +3 -3
- package/dist/lead-yqt47dkr.js +70 -0
- package/dist/{maintenance-h2ds9w6c.js → maintenance-86jvartk.js} +1 -1
- package/dist/{oauth-refresh-sweep-q7mtbyp3.js → oauth-refresh-sweep-j52kg9pr.js} +2 -2
- package/dist/{onboard-vw8r2fdw.js → onboard-c2aj5p8q.js} +3 -3
- package/dist/{opencode-adapter-mtb0953j.js → opencode-adapter-dsagkhtw.js} +5 -6
- package/dist/{otel-impl-j42czw3r.js → otel-impl-yyy203z8.js} +1 -1
- package/dist/{pi-mono-adapter-zk8pg9jr.js → pi-mono-adapter-546cd1cc.js} +9 -9
- package/dist/{pricing-refresh-x7nhv23d.js → pricing-refresh-1rgzqyzz.js} +2 -3
- package/dist/{rbac-roles-9044425x.js → rbac-roles-e70xfeyj.js} +4 -6
- package/dist/{rbac-roles-bzvee6cf.js → rbac-roles-q89qe8er.js} +3 -3
- package/dist/{registry-hpjfmcfz.js → registry-32b1mft6.js} +1 -1
- package/dist/{render-v2-t7bn4skz.js → render-v2-k6tt107q.js} +9 -4
- package/dist/{resume-x94gemep.js → resume-cnnrjfxa.js} +6 -6
- package/dist/{runtime-breq6fmv.js → runtime-1hv06jsn.js} +1 -1
- package/dist/{session-access-q7dmqjvt.js → session-access-xkxkjw3n.js} +4 -4
- package/dist/{session-source-backfill-440ysamr.js → session-source-backfill-1d5pdwww.js} +2 -2
- package/dist/{setup-07n4727s.js → setup-se8q7gkc.js} +1 -1
- package/dist/{virtual-modules-z5h6mcyf.js → virtual-modules-gazyapte.js} +3 -3
- package/dist/{work-objects-pnq5y534.js → work-objects-1kxnbzy5.js} +22 -22
- package/dist/{worker-follow-up-7z1gfkr8.js → worker-follow-up-zqm8apt4.js} +18 -18
- package/dist/worker-j6xxtq7p.js +70 -0
- package/openapi.json +334 -7
- package/package.json +4 -4
- package/src/apps/catalog.generated.json +55 -0
- package/src/apps/definition.ts +11 -0
- package/src/apps/page-validator.ts +19 -0
- package/src/apps/store.ts +28 -8
- package/src/assets/key.ts +77 -4
- package/src/be/db/model-profiles.ts +147 -38
- package/src/be/db/session-labels.ts +57 -0
- package/src/be/db/session-tree.ts +51 -7
- package/src/be/db/slack-trees.ts +146 -0
- package/src/be/db/tasks/read.ts +107 -8
- package/src/be/db/workflow-run-definitions.ts +117 -0
- package/src/be/db-client.ts +8 -2
- package/src/be/db.ts +119 -87
- package/src/be/event-loop-lag.ts +146 -0
- package/src/be/mcp-overflow-sweep.ts +2 -1
- package/src/be/memory/constants.ts +14 -1
- package/src/be/memory/key-paths.ts +8 -0
- package/src/be/memory/providers/sqlite-store.ts +199 -18
- package/src/be/memory/task-learning.ts +79 -14
- package/src/be/memory/types.ts +24 -1
- package/src/be/migrations/278_slack_render_v2_reconcile.sql +108 -0
- package/src/be/migrations/279_backfill_learning_expiry.sql +15 -0
- package/src/be/migrations/281_model_profiles_pr2.sql +28 -0
- package/src/be/migrations/283_workflow_run_definitions.sql +14 -0
- package/src/be/model-profile-check.ts +284 -0
- package/src/be/model-tier-resolution.ts +112 -12
- package/src/be/multi-runtime.ts +27 -0
- package/src/be/runtime-pools/routing.ts +52 -4
- package/src/be/scripts/typecheck.ts +1 -0
- package/src/be/seed-scripts/catalog/dreaming-learnings.ts +552 -0
- package/src/be/seed-scripts/catalog/dreaming-memtax-create.ts +389 -14
- package/src/be/seed-scripts/catalog/dreaming-memtax.ts +6 -3
- package/src/be/seed-scripts/index.ts +9 -0
- package/src/be/steering.ts +8 -2
- package/src/be/swarm-config-guard.ts +2 -0
- package/src/commands/context-preamble.ts +258 -0
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/runner.ts +32 -1
- package/src/extensions/catalog.generated.json +3 -3
- package/src/fs/provider.ts +17 -3
- package/src/heartbeat/heartbeat.ts +17 -5
- package/src/heartbeat/index.ts +1 -0
- package/src/http/agents.ts +56 -4
- package/src/http/apps.ts +3 -1
- package/src/http/config.ts +2 -6
- package/src/http/core.ts +9 -3
- package/src/http/index.ts +12 -9
- package/src/http/memory.ts +9 -4
- package/src/http/model-profiles.ts +58 -10
- package/src/http/poll.ts +36 -3
- package/src/http/schedules.ts +42 -3
- package/src/http/sessions.ts +16 -3
- package/src/http/tasks.ts +37 -12
- package/src/http/utils.ts +18 -0
- package/src/http/webhooks.ts +48 -0
- package/src/http/workflows.ts +15 -2
- package/src/integrations/chat-sdk/commands.ts +167 -31
- package/src/integrations/chat-sdk/inbound.ts +10 -8
- package/src/integrations/chat-sdk/message-text.ts +117 -0
- package/src/prompts/session-templates.ts +1 -1
- package/src/providers/acp-targets.ts +11 -6
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-sdk-session.ts +132 -23
- package/src/providers/codex-skill-resolver.ts +10 -4
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/providers/devin-skill-resolver.ts +5 -5
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/scheduler/schedule-task.ts +1 -0
- package/src/scheduler/scheduler.ts +4 -1
- package/src/scripts-runtime/executors/quickjs-runner.ts +2 -0
- package/src/scripts-runtime/executors/quickjs-structured-clone.ts +180 -0
- package/src/scripts-runtime/quickjs-compat.ts +0 -1
- package/src/scripts-runtime/sdk-allowlist.ts +1 -0
- package/src/scripts-runtime/swarm-sdk.ts +18 -1
- package/src/scripts-runtime/types/stdlib.d.ts +1 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +1 -0
- package/src/server.ts +2 -0
- package/src/slack/app.ts +425 -10
- package/src/slack/handlers.ts +9 -2
- package/src/slack/inbound-dispatch.ts +18 -1
- package/src/slack/index.ts +7 -1
- package/src/slack/lifecycle-lock.ts +29 -0
- package/src/slack/render-v2.ts +424 -212
- package/src/slack/socket-fence.ts +64 -0
- package/src/slack/watcher.ts +42 -8
- package/src/slack/workspace-guard.ts +345 -0
- package/src/tasks/task-terminal-effects.ts +4 -0
- package/src/tasks/worker-follow-up.ts +102 -2
- package/src/tests/acp-adapter.test.ts +82 -0
- package/src/tests/apps-icon.test.ts +120 -0
- package/src/tests/apps-schema-form.test.ts +151 -0
- package/src/tests/chained-task-follow-up.test.ts +248 -0
- package/src/tests/chat-sdk-commands.test.ts +359 -2
- package/src/tests/chat-sdk-inbound.test.ts +20 -0
- package/src/tests/chat-sdk-slack.test.ts +189 -1
- package/src/tests/check-pr-body.test.ts +40 -0
- package/src/tests/claude-sdk-lifecycle.test.ts +216 -1
- package/src/tests/claude-sdk-process.fixture.ts +57 -0
- package/src/tests/codex-skill-resolver.test.ts +31 -0
- package/src/tests/credentials-allowlist.test.ts +470 -0
- package/src/tests/db-client-busy-retry.test.ts +69 -18
- package/src/tests/db-client.test.ts +26 -1
- package/src/tests/db-task-read-contract.test.ts +7 -0
- package/src/tests/db-task-write-contract.test.ts +6 -0
- package/src/tests/deferred-wake-follow-up.test.ts +47 -0
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/dreaming-learnings.test.ts +1395 -0
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/event-loop-lag.test.ts +184 -0
- package/src/tests/explicit-model-validation.test.ts +2 -0
- package/src/tests/extensions-example-comms-adherence-gate.test.ts +115 -0
- package/src/tests/fs-provider.test.ts +42 -0
- package/src/tests/github-webhook-early-ack.test.ts +144 -0
- package/src/tests/heartbeat.test.ts +28 -1
- package/src/tests/http-api-integration.test.ts +2 -0
- package/src/tests/http-log-scrubbing.test.ts +68 -2
- package/src/tests/human-free-reclassify.test.ts +5 -1
- package/src/tests/kv-storage.test.ts +92 -1
- package/src/tests/list-endpoint-slimming.test.ts +17 -0
- package/src/tests/memory-key-paths.test.ts +57 -0
- package/src/tests/memory-retrieval-purge.test.ts +19 -0
- package/src/tests/migration-283-workflow-run-definitions.test.ts +69 -0
- package/src/tests/model-profile-check.test.ts +387 -0
- package/src/tests/model-profiles-api.test.ts +528 -1
- package/src/tests/profile-claim.test.ts +415 -3
- package/src/tests/profile-tier-alias.test.ts +382 -0
- package/src/tests/quickjs-compat.test.ts +1 -1
- package/src/tests/runner-context-preamble.test.ts +552 -0
- package/src/tests/schedule-profile.test.ts +359 -0
- package/src/tests/script-connections.test.ts +9 -0
- package/src/tests/script-executor-conformance.test.ts +188 -0
- package/src/tests/script-per-script-executor.test.ts +1 -0
- package/src/tests/scripts-sdk-bridge-tool-failure.test.ts +141 -0
- package/src/tests/seed-scripts.test.ts +2 -2
- package/src/tests/sessions-tree.test.ts +133 -2
- package/src/tests/slack-app-icon.test.ts +4 -0
- package/src/tests/slack-dm-implicit-mention.test.ts +236 -0
- package/src/tests/slack-file-tools-attachments.test.ts +1 -0
- package/src/tests/slack-inbound-receipts.test.ts +22 -2
- package/src/tests/slack-read-boundaries.test.ts +4 -3
- package/src/tests/slack-render-v2-query-plans.test.ts +262 -3
- package/src/tests/slack-render-v2-reconcile.test.ts +201 -0
- package/src/tests/slack-socket-ack.test.ts +16 -1
- package/src/tests/slack-socket-watchdog.test.ts +748 -0
- package/src/tests/slack-workspace-guard.test.ts +905 -0
- package/src/tests/steering-core.test.ts +40 -0
- package/src/tests/store-progress-learning.test.ts +605 -20
- package/src/tests/tool-annotations.test.ts +1 -1
- package/src/tests/vcs-identity-inheritance.test.ts +85 -0
- package/src/tests/workflow-convergence.test.ts +46 -40
- package/src/tests/workflow-definition-pinning-recovery.test.ts +552 -0
- package/src/tests/workflow-definition-pinning.test.ts +645 -0
- package/src/tests/workflow-executors.test.ts +16 -7
- package/src/tests/workflow-foreach.test.ts +43 -20
- package/src/tests/workflow-notify-slack-ready.test.ts +161 -0
- package/src/tests/workflow-profile.test.ts +328 -0
- package/src/tools/app-upsert.ts +1 -1
- package/src/tools/memory-edit.ts +2 -1
- package/src/tools/model-profiles/check-model-profile.ts +63 -0
- package/src/tools/schedules/create-schedule.ts +45 -4
- package/src/tools/schedules/patch-schedule.ts +50 -4
- package/src/tools/schedules/update-schedule.ts +50 -4
- package/src/tools/send-task.ts +17 -2
- package/src/tools/store-progress.ts +15 -3
- package/src/tools/task-action.ts +9 -1
- package/src/tools/templates.ts +13 -0
- package/src/tools/tool-config.ts +2 -1
- package/src/tools/utils.ts +77 -11
- package/src/tools/workflows/create-workflow.ts +1 -1
- package/src/tools/workflows/retry-workflow-run.ts +1 -1
- package/src/tools/workflows/update-workflow.ts +10 -1
- package/src/types.ts +56 -1
- package/src/utils/credentials.ts +89 -12
- package/src/workflows/engine.ts +10 -1
- package/src/workflows/executors/agent-task.ts +21 -2
- package/src/workflows/executors/foreach.ts +4 -1
- package/src/workflows/executors/notify.ts +62 -6
- package/src/workflows/executors/sub-workflow.ts +1 -1
- package/src/workflows/executors/swarm-script.ts +4 -1
- package/src/workflows/foreach-driver.ts +8 -5
- package/src/workflows/limits.ts +2 -1
- package/src/workflows/model-validation.ts +27 -2
- package/src/workflows/patch-definition.ts +3 -1
- package/src/workflows/recovery.ts +6 -6
- package/src/workflows/resume.ts +9 -9
- package/src/workflows/retry-poller.ts +2 -2
- package/templates/extensions/comms-adherence-gate/README.md +25 -0
- package/templates/extensions/comms-adherence-gate/hooks.ts +100 -11
- package/templates/extensions/comms-adherence-gate/manifest.json +1 -1
- package/templates/skills/apps/SKILL.md +9 -0
- package/templates/skills/apps/content.md +9 -0
- package/templates/skills/code-quality/content.md +12 -0
- package/templates/skills/memory/content.md +8 -0
- package/templates/skills/scheduling/config.json +1 -1
- package/templates/skills/scheduling/content.md +2 -2
- package/templates/skills/swarm-docs/content.md +4 -0
- package/templates/skills/swarm-extensions/content.md +1 -1
- package/templates/skills/swarm-scripts/SKILL.md +1 -1
- package/templates/skills/swarm-scripts/content.md +1 -1
- package/templates/skills/work-on-task/SKILL.md +2 -0
- package/templates/skills/work-on-task/content.md +2 -0
- package/templates/workflows/dreaming/content.md +174 -7
- package/dist/acp-adapter-dn4gdsgr.js +0 -16
- package/dist/app-a66ssc4k.js +0 -17
- package/dist/cli-530hkwdy.js +0 -779
- package/dist/cli-a0657jmf.js +0 -339
- package/dist/cli-cyn9v8zr.js +0 -748
- package/dist/handlers-crckt5dq.js +0 -32
- package/dist/heartbeat-8phn1kdq.js +0 -41
- package/dist/index-4x08sjtk.js +0 -30
- package/dist/index-8ybffts4.js +0 -37
- package/dist/index-nfy4kkg5.js +0 -33
- package/dist/lead-zdqxsvjn.js +0 -71
- package/dist/worker-y62rvvq3.js +0 -71
- package/dist/{cli-gxy8y1dt.js → cli-8bpgbr8k.js} +3 -3
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
loadMcpConfig,
|
|
10
10
|
addMcpServerConfig,
|
|
11
11
|
removeMcpServerConfig
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-bsywb58a.js";
|
|
13
13
|
import {
|
|
14
14
|
McpOAuthCredentialStore2,
|
|
15
15
|
McpSignInCancelledError2,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
McpServerLog2,
|
|
18
18
|
createDefaultTransport2,
|
|
19
19
|
McpServerConnection2
|
|
20
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-3rkdne1h.js";
|
|
21
21
|
|
|
22
22
|
// node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js
|
|
23
23
|
import { existsSync } from "node:fs";
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
contextBoundNoteThreshold,
|
|
3
3
|
createContextBoundNote
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-xzm9vcfg.js";
|
|
5
5
|
import {
|
|
6
6
|
SessionErrorTracker
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-kc7v1nfv.js";
|
|
8
8
|
import {
|
|
9
9
|
summarizeSession
|
|
10
|
-
} from "./cli-
|
|
11
|
-
import {
|
|
12
|
-
resolveCodexPrompt
|
|
13
|
-
} from "./cli-jc1g9ndz.js";
|
|
10
|
+
} from "./cli-g70vxtjh.js";
|
|
14
11
|
import {
|
|
15
12
|
createSwarmEventHandler
|
|
16
13
|
} from "./cli-m5akxq8q.js";
|
|
@@ -29,6 +26,9 @@ import {
|
|
|
29
26
|
import {
|
|
30
27
|
hasCodexOAuthPoolSlots
|
|
31
28
|
} from "./cli-j4bwnpkm.js";
|
|
29
|
+
import {
|
|
30
|
+
resolveCodexPrompt
|
|
31
|
+
} from "./cli-5j88qqa8.js";
|
|
32
32
|
import {
|
|
33
33
|
CONTEXT_FORMULA,
|
|
34
34
|
computeContextUsedUnified,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
import {
|
|
64
64
|
DEFAULT_MODEL_TIER_MAP,
|
|
65
65
|
init_types4
|
|
66
|
-
} from "./cli-
|
|
66
|
+
} from "./cli-2zp0et3v.js";
|
|
67
67
|
import {
|
|
68
68
|
isCodexRejectedAccessError,
|
|
69
69
|
init_codex_auth_failure
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
init_src,
|
|
77
77
|
selectCredential,
|
|
78
78
|
init_credentials2
|
|
79
|
-
} from "./cli-
|
|
79
|
+
} from "./cli-5mrq3ake.js";
|
|
80
80
|
import {
|
|
81
81
|
runtimeCatalogModel,
|
|
82
82
|
init_runtime_model_catalog
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
import {
|
|
85
85
|
init_package,
|
|
86
86
|
package_default
|
|
87
|
-
} from "./cli-
|
|
87
|
+
} from "./cli-334z18y3.js";
|
|
88
88
|
import {
|
|
89
89
|
isEnvFlagEnabled,
|
|
90
90
|
isSessionSummarySkipped,
|
|
@@ -69,12 +69,35 @@ function keyPrefixRange(prefix) {
|
|
|
69
69
|
const lo = normalizeAssetKey(prefix);
|
|
70
70
|
return { lo, hi: `${lo.slice(0, -1)}${String.fromCharCode(lo.charCodeAt(lo.length - 1) + 1)}` };
|
|
71
71
|
}
|
|
72
|
+
function isResourceGroupPrefix(key) {
|
|
73
|
+
return resourcePrefixPattern.test(key);
|
|
74
|
+
}
|
|
75
|
+
function sessionResourceGroupOf(groupKey) {
|
|
76
|
+
const match = resourceGroupPattern.exec(groupKey);
|
|
77
|
+
if (!match || match[0] !== groupKey)
|
|
78
|
+
return null;
|
|
79
|
+
const kind = match[3];
|
|
80
|
+
if (match[5] && kind !== "app")
|
|
81
|
+
return null;
|
|
82
|
+
return {
|
|
83
|
+
kind,
|
|
84
|
+
id: match[4],
|
|
85
|
+
base: match[1],
|
|
86
|
+
resourceKey: `${match[1]}${match[2]}/`,
|
|
87
|
+
...match[5] ? { action: match[5].slice("action:".length) } : {}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
72
90
|
function sessionGroupKey(key) {
|
|
73
91
|
const normalized = normalizeAssetKey(key);
|
|
74
92
|
const namespace = parseAssetKey(normalized);
|
|
75
93
|
if (namespace.relativeSegments.length === 0)
|
|
76
94
|
return normalized;
|
|
77
|
-
|
|
95
|
+
const leaf = sessionLeafPattern.exec(normalized);
|
|
96
|
+
if (!leaf)
|
|
97
|
+
return normalized;
|
|
98
|
+
const group = normalized.slice(0, leaf.index + 1);
|
|
99
|
+
const resource = SESSION_RESOURCE_KINDS.includes(leaf[1]);
|
|
100
|
+
return resource && parseAssetKey(group).relativeSegments.length === 0 ? normalized : group;
|
|
78
101
|
}
|
|
79
102
|
function parseAssetKey(input) {
|
|
80
103
|
const key = normalizeAssetKey(input);
|
|
@@ -106,7 +129,7 @@ function canWriteAssetKey(input, trustedUserId) {
|
|
|
106
129
|
const parsed = parseAssetKey(input);
|
|
107
130
|
return parsed.root === "shared" || !!trustedUserId && parsed.userId === trustedUserId;
|
|
108
131
|
}
|
|
109
|
-
var ASSET_KEY_MAX_LENGTH = 255, AssetKeyError, SESSION_LEAF_KINDS, sessionLeafPattern;
|
|
132
|
+
var ASSET_KEY_MAX_LENGTH = 255, AssetKeyError, SESSION_RESOURCE_KINDS, SESSION_LEAF_KINDS, NO_GROUP_LEAF_KINDS, sessionLeafPattern, resourceGroupPattern, resourcePrefixPattern, RESOURCE_GROUPS_READ_ONLY = "Resource groups are read-only.";
|
|
110
133
|
var init_key = __esm(() => {
|
|
111
134
|
AssetKeyError = class AssetKeyError extends Error {
|
|
112
135
|
constructor(message) {
|
|
@@ -114,8 +137,19 @@ var init_key = __esm(() => {
|
|
|
114
137
|
this.name = "AssetKeyError";
|
|
115
138
|
}
|
|
116
139
|
};
|
|
117
|
-
|
|
118
|
-
|
|
140
|
+
SESSION_RESOURCE_KINDS = [
|
|
141
|
+
"page",
|
|
142
|
+
"workflow",
|
|
143
|
+
"schedule",
|
|
144
|
+
"app",
|
|
145
|
+
"script",
|
|
146
|
+
"fs"
|
|
147
|
+
];
|
|
148
|
+
SESSION_LEAF_KINDS = ["task", "thread", ...SESSION_RESOURCE_KINDS];
|
|
149
|
+
NO_GROUP_LEAF_KINDS = ["task", "thread"];
|
|
150
|
+
sessionLeafPattern = new RegExp(`/(${SESSION_LEAF_KINDS.join("|")}):[^/]+/$`);
|
|
151
|
+
resourceGroupPattern = new RegExp(`^(shared/|personal/[^/]+/)((${SESSION_RESOURCE_KINDS.join("|")}):([^/]+))/(?:(action:[^/]+)/)?`);
|
|
152
|
+
resourcePrefixPattern = new RegExp(`^(?:shared/|personal/[^/]+/)(?:${SESSION_RESOURCE_KINDS.join("|")}):`);
|
|
119
153
|
});
|
|
120
154
|
|
|
121
155
|
// src/extensions/bundle-path.ts
|
|
@@ -2139,7 +2173,7 @@ function checkExtensionInstallSource(body, ctx) {
|
|
|
2139
2173
|
ctx.addIssue({ code: "custom", path: ["files"], message: "files is required with manifest" });
|
|
2140
2174
|
}
|
|
2141
2175
|
}
|
|
2142
|
-
var AssetKeySchema, AssetEntityTypeSchema, AssetProviderRefSchema, AssetKeyMappingSchema, AssetSummarySchema, ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, LEGACY_MODEL_TO_TIER, DEFAULT_MODEL_TIER_MAP, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, OPEN_TASK_STATUSES, InboxMessageStatusSchema, InboxMessageSchema, AgentTaskSourceSchema, RoutingReasonSchema, RoutingSourceSchema, ProviderNameSchema, ModelProfileNameSchema, ModelProfileSchema, SessionShareAccessSchema, SessionAccessSchema, SessionOwnerSchema, SessionSharesSchema, SessionSharesUpdateSchema, SteerModeSchema, SteeringStatusSchema, SteeringSourceSchema, SteeringMessageSchema, SteerOutcomeSchema, OnUnsupportedSchema, SteerResultSchema, PROVIDER_STEER_CAPABILITIES, FollowUpConfigSchema, RoutingAffinitySchema, AgentTaskSchema, CreateTaskOptionsSchema, TaskAttachmentKindSchema, SERVER_GENERATED_ATTACHMENT_CAPABILITY = "_agentSwarmGeneratedBy", attachmentCapabilitiesSchema, attachmentCommonFields, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, RbacRoleSchema, UserRbacRolesSchema, UserCommsPrefsSchema, IdentityEventTypeSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, FavoriteItemTypeSchema, UserFavoriteSchema, TaskTemplateKindSchema, TaskTemplateSchema, AgentStatusSchema, AgentAvatarSchema, AgentSlackIconSchema, AgentSchema, AgentCredStatusKeyResultSchema, AgentCredStatusLiveTestSchema, AgentLatestModelSchema, AgentBedrockStatusSchema, AgentOpencodeGoStatusSchema, AcpSessionConfigSelectValueSchema, AcpSessionConfigSelectGroupSchema, AcpSessionConfigOptionSchema, AgentAcpStatusSchema, AgentCredStatusSchema, AgentWithTasksSchema, ChangeSourceSchema, VersionableFieldSchema, ContextVersionSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, AgentLogEventTypeSchema, ResumeReasonSchema, AgentLogSchema, SessionLogSchema, SessionCostSourceSchema, SessionCostModelBreakdownSchema, SessionCostSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, SwarmEventSchema, AutomationIntegrationIdSchema, ScheduledTaskTargetTypeSchema, ScheduledTaskSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, REPO_GUIDELINES_MAX_ENTRIES = 50, RepoGuidelinesInputSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, ActiveSessionSchema, WorkerNudgeSchema, RuntimeInstanceStatusSchema, RuntimeProviderKindSchema, DeliveryModeSchema, PoolLifecycleSchema, RuntimeResourcesSchema, RuntimeControllerCreateSchema, RuntimeControllerUpdateSchema, RuntimeControllerSchema, RuntimePoolCacheSchema, RuntimePoolCreateSchema, RuntimePoolUpdateSchema, RuntimePoolSchema, RuntimePoolCreateAgentSchema, RuntimeInstanceSchema, RetryPolicySchema, SUPERSEDED_WORKFLOW_TASK_REASON = "superseded_workflow_task", ExecutorMetaSchema, ValidationResultSchema, StepValidationConfigSchema, SwarmScriptNodeConfigSchema, WorkflowNodeSchema, WorkflowEdgeSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, WebhookVerificationSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, WorkflowTemplateSchema, WorkflowSnapshotSchema, WorkflowSchema, WorkflowVersionSchema, PageContentTypeSchema, PageAuthModeSchema, PageThemeTokensSchema, PageThemeTokensInputSchema, PageSnapshotSchema, PageSchema, PageVersionSchema, MetricParamSchema, MetricVariableTypeSchema, MetricFormatSchema, MetricVisualizationSchema, MetricQuerySchema, MetricVariableSchema, MetricVizConfigSchema, MetricWidgetSchema, MetricDefinitionSchema, MetricSnapshotSchema, MetricSchema, MetricVersionSchema, WorkflowRunStatusSchema, WorkflowRunSchema, WorkflowRunParentSchema, WorkflowRunSummarySchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, ScriptRunKindSchema, ScriptRunSchema, ScriptRunListItemSchema, ScriptRunJournalEntrySchema, WorkflowRunStepStatusSchema, WorkflowRunStepSchema, WorkflowRunStepSlimSchema, WaitModeSchema, WaitStateStatusSchema, WaitStateRowSchema, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptExecutorNameSchema, ScriptRecordSchema, ScriptVersionRecordSchema, ExtensionNameSchema, SemverSchema, ExtensionBundlePathSchema, ExtensionAssetNameSchema, ExtensionScriptAssetSchema, ExtensionScheduleAssetSchema, ExtensionWorkflowAssetSchema, ExtensionSkillAssetSchema, ExtensionWorkflowFileSchema, ExtensionManifestSchema, ExtensionStatusSchema, ExtensionSchema, ExtensionFileSchema, ExtensionVersionSchema, ExtensionRunSchema, ExtensionInstallBodySchema, ScriptApiAuthModeSchema, ScriptApiRecordSchema, SkillTypeSchema, SkillScopeSchema, SkillSchema, AgentSkillSchema, SkillWithInstallInfoSchema, SkillFileSchema, McpServerTransportSchema, McpServerScopeSchema, McpAuthMethodSchema, McpServerSchema, AgentMcpServerSchema, McpServerWithInstallInfoSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, ContextSnapshotSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, BudgetRefusedTriggerSchema, KvValueTypeSchema, KV_NAME_REGEX, KvNamespaceSchema, KvKeySchema, KvEntrySchema;
|
|
2176
|
+
var AssetKeySchema, AssetEntityTypeSchema, AssetProviderRefSchema, AssetKeyMappingSchema, AssetSummarySchema, ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, LEGACY_MODEL_TO_TIER, DEFAULT_MODEL_TIER_MAP, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, OPEN_TASK_STATUSES, InboxMessageStatusSchema, InboxMessageSchema, AgentTaskSourceSchema, RoutingReasonSchema, RoutingSourceSchema, ProviderNameSchema, ModelProfileNameSchema, ModelProfileCredentialsSchema, ModelProfileSchema, ProfileCheckStateSchema, ProfileCheckRowSchema, ProfileCheckResultSchema, SessionShareAccessSchema, SessionAccessSchema, SessionOwnerSchema, SessionSharesSchema, SessionSharesUpdateSchema, SteerModeSchema, SteeringStatusSchema, SteeringSourceSchema, SteeringMessageSchema, SteerOutcomeSchema, OnUnsupportedSchema, SteerResultSchema, PROVIDER_STEER_CAPABILITIES, FollowUpConfigSchema, RoutingAffinitySchema, AgentTaskSchema, CreateTaskOptionsSchema, TaskAttachmentKindSchema, SERVER_GENERATED_ATTACHMENT_CAPABILITY = "_agentSwarmGeneratedBy", attachmentCapabilitiesSchema, attachmentCommonFields, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, RbacRoleSchema, UserRbacRolesSchema, UserCommsPrefsSchema, IdentityEventTypeSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, FavoriteItemTypeSchema, UserFavoriteSchema, TaskTemplateKindSchema, TaskTemplateSchema, AgentStatusSchema, AgentAvatarSchema, AppIconSchema, AgentSlackIconSchema, AgentSchema, AgentCredStatusKeyResultSchema, AgentCredStatusLiveTestSchema, AgentLatestModelSchema, AgentBedrockStatusSchema, AgentOpencodeGoStatusSchema, AcpSessionConfigSelectValueSchema, AcpSessionConfigSelectGroupSchema, AcpSessionConfigOptionSchema, AgentAcpStatusSchema, AgentCredStatusSchema, AgentWithTasksSchema, ChangeSourceSchema, VersionableFieldSchema, ContextVersionSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, AgentLogEventTypeSchema, ResumeReasonSchema, AgentLogSchema, SessionLogSchema, SessionCostSourceSchema, SessionCostModelBreakdownSchema, SessionCostSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, SwarmEventSchema, AutomationIntegrationIdSchema, ScheduledTaskTargetTypeSchema, ScheduledTaskSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, REPO_GUIDELINES_MAX_ENTRIES = 50, RepoGuidelinesInputSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, ActiveSessionSchema, WorkerNudgeSchema, RuntimeInstanceStatusSchema, RuntimeProviderKindSchema, DeliveryModeSchema, PoolLifecycleSchema, RuntimeResourcesSchema, RuntimeControllerCreateSchema, RuntimeControllerUpdateSchema, RuntimeControllerSchema, RuntimePoolCacheSchema, RuntimePoolCreateSchema, RuntimePoolUpdateSchema, RuntimePoolSchema, RuntimePoolCreateAgentSchema, RuntimeInstanceSchema, RetryPolicySchema, SUPERSEDED_WORKFLOW_TASK_REASON = "superseded_workflow_task", ExecutorMetaSchema, ValidationResultSchema, StepValidationConfigSchema, SwarmScriptNodeConfigSchema, WorkflowNodeSchema, WorkflowEdgeSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, WebhookVerificationSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, WorkflowTemplateSchema, WorkflowSnapshotSchema, WorkflowSchema, WorkflowVersionSchema, PageContentTypeSchema, PageAuthModeSchema, PageThemeTokensSchema, PageThemeTokensInputSchema, PageSnapshotSchema, PageSchema, PageVersionSchema, MetricParamSchema, MetricVariableTypeSchema, MetricFormatSchema, MetricVisualizationSchema, MetricQuerySchema, MetricVariableSchema, MetricVizConfigSchema, MetricWidgetSchema, MetricDefinitionSchema, MetricSnapshotSchema, MetricSchema, MetricVersionSchema, WorkflowRunStatusSchema, WorkflowRunSchema, WorkflowRunParentSchema, WorkflowRunSummarySchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, ScriptRunKindSchema, ScriptRunSchema, ScriptRunListItemSchema, ScriptRunJournalEntrySchema, WorkflowRunStepStatusSchema, WorkflowRunStepSchema, WorkflowRunStepSlimSchema, WaitModeSchema, WaitStateStatusSchema, WaitStateRowSchema, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptExecutorNameSchema, ScriptRecordSchema, ScriptVersionRecordSchema, ExtensionNameSchema, SemverSchema, ExtensionBundlePathSchema, ExtensionAssetNameSchema, ExtensionScriptAssetSchema, ExtensionScheduleAssetSchema, ExtensionWorkflowAssetSchema, ExtensionSkillAssetSchema, ExtensionWorkflowFileSchema, ExtensionManifestSchema, ExtensionStatusSchema, ExtensionSchema, ExtensionFileSchema, ExtensionVersionSchema, ExtensionRunSchema, ExtensionInstallBodySchema, ScriptApiAuthModeSchema, ScriptApiRecordSchema, SkillTypeSchema, SkillScopeSchema, SkillSchema, AgentSkillSchema, SkillWithInstallInfoSchema, SkillFileSchema, McpServerTransportSchema, McpServerScopeSchema, McpAuthMethodSchema, McpServerSchema, AgentMcpServerSchema, McpServerWithInstallInfoSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, ContextSnapshotSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, BudgetRefusedTriggerSchema, KvValueTypeSchema, KV_NAME_REGEX, KvNamespaceSchema, KvKeySchema, KvEntrySchema;
|
|
2143
2177
|
var init_types4 = __esm(() => {
|
|
2144
2178
|
init_key();
|
|
2145
2179
|
init_bundle_path();
|
|
@@ -2362,6 +2396,7 @@ var init_types4 = __esm(() => {
|
|
|
2362
2396
|
"fx"
|
|
2363
2397
|
]);
|
|
2364
2398
|
ModelProfileNameSchema = string2().trim().regex(/^[a-z0-9][a-z0-9._-]{0,99}$/, "lowercase letters, digits, '.', '_' or '-', max 100");
|
|
2399
|
+
ModelProfileCredentialsSchema = record2(string2(), array2(string2().length(5)).min(1));
|
|
2365
2400
|
ModelProfileSchema = object2({
|
|
2366
2401
|
id: string2(),
|
|
2367
2402
|
name: string2(),
|
|
@@ -2371,9 +2406,25 @@ var init_types4 = __esm(() => {
|
|
|
2371
2406
|
allowCustomModel: boolean(),
|
|
2372
2407
|
description: string2().nullable(),
|
|
2373
2408
|
seededFrom: string2().nullable(),
|
|
2409
|
+
credentials: ModelProfileCredentialsSchema.nullable(),
|
|
2374
2410
|
createdAt: string2(),
|
|
2375
2411
|
lastUpdatedAt: string2()
|
|
2376
2412
|
});
|
|
2413
|
+
ProfileCheckStateSchema = _enum2(["pass", "warn", "fail", "unverified"]);
|
|
2414
|
+
ProfileCheckRowSchema = object2({
|
|
2415
|
+
check: _enum2(["harness", "model", "harness-credentials", "credential-allowlist"]),
|
|
2416
|
+
state: ProfileCheckStateSchema,
|
|
2417
|
+
detail: string2().optional()
|
|
2418
|
+
});
|
|
2419
|
+
ProfileCheckResultSchema = object2({
|
|
2420
|
+
agentId: string2(),
|
|
2421
|
+
ok: boolean(),
|
|
2422
|
+
profiles: array2(object2({
|
|
2423
|
+
name: string2(),
|
|
2424
|
+
ok: boolean(),
|
|
2425
|
+
checks: array2(ProfileCheckRowSchema)
|
|
2426
|
+
}))
|
|
2427
|
+
}).openapi("ProfileCheckResult");
|
|
2377
2428
|
SessionShareAccessSchema = _enum2(["read", "write"]);
|
|
2378
2429
|
SessionAccessSchema = _enum2(["owner", "write", "read"]);
|
|
2379
2430
|
SessionOwnerSchema = object2({ id: string2(), name: string2() }).openapi("SessionOwner");
|
|
@@ -2749,6 +2800,7 @@ var init_types4 = __esm(() => {
|
|
|
2749
2800
|
color: string2().regex(/^#[0-9a-fA-F]{6}$/).optional()
|
|
2750
2801
|
})
|
|
2751
2802
|
]);
|
|
2803
|
+
AppIconSchema = AgentAvatarSchema;
|
|
2752
2804
|
AgentSlackIconSchema = discriminatedUnion("type", [
|
|
2753
2805
|
object2({
|
|
2754
2806
|
type: literal2("emoji"),
|
|
@@ -3137,6 +3189,7 @@ var init_types4 = __esm(() => {
|
|
|
3137
3189
|
lastErrorMessage: string2().optional(),
|
|
3138
3190
|
model: string2().optional(),
|
|
3139
3191
|
modelTier: ModelTierSchema.optional(),
|
|
3192
|
+
profile: string2().optional(),
|
|
3140
3193
|
scheduleType: _enum2(["recurring", "one_time"]).default("recurring"),
|
|
3141
3194
|
targetType: ScheduledTaskTargetTypeSchema.default("agent-task"),
|
|
3142
3195
|
workflowId: uuid().optional(),
|
|
@@ -4250,4 +4303,4 @@ var init_types4 = __esm(() => {
|
|
|
4250
4303
|
}).openapi("KvEntry");
|
|
4251
4304
|
});
|
|
4252
4305
|
|
|
4253
|
-
export { ASSET_KEY_MAX_LENGTH, normalizeAssetKey, defaultAssetKey, keyPrefixRange, SESSION_LEAF_KINDS, sessionGroupKey, parseAssetKey, isCanonicalAssetKey, canWriteAssetKey, init_key, isSafeBundlePath, init_bundle_path, PAGE_THEME_COLOR_TOKENS, PAGE_THEME_SHARED_TOKENS, PAGE_THEME_TOKENS, HIVE_PAGE_TOKENS, init_tokens2, ThemeImportError, importThemeTokens, init_import, $OpenAPIRegistry, $OpenApiGeneratorV31, init_dist7, init_zod_openapi, AssetKeySchema, AssetEntityTypeSchema, AssetKeyMappingSchema, AssetSummarySchema, ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, DEFAULT_MODEL_TIER_MAP, parseModelTier, splitLegacyModelAlias, parseWorkerModelTierOverrides, resolveTaskModelSelection, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, isTerminalTaskStatus, OPEN_TASK_STATUSES, AgentTaskSourceSchema, RoutingReasonSchema, ProviderNameSchema, ModelProfileNameSchema, ModelProfileSchema, SessionAccessSchema, SessionOwnerSchema, SessionSharesSchema, SessionSharesUpdateSchema, SteerModeSchema, SteeringSourceSchema, SteeringMessageSchema, SteerOutcomeSchema, OnUnsupportedSchema, SteerResultSchema, PROVIDER_STEER_CAPABILITIES, FollowUpConfigSchema, RoutingAffinitySchema, AgentTaskSchema, CreateTaskOptionsSchema, SERVER_GENERATED_ATTACHMENT_CAPABILITY, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, RbacRoleSchema, UserRbacRolesSchema, UserCommsPrefsSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, FavoriteItemTypeSchema, UserFavoriteSchema, TaskTemplateKindSchema, TaskTemplateSchema, AgentStatusSchema, AgentAvatarSchema, AgentSlackIconSchema, AgentSchema, AgentLatestModelSchema, AgentAcpStatusSchema, AgentCredStatusSchema, AgentWithTasksSchema, VersionableFieldSchema, ChannelTypeSchema, ResumeReasonSchema, AgentLogSchema, SessionLogSchema, SessionCostModelBreakdownSchema, SessionCostSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, SwarmEventSchema, AutomationIntegrationIdSchema, ScheduledTaskTargetTypeSchema, ScheduledTaskSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesInputSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, ActiveSessionSchema, WorkerNudgeSchema, RuntimeProviderKindSchema, DeliveryModeSchema, RuntimeControllerCreateSchema, RuntimeControllerUpdateSchema, RuntimeControllerSchema, RuntimePoolCacheSchema, RuntimePoolCreateSchema, RuntimePoolUpdateSchema, RuntimePoolSchema, RuntimePoolCreateAgentSchema, RuntimeInstanceSchema, RetryPolicySchema, SUPERSEDED_WORKFLOW_TASK_REASON, WorkflowEdgeSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, WorkflowSchema, WorkflowVersionSchema, PageContentTypeSchema, PageAuthModeSchema, PageThemeTokensSchema, PageThemeTokensInputSchema, PageSchema, PageVersionSchema, MetricWidgetSchema, MetricDefinitionSchema, MetricSchema, MetricVersionSchema, WorkflowRunStatusSchema, WorkflowRunSchema, WorkflowRunParentSchema, WorkflowRunSummarySchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, ScriptRunSchema, ScriptRunListItemSchema, ScriptRunJournalEntrySchema, WorkflowRunStepSchema, WorkflowRunStepSlimSchema, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptExecutorNameSchema, ScriptRecordSchema, ScriptVersionRecordSchema, ExtensionWorkflowFileSchema, ExtensionManifestSchema, ExtensionSchema, ExtensionVersionSchema, ExtensionRunSchema, checkExtensionInstallSource, ExtensionInstallBodySchema, ScriptApiAuthModeSchema, ScriptApiRecordSchema, SkillSchema, AgentSkillSchema, SkillWithInstallInfoSchema, SkillFileSchema, McpAuthMethodSchema, McpServerSchema, AgentMcpServerSchema, McpServerWithInstallInfoSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, ContextSnapshotSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, BudgetRefusedTriggerSchema, KvValueTypeSchema, KvNamespaceSchema, KvKeySchema, KvEntrySchema, init_types4 };
|
|
4306
|
+
export { ASSET_KEY_MAX_LENGTH, normalizeAssetKey, defaultAssetKey, keyPrefixRange, SESSION_RESOURCE_KINDS, SESSION_LEAF_KINDS, NO_GROUP_LEAF_KINDS, isResourceGroupPrefix, RESOURCE_GROUPS_READ_ONLY, sessionResourceGroupOf, sessionGroupKey, parseAssetKey, isCanonicalAssetKey, canWriteAssetKey, init_key, isSafeBundlePath, init_bundle_path, PAGE_THEME_COLOR_TOKENS, PAGE_THEME_SHARED_TOKENS, PAGE_THEME_TOKENS, HIVE_PAGE_TOKENS, init_tokens2, ThemeImportError, importThemeTokens, init_import, $OpenAPIRegistry, $OpenApiGeneratorV31, init_dist7, init_zod_openapi, AssetKeySchema, AssetEntityTypeSchema, AssetKeyMappingSchema, AssetSummarySchema, ModelTierSchema, MODEL_TIERS, ReasoningEffortSchema, DEFAULT_MODEL_TIER_MAP, parseModelTier, splitLegacyModelAlias, parseWorkerModelTierOverrides, resolveTaskModelSelection, AgentTaskStatusSchema, TERMINAL_TASK_STATUSES, isTerminalTaskStatus, OPEN_TASK_STATUSES, AgentTaskSourceSchema, RoutingReasonSchema, ProviderNameSchema, ModelProfileNameSchema, ModelProfileCredentialsSchema, ModelProfileSchema, ProfileCheckResultSchema, SessionAccessSchema, SessionOwnerSchema, SessionSharesSchema, SessionSharesUpdateSchema, SteerModeSchema, SteeringSourceSchema, SteeringMessageSchema, SteerOutcomeSchema, OnUnsupportedSchema, SteerResultSchema, PROVIDER_STEER_CAPABILITIES, FollowUpConfigSchema, RoutingAffinitySchema, AgentTaskSchema, CreateTaskOptionsSchema, SERVER_GENERATED_ATTACHMENT_CAPABILITY, AttachmentInputSchema, TaskAttachmentSchema, UserSchema, RbacRoleSchema, UserRbacRolesSchema, UserCommsPrefsSchema, InboxItemTypeSchema, InboxItemStatusSchema, InboxItemStateSchema, FavoriteItemTypeSchema, UserFavoriteSchema, TaskTemplateKindSchema, TaskTemplateSchema, AgentStatusSchema, AgentAvatarSchema, AppIconSchema, AgentSlackIconSchema, AgentSchema, AgentLatestModelSchema, AgentAcpStatusSchema, AgentCredStatusSchema, AgentWithTasksSchema, VersionableFieldSchema, ChannelTypeSchema, ResumeReasonSchema, AgentLogSchema, SessionLogSchema, SessionCostModelBreakdownSchema, SessionCostSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, SwarmEventSchema, AutomationIntegrationIdSchema, ScheduledTaskTargetTypeSchema, ScheduledTaskSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesInputSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, ActiveSessionSchema, WorkerNudgeSchema, RuntimeProviderKindSchema, DeliveryModeSchema, RuntimeControllerCreateSchema, RuntimeControllerUpdateSchema, RuntimeControllerSchema, RuntimePoolCacheSchema, RuntimePoolCreateSchema, RuntimePoolUpdateSchema, RuntimePoolSchema, RuntimePoolCreateAgentSchema, RuntimeInstanceSchema, RetryPolicySchema, SUPERSEDED_WORKFLOW_TASK_REASON, WorkflowEdgeSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, WorkflowSchema, WorkflowVersionSchema, PageContentTypeSchema, PageAuthModeSchema, PageThemeTokensSchema, PageThemeTokensInputSchema, PageSchema, PageVersionSchema, MetricWidgetSchema, MetricDefinitionSchema, MetricSchema, MetricVersionSchema, WorkflowRunStatusSchema, WorkflowRunSchema, WorkflowRunParentSchema, WorkflowRunSummarySchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, ScriptRunSchema, ScriptRunListItemSchema, ScriptRunJournalEntrySchema, WorkflowRunStepSchema, WorkflowRunStepSlimSchema, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptExecutorNameSchema, ScriptRecordSchema, ScriptVersionRecordSchema, ExtensionWorkflowFileSchema, ExtensionManifestSchema, ExtensionSchema, ExtensionVersionSchema, ExtensionRunSchema, checkExtensionInstallSource, ExtensionInstallBodySchema, ScriptApiAuthModeSchema, ScriptApiRecordSchema, SkillSchema, AgentSkillSchema, SkillWithInstallInfoSchema, SkillFileSchema, McpAuthMethodSchema, McpServerSchema, AgentMcpServerSchema, McpServerWithInstallInfoSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, ContextSnapshotSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, BudgetRefusedTriggerSchema, KvValueTypeSchema, KvNamespaceSchema, KvKeySchema, KvEntrySchema, init_types4 };
|
|
@@ -7,7 +7,7 @@ var package_default;
|
|
|
7
7
|
var init_package = __esm(() => {
|
|
8
8
|
package_default = {
|
|
9
9
|
name: "@desplega.ai/agent-swarm",
|
|
10
|
-
version: "2.
|
|
10
|
+
version: "2.8.0",
|
|
11
11
|
description: "agent-swarm.dev — an open-source operating system for AI work: a lead agent breaks goals into tasks, routes them to specialized workers such as Claude Code or Codex, runs each worker in an isolated container, and preserves shared memory, tools, schedules, and review gates so delegated work compounds across sessions.",
|
|
12
12
|
keywords: [
|
|
13
13
|
"agent-swarm.dev",
|
|
@@ -211,7 +211,7 @@ var init_package = __esm(() => {
|
|
|
211
211
|
dependencies: {
|
|
212
212
|
"@agentclientprotocol/sdk": "2.4.0",
|
|
213
213
|
"@ai-sdk/openai": "^3.0.41",
|
|
214
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
214
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.318",
|
|
215
215
|
"@anthropic-ai/sdk": "^1.4.0",
|
|
216
216
|
"@asteasolutions/zod-to-openapi": "^8.0.0",
|
|
217
217
|
"@aws-sdk/client-bedrock": "3.1048.0",
|
|
@@ -220,8 +220,8 @@ var init_package = __esm(() => {
|
|
|
220
220
|
"@chat-adapter/slack": "4.41.1",
|
|
221
221
|
"@chat-adapter/teams": "4.41.1",
|
|
222
222
|
"@chat-adapter/telegram": "4.41.1",
|
|
223
|
-
"@cursor/sdk": "1.
|
|
224
|
-
"@desplega.ai/agent-fs-just-bash": "0.18.
|
|
223
|
+
"@cursor/sdk": "1.3.1",
|
|
224
|
+
"@desplega.ai/agent-fs-just-bash": "0.18.18",
|
|
225
225
|
"@desplega.ai/business-use": "^0.4.2",
|
|
226
226
|
"@earendil-works/pi-agent-core": "^1.5.0",
|
|
227
227
|
"@earendil-works/pi-ai": "^1.5.0",
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
resolveConfigValueOrThrow,
|
|
10
10
|
resolveHeadersOrThrow,
|
|
11
11
|
FileAuthStorageBackend
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-bsywb58a.js";
|
|
13
13
|
import {
|
|
14
14
|
oauthSuccessHtml,
|
|
15
15
|
oauthErrorHtml,
|
|
16
16
|
init_oauth_page
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-x1wa213s.js";
|
|
18
18
|
import {
|
|
19
19
|
__toESM
|
|
20
20
|
} from "./cli-242037k3.js";
|
|
@@ -4,24 +4,22 @@ import {
|
|
|
4
4
|
init_runtime2,
|
|
5
5
|
tierConfigKey,
|
|
6
6
|
init_model_tier_keys,
|
|
7
|
+
seedPricingFromModelsDev,
|
|
8
|
+
init_seed_pricing,
|
|
7
9
|
createModelProfile,
|
|
8
10
|
init_model_profiles,
|
|
9
11
|
init_db4
|
|
10
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-h38x262p.js";
|
|
11
13
|
import {
|
|
12
14
|
ensureRbacSeedsSynced2,
|
|
13
15
|
init_rbac_roles
|
|
14
|
-
} from "./cli-
|
|
15
|
-
import {
|
|
16
|
-
seedPricingFromModelsDev,
|
|
17
|
-
init_seed_pricing
|
|
18
|
-
} from "./cli-a0657jmf.js";
|
|
16
|
+
} from "./cli-c55z5chy.js";
|
|
19
17
|
import {
|
|
20
18
|
MODEL_TIERS,
|
|
21
19
|
DEFAULT_MODEL_TIER_MAP,
|
|
22
20
|
ProviderNameSchema,
|
|
23
21
|
init_types4
|
|
24
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-2zp0et3v.js";
|
|
25
23
|
import {
|
|
26
24
|
__esm
|
|
27
25
|
} from "./cli-242037k3.js";
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
var SLASH_COMMAND_REGEX = /^\/([a-z0-9:_-]+)(?:\s+(.*))?$/;
|
|
5
|
-
var
|
|
5
|
+
var DEFAULT_MAX_SKILL_CHARS = 1e5;
|
|
6
|
+
function getMaxSkillChars() {
|
|
7
|
+
const parsed = Number(process.env.MAX_SKILL_CHARS);
|
|
8
|
+
return Number.isInteger(parsed) && parsed > 0 ? parsed : DEFAULT_MAX_SKILL_CHARS;
|
|
9
|
+
}
|
|
6
10
|
function defaultSkillsDir() {
|
|
7
11
|
if (process.env.CODEX_SKILLS_DIR) {
|
|
8
12
|
return process.env.CODEX_SKILLS_DIR;
|
|
@@ -55,13 +59,14 @@ async function resolveSlashSkillPrompt(prompt, opts) {
|
|
|
55
59
|
});
|
|
56
60
|
return prompt;
|
|
57
61
|
}
|
|
58
|
-
|
|
62
|
+
const maxSkillChars = getMaxSkillChars();
|
|
63
|
+
if (skillContent.length > maxSkillChars) {
|
|
59
64
|
opts.emit?.({
|
|
60
65
|
type: "raw_stderr",
|
|
61
|
-
content: `[${opts.providerLabel}] skill resolver: SKILL.md for /${commandName} exceeds ${
|
|
66
|
+
content: `[${opts.providerLabel}] skill resolver: SKILL.md for /${commandName} exceeds ${maxSkillChars} chars (${skillContent.length}), truncating
|
|
62
67
|
`
|
|
63
68
|
});
|
|
64
|
-
skillContent = skillContent.slice(0,
|
|
69
|
+
skillContent = skillContent.slice(0, maxSkillChars);
|
|
65
70
|
}
|
|
66
71
|
if (opts.stripFrontmatter) {
|
|
67
72
|
skillContent = skillContent.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n/, "").trimStart();
|
|
@@ -76,4 +81,4 @@ ${rest}` : trailingArgs || rest;
|
|
|
76
81
|
User request: ${userRequestBody}`;
|
|
77
82
|
}
|
|
78
83
|
|
|
79
|
-
export { resolveCodexPrompt, resolveSlashSkillPrompt };
|
|
84
|
+
export { getMaxSkillChars, resolveCodexPrompt, resolveSlashSkillPrompt };
|
|
@@ -667,6 +667,9 @@ function deriveProviderFromKeyType(keyType) {
|
|
|
667
667
|
return "claude";
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
+
function keySuffix(value) {
|
|
671
|
+
return value.slice(-5);
|
|
672
|
+
}
|
|
670
673
|
function isJsonObject(value) {
|
|
671
674
|
const trimmed = value.trim();
|
|
672
675
|
if (!trimmed.startsWith("{") || !trimmed.endsWith("}"))
|
|
@@ -681,7 +684,7 @@ function isJsonObject(value) {
|
|
|
681
684
|
function splitCredentialPool(value) {
|
|
682
685
|
return isJsonObject(value) ? [value.trim()] : value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
683
686
|
}
|
|
684
|
-
function selectCredential(value, availableIndices, keyType = "ANTHROPIC_API_KEY") {
|
|
687
|
+
function selectCredential(value, availableIndices, keyType = "ANTHROPIC_API_KEY", allowedIndices) {
|
|
685
688
|
const credentials = splitCredentialPool(value);
|
|
686
689
|
if (credentials.length <= 1) {
|
|
687
690
|
const selected = value.trim();
|
|
@@ -690,33 +693,36 @@ function selectCredential(value, availableIndices, keyType = "ANTHROPIC_API_KEY"
|
|
|
690
693
|
selected,
|
|
691
694
|
index: 0,
|
|
692
695
|
total: 1,
|
|
693
|
-
keySuffix: selected
|
|
696
|
+
keySuffix: keySuffix(selected),
|
|
694
697
|
keyType,
|
|
695
698
|
isRateLimitFallback
|
|
696
699
|
};
|
|
697
700
|
}
|
|
701
|
+
const allowed = allowedIndices?.filter((i) => i >= 0 && i < credentials.length);
|
|
702
|
+
const drawFrom = allowed && allowed.length > 0 ? allowed : undefined;
|
|
703
|
+
const pickAny = () => drawFrom ? drawFrom[Math.floor(Math.random() * drawFrom.length)] : Math.floor(Math.random() * credentials.length);
|
|
698
704
|
let index;
|
|
699
705
|
let isRateLimitFallback = false;
|
|
700
706
|
if (availableIndices && availableIndices.length > 0) {
|
|
701
|
-
const validIndices = availableIndices.filter((i) => i >= 0 && i < credentials.length);
|
|
707
|
+
const validIndices = availableIndices.filter((i) => i >= 0 && i < credentials.length && (!drawFrom || drawFrom.includes(i)));
|
|
702
708
|
if (validIndices.length > 0) {
|
|
703
709
|
index = validIndices[Math.floor(Math.random() * validIndices.length)];
|
|
704
710
|
} else {
|
|
705
|
-
index =
|
|
711
|
+
index = pickAny();
|
|
706
712
|
isRateLimitFallback = true;
|
|
707
713
|
}
|
|
708
714
|
} else if (availableIndices && availableIndices.length === 0) {
|
|
709
|
-
index =
|
|
715
|
+
index = pickAny();
|
|
710
716
|
isRateLimitFallback = true;
|
|
711
717
|
} else {
|
|
712
|
-
index =
|
|
718
|
+
index = pickAny();
|
|
713
719
|
}
|
|
714
720
|
const selected = credentials[index];
|
|
715
721
|
return {
|
|
716
722
|
selected,
|
|
717
723
|
index,
|
|
718
724
|
total: credentials.length,
|
|
719
|
-
keySuffix: selected
|
|
725
|
+
keySuffix: keySuffix(selected),
|
|
720
726
|
keyType,
|
|
721
727
|
isRateLimitFallback
|
|
722
728
|
};
|
|
@@ -787,9 +793,22 @@ async function resolveCredentialPools(env, opts) {
|
|
|
787
793
|
for (const envVar of providerVars) {
|
|
788
794
|
const val = env[envVar];
|
|
789
795
|
if (val) {
|
|
796
|
+
const wanted = opts?.allowedKeySuffixes?.[envVar];
|
|
797
|
+
let allowedIdx;
|
|
798
|
+
if (wanted) {
|
|
799
|
+
allowedIdx = splitCredentialPool(val).flatMap((key, i) => wanted.includes(keySuffix(key)) ? [i] : []);
|
|
800
|
+
if (allowedIdx.length === 0) {
|
|
801
|
+
throw new CredentialAllowlistError({
|
|
802
|
+
profile: opts?.allowlistProfile,
|
|
803
|
+
keyType: envVar,
|
|
804
|
+
wanted
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
const inAllowlist = (i) => !allowedIdx || allowedIdx.includes(i);
|
|
790
809
|
const info = availableIndicesMap?.[envVar];
|
|
791
|
-
let available = info?.availableIndices;
|
|
792
|
-
let modelBlockedCount = info?.modelBlockedIndices?.length ?? 0;
|
|
810
|
+
let available = allowedIdx ? info?.availableIndices?.filter(inAllowlist) : info?.availableIndices;
|
|
811
|
+
let modelBlockedCount = allowedIdx ? info?.modelBlockedIndices?.filter(inAllowlist).length ?? 0 : info?.modelBlockedIndices?.length ?? 0;
|
|
793
812
|
if (available && window && opts?.localBlocks) {
|
|
794
813
|
const beforeCount = available.length;
|
|
795
814
|
available = available.filter((i) => {
|
|
@@ -799,13 +818,13 @@ async function resolveCredentialPools(env, opts) {
|
|
|
799
818
|
modelBlockedCount += beforeCount - available.length;
|
|
800
819
|
}
|
|
801
820
|
const seatBlockedIndices = info?.seatBlockedIndices ?? [];
|
|
802
|
-
const seatBlockedCount = seatBlockedIndices.length;
|
|
821
|
+
const seatBlockedCount = seatBlockedIndices.filter(inAllowlist).length;
|
|
803
822
|
let seatFallbackIndices;
|
|
804
823
|
if (opts?.enforceModelCapacity && modelFamily && available && available.length === 0) {
|
|
805
824
|
const policy = (env.MODEL_WINDOW_EXHAUSTED_POLICY ?? "fail").trim().toLowerCase();
|
|
806
825
|
const windowExhausted = window !== undefined && modelBlockedCount > 0 && policy !== "fallback";
|
|
807
826
|
if (seatBlockedCount > 0) {
|
|
808
|
-
seatFallbackIndices = splitCredentialPool(val).map((_, i) => i).filter((i) => !seatBlockedIndices.includes(i));
|
|
827
|
+
seatFallbackIndices = splitCredentialPool(val).map((_, i) => i).filter((i) => !seatBlockedIndices.includes(i) && inAllowlist(i));
|
|
809
828
|
}
|
|
810
829
|
if (windowExhausted || seatFallbackIndices?.length === 0) {
|
|
811
830
|
throw new ModelWindowExhaustedError({
|
|
@@ -818,7 +837,10 @@ async function resolveCredentialPools(env, opts) {
|
|
|
818
837
|
});
|
|
819
838
|
}
|
|
820
839
|
}
|
|
821
|
-
const result = seatFallbackIndices ? {
|
|
840
|
+
const result = seatFallbackIndices ? {
|
|
841
|
+
...selectCredential(val, seatFallbackIndices, envVar, allowedIdx),
|
|
842
|
+
isRateLimitFallback: true
|
|
843
|
+
} : selectCredential(val, available, envVar, allowedIdx);
|
|
822
844
|
env[envVar] = result.selected;
|
|
823
845
|
const availInfo = available ? ` (${available.length} available of ${result.total})` : "";
|
|
824
846
|
console.log(`[credentials] Selected ${envVar} credential ${result.index + 1}/${result.total}${availInfo} [...${result.keySuffix}]${info?.rejectedIndices?.length ? ` (${info.rejectedIndices.length} rejected)` : ""}`);
|
|
@@ -832,7 +854,7 @@ async function resolveCredentialPools(env, opts) {
|
|
|
832
854
|
}
|
|
833
855
|
return selections;
|
|
834
856
|
}
|
|
835
|
-
var CREDENTIAL_POOL_VARS, PROVIDER_CREDENTIAL_VARS, SLASH_MODEL_PROVIDERS, MODEL_LABELS, ModelWindowExhaustedError, CLAUDE_CREDENTIALS_HINT = "Set CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY, or route Claude Code through a gateway (ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY), Microsoft Foundry (CLAUDE_CODE_USE_FOUNDRY), Amazon Bedrock (CLAUDE_CODE_USE_BEDROCK), or Google Vertex AI (CLAUDE_CODE_USE_VERTEX).", CLAUDE_CREDENTIAL_TYPE_BY_PROVIDER;
|
|
857
|
+
var CREDENTIAL_POOL_VARS, PROVIDER_CREDENTIAL_VARS, SLASH_MODEL_PROVIDERS, MODEL_LABELS, ModelWindowExhaustedError, CredentialAllowlistError, CLAUDE_CREDENTIALS_HINT = "Set CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY, or route Claude Code through a gateway (ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY), Microsoft Foundry (CLAUDE_CODE_USE_FOUNDRY), Amazon Bedrock (CLAUDE_CODE_USE_BEDROCK), or Google Vertex AI (CLAUDE_CODE_USE_VERTEX).", CLAUDE_CREDENTIAL_TYPE_BY_PROVIDER;
|
|
836
858
|
var init_credentials2 = __esm(() => {
|
|
837
859
|
init_src2();
|
|
838
860
|
init_src();
|
|
@@ -891,6 +913,18 @@ var init_credentials2 = __esm(() => {
|
|
|
891
913
|
this.modelBlockedCount = modelBlockedCount;
|
|
892
914
|
}
|
|
893
915
|
};
|
|
916
|
+
CredentialAllowlistError = class CredentialAllowlistError extends Error {
|
|
917
|
+
profile;
|
|
918
|
+
keyType;
|
|
919
|
+
wanted;
|
|
920
|
+
constructor(opts) {
|
|
921
|
+
super(`credential allowlist for ${opts.profile ?? "this task"} matches no ${opts.keyType} key (wanted ${opts.wanted.join(", ")})`);
|
|
922
|
+
this.name = "CredentialAllowlistError";
|
|
923
|
+
this.profile = opts.profile ?? null;
|
|
924
|
+
this.keyType = opts.keyType;
|
|
925
|
+
this.wanted = opts.wanted;
|
|
926
|
+
}
|
|
927
|
+
};
|
|
894
928
|
CLAUDE_CREDENTIAL_TYPE_BY_PROVIDER = {
|
|
895
929
|
"claude-subscription": "oauth",
|
|
896
930
|
anthropic: "api_key",
|
|
@@ -898,4 +932,4 @@ var init_credentials2 = __esm(() => {
|
|
|
898
932
|
};
|
|
899
933
|
});
|
|
900
934
|
|
|
901
|
-
export { getRouteProvider, createScopedFetch, routeCredentialStatus, validateRoute, isFirstPartyAnthropicUrl, CODEX_GATEWAY_API_KEY, deriveDefaultRoute, routeUnsetEnv, init_src, MODEL_SCOPED_WINDOWS, modelFamilyOf, windowForModelFamily, isModelScopedWindow, parseModelLimitMessage, parseCreditsRequiredMessage, activeModelBlock, activeModelBlocks, init_model_rate_limit_windows, CREDENTIAL_POOL_VARS, normalizeProviderKeyAliases, deriveProviderFromKeyType, ModelWindowExhaustedError, splitCredentialPool, selectCredential, CLAUDE_CREDENTIALS_HINT, validateClaudeCredentials, openAICompatibleKeyLabels, validateOpencodeCredentials, resolveCredentialPools, init_credentials2 };
|
|
935
|
+
export { getRouteProvider, createScopedFetch, routeCredentialStatus, validateRoute, isFirstPartyAnthropicUrl, CODEX_GATEWAY_API_KEY, deriveDefaultRoute, routeUnsetEnv, init_src, MODEL_SCOPED_WINDOWS, modelFamilyOf, windowForModelFamily, isModelScopedWindow, parseModelLimitMessage, parseCreditsRequiredMessage, activeModelBlock, activeModelBlocks, init_model_rate_limit_windows, CREDENTIAL_POOL_VARS, normalizeProviderKeyAliases, PROVIDER_CREDENTIAL_VARS, getModelAwareCredentialVars, deriveProviderFromKeyType, ModelWindowExhaustedError, CredentialAllowlistError, keySuffix, splitCredentialPool, selectCredential, CLAUDE_CREDENTIALS_HINT, validateClaudeCredentials, openAICompatibleKeyLabels, validateOpencodeCredentials, resolveCredentialPools, init_credentials2 };
|
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
getKv2,
|
|
3
3
|
upsertKv2,
|
|
4
4
|
init_db4
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-h38x262p.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveIdentity,
|
|
8
8
|
init_identity,
|
|
9
9
|
recordUnmappedIdentity,
|
|
10
10
|
init_unmapped_identities
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-rfywm85n.js";
|
|
12
12
|
import {
|
|
13
13
|
findUserByExternalId,
|
|
14
14
|
findOrCreateUserByEmail,
|
|
15
15
|
linkIdentity,
|
|
16
16
|
init_users
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-gxkx0zzp.js";
|
|
18
18
|
import {
|
|
19
19
|
__esm
|
|
20
20
|
} from "./cli-242037k3.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
CONTROLLER_COMMAND_TIMEOUT_MS,
|
|
5
5
|
RuntimeHandleSchema,
|
|
6
6
|
ControllerStatusResultSchema
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-m4dqmnbp.js";
|
|
8
8
|
import {
|
|
9
9
|
getDbClient2,
|
|
10
10
|
validateControllerGraceSec,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
upsertSwarmConfig2,
|
|
22
22
|
getResolvedConfig2,
|
|
23
23
|
init_db4
|
|
24
|
-
} from "./cli-
|
|
24
|
+
} from "./cli-h38x262p.js";
|
|
25
25
|
import {
|
|
26
26
|
getPoolCache,
|
|
27
27
|
reconcileCacheReleases,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
getPoolForAgent2,
|
|
36
36
|
resolvePoolDelivery2,
|
|
37
37
|
init_db2
|
|
38
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-8kzasymh.js";
|
|
39
39
|
import {
|
|
40
40
|
workflowEventBus2,
|
|
41
41
|
init_event_bus
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
init_worker_follow_up,
|
|
46
46
|
canClaim,
|
|
47
47
|
init_budget_admission
|
|
48
|
-
} from "./cli-
|
|
48
|
+
} from "./cli-rfywm85n.js";
|
|
49
49
|
import {
|
|
50
50
|
runtimeStaleThresholdMinutes,
|
|
51
51
|
getRuntimeInstanceById,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
listRuntimeInstancesForAgent,
|
|
55
55
|
listRuntimeInstancesForPool,
|
|
56
56
|
init_multi_runtime
|
|
57
|
-
} from "./cli-
|
|
57
|
+
} from "./cli-qfedvmcr.js";
|
|
58
58
|
import {
|
|
59
59
|
isMultiRuntimeEnabled,
|
|
60
60
|
init_multi_runtime2
|
|
@@ -71,12 +71,12 @@ import {
|
|
|
71
71
|
import {
|
|
72
72
|
mintRuntimeToken,
|
|
73
73
|
init_users
|
|
74
|
-
} from "./cli-
|
|
74
|
+
} from "./cli-gxkx0zzp.js";
|
|
75
75
|
import {
|
|
76
76
|
TERMINAL_TASK_STATUSES,
|
|
77
77
|
isTerminalTaskStatus,
|
|
78
78
|
init_types4
|
|
79
|
-
} from "./cli-
|
|
79
|
+
} from "./cli-2zp0et3v.js";
|
|
80
80
|
import {
|
|
81
81
|
init_zod
|
|
82
82
|
} from "./cli-zcfpsfzf.js";
|
|
@@ -546,7 +546,7 @@ async function recoverSessions(runtimeId, reason) {
|
|
|
546
546
|
}
|
|
547
547
|
if (!sessions.length)
|
|
548
548
|
return;
|
|
549
|
-
const { remediateTaskForDeadRuntime } = await import("./heartbeat-
|
|
549
|
+
const { remediateTaskForDeadRuntime } = await import("./heartbeat-xgb036sx.js");
|
|
550
550
|
for (const session of sessions) {
|
|
551
551
|
try {
|
|
552
552
|
const task = await getTaskById2(session.taskId);
|