@desplega.ai/agent-swarm 1.166.0 → 1.168.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-zhejfecx.js +34 -0
- package/dist/{actions-qz3m692w.js → actions-7jg840nr.js} +25 -25
- package/dist/{amp-adapter-j1xbmsqz.js → amp-adapter-ye6rnetm.js} +4 -4
- package/dist/{anthropic-messages-hst62ws9.js → anthropic-messages-13yn502s.js} +4 -4
- package/dist/{app-43vrdmv8.js → app-ffes2kyf.js} +10 -9
- package/dist/{assistant-ertffmka.js → assistant-fhm5smyz.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-20q3nzvg.js} +9 -8
- package/dist/{boot-reembed-s7k7c6v2.js → boot-reembed-jvfadhsk.js} +9 -8
- package/dist/{boot-scrub-sweep-nepsk4t1.js → boot-scrub-sweep-jtfajzve.js} +10 -9
- package/dist/{boot-seeds-vvzs1zhk.js → boot-seeds-9qt0j8j2.js} +12 -11
- package/dist/{claude-adapter-2zvmekrp.js → claude-adapter-a8znhthz.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-7x7chdrs.js} +7608 -7596
- package/dist/{cli-zsh093hk.js → cli-014vns2y.js} +63 -1
- package/dist/{cli-8kgvmkak.js → cli-0jngabtb.js} +1 -1
- package/dist/{cli-qvfk83fy.js → cli-13xwcqvj.js} +2 -2
- package/dist/{cli-0nhdwxd5.js → cli-43jg9xdw.js} +3 -3
- package/dist/{cli-cpfmqz3n.js → cli-47zfzshm.js} +5 -5
- 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-yshaazs1.js → cli-74ez9b66.js} +63 -20
- 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-fn697bnt.js → cli-9q0bh411.js} +21 -8
- package/dist/{cli-rggdq8wq.js → cli-9q24yyvs.js} +3 -3
- package/dist/cli-a35hzdve.js +33 -0
- package/dist/{cli-3qn4r334.js → cli-aj1e0h0d.js} +20 -14
- package/dist/{cli-rsy933yz.js → cli-bcspch6h.js} +30 -19
- package/dist/{cli-x3x0qwky.js → cli-bxqez1p0.js} +51 -23
- package/dist/{cli-ng97fjq7.js → cli-cmxkbzzs.js} +33 -7
- package/dist/{cli-df56tqdw.js → cli-ee0402n1.js} +198 -70
- package/dist/{cli-mwegs4af.js → cli-ew0c3a1j.js} +3 -3
- package/dist/{cli-ysnyhws9.js → cli-ewhwpyrb.js} +54 -51
- package/dist/{cli-j2jbr8af.js → cli-fhj4y16f.js} +1 -1
- package/dist/{cli-8t229cmr.js → cli-fqq06kkb.js} +30 -17
- package/dist/{cli-jvj6a0cv.js → cli-g6gx2dn1.js} +54 -19
- package/dist/{cli-nexwh8zg.js → cli-g7k7zbcz.js} +12 -5
- package/dist/{cli-ecknp7p1.js → cli-j05x7pnb.js} +10 -10
- package/dist/{cli-gt8azyet.js → cli-jb931ba2.js} +1 -1
- 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-b0f70z24.js → cli-mn8qkd8v.js} +1 -1
- package/dist/{cli-0qjcsxgz.js → cli-nctfv2yy.js} +99 -9
- package/dist/{cli-4r1sjfc4.js → cli-ng1pmdx6.js} +10 -10
- package/dist/cli-nkqjj42q.js +104 -0
- package/dist/{cli-aqcey741.js → cli-p5jqk8fr.js} +1 -1
- package/dist/{cli-66zh26sp.js → cli-pgehz8e1.js} +57 -17
- package/dist/cli-q1vnz8wv.js +96 -0
- package/dist/{cli-fj86xr3c.js → cli-qd97v6z2.js} +2 -2
- package/dist/{cli-p4ztb80h.js → cli-r7eeddkq.js} +13 -8
- package/dist/{cli-8ssjez7e.js → cli-rhy7z1rp.js} +22 -11
- package/dist/{cli-vzc73wet.js → cli-rr5z1j4p.js} +87 -69
- package/dist/{cli-4mevd1hf.js → cli-s9y81s7j.js} +5 -5
- package/dist/{cli-dw2q9f7g.js → cli-svah6b6w.js} +4 -4
- package/dist/{cli-h3x613ze.js → cli-tc5zec7v.js} +6 -6
- package/dist/{cli-ttbsse3f.js → cli-tmhsxhb8.js} +1 -1
- 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-krqm5f11.js → cli-xezn9nkh.js} +16 -13
- package/dist/{cli-8kt0bmgx.js → cli-xf713zz0.js} +2 -2
- package/dist/{cli-6zcfw0x7.js → cli-y195hv1a.js} +1 -1
- package/dist/{cli-x7kpr72a.js → cli-ytmmyj7f.js} +2 -2
- package/dist/{cli-v2a8x45d.js → cli-z48ggfyq.js} +11 -6
- package/dist/{cli-qbksc292.js → cli-zy39d433.js} +2 -0
- package/dist/cli.js +28 -28
- 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-n63k33d3.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-xkxfd81a.js} +18 -18
- package/dist/{commands-mhxam6z2.js → commands-q4mfhn51.js} +9 -8
- package/dist/{cursor-adapter-2qda3st7.js → cursor-adapter-v8mm6bp5.js} +5 -5
- package/dist/{db-sjks418k.js → db-1t0bj3pc.js} +9 -8
- package/dist/{dispatcher-1es759rn.js → dispatcher-k1fhavcf.js} +24 -24
- package/dist/{dsh-adapter-bek4cyw9.js → dsh-adapter-5423p70m.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-phrndeb8.js} +18 -8
- package/dist/{handlers-1gkbhktr.js → handlers-59ywqwzh.js} +27 -27
- package/dist/{hook-vxa3tcsy.js → hook-atj0swc2.js} +14 -14
- package/dist/{hook-ds2zxq9v.js → hook-mew1chq9.js} +42 -31
- package/dist/{http-3h21z9md.js → http-ef2fnn9v.js} +953 -98
- package/dist/{index-n99fycq7.js → index-48pb9erw.js} +24 -24
- package/dist/{index-bn6cy8ps.js → index-9fc2h7ww.js} +24 -24
- package/dist/{index-9b65j1m5.js → index-gr69c43q.js} +9 -8
- package/dist/{index-f8xnqrye.js → index-h26wjcfy.js} +43 -24
- package/dist/{index-dkfxpkmm.js → index-w2yhye23.js} +25 -25
- package/dist/{keepalive-3xspa9jw.js → keepalive-qhcqz56v.js} +11 -10
- package/dist/{lead-6qphc124.js → lead-hpk5r3b1.js} +47 -47
- package/dist/{llama-cpp-classify-tgj35k8d.js → llama-cpp-classify-6erb7wwv.js} +3 -1
- package/dist/{maintenance-0teem1bb.js → maintenance-nvkyp2xe.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-ngskthwh.js} +10 -9
- package/dist/{onboard-54qmnqxe.js → onboard-yfnkqhxc.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-hhm64r6m.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-35f91nx2.js} +11 -10
- package/dist/{rbac-roles-j78wdksm.js → rbac-roles-97w370qj.js} +10 -9
- package/dist/{rbac-roles-9pjphh9q.js → rbac-roles-z6sje3gy.js} +9 -8
- package/dist/{render-v2-pxjs49fx.js → render-v2-n4v66bj3.js} +10 -9
- package/dist/{runtime-v2t1r79e.js → runtime-h9ha1mq6.js} +4 -4
- package/dist/{setup-ymej0xtx.js → setup-m3hhyv5f.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-mxf2c842.js} +27 -27
- package/dist/{worker-qa9fkz5s.js → worker-9t07z1gq.js} +47 -47
- package/openapi.json +72 -1
- package/package.json +10 -10
- 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/script-connections.ts +40 -6
- package/src/be/seed-pricing.ts +84 -53
- package/src/be/swarm-config-guard.ts +14 -0
- package/src/commands/provider-credentials.ts +28 -5
- package/src/commands/runner.ts +7 -12
- package/src/extensions/catalog.generated.json +17 -0
- 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/http/script-connections.ts +35 -0
- package/src/providers/acp-targets.ts +10 -5
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-adapter.ts +32 -0
- package/src/providers/claude-background-keepalive.ts +100 -0
- package/src/providers/claude-sdk-session.ts +6 -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 +11 -2
- 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/scheduler/scheduler.ts +82 -13
- package/src/scripts-runtime/executors/registry.ts +1 -1
- 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-background-keepalive-wiring.test.ts +220 -0
- package/src/tests/claude-background-keepalive.fixture.ts +162 -0
- package/src/tests/claude-background-keepalive.test.ts +139 -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/connection-embedded-auth.test.ts +51 -0
- package/src/tests/context-window.test.ts +2 -2
- package/src/tests/credential-check.test.ts +51 -1
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/dsh-adapter.test.ts +24 -2
- package/src/tests/enabled-tools.test.ts +269 -0
- package/src/tests/entrypoint-codex-oauth-seed.test.ts +12 -0
- package/src/tests/extensions-catalog.test.ts +1 -0
- package/src/tests/extensions-example-slack-reply-gate.test.ts +756 -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/schedule-target-type.test.ts +136 -0
- package/src/tests/script-connections-http.test.ts +45 -0
- package/src/tests/script-connections-mcp.test.ts +41 -0
- package/src/tests/script-executor-registry.test.ts +18 -0
- package/src/tests/send-task-self-send.test.ts +107 -0
- 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/tools/script-connections/tool.ts +35 -3
- package/src/tools/send-task.ts +9 -1
- 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/extensions/README.md +1 -0
- package/templates/extensions/slack-reply-gate/README.md +98 -0
- package/templates/extensions/slack-reply-gate/hooks.ts +582 -0
- package/templates/extensions/slack-reply-gate/manifest.json +8 -0
- 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/swarm-scripts/SKILL.md +10 -0
- package/templates/skills/swarm-scripts/content.md +10 -0
- 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
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
imageFallback,
|
|
8
8
|
resolvePath,
|
|
9
9
|
truncateToWidth
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-5t5my0h8.js";
|
|
11
11
|
|
|
12
12
|
// node_modules/@earendil-works/pi-coding-agent/dist/utils/output-files.js
|
|
13
13
|
import { randomBytes } from "node:crypto";
|
|
@@ -414,14 +414,25 @@ class VisualLinePreview {
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
// node_modules/@earendil-works/pi-coding-agent/dist/utils/ansi.js
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
417
|
+
var ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
418
|
+
var OSC_START = "\\u001B\\]";
|
|
419
|
+
var CSI_START = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?";
|
|
420
|
+
var CSI_FINAL = "[\\dA-PR-TZcf-nq-uy=><~]";
|
|
421
|
+
var ansiRegex = new RegExp(`(?:${OSC_START}[\\s\\S]*?${ST})|${CSI_START}${CSI_FINAL}`, "g");
|
|
422
|
+
var unfinishedAnsiAtEndRegex = new RegExp(`(?:${OSC_START}(?:[^\\u0007\\u009C\\u001B]|\\u001B(?!\\\\))*|${CSI_START})$`);
|
|
423
|
+
var MAX_PENDING_ANSI_LENGTH = 256;
|
|
424
|
+
function splitIncompleteAnsiSuffix(value) {
|
|
425
|
+
if (!value.includes("\x1B") && !value.includes("")) {
|
|
426
|
+
return { complete: value, pending: "" };
|
|
427
|
+
}
|
|
428
|
+
const windowStart = Math.max(0, value.length - MAX_PENDING_ANSI_LENGTH);
|
|
429
|
+
const match = unfinishedAnsiAtEndRegex.exec(value.slice(windowStart));
|
|
430
|
+
if (!match) {
|
|
431
|
+
return { complete: value, pending: "" };
|
|
432
|
+
}
|
|
433
|
+
const splitAt = windowStart + match.index;
|
|
434
|
+
return { complete: value.slice(0, splitAt), pending: value.slice(splitAt) };
|
|
435
|
+
}
|
|
425
436
|
function stripAnsi(value) {
|
|
426
437
|
if (typeof value !== "string") {
|
|
427
438
|
throw new TypeError(`Expected a \`string\`, got \`${typeof value}\``);
|
|
@@ -429,7 +440,7 @@ function stripAnsi(value) {
|
|
|
429
440
|
if (!value.includes("\x1B") && !value.includes("")) {
|
|
430
441
|
return value;
|
|
431
442
|
}
|
|
432
|
-
return value.replace(
|
|
443
|
+
return value.replace(ansiRegex, "");
|
|
433
444
|
}
|
|
434
445
|
|
|
435
446
|
// node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js
|
|
@@ -518,4 +529,4 @@ function renderToolPath(rawPath, theme, cwd, options) {
|
|
|
518
529
|
return linkPath(theme.fg("accent", shortenPath(value)), value, cwd);
|
|
519
530
|
}
|
|
520
531
|
|
|
521
|
-
export { stripAnsi, writeOutputFile, createOutputFileStream, getShellConfig, getPowerShellConfig, getShellEnv, sanitizeBinaryOutput, trackDetachedChildPid, untrackDetachedChildPid, killTrackedDetachedChildren, killProcessTree, DEFAULT_MAX_LINES, DEFAULT_MAX_BYTES, GREP_MAX_LINE_LENGTH, formatSize, truncateHead, truncateTail, truncateLine, truncateMiddle, truncateToVisualLines, VisualLinePreview, shortenPath, str, replaceTabs, normalizeDisplayText, getTextOutput, formatToolCallWithArgs, invalidArgText, renderToolPath };
|
|
532
|
+
export { splitIncompleteAnsiSuffix, stripAnsi, writeOutputFile, createOutputFileStream, getShellConfig, getPowerShellConfig, getShellEnv, sanitizeBinaryOutput, trackDetachedChildPid, untrackDetachedChildPid, killTrackedDetachedChildren, killProcessTree, DEFAULT_MAX_LINES, DEFAULT_MAX_BYTES, GREP_MAX_LINE_LENGTH, formatSize, truncateHead, truncateTail, truncateLine, truncateMiddle, truncateToVisualLines, VisualLinePreview, shortenPath, str, replaceTabs, normalizeDisplayText, getTextOutput, formatToolCallWithArgs, invalidArgText, renderToolPath };
|
|
@@ -3,52 +3,56 @@ import {
|
|
|
3
3
|
} from "./cli-9q3wt23f.js";
|
|
4
4
|
import {
|
|
5
5
|
checkCursorCredentials
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-6bpvv8h4.js";
|
|
7
7
|
import {
|
|
8
8
|
checkGrokCredentials
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-9q0bh411.js";
|
|
10
|
+
import {
|
|
11
|
+
createSkillInvokeTracker,
|
|
12
|
+
isSkillLoaderCall,
|
|
13
|
+
skillFromToolArgs
|
|
14
|
+
} from "./cli-9k7mqz00.js";
|
|
10
15
|
import {
|
|
11
16
|
checkCodexCredentials,
|
|
12
17
|
codexUserHome
|
|
13
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-fqq06kkb.js";
|
|
14
19
|
import {
|
|
15
20
|
checkClaudeManagedCredentials
|
|
16
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-tc5zec7v.js";
|
|
17
22
|
import {
|
|
18
23
|
checkDevinCredentials
|
|
19
24
|
} from "./cli-hf5s9pgf.js";
|
|
20
25
|
import {
|
|
21
26
|
checkOpencodeCredentials
|
|
22
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-jvmtxqtc.js";
|
|
23
28
|
import {
|
|
24
29
|
checkDshCredentials
|
|
25
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-z48ggfyq.js";
|
|
26
31
|
import {
|
|
27
32
|
checkAmpCredentials,
|
|
28
33
|
liveTestAmpCredentials
|
|
29
|
-
} from "./cli-
|
|
30
|
-
import {
|
|
31
|
-
createSkillInvokeTracker,
|
|
32
|
-
isSkillLoaderCall,
|
|
33
|
-
skillFromToolArgs
|
|
34
|
-
} from "./cli-9k7mqz00.js";
|
|
35
|
-
import {
|
|
36
|
-
checkClaudeCredentials
|
|
37
|
-
} from "./cli-0qjcsxgz.js";
|
|
38
|
-
import {
|
|
39
|
-
getContextWindowSize
|
|
40
|
-
} from "./cli-32bca7nr.js";
|
|
34
|
+
} from "./cli-ew0c3a1j.js";
|
|
41
35
|
import {
|
|
42
36
|
isUnknownModelError,
|
|
43
37
|
renderMemoriesPrompt,
|
|
44
38
|
writeSkillsToFilesystem
|
|
45
39
|
} from "./cli-efnd2kce.js";
|
|
40
|
+
import {
|
|
41
|
+
ACP_TARGET_IDS,
|
|
42
|
+
isAcpTarget
|
|
43
|
+
} from "./cli-zp67qg5x.js";
|
|
46
44
|
import {
|
|
47
45
|
CODEX_OAUTH_POOL_SLOTS_ENV,
|
|
48
46
|
countCodexOAuthPoolSlots,
|
|
49
47
|
hasCodexOAuthPoolSlots,
|
|
50
48
|
isCodexOAuthConfigKey
|
|
51
49
|
} from "./cli-bqjfjex4.js";
|
|
50
|
+
import {
|
|
51
|
+
checkClaudeCredentials
|
|
52
|
+
} from "./cli-nctfv2yy.js";
|
|
53
|
+
import {
|
|
54
|
+
getContextWindowSize
|
|
55
|
+
} from "./cli-7avy4v8w.js";
|
|
52
56
|
import {
|
|
53
57
|
CODEX_CREDITS_EXHAUSTED_COOLDOWN_MS,
|
|
54
58
|
MAX_RATE_LIMIT_RESET_MS,
|
|
@@ -63,21 +67,18 @@ import {
|
|
|
63
67
|
parseAzureDevOpsRepoUrl,
|
|
64
68
|
resolveScriptsOnlyMode,
|
|
65
69
|
validateJsonSchema
|
|
66
|
-
} from "./cli-
|
|
70
|
+
} from "./cli-ee0402n1.js";
|
|
67
71
|
import {
|
|
68
72
|
getApiKey
|
|
69
73
|
} from "./cli-f14fvzag.js";
|
|
70
|
-
import {
|
|
71
|
-
terminateRegisteredProcessGroups
|
|
72
|
-
} from "./cli-zt3w1cn1.js";
|
|
73
74
|
import {
|
|
74
75
|
authJsonToCredentialSelection,
|
|
75
76
|
credentialsToAuthJson,
|
|
76
77
|
loadAllCodexOAuthSlots
|
|
77
|
-
} from "./cli-
|
|
78
|
+
} from "./cli-v1w7pbd8.js";
|
|
78
79
|
import {
|
|
79
|
-
|
|
80
|
-
} from "./cli-
|
|
80
|
+
terminateRegisteredProcessGroups
|
|
81
|
+
} from "./cli-zt3w1cn1.js";
|
|
81
82
|
import {
|
|
82
83
|
ensure,
|
|
83
84
|
initOtel,
|
|
@@ -87,7 +88,7 @@ import {
|
|
|
87
88
|
startSpan,
|
|
88
89
|
withSpan,
|
|
89
90
|
withSpanContext
|
|
90
|
-
} from "./cli-
|
|
91
|
+
} from "./cli-j05x7pnb.js";
|
|
91
92
|
import {
|
|
92
93
|
initTelemetry,
|
|
93
94
|
init_api_drain,
|
|
@@ -98,7 +99,7 @@ import {
|
|
|
98
99
|
isCodexAuthFailureReason,
|
|
99
100
|
mapTriggerSurface,
|
|
100
101
|
telemetry
|
|
101
|
-
} from "./cli-
|
|
102
|
+
} from "./cli-74ez9b66.js";
|
|
102
103
|
import {
|
|
103
104
|
ProviderNameSchema,
|
|
104
105
|
init_types,
|
|
@@ -127,11 +128,21 @@ import {
|
|
|
127
128
|
taskAttachmentFetchCommand,
|
|
128
129
|
writeIdentityBaselines,
|
|
129
130
|
writeProfileFileFromDb
|
|
130
|
-
} from "./cli-
|
|
131
|
+
} from "./cli-mxvnnv5q.js";
|
|
131
132
|
import {
|
|
132
133
|
init_steering_enabled,
|
|
133
134
|
isSteeringEnabled
|
|
134
135
|
} from "./cli-7mm2r1kp.js";
|
|
136
|
+
import {
|
|
137
|
+
init_templates
|
|
138
|
+
} from "./cli-agamgm0p.js";
|
|
139
|
+
import {
|
|
140
|
+
configureHttpResolver,
|
|
141
|
+
init_resolver,
|
|
142
|
+
init_template,
|
|
143
|
+
interpolate,
|
|
144
|
+
resolveTemplateAsync
|
|
145
|
+
} from "./cli-5c2j5yvx.js";
|
|
135
146
|
import {
|
|
136
147
|
CLAUDE_CREDENTIALS_HINT,
|
|
137
148
|
ModelWindowExhaustedError,
|
|
@@ -145,32 +156,27 @@ import {
|
|
|
145
156
|
parseModelLimitMessage,
|
|
146
157
|
windowForModelFamily
|
|
147
158
|
} from "./cli-ywybs5as.js";
|
|
148
|
-
import {
|
|
149
|
-
getMcpBaseUrl,
|
|
150
|
-
init_constants
|
|
151
|
-
} from "./cli-gd4favx9.js";
|
|
152
|
-
import {
|
|
153
|
-
init_templates
|
|
154
|
-
} from "./cli-agamgm0p.js";
|
|
155
|
-
import {
|
|
156
|
-
configureHttpResolver,
|
|
157
|
-
init_resolver,
|
|
158
|
-
init_template,
|
|
159
|
-
interpolate,
|
|
160
|
-
resolveTemplateAsync
|
|
161
|
-
} from "./cli-5c2j5yvx.js";
|
|
162
159
|
import {
|
|
163
160
|
deriveDefaultRoute,
|
|
164
161
|
init_src,
|
|
165
162
|
validateRoute
|
|
166
163
|
} from "./cli-f9w1semm.js";
|
|
164
|
+
import {
|
|
165
|
+
getOpenRouterAttributionHeaders,
|
|
166
|
+
getOpenRouterBaseUrl,
|
|
167
|
+
init_openrouter_base_url
|
|
168
|
+
} from "./cli-a35hzdve.js";
|
|
169
|
+
import {
|
|
170
|
+
getMcpBaseUrl,
|
|
171
|
+
init_constants
|
|
172
|
+
} from "./cli-gd4favx9.js";
|
|
167
173
|
import {
|
|
168
174
|
harnessModelMismatch,
|
|
169
175
|
init_runtime_model_catalog,
|
|
170
176
|
init_src as init_src2,
|
|
171
177
|
refreshRuntimeModelCatalog,
|
|
172
178
|
runtimeHarnessSections
|
|
173
|
-
} from "./cli-
|
|
179
|
+
} from "./cli-014vns2y.js";
|
|
174
180
|
import {
|
|
175
181
|
init_secret_scrubber,
|
|
176
182
|
registerSensitiveKeyName,
|
|
@@ -212,19 +218,19 @@ async function materializeCodexAuthJson(_slot, creds, deps = {}) {
|
|
|
212
218
|
async function createProviderAdapter(provider) {
|
|
213
219
|
switch (provider) {
|
|
214
220
|
case "claude": {
|
|
215
|
-
const { ClaudeAdapter } = await import("./claude-adapter-
|
|
221
|
+
const { ClaudeAdapter } = await import("./claude-adapter-a8znhthz.js");
|
|
216
222
|
return new ClaudeAdapter;
|
|
217
223
|
}
|
|
218
224
|
case "pi": {
|
|
219
|
-
const { PiMonoAdapter } = await import("./pi-mono-adapter-
|
|
225
|
+
const { PiMonoAdapter } = await import("./pi-mono-adapter-0eg8kw2c.js");
|
|
220
226
|
return new PiMonoAdapter;
|
|
221
227
|
}
|
|
222
228
|
case "codex": {
|
|
223
|
-
const { CodexAdapter } = await import("./codex-adapter-
|
|
229
|
+
const { CodexAdapter } = await import("./codex-adapter-n63k33d3.js");
|
|
224
230
|
return new CodexAdapter;
|
|
225
231
|
}
|
|
226
232
|
case "claude-managed": {
|
|
227
|
-
const { ClaudeManagedAdapter } = await import("./claude-managed-adapter-
|
|
233
|
+
const { ClaudeManagedAdapter } = await import("./claude-managed-adapter-tzwxy803.js");
|
|
228
234
|
return new ClaudeManagedAdapter;
|
|
229
235
|
}
|
|
230
236
|
case "devin": {
|
|
@@ -232,27 +238,27 @@ async function createProviderAdapter(provider) {
|
|
|
232
238
|
return new DevinAdapter;
|
|
233
239
|
}
|
|
234
240
|
case "opencode": {
|
|
235
|
-
const { OpencodeAdapter } = await import("./opencode-adapter-
|
|
241
|
+
const { OpencodeAdapter } = await import("./opencode-adapter-yjyqynzf.js");
|
|
236
242
|
return new OpencodeAdapter;
|
|
237
243
|
}
|
|
238
244
|
case "dsh": {
|
|
239
|
-
const { DshAdapter } = await import("./dsh-adapter-
|
|
245
|
+
const { DshAdapter } = await import("./dsh-adapter-5423p70m.js");
|
|
240
246
|
return new DshAdapter;
|
|
241
247
|
}
|
|
242
248
|
case "amp": {
|
|
243
|
-
const { AmpAdapter } = await import("./amp-adapter-
|
|
249
|
+
const { AmpAdapter } = await import("./amp-adapter-ye6rnetm.js");
|
|
244
250
|
return new AmpAdapter;
|
|
245
251
|
}
|
|
246
252
|
case "cursor": {
|
|
247
|
-
const { CursorAdapter } = await import("./cursor-adapter-
|
|
253
|
+
const { CursorAdapter } = await import("./cursor-adapter-v8mm6bp5.js");
|
|
248
254
|
return new CursorAdapter;
|
|
249
255
|
}
|
|
250
256
|
case "grok": {
|
|
251
|
-
const { GrokAdapter } = await import("./grok-adapter-
|
|
257
|
+
const { GrokAdapter } = await import("./grok-adapter-phrndeb8.js");
|
|
252
258
|
return new GrokAdapter;
|
|
253
259
|
}
|
|
254
260
|
case "acp": {
|
|
255
|
-
const { ACPAdapter } = await import("./acp-adapter-
|
|
261
|
+
const { ACPAdapter } = await import("./acp-adapter-zhejfecx.js");
|
|
256
262
|
return new ACPAdapter;
|
|
257
263
|
}
|
|
258
264
|
default:
|
|
@@ -933,6 +939,7 @@ async function reportCredentialOutcomeThenFinish(input, finish) {
|
|
|
933
939
|
// src/commands/provider-credentials.ts
|
|
934
940
|
init_src();
|
|
935
941
|
init_credentials();
|
|
942
|
+
init_openrouter_base_url();
|
|
936
943
|
init_secret_scrubber();
|
|
937
944
|
function isBedrockMode(env) {
|
|
938
945
|
const mode = env.BEDROCK_AUTH_MODE?.toLowerCase();
|
|
@@ -952,10 +959,28 @@ var CREDENTIAL_PROVIDER_CHECKERS = {
|
|
|
952
959
|
devin: (env) => checkDevinCredentials(env),
|
|
953
960
|
opencode: (env, opts) => checkOpencodeCredentials(env, opts),
|
|
954
961
|
pi: async (env, opts) => {
|
|
955
|
-
const { checkPiMonoCredentials } = await import("./pi-mono-adapter-
|
|
962
|
+
const { checkPiMonoCredentials } = await import("./pi-mono-adapter-0eg8kw2c.js");
|
|
956
963
|
return checkPiMonoCredentials(env, opts);
|
|
957
964
|
},
|
|
958
|
-
acp: () =>
|
|
965
|
+
acp: (env) => {
|
|
966
|
+
const target = env.ACP_TARGET ?? "custom";
|
|
967
|
+
if (!isAcpTarget(target)) {
|
|
968
|
+
return {
|
|
969
|
+
ready: false,
|
|
970
|
+
missing: ["ACP_TARGET"],
|
|
971
|
+
hint: `Set ACP_TARGET to one of: ${ACP_TARGET_IDS.join(", ")}.`
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
const command = env.ACP_TARGET_COMMAND ?? env.ACP_COMMAND;
|
|
975
|
+
if (target === "custom" && !command?.trim()) {
|
|
976
|
+
return {
|
|
977
|
+
ready: false,
|
|
978
|
+
missing: ["ACP_TARGET_COMMAND"],
|
|
979
|
+
hint: "Set ACP_TARGET_COMMAND (or ACP_COMMAND) to an ACP-compatible executable, or select a preset with ACP_TARGET."
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
return { ready: true, missing: [], satisfiedBy: "sdk-delegated" };
|
|
983
|
+
}
|
|
959
984
|
};
|
|
960
985
|
async function checkProviderCredentials(provider, env, opts) {
|
|
961
986
|
const checker = CREDENTIAL_PROVIDER_CHECKERS[provider];
|
|
@@ -1036,9 +1061,10 @@ async function checkXaiApiKey(apiKey) {
|
|
|
1036
1061
|
};
|
|
1037
1062
|
}
|
|
1038
1063
|
async function checkOpenRouter(apiKey) {
|
|
1039
|
-
const
|
|
1064
|
+
const url = `${getOpenRouterBaseUrl()}/models`;
|
|
1065
|
+
const r = await timedFetch(url, {
|
|
1040
1066
|
method: "GET",
|
|
1041
|
-
headers: { Authorization: `Bearer ${apiKey}` }
|
|
1067
|
+
headers: { ...getOpenRouterAttributionHeaders(url), Authorization: `Bearer ${apiKey}` }
|
|
1042
1068
|
});
|
|
1043
1069
|
if (r.ok)
|
|
1044
1070
|
return { ok: true, latency_ms: r.latency_ms };
|
|
@@ -1183,7 +1209,7 @@ async function validateProviderCredentials(provider, env = process.env, presence
|
|
|
1183
1209
|
latency_ms: Date.now() - startedAt
|
|
1184
1210
|
};
|
|
1185
1211
|
}
|
|
1186
|
-
const { liveTestCursorKey } = await import("./cursor-adapter-
|
|
1212
|
+
const { liveTestCursorKey } = await import("./cursor-adapter-v8mm6bp5.js");
|
|
1187
1213
|
const result = await liveTestCursorKey(apiKey);
|
|
1188
1214
|
return result.ok ? { ok: true, latency_ms: Date.now() - startedAt } : { ok: false, error: result.error, latency_ms: Date.now() - startedAt };
|
|
1189
1215
|
}
|
|
@@ -2510,17 +2536,9 @@ async function resolveCodexOAuthCredentialInfo(apiUrl, apiKey) {
|
|
|
2510
2536
|
await materializeCodexAuthJson(selectedSlot, slotEntry.creds, {
|
|
2511
2537
|
includeRefreshToken: false
|
|
2512
2538
|
});
|
|
2513
|
-
const authJson = {
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
tokens: {
|
|
2517
|
-
id_token: slotEntry.creds.access,
|
|
2518
|
-
access_token: slotEntry.creds.access,
|
|
2519
|
-
refresh_token: slotEntry.creds.refresh,
|
|
2520
|
-
account_id: slotEntry.creds.accountId
|
|
2521
|
-
},
|
|
2522
|
-
last_refresh: new Date(slotEntry.creds.expires).toISOString()
|
|
2523
|
-
};
|
|
2539
|
+
const authJson = credentialsToAuthJson(slotEntry.creds, {
|
|
2540
|
+
includeRefreshToken: false
|
|
2541
|
+
});
|
|
2524
2542
|
const sel = {
|
|
2525
2543
|
...authJsonToCredentialSelection(authJson, selectedSlot, slots.length),
|
|
2526
2544
|
authFailureFence
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getTextOutput,
|
|
4
4
|
replaceTabs,
|
|
5
5
|
str
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-rhy7z1rp.js";
|
|
7
7
|
import {
|
|
8
8
|
Container,
|
|
9
9
|
Spacer,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getDocsPath,
|
|
12
12
|
highlightCode,
|
|
13
13
|
keyHint
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-5t5my0h8.js";
|
|
15
15
|
import {
|
|
16
16
|
exports_typebox
|
|
17
17
|
} from "./cli-rb9m6rpe.js";
|
|
@@ -613,7 +613,7 @@ function createToolDefinitionFromAgentTool(tool) {
|
|
|
613
613
|
}
|
|
614
614
|
|
|
615
615
|
// node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.lazy.js
|
|
616
|
-
var loadCodemodeExecutor = () => import("./execute-
|
|
616
|
+
var loadCodemodeExecutor = () => import("./execute-h4jgevyw.js");
|
|
617
617
|
|
|
618
618
|
// node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.js
|
|
619
619
|
var CODE_PREVIEW_LINES = 10;
|
|
@@ -755,9 +755,9 @@ var DESCRIPTION_INTRO = `Run JavaScript that calls other tools. The input is raw
|
|
|
755
755
|
function describeGlobals(models) {
|
|
756
756
|
const lines = [
|
|
757
757
|
"Globals:",
|
|
758
|
-
"- `text(value)`, `image(dataUrlOrImageBlock)`, `console.log(...)`, and top-level `return` add output; `exit()` ends the script. `image()` also saves the image to a temp file and the result names its path.",
|
|
758
|
+
"- `text(value)`, `image(dataUrlOrImageBlock)`, `console.log(...)`, and top-level `return` add output; `exit()` ends the script. With several text items, each starts with a `==> text N/M <==` line, and `console` lines follow the other output in one `<console_output>` block. `image()` also saves the image to a temp file and the result names its path.",
|
|
759
759
|
"- `store(key, value)` and `load(key)` keep JSON values across codemode calls.",
|
|
760
|
-
"- `ALL_TOOLS`, `searchTools(query, { limit?, namespace? })`, `describeTool(name)`, `describeNamespace(name)`: find unlisted tools, such as MCP tools."
|
|
760
|
+
"- `ALL_TOOLS`, `await searchTools(query, { limit?, namespace? })`, `await describeTool(name)`, `await describeNamespace(name)`: find unlisted tools, such as MCP tools."
|
|
761
761
|
];
|
|
762
762
|
if (models) {
|
|
763
763
|
lines.push(`- \`models\`: classifiers and image generation. Read ${CODEMODE_DOCS_PATH} first.`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSlackUserId,
|
|
3
3
|
rewriteSlackMentions
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-ytmmyj7f.js";
|
|
5
5
|
import {
|
|
6
6
|
bufferedFileFailures,
|
|
7
7
|
buildEffectiveText,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
fetchSlackFiles,
|
|
12
12
|
findUserByExternalId,
|
|
13
13
|
notifySlackFileFailures
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-ee0402n1.js";
|
|
15
15
|
import {
|
|
16
16
|
buildBufferFlushBlocks,
|
|
17
17
|
ensureSlackThreadTree,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getSlackApp,
|
|
21
21
|
isSlackRenderV2Enabled,
|
|
22
22
|
registerTreeMessage
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-j05x7pnb.js";
|
|
24
24
|
import {
|
|
25
25
|
createLogEntry,
|
|
26
26
|
getAgentById,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
init_steering,
|
|
34
34
|
requestSteering,
|
|
35
35
|
slackContextKey
|
|
36
|
-
} from "./cli-
|
|
36
|
+
} from "./cli-74ez9b66.js";
|
|
37
37
|
import {
|
|
38
38
|
init_steering_enabled,
|
|
39
39
|
isSteeringEnabled
|
|
@@ -4,23 +4,23 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
readPkgVersion
|
|
6
6
|
} from "./cli-gt4hxb8p.js";
|
|
7
|
+
import {
|
|
8
|
+
checkToolLoop
|
|
9
|
+
} from "./cli-hp1n6zq3.js";
|
|
7
10
|
import {
|
|
8
11
|
CONTEXT_FORMULA,
|
|
9
12
|
clampContextPercent,
|
|
10
13
|
computeContextUsedUnified,
|
|
11
14
|
getContextWindowSize
|
|
12
|
-
} from "./cli-
|
|
13
|
-
import {
|
|
14
|
-
checkToolLoop
|
|
15
|
-
} from "./cli-hp1n6zq3.js";
|
|
15
|
+
} from "./cli-7avy4v8w.js";
|
|
16
16
|
import {
|
|
17
17
|
Anthropic
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-5qkcdv8c.js";
|
|
19
19
|
import {
|
|
20
20
|
init_runtime_model_catalog,
|
|
21
21
|
init_src,
|
|
22
22
|
runtimeCatalogModel
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-014vns2y.js";
|
|
24
24
|
import {
|
|
25
25
|
init_secret_scrubber,
|
|
26
26
|
scrubSecrets
|
|
@@ -366,7 +366,8 @@ function credentialsToAuthJson(creds, opts = {}) {
|
|
|
366
366
|
refresh_token: includeRefreshToken ? creds.refresh : "",
|
|
367
367
|
account_id: creds.accountId
|
|
368
368
|
},
|
|
369
|
-
last_refresh: new Date(
|
|
369
|
+
last_refresh: new Date().toISOString(),
|
|
370
|
+
expires: creds.expires
|
|
370
371
|
};
|
|
371
372
|
}
|
|
372
373
|
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProjectTrustStore,
|
|
3
|
+
addMcpServerConfig,
|
|
4
|
+
loadMcpConfig,
|
|
5
|
+
openBrowser,
|
|
6
|
+
removeMcpServerConfig
|
|
7
|
+
} from "./cli-13xwcqvj.js";
|
|
1
8
|
import {
|
|
2
9
|
McpOAuthCredentialStore,
|
|
3
10
|
McpServerConnection,
|
|
@@ -5,24 +12,17 @@ import {
|
|
|
5
12
|
McpSignInCancelledError,
|
|
6
13
|
createDefaultTransport,
|
|
7
14
|
signInMcpServer
|
|
8
|
-
} from "./cli-
|
|
9
|
-
import {
|
|
10
|
-
ProjectTrustStore,
|
|
11
|
-
addMcpServerConfig,
|
|
12
|
-
loadMcpConfig,
|
|
13
|
-
openBrowser,
|
|
14
|
-
removeMcpServerConfig
|
|
15
|
-
} from "./cli-qvfk83fy.js";
|
|
15
|
+
} from "./cli-bxqez1p0.js";
|
|
16
16
|
import {
|
|
17
17
|
getMcpToolExposure,
|
|
18
18
|
validateMcpServerConfig
|
|
19
|
-
} from "./cli-
|
|
20
|
-
import"./cli-
|
|
19
|
+
} from "./cli-xezn9nkh.js";
|
|
20
|
+
import"./cli-rhy7z1rp.js";
|
|
21
21
|
import {
|
|
22
22
|
APP_NAME,
|
|
23
23
|
CONFIG_DIR_NAME,
|
|
24
24
|
source_default
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-5t5my0h8.js";
|
|
26
26
|
import"./cli-5bfdm1ah.js";
|
|
27
27
|
import"./cli-0m7wct0d.js";
|
|
28
28
|
import"./cli-2x0e561b.js";
|
|
@@ -451,8 +451,9 @@ async function login(entry, connection, url, timeoutMs, options, credentials, lo
|
|
|
451
451
|
${authorizationUrl.href}`);
|
|
452
452
|
openUrl(authorizationUrl.href);
|
|
453
453
|
},
|
|
454
|
-
promptForRedirectUrl: (signal) => waitForRedirectUrl(signal,
|
|
455
|
-
}
|
|
454
|
+
promptForRedirectUrl: (signal) => waitForRedirectUrl(signal, interactive)
|
|
455
|
+
},
|
|
456
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
456
457
|
});
|
|
457
458
|
} catch (signInError) {
|
|
458
459
|
error(signInError instanceof McpSignInCancelledError ? `Sign-in to MCP server "${name}" was cancelled or not completed within ${Math.round(timeoutMs / 1000)} seconds.` : `Sign-in to MCP server "${name}" failed: ${errorMessage(signInError)}`);
|
|
@@ -468,27 +469,21 @@ ${authorizationUrl.href}`);
|
|
|
468
469
|
log(`Signed in to MCP server "${name}" (${connection.tools.length} tools).`);
|
|
469
470
|
return 0;
|
|
470
471
|
}
|
|
471
|
-
async function waitForRedirectUrl(signal,
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
472
|
+
async function waitForRedirectUrl(signal, interactive) {
|
|
473
|
+
if (!interactive) {
|
|
474
|
+
if (!signal.aborted)
|
|
475
|
+
await new Promise((resolve) => signal.addEventListener("abort", resolve, { once: true }));
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
const readline = createInterface({ input: process.stdin, output: process.stderr });
|
|
476
479
|
try {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
try {
|
|
483
|
-
return await readline.question("If the browser cannot reach this machine, paste the URL it was redirected to: ", { signal: controller.signal });
|
|
484
|
-
} catch {
|
|
485
|
-
return;
|
|
486
|
-
} finally {
|
|
487
|
-
readline.close();
|
|
488
|
-
}
|
|
480
|
+
return await readline.question("If the browser cannot reach this machine, paste the URL it was redirected to: ", {
|
|
481
|
+
signal
|
|
482
|
+
});
|
|
483
|
+
} catch {
|
|
484
|
+
return;
|
|
489
485
|
} finally {
|
|
490
|
-
|
|
491
|
-
signal.removeEventListener("abort", abort);
|
|
486
|
+
readline.close();
|
|
492
487
|
}
|
|
493
488
|
}
|
|
494
489
|
export {
|
|
@@ -77,6 +77,8 @@ class EventStream {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
class AssistantMessageEventStream extends EventStream {
|
|
80
|
+
#startedAt = Date.now();
|
|
81
|
+
#startedAtMonotonic = performance.now();
|
|
80
82
|
constructor() {
|
|
81
83
|
super((event) => event.type === "done" || event.type === "error", (event) => {
|
|
82
84
|
if (event.type === "done") {
|
|
@@ -87,6 +89,23 @@ class AssistantMessageEventStream extends EventStream {
|
|
|
87
89
|
throw new Error("Unexpected event type for final result");
|
|
88
90
|
});
|
|
89
91
|
}
|
|
92
|
+
push(event) {
|
|
93
|
+
if (event.type === "done")
|
|
94
|
+
this.#time(event.message);
|
|
95
|
+
else if (event.type === "error")
|
|
96
|
+
this.#time(event.error);
|
|
97
|
+
super.push(event);
|
|
98
|
+
}
|
|
99
|
+
end(result) {
|
|
100
|
+
if (result !== undefined)
|
|
101
|
+
this.#time(result);
|
|
102
|
+
super.end(result);
|
|
103
|
+
}
|
|
104
|
+
#time(message) {
|
|
105
|
+
if (this.done || message.durationMs !== undefined || message.timestamp < this.#startedAt)
|
|
106
|
+
return;
|
|
107
|
+
message.durationMs = Math.max(0, Math.round(performance.now() - this.#startedAtMonotonic));
|
|
108
|
+
}
|
|
90
109
|
}
|
|
91
110
|
function createAssistantMessageEventStream() {
|
|
92
111
|
return new AssistantMessageEventStream;
|