@desplega.ai/agent-swarm 1.166.0 → 1.167.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-zpvy6321.js +34 -0
- package/dist/{actions-qz3m692w.js → actions-fq2zrwtf.js} +25 -25
- package/dist/{amp-adapter-j1xbmsqz.js → amp-adapter-5gbk7501.js} +4 -4
- package/dist/{anthropic-messages-hst62ws9.js → anthropic-messages-13yn502s.js} +4 -4
- package/dist/{app-43vrdmv8.js → app-nctetn1e.js} +10 -9
- package/dist/{assistant-ertffmka.js → assistant-0aq8gjvj.js} +26 -26
- package/dist/{azure-openai-responses-mh8tvf78.js → azure-openai-responses-9st34pfz.js} +5 -5
- package/dist/{boot-reembed-998jtpdg.js → boot-reembed-1ze5853n.js} +9 -8
- package/dist/{boot-reembed-s7k7c6v2.js → boot-reembed-fmp5ww69.js} +9 -8
- package/dist/{boot-scrub-sweep-nepsk4t1.js → boot-scrub-sweep-cbp8xd4e.js} +10 -9
- package/dist/{boot-seeds-vvzs1zhk.js → boot-seeds-22tx8a53.js} +12 -11
- package/dist/{claude-adapter-2zvmekrp.js → claude-adapter-0jhgeh1d.js} +24 -22
- package/dist/{claude-managed-adapter-s49wbk8t.js → claude-managed-adapter-tzwxy803.js} +4 -4
- package/dist/{claude-managed-setup-cvhqq8qn.js → claude-managed-setup-nrhfx5b0.js} +3 -3
- package/dist/{claude-sdk-session-kkbxtw5q.js → claude-sdk-session-wh77rh83.js} +22 -22
- package/dist/{cli-zsh093hk.js → cli-014vns2y.js} +63 -1
- package/dist/{cli-qvfk83fy.js → cli-13xwcqvj.js} +2 -2
- package/dist/{cli-dw2q9f7g.js → cli-1yrcfa5s.js} +4 -4
- package/dist/{cli-jvj6a0cv.js → cli-577bxkf6.js} +27 -17
- package/dist/{cli-zy7vwsne.js → cli-5qkcdv8c.js} +16 -9
- package/dist/{cli-cwxhbf43.js → cli-5t5my0h8.js} +85 -2
- package/dist/{cli-y59h2pk9.js → cli-69egj654.js} +1 -1
- package/dist/{cli-68r1j4sg.js → cli-6bpvv8h4.js} +3 -3
- package/dist/{cli-cpfmqz3n.js → cli-6qxmjpem.js} +5 -5
- package/dist/{cli-aqcey741.js → cli-6vfz44sr.js} +1 -1
- package/dist/{cli-32bca7nr.js → cli-7avy4v8w.js} +1 -1
- package/dist/{cli-f2n17zhp.js → cli-7mhy3ths.js} +21 -18
- package/dist/{cli-q38n4bq0.js → cli-95zs84qw.js} +3 -3
- package/dist/cli-a35hzdve.js +33 -0
- package/dist/{cli-x3x0qwky.js → cli-bxqez1p0.js} +51 -23
- package/dist/{cli-gt8azyet.js → cli-c2tpw9ck.js} +1 -1
- package/dist/{cli-ecknp7p1.js → cli-c8r99akr.js} +10 -10
- package/dist/{cli-3qn4r334.js → cli-cexctgn5.js} +20 -14
- package/dist/{cli-vzc73wet.js → cli-cf2vgn9d.js} +87 -69
- package/dist/{cli-ng97fjq7.js → cli-cmxkbzzs.js} +33 -7
- package/dist/{cli-nexwh8zg.js → cli-g7k7zbcz.js} +12 -5
- package/dist/{cli-nvvfd8bq.js → cli-jbzbr36n.js} +4091 -3793
- package/dist/{cli-3ddybbbx.js → cli-jvmtxqtc.js} +26 -14
- package/dist/{cli-pkke6geq.js → cli-km4x66j0.js} +83 -65
- package/dist/{cli-j2jbr8af.js → cli-kw0jcfje.js} +1 -1
- package/dist/{cli-8t229cmr.js → cli-m7vmeepg.js} +30 -17
- package/dist/{cli-yshaazs1.js → cli-mkdsy1nq.js} +62 -20
- package/dist/{cli-b0f70z24.js → cli-mn8qkd8v.js} +1 -1
- package/dist/{cli-0qjcsxgz.js → cli-mxry91sa.js} +30 -9
- package/dist/cli-nkqjj42q.js +104 -0
- package/dist/{cli-rggdq8wq.js → cli-p8rt8spp.js} +3 -3
- package/dist/{cli-v2a8x45d.js → cli-pkj1w46r.js} +10 -5
- package/dist/cli-q1vnz8wv.js +96 -0
- package/dist/{cli-fj86xr3c.js → cli-qd97v6z2.js} +2 -2
- package/dist/{cli-66zh26sp.js → cli-qzmzwegq.js} +57 -17
- package/dist/{cli-p4ztb80h.js → cli-r7eeddkq.js} +13 -8
- package/dist/{cli-8ssjez7e.js → cli-rhy7z1rp.js} +22 -11
- package/dist/{cli-4mevd1hf.js → cli-s9y81s7j.js} +5 -5
- package/dist/{cli-h3x613ze.js → cli-tc5zec7v.js} +6 -6
- package/dist/{cli-ttbsse3f.js → cli-tmhsxhb8.js} +1 -1
- package/dist/{cli-0nhdwxd5.js → cli-tx2zvn23.js} +3 -3
- package/dist/{cli-mwegs4af.js → cli-ty4bzkqr.js} +3 -3
- package/dist/{cli-ysnyhws9.js → cli-v1pwxreq.js} +54 -51
- package/dist/{cli-feh3dkah.js → cli-v1w7pbd8.js} +2 -1
- package/dist/{cli-10zmp1p7.js → cli-vr5avem2.js} +27 -32
- package/dist/{cli-bzr0ftht.js → cli-wnb9b2g3.js} +19 -0
- package/dist/{cli-df56tqdw.js → cli-wydz3feg.js} +108 -57
- package/dist/{cli-krqm5f11.js → cli-xezn9nkh.js} +16 -13
- package/dist/{cli-8kt0bmgx.js → cli-xf713zz0.js} +2 -2
- package/dist/{cli-x7kpr72a.js → cli-y0kjpfm9.js} +2 -2
- package/dist/{cli-6zcfw0x7.js → cli-y195hv1a.js} +1 -1
- package/dist/{cli-fn697bnt.js → cli-ykt8f7va.js} +21 -8
- package/dist/{cli-4r1sjfc4.js → cli-ymmc1zxg.js} +8 -8
- package/dist/{cli-8kgvmkak.js → cli-ypgba1a8.js} +1 -1
- package/dist/{cli-rsy933yz.js → cli-z1dqhc9y.js} +30 -19
- package/dist/{cli-qbksc292.js → cli-zy39d433.js} +2 -0
- package/dist/cli.js +26 -26
- package/dist/{cloudflare-workers-ai-system-one-tt484t61.js → cloudflare-workers-ai-system-one-sta45jf9.js} +7 -5
- package/dist/{codex-adapter-dw1wxqt8.js → codex-adapter-cgesnjkr.js} +18 -18
- package/dist/{codex-login-terbdsqq.js → codex-login-g1cyt5zm.js} +1 -1
- package/dist/{codex-session-runner-3cgb8y1g.js → codex-session-runner-8kd7ddhr.js} +18 -18
- package/dist/{commands-mhxam6z2.js → commands-h6zaaxym.js} +9 -8
- package/dist/{cursor-adapter-2qda3st7.js → cursor-adapter-v8mm6bp5.js} +5 -5
- package/dist/{db-sjks418k.js → db-qg3myn53.js} +9 -8
- package/dist/{dispatcher-1es759rn.js → dispatcher-7vnwj9qw.js} +24 -24
- package/dist/{dsh-adapter-bek4cyw9.js → dsh-adapter-tz6hfp5r.js} +5 -5
- package/dist/{easter-egg-3d-mtpnw06s.js → easter-egg-3d-66zxervv.js} +2 -2
- package/dist/{execute-s4ccjq3n.js → execute-h4jgevyw.js} +61 -11
- package/dist/{google-generative-ai-d6nphg3q.js → google-generative-ai-b8zxrpax.js} +5 -5
- package/dist/{google-vertex-cpshkref.js → google-vertex-nrdd697t.js} +5 -5
- package/dist/{grok-adapter-ar9cw9jg.js → grok-adapter-jdt2dz2s.js} +18 -8
- package/dist/{handlers-1gkbhktr.js → handlers-2qtkpncr.js} +27 -27
- package/dist/{hook-ds2zxq9v.js → hook-51yfcgsv.js} +42 -31
- package/dist/{hook-vxa3tcsy.js → hook-qnbdgwvd.js} +14 -14
- package/dist/{http-3h21z9md.js → http-jsmtag08.js} +320 -98
- package/dist/{index-9b65j1m5.js → index-2t9kesn1.js} +9 -8
- package/dist/{index-dkfxpkmm.js → index-bt8wkv1w.js} +25 -25
- package/dist/{index-f8xnqrye.js → index-cx1sb9bq.js} +33 -24
- package/dist/{index-bn6cy8ps.js → index-ekywyv2v.js} +24 -24
- package/dist/{index-n99fycq7.js → index-t4g06w93.js} +24 -24
- package/dist/{keepalive-3xspa9jw.js → keepalive-4aezx4bj.js} +11 -10
- package/dist/{lead-6qphc124.js → lead-r44bkpm5.js} +47 -47
- package/dist/{llama-cpp-classify-tgj35k8d.js → llama-cpp-classify-6erb7wwv.js} +3 -1
- package/dist/{maintenance-0teem1bb.js → maintenance-grz5jrzh.js} +9 -8
- package/dist/{mistral-conversations-8445ddjn.js → mistral-conversations-059y51zt.js} +4 -4
- package/dist/{node-9sg7ajby.js → node-qm9eb6z0.js} +1 -1
- package/dist/{oauth-refresh-sweep-sh9q25xp.js → oauth-refresh-sweep-wm4ctjfj.js} +10 -9
- package/dist/{onboard-54qmnqxe.js → onboard-v60zgqf0.js} +2 -2
- package/dist/{openai-codex-responses-9ynm88zy.js → openai-codex-responses-jzxkta9b.js} +8 -7
- package/dist/{openai-completions-nhqwjmaw.js → openai-completions-663yncfq.js} +4 -4
- package/dist/openai-decisions-vj9nkpf8.js +162 -0
- package/dist/{openai-responses-xx1c4kgm.js → openai-responses-m3g43rrt.js} +5 -5
- package/dist/{opencode-adapter-wjfa2wvd.js → opencode-adapter-yjyqynzf.js} +7 -7
- package/dist/{openrouter-images-8yx3487g.js → openrouter-images-kr60n6b9.js} +1 -1
- package/dist/{otel-impl-ycqzp2a1.js → otel-impl-ghh4dyf8.js} +1 -1
- package/dist/{pi-messages-vxdt8v7j.js → pi-messages-xszk613n.js} +1 -1
- package/dist/{pi-mono-adapter-e77e9zst.js → pi-mono-adapter-0eg8kw2c.js} +68 -51
- package/dist/{pricing-refresh-atnkngqs.js → pricing-refresh-mjrqvnvw.js} +11 -10
- package/dist/{rbac-roles-j78wdksm.js → rbac-roles-axv4d74x.js} +10 -9
- package/dist/{rbac-roles-9pjphh9q.js → rbac-roles-fd5tskj9.js} +9 -8
- package/dist/{render-v2-pxjs49fx.js → render-v2-k50j33qd.js} +10 -9
- package/dist/{runtime-v2t1r79e.js → runtime-h9ha1mq6.js} +4 -4
- package/dist/{setup-ymej0xtx.js → setup-4syh0pd2.js} +2 -2
- package/dist/{typesafe-system-one-datfr82p.js → typesafe-system-one-e988vty7.js} +7 -5
- package/dist/{virtual-modules-wm8mxdxx.js → virtual-modules-ftr9kwe8.js} +11 -11
- package/dist/{work-objects-3nh4ymzb.js → work-objects-jcdbg8rr.js} +27 -27
- package/dist/{worker-qa9fkz5s.js → worker-x8j8c9sx.js} +47 -47
- package/openapi.json +1 -1
- package/package.json +8 -8
- package/src/be/memory/providers/openai-embedding.ts +7 -2
- package/src/be/memory/raters/llm-summarizer.ts +7 -2
- package/src/be/modelsdev-cache.json +61 -0
- package/src/be/seed-pricing.ts +84 -53
- package/src/be/swarm-config-guard.ts +13 -0
- package/src/commands/provider-credentials.ts +28 -5
- package/src/commands/runner.ts +7 -12
- package/src/heartbeat/heartbeat.ts +91 -19
- package/src/hooks/hook.ts +72 -27
- package/src/http/mcp.ts +5 -0
- package/src/http/onboarding.ts +2 -0
- package/src/providers/acp-targets.ts +9 -4
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-adapter.ts +26 -0
- package/src/providers/codex-adapter.ts +30 -3
- package/src/providers/codex-oauth/auth-json.ts +21 -4
- package/src/providers/codex-oauth/types.ts +2 -0
- package/src/providers/dsh-adapter.ts +10 -1
- package/src/providers/grok-adapter.ts +18 -2
- package/src/providers/opencode-adapter.ts +21 -5
- package/src/providers/pi-mono-extension.ts +56 -25
- package/src/providers/pricing-sources.md +2 -0
- package/src/server.ts +63 -3
- package/src/tests/acp-adapter.test.ts +152 -12
- package/src/tests/ci-unit-test-report.test.ts +73 -0
- package/src/tests/claude-default-route.test.ts +75 -0
- package/src/tests/claude-hook-output.test.ts +233 -0
- package/src/tests/codex-adapter-pool-auth-revalidate.test.ts +4 -2
- package/src/tests/codex-adapter.test.ts +166 -26
- package/src/tests/codex-oauth-auth-timestamps.test.ts +76 -0
- package/src/tests/codex-oauth.test.ts +4 -1
- package/src/tests/context-window.test.ts +2 -2
- package/src/tests/credential-check.test.ts +51 -1
- package/src/tests/dsh-adapter.test.ts +23 -1
- package/src/tests/enabled-tools.test.ts +269 -0
- package/src/tests/entrypoint-codex-oauth-seed.test.ts +12 -0
- package/src/tests/grok-adapter.test.ts +13 -0
- package/src/tests/haiku-5-5-pricing.test.ts +38 -0
- package/src/tests/heartbeat-checklist.test.ts +158 -1
- package/src/tests/onboarding.test.ts +44 -0
- package/src/tests/opencode-adapter.test.ts +66 -3
- package/src/tests/opencode-plugin.test.ts +37 -0
- package/src/tests/openrouter-attribution-call-sites.test.ts +204 -0
- package/src/tests/openrouter-base-url.test.ts +30 -39
- package/src/tests/pi-mono-extension.test.ts +161 -2
- package/src/tests/pricing-refresh.test.ts +70 -1
- package/src/tests/reasoning-effort.test.ts +3 -1
- package/src/tests/telemetry-trigger.test.ts +12 -1
- package/src/tests/workflow-llm.test.ts +14 -0
- package/src/tests/workflow-system-one-decision-providers.test.ts +33 -0
- package/src/tools/request-human-input.ts +7 -2
- package/src/utils/enabled-tools.ts +27 -0
- package/src/utils/internal-ai/complete-structured.ts +11 -3
- package/src/utils/openrouter-base-url.ts +23 -0
- package/src/workflows/executors/raw-llm.ts +1 -0
- package/src/workflows/executors/system-one-decision.ts +2 -0
- package/src/workflows/executors/validate.ts +1 -0
- package/src/workflows/executors/workflow-llm.ts +9 -2
- package/templates/skills/agent-browser/SKILL.md +2 -0
- package/templates/skills/agent-browser/content.md +2 -0
- package/templates/skills/code-quality/content.md +1 -0
- package/templates/skills/heartbeat-runbook/content.md +1 -1
- package/templates/skills/work-on-task/SKILL.md +4 -0
- package/templates/skills/work-on-task/content.md +4 -0
- package/templates/skills/workflow-iterate/content.md +9 -0
- package/dist/acp-adapter-yzfxn8vj.js +0 -23
- package/dist/cli-3dpj7atn.js +0 -11
- package/dist/cli-gvcgmx69.js +0 -183
- package/dist/{cli-jhm6hzjn.js → cli-mxvnnv5q.js} +7 -7
- package/dist/{codex-hook-d2rkvf39.js → codex-hook-15dgc4cb.js} +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getValidCodexOAuth,
|
|
3
3
|
persistCodexOAuth
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import {
|
|
6
|
-
oauthErrorHtml,
|
|
7
|
-
oauthSuccessHtml
|
|
8
|
-
} from "./cli-2x0e561b.js";
|
|
4
|
+
} from "./cli-v1w7pbd8.js";
|
|
9
5
|
import {
|
|
10
6
|
GITHUB_COPILOT_MODELS,
|
|
11
7
|
builtinModels,
|
|
12
8
|
normalizeRadiusGatewayUrl,
|
|
13
9
|
registerBundledOAuthFlowLoaders
|
|
14
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-km4x66j0.js";
|
|
11
|
+
import {
|
|
12
|
+
oauthErrorHtml,
|
|
13
|
+
oauthSuccessHtml
|
|
14
|
+
} from "./cli-2x0e561b.js";
|
|
15
15
|
import {
|
|
16
16
|
getEnvApiKey
|
|
17
17
|
} from "./cli-zxg80zs9.js";
|
|
18
18
|
import {
|
|
19
19
|
InMemoryCredentialStore
|
|
20
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-g7k7zbcz.js";
|
|
21
21
|
import {
|
|
22
22
|
getProviderEnvValue
|
|
23
23
|
} from "./cli-btbzvq95.js";
|
|
@@ -307,23 +307,26 @@ async function exchangeAuthorizationCode(code, state, verifier, redirectUri, sig
|
|
|
307
307
|
}
|
|
308
308
|
async function loginAnthropic(interaction) {
|
|
309
309
|
const { verifier, challenge } = await generatePKCE();
|
|
310
|
-
const
|
|
310
|
+
const startCallbackServer = (port) => startOAuthCallbackServer({
|
|
311
311
|
providerName: "Anthropic",
|
|
312
312
|
host: CALLBACK_HOST,
|
|
313
|
-
port
|
|
313
|
+
port,
|
|
314
314
|
path: CALLBACK_PATH,
|
|
315
|
+
redirectHost: "localhost",
|
|
315
316
|
state: verifier,
|
|
316
317
|
complete: async (code) => code,
|
|
317
318
|
signal: interaction.signal
|
|
318
|
-
})
|
|
319
|
+
});
|
|
320
|
+
const callback = await startCallbackServer(CALLBACK_PORT).catch(() => startCallbackServer(0)).catch(() => {
|
|
319
321
|
return;
|
|
320
322
|
});
|
|
323
|
+
const redirectUri = callback?.redirectUri ?? REDIRECT_URI;
|
|
321
324
|
try {
|
|
322
325
|
const authParams = new URLSearchParams({
|
|
323
326
|
code: "true",
|
|
324
327
|
client_id: CLIENT_ID,
|
|
325
328
|
response_type: "code",
|
|
326
|
-
redirect_uri:
|
|
329
|
+
redirect_uri: redirectUri,
|
|
327
330
|
scope: SCOPES,
|
|
328
331
|
code_challenge: challenge,
|
|
329
332
|
code_challenge_method: "S256",
|
|
@@ -336,7 +339,7 @@ async function loginAnthropic(interaction) {
|
|
|
336
339
|
});
|
|
337
340
|
const result = await waitForCallbackOrManualInput(interaction, callback, {
|
|
338
341
|
message: "Complete login in your browser, or paste the authorization code / redirect URL here:",
|
|
339
|
-
placeholder:
|
|
342
|
+
placeholder: redirectUri
|
|
340
343
|
});
|
|
341
344
|
let code;
|
|
342
345
|
let state = verifier;
|
|
@@ -352,7 +355,7 @@ async function loginAnthropic(interaction) {
|
|
|
352
355
|
if (!code)
|
|
353
356
|
throw new Error("Missing authorization code");
|
|
354
357
|
interaction.notify({ type: "progress", message: "Exchanging authorization code for tokens..." });
|
|
355
|
-
return await exchangeAuthorizationCode(code, state, verifier,
|
|
358
|
+
return await exchangeAuthorizationCode(code, state, verifier, redirectUri, interaction.signal);
|
|
356
359
|
} finally {
|
|
357
360
|
callback?.close();
|
|
358
361
|
}
|
|
@@ -1431,7 +1434,7 @@ async function loginOpenAIChatGPT(interaction, options) {
|
|
|
1431
1434
|
const authorizationUrl = new URL(AUTHORIZE_URL2);
|
|
1432
1435
|
authorizationUrl.search = new URLSearchParams({
|
|
1433
1436
|
client_id: DYNAMIC_CLIENT_ID,
|
|
1434
|
-
agent_name_hint: AGENT_NAME_HINT,
|
|
1437
|
+
agent_name_hint: options?.agentName ?? AGENT_NAME_HINT,
|
|
1435
1438
|
ext_agent_host_id: hostId,
|
|
1436
1439
|
response_type: "code",
|
|
1437
1440
|
redirect_uri: REDIRECT_URI2,
|
|
@@ -1732,8 +1735,8 @@ async function loginOpenAICodexDeviceCode(interaction) {
|
|
|
1732
1735
|
const code = await pollOpenAICodexDeviceAuth(device, interaction.signal);
|
|
1733
1736
|
return exchangeAuthorizationCodeForCredentials(code.authorizationCode, code.codeVerifier, DEVICE_REDIRECT_URI, interaction.signal);
|
|
1734
1737
|
}
|
|
1735
|
-
async function loginOpenAICodex(interaction) {
|
|
1736
|
-
const { verifier, state, url } = await createAuthorizationFlow();
|
|
1738
|
+
async function loginOpenAICodex(interaction, options) {
|
|
1739
|
+
const { verifier, state, url } = await createAuthorizationFlow(options?.agentName);
|
|
1737
1740
|
const callback = await startOAuthCallbackServer({
|
|
1738
1741
|
providerName: "OpenAI",
|
|
1739
1742
|
host: getCallbackHost(),
|
|
@@ -1777,7 +1780,7 @@ async function refreshOpenAICodexToken(refreshToken2, signal) {
|
|
|
1777
1780
|
var openaiCodexOAuth = {
|
|
1778
1781
|
name: "OpenAI (ChatGPT Plus/Pro)",
|
|
1779
1782
|
isSubscription: true,
|
|
1780
|
-
async login(interaction) {
|
|
1783
|
+
async login(interaction, options) {
|
|
1781
1784
|
const method = await interaction.prompt({
|
|
1782
1785
|
type: "select",
|
|
1783
1786
|
message: "Select OpenAI Codex login method:",
|
|
@@ -1792,7 +1795,7 @@ var openaiCodexOAuth = {
|
|
|
1792
1795
|
if (method !== OPENAI_CODEX_BROWSER_LOGIN_METHOD) {
|
|
1793
1796
|
throw new Error(`Unknown OpenAI Codex login method: ${method}`);
|
|
1794
1797
|
}
|
|
1795
|
-
return loginOpenAICodex(interaction);
|
|
1798
|
+
return loginOpenAICodex(interaction, options);
|
|
1796
1799
|
},
|
|
1797
1800
|
refresh: (credential, signal) => refreshOpenAICodexToken(credential.refresh, signal),
|
|
1798
1801
|
async toAuth(credential) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
retryProviderRequest
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-zy39d433.js";
|
|
4
4
|
import {
|
|
5
5
|
require_ecdsa_sig_formatter,
|
|
6
6
|
require_jws,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
getJsonSchemaToolParameters,
|
|
11
11
|
resolveJsonSchemaStrictSampling,
|
|
12
12
|
transformMessages
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-xf713zz0.js";
|
|
14
14
|
import {
|
|
15
15
|
sanitizeSurrogates
|
|
16
16
|
} from "./cli-y2apkfe2.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
clampThinkingLevel,
|
|
19
19
|
collapseSystemMessages,
|
|
20
20
|
withoutInitialSystemMessage
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-g7k7zbcz.js";
|
|
22
22
|
import {
|
|
23
23
|
import_websocket
|
|
24
24
|
} from "./cli-76yrvwsa.js";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__esm
|
|
3
|
+
} from "./cli-bc05qbss.js";
|
|
4
|
+
|
|
5
|
+
// src/utils/openrouter-base-url.ts
|
|
6
|
+
function getOpenRouterBaseUrl(env = process.env) {
|
|
7
|
+
const raw = env.OPENROUTER_BASE_URL;
|
|
8
|
+
if (typeof raw === "string" && raw.trim().length > 0) {
|
|
9
|
+
return raw.trim().replace(/\/+$/, "");
|
|
10
|
+
}
|
|
11
|
+
return DEFAULT_OPENROUTER_BASE_URL;
|
|
12
|
+
}
|
|
13
|
+
function getOpenRouterAttributionHeaders(url, env = process.env) {
|
|
14
|
+
const enabled = env.OPENROUTER_APP_ATTRIBUTION?.toLowerCase();
|
|
15
|
+
if (enabled === "false" || enabled === "0")
|
|
16
|
+
return {};
|
|
17
|
+
try {
|
|
18
|
+
const host = new URL(url).hostname;
|
|
19
|
+
return host === "openrouter.ai" || host.endsWith(".openrouter.ai") ? { ...OPENROUTER_APP_ATTRIBUTION_HEADERS } : {};
|
|
20
|
+
} catch {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
var DEFAULT_OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1", OPENROUTER_APP_ATTRIBUTION_HEADERS;
|
|
25
|
+
var init_openrouter_base_url = __esm(() => {
|
|
26
|
+
OPENROUTER_APP_ATTRIBUTION_HEADERS = {
|
|
27
|
+
"HTTP-Referer": "https://agent-swarm.dev",
|
|
28
|
+
"X-OpenRouter-Title": "Agent Swarm",
|
|
29
|
+
"X-OpenRouter-Categories": "personal-agent,cloud-agent"
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export { DEFAULT_OPENROUTER_BASE_URL, getOpenRouterBaseUrl, getOpenRouterAttributionHeaders, init_openrouter_base_url };
|
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
require_proper_lockfile,
|
|
16
16
|
resolveConfigValueOrThrow,
|
|
17
17
|
resolveHeadersOrThrow
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-xezn9nkh.js";
|
|
19
19
|
import {
|
|
20
20
|
APP_NAME,
|
|
21
21
|
VERSION,
|
|
22
22
|
getAgentDir
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-5t5my0h8.js";
|
|
24
24
|
import {
|
|
25
25
|
oauthErrorHtml,
|
|
26
26
|
oauthSuccessHtml
|
|
@@ -328,19 +328,20 @@ function parseWwwAuthenticate(header) {
|
|
|
328
328
|
errorDescription: field(header, "error_description")
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
|
-
async function fetchMetadata(url, fetch, protocolVersion) {
|
|
331
|
+
async function fetchMetadata(url, fetch, protocolVersion, signal) {
|
|
332
332
|
return fetch(url, {
|
|
333
|
-
headers: { Accept: "application/json", "MCP-Protocol-Version": protocolVersion }
|
|
333
|
+
headers: { Accept: "application/json", "MCP-Protocol-Version": protocolVersion },
|
|
334
|
+
signal
|
|
334
335
|
});
|
|
335
336
|
}
|
|
336
337
|
async function discoverProtectedResourceMetadata(serverUrl, options = {}) {
|
|
337
338
|
const server = new URL(serverUrl);
|
|
338
339
|
const fetch = options.fetch ?? globalThis.fetch;
|
|
339
340
|
const version = options.protocolVersion ?? LATEST_PROTOCOL_VERSION;
|
|
340
|
-
let response = await fetchMetadata(options.resourceMetadataUrl ? new URL(options.resourceMetadataUrl) : new URL(`/.well-known/oauth-protected-resource${pathSuffix(server.pathname)}`, server.origin), fetch, version);
|
|
341
|
+
let response = await fetchMetadata(options.resourceMetadataUrl ? new URL(options.resourceMetadataUrl) : new URL(`/.well-known/oauth-protected-resource${pathSuffix(server.pathname)}`, server.origin), fetch, version, options.signal);
|
|
341
342
|
if (!options.resourceMetadataUrl && server.pathname !== "/" && isDiscoveryMiss(response.status)) {
|
|
342
343
|
discard(response);
|
|
343
|
-
response = await fetchMetadata(new URL("/.well-known/oauth-protected-resource", server.origin), fetch, version);
|
|
344
|
+
response = await fetchMetadata(new URL("/.well-known/oauth-protected-resource", server.origin), fetch, version, options.signal);
|
|
344
345
|
}
|
|
345
346
|
if (!response.ok) {
|
|
346
347
|
discard(response);
|
|
@@ -362,7 +363,7 @@ function buildAuthorizationServerDiscoveryUrls(authorizationServerUrl) {
|
|
|
362
363
|
async function discoverAuthorizationServerMetadata(authorizationServerUrl, options = {}) {
|
|
363
364
|
const fetch = options.fetch ?? globalThis.fetch;
|
|
364
365
|
for (const { url } of buildAuthorizationServerDiscoveryUrls(authorizationServerUrl)) {
|
|
365
|
-
const response = await fetchMetadata(url, fetch, options.protocolVersion ?? LATEST_PROTOCOL_VERSION);
|
|
366
|
+
const response = await fetchMetadata(url, fetch, options.protocolVersion ?? LATEST_PROTOCOL_VERSION, options.signal);
|
|
366
367
|
if (!response.ok) {
|
|
367
368
|
discard(response);
|
|
368
369
|
if (isDiscoveryMiss(response.status))
|
|
@@ -385,7 +386,8 @@ async function discoverOAuthServerInfo(serverUrl, options = {}) {
|
|
|
385
386
|
try {
|
|
386
387
|
resourceMetadata = await discoverProtectedResourceMetadata(serverUrl, {
|
|
387
388
|
resourceMetadataUrl: options.resourceMetadataUrl,
|
|
388
|
-
fetch: options.fetch
|
|
389
|
+
fetch: options.fetch,
|
|
390
|
+
signal: options.signal
|
|
389
391
|
});
|
|
390
392
|
} catch (error) {
|
|
391
393
|
if (error instanceof TypeError)
|
|
@@ -393,7 +395,7 @@ async function discoverOAuthServerInfo(serverUrl, options = {}) {
|
|
|
393
395
|
}
|
|
394
396
|
if (options.authorizationServerMetadataUrl) {
|
|
395
397
|
const url = options.authorizationServerMetadataUrl;
|
|
396
|
-
const response = await fetchMetadata(url, options.fetch ?? globalThis.fetch, LATEST_PROTOCOL_VERSION);
|
|
398
|
+
const response = await fetchMetadata(url, options.fetch ?? globalThis.fetch, LATEST_PROTOCOL_VERSION, options.signal);
|
|
397
399
|
if (!response.ok) {
|
|
398
400
|
discard(response);
|
|
399
401
|
throw new Error(`HTTP ${response.status} loading authorization server metadata from ${url}`);
|
|
@@ -406,7 +408,8 @@ async function discoverOAuthServerInfo(serverUrl, options = {}) {
|
|
|
406
408
|
authorizationServerUrl,
|
|
407
409
|
authorizationServerMetadata: await discoverAuthorizationServerMetadata(authorizationServerUrl, {
|
|
408
410
|
fetch: options.fetch,
|
|
409
|
-
skipIssuerValidation: options.skipIssuerValidation
|
|
411
|
+
skipIssuerValidation: options.skipIssuerValidation,
|
|
412
|
+
signal: options.signal
|
|
410
413
|
}),
|
|
411
414
|
resourceMetadata
|
|
412
415
|
};
|
|
@@ -517,7 +520,12 @@ async function tokenRequest(authorizationServerUrl, options, params) {
|
|
|
517
520
|
} else {
|
|
518
521
|
applyClientAuthentication(selectClientAuthMethod(options.clientInformation, options.metadata?.token_endpoint_auth_methods_supported ?? []), options.clientInformation, headers, params);
|
|
519
522
|
}
|
|
520
|
-
const response = await (options.fetch ?? globalThis.fetch)(url, {
|
|
523
|
+
const response = await (options.fetch ?? globalThis.fetch)(url, {
|
|
524
|
+
method: "POST",
|
|
525
|
+
headers,
|
|
526
|
+
body: params,
|
|
527
|
+
signal: options.signal
|
|
528
|
+
});
|
|
521
529
|
const text = await response.text();
|
|
522
530
|
let value;
|
|
523
531
|
try {
|
|
@@ -541,7 +549,8 @@ async function registerClient(authorizationServerUrl, options) {
|
|
|
541
549
|
...options.clientMetadata,
|
|
542
550
|
application_type: options.clientMetadata.application_type ?? applicationType(options.clientMetadata.redirect_uris),
|
|
543
551
|
...options.scope ? { scope: options.scope } : {}
|
|
544
|
-
})
|
|
552
|
+
}),
|
|
553
|
+
signal: options.signal
|
|
545
554
|
});
|
|
546
555
|
if (!response.ok)
|
|
547
556
|
throw new OAuthRegistrationError(response.status, await response.text());
|
|
@@ -575,14 +584,16 @@ async function runFlow(provider, options) {
|
|
|
575
584
|
authorizationServerUrl: cached.authorizationServerUrl,
|
|
576
585
|
authorizationServerMetadata: cached.authorizationServerMetadata ?? await discoverAuthorizationServerMetadata(cached.authorizationServerUrl, {
|
|
577
586
|
fetch: options.fetch,
|
|
578
|
-
skipIssuerValidation: options.skipIssuerValidation
|
|
587
|
+
skipIssuerValidation: options.skipIssuerValidation,
|
|
588
|
+
signal: options.signal
|
|
579
589
|
}),
|
|
580
590
|
resourceMetadata: cached.resourceMetadata
|
|
581
591
|
} : await discoverOAuthServerInfo(options.serverUrl, {
|
|
582
592
|
resourceMetadataUrl: options.resourceMetadataUrl,
|
|
583
593
|
authorizationServerMetadataUrl: metadataUrl,
|
|
584
594
|
fetch: options.fetch,
|
|
585
|
-
skipIssuerValidation: options.skipIssuerValidation
|
|
595
|
+
skipIssuerValidation: options.skipIssuerValidation,
|
|
596
|
+
signal: options.signal
|
|
586
597
|
});
|
|
587
598
|
if (!metadataUrl) {
|
|
588
599
|
await provider.saveDiscoveryState?.({
|
|
@@ -610,7 +621,8 @@ async function runFlow(provider, options) {
|
|
|
610
621
|
metadata,
|
|
611
622
|
clientMetadata: provider.clientMetadata,
|
|
612
623
|
scope,
|
|
613
|
-
fetch: options.fetch
|
|
624
|
+
fetch: options.fetch,
|
|
625
|
+
signal: options.signal
|
|
614
626
|
});
|
|
615
627
|
await provider.saveClientInformation(client);
|
|
616
628
|
}
|
|
@@ -620,7 +632,8 @@ async function runFlow(provider, options) {
|
|
|
620
632
|
clientInformation: client,
|
|
621
633
|
resource,
|
|
622
634
|
addClientAuthentication: provider.addClientAuthentication,
|
|
623
|
-
fetch: options.fetch
|
|
635
|
+
fetch: options.fetch,
|
|
636
|
+
signal: options.signal
|
|
624
637
|
};
|
|
625
638
|
if (options.authorizationCode) {
|
|
626
639
|
const iss = options.iss;
|
|
@@ -647,7 +660,7 @@ async function runFlow(provider, options) {
|
|
|
647
660
|
await provider.saveTokens(withScope(tokens, existing.scope));
|
|
648
661
|
return "AUTHORIZED";
|
|
649
662
|
} catch (error) {
|
|
650
|
-
if (error instanceof OAuthInsecureEndpointError)
|
|
663
|
+
if (options.signal?.aborted || error instanceof OAuthInsecureEndpointError)
|
|
651
664
|
throw error;
|
|
652
665
|
if (error instanceof OAuthError && error.code !== "server_error")
|
|
653
666
|
throw error;
|
|
@@ -806,7 +819,7 @@ var CALLBACK_PATH = "/callback";
|
|
|
806
819
|
var CLIENT_METADATA_BASE_URL = "https://pi.dev/oauth";
|
|
807
820
|
var FALLBACK_REDIRECT_URL = `http://${CALLBACK_HOST}${CALLBACK_PATH}`;
|
|
808
821
|
var REFRESH_SKEW_MS = 30000;
|
|
809
|
-
var
|
|
822
|
+
var OAUTH_REQUEST_TIMEOUT_MS = 15000;
|
|
810
823
|
var REFRESH_LOCK_STALE_MS = 20000;
|
|
811
824
|
var REFRESH_LOCK_WAIT_MS = 25000;
|
|
812
825
|
var REFRESH_LOCK_RETRY_MS = 100;
|
|
@@ -920,6 +933,12 @@ class McpOAuthCredentialStore {
|
|
|
920
933
|
});
|
|
921
934
|
}
|
|
922
935
|
}
|
|
936
|
+
function timedFetch(fetch = globalThis.fetch) {
|
|
937
|
+
return (input, init) => {
|
|
938
|
+
const timeout = AbortSignal.timeout(OAUTH_REQUEST_TIMEOUT_MS);
|
|
939
|
+
return fetch(input, { ...init, signal: init?.signal ? AbortSignal.any([init.signal, timeout]) : timeout });
|
|
940
|
+
};
|
|
941
|
+
}
|
|
923
942
|
function registeredRedirectUrls(client) {
|
|
924
943
|
return client && "redirect_uris" in client ? client.redirect_uris : [];
|
|
925
944
|
}
|
|
@@ -970,7 +989,7 @@ function createMcpAuthProvider(options) {
|
|
|
970
989
|
resourceMetadataUrl: challenge?.resourceMetadataUrl,
|
|
971
990
|
authorizationServerMetadataUrl: settings.authServerMetadataUrl,
|
|
972
991
|
scope: challenge?.scope,
|
|
973
|
-
fetch: (
|
|
992
|
+
fetch: timedFetch(fetch)
|
|
974
993
|
});
|
|
975
994
|
if (result === "REDIRECT")
|
|
976
995
|
throw new McpOAuthAuthorizationRequiredError;
|
|
@@ -1035,10 +1054,11 @@ function responseFromRedirectUrl(input, state, redirectUrl) {
|
|
|
1035
1054
|
throw new Error("The redirect URL does not contain an authorization code");
|
|
1036
1055
|
return { code, iss: url.searchParams.get("iss") ?? undefined };
|
|
1037
1056
|
}
|
|
1038
|
-
async function waitForAuthorizationResponse(callback, state, redirectUrl, prompt) {
|
|
1057
|
+
async function waitForAuthorizationResponse(callback, state, redirectUrl, prompt, signal) {
|
|
1039
1058
|
const controller = new AbortController;
|
|
1059
|
+
const promptSignal = signal ? AbortSignal.any([controller.signal, signal]) : controller.signal;
|
|
1040
1060
|
const fromBrowser = callback.waitForCallback(state, redirectUrl.pathname);
|
|
1041
|
-
const fromUser = prompt.promptForRedirectUrl(
|
|
1061
|
+
const fromUser = prompt.promptForRedirectUrl(promptSignal).then((input) => {
|
|
1042
1062
|
if (!input?.trim())
|
|
1043
1063
|
throw new McpSignInCancelledError;
|
|
1044
1064
|
return responseFromRedirectUrl(input, state, redirectUrl);
|
|
@@ -1072,7 +1092,9 @@ async function listenForCallback(settings, extraPaths, port, required) {
|
|
|
1072
1092
|
}
|
|
1073
1093
|
}
|
|
1074
1094
|
async function signInMcpServer(options) {
|
|
1075
|
-
const { serverUrl, store, settings } = options;
|
|
1095
|
+
const { serverUrl, store, settings, signal } = options;
|
|
1096
|
+
if (signal?.aborted)
|
|
1097
|
+
throw new McpSignInCancelledError;
|
|
1076
1098
|
const stored = await store.load();
|
|
1077
1099
|
const stepUp = options.challenge?.error === "insufficient_scope";
|
|
1078
1100
|
const callbackOptions = callbackSettings(settings);
|
|
@@ -1099,6 +1121,8 @@ async function signInMcpServer(options) {
|
|
|
1099
1121
|
});
|
|
1100
1122
|
const flow = {
|
|
1101
1123
|
serverUrl,
|
|
1124
|
+
fetch: timedFetch(),
|
|
1125
|
+
signal,
|
|
1102
1126
|
resourceMetadataUrl: options.challenge?.resourceMetadataUrl,
|
|
1103
1127
|
authorizationServerMetadataUrl: settings.authServerMetadataUrl,
|
|
1104
1128
|
scope: mergeScopes(settings.scope, stepUp ? stepUpScope(stored?.tokens?.scope, options.challenge?.scope) : options.challenge?.scope)
|
|
@@ -1111,8 +1135,12 @@ async function signInMcpServer(options) {
|
|
|
1111
1135
|
const state = await provider.state();
|
|
1112
1136
|
const authorizationRedirectUrl = new URL(authorizationUrl.searchParams.get("redirect_uri") ?? redirectUrl);
|
|
1113
1137
|
options.prompt.showAuthorizationUrl(authorizationUrl);
|
|
1114
|
-
const { code, iss } = await waitForAuthorizationResponse(callback, state, authorizationRedirectUrl, options.prompt);
|
|
1138
|
+
const { code, iss } = await waitForAuthorizationResponse(callback, state, authorizationRedirectUrl, options.prompt, signal);
|
|
1115
1139
|
await authorizeMcp(provider, { ...flow, authorizationCode: code, iss });
|
|
1140
|
+
} catch (error) {
|
|
1141
|
+
if (signal?.aborted)
|
|
1142
|
+
throw new McpSignInCancelledError;
|
|
1143
|
+
throw error;
|
|
1116
1144
|
} finally {
|
|
1117
1145
|
await callback.close();
|
|
1118
1146
|
}
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
setSlackMessageTracking,
|
|
70
70
|
slackContextKey,
|
|
71
71
|
updateSlackMessageRecord
|
|
72
|
-
} from "./cli-
|
|
72
|
+
} from "./cli-mkdsy1nq.js";
|
|
73
73
|
import {
|
|
74
74
|
init_types,
|
|
75
75
|
isTerminalTaskStatus
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
import {
|
|
78
78
|
init_task_attachment_links,
|
|
79
79
|
taskAttachmentDisplayUrl
|
|
80
|
-
} from "./cli-
|
|
80
|
+
} from "./cli-mxvnnv5q.js";
|
|
81
81
|
import {
|
|
82
82
|
getSlackConfiguration,
|
|
83
83
|
init_config
|
|
@@ -52915,7 +52915,7 @@ async function initOtel(serviceRole = process.env.AGENT_ROLE || "api") {
|
|
|
52915
52915
|
return;
|
|
52916
52916
|
initialized = true;
|
|
52917
52917
|
try {
|
|
52918
|
-
const impl = await import("./otel-impl-
|
|
52918
|
+
const impl = await import("./otel-impl-ghh4dyf8.js");
|
|
52919
52919
|
await impl.boot(serviceRole, {
|
|
52920
52920
|
exportConsoleLogs: serviceRole === "api" && isApiLogExportEnabled()
|
|
52921
52921
|
});
|
|
@@ -54410,15 +54410,15 @@ async function initSlackApp() {
|
|
|
54410
54410
|
...clientOptions ? { clientOptions } : {}
|
|
54411
54411
|
});
|
|
54412
54412
|
initialized2 = true;
|
|
54413
|
-
const { registerMessageHandler } = await import("./handlers-
|
|
54414
|
-
const { registerCommandHandler } = await import("./commands-
|
|
54415
|
-
const { registerActionHandlers } = await import("./actions-
|
|
54416
|
-
const { registerWorkObjectHandlers } = await import("./work-objects-
|
|
54413
|
+
const { registerMessageHandler } = await import("./handlers-2qtkpncr.js");
|
|
54414
|
+
const { registerCommandHandler } = await import("./commands-h6zaaxym.js");
|
|
54415
|
+
const { registerActionHandlers } = await import("./actions-fq2zrwtf.js");
|
|
54416
|
+
const { registerWorkObjectHandlers } = await import("./work-objects-jcdbg8rr.js");
|
|
54417
54417
|
registerMessageHandler(app);
|
|
54418
54418
|
registerCommandHandler(app);
|
|
54419
54419
|
registerActionHandlers(app);
|
|
54420
54420
|
registerWorkObjectHandlers(app);
|
|
54421
|
-
const { createAssistant } = await import("./assistant-
|
|
54421
|
+
const { createAssistant } = await import("./assistant-0aq8gjvj.js");
|
|
54422
54422
|
app.assistant(createAssistant());
|
|
54423
54423
|
return app;
|
|
54424
54424
|
}
|
|
@@ -54427,7 +54427,7 @@ async function startSlackApp() {
|
|
|
54427
54427
|
await initSlackApp();
|
|
54428
54428
|
}
|
|
54429
54429
|
if (app) {
|
|
54430
|
-
const { isSlackRenderV2Enabled: isSlackRenderV2Enabled2 } = await import("./render-v2-
|
|
54430
|
+
const { isSlackRenderV2Enabled: isSlackRenderV2Enabled2 } = await import("./render-v2-k50j33qd.js");
|
|
54431
54431
|
if (isSlackRenderV2Enabled2())
|
|
54432
54432
|
await ensureSlackRenderV2Activation();
|
|
54433
54433
|
await app.start();
|
|
@@ -56191,4 +56191,4 @@ function _resetSlackRenderV2ForTests() {
|
|
|
56191
56191
|
}
|
|
56192
56192
|
var _noteOutcomeDeliveryFailureForTests = (task, tree, error) => noteOutcomeDeliveryFailure(task, tree, error, undefined);
|
|
56193
56193
|
|
|
56194
|
-
export { require_dist7 as require_dist, getSlackConnectionState, isPollTracingEnabled, initOtel, withSpan, startSpan, withSpanContext, withRemoteContext, injectTraceContext, recordSessionCost, recordDbRetentionSweep, recordDbRetentionStatement, slackTaskOutput, ackSlackMessage, getTaskLink, getTaskUrl, markdownToSlack, buildCaptionBlock, buildCancelledBlocks, buildBufferFlushBlocks, buildTreeBlocks, taskCitationIssues, stripInvalidTaskCitations, taskCitationSourceGroups, renderTaskCitations, taskCitationWarnings, MAX_TASK_CITATIONS, CitationInputSchema, TaskCitationSchema, upsertTaskCitations, getTaskCitations, getTaskCitationsForTasks, hasTaskCitationCheckRefusal, initialize, ensure2 as ensure, getAgentDisplayName, getAgentEmoji, markSlackSessionProcessing, isSlackRenderV2Enabled, isSlackDelegationEnabled, callSlackWithRetry, formatV2Duration, renderThreadTree, ensureSlackThreadTree, withStatusLead, childOutcomeContent, streamOutcomeCard, slackErrorCode2 as slackErrorCode, isTerminalSlackError, describeSlackError, slackErrorSummary, refreshResolvedDeferralCards, processSlackRenderV2, _resetSlackRenderV2ForTests, _noteOutcomeDeliveryFailureForTests, registerTreeMessage, getSlackApp, initSlackApp, startSlackApp, stopSlackApp };
|
|
56194
|
+
export { require_content_type, require_dist7 as require_dist, getSlackConnectionState, isPollTracingEnabled, initOtel, withSpan, startSpan, withSpanContext, withRemoteContext, injectTraceContext, recordSessionCost, recordDbRetentionSweep, recordDbRetentionStatement, slackTaskOutput, ackSlackMessage, getTaskLink, getTaskUrl, markdownToSlack, buildCaptionBlock, buildCancelledBlocks, buildBufferFlushBlocks, buildTreeBlocks, taskCitationIssues, stripInvalidTaskCitations, taskCitationSourceGroups, renderTaskCitations, taskCitationWarnings, MAX_TASK_CITATIONS, CitationInputSchema, TaskCitationSchema, upsertTaskCitations, getTaskCitations, getTaskCitationsForTasks, hasTaskCitationCheckRefusal, initialize, ensure2 as ensure, getAgentDisplayName, getAgentEmoji, markSlackSessionProcessing, isSlackRenderV2Enabled, isSlackDelegationEnabled, callSlackWithRetry, formatV2Duration, renderThreadTree, ensureSlackThreadTree, withStatusLead, childOutcomeContent, streamOutcomeCard, slackErrorCode2 as slackErrorCode, isTerminalSlackError, describeSlackError, slackErrorSummary, refreshResolvedDeferralCards, processSlackRenderV2, _resetSlackRenderV2ForTests, _noteOutcomeDeliveryFailureForTests, registerTreeMessage, getSlackApp, initSlackApp, startSlackApp, stopSlackApp };
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./cli-32bca7nr.js";
|
|
5
|
-
import {
|
|
6
|
-
fetchInstalledMcpServers
|
|
7
|
-
} from "./cli-tng3131n.js";
|
|
2
|
+
applyOpenRouterBaseUrlOverride
|
|
3
|
+
} from "./cli-jvmtxqtc.js";
|
|
8
4
|
import {
|
|
9
5
|
ACP_TARGET_IDS,
|
|
10
6
|
getAcpTargetCatalogEntry,
|
|
11
7
|
isAcpTarget
|
|
12
8
|
} from "./cli-zp67qg5x.js";
|
|
9
|
+
import {
|
|
10
|
+
fetchInstalledMcpServers
|
|
11
|
+
} from "./cli-tng3131n.js";
|
|
12
|
+
import {
|
|
13
|
+
clampContextPercent,
|
|
14
|
+
getContextWindowSize
|
|
15
|
+
} from "./cli-7avy4v8w.js";
|
|
13
16
|
import {
|
|
14
17
|
applyReasoningEffort
|
|
15
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-tmhsxhb8.js";
|
|
16
19
|
import {
|
|
17
20
|
detachedProcessGroup,
|
|
18
21
|
registerProcessGroup,
|
|
@@ -21,7 +24,7 @@ import {
|
|
|
21
24
|
import {
|
|
22
25
|
init_src,
|
|
23
26
|
normalizeGrokModel
|
|
24
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-014vns2y.js";
|
|
25
28
|
import {
|
|
26
29
|
array,
|
|
27
30
|
boolean,
|
|
@@ -41,7 +44,7 @@ import {
|
|
|
41
44
|
import {
|
|
42
45
|
init_package,
|
|
43
46
|
package_default
|
|
44
|
-
} from "./cli-
|
|
47
|
+
} from "./cli-ymmc1zxg.js";
|
|
45
48
|
import {
|
|
46
49
|
init_secret_scrubber,
|
|
47
50
|
scrubSecrets
|
|
@@ -4800,9 +4803,8 @@ function configuredOptions(config) {
|
|
|
4800
4803
|
options.model = config.model.trim();
|
|
4801
4804
|
return options;
|
|
4802
4805
|
}
|
|
4803
|
-
function
|
|
4804
|
-
|
|
4805
|
-
return;
|
|
4806
|
+
function withOpencodeConfig(env, model) {
|
|
4807
|
+
const key = "OPENCODE_CONFIG_CONTENT";
|
|
4806
4808
|
let value = {};
|
|
4807
4809
|
const existing = env[key];
|
|
4808
4810
|
if (existing) {
|
|
@@ -4815,7 +4817,10 @@ function withModelInJsonEnv(env, key, model) {
|
|
|
4815
4817
|
console.warn(`\x1B[33m[acp]\x1B[0m Replacing invalid ${key} JSON for model fallback`);
|
|
4816
4818
|
}
|
|
4817
4819
|
}
|
|
4818
|
-
|
|
4820
|
+
if (model.trim())
|
|
4821
|
+
value.model = model.trim();
|
|
4822
|
+
applyOpenRouterBaseUrlOverride(value, env);
|
|
4823
|
+
env[key] = JSON.stringify(value);
|
|
4819
4824
|
}
|
|
4820
4825
|
function parseCommand(command, args) {
|
|
4821
4826
|
const trimmed = command.trim();
|
|
@@ -4870,7 +4875,8 @@ var opencodeTargetProfile = {
|
|
|
4870
4875
|
const env = baseTargetEnv(config);
|
|
4871
4876
|
const entry = getAcpTargetCatalogEntry("opencode");
|
|
4872
4877
|
copyEnvKeys(config, env, entry.envKeys);
|
|
4873
|
-
|
|
4878
|
+
copyEnvKeys(config, env, ["OPENROUTER_APP_ATTRIBUTION"]);
|
|
4879
|
+
withOpencodeConfig(env, config.model);
|
|
4874
4880
|
return env;
|
|
4875
4881
|
},
|
|
4876
4882
|
configuredOptions,
|