claude-use 11.45.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,8 +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
- routeByName: z.boolean().optional(),
276
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. */
277
275
  explain: z.boolean().optional()
278
276
  });
@@ -1451,9 +1449,6 @@ function flattenLayers(layers, options) {
1451
1449
  if (layer.launch.explain !== void 0) {
1452
1450
  launch.explain = layer.launch.explain;
1453
1451
  }
1454
- if (layer.launch.routeByName !== void 0) {
1455
- launch.routeByName = layer.launch.routeByName;
1456
- }
1457
1452
  }
1458
1453
  if (layer.models !== void 0) {
1459
1454
  models = mergeModels(models, layer.models);
@@ -2906,7 +2901,7 @@ var init_capability = __esm({
2906
2901
  });
2907
2902
 
2908
2903
  // src/frontdoor/route.ts
2909
- var IDENTITY_HEADER, SESSION_HEADER, PROVIDER_HEADER, HEADROOM_FLAG_HEADER, ROUTE_BY_NAME_HEADER, PROJECT_ID_HEADER, AUTH_HEADER;
2904
+ var IDENTITY_HEADER, SESSION_HEADER, PROVIDER_HEADER, HEADROOM_FLAG_HEADER, PROJECT_ID_HEADER, AUTH_HEADER;
2910
2905
  var init_route = __esm({
2911
2906
  "src/frontdoor/route.ts"() {
2912
2907
  "use strict";
@@ -2914,7 +2909,6 @@ var init_route = __esm({
2914
2909
  SESSION_HEADER = "x-agent-shim-session";
2915
2910
  PROVIDER_HEADER = "x-agent-shim-provider";
2916
2911
  HEADROOM_FLAG_HEADER = "x-agent-shim-headroom";
2917
- ROUTE_BY_NAME_HEADER = "x-agent-shim-route-by-name";
2918
2912
  PROJECT_ID_HEADER = "x-headroom-project-id";
2919
2913
  AUTH_HEADER = "x-agent-shim-auth";
2920
2914
  }
@@ -3054,7 +3048,7 @@ var init_state = __esm({
3054
3048
  "src/frontdoor/state.ts"() {
3055
3049
  "use strict";
3056
3050
  init_schema();
3057
- FRONT_DOOR_PROTOCOL = 4;
3051
+ FRONT_DOOR_PROTOCOL = 5;
3058
3052
  FrontDoorSessionSchema = z3.strictObject({ pid: z3.number().int().positive(), startedAt: z3.number(), token: z3.string().min(1), supervisorPid: z3.number().int().positive().optional(), sessionId: z3.string().min(1).optional(), models: ModelsConfigSchema.optional() });
3059
3053
  FrontDoorStateSchema = z3.strictObject({
3060
3054
  /**
@@ -3127,7 +3121,7 @@ var init_package = __esm({
3127
3121
  "package.json"() {
3128
3122
  package_default = {
3129
3123
  name: "claude-use",
3130
- version: "11.45.0",
3124
+ version: "11.47.0",
3131
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.",
3132
3126
  license: "MIT",
3133
3127
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -6431,9 +6425,6 @@ function applyProfileChange(paths, name, change) {
6431
6425
  if (change.launchExplain !== void 0) {
6432
6426
  launchPatch.explain = change.launchExplain;
6433
6427
  }
6434
- if (change.launchRouteByName !== void 0) {
6435
- launchPatch.routeByName = change.launchRouteByName;
6436
- }
6437
6428
  if (Object.keys(launchPatch).length > 0) {
6438
6429
  setProfileLaunchFlags(paths, name, launchPatch);
6439
6430
  touched = true;
@@ -6504,6 +6495,7 @@ function buildLayoutPaths(root) {
6504
6495
  identitiesDir: path23.join(root, "identities"),
6505
6496
  configProfilesDir: path23.join(root, "config-profiles"),
6506
6497
  providersDir: path23.join(root, "providers"),
6498
+ providerAliasesFile: path23.join(root, "provider-aliases.json"),
6507
6499
  directoryRulesFile: path23.join(root, "directory-rules.json"),
6508
6500
  activeIdentityFile: path23.join(root, "active-identity"),
6509
6501
  globalConfigFile: path23.join(root, "config.json"),
@@ -6716,6 +6708,50 @@ var init_realCredentialCache = __esm({
6716
6708
  }
6717
6709
  });
6718
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
+
6719
6755
  // src/credential.ts
6720
6756
  function commandArgv(source) {
6721
6757
  if ("command" in source) {
@@ -7122,6 +7158,11 @@ var init_families = __esm({
7122
7158
  // src/providersStore.ts
7123
7159
  import fs7 from "node:fs";
7124
7160
  import path25 from "node:path";
7161
+ function requireValidProviderName(name) {
7162
+ if (!PROVIDER_NAME_RE.test(name)) {
7163
+ throw new InvalidProviderNameError(name);
7164
+ }
7165
+ }
7125
7166
  function providerJsonPath(paths, name) {
7126
7167
  return path25.join(paths.providersDir, `${name}.json`);
7127
7168
  }
@@ -7242,9 +7283,7 @@ function addProvider(paths, name, input) {
7242
7283
  if (providerExists(paths, name)) {
7243
7284
  throw new ProviderAlreadyExistsError(name);
7244
7285
  }
7245
- if (!PROVIDER_NAME_RE.test(name)) {
7246
- throw new InvalidProviderNameError(name);
7247
- }
7286
+ requireValidProviderName(name);
7248
7287
  const kind = input.kind ?? "http";
7249
7288
  if (kind === "codex" && input.baseUrl !== void 0) {
7250
7289
  throw new ProviderKindMismatchError("A codex provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
@@ -7375,10 +7414,11 @@ function cascadeProviderName(cascade) {
7375
7414
  }
7376
7415
  function selectProvider(params) {
7377
7416
  const cliName = params.cliProvider !== void 0 && params.cliProvider !== "" ? params.cliProvider : void 0;
7378
- const name = cliName ?? (params.cascade === void 0 ? void 0 : cascadeProviderName(params.cascade));
7379
- if (name === void 0) {
7417
+ const named = cliName ?? (params.cascade === void 0 ? void 0 : cascadeProviderName(params.cascade));
7418
+ if (named === void 0) {
7380
7419
  return void 0;
7381
7420
  }
7421
+ const name = canonicalProviderName(named, (candidate) => loadProvider(params.paths.providersDir, candidate, params.port) !== void 0, () => loadProviderAliases(params.paths.providerAliasesFile, params.port));
7382
7422
  const definition = loadProvider(params.paths.providersDir, name, params.port);
7383
7423
  if (definition === void 0) {
7384
7424
  const known = listProviderNames(params.port.readdir, params.paths.providersDir);
@@ -7476,6 +7516,7 @@ var init_providersStore = __esm({
7476
7516
  init_unrecognisedKeys();
7477
7517
  init_schema();
7478
7518
  init_cliError();
7519
+ init_providerAliases();
7479
7520
  init_credential();
7480
7521
  init_walk();
7481
7522
  init_families();
@@ -7724,7 +7765,7 @@ var init_commandDeps = __esm({
7724
7765
  // src/claudeShim.ts
7725
7766
  import fs8 from "node:fs";
7726
7767
  import path28 from "node:path";
7727
- import { z as z19 } from "zod";
7768
+ import { z as z20 } from "zod";
7728
7769
  function commandFilename(ownExecutablePath, commandName) {
7729
7770
  return ownExecutablePath.toLowerCase().endsWith(".exe") ? `${commandName}.exe` : commandName;
7730
7771
  }
@@ -7774,10 +7815,10 @@ var init_claudeShim = __esm({
7774
7815
  init_store();
7775
7816
  init_realPorts();
7776
7817
  init_cliError();
7777
- ClaudeShimStateSchema = z19.strictObject({
7778
- targetPath: z19.string().min(1),
7779
- method: z19.enum(["hardlink", "copy"]),
7780
- installedAtMs: z19.number()
7818
+ ClaudeShimStateSchema = z20.strictObject({
7819
+ targetPath: z20.string().min(1),
7820
+ method: z20.enum(["hardlink", "copy"]),
7821
+ installedAtMs: z20.number()
7781
7822
  });
7782
7823
  nodeLinkFs = { link: fs8.linkSync, copyFile: fs8.copyFileSync, chmod: fs8.chmodSync };
7783
7824
  }
@@ -7873,62 +7914,62 @@ var init_signatures = __esm({
7873
7914
  });
7874
7915
 
7875
7916
  // src/codex/anthropic.ts
7876
- import { z as z23 } from "zod";
7917
+ import { z as z24 } from "zod";
7877
7918
  var TextBlockSchema, Base64ImageSourceSchema, UrlImageSourceSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultContentBlockSchema, ToolResultBlockSchema, OtherBlockSchema, ContentBlockSchema, MessageSchema, ToolSchema, ToolChoiceSchema, SystemSchema, MessagesRequestSchema, CountTokensRequestSchema;
7878
7919
  var init_anthropic = __esm({
7879
7920
  "src/codex/anthropic.ts"() {
7880
7921
  "use strict";
7881
- TextBlockSchema = z23.looseObject({ type: z23.literal("text"), text: z23.string() });
7882
- Base64ImageSourceSchema = z23.looseObject({ type: z23.literal("base64"), media_type: z23.string().min(1), data: z23.string() });
7883
- UrlImageSourceSchema = z23.looseObject({ type: z23.literal("url"), url: z23.string().min(1) });
7884
- ImageBlockSchema = z23.looseObject({
7885
- type: z23.literal("image"),
7886
- 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])
7887
7928
  });
7888
- ToolUseBlockSchema = z23.looseObject({
7889
- type: z23.literal("tool_use"),
7890
- id: z23.string().min(1),
7891
- name: z23.string().min(1),
7892
- 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()
7893
7934
  });
7894
- ToolResultContentBlockSchema = z23.union([TextBlockSchema, z23.looseObject({ type: z23.string() })]);
7895
- ToolResultBlockSchema = z23.looseObject({
7896
- type: z23.literal("tool_result"),
7897
- tool_use_id: z23.string().min(1),
7898
- 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()
7899
7940
  });
7900
- OtherBlockSchema = z23.looseObject({ type: z23.string() });
7901
- ContentBlockSchema = z23.union([TextBlockSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultBlockSchema, OtherBlockSchema]);
7902
- MessageSchema = z23.looseObject({
7903
- role: z23.enum(["user", "assistant", "system"]),
7904
- 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)])
7905
7946
  });
7906
- ToolSchema = z23.looseObject({
7907
- name: z23.string().min(1),
7908
- description: z23.string().optional(),
7909
- 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()
7910
7951
  });
7911
- ToolChoiceSchema = z23.union([
7912
- z23.looseObject({ type: z23.enum(["auto", "none", "any"]) }),
7913
- 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) })
7914
7955
  ]);
7915
- SystemSchema = z23.union([z23.string(), z23.array(z23.union([TextBlockSchema, OtherBlockSchema]))]);
7916
- MessagesRequestSchema = z23.looseObject({
7917
- 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(),
7918
7959
  system: SystemSchema.optional(),
7919
- messages: z23.array(MessageSchema),
7920
- tools: z23.array(ToolSchema).optional(),
7960
+ messages: z24.array(MessageSchema),
7961
+ tools: z24.array(ToolSchema).optional(),
7921
7962
  tool_choice: ToolChoiceSchema.optional(),
7922
- stream: z23.boolean().optional(),
7963
+ stream: z24.boolean().optional(),
7923
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. */
7924
- metadata: z23.looseObject({ user_id: z23.string().optional() }).optional(),
7965
+ metadata: z24.looseObject({ user_id: z24.string().optional() }).optional(),
7925
7966
  /** Claude Code's effort setting. Any string is accepted; the translator honours only the levels the backend understands. */
7926
- output_config: z23.looseObject({ effort: z23.string().optional() }).optional()
7967
+ output_config: z24.looseObject({ effort: z24.string().optional() }).optional()
7927
7968
  });
7928
- CountTokensRequestSchema = z23.looseObject({
7929
- system: z23.unknown().optional(),
7930
- messages: z23.unknown().optional(),
7931
- tools: z23.unknown().optional()
7969
+ CountTokensRequestSchema = z24.looseObject({
7970
+ system: z24.unknown().optional(),
7971
+ messages: z24.unknown().optional(),
7972
+ tools: z24.unknown().optional()
7932
7973
  });
7933
7974
  }
7934
7975
  });
@@ -8013,7 +8054,7 @@ var init_translate2 = __esm({
8013
8054
  // src/providerCatalogue.ts
8014
8055
  import path30 from "node:path";
8015
8056
  import picomatch4 from "picomatch";
8016
- import { z as z24 } from "zod";
8057
+ import { z as z25 } from "zod";
8017
8058
  function catalogueCachePath(paths, name) {
8018
8059
  return path30.join(paths.catalogueDir, `${name}.json`);
8019
8060
  }
@@ -8048,8 +8089,8 @@ var init_providerCatalogue = __esm({
8048
8089
  CATALOGUE_REQUEST_SECONDS = 10;
8049
8090
  CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND5;
8050
8091
  CATALOGUE_REFRESH_TIMEOUT_MS = DEFAULT_CANDIDATE_URLS * CATALOGUE_REQUEST_TIMEOUT_MS;
8051
- CatalogueModelSchema = z24.strictObject({ id: z24.string().min(1), name: z24.string().min(1).optional() });
8052
- 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) });
8053
8094
  }
8054
8095
  });
8055
8096
 
@@ -8135,7 +8176,7 @@ function providerModelRows(provider, catalogue = []) {
8135
8176
  const taken = new Set(named.map((row) => labelOf(row.model)));
8136
8177
  return [...named, ...catalogueRows(provider, catalogue).filter((row) => !taken.has(labelOf(row.model)))];
8137
8178
  }
8138
- function routedModelRows(models, providers, bare = true) {
8179
+ function routedModelRows(models, providers) {
8139
8180
  const hidden = new Set(models.hide ?? []);
8140
8181
  const shown = models.show === void 0 ? void 0 : new Set(models.show);
8141
8182
  const visible = (model) => shown === void 0 ? !hidden.has(model) : shown.has(model);
@@ -8143,17 +8184,17 @@ function routedModelRows(models, providers, bare = true) {
8143
8184
  const concreteByRef = new Map(concrete.map((row) => [row.model, row]));
8144
8185
  const families = buildFamilies([...concrete.map((row) => row.model), ...accountRefsOf(models)], models);
8145
8186
  const handlingOf = (refs) => refs.map((ref) => concreteByRef.get(ref)?.behavesAs).find((behavesAs) => behavesAs !== void 0) ?? TIER_BEHAVES_AS.sonnet;
8146
- const virtual = bare ? Object.entries(models.virtual ?? {}).flatMap(([name, definition]) => {
8187
+ const virtual = Object.entries(models.virtual ?? {}).flatMap(([name, definition]) => {
8147
8188
  if (!visible(name)) {
8148
8189
  return [];
8149
8190
  }
8150
8191
  const targets = expandFamilyMembers(safeExpand(name, models), families);
8151
8192
  return [{ model: name, label: name, description: `Virtual (${definition.mode})`, behavesAs: handlingOf(targets) }];
8152
- }) : [];
8153
- const familyRows = bare ? sharedFamilies(families).flatMap((family) => {
8193
+ });
8194
+ const familyRows = sharedFamilies(families).flatMap((family) => {
8154
8195
  const member = `${FAMILY_PREFIX}${family.key}`;
8155
8196
  return visible(member) ? [{ model: member, label: family.key, description: `Family (${familyMode(family.settings)}): ${family.refs.join(", ")}`, behavesAs: handlingOf(family.refs) }] : [];
8156
- }) : [];
8197
+ });
8157
8198
  return [...virtual, ...familyRows, ...concrete.filter((row) => visible(row.model))];
8158
8199
  }
8159
8200
  function safeExpand(name, models) {
@@ -8633,8 +8674,7 @@ var init_argv = __esm({
8633
8674
  { flag: "--remote-control", key: "remoteControl" },
8634
8675
  { flag: "--wait", key: "wait" },
8635
8676
  { flag: "--pause", key: "pause" },
8636
- { flag: "--explain", key: "explain" },
8637
- { flag: "--route-by-name", key: "routeByName" }
8677
+ { flag: "--explain", key: "explain" }
8638
8678
  ];
8639
8679
  LAUNCHER_FLAG_NAMES = [
8640
8680
  ...VALUED_FLAGS,
@@ -8825,7 +8865,6 @@ function resolveLaunchFlags(params) {
8825
8865
  trackUsage: params.flags?.trackUsage ?? parseEnvBool("AGENT_SHIM_TRACK_USAGE", params.env.AGENT_SHIM_TRACK_USAGE) ?? params.cascade?.trackUsage ?? true,
8826
8866
  pause: params.flags?.pause ?? parseEnvBool("AGENT_SHIM_PAUSE", params.env.AGENT_SHIM_PAUSE) ?? params.cascade?.pause ?? false,
8827
8867
  explain: params.flags?.explain ?? parseEnvBool("AGENT_SHIM_EXPLAIN", params.env.AGENT_SHIM_EXPLAIN) ?? params.cascade?.explain ?? false,
8828
- routeByName: params.flags?.routeByName ?? parseEnvBool("AGENT_SHIM_ROUTE_BY_NAME", params.env.AGENT_SHIM_ROUTE_BY_NAME) ?? params.cascade?.routeByName ?? false,
8829
8868
  delayMs: resolveDelayMs(params)
8830
8869
  };
8831
8870
  }
@@ -8874,12 +8913,10 @@ function buildEnv(params) {
8874
8913
  env[key] = value;
8875
8914
  }
8876
8915
  }
8877
- if (params.routeByName) {
8878
- for (const tier of CLAUDE_TIERS) {
8879
- const ref = params.tierModels?.[tier];
8880
- if (ref !== void 0) {
8881
- env[`ANTHROPIC_DEFAULT_${tier.toUpperCase()}_MODEL`] = ref;
8882
- }
8916
+ for (const tier of CLAUDE_TIERS) {
8917
+ const ref = params.tierModels?.[tier];
8918
+ if (ref !== void 0) {
8919
+ env[`ANTHROPIC_DEFAULT_${tier.toUpperCase()}_MODEL`] = ref;
8883
8920
  }
8884
8921
  }
8885
8922
  if (params.provider !== void 0) {
@@ -8902,7 +8939,6 @@ function buildEnv(params) {
8902
8939
  { name: SESSION_HEADER, value: params.sessionId },
8903
8940
  { name: AUTH_HEADER, value: params.frontdoor.sessionToken },
8904
8941
  ...params.provider === void 0 ? [] : [{ name: PROVIDER_HEADER, value: params.provider.name }],
8905
- ...params.routeByName ? [{ name: ROUTE_BY_NAME_HEADER, value: "1" }] : [],
8906
8942
  ...params.headroom === void 0 ? [] : [
8907
8943
  { name: HEADROOM_FLAG_HEADER, value: "1" },
8908
8944
  { name: PROJECT_ID_HEADER, value: params.headroom.projectId }
@@ -9682,7 +9718,6 @@ function decideLaunch(params, readOnly) {
9682
9718
  ...parsedArgv.trackUsage === void 0 ? {} : { trackUsage: parsedArgv.trackUsage },
9683
9719
  ...parsedArgv.pause === void 0 ? {} : { pause: parsedArgv.pause },
9684
9720
  ...parsedArgv.explain === void 0 ? {} : { explain: parsedArgv.explain },
9685
- ...parsedArgv.routeByName === void 0 ? {} : { routeByName: parsedArgv.routeByName },
9686
9721
  ...parsedArgv.delay === void 0 ? {} : { delay: parsedArgv.delay }
9687
9722
  }
9688
9723
  });
@@ -9692,7 +9727,6 @@ function decideLaunch(params, readOnly) {
9692
9727
  notes.push(`${loginlessProvider.identity} has no stored login, so Remote Control is off; provider ${loginlessProvider.provider} runs without it`);
9693
9728
  }
9694
9729
  const flags = loginlessProvider === void 0 ? requestedFlags : { ...requestedFlags, remoteControl: false };
9695
- const routesByName = flags.routeByName || selectedProvider !== void 0 && isRouterProvider(selectedProvider.definition);
9696
9730
  const globalModels = loadConfigFile(paths.globalConfigFile, GlobalConfigSchema, params.fs.readConfigFile)?.config.models;
9697
9731
  const models = launchCascade !== void 0 && params.farm !== void 0 ? cascadeModels : globalModels;
9698
9732
  const listedProviders = listProviderNames(fs13.readdir, paths.providersDir).flatMap((name) => {
@@ -9703,7 +9737,7 @@ function decideLaunch(params, readOnly) {
9703
9737
  return [];
9704
9738
  }
9705
9739
  });
9706
- const pickerSettings = modelPickerSettingsFromRows(routedModelRows(models ?? {}, listedProviders, routesByName), selectedProvider !== void 0);
9740
+ const pickerSettings = modelPickerSettingsFromRows(routedModelRows(models ?? {}, listedProviders), selectedProvider !== void 0);
9707
9741
  const callerSettings = hasSettingsArgument(parsedArgv.rest);
9708
9742
  if (pickerSettings !== void 0 && callerSettings) {
9709
9743
  notes.push("--settings was passed, so /model keeps Claude Code's own model names");
@@ -9807,8 +9841,8 @@ function prepareLaunch(params) {
9807
9841
  if (decided.pinnedVersion !== void 0) {
9808
9842
  rows.push(pinnedVersionRow(decided.pinnedVersion.version, decided.pinnedVersion.source));
9809
9843
  }
9810
- const routesByName = resolvedFlags.routeByName || resolvedProvider !== void 0 && isRouterProvider(resolvedProvider.definition);
9811
- if (routesByName) {
9844
+ const namesResolved = decided.models !== void 0;
9845
+ if (namesResolved) {
9812
9846
  const check = resolveRoutedProviderCredentials({ paths, port: params.fs, env, ...params.credentials === void 0 ? {} : { credentials: params.credentials }, models: decided.models, targets: () => targetRefs(paths) });
9813
9847
  if (!check.ok) {
9814
9848
  log.error(check.message);
@@ -9849,7 +9883,6 @@ function prepareLaunch(params) {
9849
9883
  ...headroom === void 0 ? {} : { headroom },
9850
9884
  sessionId,
9851
9885
  remoteControl: resolvedFlags.remoteControl,
9852
- routeByName: routesByName,
9853
9886
  ...decided.models?.tiers === void 0 ? {} : { tierModels: decided.models.tiers }
9854
9887
  });
9855
9888
  const releases = [...headroom === void 0 || headroomPort === void 0 ? [] : [headroomPort.release], ...frontDoorRelease === void 0 ? [] : [frontDoorRelease]];
@@ -9877,8 +9910,7 @@ function resolveLaunch(params) {
9877
9910
  ...frontDoor ? { frontdoor: { port: 0, connectPort: 0, trustBundlePath: "", sessionToken: "" } } : {},
9878
9911
  ...decided.flags.headroom ? { headroom: { socketPath: "", projectId: "" } } : {},
9879
9912
  sessionId: "",
9880
- remoteControl: decided.flags.remoteControl,
9881
- routeByName: decided.flags.routeByName
9913
+ remoteControl: decided.flags.remoteControl
9882
9914
  });
9883
9915
  const credentialNames = decided.identityCredentialBlock === void 0 ? [] : Object.keys(credentialVariables(decided.identityCredentialBlock.target ?? "bearer", ""));
9884
9916
  const environment = [.../* @__PURE__ */ new Set([...Object.keys(built).filter((name) => built[name] !== env[name]), ...credentialNames])].sort();
@@ -9890,7 +9922,7 @@ function resolveLaunch(params) {
9890
9922
  bin: decided.bin,
9891
9923
  args: decided.args,
9892
9924
  ...credential === void 0 ? {} : { credential },
9893
- routing: { frontDoor, headroom: decided.flags.headroom, routeByName: decided.flags.routeByName },
9925
+ routing: { frontDoor, headroom: decided.flags.headroom },
9894
9926
  environment
9895
9927
  };
9896
9928
  }
@@ -10419,7 +10451,7 @@ var init_identityClaude = __esm({
10419
10451
  });
10420
10452
 
10421
10453
  // src/usage/providerQuota.ts
10422
- import { z as z31 } from "zod";
10454
+ import { z as z32 } from "zod";
10423
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;
10424
10456
  var init_providerQuota = __esm({
10425
10457
  "src/usage/providerQuota.ts"() {
@@ -10438,35 +10470,35 @@ var init_providerQuota = __esm({
10438
10470
  [ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND9],
10439
10471
  [ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9]
10440
10472
  ]);
10441
- ZaiLimitSchema = z31.object({
10442
- type: z31.string(),
10443
- unit: z31.number().int(),
10444
- number: z31.number().int().positive(),
10445
- percentage: z31.number().nonnegative(),
10446
- nextResetTime: z31.number().positive().optional(),
10447
- usage: z31.number().nonnegative().optional(),
10448
- currentValue: z31.number().nonnegative().optional(),
10449
- 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()
10450
10482
  });
10451
- ZaiResponseSchema = z31.object({
10452
- success: z31.boolean(),
10453
- msg: z31.string().optional(),
10454
- 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) })
10455
10487
  });
10456
10488
  OPENROUTER_HOST = "openrouter.ai";
10457
10489
  OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
10458
10490
  OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
10459
10491
  MS_PER_DAY3 = HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
10460
- OpenRouterKeySchema = z31.object({
10461
- data: z31.object({
10462
- limit: z31.number().nonnegative().nullable(),
10463
- limit_remaining: z31.number().nullable(),
10464
- limit_reset: z31.string().nullable(),
10465
- is_free_tier: z31.boolean().optional(),
10466
- 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()
10467
10499
  })
10468
10500
  });
10469
- 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() }) });
10470
10502
  ANTIGRAVITY_HOST = "daily-cloudcode-pa.googleapis.com";
10471
10503
  ANTIGRAVITY_QUOTA_URL = `https://${ANTIGRAVITY_HOST}/v1internal:retrieveUserQuotaSummary`;
10472
10504
  ANTIGRAVITY_USER_URL = `https://${ANTIGRAVITY_HOST}/v1internal:loadCodeAssist`;
@@ -10474,21 +10506,21 @@ var init_providerQuota = __esm({
10474
10506
  DAYS_PER_WEEK2 = 7;
10475
10507
  FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
10476
10508
  WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
10477
- AntigravityBucketSchema = z31.object({
10478
- bucketId: z31.string(),
10479
- remainingFraction: z31.number().optional(),
10480
- resetTime: z31.string().optional()
10509
+ AntigravityBucketSchema = z32.object({
10510
+ bucketId: z32.string(),
10511
+ remainingFraction: z32.number().optional(),
10512
+ resetTime: z32.string().optional()
10481
10513
  });
10482
- AntigravitySummarySchema = z31.object({ groups: z31.array(z31.object({ buckets: z31.array(AntigravityBucketSchema) })) });
10483
- GoogleTokenInfoSchema = z31.object({
10484
- email: z31.string().optional(),
10485
- 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()
10486
10518
  });
10487
- AntigravityUserSchema = z31.object({
10519
+ AntigravityUserSchema = z32.object({
10488
10520
  /** The code-assist tier context, which defaults to the free tier for every account. */
10489
- 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(),
10490
10522
  /** The account's paid subscription; absent when the account has none. */
10491
- 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()
10492
10524
  });
10493
10525
  }
10494
10526
  });
@@ -14416,7 +14448,7 @@ init_providersStore();
14416
14448
  init_projects();
14417
14449
  init_pipeline();
14418
14450
  import path27 from "node:path";
14419
- import { z as z15 } from "zod";
14451
+ import { z as z16 } from "zod";
14420
14452
  var HISTORY_PROJECTS_KEY_PREFIX = "history/projects/";
14421
14453
  function projectFragmentOf(rawKey) {
14422
14454
  return rawKey.startsWith(HISTORY_PROJECTS_KEY_PREFIX) ? rawKey.slice(HISTORY_PROJECTS_KEY_PREFIX.length) : void 0;
@@ -14485,9 +14517,9 @@ function lookupKeychainService(run, farmRoot) {
14485
14517
  }
14486
14518
  return { checked: true, found: true, serviceName, note: `Keychain service name for this identity: "${serviceName}".` };
14487
14519
  }
14488
- var SettingsSecretsShapeSchema = z15.looseObject({
14489
- env: z15.record(z15.string(), z15.unknown()).optional(),
14490
- 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()
14491
14523
  });
14492
14524
  function hookCommandCountOf(group) {
14493
14525
  if (typeof group !== "object" || group === null) {
@@ -14784,7 +14816,7 @@ init_schema();
14784
14816
  init_claudeVersion();
14785
14817
  init_identity();
14786
14818
  init_projects();
14787
- import { z as z17 } from "zod";
14819
+ import { z as z18 } from "zod";
14788
14820
 
14789
14821
  // src/resolve/types.ts
14790
14822
  var LAYER_KINDS = [
@@ -14845,123 +14877,123 @@ var DIAGNOSTIC_SEVERITIES = ["error", "warning", "info"];
14845
14877
 
14846
14878
  // src/usage/pickReportSchema.ts
14847
14879
  init_plan2();
14848
- import { z as z16 } from "zod";
14849
- var PoolPickCandidateViewSchema = z16.strictObject({
14850
- identity: z16.string(),
14880
+ import { z as z17 } from "zod";
14881
+ var PoolPickCandidateViewSchema = z17.strictObject({
14882
+ identity: z17.string(),
14851
14883
  /** In pick order: `scored` has usable quota data, `unknown` has none, `pay-per-use` bills by use, `ineligible` is refused right now. */
14852
- class: z16.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
14884
+ class: z17.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
14853
14885
  /** Plan-size-weighted remaining quota per hour until its reset; present for `scored` only. */
14854
- score: z16.number().optional(),
14886
+ score: z17.number().optional(),
14855
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`. */
14856
- scoreWindow: z16.enum(["sevenDay", "fiveHour"]).optional(),
14888
+ scoreWindow: z17.enum(["sevenDay", "fiveHour"]).optional(),
14857
14889
  /** False when the five-hour window would run dry, at the observed pace, before it resets. */
14858
- feasible: z16.boolean(),
14890
+ feasible: z17.boolean(),
14859
14891
  /** When an `ineligible` member can be used again, as an ISO instant. */
14860
- blockedUntil: z16.iso.datetime().optional(),
14892
+ blockedUntil: z17.iso.datetime().optional(),
14861
14893
  plan: PlanClassSchema,
14862
14894
  /** The facts behind the class and score, in the order they matter. */
14863
- reasons: z16.array(z16.string())
14895
+ reasons: z17.array(z17.string())
14864
14896
  });
14865
- var PoolPickReportSchema = z16.strictObject({
14866
- pool: z16.string(),
14867
- directory: z16.string(),
14897
+ var PoolPickReportSchema = z17.strictObject({
14898
+ pool: z17.string(),
14899
+ directory: z17.string(),
14868
14900
  /** The member a launch would run as, absent when every member is refused. */
14869
- pick: z16.string().optional(),
14870
- candidates: z16.array(PoolPickCandidateViewSchema),
14901
+ pick: z17.string().optional(),
14902
+ candidates: z17.array(PoolPickCandidateViewSchema),
14871
14903
  /** Identity members anywhere in the pool's graph that do not exist; a launch skips them. */
14872
- missing: z16.array(z16.string()),
14904
+ missing: z17.array(z17.string()),
14873
14905
  /** When nothing can be picked, the soonest any member returns. */
14874
- earliestReturn: z16.strictObject({ identity: z16.string(), at: z16.iso.datetime() }).optional(),
14906
+ earliestReturn: z17.strictObject({ identity: z17.string(), at: z17.iso.datetime() }).optional(),
14875
14907
  /** The member a resumed conversation started on but moved off, and why, when the ranking could not keep it. */
14876
- movedOff: z16.strictObject({ identity: z16.string(), reason: z16.string() }).optional(),
14908
+ movedOff: z17.strictObject({ identity: z17.string(), reason: z17.string() }).optional(),
14877
14909
  /** Why the last-pick record could not be read, when that is the case. */
14878
- stickyProblem: z16.string().optional()
14910
+ stickyProblem: z17.string().optional()
14879
14911
  });
14880
14912
 
14881
14913
  // src/checkReportSchema.ts
14882
14914
  var CHECK_CREDENTIAL_APPLIES = ["provider", "identity", "stored-login"];
14883
- var CheckLayerViewSchema = z17.strictObject({
14884
- id: z17.int(),
14885
- kind: z17.enum(LAYER_KINDS),
14886
- source: z17.string()
14915
+ var CheckLayerViewSchema = z18.strictObject({
14916
+ id: z18.int(),
14917
+ kind: z18.enum(LAYER_KINDS),
14918
+ source: z18.string()
14887
14919
  });
14888
- var CheckEntryViewSchema = z17.strictObject({
14889
- path: z17.string(),
14890
- shared: z17.boolean(),
14891
- via: z17.enum(DECISION_VIAS),
14920
+ var CheckEntryViewSchema = z18.strictObject({
14921
+ path: z18.string(),
14922
+ shared: z18.boolean(),
14923
+ via: z18.enum(DECISION_VIAS),
14892
14924
  /** The entry's real category, or null when nothing classifies it. */
14893
- category: z17.enum(CATEGORY_NAMES).nullable(),
14894
- 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(),
14895
14927
  /** Rules that matched but whose `when` condition failed, each with the conditions that failed. */
14896
- 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()
14897
14929
  });
14898
- var CheckDiagnosticSchema = z17.strictObject({
14899
- code: z17.enum(DIAGNOSTIC_CODES),
14900
- severity: z17.enum(DIAGNOSTIC_SEVERITIES),
14901
- message: z17.string(),
14902
- subject: z17.string().optional(),
14903
- 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()
14904
14936
  });
14905
- var CheckAmbientCredentialSchema = z17.union([z17.strictObject({ ok: z17.literal(true) }), z17.strictObject({ ok: z17.literal(false), variable: z17.string(), message: z17.string() })]);
14906
- var CheckKeychainSchema = z17.strictObject({
14907
- checked: z17.literal(true),
14908
- found: z17.boolean(),
14909
- serviceName: z17.string().optional(),
14910
- 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()
14911
14943
  });
14912
- var CheckSettingsExposureSchema = z17.strictObject({
14913
- file: z17.string(),
14914
- envKeyNames: z17.readonly(z17.array(z17.string())),
14915
- hookEventNames: z17.readonly(z17.array(z17.string())),
14916
- 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()
14917
14949
  });
14918
- var CredentialSourceSummarySchema = z17.union([
14919
- z17.strictObject({ kind: z17.literal("env"), variable: z17.string() }),
14920
- z17.strictObject({ kind: z17.literal("file"), path: z17.string() }),
14921
- z17.strictObject({ kind: z17.literal("command"), program: z17.string() }),
14922
- z17.strictObject({ kind: z17.literal("op"), reference: z17.string() }),
14923
- z17.strictObject({ kind: z17.literal("keychain"), service: z17.string(), account: z17.string().optional() }),
14924
- 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") })
14925
14957
  ]);
14926
- var CredentialSummarySchema = z17.strictObject({
14927
- target: z17.enum(CREDENTIAL_TARGETS),
14928
- sources: z17.readonly(z17.array(CredentialSourceSummarySchema)),
14958
+ var CredentialSummarySchema = z18.strictObject({
14959
+ target: z18.enum(CREDENTIAL_TARGETS),
14960
+ sources: z18.readonly(z18.array(CredentialSourceSummarySchema)),
14929
14961
  cache: CredentialCacheSchema.optional()
14930
14962
  });
14931
- var CachedCredentialStateSchema = z17.union([
14932
- z17.strictObject({ store: z17.enum(CREDENTIAL_CACHE_STORES), status: z17.literal("empty") }),
14933
- z17.strictObject({ store: z17.enum(CREDENTIAL_CACHE_STORES), status: z17.literal("unreadable"), reason: z17.string() }),
14934
- 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() })
14935
14967
  ]);
14936
- var CheckCredentialProviderSchema = z17.union([
14937
- z17.strictObject({ name: z17.string(), credential: CredentialSummarySchema.optional(), cached: CachedCredentialStateSchema.optional() }),
14938
- 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() })
14939
14971
  ]);
14940
- var CheckCredentialSchema = z17.strictObject({
14941
- applies: z17.enum(CHECK_CREDENTIAL_APPLIES),
14972
+ var CheckCredentialSchema = z18.strictObject({
14973
+ applies: z18.enum(CHECK_CREDENTIAL_APPLIES),
14942
14974
  provider: CheckCredentialProviderSchema.optional(),
14943
14975
  identity: CredentialSummarySchema.optional(),
14944
14976
  identityCached: CachedCredentialStateSchema.optional()
14945
14977
  });
14946
- var CheckClaudeVersionSchema = z17.strictObject({
14947
- pinned: z17.strictObject({ version: z17.string(), source: z17.enum(CLAUDE_VERSION_SOURCES), installed: z17.boolean() }).optional(),
14948
- highestInstalled: z17.string().optional(),
14949
- 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()))
14950
14982
  });
14951
- var CheckReportJsonSchema = z17.strictObject({
14952
- 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) }),
14953
14985
  /** The pool ranking, when the launch named a pool instead of an identity. */
14954
14986
  pool: PoolPickReportSchema.optional(),
14955
- configProfile: z17.strictObject({ name: z17.string().nullable(), source: z17.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
14956
- layers: z17.readonly(z17.array(CheckLayerViewSchema)),
14957
- entries: z17.readonly(z17.array(CheckEntryViewSchema)),
14958
- projectEncodingAmbiguities: z17.readonly(
14959
- 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() }))
14960
14992
  ),
14961
- diagnostics: z17.readonly(z17.array(CheckDiagnosticSchema)),
14993
+ diagnostics: z18.readonly(z18.array(CheckDiagnosticSchema)),
14962
14994
  ambientCredential: CheckAmbientCredentialSchema,
14963
14995
  keychain: CheckKeychainSchema.optional(),
14964
- settingsExposure: z17.readonly(z17.array(CheckSettingsExposureSchema)),
14996
+ settingsExposure: z18.readonly(z18.array(CheckSettingsExposureSchema)),
14965
14997
  credential: CheckCredentialSchema,
14966
14998
  claudeVersion: CheckClaudeVersionSchema.optional()
14967
14999
  });
@@ -15021,28 +15053,28 @@ function collectResets(snapshots, nowMs) {
15021
15053
  }
15022
15054
 
15023
15055
  // src/usage/resetsSchema.ts
15024
- import { z as z18 } from "zod";
15025
- var ResetRowSchema = z18.strictObject({
15026
- identity: z18.string(),
15027
- provider: z18.string(),
15056
+ import { z as z19 } from "zod";
15057
+ var ResetRowSchema = z19.strictObject({
15058
+ identity: z19.string(),
15059
+ provider: z19.string(),
15028
15060
  /** What the window is: `5h`, `7d` or `extra usage` for an Anthropic account, or the provider's own measure and period (`tokens 5h`). */
15029
- window: z18.string(),
15061
+ window: z19.string(),
15030
15062
  /** When the state the window comes from was observed, as an ISO instant. */
15031
- observedAt: z18.iso.datetime(),
15063
+ observedAt: z19.iso.datetime(),
15032
15064
  /** When the window resets, as an ISO instant; absent when the upstream reported none. */
15033
- resetsAt: z18.iso.datetime().optional(),
15065
+ resetsAt: z19.iso.datetime().optional(),
15034
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. */
15035
- reset: z18.boolean(),
15067
+ reset: z19.boolean(),
15036
15068
  /** The fraction used, as `effectiveWindow` reads it at the report's own clock. */
15037
- utilization: z18.number().optional(),
15069
+ utilization: z19.number().optional(),
15038
15070
  /** The window's own status, for a window that has not reset yet. */
15039
- status: z18.string().optional()
15071
+ status: z19.string().optional()
15040
15072
  });
15041
- var ResetScheduleSchema = z18.strictObject({ resets: z18.readonly(z18.array(ResetRowSchema)) });
15073
+ var ResetScheduleSchema = z19.strictObject({ resets: z19.readonly(z19.array(ResetRowSchema)) });
15042
15074
 
15043
15075
  // src/frontdoor/controlSchemas.ts
15044
15076
  import path32 from "node:path";
15045
- import { z as z25 } from "zod";
15077
+ import { z as z26 } from "zod";
15046
15078
 
15047
15079
  // src/doctorReport.ts
15048
15080
  init_claudeShim();
@@ -15222,24 +15254,24 @@ import path31 from "node:path";
15222
15254
  init_signIn();
15223
15255
 
15224
15256
  // src/codex/siwcStore.ts
15225
- import { z as z22 } from "zod";
15257
+ import { z as z23 } from "zod";
15226
15258
 
15227
15259
  // src/codex/auth.ts
15228
- import { z as z20 } from "zod";
15229
- var AuthFileSchema = z20.looseObject({
15230
- tokens: z20.looseObject({
15231
- access_token: z20.string().optional(),
15232
- refresh_token: z20.string().optional(),
15233
- id_token: z20.string().optional(),
15234
- 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()
15235
15267
  }).nullish(),
15236
- last_refresh: z20.string().optional()
15268
+ last_refresh: z21.string().optional()
15237
15269
  });
15238
- var TokenGrantSchema = z20.looseObject({
15239
- access_token: z20.string().min(1).optional(),
15240
- refresh_token: z20.string().min(1).optional(),
15241
- id_token: z20.string().min(1).optional(),
15242
- 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()
15243
15275
  });
15244
15276
  var CodexAuthError = class extends Error {
15245
15277
  constructor(message) {
@@ -15249,41 +15281,41 @@ var CodexAuthError = class extends Error {
15249
15281
  };
15250
15282
 
15251
15283
  // src/codex/siwc.ts
15252
- import { z as z21 } from "zod";
15284
+ import { z as z22 } from "zod";
15253
15285
  var SIWC_RESOURCE = "https://api.openai.com/v1";
15254
15286
  var SIWC_RESPONSES_URL = `${SIWC_RESOURCE}/responses`;
15255
15287
  var SIWC_PLAN_SCOPE = "chatgpt.tokens.use.direct";
15256
- var TokenResponseSchema = z21.looseObject({
15257
- access_token: z21.string().min(1),
15258
- refresh_token: z21.string().min(1).optional(),
15259
- id_token: z21.string().min(1).optional(),
15260
- expires_in: z21.number().positive(),
15261
- 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()
15262
15294
  });
15263
- var JwtHeaderSchema = z21.looseObject({ alg: z21.string(), kid: z21.string().optional() });
15264
- var IdTokenClaimsSchema = z21.looseObject({
15265
- iss: z21.string(),
15266
- sub: z21.string().min(1),
15267
- aud: z21.union([z21.string(), z21.array(z21.string())]),
15268
- exp: z21.number(),
15269
- nonce: z21.string().optional(),
15270
- 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()
15271
15303
  });
15272
- 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() })) });
15273
15305
 
15274
15306
  // src/codex/siwcStore.ts
15275
- var SiwcGrantSchema = z22.strictObject({
15276
- clientId: z22.string().min(1),
15277
- sub: z22.string().min(1),
15278
- email: z22.string().optional(),
15279
- idToken: z22.string().min(1),
15280
- accessToken: z22.string().min(1),
15281
- refreshToken: z22.string().min(1),
15282
- 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(),
15283
15315
  /** When the access token stops working, in milliseconds since the epoch. */
15284
- expiresAt: z22.number()
15316
+ expiresAt: z23.number()
15285
15317
  });
15286
- 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() });
15287
15319
  function parseSiwcFile(raw, filePath) {
15288
15320
  let json;
15289
15321
  try {
@@ -15565,6 +15597,7 @@ function realFrontDoorListenerProbes(paths) {
15565
15597
  // src/doctorReport.ts
15566
15598
  init_supervisorProcesses();
15567
15599
  init_legacy();
15600
+ init_providerAliases();
15568
15601
  init_providersStore();
15569
15602
  init_guard();
15570
15603
  init_identity();
@@ -15893,6 +15926,10 @@ function runDoctor(params) {
15893
15926
  for (const entry of params.providers) {
15894
15927
  pushProvider(push, entry, params.credentialCache, params.chatgptSignIn);
15895
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
+ }
15896
15933
  if (params.platform !== "darwin" || params.run === void 0) {
15897
15934
  push("keychain", "pass", "Skipped (not macOS).");
15898
15935
  } else {
@@ -16182,6 +16219,7 @@ function collectDoctorReport(params) {
16182
16219
  identities,
16183
16220
  configProfiles,
16184
16221
  providers,
16222
+ providerAliases: readProviderAliases(paths),
16185
16223
  directoryRules: { path: paths.directoryRulesFile, raw: realFsPort.readFileUtf8(paths.directoryRulesFile) },
16186
16224
  globalConfig: { path: paths.globalConfigFile, raw: realFsPort.readFileUtf8(paths.globalConfigFile) },
16187
16225
  models: parsedModelsOf(paths),
@@ -16237,90 +16275,90 @@ function collectDoctorReport(params) {
16237
16275
  // src/frontdoor/controlSchemas.ts
16238
16276
  init_schema2();
16239
16277
  init_state();
16240
- var UsageListOutputSchema = z25.strictObject({ snapshots: z25.readonly(z25.array(UsageSnapshotSchema)) });
16241
- var UsageWindowsInputSchema = z25.strictObject({
16242
- identity: z25.string().min(1),
16243
- 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()
16244
16282
  });
16245
- var EffectiveWindowSchema = z25.strictObject({
16283
+ var EffectiveWindowSchema = z26.strictObject({
16246
16284
  /** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
16247
- reset: z25.boolean(),
16285
+ reset: z26.boolean(),
16248
16286
  /** The fraction used: 0 for a reset window, otherwise what was last observed, absent when none was reported. */
16249
- utilization: z25.number().optional(),
16287
+ utilization: z26.number().optional(),
16250
16288
  /** The reset instant, for a window that has not reset yet and reported one. */
16251
- resetsAtMs: z25.number().optional(),
16289
+ resetsAtMs: z26.number().optional(),
16252
16290
  /** The window's own status, for a window that has not reset yet. */
16253
- status: z25.string().optional()
16291
+ status: z26.string().optional()
16254
16292
  });
16255
- var UsageWindowsOutputSchema = z25.strictObject({
16256
- identity: z25.string(),
16257
- provider: z25.string(),
16293
+ var UsageWindowsOutputSchema = z26.strictObject({
16294
+ identity: z26.string(),
16295
+ provider: z26.string(),
16258
16296
  /** When the rate-limit state the windows come from was observed. */
16259
- observedAt: z25.iso.datetime().optional(),
16297
+ observedAt: z26.iso.datetime().optional(),
16260
16298
  fiveHour: EffectiveWindowSchema.optional(),
16261
16299
  sevenDay: EffectiveWindowSchema.optional()
16262
16300
  });
16263
- var UsageLiveOutputSchema = z25.strictObject({
16301
+ var UsageLiveOutputSchema = z26.strictObject({
16264
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. */
16265
16303
  latest: RcLiveRateLimitSchema.optional(),
16266
16304
  /** One observation per session whose stream has filed a rate_limit_event this door generation. */
16267
- sessions: z25.readonly(z25.array(RcLiveRateLimitSchema))
16305
+ sessions: z26.readonly(z26.array(RcLiveRateLimitSchema))
16268
16306
  });
16269
- var FrontDoorSessionStatusSchema = z25.strictObject({
16270
- pid: z25.int().positive(),
16271
- startedAt: z25.number(),
16272
- alive: z25.boolean()
16307
+ var FrontDoorSessionStatusSchema = z26.strictObject({
16308
+ pid: z26.int().positive(),
16309
+ startedAt: z26.number(),
16310
+ alive: z26.boolean()
16273
16311
  });
16274
- var HeadroomSocketTargetSchema = z25.union([z25.strictObject({ socketPath: z25.string() }), z25.strictObject({ refused: z25.string() })]);
16275
- var FrontDoorStatusOutputSchema = z25.strictObject({
16312
+ var HeadroomSocketTargetSchema = z26.union([z26.strictObject({ socketPath: z26.string() }), z26.strictObject({ refused: z26.string() })]);
16313
+ var FrontDoorStatusOutputSchema = z26.strictObject({
16276
16314
  state: FrontDoorStateSchema,
16277
- supervisorAlive: z25.boolean(),
16278
- sessions: z25.readonly(z25.array(FrontDoorSessionStatusSchema)),
16315
+ supervisorAlive: z26.boolean(),
16316
+ sessions: z26.readonly(z26.array(FrontDoorSessionStatusSchema)),
16279
16317
  headroomSocket: HeadroomSocketTargetSchema.optional(),
16280
- logPath: z25.string(),
16281
- logExists: z25.boolean()
16318
+ logPath: z26.string(),
16319
+ logExists: z26.boolean()
16282
16320
  });
16283
- var FrontDoorSessionsOutputSchema = z25.strictObject({ sessions: z25.readonly(z25.array(FrontDoorSessionStatusSchema)) });
16284
- var CheckRunInputSchema = z25.strictObject({
16285
- path: z25.string().min(1),
16286
- 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()
16287
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" });
16288
- var PoolPickInputSchema = z25.strictObject({
16289
- pool: z25.string().min(1),
16290
- path: z25.string().min(1)
16326
+ var PoolPickInputSchema = z26.strictObject({
16327
+ pool: z26.string().min(1),
16328
+ path: z26.string().min(1)
16291
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" });
16292
- var DoctorFindingSchema = z25.strictObject({
16293
- section: z25.enum(DOCTOR_SECTIONS),
16294
- subject: z25.string().optional(),
16295
- severity: z25.enum(DOCTOR_SEVERITIES),
16296
- 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()
16297
16335
  });
16298
- var DoctorRunOutputSchema = z25.strictObject({
16336
+ var DoctorRunOutputSchema = z26.strictObject({
16299
16337
  /** False exactly when any finding is a `fail`; a `warn` never fails the report on its own. */
16300
- ok: z25.boolean(),
16301
- findings: z25.readonly(z25.array(DoctorFindingSchema))
16338
+ ok: z26.boolean(),
16339
+ findings: z26.readonly(z26.array(DoctorFindingSchema))
16302
16340
  });
16303
- var FrontDoorRestartOutputSchema = z25.strictObject({
16304
- action: z25.literal("restarting"),
16305
- previousPid: z25.int().positive()
16341
+ var FrontDoorRestartOutputSchema = z26.strictObject({
16342
+ action: z26.literal("restarting"),
16343
+ previousPid: z26.int().positive()
16306
16344
  });
16307
- var UpdateCheckOutputSchema = z25.strictObject({
16308
- current: z25.string(),
16309
- latest: z25.string(),
16310
- 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"])
16311
16349
  });
16312
- var CodexSignInSchema = z25.discriminatedUnion("state", [
16313
- z25.strictObject({ state: z25.literal("none") }),
16314
- z25.strictObject({ state: z25.literal("signed-in"), email: z25.string().optional(), planScope: z25.boolean(), accessTokenExpiresAt: z25.number() }),
16315
- 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() })
16316
16354
  ]);
16317
- var CodexStatusOutputSchema = z25.strictObject({
16355
+ var CodexStatusOutputSchema = z26.strictObject({
16318
16356
  signIn: CodexSignInSchema,
16319
- codexProviders: z25.readonly(z25.array(z25.string()))
16357
+ codexProviders: z26.readonly(z26.array(z26.string()))
16320
16358
  });
16321
- var CodexLogoutOutputSchema = z25.strictObject({
16322
- hadGrant: z25.boolean(),
16323
- revoked: z25.boolean()
16359
+ var CodexLogoutOutputSchema = z26.strictObject({
16360
+ hadGrant: z26.boolean(),
16361
+ revoked: z26.boolean()
16324
16362
  });
16325
16363
 
16326
16364
  // src/frontdoor/codexApi.ts
@@ -16478,143 +16516,142 @@ init_providersStore();
16478
16516
 
16479
16517
  // src/frontdoor/configSchemas.ts
16480
16518
  init_schema();
16481
- import { z as z26 } from "zod";
16482
- var RemovalConfirmationSchema = z26.boolean();
16483
- var CredentialWriteSchema = (targets) => z26.strictObject({
16484
- sources: z26.array(RemoteCredentialSourceSchema).min(1).optional(),
16485
- target: z26.enum(targets).optional(),
16486
- 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()
16487
16525
  });
16488
- var CredentialSummarySchema2 = z26.strictObject({
16489
- target: z26.enum(CREDENTIAL_TARGETS),
16490
- sources: z26.readonly(z26.array(
16491
- z26.discriminatedUnion("kind", [
16492
- z26.strictObject({ kind: z26.literal("env"), variable: z26.string() }),
16493
- z26.strictObject({ kind: z26.literal("file"), path: z26.string() }),
16494
- z26.strictObject({ kind: z26.literal("command"), program: z26.string() }),
16495
- z26.strictObject({ kind: z26.literal("op"), reference: z26.string() }),
16496
- z26.strictObject({ kind: z26.literal("keychain"), service: z26.string(), account: z26.string().optional() }),
16497
- 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") })
16498
16536
  ])
16499
16537
  )),
16500
16538
  cache: CredentialCacheSchema.optional()
16501
16539
  });
16502
- var mutationOutput = (kind, action) => z26.strictObject({ action: z26.literal(action), kind: z26.literal(kind), name: z26.string() });
16503
- var storedMutationOutput = (kind, action, value) => z26.strictObject({ action: z26.literal(action), kind: z26.literal(kind), name: z26.string(), value });
16504
- var IdentityValueSchema = z26.strictObject({
16505
- name: z26.string(),
16506
- defaultConfigProfile: z26.string().optional(),
16507
- 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(),
16508
16546
  credential: CredentialSummarySchema2.optional(),
16509
- anchors: z26.array(AnchorSchema).optional()
16547
+ anchors: z27.array(AnchorSchema).optional()
16510
16548
  });
16511
16549
  var ProfileValueSchema = ConfigProfileSchema.omit({ $schema: true });
16512
- var ProviderValueSchema = z26.strictObject({
16513
- name: z26.string(),
16514
- kind: z26.enum(PROVIDER_KINDS),
16515
- displayName: z26.string(),
16516
- 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(),
16517
16555
  codex: CodexProviderConfigSchema.optional(),
16518
16556
  credential: CredentialSummarySchema2.optional(),
16519
- env: z26.record(z26.string(), z26.string()).optional()
16557
+ env: z27.record(z27.string(), z27.string()).optional()
16520
16558
  });
16521
- var ConfigNameInputSchema = z26.strictObject({ name: z26.string().min(1) });
16559
+ var ConfigNameInputSchema = z27.strictObject({ name: z27.string().min(1) });
16522
16560
  var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
16523
- var ConfigIdentitySetInputSchema = z26.strictObject({
16524
- name: z26.string().min(1),
16525
- defaultConfigProfile: z26.union([z26.string().min(1), z26.literal(false)]).optional(),
16526
- allowAmbientCredential: z26.boolean().optional(),
16527
- 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(),
16528
16566
  /** `false` removes the anchors; a list replaces them. */
16529
- 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()
16530
16568
  });
16531
16569
  var ConfigIdentitySetOutputSchema = storedMutationOutput("identity", "updated", IdentityValueSchema);
16532
- var ConfigIdentityRemoveInputSchema = z26.strictObject({ name: z26.string().min(1), confirm: RemovalConfirmationSchema });
16570
+ var ConfigIdentityRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
16533
16571
  var ConfigIdentityRemoveOutputSchema = mutationOutput("identity", "removed");
16534
16572
  var ConfigIdentityUseOutputSchema = mutationOutput("identity", "selected");
16535
- var ConfigProfileAddInputSchema = z26.strictObject({
16536
- name: z26.string().min(1),
16537
- extends: z26.array(z26.string().min(1)).optional(),
16538
- 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()
16539
16577
  });
16540
16578
  var ConfigProfileAddOutputSchema = storedMutationOutput("profile", "created", ProfileValueSchema);
16541
- var ConfigProfileSetInputSchema = z26.strictObject({
16542
- name: z26.string().min(1),
16543
- category: z26.record(z26.string(), z26.boolean()).optional(),
16544
- entry: z26.record(z26.string(), z26.boolean()).optional(),
16545
- extends: z26.union([z26.array(z26.string().min(1)), z26.literal(false)]).optional(),
16546
- description: z26.union([z26.string(), z26.literal(false)]).optional(),
16547
- launch: z26.strictObject({
16548
- skipPermissions: z26.boolean().optional(),
16549
- remoteControl: z26.boolean().optional(),
16550
- headroom: z26.boolean().optional(),
16551
- trackUsage: z26.boolean().optional(),
16552
- provider: z26.union([z26.string().min(1), z26.literal(false)]).optional(),
16553
- claudeVersion: z26.union([z26.string().min(1), z26.literal(false)]).optional(),
16554
- delay: z26.union([z26.string().regex(DURATION_RE), z26.literal(false)]).optional(),
16555
- pause: z26.boolean().optional(),
16556
- explain: z26.boolean().optional(),
16557
- routeByName: 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()
16558
16595
  }).optional()
16559
16596
  });
16560
16597
  var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
16561
- var ConfigProfileRemoveInputSchema = z26.strictObject({ name: z26.string().min(1), confirm: RemovalConfirmationSchema });
16598
+ var ConfigProfileRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
16562
16599
  var ConfigProfileRemoveOutputSchema = mutationOutput("profile", "removed");
16563
16600
  var ConfigProfileUseOutputSchema = mutationOutput("profile", "selected");
16564
- var PoolMembersInputSchema = z26.array(z26.string().min(1)).min(1);
16565
- var ConfigPoolAddInputSchema = z26.strictObject({
16566
- 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),
16567
16604
  identities: PoolMembersInputSchema,
16568
- preference: z26.enum(POOL_PREFERENCES).optional(),
16569
- resumeOnLimit: z26.boolean().optional(),
16570
- compactBeforeLimit: z26.boolean().optional(),
16605
+ preference: z27.enum(POOL_PREFERENCES).optional(),
16606
+ resumeOnLimit: z27.boolean().optional(),
16607
+ compactBeforeLimit: z27.boolean().optional(),
16571
16608
  compactAtUtilisation: CompactAtUtilisationSchema.optional()
16572
16609
  });
16573
16610
  var ConfigPoolAddOutputSchema = storedMutationOutput("pool", "created", PoolSchema);
16574
- var ConfigPoolSetInputSchema = z26.strictObject({
16575
- name: z26.string().min(1),
16611
+ var ConfigPoolSetInputSchema = z27.strictObject({
16612
+ name: z27.string().min(1),
16576
16613
  identities: PoolMembersInputSchema.optional(),
16577
- preference: z26.union([z26.enum(POOL_PREFERENCES), z26.literal(false)]).optional(),
16578
- resumeOnLimit: z26.boolean().optional(),
16579
- compactBeforeLimit: z26.boolean().optional(),
16580
- 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()
16581
16618
  });
16582
16619
  var ConfigPoolSetOutputSchema = storedMutationOutput("pool", "updated", PoolSchema);
16583
- var ConfigPoolRemoveInputSchema = z26.strictObject({ name: z26.string().min(1), confirm: RemovalConfirmationSchema });
16620
+ var ConfigPoolRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
16584
16621
  var ConfigPoolRemoveOutputSchema = mutationOutput("pool", "removed");
16585
16622
  var ConfigPoolUseOutputSchema = mutationOutput("pool", "selected");
16586
- var ConfigProviderAddInputSchema = z26.strictObject({
16587
- name: z26.string().min(1),
16588
- kind: z26.enum(PROVIDER_KINDS).optional(),
16589
- displayName: z26.string().min(1),
16590
- 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(),
16591
16628
  credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).required({ sources: true }),
16592
16629
  codex: CodexProviderConfigSchema.optional()
16593
16630
  });
16594
16631
  var ConfigProviderAddOutputSchema = storedMutationOutput("provider", "created", ProviderValueSchema);
16595
- var ConfigProviderSetInputSchema = z26.strictObject({
16596
- name: z26.string().min(1),
16597
- displayName: z26.string().min(1).optional(),
16598
- 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(),
16599
16636
  credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).optional(),
16600
16637
  codex: CodexProviderConfigSchema.optional()
16601
16638
  });
16602
16639
  var ConfigProviderSetOutputSchema = storedMutationOutput("provider", "updated", ProviderValueSchema);
16603
- var ConfigProviderRemoveInputSchema = z26.strictObject({ name: z26.string().min(1), confirm: RemovalConfirmationSchema });
16640
+ var ConfigProviderRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
16604
16641
  var ConfigProviderRemoveOutputSchema = mutationOutput("provider", "removed");
16605
- var ConfigRuleAddInputSchema = z26.strictObject({
16606
- path: z26.string().min(1),
16607
- configProfile: z26.string().min(1).optional(),
16608
- 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()
16609
16646
  });
16610
16647
  var ConfigRuleAddOutputSchema = storedMutationOutput("rule", "created", DirectoryRuleSchema);
16611
- var ConfigRuleSetInputSchema = z26.strictObject({
16612
- path: z26.string().min(1),
16613
- configProfile: z26.union([z26.string().min(1), z26.literal(false)]).optional(),
16614
- 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()
16615
16652
  });
16616
16653
  var ConfigRuleSetOutputSchema = storedMutationOutput("rule", "updated", DirectoryRuleSchema);
16617
- var ConfigRuleRemoveInputSchema = z26.strictObject({ path: z26.string().min(1), confirm: RemovalConfirmationSchema });
16654
+ var ConfigRuleRemoveInputSchema = z27.strictObject({ path: z27.string().min(1), confirm: RemovalConfirmationSchema });
16618
16655
  var ConfigRuleRemoveOutputSchema = mutationOutput("rule", "removed");
16619
16656
 
16620
16657
  // src/frontdoor/configApi.ts
@@ -16766,8 +16803,7 @@ function createConfigApiRouter(deps) {
16766
16803
  ...launch?.claudeVersion === void 0 ? {} : { launchClaudeVersion: launch.claudeVersion },
16767
16804
  ...launch?.delay === void 0 ? {} : { launchDelay: launch.delay },
16768
16805
  ...launch?.pause === void 0 ? {} : { launchPause: launch.pause },
16769
- ...launch?.explain === void 0 ? {} : { launchExplain: launch.explain },
16770
- ...launch?.routeByName === void 0 ? {} : { launchRouteByName: launch.routeByName }
16806
+ ...launch?.explain === void 0 ? {} : { launchExplain: launch.explain }
16771
16807
  });
16772
16808
  return { action: "updated", kind: "profile", name: input.name, value: profileValue(input.name, paths) };
16773
16809
  })
@@ -16926,43 +16962,43 @@ import { openapi as openapi4 } from "@orpc/openapi";
16926
16962
  import { eventIterator as eventIterator2, withEventMeta as withEventMeta2 } from "@orpc/server";
16927
16963
 
16928
16964
  // src/frontdoor/eventSchemas.ts
16929
- import { z as z27 } from "zod";
16965
+ import { z as z28 } from "zod";
16930
16966
  var DOOR_EVENT_SOURCE_RC = "rc";
16931
16967
  var LAUNCH_EVENT_SOURCE = "launch";
16932
16968
  var USAGE_EVENT_SOURCE = "usage";
16933
16969
  var DOOR_HEALTH_EVENT_SOURCE = "door";
16934
16970
  var QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
16935
- var DoorEventSchema = z27.strictObject({
16936
- source: z27.string().min(1),
16971
+ var DoorEventSchema = z28.strictObject({
16972
+ source: z28.string().min(1),
16937
16973
  /** A positive integer because the backbone's counters start at one and only ever increase. */
16938
- sequence: z27.number().int().positive(),
16939
- payload: z27.unknown()
16974
+ sequence: z28.number().int().positive(),
16975
+ payload: z28.unknown()
16940
16976
  });
16941
- var DoorEventSourceQuerySchema = z27.strictObject({
16942
- 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()
16943
16979
  });
16944
- var LaunchLifecycleEventSchema = z27.strictObject({
16945
- kind: z27.enum(["registered", "pruned", "ended"]),
16946
- pid: z27.number().int().positive(),
16947
- startedAt: z27.number(),
16948
- 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()
16949
16985
  });
16950
- var DoorHealthEventSchema = z27.discriminatedUnion("kind", [
16951
- 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() }),
16952
- z27.strictObject({ kind: z27.literal("listenerFailed"), pid: z27.number().int().positive(), listener: z27.enum(["provider", "connect", "direct"]), message: z27.string(), observedAt: z27.number() }),
16953
- z27.strictObject({ kind: z27.literal("binaryTurnover"), pid: z27.number().int().positive(), observedAt: z27.number() }),
16954
- z27.strictObject({ kind: z27.literal("idleShutdown"), pid: z27.number().int().positive(), observedAt: z27.number() }),
16955
- z27.strictObject({ kind: z27.literal("superseded"), pid: z27.number().int().positive(), ownerPid: z27.number().int().positive(), observedAt: z27.number() }),
16956
- 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() })
16957
16993
  ]);
16958
- var QuotaExpiringEventSchema = z27.strictObject({
16959
- identity: z27.string().min(1),
16960
- provider: z27.string().min(1),
16961
- 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"]),
16962
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. */
16963
- utilization: z27.number().min(0).max(1),
16964
- resetsAt: z27.iso.datetime(),
16965
- observedAt: z27.number()
16999
+ utilization: z28.number().min(0).max(1),
17000
+ resetsAt: z28.iso.datetime(),
17001
+ observedAt: z28.number()
16966
17002
  });
16967
17003
 
16968
17004
  // src/frontdoor/eventsApi.ts
@@ -17046,56 +17082,55 @@ import { openapi as openapi6 } from "@orpc/openapi";
17046
17082
 
17047
17083
  // src/frontdoor/launchSchemas.ts
17048
17084
  import path33 from "node:path";
17049
- import { z as z28 } from "zod";
17085
+ import { z as z29 } from "zod";
17050
17086
  init_claudeVersion();
17051
17087
  init_identity();
17052
- var LaunchResolveInputSchema = z28.strictObject({
17053
- path: z28.string().min(1),
17088
+ var LaunchResolveInputSchema = z29.strictObject({
17089
+ path: z29.string().min(1),
17054
17090
  /** `@name`, launch flags, then the arguments for `claude`; empty for a bare launch. */
17055
- argv: z28.readonly(z28.array(z28.string())).optional(),
17091
+ argv: z29.readonly(z29.array(z29.string())).optional(),
17056
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. */
17057
- env: z28.record(z28.string(), z28.string()).optional()
17093
+ env: z29.record(z29.string(), z29.string()).optional()
17058
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" });
17059
- var LaunchPoolDecisionSchema = z28.strictObject({
17060
- name: z28.string(),
17061
- reasons: z28.readonly(z28.array(z28.string())),
17062
- 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()
17063
17099
  });
17064
- var LaunchDecisionSchema = z28.strictObject({
17065
- identity: z28.string().optional(),
17066
- identitySource: z28.enum(IDENTITY_DECISION_SOURCES),
17100
+ var LaunchDecisionSchema = z29.strictObject({
17101
+ identity: z29.string().optional(),
17102
+ identitySource: z29.enum(IDENTITY_DECISION_SOURCES),
17067
17103
  pool: LaunchPoolDecisionSchema.optional(),
17068
- configDirEscapeHatch: z28.boolean(),
17069
- configDir: z28.string().optional(),
17070
- configProfile: z28.string().optional(),
17071
- configProfileSource: z28.enum(CONFIG_PROFILE_DECISION_SOURCES),
17072
- 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()
17073
17109
  });
17074
- var LaunchFlagsSchema = z28.strictObject({
17075
- skipPermissions: z28.boolean(),
17076
- remoteControl: z28.boolean(),
17077
- headroom: z28.boolean(),
17078
- trackUsage: z28.boolean(),
17079
- pause: z28.boolean(),
17080
- explain: z28.boolean(),
17081
- routeByName: 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(),
17082
17117
  /** How long the launch waits after its own output before it starts claude, in milliseconds. */
17083
- delayMs: z28.number()
17118
+ delayMs: z29.number()
17084
17119
  });
17085
- var LaunchResolveOutputSchema = z28.strictObject({
17120
+ var LaunchResolveOutputSchema = z29.strictObject({
17086
17121
  decision: LaunchDecisionSchema,
17087
17122
  flags: LaunchFlagsSchema,
17088
- 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(),
17089
17124
  /** The real `claude` binary the launch would spawn, on the door's host. */
17090
- bin: z28.string(),
17125
+ bin: z29.string(),
17091
17126
  /** The arguments the launch would pass it: the tool's own flags, then `CLAUDE_EXTRA_FLAGS`, then the caller's own. */
17092
- args: z28.readonly(z28.array(z28.string())),
17127
+ args: z29.readonly(z29.array(z29.string())),
17093
17128
  /** The credential the launch would authenticate with, by target and source kinds. Absent when none applies. */
17094
- credential: z28.strictObject({ subject: z28.enum(["provider", "identity"]), name: z28.string(), summary: CredentialSummarySchema }).optional(),
17095
- routing: z28.strictObject({ frontDoor: z28.boolean(), headroom: z28.boolean(), routeByName: 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() }),
17096
17131
  /** The names of the environment variables the launch would set or unset, sorted. Values are not reported. */
17097
- environment: z28.readonly(z28.array(z28.string())),
17098
- warnings: z28.readonly(z28.array(z28.string()))
17132
+ environment: z29.readonly(z29.array(z29.string())),
17133
+ warnings: z29.readonly(z29.array(z29.string()))
17099
17134
  });
17100
17135
 
17101
17136
  // src/frontdoor/launchApi.ts
@@ -17131,22 +17166,22 @@ function createLaunchApiRouter(deps) {
17131
17166
  // src/frontdoor/agentTreesApi.ts
17132
17167
  import { ORPCError as ORPCError6 } from "@orpc/client";
17133
17168
  import { openapi as openapi7 } from "@orpc/openapi";
17134
- import { z as z29 } from "zod";
17169
+ import { z as z30 } from "zod";
17135
17170
  init_cliError();
17136
- var AgentTreesListInputSchema = z29.strictObject({
17171
+ var AgentTreesListInputSchema = z30.strictObject({
17137
17172
  /** Only this identity's sessions. */
17138
- identity: z29.string().optional(),
17173
+ identity: z30.string().optional(),
17139
17174
  /** Include sessions that spawned no agent and ran no workflow. */
17140
- all: z29.boolean().optional()
17175
+ all: z30.boolean().optional()
17141
17176
  });
17142
- var AgentTreesListOutputSchema = z29.array(SessionSummarySchema);
17143
- var AgentTreesShowInputSchema = z29.strictObject({
17177
+ var AgentTreesListOutputSchema = z30.array(SessionSummarySchema);
17178
+ var AgentTreesShowInputSchema = z30.strictObject({
17144
17179
  /** A session id, or an unambiguous prefix of one. */
17145
- session: z29.string().min(1),
17180
+ session: z30.string().min(1),
17146
17181
  /** Look only in this identity. */
17147
- identity: z29.string().optional()
17182
+ identity: z30.string().optional()
17148
17183
  });
17149
- var AgentTreesShowOutputSchema = z29.strictObject({ identities: z29.array(z29.string()), ...MergedAgentTreeSchema.shape });
17184
+ var AgentTreesShowOutputSchema = z30.strictObject({ identities: z30.array(z30.string()), ...MergedAgentTreeSchema.shape });
17150
17185
  function asBadRequest(error) {
17151
17186
  if (error instanceof CliError) {
17152
17187
  throw new ORPCError6("BAD_REQUEST", { message: error.message });
@@ -19329,7 +19364,7 @@ init_poolPick();
19329
19364
 
19330
19365
  // src/agents/read.ts
19331
19366
  import path35 from "node:path";
19332
- import { z as z30 } from "zod";
19367
+ import { z as z31 } from "zod";
19333
19368
  var PROJECTS_DIR = "projects";
19334
19369
  var TASKS_DIR = "tasks";
19335
19370
  var SUBAGENTS_DIR = "subagents";
@@ -19448,14 +19483,14 @@ function parseJson2(text) {
19448
19483
  return void 0;
19449
19484
  }
19450
19485
  }
19451
- var TaskFileSchema = z30.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: z30.array(z30.string()).default([]), blockedBy: z30.array(z30.string()).default([]) });
19452
- var WorkflowRunFileSchema = z30.object({
19453
- runId: z30.string(),
19454
- workflowName: z30.string().optional(),
19455
- status: z30.string().optional(),
19456
- startTime: z30.number().optional(),
19457
- phases: z30.array(z30.object({ title: z30.string() })).default([]),
19458
- 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()
19459
19494
  });
19460
19495
  function summariseSession(fs13, configDir, ref) {
19461
19496
  const sessionRelative = path35.join(PROJECTS_DIR, ref.project, ref.entry);