shortcutxl 0.3.90 → 0.3.92

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.
Files changed (136) hide show
  1. package/BINARY-INVENTORY.json +16 -16
  2. package/CHANGELOG.md +10 -0
  3. package/dist/ai/types.d.ts +2 -0
  4. package/dist/app/connectors/secret-store.d.ts +8 -0
  5. package/dist/app/connectors/secret-store.js +73 -1
  6. package/dist/app/mcp/auth-status.d.ts +2 -0
  7. package/dist/app/mcp/auth-status.js +5 -1
  8. package/dist/app/mcp/connection.d.ts +32 -2
  9. package/dist/app/mcp/connection.js +179 -83
  10. package/dist/app/mcp/index.js +44 -9
  11. package/dist/app/mcp/types.d.ts +3 -1
  12. package/dist/app/modes/action/agent.js +2 -1
  13. package/dist/app/modes/action/prompt.js +1 -1
  14. package/dist/app/modes/ask/agent.js +2 -1
  15. package/dist/app/modes/ask/prompt.js +3 -3
  16. package/dist/app/modes/plan/agent.js +2 -1
  17. package/dist/app/modes/plan/prompt.js +2 -2
  18. package/dist/app/modes/skill-forge/agent.js +2 -1
  19. package/dist/app/prompts/mog-cli.d.ts +3 -0
  20. package/dist/app/prompts/mog-cli.js +46 -0
  21. package/dist/app/prompts/shared-guidelines.d.ts +12 -2
  22. package/dist/app/prompts/shared-guidelines.js +31 -3
  23. package/dist/app/prompts/spreadjs-api-reference.json +5 -0
  24. package/dist/app/providers/model-registry.d.ts +1 -0
  25. package/dist/app/providers/model-registry.js +1 -0
  26. package/dist/app/providers/model-resolver.js +2 -1
  27. package/dist/app/providers/shortcut-api-v2-transport.js +1 -0
  28. package/dist/app/session/forked-agent.js +9 -4
  29. package/dist/app/session/session-models.js +4 -3
  30. package/dist/app/subagents/clone/agent.js +4 -1
  31. package/dist/app/subagents/simulation/agent.js +13 -9
  32. package/dist/app/subagents/verification/agent.js +12 -2
  33. package/dist/app/subagents/workbook-reader/agent.js +6 -4
  34. package/dist/app/tools/bash.d.ts +2 -0
  35. package/dist/app/tools/bash.js +10 -1
  36. package/dist/app/tools/task/runner.js +10 -9
  37. package/dist/cli/args.d.ts +1 -0
  38. package/dist/cli/args.js +4 -0
  39. package/dist/cli.js +2140 -984
  40. package/dist/contracts/agent-api.d.ts +5 -4
  41. package/dist/contracts/agent-api.js +6 -5
  42. package/dist/core/agent-controller.d.ts +9 -0
  43. package/dist/core/agent-controller.js +19 -2
  44. package/dist/core/agent-engine.d.ts +3 -0
  45. package/dist/core/agent-engine.js +23 -3
  46. package/dist/core/agent-loop.js +5 -1
  47. package/dist/core/core-types.d.ts +2 -0
  48. package/dist/core/prompts/agent-guidelines.d.ts +1 -1
  49. package/dist/core/prompts/agent-guidelines.js +1 -1
  50. package/dist/core/prompts/model-addenda.d.ts +9 -0
  51. package/dist/core/prompts/model-addenda.js +31 -0
  52. package/dist/core/session/compaction/compaction.d.ts +1 -1
  53. package/dist/core/session/compaction/compaction.js +2 -2
  54. package/dist/core/session/compaction/constants.d.ts +4 -3
  55. package/dist/core/session/compaction/constants.js +5 -4
  56. package/dist/core/session/session-compaction.js +6 -4
  57. package/dist/credits/shortcut-credits.d.ts +2 -0
  58. package/dist/credits/shortcut-credits.js +12 -1
  59. package/dist/embedded-agent/agent-event-funnel.d.ts +2 -3
  60. package/dist/embedded-agent/agent-event-funnel.js +6 -7
  61. package/dist/embedded-agent/compaction-wiring.d.ts +2 -2
  62. package/dist/embedded-agent/compaction-wiring.js +44 -22
  63. package/dist/embedded-agent/compose.js +102 -34
  64. package/dist/embedded-agent/credit-gate.d.ts +18 -1
  65. package/dist/embedded-agent/credit-gate.js +40 -4
  66. package/dist/embedded-agent/host-runtime-options.js +4 -0
  67. package/dist/embedded-agent/host-tools/build-tool-list.d.ts +2 -0
  68. package/dist/embedded-agent/host-tools/build-tool-list.js +6 -0
  69. package/dist/embedded-agent/host-tools/execute-code/allowed-functions.json +4 -0
  70. package/dist/embedded-agent/host-tools/mcp/contract.d.ts +12 -0
  71. package/dist/embedded-agent/host-tools/mcp/contract.js +20 -1
  72. package/dist/embedded-agent/host-tools/mcp/index.d.ts +1 -1
  73. package/dist/embedded-agent/host-tools/mcp/index.js +1 -1
  74. package/dist/embedded-agent/host-tools/mode-host-tools.d.ts +2 -0
  75. package/dist/embedded-agent/host-tools/mode-host-tools.js +2 -0
  76. package/dist/embedded-agent/host-tools/task/contract.d.ts +4 -1
  77. package/dist/embedded-agent/host-tools/task/contract.js +6 -1
  78. package/dist/embedded-agent/host-tools/task/lifecycle.d.ts +2 -0
  79. package/dist/embedded-agent/host-tools/task/lifecycle.js +54 -32
  80. package/dist/embedded-agent/host-tools/task/runner.js +4 -3
  81. package/dist/embedded-agent/host-tools/task/send-message.js +5 -1
  82. package/dist/embedded-agent/index.d.ts +2 -0
  83. package/dist/embedded-agent/model-registry.d.ts +5 -0
  84. package/dist/embedded-agent/model-registry.js +5 -0
  85. package/dist/embedded-agent/persistence.d.ts +2 -2
  86. package/dist/embedded-agent/persistence.js +1 -1
  87. package/dist/embedded-agent/prompt/build.d.ts +0 -1
  88. package/dist/embedded-agent/prompt/build.js +0 -1
  89. package/dist/embedded-agent/provider-fast-mode.js +8 -4
  90. package/dist/embedded-agent/recovery-wiring.d.ts +2 -0
  91. package/dist/embedded-agent/recovery-wiring.js +1 -13
  92. package/dist/embedded-agent/task-notification-turn-queue.d.ts +8 -9
  93. package/dist/embedded-agent/task-notification-turn-queue.js +65 -39
  94. package/dist/main.d.ts +1 -0
  95. package/dist/main.js +62 -15
  96. package/dist/model-display.js +1 -1
  97. package/dist/model-ids.d.ts +11 -1
  98. package/dist/model-ids.js +16 -2
  99. package/dist/rpc/rpc-host.d.ts +3 -1
  100. package/dist/rpc/rpc-host.js +4 -1
  101. package/dist/rpc/rpc-mode.d.ts +1 -1
  102. package/dist/rpc/rpc-types.d.ts +11 -0
  103. package/dist/shell/commands/mcp-command.js +17 -7
  104. package/dist/shortcut-model-catalog.d.ts +2 -1
  105. package/dist/shortcut-model-catalog.js +106 -15
  106. package/dist/startup/mog-cli.d.ts +5 -0
  107. package/dist/startup/mog-cli.js +19 -0
  108. package/dist/startup/output-workbook.d.ts +2 -1
  109. package/dist/startup/output-workbook.js +8 -0
  110. package/dist/startup/timeout-snapshot.d.ts +2 -1
  111. package/dist/startup/timeout-snapshot.js +15 -1
  112. package/dist/subagent-model-policy.js +4 -1
  113. package/dist/utils/api-reference.d.ts +0 -2
  114. package/dist/utils/api-reference.js +21 -5
  115. package/dist/utils/mog-headless-api-reference.js +0 -1
  116. package/native-app/main/index.js +4 -2
  117. package/native-app/package.json +1 -1
  118. package/native-app/renderer/assets/{index-Dep1w85F.js → index--fI2TmN5.js} +90 -24
  119. package/native-app/renderer/index.html +1 -1
  120. package/package.json +8 -3
  121. package/skills/mcp/SKILL.md +2 -2
  122. package/user-docs/dist/index.html +2 -2
  123. package/xll/ShortcutPowerPoint.dll +0 -0
  124. package/xll/ShortcutWord.dll +0 -0
  125. package/xll/ShortcutXL.xll +0 -0
  126. package/xll/python/Lib/site-packages/httpx-0.28.1.dist-info/RECORD +1 -1
  127. package/xll/python/Lib/site-packages/idna-3.18.dist-info/RECORD +1 -1
  128. package/xll/python/Lib/site-packages/pip-26.2.dist-info/RECORD +3 -3
  129. package/xll/python/Lib/site-packages/pywin32-311.dist-info/RECORD +2 -2
  130. package/xll/python/Scripts/httpx.exe +0 -0
  131. package/xll/python/Scripts/idna.exe +0 -0
  132. package/xll/python/Scripts/pip.exe +0 -0
  133. package/xll/python/Scripts/pip3.13.exe +0 -0
  134. package/xll/python/Scripts/pip3.exe +0 -0
  135. package/xll/python/Scripts/pywin32_postinstall.exe +0 -0
  136. package/xll/python/Scripts/pywin32_testall.exe +0 -0
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-09-02T05:35:16.912Z",
3
+ "generatedAt": "2026-09-28T15:24:40.862Z",
4
4
  "package": "shortcutxl",
5
5
  "build": {
6
6
  "builder": "github-actions",
7
7
  "repository": "lyfegame/shortcut",
8
- "sourceRef": "refs/heads/codex/excel-preexecution-approval",
9
- "sourceCommit": "2520273120cc4b4024d877790eacf6f41fefdd7c",
10
- "workflowRef": "lyfegame/shortcut/.github/workflows/release-shortcut-cli-npm-package.yml@refs/heads/codex/excel-preexecution-approval",
11
- "runId": "33595155271",
8
+ "sourceRef": "refs/tags/shortcutxl/v0.3.92",
9
+ "sourceCommit": "e570fa7e9f098635d5a8594035f1ec509d6c84f2",
10
+ "workflowRef": "lyfegame/shortcut/.github/workflows/release-shortcut-cli-npm-package.yml@refs/tags/shortcutxl/v0.3.92",
11
+ "runId": "36443042051",
12
12
  "runnerOs": "Windows",
13
13
  "runnerImage": "win25-vs2026",
14
- "runnerImageVersion": "20260824.214.3"
14
+ "runnerImageVersion": "20260922.246.2"
15
15
  },
16
16
  "binaryExtensions": [
17
17
  ".dll",
@@ -22,7 +22,7 @@
22
22
  "files": [
23
23
  {
24
24
  "path": "xll/ShortcutPowerPoint.dll",
25
- "sha256": "5c5c7630cd30e36daaf85b944baee2bf84c1cb59c2dde40b05505b8dbf04239b",
25
+ "sha256": "e74ec73ef238eff5f936ffb236610220c2c545da164a7cf58b868ae1b4fa1d45",
26
26
  "source": "ShortcutXL native PowerPoint COM add-in build",
27
27
  "version": "package",
28
28
  "builtBy": "shortcut",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  {
32
32
  "path": "xll/ShortcutWord.dll",
33
- "sha256": "2823c3604f6b7a6fdbabd3bedcdf31a66ec1d3dcd51e54284affb64969d8bcc5",
33
+ "sha256": "17a78ed362a9edd2dc413d6d090c37347eb68a27cb23b53e91f647c9f940fe37",
34
34
  "source": "ShortcutXL native Word COM add-in build",
35
35
  "version": "package",
36
36
  "builtBy": "shortcut",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  {
40
40
  "path": "xll/ShortcutXL.xll",
41
- "sha256": "b1d14ede58224be66163f924bd2259bfc1c586849743c2b97bb28de77b4072e4",
41
+ "sha256": "b3ea0f0ac97160f45fa4571488e3e038ef0a09bd7d5d67833eb1248f24d9ff50",
42
42
  "source": "ShortcutXL native XLL build",
43
43
  "version": "package",
44
44
  "builtBy": "shortcut",
@@ -550,7 +550,7 @@
550
550
  },
551
551
  {
552
552
  "path": "xll/python/Scripts/httpx.exe",
553
- "sha256": "a7f8d80085b1d17fdf993cd7246d55f05726e3eb624859a8ba3b69b76368bd4c",
553
+ "sha256": "38991b06575eecf3ed2dce55d63b5f70617a132462b6e011a05567836017458b",
554
554
  "source": "httpx console launcher installed into embedded Python",
555
555
  "version": "see packaged httpx distribution",
556
556
  "builtBy": "third-party",
@@ -558,7 +558,7 @@
558
558
  },
559
559
  {
560
560
  "path": "xll/python/Scripts/idna.exe",
561
- "sha256": "75e2f1c65f561084f603823794d6ad5877ef0a5b1ef0b1fffff096603479642a",
561
+ "sha256": "93cfec5f08ff75bd6358ddf0427d0ed53bbdcc8c139b8feac5b96671d4e22d4f",
562
562
  "source": "Python package console launcher installed into embedded Python",
563
563
  "version": "see owning Python package metadata in site-packages",
564
564
  "builtBy": "third-party",
@@ -566,7 +566,7 @@
566
566
  },
567
567
  {
568
568
  "path": "xll/python/Scripts/pip.exe",
569
- "sha256": "f68ea8e144f74e0f9748750a5fc21b73e11d63486c905730aa474e28f3bab8e7",
569
+ "sha256": "417cbb3269a7e6fdfe8bdf606f56ea86f80f0fc5d939d65c7857d0f3aa263c2c",
570
570
  "source": "pip console launcher installed into embedded Python",
571
571
  "version": "see packaged pip distribution",
572
572
  "builtBy": "third-party",
@@ -574,7 +574,7 @@
574
574
  },
575
575
  {
576
576
  "path": "xll/python/Scripts/pip3.13.exe",
577
- "sha256": "f68ea8e144f74e0f9748750a5fc21b73e11d63486c905730aa474e28f3bab8e7",
577
+ "sha256": "417cbb3269a7e6fdfe8bdf606f56ea86f80f0fc5d939d65c7857d0f3aa263c2c",
578
578
  "source": "pip console launcher installed into embedded Python",
579
579
  "version": "see packaged pip distribution",
580
580
  "builtBy": "third-party",
@@ -582,7 +582,7 @@
582
582
  },
583
583
  {
584
584
  "path": "xll/python/Scripts/pip3.exe",
585
- "sha256": "f68ea8e144f74e0f9748750a5fc21b73e11d63486c905730aa474e28f3bab8e7",
585
+ "sha256": "417cbb3269a7e6fdfe8bdf606f56ea86f80f0fc5d939d65c7857d0f3aa263c2c",
586
586
  "source": "pip console launcher installed into embedded Python",
587
587
  "version": "see packaged pip distribution",
588
588
  "builtBy": "third-party",
@@ -590,7 +590,7 @@
590
590
  },
591
591
  {
592
592
  "path": "xll/python/Scripts/pywin32_postinstall.exe",
593
- "sha256": "3d5142d3d301b5b22ec9f9ba2d29c9f8a4a73bad069389a73dafbd61e2b37696",
593
+ "sha256": "e0b6ba36d80a9cd5d712e05a5b7cbe353afa05a65e51d26b60680ef75d49cc98",
594
594
  "source": "Python package console launcher installed into embedded Python",
595
595
  "version": "see owning Python package metadata in site-packages",
596
596
  "builtBy": "third-party",
@@ -598,7 +598,7 @@
598
598
  },
599
599
  {
600
600
  "path": "xll/python/Scripts/pywin32_testall.exe",
601
- "sha256": "494be3de764340437d1fb12aaaefaf8f47c5a482f14834da3a17b080c71d6e16",
601
+ "sha256": "fdac2f9fbcf98b44f89e9846f727b93c8f6f4be6fa9db2210cc62450e1e74d52",
602
602
  "source": "Python package console launcher installed into embedded Python",
603
603
  "version": "see owning Python package metadata in site-packages",
604
604
  "builtBy": "third-party",
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.92]
4
+
5
+ - **Latest OpenAI and Anthropic models** - Select GPT-6 Sol, GPT-6 Luna, or Claude Opus 5.5 in the CLI and Windows app. New CLI sessions default to GPT-6 Sol.
6
+ - **Simpler model selector** - Replaced GPT-5.6 Sol/Luna and Opus 5 in the selector with their successors. Existing saved sessions and explicit model selections remain supported.
7
+
8
+ ## [0.3.91]
9
+
10
+ - **GPT-6 Astra** - GPT-6 Astra is now available in the model selector.
11
+ - **Faster, more reliable MCP startup** - Shortcut now starts MCP integrations faster, retries temporary connection failures, and clearly reports servers that take too long to start.
12
+
3
13
  ## [0.3.90]
4
14
 
5
15
  - **Skill Forge** - A recursive self-improvement loop for skills. Create or improve personal skills by giving Skill Forge tasks and a grading bar to train, evaluate, and refine against.
@@ -296,6 +296,8 @@ export interface Model<TApi extends Api> {
296
296
  cacheWrite: number;
297
297
  };
298
298
  contextWindow: number;
299
+ /** Optional auto-compaction threshold. Defaults to the runtime-wide threshold policy. */
300
+ compactionThresholdTokens?: number;
299
301
  maxTokens: number;
300
302
  capabilities?: ModelCapabilities;
301
303
  headers?: Record<string, string>;
@@ -12,12 +12,20 @@
12
12
  export declare function setSecret(name: string, payload: Record<string, string>): void;
13
13
  /** Retrieve a secret payload for a connection. Returns undefined if not found. */
14
14
  export declare function getSecret(name: string): Record<string, string> | undefined;
15
+ /**
16
+ * Retrieve several connection secrets without serially blocking the Node event loop.
17
+ * Windows uses one PowerShell process for the whole batch so the P/Invoke helper is
18
+ * compiled once. Other platforms perform their native lookups concurrently.
19
+ */
20
+ export declare function getSecrets(names: readonly string[], timeoutMs?: number): Promise<Map<string, Record<string, string> | undefined>>;
15
21
  /** Remove a secret for a connection. Returns true if it existed. */
16
22
  export declare function removeSecret(name: string): boolean;
17
23
  /** Store a JSON payload in the OS keychain under a custom service namespace. */
18
24
  export declare function setNamespacedSecret(service: string, name: string, payload: object): void;
19
25
  /** Retrieve a JSON payload from the OS keychain for a custom service namespace. */
20
26
  export declare function getNamespacedSecret<T extends object>(service: string, name: string): T | undefined;
27
+ /** Retrieve several secrets through a single asynchronous batch operation where possible. */
28
+ export declare function getNamespacedSecrets<T extends object>(service: string, names: readonly string[], timeoutMs?: number): Promise<Map<string, T | undefined>>;
21
29
  /** Remove a JSON payload from the OS keychain for a custom service namespace. */
22
30
  export declare function removeNamespacedSecret(service: string, name: string): boolean;
23
31
  /**
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Imports: none from internal layers. Pure shell-out utility.
10
10
  */
11
- import { execFileSync } from 'child_process';
11
+ import { execFile, execFileSync } from 'child_process';
12
12
  const CONNECTION_SERVICE = 'shortcut.connection';
13
13
  // =============================================================================
14
14
  // Public API
@@ -21,6 +21,14 @@ export function setSecret(name, payload) {
21
21
  export function getSecret(name) {
22
22
  return getNamespacedSecret(CONNECTION_SERVICE, name);
23
23
  }
24
+ /**
25
+ * Retrieve several connection secrets without serially blocking the Node event loop.
26
+ * Windows uses one PowerShell process for the whole batch so the P/Invoke helper is
27
+ * compiled once. Other platforms perform their native lookups concurrently.
28
+ */
29
+ export function getSecrets(names, timeoutMs = 10_000) {
30
+ return getNamespacedSecrets(CONNECTION_SERVICE, names, timeoutMs);
31
+ }
24
32
  /** Remove a secret for a connection. Returns true if it existed. */
25
33
  export function removeSecret(name) {
26
34
  return removeNamespacedSecret(CONNECTION_SERVICE, name);
@@ -61,6 +69,45 @@ export function getNamespacedSecret(service, name) {
61
69
  }
62
70
  return undefined;
63
71
  }
72
+ /** Retrieve several secrets through a single asynchronous batch operation where possible. */
73
+ export async function getNamespacedSecrets(service, names, timeoutMs = 10_000) {
74
+ const uniqueNames = [...new Set(names)];
75
+ const result = new Map();
76
+ if (uniqueNames.length === 0)
77
+ return result;
78
+ if (process.platform === 'win32') {
79
+ const targets = uniqueNames.map((name) => `${service}/${name}`);
80
+ const psTargets = targets.map((target) => `'${psEsc(target)}'`).join(', ');
81
+ const ps = `${WIN_CRED_PREAMBLE}
82
+ $result = @{}
83
+ foreach ($target in @(${psTargets})) {
84
+ $value = [CredManager]::Read($target)
85
+ if ($null -ne $value) { $result[$target] = $value }
86
+ }
87
+ $result | ConvertTo-Json -Compress`;
88
+ const raw = await execFileUtf8('powershell', ['-NoProfile', '-EncodedCommand', psEncode(ps)], timeoutMs);
89
+ const values = raw.trim() ? JSON.parse(raw) : {};
90
+ for (const [index, name] of uniqueNames.entries()) {
91
+ result.set(name, parseSecretJson(values[targets[index]]));
92
+ }
93
+ return result;
94
+ }
95
+ if (process.platform === 'darwin') {
96
+ await Promise.all(uniqueNames.map(async (name) => {
97
+ try {
98
+ const raw = await execFileUtf8('security', ['find-generic-password', '-a', name, '-s', service, '-w'], timeoutMs);
99
+ result.set(name, parseSecretJson(raw));
100
+ }
101
+ catch {
102
+ result.set(name, undefined);
103
+ }
104
+ }));
105
+ return result;
106
+ }
107
+ for (const name of uniqueNames)
108
+ result.set(name, undefined);
109
+ return result;
110
+ }
64
111
  /** Remove a JSON payload from the OS keychain for a custom service namespace. */
65
112
  export function removeNamespacedSecret(service, name) {
66
113
  try {
@@ -115,7 +162,11 @@ export function buildConnectionEnv(connectionNames) {
115
162
  * PowerShell script that uses P/Invoke to call CredRead/CredWrite/CredDelete
116
163
  * from advapi32.dll. Works on every Windows version. No external modules needed.
117
164
  */
165
+ // Secrets are read back as .NET strings but serialized to stdout with the
166
+ // console's OEM codepage, which varies per machine and locale. Force BOM-less
167
+ // UTF-8 so Node decodes non-ASCII values correctly on every host.
118
168
  const WIN_CRED_PREAMBLE = `
169
+ [Console]::OutputEncoding = New-Object System.Text.UTF8Encoding $false
119
170
  Add-Type -TypeDefinition @"
120
171
  using System;
121
172
  using System.Runtime.InteropServices;
@@ -161,6 +212,27 @@ public class CredManager {
161
212
  function psEncode(script) {
162
213
  return Buffer.from(script, 'utf16le').toString('base64');
163
214
  }
215
+ function execFileUtf8(command, args, timeout) {
216
+ return new Promise((resolve, reject) => {
217
+ execFile(command, args, { encoding: 'utf-8', timeout, windowsHide: true }, (error, stdout) => {
218
+ if (error) {
219
+ reject(error);
220
+ return;
221
+ }
222
+ resolve(stdout);
223
+ });
224
+ });
225
+ }
226
+ function parseSecretJson(raw) {
227
+ if (!raw)
228
+ return undefined;
229
+ try {
230
+ return JSON.parse(raw.trim());
231
+ }
232
+ catch {
233
+ return undefined;
234
+ }
235
+ }
164
236
  function winCredWrite(target, secret) {
165
237
  const ps = `${WIN_CRED_PREAMBLE}\n[CredManager]::Write('${psEsc(target)}', '${psEsc(secret)}')`;
166
238
  execFileSync('powershell', ['-NoProfile', '-EncodedCommand', psEncode(ps)], {
@@ -6,6 +6,8 @@ export interface ResolveMcpAuthStatusOptions {
6
6
  authStorage?: AuthStorage;
7
7
  mcpOAuthStore?: McpOAuthStore;
8
8
  discovery?: McpAuthDiscoveryMode;
9
+ /** Pre-fetched connection secrets by name; when absent the keychain is read directly. */
10
+ connectionSecrets?: ReadonlyMap<string, Record<string, string> | undefined>;
9
11
  }
10
12
  export declare function resolveMcpAuthStatus(serverName: string, config: McpServerConfig, options?: ResolveMcpAuthStatusOptions): Promise<McpAuthStatus>;
11
13
  export declare function getMcpAuthStatus(serverName: string, config: McpServerConfig, authStorage?: AuthStorage, mcpOAuthStore?: McpOAuthStore): Promise<McpAuthStatus>;
@@ -10,7 +10,11 @@ export async function resolveMcpAuthStatus(serverName, config, options = {}) {
10
10
  return 'unsupported';
11
11
  }
12
12
  const staticHeaders = { ...(config.headers ?? {}) };
13
- const secretHeaders = config.connection ? getSecret(config.connection) : undefined;
13
+ const secretHeaders = !config.connection
14
+ ? undefined
15
+ : options.connectionSecrets
16
+ ? options.connectionSecrets.get(config.connection)
17
+ : getSecret(config.connection);
14
18
  if (hasConfiguredHeaders(staticHeaders) || hasConfiguredHeaders(secretHeaders)) {
15
19
  return 'configured';
16
20
  }
@@ -4,17 +4,47 @@
4
4
  import type { AuthStorage } from '../auth/auth-storage.js';
5
5
  import type { McpOAuthStore } from './oauth-state-store.js';
6
6
  import { type McpConnection, type McpFailureKind, type McpRequestPolicy, type McpServerConfig } from './types.js';
7
+ /** Abort signal plus absolute deadline that bounds one server's whole startup. */
8
+ export interface McpStartupBudget {
9
+ signal: AbortSignal;
10
+ deadlineAt: number;
11
+ }
12
+ export interface McpConnectOptions {
13
+ /**
14
+ * Connection secrets already read from the keychain, keyed by connection
15
+ * name. When absent, the server reads its own secret synchronously.
16
+ */
17
+ connectionSecrets?: ReadonlyMap<string, Record<string, string> | undefined>;
18
+ /** Budget shared across the whole startup. Direct callers get one from the config's startup timeout. */
19
+ budget?: McpStartupBudget;
20
+ }
7
21
  export declare class McpConnectionError extends Error {
8
22
  readonly failureKind: McpFailureKind;
9
23
  constructor(failureKind: McpFailureKind, message: string);
10
24
  }
11
25
  export declare function resolveStartupTimeoutMs(config: McpServerConfig): number;
12
26
  export declare function buildRequestPolicy(config: McpServerConfig): McpRequestPolicy;
27
+ /**
28
+ * Run one server's startup under a single deadline. The budget's signal is
29
+ * threaded into every SDK request so a stalled initialize or tools/list is
30
+ * cancelled, and the race guarantees the deadline even for steps that cannot
31
+ * observe the signal (process spawn, keychain reads).
32
+ */
33
+ export declare function withStartupBudget<T>(name: string, timeoutMs: number, operation: (budget: McpStartupBudget) => Promise<T>): Promise<T>;
34
+ /** SDK request options for initialize and tools/list under a startup budget. */
35
+ export declare function requestOptions(budget: McpStartupBudget): {
36
+ signal: AbortSignal;
37
+ timeout: number;
38
+ };
39
+ /** Whether a failed hosted startup is safe to repeat with a fresh MCP session. */
40
+ export declare function isTransientHostedStartupError(error: unknown): boolean;
13
41
  export declare function createHostedMcpLoggingFetch(serverName: string, fetchImpl?: typeof fetch): typeof fetch;
14
42
  /**
15
- * Connect a server, list tools, and return a live MCP connection.
43
+ * Connect a server, list tools, and return a live MCP connection. The whole
44
+ * sequence runs under `options.budget`, or under a fresh budget from the
45
+ * config's startup timeout when the caller did not supply one.
16
46
  */
17
- export declare function connectServer(name: string, config: McpServerConfig, defaultCwd: string, authStorage?: AuthStorage, mcpOAuthStore?: McpOAuthStore): Promise<McpConnection>;
47
+ export declare function connectServer(name: string, config: McpServerConfig, defaultCwd: string, authStorage?: AuthStorage, mcpOAuthStore?: McpOAuthStore, options?: McpConnectOptions): Promise<McpConnection>;
18
48
  /**
19
49
  * Call a tool on a connected server. Returns the result text or throws.
20
50
  */