claude-use 11.46.0 → 11.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -271,7 +271,6 @@ var init_schema = __esm({
271
271
  delay: z.string().regex(DURATION_RE, "must be a duration such as 5s or 500ms").optional(),
272
272
  /** Whether the launcher waits for a key press after its own output before it starts claude. Takes the place of `delay` when both are set. Applies only when a terminal is watching. */
273
273
  pause: z.boolean().optional(),
274
- /** Whether a provider session routes provider-qualified model names (`z/glm-5.3`, `auto`) through the `models` block to the provider that serves them, instead of sending every request to the launch provider. */
275
274
  /** Whether the launcher's report, for a launch that picks from a pool, lists every member the pick ranked with why each stands where it does, and not only the member it picked. */
276
275
  explain: z.boolean().optional()
277
276
  });
@@ -3122,7 +3121,7 @@ var init_package = __esm({
3122
3121
  "package.json"() {
3123
3122
  package_default = {
3124
3123
  name: "claude-use",
3125
- version: "11.46.0",
3124
+ version: "11.47.0",
3126
3125
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
3127
3126
  license: "MIT",
3128
3127
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -6496,6 +6495,7 @@ function buildLayoutPaths(root) {
6496
6495
  identitiesDir: path23.join(root, "identities"),
6497
6496
  configProfilesDir: path23.join(root, "config-profiles"),
6498
6497
  providersDir: path23.join(root, "providers"),
6498
+ providerAliasesFile: path23.join(root, "provider-aliases.json"),
6499
6499
  directoryRulesFile: path23.join(root, "directory-rules.json"),
6500
6500
  activeIdentityFile: path23.join(root, "active-identity"),
6501
6501
  globalConfigFile: path23.join(root, "config.json"),
@@ -6708,6 +6708,50 @@ var init_realCredentialCache = __esm({
6708
6708
  }
6709
6709
  });
6710
6710
 
6711
+ // src/providerAliases.ts
6712
+ import { z as z15 } from "zod";
6713
+ function parseAliases(file, raw) {
6714
+ const parsed = ProviderAliasesSchema.safeParse(raw);
6715
+ if (!parsed.success) {
6716
+ throw new ConfigValidationError(file, parsed.error.issues);
6717
+ }
6718
+ return parsed.data;
6719
+ }
6720
+ function readProviderAliases(paths) {
6721
+ return readJson(paths.providerAliasesFile, ProviderAliasesSchema) ?? {};
6722
+ }
6723
+ function loadProviderAliases(file, port) {
6724
+ const raw = port.readConfigFile(file);
6725
+ return raw === void 0 ? {} : parseAliases(file, raw);
6726
+ }
6727
+ function canonicalProviderName(name, defined, aliases) {
6728
+ if (defined(name)) {
6729
+ return name;
6730
+ }
6731
+ return aliases()[name] ?? name;
6732
+ }
6733
+ function aliasFindings(aliases, providerNames) {
6734
+ return Object.entries(aliases).map(([alias, target]) => {
6735
+ if (!providerNames.has(target)) {
6736
+ return { level: "fail", alias, message: `${alias} is recorded as a former name of ${target}, which is not a provider. Run \`agent-shim provider unalias ${alias}\`.` };
6737
+ }
6738
+ if (providerNames.has(alias)) {
6739
+ return { level: "warn", alias, message: `${alias} is both a provider and a recorded former name of ${target}; the provider wins. Run \`agent-shim provider unalias ${alias}\`.` };
6740
+ }
6741
+ return { level: "pass", alias, message: `${alias} is a former name of ${target}, still honoured for sessions launched under it. Run \`agent-shim provider unalias ${alias}\` once none is running.` };
6742
+ });
6743
+ }
6744
+ var ProviderAliasesSchema;
6745
+ var init_providerAliases = __esm({
6746
+ "src/providerAliases.ts"() {
6747
+ "use strict";
6748
+ init_cliError();
6749
+ init_load();
6750
+ init_store();
6751
+ ProviderAliasesSchema = z15.record(z15.string().min(1), z15.string().min(1));
6752
+ }
6753
+ });
6754
+
6711
6755
  // src/credential.ts
6712
6756
  function commandArgv(source) {
6713
6757
  if ("command" in source) {
@@ -7114,6 +7158,11 @@ var init_families = __esm({
7114
7158
  // src/providersStore.ts
7115
7159
  import fs7 from "node:fs";
7116
7160
  import path25 from "node:path";
7161
+ function requireValidProviderName(name) {
7162
+ if (!PROVIDER_NAME_RE.test(name)) {
7163
+ throw new InvalidProviderNameError(name);
7164
+ }
7165
+ }
7117
7166
  function providerJsonPath(paths, name) {
7118
7167
  return path25.join(paths.providersDir, `${name}.json`);
7119
7168
  }
@@ -7234,9 +7283,7 @@ function addProvider(paths, name, input) {
7234
7283
  if (providerExists(paths, name)) {
7235
7284
  throw new ProviderAlreadyExistsError(name);
7236
7285
  }
7237
- if (!PROVIDER_NAME_RE.test(name)) {
7238
- throw new InvalidProviderNameError(name);
7239
- }
7286
+ requireValidProviderName(name);
7240
7287
  const kind = input.kind ?? "http";
7241
7288
  if (kind === "codex" && input.baseUrl !== void 0) {
7242
7289
  throw new ProviderKindMismatchError("A codex provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
@@ -7367,10 +7414,11 @@ function cascadeProviderName(cascade) {
7367
7414
  }
7368
7415
  function selectProvider(params) {
7369
7416
  const cliName = params.cliProvider !== void 0 && params.cliProvider !== "" ? params.cliProvider : void 0;
7370
- const name = cliName ?? (params.cascade === void 0 ? void 0 : cascadeProviderName(params.cascade));
7371
- if (name === void 0) {
7417
+ const named = cliName ?? (params.cascade === void 0 ? void 0 : cascadeProviderName(params.cascade));
7418
+ if (named === void 0) {
7372
7419
  return void 0;
7373
7420
  }
7421
+ const name = canonicalProviderName(named, (candidate) => loadProvider(params.paths.providersDir, candidate, params.port) !== void 0, () => loadProviderAliases(params.paths.providerAliasesFile, params.port));
7374
7422
  const definition = loadProvider(params.paths.providersDir, name, params.port);
7375
7423
  if (definition === void 0) {
7376
7424
  const known = listProviderNames(params.port.readdir, params.paths.providersDir);
@@ -7468,6 +7516,7 @@ var init_providersStore = __esm({
7468
7516
  init_unrecognisedKeys();
7469
7517
  init_schema();
7470
7518
  init_cliError();
7519
+ init_providerAliases();
7471
7520
  init_credential();
7472
7521
  init_walk();
7473
7522
  init_families();
@@ -7716,7 +7765,7 @@ var init_commandDeps = __esm({
7716
7765
  // src/claudeShim.ts
7717
7766
  import fs8 from "node:fs";
7718
7767
  import path28 from "node:path";
7719
- import { z as z19 } from "zod";
7768
+ import { z as z20 } from "zod";
7720
7769
  function commandFilename(ownExecutablePath, commandName) {
7721
7770
  return ownExecutablePath.toLowerCase().endsWith(".exe") ? `${commandName}.exe` : commandName;
7722
7771
  }
@@ -7766,10 +7815,10 @@ var init_claudeShim = __esm({
7766
7815
  init_store();
7767
7816
  init_realPorts();
7768
7817
  init_cliError();
7769
- ClaudeShimStateSchema = z19.strictObject({
7770
- targetPath: z19.string().min(1),
7771
- method: z19.enum(["hardlink", "copy"]),
7772
- installedAtMs: z19.number()
7818
+ ClaudeShimStateSchema = z20.strictObject({
7819
+ targetPath: z20.string().min(1),
7820
+ method: z20.enum(["hardlink", "copy"]),
7821
+ installedAtMs: z20.number()
7773
7822
  });
7774
7823
  nodeLinkFs = { link: fs8.linkSync, copyFile: fs8.copyFileSync, chmod: fs8.chmodSync };
7775
7824
  }
@@ -7865,62 +7914,62 @@ var init_signatures = __esm({
7865
7914
  });
7866
7915
 
7867
7916
  // src/codex/anthropic.ts
7868
- import { z as z23 } from "zod";
7917
+ import { z as z24 } from "zod";
7869
7918
  var TextBlockSchema, Base64ImageSourceSchema, UrlImageSourceSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultContentBlockSchema, ToolResultBlockSchema, OtherBlockSchema, ContentBlockSchema, MessageSchema, ToolSchema, ToolChoiceSchema, SystemSchema, MessagesRequestSchema, CountTokensRequestSchema;
7870
7919
  var init_anthropic = __esm({
7871
7920
  "src/codex/anthropic.ts"() {
7872
7921
  "use strict";
7873
- TextBlockSchema = z23.looseObject({ type: z23.literal("text"), text: z23.string() });
7874
- Base64ImageSourceSchema = z23.looseObject({ type: z23.literal("base64"), media_type: z23.string().min(1), data: z23.string() });
7875
- UrlImageSourceSchema = z23.looseObject({ type: z23.literal("url"), url: z23.string().min(1) });
7876
- ImageBlockSchema = z23.looseObject({
7877
- type: z23.literal("image"),
7878
- source: z23.union([Base64ImageSourceSchema, UrlImageSourceSchema])
7922
+ TextBlockSchema = z24.looseObject({ type: z24.literal("text"), text: z24.string() });
7923
+ Base64ImageSourceSchema = z24.looseObject({ type: z24.literal("base64"), media_type: z24.string().min(1), data: z24.string() });
7924
+ UrlImageSourceSchema = z24.looseObject({ type: z24.literal("url"), url: z24.string().min(1) });
7925
+ ImageBlockSchema = z24.looseObject({
7926
+ type: z24.literal("image"),
7927
+ source: z24.union([Base64ImageSourceSchema, UrlImageSourceSchema])
7879
7928
  });
7880
- ToolUseBlockSchema = z23.looseObject({
7881
- type: z23.literal("tool_use"),
7882
- id: z23.string().min(1),
7883
- name: z23.string().min(1),
7884
- input: z23.unknown()
7929
+ ToolUseBlockSchema = z24.looseObject({
7930
+ type: z24.literal("tool_use"),
7931
+ id: z24.string().min(1),
7932
+ name: z24.string().min(1),
7933
+ input: z24.unknown()
7885
7934
  });
7886
- ToolResultContentBlockSchema = z23.union([TextBlockSchema, z23.looseObject({ type: z23.string() })]);
7887
- ToolResultBlockSchema = z23.looseObject({
7888
- type: z23.literal("tool_result"),
7889
- tool_use_id: z23.string().min(1),
7890
- content: z23.union([z23.string(), z23.array(ToolResultContentBlockSchema)]).optional()
7935
+ ToolResultContentBlockSchema = z24.union([TextBlockSchema, z24.looseObject({ type: z24.string() })]);
7936
+ ToolResultBlockSchema = z24.looseObject({
7937
+ type: z24.literal("tool_result"),
7938
+ tool_use_id: z24.string().min(1),
7939
+ content: z24.union([z24.string(), z24.array(ToolResultContentBlockSchema)]).optional()
7891
7940
  });
7892
- OtherBlockSchema = z23.looseObject({ type: z23.string() });
7893
- ContentBlockSchema = z23.union([TextBlockSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultBlockSchema, OtherBlockSchema]);
7894
- MessageSchema = z23.looseObject({
7895
- role: z23.enum(["user", "assistant", "system"]),
7896
- content: z23.union([z23.string(), z23.array(ContentBlockSchema)])
7941
+ OtherBlockSchema = z24.looseObject({ type: z24.string() });
7942
+ ContentBlockSchema = z24.union([TextBlockSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultBlockSchema, OtherBlockSchema]);
7943
+ MessageSchema = z24.looseObject({
7944
+ role: z24.enum(["user", "assistant", "system"]),
7945
+ content: z24.union([z24.string(), z24.array(ContentBlockSchema)])
7897
7946
  });
7898
- ToolSchema = z23.looseObject({
7899
- name: z23.string().min(1),
7900
- description: z23.string().optional(),
7901
- input_schema: z23.record(z23.string(), z23.unknown()).optional()
7947
+ ToolSchema = z24.looseObject({
7948
+ name: z24.string().min(1),
7949
+ description: z24.string().optional(),
7950
+ input_schema: z24.record(z24.string(), z24.unknown()).optional()
7902
7951
  });
7903
- ToolChoiceSchema = z23.union([
7904
- z23.looseObject({ type: z23.enum(["auto", "none", "any"]) }),
7905
- z23.looseObject({ type: z23.literal("tool"), name: z23.string().min(1) })
7952
+ ToolChoiceSchema = z24.union([
7953
+ z24.looseObject({ type: z24.enum(["auto", "none", "any"]) }),
7954
+ z24.looseObject({ type: z24.literal("tool"), name: z24.string().min(1) })
7906
7955
  ]);
7907
- SystemSchema = z23.union([z23.string(), z23.array(z23.union([TextBlockSchema, OtherBlockSchema]))]);
7908
- MessagesRequestSchema = z23.looseObject({
7909
- model: z23.string().optional(),
7956
+ SystemSchema = z24.union([z24.string(), z24.array(z24.union([TextBlockSchema, OtherBlockSchema]))]);
7957
+ MessagesRequestSchema = z24.looseObject({
7958
+ model: z24.string().optional(),
7910
7959
  system: SystemSchema.optional(),
7911
- messages: z23.array(MessageSchema),
7912
- tools: z23.array(ToolSchema).optional(),
7960
+ messages: z24.array(MessageSchema),
7961
+ tools: z24.array(ToolSchema).optional(),
7913
7962
  tool_choice: ToolChoiceSchema.optional(),
7914
- stream: z23.boolean().optional(),
7963
+ stream: z24.boolean().optional(),
7915
7964
  /** `user_id` is stable for one Claude Code session and differs between sessions, which is what makes it the right key for both the backend's prompt cache and its session header. */
7916
- metadata: z23.looseObject({ user_id: z23.string().optional() }).optional(),
7965
+ metadata: z24.looseObject({ user_id: z24.string().optional() }).optional(),
7917
7966
  /** Claude Code's effort setting. Any string is accepted; the translator honours only the levels the backend understands. */
7918
- output_config: z23.looseObject({ effort: z23.string().optional() }).optional()
7967
+ output_config: z24.looseObject({ effort: z24.string().optional() }).optional()
7919
7968
  });
7920
- CountTokensRequestSchema = z23.looseObject({
7921
- system: z23.unknown().optional(),
7922
- messages: z23.unknown().optional(),
7923
- tools: z23.unknown().optional()
7969
+ CountTokensRequestSchema = z24.looseObject({
7970
+ system: z24.unknown().optional(),
7971
+ messages: z24.unknown().optional(),
7972
+ tools: z24.unknown().optional()
7924
7973
  });
7925
7974
  }
7926
7975
  });
@@ -8005,7 +8054,7 @@ var init_translate2 = __esm({
8005
8054
  // src/providerCatalogue.ts
8006
8055
  import path30 from "node:path";
8007
8056
  import picomatch4 from "picomatch";
8008
- import { z as z24 } from "zod";
8057
+ import { z as z25 } from "zod";
8009
8058
  function catalogueCachePath(paths, name) {
8010
8059
  return path30.join(paths.catalogueDir, `${name}.json`);
8011
8060
  }
@@ -8040,8 +8089,8 @@ var init_providerCatalogue = __esm({
8040
8089
  CATALOGUE_REQUEST_SECONDS = 10;
8041
8090
  CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND5;
8042
8091
  CATALOGUE_REFRESH_TIMEOUT_MS = DEFAULT_CANDIDATE_URLS * CATALOGUE_REQUEST_TIMEOUT_MS;
8043
- CatalogueModelSchema = z24.strictObject({ id: z24.string().min(1), name: z24.string().min(1).optional() });
8044
- CatalogueCacheSchema = z24.strictObject({ fetchedAt: z24.number(), url: z24.string().min(1), models: z24.array(CatalogueModelSchema) });
8092
+ CatalogueModelSchema = z25.strictObject({ id: z25.string().min(1), name: z25.string().min(1).optional() });
8093
+ CatalogueCacheSchema = z25.strictObject({ fetchedAt: z25.number(), url: z25.string().min(1), models: z25.array(CatalogueModelSchema) });
8045
8094
  }
8046
8095
  });
8047
8096
 
@@ -10402,7 +10451,7 @@ var init_identityClaude = __esm({
10402
10451
  });
10403
10452
 
10404
10453
  // src/usage/providerQuota.ts
10405
- import { z as z31 } from "zod";
10454
+ import { z as z32 } from "zod";
10406
10455
  var MS_PER_SECOND9, SECONDS_PER_HOUR3, HOURS_PER_DAY6, DAYS_PER_MONTH, ZAI_HOST, ZAI_QUOTA_URL, ZAI_UNIT_HOURS, ZAI_UNIT_MONTHS, ZAI_UNIT_MS, ZaiLimitSchema, ZaiResponseSchema, OPENROUTER_HOST, OPENROUTER_KEY_URL, OPENROUTER_CREDITS_URL, MS_PER_DAY3, OpenRouterKeySchema, OpenRouterCreditsSchema, ANTIGRAVITY_HOST, ANTIGRAVITY_QUOTA_URL, ANTIGRAVITY_USER_URL, FIVE_HOURS2, DAYS_PER_WEEK2, FIVE_HOURS_MS, WEEK_MS, AntigravityBucketSchema, AntigravitySummarySchema, GoogleTokenInfoSchema, AntigravityUserSchema;
10407
10456
  var init_providerQuota = __esm({
10408
10457
  "src/usage/providerQuota.ts"() {
@@ -10421,35 +10470,35 @@ var init_providerQuota = __esm({
10421
10470
  [ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND9],
10422
10471
  [ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9]
10423
10472
  ]);
10424
- ZaiLimitSchema = z31.object({
10425
- type: z31.string(),
10426
- unit: z31.number().int(),
10427
- number: z31.number().int().positive(),
10428
- percentage: z31.number().nonnegative(),
10429
- nextResetTime: z31.number().positive().optional(),
10430
- usage: z31.number().nonnegative().optional(),
10431
- currentValue: z31.number().nonnegative().optional(),
10432
- remaining: z31.number().nonnegative().optional()
10473
+ ZaiLimitSchema = z32.object({
10474
+ type: z32.string(),
10475
+ unit: z32.number().int(),
10476
+ number: z32.number().int().positive(),
10477
+ percentage: z32.number().nonnegative(),
10478
+ nextResetTime: z32.number().positive().optional(),
10479
+ usage: z32.number().nonnegative().optional(),
10480
+ currentValue: z32.number().nonnegative().optional(),
10481
+ remaining: z32.number().nonnegative().optional()
10433
10482
  });
10434
- ZaiResponseSchema = z31.object({
10435
- success: z31.boolean(),
10436
- msg: z31.string().optional(),
10437
- data: z31.object({ level: z31.string().optional(), limits: z31.array(ZaiLimitSchema) })
10483
+ ZaiResponseSchema = z32.object({
10484
+ success: z32.boolean(),
10485
+ msg: z32.string().optional(),
10486
+ data: z32.object({ level: z32.string().optional(), limits: z32.array(ZaiLimitSchema) })
10438
10487
  });
10439
10488
  OPENROUTER_HOST = "openrouter.ai";
10440
10489
  OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
10441
10490
  OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
10442
10491
  MS_PER_DAY3 = HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
10443
- OpenRouterKeySchema = z31.object({
10444
- data: z31.object({
10445
- limit: z31.number().nonnegative().nullable(),
10446
- limit_remaining: z31.number().nullable(),
10447
- limit_reset: z31.string().nullable(),
10448
- is_free_tier: z31.boolean().optional(),
10449
- free_model_daily_requests: z31.object({ used: z31.number().nonnegative(), limit: z31.number().nonnegative(), remaining: z31.number() }).optional()
10492
+ OpenRouterKeySchema = z32.object({
10493
+ data: z32.object({
10494
+ limit: z32.number().nonnegative().nullable(),
10495
+ limit_remaining: z32.number().nullable(),
10496
+ limit_reset: z32.string().nullable(),
10497
+ is_free_tier: z32.boolean().optional(),
10498
+ free_model_daily_requests: z32.object({ used: z32.number().nonnegative(), limit: z32.number().nonnegative(), remaining: z32.number() }).optional()
10450
10499
  })
10451
10500
  });
10452
- OpenRouterCreditsSchema = z31.object({ data: z31.object({ total_credits: z31.number().nonnegative(), total_usage: z31.number().nonnegative() }) });
10501
+ OpenRouterCreditsSchema = z32.object({ data: z32.object({ total_credits: z32.number().nonnegative(), total_usage: z32.number().nonnegative() }) });
10453
10502
  ANTIGRAVITY_HOST = "daily-cloudcode-pa.googleapis.com";
10454
10503
  ANTIGRAVITY_QUOTA_URL = `https://${ANTIGRAVITY_HOST}/v1internal:retrieveUserQuotaSummary`;
10455
10504
  ANTIGRAVITY_USER_URL = `https://${ANTIGRAVITY_HOST}/v1internal:loadCodeAssist`;
@@ -10457,21 +10506,21 @@ var init_providerQuota = __esm({
10457
10506
  DAYS_PER_WEEK2 = 7;
10458
10507
  FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
10459
10508
  WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
10460
- AntigravityBucketSchema = z31.object({
10461
- bucketId: z31.string(),
10462
- remainingFraction: z31.number().optional(),
10463
- resetTime: z31.string().optional()
10509
+ AntigravityBucketSchema = z32.object({
10510
+ bucketId: z32.string(),
10511
+ remainingFraction: z32.number().optional(),
10512
+ resetTime: z32.string().optional()
10464
10513
  });
10465
- AntigravitySummarySchema = z31.object({ groups: z31.array(z31.object({ buckets: z31.array(AntigravityBucketSchema) })) });
10466
- GoogleTokenInfoSchema = z31.object({
10467
- email: z31.string().optional(),
10468
- sub: z31.string().optional()
10514
+ AntigravitySummarySchema = z32.object({ groups: z32.array(z32.object({ buckets: z32.array(AntigravityBucketSchema) })) });
10515
+ GoogleTokenInfoSchema = z32.object({
10516
+ email: z32.string().optional(),
10517
+ sub: z32.string().optional()
10469
10518
  });
10470
- AntigravityUserSchema = z31.object({
10519
+ AntigravityUserSchema = z32.object({
10471
10520
  /** The code-assist tier context, which defaults to the free tier for every account. */
10472
- currentTier: z31.object({ name: z31.string().optional(), id: z31.string().optional() }).optional(),
10521
+ currentTier: z32.object({ name: z32.string().optional(), id: z32.string().optional() }).optional(),
10473
10522
  /** The account's paid subscription; absent when the account has none. */
10474
- paidTier: z31.object({ name: z31.string().optional(), id: z31.string().optional() }).optional()
10523
+ paidTier: z32.object({ name: z32.string().optional(), id: z32.string().optional() }).optional()
10475
10524
  });
10476
10525
  }
10477
10526
  });
@@ -14399,7 +14448,7 @@ init_providersStore();
14399
14448
  init_projects();
14400
14449
  init_pipeline();
14401
14450
  import path27 from "node:path";
14402
- import { z as z15 } from "zod";
14451
+ import { z as z16 } from "zod";
14403
14452
  var HISTORY_PROJECTS_KEY_PREFIX = "history/projects/";
14404
14453
  function projectFragmentOf(rawKey) {
14405
14454
  return rawKey.startsWith(HISTORY_PROJECTS_KEY_PREFIX) ? rawKey.slice(HISTORY_PROJECTS_KEY_PREFIX.length) : void 0;
@@ -14468,9 +14517,9 @@ function lookupKeychainService(run, farmRoot) {
14468
14517
  }
14469
14518
  return { checked: true, found: true, serviceName, note: `Keychain service name for this identity: "${serviceName}".` };
14470
14519
  }
14471
- var SettingsSecretsShapeSchema = z15.looseObject({
14472
- env: z15.record(z15.string(), z15.unknown()).optional(),
14473
- hooks: z15.record(z15.string(), z15.array(z15.unknown())).optional()
14520
+ var SettingsSecretsShapeSchema = z16.looseObject({
14521
+ env: z16.record(z16.string(), z16.unknown()).optional(),
14522
+ hooks: z16.record(z16.string(), z16.array(z16.unknown())).optional()
14474
14523
  });
14475
14524
  function hookCommandCountOf(group) {
14476
14525
  if (typeof group !== "object" || group === null) {
@@ -14767,7 +14816,7 @@ init_schema();
14767
14816
  init_claudeVersion();
14768
14817
  init_identity();
14769
14818
  init_projects();
14770
- import { z as z17 } from "zod";
14819
+ import { z as z18 } from "zod";
14771
14820
 
14772
14821
  // src/resolve/types.ts
14773
14822
  var LAYER_KINDS = [
@@ -14828,123 +14877,123 @@ var DIAGNOSTIC_SEVERITIES = ["error", "warning", "info"];
14828
14877
 
14829
14878
  // src/usage/pickReportSchema.ts
14830
14879
  init_plan2();
14831
- import { z as z16 } from "zod";
14832
- var PoolPickCandidateViewSchema = z16.strictObject({
14833
- identity: z16.string(),
14880
+ import { z as z17 } from "zod";
14881
+ var PoolPickCandidateViewSchema = z17.strictObject({
14882
+ identity: z17.string(),
14834
14883
  /** In pick order: `scored` has usable quota data, `unknown` has none, `pay-per-use` bills by use, `ineligible` is refused right now. */
14835
- class: z16.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
14884
+ class: z17.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
14836
14885
  /** Plan-size-weighted remaining quota per hour until its reset; present for `scored` only. */
14837
- score: z16.number().optional(),
14886
+ score: z17.number().optional(),
14838
14887
  /** Which window's reset divides the score: the seven-day window, or the five-hour one when the member reports no seven-day utilisation or its measured-ratio five-hour term outranks the weekly one; present with `score`. */
14839
- scoreWindow: z16.enum(["sevenDay", "fiveHour"]).optional(),
14888
+ scoreWindow: z17.enum(["sevenDay", "fiveHour"]).optional(),
14840
14889
  /** False when the five-hour window would run dry, at the observed pace, before it resets. */
14841
- feasible: z16.boolean(),
14890
+ feasible: z17.boolean(),
14842
14891
  /** When an `ineligible` member can be used again, as an ISO instant. */
14843
- blockedUntil: z16.iso.datetime().optional(),
14892
+ blockedUntil: z17.iso.datetime().optional(),
14844
14893
  plan: PlanClassSchema,
14845
14894
  /** The facts behind the class and score, in the order they matter. */
14846
- reasons: z16.array(z16.string())
14895
+ reasons: z17.array(z17.string())
14847
14896
  });
14848
- var PoolPickReportSchema = z16.strictObject({
14849
- pool: z16.string(),
14850
- directory: z16.string(),
14897
+ var PoolPickReportSchema = z17.strictObject({
14898
+ pool: z17.string(),
14899
+ directory: z17.string(),
14851
14900
  /** The member a launch would run as, absent when every member is refused. */
14852
- pick: z16.string().optional(),
14853
- candidates: z16.array(PoolPickCandidateViewSchema),
14901
+ pick: z17.string().optional(),
14902
+ candidates: z17.array(PoolPickCandidateViewSchema),
14854
14903
  /** Identity members anywhere in the pool's graph that do not exist; a launch skips them. */
14855
- missing: z16.array(z16.string()),
14904
+ missing: z17.array(z17.string()),
14856
14905
  /** When nothing can be picked, the soonest any member returns. */
14857
- earliestReturn: z16.strictObject({ identity: z16.string(), at: z16.iso.datetime() }).optional(),
14906
+ earliestReturn: z17.strictObject({ identity: z17.string(), at: z17.iso.datetime() }).optional(),
14858
14907
  /** The member a resumed conversation started on but moved off, and why, when the ranking could not keep it. */
14859
- movedOff: z16.strictObject({ identity: z16.string(), reason: z16.string() }).optional(),
14908
+ movedOff: z17.strictObject({ identity: z17.string(), reason: z17.string() }).optional(),
14860
14909
  /** Why the last-pick record could not be read, when that is the case. */
14861
- stickyProblem: z16.string().optional()
14910
+ stickyProblem: z17.string().optional()
14862
14911
  });
14863
14912
 
14864
14913
  // src/checkReportSchema.ts
14865
14914
  var CHECK_CREDENTIAL_APPLIES = ["provider", "identity", "stored-login"];
14866
- var CheckLayerViewSchema = z17.strictObject({
14867
- id: z17.int(),
14868
- kind: z17.enum(LAYER_KINDS),
14869
- source: z17.string()
14915
+ var CheckLayerViewSchema = z18.strictObject({
14916
+ id: z18.int(),
14917
+ kind: z18.enum(LAYER_KINDS),
14918
+ source: z18.string()
14870
14919
  });
14871
- var CheckEntryViewSchema = z17.strictObject({
14872
- path: z17.string(),
14873
- shared: z17.boolean(),
14874
- via: z17.enum(DECISION_VIAS),
14920
+ var CheckEntryViewSchema = z18.strictObject({
14921
+ path: z18.string(),
14922
+ shared: z18.boolean(),
14923
+ via: z18.enum(DECISION_VIAS),
14875
14924
  /** The entry's real category, or null when nothing classifies it. */
14876
- category: z17.enum(CATEGORY_NAMES).nullable(),
14877
- rule: z17.strictObject({ key: z17.string(), layer: z17.int() }).optional(),
14925
+ category: z18.enum(CATEGORY_NAMES).nullable(),
14926
+ rule: z18.strictObject({ key: z18.string(), layer: z18.int() }).optional(),
14878
14927
  /** Rules that matched but whose `when` condition failed, each with the conditions that failed. */
14879
- eliminated: z17.readonly(z17.array(z17.strictObject({ key: z17.string(), failed: z17.readonly(z17.array(z17.string())) }))).optional()
14928
+ eliminated: z18.readonly(z18.array(z18.strictObject({ key: z18.string(), failed: z18.readonly(z18.array(z18.string())) }))).optional()
14880
14929
  });
14881
- var CheckDiagnosticSchema = z17.strictObject({
14882
- code: z17.enum(DIAGNOSTIC_CODES),
14883
- severity: z17.enum(DIAGNOSTIC_SEVERITIES),
14884
- message: z17.string(),
14885
- subject: z17.string().optional(),
14886
- layer: z17.int().optional()
14930
+ var CheckDiagnosticSchema = z18.strictObject({
14931
+ code: z18.enum(DIAGNOSTIC_CODES),
14932
+ severity: z18.enum(DIAGNOSTIC_SEVERITIES),
14933
+ message: z18.string(),
14934
+ subject: z18.string().optional(),
14935
+ layer: z18.int().optional()
14887
14936
  });
14888
- var CheckAmbientCredentialSchema = z17.union([z17.strictObject({ ok: z17.literal(true) }), z17.strictObject({ ok: z17.literal(false), variable: z17.string(), message: z17.string() })]);
14889
- var CheckKeychainSchema = z17.strictObject({
14890
- checked: z17.literal(true),
14891
- found: z17.boolean(),
14892
- serviceName: z17.string().optional(),
14893
- note: z17.string()
14937
+ var CheckAmbientCredentialSchema = z18.union([z18.strictObject({ ok: z18.literal(true) }), z18.strictObject({ ok: z18.literal(false), variable: z18.string(), message: z18.string() })]);
14938
+ var CheckKeychainSchema = z18.strictObject({
14939
+ checked: z18.literal(true),
14940
+ found: z18.boolean(),
14941
+ serviceName: z18.string().optional(),
14942
+ note: z18.string()
14894
14943
  });
14895
- var CheckSettingsExposureSchema = z17.strictObject({
14896
- file: z17.string(),
14897
- envKeyNames: z17.readonly(z17.array(z17.string())),
14898
- hookEventNames: z17.readonly(z17.array(z17.string())),
14899
- hookCommandCount: z17.int().nonnegative()
14944
+ var CheckSettingsExposureSchema = z18.strictObject({
14945
+ file: z18.string(),
14946
+ envKeyNames: z18.readonly(z18.array(z18.string())),
14947
+ hookEventNames: z18.readonly(z18.array(z18.string())),
14948
+ hookCommandCount: z18.int().nonnegative()
14900
14949
  });
14901
- var CredentialSourceSummarySchema = z17.union([
14902
- z17.strictObject({ kind: z17.literal("env"), variable: z17.string() }),
14903
- z17.strictObject({ kind: z17.literal("file"), path: z17.string() }),
14904
- z17.strictObject({ kind: z17.literal("command"), program: z17.string() }),
14905
- z17.strictObject({ kind: z17.literal("op"), reference: z17.string() }),
14906
- z17.strictObject({ kind: z17.literal("keychain"), service: z17.string(), account: z17.string().optional() }),
14907
- z17.strictObject({ kind: z17.literal("literal") })
14950
+ var CredentialSourceSummarySchema = z18.union([
14951
+ z18.strictObject({ kind: z18.literal("env"), variable: z18.string() }),
14952
+ z18.strictObject({ kind: z18.literal("file"), path: z18.string() }),
14953
+ z18.strictObject({ kind: z18.literal("command"), program: z18.string() }),
14954
+ z18.strictObject({ kind: z18.literal("op"), reference: z18.string() }),
14955
+ z18.strictObject({ kind: z18.literal("keychain"), service: z18.string(), account: z18.string().optional() }),
14956
+ z18.strictObject({ kind: z18.literal("literal") })
14908
14957
  ]);
14909
- var CredentialSummarySchema = z17.strictObject({
14910
- target: z17.enum(CREDENTIAL_TARGETS),
14911
- sources: z17.readonly(z17.array(CredentialSourceSummarySchema)),
14958
+ var CredentialSummarySchema = z18.strictObject({
14959
+ target: z18.enum(CREDENTIAL_TARGETS),
14960
+ sources: z18.readonly(z18.array(CredentialSourceSummarySchema)),
14912
14961
  cache: CredentialCacheSchema.optional()
14913
14962
  });
14914
- var CachedCredentialStateSchema = z17.union([
14915
- z17.strictObject({ store: z17.enum(CREDENTIAL_CACHE_STORES), status: z17.literal("empty") }),
14916
- z17.strictObject({ store: z17.enum(CREDENTIAL_CACHE_STORES), status: z17.literal("unreadable"), reason: z17.string() }),
14917
- z17.strictObject({ store: z17.enum(CREDENTIAL_CACHE_STORES), status: z17.enum(["fresh", "expired"]), ageMs: z17.number(), expiresInMs: z17.number().optional() })
14963
+ var CachedCredentialStateSchema = z18.union([
14964
+ z18.strictObject({ store: z18.enum(CREDENTIAL_CACHE_STORES), status: z18.literal("empty") }),
14965
+ z18.strictObject({ store: z18.enum(CREDENTIAL_CACHE_STORES), status: z18.literal("unreadable"), reason: z18.string() }),
14966
+ z18.strictObject({ store: z18.enum(CREDENTIAL_CACHE_STORES), status: z18.enum(["fresh", "expired"]), ageMs: z18.number(), expiresInMs: z18.number().optional() })
14918
14967
  ]);
14919
- var CheckCredentialProviderSchema = z17.union([
14920
- z17.strictObject({ name: z17.string(), credential: CredentialSummarySchema.optional(), cached: CachedCredentialStateSchema.optional() }),
14921
- z17.strictObject({ name: z17.string(), problem: z17.string() })
14968
+ var CheckCredentialProviderSchema = z18.union([
14969
+ z18.strictObject({ name: z18.string(), credential: CredentialSummarySchema.optional(), cached: CachedCredentialStateSchema.optional() }),
14970
+ z18.strictObject({ name: z18.string(), problem: z18.string() })
14922
14971
  ]);
14923
- var CheckCredentialSchema = z17.strictObject({
14924
- applies: z17.enum(CHECK_CREDENTIAL_APPLIES),
14972
+ var CheckCredentialSchema = z18.strictObject({
14973
+ applies: z18.enum(CHECK_CREDENTIAL_APPLIES),
14925
14974
  provider: CheckCredentialProviderSchema.optional(),
14926
14975
  identity: CredentialSummarySchema.optional(),
14927
14976
  identityCached: CachedCredentialStateSchema.optional()
14928
14977
  });
14929
- var CheckClaudeVersionSchema = z17.strictObject({
14930
- pinned: z17.strictObject({ version: z17.string(), source: z17.enum(CLAUDE_VERSION_SOURCES), installed: z17.boolean() }).optional(),
14931
- highestInstalled: z17.string().optional(),
14932
- installed: z17.readonly(z17.array(z17.string()))
14978
+ var CheckClaudeVersionSchema = z18.strictObject({
14979
+ pinned: z18.strictObject({ version: z18.string(), source: z18.enum(CLAUDE_VERSION_SOURCES), installed: z18.boolean() }).optional(),
14980
+ highestInstalled: z18.string().optional(),
14981
+ installed: z18.readonly(z18.array(z18.string()))
14933
14982
  });
14934
- var CheckReportJsonSchema = z17.strictObject({
14935
- identity: z17.strictObject({ name: z17.string().nullable(), source: z17.enum(IDENTITY_DECISION_SOURCES) }),
14983
+ var CheckReportJsonSchema = z18.strictObject({
14984
+ identity: z18.strictObject({ name: z18.string().nullable(), source: z18.enum(IDENTITY_DECISION_SOURCES) }),
14936
14985
  /** The pool ranking, when the launch named a pool instead of an identity. */
14937
14986
  pool: PoolPickReportSchema.optional(),
14938
- configProfile: z17.strictObject({ name: z17.string().nullable(), source: z17.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
14939
- layers: z17.readonly(z17.array(CheckLayerViewSchema)),
14940
- entries: z17.readonly(z17.array(CheckEntryViewSchema)),
14941
- projectEncodingAmbiguities: z17.readonly(
14942
- z17.array(z17.strictObject({ fragment: z17.string(), encoded: z17.string(), reason: z17.enum(ENCODING_AMBIGUITY_REASONS), detail: z17.string() }))
14987
+ configProfile: z18.strictObject({ name: z18.string().nullable(), source: z18.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
14988
+ layers: z18.readonly(z18.array(CheckLayerViewSchema)),
14989
+ entries: z18.readonly(z18.array(CheckEntryViewSchema)),
14990
+ projectEncodingAmbiguities: z18.readonly(
14991
+ z18.array(z18.strictObject({ fragment: z18.string(), encoded: z18.string(), reason: z18.enum(ENCODING_AMBIGUITY_REASONS), detail: z18.string() }))
14943
14992
  ),
14944
- diagnostics: z17.readonly(z17.array(CheckDiagnosticSchema)),
14993
+ diagnostics: z18.readonly(z18.array(CheckDiagnosticSchema)),
14945
14994
  ambientCredential: CheckAmbientCredentialSchema,
14946
14995
  keychain: CheckKeychainSchema.optional(),
14947
- settingsExposure: z17.readonly(z17.array(CheckSettingsExposureSchema)),
14996
+ settingsExposure: z18.readonly(z18.array(CheckSettingsExposureSchema)),
14948
14997
  credential: CheckCredentialSchema,
14949
14998
  claudeVersion: CheckClaudeVersionSchema.optional()
14950
14999
  });
@@ -15004,28 +15053,28 @@ function collectResets(snapshots, nowMs) {
15004
15053
  }
15005
15054
 
15006
15055
  // src/usage/resetsSchema.ts
15007
- import { z as z18 } from "zod";
15008
- var ResetRowSchema = z18.strictObject({
15009
- identity: z18.string(),
15010
- provider: z18.string(),
15056
+ import { z as z19 } from "zod";
15057
+ var ResetRowSchema = z19.strictObject({
15058
+ identity: z19.string(),
15059
+ provider: z19.string(),
15011
15060
  /** What the window is: `5h`, `7d` or `extra usage` for an Anthropic account, or the provider's own measure and period (`tokens 5h`). */
15012
- window: z18.string(),
15061
+ window: z19.string(),
15013
15062
  /** When the state the window comes from was observed, as an ISO instant. */
15014
- observedAt: z18.iso.datetime(),
15063
+ observedAt: z19.iso.datetime(),
15015
15064
  /** When the window resets, as an ISO instant; absent when the upstream reported none. */
15016
- resetsAt: z18.iso.datetime().optional(),
15065
+ resetsAt: z19.iso.datetime().optional(),
15017
15066
  /** True when the reset time has passed, so the recorded observation describes a window that no longer exists and its utilisation reads as 0. */
15018
- reset: z18.boolean(),
15067
+ reset: z19.boolean(),
15019
15068
  /** The fraction used, as `effectiveWindow` reads it at the report's own clock. */
15020
- utilization: z18.number().optional(),
15069
+ utilization: z19.number().optional(),
15021
15070
  /** The window's own status, for a window that has not reset yet. */
15022
- status: z18.string().optional()
15071
+ status: z19.string().optional()
15023
15072
  });
15024
- var ResetScheduleSchema = z18.strictObject({ resets: z18.readonly(z18.array(ResetRowSchema)) });
15073
+ var ResetScheduleSchema = z19.strictObject({ resets: z19.readonly(z19.array(ResetRowSchema)) });
15025
15074
 
15026
15075
  // src/frontdoor/controlSchemas.ts
15027
15076
  import path32 from "node:path";
15028
- import { z as z25 } from "zod";
15077
+ import { z as z26 } from "zod";
15029
15078
 
15030
15079
  // src/doctorReport.ts
15031
15080
  init_claudeShim();
@@ -15205,24 +15254,24 @@ import path31 from "node:path";
15205
15254
  init_signIn();
15206
15255
 
15207
15256
  // src/codex/siwcStore.ts
15208
- import { z as z22 } from "zod";
15257
+ import { z as z23 } from "zod";
15209
15258
 
15210
15259
  // src/codex/auth.ts
15211
- import { z as z20 } from "zod";
15212
- var AuthFileSchema = z20.looseObject({
15213
- tokens: z20.looseObject({
15214
- access_token: z20.string().optional(),
15215
- refresh_token: z20.string().optional(),
15216
- id_token: z20.string().optional(),
15217
- account_id: z20.string().optional()
15260
+ import { z as z21 } from "zod";
15261
+ var AuthFileSchema = z21.looseObject({
15262
+ tokens: z21.looseObject({
15263
+ access_token: z21.string().optional(),
15264
+ refresh_token: z21.string().optional(),
15265
+ id_token: z21.string().optional(),
15266
+ account_id: z21.string().optional()
15218
15267
  }).nullish(),
15219
- last_refresh: z20.string().optional()
15268
+ last_refresh: z21.string().optional()
15220
15269
  });
15221
- var TokenGrantSchema = z20.looseObject({
15222
- access_token: z20.string().min(1).optional(),
15223
- refresh_token: z20.string().min(1).optional(),
15224
- id_token: z20.string().min(1).optional(),
15225
- account_id: z20.string().min(1).optional()
15270
+ var TokenGrantSchema = z21.looseObject({
15271
+ access_token: z21.string().min(1).optional(),
15272
+ refresh_token: z21.string().min(1).optional(),
15273
+ id_token: z21.string().min(1).optional(),
15274
+ account_id: z21.string().min(1).optional()
15226
15275
  });
15227
15276
  var CodexAuthError = class extends Error {
15228
15277
  constructor(message) {
@@ -15232,41 +15281,41 @@ var CodexAuthError = class extends Error {
15232
15281
  };
15233
15282
 
15234
15283
  // src/codex/siwc.ts
15235
- import { z as z21 } from "zod";
15284
+ import { z as z22 } from "zod";
15236
15285
  var SIWC_RESOURCE = "https://api.openai.com/v1";
15237
15286
  var SIWC_RESPONSES_URL = `${SIWC_RESOURCE}/responses`;
15238
15287
  var SIWC_PLAN_SCOPE = "chatgpt.tokens.use.direct";
15239
- var TokenResponseSchema = z21.looseObject({
15240
- access_token: z21.string().min(1),
15241
- refresh_token: z21.string().min(1).optional(),
15242
- id_token: z21.string().min(1).optional(),
15243
- expires_in: z21.number().positive(),
15244
- scope: z21.string().optional()
15288
+ var TokenResponseSchema = z22.looseObject({
15289
+ access_token: z22.string().min(1),
15290
+ refresh_token: z22.string().min(1).optional(),
15291
+ id_token: z22.string().min(1).optional(),
15292
+ expires_in: z22.number().positive(),
15293
+ scope: z22.string().optional()
15245
15294
  });
15246
- var JwtHeaderSchema = z21.looseObject({ alg: z21.string(), kid: z21.string().optional() });
15247
- var IdTokenClaimsSchema = z21.looseObject({
15248
- iss: z21.string(),
15249
- sub: z21.string().min(1),
15250
- aud: z21.union([z21.string(), z21.array(z21.string())]),
15251
- exp: z21.number(),
15252
- nonce: z21.string().optional(),
15253
- email: z21.string().optional()
15295
+ var JwtHeaderSchema = z22.looseObject({ alg: z22.string(), kid: z22.string().optional() });
15296
+ var IdTokenClaimsSchema = z22.looseObject({
15297
+ iss: z22.string(),
15298
+ sub: z22.string().min(1),
15299
+ aud: z22.union([z22.string(), z22.array(z22.string())]),
15300
+ exp: z22.number(),
15301
+ nonce: z22.string().optional(),
15302
+ email: z22.string().optional()
15254
15303
  });
15255
- var JwksSchema = z21.object({ keys: z21.array(z21.looseObject({ kid: z21.string().optional(), kty: z21.string() })) });
15304
+ var JwksSchema = z22.object({ keys: z22.array(z22.looseObject({ kid: z22.string().optional(), kty: z22.string() })) });
15256
15305
 
15257
15306
  // src/codex/siwcStore.ts
15258
- var SiwcGrantSchema = z22.strictObject({
15259
- clientId: z22.string().min(1),
15260
- sub: z22.string().min(1),
15261
- email: z22.string().optional(),
15262
- idToken: z22.string().min(1),
15263
- accessToken: z22.string().min(1),
15264
- refreshToken: z22.string().min(1),
15265
- scopes: z22.array(z22.string()).readonly(),
15307
+ var SiwcGrantSchema = z23.strictObject({
15308
+ clientId: z23.string().min(1),
15309
+ sub: z23.string().min(1),
15310
+ email: z23.string().optional(),
15311
+ idToken: z23.string().min(1),
15312
+ accessToken: z23.string().min(1),
15313
+ refreshToken: z23.string().min(1),
15314
+ scopes: z23.array(z23.string()).readonly(),
15266
15315
  /** When the access token stops working, in milliseconds since the epoch. */
15267
- expiresAt: z22.number()
15316
+ expiresAt: z23.number()
15268
15317
  });
15269
- var SiwcFileSchema = z22.strictObject({ registeredClientId: z22.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
15318
+ var SiwcFileSchema = z23.strictObject({ registeredClientId: z23.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
15270
15319
  function parseSiwcFile(raw, filePath) {
15271
15320
  let json;
15272
15321
  try {
@@ -15548,6 +15597,7 @@ function realFrontDoorListenerProbes(paths) {
15548
15597
  // src/doctorReport.ts
15549
15598
  init_supervisorProcesses();
15550
15599
  init_legacy();
15600
+ init_providerAliases();
15551
15601
  init_providersStore();
15552
15602
  init_guard();
15553
15603
  init_identity();
@@ -15876,6 +15926,10 @@ function runDoctor(params) {
15876
15926
  for (const entry of params.providers) {
15877
15927
  pushProvider(push, entry, params.credentialCache, params.chatgptSignIn);
15878
15928
  }
15929
+ const providerNames = new Set(params.providers.map((entry) => entry.name));
15930
+ for (const finding of aliasFindings(params.providerAliases ?? {}, providerNames)) {
15931
+ push("provider", finding.level, finding.message, finding.alias);
15932
+ }
15879
15933
  if (params.platform !== "darwin" || params.run === void 0) {
15880
15934
  push("keychain", "pass", "Skipped (not macOS).");
15881
15935
  } else {
@@ -16165,6 +16219,7 @@ function collectDoctorReport(params) {
16165
16219
  identities,
16166
16220
  configProfiles,
16167
16221
  providers,
16222
+ providerAliases: readProviderAliases(paths),
16168
16223
  directoryRules: { path: paths.directoryRulesFile, raw: realFsPort.readFileUtf8(paths.directoryRulesFile) },
16169
16224
  globalConfig: { path: paths.globalConfigFile, raw: realFsPort.readFileUtf8(paths.globalConfigFile) },
16170
16225
  models: parsedModelsOf(paths),
@@ -16220,90 +16275,90 @@ function collectDoctorReport(params) {
16220
16275
  // src/frontdoor/controlSchemas.ts
16221
16276
  init_schema2();
16222
16277
  init_state();
16223
- var UsageListOutputSchema = z25.strictObject({ snapshots: z25.readonly(z25.array(UsageSnapshotSchema)) });
16224
- var UsageWindowsInputSchema = z25.strictObject({
16225
- identity: z25.string().min(1),
16226
- provider: z25.string().min(1).optional()
16278
+ var UsageListOutputSchema = z26.strictObject({ snapshots: z26.readonly(z26.array(UsageSnapshotSchema)) });
16279
+ var UsageWindowsInputSchema = z26.strictObject({
16280
+ identity: z26.string().min(1),
16281
+ provider: z26.string().min(1).optional()
16227
16282
  });
16228
- var EffectiveWindowSchema = z25.strictObject({
16283
+ var EffectiveWindowSchema = z26.strictObject({
16229
16284
  /** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
16230
- reset: z25.boolean(),
16285
+ reset: z26.boolean(),
16231
16286
  /** The fraction used: 0 for a reset window, otherwise what was last observed, absent when none was reported. */
16232
- utilization: z25.number().optional(),
16287
+ utilization: z26.number().optional(),
16233
16288
  /** The reset instant, for a window that has not reset yet and reported one. */
16234
- resetsAtMs: z25.number().optional(),
16289
+ resetsAtMs: z26.number().optional(),
16235
16290
  /** The window's own status, for a window that has not reset yet. */
16236
- status: z25.string().optional()
16291
+ status: z26.string().optional()
16237
16292
  });
16238
- var UsageWindowsOutputSchema = z25.strictObject({
16239
- identity: z25.string(),
16240
- provider: z25.string(),
16293
+ var UsageWindowsOutputSchema = z26.strictObject({
16294
+ identity: z26.string(),
16295
+ provider: z26.string(),
16241
16296
  /** When the rate-limit state the windows come from was observed. */
16242
- observedAt: z25.iso.datetime().optional(),
16297
+ observedAt: z26.iso.datetime().optional(),
16243
16298
  fiveHour: EffectiveWindowSchema.optional(),
16244
16299
  sevenDay: EffectiveWindowSchema.optional()
16245
16300
  });
16246
- var UsageLiveOutputSchema = z25.strictObject({
16301
+ var UsageLiveOutputSchema = z26.strictObject({
16247
16302
  /** The freshest observation the door holds, never narrowed by the read's session filter because it is the door's single latest statement of the account's quota; absent while no rate_limit_event has been filed at all. */
16248
16303
  latest: RcLiveRateLimitSchema.optional(),
16249
16304
  /** One observation per session whose stream has filed a rate_limit_event this door generation. */
16250
- sessions: z25.readonly(z25.array(RcLiveRateLimitSchema))
16305
+ sessions: z26.readonly(z26.array(RcLiveRateLimitSchema))
16251
16306
  });
16252
- var FrontDoorSessionStatusSchema = z25.strictObject({
16253
- pid: z25.int().positive(),
16254
- startedAt: z25.number(),
16255
- alive: z25.boolean()
16307
+ var FrontDoorSessionStatusSchema = z26.strictObject({
16308
+ pid: z26.int().positive(),
16309
+ startedAt: z26.number(),
16310
+ alive: z26.boolean()
16256
16311
  });
16257
- var HeadroomSocketTargetSchema = z25.union([z25.strictObject({ socketPath: z25.string() }), z25.strictObject({ refused: z25.string() })]);
16258
- var FrontDoorStatusOutputSchema = z25.strictObject({
16312
+ var HeadroomSocketTargetSchema = z26.union([z26.strictObject({ socketPath: z26.string() }), z26.strictObject({ refused: z26.string() })]);
16313
+ var FrontDoorStatusOutputSchema = z26.strictObject({
16259
16314
  state: FrontDoorStateSchema,
16260
- supervisorAlive: z25.boolean(),
16261
- sessions: z25.readonly(z25.array(FrontDoorSessionStatusSchema)),
16315
+ supervisorAlive: z26.boolean(),
16316
+ sessions: z26.readonly(z26.array(FrontDoorSessionStatusSchema)),
16262
16317
  headroomSocket: HeadroomSocketTargetSchema.optional(),
16263
- logPath: z25.string(),
16264
- logExists: z25.boolean()
16318
+ logPath: z26.string(),
16319
+ logExists: z26.boolean()
16265
16320
  });
16266
- var FrontDoorSessionsOutputSchema = z25.strictObject({ sessions: z25.readonly(z25.array(FrontDoorSessionStatusSchema)) });
16267
- var CheckRunInputSchema = z25.strictObject({
16268
- path: z25.string().min(1),
16269
- identity: z25.string().min(1).optional()
16321
+ var FrontDoorSessionsOutputSchema = z26.strictObject({ sessions: z26.readonly(z26.array(FrontDoorSessionStatusSchema)) });
16322
+ var CheckRunInputSchema = z26.strictObject({
16323
+ path: z26.string().min(1),
16324
+ identity: z26.string().min(1).optional()
16270
16325
  }).refine((input) => path32.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
16271
- var PoolPickInputSchema = z25.strictObject({
16272
- pool: z25.string().min(1),
16273
- path: z25.string().min(1)
16326
+ var PoolPickInputSchema = z26.strictObject({
16327
+ pool: z26.string().min(1),
16328
+ path: z26.string().min(1)
16274
16329
  }).refine((input) => path32.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
16275
- var DoctorFindingSchema = z25.strictObject({
16276
- section: z25.enum(DOCTOR_SECTIONS),
16277
- subject: z25.string().optional(),
16278
- severity: z25.enum(DOCTOR_SEVERITIES),
16279
- message: z25.string()
16330
+ var DoctorFindingSchema = z26.strictObject({
16331
+ section: z26.enum(DOCTOR_SECTIONS),
16332
+ subject: z26.string().optional(),
16333
+ severity: z26.enum(DOCTOR_SEVERITIES),
16334
+ message: z26.string()
16280
16335
  });
16281
- var DoctorRunOutputSchema = z25.strictObject({
16336
+ var DoctorRunOutputSchema = z26.strictObject({
16282
16337
  /** False exactly when any finding is a `fail`; a `warn` never fails the report on its own. */
16283
- ok: z25.boolean(),
16284
- findings: z25.readonly(z25.array(DoctorFindingSchema))
16338
+ ok: z26.boolean(),
16339
+ findings: z26.readonly(z26.array(DoctorFindingSchema))
16285
16340
  });
16286
- var FrontDoorRestartOutputSchema = z25.strictObject({
16287
- action: z25.literal("restarting"),
16288
- previousPid: z25.int().positive()
16341
+ var FrontDoorRestartOutputSchema = z26.strictObject({
16342
+ action: z26.literal("restarting"),
16343
+ previousPid: z26.int().positive()
16289
16344
  });
16290
- var UpdateCheckOutputSchema = z25.strictObject({
16291
- current: z25.string(),
16292
- latest: z25.string(),
16293
- action: z25.enum(["current", "available", "updated"])
16345
+ var UpdateCheckOutputSchema = z26.strictObject({
16346
+ current: z26.string(),
16347
+ latest: z26.string(),
16348
+ action: z26.enum(["current", "available", "updated"])
16294
16349
  });
16295
- var CodexSignInSchema = z25.discriminatedUnion("state", [
16296
- z25.strictObject({ state: z25.literal("none") }),
16297
- z25.strictObject({ state: z25.literal("signed-in"), email: z25.string().optional(), planScope: z25.boolean(), accessTokenExpiresAt: z25.number() }),
16298
- z25.strictObject({ state: z25.literal("unreadable"), message: z25.string() })
16350
+ var CodexSignInSchema = z26.discriminatedUnion("state", [
16351
+ z26.strictObject({ state: z26.literal("none") }),
16352
+ z26.strictObject({ state: z26.literal("signed-in"), email: z26.string().optional(), planScope: z26.boolean(), accessTokenExpiresAt: z26.number() }),
16353
+ z26.strictObject({ state: z26.literal("unreadable"), message: z26.string() })
16299
16354
  ]);
16300
- var CodexStatusOutputSchema = z25.strictObject({
16355
+ var CodexStatusOutputSchema = z26.strictObject({
16301
16356
  signIn: CodexSignInSchema,
16302
- codexProviders: z25.readonly(z25.array(z25.string()))
16357
+ codexProviders: z26.readonly(z26.array(z26.string()))
16303
16358
  });
16304
- var CodexLogoutOutputSchema = z25.strictObject({
16305
- hadGrant: z25.boolean(),
16306
- revoked: z25.boolean()
16359
+ var CodexLogoutOutputSchema = z26.strictObject({
16360
+ hadGrant: z26.boolean(),
16361
+ revoked: z26.boolean()
16307
16362
  });
16308
16363
 
16309
16364
  // src/frontdoor/codexApi.ts
@@ -16461,142 +16516,142 @@ init_providersStore();
16461
16516
 
16462
16517
  // src/frontdoor/configSchemas.ts
16463
16518
  init_schema();
16464
- import { z as z26 } from "zod";
16465
- var RemovalConfirmationSchema = z26.boolean();
16466
- var CredentialWriteSchema = (targets) => z26.strictObject({
16467
- sources: z26.array(RemoteCredentialSourceSchema).min(1).optional(),
16468
- target: z26.enum(targets).optional(),
16469
- cache: z26.union([z26.literal(false), CredentialCacheSchema]).optional()
16519
+ import { z as z27 } from "zod";
16520
+ var RemovalConfirmationSchema = z27.boolean();
16521
+ var CredentialWriteSchema = (targets) => z27.strictObject({
16522
+ sources: z27.array(RemoteCredentialSourceSchema).min(1).optional(),
16523
+ target: z27.enum(targets).optional(),
16524
+ cache: z27.union([z27.literal(false), CredentialCacheSchema]).optional()
16470
16525
  });
16471
- var CredentialSummarySchema2 = z26.strictObject({
16472
- target: z26.enum(CREDENTIAL_TARGETS),
16473
- sources: z26.readonly(z26.array(
16474
- z26.discriminatedUnion("kind", [
16475
- z26.strictObject({ kind: z26.literal("env"), variable: z26.string() }),
16476
- z26.strictObject({ kind: z26.literal("file"), path: z26.string() }),
16477
- z26.strictObject({ kind: z26.literal("command"), program: z26.string() }),
16478
- z26.strictObject({ kind: z26.literal("op"), reference: z26.string() }),
16479
- z26.strictObject({ kind: z26.literal("keychain"), service: z26.string(), account: z26.string().optional() }),
16480
- z26.strictObject({ kind: z26.literal("literal") })
16526
+ var CredentialSummarySchema2 = z27.strictObject({
16527
+ target: z27.enum(CREDENTIAL_TARGETS),
16528
+ sources: z27.readonly(z27.array(
16529
+ z27.discriminatedUnion("kind", [
16530
+ z27.strictObject({ kind: z27.literal("env"), variable: z27.string() }),
16531
+ z27.strictObject({ kind: z27.literal("file"), path: z27.string() }),
16532
+ z27.strictObject({ kind: z27.literal("command"), program: z27.string() }),
16533
+ z27.strictObject({ kind: z27.literal("op"), reference: z27.string() }),
16534
+ z27.strictObject({ kind: z27.literal("keychain"), service: z27.string(), account: z27.string().optional() }),
16535
+ z27.strictObject({ kind: z27.literal("literal") })
16481
16536
  ])
16482
16537
  )),
16483
16538
  cache: CredentialCacheSchema.optional()
16484
16539
  });
16485
- var mutationOutput = (kind, action) => z26.strictObject({ action: z26.literal(action), kind: z26.literal(kind), name: z26.string() });
16486
- var storedMutationOutput = (kind, action, value) => z26.strictObject({ action: z26.literal(action), kind: z26.literal(kind), name: z26.string(), value });
16487
- var IdentityValueSchema = z26.strictObject({
16488
- name: z26.string(),
16489
- defaultConfigProfile: z26.string().optional(),
16490
- allowAmbientCredential: z26.boolean(),
16540
+ var mutationOutput = (kind, action) => z27.strictObject({ action: z27.literal(action), kind: z27.literal(kind), name: z27.string() });
16541
+ var storedMutationOutput = (kind, action, value) => z27.strictObject({ action: z27.literal(action), kind: z27.literal(kind), name: z27.string(), value });
16542
+ var IdentityValueSchema = z27.strictObject({
16543
+ name: z27.string(),
16544
+ defaultConfigProfile: z27.string().optional(),
16545
+ allowAmbientCredential: z27.boolean(),
16491
16546
  credential: CredentialSummarySchema2.optional(),
16492
- anchors: z26.array(AnchorSchema).optional()
16547
+ anchors: z27.array(AnchorSchema).optional()
16493
16548
  });
16494
16549
  var ProfileValueSchema = ConfigProfileSchema.omit({ $schema: true });
16495
- var ProviderValueSchema = z26.strictObject({
16496
- name: z26.string(),
16497
- kind: z26.enum(PROVIDER_KINDS),
16498
- displayName: z26.string(),
16499
- baseUrl: z26.string().optional(),
16550
+ var ProviderValueSchema = z27.strictObject({
16551
+ name: z27.string(),
16552
+ kind: z27.enum(PROVIDER_KINDS),
16553
+ displayName: z27.string(),
16554
+ baseUrl: z27.string().optional(),
16500
16555
  codex: CodexProviderConfigSchema.optional(),
16501
16556
  credential: CredentialSummarySchema2.optional(),
16502
- env: z26.record(z26.string(), z26.string()).optional()
16557
+ env: z27.record(z27.string(), z27.string()).optional()
16503
16558
  });
16504
- var ConfigNameInputSchema = z26.strictObject({ name: z26.string().min(1) });
16559
+ var ConfigNameInputSchema = z27.strictObject({ name: z27.string().min(1) });
16505
16560
  var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
16506
- var ConfigIdentitySetInputSchema = z26.strictObject({
16507
- name: z26.string().min(1),
16508
- defaultConfigProfile: z26.union([z26.string().min(1), z26.literal(false)]).optional(),
16509
- allowAmbientCredential: z26.boolean().optional(),
16510
- credential: z26.union([z26.literal(false), CredentialWriteSchema(CREDENTIAL_TARGETS)]).optional(),
16561
+ var ConfigIdentitySetInputSchema = z27.strictObject({
16562
+ name: z27.string().min(1),
16563
+ defaultConfigProfile: z27.union([z27.string().min(1), z27.literal(false)]).optional(),
16564
+ allowAmbientCredential: z27.boolean().optional(),
16565
+ credential: z27.union([z27.literal(false), CredentialWriteSchema(CREDENTIAL_TARGETS)]).optional(),
16511
16566
  /** `false` removes the anchors; a list replaces them. */
16512
- anchors: z26.union([z26.literal(false), z26.array(AnchorSchema).min(1)]).optional()
16567
+ anchors: z27.union([z27.literal(false), z27.array(AnchorSchema).min(1)]).optional()
16513
16568
  });
16514
16569
  var ConfigIdentitySetOutputSchema = storedMutationOutput("identity", "updated", IdentityValueSchema);
16515
- var ConfigIdentityRemoveInputSchema = z26.strictObject({ name: z26.string().min(1), confirm: RemovalConfirmationSchema });
16570
+ var ConfigIdentityRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
16516
16571
  var ConfigIdentityRemoveOutputSchema = mutationOutput("identity", "removed");
16517
16572
  var ConfigIdentityUseOutputSchema = mutationOutput("identity", "selected");
16518
- var ConfigProfileAddInputSchema = z26.strictObject({
16519
- name: z26.string().min(1),
16520
- extends: z26.array(z26.string().min(1)).optional(),
16521
- description: z26.string().optional()
16573
+ var ConfigProfileAddInputSchema = z27.strictObject({
16574
+ name: z27.string().min(1),
16575
+ extends: z27.array(z27.string().min(1)).optional(),
16576
+ description: z27.string().optional()
16522
16577
  });
16523
16578
  var ConfigProfileAddOutputSchema = storedMutationOutput("profile", "created", ProfileValueSchema);
16524
- var ConfigProfileSetInputSchema = z26.strictObject({
16525
- name: z26.string().min(1),
16526
- category: z26.record(z26.string(), z26.boolean()).optional(),
16527
- entry: z26.record(z26.string(), z26.boolean()).optional(),
16528
- extends: z26.union([z26.array(z26.string().min(1)), z26.literal(false)]).optional(),
16529
- description: z26.union([z26.string(), z26.literal(false)]).optional(),
16530
- launch: z26.strictObject({
16531
- skipPermissions: z26.boolean().optional(),
16532
- remoteControl: z26.boolean().optional(),
16533
- headroom: z26.boolean().optional(),
16534
- trackUsage: z26.boolean().optional(),
16535
- provider: z26.union([z26.string().min(1), z26.literal(false)]).optional(),
16536
- claudeVersion: z26.union([z26.string().min(1), z26.literal(false)]).optional(),
16537
- delay: z26.union([z26.string().regex(DURATION_RE), z26.literal(false)]).optional(),
16538
- pause: z26.boolean().optional(),
16539
- explain: z26.boolean().optional()
16579
+ var ConfigProfileSetInputSchema = z27.strictObject({
16580
+ name: z27.string().min(1),
16581
+ category: z27.record(z27.string(), z27.boolean()).optional(),
16582
+ entry: z27.record(z27.string(), z27.boolean()).optional(),
16583
+ extends: z27.union([z27.array(z27.string().min(1)), z27.literal(false)]).optional(),
16584
+ description: z27.union([z27.string(), z27.literal(false)]).optional(),
16585
+ launch: z27.strictObject({
16586
+ skipPermissions: z27.boolean().optional(),
16587
+ remoteControl: z27.boolean().optional(),
16588
+ headroom: z27.boolean().optional(),
16589
+ trackUsage: z27.boolean().optional(),
16590
+ provider: z27.union([z27.string().min(1), z27.literal(false)]).optional(),
16591
+ claudeVersion: z27.union([z27.string().min(1), z27.literal(false)]).optional(),
16592
+ delay: z27.union([z27.string().regex(DURATION_RE), z27.literal(false)]).optional(),
16593
+ pause: z27.boolean().optional(),
16594
+ explain: z27.boolean().optional()
16540
16595
  }).optional()
16541
16596
  });
16542
16597
  var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
16543
- var ConfigProfileRemoveInputSchema = z26.strictObject({ name: z26.string().min(1), confirm: RemovalConfirmationSchema });
16598
+ var ConfigProfileRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
16544
16599
  var ConfigProfileRemoveOutputSchema = mutationOutput("profile", "removed");
16545
16600
  var ConfigProfileUseOutputSchema = mutationOutput("profile", "selected");
16546
- var PoolMembersInputSchema = z26.array(z26.string().min(1)).min(1);
16547
- var ConfigPoolAddInputSchema = z26.strictObject({
16548
- name: z26.string().min(1),
16601
+ var PoolMembersInputSchema = z27.array(z27.string().min(1)).min(1);
16602
+ var ConfigPoolAddInputSchema = z27.strictObject({
16603
+ name: z27.string().min(1),
16549
16604
  identities: PoolMembersInputSchema,
16550
- preference: z26.enum(POOL_PREFERENCES).optional(),
16551
- resumeOnLimit: z26.boolean().optional(),
16552
- compactBeforeLimit: z26.boolean().optional(),
16605
+ preference: z27.enum(POOL_PREFERENCES).optional(),
16606
+ resumeOnLimit: z27.boolean().optional(),
16607
+ compactBeforeLimit: z27.boolean().optional(),
16553
16608
  compactAtUtilisation: CompactAtUtilisationSchema.optional()
16554
16609
  });
16555
16610
  var ConfigPoolAddOutputSchema = storedMutationOutput("pool", "created", PoolSchema);
16556
- var ConfigPoolSetInputSchema = z26.strictObject({
16557
- name: z26.string().min(1),
16611
+ var ConfigPoolSetInputSchema = z27.strictObject({
16612
+ name: z27.string().min(1),
16558
16613
  identities: PoolMembersInputSchema.optional(),
16559
- preference: z26.union([z26.enum(POOL_PREFERENCES), z26.literal(false)]).optional(),
16560
- resumeOnLimit: z26.boolean().optional(),
16561
- compactBeforeLimit: z26.boolean().optional(),
16562
- compactAtUtilisation: z26.union([CompactAtUtilisationSchema, z26.literal(false)]).optional()
16614
+ preference: z27.union([z27.enum(POOL_PREFERENCES), z27.literal(false)]).optional(),
16615
+ resumeOnLimit: z27.boolean().optional(),
16616
+ compactBeforeLimit: z27.boolean().optional(),
16617
+ compactAtUtilisation: z27.union([CompactAtUtilisationSchema, z27.literal(false)]).optional()
16563
16618
  });
16564
16619
  var ConfigPoolSetOutputSchema = storedMutationOutput("pool", "updated", PoolSchema);
16565
- var ConfigPoolRemoveInputSchema = z26.strictObject({ name: z26.string().min(1), confirm: RemovalConfirmationSchema });
16620
+ var ConfigPoolRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
16566
16621
  var ConfigPoolRemoveOutputSchema = mutationOutput("pool", "removed");
16567
16622
  var ConfigPoolUseOutputSchema = mutationOutput("pool", "selected");
16568
- var ConfigProviderAddInputSchema = z26.strictObject({
16569
- name: z26.string().min(1),
16570
- kind: z26.enum(PROVIDER_KINDS).optional(),
16571
- displayName: z26.string().min(1),
16572
- baseUrl: z26.string().min(1).optional(),
16623
+ var ConfigProviderAddInputSchema = z27.strictObject({
16624
+ name: z27.string().min(1),
16625
+ kind: z27.enum(PROVIDER_KINDS).optional(),
16626
+ displayName: z27.string().min(1),
16627
+ baseUrl: z27.string().min(1).optional(),
16573
16628
  credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).required({ sources: true }),
16574
16629
  codex: CodexProviderConfigSchema.optional()
16575
16630
  });
16576
16631
  var ConfigProviderAddOutputSchema = storedMutationOutput("provider", "created", ProviderValueSchema);
16577
- var ConfigProviderSetInputSchema = z26.strictObject({
16578
- name: z26.string().min(1),
16579
- displayName: z26.string().min(1).optional(),
16580
- baseUrl: z26.string().min(1).optional(),
16632
+ var ConfigProviderSetInputSchema = z27.strictObject({
16633
+ name: z27.string().min(1),
16634
+ displayName: z27.string().min(1).optional(),
16635
+ baseUrl: z27.string().min(1).optional(),
16581
16636
  credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).optional(),
16582
16637
  codex: CodexProviderConfigSchema.optional()
16583
16638
  });
16584
16639
  var ConfigProviderSetOutputSchema = storedMutationOutput("provider", "updated", ProviderValueSchema);
16585
- var ConfigProviderRemoveInputSchema = z26.strictObject({ name: z26.string().min(1), confirm: RemovalConfirmationSchema });
16640
+ var ConfigProviderRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
16586
16641
  var ConfigProviderRemoveOutputSchema = mutationOutput("provider", "removed");
16587
- var ConfigRuleAddInputSchema = z26.strictObject({
16588
- path: z26.string().min(1),
16589
- configProfile: z26.string().min(1).optional(),
16590
- identity: z26.string().min(1).optional()
16642
+ var ConfigRuleAddInputSchema = z27.strictObject({
16643
+ path: z27.string().min(1),
16644
+ configProfile: z27.string().min(1).optional(),
16645
+ identity: z27.string().min(1).optional()
16591
16646
  });
16592
16647
  var ConfigRuleAddOutputSchema = storedMutationOutput("rule", "created", DirectoryRuleSchema);
16593
- var ConfigRuleSetInputSchema = z26.strictObject({
16594
- path: z26.string().min(1),
16595
- configProfile: z26.union([z26.string().min(1), z26.literal(false)]).optional(),
16596
- identity: z26.union([z26.string().min(1), z26.literal(false)]).optional()
16648
+ var ConfigRuleSetInputSchema = z27.strictObject({
16649
+ path: z27.string().min(1),
16650
+ configProfile: z27.union([z27.string().min(1), z27.literal(false)]).optional(),
16651
+ identity: z27.union([z27.string().min(1), z27.literal(false)]).optional()
16597
16652
  });
16598
16653
  var ConfigRuleSetOutputSchema = storedMutationOutput("rule", "updated", DirectoryRuleSchema);
16599
- var ConfigRuleRemoveInputSchema = z26.strictObject({ path: z26.string().min(1), confirm: RemovalConfirmationSchema });
16654
+ var ConfigRuleRemoveInputSchema = z27.strictObject({ path: z27.string().min(1), confirm: RemovalConfirmationSchema });
16600
16655
  var ConfigRuleRemoveOutputSchema = mutationOutput("rule", "removed");
16601
16656
 
16602
16657
  // src/frontdoor/configApi.ts
@@ -16907,43 +16962,43 @@ import { openapi as openapi4 } from "@orpc/openapi";
16907
16962
  import { eventIterator as eventIterator2, withEventMeta as withEventMeta2 } from "@orpc/server";
16908
16963
 
16909
16964
  // src/frontdoor/eventSchemas.ts
16910
- import { z as z27 } from "zod";
16965
+ import { z as z28 } from "zod";
16911
16966
  var DOOR_EVENT_SOURCE_RC = "rc";
16912
16967
  var LAUNCH_EVENT_SOURCE = "launch";
16913
16968
  var USAGE_EVENT_SOURCE = "usage";
16914
16969
  var DOOR_HEALTH_EVENT_SOURCE = "door";
16915
16970
  var QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
16916
- var DoorEventSchema = z27.strictObject({
16917
- source: z27.string().min(1),
16971
+ var DoorEventSchema = z28.strictObject({
16972
+ source: z28.string().min(1),
16918
16973
  /** A positive integer because the backbone's counters start at one and only ever increase. */
16919
- sequence: z27.number().int().positive(),
16920
- payload: z27.unknown()
16974
+ sequence: z28.number().int().positive(),
16975
+ payload: z28.unknown()
16921
16976
  });
16922
- var DoorEventSourceQuerySchema = z27.strictObject({
16923
- sources: z27.array(z27.string().min(1)).min(1).optional()
16977
+ var DoorEventSourceQuerySchema = z28.strictObject({
16978
+ sources: z28.array(z28.string().min(1)).min(1).optional()
16924
16979
  });
16925
- var LaunchLifecycleEventSchema = z27.strictObject({
16926
- kind: z27.enum(["registered", "pruned", "ended"]),
16927
- pid: z27.number().int().positive(),
16928
- startedAt: z27.number(),
16929
- observedAt: z27.number()
16980
+ var LaunchLifecycleEventSchema = z28.strictObject({
16981
+ kind: z28.enum(["registered", "pruned", "ended"]),
16982
+ pid: z28.number().int().positive(),
16983
+ startedAt: z28.number(),
16984
+ observedAt: z28.number()
16930
16985
  });
16931
- var DoorHealthEventSchema = z27.discriminatedUnion("kind", [
16932
- z27.strictObject({ kind: z27.literal("generation"), pid: z27.number().int().positive(), providerPort: z27.number().int().positive(), connectPort: z27.number().int().positive(), directPort: z27.number().int().positive(), observedAt: z27.number() }),
16933
- z27.strictObject({ kind: z27.literal("listenerFailed"), pid: z27.number().int().positive(), listener: z27.enum(["provider", "connect", "direct"]), message: z27.string(), observedAt: z27.number() }),
16934
- z27.strictObject({ kind: z27.literal("binaryTurnover"), pid: z27.number().int().positive(), observedAt: z27.number() }),
16935
- z27.strictObject({ kind: z27.literal("idleShutdown"), pid: z27.number().int().positive(), observedAt: z27.number() }),
16936
- z27.strictObject({ kind: z27.literal("superseded"), pid: z27.number().int().positive(), ownerPid: z27.number().int().positive(), observedAt: z27.number() }),
16937
- z27.strictObject({ kind: z27.literal("drained"), pid: z27.number().int().positive(), observedAt: z27.number() })
16986
+ var DoorHealthEventSchema = z28.discriminatedUnion("kind", [
16987
+ z28.strictObject({ kind: z28.literal("generation"), pid: z28.number().int().positive(), providerPort: z28.number().int().positive(), connectPort: z28.number().int().positive(), directPort: z28.number().int().positive(), observedAt: z28.number() }),
16988
+ z28.strictObject({ kind: z28.literal("listenerFailed"), pid: z28.number().int().positive(), listener: z28.enum(["provider", "connect", "direct"]), message: z28.string(), observedAt: z28.number() }),
16989
+ z28.strictObject({ kind: z28.literal("binaryTurnover"), pid: z28.number().int().positive(), observedAt: z28.number() }),
16990
+ z28.strictObject({ kind: z28.literal("idleShutdown"), pid: z28.number().int().positive(), observedAt: z28.number() }),
16991
+ z28.strictObject({ kind: z28.literal("superseded"), pid: z28.number().int().positive(), ownerPid: z28.number().int().positive(), observedAt: z28.number() }),
16992
+ z28.strictObject({ kind: z28.literal("drained"), pid: z28.number().int().positive(), observedAt: z28.number() })
16938
16993
  ]);
16939
- var QuotaExpiringEventSchema = z27.strictObject({
16940
- identity: z27.string().min(1),
16941
- provider: z27.string().min(1),
16942
- window: z27.enum(["fiveHour", "sevenDay"]),
16994
+ var QuotaExpiringEventSchema = z28.strictObject({
16995
+ identity: z28.string().min(1),
16996
+ provider: z28.string().min(1),
16997
+ window: z28.enum(["fiveHour", "sevenDay"]),
16943
16998
  /** The fraction of the window already used when it was seen expiring, always below one because a fully used window has nothing left to spend. */
16944
- utilization: z27.number().min(0).max(1),
16945
- resetsAt: z27.iso.datetime(),
16946
- observedAt: z27.number()
16999
+ utilization: z28.number().min(0).max(1),
17000
+ resetsAt: z28.iso.datetime(),
17001
+ observedAt: z28.number()
16947
17002
  });
16948
17003
 
16949
17004
  // src/frontdoor/eventsApi.ts
@@ -17027,55 +17082,55 @@ import { openapi as openapi6 } from "@orpc/openapi";
17027
17082
 
17028
17083
  // src/frontdoor/launchSchemas.ts
17029
17084
  import path33 from "node:path";
17030
- import { z as z28 } from "zod";
17085
+ import { z as z29 } from "zod";
17031
17086
  init_claudeVersion();
17032
17087
  init_identity();
17033
- var LaunchResolveInputSchema = z28.strictObject({
17034
- path: z28.string().min(1),
17088
+ var LaunchResolveInputSchema = z29.strictObject({
17089
+ path: z29.string().min(1),
17035
17090
  /** `@name`, launch flags, then the arguments for `claude`; empty for a bare launch. */
17036
- argv: z28.readonly(z28.array(z28.string())).optional(),
17091
+ argv: z29.readonly(z29.array(z29.string())).optional(),
17037
17092
  /** The launch's inherited environment. Absent means an empty one: the door's own environment is never a substitute for the caller's, so a caller that wants `AGENT_SHIM_*` switches or a `CLAUDE_CONFIG_DIR` considered names them here. Values are read, never reported. */
17038
- env: z28.record(z28.string(), z28.string()).optional()
17093
+ env: z29.record(z29.string(), z29.string()).optional()
17039
17094
  }).refine((input) => path33.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
17040
- var LaunchPoolDecisionSchema = z28.strictObject({
17041
- name: z28.string(),
17042
- reasons: z28.readonly(z28.array(z28.string())),
17043
- movedOff: z28.strictObject({ identity: z28.string(), reason: z28.string() }).optional()
17095
+ var LaunchPoolDecisionSchema = z29.strictObject({
17096
+ name: z29.string(),
17097
+ reasons: z29.readonly(z29.array(z29.string())),
17098
+ movedOff: z29.strictObject({ identity: z29.string(), reason: z29.string() }).optional()
17044
17099
  });
17045
- var LaunchDecisionSchema = z28.strictObject({
17046
- identity: z28.string().optional(),
17047
- identitySource: z28.enum(IDENTITY_DECISION_SOURCES),
17100
+ var LaunchDecisionSchema = z29.strictObject({
17101
+ identity: z29.string().optional(),
17102
+ identitySource: z29.enum(IDENTITY_DECISION_SOURCES),
17048
17103
  pool: LaunchPoolDecisionSchema.optional(),
17049
- configDirEscapeHatch: z28.boolean(),
17050
- configDir: z28.string().optional(),
17051
- configProfile: z28.string().optional(),
17052
- configProfileSource: z28.enum(CONFIG_PROFILE_DECISION_SOURCES),
17053
- provider: z28.string().optional()
17104
+ configDirEscapeHatch: z29.boolean(),
17105
+ configDir: z29.string().optional(),
17106
+ configProfile: z29.string().optional(),
17107
+ configProfileSource: z29.enum(CONFIG_PROFILE_DECISION_SOURCES),
17108
+ provider: z29.string().optional()
17054
17109
  });
17055
- var LaunchFlagsSchema = z28.strictObject({
17056
- skipPermissions: z28.boolean(),
17057
- remoteControl: z28.boolean(),
17058
- headroom: z28.boolean(),
17059
- trackUsage: z28.boolean(),
17060
- pause: z28.boolean(),
17061
- explain: z28.boolean(),
17110
+ var LaunchFlagsSchema = z29.strictObject({
17111
+ skipPermissions: z29.boolean(),
17112
+ remoteControl: z29.boolean(),
17113
+ headroom: z29.boolean(),
17114
+ trackUsage: z29.boolean(),
17115
+ pause: z29.boolean(),
17116
+ explain: z29.boolean(),
17062
17117
  /** How long the launch waits after its own output before it starts claude, in milliseconds. */
17063
- delayMs: z28.number()
17118
+ delayMs: z29.number()
17064
17119
  });
17065
- var LaunchResolveOutputSchema = z28.strictObject({
17120
+ var LaunchResolveOutputSchema = z29.strictObject({
17066
17121
  decision: LaunchDecisionSchema,
17067
17122
  flags: LaunchFlagsSchema,
17068
- claudeVersion: z28.strictObject({ version: z28.string(), source: z28.enum(CLAUDE_VERSION_SOURCES) }).optional(),
17123
+ claudeVersion: z29.strictObject({ version: z29.string(), source: z29.enum(CLAUDE_VERSION_SOURCES) }).optional(),
17069
17124
  /** The real `claude` binary the launch would spawn, on the door's host. */
17070
- bin: z28.string(),
17125
+ bin: z29.string(),
17071
17126
  /** The arguments the launch would pass it: the tool's own flags, then `CLAUDE_EXTRA_FLAGS`, then the caller's own. */
17072
- args: z28.readonly(z28.array(z28.string())),
17127
+ args: z29.readonly(z29.array(z29.string())),
17073
17128
  /** The credential the launch would authenticate with, by target and source kinds. Absent when none applies. */
17074
- credential: z28.strictObject({ subject: z28.enum(["provider", "identity"]), name: z28.string(), summary: CredentialSummarySchema }).optional(),
17075
- routing: z28.strictObject({ frontDoor: z28.boolean(), headroom: z28.boolean() }),
17129
+ credential: z29.strictObject({ subject: z29.enum(["provider", "identity"]), name: z29.string(), summary: CredentialSummarySchema }).optional(),
17130
+ routing: z29.strictObject({ frontDoor: z29.boolean(), headroom: z29.boolean() }),
17076
17131
  /** The names of the environment variables the launch would set or unset, sorted. Values are not reported. */
17077
- environment: z28.readonly(z28.array(z28.string())),
17078
- warnings: z28.readonly(z28.array(z28.string()))
17132
+ environment: z29.readonly(z29.array(z29.string())),
17133
+ warnings: z29.readonly(z29.array(z29.string()))
17079
17134
  });
17080
17135
 
17081
17136
  // src/frontdoor/launchApi.ts
@@ -17111,22 +17166,22 @@ function createLaunchApiRouter(deps) {
17111
17166
  // src/frontdoor/agentTreesApi.ts
17112
17167
  import { ORPCError as ORPCError6 } from "@orpc/client";
17113
17168
  import { openapi as openapi7 } from "@orpc/openapi";
17114
- import { z as z29 } from "zod";
17169
+ import { z as z30 } from "zod";
17115
17170
  init_cliError();
17116
- var AgentTreesListInputSchema = z29.strictObject({
17171
+ var AgentTreesListInputSchema = z30.strictObject({
17117
17172
  /** Only this identity's sessions. */
17118
- identity: z29.string().optional(),
17173
+ identity: z30.string().optional(),
17119
17174
  /** Include sessions that spawned no agent and ran no workflow. */
17120
- all: z29.boolean().optional()
17175
+ all: z30.boolean().optional()
17121
17176
  });
17122
- var AgentTreesListOutputSchema = z29.array(SessionSummarySchema);
17123
- var AgentTreesShowInputSchema = z29.strictObject({
17177
+ var AgentTreesListOutputSchema = z30.array(SessionSummarySchema);
17178
+ var AgentTreesShowInputSchema = z30.strictObject({
17124
17179
  /** A session id, or an unambiguous prefix of one. */
17125
- session: z29.string().min(1),
17180
+ session: z30.string().min(1),
17126
17181
  /** Look only in this identity. */
17127
- identity: z29.string().optional()
17182
+ identity: z30.string().optional()
17128
17183
  });
17129
- var AgentTreesShowOutputSchema = z29.strictObject({ identities: z29.array(z29.string()), ...MergedAgentTreeSchema.shape });
17184
+ var AgentTreesShowOutputSchema = z30.strictObject({ identities: z30.array(z30.string()), ...MergedAgentTreeSchema.shape });
17130
17185
  function asBadRequest(error) {
17131
17186
  if (error instanceof CliError) {
17132
17187
  throw new ORPCError6("BAD_REQUEST", { message: error.message });
@@ -19309,7 +19364,7 @@ init_poolPick();
19309
19364
 
19310
19365
  // src/agents/read.ts
19311
19366
  import path35 from "node:path";
19312
- import { z as z30 } from "zod";
19367
+ import { z as z31 } from "zod";
19313
19368
  var PROJECTS_DIR = "projects";
19314
19369
  var TASKS_DIR = "tasks";
19315
19370
  var SUBAGENTS_DIR = "subagents";
@@ -19428,14 +19483,14 @@ function parseJson2(text) {
19428
19483
  return void 0;
19429
19484
  }
19430
19485
  }
19431
- var TaskFileSchema = z30.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: z30.array(z30.string()).default([]), blockedBy: z30.array(z30.string()).default([]) });
19432
- var WorkflowRunFileSchema = z30.object({
19433
- runId: z30.string(),
19434
- workflowName: z30.string().optional(),
19435
- status: z30.string().optional(),
19436
- startTime: z30.number().optional(),
19437
- phases: z30.array(z30.object({ title: z30.string() })).default([]),
19438
- summary: z30.string().optional()
19486
+ var TaskFileSchema = z31.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: z31.array(z31.string()).default([]), blockedBy: z31.array(z31.string()).default([]) });
19487
+ var WorkflowRunFileSchema = z31.object({
19488
+ runId: z31.string(),
19489
+ workflowName: z31.string().optional(),
19490
+ status: z31.string().optional(),
19491
+ startTime: z31.number().optional(),
19492
+ phases: z31.array(z31.object({ title: z31.string() })).default([]),
19493
+ summary: z31.string().optional()
19439
19494
  });
19440
19495
  function summariseSession(fs13, configDir, ref) {
19441
19496
  const sessionRelative = path35.join(PROJECTS_DIR, ref.project, ref.entry);