@bastani/atomic 0.9.58 → 0.9.59

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/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.9.59] - 2026-11-01
6
+
7
+ GitHub Copilot tokens that work from `/login`, and intercom that recovers on Windows.
8
+
9
+ - **Copilot tokens saved through `/login`:** a GitHub Copilot personal access token saved with `/login` → **Use an API key** now works for business and enterprise accounts, so you no longer need `COPILOT_GITHUB_TOKEN` to avoid `421 Misdirected Request` ([#4151](https://github.com/bastani-inc/atomic/pull/4151))
10
+ - **Intercom recovers on Windows:** when the intercom broker dies, sessions start a new one right away instead of waiting out the start-up timeout and failing with `Broker failed to start within timeout` ([#4152](https://github.com/bastani-inc/atomic/pull/4152))
11
+
12
+ ### Fixed
13
+
14
+ - Fixed GitHub Copilot personal access tokens saved through `/login` → **Use an API key** being sent to the individual Copilot host, where business and enterprise accounts fail with `421 Misdirected Request`. Saved tokens now get the same endpoint routing as `COPILOT_GITHUB_TOKEN`, so the environment variable is no longer required. A `models.json` `baseUrl` still takes precedence, and OAuth logins are unchanged. ([#4151](https://github.com/bastani-inc/atomic/pull/4151))
15
+
16
+ ## [0.9.59-alpha.1] - 2026-11-01
17
+
18
+ GitHub Copilot tokens that work from `/login`, and intercom that recovers on Windows.
19
+
20
+ - **Copilot tokens saved through `/login`:** a GitHub Copilot personal access token saved with `/login` → **Use an API key** now works for business and enterprise accounts, so you no longer need `COPILOT_GITHUB_TOKEN` to avoid `421 Misdirected Request` ([#4151](https://github.com/bastani-inc/atomic/pull/4151))
21
+ - **Intercom recovers on Windows:** when the intercom broker dies, sessions start a new one right away instead of waiting out the start-up timeout and failing with `Broker failed to start within timeout` ([#4152](https://github.com/bastani-inc/atomic/pull/4152))
22
+
23
+ ### Fixed
24
+
25
+ - Fixed GitHub Copilot personal access tokens saved through `/login` → **Use an API key** being sent to the individual Copilot host, where business and enterprise accounts fail with `421 Misdirected Request`. Saved tokens now get the same endpoint routing as `COPILOT_GITHUB_TOKEN`, so the environment variable is no longer required. A `models.json` `baseUrl` still takes precedence, and OAuth logins are unchanged. ([#4151](https://github.com/bastani-inc/atomic/pull/4151))
26
+
5
27
  ## [0.9.58] - 2026-11-01
6
28
 
7
29
  Task heartbeats, stage chats that work on local workers, and a local worker pool that holds up under load.
@@ -4,6 +4,18 @@ All notable changes to the `pi-intercom` extension will be documented in this fi
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.9.59] - 2026-11-01
8
+
9
+ ### Fixed
10
+
11
+ - On Windows, sessions reconnect to a new intercom broker right after the running one dies, instead of waiting out the whole broker start-up timeout and failing with `Broker failed to start within timeout`. The dead broker's hidden `cmd.exe` launcher holds `broker.log` for a moment after the broker exits, and the respawn mistook that for another broker still starting; it now waits up to a second for the log to be released first. ([#4152](https://github.com/bastani-inc/atomic/pull/4152))
12
+
13
+ ## [0.9.59-alpha.1] - 2026-11-01
14
+
15
+ ### Fixed
16
+
17
+ - On Windows, sessions reconnect to a new intercom broker right after the running one dies, instead of waiting out the whole broker start-up timeout and failing with `Broker failed to start within timeout`. The dead broker's hidden `cmd.exe` launcher holds `broker.log` for a moment after the broker exits, and the respawn mistook that for another broker still starting; it now waits up to a second for the log to be released first. ([#4152](https://github.com/bastani-inc/atomic/pull/4152))
18
+
7
19
  ## [0.9.56] - 2026-10-30
8
20
 
9
21
  ### Fixed
@@ -291,9 +291,15 @@ export function getBrokerSpawnOptions(
291
291
  };
292
292
  }
293
293
 
294
+ /**
295
+ * How long a spawn waits for the Windows launcher of a broker that just exited to let go of the log. Its `cmd.exe`
296
+ * outlives the broker by a moment, and a broker that is really still starting keeps the log for as long as it runs.
297
+ */
298
+ export const BROKER_LOG_RELEASE_WAIT_MS = 1_000;
299
+
294
300
  /**
295
301
  * Preserve a bounded previous log across truncation. Returns false when a
296
- * Windows broker that is still starting holds the log through its launcher's stderr redirect.
302
+ * Windows launcher holds the log through its stderr redirect.
297
303
  */
298
304
  function resetBrokerLog(logPath: string = BROKER_LOG): boolean {
299
305
  ensurePrivateDirectory(dirname(logPath));
@@ -315,6 +321,20 @@ function resetBrokerLog(logPath: string = BROKER_LOG): boolean {
315
321
  }
316
322
  }
317
323
 
324
+ /**
325
+ * Reset the log, waiting up to {@link BROKER_LOG_RELEASE_WAIT_MS} for the launcher of a broker that just exited, as
326
+ * one does when a running broker dies and its clients reconnect at once. Returns false only when the log stays held,
327
+ * which means a broker is still starting.
328
+ */
329
+ async function resetBrokerLogOnceReleased(): Promise<boolean> {
330
+ const deadline = Date.now() + BROKER_LOG_RELEASE_WAIT_MS;
331
+ while (!resetBrokerLog()) {
332
+ if (Date.now() >= deadline) return false;
333
+ await sleep(50);
334
+ }
335
+ return true;
336
+ }
337
+
318
338
  /** Read at most {@link BROKER_LOG_TAIL_BYTES} trailing bytes of the broker log. */
319
339
  export function readBrokerLogTail(logPath: string = BROKER_LOG, maxBytes: number = BROKER_LOG_TAIL_BYTES): string {
320
340
  let fd: number | undefined;
@@ -392,7 +412,7 @@ export async function spawnBrokerIfNeeded(
392
412
  writeWindowsHiddenLauncher(launch.launcherCommandLine, launch.launcherPath);
393
413
  }
394
414
  // Reset before spawning either way: the Windows launcher appends to this same path.
395
- if (!resetBrokerLog()) {
415
+ if (!(await resetBrokerLogOnceReleased())) {
396
416
  await waitForBroker(readyTimeoutMs);
397
417
  return;
398
418
  }
@@ -2487,6 +2487,15 @@ function resetBrokerLog(logPath = BROKER_LOG) {
2487
2487
  throw error;
2488
2488
  }
2489
2489
  }
2490
+ async function resetBrokerLogOnceReleased() {
2491
+ const deadline = Date.now() + BROKER_LOG_RELEASE_WAIT_MS;
2492
+ while (!resetBrokerLog()) {
2493
+ if (Date.now() >= deadline)
2494
+ return false;
2495
+ await sleep(50);
2496
+ }
2497
+ return true;
2498
+ }
2490
2499
  function readBrokerLogTail(logPath = BROKER_LOG, maxBytes = BROKER_LOG_TAIL_BYTES) {
2491
2500
  let fd;
2492
2501
  try {
@@ -2545,7 +2554,7 @@ async function spawnBrokerIfNeeded(brokerCommand, brokerArgs, readyTimeoutMs = B
2545
2554
  if (launch.kind === "windows-launcher") {
2546
2555
  writeWindowsHiddenLauncher(launch.launcherCommandLine, launch.launcherPath);
2547
2556
  }
2548
- if (!resetBrokerLog()) {
2557
+ if (!await resetBrokerLogOnceReleased()) {
2549
2558
  await waitForBroker(readyTimeoutMs);
2550
2559
  return;
2551
2560
  }
@@ -2718,7 +2727,7 @@ ${describeBrokerLog()}`);
2718
2727
  ` + "The broker did not answer on its socket in time; it may still be starting, which a busy machine or an empty jiti " + "cache slows. Try again, or raise `brokerStartupTimeoutMs` in the Intercom config.json (default " + `${BROKER_READY_TIMEOUT_MS} ms).
2719
2728
  ${describeBrokerLog()}`);
2720
2729
  }
2721
- var INTERCOM_DIR, EXTENSION_DIR, BROKER_SOCKET2, BROKER_PID, BROKER_SPAWN_LOCK, BROKER_LOG, BROKER_START_ANNOUNCEMENT, BROKER_LOG_TAIL_BYTES, BROKER_POLL_INITIAL_INTERVAL_MS = 10, BROKER_POLL_MAX_INTERVAL_MS = 100, BROKER_SPAWN_LOCK_MAX_AGE_MS = 60000, INTERNAL_INTERCOM_BROKER_ARG = "--atomic-internal-intercom-broker";
2730
+ var INTERCOM_DIR, EXTENSION_DIR, BROKER_SOCKET2, BROKER_PID, BROKER_SPAWN_LOCK, BROKER_LOG, BROKER_START_ANNOUNCEMENT, BROKER_LOG_TAIL_BYTES, BROKER_POLL_INITIAL_INTERVAL_MS = 10, BROKER_POLL_MAX_INTERVAL_MS = 100, BROKER_SPAWN_LOCK_MAX_AGE_MS = 60000, INTERNAL_INTERCOM_BROKER_ARG = "--atomic-internal-intercom-broker", BROKER_LOG_RELEASE_WAIT_MS = 1000;
2722
2731
  var init_spawn = __esm(() => {
2723
2732
  init_socket_liveness();
2724
2733
  init_start_announcement();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.9.58",
3
+ "version": "0.9.59",
4
4
  "private": true,
5
5
  "description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.9.58",
3
+ "version": "0.9.59",
4
4
  "private": true,
5
5
  "description": "Atomic's pi-compatible MCP integration for server connections, OAuth, tools, resources, and terminal management.",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.9.58",
3
+ "version": "0.9.59",
4
4
  "private": true,
5
5
  "description": "Atomic extension for delegating tasks to subagents with parallel execution. Fork of: https://github.com/nicobailon/pi-subagents",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.9.58",
3
+ "version": "0.9.59",
4
4
  "private": true,
5
5
  "description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/workflows",
3
- "version": "0.9.58",
3
+ "version": "0.9.59",
4
4
  "private": true,
5
5
  "description": "Atomic extension for multi-stage workflow authoring and execution.",
6
6
  "contributors": [
@@ -67204,6 +67204,15 @@ function resetBrokerLog(logPath = BROKER_LOG) {
67204
67204
  throw error;
67205
67205
  }
67206
67206
  }
67207
+ async function resetBrokerLogOnceReleased() {
67208
+ const deadline = Date.now() + BROKER_LOG_RELEASE_WAIT_MS;
67209
+ while (!resetBrokerLog()) {
67210
+ if (Date.now() >= deadline)
67211
+ return false;
67212
+ await sleep(50);
67213
+ }
67214
+ return true;
67215
+ }
67207
67216
  function readBrokerLogTail(logPath = BROKER_LOG, maxBytes = BROKER_LOG_TAIL_BYTES) {
67208
67217
  let fd;
67209
67218
  try {
@@ -67262,7 +67271,7 @@ async function spawnBrokerIfNeeded(brokerCommand, brokerArgs, readyTimeoutMs = B
67262
67271
  if (launch.kind === "windows-launcher") {
67263
67272
  writeWindowsHiddenLauncher(launch.launcherCommandLine, launch.launcherPath);
67264
67273
  }
67265
- if (!resetBrokerLog()) {
67274
+ if (!await resetBrokerLogOnceReleased()) {
67266
67275
  await waitForBroker(readyTimeoutMs);
67267
67276
  return;
67268
67277
  }
@@ -67435,7 +67444,7 @@ ${describeBrokerLog()}`);
67435
67444
  ` + "The broker did not answer on its socket in time; it may still be starting, which a busy machine or an empty jiti " + "cache slows. Try again, or raise `brokerStartupTimeoutMs` in the Intercom config.json (default " + `${BROKER_READY_TIMEOUT_MS} ms).
67436
67445
  ${describeBrokerLog()}`);
67437
67446
  }
67438
- var INTERCOM_DIR, EXTENSION_DIR, BROKER_SOCKET2, BROKER_PID, BROKER_SPAWN_LOCK, BROKER_LOG, BROKER_START_ANNOUNCEMENT, BROKER_LOG_TAIL_BYTES, BROKER_POLL_INITIAL_INTERVAL_MS = 10, BROKER_POLL_MAX_INTERVAL_MS = 100, BROKER_SPAWN_LOCK_MAX_AGE_MS = 60000, INTERNAL_INTERCOM_BROKER_ARG = "--atomic-internal-intercom-broker";
67447
+ var INTERCOM_DIR, EXTENSION_DIR, BROKER_SOCKET2, BROKER_PID, BROKER_SPAWN_LOCK, BROKER_LOG, BROKER_START_ANNOUNCEMENT, BROKER_LOG_TAIL_BYTES, BROKER_POLL_INITIAL_INTERVAL_MS = 10, BROKER_POLL_MAX_INTERVAL_MS = 100, BROKER_SPAWN_LOCK_MAX_AGE_MS = 60000, INTERNAL_INTERCOM_BROKER_ARG = "--atomic-internal-intercom-broker", BROKER_LOG_RELEASE_WAIT_MS = 1000;
67439
67448
  var init_spawn = __esm(() => {
67440
67449
  init_socket_liveness();
67441
67450
  init_start_announcement();
@@ -64112,6 +64112,15 @@ function resetBrokerLog(logPath = BROKER_LOG) {
64112
64112
  throw error;
64113
64113
  }
64114
64114
  }
64115
+ async function resetBrokerLogOnceReleased() {
64116
+ const deadline = Date.now() + BROKER_LOG_RELEASE_WAIT_MS;
64117
+ while (!resetBrokerLog()) {
64118
+ if (Date.now() >= deadline)
64119
+ return false;
64120
+ await sleep(50);
64121
+ }
64122
+ return true;
64123
+ }
64115
64124
  function readBrokerLogTail(logPath = BROKER_LOG, maxBytes = BROKER_LOG_TAIL_BYTES) {
64116
64125
  let fd;
64117
64126
  try {
@@ -64170,7 +64179,7 @@ async function spawnBrokerIfNeeded(brokerCommand, brokerArgs, readyTimeoutMs = B
64170
64179
  if (launch.kind === "windows-launcher") {
64171
64180
  writeWindowsHiddenLauncher(launch.launcherCommandLine, launch.launcherPath);
64172
64181
  }
64173
- if (!resetBrokerLog()) {
64182
+ if (!await resetBrokerLogOnceReleased()) {
64174
64183
  await waitForBroker(readyTimeoutMs);
64175
64184
  return;
64176
64185
  }
@@ -64343,7 +64352,7 @@ ${describeBrokerLog()}`);
64343
64352
  ` + "The broker did not answer on its socket in time; it may still be starting, which a busy machine or an empty jiti " + "cache slows. Try again, or raise `brokerStartupTimeoutMs` in the Intercom config.json (default " + `${BROKER_READY_TIMEOUT_MS} ms).
64344
64353
  ${describeBrokerLog()}`);
64345
64354
  }
64346
- var INTERCOM_DIR, EXTENSION_DIR, BROKER_SOCKET2, BROKER_PID, BROKER_SPAWN_LOCK, BROKER_LOG, BROKER_START_ANNOUNCEMENT, BROKER_LOG_TAIL_BYTES, BROKER_POLL_INITIAL_INTERVAL_MS = 10, BROKER_POLL_MAX_INTERVAL_MS = 100, BROKER_SPAWN_LOCK_MAX_AGE_MS = 60000, INTERNAL_INTERCOM_BROKER_ARG = "--atomic-internal-intercom-broker";
64355
+ var INTERCOM_DIR, EXTENSION_DIR, BROKER_SOCKET2, BROKER_PID, BROKER_SPAWN_LOCK, BROKER_LOG, BROKER_START_ANNOUNCEMENT, BROKER_LOG_TAIL_BYTES, BROKER_POLL_INITIAL_INTERVAL_MS = 10, BROKER_POLL_MAX_INTERVAL_MS = 100, BROKER_SPAWN_LOCK_MAX_AGE_MS = 60000, INTERNAL_INTERCOM_BROKER_ARG = "--atomic-internal-intercom-broker", BROKER_LOG_RELEASE_WAIT_MS = 1000;
64347
64356
  var init_spawn = __esm(() => {
64348
64357
  init_socket_liveness();
64349
64358
  init_start_announcement();
@@ -64235,6 +64235,15 @@ function resetBrokerLog(logPath = BROKER_LOG) {
64235
64235
  throw error;
64236
64236
  }
64237
64237
  }
64238
+ async function resetBrokerLogOnceReleased() {
64239
+ const deadline = Date.now() + BROKER_LOG_RELEASE_WAIT_MS;
64240
+ while (!resetBrokerLog()) {
64241
+ if (Date.now() >= deadline)
64242
+ return false;
64243
+ await sleep(50);
64244
+ }
64245
+ return true;
64246
+ }
64238
64247
  function readBrokerLogTail(logPath = BROKER_LOG, maxBytes = BROKER_LOG_TAIL_BYTES) {
64239
64248
  let fd;
64240
64249
  try {
@@ -64293,7 +64302,7 @@ async function spawnBrokerIfNeeded(brokerCommand, brokerArgs, readyTimeoutMs = B
64293
64302
  if (launch.kind === "windows-launcher") {
64294
64303
  writeWindowsHiddenLauncher(launch.launcherCommandLine, launch.launcherPath);
64295
64304
  }
64296
- if (!resetBrokerLog()) {
64305
+ if (!await resetBrokerLogOnceReleased()) {
64297
64306
  await waitForBroker(readyTimeoutMs);
64298
64307
  return;
64299
64308
  }
@@ -64466,7 +64475,7 @@ ${describeBrokerLog()}`);
64466
64475
  ` + "The broker did not answer on its socket in time; it may still be starting, which a busy machine or an empty jiti " + "cache slows. Try again, or raise `brokerStartupTimeoutMs` in the Intercom config.json (default " + `${BROKER_READY_TIMEOUT_MS} ms).
64467
64476
  ${describeBrokerLog()}`);
64468
64477
  }
64469
- var INTERCOM_DIR, EXTENSION_DIR, BROKER_SOCKET2, BROKER_PID, BROKER_SPAWN_LOCK, BROKER_LOG, BROKER_START_ANNOUNCEMENT, BROKER_LOG_TAIL_BYTES, BROKER_POLL_INITIAL_INTERVAL_MS = 10, BROKER_POLL_MAX_INTERVAL_MS = 100, BROKER_SPAWN_LOCK_MAX_AGE_MS = 60000, INTERNAL_INTERCOM_BROKER_ARG = "--atomic-internal-intercom-broker";
64478
+ var INTERCOM_DIR, EXTENSION_DIR, BROKER_SOCKET2, BROKER_PID, BROKER_SPAWN_LOCK, BROKER_LOG, BROKER_START_ANNOUNCEMENT, BROKER_LOG_TAIL_BYTES, BROKER_POLL_INITIAL_INTERVAL_MS = 10, BROKER_POLL_MAX_INTERVAL_MS = 100, BROKER_SPAWN_LOCK_MAX_AGE_MS = 60000, INTERNAL_INTERCOM_BROKER_ARG = "--atomic-internal-intercom-broker", BROKER_LOG_RELEASE_WAIT_MS = 1000;
64470
64479
  var init_spawn = __esm(() => {
64471
64480
  init_socket_liveness();
64472
64481
  init_start_announcement();
@@ -64112,6 +64112,15 @@ function resetBrokerLog(logPath = BROKER_LOG) {
64112
64112
  throw error;
64113
64113
  }
64114
64114
  }
64115
+ async function resetBrokerLogOnceReleased() {
64116
+ const deadline = Date.now() + BROKER_LOG_RELEASE_WAIT_MS;
64117
+ while (!resetBrokerLog()) {
64118
+ if (Date.now() >= deadline)
64119
+ return false;
64120
+ await sleep(50);
64121
+ }
64122
+ return true;
64123
+ }
64115
64124
  function readBrokerLogTail(logPath = BROKER_LOG, maxBytes = BROKER_LOG_TAIL_BYTES) {
64116
64125
  let fd;
64117
64126
  try {
@@ -64170,7 +64179,7 @@ async function spawnBrokerIfNeeded(brokerCommand, brokerArgs, readyTimeoutMs = B
64170
64179
  if (launch.kind === "windows-launcher") {
64171
64180
  writeWindowsHiddenLauncher(launch.launcherCommandLine, launch.launcherPath);
64172
64181
  }
64173
- if (!resetBrokerLog()) {
64182
+ if (!await resetBrokerLogOnceReleased()) {
64174
64183
  await waitForBroker(readyTimeoutMs);
64175
64184
  return;
64176
64185
  }
@@ -64343,7 +64352,7 @@ ${describeBrokerLog()}`);
64343
64352
  ` + "The broker did not answer on its socket in time; it may still be starting, which a busy machine or an empty jiti " + "cache slows. Try again, or raise `brokerStartupTimeoutMs` in the Intercom config.json (default " + `${BROKER_READY_TIMEOUT_MS} ms).
64344
64353
  ${describeBrokerLog()}`);
64345
64354
  }
64346
- var INTERCOM_DIR, EXTENSION_DIR, BROKER_SOCKET2, BROKER_PID, BROKER_SPAWN_LOCK, BROKER_LOG, BROKER_START_ANNOUNCEMENT, BROKER_LOG_TAIL_BYTES, BROKER_POLL_INITIAL_INTERVAL_MS = 10, BROKER_POLL_MAX_INTERVAL_MS = 100, BROKER_SPAWN_LOCK_MAX_AGE_MS = 60000, INTERNAL_INTERCOM_BROKER_ARG = "--atomic-internal-intercom-broker";
64355
+ var INTERCOM_DIR, EXTENSION_DIR, BROKER_SOCKET2, BROKER_PID, BROKER_SPAWN_LOCK, BROKER_LOG, BROKER_START_ANNOUNCEMENT, BROKER_LOG_TAIL_BYTES, BROKER_POLL_INITIAL_INTERVAL_MS = 10, BROKER_POLL_MAX_INTERVAL_MS = 100, BROKER_SPAWN_LOCK_MAX_AGE_MS = 60000, INTERNAL_INTERCOM_BROKER_ARG = "--atomic-internal-intercom-broker", BROKER_LOG_RELEASE_WAIT_MS = 1000;
64347
64356
  var init_spawn = __esm(() => {
64348
64357
  init_socket_liveness();
64349
64358
  init_start_announcement();
@@ -1,6 +1,6 @@
1
- import type { Provider } from "@bastani/pi-ai";
1
+ import type { Credential, Provider } from "@bastani/pi-ai";
2
2
  import { type CopilotRoutingEnv } from "@bastani/pi-ai/providers/github-copilot-env";
3
3
  import type { ModelConfig } from "./model-config.ts";
4
4
  /** Rebuild the builtin layer, including configured Radius gateways. */
5
- export declare function configureBuiltinProviders(target: Map<string, Provider>, defaults: ReadonlyMap<string, Provider>, config: ModelConfig, env?: CopilotRoutingEnv): void;
5
+ export declare function configureBuiltinProviders(target: Map<string, Provider>, defaults: ReadonlyMap<string, Provider>, config: ModelConfig, env?: CopilotRoutingEnv, getStoredCredential?: (providerId: string) => Credential | undefined): void;
6
6
  //# sourceMappingURL=model-runtime-providers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"model-runtime-providers.d.ts","sourceRoot":"","sources":["../../src/core/model-runtime-providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,KAAK,iBAAiB,EAAyB,MAAM,6CAA6C,CAAC;AAC5G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,uEAAuE;AACvE,wBAAgB,yBAAyB,CACxC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC7B,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,EACvC,MAAM,EAAE,WAAW,EACnB,GAAG,GAAE,iBAA+B,GAClC,IAAI,CAmBN"}
1
+ {"version":3,"file":"model-runtime-providers.d.ts","sourceRoot":"","sources":["../../src/core/model-runtime-providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,KAAK,iBAAiB,EAAyB,MAAM,6CAA6C,CAAC;AAC5G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,uEAAuE;AACvE,wBAAgB,yBAAyB,CACxC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC7B,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,EACvC,MAAM,EAAE,WAAW,EACnB,GAAG,GAAE,iBAA+B,EACpC,mBAAmB,GAAE,CAAC,UAAU,EAAE,MAAM,KAAK,UAAU,GAAG,SAA2B,GACnF,IAAI,CAuBN"}
@@ -1,12 +1,16 @@
1
1
  import * as builtinProviderCatalog from "@bastani/pi-ai/providers/all";
2
2
  import { withCopilotEnvBaseUrl } from "@bastani/pi-ai/providers/github-copilot-env";
3
3
  /** Rebuild the builtin layer, including configured Radius gateways. */
4
- export function configureBuiltinProviders(target, defaults, config, env = process.env) {
4
+ export function configureBuiltinProviders(target, defaults, config, env = process.env, getStoredCredential = () => undefined) {
5
5
  target.clear();
6
- // Copilot env-token auth needs a routed host; models.json overrides still win
7
- // because they are composed on top of this builtin layer.
6
+ // Raw Copilot tokens, from the environment or saved through /login, need a routed
7
+ // host; models.json overrides still win because they compose on top of this layer.
8
8
  for (const [providerId, provider] of defaults) {
9
- target.set(providerId, withCopilotEnvBaseUrl(provider, env));
9
+ const getStoredApiKey = () => {
10
+ const credential = getStoredCredential(providerId);
11
+ return credential?.type === "api_key" ? credential.key : undefined;
12
+ };
13
+ target.set(providerId, withCopilotEnvBaseUrl(provider, env, getStoredApiKey));
10
14
  }
11
15
  for (const providerId of config.getProviderIds()) {
12
16
  const providerConfig = config.getProvider(providerId);
@@ -1 +1 @@
1
- {"version":3,"file":"model-runtime-providers.js","sourceRoot":"","sources":["../../src/core/model-runtime-providers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,sBAAsB,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAA0B,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAG5G,uEAAuE;AACvE,MAAM,UAAU,yBAAyB,CACxC,MAA6B,EAC7B,QAAuC,EACvC,MAAmB,EACnB,GAAG,GAAsB,OAAO,CAAC,GAAG;IAEpC,MAAM,CAAC,KAAK,EAAE,CAAC;IACf,8EAA8E;IAC9E,0DAA0D;IAC1D,KAAK,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,QAAQ,EAAE,CAAC;QAC/C,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,qBAAqB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;IAC9D,CAAC;IACD,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;QAClD,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACtD,IAAI,cAAc,EAAE,KAAK,KAAK,QAAQ,IAAI,CAAC,cAAc,CAAC,OAAO;YAAE,SAAS;QAC5E,MAAM,CAAC,GAAG,CACT,UAAU,EACV,sBAAsB,CAAC,cAAc,CAAC;YACrC,EAAE,EAAE,UAAU;YACd,IAAI,EAAE,cAAc,CAAC,IAAI,IAAI,UAAU;YACvC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;SACxD,CAAC,CACF,CAAC;IACH,CAAC;AACF,CAAC","sourcesContent":["import type { Provider } from \"@bastani/pi-ai\";\nimport * as builtinProviderCatalog from \"@bastani/pi-ai/providers/all\";\nimport { type CopilotRoutingEnv, withCopilotEnvBaseUrl } from \"@bastani/pi-ai/providers/github-copilot-env\";\nimport type { ModelConfig } from \"./model-config.ts\";\n\n/** Rebuild the builtin layer, including configured Radius gateways. */\nexport function configureBuiltinProviders(\n\ttarget: Map<string, Provider>,\n\tdefaults: ReadonlyMap<string, Provider>,\n\tconfig: ModelConfig,\n\tenv: CopilotRoutingEnv = process.env,\n): void {\n\ttarget.clear();\n\t// Copilot env-token auth needs a routed host; models.json overrides still win\n\t// because they are composed on top of this builtin layer.\n\tfor (const [providerId, provider] of defaults) {\n\t\ttarget.set(providerId, withCopilotEnvBaseUrl(provider, env));\n\t}\n\tfor (const providerId of config.getProviderIds()) {\n\t\tconst providerConfig = config.getProvider(providerId);\n\t\tif (providerConfig?.oauth !== \"radius\" || !providerConfig.baseUrl) continue;\n\t\ttarget.set(\n\t\t\tproviderId,\n\t\t\tbuiltinProviderCatalog.radiusProvider({\n\t\t\t\tid: providerId,\n\t\t\t\tname: providerConfig.name ?? providerId,\n\t\t\t\tgateway: providerConfig.baseUrl.replace(/\\/v1\\/?$/u, \"\"),\n\t\t\t}),\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"model-runtime-providers.js","sourceRoot":"","sources":["../../src/core/model-runtime-providers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,sBAAsB,MAAM,8BAA8B,CAAC;A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alog from \"@bastani/pi-ai/providers/all\";\nimport { type CopilotRoutingEnv, withCopilotEnvBaseUrl } from \"@bastani/pi-ai/providers/github-copilot-env\";\nimport type { ModelConfig } from \"./model-config.ts\";\n\n/** Rebuild the builtin layer, including configured Radius gateways. */\nexport function configureBuiltinProviders(\n\ttarget: Map<string, Provider>,\n\tdefaults: ReadonlyMap<string, Provider>,\n\tconfig: ModelConfig,\n\tenv: CopilotRoutingEnv = process.env,\n\tgetStoredCredential: (providerId: string) => Credential | undefined = () => undefined,\n): void {\n\ttarget.clear();\n\t// Raw Copilot tokens, from the environment or saved through /login, need a routed\n\t// host; models.json overrides still win because they compose on top of this layer.\n\tfor (const [providerId, provider] of defaults) {\n\t\tconst getStoredApiKey = () => {\n\t\t\tconst credential = getStoredCredential(providerId);\n\t\t\treturn credential?.type === \"api_key\" ? credential.key : undefined;\n\t\t};\n\t\ttarget.set(providerId, withCopilotEnvBaseUrl(provider, env, getStoredApiKey));\n\t}\n\tfor (const providerId of config.getProviderIds()) {\n\t\tconst providerConfig = config.getProvider(providerId);\n\t\tif (providerConfig?.oauth !== \"radius\" || !providerConfig.baseUrl) continue;\n\t\ttarget.set(\n\t\t\tproviderId,\n\t\t\tbuiltinProviderCatalog.radiusProvider({\n\t\t\t\tid: providerId,\n\t\t\t\tname: providerConfig.name ?? providerId,\n\t\t\t\tgateway: providerConfig.baseUrl.replace(/\\/v1\\/?$/u, \"\"),\n\t\t\t}),\n\t\t);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"model-runtime.d.ts","sourceRoot":"","sources":["../../src/core/model-runtime.ts"],"names":[],"mappings":"AAIA,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,GAAG,EACR,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,2BAA2B,EAChC,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAA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/C;IAED,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAG,IAAI,CA2BtE;IAED,OAAO,CAAC,2BAA2B;IAoBnC,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAO3C;CACD"}
@@ -136,7 +136,7 @@ export class ModelRuntime {
136
136
  return runtime;
137
137
  }
138
138
  configureRadiusProviders() {
139
- configureBuiltinProviders(this.builtins, this.defaultBuiltins, this.config);
139
+ configureBuiltinProviders(this.builtins, this.defaultBuiltins, this.config, process.env, (providerId) => this.credentials.peek(providerId));
140
140
  }
141
141
  providerIds() {
142
142
  return new Set([
@@ -1 +1 @@
1
- {"version":3,"file":"model-runtime.js","sourceRoot":"","sources":["../../src/core/model-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAkBN,YAAY,EAKZ,WAAW,EAeX,iBAAiB,EACjB,mBAAmB,GAGnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,sBAAsB,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAA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AC,UAAU,CAAC,EAAE,CAAC;YACxD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAC3D,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CACnC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,UAAU,IAAI,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAClF,CAAC;QACH,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,mBAAmB,EAAE,SAAS,EAAE,CAAC;IAC5E,CAAC;IAED,kBAAkB,CAAC,UAAkB;QACpC,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACjD,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QACnC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACpC,CAAC;CACD","sourcesContent":["import { createHash } from \"node:crypto\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { isDeepStrictEqual } from \"node:util\";\nimport {\n\ttype AnyModel,\n\ttype Api,\n\ttype AssistantImages,\n\ttype AssistantMessage,\n\ttype AssistantMessageEventStream,\n\ttype AuthCheck,\n\ttype AuthInteraction,\n\ttype AuthOperationOptions,\n\ttype AuthResult,\n\ttype AuthType,\n\ttype ClassifierApi,\n\ttype ClassifierContext,\n\ttype ClassifierModel,\n\ttype ClassifierResult,\n\ttype Context,\n\ttype Credential,\n\ttype CredentialInfo,\n\tcreateModels,\n\ttype DeferredHandle,\n\ttype ImageApi,\n\ttype ImageModel,\n\ttype ImagesContext,\n\tisModelType,\n\ttype LoginOptions,\n\ttype Model,\n\ttype Models,\n\ttype ModelsApiStreamOptions,\n\ttype ModelsClassifierOptions,\n\ttype ModelsDeferredCancelOptions,\n\ttype ModelsDeferredFetchOptions,\n\ttype ModelsImagesOptions,\n\ttype ModelsRefreshOptions,\n\ttype ModelsRefreshResult,\n\ttype ModelsStore,\n\ttype ModelType,\n\ttype ModelTypeMap,\n\ttype MutableModels,\n\tnormalizeProvider,\n\tnormalizeProviderId,\n\ttype Provider,\n\ttype ProviderHeaders,\n} from \"@bastani/pi-ai\";\nimport * as builtinProviderCatalog from \"@bastani/pi-ai/providers/all\";\nimport { personalizeOpenRouterCatalog } from \"@bastani/pi-ai/providers/openrouter\";\nimport { getAgentDir } from \"../config.js\";\nimport { operationSignal, raceWithAbortSignal } from \"../utils/abort.js\";\nimport { normalizePath } from \"../utils/paths.ts\";\nimport { AuthStorage as DefaultAuthStorage } from \"./auth-storage.ts\";\nimport { normalizeModelProvider } from \"./azure-provider-compat.js\";\nimport { containsAuthConfig } from \"./credential-screening.ts\";\nimport {\n\tcopilotAdvertisedFastModelIds,\n\tcopilotAdvertisesModelId,\n\tFAST_MODEL_ID_SUFFIX,\n\ttype FastModelVariantDiagnostic,\n\tisGitHubCopilotModel,\n\twithFastModelVariants,\n} from \"./fast-model-variants.ts\";\nimport { ModelConfig } from \"./model-config.ts\";\nimport { POST_LOGOUT_AUTH_CHECK_TIMEOUT_MS } from \"./model-refresh-timeout.ts\";\nimport {\n\taddRuntimeApiKeyProvider,\n\taddStoredCredentialProvider,\n\tcreateEmptyModelRuntimeSnapshot,\n\tcreateModelRuntimeSnapshot,\n\tgetSnapshotProviderAuthStatus,\n\ttype ModelRuntimeSnapshot,\n\tremoveStoredCredentialProvider,\n\treplaceStoredCredentialProviders,\n\tsnapshotModelKey,\n\tupdateSnapshotModels,\n} from \"./model-runtime-snapshot.ts\";\nimport { FileModelsStore, InMemoryCodingAgentModelsStore } from \"./models-store.ts\";\nimport { collectOAuthProviderMetadata } from \"./oauth-provider-metadata.ts\";\nimport { isOfflineModeEnabled } from \"./package-manager-env.ts\";\nimport { createProviderAlias } from \"./provider-alias.js\";\nimport {\n\ttype AuthStatus,\n\ttype CompatibilityRequestConfig,\n\tcomposeModelProvider,\n\tconfiguredRequestAuthStatus,\n\ttype ProviderConfigInput,\n\tresolveCompatibilityRequestConfig,\n\tresolveConfiguredModelHeaders,\n\tvalidateExtensionProvider,\n} from \"./provider-composer.ts\";\nimport { withPersonalizedCatalog, withRemoteCatalog } from \"./remote-catalog-provider.ts\";\nimport { RuntimeCredentials } from \"./runtime-credentials.ts\";\n\nexport type { CreateModelRuntimeOptions, ModelRuntimeAuthOverrides } from \"./model-runtime-types.ts\";\n\nimport { mergeConfiguredAuthHeaders } from \"./model-runtime-auth.ts\";\nimport { configureBuiltinProviders } from \"./model-runtime-providers.ts\";\nimport { canRestoreUnknownModel as canRestoreUnknownModelProvider } from \"./model-runtime-restoration.ts\";\nimport {\n\ttype ModelRuntimeSimpleStreamOptions,\n\tModelRuntimeStreaming,\n\tmergeHeaders,\n} from \"./model-runtime-streaming.ts\";\nimport type { CreateModelRuntimeOptions, ModelRuntimeAuthOverrides } from \"./model-runtime-types.ts\";\n\nexport type CredentialSynchronizationOperation =\n\t| \"login\"\n\t| \"logout\"\n\t| \"saveCredential\"\n\t| \"setRuntimeApiKey\"\n\t| \"removeRuntimeApiKey\";\n\nfunction availabilityCredentialInputs(credential: Credential | undefined) {\n\tif (credential?.type !== \"oauth\") return credential;\n\tconst { access: _access, refresh: _refresh, expires: _expires, ...inputs } = credential;\n\treturn inputs;\n}\n\n/** Credentials changed successfully, but local model state could not be synchronized. */\nexport class CredentialSynchronizationError extends Error {\n\treadonly providerId: string;\n\treadonly operation: CredentialSynchronizationOperation;\n\treadonly credential: Credential | undefined;\n\n\tconstructor(\n\t\tproviderId: string,\n\t\toperation: CredentialSynchronizationOperation,\n\t\tcredential: Credential | undefined,\n\t\toptions: ErrorOptions,\n\t) {\n\t\tsuper(`Credential ${operation} committed for ${providerId}, but local synchronization failed`, options);\n\t\tthis.name = \"CredentialSynchronizationError\";\n\t\tthis.providerId = providerId;\n\t\tthis.operation = operation;\n\t\t// One call rather than assign-then-redefine: the two-step form is\n\t\t// equivalent (defineProperty with only `enumerable` preserves the existing\n\t\t// value) but reads as a redundant write and trips static analysis. The\n\t\t// non-enumerable descriptor is the load-bearing part — it keeps the\n\t\t// credential out of JSON.stringify, console.log, and structured error\n\t\t// reporting.\n\t\tObject.defineProperty(this, \"credential\", {\n\t\t\tvalue: credential,\n\t\t\tenumerable: false,\n\t\t\twritable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\t}\n}\nexport interface ExtensionProviderTransaction {\n\tregisterNativeProvider(provider: Provider): void;\n\tregisterProvider(providerId: string, config: ProviderConfigInput): void;\n\tunregisterProvider(providerId: string): void;\n\thasConfiguredAuth(providerId: string): boolean;\n\tcommit(): Promise<void>;\n}\n\nexport interface SaveCredentialOptions {\n\t/** Fetch the remote catalog before publishing the credential. Defaults to true. */\n\trefreshCatalog?: boolean;\n}\n\n/** Configured pi-ai Models collection used by coding-agent and SDK consumers. */\nexport class ModelRuntime implements Models {\n\tprivate readonly models: MutableModels;\n\tprivate readonly credentials: RuntimeCredentials;\n\tprivate readonly streaming: ModelRuntimeStreaming;\n\tprivate readonly defaultBuiltins: ReadonlyMap<string, Provider>;\n\tprivate readonly builtins = new Map<string, Provider>();\n\tprivate readonly nativeExtensionProviders = new Map<string, Provider>();\n\tprivate readonly extensionProviders = new Map<string, ProviderConfigInput>();\n\tprivate readonly compositionErrors = new Map<string, string>();\n\tprivate readonly fastModelVariantDiagnostics = new Map<string, readonly FastModelVariantDiagnostic[]>();\n\tprivate readonly modelsPath: string | undefined;\n\tprivate readonly modelNetworkEnabled: boolean;\n\tprivate config: ModelConfig;\n\tprivate snapshot: ModelRuntimeSnapshot = createEmptyModelRuntimeSnapshot();\n\tprivate snapshotGeneration = 0;\n\tprivate catalogInputsGeneration = 0;\n\tprivate observedModelsFileToken: string | undefined;\n\tprivate readonly externalProviderAuthStatuses = new Map<string, AuthStatus>();\n\tprivate readonly externalStatusCredentials = new Map<string, Credential | undefined>();\n\tprivate readonly availabilityCredentials = new Map<string, Credential | undefined>();\n\tprivate availabilityRefreshSeq = 0;\n\tprivate availabilityErrorSeq = 0;\n\tprivate readonly providerAvailabilitySeq = new Map<string, number>();\n\tprivate readonly credentialOperations = new Map<string, Promise<unknown>>();\n\tprivate availabilityError: string | undefined;\n\tprivate refreshSequence = 0;\n\tprivate constructor(\n\t\tcredentials: RuntimeCredentials,\n\t\tconfig: ModelConfig,\n\t\tmodelsPath: string | undefined,\n\t\tmodelsStore: ModelsStore,\n\t\tproviders: readonly Provider[],\n\t\tmodelNetworkEnabled: boolean,\n\t) {\n\t\tthis.credentials = credentials;\n\t\tthis.config = config;\n\t\tthis.modelsPath = modelsPath;\n\t\tthis.modelNetworkEnabled = modelNetworkEnabled;\n\t\tthis.defaultBuiltins = new Map(providers.map((provider) => [provider.id, provider]));\n\t\tfor (const [providerId, provider] of this.defaultBuiltins) this.builtins.set(providerId, provider);\n\t\tthis.models = createModels({ credentials, modelsStore });\n\t\tthis.streaming = new ModelRuntimeStreaming(\n\t\t\tthis.models,\n\t\t\t(model, overrides) => this.getRequestAuth(model, overrides),\n\t\t\t(model) => this.ownsExtensionTransport(model),\n\t\t\t(model) => {\n\t\t\t\tconst source = this.extensionProviders.get(model.provider)?.aliasOf;\n\t\t\t\treturn source ? { ...model, provider: source } : model;\n\t\t\t},\n\t\t\t() => this.credentials.reload(),\n\t\t);\n\t\tthis.rebuildProviders();\n\t}\n\tstatic async create(options: CreateModelRuntimeOptions = {}): Promise<ModelRuntime> {\n\t\tconst credentials = new RuntimeCredentials(options.credentials ?? DefaultAuthStorage.create(options.authPath));\n\t\tconst modelsPath =\n\t\t\toptions.modelsPath === null ? undefined : (options.modelsPath ?? join(getAgentDir(), \"models.json\"));\n\t\tconst config = await ModelConfig.load(modelsPath);\n\t\tconst modelsStore =\n\t\t\toptions.modelsStore ??\n\t\t\t(modelsPath\n\t\t\t\t? new FileModelsStore(options.modelsStorePath ?? join(dirname(modelsPath), \"models-store.json\"))\n\t\t\t\t: new InMemoryCodingAgentModelsStore());\n\t\tconst builtinModelDataGeneratedAt = builtinProviderCatalog.getBuiltinModelDataGeneratedAt();\n\t\tconst providers = builtinProviderCatalog.builtinProviders().map((provider) => {\n\t\t\tif (provider.id === \"radius\") return provider;\n\t\t\t// OpenRouter narrows the catalog to the models, limits and prices of the user's key.\n\t\t\tif (provider.id === \"openrouter\") {\n\t\t\t\treturn withPersonalizedCatalog(\n\t\t\t\t\tprovider,\n\t\t\t\t\tpersonalizeOpenRouterCatalog,\n\t\t\t\t\toptions.catalogBaseUrl,\n\t\t\t\t\tbuiltinModelDataGeneratedAt,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn withRemoteCatalog(provider, options.catalogBaseUrl, builtinModelDataGeneratedAt);\n\t\t});\n\t\tconst runtime = new ModelRuntime(\n\t\t\tcredentials,\n\t\t\tconfig,\n\t\t\tmodelsPath,\n\t\t\tmodelsStore,\n\t\t\tproviders,\n\t\t\t!isOfflineModeEnabled(),\n\t\t);\n\t\truntime.configureRadiusProviders();\n\t\truntime.rebuildProviders();\n\t\tconst refreshFromNetwork = runtime.modelNetworkEnabled && options.allowModelNetwork === true;\n\t\tconst controller = refreshFromNetwork ? new AbortController() : undefined;\n\t\tconst timeout = controller\n\t\t\t? setTimeout(() => controller.abort(), options.modelRefreshTimeoutMs ?? 15_000)\n\t\t\t: undefined;\n\t\ttry {\n\t\t\tif (options.refreshOnCreate !== false) {\n\t\t\t\tawait runtime.refresh({ allowNetwork: refreshFromNetwork, signal: controller?.signal });\n\t\t\t}\n\t\t} finally {\n\t\t\tif (timeout) clearTimeout(timeout);\n\t\t}\n\t\treturn runtime;\n\t}\n\tprivate configureRadiusProviders(): void {\n\t\tconfigureBuiltinProviders(this.builtins, this.defaultBuiltins, this.config);\n\t}\n\tprivate providerIds(): Set<string> {\n\t\treturn new Set([\n\t\t\t...this.builtins.keys(),\n\t\t\t...this.nativeExtensionProviders.keys(),\n\t\t\t...this.config.getProviderIds(),\n\t\t\t...this.extensionProviders.keys(),\n\t\t]);\n\t}\n\n\t/** Privacy boundary: no request auth resolution, credential commands, or OAuth refresh. */\n\tasync containsConfiguredCredential(serialized: string): Promise<boolean> {\n\t\tif (await this.credentials.containsConfiguredCredential(serialized)) return true;\n\t\tfor (const providerId of this.providerIds()) {\n\t\t\tif (\n\t\t\t\tcontainsAuthConfig(serialized, this.config.getProvider(providerId)) ||\n\t\t\t\tcontainsAuthConfig(serialized, this.extensionProviders.get(providerId))\n\t\t\t)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\t/**\n\t * Overlay derived selectable `-fast` model variants. Applied last so exact `-fast` IDs owned by the\n\t * provider, models.json, or an extension are already present and win the collision.\n\t */\n\tprivate withDerivedFastModels(provider: Provider): Provider {\n\t\treturn withFastModelVariants(provider, {\n\t\t\tgetCopilotFastModelIds: () => copilotAdvertisedFastModelIds(this.credentials.peek(\"github-copilot\")),\n\t\t\tgetModelOverrides: () => this.config.getProvider(provider.id)?.modelOverrides,\n\t\t\tgetCustomModelIds: () => new Set(this.config.getProvider(provider.id)?.models?.map((model) => model.id)),\n\t\t\tgetExtensionOwnedApis: () => {\n\t\t\t\tconst ownedApis = new Set<Api>();\n\t\t\t\tconst extension = this.extensionProviders.get(provider.id);\n\t\t\t\tif (extension?.streamSimple !== undefined && extension.api) ownedApis.add(extension.api);\n\t\t\t\tconst native = this.nativeExtensionProviders.get(provider.id);\n\t\t\t\tif (native?.stream !== undefined || native?.streamSimple !== undefined) {\n\t\t\t\t\tfor (const model of native.getModels()) ownedApis.add(model.api);\n\t\t\t\t}\n\t\t\t\treturn ownedApis.size > 0 ? ownedApis : undefined;\n\t\t\t},\n\t\t\tonDiagnostics: (id, diagnostics) => {\n\t\t\t\tif (diagnostics.length === 0) this.fastModelVariantDiagnostics.delete(id);\n\t\t\t\telse this.fastModelVariantDiagnostics.set(id, diagnostics);\n\t\t\t},\n\t\t});\n\t}\n\t/**\n\t * Publish a provider through the fast-variant overlay. Every catalog accessor — `getProvider`,\n\t * `getProviders`, `getModel`, `getModels`, `getAvailable` — then reports the same list. The overlay\n\t * is `{ ...provider, getModels }`, so `auth`, `login`, `stream`, and `streamSimple` stay the same\n\t * function references the caller registered.\n\t */\n\tprivate publishProvider(provider: Provider): void {\n\t\tthis.models.setProvider(this.withDerivedFastModels(provider));\n\t}\n\tprivate recomposeProvider(providerId: string): void {\n\t\tthis.composeProvider(providerId);\n\t\tfor (const [id, config] of this.extensionProviders) {\n\t\t\tif (config.aliasOf === providerId) this.composeProvider(id);\n\t\t}\n\t}\n\tprivate composeProvider(providerId: string): void {\n\t\tconst native = this.nativeExtensionProviders.get(providerId);\n\t\tconst base = native ? normalizeProvider(native) : this.builtins.get(providerId);\n\t\tconst extension = this.extensionProviders.get(providerId);\n\t\tif (extension?.aliasOf !== undefined) {\n\t\t\ttry {\n\t\t\t\tif (this.config.getProvider(providerId)) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Provider alias ${providerId}: configure models.json on source ${extension.aliasOf}, not the alias.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst sourceId = extension.aliasOf;\n\t\t\t\tthis.publishProvider(\n\t\t\t\t\tcreateProviderAlias({ id: providerId, name: extension.name, provider: sourceId }, () => {\n\t\t\t\t\t\tif (this.extensionProviders.get(sourceId)?.aliasOf !== undefined) {\n\t\t\t\t\t\t\tthrow new Error(\"Provider aliases must refer directly to a source provider, not another alias.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst source = this.models.getProvider(sourceId);\n\t\t\t\t\t\tif (!source)\n\t\t\t\t\t\t\tthrow new Error(`Provider alias ${providerId}: source provider ${sourceId} is unavailable.`);\n\t\t\t\t\t\treturn source;\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tthis.compositionErrors.delete(providerId);\n\t\t\t} catch (error) {\n\t\t\t\tthis.compositionErrors.set(providerId, error instanceof Error ? error.message : String(error));\n\t\t\t\tthis.models.deleteProvider(providerId);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (!base && !this.config.getProvider(providerId) && !extension) {\n\t\t\tthis.models.deleteProvider(providerId);\n\t\t\tthis.compositionErrors.delete(providerId);\n\t\t\tthis.fastModelVariantDiagnostics.delete(providerId);\n\t\t\treturn;\n\t\t}\n\t\tif (base && !this.config.getProvider(providerId) && !extension) {\n\t\t\t// No overlays: keep the builtin's auth/login/stream behavior exact and only add fast variants.\n\t\t\tthis.publishProvider(base);\n\t\t\tthis.compositionErrors.delete(providerId);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tthis.publishProvider(composeModelProvider(providerId, base, this.config, extension));\n\t\t\tthis.compositionErrors.delete(providerId);\n\t\t} catch (error) {\n\t\t\tthis.compositionErrors.set(providerId, error instanceof Error ? error.message : String(error));\n\t\t\tif (base) this.publishProvider(base);\n\t\t\telse this.models.deleteProvider(providerId);\n\t\t}\n\t}\n\tprivate rebuildProviders(): void {\n\t\tthis.models.clearProviders();\n\t\tthis.compositionErrors.clear();\n\t\tthis.fastModelVariantDiagnostics.clear();\n\t\tconst ids = [...this.providerIds()];\n\t\tfor (const providerId of ids.filter((id) => this.extensionProviders.get(id)?.aliasOf === undefined)) {\n\t\t\tthis.recomposeProvider(providerId);\n\t\t}\n\t\tfor (const providerId of ids.filter((id) => this.extensionProviders.get(id)?.aliasOf !== undefined)) {\n\t\t\tthis.recomposeProvider(providerId);\n\t\t}\n\t\tthis.updateModelSnapshot();\n\t}\n\tprivate updateModelSnapshot(): void {\n\t\tthis.snapshotGeneration += 1;\n\t\tthis.snapshot = updateSnapshotModels(this.snapshot, [...this.models.getModels()]);\n\t}\n\tprivate async runAvailabilityRefresh(seq: number, errorSeq: number, signal: AbortSignal): Promise<boolean> {\n\t\tconst inputsGeneration = this.catalogInputsGeneration;\n\t\tconst providers = this.models.getProviders();\n\t\tconst [available, checks, credentials] = await Promise.all([\n\t\t\tthis.models.getAvailable(undefined, { signal }),\n\t\t\tPromise.all(\n\t\t\t\tproviders.map(\n\t\t\t\t\tasync (provider): Promise<[string, AuthCheck | undefined]> => [\n\t\t\t\t\t\tprovider.id,\n\t\t\t\t\t\tawait this.models.checkAuth(provider.id, { signal }),\n\t\t\t\t\t],\n\t\t\t\t),\n\t\t\t),\n\t\t\tthis.credentials.list({ signal }),\n\t\t]);\n\t\tif (seq !== this.availabilityRefreshSeq || inputsGeneration !== this.catalogInputsGeneration) return false;\n\t\tthis.snapshot = createModelRuntimeSnapshot([...this.models.getModels()], [...available], checks, credentials);\n\t\tthis.availabilityCredentials.clear();\n\t\tthis.recordAvailabilityCredentials([...this.snapshot.auth.keys(), ...this.snapshot.storedProviders]);\n\t\tif (errorSeq === this.availabilityErrorSeq) this.availabilityError = undefined;\n\t\treturn true;\n\t}\n\tprivate queueAvailabilityRefresh(signal?: AbortSignal): Promise<boolean> {\n\t\tconst seq = ++this.availabilityRefreshSeq;\n\t\tfor (const [providerId, providerSeq] of this.providerAvailabilitySeq)\n\t\t\tthis.providerAvailabilitySeq.set(providerId, providerSeq + 1);\n\t\tconst errorSeq = ++this.availabilityErrorSeq;\n\t\tconst effectiveSignal = operationSignal(signal);\n\t\treturn this.runAvailabilityRefresh(seq, errorSeq, effectiveSignal).catch((error) => {\n\t\t\tif (errorSeq === this.availabilityErrorSeq && !effectiveSignal.aborted)\n\t\t\t\tthis.availabilityError = error instanceof Error ? error.message : String(error);\n\t\t\tthrow error;\n\t\t});\n\t}\n\tprivate async refreshProviderAvailability(providerId: string, signal: AbortSignal): Promise<void> {\n\t\tconst inputsGeneration = this.catalogInputsGeneration;\n\t\t++this.availabilityRefreshSeq;\n\t\tconst providerSeq = (this.providerAvailabilitySeq.get(providerId) ?? 0) + 1;\n\t\tthis.providerAvailabilitySeq.set(providerId, providerSeq);\n\t\tconst errorSeq = ++this.availabilityErrorSeq;\n\t\ttry {\n\t\t\tconst [available, auth, credential] = await Promise.all([\n\t\t\t\tthis.models.getAvailable(providerId, { signal }),\n\t\t\t\tthis.models.checkAuth(providerId, { signal }),\n\t\t\t\tthis.credentials.read(providerId, { signal }),\n\t\t\t]);\n\t\t\tsignal.throwIfAborted();\n\t\t\tif (\n\t\t\t\tthis.providerAvailabilitySeq.get(providerId) !== providerSeq ||\n\t\t\t\tinputsGeneration !== this.catalogInputsGeneration\n\t\t\t)\n\t\t\t\treturn;\n\t\t\tconst configuredProviders = new Set(this.snapshot.configuredProviders),\n\t\t\t\tstoredProviders = new Set(this.snapshot.storedProviders),\n\t\t\t\tstoredCredentialTypes = new Map(this.snapshot.storedCredentialTypes),\n\t\t\t\tauthByProvider = new Map(this.snapshot.auth);\n\t\t\tif (auth) {\n\t\t\t\tconfiguredProviders.add(providerId);\n\t\t\t\tauthByProvider.set(providerId, auth);\n\t\t\t} else {\n\t\t\t\tconfiguredProviders.delete(providerId);\n\t\t\t\tauthByProvider.delete(providerId);\n\t\t\t}\n\t\t\tif (credential) {\n\t\t\t\tstoredProviders.add(providerId);\n\t\t\t\tstoredCredentialTypes.set(providerId, credential.type);\n\t\t\t} else {\n\t\t\t\tstoredProviders.delete(providerId);\n\t\t\t\tstoredCredentialTypes.delete(providerId);\n\t\t\t}\n\t\t\tconst all = [...this.models.getModels()];\n\t\t\tconst availableById = new Map(\n\t\t\t\t[...this.snapshot.available.filter((model) => model.provider !== providerId), ...available].map((model) => [\n\t\t\t\t\t`${model.provider}\\0${model.id}`,\n\t\t\t\t\tmodel,\n\t\t\t\t]),\n\t\t\t);\n\t\t\tthis.recordAvailabilityCredentials([providerId]);\n\t\t\tthis.snapshot = {\n\t\t\t\tall,\n\t\t\t\tavailable: all.flatMap((model) => availableById.get(`${model.provider}\\0${model.id}`) ?? []),\n\t\t\t\tconfiguredProviders,\n\t\t\t\tstoredProviders,\n\t\t\t\tstoredCredentialTypes,\n\t\t\t\tauth: authByProvider,\n\t\t\t};\n\t\t\tif (errorSeq === this.availabilityErrorSeq) this.availabilityError = undefined;\n\t\t} catch (error) {\n\t\t\tif (\n\t\t\t\tthis.providerAvailabilitySeq.get(providerId) === providerSeq &&\n\t\t\t\terrorSeq === this.availabilityErrorSeq &&\n\t\t\t\t!signal.aborted\n\t\t\t)\n\t\t\t\tthis.availabilityError = error instanceof Error ? error.message : String(error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tgetProviders(): readonly Provider[] {\n\t\treturn this.models.getProviders();\n\t}\n\tgetProvider(providerId: string): Provider | undefined {\n\t\treturn this.models.getProvider(normalizeProviderId(providerId));\n\t}\n\t/**\n\t * Whether an authenticated provider may reconstruct an absent saved model ID.\n\t *\n\t * Pass `modelId` whenever it is known. GitHub Copilot advertises every model it offers per account,\n\t * so a `-fast` ID that appears in neither the picker list nor the fast-sibling list is definitively\n\t * not restorable. An ID advertised as a fast sibling also requires its corresponding base model in\n\t * the catalog; otherwise reconstruction would invent a route-less fast identity. An ID advertised\n\t * as an ordinary model stays ordinary whatever its name ends in. Every other provider keeps the\n\t * provider-scoped answer, so a provider-owned model whose upstream name merely ends in `-fast`\n\t * (several exist under `vercel-ai-gateway`) still restores.\n\t */\n\tcanRestoreUnknownModel(providerId: string, modelId?: string): boolean {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tif (\n\t\t\tmodelId !== undefined &&\n\t\t\tisGitHubCopilotModel({ provider: providerId }) &&\n\t\t\tmodelId.endsWith(FAST_MODEL_ID_SUFFIX)\n\t\t) {\n\t\t\tconst credential = this.credentials.peek(providerId);\n\t\t\tif (!copilotAdvertisesModelId(credential, modelId)) return false;\n\t\t\tif (copilotAdvertisedFastModelIds(credential)?.includes(modelId) === true) {\n\t\t\t\tconst baseModelId = modelId.slice(0, -FAST_MODEL_ID_SUFFIX.length);\n\t\t\t\tif (!this.models.getModel(providerId, baseModelId)) return false;\n\t\t\t}\n\t\t}\n\t\treturn canRestoreUnknownModelProvider(\n\t\t\tproviderId,\n\t\t\tthis.defaultBuiltins.get(providerId),\n\t\t\tthis.config.getProvider(providerId),\n\t\t\tthis.extensionProviders.get(providerId),\n\t\t\tthis.nativeExtensionProviders.get(providerId),\n\t\t);\n\t}\n\tprivate resolveModelMetadata(model: Model<Api>): Model<Api> {\n\t\tconst credential = this.credentials.peek(model.provider);\n\t\tif (credential !== undefined || this.credentials.hasCredentialSnapshot()) {\n\t\t\tconst provider = this.models.getProvider(model.provider);\n\t\t\treturn provider?.filterModels?.([model], credential).find((candidate) => candidate.id === model.id) ?? model;\n\t\t}\n\t\treturn (\n\t\t\tthis.snapshot.available.find(\n\t\t\t\t(candidate) => candidate.provider === model.provider && candidate.id === model.id,\n\t\t\t) ?? model\n\t\t);\n\t}\n\tgetModels(providerId?: string): readonly Model<Api>[] {\n\t\treturn this.models.getModels(providerId).map((model) => this.resolveModelMetadata(model));\n\t}\n\tgetModel(providerId: string, modelId: string): Model<Api> | undefined {\n\t\tconst model = this.models.getModel(normalizeProviderId(providerId), modelId);\n\t\treturn model ? this.resolveModelMetadata(model) : undefined;\n\t}\n\tprivate resolveCatalogMetadata<TModel extends AnyModel>(model: TModel): TModel {\n\t\treturn isModelType(model, \"chat\") ? { ...model, ...this.resolveModelMetadata(model) } : model;\n\t}\n\tgetModelsOfType<TType extends ModelType>(type: TType, providerId?: string): readonly ModelTypeMap[TType][] {\n\t\treturn this.models.getModelsOfType(type, providerId).map((model) => this.resolveCatalogMetadata(model));\n\t}\n\tgetModelOfType<TType extends ModelType>(\n\t\ttype: TType,\n\t\tproviderId: string,\n\t\tmodelId: string,\n\t): ModelTypeMap[TType] | undefined {\n\t\tconst model = this.models.getModelOfType(type, normalizeProviderId(providerId), modelId);\n\t\treturn model ? this.resolveCatalogMetadata(model) : undefined;\n\t}\n\tgetAllModels(providerId?: string): readonly AnyModel[] {\n\t\treturn this.models.getAllModels(providerId).map((model) => this.resolveCatalogMetadata(model));\n\t}\n\tgetAvailableOfType<TType extends ModelType>(\n\t\ttype: TType,\n\t\tproviderId?: string,\n\t\toptions?: AuthOperationOptions,\n\t): Promise<readonly ModelTypeMap[TType][]> {\n\t\treturn this.models.getAvailableOfType(type, providerId, options);\n\t}\n\tgetAllAvailable(providerId?: string, options?: AuthOperationOptions): Promise<readonly AnyModel[]> {\n\t\treturn this.models.getAllAvailable(providerId, options);\n\t}\n\n\tasync checkAuth(providerId: string, options?: AuthOperationOptions): Promise<AuthCheck | undefined> {\n\t\treturn this.models.checkAuth(providerId, options);\n\t}\n\tasync getAvailable(providerId?: string, options?: AuthOperationOptions): Promise<readonly Model<Api>[]> {\n\t\tif (providerId) {\n\t\t\tconst errorSeq = ++this.availabilityErrorSeq;\n\t\t\ttry {\n\t\t\t\tconst available = await this.models.getAvailable(providerId, options);\n\t\t\t\tif (errorSeq === this.availabilityErrorSeq) this.availabilityError = undefined;\n\t\t\t\treturn available;\n\t\t\t} catch (error) {\n\t\t\t\tif (errorSeq === this.availabilityErrorSeq && !options?.signal?.aborted)\n\t\t\t\t\tthis.availabilityError = error instanceof Error ? error.message : String(error);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t\tfor (let attempt = 0; attempt < 3 && !(await this.queueAvailabilityRefresh(options?.signal)); attempt++);\n\t\treturn this.snapshot.available;\n\t}\n\tgetAvailableSnapshot(): readonly Model<Api>[] {\n\t\treturn this.snapshot.available;\n\t}\n\tgetError(): string | undefined {\n\t\tconst errors: string[] = [];\n\t\tconst configError = this.config.getError();\n\t\tif (configError) errors.push(configError);\n\t\tfor (const [providerId, error] of this.compositionErrors) {\n\t\t\terrors.push(`Provider \"${providerId}\": ${error}`);\n\t\t}\n\t\tif (this.availabilityError) errors.push(`Availability refresh: ${this.availabilityError}`);\n\t\treturn errors.length > 0 ? errors.join(\"\\n\\n\") : undefined;\n\t}\n\n\t/**\n\t * Derived fast model variants that were suppressed because a provider, models.json custom model, or\n\t * extension already owns the exact `-fast` model ID. Reported as warnings, not composition errors.\n\t */\n\tgetFastModelVariantDiagnostics(): readonly FastModelVariantDiagnostic[] {\n\t\treturn [...this.fastModelVariantDiagnostics.values()].flat();\n\t}\n\n\t/** Non-fatal catalog warnings, joined for display. */\n\tgetWarning(): string | undefined {\n\t\tconst warnings = this.getFastModelVariantDiagnostics().map((diagnostic) => diagnostic.message);\n\t\treturn warnings.length > 0 ? warnings.join(\"\\n\\n\") : undefined;\n\t}\n\n\tgetRegisteredProviderConfig(providerId: string): ProviderConfigInput | undefined {\n\t\treturn this.extensionProviders.get(normalizeProviderId(providerId));\n\t}\n\n\t/**\n\t * Whether an extension supplies the stream function for this model's api. Such a transport owns its\n\t * own serialization, so Atomic must not attach first-party provider routing to it. This mirrors the\n\t * `usesExtensionStream` check the agent session makes before dispatching.\n\t */\n\tprivate ownsExtensionTransport(model: Model<Api>): boolean {\n\t\tconst extension = this.extensionProviders.get(model.provider);\n\t\treturn extension?.streamSimple !== undefined && model.api === extension.api;\n\t}\n\n\tgetRegisteredProviderIds(): readonly string[] {\n\t\treturn [...new Set([...this.extensionProviders.keys(), ...this.nativeExtensionProviders.keys()])];\n\t}\n\n\tgetRegisteredNativeProvider(providerId: string): Provider | undefined {\n\t\treturn this.nativeExtensionProviders.get(normalizeProviderId(providerId));\n\t}\n\tgetOAuthProviderMetadata() {\n\t\treturn collectOAuthProviderMetadata(this.getProviders(), this.extensionProviders);\n\t}\n\t/** Providers that offer API-key login in `/login`. */\n\tgetApiKeyLoginProviderMetadata(): Array<{ id: string; name: string }> {\n\t\treturn this.getProviders()\n\t\t\t.filter((provider) => provider.auth.apiKey?.login !== undefined)\n\t\t\t.map((provider) => ({ id: provider.id, name: provider.name ?? provider.id }));\n\t}\n\t/** @internal Compatibility fallback for ModelRegistry when provider auth is unconfigured. */\n\tgetCompatibilityRequestConfig(model: Model<Api>): CompatibilityRequestConfig {\n\t\tmodel = normalizeModelProvider(model);\n\t\treturn resolveCompatibilityRequestConfig(\n\t\t\tmodel,\n\t\t\tthis.config.getProvider(model.provider),\n\t\t\tthis.extensionProviders.get(model.provider),\n\t\t);\n\t}\n\n\tisUsingOAuth(providerId: string): boolean {\n\t\tthis.syncStoredCredentialChanges();\n\t\treturn this.snapshot.auth.get(normalizeProviderId(providerId))?.type === \"oauth\";\n\t}\n\n\thasConfiguredAuth(providerId: string): boolean {\n\t\tthis.syncStoredCredentialChanges();\n\t\treturn this.snapshot.configuredProviders.has(normalizeProviderId(providerId));\n\t}\n\n\tprivate syncStoredCredentialChanges(): void {\n\t\tif (!this.credentials.hasCredentialSnapshot()) return;\n\t\tthis.credentials.reloadIfChanged();\n\t\tconst providerIds = new Set([\n\t\t\t...this.models.getProviders().map((provider) => provider.id),\n\t\t\t...this.snapshot.storedProviders,\n\t\t]);\n\t\tlet snapshot = this.snapshot;\n\t\tconst changedProviderIds = new Set<string>();\n\t\tconst removedProviderIds: string[] = [];\n\t\tfor (const providerId of providerIds) {\n\t\t\tif (this.credentials.hasRuntimeApiKey(providerId)) continue;\n\t\t\tconst credential = this.credentials.peek(providerId);\n\t\t\tconst type = credential?.type;\n\t\t\tif (\n\t\t\t\ttype === snapshot.storedCredentialTypes.get(providerId) &&\n\t\t\t\t!this.availabilityCredentialChanged(providerId, credential)\n\t\t\t)\n\t\t\t\tcontinue;\n\t\t\tif (\n\t\t\t\tthis.externalProviderAuthStatuses.has(providerId) &&\n\t\t\t\tisDeepStrictEqual(credential, this.externalStatusCredentials.get(providerId))\n\t\t\t)\n\t\t\t\tcontinue;\n\t\t\tthis.externalProviderAuthStatuses.delete(providerId);\n\t\t\tthis.externalStatusCredentials.delete(providerId);\n\t\t\tchangedProviderIds.add(providerId);\n\t\t\tif (type) {\n\t\t\t\tsnapshot = addStoredCredentialProvider(snapshot, providerId, type);\n\t\t\t} else {\n\t\t\t\tsnapshot = removeStoredCredentialProvider(snapshot, providerId);\n\t\t\t\tremovedProviderIds.push(providerId);\n\t\t\t}\n\t\t}\n\t\tif (changedProviderIds.size === 0) return;\n\t\tthis.markCatalogInputsChanged();\n\t\tthis.snapshotGeneration += 1;\n\t\tthis.snapshot = this.withCredentialAvailability(this.snapshot, snapshot, changedProviderIds);\n\t\tfor (const providerId of removedProviderIds) {\n\t\t\tvoid this.refreshRemainingAuthAfterLogout(providerId, this.snapshotGeneration);\n\t\t}\n\t}\n\n\tprivate availabilityCredentialChanged(providerId: string, credential: Credential | undefined): boolean {\n\t\tif (!this.availabilityCredentials.has(providerId)) {\n\t\t\tthis.availabilityCredentials.set(providerId, credential);\n\t\t\treturn false;\n\t\t}\n\t\tconst published = this.availabilityCredentials.get(providerId);\n\t\tif (credential === published) return false;\n\t\tif (!isDeepStrictEqual(availabilityCredentialInputs(credential), availabilityCredentialInputs(published)))\n\t\t\treturn true;\n\t\tthis.availabilityCredentials.set(providerId, credential);\n\t\treturn false;\n\t}\n\n\tprivate recordAvailabilityCredentials(providerIds: Iterable<string>): void {\n\t\tfor (const providerId of providerIds)\n\t\t\tthis.availabilityCredentials.set(providerId, this.credentials.peek(providerId));\n\t}\n\n\tprivate withCredentialAvailability(\n\t\tprevious: ModelRuntimeSnapshot,\n\t\tnext: ModelRuntimeSnapshot,\n\t\tproviderIds: ReadonlySet<string>,\n\t): ModelRuntimeSnapshot {\n\t\tconst availableByKey = new Map(\n\t\t\tprevious.available\n\t\t\t\t.filter((model) => !providerIds.has(model.provider))\n\t\t\t\t.map((model) => [snapshotModelKey(model), model]),\n\t\t);\n\t\tfor (const providerId of providerIds) {\n\t\t\tconst provider = this.models.getProvider(providerId);\n\t\t\tif (!provider || !next.configuredProviders.has(providerId)) continue;\n\t\t\tconst models = provider.getModels();\n\t\t\tfor (const model of provider.filterModels?.(models, this.credentials.peek(providerId)) ?? models)\n\t\t\t\tavailableByKey.set(snapshotModelKey(model), model);\n\t\t}\n\t\tthis.recordAvailabilityCredentials(providerIds);\n\t\tconst all = [...this.models.getModels()];\n\t\treturn {\n\t\t\t...next,\n\t\t\tall,\n\t\t\tavailable: all.flatMap((model) => availableByKey.get(snapshotModelKey(model)) ?? []),\n\t\t};\n\t}\n\n\t/** Return stored credential metadata synchronously without refreshing auth. */\n\tgetCredentialSnapshot(providerId: string): Credential | undefined {\n\t\treturn this.credentials.peek(normalizeProviderId(providerId));\n\t}\n\n\tgetAuth(providerId: string, overrides?: ModelRuntimeAuthOverrides): Promise<AuthResult | undefined>;\n\tgetAuth(model: AnyModel, overrides?: ModelRuntimeAuthOverrides): Promise<AuthResult | undefined>;\n\tasync getAuth(\n\t\tproviderOrModel: string | AnyModel,\n\t\toverrides: ModelRuntimeAuthOverrides = {},\n\t): Promise<AuthResult | undefined> {\n\t\tif (typeof providerOrModel === \"string\")\n\t\t\treturn this.models.getAuth(normalizeProviderId(providerOrModel), overrides);\n\t\tproviderOrModel = normalizeModelProvider(providerOrModel);\n\t\tconst resolution = await this.models.getAuth(providerOrModel, overrides);\n\t\tif (!resolution) return undefined;\n\t\treturn mergeConfiguredAuthHeaders(\n\t\t\tresolution,\n\t\t\tproviderOrModel,\n\t\t\tthis.config,\n\t\t\tthis.extensionProviders.get(providerOrModel.provider),\n\t\t\toverrides,\n\t\t);\n\t}\n\n\t/**\n\t * Resolve request-owned auth/config headers without copying the model's static\n\t * catalog headers into the per-request override layer. The API provider reads\n\t * static headers from the model itself; duplicating them in auth would make\n\t * them override API-computed defaults that intentionally replace catalog values.\n\t */\n\tasync getRequestAuth(model: Model<Api>, overrides: ModelRuntimeAuthOverrides = {}): Promise<AuthResult | undefined> {\n\t\tmodel = normalizeModelProvider(model);\n\t\tconst resolution = await this.getAuth(model.provider, overrides);\n\t\tif (!resolution) return undefined;\n\t\treturn mergeConfiguredAuthHeaders(\n\t\t\tresolution,\n\t\t\tmodel,\n\t\t\tthis.config,\n\t\t\tthis.extensionProviders.get(model.provider),\n\t\t\toverrides,\n\t\t);\n\t}\n\n\t/**\n\t * Monotonic count of changes to any input a catalog refresh reads.\n\t *\n\t * `refresh()` reloads models.json, recomposes every provider from it, the\n\t * extension registrations, and the builtin catalog, resolves credentials as\n\t * it runs, and publishes ONE snapshot at the end. So a pass belongs to the\n\t * inputs it started under, and joining a pass across a bump is unsound in\n\t * both directions: the joiner reads models and credentials the user has\n\t * already replaced, and the pass's late publish overwrites the newer state\n\t * with them.\n\t *\n\t * Every mutation source bumps this counter, which is why callers need only\n\t * this one number rather than a growing tuple of per-input keys:\n\t *\n\t * - credential writes — `login`, `logout`, `saveCredential`,\n\t * `setRuntimeApiKey`, `removeRuntimeApiKey`, an external\n\t * `reloadCredentials`, and an applied external auth status;\n\t * - provider registrations — `registerProvider`, `registerNativeProvider`,\n\t * and `unregisterProvider`, through the refresh they schedule;\n\t * - models.json content — provider `baseUrl`, `apiKey`, `api`, headers,\n\t * model definitions, and overrides, which every pass reloads.\n\t *\n\t * The first two are this runtime's own writes and bump where they happen.\n\t * The third is an external edit nothing here observes, so reading the\n\t * generation samples the file and bumps when its content moved since the\n\t * last sample. That read is synchronous so the answer belongs to the same\n\t * tick as the decision that depends on it, and it hashes content rather\n\t * than trusting an mtime: a same-size rewrite inside one filesystem\n\t * timestamp tick — an edited key, a renamed model — is exactly the change a\n\t * shared pass must not hide.\n\t */\n\tgetCatalogInputsGeneration(): number {\n\t\tthis.observeModelsFile();\n\t\treturn this.catalogInputsGeneration;\n\t}\n\n\t/**\n\t * Record that an input a catalog refresh reads changed. Every pass started\n\t * before this call answers for inputs that no longer exist.\n\t */\n\tprivate markCatalogInputsChanged(): void {\n\t\tthis.catalogInputsGeneration += 1;\n\t}\n\n\t/** Bump the generation when models.json changed since the last observation. */\n\tprivate observeModelsFile(): void {\n\t\tconst token = this.readModelsFileToken();\n\t\tif (this.observedModelsFileToken === token) return;\n\t\tconst first = this.observedModelsFileToken === undefined;\n\t\tthis.observedModelsFileToken = token;\n\t\t// The first observation is a baseline, not a change: no pass can predate it.\n\t\tif (!first) this.markCatalogInputsChanged();\n\t}\n\n\tprivate readModelsFileToken(): string {\n\t\tif (!this.modelsPath) return \"none\";\n\t\ttry {\n\t\t\treturn createHash(\"sha1\")\n\t\t\t\t.update(readFileSync(normalizePath(this.modelsPath)))\n\t\t\t\t.digest(\"hex\");\n\t\t} catch (error) {\n\t\t\tconst code = (error as NodeJS.ErrnoException).code;\n\t\t\t// An absent file is a stable state passes can share; any other read\n\t\t\t// failure keys on its own code rather than pretending the file is empty.\n\t\t\treturn code === \"ENOENT\" ? \"absent\" : `unreadable:${code ?? \"unknown\"}`;\n\t\t}\n\t}\n\n\t/** Reload credentials changed by the authoritative isolated engine and update auth status snapshots. */\n\tasync reloadCredentials(options: { refreshAvailability?: boolean } = {}): Promise<void> {\n\t\tawait this.credentials.reload();\n\t\tthis.markCatalogInputsChanged();\n\t\tif (options.refreshAvailability === false) {\n\t\t\tconst credentials = await this.credentials.list();\n\t\t\tfor (const credential of credentials) this.externalProviderAuthStatuses.delete(credential.providerId);\n\t\t\tthis.snapshotGeneration += 1;\n\t\t\tthis.snapshot = replaceStoredCredentialProviders(this.snapshot, credentials);\n\t\t\tthis.recordAvailabilityCredentials([...this.snapshot.auth.keys(), ...this.snapshot.storedProviders]);\n\t\t\treturn;\n\t\t}\n\t\tawait this.queueAvailabilityRefresh();\n\t}\n\n\tprivate assertCredentialRefreshSucceeded(\n\t\tproviderId: string,\n\t\tresult: ModelsRefreshResult,\n\t\tsignal?: AbortSignal,\n\t): void {\n\t\tif (result.aborted) {\n\t\t\tsignal?.throwIfAborted();\n\t\t\tthrow new Error(`Model refresh aborted for ${providerId}`);\n\t\t}\n\t\tconst refreshError = result.errors.get(providerId);\n\t\tif (refreshError) throw refreshError;\n\t\tconst compositionError = this.compositionErrors.get(providerId);\n\t\tif (compositionError) throw new Error(compositionError);\n\t}\n\n\tprivate enqueueCredentialOperation<T>(providerId: string, signal: AbortSignal, task: () => Promise<T>): Promise<T> {\n\t\tconst previous = this.credentialOperations.get(providerId) ?? Promise.resolve();\n\t\tlet markStarted: (() => void) | undefined;\n\t\tconst started = new Promise<void>((resolve) => {\n\t\t\tmarkStarted = resolve;\n\t\t});\n\t\tconst operation = (async () => {\n\t\t\tawait previous.catch(() => {});\n\t\t\tsignal.throwIfAborted();\n\t\t\tmarkStarted?.();\n\t\t\treturn task();\n\t\t})();\n\t\tconst tail = operation.catch(() => {});\n\t\tthis.credentialOperations.set(providerId, tail);\n\t\tvoid tail.then(() => {\n\t\t\tif (this.credentialOperations.get(providerId) === tail) this.credentialOperations.delete(providerId);\n\t\t});\n\t\treturn raceWithAbortSignal(started, signal).then(() => operation);\n\t}\n\tprivate async synchronizeCredentialState(\n\t\tproviderId: string,\n\t\toperation: CredentialSynchronizationOperation,\n\t\tcredential: Credential | undefined,\n\t\tsynchronize: () => void | Promise<void>,\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait synchronize();\n\t\t} catch (cause) {\n\t\t\tif (cause instanceof CredentialSynchronizationError) throw cause;\n\t\t\tthrow new CredentialSynchronizationError(providerId, operation, credential, { cause });\n\t\t}\n\t}\n\tprivate async refreshRemainingAuthAfterLogout(providerId: string, logoutGeneration: number): Promise<void> {\n\t\t// Environment/runtime auth can remain after stored auth is removed. The\n\t\t// probe is normally synchronous, but its deadline is authoritative because\n\t\t// extension checks are third-party code and need not honor cancellation.\n\t\tlet timeout: number | undefined;\n\t\ttry {\n\t\t\tconst remainingAuth = await Promise.race([\n\t\t\t\tthis.checkAuth(providerId).catch(() => undefined),\n\t\t\t\tnew Promise<undefined>((resolve) => {\n\t\t\t\t\ttimeout = setTimeout(resolve, POST_LOGOUT_AUTH_CHECK_TIMEOUT_MS);\n\t\t\t\t}),\n\t\t\t]);\n\t\t\tif (logoutGeneration === this.snapshotGeneration && !this.snapshot.storedProviders.has(providerId)) {\n\t\t\t\tthis.snapshot = this.withCredentialAvailability(\n\t\t\t\t\tthis.snapshot,\n\t\t\t\t\tremoveStoredCredentialProvider(this.snapshot, providerId, remainingAuth),\n\t\t\t\t\tnew Set([providerId]),\n\t\t\t\t);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (timeout) clearTimeout(timeout);\n\t\t}\n\t}\n\n\t/**\n\t * Persist a credential acquired elsewhere.\n\t *\n\t * `refreshCatalog` defaults to true so the saved credential is published against\n\t * a freshly fetched catalog. Callers that acquired the key through a login dialog\n\t * pass false: that transaction ends at persistence, and a remote catalog fetch\n\t * would make an offline save fail after the credential was already committed.\n\t */\n\tasync saveCredential(\n\t\tproviderId: string,\n\t\tcredential: Credential,\n\t\toptions: SaveCredentialOptions = {},\n\t): Promise<void> {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tconst refreshCatalog = options.refreshCatalog ?? true;\n\t\tconst signal = operationSignal(undefined);\n\t\tawait this.enqueueCredentialOperation(providerId, signal, async () => {\n\t\t\tawait this.credentials.modify(providerId, async () => credential);\n\t\t\tthis.markCatalogInputsChanged();\n\t\t\tawait this.synchronizeCredentialState(providerId, \"saveCredential\", credential, async () => {\n\t\t\t\tif (!refreshCatalog) {\n\t\t\t\t\tthis.updateModelSnapshot();\n\t\t\t\t\tthis.externalProviderAuthStatuses.delete(providerId);\n\t\t\t\t\tthis.snapshot = addStoredCredentialProvider(this.snapshot, providerId, credential.type);\n\t\t\t\t\tthis.recordAvailabilityCredentials([providerId]);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst result = await this.refresh({ providers: [providerId] });\n\t\t\t\tthis.assertCredentialRefreshSucceeded(providerId, result);\n\t\t\t\t// A concurrent catalog refresh can supersede this provider's availability\n\t\t\t\t// publication. The committed credential must still be visible when save returns.\n\t\t\t\tthis.snapshotGeneration += 1;\n\t\t\t\tthis.externalProviderAuthStatuses.delete(providerId);\n\t\t\t\tthis.snapshot = {\n\t\t\t\t\t...addStoredCredentialProvider(this.snapshot, providerId, credential.type),\n\t\t\t\t\t// Keep credential-filtered model availability from the refresh intact.\n\t\t\t\t\tavailable: this.snapshot.available,\n\t\t\t\t};\n\t\t\t\tthis.recordAvailabilityCredentials([providerId]);\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t * Apply a process-scoped API key override. This publishes the provider against\n\t * the current snapshot and deliberately does not refresh the model catalog;\n\t * callers needing catalog freshness call refresh({ providers: [providerId], signal })\n\t * separately.\n\t */\n\tasync setRuntimeApiKey(providerId: string, apiKey: string, options: AuthOperationOptions): Promise<void> {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tconst signal = operationSignal(options.signal);\n\t\tawait this.enqueueCredentialOperation(providerId, signal, async () => {\n\t\t\tthis.credentials.setRuntimeApiKey(providerId, apiKey);\n\t\t\tthis.markCatalogInputsChanged();\n\t\t\tawait this.synchronizeCredentialState(providerId, \"setRuntimeApiKey\", { type: \"api_key\", key: apiKey }, () => {\n\t\t\t\tthis.snapshot = addRuntimeApiKeyProvider(this.snapshot, providerId);\n\t\t\t});\n\t\t});\n\t}\n\n\tasync removeRuntimeApiKey(providerId: string, options: AuthOperationOptions = {}): Promise<void> {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tconst signal = operationSignal(options.signal);\n\t\tawait this.enqueueCredentialOperation(providerId, signal, async () => {\n\t\t\tthis.credentials.removeRuntimeApiKey(providerId);\n\t\t\tthis.markCatalogInputsChanged();\n\t\t\tawait this.synchronizeCredentialState(providerId, \"removeRuntimeApiKey\", undefined, async () => {\n\t\t\t\tconst result = await this.refresh({ allowNetwork: this.modelNetworkEnabled, signal });\n\t\t\t\tthis.assertCredentialRefreshSucceeded(providerId, result, signal);\n\t\t\t});\n\t\t});\n\t}\n\n\tlistCredentials(): Promise<readonly CredentialInfo[]> {\n\t\treturn this.credentials.list();\n\t}\n\n\tgetStoredCredentialType(providerId: string): CredentialInfo[\"type\"] | undefined {\n\t\tthis.syncStoredCredentialChanges();\n\t\treturn this.snapshot.storedCredentialTypes.get(normalizeProviderId(providerId));\n\t}\n\n\tgetProviderAuthStatus(providerId: string): AuthStatus {\n\t\tthis.syncStoredCredentialChanges();\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tconst localStatus = getSnapshotProviderAuthStatus(\n\t\t\tthis.snapshot,\n\t\t\tproviderId,\n\t\t\tthis.credentials.hasRuntimeApiKey(providerId),\n\t\t\tconfiguredRequestAuthStatus(this.config.getProvider(providerId), this.extensionProviders.get(providerId)),\n\t\t);\n\t\tif (localStatus.source === \"stored\" || localStatus.source === \"runtime\") return localStatus;\n\t\treturn this.externalProviderAuthStatuses.get(providerId) ?? localStatus;\n\t}\n\n\t/** Apply authoritative auth state returned by an isolated engine mutation. */\n\tapplyExternalProviderAuthStatus(providerId: string, status: AuthStatus): void {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tthis.markCatalogInputsChanged();\n\t\tthis.snapshotGeneration += 1;\n\t\tconst remainingAuth =\n\t\t\tstatus.configured && status.source === \"environment\"\n\t\t\t\t? ({ type: \"api_key\", source: status.label ?? \"environment\" } as const)\n\t\t\t\t: undefined;\n\t\tthis.snapshot = removeStoredCredentialProvider(this.snapshot, providerId, remainingAuth);\n\t\tthis.externalProviderAuthStatuses.set(providerId, status);\n\t\tthis.externalStatusCredentials.set(providerId, this.credentials.peek(providerId));\n\t}\n\n\tstream<TApi extends Api>(\n\t\tmodel: Model<TApi>,\n\t\tcontext: Context,\n\t\toptions?: ModelsApiStreamOptions<TApi>,\n\t): AssistantMessageEventStream {\n\t\treturn this.streaming.stream(model, context, options);\n\t}\n\n\tcomplete<TApi extends Api>(\n\t\tmodel: Model<TApi>,\n\t\tcontext: Context,\n\t\toptions?: ModelsApiStreamOptions<TApi>,\n\t): Promise<AssistantMessage> {\n\t\treturn this.streaming.complete(model, context, options);\n\t}\n\n\tstreamSimple(\n\t\tmodel: Model<Api>,\n\t\tcontext: Context,\n\t\toptions?: ModelRuntimeSimpleStreamOptions,\n\t): AssistantMessageEventStream {\n\t\treturn this.streaming.streamSimple(model, context, options);\n\t}\n\n\tcompleteSimple(\n\t\tmodel: Model<Api>,\n\t\tcontext: Context,\n\t\toptions?: ModelRuntimeSimpleStreamOptions,\n\t): Promise<AssistantMessage> {\n\t\treturn this.streaming.completeSimple(model, context, options);\n\t}\n\n\tfetchDeferred(\n\t\tmodel: Model<Api>,\n\t\thandle: DeferredHandle,\n\t\toptions?: ModelsDeferredFetchOptions,\n\t): Promise<AssistantMessage> {\n\t\treturn this.streaming.fetchDeferred(model, handle, options);\n\t}\n\n\tcancelDeferred(model: Model<Api>, handle: DeferredHandle, options?: ModelsDeferredCancelOptions): Promise<void> {\n\t\treturn this.streaming.cancelDeferred(model, handle, options);\n\t}\n\n\tprivate operationHeaders(model: AnyModel, headers: ProviderHeaders, env?: Record<string, string>): ProviderHeaders {\n\t\tconst configured = resolveConfiguredModelHeaders(\n\t\t\tmodel,\n\t\t\tthis.config.getProvider(model.provider),\n\t\t\tthis.extensionProviders.get(model.provider),\n\t\t\tenv,\n\t\t);\n\t\treturn mergeHeaders(configured, headers) ?? {};\n\t}\n\n\tgenerateImages(\n\t\tmodel: ImageModel<ImageApi>,\n\t\tcontext: ImagesContext,\n\t\toptions?: ModelsImagesOptions,\n\t): Promise<AssistantImages> {\n\t\treturn this.models.generateImages(model, context, {\n\t\t\t...options,\n\t\t\ttransformHeaders: async (headers) => {\n\t\t\t\tconst prepared = this.operationHeaders(model, headers, options?.env);\n\t\t\t\treturn (await options?.transformHeaders?.(prepared)) ?? prepared;\n\t\t\t},\n\t\t});\n\t}\n\n\tclassify(\n\t\tmodel: ClassifierModel<ClassifierApi>,\n\t\tcontext: ClassifierContext,\n\t\toptions?: ModelsClassifierOptions,\n\t): Promise<ClassifierResult> {\n\t\treturn this.models.classify(model, context, {\n\t\t\t...options,\n\t\t\ttransformHeaders: async (headers) => {\n\t\t\t\tconst prepared = this.operationHeaders(model, headers, options?.env);\n\t\t\t\treturn (await options?.transformHeaders?.(prepared)) ?? prepared;\n\t\t\t},\n\t\t});\n\t}\n\n\tasync login(\n\t\tproviderId: string,\n\t\ttype: AuthType,\n\t\tinteraction: AuthInteraction,\n\t\toptions?: LoginOptions,\n\t): Promise<Credential> {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tconst signal = operationSignal(interaction.signal);\n\t\treturn this.enqueueCredentialOperation(providerId, signal, async () => {\n\t\t\tconst credential = await this.models.login(providerId, type, { ...interaction, signal }, options);\n\t\t\tthis.markCatalogInputsChanged();\n\t\t\tawait this.synchronizeCredentialState(providerId, \"login\", credential, () => {\n\t\t\t\t// Credential acquisition and persistence are the login transaction. Publish\n\t\t\t\t// the provider against the current snapshot immediately; catalog restoration,\n\t\t\t\t// ambient availability checks, and networking belong to /model's bounded\n\t\t\t\t// background refresh and must never keep a successful login dialog open.\n\t\t\t\tthis.updateModelSnapshot();\n\t\t\t\tthis.externalProviderAuthStatuses.delete(providerId);\n\t\t\t\tthis.snapshot = addStoredCredentialProvider(this.snapshot, providerId, credential.type);\n\t\t\t\tthis.recordAvailabilityCredentials([providerId]);\n\t\t\t});\n\t\t\treturn credential;\n\t\t});\n\t}\n\n\tasync logout(providerId: string, options: AuthOperationOptions = {}): Promise<void> {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tconst signal = operationSignal(options.signal);\n\t\tconst logoutGeneration = await this.enqueueCredentialOperation(providerId, signal, async () => {\n\t\t\tawait this.models.logout(providerId, { signal });\n\t\t\tthis.markCatalogInputsChanged();\n\t\t\tlet generation = 0;\n\t\t\tawait this.synchronizeCredentialState(providerId, \"logout\", undefined, () => {\n\t\t\t\t// Reset credential-dependent compatibility projections, then publish the\n\t\t\t\t// persisted deletion without waiting for model stores or remote catalogs.\n\t\t\t\tthis.recomposeProvider(providerId);\n\t\t\t\tthis.updateModelSnapshot();\n\t\t\t\tthis.externalProviderAuthStatuses.delete(providerId);\n\t\t\t\tthis.snapshot = removeStoredCredentialProvider(this.snapshot, providerId);\n\t\t\t\tthis.recordAvailabilityCredentials([providerId]);\n\t\t\t\tgeneration = this.snapshotGeneration;\n\t\t\t});\n\t\t\treturn generation;\n\t\t});\n\t\tawait this.refreshRemainingAuthAfterLogout(providerId, logoutGeneration);\n\t}\n\n\t/**\n\t * The network policy a refresh with an omitted `allowNetwork` resolves to.\n\t *\n\t * Callers that share one in-flight refresh key on the effective policy, so\n\t * they need the same answer `runRefresh` computes rather than a second guess\n\t * at the offline setting this runtime was created under.\n\t */\n\tisNetworkRefreshEnabled(): boolean {\n\t\treturn this.modelNetworkEnabled;\n\t}\n\tasync refresh(options: ModelsRefreshOptions = {}): Promise<ModelsRefreshResult> {\n\t\treturn this.runRefresh(options, ++this.refreshSequence);\n\t}\n\n\t/**\n\t * A registration's offline catalog pass must not publish after a newer refresh\n\t * that resolves configured credentials.\n\t *\n\t * The registration is also a catalog-input change: it adds, replaces, or drops\n\t * a provider every later pass composes from, so no pass that predates it can\n\t * answer for the provider set a caller now sees.\n\t */\n\tprivate scheduleRegistrationRefresh(): void {\n\t\tthis.markCatalogInputsChanged();\n\t\tconst sequence = ++this.refreshSequence;\n\t\tvoid this.runRefresh({ allowNetwork: false }, sequence, true);\n\t}\n\n\tprivate async runRefresh(\n\t\toptions: ModelsRefreshOptions,\n\t\tsequence: number,\n\t\tdiscardIfSuperseded = false,\n\t): Promise<ModelsRefreshResult> {\n\t\tconst config = await ModelConfig.load(this.modelsPath);\n\t\tif (discardIfSuperseded && sequence !== this.refreshSequence) {\n\t\t\treturn { aborted: true, errors: new Map<string, Error>() };\n\t\t}\n\t\tthis.config = config;\n\t\tthis.configureRadiusProviders();\n\t\tif (options.providers) options = { ...options, providers: options.providers.map(normalizeProviderId) };\n\t\tif (options.providers) {\n\t\t\tfor (const providerId of new Set(options.providers)) this.recomposeProvider(providerId);\n\t\t\tthis.updateModelSnapshot();\n\t\t} else this.rebuildProviders();\n\t\tconst refreshOptions = { ...options, allowNetwork: options.allowNetwork ?? this.isNetworkRefreshEnabled() };\n\t\tconst result = await this.models.refresh(refreshOptions);\n\t\tconst errors = new Map(result.errors);\n\t\tthis.updateModelSnapshot();\n\t\tif (options.providers) {\n\t\t\tawait Promise.all(\n\t\t\t\t[...new Set(options.providers)].map(async (providerId) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.refreshProviderAvailability(providerId, operationSignal(options.signal));\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (!options.signal?.aborted)\n\t\t\t\t\t\t\terrors.set(providerId, error instanceof Error ? error : new Error(String(error)));\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tawait this.queueAvailabilityRefresh(options.signal);\n\t\t\t} catch {\n\t\t\t\t// Availability errors are recorded by the latest pass; refreshed models remain usable.\n\t\t\t}\n\t\t}\n\t\treturn { aborted: result.aborted || (options.signal?.aborted ?? false), errors };\n\t}\n\n\tprivate validateAliasRegistration(\n\t\tid: string,\n\t\tconfig: ProviderConfigInput,\n\t\tproviders: ReadonlyMap<string, ProviderConfigInput>,\n\t\tnativeProviders: ReadonlyMap<string, Provider>,\n\t): void {\n\t\tconst source = config.aliasOf;\n\t\tif (source === undefined) return;\n\t\tif (\n\t\t\tthis.builtins.has(id) ||\n\t\t\tnativeProviders.has(id) ||\n\t\t\tthis.config.getProvider(id) ||\n\t\t\t(providers.has(id) && providers.get(id)?.aliasOf === undefined)\n\t\t) {\n\t\t\tthrow new Error(`Provider alias ${id} cannot replace an existing provider.`);\n\t\t}\n\t\tif (providers.get(source)?.aliasOf !== undefined) {\n\t\t\tthrow new Error(\"Provider aliases must refer directly to a source provider, not another alias.\");\n\t\t}\n\t\tif (\n\t\t\t!this.builtins.has(source) &&\n\t\t\t!nativeProviders.has(source) &&\n\t\t\t!providers.has(source) &&\n\t\t\t!this.config.getProvider(source)\n\t\t) {\n\t\t\tthrow new Error(`Provider alias ${id}: source provider ${source} is unavailable.`);\n\t\t}\n\t}\n\n\tcreateExtensionProviderTransaction(replacedProviderIds: Iterable<string> = []): ExtensionProviderTransaction {\n\t\treplacedProviderIds = Array.from(replacedProviderIds, normalizeProviderId);\n\t\tconst nativeProviders = new Map(this.nativeExtensionProviders);\n\t\tconst providers = new Map(this.extensionProviders);\n\t\tfor (const providerId of replacedProviderIds) {\n\t\t\tnativeProviders.delete(providerId);\n\t\t\tproviders.delete(providerId);\n\t\t}\n\t\tconst configuredProviders = new Set(this.snapshot.configuredProviders);\n\t\tfor (const providerId of replacedProviderIds) configuredProviders.delete(providerId);\n\t\treturn {\n\t\t\tregisterNativeProvider: (provider) => {\n\t\t\t\tconst id = normalizeProviderId(provider.id);\n\t\t\t\tif (!id.trim()) throw new Error(\"Provider id must not be empty.\");\n\t\t\t\tproviders.delete(id);\n\t\t\t\tif (this.snapshot.storedProviders.has(id)) configuredProviders.add(id);\n\t\t\t\tnativeProviders.set(id, provider);\n\t\t\t},\n\t\t\tregisterProvider: (providerId, config) => {\n\t\t\t\tproviderId = normalizeProviderId(providerId);\n\t\t\t\tif (config.aliasOf !== undefined) config = { ...config, aliasOf: normalizeProviderId(config.aliasOf) };\n\t\t\t\tvalidateExtensionProvider(\n\t\t\t\t\tproviderId,\n\t\t\t\t\tthis.builtins.get(providerId),\n\t\t\t\t\tthis.config.getProvider(providerId),\n\t\t\t\t\tconfig,\n\t\t\t\t);\n\t\t\t\tthis.validateAliasRegistration(providerId, config, providers, nativeProviders);\n\t\t\t\tnativeProviders.delete(providerId);\n\t\t\t\tconst previous = providers.get(providerId);\n\t\t\t\tconst effective: ProviderConfigInput =\n\t\t\t\t\tconfig.aliasOf !== undefined || previous?.aliasOf !== undefined ? {} : { ...previous };\n\t\t\t\tfor (const [key, value] of Object.entries(config)) {\n\t\t\t\t\tif (value !== undefined) (effective as Record<string, unknown>)[key] = value;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tthis.snapshot.storedProviders.has(providerId) ||\n\t\t\t\t\tconfiguredRequestAuthStatus(this.config.getProvider(providerId), effective)?.configured\n\t\t\t\t) {\n\t\t\t\t\tconfiguredProviders.add(providerId);\n\t\t\t\t} else configuredProviders.delete(providerId);\n\t\t\t\tproviders.set(providerId, effective);\n\t\t\t},\n\t\t\tunregisterProvider: (providerId) => {\n\t\t\t\tproviderId = normalizeProviderId(providerId);\n\t\t\t\tproviders.delete(providerId);\n\t\t\t\tconfiguredProviders.delete(providerId);\n\t\t\t\tnativeProviders.delete(providerId);\n\t\t\t},\n\t\t\thasConfiguredAuth: (providerId) => configuredProviders.has(normalizeProviderId(providerId)),\n\t\t\tcommit: async () => {\n\t\t\t\tconst previous = {\n\t\t\t\t\textensionProviders: new Map(this.extensionProviders),\n\t\t\t\t\tnativeExtensionProviders: new Map(this.nativeExtensionProviders),\n\t\t\t\t\tbuiltins: new Map(this.builtins),\n\t\t\t\t\tconfig: this.config,\n\t\t\t\t\tsnapshot: this.snapshot,\n\t\t\t\t\tcompositionErrors: new Map(this.compositionErrors),\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\tthis.extensionProviders.clear();\n\t\t\t\t\tfor (const [providerId, config] of providers) this.extensionProviders.set(providerId, config);\n\t\t\t\t\tthis.nativeExtensionProviders.clear();\n\t\t\t\t\tfor (const [providerId, provider] of nativeProviders)\n\t\t\t\t\t\tthis.nativeExtensionProviders.set(providerId, provider);\n\t\t\t\t\tthis.rebuildProviders();\n\t\t\t\t\tthis.markCatalogInputsChanged();\n\t\t\t\t\tawait this.runRefresh({ allowNetwork: false }, ++this.refreshSequence, true);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.extensionProviders.clear();\n\t\t\t\t\tfor (const [providerId, config] of previous.extensionProviders)\n\t\t\t\t\t\tthis.extensionProviders.set(providerId, config);\n\t\t\t\t\tthis.nativeExtensionProviders.clear();\n\t\t\t\t\tfor (const [providerId, provider] of previous.nativeExtensionProviders)\n\t\t\t\t\t\tthis.nativeExtensionProviders.set(providerId, provider);\n\t\t\t\t\tthis.builtins.clear();\n\t\t\t\t\tfor (const [providerId, provider] of previous.builtins) this.builtins.set(providerId, provider);\n\t\t\t\t\tthis.config = previous.config;\n\t\t\t\t\tthis.rebuildProviders();\n\t\t\t\t\tthis.snapshot = previous.snapshot;\n\t\t\t\t\tthis.compositionErrors.clear();\n\t\t\t\t\tfor (const [providerId, message] of previous.compositionErrors)\n\t\t\t\t\t\tthis.compositionErrors.set(providerId, message);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n\n\tregisterNativeProvider(provider: Provider): void {\n\t\tconst id = normalizeProviderId(provider.id);\n\t\tif (!id.trim()) throw new Error(\"Provider id must not be empty.\");\n\t\tthis.extensionProviders.delete(id);\n\t\tthis.nativeExtensionProviders.set(id, provider);\n\t\tthis.recomposeProvider(id);\n\t\tthis.updateModelSnapshot();\n\t\tthis.markProvisionallyConfigured(\n\t\t\tid,\n\t\t\tconfiguredRequestAuthStatus(this.config.getProvider(id), undefined),\n\t\t\tprovider.auth?.oauth && !provider.auth.apiKey ? \"oauth\" : \"api_key\",\n\t\t);\n\t\tthis.scheduleRegistrationRefresh();\n\t}\n\n\tregisterProvider(providerId: string, config: ProviderConfigInput): void {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tif (config.aliasOf !== undefined) config = { ...config, aliasOf: normalizeProviderId(config.aliasOf) };\n\t\t// Validate the incoming registration on its own, like the legacy registry:\n\t\t// a broken re-registration must throw without touching the stored config.\n\t\tvalidateExtensionProvider(providerId, this.builtins.get(providerId), this.config.getProvider(providerId), config);\n\t\tthis.validateAliasRegistration(providerId, config, this.extensionProviders, this.nativeExtensionProviders);\n\t\tthis.nativeExtensionProviders.delete(providerId);\n\t\t// Re-registration merges defined values over the previous registration and\n\t\t// preserves undefined ones, matching the legacy ModelRegistry contract.\n\t\tconst previous = this.extensionProviders.get(providerId);\n\t\tconst effective: ProviderConfigInput =\n\t\t\tconfig.aliasOf !== undefined || previous?.aliasOf !== undefined ? {} : { ...previous };\n\t\tfor (const [key, value] of Object.entries(config)) {\n\t\t\tif (value !== undefined) (effective as Record<string, unknown>)[key] = value;\n\t\t}\n\t\tthis.extensionProviders.set(providerId, effective);\n\t\tthis.recomposeProvider(providerId);\n\t\tthis.updateModelSnapshot();\n\t\tthis.markProvisionallyConfigured(\n\t\t\tproviderId,\n\t\t\tconfiguredRequestAuthStatus(this.config.getProvider(providerId), effective),\n\t\t\tthis.models.getProvider(providerId)?.auth.oauth && !this.models.getProvider(providerId)?.auth.apiKey\n\t\t\t\t? \"oauth\"\n\t\t\t\t: \"api_key\",\n\t\t);\n\t\tthis.scheduleRegistrationRefresh();\n\t}\n\n\tprivate markProvisionallyConfigured(\n\t\tproviderId: string,\n\t\tconfiguredStatus: AuthStatus | undefined,\n\t\ttype: AuthType,\n\t): void {\n\t\tif (!this.snapshot.storedProviders.has(providerId) && !configuredStatus?.configured) return;\n\t\tconst configuredProviders = new Set(this.snapshot.configuredProviders).add(providerId);\n\t\tconst auth = new Map(this.snapshot.auth);\n\t\tif (!auth.has(providerId)) auth.set(providerId, { type, source: \"configured provider\" });\n\t\t// Preserve credential-filtered availability for providers already configured.\n\t\tlet available = this.snapshot.available;\n\t\tif (!this.snapshot.configuredProviders.has(providerId)) {\n\t\t\tconst preserved = new Set(available.map(snapshotModelKey));\n\t\t\tavailable = this.snapshot.all.filter(\n\t\t\t\t(model) => model.provider === providerId || preserved.has(snapshotModelKey(model)),\n\t\t\t);\n\t\t}\n\t\tthis.snapshot = { ...this.snapshot, auth, configuredProviders, available };\n\t}\n\n\tunregisterProvider(providerId: string): void {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tthis.extensionProviders.delete(providerId);\n\t\tthis.nativeExtensionProviders.delete(providerId);\n\t\tthis.recomposeProvider(providerId);\n\t\tthis.updateModelSnapshot();\n\t\tthis.scheduleRegistrationRefresh();\n\t}\n}\n"]}
1
+ {"version":3,"file":"model-runtime.js","sourceRoot":"","sources":["../../src/core/model-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAkBN,YAAY,EAKZ,WAAW,EAeX,iBAAiB,EACjB,mBAA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AC;QACjD,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QACnC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACpC,CAAC;CACD","sourcesContent":["import { createHash } from \"node:crypto\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { isDeepStrictEqual } from \"node:util\";\nimport {\n\ttype AnyModel,\n\ttype Api,\n\ttype AssistantImages,\n\ttype AssistantMessage,\n\ttype AssistantMessageEventStream,\n\ttype AuthCheck,\n\ttype AuthInteraction,\n\ttype AuthOperationOptions,\n\ttype AuthResult,\n\ttype AuthType,\n\ttype ClassifierApi,\n\ttype ClassifierContext,\n\ttype ClassifierModel,\n\ttype ClassifierResult,\n\ttype Context,\n\ttype Credential,\n\ttype CredentialInfo,\n\tcreateModels,\n\ttype DeferredHandle,\n\ttype ImageApi,\n\ttype ImageModel,\n\ttype ImagesContext,\n\tisModelType,\n\ttype LoginOptions,\n\ttype Model,\n\ttype Models,\n\ttype ModelsApiStreamOptions,\n\ttype ModelsClassifierOptions,\n\ttype ModelsDeferredCancelOptions,\n\ttype ModelsDeferredFetchOptions,\n\ttype ModelsImagesOptions,\n\ttype ModelsRefreshOptions,\n\ttype ModelsRefreshResult,\n\ttype ModelsStore,\n\ttype ModelType,\n\ttype ModelTypeMap,\n\ttype MutableModels,\n\tnormalizeProvider,\n\tnormalizeProviderId,\n\ttype Provider,\n\ttype ProviderHeaders,\n} from \"@bastani/pi-ai\";\nimport * as builtinProviderCatalog from \"@bastani/pi-ai/providers/all\";\nimport { personalizeOpenRouterCatalog } from \"@bastani/pi-ai/providers/openrouter\";\nimport { getAgentDir } from \"../config.js\";\nimport { operationSignal, raceWithAbortSignal } from \"../utils/abort.js\";\nimport { normalizePath } from \"../utils/paths.ts\";\nimport { AuthStorage as DefaultAuthStorage } from \"./auth-storage.ts\";\nimport { normalizeModelProvider } from \"./azure-provider-compat.js\";\nimport { containsAuthConfig } from \"./credential-screening.ts\";\nimport {\n\tcopilotAdvertisedFastModelIds,\n\tcopilotAdvertisesModelId,\n\tFAST_MODEL_ID_SUFFIX,\n\ttype FastModelVariantDiagnostic,\n\tisGitHubCopilotModel,\n\twithFastModelVariants,\n} from \"./fast-model-variants.ts\";\nimport { ModelConfig } from \"./model-config.ts\";\nimport { POST_LOGOUT_AUTH_CHECK_TIMEOUT_MS } from \"./model-refresh-timeout.ts\";\nimport {\n\taddRuntimeApiKeyProvider,\n\taddStoredCredentialProvider,\n\tcreateEmptyModelRuntimeSnapshot,\n\tcreateModelRuntimeSnapshot,\n\tgetSnapshotProviderAuthStatus,\n\ttype ModelRuntimeSnapshot,\n\tremoveStoredCredentialProvider,\n\treplaceStoredCredentialProviders,\n\tsnapshotModelKey,\n\tupdateSnapshotModels,\n} from \"./model-runtime-snapshot.ts\";\nimport { FileModelsStore, InMemoryCodingAgentModelsStore } from \"./models-store.ts\";\nimport { collectOAuthProviderMetadata } from \"./oauth-provider-metadata.ts\";\nimport { isOfflineModeEnabled } from \"./package-manager-env.ts\";\nimport { createProviderAlias } from \"./provider-alias.js\";\nimport {\n\ttype AuthStatus,\n\ttype CompatibilityRequestConfig,\n\tcomposeModelProvider,\n\tconfiguredRequestAuthStatus,\n\ttype ProviderConfigInput,\n\tresolveCompatibilityRequestConfig,\n\tresolveConfiguredModelHeaders,\n\tvalidateExtensionProvider,\n} from \"./provider-composer.ts\";\nimport { withPersonalizedCatalog, withRemoteCatalog } from \"./remote-catalog-provider.ts\";\nimport { RuntimeCredentials } from \"./runtime-credentials.ts\";\n\nexport type { CreateModelRuntimeOptions, ModelRuntimeAuthOverrides } from \"./model-runtime-types.ts\";\n\nimport { mergeConfiguredAuthHeaders } from \"./model-runtime-auth.ts\";\nimport { configureBuiltinProviders } from \"./model-runtime-providers.ts\";\nimport { canRestoreUnknownModel as canRestoreUnknownModelProvider } from \"./model-runtime-restoration.ts\";\nimport {\n\ttype ModelRuntimeSimpleStreamOptions,\n\tModelRuntimeStreaming,\n\tmergeHeaders,\n} from \"./model-runtime-streaming.ts\";\nimport type { CreateModelRuntimeOptions, ModelRuntimeAuthOverrides } from \"./model-runtime-types.ts\";\n\nexport type CredentialSynchronizationOperation =\n\t| \"login\"\n\t| \"logout\"\n\t| \"saveCredential\"\n\t| \"setRuntimeApiKey\"\n\t| \"removeRuntimeApiKey\";\n\nfunction availabilityCredentialInputs(credential: Credential | undefined) {\n\tif (credential?.type !== \"oauth\") return credential;\n\tconst { access: _access, refresh: _refresh, expires: _expires, ...inputs } = credential;\n\treturn inputs;\n}\n\n/** Credentials changed successfully, but local model state could not be synchronized. */\nexport class CredentialSynchronizationError extends Error {\n\treadonly providerId: string;\n\treadonly operation: CredentialSynchronizationOperation;\n\treadonly credential: Credential | undefined;\n\n\tconstructor(\n\t\tproviderId: string,\n\t\toperation: CredentialSynchronizationOperation,\n\t\tcredential: Credential | undefined,\n\t\toptions: ErrorOptions,\n\t) {\n\t\tsuper(`Credential ${operation} committed for ${providerId}, but local synchronization failed`, options);\n\t\tthis.name = \"CredentialSynchronizationError\";\n\t\tthis.providerId = providerId;\n\t\tthis.operation = operation;\n\t\t// One call rather than assign-then-redefine: the two-step form is\n\t\t// equivalent (defineProperty with only `enumerable` preserves the existing\n\t\t// value) but reads as a redundant write and trips static analysis. The\n\t\t// non-enumerable descriptor is the load-bearing part — it keeps the\n\t\t// credential out of JSON.stringify, console.log, and structured error\n\t\t// reporting.\n\t\tObject.defineProperty(this, \"credential\", {\n\t\t\tvalue: credential,\n\t\t\tenumerable: false,\n\t\t\twritable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\t}\n}\nexport interface ExtensionProviderTransaction {\n\tregisterNativeProvider(provider: Provider): void;\n\tregisterProvider(providerId: string, config: ProviderConfigInput): void;\n\tunregisterProvider(providerId: string): void;\n\thasConfiguredAuth(providerId: string): boolean;\n\tcommit(): Promise<void>;\n}\n\nexport interface SaveCredentialOptions {\n\t/** Fetch the remote catalog before publishing the credential. Defaults to true. */\n\trefreshCatalog?: boolean;\n}\n\n/** Configured pi-ai Models collection used by coding-agent and SDK consumers. */\nexport class ModelRuntime implements Models {\n\tprivate readonly models: MutableModels;\n\tprivate readonly credentials: RuntimeCredentials;\n\tprivate readonly streaming: ModelRuntimeStreaming;\n\tprivate readonly defaultBuiltins: ReadonlyMap<string, Provider>;\n\tprivate readonly builtins = new Map<string, Provider>();\n\tprivate readonly nativeExtensionProviders = new Map<string, Provider>();\n\tprivate readonly extensionProviders = new Map<string, ProviderConfigInput>();\n\tprivate readonly compositionErrors = new Map<string, string>();\n\tprivate readonly fastModelVariantDiagnostics = new Map<string, readonly FastModelVariantDiagnostic[]>();\n\tprivate readonly modelsPath: string | undefined;\n\tprivate readonly modelNetworkEnabled: boolean;\n\tprivate config: ModelConfig;\n\tprivate snapshot: ModelRuntimeSnapshot = createEmptyModelRuntimeSnapshot();\n\tprivate snapshotGeneration = 0;\n\tprivate catalogInputsGeneration = 0;\n\tprivate observedModelsFileToken: string | undefined;\n\tprivate readonly externalProviderAuthStatuses = new Map<string, AuthStatus>();\n\tprivate readonly externalStatusCredentials = new Map<string, Credential | undefined>();\n\tprivate readonly availabilityCredentials = new Map<string, Credential | undefined>();\n\tprivate availabilityRefreshSeq = 0;\n\tprivate availabilityErrorSeq = 0;\n\tprivate readonly providerAvailabilitySeq = new Map<string, number>();\n\tprivate readonly credentialOperations = new Map<string, Promise<unknown>>();\n\tprivate availabilityError: string | undefined;\n\tprivate refreshSequence = 0;\n\tprivate constructor(\n\t\tcredentials: RuntimeCredentials,\n\t\tconfig: ModelConfig,\n\t\tmodelsPath: string | undefined,\n\t\tmodelsStore: ModelsStore,\n\t\tproviders: readonly Provider[],\n\t\tmodelNetworkEnabled: boolean,\n\t) {\n\t\tthis.credentials = credentials;\n\t\tthis.config = config;\n\t\tthis.modelsPath = modelsPath;\n\t\tthis.modelNetworkEnabled = modelNetworkEnabled;\n\t\tthis.defaultBuiltins = new Map(providers.map((provider) => [provider.id, provider]));\n\t\tfor (const [providerId, provider] of this.defaultBuiltins) this.builtins.set(providerId, provider);\n\t\tthis.models = createModels({ credentials, modelsStore });\n\t\tthis.streaming = new ModelRuntimeStreaming(\n\t\t\tthis.models,\n\t\t\t(model, overrides) => this.getRequestAuth(model, overrides),\n\t\t\t(model) => this.ownsExtensionTransport(model),\n\t\t\t(model) => {\n\t\t\t\tconst source = this.extensionProviders.get(model.provider)?.aliasOf;\n\t\t\t\treturn source ? { ...model, provider: source } : model;\n\t\t\t},\n\t\t\t() => this.credentials.reload(),\n\t\t);\n\t\tthis.rebuildProviders();\n\t}\n\tstatic async create(options: CreateModelRuntimeOptions = {}): Promise<ModelRuntime> {\n\t\tconst credentials = new RuntimeCredentials(options.credentials ?? DefaultAuthStorage.create(options.authPath));\n\t\tconst modelsPath =\n\t\t\toptions.modelsPath === null ? undefined : (options.modelsPath ?? join(getAgentDir(), \"models.json\"));\n\t\tconst config = await ModelConfig.load(modelsPath);\n\t\tconst modelsStore =\n\t\t\toptions.modelsStore ??\n\t\t\t(modelsPath\n\t\t\t\t? new FileModelsStore(options.modelsStorePath ?? join(dirname(modelsPath), \"models-store.json\"))\n\t\t\t\t: new InMemoryCodingAgentModelsStore());\n\t\tconst builtinModelDataGeneratedAt = builtinProviderCatalog.getBuiltinModelDataGeneratedAt();\n\t\tconst providers = builtinProviderCatalog.builtinProviders().map((provider) => {\n\t\t\tif (provider.id === \"radius\") return provider;\n\t\t\t// OpenRouter narrows the catalog to the models, limits and prices of the user's key.\n\t\t\tif (provider.id === \"openrouter\") {\n\t\t\t\treturn withPersonalizedCatalog(\n\t\t\t\t\tprovider,\n\t\t\t\t\tpersonalizeOpenRouterCatalog,\n\t\t\t\t\toptions.catalogBaseUrl,\n\t\t\t\t\tbuiltinModelDataGeneratedAt,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn withRemoteCatalog(provider, options.catalogBaseUrl, builtinModelDataGeneratedAt);\n\t\t});\n\t\tconst runtime = new ModelRuntime(\n\t\t\tcredentials,\n\t\t\tconfig,\n\t\t\tmodelsPath,\n\t\t\tmodelsStore,\n\t\t\tproviders,\n\t\t\t!isOfflineModeEnabled(),\n\t\t);\n\t\truntime.configureRadiusProviders();\n\t\truntime.rebuildProviders();\n\t\tconst refreshFromNetwork = runtime.modelNetworkEnabled && options.allowModelNetwork === true;\n\t\tconst controller = refreshFromNetwork ? new AbortController() : undefined;\n\t\tconst timeout = controller\n\t\t\t? setTimeout(() => controller.abort(), options.modelRefreshTimeoutMs ?? 15_000)\n\t\t\t: undefined;\n\t\ttry {\n\t\t\tif (options.refreshOnCreate !== false) {\n\t\t\t\tawait runtime.refresh({ allowNetwork: refreshFromNetwork, signal: controller?.signal });\n\t\t\t}\n\t\t} finally {\n\t\t\tif (timeout) clearTimeout(timeout);\n\t\t}\n\t\treturn runtime;\n\t}\n\tprivate configureRadiusProviders(): void {\n\t\tconfigureBuiltinProviders(this.builtins, this.defaultBuiltins, this.config, process.env, (providerId) =>\n\t\t\tthis.credentials.peek(providerId),\n\t\t);\n\t}\n\tprivate providerIds(): Set<string> {\n\t\treturn new Set([\n\t\t\t...this.builtins.keys(),\n\t\t\t...this.nativeExtensionProviders.keys(),\n\t\t\t...this.config.getProviderIds(),\n\t\t\t...this.extensionProviders.keys(),\n\t\t]);\n\t}\n\n\t/** Privacy boundary: no request auth resolution, credential commands, or OAuth refresh. */\n\tasync containsConfiguredCredential(serialized: string): Promise<boolean> {\n\t\tif (await this.credentials.containsConfiguredCredential(serialized)) return true;\n\t\tfor (const providerId of this.providerIds()) {\n\t\t\tif (\n\t\t\t\tcontainsAuthConfig(serialized, this.config.getProvider(providerId)) ||\n\t\t\t\tcontainsAuthConfig(serialized, this.extensionProviders.get(providerId))\n\t\t\t)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\t/**\n\t * Overlay derived selectable `-fast` model variants. Applied last so exact `-fast` IDs owned by the\n\t * provider, models.json, or an extension are already present and win the collision.\n\t */\n\tprivate withDerivedFastModels(provider: Provider): Provider {\n\t\treturn withFastModelVariants(provider, {\n\t\t\tgetCopilotFastModelIds: () => copilotAdvertisedFastModelIds(this.credentials.peek(\"github-copilot\")),\n\t\t\tgetModelOverrides: () => this.config.getProvider(provider.id)?.modelOverrides,\n\t\t\tgetCustomModelIds: () => new Set(this.config.getProvider(provider.id)?.models?.map((model) => model.id)),\n\t\t\tgetExtensionOwnedApis: () => {\n\t\t\t\tconst ownedApis = new Set<Api>();\n\t\t\t\tconst extension = this.extensionProviders.get(provider.id);\n\t\t\t\tif (extension?.streamSimple !== undefined && extension.api) ownedApis.add(extension.api);\n\t\t\t\tconst native = this.nativeExtensionProviders.get(provider.id);\n\t\t\t\tif (native?.stream !== undefined || native?.streamSimple !== undefined) {\n\t\t\t\t\tfor (const model of native.getModels()) ownedApis.add(model.api);\n\t\t\t\t}\n\t\t\t\treturn ownedApis.size > 0 ? ownedApis : undefined;\n\t\t\t},\n\t\t\tonDiagnostics: (id, diagnostics) => {\n\t\t\t\tif (diagnostics.length === 0) this.fastModelVariantDiagnostics.delete(id);\n\t\t\t\telse this.fastModelVariantDiagnostics.set(id, diagnostics);\n\t\t\t},\n\t\t});\n\t}\n\t/**\n\t * Publish a provider through the fast-variant overlay. Every catalog accessor — `getProvider`,\n\t * `getProviders`, `getModel`, `getModels`, `getAvailable` — then reports the same list. The overlay\n\t * is `{ ...provider, getModels }`, so `auth`, `login`, `stream`, and `streamSimple` stay the same\n\t * function references the caller registered.\n\t */\n\tprivate publishProvider(provider: Provider): void {\n\t\tthis.models.setProvider(this.withDerivedFastModels(provider));\n\t}\n\tprivate recomposeProvider(providerId: string): void {\n\t\tthis.composeProvider(providerId);\n\t\tfor (const [id, config] of this.extensionProviders) {\n\t\t\tif (config.aliasOf === providerId) this.composeProvider(id);\n\t\t}\n\t}\n\tprivate composeProvider(providerId: string): void {\n\t\tconst native = this.nativeExtensionProviders.get(providerId);\n\t\tconst base = native ? normalizeProvider(native) : this.builtins.get(providerId);\n\t\tconst extension = this.extensionProviders.get(providerId);\n\t\tif (extension?.aliasOf !== undefined) {\n\t\t\ttry {\n\t\t\t\tif (this.config.getProvider(providerId)) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Provider alias ${providerId}: configure models.json on source ${extension.aliasOf}, not the alias.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst sourceId = extension.aliasOf;\n\t\t\t\tthis.publishProvider(\n\t\t\t\t\tcreateProviderAlias({ id: providerId, name: extension.name, provider: sourceId }, () => {\n\t\t\t\t\t\tif (this.extensionProviders.get(sourceId)?.aliasOf !== undefined) {\n\t\t\t\t\t\t\tthrow new Error(\"Provider aliases must refer directly to a source provider, not another alias.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst source = this.models.getProvider(sourceId);\n\t\t\t\t\t\tif (!source)\n\t\t\t\t\t\t\tthrow new Error(`Provider alias ${providerId}: source provider ${sourceId} is unavailable.`);\n\t\t\t\t\t\treturn source;\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tthis.compositionErrors.delete(providerId);\n\t\t\t} catch (error) {\n\t\t\t\tthis.compositionErrors.set(providerId, error instanceof Error ? error.message : String(error));\n\t\t\t\tthis.models.deleteProvider(providerId);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (!base && !this.config.getProvider(providerId) && !extension) {\n\t\t\tthis.models.deleteProvider(providerId);\n\t\t\tthis.compositionErrors.delete(providerId);\n\t\t\tthis.fastModelVariantDiagnostics.delete(providerId);\n\t\t\treturn;\n\t\t}\n\t\tif (base && !this.config.getProvider(providerId) && !extension) {\n\t\t\t// No overlays: keep the builtin's auth/login/stream behavior exact and only add fast variants.\n\t\t\tthis.publishProvider(base);\n\t\t\tthis.compositionErrors.delete(providerId);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tthis.publishProvider(composeModelProvider(providerId, base, this.config, extension));\n\t\t\tthis.compositionErrors.delete(providerId);\n\t\t} catch (error) {\n\t\t\tthis.compositionErrors.set(providerId, error instanceof Error ? error.message : String(error));\n\t\t\tif (base) this.publishProvider(base);\n\t\t\telse this.models.deleteProvider(providerId);\n\t\t}\n\t}\n\tprivate rebuildProviders(): void {\n\t\tthis.models.clearProviders();\n\t\tthis.compositionErrors.clear();\n\t\tthis.fastModelVariantDiagnostics.clear();\n\t\tconst ids = [...this.providerIds()];\n\t\tfor (const providerId of ids.filter((id) => this.extensionProviders.get(id)?.aliasOf === undefined)) {\n\t\t\tthis.recomposeProvider(providerId);\n\t\t}\n\t\tfor (const providerId of ids.filter((id) => this.extensionProviders.get(id)?.aliasOf !== undefined)) {\n\t\t\tthis.recomposeProvider(providerId);\n\t\t}\n\t\tthis.updateModelSnapshot();\n\t}\n\tprivate updateModelSnapshot(): void {\n\t\tthis.snapshotGeneration += 1;\n\t\tthis.snapshot = updateSnapshotModels(this.snapshot, [...this.models.getModels()]);\n\t}\n\tprivate async runAvailabilityRefresh(seq: number, errorSeq: number, signal: AbortSignal): Promise<boolean> {\n\t\tconst inputsGeneration = this.catalogInputsGeneration;\n\t\tconst providers = this.models.getProviders();\n\t\tconst [available, checks, credentials] = await Promise.all([\n\t\t\tthis.models.getAvailable(undefined, { signal }),\n\t\t\tPromise.all(\n\t\t\t\tproviders.map(\n\t\t\t\t\tasync (provider): Promise<[string, AuthCheck | undefined]> => [\n\t\t\t\t\t\tprovider.id,\n\t\t\t\t\t\tawait this.models.checkAuth(provider.id, { signal }),\n\t\t\t\t\t],\n\t\t\t\t),\n\t\t\t),\n\t\t\tthis.credentials.list({ signal }),\n\t\t]);\n\t\tif (seq !== this.availabilityRefreshSeq || inputsGeneration !== this.catalogInputsGeneration) return false;\n\t\tthis.snapshot = createModelRuntimeSnapshot([...this.models.getModels()], [...available], checks, credentials);\n\t\tthis.availabilityCredentials.clear();\n\t\tthis.recordAvailabilityCredentials([...this.snapshot.auth.keys(), ...this.snapshot.storedProviders]);\n\t\tif (errorSeq === this.availabilityErrorSeq) this.availabilityError = undefined;\n\t\treturn true;\n\t}\n\tprivate queueAvailabilityRefresh(signal?: AbortSignal): Promise<boolean> {\n\t\tconst seq = ++this.availabilityRefreshSeq;\n\t\tfor (const [providerId, providerSeq] of this.providerAvailabilitySeq)\n\t\t\tthis.providerAvailabilitySeq.set(providerId, providerSeq + 1);\n\t\tconst errorSeq = ++this.availabilityErrorSeq;\n\t\tconst effectiveSignal = operationSignal(signal);\n\t\treturn this.runAvailabilityRefresh(seq, errorSeq, effectiveSignal).catch((error) => {\n\t\t\tif (errorSeq === this.availabilityErrorSeq && !effectiveSignal.aborted)\n\t\t\t\tthis.availabilityError = error instanceof Error ? error.message : String(error);\n\t\t\tthrow error;\n\t\t});\n\t}\n\tprivate async refreshProviderAvailability(providerId: string, signal: AbortSignal): Promise<void> {\n\t\tconst inputsGeneration = this.catalogInputsGeneration;\n\t\t++this.availabilityRefreshSeq;\n\t\tconst providerSeq = (this.providerAvailabilitySeq.get(providerId) ?? 0) + 1;\n\t\tthis.providerAvailabilitySeq.set(providerId, providerSeq);\n\t\tconst errorSeq = ++this.availabilityErrorSeq;\n\t\ttry {\n\t\t\tconst [available, auth, credential] = await Promise.all([\n\t\t\t\tthis.models.getAvailable(providerId, { signal }),\n\t\t\t\tthis.models.checkAuth(providerId, { signal }),\n\t\t\t\tthis.credentials.read(providerId, { signal }),\n\t\t\t]);\n\t\t\tsignal.throwIfAborted();\n\t\t\tif (\n\t\t\t\tthis.providerAvailabilitySeq.get(providerId) !== providerSeq ||\n\t\t\t\tinputsGeneration !== this.catalogInputsGeneration\n\t\t\t)\n\t\t\t\treturn;\n\t\t\tconst configuredProviders = new Set(this.snapshot.configuredProviders),\n\t\t\t\tstoredProviders = new Set(this.snapshot.storedProviders),\n\t\t\t\tstoredCredentialTypes = new Map(this.snapshot.storedCredentialTypes),\n\t\t\t\tauthByProvider = new Map(this.snapshot.auth);\n\t\t\tif (auth) {\n\t\t\t\tconfiguredProviders.add(providerId);\n\t\t\t\tauthByProvider.set(providerId, auth);\n\t\t\t} else {\n\t\t\t\tconfiguredProviders.delete(providerId);\n\t\t\t\tauthByProvider.delete(providerId);\n\t\t\t}\n\t\t\tif (credential) {\n\t\t\t\tstoredProviders.add(providerId);\n\t\t\t\tstoredCredentialTypes.set(providerId, credential.type);\n\t\t\t} else {\n\t\t\t\tstoredProviders.delete(providerId);\n\t\t\t\tstoredCredentialTypes.delete(providerId);\n\t\t\t}\n\t\t\tconst all = [...this.models.getModels()];\n\t\t\tconst availableById = new Map(\n\t\t\t\t[...this.snapshot.available.filter((model) => model.provider !== providerId), ...available].map((model) => [\n\t\t\t\t\t`${model.provider}\\0${model.id}`,\n\t\t\t\t\tmodel,\n\t\t\t\t]),\n\t\t\t);\n\t\t\tthis.recordAvailabilityCredentials([providerId]);\n\t\t\tthis.snapshot = {\n\t\t\t\tall,\n\t\t\t\tavailable: all.flatMap((model) => availableById.get(`${model.provider}\\0${model.id}`) ?? []),\n\t\t\t\tconfiguredProviders,\n\t\t\t\tstoredProviders,\n\t\t\t\tstoredCredentialTypes,\n\t\t\t\tauth: authByProvider,\n\t\t\t};\n\t\t\tif (errorSeq === this.availabilityErrorSeq) this.availabilityError = undefined;\n\t\t} catch (error) {\n\t\t\tif (\n\t\t\t\tthis.providerAvailabilitySeq.get(providerId) === providerSeq &&\n\t\t\t\terrorSeq === this.availabilityErrorSeq &&\n\t\t\t\t!signal.aborted\n\t\t\t)\n\t\t\t\tthis.availabilityError = error instanceof Error ? error.message : String(error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tgetProviders(): readonly Provider[] {\n\t\treturn this.models.getProviders();\n\t}\n\tgetProvider(providerId: string): Provider | undefined {\n\t\treturn this.models.getProvider(normalizeProviderId(providerId));\n\t}\n\t/**\n\t * Whether an authenticated provider may reconstruct an absent saved model ID.\n\t *\n\t * Pass `modelId` whenever it is known. GitHub Copilot advertises every model it offers per account,\n\t * so a `-fast` ID that appears in neither the picker list nor the fast-sibling list is definitively\n\t * not restorable. An ID advertised as a fast sibling also requires its corresponding base model in\n\t * the catalog; otherwise reconstruction would invent a route-less fast identity. An ID advertised\n\t * as an ordinary model stays ordinary whatever its name ends in. Every other provider keeps the\n\t * provider-scoped answer, so a provider-owned model whose upstream name merely ends in `-fast`\n\t * (several exist under `vercel-ai-gateway`) still restores.\n\t */\n\tcanRestoreUnknownModel(providerId: string, modelId?: string): boolean {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tif (\n\t\t\tmodelId !== undefined &&\n\t\t\tisGitHubCopilotModel({ provider: providerId }) &&\n\t\t\tmodelId.endsWith(FAST_MODEL_ID_SUFFIX)\n\t\t) {\n\t\t\tconst credential = this.credentials.peek(providerId);\n\t\t\tif (!copilotAdvertisesModelId(credential, modelId)) return false;\n\t\t\tif (copilotAdvertisedFastModelIds(credential)?.includes(modelId) === true) {\n\t\t\t\tconst baseModelId = modelId.slice(0, -FAST_MODEL_ID_SUFFIX.length);\n\t\t\t\tif (!this.models.getModel(providerId, baseModelId)) return false;\n\t\t\t}\n\t\t}\n\t\treturn canRestoreUnknownModelProvider(\n\t\t\tproviderId,\n\t\t\tthis.defaultBuiltins.get(providerId),\n\t\t\tthis.config.getProvider(providerId),\n\t\t\tthis.extensionProviders.get(providerId),\n\t\t\tthis.nativeExtensionProviders.get(providerId),\n\t\t);\n\t}\n\tprivate resolveModelMetadata(model: Model<Api>): Model<Api> {\n\t\tconst credential = this.credentials.peek(model.provider);\n\t\tif (credential !== undefined || this.credentials.hasCredentialSnapshot()) {\n\t\t\tconst provider = this.models.getProvider(model.provider);\n\t\t\treturn provider?.filterModels?.([model], credential).find((candidate) => candidate.id === model.id) ?? model;\n\t\t}\n\t\treturn (\n\t\t\tthis.snapshot.available.find(\n\t\t\t\t(candidate) => candidate.provider === model.provider && candidate.id === model.id,\n\t\t\t) ?? model\n\t\t);\n\t}\n\tgetModels(providerId?: string): readonly Model<Api>[] {\n\t\treturn this.models.getModels(providerId).map((model) => this.resolveModelMetadata(model));\n\t}\n\tgetModel(providerId: string, modelId: string): Model<Api> | undefined {\n\t\tconst model = this.models.getModel(normalizeProviderId(providerId), modelId);\n\t\treturn model ? this.resolveModelMetadata(model) : undefined;\n\t}\n\tprivate resolveCatalogMetadata<TModel extends AnyModel>(model: TModel): TModel {\n\t\treturn isModelType(model, \"chat\") ? { ...model, ...this.resolveModelMetadata(model) } : model;\n\t}\n\tgetModelsOfType<TType extends ModelType>(type: TType, providerId?: string): readonly ModelTypeMap[TType][] {\n\t\treturn this.models.getModelsOfType(type, providerId).map((model) => this.resolveCatalogMetadata(model));\n\t}\n\tgetModelOfType<TType extends ModelType>(\n\t\ttype: TType,\n\t\tproviderId: string,\n\t\tmodelId: string,\n\t): ModelTypeMap[TType] | undefined {\n\t\tconst model = this.models.getModelOfType(type, normalizeProviderId(providerId), modelId);\n\t\treturn model ? this.resolveCatalogMetadata(model) : undefined;\n\t}\n\tgetAllModels(providerId?: string): readonly AnyModel[] {\n\t\treturn this.models.getAllModels(providerId).map((model) => this.resolveCatalogMetadata(model));\n\t}\n\tgetAvailableOfType<TType extends ModelType>(\n\t\ttype: TType,\n\t\tproviderId?: string,\n\t\toptions?: AuthOperationOptions,\n\t): Promise<readonly ModelTypeMap[TType][]> {\n\t\treturn this.models.getAvailableOfType(type, providerId, options);\n\t}\n\tgetAllAvailable(providerId?: string, options?: AuthOperationOptions): Promise<readonly AnyModel[]> {\n\t\treturn this.models.getAllAvailable(providerId, options);\n\t}\n\n\tasync checkAuth(providerId: string, options?: AuthOperationOptions): Promise<AuthCheck | undefined> {\n\t\treturn this.models.checkAuth(providerId, options);\n\t}\n\tasync getAvailable(providerId?: string, options?: AuthOperationOptions): Promise<readonly Model<Api>[]> {\n\t\tif (providerId) {\n\t\t\tconst errorSeq = ++this.availabilityErrorSeq;\n\t\t\ttry {\n\t\t\t\tconst available = await this.models.getAvailable(providerId, options);\n\t\t\t\tif (errorSeq === this.availabilityErrorSeq) this.availabilityError = undefined;\n\t\t\t\treturn available;\n\t\t\t} catch (error) {\n\t\t\t\tif (errorSeq === this.availabilityErrorSeq && !options?.signal?.aborted)\n\t\t\t\t\tthis.availabilityError = error instanceof Error ? error.message : String(error);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t\tfor (let attempt = 0; attempt < 3 && !(await this.queueAvailabilityRefresh(options?.signal)); attempt++);\n\t\treturn this.snapshot.available;\n\t}\n\tgetAvailableSnapshot(): readonly Model<Api>[] {\n\t\treturn this.snapshot.available;\n\t}\n\tgetError(): string | undefined {\n\t\tconst errors: string[] = [];\n\t\tconst configError = this.config.getError();\n\t\tif (configError) errors.push(configError);\n\t\tfor (const [providerId, error] of this.compositionErrors) {\n\t\t\terrors.push(`Provider \"${providerId}\": ${error}`);\n\t\t}\n\t\tif (this.availabilityError) errors.push(`Availability refresh: ${this.availabilityError}`);\n\t\treturn errors.length > 0 ? errors.join(\"\\n\\n\") : undefined;\n\t}\n\n\t/**\n\t * Derived fast model variants that were suppressed because a provider, models.json custom model, or\n\t * extension already owns the exact `-fast` model ID. Reported as warnings, not composition errors.\n\t */\n\tgetFastModelVariantDiagnostics(): readonly FastModelVariantDiagnostic[] {\n\t\treturn [...this.fastModelVariantDiagnostics.values()].flat();\n\t}\n\n\t/** Non-fatal catalog warnings, joined for display. */\n\tgetWarning(): string | undefined {\n\t\tconst warnings = this.getFastModelVariantDiagnostics().map((diagnostic) => diagnostic.message);\n\t\treturn warnings.length > 0 ? warnings.join(\"\\n\\n\") : undefined;\n\t}\n\n\tgetRegisteredProviderConfig(providerId: string): ProviderConfigInput | undefined {\n\t\treturn this.extensionProviders.get(normalizeProviderId(providerId));\n\t}\n\n\t/**\n\t * Whether an extension supplies the stream function for this model's api. Such a transport owns its\n\t * own serialization, so Atomic must not attach first-party provider routing to it. This mirrors the\n\t * `usesExtensionStream` check the agent session makes before dispatching.\n\t */\n\tprivate ownsExtensionTransport(model: Model<Api>): boolean {\n\t\tconst extension = this.extensionProviders.get(model.provider);\n\t\treturn extension?.streamSimple !== undefined && model.api === extension.api;\n\t}\n\n\tgetRegisteredProviderIds(): readonly string[] {\n\t\treturn [...new Set([...this.extensionProviders.keys(), ...this.nativeExtensionProviders.keys()])];\n\t}\n\n\tgetRegisteredNativeProvider(providerId: string): Provider | undefined {\n\t\treturn this.nativeExtensionProviders.get(normalizeProviderId(providerId));\n\t}\n\tgetOAuthProviderMetadata() {\n\t\treturn collectOAuthProviderMetadata(this.getProviders(), this.extensionProviders);\n\t}\n\t/** Providers that offer API-key login in `/login`. */\n\tgetApiKeyLoginProviderMetadata(): Array<{ id: string; name: string }> {\n\t\treturn this.getProviders()\n\t\t\t.filter((provider) => provider.auth.apiKey?.login !== undefined)\n\t\t\t.map((provider) => ({ id: provider.id, name: provider.name ?? provider.id }));\n\t}\n\t/** @internal Compatibility fallback for ModelRegistry when provider auth is unconfigured. */\n\tgetCompatibilityRequestConfig(model: Model<Api>): CompatibilityRequestConfig {\n\t\tmodel = normalizeModelProvider(model);\n\t\treturn resolveCompatibilityRequestConfig(\n\t\t\tmodel,\n\t\t\tthis.config.getProvider(model.provider),\n\t\t\tthis.extensionProviders.get(model.provider),\n\t\t);\n\t}\n\n\tisUsingOAuth(providerId: string): boolean {\n\t\tthis.syncStoredCredentialChanges();\n\t\treturn this.snapshot.auth.get(normalizeProviderId(providerId))?.type === \"oauth\";\n\t}\n\n\thasConfiguredAuth(providerId: string): boolean {\n\t\tthis.syncStoredCredentialChanges();\n\t\treturn this.snapshot.configuredProviders.has(normalizeProviderId(providerId));\n\t}\n\n\tprivate syncStoredCredentialChanges(): void {\n\t\tif (!this.credentials.hasCredentialSnapshot()) return;\n\t\tthis.credentials.reloadIfChanged();\n\t\tconst providerIds = new Set([\n\t\t\t...this.models.getProviders().map((provider) => provider.id),\n\t\t\t...this.snapshot.storedProviders,\n\t\t]);\n\t\tlet snapshot = this.snapshot;\n\t\tconst changedProviderIds = new Set<string>();\n\t\tconst removedProviderIds: string[] = [];\n\t\tfor (const providerId of providerIds) {\n\t\t\tif (this.credentials.hasRuntimeApiKey(providerId)) continue;\n\t\t\tconst credential = this.credentials.peek(providerId);\n\t\t\tconst type = credential?.type;\n\t\t\tif (\n\t\t\t\ttype === snapshot.storedCredentialTypes.get(providerId) &&\n\t\t\t\t!this.availabilityCredentialChanged(providerId, credential)\n\t\t\t)\n\t\t\t\tcontinue;\n\t\t\tif (\n\t\t\t\tthis.externalProviderAuthStatuses.has(providerId) &&\n\t\t\t\tisDeepStrictEqual(credential, this.externalStatusCredentials.get(providerId))\n\t\t\t)\n\t\t\t\tcontinue;\n\t\t\tthis.externalProviderAuthStatuses.delete(providerId);\n\t\t\tthis.externalStatusCredentials.delete(providerId);\n\t\t\tchangedProviderIds.add(providerId);\n\t\t\tif (type) {\n\t\t\t\tsnapshot = addStoredCredentialProvider(snapshot, providerId, type);\n\t\t\t} else {\n\t\t\t\tsnapshot = removeStoredCredentialProvider(snapshot, providerId);\n\t\t\t\tremovedProviderIds.push(providerId);\n\t\t\t}\n\t\t}\n\t\tif (changedProviderIds.size === 0) return;\n\t\tthis.markCatalogInputsChanged();\n\t\tthis.snapshotGeneration += 1;\n\t\tthis.snapshot = this.withCredentialAvailability(this.snapshot, snapshot, changedProviderIds);\n\t\tfor (const providerId of removedProviderIds) {\n\t\t\tvoid this.refreshRemainingAuthAfterLogout(providerId, this.snapshotGeneration);\n\t\t}\n\t}\n\n\tprivate availabilityCredentialChanged(providerId: string, credential: Credential | undefined): boolean {\n\t\tif (!this.availabilityCredentials.has(providerId)) {\n\t\t\tthis.availabilityCredentials.set(providerId, credential);\n\t\t\treturn false;\n\t\t}\n\t\tconst published = this.availabilityCredentials.get(providerId);\n\t\tif (credential === published) return false;\n\t\tif (!isDeepStrictEqual(availabilityCredentialInputs(credential), availabilityCredentialInputs(published)))\n\t\t\treturn true;\n\t\tthis.availabilityCredentials.set(providerId, credential);\n\t\treturn false;\n\t}\n\n\tprivate recordAvailabilityCredentials(providerIds: Iterable<string>): void {\n\t\tfor (const providerId of providerIds)\n\t\t\tthis.availabilityCredentials.set(providerId, this.credentials.peek(providerId));\n\t}\n\n\tprivate withCredentialAvailability(\n\t\tprevious: ModelRuntimeSnapshot,\n\t\tnext: ModelRuntimeSnapshot,\n\t\tproviderIds: ReadonlySet<string>,\n\t): ModelRuntimeSnapshot {\n\t\tconst availableByKey = new Map(\n\t\t\tprevious.available\n\t\t\t\t.filter((model) => !providerIds.has(model.provider))\n\t\t\t\t.map((model) => [snapshotModelKey(model), model]),\n\t\t);\n\t\tfor (const providerId of providerIds) {\n\t\t\tconst provider = this.models.getProvider(providerId);\n\t\t\tif (!provider || !next.configuredProviders.has(providerId)) continue;\n\t\t\tconst models = provider.getModels();\n\t\t\tfor (const model of provider.filterModels?.(models, this.credentials.peek(providerId)) ?? models)\n\t\t\t\tavailableByKey.set(snapshotModelKey(model), model);\n\t\t}\n\t\tthis.recordAvailabilityCredentials(providerIds);\n\t\tconst all = [...this.models.getModels()];\n\t\treturn {\n\t\t\t...next,\n\t\t\tall,\n\t\t\tavailable: all.flatMap((model) => availableByKey.get(snapshotModelKey(model)) ?? []),\n\t\t};\n\t}\n\n\t/** Return stored credential metadata synchronously without refreshing auth. */\n\tgetCredentialSnapshot(providerId: string): Credential | undefined {\n\t\treturn this.credentials.peek(normalizeProviderId(providerId));\n\t}\n\n\tgetAuth(providerId: string, overrides?: ModelRuntimeAuthOverrides): Promise<AuthResult | undefined>;\n\tgetAuth(model: AnyModel, overrides?: ModelRuntimeAuthOverrides): Promise<AuthResult | undefined>;\n\tasync getAuth(\n\t\tproviderOrModel: string | AnyModel,\n\t\toverrides: ModelRuntimeAuthOverrides = {},\n\t): Promise<AuthResult | undefined> {\n\t\tif (typeof providerOrModel === \"string\")\n\t\t\treturn this.models.getAuth(normalizeProviderId(providerOrModel), overrides);\n\t\tproviderOrModel = normalizeModelProvider(providerOrModel);\n\t\tconst resolution = await this.models.getAuth(providerOrModel, overrides);\n\t\tif (!resolution) return undefined;\n\t\treturn mergeConfiguredAuthHeaders(\n\t\t\tresolution,\n\t\t\tproviderOrModel,\n\t\t\tthis.config,\n\t\t\tthis.extensionProviders.get(providerOrModel.provider),\n\t\t\toverrides,\n\t\t);\n\t}\n\n\t/**\n\t * Resolve request-owned auth/config headers without copying the model's static\n\t * catalog headers into the per-request override layer. The API provider reads\n\t * static headers from the model itself; duplicating them in auth would make\n\t * them override API-computed defaults that intentionally replace catalog values.\n\t */\n\tasync getRequestAuth(model: Model<Api>, overrides: ModelRuntimeAuthOverrides = {}): Promise<AuthResult | undefined> {\n\t\tmodel = normalizeModelProvider(model);\n\t\tconst resolution = await this.getAuth(model.provider, overrides);\n\t\tif (!resolution) return undefined;\n\t\treturn mergeConfiguredAuthHeaders(\n\t\t\tresolution,\n\t\t\tmodel,\n\t\t\tthis.config,\n\t\t\tthis.extensionProviders.get(model.provider),\n\t\t\toverrides,\n\t\t);\n\t}\n\n\t/**\n\t * Monotonic count of changes to any input a catalog refresh reads.\n\t *\n\t * `refresh()` reloads models.json, recomposes every provider from it, the\n\t * extension registrations, and the builtin catalog, resolves credentials as\n\t * it runs, and publishes ONE snapshot at the end. So a pass belongs to the\n\t * inputs it started under, and joining a pass across a bump is unsound in\n\t * both directions: the joiner reads models and credentials the user has\n\t * already replaced, and the pass's late publish overwrites the newer state\n\t * with them.\n\t *\n\t * Every mutation source bumps this counter, which is why callers need only\n\t * this one number rather than a growing tuple of per-input keys:\n\t *\n\t * - credential writes — `login`, `logout`, `saveCredential`,\n\t * `setRuntimeApiKey`, `removeRuntimeApiKey`, an external\n\t * `reloadCredentials`, and an applied external auth status;\n\t * - provider registrations — `registerProvider`, `registerNativeProvider`,\n\t * and `unregisterProvider`, through the refresh they schedule;\n\t * - models.json content — provider `baseUrl`, `apiKey`, `api`, headers,\n\t * model definitions, and overrides, which every pass reloads.\n\t *\n\t * The first two are this runtime's own writes and bump where they happen.\n\t * The third is an external edit nothing here observes, so reading the\n\t * generation samples the file and bumps when its content moved since the\n\t * last sample. That read is synchronous so the answer belongs to the same\n\t * tick as the decision that depends on it, and it hashes content rather\n\t * than trusting an mtime: a same-size rewrite inside one filesystem\n\t * timestamp tick — an edited key, a renamed model — is exactly the change a\n\t * shared pass must not hide.\n\t */\n\tgetCatalogInputsGeneration(): number {\n\t\tthis.observeModelsFile();\n\t\treturn this.catalogInputsGeneration;\n\t}\n\n\t/**\n\t * Record that an input a catalog refresh reads changed. Every pass started\n\t * before this call answers for inputs that no longer exist.\n\t */\n\tprivate markCatalogInputsChanged(): void {\n\t\tthis.catalogInputsGeneration += 1;\n\t}\n\n\t/** Bump the generation when models.json changed since the last observation. */\n\tprivate observeModelsFile(): void {\n\t\tconst token = this.readModelsFileToken();\n\t\tif (this.observedModelsFileToken === token) return;\n\t\tconst first = this.observedModelsFileToken === undefined;\n\t\tthis.observedModelsFileToken = token;\n\t\t// The first observation is a baseline, not a change: no pass can predate it.\n\t\tif (!first) this.markCatalogInputsChanged();\n\t}\n\n\tprivate readModelsFileToken(): string {\n\t\tif (!this.modelsPath) return \"none\";\n\t\ttry {\n\t\t\treturn createHash(\"sha1\")\n\t\t\t\t.update(readFileSync(normalizePath(this.modelsPath)))\n\t\t\t\t.digest(\"hex\");\n\t\t} catch (error) {\n\t\t\tconst code = (error as NodeJS.ErrnoException).code;\n\t\t\t// An absent file is a stable state passes can share; any other read\n\t\t\t// failure keys on its own code rather than pretending the file is empty.\n\t\t\treturn code === \"ENOENT\" ? \"absent\" : `unreadable:${code ?? \"unknown\"}`;\n\t\t}\n\t}\n\n\t/** Reload credentials changed by the authoritative isolated engine and update auth status snapshots. */\n\tasync reloadCredentials(options: { refreshAvailability?: boolean } = {}): Promise<void> {\n\t\tawait this.credentials.reload();\n\t\tthis.markCatalogInputsChanged();\n\t\tif (options.refreshAvailability === false) {\n\t\t\tconst credentials = await this.credentials.list();\n\t\t\tfor (const credential of credentials) this.externalProviderAuthStatuses.delete(credential.providerId);\n\t\t\tthis.snapshotGeneration += 1;\n\t\t\tthis.snapshot = replaceStoredCredentialProviders(this.snapshot, credentials);\n\t\t\tthis.recordAvailabilityCredentials([...this.snapshot.auth.keys(), ...this.snapshot.storedProviders]);\n\t\t\treturn;\n\t\t}\n\t\tawait this.queueAvailabilityRefresh();\n\t}\n\n\tprivate assertCredentialRefreshSucceeded(\n\t\tproviderId: string,\n\t\tresult: ModelsRefreshResult,\n\t\tsignal?: AbortSignal,\n\t): void {\n\t\tif (result.aborted) {\n\t\t\tsignal?.throwIfAborted();\n\t\t\tthrow new Error(`Model refresh aborted for ${providerId}`);\n\t\t}\n\t\tconst refreshError = result.errors.get(providerId);\n\t\tif (refreshError) throw refreshError;\n\t\tconst compositionError = this.compositionErrors.get(providerId);\n\t\tif (compositionError) throw new Error(compositionError);\n\t}\n\n\tprivate enqueueCredentialOperation<T>(providerId: string, signal: AbortSignal, task: () => Promise<T>): Promise<T> {\n\t\tconst previous = this.credentialOperations.get(providerId) ?? Promise.resolve();\n\t\tlet markStarted: (() => void) | undefined;\n\t\tconst started = new Promise<void>((resolve) => {\n\t\t\tmarkStarted = resolve;\n\t\t});\n\t\tconst operation = (async () => {\n\t\t\tawait previous.catch(() => {});\n\t\t\tsignal.throwIfAborted();\n\t\t\tmarkStarted?.();\n\t\t\treturn task();\n\t\t})();\n\t\tconst tail = operation.catch(() => {});\n\t\tthis.credentialOperations.set(providerId, tail);\n\t\tvoid tail.then(() => {\n\t\t\tif (this.credentialOperations.get(providerId) === tail) this.credentialOperations.delete(providerId);\n\t\t});\n\t\treturn raceWithAbortSignal(started, signal).then(() => operation);\n\t}\n\tprivate async synchronizeCredentialState(\n\t\tproviderId: string,\n\t\toperation: CredentialSynchronizationOperation,\n\t\tcredential: Credential | undefined,\n\t\tsynchronize: () => void | Promise<void>,\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait synchronize();\n\t\t} catch (cause) {\n\t\t\tif (cause instanceof CredentialSynchronizationError) throw cause;\n\t\t\tthrow new CredentialSynchronizationError(providerId, operation, credential, { cause });\n\t\t}\n\t}\n\tprivate async refreshRemainingAuthAfterLogout(providerId: string, logoutGeneration: number): Promise<void> {\n\t\t// Environment/runtime auth can remain after stored auth is removed. The\n\t\t// probe is normally synchronous, but its deadline is authoritative because\n\t\t// extension checks are third-party code and need not honor cancellation.\n\t\tlet timeout: number | undefined;\n\t\ttry {\n\t\t\tconst remainingAuth = await Promise.race([\n\t\t\t\tthis.checkAuth(providerId).catch(() => undefined),\n\t\t\t\tnew Promise<undefined>((resolve) => {\n\t\t\t\t\ttimeout = setTimeout(resolve, POST_LOGOUT_AUTH_CHECK_TIMEOUT_MS);\n\t\t\t\t}),\n\t\t\t]);\n\t\t\tif (logoutGeneration === this.snapshotGeneration && !this.snapshot.storedProviders.has(providerId)) {\n\t\t\t\tthis.snapshot = this.withCredentialAvailability(\n\t\t\t\t\tthis.snapshot,\n\t\t\t\t\tremoveStoredCredentialProvider(this.snapshot, providerId, remainingAuth),\n\t\t\t\t\tnew Set([providerId]),\n\t\t\t\t);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (timeout) clearTimeout(timeout);\n\t\t}\n\t}\n\n\t/**\n\t * Persist a credential acquired elsewhere.\n\t *\n\t * `refreshCatalog` defaults to true so the saved credential is published against\n\t * a freshly fetched catalog. Callers that acquired the key through a login dialog\n\t * pass false: that transaction ends at persistence, and a remote catalog fetch\n\t * would make an offline save fail after the credential was already committed.\n\t */\n\tasync saveCredential(\n\t\tproviderId: string,\n\t\tcredential: Credential,\n\t\toptions: SaveCredentialOptions = {},\n\t): Promise<void> {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tconst refreshCatalog = options.refreshCatalog ?? true;\n\t\tconst signal = operationSignal(undefined);\n\t\tawait this.enqueueCredentialOperation(providerId, signal, async () => {\n\t\t\tawait this.credentials.modify(providerId, async () => credential);\n\t\t\tthis.markCatalogInputsChanged();\n\t\t\tawait this.synchronizeCredentialState(providerId, \"saveCredential\", credential, async () => {\n\t\t\t\tif (!refreshCatalog) {\n\t\t\t\t\tthis.updateModelSnapshot();\n\t\t\t\t\tthis.externalProviderAuthStatuses.delete(providerId);\n\t\t\t\t\tthis.snapshot = addStoredCredentialProvider(this.snapshot, providerId, credential.type);\n\t\t\t\t\tthis.recordAvailabilityCredentials([providerId]);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst result = await this.refresh({ providers: [providerId] });\n\t\t\t\tthis.assertCredentialRefreshSucceeded(providerId, result);\n\t\t\t\t// A concurrent catalog refresh can supersede this provider's availability\n\t\t\t\t// publication. The committed credential must still be visible when save returns.\n\t\t\t\tthis.snapshotGeneration += 1;\n\t\t\t\tthis.externalProviderAuthStatuses.delete(providerId);\n\t\t\t\tthis.snapshot = {\n\t\t\t\t\t...addStoredCredentialProvider(this.snapshot, providerId, credential.type),\n\t\t\t\t\t// Keep credential-filtered model availability from the refresh intact.\n\t\t\t\t\tavailable: this.snapshot.available,\n\t\t\t\t};\n\t\t\t\tthis.recordAvailabilityCredentials([providerId]);\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t * Apply a process-scoped API key override. This publishes the provider against\n\t * the current snapshot and deliberately does not refresh the model catalog;\n\t * callers needing catalog freshness call refresh({ providers: [providerId], signal })\n\t * separately.\n\t */\n\tasync setRuntimeApiKey(providerId: string, apiKey: string, options: AuthOperationOptions): Promise<void> {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tconst signal = operationSignal(options.signal);\n\t\tawait this.enqueueCredentialOperation(providerId, signal, async () => {\n\t\t\tthis.credentials.setRuntimeApiKey(providerId, apiKey);\n\t\t\tthis.markCatalogInputsChanged();\n\t\t\tawait this.synchronizeCredentialState(providerId, \"setRuntimeApiKey\", { type: \"api_key\", key: apiKey }, () => {\n\t\t\t\tthis.snapshot = addRuntimeApiKeyProvider(this.snapshot, providerId);\n\t\t\t});\n\t\t});\n\t}\n\n\tasync removeRuntimeApiKey(providerId: string, options: AuthOperationOptions = {}): Promise<void> {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tconst signal = operationSignal(options.signal);\n\t\tawait this.enqueueCredentialOperation(providerId, signal, async () => {\n\t\t\tthis.credentials.removeRuntimeApiKey(providerId);\n\t\t\tthis.markCatalogInputsChanged();\n\t\t\tawait this.synchronizeCredentialState(providerId, \"removeRuntimeApiKey\", undefined, async () => {\n\t\t\t\tconst result = await this.refresh({ allowNetwork: this.modelNetworkEnabled, signal });\n\t\t\t\tthis.assertCredentialRefreshSucceeded(providerId, result, signal);\n\t\t\t});\n\t\t});\n\t}\n\n\tlistCredentials(): Promise<readonly CredentialInfo[]> {\n\t\treturn this.credentials.list();\n\t}\n\n\tgetStoredCredentialType(providerId: string): CredentialInfo[\"type\"] | undefined {\n\t\tthis.syncStoredCredentialChanges();\n\t\treturn this.snapshot.storedCredentialTypes.get(normalizeProviderId(providerId));\n\t}\n\n\tgetProviderAuthStatus(providerId: string): AuthStatus {\n\t\tthis.syncStoredCredentialChanges();\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tconst localStatus = getSnapshotProviderAuthStatus(\n\t\t\tthis.snapshot,\n\t\t\tproviderId,\n\t\t\tthis.credentials.hasRuntimeApiKey(providerId),\n\t\t\tconfiguredRequestAuthStatus(this.config.getProvider(providerId), this.extensionProviders.get(providerId)),\n\t\t);\n\t\tif (localStatus.source === \"stored\" || localStatus.source === \"runtime\") return localStatus;\n\t\treturn this.externalProviderAuthStatuses.get(providerId) ?? localStatus;\n\t}\n\n\t/** Apply authoritative auth state returned by an isolated engine mutation. */\n\tapplyExternalProviderAuthStatus(providerId: string, status: AuthStatus): void {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tthis.markCatalogInputsChanged();\n\t\tthis.snapshotGeneration += 1;\n\t\tconst remainingAuth =\n\t\t\tstatus.configured && status.source === \"environment\"\n\t\t\t\t? ({ type: \"api_key\", source: status.label ?? \"environment\" } as const)\n\t\t\t\t: undefined;\n\t\tthis.snapshot = removeStoredCredentialProvider(this.snapshot, providerId, remainingAuth);\n\t\tthis.externalProviderAuthStatuses.set(providerId, status);\n\t\tthis.externalStatusCredentials.set(providerId, this.credentials.peek(providerId));\n\t}\n\n\tstream<TApi extends Api>(\n\t\tmodel: Model<TApi>,\n\t\tcontext: Context,\n\t\toptions?: ModelsApiStreamOptions<TApi>,\n\t): AssistantMessageEventStream {\n\t\treturn this.streaming.stream(model, context, options);\n\t}\n\n\tcomplete<TApi extends Api>(\n\t\tmodel: Model<TApi>,\n\t\tcontext: Context,\n\t\toptions?: ModelsApiStreamOptions<TApi>,\n\t): Promise<AssistantMessage> {\n\t\treturn this.streaming.complete(model, context, options);\n\t}\n\n\tstreamSimple(\n\t\tmodel: Model<Api>,\n\t\tcontext: Context,\n\t\toptions?: ModelRuntimeSimpleStreamOptions,\n\t): AssistantMessageEventStream {\n\t\treturn this.streaming.streamSimple(model, context, options);\n\t}\n\n\tcompleteSimple(\n\t\tmodel: Model<Api>,\n\t\tcontext: Context,\n\t\toptions?: ModelRuntimeSimpleStreamOptions,\n\t): Promise<AssistantMessage> {\n\t\treturn this.streaming.completeSimple(model, context, options);\n\t}\n\n\tfetchDeferred(\n\t\tmodel: Model<Api>,\n\t\thandle: DeferredHandle,\n\t\toptions?: ModelsDeferredFetchOptions,\n\t): Promise<AssistantMessage> {\n\t\treturn this.streaming.fetchDeferred(model, handle, options);\n\t}\n\n\tcancelDeferred(model: Model<Api>, handle: DeferredHandle, options?: ModelsDeferredCancelOptions): Promise<void> {\n\t\treturn this.streaming.cancelDeferred(model, handle, options);\n\t}\n\n\tprivate operationHeaders(model: AnyModel, headers: ProviderHeaders, env?: Record<string, string>): ProviderHeaders {\n\t\tconst configured = resolveConfiguredModelHeaders(\n\t\t\tmodel,\n\t\t\tthis.config.getProvider(model.provider),\n\t\t\tthis.extensionProviders.get(model.provider),\n\t\t\tenv,\n\t\t);\n\t\treturn mergeHeaders(configured, headers) ?? {};\n\t}\n\n\tgenerateImages(\n\t\tmodel: ImageModel<ImageApi>,\n\t\tcontext: ImagesContext,\n\t\toptions?: ModelsImagesOptions,\n\t): Promise<AssistantImages> {\n\t\treturn this.models.generateImages(model, context, {\n\t\t\t...options,\n\t\t\ttransformHeaders: async (headers) => {\n\t\t\t\tconst prepared = this.operationHeaders(model, headers, options?.env);\n\t\t\t\treturn (await options?.transformHeaders?.(prepared)) ?? prepared;\n\t\t\t},\n\t\t});\n\t}\n\n\tclassify(\n\t\tmodel: ClassifierModel<ClassifierApi>,\n\t\tcontext: ClassifierContext,\n\t\toptions?: ModelsClassifierOptions,\n\t): Promise<ClassifierResult> {\n\t\treturn this.models.classify(model, context, {\n\t\t\t...options,\n\t\t\ttransformHeaders: async (headers) => {\n\t\t\t\tconst prepared = this.operationHeaders(model, headers, options?.env);\n\t\t\t\treturn (await options?.transformHeaders?.(prepared)) ?? prepared;\n\t\t\t},\n\t\t});\n\t}\n\n\tasync login(\n\t\tproviderId: string,\n\t\ttype: AuthType,\n\t\tinteraction: AuthInteraction,\n\t\toptions?: LoginOptions,\n\t): Promise<Credential> {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tconst signal = operationSignal(interaction.signal);\n\t\treturn this.enqueueCredentialOperation(providerId, signal, async () => {\n\t\t\tconst credential = await this.models.login(providerId, type, { ...interaction, signal }, options);\n\t\t\tthis.markCatalogInputsChanged();\n\t\t\tawait this.synchronizeCredentialState(providerId, \"login\", credential, () => {\n\t\t\t\t// Credential acquisition and persistence are the login transaction. Publish\n\t\t\t\t// the provider against the current snapshot immediately; catalog restoration,\n\t\t\t\t// ambient availability checks, and networking belong to /model's bounded\n\t\t\t\t// background refresh and must never keep a successful login dialog open.\n\t\t\t\tthis.updateModelSnapshot();\n\t\t\t\tthis.externalProviderAuthStatuses.delete(providerId);\n\t\t\t\tthis.snapshot = addStoredCredentialProvider(this.snapshot, providerId, credential.type);\n\t\t\t\tthis.recordAvailabilityCredentials([providerId]);\n\t\t\t});\n\t\t\treturn credential;\n\t\t});\n\t}\n\n\tasync logout(providerId: string, options: AuthOperationOptions = {}): Promise<void> {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tconst signal = operationSignal(options.signal);\n\t\tconst logoutGeneration = await this.enqueueCredentialOperation(providerId, signal, async () => {\n\t\t\tawait this.models.logout(providerId, { signal });\n\t\t\tthis.markCatalogInputsChanged();\n\t\t\tlet generation = 0;\n\t\t\tawait this.synchronizeCredentialState(providerId, \"logout\", undefined, () => {\n\t\t\t\t// Reset credential-dependent compatibility projections, then publish the\n\t\t\t\t// persisted deletion without waiting for model stores or remote catalogs.\n\t\t\t\tthis.recomposeProvider(providerId);\n\t\t\t\tthis.updateModelSnapshot();\n\t\t\t\tthis.externalProviderAuthStatuses.delete(providerId);\n\t\t\t\tthis.snapshot = removeStoredCredentialProvider(this.snapshot, providerId);\n\t\t\t\tthis.recordAvailabilityCredentials([providerId]);\n\t\t\t\tgeneration = this.snapshotGeneration;\n\t\t\t});\n\t\t\treturn generation;\n\t\t});\n\t\tawait this.refreshRemainingAuthAfterLogout(providerId, logoutGeneration);\n\t}\n\n\t/**\n\t * The network policy a refresh with an omitted `allowNetwork` resolves to.\n\t *\n\t * Callers that share one in-flight refresh key on the effective policy, so\n\t * they need the same answer `runRefresh` computes rather than a second guess\n\t * at the offline setting this runtime was created under.\n\t */\n\tisNetworkRefreshEnabled(): boolean {\n\t\treturn this.modelNetworkEnabled;\n\t}\n\tasync refresh(options: ModelsRefreshOptions = {}): Promise<ModelsRefreshResult> {\n\t\treturn this.runRefresh(options, ++this.refreshSequence);\n\t}\n\n\t/**\n\t * A registration's offline catalog pass must not publish after a newer refresh\n\t * that resolves configured credentials.\n\t *\n\t * The registration is also a catalog-input change: it adds, replaces, or drops\n\t * a provider every later pass composes from, so no pass that predates it can\n\t * answer for the provider set a caller now sees.\n\t */\n\tprivate scheduleRegistrationRefresh(): void {\n\t\tthis.markCatalogInputsChanged();\n\t\tconst sequence = ++this.refreshSequence;\n\t\tvoid this.runRefresh({ allowNetwork: false }, sequence, true);\n\t}\n\n\tprivate async runRefresh(\n\t\toptions: ModelsRefreshOptions,\n\t\tsequence: number,\n\t\tdiscardIfSuperseded = false,\n\t): Promise<ModelsRefreshResult> {\n\t\tconst config = await ModelConfig.load(this.modelsPath);\n\t\tif (discardIfSuperseded && sequence !== this.refreshSequence) {\n\t\t\treturn { aborted: true, errors: new Map<string, Error>() };\n\t\t}\n\t\tthis.config = config;\n\t\tthis.configureRadiusProviders();\n\t\tif (options.providers) options = { ...options, providers: options.providers.map(normalizeProviderId) };\n\t\tif (options.providers) {\n\t\t\tfor (const providerId of new Set(options.providers)) this.recomposeProvider(providerId);\n\t\t\tthis.updateModelSnapshot();\n\t\t} else this.rebuildProviders();\n\t\tconst refreshOptions = { ...options, allowNetwork: options.allowNetwork ?? this.isNetworkRefreshEnabled() };\n\t\tconst result = await this.models.refresh(refreshOptions);\n\t\tconst errors = new Map(result.errors);\n\t\tthis.updateModelSnapshot();\n\t\tif (options.providers) {\n\t\t\tawait Promise.all(\n\t\t\t\t[...new Set(options.providers)].map(async (providerId) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.refreshProviderAvailability(providerId, operationSignal(options.signal));\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (!options.signal?.aborted)\n\t\t\t\t\t\t\terrors.set(providerId, error instanceof Error ? error : new Error(String(error)));\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tawait this.queueAvailabilityRefresh(options.signal);\n\t\t\t} catch {\n\t\t\t\t// Availability errors are recorded by the latest pass; refreshed models remain usable.\n\t\t\t}\n\t\t}\n\t\treturn { aborted: result.aborted || (options.signal?.aborted ?? false), errors };\n\t}\n\n\tprivate validateAliasRegistration(\n\t\tid: string,\n\t\tconfig: ProviderConfigInput,\n\t\tproviders: ReadonlyMap<string, ProviderConfigInput>,\n\t\tnativeProviders: ReadonlyMap<string, Provider>,\n\t): void {\n\t\tconst source = config.aliasOf;\n\t\tif (source === undefined) return;\n\t\tif (\n\t\t\tthis.builtins.has(id) ||\n\t\t\tnativeProviders.has(id) ||\n\t\t\tthis.config.getProvider(id) ||\n\t\t\t(providers.has(id) && providers.get(id)?.aliasOf === undefined)\n\t\t) {\n\t\t\tthrow new Error(`Provider alias ${id} cannot replace an existing provider.`);\n\t\t}\n\t\tif (providers.get(source)?.aliasOf !== undefined) {\n\t\t\tthrow new Error(\"Provider aliases must refer directly to a source provider, not another alias.\");\n\t\t}\n\t\tif (\n\t\t\t!this.builtins.has(source) &&\n\t\t\t!nativeProviders.has(source) &&\n\t\t\t!providers.has(source) &&\n\t\t\t!this.config.getProvider(source)\n\t\t) {\n\t\t\tthrow new Error(`Provider alias ${id}: source provider ${source} is unavailable.`);\n\t\t}\n\t}\n\n\tcreateExtensionProviderTransaction(replacedProviderIds: Iterable<string> = []): ExtensionProviderTransaction {\n\t\treplacedProviderIds = Array.from(replacedProviderIds, normalizeProviderId);\n\t\tconst nativeProviders = new Map(this.nativeExtensionProviders);\n\t\tconst providers = new Map(this.extensionProviders);\n\t\tfor (const providerId of replacedProviderIds) {\n\t\t\tnativeProviders.delete(providerId);\n\t\t\tproviders.delete(providerId);\n\t\t}\n\t\tconst configuredProviders = new Set(this.snapshot.configuredProviders);\n\t\tfor (const providerId of replacedProviderIds) configuredProviders.delete(providerId);\n\t\treturn {\n\t\t\tregisterNativeProvider: (provider) => {\n\t\t\t\tconst id = normalizeProviderId(provider.id);\n\t\t\t\tif (!id.trim()) throw new Error(\"Provider id must not be empty.\");\n\t\t\t\tproviders.delete(id);\n\t\t\t\tif (this.snapshot.storedProviders.has(id)) configuredProviders.add(id);\n\t\t\t\tnativeProviders.set(id, provider);\n\t\t\t},\n\t\t\tregisterProvider: (providerId, config) => {\n\t\t\t\tproviderId = normalizeProviderId(providerId);\n\t\t\t\tif (config.aliasOf !== undefined) config = { ...config, aliasOf: normalizeProviderId(config.aliasOf) };\n\t\t\t\tvalidateExtensionProvider(\n\t\t\t\t\tproviderId,\n\t\t\t\t\tthis.builtins.get(providerId),\n\t\t\t\t\tthis.config.getProvider(providerId),\n\t\t\t\t\tconfig,\n\t\t\t\t);\n\t\t\t\tthis.validateAliasRegistration(providerId, config, providers, nativeProviders);\n\t\t\t\tnativeProviders.delete(providerId);\n\t\t\t\tconst previous = providers.get(providerId);\n\t\t\t\tconst effective: ProviderConfigInput =\n\t\t\t\t\tconfig.aliasOf !== undefined || previous?.aliasOf !== undefined ? {} : { ...previous };\n\t\t\t\tfor (const [key, value] of Object.entries(config)) {\n\t\t\t\t\tif (value !== undefined) (effective as Record<string, unknown>)[key] = value;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tthis.snapshot.storedProviders.has(providerId) ||\n\t\t\t\t\tconfiguredRequestAuthStatus(this.config.getProvider(providerId), effective)?.configured\n\t\t\t\t) {\n\t\t\t\t\tconfiguredProviders.add(providerId);\n\t\t\t\t} else configuredProviders.delete(providerId);\n\t\t\t\tproviders.set(providerId, effective);\n\t\t\t},\n\t\t\tunregisterProvider: (providerId) => {\n\t\t\t\tproviderId = normalizeProviderId(providerId);\n\t\t\t\tproviders.delete(providerId);\n\t\t\t\tconfiguredProviders.delete(providerId);\n\t\t\t\tnativeProviders.delete(providerId);\n\t\t\t},\n\t\t\thasConfiguredAuth: (providerId) => configuredProviders.has(normalizeProviderId(providerId)),\n\t\t\tcommit: async () => {\n\t\t\t\tconst previous = {\n\t\t\t\t\textensionProviders: new Map(this.extensionProviders),\n\t\t\t\t\tnativeExtensionProviders: new Map(this.nativeExtensionProviders),\n\t\t\t\t\tbuiltins: new Map(this.builtins),\n\t\t\t\t\tconfig: this.config,\n\t\t\t\t\tsnapshot: this.snapshot,\n\t\t\t\t\tcompositionErrors: new Map(this.compositionErrors),\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\tthis.extensionProviders.clear();\n\t\t\t\t\tfor (const [providerId, config] of providers) this.extensionProviders.set(providerId, config);\n\t\t\t\t\tthis.nativeExtensionProviders.clear();\n\t\t\t\t\tfor (const [providerId, provider] of nativeProviders)\n\t\t\t\t\t\tthis.nativeExtensionProviders.set(providerId, provider);\n\t\t\t\t\tthis.rebuildProviders();\n\t\t\t\t\tthis.markCatalogInputsChanged();\n\t\t\t\t\tawait this.runRefresh({ allowNetwork: false }, ++this.refreshSequence, true);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthis.extensionProviders.clear();\n\t\t\t\t\tfor (const [providerId, config] of previous.extensionProviders)\n\t\t\t\t\t\tthis.extensionProviders.set(providerId, config);\n\t\t\t\t\tthis.nativeExtensionProviders.clear();\n\t\t\t\t\tfor (const [providerId, provider] of previous.nativeExtensionProviders)\n\t\t\t\t\t\tthis.nativeExtensionProviders.set(providerId, provider);\n\t\t\t\t\tthis.builtins.clear();\n\t\t\t\t\tfor (const [providerId, provider] of previous.builtins) this.builtins.set(providerId, provider);\n\t\t\t\t\tthis.config = previous.config;\n\t\t\t\t\tthis.rebuildProviders();\n\t\t\t\t\tthis.snapshot = previous.snapshot;\n\t\t\t\t\tthis.compositionErrors.clear();\n\t\t\t\t\tfor (const [providerId, message] of previous.compositionErrors)\n\t\t\t\t\t\tthis.compositionErrors.set(providerId, message);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n\n\tregisterNativeProvider(provider: Provider): void {\n\t\tconst id = normalizeProviderId(provider.id);\n\t\tif (!id.trim()) throw new Error(\"Provider id must not be empty.\");\n\t\tthis.extensionProviders.delete(id);\n\t\tthis.nativeExtensionProviders.set(id, provider);\n\t\tthis.recomposeProvider(id);\n\t\tthis.updateModelSnapshot();\n\t\tthis.markProvisionallyConfigured(\n\t\t\tid,\n\t\t\tconfiguredRequestAuthStatus(this.config.getProvider(id), undefined),\n\t\t\tprovider.auth?.oauth && !provider.auth.apiKey ? \"oauth\" : \"api_key\",\n\t\t);\n\t\tthis.scheduleRegistrationRefresh();\n\t}\n\n\tregisterProvider(providerId: string, config: ProviderConfigInput): void {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tif (config.aliasOf !== undefined) config = { ...config, aliasOf: normalizeProviderId(config.aliasOf) };\n\t\t// Validate the incoming registration on its own, like the legacy registry:\n\t\t// a broken re-registration must throw without touching the stored config.\n\t\tvalidateExtensionProvider(providerId, this.builtins.get(providerId), this.config.getProvider(providerId), config);\n\t\tthis.validateAliasRegistration(providerId, config, this.extensionProviders, this.nativeExtensionProviders);\n\t\tthis.nativeExtensionProviders.delete(providerId);\n\t\t// Re-registration merges defined values over the previous registration and\n\t\t// preserves undefined ones, matching the legacy ModelRegistry contract.\n\t\tconst previous = this.extensionProviders.get(providerId);\n\t\tconst effective: ProviderConfigInput =\n\t\t\tconfig.aliasOf !== undefined || previous?.aliasOf !== undefined ? {} : { ...previous };\n\t\tfor (const [key, value] of Object.entries(config)) {\n\t\t\tif (value !== undefined) (effective as Record<string, unknown>)[key] = value;\n\t\t}\n\t\tthis.extensionProviders.set(providerId, effective);\n\t\tthis.recomposeProvider(providerId);\n\t\tthis.updateModelSnapshot();\n\t\tthis.markProvisionallyConfigured(\n\t\t\tproviderId,\n\t\t\tconfiguredRequestAuthStatus(this.config.getProvider(providerId), effective),\n\t\t\tthis.models.getProvider(providerId)?.auth.oauth && !this.models.getProvider(providerId)?.auth.apiKey\n\t\t\t\t? \"oauth\"\n\t\t\t\t: \"api_key\",\n\t\t);\n\t\tthis.scheduleRegistrationRefresh();\n\t}\n\n\tprivate markProvisionallyConfigured(\n\t\tproviderId: string,\n\t\tconfiguredStatus: AuthStatus | undefined,\n\t\ttype: AuthType,\n\t): void {\n\t\tif (!this.snapshot.storedProviders.has(providerId) && !configuredStatus?.configured) return;\n\t\tconst configuredProviders = new Set(this.snapshot.configuredProviders).add(providerId);\n\t\tconst auth = new Map(this.snapshot.auth);\n\t\tif (!auth.has(providerId)) auth.set(providerId, { type, source: \"configured provider\" });\n\t\t// Preserve credential-filtered availability for providers already configured.\n\t\tlet available = this.snapshot.available;\n\t\tif (!this.snapshot.configuredProviders.has(providerId)) {\n\t\t\tconst preserved = new Set(available.map(snapshotModelKey));\n\t\t\tavailable = this.snapshot.all.filter(\n\t\t\t\t(model) => model.provider === providerId || preserved.has(snapshotModelKey(model)),\n\t\t\t);\n\t\t}\n\t\tthis.snapshot = { ...this.snapshot, auth, configuredProviders, available };\n\t}\n\n\tunregisterProvider(providerId: string): void {\n\t\tproviderId = normalizeProviderId(providerId);\n\t\tthis.extensionProviders.delete(providerId);\n\t\tthis.nativeExtensionProviders.delete(providerId);\n\t\tthis.recomposeProvider(providerId);\n\t\tthis.updateModelSnapshot();\n\t\tthis.scheduleRegistrationRefresh();\n\t}\n}\n"]}
package/docs/providers.md CHANGED
@@ -161,7 +161,7 @@ Keys, `ANTHROPIC_AUTH_TOKEN`, and custom authorization headers take precedence.
161
161
  ### GitHub Copilot
162
162
 
163
163
  - Press Enter for github.com, or enter your GitHub Enterprise Server domain
164
- - `COPILOT_GITHUB_TOKEN` is read as an API key when you prefer an environment variable over `/login`
164
+ - A personal access token works either way: save it with `/login github-copilot` → **Use an API key**, or set `COPILOT_GITHUB_TOKEN`. A saved key takes precedence over the environment variable
165
165
  - Models come from the bundled `pi-ai` GitHub Copilot catalog; an OAuth credential narrows the list to the ids your account can actually use
166
166
  - If you get "model not supported", enable it in VS Code: Copilot Chat → model selector → select model → "Enable"
167
167
 
@@ -169,18 +169,18 @@ Copilot includes `github-copilot/gpt-6.1-sol` and `github-copilot/gpt-6-astra`,
169
169
 
170
170
  `github-copilot/gpt-6-astra-fast` appears only when the OAuth account catalog advertises that exact fast ID. It sends `gpt-6-astra-fast` unchanged with no `service_tier`, unlike first-party OpenAI's priority route. A raw `COPILOT_GITHUB_TOKEN` cannot supply that fast entitlement.
171
171
 
172
- #### Endpoint routing for `COPILOT_GITHUB_TOKEN`
172
+ #### Endpoint routing for personal access tokens
173
173
 
174
- OAuth logins get their Copilot host from the token GitHub issues during login. Environment-token auth has no such exchange, so Atomic resolves the host itself, highest precedence first:
174
+ OAuth logins get their Copilot host from the token GitHub issues during login. A token saved through `/login` as an API key, or set in `COPILOT_GITHUB_TOKEN`, has no such exchange, so Atomic resolves the host itself, highest precedence first:
175
175
 
176
176
  1. `COPILOT_API_TARGET`, then `GITHUB_COPILOT_BASE_URL` — an explicit host or full URL
177
- 2. the `proxy-ep=` segment embedded in `COPILOT_GITHUB_TOKEN`
177
+ 2. the `proxy-ep=` segment embedded in the token
178
178
  3. `GITHUB_SERVER_URL` — `<tenant>.ghe.com` routes to `copilot-api.<tenant>.ghe.com`; any other non-`github.com` host routes to `https://api.enterprise.githubcopilot.com`
179
179
  4. `https://api.githubcopilot.com`, the public routing hub, which resolves your plan's host server-side
180
180
 
181
- A `models.json` provider `baseUrl` for `github-copilot` overrides all of the above. Without `COPILOT_GITHUB_TOKEN` the provider is left exactly as upstream `pi-ai` defines it.
181
+ A `models.json` provider `baseUrl` for `github-copilot` overrides all of the above. Without a saved API key or `COPILOT_GITHUB_TOKEN`, the provider is left exactly as upstream `pi-ai` defines it.
182
182
 
183
- Chat requests authenticated with a raw `COPILOT_GITHUB_TOKEN`, including `github_pat_`, `ghp_`, `gho_`, and `ghu_` tokens, send `Copilot-Integration-Id: copilot-developer-cli`. A header supplied through `models.json`, `modelOverrides`, or per request takes precedence, including `vscode-chat`. Exchanged OAuth tokens containing `tid=` keep their OAuth headers.
183
+ Chat requests authenticated with a raw token, including `github_pat_`, `ghp_`, `gho_`, and `ghu_` tokens from `/login` or `COPILOT_GITHUB_TOKEN`, send `Copilot-Integration-Id: copilot-developer-cli`. A header supplied through `models.json`, `modelOverrides`, or per request takes precedence, including `vscode-chat`. Exchanged OAuth tokens containing `tid=` keep their OAuth headers.
184
184
 
185
185
  Business and enterprise tokens sent to the individual host return `421 Misdirected Request`; if you see that, set `COPILOT_API_TARGET` to the host your organization issues.
186
186
 
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.9.58",
3
+ "version": "0.9.59",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bastani/atomic",
9
- "version": "0.9.58",
9
+ "version": "0.9.59",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@bastani/atomic-natives": "0.9.58",
13
- "@bastani/pi-ai": "0.9.58",
12
+ "@bastani/atomic-natives": "0.9.59",
13
+ "@bastani/pi-ai": "0.9.59",
14
14
  "@earendil-works/pi-agent-core": "1.4.0",
15
15
  "@earendil-works/pi-codemode": "1.4.0",
16
16
  "@earendil-works/pi-tui": "1.4.0",
@@ -427,18 +427,18 @@
427
427
  }
428
428
  },
429
429
  "node_modules/@bastani/atomic-natives": {
430
- "version": "0.9.58",
431
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.58.tgz",
430
+ "version": "0.9.59",
431
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.59.tgz",
432
432
  "license": "MIT",
433
433
  "optionalDependencies": {
434
- "@bastani/atomic-natives-darwin-arm64": "0.9.58",
435
- "@bastani/atomic-natives-darwin-x64": "0.9.58",
436
- "@bastani/atomic-natives-linux-arm64-gnu": "0.9.58",
437
- "@bastani/atomic-natives-linux-arm64-musl": "0.9.58",
438
- "@bastani/atomic-natives-linux-x64-gnu": "0.9.58",
439
- "@bastani/atomic-natives-linux-x64-musl": "0.9.58",
440
- "@bastani/atomic-natives-win32-arm64-msvc": "0.9.58",
441
- "@bastani/atomic-natives-win32-x64-msvc": "0.9.58"
434
+ "@bastani/atomic-natives-darwin-arm64": "0.9.59",
435
+ "@bastani/atomic-natives-darwin-x64": "0.9.59",
436
+ "@bastani/atomic-natives-linux-arm64-gnu": "0.9.59",
437
+ "@bastani/atomic-natives-linux-arm64-musl": "0.9.59",
438
+ "@bastani/atomic-natives-linux-x64-gnu": "0.9.59",
439
+ "@bastani/atomic-natives-linux-x64-musl": "0.9.59",
440
+ "@bastani/atomic-natives-win32-arm64-msvc": "0.9.59",
441
+ "@bastani/atomic-natives-win32-x64-msvc": "0.9.59"
442
442
  },
443
443
  "engines": {
444
444
  "bun": ">=1.4.2",
@@ -446,8 +446,8 @@
446
446
  }
447
447
  },
448
448
  "node_modules/@bastani/atomic-natives-darwin-arm64": {
449
- "version": "0.9.58",
450
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.58.tgz",
449
+ "version": "0.9.59",
450
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.59.tgz",
451
451
  "license": "MIT",
452
452
  "os": [
453
453
  "darwin"
@@ -458,8 +458,8 @@
458
458
  "optional": true
459
459
  },
460
460
  "node_modules/@bastani/atomic-natives-darwin-x64": {
461
- "version": "0.9.58",
462
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.58.tgz",
461
+ "version": "0.9.59",
462
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.59.tgz",
463
463
  "license": "MIT",
464
464
  "os": [
465
465
  "darwin"
@@ -470,8 +470,8 @@
470
470
  "optional": true
471
471
  },
472
472
  "node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
473
- "version": "0.9.58",
474
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.58.tgz",
473
+ "version": "0.9.59",
474
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.59.tgz",
475
475
  "license": "MIT",
476
476
  "os": [
477
477
  "linux"
@@ -485,8 +485,8 @@
485
485
  "optional": true
486
486
  },
487
487
  "node_modules/@bastani/atomic-natives-linux-arm64-musl": {
488
- "version": "0.9.58",
489
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.58.tgz",
488
+ "version": "0.9.59",
489
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.59.tgz",
490
490
  "license": "MIT",
491
491
  "os": [
492
492
  "linux"
@@ -500,8 +500,8 @@
500
500
  "optional": true
501
501
  },
502
502
  "node_modules/@bastani/atomic-natives-linux-x64-gnu": {
503
- "version": "0.9.58",
504
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.58.tgz",
503
+ "version": "0.9.59",
504
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.59.tgz",
505
505
  "license": "MIT",
506
506
  "os": [
507
507
  "linux"
@@ -515,8 +515,8 @@
515
515
  "optional": true
516
516
  },
517
517
  "node_modules/@bastani/atomic-natives-linux-x64-musl": {
518
- "version": "0.9.58",
519
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.58.tgz",
518
+ "version": "0.9.59",
519
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.59.tgz",
520
520
  "license": "MIT",
521
521
  "os": [
522
522
  "linux"
@@ -530,8 +530,8 @@
530
530
  "optional": true
531
531
  },
532
532
  "node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
533
- "version": "0.9.58",
534
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.58.tgz",
533
+ "version": "0.9.59",
534
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.59.tgz",
535
535
  "license": "MIT",
536
536
  "os": [
537
537
  "win32"
@@ -542,8 +542,8 @@
542
542
  "optional": true
543
543
  },
544
544
  "node_modules/@bastani/atomic-natives-win32-x64-msvc": {
545
- "version": "0.9.58",
546
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.58.tgz",
545
+ "version": "0.9.59",
546
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.59.tgz",
547
547
  "license": "MIT",
548
548
  "os": [
549
549
  "win32"
@@ -554,8 +554,8 @@
554
554
  "optional": true
555
555
  },
556
556
  "node_modules/@bastani/pi-ai": {
557
- "version": "0.9.58",
558
- "resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.58.tgz",
557
+ "version": "0.9.59",
558
+ "resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.59.tgz",
559
559
  "license": "MIT",
560
560
  "dependencies": {
561
561
  "@anthropic-ai/sdk": "0.129.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.9.58",
3
+ "version": "0.9.59",
4
4
  "description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "atomicConfig": {
@@ -89,8 +89,8 @@
89
89
  "prepublishOnly": "bun run clean && bun run build && bun run shrinkwrap"
90
90
  },
91
91
  "dependencies": {
92
- "@bastani/atomic-natives": "0.9.58",
93
- "@bastani/pi-ai": "0.9.58",
92
+ "@bastani/atomic-natives": "0.9.59",
93
+ "@bastani/pi-ai": "0.9.59",
94
94
  "@earendil-works/pi-agent-core": "1.4.0",
95
95
  "@earendil-works/pi-codemode": "1.4.0",
96
96
  "@earendil-works/pi-tui": "1.4.0",