@desplega.ai/agent-swarm 2.5.4 → 2.6.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/README.md +2 -2
- package/dist/{acp-adapter-ek38cwsv.js → acp-adapter-dgfakfpw.js} +9 -9
- package/dist/{actions-92mepq03.js → actions-fbqma8aa.js} +21 -21
- package/dist/{amp-adapter-9gaxg015.js → amp-adapter-en0jy6hs.js} +4 -4
- package/dist/{app-ctn8gsgx.js → app-k8a5cgpp.js} +3 -3
- package/dist/{assistant-zyr5kz47.js → assistant-a16433gr.js} +29 -25
- package/dist/{boot-reembed-dwzfttdr.js → boot-reembed-6c1sjfnr.js} +1 -1
- package/dist/{boot-reembed-w75maga2.js → boot-reembed-f4nn561n.js} +1 -1
- package/dist/{boot-scrub-sweep-e9kq43kf.js → boot-scrub-sweep-d4w9gajf.js} +4 -4
- package/dist/{boot-seeds-x28v3fhb.js → boot-seeds-9bmkspyw.js} +4 -4
- package/dist/{claude-adapter-f0afqnne.js → claude-adapter-nys1kjxa.js} +9 -9
- package/dist/{claude-managed-adapter-x81a7r65.js → claude-managed-adapter-55207973.js} +2 -2
- package/dist/{claude-managed-setup-bqzwjd9x.js → claude-managed-setup-3cm35gey.js} +10 -3
- package/dist/{claude-sdk-session-7b7whkaq.js → claude-sdk-session-nw5yd8cp.js} +11 -11
- package/dist/{cli-c61mbdds.js → cli-03gg9pd1.js} +4 -4
- package/dist/{cli-kxpfx2xr.js → cli-0z1xjzwa.js} +2 -2
- package/dist/cli-1tem6ns9.js +894 -0
- package/dist/{cli-jbnn4vxb.js → cli-24j1jeeb.js} +3 -3
- package/dist/{cli-pzatvw94.js → cli-2sjhpsns.js} +2 -2
- package/dist/{cli-dew6x255.js → cli-39aet655.js} +2 -2
- package/dist/{cli-g1cw7xtt.js → cli-39rrw8yp.js} +1 -1
- package/dist/{cli-x0f2v69c.js → cli-3aqd4jaa.js} +12 -7
- package/dist/{cli-gbfxp48k.js → cli-3fwqy71j.js} +15 -15
- package/dist/{cli-7p4jxgtt.js → cli-3gfvmzht.js} +6 -6
- package/dist/{cli-03vpq45j.js → cli-3ndmpxxv.js} +2 -2
- package/dist/{cli-asq5ydm4.js → cli-4hxrf0p4.js} +131 -50
- package/dist/{cli-mz9afxxf.js → cli-4rf0f5vg.js} +15 -3
- package/dist/{cli-k4tjsdx9.js → cli-5rj83bam.js} +272 -195
- package/dist/{cli-sbwsxvtd.js → cli-5sckpqcx.js} +2 -2
- package/dist/{cli-cz5nmdxt.js → cli-683y0b3a.js} +2 -2
- package/dist/{cli-ethgy7ha.js → cli-6y51ryva.js} +2 -2
- package/dist/{cli-n4c8e3s5.js → cli-708wdy32.js} +1 -1
- package/dist/{cli-pasyvjmm.js → cli-737pyqxr.js} +1 -1
- package/dist/{cli-gx4rm0qx.js → cli-7enjwya9.js} +1 -1
- package/dist/{cli-6x9ma5w5.js → cli-803188pb.js} +1 -1
- package/dist/{cli-hh5we352.js → cli-9abdgn5t.js} +7 -7
- package/dist/{cli-ff1tm9n9.js → cli-a2rr0fmg.js} +1 -1
- package/dist/{cli-c952c7ac.js → cli-a34pr3w1.js} +2 -2
- package/dist/{cli-s682zgqz.js → cli-abkm71vr.js} +1 -1
- package/dist/{cli-mmhj8vd7.js → cli-ag2yrnt5.js} +11 -2
- package/dist/{cli-bvpgr9ny.js → cli-aj8djyqt.js} +5 -5
- package/dist/{cli-gwhjmh8g.js → cli-art7c1zh.js} +5 -5
- package/dist/{cli-5bnsc0e1.js → cli-az25fn5f.js} +4 -4
- package/dist/{cli-9s05422w.js → cli-bqztfyve.js} +1 -1
- package/dist/{cli-bn0rewsy.js → cli-c081bj3b.js} +2 -2
- package/dist/{cli-1r5ad7j5.js → cli-c2habvsf.js} +12 -12
- package/dist/{cli-64mh9mf3.js → cli-ca6banwz.js} +69 -17
- package/dist/{cli-25n3mv5d.js → cli-cz37jqss.js} +5 -5
- package/dist/{cli-6n8axjv1.js → cli-d2dpf95n.js} +2 -2
- package/dist/{cli-gn5af0x5.js → cli-emhjcj2y.js} +11 -11
- package/dist/{cli-6a1xg1p7.js → cli-esakngh8.js} +2 -2
- package/dist/{cli-ha9rmwgq.js → cli-fb8m699c.js} +2 -2
- package/dist/{cli-4b2z6n0m.js → cli-ffvsj2qw.js} +17 -8
- package/dist/{cli-abs8ndtr.js → cli-g20jjwt4.js} +26 -26
- package/dist/{cli-jb30dzvk.js → cli-g8ka5j4j.js} +446 -164
- package/dist/{cli-19202kew.js → cli-gf95q3bm.js} +5 -5
- package/dist/{cli-eftzyh9y.js → cli-gnsb1zxa.js} +2 -2
- package/dist/{cli-nwyw3zhg.js → cli-gxee0bqa.js} +1 -1
- package/dist/{cli-e42vss7b.js → cli-hfeb68z4.js} +5 -5
- package/dist/{cli-g9vd9ece.js → cli-k21gx5ht.js} +14 -16
- package/dist/{cli-tsma7p8v.js → cli-kf4jree9.js} +2 -2
- package/dist/{cli-dabehxhp.js → cli-kt907da6.js} +1 -1
- package/dist/{cli-wx2nj19m.js → cli-m5a9m0ak.js} +6 -6
- package/dist/{cli-621ce7kw.js → cli-m70bajzr.js} +3 -3
- package/dist/{cli-9j129brq.js → cli-mtnj4fwa.js} +6 -6
- package/dist/{cli-xzfq4at3.js → cli-mvjz5an3.js} +15 -11
- package/dist/{cli-277c31dw.js → cli-n7asmce6.js} +225 -3
- package/dist/{cli-xtrz6bzs.js → cli-nn6vx2mq.js} +1 -1
- package/dist/{cli-2655k16q.js → cli-nq677csy.js} +1 -1
- package/dist/{cli-0shx9j93.js → cli-pfk92eqz.js} +2 -2
- package/dist/{cli-wghjkr0e.js → cli-sqma6vw1.js} +10 -7
- package/dist/{cli-nzfnt2gs.js → cli-tf1n0r0b.js} +1 -1
- package/dist/{cli-qqzmjxkf.js → cli-v49fkghp.js} +11 -6
- package/dist/{cli-x77gen2p.js → cli-w2656ka1.js} +7 -7
- package/dist/{cli-5kqnemen.js → cli-yvy48785.js} +1 -1
- package/dist/{cli-m4ecdxvz.js → cli-zqne1qcj.js} +7 -7
- package/dist/cli.js +17 -17
- package/dist/{codex-adapter-wch12q99.js → codex-adapter-d95q4qsn.js} +7 -7
- package/dist/{codex-login-rn7c5gxt.js → codex-login-8cg0vhf2.js} +1 -1
- package/dist/{codex-session-runner-41pfcr95.js → codex-session-runner-gdwd8h0c.js} +8 -8
- package/dist/{commands-9849dkj6.js → commands-jqmgk54b.js} +2 -2
- package/dist/{controller-ja0sd95p.js → controller-z3jq589f.js} +4 -4
- package/dist/{controllers-connect-xp05dj6x.js → controllers-connect-r2za39ef.js} +23 -23
- package/dist/{cursor-adapter-623qxqew.js → cursor-adapter-4mr4jgkw.js} +2 -2
- package/dist/{db-47vj40dy.js → db-ppv2tze7.js} +3 -3
- package/dist/{db-w759qmx0.js → db-w36wwb5g.js} +4 -2
- package/dist/{devin-adapter-4ycy4vrf.js → devin-adapter-byen2cxt.js} +1 -1
- package/dist/{dispatcher-7b8e4z2j.js → dispatcher-pv5h77vf.js} +20 -20
- package/dist/{docker-s84hjs91.js → docker-fdzyewpz.js} +2 -2
- package/dist/{dsh-adapter-2ezw3xea.js → dsh-adapter-d4pdpb3r.js} +2 -2
- package/dist/{e2b-9gkdhm3c.js → e2b-222hsajc.js} +2 -2
- package/dist/{e2b-cjtf8k1z.js → e2b-fn3zacvt.js} +2 -2
- package/dist/{easter-egg-3d-e4qv8dxj.js → easter-egg-3d-4sp4dvmc.js} +1 -1
- package/dist/{event-bus-3z78ep5n.js → event-bus-pghg8hqy.js} +1 -1
- package/dist/{execute-0xpz8950.js → execute-jev839y1.js} +1 -1
- package/dist/{external-channel-e2s028da.js → external-channel-y6nkzhnn.js} +2 -2
- package/dist/{grok-adapter-ys7gaqee.js → grok-adapter-t08b9ntm.js} +10 -10
- package/dist/handlers-eqsnmv95.js +41 -0
- package/dist/{heartbeat-w3mntghj.js → heartbeat-vn31xwdk.js} +23 -23
- package/dist/{hook-g7kvv6x9.js → hook-6d0zbvvt.js} +6 -6
- package/dist/{hook-3jjywnpb.js → hook-cpjs8q51.js} +8 -8
- package/dist/{http-tkp7d4kb.js → http-9c6medda.js} +856 -99
- package/dist/{index-xdaahthb.js → index-38t35h0n.js} +20 -20
- package/dist/{index-3n8m9ea2.js → index-g6k9tctj.js} +1 -1
- package/dist/{index-1ef1myq2.js → index-k0yt1tvq.js} +20 -20
- package/dist/{index-31ceyf42.js → index-pkma1yf8.js} +1 -1
- package/dist/{index-q7m26kvs.js → index-qhjf2htm.js} +13 -10
- package/dist/index-yqgbfgaj.js +43 -0
- package/dist/{keepalive-v4ta8wgg.js → keepalive-em0117bp.js} +4 -4
- package/dist/lead-23e7z59t.js +79 -0
- package/dist/{maintenance-84n1ex21.js → maintenance-kbme3qy9.js} +1 -1
- package/dist/{oauth-refresh-sweep-vjnnandw.js → oauth-refresh-sweep-xysj4yse.js} +3 -3
- package/dist/{onboard-sfmpe4np.js → onboard-p6q0vz97.js} +3 -3
- package/dist/{opencode-adapter-jmpst4q4.js → opencode-adapter-esv3k9yn.js} +7 -7
- package/dist/{otel-impl-v6cc0zve.js → otel-impl-54qhqh1z.js} +2 -2
- package/dist/{pi-mono-adapter-fk8fkcf6.js → pi-mono-adapter-mymbwhj0.js} +10 -10
- package/dist/{pricing-refresh-fsk1e1zc.js → pricing-refresh-yb75wv33.js} +3 -3
- package/dist/{rbac-roles-prmkdnkw.js → rbac-roles-1vp2mw4p.js} +2 -2
- package/dist/{rbac-roles-zxmxqa39.js → rbac-roles-dexhc9x8.js} +1 -1
- package/dist/render-v2-tjay5hhf.js +16 -0
- package/dist/{resume-frdtgfa0.js → resume-8ayf37g5.js} +9 -9
- package/dist/{runtime-bt5pkpm1.js → runtime-hqe5cqcd.js} +1 -1
- package/dist/{session-access-fpez4y5q.js → session-access-fdhp987s.js} +4 -4
- package/dist/session-source-backfill-qgtc86z1.js +110 -0
- package/dist/{setup-mq6m3m8q.js → setup-4rrmqcq3.js} +1 -1
- package/dist/{virtual-modules-mnfbh5mr.js → virtual-modules-52km00d6.js} +2 -2
- package/dist/{work-objects-kfahhjsq.js → work-objects-p28fgd70.js} +23 -23
- package/dist/worker-e3w7vye1.js +79 -0
- package/dist/{x-pbpezr0s.js → x-wxrzvzx8.js} +2 -2
- package/openapi.json +1274 -32
- package/package.json +1 -1
- package/src/assets/source-key.ts +95 -0
- package/src/be/db/api-keys.ts +80 -0
- package/src/be/db/session-labels.ts +28 -0
- package/src/be/db/session-moves.ts +5 -6
- package/src/be/db/session-tree.ts +153 -14
- package/src/be/db/tasks/read.ts +11 -0
- package/src/be/db/tasks/write.ts +6 -1
- package/src/be/db/workflow-runs.ts +183 -1
- package/src/be/db-retention.ts +61 -6
- package/src/be/db.ts +59 -114
- package/src/be/memory/providers/openai-embedding.ts +5 -1
- package/src/be/migrations/244_api_key_validation.sql +4 -0
- package/src/be/onboarding.ts +4 -0
- package/src/be/scripts/typecheck.ts +1 -1
- package/src/be/session-source-backfill.ts +163 -0
- package/src/be/swarm-config-guard.ts +1 -0
- package/src/comb/review-batch.ts +28 -1
- package/src/comb/templates.ts +7 -2
- package/src/commands/claude-managed-setup.ts +7 -1
- package/src/commands/credential-refresh.ts +76 -1
- package/src/commands/credential-wait.ts +2 -2
- package/src/commands/provider-credentials.ts +210 -170
- package/src/commands/runner.ts +25 -4
- package/src/extensions/apply-task-create.ts +8 -1
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/extensions/contract.ts +5 -0
- package/src/http/all-routes.ts +2 -0
- package/src/http/api-keys.ts +53 -0
- package/src/http/assets.ts +15 -0
- package/src/http/codex-oauth-accounts.ts +191 -0
- package/src/http/comb.ts +15 -2
- package/src/http/config.ts +1 -1
- package/src/http/core.ts +6 -0
- package/src/http/fleet-benchmark.ts +5 -2
- package/src/http/index.ts +11 -0
- package/src/http/integrations.ts +5 -1
- package/src/http/kv.ts +8 -3
- package/src/http/onboarding.ts +6 -1
- package/src/http/pool-keys.ts +354 -0
- package/src/http/sessions.ts +37 -12
- package/src/http/stats.ts +1 -0
- package/src/http/status.ts +26 -12
- package/src/http/tasks.ts +3 -0
- package/src/http/used-by.ts +7 -2
- package/src/http/workflows.ts +78 -9
- package/src/integrations/chat-sdk/inbound.ts +27 -0
- package/src/kv-reserved-namespaces.ts +19 -0
- package/src/providers/acp-targets.ts +1 -1
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-adapter.ts +5 -1
- package/src/providers/claude-managed-adapter.ts +16 -9
- package/src/providers/codex-adapter.ts +71 -11
- package/src/scheduler/scheduler.ts +3 -2
- package/src/scripts-runtime/swarm-sdk.ts +7 -1
- package/src/scripts-runtime/types/stdlib.d.ts +1 -1
- package/src/scripts-runtime/types/swarm-extension.d.ts +17 -8
- package/src/scripts-runtime/types/swarm-sdk.d.ts +1 -1
- package/src/slack/assistant.ts +7 -0
- package/src/slack/channel-labels.ts +74 -0
- package/src/slack/handlers.ts +8 -0
- package/src/slack/inbound-files.ts +5 -2
- package/src/slack/thread-buffer.ts +4 -0
- package/src/tasks/sibling-awareness.ts +12 -3
- package/src/telemetry-context.ts +5 -6
- package/src/telemetry-identity.ts +3 -3
- package/src/tests/api-keys-validation.test.ts +170 -0
- package/src/tests/claude-managed-adapter.test.ts +46 -0
- package/src/tests/claude-routes-e2e.test.ts +7 -2
- package/src/tests/codex-credential-pools.test.ts +120 -0
- package/src/tests/codex-gateway-route.test.ts +165 -0
- package/src/tests/codex-oauth-accounts.test.ts +357 -0
- package/src/tests/comb-review-batch.test.ts +63 -2
- package/src/tests/config-pool-keys.test.ts +533 -0
- package/src/tests/credential-check.test.ts +290 -2
- package/src/tests/credential-refresh.test.ts +172 -1
- package/src/tests/db-retention.test.ts +9 -3
- package/src/tests/db-task-read-contract.test.ts +1 -0
- package/src/tests/db-task-write-contract.test.ts +1 -3
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/extensions-pre-task.test.ts +53 -1
- package/src/tests/fixtures/extensions/record-task-create/hooks.ts +9 -0
- package/src/tests/fixtures/extensions/record-task-create/manifest.json +7 -0
- package/src/tests/fleet-benchmark.test.ts +8 -0
- package/src/tests/get-workflow-run-tool.test.ts +98 -0
- package/src/tests/integrations-http.test.ts +32 -2
- package/src/tests/internal-ai/complete-structured.test.ts +37 -1
- package/src/tests/internal-ai/credentials.test.ts +23 -0
- package/src/tests/kv-http.test.ts +32 -0
- package/src/tests/kv-tool.test.ts +25 -0
- package/src/tests/multi-runtime-registration.test.ts +12 -12
- package/src/tests/onboarding.test.ts +108 -1
- package/src/tests/openai-embedding-credentials.test.ts +35 -0
- package/src/tests/openrouter-attribution-call-sites.test.ts +2 -2
- package/src/tests/org-website.test.ts +36 -0
- package/src/tests/provider-key-probes.test.ts +181 -0
- package/src/tests/rbac-e2e-helpers.test.ts +88 -1
- package/src/tests/rbac-e2e-helpers.ts +36 -11
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/script-runs-retention.test.ts +212 -0
- package/src/tests/sdk-allowlist.test.ts +39 -0
- package/src/tests/session-source-backfill.test.ts +429 -0
- package/src/tests/session-source-keys.test.ts +236 -0
- package/src/tests/session-source-labels.test.ts +419 -0
- package/src/tests/sessions-detail-batch.test.ts +2 -0
- package/src/tests/sessions-move.test.ts +131 -0
- package/src/tests/sessions-tree.test.ts +299 -2
- package/src/tests/slack-inbound-files.test.ts +103 -23
- package/src/tests/status.test.ts +101 -18
- package/src/tests/tasks-workflow-run-filter.test.ts +146 -0
- package/src/tests/test-net.ts +31 -0
- package/src/tests/transcription.test.ts +8 -0
- package/src/tests/used-by-route.test.ts +11 -0
- package/src/tests/workflow-cascade-cancel.test.ts +172 -0
- package/src/tests/workflow-http-v2.test.ts +131 -0
- package/src/tests/workflow-step-order.test.ts +92 -0
- package/src/tests/workflow-sub-workflow.test.ts +30 -0
- package/src/tools/get-tasks.ts +8 -0
- package/src/tools/kv/kv-read-auth.ts +4 -2
- package/src/tools/task-action.ts +1 -1
- package/src/tools/workflows/get-workflow-run.ts +14 -4
- package/src/types.ts +24 -0
- package/src/utils/company-profile.ts +51 -1
- package/src/utils/credentials.ts +5 -2
- package/src/utils/internal-ai/complete-structured.ts +5 -0
- package/src/utils/internal-ai/credentials.ts +4 -3
- package/src/utils/provider-key-probes.ts +328 -0
- package/src/utils/transcription.ts +4 -1
- package/src/workflows/executors/sub-workflow.ts +8 -1
- package/templates/ai-toolbox.manifest.json +2 -2
- package/templates/skills/researching/content.md +2 -0
- package/templates/skills/swarm-scripts/SKILL.md +1 -0
- package/templates/skills/swarm-scripts/content.md +1 -0
- package/dist/cli-7421jzsw.js +0 -84
- package/dist/cli-e45e4m6b.js +0 -413
- package/dist/cli-zw88zjba.js +0 -307
- package/dist/handlers-wy1dr6ja.js +0 -41
- package/dist/index-nmm79qgr.js +0 -43
- package/dist/lead-sawnyqxk.js +0 -79
- package/dist/render-v2-pjwxvnkw.js +0 -12
- package/dist/worker-v5e5rxj3.js +0 -79
|
@@ -15,17 +15,17 @@ import {
|
|
|
15
15
|
init_secret_registry,
|
|
16
16
|
upsertSwarmConfig2,
|
|
17
17
|
init_db3
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-g8ka5j4j.js";
|
|
19
19
|
import {
|
|
20
20
|
createRuntimeProvider,
|
|
21
21
|
init_runtime_providers
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-39aet655.js";
|
|
23
23
|
import {
|
|
24
24
|
closeSessionTokenConnections,
|
|
25
25
|
init_session_token_connections,
|
|
26
26
|
insertSessionToken,
|
|
27
27
|
init_users
|
|
28
|
-
} from "./cli-
|
|
28
|
+
} from "./cli-esakngh8.js";
|
|
29
29
|
import {
|
|
30
30
|
RuntimeControllerCreateSchema,
|
|
31
31
|
RuntimeControllerUpdateSchema,
|
|
@@ -33,13 +33,13 @@ import {
|
|
|
33
33
|
RuntimePoolUpdateSchema,
|
|
34
34
|
RuntimePoolCreateAgentSchema,
|
|
35
35
|
init_types
|
|
36
|
-
} from "./cli-
|
|
36
|
+
} from "./cli-4rf0f5vg.js";
|
|
37
37
|
import {
|
|
38
38
|
scrubSecrets,
|
|
39
39
|
registerVolatileSecret,
|
|
40
40
|
unregisterVolatileSecret,
|
|
41
41
|
init_secret_scrubber
|
|
42
|
-
} from "./cli-
|
|
42
|
+
} from "./cli-708wdy32.js";
|
|
43
43
|
import {
|
|
44
44
|
__esm
|
|
45
45
|
} from "./cli-242037k3.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
claimKv2,
|
|
5
5
|
deleteKv2,
|
|
6
6
|
init_db3
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-g8ka5j4j.js";
|
|
8
8
|
import {
|
|
9
9
|
isEnvFlagEnabled,
|
|
10
10
|
init_env_flag
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
scrubSecrets,
|
|
14
14
|
init_secret_scrubber
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-708wdy32.js";
|
|
16
16
|
|
|
17
17
|
// src/slack/external-channel.ts
|
|
18
18
|
init_db3();
|
|
@@ -773,4 +773,4 @@ var init_src2 = __esm(() => {
|
|
|
773
773
|
init_resolve_alias();
|
|
774
774
|
});
|
|
775
775
|
|
|
776
|
-
export { isAlias, parseAlias, resolveAlias, harnessCatalogSection, isHarnessModelJudged, normalizeGrokModel, harnessModelIds, modelFamilyKey, buildClaudeShortnameMap, harnessModelMismatch, openAICompatibleProviders, openAICompatibleProviderIds, providerKeyVars, openAICompatibleKeyVars, openAICompatibleBaseUrlVars, baseUrlOverride, ignoredBaseUrlVar, providerBaseUrl, openAICompatibleProvider, providerForModel, providerForKeyVar, providerKeyFromEnv, providerHarnessModels, withAgentChatRegistrySections, registryCatalogSections, withRegistryCatalogSections, dshCatalogRef, grokCatalogRef, cursorCatalogRef, reasoningLevelsFor, claudeCatalogModelId, init_src2 };
|
|
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 };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getSlackConfiguration,
|
|
3
|
-
init_config
|
|
4
|
-
} from "./cli-qeaq3j6t.js";
|
|
5
1
|
import {
|
|
6
2
|
isSteeringEnabled2,
|
|
7
3
|
init_steering_enabled
|
|
8
4
|
} from "./cli-4sydckyj.js";
|
|
5
|
+
import {
|
|
6
|
+
getSlackConfiguration,
|
|
7
|
+
init_config
|
|
8
|
+
} from "./cli-qeaq3j6t.js";
|
|
9
9
|
import {
|
|
10
10
|
init_templates3
|
|
11
11
|
} from "./cli-j6rktc91.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
scrubSecrets,
|
|
26
26
|
init_secret_scrubber
|
|
27
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-708wdy32.js";
|
|
28
28
|
import {
|
|
29
29
|
__esm
|
|
30
30
|
} from "./cli-242037k3.js";
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
contextStatePath,
|
|
3
3
|
contextBoundNoteMarkerPath,
|
|
4
4
|
recordContextState
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-nq677csy.js";
|
|
6
6
|
import {
|
|
7
7
|
runStopHookSessionSummarySubprocess
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-mtnj4fwa.js";
|
|
9
9
|
import {
|
|
10
10
|
redactRateLimitEventLine,
|
|
11
11
|
SessionErrorTracker,
|
|
12
12
|
trackErrorFromJson,
|
|
13
13
|
parseStderrForErrors
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-7enjwya9.js";
|
|
15
15
|
import {
|
|
16
16
|
swarmRuntimeInstanceId
|
|
17
17
|
} from "./cli-e8xyjvfc.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
} from "./cli-vbhgkw9h.js";
|
|
33
33
|
import {
|
|
34
34
|
applyReasoningEffort
|
|
35
|
-
} from "./cli-
|
|
35
|
+
} from "./cli-c081bj3b.js";
|
|
36
36
|
import {
|
|
37
37
|
fetchInstalledMcpServers
|
|
38
38
|
} from "./cli-bst1vp7e.js";
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
computeContextUsedUnified,
|
|
43
43
|
clampContextPercent,
|
|
44
44
|
init_context_window
|
|
45
|
-
} from "./cli-
|
|
45
|
+
} from "./cli-pfk92eqz.js";
|
|
46
46
|
import {
|
|
47
47
|
resolveClaudeTransport,
|
|
48
48
|
isClaudeBridgeEffective
|
|
@@ -53,18 +53,16 @@ import {
|
|
|
53
53
|
import {
|
|
54
54
|
withFileLock,
|
|
55
55
|
init_file_lock
|
|
56
|
-
} from "./cli-
|
|
57
|
-
import {
|
|
58
|
-
CLAUDE_CREDENTIALS_HINT,
|
|
59
|
-
validateClaudeCredentials,
|
|
60
|
-
init_credentials
|
|
61
|
-
} from "./cli-zw88zjba.js";
|
|
56
|
+
} from "./cli-hfeb68z4.js";
|
|
62
57
|
import {
|
|
63
58
|
routeCredentialStatus,
|
|
64
59
|
deriveDefaultRoute,
|
|
65
60
|
routeUnsetEnv,
|
|
66
|
-
init_src
|
|
67
|
-
|
|
61
|
+
init_src,
|
|
62
|
+
CLAUDE_CREDENTIALS_HINT,
|
|
63
|
+
validateClaudeCredentials,
|
|
64
|
+
init_credentials
|
|
65
|
+
} from "./cli-1tem6ns9.js";
|
|
68
66
|
import {
|
|
69
67
|
getOpenRouterAttributionHeaders,
|
|
70
68
|
init_openrouter_base_url
|
|
@@ -76,7 +74,7 @@ import {
|
|
|
76
74
|
import {
|
|
77
75
|
scrubSecrets,
|
|
78
76
|
init_secret_scrubber
|
|
79
|
-
} from "./cli-
|
|
77
|
+
} from "./cli-708wdy32.js";
|
|
80
78
|
import {
|
|
81
79
|
__toESM
|
|
82
80
|
} from "./cli-242037k3.js";
|
|
@@ -1261,7 +1259,7 @@ class ClaudeAdapter2 {
|
|
|
1261
1259
|
if (transport === "sdk" && isClaudeBridgeEffective(sourceEnv)) {
|
|
1262
1260
|
throw new Error("CLAUDE_TRANSPORT=sdk cannot run with an effective Claude Bridge configuration. Select CLI transport or disable the bridge.");
|
|
1263
1261
|
}
|
|
1264
|
-
const claudeSdk = transport === "sdk" ? await import("./claude-sdk-session-
|
|
1262
|
+
const claudeSdk = transport === "sdk" ? await import("./claude-sdk-session-nw5yd8cp.js") : undefined;
|
|
1265
1263
|
claudeSdk?.validateClaudeSdkAdditionalArgs([
|
|
1266
1264
|
...claudeBinaryArgv.slice(1),
|
|
1267
1265
|
...config.additionalArgs ?? []
|
|
@@ -1290,7 +1288,7 @@ class ClaudeAdapter2 {
|
|
|
1290
1288
|
}
|
|
1291
1289
|
if (isEnvFlagEnabled("CLAUDE_TRUST_PRESEED", true, sourceEnv)) {
|
|
1292
1290
|
try {
|
|
1293
|
-
await preseedClaudeTrustDialog(await resolveClaudeTrustDirs(config.cwd));
|
|
1291
|
+
await preseedClaudeTrustDialog(await resolveClaudeTrustDirs(config.cwd), sourceEnv.HOME || undefined);
|
|
1294
1292
|
} catch (err) {
|
|
1295
1293
|
console.warn(`\x1B[33m[claude]\x1B[0m ${scrubSecrets(`Failed to pre-seed trust for ${config.cwd}: ${err}`)}`);
|
|
1296
1294
|
}
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
acquireOAuthRefreshLock,
|
|
10
10
|
releaseOAuthRefreshLock,
|
|
11
11
|
init_oauth
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-g8ka5j4j.js";
|
|
13
13
|
import {
|
|
14
14
|
scrubSecrets,
|
|
15
15
|
registerVolatileSecret,
|
|
16
16
|
init_secret_scrubber
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-708wdy32.js";
|
|
18
18
|
|
|
19
19
|
// node_modules/oauth4webapi/build/index.js
|
|
20
20
|
var USER_AGENT;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
contextBoundNoteThreshold,
|
|
3
3
|
createContextBoundNote
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-nq677csy.js";
|
|
5
5
|
import {
|
|
6
6
|
ampBillsCacheWrites,
|
|
7
7
|
resolveAmpModel
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-bqztfyve.js";
|
|
9
9
|
import {
|
|
10
10
|
swarmRuntimeInstanceId
|
|
11
11
|
} from "./cli-e8xyjvfc.js";
|
|
@@ -22,18 +22,18 @@ import {
|
|
|
22
22
|
} from "./cli-jc1g9ndz.js";
|
|
23
23
|
import {
|
|
24
24
|
applyReasoningEffort
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-c081bj3b.js";
|
|
26
26
|
import {
|
|
27
27
|
CONTEXT_FORMULA,
|
|
28
28
|
computeContextUsedUnified,
|
|
29
29
|
clampContextPercent,
|
|
30
30
|
init_context_window
|
|
31
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-pfk92eqz.js";
|
|
32
32
|
import {
|
|
33
33
|
scrubSecrets,
|
|
34
34
|
registerVolatileSecret,
|
|
35
35
|
init_secret_scrubber
|
|
36
|
-
} from "./cli-
|
|
36
|
+
} from "./cli-708wdy32.js";
|
|
37
37
|
|
|
38
38
|
// src/providers/amp-adapter.ts
|
|
39
39
|
import { existsSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -42,7 +42,7 @@ import { tmpdir } from "node:os";
|
|
|
42
42
|
import { join } from "node:path";
|
|
43
43
|
init_context_window();
|
|
44
44
|
init_secret_scrubber();
|
|
45
|
-
var AMP_PACKAGE = "@ampcode/cli@0.0.
|
|
45
|
+
var AMP_PACKAGE = "@ampcode/cli@0.0.1792929650-g000512";
|
|
46
46
|
var AMP_MCP_SERVER_NAME = "agent-swarm";
|
|
47
47
|
var AMP_PLUGIN_MODE_KEY = "agent-swarm";
|
|
48
48
|
var AMP_LIVE_TEST_TIMEOUT_MS = 5000;
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
isGrokOpenRouterModel,
|
|
3
3
|
grokTargetProfile,
|
|
4
4
|
ACPAdapter2
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-zqne1qcj.js";
|
|
6
6
|
import {
|
|
7
7
|
getOpenRouterBaseUrl,
|
|
8
8
|
getOpenRouterAttributionHeaders,
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
registerVolatileSecret,
|
|
13
13
|
init_secret_scrubber
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-708wdy32.js";
|
|
15
15
|
import {
|
|
16
16
|
normalizeGrokModel,
|
|
17
17
|
init_src2
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-gxee0bqa.js";
|
|
19
19
|
|
|
20
20
|
// src/providers/grok-adapter.ts
|
|
21
21
|
init_src2();
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
materializeClaudeMd,
|
|
10
10
|
stopClaudeMd
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-2sjhpsns.js";
|
|
12
12
|
import {
|
|
13
13
|
summarizeSession
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-ag2yrnt5.js";
|
|
15
15
|
import {
|
|
16
16
|
contextBoundNoteThreshold,
|
|
17
17
|
injectClaimedContextBoundNote
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-nq677csy.js";
|
|
19
19
|
import {
|
|
20
20
|
guardGhPrBody,
|
|
21
21
|
guardGhPrRoom
|
|
@@ -31,11 +31,11 @@ import {
|
|
|
31
31
|
warnProfileFileTooLarge,
|
|
32
32
|
buildIndependentIdentityPayloads,
|
|
33
33
|
init_profile_sync
|
|
34
|
-
} from "./cli-
|
|
34
|
+
} from "./cli-hfeb68z4.js";
|
|
35
35
|
import {
|
|
36
36
|
init_package,
|
|
37
37
|
package_default
|
|
38
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-nn6vx2mq.js";
|
|
39
39
|
import {
|
|
40
40
|
MAX_PROFILE_FILE_LENGTH,
|
|
41
41
|
getMcpBaseUrl,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
import {
|
|
53
53
|
scrubSecrets,
|
|
54
54
|
init_secret_scrubber
|
|
55
|
-
} from "./cli-
|
|
55
|
+
} from "./cli-708wdy32.js";
|
|
56
56
|
|
|
57
57
|
// src/hooks/hook.ts
|
|
58
58
|
init_package();
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
getMostRecentTaskInThread2,
|
|
11
11
|
reactionName,
|
|
12
12
|
init_db3
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-g8ka5j4j.js";
|
|
14
14
|
import {
|
|
15
15
|
TaskCreationBlockedError,
|
|
16
16
|
buildEffectiveText,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
extractTaskFromMessage,
|
|
24
24
|
extractSlackMessageText,
|
|
25
25
|
dispatchPre2
|
|
26
|
-
} from "./cli-
|
|
26
|
+
} from "./cli-4hxrf0p4.js";
|
|
27
27
|
import {
|
|
28
28
|
noteSlackInboundSideEffect,
|
|
29
29
|
ignoreSlackInbound,
|
|
@@ -34,23 +34,23 @@ import {
|
|
|
34
34
|
isSlackRenderV2Enabled2,
|
|
35
35
|
ensureSlackThreadTree2,
|
|
36
36
|
registerTreeMessage
|
|
37
|
-
} from "./cli-
|
|
37
|
+
} from "./cli-g20jjwt4.js";
|
|
38
38
|
import {
|
|
39
39
|
isBlockExternalEnabled2,
|
|
40
40
|
invalidateChannelExternality2,
|
|
41
41
|
getChannelBlockReason2,
|
|
42
42
|
shouldBlockChannel2,
|
|
43
43
|
leaveExternalChannel2
|
|
44
|
-
} from "./cli-
|
|
44
|
+
} from "./cli-gnsb1zxa.js";
|
|
45
45
|
import {
|
|
46
46
|
workflowEventBus2,
|
|
47
47
|
init_event_bus
|
|
48
|
-
} from "./cli-
|
|
48
|
+
} from "./cli-kt907da6.js";
|
|
49
49
|
import {
|
|
50
50
|
enrichSlackUserEmail,
|
|
51
51
|
resolveSlackUserId,
|
|
52
52
|
rewriteSlackMentions
|
|
53
|
-
} from "./cli-
|
|
53
|
+
} from "./cli-24j1jeeb.js";
|
|
54
54
|
import {
|
|
55
55
|
wasEventSeen,
|
|
56
56
|
requestSlackThreadSteering,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
bufferThreadMessage,
|
|
59
59
|
getBufferMessageCount,
|
|
60
60
|
instantFlush
|
|
61
|
-
} from "./cli-
|
|
61
|
+
} from "./cli-sqma6vw1.js";
|
|
62
62
|
import {
|
|
63
63
|
resolveTemplate,
|
|
64
64
|
init_resolver
|
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
import {
|
|
80
80
|
scrubSecrets,
|
|
81
81
|
init_secret_scrubber
|
|
82
|
-
} from "./cli-
|
|
82
|
+
} from "./cli-708wdy32.js";
|
|
83
83
|
import {
|
|
84
84
|
__using,
|
|
85
85
|
__callDispose
|
|
@@ -400,6 +400,10 @@ function registerMessageHandler2(app) {
|
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
matches ??= await routeMessage(routingText, botUserId, botMentioned || isImplicitMention, routingThreadContext);
|
|
403
|
+
const slack = {
|
|
404
|
+
trigger: "mention",
|
|
405
|
+
messages: [{ ts: msg.ts, userId: msg.user, text: msg.text ?? "" }]
|
|
406
|
+
};
|
|
403
407
|
if (matches.length === 0) {
|
|
404
408
|
let __stack = [];
|
|
405
409
|
try {
|
|
@@ -451,7 +455,7 @@ ${taskDescription}`;
|
|
|
451
455
|
slackUserId: msg.user,
|
|
452
456
|
requestedByUserId,
|
|
453
457
|
contextKey: slackContextKey({ channelId: msg.channel, threadTs })
|
|
454
|
-
}, inbound);
|
|
458
|
+
}, inbound, slack);
|
|
455
459
|
await ackSlackMessage(client, msg.channel, msg.ts, reactionName("accepted"), "accepted");
|
|
456
460
|
await notifySlackFileFailures(client, msg.channel, threadTs, unattached);
|
|
457
461
|
if (isSlackRenderV2Enabled2()) {
|
|
@@ -544,7 +548,7 @@ ${taskDescription}`;
|
|
|
544
548
|
inheritParentOutputSchema: false,
|
|
545
549
|
requestedByUserId,
|
|
546
550
|
contextKey: slackContextKey({ channelId: msg.channel, threadTs })
|
|
547
|
-
}, inbound);
|
|
551
|
+
}, inbound, slack);
|
|
548
552
|
const { task } = created;
|
|
549
553
|
unattached.push(...created.unattached);
|
|
550
554
|
await ackSlackMessage(client, msg.channel, msg.ts, reactionName("accepted"), "accepted");
|
|
@@ -562,7 +566,7 @@ ${taskDescription}`;
|
|
|
562
566
|
slackUserId: msg.user,
|
|
563
567
|
requestedByUserId,
|
|
564
568
|
contextKey: slackContextKey({ channelId: msg.channel, threadTs })
|
|
565
|
-
}, inbound);
|
|
569
|
+
}, inbound, slack);
|
|
566
570
|
const { task } = created;
|
|
567
571
|
unattached.push(...created.unattached);
|
|
568
572
|
await ackSlackMessage(client, msg.channel, msg.ts, reactionName("accepted"), "accepted");
|
|
@@ -1,10 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
publicEndpointSsrfOptions
|
|
3
|
+
} from "./cli-3gfvmzht.js";
|
|
1
4
|
import {
|
|
2
5
|
getMemoryRaterNames
|
|
3
6
|
} from "./cli-3h26v7yj.js";
|
|
4
7
|
import {
|
|
5
8
|
normalizeOrgWebsite,
|
|
6
|
-
init_org_website
|
|
7
|
-
|
|
9
|
+
init_org_website,
|
|
10
|
+
assertUrlSafe
|
|
11
|
+
} from "./cli-g8ka5j4j.js";
|
|
12
|
+
import {
|
|
13
|
+
getRouteProvider,
|
|
14
|
+
createScopedFetch,
|
|
15
|
+
deriveDefaultRoute,
|
|
16
|
+
init_src
|
|
17
|
+
} from "./cli-1tem6ns9.js";
|
|
18
|
+
import {
|
|
19
|
+
getOpenRouterBaseUrl,
|
|
20
|
+
getOpenRouterAttributionHeaders,
|
|
21
|
+
init_openrouter_base_url
|
|
22
|
+
} from "./cli-dfyv0jdy.js";
|
|
23
|
+
import {
|
|
24
|
+
scrubSecrets,
|
|
25
|
+
init_secret_scrubber
|
|
26
|
+
} from "./cli-708wdy32.js";
|
|
27
|
+
import {
|
|
28
|
+
providerBaseUrl,
|
|
29
|
+
providerForKeyVar,
|
|
30
|
+
init_src2
|
|
31
|
+
} from "./cli-gxee0bqa.js";
|
|
8
32
|
|
|
9
33
|
// src/utils/lead-monitor-channels.ts
|
|
10
34
|
function isLeadChannelMonitoringEnabled(env = process.env) {
|
|
@@ -117,6 +141,204 @@ function isUnknownModelError(text, modelId) {
|
|
|
117
141
|
});
|
|
118
142
|
}
|
|
119
143
|
|
|
144
|
+
// src/utils/provider-key-probes.ts
|
|
145
|
+
init_src2();
|
|
146
|
+
init_src();
|
|
147
|
+
init_openrouter_base_url();
|
|
148
|
+
init_secret_scrubber();
|
|
149
|
+
var LIVE_TEST_TIMEOUT_MS = 5000;
|
|
150
|
+
function scrubProbeBody(body, init) {
|
|
151
|
+
const headers = new Headers(init.headers);
|
|
152
|
+
const apiKey = headers.get("x-api-key") ?? headers.get("authorization")?.replace(/^Bearer\s+/i, "");
|
|
153
|
+
return scrubSecrets(apiKey ? body.replaceAll(apiKey, "[REDACTED]") : body);
|
|
154
|
+
}
|
|
155
|
+
async function timedFetch(url, init, options = {}) {
|
|
156
|
+
const controller = new AbortController;
|
|
157
|
+
const timer = setTimeout(() => controller.abort(), LIVE_TEST_TIMEOUT_MS);
|
|
158
|
+
const start = Date.now();
|
|
159
|
+
try {
|
|
160
|
+
if (options.publicEndpoint)
|
|
161
|
+
assertUrlSafe(url, publicEndpointSsrfOptions());
|
|
162
|
+
const res = await fetch(url, {
|
|
163
|
+
...init,
|
|
164
|
+
...options.publicEndpoint ? { redirect: "manual" } : {},
|
|
165
|
+
signal: controller.signal
|
|
166
|
+
});
|
|
167
|
+
let bodyText = "";
|
|
168
|
+
try {
|
|
169
|
+
bodyText = scrubProbeBody(await res.text(), init);
|
|
170
|
+
} catch {}
|
|
171
|
+
return {
|
|
172
|
+
ok: res.ok,
|
|
173
|
+
status: res.status,
|
|
174
|
+
bodyText,
|
|
175
|
+
latency_ms: Date.now() - start
|
|
176
|
+
};
|
|
177
|
+
} finally {
|
|
178
|
+
clearTimeout(timer);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async function checkAnthropicApiKey(apiKey, options = {}) {
|
|
182
|
+
const r = await timedFetch("https://api.anthropic.com/v1/models", {
|
|
183
|
+
method: "GET",
|
|
184
|
+
headers: { "x-api-key": apiKey, "anthropic-version": "2023-06-01" }
|
|
185
|
+
}, options);
|
|
186
|
+
if (r.ok)
|
|
187
|
+
return { ok: true, latency_ms: r.latency_ms };
|
|
188
|
+
return {
|
|
189
|
+
ok: false,
|
|
190
|
+
error: scrubSecrets(`HTTP ${r.status}: ${r.bodyText.slice(0, 200)}`),
|
|
191
|
+
httpStatus: r.status,
|
|
192
|
+
latency_ms: r.latency_ms
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
async function checkOpenAiApiKey(apiKey, options = {}) {
|
|
196
|
+
const r = await timedFetch("https://api.openai.com/v1/models", {
|
|
197
|
+
method: "GET",
|
|
198
|
+
headers: { Authorization: `Bearer ${apiKey}` }
|
|
199
|
+
}, options);
|
|
200
|
+
if (r.ok)
|
|
201
|
+
return { ok: true, latency_ms: r.latency_ms };
|
|
202
|
+
return {
|
|
203
|
+
ok: false,
|
|
204
|
+
error: scrubSecrets(`HTTP ${r.status}: ${r.bodyText.slice(0, 200)}`),
|
|
205
|
+
httpStatus: r.status,
|
|
206
|
+
latency_ms: r.latency_ms
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
async function checkXaiApiKey(apiKey, options = {}) {
|
|
210
|
+
const r = await timedFetch("https://api.x.ai/v1/models", {
|
|
211
|
+
method: "GET",
|
|
212
|
+
headers: { Authorization: `Bearer ${apiKey}` }
|
|
213
|
+
}, options);
|
|
214
|
+
if (r.ok)
|
|
215
|
+
return { ok: true, latency_ms: r.latency_ms };
|
|
216
|
+
return {
|
|
217
|
+
ok: false,
|
|
218
|
+
error: scrubSecrets(`HTTP ${r.status}: ${r.bodyText.slice(0, 200)}`),
|
|
219
|
+
httpStatus: r.status,
|
|
220
|
+
latency_ms: r.latency_ms
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
async function checkBearerGet(url, init, options = {}) {
|
|
224
|
+
const r = await timedFetch(url, { method: "GET", ...init }, options);
|
|
225
|
+
if (r.ok)
|
|
226
|
+
return { ok: true, latency_ms: r.latency_ms };
|
|
227
|
+
return {
|
|
228
|
+
ok: false,
|
|
229
|
+
error: scrubSecrets(`HTTP ${r.status}: ${r.bodyText.slice(0, 200)}`),
|
|
230
|
+
httpStatus: r.status,
|
|
231
|
+
latency_ms: r.latency_ms
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
async function checkOpenRouter(apiKey, options = {}) {
|
|
235
|
+
const base = getOpenRouterBaseUrl(options.env);
|
|
236
|
+
const get = (url) => checkBearerGet(url, {
|
|
237
|
+
headers: {
|
|
238
|
+
...getOpenRouterAttributionHeaders(url, options.env),
|
|
239
|
+
Authorization: `Bearer ${apiKey}`
|
|
240
|
+
}
|
|
241
|
+
}, options);
|
|
242
|
+
const keyResult = await get(`${base}/key`);
|
|
243
|
+
if (keyResult.httpStatus === 404 || keyResult.httpStatus === 405)
|
|
244
|
+
return get(`${base}/models`);
|
|
245
|
+
return keyResult;
|
|
246
|
+
}
|
|
247
|
+
function checkDeepSeekApiKey(apiKey, options = {}) {
|
|
248
|
+
return checkBearerGet("https://api.deepseek.com/models", {
|
|
249
|
+
headers: { Authorization: `Bearer ${apiKey}` }
|
|
250
|
+
}, options);
|
|
251
|
+
}
|
|
252
|
+
async function checkOpenAICompatibleProvider(provider, apiKey, baseUrl = provider.baseUrl, options = {}) {
|
|
253
|
+
const r = await timedFetch(`${baseUrl.replace(/\/+$/, "")}/models`, {
|
|
254
|
+
method: "GET",
|
|
255
|
+
headers: { Authorization: `Bearer ${apiKey}` }
|
|
256
|
+
}, options);
|
|
257
|
+
if (r.ok)
|
|
258
|
+
return { ok: true, latency_ms: r.latency_ms };
|
|
259
|
+
return {
|
|
260
|
+
ok: false,
|
|
261
|
+
error: scrubSecrets(`HTTP ${r.status}: ${r.bodyText.slice(0, 200)}`),
|
|
262
|
+
httpStatus: r.status,
|
|
263
|
+
latency_ms: r.latency_ms
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
async function checkRoute(route, env) {
|
|
267
|
+
const startedAt = Date.now();
|
|
268
|
+
const provider = getRouteProvider(route.provider);
|
|
269
|
+
const baseUrl = route.baseUrl ?? provider?.defaultBaseUrl;
|
|
270
|
+
if (!provider?.validate || !baseUrl)
|
|
271
|
+
return { ok: true, skipped: true, latency_ms: 0 };
|
|
272
|
+
const publicFetch = async (url, init) => {
|
|
273
|
+
assertUrlSafe(String(url), publicEndpointSsrfOptions());
|
|
274
|
+
const res = await fetch(url, init);
|
|
275
|
+
if (res.ok || !res.body)
|
|
276
|
+
return res;
|
|
277
|
+
return new Response(scrubProbeBody(await res.text(), init ?? {}), {
|
|
278
|
+
status: res.status,
|
|
279
|
+
statusText: res.statusText,
|
|
280
|
+
headers: res.headers
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
const result = await provider.validate({
|
|
284
|
+
route,
|
|
285
|
+
env,
|
|
286
|
+
signal: AbortSignal.timeout(LIVE_TEST_TIMEOUT_MS),
|
|
287
|
+
fetch: createScopedFetch(baseUrl, publicFetch)
|
|
288
|
+
});
|
|
289
|
+
const latency_ms = Date.now() - startedAt;
|
|
290
|
+
if (result.status === "verified")
|
|
291
|
+
return { ok: true, latency_ms };
|
|
292
|
+
return {
|
|
293
|
+
ok: result.status === "configured",
|
|
294
|
+
...result.status === "configured" ? { skipped: true } : { httpStatus: result.httpStatus },
|
|
295
|
+
error: scrubSecrets(result.reason),
|
|
296
|
+
latency_ms
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
async function checkProviderPoolKey(keyType, apiKey, env = process.env) {
|
|
300
|
+
const startedAt = Date.now();
|
|
301
|
+
const options = { env, publicEndpoint: true };
|
|
302
|
+
try {
|
|
303
|
+
switch (keyType) {
|
|
304
|
+
case "ANTHROPIC_API_KEY": {
|
|
305
|
+
const keyEnv = { ...env, ANTHROPIC_API_KEY: apiKey };
|
|
306
|
+
const route = deriveDefaultRoute("claude", keyEnv);
|
|
307
|
+
if (route?.provider === "anthropic-gateway" && "secretKey" in route.auth && route.auth.secretKey === "ANTHROPIC_API_KEY") {
|
|
308
|
+
return await checkRoute(route, keyEnv);
|
|
309
|
+
}
|
|
310
|
+
return await checkAnthropicApiKey(apiKey, options);
|
|
311
|
+
}
|
|
312
|
+
case "OPENAI_API_KEY":
|
|
313
|
+
return await checkOpenAiApiKey(apiKey, options);
|
|
314
|
+
case "OPENROUTER_API_KEY":
|
|
315
|
+
return await checkOpenRouter(apiKey, options);
|
|
316
|
+
case "DEEPSEEK_API_KEY":
|
|
317
|
+
return await checkDeepSeekApiKey(apiKey, options);
|
|
318
|
+
case "XAI_API_KEY":
|
|
319
|
+
return await checkXaiApiKey(apiKey, options);
|
|
320
|
+
case "CLAUDE_CODE_OAUTH_TOKEN": {
|
|
321
|
+
const tokenEnv = { CLAUDE_CODE_OAUTH_TOKEN: apiKey };
|
|
322
|
+
return await checkRoute(deriveDefaultRoute("claude", tokenEnv), tokenEnv);
|
|
323
|
+
}
|
|
324
|
+
default: {
|
|
325
|
+
const provider = providerForKeyVar(keyType);
|
|
326
|
+
if (provider) {
|
|
327
|
+
return await checkOpenAICompatibleProvider(provider, apiKey, providerBaseUrl(provider, env), options);
|
|
328
|
+
}
|
|
329
|
+
return { ok: true, skipped: true, latency_ms: 0 };
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
} catch (err) {
|
|
333
|
+
const raw = err instanceof Error ? err.message : String(err);
|
|
334
|
+
return {
|
|
335
|
+
ok: false,
|
|
336
|
+
error: scrubSecrets(raw.split(apiKey).join("[REDACTED]")) || "Unknown error",
|
|
337
|
+
latency_ms: Date.now() - startedAt
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
120
342
|
// src/utils/skill-fs-writer.ts
|
|
121
343
|
import { existsSync, mkdirSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
122
344
|
import { dirname, join } from "node:path";
|
|
@@ -256,4 +478,4 @@ function writeSkillsToFilesystem(entries, harnessType = "all", home) {
|
|
|
256
478
|
return { synced, removed, errors };
|
|
257
479
|
}
|
|
258
480
|
|
|
259
|
-
export { isLeadChannelMonitoringEnabled, ORG_IDENTITY_KEYS, orgIdentityStatus, SIMILARITY_THRESHOLD, memoryRelevance, renderMemoriesPrompt, isUnknownModelError, writeSkillsToFilesystem };
|
|
481
|
+
export { isLeadChannelMonitoringEnabled, ORG_IDENTITY_KEYS, orgIdentityStatus, SIMILARITY_THRESHOLD, memoryRelevance, renderMemoriesPrompt, isUnknownModelError, timedFetch, checkAnthropicApiKey, checkOpenAiApiKey, checkXaiApiKey, checkOpenRouter, checkDeepSeekApiKey, checkOpenAICompatibleProvider, checkProviderPoolKey, writeSkillsToFilesystem };
|
|
@@ -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.6.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",
|