agent-shim 11.50.2 → 11.51.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
@@ -121,58 +121,72 @@ import { z } from "zod";
121
121
  function distinctList(member) {
122
122
  return z.array(member).refine((items) => new Set(items).size === items.length, "must not repeat a segment");
123
123
  }
124
+ function isPlainObject(value) {
125
+ return typeof value === "object" && value !== null && !Array.isArray(value);
126
+ }
127
+ function mergeStatuslineSettings(base, over) {
128
+ if (!isPlainObject(base) || !isPlainObject(over)) {
129
+ return over === void 0 ? base : over;
130
+ }
131
+ const merged = { ...base };
132
+ for (const [key, value] of Object.entries(over)) {
133
+ merged[key] = key in base ? mergeStatuslineSettings(base[key], value) : value;
134
+ }
135
+ return merged;
136
+ }
124
137
  function resolveStatusline(settings) {
125
- const resolved = {
126
- header: settings?.header ?? STATUSLINE_DEFAULTS.header,
127
- bars: settings?.bars ?? STATUSLINE_DEFAULTS.bars,
128
- warnAt: settings?.warnAt ?? STATUSLINE_DEFAULTS.warnAt,
129
- criticalAt: settings?.criticalAt ?? STATUSLINE_DEFAULTS.criticalAt,
130
- fiveHourLabel: settings?.fiveHourLabel ?? STATUSLINE_DEFAULTS.fiveHourLabel,
131
- sevenDayLabel: settings?.sevenDayLabel ?? STATUSLINE_DEFAULTS.sevenDayLabel,
132
- barWidth: settings?.barWidth ?? STATUSLINE_DEFAULTS.barWidth
133
- };
134
- if (resolved.warnAt >= resolved.criticalAt) {
135
- throw new RangeError(`statusline warnAt (${String(resolved.warnAt)}) must be below criticalAt (${String(resolved.criticalAt)})`);
138
+ const resolved = ResolvedStatuslineSchema.parse(mergeStatuslineSettings(STATUSLINE_DEFAULTS, settings));
139
+ if (resolved.bands.warnAt >= resolved.bands.criticalAt) {
140
+ throw new RangeError(`statusline bands.warnAt (${String(resolved.bands.warnAt)}) must be below bands.criticalAt (${String(resolved.bands.criticalAt)})`);
136
141
  }
137
142
  return resolved;
138
143
  }
139
- var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_BAR_GROUPS, MAX_PERCENT, MAX_STATUSLINE_LABEL_CHARS, MAX_BAR_CELLS, LABEL_RE2, wholePercent, StatuslineSchema, StatuslineChangeSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
144
+ var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, MAX_PERCENT, MAX_STATUSLINE_LABEL_CHARS, MAX_BAR_CELLS, LABEL_RE2, labelText, wholePercent, SHAPES, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
140
145
  var init_statusline = __esm({
141
146
  "src/config/statusline.ts"() {
142
147
  "use strict";
143
148
  STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom"];
144
- STATUSLINE_BAR_GROUPS = ["context", "quota"];
149
+ STATUSLINE_ROWS = ["context", "quota"];
145
150
  MAX_PERCENT = 100;
146
151
  MAX_STATUSLINE_LABEL_CHARS = 12;
147
152
  MAX_BAR_CELLS = 40;
148
153
  LABEL_RE2 = /^[^\p{C}\p{Z}]+(?: [^\p{C}\p{Z}]+)*$/u;
154
+ labelText = z.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters");
149
155
  wholePercent = z.number().int().min(1).max(MAX_PERCENT);
156
+ SHAPES = {
157
+ layout: {
158
+ header: distinctList(z.enum(STATUSLINE_HEADER_SEGMENTS)).describe("The header segments to draw, in drawing order; a segment left out is hidden, and an empty list hides the header."),
159
+ rows: distinctList(z.enum(STATUSLINE_ROWS)).describe("The rows to draw below the header, in drawing order; a row left out is hidden, and an empty list hides every row.")
160
+ },
161
+ bands: {
162
+ warnAt: wholePercent.describe("The whole percentage of use at which a bar turns yellow; it must be below criticalAt."),
163
+ criticalAt: wholePercent.describe("The whole percentage of use at which a bar turns red.")
164
+ },
165
+ labels: {
166
+ fiveHour: labelText.describe("The name of the five-hour subscription window."),
167
+ sevenDay: labelText.describe("The name of the weekly subscription window.")
168
+ },
169
+ bar: {
170
+ width: z.number().int().min(1).max(MAX_BAR_CELLS).describe("A bar's width in cells before the line's spare width is shared out among the bars.")
171
+ }
172
+ };
150
173
  StatuslineSchema = z.strictObject({
151
- header: distinctList(z.enum(STATUSLINE_HEADER_SEGMENTS)).optional(),
152
- bars: distinctList(z.enum(STATUSLINE_BAR_GROUPS)).optional(),
153
- warnAt: wholePercent.optional(),
154
- criticalAt: wholePercent.optional(),
155
- fiveHourLabel: z.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters").optional(),
156
- sevenDayLabel: z.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters").optional(),
157
- barWidth: z.number().int().min(1).max(MAX_BAR_CELLS).optional()
174
+ layout: z.strictObject(SHAPES.layout).partial().optional(),
175
+ bands: z.strictObject(SHAPES.bands).partial().optional(),
176
+ labels: z.strictObject(SHAPES.labels).partial().optional(),
177
+ bar: z.strictObject(SHAPES.bar).partial().optional()
158
178
  });
159
- StatuslineChangeSchema = z.strictObject({
160
- header: z.union([StatuslineSchema.shape.header.unwrap(), z.literal(false)]).optional(),
161
- bars: z.union([StatuslineSchema.shape.bars.unwrap(), z.literal(false)]).optional(),
162
- warnAt: z.union([StatuslineSchema.shape.warnAt.unwrap(), z.literal(false)]).optional(),
163
- criticalAt: z.union([StatuslineSchema.shape.criticalAt.unwrap(), z.literal(false)]).optional(),
164
- fiveHourLabel: z.union([StatuslineSchema.shape.fiveHourLabel.unwrap(), z.literal(false)]).optional(),
165
- sevenDayLabel: z.union([StatuslineSchema.shape.sevenDayLabel.unwrap(), z.literal(false)]).optional(),
166
- barWidth: z.union([StatuslineSchema.shape.barWidth.unwrap(), z.literal(false)]).optional()
179
+ ResolvedStatuslineSchema = z.strictObject({
180
+ layout: z.strictObject(SHAPES.layout),
181
+ bands: z.strictObject(SHAPES.bands),
182
+ labels: z.strictObject(SHAPES.labels),
183
+ bar: z.strictObject(SHAPES.bar)
167
184
  });
168
185
  STATUSLINE_DEFAULTS = {
169
- header: STATUSLINE_HEADER_SEGMENTS,
170
- bars: STATUSLINE_BAR_GROUPS,
171
- warnAt: 70,
172
- criticalAt: 90,
173
- fiveHourLabel: "5h",
174
- sevenDayLabel: "Wk",
175
- barWidth: 10
186
+ layout: { header: [...STATUSLINE_HEADER_SEGMENTS], rows: [...STATUSLINE_ROWS] },
187
+ bands: { warnAt: 70, criticalAt: 90 },
188
+ labels: { fiveHour: "5h", sevenDay: "Wk" },
189
+ bar: { width: 10 }
176
190
  };
177
191
  STATUSLINE_ENV = "AGENT_SHIM_STATUSLINE";
178
192
  }
@@ -1570,7 +1584,7 @@ function flattenLayers(layers, options) {
1570
1584
  launch.proxyBypass = layer.launch.proxyBypass;
1571
1585
  }
1572
1586
  if (layer.launch.statusline !== void 0) {
1573
- launch.statusline = { ...launch.statusline, ...layer.launch.statusline };
1587
+ launch.statusline = StatuslineSchema.parse(mergeStatuslineSettings(launch.statusline, layer.launch.statusline));
1574
1588
  }
1575
1589
  }
1576
1590
  if (layer.models !== void 0) {
@@ -1751,6 +1765,7 @@ var init_flatten = __esm({
1751
1765
  "src/resolve/flatten.ts"() {
1752
1766
  "use strict";
1753
1767
  init_schema();
1768
+ init_statusline();
1754
1769
  init_conditions();
1755
1770
  init_match();
1756
1771
  }
@@ -4235,7 +4250,7 @@ var init_package = __esm({
4235
4250
  "package.json"() {
4236
4251
  package_default = {
4237
4252
  name: "agent-shim",
4238
- version: "11.50.2",
4253
+ version: "11.51.0",
4239
4254
  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.",
4240
4255
  license: "MIT",
4241
4256
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -7393,6 +7408,111 @@ var init_poolPick = __esm({
7393
7408
  }
7394
7409
  });
7395
7410
 
7411
+ // src/statusline/keys.ts
7412
+ import { z as z15 } from "zod";
7413
+ function valueAt(source, path43) {
7414
+ let current = source;
7415
+ for (const part of path43) {
7416
+ if (!isPlainObject(current)) {
7417
+ return void 0;
7418
+ }
7419
+ current = current[part];
7420
+ }
7421
+ return current;
7422
+ }
7423
+ function keyOf(path43, leaf) {
7424
+ const common = { path: path43.join("."), description: leaf.description ?? "", defaultValue: valueAt(STATUSLINE_DEFAULTS, path43) };
7425
+ if (leaf instanceof z15.ZodNumber) {
7426
+ return { ...common, kind: "integer", choices: [] };
7427
+ }
7428
+ if (leaf instanceof z15.ZodString) {
7429
+ return { ...common, kind: "text", choices: [] };
7430
+ }
7431
+ if (leaf instanceof z15.ZodEnum) {
7432
+ return { ...common, kind: "choice", choices: Object.values(leaf.enum).map(String) };
7433
+ }
7434
+ if (leaf instanceof z15.ZodArray && leaf.element instanceof z15.ZodEnum) {
7435
+ return { ...common, kind: "list", choices: Object.values(leaf.element.enum).map(String) };
7436
+ }
7437
+ throw new TypeError(`statusline setting ${path43.join(".")} has a kind the key listing does not describe`);
7438
+ }
7439
+ function walk(shape, prefix) {
7440
+ return Object.entries(shape).flatMap(([name, schema]) => schema instanceof z15.ZodObject ? walk(schema.shape, [...prefix, name]) : [keyOf([...prefix, name], schema)]);
7441
+ }
7442
+ function statuslineKeys() {
7443
+ return walk(ResolvedStatuslineSchema.shape, []);
7444
+ }
7445
+ var init_keys = __esm({
7446
+ "src/statusline/keys.ts"() {
7447
+ "use strict";
7448
+ init_statusline();
7449
+ }
7450
+ });
7451
+
7452
+ // src/statusline/change.ts
7453
+ function keyNamed(path43) {
7454
+ const found = statuslineKeys().find((key) => key.path === path43);
7455
+ if (found === void 0) {
7456
+ throw new UsageError(`"${path43}" is not a statusline setting; \`agent-shim statusline keys\` lists them.`);
7457
+ }
7458
+ return found;
7459
+ }
7460
+ function setAt(target, path43, value) {
7461
+ const [head, ...rest] = path43;
7462
+ if (head === void 0) {
7463
+ return;
7464
+ }
7465
+ if (rest.length === 0) {
7466
+ target[head] = value;
7467
+ return;
7468
+ }
7469
+ const child = target[head];
7470
+ const next = isPlainObject(child) ? child : {};
7471
+ target[head] = next;
7472
+ setAt(next, rest, value);
7473
+ }
7474
+ function removeAt(target, path43) {
7475
+ const [head, ...rest] = path43;
7476
+ if (head === void 0) {
7477
+ return;
7478
+ }
7479
+ const child = target[head];
7480
+ if (rest.length === 0) {
7481
+ Reflect.deleteProperty(target, head);
7482
+ return;
7483
+ }
7484
+ if (isPlainObject(child)) {
7485
+ removeAt(child, rest);
7486
+ if (Object.keys(child).length === 0) {
7487
+ Reflect.deleteProperty(target, head);
7488
+ }
7489
+ }
7490
+ }
7491
+ function applyStatuslineChange(existing, change) {
7492
+ const draft = structuredClone(existing ?? {});
7493
+ for (const [path43, value] of Object.entries(change.set ?? {})) {
7494
+ keyNamed(path43);
7495
+ setAt(draft, path43.split("."), value);
7496
+ }
7497
+ for (const path43 of change.unset ?? []) {
7498
+ keyNamed(path43);
7499
+ removeAt(draft, path43.split("."));
7500
+ }
7501
+ const result = StatuslineSchema.safeParse(draft);
7502
+ if (!result.success) {
7503
+ throw new UsageError(`statusline: ${result.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ")}.`);
7504
+ }
7505
+ return Object.keys(result.data).length === 0 ? void 0 : result.data;
7506
+ }
7507
+ var init_change = __esm({
7508
+ "src/statusline/change.ts"() {
7509
+ "use strict";
7510
+ init_cliError();
7511
+ init_statusline();
7512
+ init_keys();
7513
+ }
7514
+ });
7515
+
7396
7516
  // src/configProfilesStore.ts
7397
7517
  import fs4 from "node:fs";
7398
7518
  import path22 from "node:path";
@@ -7494,17 +7614,6 @@ function removeProfile(paths, name) {
7494
7614
  requireProfileExists(paths, name);
7495
7615
  fs4.rmSync(profileJsonPath(paths, name));
7496
7616
  }
7497
- function withStatuslineChange(existing, change) {
7498
- const merged = new Map(Object.entries({ ...existing }));
7499
- for (const [key, value] of Object.entries(change)) {
7500
- if (value === false) {
7501
- merged.delete(key);
7502
- } else {
7503
- merged.set(key, value);
7504
- }
7505
- }
7506
- return merged.size === 0 ? void 0 : StatuslineSchema.parse(Object.fromEntries(merged));
7507
- }
7508
7617
  function applyProfileChange(paths, name, change) {
7509
7618
  let touched = false;
7510
7619
  if (change.category !== void 0) {
@@ -7554,7 +7663,7 @@ function applyProfileChange(paths, name, change) {
7554
7663
  launchPatch.explain = change.launchExplain;
7555
7664
  }
7556
7665
  if (change.launchStatusline !== void 0) {
7557
- launchPatch.statusline = withStatuslineChange(readProfile(paths, name)?.launch?.statusline, change.launchStatusline);
7666
+ launchPatch.statusline = applyStatuslineChange(readProfile(paths, name)?.launch?.statusline, change.launchStatusline);
7558
7667
  }
7559
7668
  if (Object.keys(launchPatch).length > 0) {
7560
7669
  setProfileLaunchFlags(paths, name, launchPatch);
@@ -7569,7 +7678,7 @@ var init_configProfilesStore = __esm({
7569
7678
  init_store();
7570
7679
  init_schema();
7571
7680
  init_cliError();
7572
- init_statusline();
7681
+ init_change();
7573
7682
  init_load();
7574
7683
  ProfileNotFoundError = class extends CliError {
7575
7684
  constructor(profileName) {
@@ -7681,7 +7790,7 @@ var init_paths = __esm({
7681
7790
  });
7682
7791
 
7683
7792
  // src/credentialCache.ts
7684
- import { z as z15 } from "zod";
7793
+ import { z as z16 } from "zod";
7685
7794
  function effectiveStore(cache, platform) {
7686
7795
  return cache.store ?? (platform === "darwin" ? "keychain" : "file");
7687
7796
  }
@@ -7748,9 +7857,9 @@ var init_credentialCache = __esm({
7748
7857
  init_schema();
7749
7858
  init_preflight();
7750
7859
  MS_PER_UNIT = { s: 1e3, m: 6e4, h: 36e5, d: 864e5 };
7751
- CachedCredentialSchema = z15.strictObject({
7752
- token: z15.string().min(1),
7753
- fetchedAt: z15.number().int().nonnegative(),
7860
+ CachedCredentialSchema = z16.strictObject({
7861
+ token: z16.string().min(1),
7862
+ fetchedAt: z16.number().int().nonnegative(),
7754
7863
  source: CredentialSourceSchema
7755
7864
  });
7756
7865
  }
@@ -7842,7 +7951,7 @@ var init_realCredentialCache = __esm({
7842
7951
  });
7843
7952
 
7844
7953
  // src/providerAliases.ts
7845
- import { z as z16 } from "zod";
7954
+ import { z as z17 } from "zod";
7846
7955
  function parseAliases(file, raw) {
7847
7956
  const parsed = ProviderAliasesSchema.safeParse(raw);
7848
7957
  if (!parsed.success) {
@@ -7881,7 +7990,7 @@ var init_providerAliases = __esm({
7881
7990
  init_cliError();
7882
7991
  init_load();
7883
7992
  init_store();
7884
- ProviderAliasesSchema = z16.record(z16.string().min(1), z16.string().min(1));
7993
+ ProviderAliasesSchema = z17.record(z17.string().min(1), z17.string().min(1));
7885
7994
  }
7886
7995
  });
7887
7996
 
@@ -8898,7 +9007,7 @@ var init_commandDeps = __esm({
8898
9007
  // src/claudeShim.ts
8899
9008
  import fs8 from "node:fs";
8900
9009
  import path28 from "node:path";
8901
- import { z as z21 } from "zod";
9010
+ import { z as z22 } from "zod";
8902
9011
  function commandFilename(ownExecutablePath, commandName) {
8903
9012
  return ownExecutablePath.toLowerCase().endsWith(".exe") ? `${commandName}.exe` : commandName;
8904
9013
  }
@@ -8948,10 +9057,10 @@ var init_claudeShim = __esm({
8948
9057
  init_store();
8949
9058
  init_realPorts();
8950
9059
  init_cliError();
8951
- ClaudeShimStateSchema = z21.strictObject({
8952
- targetPath: z21.string().min(1),
8953
- method: z21.enum(["hardlink", "copy"]),
8954
- installedAtMs: z21.number()
9060
+ ClaudeShimStateSchema = z22.strictObject({
9061
+ targetPath: z22.string().min(1),
9062
+ method: z22.enum(["hardlink", "copy"]),
9063
+ installedAtMs: z22.number()
8955
9064
  });
8956
9065
  nodeLinkFs = { link: fs8.linkSync, copyFile: fs8.copyFileSync, chmod: fs8.chmodSync };
8957
9066
  }
@@ -8970,14 +9079,14 @@ function memberKindOf(ref, models) {
8970
9079
  function expandMembers(name, models) {
8971
9080
  const virtual = models?.virtual ?? {};
8972
9081
  const expanded = [];
8973
- const walk = (current, chain) => {
9082
+ const walk2 = (current, chain) => {
8974
9083
  const nested = virtual[current];
8975
9084
  if (nested !== void 0) {
8976
9085
  if (chain.includes(current)) {
8977
9086
  throw new Error(`virtual model cycle: ${[...chain, current].join(" -> ")}`);
8978
9087
  }
8979
9088
  for (const member of nested.members) {
8980
- walk(member, [...chain, current]);
9089
+ walk2(member, [...chain, current]);
8981
9090
  }
8982
9091
  return;
8983
9092
  }
@@ -8990,7 +9099,7 @@ function expandMembers(name, models) {
8990
9099
  throw new VirtualModelNotFoundError(name);
8991
9100
  }
8992
9101
  for (const member of top.members) {
8993
- walk(member, [name]);
9102
+ walk2(member, [name]);
8994
9103
  }
8995
9104
  return expanded;
8996
9105
  }
@@ -9047,62 +9156,62 @@ var init_signatures = __esm({
9047
9156
  });
9048
9157
 
9049
9158
  // src/codex/anthropic.ts
9050
- import { z as z25 } from "zod";
9159
+ import { z as z26 } from "zod";
9051
9160
  var TextBlockSchema, Base64ImageSourceSchema, UrlImageSourceSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultContentBlockSchema, ToolResultBlockSchema, OtherBlockSchema, ContentBlockSchema, MessageSchema, ToolSchema, ToolChoiceSchema, SystemSchema, MessagesRequestSchema, CountTokensRequestSchema;
9052
9161
  var init_anthropic = __esm({
9053
9162
  "src/codex/anthropic.ts"() {
9054
9163
  "use strict";
9055
- TextBlockSchema = z25.looseObject({ type: z25.literal("text"), text: z25.string() });
9056
- Base64ImageSourceSchema = z25.looseObject({ type: z25.literal("base64"), media_type: z25.string().min(1), data: z25.string() });
9057
- UrlImageSourceSchema = z25.looseObject({ type: z25.literal("url"), url: z25.string().min(1) });
9058
- ImageBlockSchema = z25.looseObject({
9059
- type: z25.literal("image"),
9060
- source: z25.union([Base64ImageSourceSchema, UrlImageSourceSchema])
9164
+ TextBlockSchema = z26.looseObject({ type: z26.literal("text"), text: z26.string() });
9165
+ Base64ImageSourceSchema = z26.looseObject({ type: z26.literal("base64"), media_type: z26.string().min(1), data: z26.string() });
9166
+ UrlImageSourceSchema = z26.looseObject({ type: z26.literal("url"), url: z26.string().min(1) });
9167
+ ImageBlockSchema = z26.looseObject({
9168
+ type: z26.literal("image"),
9169
+ source: z26.union([Base64ImageSourceSchema, UrlImageSourceSchema])
9061
9170
  });
9062
- ToolUseBlockSchema = z25.looseObject({
9063
- type: z25.literal("tool_use"),
9064
- id: z25.string().min(1),
9065
- name: z25.string().min(1),
9066
- input: z25.unknown()
9171
+ ToolUseBlockSchema = z26.looseObject({
9172
+ type: z26.literal("tool_use"),
9173
+ id: z26.string().min(1),
9174
+ name: z26.string().min(1),
9175
+ input: z26.unknown()
9067
9176
  });
9068
- ToolResultContentBlockSchema = z25.union([TextBlockSchema, z25.looseObject({ type: z25.string() })]);
9069
- ToolResultBlockSchema = z25.looseObject({
9070
- type: z25.literal("tool_result"),
9071
- tool_use_id: z25.string().min(1),
9072
- content: z25.union([z25.string(), z25.array(ToolResultContentBlockSchema)]).optional()
9177
+ ToolResultContentBlockSchema = z26.union([TextBlockSchema, z26.looseObject({ type: z26.string() })]);
9178
+ ToolResultBlockSchema = z26.looseObject({
9179
+ type: z26.literal("tool_result"),
9180
+ tool_use_id: z26.string().min(1),
9181
+ content: z26.union([z26.string(), z26.array(ToolResultContentBlockSchema)]).optional()
9073
9182
  });
9074
- OtherBlockSchema = z25.looseObject({ type: z25.string() });
9075
- ContentBlockSchema = z25.union([TextBlockSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultBlockSchema, OtherBlockSchema]);
9076
- MessageSchema = z25.looseObject({
9077
- role: z25.enum(["user", "assistant", "system"]),
9078
- content: z25.union([z25.string(), z25.array(ContentBlockSchema)])
9183
+ OtherBlockSchema = z26.looseObject({ type: z26.string() });
9184
+ ContentBlockSchema = z26.union([TextBlockSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultBlockSchema, OtherBlockSchema]);
9185
+ MessageSchema = z26.looseObject({
9186
+ role: z26.enum(["user", "assistant", "system"]),
9187
+ content: z26.union([z26.string(), z26.array(ContentBlockSchema)])
9079
9188
  });
9080
- ToolSchema = z25.looseObject({
9081
- name: z25.string().min(1),
9082
- description: z25.string().optional(),
9083
- input_schema: z25.record(z25.string(), z25.unknown()).optional()
9189
+ ToolSchema = z26.looseObject({
9190
+ name: z26.string().min(1),
9191
+ description: z26.string().optional(),
9192
+ input_schema: z26.record(z26.string(), z26.unknown()).optional()
9084
9193
  });
9085
- ToolChoiceSchema = z25.union([
9086
- z25.looseObject({ type: z25.enum(["auto", "none", "any"]) }),
9087
- z25.looseObject({ type: z25.literal("tool"), name: z25.string().min(1) })
9194
+ ToolChoiceSchema = z26.union([
9195
+ z26.looseObject({ type: z26.enum(["auto", "none", "any"]) }),
9196
+ z26.looseObject({ type: z26.literal("tool"), name: z26.string().min(1) })
9088
9197
  ]);
9089
- SystemSchema = z25.union([z25.string(), z25.array(z25.union([TextBlockSchema, OtherBlockSchema]))]);
9090
- MessagesRequestSchema = z25.looseObject({
9091
- model: z25.string().optional(),
9198
+ SystemSchema = z26.union([z26.string(), z26.array(z26.union([TextBlockSchema, OtherBlockSchema]))]);
9199
+ MessagesRequestSchema = z26.looseObject({
9200
+ model: z26.string().optional(),
9092
9201
  system: SystemSchema.optional(),
9093
- messages: z25.array(MessageSchema),
9094
- tools: z25.array(ToolSchema).optional(),
9202
+ messages: z26.array(MessageSchema),
9203
+ tools: z26.array(ToolSchema).optional(),
9095
9204
  tool_choice: ToolChoiceSchema.optional(),
9096
- stream: z25.boolean().optional(),
9205
+ stream: z26.boolean().optional(),
9097
9206
  /** `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. */
9098
- metadata: z25.looseObject({ user_id: z25.string().optional() }).optional(),
9207
+ metadata: z26.looseObject({ user_id: z26.string().optional() }).optional(),
9099
9208
  /** Claude Code's effort setting. Any string is accepted; the translator honours only the levels the backend understands. */
9100
- output_config: z25.looseObject({ effort: z25.string().optional() }).optional()
9209
+ output_config: z26.looseObject({ effort: z26.string().optional() }).optional()
9101
9210
  });
9102
- CountTokensRequestSchema = z25.looseObject({
9103
- system: z25.unknown().optional(),
9104
- messages: z25.unknown().optional(),
9105
- tools: z25.unknown().optional()
9211
+ CountTokensRequestSchema = z26.looseObject({
9212
+ system: z26.unknown().optional(),
9213
+ messages: z26.unknown().optional(),
9214
+ tools: z26.unknown().optional()
9106
9215
  });
9107
9216
  }
9108
9217
  });
@@ -9187,7 +9296,7 @@ var init_translate2 = __esm({
9187
9296
  // src/providerCatalogue.ts
9188
9297
  import path30 from "node:path";
9189
9298
  import picomatch4 from "picomatch";
9190
- import { z as z26 } from "zod";
9299
+ import { z as z27 } from "zod";
9191
9300
  function catalogueCachePath(paths, name) {
9192
9301
  return path30.join(paths.catalogueDir, `${name}.json`);
9193
9302
  }
@@ -9222,8 +9331,8 @@ var init_providerCatalogue = __esm({
9222
9331
  CATALOGUE_REQUEST_SECONDS = 10;
9223
9332
  CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND5;
9224
9333
  CATALOGUE_REFRESH_TIMEOUT_MS = DEFAULT_CANDIDATE_URLS * CATALOGUE_REQUEST_TIMEOUT_MS;
9225
- CatalogueModelSchema = z26.strictObject({ id: z26.string().min(1), name: z26.string().min(1).optional() });
9226
- CatalogueCacheSchema = z26.strictObject({ fetchedAt: z26.number(), url: z26.string().min(1), models: z26.array(CatalogueModelSchema) });
9334
+ CatalogueModelSchema = z27.strictObject({ id: z27.string().min(1), name: z27.string().min(1).optional() });
9335
+ CatalogueCacheSchema = z27.strictObject({ fetchedAt: z27.number(), url: z27.string().min(1), models: z27.array(CatalogueModelSchema) });
9227
9336
  }
9228
9337
  });
9229
9338
 
@@ -11583,7 +11692,7 @@ function isAnthropicUsageStale(member, nowMs) {
11583
11692
  function poolIdentityNames(pools, poolName) {
11584
11693
  const seenPools = /* @__PURE__ */ new Set();
11585
11694
  const identities = /* @__PURE__ */ new Set();
11586
- const walk = (name) => {
11695
+ const walk2 = (name) => {
11587
11696
  const pool = pools[name];
11588
11697
  if (pool === void 0 || seenPools.has(name)) {
11589
11698
  return;
@@ -11595,11 +11704,11 @@ function poolIdentityNames(pools, poolName) {
11595
11704
  if (nested === void 0) {
11596
11705
  identities.add(member);
11597
11706
  } else {
11598
- walk(nested);
11707
+ walk2(nested);
11599
11708
  }
11600
11709
  }
11601
11710
  };
11602
- walk(poolName);
11711
+ walk2(poolName);
11603
11712
  return [...identities];
11604
11713
  }
11605
11714
  function describeError(error) {
@@ -11718,7 +11827,7 @@ var init_identityClaude = __esm({
11718
11827
  });
11719
11828
 
11720
11829
  // src/usage/providerQuota.ts
11721
- import { z as z33 } from "zod";
11830
+ import { z as z34 } from "zod";
11722
11831
  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;
11723
11832
  var init_providerQuota = __esm({
11724
11833
  "src/usage/providerQuota.ts"() {
@@ -11737,35 +11846,35 @@ var init_providerQuota = __esm({
11737
11846
  [ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND9],
11738
11847
  [ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9]
11739
11848
  ]);
11740
- ZaiLimitSchema = z33.object({
11741
- type: z33.string(),
11742
- unit: z33.number().int(),
11743
- number: z33.number().int().positive(),
11744
- percentage: z33.number().nonnegative(),
11745
- nextResetTime: z33.number().positive().optional(),
11746
- usage: z33.number().nonnegative().optional(),
11747
- currentValue: z33.number().nonnegative().optional(),
11748
- remaining: z33.number().nonnegative().optional()
11849
+ ZaiLimitSchema = z34.object({
11850
+ type: z34.string(),
11851
+ unit: z34.number().int(),
11852
+ number: z34.number().int().positive(),
11853
+ percentage: z34.number().nonnegative(),
11854
+ nextResetTime: z34.number().positive().optional(),
11855
+ usage: z34.number().nonnegative().optional(),
11856
+ currentValue: z34.number().nonnegative().optional(),
11857
+ remaining: z34.number().nonnegative().optional()
11749
11858
  });
11750
- ZaiResponseSchema = z33.object({
11751
- success: z33.boolean(),
11752
- msg: z33.string().optional(),
11753
- data: z33.object({ level: z33.string().optional(), limits: z33.array(ZaiLimitSchema) })
11859
+ ZaiResponseSchema = z34.object({
11860
+ success: z34.boolean(),
11861
+ msg: z34.string().optional(),
11862
+ data: z34.object({ level: z34.string().optional(), limits: z34.array(ZaiLimitSchema) })
11754
11863
  });
11755
11864
  OPENROUTER_HOST = "openrouter.ai";
11756
11865
  OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
11757
11866
  OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
11758
11867
  MS_PER_DAY3 = HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
11759
- OpenRouterKeySchema = z33.object({
11760
- data: z33.object({
11761
- limit: z33.number().nonnegative().nullable(),
11762
- limit_remaining: z33.number().nullable(),
11763
- limit_reset: z33.string().nullable(),
11764
- is_free_tier: z33.boolean().optional(),
11765
- free_model_daily_requests: z33.object({ used: z33.number().nonnegative(), limit: z33.number().nonnegative(), remaining: z33.number() }).optional()
11868
+ OpenRouterKeySchema = z34.object({
11869
+ data: z34.object({
11870
+ limit: z34.number().nonnegative().nullable(),
11871
+ limit_remaining: z34.number().nullable(),
11872
+ limit_reset: z34.string().nullable(),
11873
+ is_free_tier: z34.boolean().optional(),
11874
+ free_model_daily_requests: z34.object({ used: z34.number().nonnegative(), limit: z34.number().nonnegative(), remaining: z34.number() }).optional()
11766
11875
  })
11767
11876
  });
11768
- OpenRouterCreditsSchema = z33.object({ data: z33.object({ total_credits: z33.number().nonnegative(), total_usage: z33.number().nonnegative() }) });
11877
+ OpenRouterCreditsSchema = z34.object({ data: z34.object({ total_credits: z34.number().nonnegative(), total_usage: z34.number().nonnegative() }) });
11769
11878
  ANTIGRAVITY_HOST = "daily-cloudcode-pa.googleapis.com";
11770
11879
  ANTIGRAVITY_QUOTA_URL = `https://${ANTIGRAVITY_HOST}/v1internal:retrieveUserQuotaSummary`;
11771
11880
  ANTIGRAVITY_USER_URL = `https://${ANTIGRAVITY_HOST}/v1internal:loadCodeAssist`;
@@ -11773,21 +11882,21 @@ var init_providerQuota = __esm({
11773
11882
  DAYS_PER_WEEK2 = 7;
11774
11883
  FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
11775
11884
  WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
11776
- AntigravityBucketSchema = z33.object({
11777
- bucketId: z33.string(),
11778
- remainingFraction: z33.number().optional(),
11779
- resetTime: z33.string().optional()
11885
+ AntigravityBucketSchema = z34.object({
11886
+ bucketId: z34.string(),
11887
+ remainingFraction: z34.number().optional(),
11888
+ resetTime: z34.string().optional()
11780
11889
  });
11781
- AntigravitySummarySchema = z33.object({ groups: z33.array(z33.object({ buckets: z33.array(AntigravityBucketSchema) })) });
11782
- GoogleTokenInfoSchema = z33.object({
11783
- email: z33.string().optional(),
11784
- sub: z33.string().optional()
11890
+ AntigravitySummarySchema = z34.object({ groups: z34.array(z34.object({ buckets: z34.array(AntigravityBucketSchema) })) });
11891
+ GoogleTokenInfoSchema = z34.object({
11892
+ email: z34.string().optional(),
11893
+ sub: z34.string().optional()
11785
11894
  });
11786
- AntigravityUserSchema = z33.object({
11895
+ AntigravityUserSchema = z34.object({
11787
11896
  /** The code-assist tier context, which defaults to the free tier for every account. */
11788
- currentTier: z33.object({ name: z33.string().optional(), id: z33.string().optional() }).optional(),
11897
+ currentTier: z34.object({ name: z34.string().optional(), id: z34.string().optional() }).optional(),
11789
11898
  /** The account's paid subscription; absent when the account has none. */
11790
- paidTier: z33.object({ name: z33.string().optional(), id: z33.string().optional() }).optional()
11899
+ paidTier: z34.object({ name: z34.string().optional(), id: z34.string().optional() }).optional()
11791
11900
  });
11792
11901
  }
11793
11902
  });
@@ -14686,7 +14795,7 @@ function writePools(paths, pools) {
14686
14795
  applyPatch(paths.globalConfigFile, GlobalConfigSchema, { pools }, { defaults: {} });
14687
14796
  }
14688
14797
  function poolCycleOf(pools, name) {
14689
- const walk = (current, path43) => {
14798
+ const walk2 = (current, path43) => {
14690
14799
  for (const entry of pools[current]?.identities ?? []) {
14691
14800
  const nested = poolNameOf(poolMemberIdentity(entry));
14692
14801
  if (nested === void 0) {
@@ -14698,14 +14807,14 @@ function poolCycleOf(pools, name) {
14698
14807
  if (path43.includes(nested)) {
14699
14808
  continue;
14700
14809
  }
14701
- const found = walk(nested, [...path43, nested]);
14810
+ const found = walk2(nested, [...path43, nested]);
14702
14811
  if (found !== void 0) {
14703
14812
  return found;
14704
14813
  }
14705
14814
  }
14706
14815
  return void 0;
14707
14816
  };
14708
- return walk(name, [name]);
14817
+ return walk2(name, [name]);
14709
14818
  }
14710
14819
  function validateMembers(pools, name, members) {
14711
14820
  for (const entry of members) {
@@ -14834,7 +14943,7 @@ init_providersStore();
14834
14943
  init_projects();
14835
14944
  init_pipeline();
14836
14945
  import path27 from "node:path";
14837
- import { z as z17 } from "zod";
14946
+ import { z as z18 } from "zod";
14838
14947
  var HISTORY_PROJECTS_KEY_PREFIX = "history/projects/";
14839
14948
  function projectFragmentOf(rawKey) {
14840
14949
  return rawKey.startsWith(HISTORY_PROJECTS_KEY_PREFIX) ? rawKey.slice(HISTORY_PROJECTS_KEY_PREFIX.length) : void 0;
@@ -14903,9 +15012,9 @@ function lookupKeychainService(run, farmRoot) {
14903
15012
  }
14904
15013
  return { checked: true, found: true, serviceName, note: `Keychain service name for this identity: "${serviceName}".` };
14905
15014
  }
14906
- var SettingsSecretsShapeSchema = z17.looseObject({
14907
- env: z17.record(z17.string(), z17.unknown()).optional(),
14908
- hooks: z17.record(z17.string(), z17.array(z17.unknown())).optional()
15015
+ var SettingsSecretsShapeSchema = z18.looseObject({
15016
+ env: z18.record(z18.string(), z18.unknown()).optional(),
15017
+ hooks: z18.record(z18.string(), z18.array(z18.unknown())).optional()
14909
15018
  });
14910
15019
  function hookCommandCountOf(group) {
14911
15020
  if (typeof group !== "object" || group === null) {
@@ -15202,7 +15311,7 @@ init_schema();
15202
15311
  init_claudeVersion();
15203
15312
  init_identity();
15204
15313
  init_projects();
15205
- import { z as z19 } from "zod";
15314
+ import { z as z20 } from "zod";
15206
15315
 
15207
15316
  // src/resolve/types.ts
15208
15317
  var LAYER_KINDS = [
@@ -15263,123 +15372,123 @@ var DIAGNOSTIC_SEVERITIES = ["error", "warning", "info"];
15263
15372
 
15264
15373
  // src/usage/pickReportSchema.ts
15265
15374
  init_plan2();
15266
- import { z as z18 } from "zod";
15267
- var PoolPickCandidateViewSchema = z18.strictObject({
15268
- identity: z18.string(),
15375
+ import { z as z19 } from "zod";
15376
+ var PoolPickCandidateViewSchema = z19.strictObject({
15377
+ identity: z19.string(),
15269
15378
  /** In pick order: `scored` has usable quota data, `unknown` has none, `pay-per-use` bills by use, `ineligible` is refused right now. */
15270
- class: z18.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
15379
+ class: z19.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
15271
15380
  /** Plan-size-weighted remaining quota per hour until its reset; present for `scored` only. */
15272
- score: z18.number().optional(),
15381
+ score: z19.number().optional(),
15273
15382
  /** 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`. */
15274
- scoreWindow: z18.enum(["sevenDay", "fiveHour"]).optional(),
15383
+ scoreWindow: z19.enum(["sevenDay", "fiveHour"]).optional(),
15275
15384
  /** False when the five-hour window would run dry, at the observed pace, before it resets. */
15276
- feasible: z18.boolean(),
15385
+ feasible: z19.boolean(),
15277
15386
  /** When an `ineligible` member can be used again, as an ISO instant. */
15278
- blockedUntil: z18.iso.datetime().optional(),
15387
+ blockedUntil: z19.iso.datetime().optional(),
15279
15388
  plan: PlanClassSchema,
15280
15389
  /** The facts behind the class and score, in the order they matter. */
15281
- reasons: z18.array(z18.string())
15390
+ reasons: z19.array(z19.string())
15282
15391
  });
15283
- var PoolPickReportSchema = z18.strictObject({
15284
- pool: z18.string(),
15285
- directory: z18.string(),
15392
+ var PoolPickReportSchema = z19.strictObject({
15393
+ pool: z19.string(),
15394
+ directory: z19.string(),
15286
15395
  /** The member a launch would run as, absent when every member is refused. */
15287
- pick: z18.string().optional(),
15288
- candidates: z18.array(PoolPickCandidateViewSchema),
15396
+ pick: z19.string().optional(),
15397
+ candidates: z19.array(PoolPickCandidateViewSchema),
15289
15398
  /** Identity members anywhere in the pool's graph that do not exist; a launch skips them. */
15290
- missing: z18.array(z18.string()),
15399
+ missing: z19.array(z19.string()),
15291
15400
  /** When nothing can be picked, the soonest any member returns. */
15292
- earliestReturn: z18.strictObject({ identity: z18.string(), at: z18.iso.datetime() }).optional(),
15401
+ earliestReturn: z19.strictObject({ identity: z19.string(), at: z19.iso.datetime() }).optional(),
15293
15402
  /** The member a resumed conversation started on but moved off, and why, when the ranking could not keep it. */
15294
- movedOff: z18.strictObject({ identity: z18.string(), reason: z18.string() }).optional(),
15403
+ movedOff: z19.strictObject({ identity: z19.string(), reason: z19.string() }).optional(),
15295
15404
  /** Why the last-pick record could not be read, when that is the case. */
15296
- stickyProblem: z18.string().optional()
15405
+ stickyProblem: z19.string().optional()
15297
15406
  });
15298
15407
 
15299
15408
  // src/checkReportSchema.ts
15300
15409
  var CHECK_CREDENTIAL_APPLIES = ["provider", "identity", "stored-login"];
15301
- var CheckLayerViewSchema = z19.strictObject({
15302
- id: z19.int(),
15303
- kind: z19.enum(LAYER_KINDS),
15304
- source: z19.string()
15410
+ var CheckLayerViewSchema = z20.strictObject({
15411
+ id: z20.int(),
15412
+ kind: z20.enum(LAYER_KINDS),
15413
+ source: z20.string()
15305
15414
  });
15306
- var CheckEntryViewSchema = z19.strictObject({
15307
- path: z19.string(),
15308
- shared: z19.boolean(),
15309
- via: z19.enum(DECISION_VIAS),
15415
+ var CheckEntryViewSchema = z20.strictObject({
15416
+ path: z20.string(),
15417
+ shared: z20.boolean(),
15418
+ via: z20.enum(DECISION_VIAS),
15310
15419
  /** The entry's real category, or null when nothing classifies it. */
15311
- category: z19.enum(CATEGORY_NAMES).nullable(),
15312
- rule: z19.strictObject({ key: z19.string(), layer: z19.int() }).optional(),
15420
+ category: z20.enum(CATEGORY_NAMES).nullable(),
15421
+ rule: z20.strictObject({ key: z20.string(), layer: z20.int() }).optional(),
15313
15422
  /** Rules that matched but whose `when` condition failed, each with the conditions that failed. */
15314
- eliminated: z19.readonly(z19.array(z19.strictObject({ key: z19.string(), failed: z19.readonly(z19.array(z19.string())) }))).optional()
15423
+ eliminated: z20.readonly(z20.array(z20.strictObject({ key: z20.string(), failed: z20.readonly(z20.array(z20.string())) }))).optional()
15315
15424
  });
15316
- var CheckDiagnosticSchema = z19.strictObject({
15317
- code: z19.enum(DIAGNOSTIC_CODES),
15318
- severity: z19.enum(DIAGNOSTIC_SEVERITIES),
15319
- message: z19.string(),
15320
- subject: z19.string().optional(),
15321
- layer: z19.int().optional()
15425
+ var CheckDiagnosticSchema = z20.strictObject({
15426
+ code: z20.enum(DIAGNOSTIC_CODES),
15427
+ severity: z20.enum(DIAGNOSTIC_SEVERITIES),
15428
+ message: z20.string(),
15429
+ subject: z20.string().optional(),
15430
+ layer: z20.int().optional()
15322
15431
  });
15323
- var CheckAmbientCredentialSchema = z19.union([z19.strictObject({ ok: z19.literal(true) }), z19.strictObject({ ok: z19.literal(false), variable: z19.string(), message: z19.string() })]);
15324
- var CheckKeychainSchema = z19.strictObject({
15325
- checked: z19.literal(true),
15326
- found: z19.boolean(),
15327
- serviceName: z19.string().optional(),
15328
- note: z19.string()
15432
+ var CheckAmbientCredentialSchema = z20.union([z20.strictObject({ ok: z20.literal(true) }), z20.strictObject({ ok: z20.literal(false), variable: z20.string(), message: z20.string() })]);
15433
+ var CheckKeychainSchema = z20.strictObject({
15434
+ checked: z20.literal(true),
15435
+ found: z20.boolean(),
15436
+ serviceName: z20.string().optional(),
15437
+ note: z20.string()
15329
15438
  });
15330
- var CheckSettingsExposureSchema = z19.strictObject({
15331
- file: z19.string(),
15332
- envKeyNames: z19.readonly(z19.array(z19.string())),
15333
- hookEventNames: z19.readonly(z19.array(z19.string())),
15334
- hookCommandCount: z19.int().nonnegative()
15439
+ var CheckSettingsExposureSchema = z20.strictObject({
15440
+ file: z20.string(),
15441
+ envKeyNames: z20.readonly(z20.array(z20.string())),
15442
+ hookEventNames: z20.readonly(z20.array(z20.string())),
15443
+ hookCommandCount: z20.int().nonnegative()
15335
15444
  });
15336
- var CredentialSourceSummarySchema = z19.union([
15337
- z19.strictObject({ kind: z19.literal("env"), variable: z19.string() }),
15338
- z19.strictObject({ kind: z19.literal("file"), path: z19.string() }),
15339
- z19.strictObject({ kind: z19.literal("command"), program: z19.string() }),
15340
- z19.strictObject({ kind: z19.literal("op"), reference: z19.string() }),
15341
- z19.strictObject({ kind: z19.literal("keychain"), service: z19.string(), account: z19.string().optional() }),
15342
- z19.strictObject({ kind: z19.literal("literal") })
15445
+ var CredentialSourceSummarySchema = z20.union([
15446
+ z20.strictObject({ kind: z20.literal("env"), variable: z20.string() }),
15447
+ z20.strictObject({ kind: z20.literal("file"), path: z20.string() }),
15448
+ z20.strictObject({ kind: z20.literal("command"), program: z20.string() }),
15449
+ z20.strictObject({ kind: z20.literal("op"), reference: z20.string() }),
15450
+ z20.strictObject({ kind: z20.literal("keychain"), service: z20.string(), account: z20.string().optional() }),
15451
+ z20.strictObject({ kind: z20.literal("literal") })
15343
15452
  ]);
15344
- var CredentialSummarySchema = z19.strictObject({
15345
- target: z19.enum(CREDENTIAL_TARGETS),
15346
- sources: z19.readonly(z19.array(CredentialSourceSummarySchema)),
15453
+ var CredentialSummarySchema = z20.strictObject({
15454
+ target: z20.enum(CREDENTIAL_TARGETS),
15455
+ sources: z20.readonly(z20.array(CredentialSourceSummarySchema)),
15347
15456
  cache: CredentialCacheSchema.optional()
15348
15457
  });
15349
- var CachedCredentialStateSchema = z19.union([
15350
- z19.strictObject({ store: z19.enum(CREDENTIAL_CACHE_STORES), status: z19.literal("empty") }),
15351
- z19.strictObject({ store: z19.enum(CREDENTIAL_CACHE_STORES), status: z19.literal("unreadable"), reason: z19.string() }),
15352
- z19.strictObject({ store: z19.enum(CREDENTIAL_CACHE_STORES), status: z19.enum(["fresh", "expired"]), ageMs: z19.number(), expiresInMs: z19.number().optional() })
15458
+ var CachedCredentialStateSchema = z20.union([
15459
+ z20.strictObject({ store: z20.enum(CREDENTIAL_CACHE_STORES), status: z20.literal("empty") }),
15460
+ z20.strictObject({ store: z20.enum(CREDENTIAL_CACHE_STORES), status: z20.literal("unreadable"), reason: z20.string() }),
15461
+ z20.strictObject({ store: z20.enum(CREDENTIAL_CACHE_STORES), status: z20.enum(["fresh", "expired"]), ageMs: z20.number(), expiresInMs: z20.number().optional() })
15353
15462
  ]);
15354
- var CheckCredentialProviderSchema = z19.union([
15355
- z19.strictObject({ name: z19.string(), credential: CredentialSummarySchema.optional(), cached: CachedCredentialStateSchema.optional() }),
15356
- z19.strictObject({ name: z19.string(), problem: z19.string() })
15463
+ var CheckCredentialProviderSchema = z20.union([
15464
+ z20.strictObject({ name: z20.string(), credential: CredentialSummarySchema.optional(), cached: CachedCredentialStateSchema.optional() }),
15465
+ z20.strictObject({ name: z20.string(), problem: z20.string() })
15357
15466
  ]);
15358
- var CheckCredentialSchema = z19.strictObject({
15359
- applies: z19.enum(CHECK_CREDENTIAL_APPLIES),
15467
+ var CheckCredentialSchema = z20.strictObject({
15468
+ applies: z20.enum(CHECK_CREDENTIAL_APPLIES),
15360
15469
  provider: CheckCredentialProviderSchema.optional(),
15361
15470
  identity: CredentialSummarySchema.optional(),
15362
15471
  identityCached: CachedCredentialStateSchema.optional()
15363
15472
  });
15364
- var CheckClaudeVersionSchema = z19.strictObject({
15365
- pinned: z19.strictObject({ version: z19.string(), source: z19.enum(CLAUDE_VERSION_SOURCES), installed: z19.boolean() }).optional(),
15366
- highestInstalled: z19.string().optional(),
15367
- installed: z19.readonly(z19.array(z19.string()))
15473
+ var CheckClaudeVersionSchema = z20.strictObject({
15474
+ pinned: z20.strictObject({ version: z20.string(), source: z20.enum(CLAUDE_VERSION_SOURCES), installed: z20.boolean() }).optional(),
15475
+ highestInstalled: z20.string().optional(),
15476
+ installed: z20.readonly(z20.array(z20.string()))
15368
15477
  });
15369
- var CheckReportJsonSchema = z19.strictObject({
15370
- identity: z19.strictObject({ name: z19.string().nullable(), source: z19.enum(IDENTITY_DECISION_SOURCES) }),
15478
+ var CheckReportJsonSchema = z20.strictObject({
15479
+ identity: z20.strictObject({ name: z20.string().nullable(), source: z20.enum(IDENTITY_DECISION_SOURCES) }),
15371
15480
  /** The pool ranking, when the launch named a pool instead of an identity. */
15372
15481
  pool: PoolPickReportSchema.optional(),
15373
- configProfile: z19.strictObject({ name: z19.string().nullable(), source: z19.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
15374
- layers: z19.readonly(z19.array(CheckLayerViewSchema)),
15375
- entries: z19.readonly(z19.array(CheckEntryViewSchema)),
15376
- projectEncodingAmbiguities: z19.readonly(
15377
- z19.array(z19.strictObject({ fragment: z19.string(), encoded: z19.string(), reason: z19.enum(ENCODING_AMBIGUITY_REASONS), detail: z19.string() }))
15482
+ configProfile: z20.strictObject({ name: z20.string().nullable(), source: z20.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
15483
+ layers: z20.readonly(z20.array(CheckLayerViewSchema)),
15484
+ entries: z20.readonly(z20.array(CheckEntryViewSchema)),
15485
+ projectEncodingAmbiguities: z20.readonly(
15486
+ z20.array(z20.strictObject({ fragment: z20.string(), encoded: z20.string(), reason: z20.enum(ENCODING_AMBIGUITY_REASONS), detail: z20.string() }))
15378
15487
  ),
15379
- diagnostics: z19.readonly(z19.array(CheckDiagnosticSchema)),
15488
+ diagnostics: z20.readonly(z20.array(CheckDiagnosticSchema)),
15380
15489
  ambientCredential: CheckAmbientCredentialSchema,
15381
15490
  keychain: CheckKeychainSchema.optional(),
15382
- settingsExposure: z19.readonly(z19.array(CheckSettingsExposureSchema)),
15491
+ settingsExposure: z20.readonly(z20.array(CheckSettingsExposureSchema)),
15383
15492
  credential: CheckCredentialSchema,
15384
15493
  claudeVersion: CheckClaudeVersionSchema.optional()
15385
15494
  });
@@ -15439,28 +15548,28 @@ function collectResets(snapshots, nowMs) {
15439
15548
  }
15440
15549
 
15441
15550
  // src/usage/resetsSchema.ts
15442
- import { z as z20 } from "zod";
15443
- var ResetRowSchema = z20.strictObject({
15444
- identity: z20.string(),
15445
- provider: z20.string(),
15551
+ import { z as z21 } from "zod";
15552
+ var ResetRowSchema = z21.strictObject({
15553
+ identity: z21.string(),
15554
+ provider: z21.string(),
15446
15555
  /** What the window is: `5h`, `7d` or `extra usage` for an Anthropic account, or the provider's own measure and period (`tokens 5h`). */
15447
- window: z20.string(),
15556
+ window: z21.string(),
15448
15557
  /** When the state the window comes from was observed, as an ISO instant. */
15449
- observedAt: z20.iso.datetime(),
15558
+ observedAt: z21.iso.datetime(),
15450
15559
  /** When the window resets, as an ISO instant; absent when the upstream reported none. */
15451
- resetsAt: z20.iso.datetime().optional(),
15560
+ resetsAt: z21.iso.datetime().optional(),
15452
15561
  /** True when the reset time has passed, so the recorded observation describes a window that no longer exists and its utilisation reads as 0. */
15453
- reset: z20.boolean(),
15562
+ reset: z21.boolean(),
15454
15563
  /** The fraction used, as `effectiveWindow` reads it at the report's own clock. */
15455
- utilization: z20.number().optional(),
15564
+ utilization: z21.number().optional(),
15456
15565
  /** The window's own status, for a window that has not reset yet. */
15457
- status: z20.string().optional()
15566
+ status: z21.string().optional()
15458
15567
  });
15459
- var ResetScheduleSchema = z20.strictObject({ resets: z20.readonly(z20.array(ResetRowSchema)) });
15568
+ var ResetScheduleSchema = z21.strictObject({ resets: z21.readonly(z21.array(ResetRowSchema)) });
15460
15569
 
15461
15570
  // src/frontdoor/controlSchemas.ts
15462
15571
  import path32 from "node:path";
15463
- import { z as z27 } from "zod";
15572
+ import { z as z28 } from "zod";
15464
15573
 
15465
15574
  // src/doctorReport.ts
15466
15575
  init_claudeShim();
@@ -15640,24 +15749,24 @@ import path31 from "node:path";
15640
15749
  init_signIn();
15641
15750
 
15642
15751
  // src/codex/siwcStore.ts
15643
- import { z as z24 } from "zod";
15752
+ import { z as z25 } from "zod";
15644
15753
 
15645
15754
  // src/codex/auth.ts
15646
- import { z as z22 } from "zod";
15647
- var AuthFileSchema = z22.looseObject({
15648
- tokens: z22.looseObject({
15649
- access_token: z22.string().optional(),
15650
- refresh_token: z22.string().optional(),
15651
- id_token: z22.string().optional(),
15652
- account_id: z22.string().optional()
15755
+ import { z as z23 } from "zod";
15756
+ var AuthFileSchema = z23.looseObject({
15757
+ tokens: z23.looseObject({
15758
+ access_token: z23.string().optional(),
15759
+ refresh_token: z23.string().optional(),
15760
+ id_token: z23.string().optional(),
15761
+ account_id: z23.string().optional()
15653
15762
  }).nullish(),
15654
- last_refresh: z22.string().optional()
15763
+ last_refresh: z23.string().optional()
15655
15764
  });
15656
- var TokenGrantSchema = z22.looseObject({
15657
- access_token: z22.string().min(1).optional(),
15658
- refresh_token: z22.string().min(1).optional(),
15659
- id_token: z22.string().min(1).optional(),
15660
- account_id: z22.string().min(1).optional()
15765
+ var TokenGrantSchema = z23.looseObject({
15766
+ access_token: z23.string().min(1).optional(),
15767
+ refresh_token: z23.string().min(1).optional(),
15768
+ id_token: z23.string().min(1).optional(),
15769
+ account_id: z23.string().min(1).optional()
15661
15770
  });
15662
15771
  var CodexAuthError = class extends Error {
15663
15772
  constructor(message) {
@@ -15667,41 +15776,41 @@ var CodexAuthError = class extends Error {
15667
15776
  };
15668
15777
 
15669
15778
  // src/codex/siwc.ts
15670
- import { z as z23 } from "zod";
15779
+ import { z as z24 } from "zod";
15671
15780
  var SIWC_RESOURCE = "https://api.openai.com/v1";
15672
15781
  var SIWC_RESPONSES_URL = `${SIWC_RESOURCE}/responses`;
15673
15782
  var SIWC_PLAN_SCOPE = "chatgpt.tokens.use.direct";
15674
- var TokenResponseSchema = z23.looseObject({
15675
- access_token: z23.string().min(1),
15676
- refresh_token: z23.string().min(1).optional(),
15677
- id_token: z23.string().min(1).optional(),
15678
- expires_in: z23.number().positive(),
15679
- scope: z23.string().optional()
15783
+ var TokenResponseSchema = z24.looseObject({
15784
+ access_token: z24.string().min(1),
15785
+ refresh_token: z24.string().min(1).optional(),
15786
+ id_token: z24.string().min(1).optional(),
15787
+ expires_in: z24.number().positive(),
15788
+ scope: z24.string().optional()
15680
15789
  });
15681
- var JwtHeaderSchema = z23.looseObject({ alg: z23.string(), kid: z23.string().optional() });
15682
- var IdTokenClaimsSchema = z23.looseObject({
15683
- iss: z23.string(),
15684
- sub: z23.string().min(1),
15685
- aud: z23.union([z23.string(), z23.array(z23.string())]),
15686
- exp: z23.number(),
15687
- nonce: z23.string().optional(),
15688
- email: z23.string().optional()
15790
+ var JwtHeaderSchema = z24.looseObject({ alg: z24.string(), kid: z24.string().optional() });
15791
+ var IdTokenClaimsSchema = z24.looseObject({
15792
+ iss: z24.string(),
15793
+ sub: z24.string().min(1),
15794
+ aud: z24.union([z24.string(), z24.array(z24.string())]),
15795
+ exp: z24.number(),
15796
+ nonce: z24.string().optional(),
15797
+ email: z24.string().optional()
15689
15798
  });
15690
- var JwksSchema = z23.object({ keys: z23.array(z23.looseObject({ kid: z23.string().optional(), kty: z23.string() })) });
15799
+ var JwksSchema = z24.object({ keys: z24.array(z24.looseObject({ kid: z24.string().optional(), kty: z24.string() })) });
15691
15800
 
15692
15801
  // src/codex/siwcStore.ts
15693
- var SiwcGrantSchema = z24.strictObject({
15694
- clientId: z24.string().min(1),
15695
- sub: z24.string().min(1),
15696
- email: z24.string().optional(),
15697
- idToken: z24.string().min(1),
15698
- accessToken: z24.string().min(1),
15699
- refreshToken: z24.string().min(1),
15700
- scopes: z24.array(z24.string()).readonly(),
15802
+ var SiwcGrantSchema = z25.strictObject({
15803
+ clientId: z25.string().min(1),
15804
+ sub: z25.string().min(1),
15805
+ email: z25.string().optional(),
15806
+ idToken: z25.string().min(1),
15807
+ accessToken: z25.string().min(1),
15808
+ refreshToken: z25.string().min(1),
15809
+ scopes: z25.array(z25.string()).readonly(),
15701
15810
  /** When the access token stops working, in milliseconds since the epoch. */
15702
- expiresAt: z24.number()
15811
+ expiresAt: z25.number()
15703
15812
  });
15704
- var SiwcFileSchema = z24.strictObject({ registeredClientId: z24.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
15813
+ var SiwcFileSchema = z25.strictObject({ registeredClientId: z25.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
15705
15814
  function parseSiwcFile(raw, filePath) {
15706
15815
  let json;
15707
15816
  try {
@@ -16665,92 +16774,92 @@ function collectDoctorReport(params) {
16665
16774
  // src/frontdoor/controlSchemas.ts
16666
16775
  init_schema2();
16667
16776
  init_state();
16668
- var UsageListOutputSchema = z27.strictObject({ snapshots: z27.readonly(z27.array(UsageSnapshotSchema)) });
16669
- var UsageWindowsInputSchema = z27.strictObject({
16670
- identity: z27.string().min(1),
16671
- provider: z27.string().min(1).optional()
16777
+ var UsageListOutputSchema = z28.strictObject({ snapshots: z28.readonly(z28.array(UsageSnapshotSchema)) });
16778
+ var UsageWindowsInputSchema = z28.strictObject({
16779
+ identity: z28.string().min(1),
16780
+ provider: z28.string().min(1).optional()
16672
16781
  });
16673
- var EffectiveWindowSchema = z27.strictObject({
16782
+ var EffectiveWindowSchema = z28.strictObject({
16674
16783
  /** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
16675
- reset: z27.boolean(),
16784
+ reset: z28.boolean(),
16676
16785
  /** The fraction used: 0 for a reset window, otherwise what was last observed, absent when none was reported. */
16677
- utilization: z27.number().optional(),
16786
+ utilization: z28.number().optional(),
16678
16787
  /** The reset instant, for a window that has not reset yet and reported one. */
16679
- resetsAtMs: z27.number().optional(),
16788
+ resetsAtMs: z28.number().optional(),
16680
16789
  /** The window's own status, for a window that has not reset yet. */
16681
- status: z27.string().optional()
16790
+ status: z28.string().optional()
16682
16791
  });
16683
- var UsageWindowsOutputSchema = z27.strictObject({
16684
- identity: z27.string(),
16685
- provider: z27.string(),
16792
+ var UsageWindowsOutputSchema = z28.strictObject({
16793
+ identity: z28.string(),
16794
+ provider: z28.string(),
16686
16795
  /** When the rate-limit state the windows come from was observed. */
16687
- observedAt: z27.iso.datetime().optional(),
16796
+ observedAt: z28.iso.datetime().optional(),
16688
16797
  fiveHour: EffectiveWindowSchema.optional(),
16689
16798
  sevenDay: EffectiveWindowSchema.optional()
16690
16799
  });
16691
- var UsageLiveOutputSchema = z27.strictObject({
16800
+ var UsageLiveOutputSchema = z28.strictObject({
16692
16801
  /** 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. */
16693
16802
  latest: RcLiveRateLimitSchema.optional(),
16694
16803
  /** One observation per session whose stream has filed a rate_limit_event this door generation. */
16695
- sessions: z27.readonly(z27.array(RcLiveRateLimitSchema))
16804
+ sessions: z28.readonly(z28.array(RcLiveRateLimitSchema))
16696
16805
  });
16697
- var FrontDoorSessionStatusSchema = z27.strictObject({
16698
- pid: z27.int().positive(),
16699
- startedAt: z27.number(),
16700
- alive: z27.boolean()
16806
+ var FrontDoorSessionStatusSchema = z28.strictObject({
16807
+ pid: z28.int().positive(),
16808
+ startedAt: z28.number(),
16809
+ alive: z28.boolean()
16701
16810
  });
16702
- var HeadroomSocketTargetSchema = z27.union([z27.strictObject({ socketPath: z27.string() }), z27.strictObject({ refused: z27.string() })]);
16703
- var FrontDoorStatusOutputSchema = z27.strictObject({
16811
+ var HeadroomSocketTargetSchema = z28.union([z28.strictObject({ socketPath: z28.string() }), z28.strictObject({ refused: z28.string() })]);
16812
+ var FrontDoorStatusOutputSchema = z28.strictObject({
16704
16813
  state: FrontDoorStateSchema,
16705
- supervisorAlive: z27.boolean(),
16814
+ supervisorAlive: z28.boolean(),
16706
16815
  /** The pids of earlier doors that released their addresses and are finishing the connections they carried: running, but not serving anything new. */
16707
- draining: z27.readonly(z27.array(z27.number().int().positive())),
16708
- sessions: z27.readonly(z27.array(FrontDoorSessionStatusSchema)),
16816
+ draining: z28.readonly(z28.array(z28.number().int().positive())),
16817
+ sessions: z28.readonly(z28.array(FrontDoorSessionStatusSchema)),
16709
16818
  headroomSocket: HeadroomSocketTargetSchema.optional(),
16710
- logPath: z27.string(),
16711
- logExists: z27.boolean()
16819
+ logPath: z28.string(),
16820
+ logExists: z28.boolean()
16712
16821
  });
16713
- var FrontDoorSessionsOutputSchema = z27.strictObject({ sessions: z27.readonly(z27.array(FrontDoorSessionStatusSchema)) });
16714
- var CheckRunInputSchema = z27.strictObject({
16715
- path: z27.string().min(1),
16716
- identity: z27.string().min(1).optional()
16822
+ var FrontDoorSessionsOutputSchema = z28.strictObject({ sessions: z28.readonly(z28.array(FrontDoorSessionStatusSchema)) });
16823
+ var CheckRunInputSchema = z28.strictObject({
16824
+ path: z28.string().min(1),
16825
+ identity: z28.string().min(1).optional()
16717
16826
  }).refine((input) => path32.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
16718
- var PoolPickInputSchema = z27.strictObject({
16719
- pool: z27.string().min(1),
16720
- path: z27.string().min(1)
16827
+ var PoolPickInputSchema = z28.strictObject({
16828
+ pool: z28.string().min(1),
16829
+ path: z28.string().min(1)
16721
16830
  }).refine((input) => path32.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
16722
- var DoctorFindingSchema = z27.strictObject({
16723
- section: z27.enum(DOCTOR_SECTIONS),
16724
- subject: z27.string().optional(),
16725
- severity: z27.enum(DOCTOR_SEVERITIES),
16726
- message: z27.string()
16831
+ var DoctorFindingSchema = z28.strictObject({
16832
+ section: z28.enum(DOCTOR_SECTIONS),
16833
+ subject: z28.string().optional(),
16834
+ severity: z28.enum(DOCTOR_SEVERITIES),
16835
+ message: z28.string()
16727
16836
  });
16728
- var DoctorRunOutputSchema = z27.strictObject({
16837
+ var DoctorRunOutputSchema = z28.strictObject({
16729
16838
  /** False exactly when any finding is a `fail`; a `warn` never fails the report on its own. */
16730
- ok: z27.boolean(),
16731
- findings: z27.readonly(z27.array(DoctorFindingSchema))
16839
+ ok: z28.boolean(),
16840
+ findings: z28.readonly(z28.array(DoctorFindingSchema))
16732
16841
  });
16733
- var FrontDoorRestartOutputSchema = z27.strictObject({
16734
- action: z27.literal("restarting"),
16735
- previousPid: z27.int().positive()
16842
+ var FrontDoorRestartOutputSchema = z28.strictObject({
16843
+ action: z28.literal("restarting"),
16844
+ previousPid: z28.int().positive()
16736
16845
  });
16737
- var UpdateCheckOutputSchema = z27.strictObject({
16738
- current: z27.string(),
16739
- latest: z27.string(),
16740
- action: z27.enum(["current", "available", "updated"])
16846
+ var UpdateCheckOutputSchema = z28.strictObject({
16847
+ current: z28.string(),
16848
+ latest: z28.string(),
16849
+ action: z28.enum(["current", "available", "updated"])
16741
16850
  });
16742
- var CodexSignInSchema = z27.discriminatedUnion("state", [
16743
- z27.strictObject({ state: z27.literal("none") }),
16744
- z27.strictObject({ state: z27.literal("signed-in"), email: z27.string().optional(), planScope: z27.boolean(), accessTokenExpiresAt: z27.number() }),
16745
- z27.strictObject({ state: z27.literal("unreadable"), message: z27.string() })
16851
+ var CodexSignInSchema = z28.discriminatedUnion("state", [
16852
+ z28.strictObject({ state: z28.literal("none") }),
16853
+ z28.strictObject({ state: z28.literal("signed-in"), email: z28.string().optional(), planScope: z28.boolean(), accessTokenExpiresAt: z28.number() }),
16854
+ z28.strictObject({ state: z28.literal("unreadable"), message: z28.string() })
16746
16855
  ]);
16747
- var CodexStatusOutputSchema = z27.strictObject({
16856
+ var CodexStatusOutputSchema = z28.strictObject({
16748
16857
  signIn: CodexSignInSchema,
16749
- codexProviders: z27.readonly(z27.array(z27.string()))
16858
+ codexProviders: z28.readonly(z28.array(z28.string()))
16750
16859
  });
16751
- var CodexLogoutOutputSchema = z27.strictObject({
16752
- hadGrant: z27.boolean(),
16753
- revoked: z27.boolean()
16860
+ var CodexLogoutOutputSchema = z28.strictObject({
16861
+ hadGrant: z28.boolean(),
16862
+ revoked: z28.boolean()
16754
16863
  });
16755
16864
 
16756
16865
  // src/frontdoor/codexApi.ts
@@ -16909,145 +17018,147 @@ init_providersStore();
16909
17018
 
16910
17019
  // src/frontdoor/configSchemas.ts
16911
17020
  init_schema();
16912
- init_statusline();
16913
- import { z as z28 } from "zod";
16914
- var RemovalConfirmationSchema = z28.boolean();
16915
- var CredentialWriteSchema = (targets) => z28.strictObject({
16916
- sources: z28.array(RemoteCredentialSourceSchema).min(1).optional(),
16917
- target: z28.enum(targets).optional(),
16918
- cache: z28.union([z28.literal(false), CredentialCacheSchema]).optional()
17021
+ import { z as z29 } from "zod";
17022
+ var RemovalConfirmationSchema = z29.boolean();
17023
+ var CredentialWriteSchema = (targets) => z29.strictObject({
17024
+ sources: z29.array(RemoteCredentialSourceSchema).min(1).optional(),
17025
+ target: z29.enum(targets).optional(),
17026
+ cache: z29.union([z29.literal(false), CredentialCacheSchema]).optional()
16919
17027
  });
16920
- var CredentialSummarySchema2 = z28.strictObject({
16921
- target: z28.enum(CREDENTIAL_TARGETS),
16922
- sources: z28.readonly(z28.array(
16923
- z28.discriminatedUnion("kind", [
16924
- z28.strictObject({ kind: z28.literal("env"), variable: z28.string() }),
16925
- z28.strictObject({ kind: z28.literal("file"), path: z28.string() }),
16926
- z28.strictObject({ kind: z28.literal("command"), program: z28.string() }),
16927
- z28.strictObject({ kind: z28.literal("op"), reference: z28.string() }),
16928
- z28.strictObject({ kind: z28.literal("keychain"), service: z28.string(), account: z28.string().optional() }),
16929
- z28.strictObject({ kind: z28.literal("literal") })
17028
+ var CredentialSummarySchema2 = z29.strictObject({
17029
+ target: z29.enum(CREDENTIAL_TARGETS),
17030
+ sources: z29.readonly(z29.array(
17031
+ z29.discriminatedUnion("kind", [
17032
+ z29.strictObject({ kind: z29.literal("env"), variable: z29.string() }),
17033
+ z29.strictObject({ kind: z29.literal("file"), path: z29.string() }),
17034
+ z29.strictObject({ kind: z29.literal("command"), program: z29.string() }),
17035
+ z29.strictObject({ kind: z29.literal("op"), reference: z29.string() }),
17036
+ z29.strictObject({ kind: z29.literal("keychain"), service: z29.string(), account: z29.string().optional() }),
17037
+ z29.strictObject({ kind: z29.literal("literal") })
16930
17038
  ])
16931
17039
  )),
16932
17040
  cache: CredentialCacheSchema.optional()
16933
17041
  });
16934
- var mutationOutput = (kind, action) => z28.strictObject({ action: z28.literal(action), kind: z28.literal(kind), name: z28.string() });
16935
- var storedMutationOutput = (kind, action, value) => z28.strictObject({ action: z28.literal(action), kind: z28.literal(kind), name: z28.string(), value });
16936
- var IdentityValueSchema = z28.strictObject({
16937
- name: z28.string(),
16938
- defaultConfigProfile: z28.string().optional(),
16939
- allowAmbientCredential: z28.boolean(),
17042
+ var mutationOutput = (kind, action) => z29.strictObject({ action: z29.literal(action), kind: z29.literal(kind), name: z29.string() });
17043
+ var storedMutationOutput = (kind, action, value) => z29.strictObject({ action: z29.literal(action), kind: z29.literal(kind), name: z29.string(), value });
17044
+ var IdentityValueSchema = z29.strictObject({
17045
+ name: z29.string(),
17046
+ defaultConfigProfile: z29.string().optional(),
17047
+ allowAmbientCredential: z29.boolean(),
16940
17048
  credential: CredentialSummarySchema2.optional(),
16941
- anchors: z28.array(AnchorSchema).optional()
17049
+ anchors: z29.array(AnchorSchema).optional()
16942
17050
  });
16943
17051
  var ProfileValueSchema = ConfigProfileSchema.omit({ $schema: true });
16944
- var ProviderValueSchema = z28.strictObject({
16945
- name: z28.string(),
16946
- kind: z28.enum(PROVIDER_KINDS),
16947
- displayName: z28.string(),
16948
- baseUrl: z28.string().optional(),
17052
+ var ProviderValueSchema = z29.strictObject({
17053
+ name: z29.string(),
17054
+ kind: z29.enum(PROVIDER_KINDS),
17055
+ displayName: z29.string(),
17056
+ baseUrl: z29.string().optional(),
16949
17057
  codex: CodexProviderConfigSchema.optional(),
16950
17058
  credential: CredentialSummarySchema2.optional(),
16951
- env: z28.record(z28.string(), z28.string()).optional()
17059
+ env: z29.record(z29.string(), z29.string()).optional()
16952
17060
  });
16953
- var ConfigNameInputSchema = z28.strictObject({ name: z28.string().min(1) });
17061
+ var ConfigNameInputSchema = z29.strictObject({ name: z29.string().min(1) });
16954
17062
  var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
16955
- var ConfigIdentitySetInputSchema = z28.strictObject({
16956
- name: z28.string().min(1),
16957
- defaultConfigProfile: z28.union([z28.string().min(1), z28.literal(false)]).optional(),
16958
- allowAmbientCredential: z28.boolean().optional(),
16959
- credential: z28.union([z28.literal(false), CredentialWriteSchema(CREDENTIAL_TARGETS)]).optional(),
17063
+ var ConfigIdentitySetInputSchema = z29.strictObject({
17064
+ name: z29.string().min(1),
17065
+ defaultConfigProfile: z29.union([z29.string().min(1), z29.literal(false)]).optional(),
17066
+ allowAmbientCredential: z29.boolean().optional(),
17067
+ credential: z29.union([z29.literal(false), CredentialWriteSchema(CREDENTIAL_TARGETS)]).optional(),
16960
17068
  /** `false` removes the anchors; a list replaces them. */
16961
- anchors: z28.union([z28.literal(false), z28.array(AnchorSchema).min(1)]).optional()
17069
+ anchors: z29.union([z29.literal(false), z29.array(AnchorSchema).min(1)]).optional()
16962
17070
  });
16963
17071
  var ConfigIdentitySetOutputSchema = storedMutationOutput("identity", "updated", IdentityValueSchema);
16964
- var ConfigIdentityRemoveInputSchema = z28.strictObject({ name: z28.string().min(1), confirm: RemovalConfirmationSchema });
17072
+ var ConfigIdentityRemoveInputSchema = z29.strictObject({ name: z29.string().min(1), confirm: RemovalConfirmationSchema });
16965
17073
  var ConfigIdentityRemoveOutputSchema = mutationOutput("identity", "removed");
16966
17074
  var ConfigIdentityUseOutputSchema = mutationOutput("identity", "selected");
16967
- var ConfigProfileAddInputSchema = z28.strictObject({
16968
- name: z28.string().min(1),
16969
- extends: z28.array(z28.string().min(1)).optional(),
16970
- description: z28.string().optional()
17075
+ var ConfigProfileAddInputSchema = z29.strictObject({
17076
+ name: z29.string().min(1),
17077
+ extends: z29.array(z29.string().min(1)).optional(),
17078
+ description: z29.string().optional()
16971
17079
  });
16972
17080
  var ConfigProfileAddOutputSchema = storedMutationOutput("profile", "created", ProfileValueSchema);
16973
- var ConfigProfileSetInputSchema = z28.strictObject({
16974
- name: z28.string().min(1),
16975
- category: z28.record(z28.string(), z28.boolean()).optional(),
16976
- entry: z28.record(z28.string(), z28.boolean()).optional(),
16977
- extends: z28.union([z28.array(z28.string().min(1)), z28.literal(false)]).optional(),
16978
- description: z28.union([z28.string(), z28.literal(false)]).optional(),
16979
- launch: z28.strictObject({
16980
- skipPermissions: z28.boolean().optional(),
16981
- remoteControl: z28.boolean().optional(),
16982
- headroom: z28.boolean().optional(),
16983
- trackUsage: z28.boolean().optional(),
16984
- provider: z28.union([z28.string().min(1), z28.literal(false)]).optional(),
16985
- claudeVersion: z28.union([z28.string().min(1), z28.literal(false)]).optional(),
16986
- delay: z28.union([z28.string().regex(DURATION_RE), z28.literal(false)]).optional(),
16987
- pause: z28.boolean().optional(),
16988
- explain: z28.boolean().optional(),
16989
- proxyBypass: z28.union([z28.array(z28.string().min(1)), z28.literal(false)]).optional(),
16990
- statusline: StatuslineChangeSchema.optional()
17081
+ var ConfigProfileSetInputSchema = z29.strictObject({
17082
+ name: z29.string().min(1),
17083
+ category: z29.record(z29.string(), z29.boolean()).optional(),
17084
+ entry: z29.record(z29.string(), z29.boolean()).optional(),
17085
+ extends: z29.union([z29.array(z29.string().min(1)), z29.literal(false)]).optional(),
17086
+ description: z29.union([z29.string(), z29.literal(false)]).optional(),
17087
+ launch: z29.strictObject({
17088
+ skipPermissions: z29.boolean().optional(),
17089
+ remoteControl: z29.boolean().optional(),
17090
+ headroom: z29.boolean().optional(),
17091
+ trackUsage: z29.boolean().optional(),
17092
+ provider: z29.union([z29.string().min(1), z29.literal(false)]).optional(),
17093
+ claudeVersion: z29.union([z29.string().min(1), z29.literal(false)]).optional(),
17094
+ delay: z29.union([z29.string().regex(DURATION_RE), z29.literal(false)]).optional(),
17095
+ pause: z29.boolean().optional(),
17096
+ explain: z29.boolean().optional(),
17097
+ proxyBypass: z29.union([z29.array(z29.string().min(1)), z29.literal(false)]).optional(),
17098
+ statusline: z29.strictObject({
17099
+ set: z29.record(z29.string(), z29.unknown()).optional(),
17100
+ unset: z29.array(z29.string()).optional()
17101
+ }).optional()
16991
17102
  }).optional()
16992
17103
  });
16993
17104
  var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
16994
- var ConfigProfileRemoveInputSchema = z28.strictObject({ name: z28.string().min(1), confirm: RemovalConfirmationSchema });
17105
+ var ConfigProfileRemoveInputSchema = z29.strictObject({ name: z29.string().min(1), confirm: RemovalConfirmationSchema });
16995
17106
  var ConfigProfileRemoveOutputSchema = mutationOutput("profile", "removed");
16996
17107
  var ConfigProfileUseOutputSchema = mutationOutput("profile", "selected");
16997
- var PoolMembersInputSchema = z28.array(z28.string().min(1)).min(1);
16998
- var ConfigPoolAddInputSchema = z28.strictObject({
16999
- name: z28.string().min(1),
17108
+ var PoolMembersInputSchema = z29.array(z29.string().min(1)).min(1);
17109
+ var ConfigPoolAddInputSchema = z29.strictObject({
17110
+ name: z29.string().min(1),
17000
17111
  identities: PoolMembersInputSchema,
17001
- preference: z28.enum(POOL_PREFERENCES).optional(),
17002
- resumeOnLimit: z28.boolean().optional(),
17003
- compactBeforeLimit: z28.boolean().optional(),
17112
+ preference: z29.enum(POOL_PREFERENCES).optional(),
17113
+ resumeOnLimit: z29.boolean().optional(),
17114
+ compactBeforeLimit: z29.boolean().optional(),
17004
17115
  compactAtUtilisation: CompactAtUtilisationSchema.optional()
17005
17116
  });
17006
17117
  var ConfigPoolAddOutputSchema = storedMutationOutput("pool", "created", PoolSchema);
17007
- var ConfigPoolSetInputSchema = z28.strictObject({
17008
- name: z28.string().min(1),
17118
+ var ConfigPoolSetInputSchema = z29.strictObject({
17119
+ name: z29.string().min(1),
17009
17120
  identities: PoolMembersInputSchema.optional(),
17010
- preference: z28.union([z28.enum(POOL_PREFERENCES), z28.literal(false)]).optional(),
17011
- resumeOnLimit: z28.boolean().optional(),
17012
- compactBeforeLimit: z28.boolean().optional(),
17013
- compactAtUtilisation: z28.union([CompactAtUtilisationSchema, z28.literal(false)]).optional()
17121
+ preference: z29.union([z29.enum(POOL_PREFERENCES), z29.literal(false)]).optional(),
17122
+ resumeOnLimit: z29.boolean().optional(),
17123
+ compactBeforeLimit: z29.boolean().optional(),
17124
+ compactAtUtilisation: z29.union([CompactAtUtilisationSchema, z29.literal(false)]).optional()
17014
17125
  });
17015
17126
  var ConfigPoolSetOutputSchema = storedMutationOutput("pool", "updated", PoolSchema);
17016
- var ConfigPoolRemoveInputSchema = z28.strictObject({ name: z28.string().min(1), confirm: RemovalConfirmationSchema });
17127
+ var ConfigPoolRemoveInputSchema = z29.strictObject({ name: z29.string().min(1), confirm: RemovalConfirmationSchema });
17017
17128
  var ConfigPoolRemoveOutputSchema = mutationOutput("pool", "removed");
17018
17129
  var ConfigPoolUseOutputSchema = mutationOutput("pool", "selected");
17019
- var ConfigProviderAddInputSchema = z28.strictObject({
17020
- name: z28.string().min(1),
17021
- kind: z28.enum(PROVIDER_KINDS).optional(),
17022
- displayName: z28.string().min(1),
17023
- baseUrl: z28.string().min(1).optional(),
17130
+ var ConfigProviderAddInputSchema = z29.strictObject({
17131
+ name: z29.string().min(1),
17132
+ kind: z29.enum(PROVIDER_KINDS).optional(),
17133
+ displayName: z29.string().min(1),
17134
+ baseUrl: z29.string().min(1).optional(),
17024
17135
  credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).required({ sources: true }),
17025
17136
  codex: CodexProviderConfigSchema.optional()
17026
17137
  });
17027
17138
  var ConfigProviderAddOutputSchema = storedMutationOutput("provider", "created", ProviderValueSchema);
17028
- var ConfigProviderSetInputSchema = z28.strictObject({
17029
- name: z28.string().min(1),
17030
- displayName: z28.string().min(1).optional(),
17031
- baseUrl: z28.string().min(1).optional(),
17139
+ var ConfigProviderSetInputSchema = z29.strictObject({
17140
+ name: z29.string().min(1),
17141
+ displayName: z29.string().min(1).optional(),
17142
+ baseUrl: z29.string().min(1).optional(),
17032
17143
  credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).optional(),
17033
17144
  codex: CodexProviderConfigSchema.optional()
17034
17145
  });
17035
17146
  var ConfigProviderSetOutputSchema = storedMutationOutput("provider", "updated", ProviderValueSchema);
17036
- var ConfigProviderRemoveInputSchema = z28.strictObject({ name: z28.string().min(1), confirm: RemovalConfirmationSchema });
17147
+ var ConfigProviderRemoveInputSchema = z29.strictObject({ name: z29.string().min(1), confirm: RemovalConfirmationSchema });
17037
17148
  var ConfigProviderRemoveOutputSchema = mutationOutput("provider", "removed");
17038
- var ConfigRuleAddInputSchema = z28.strictObject({
17039
- path: z28.string().min(1),
17040
- configProfile: z28.string().min(1).optional(),
17041
- identity: z28.string().min(1).optional()
17149
+ var ConfigRuleAddInputSchema = z29.strictObject({
17150
+ path: z29.string().min(1),
17151
+ configProfile: z29.string().min(1).optional(),
17152
+ identity: z29.string().min(1).optional()
17042
17153
  });
17043
17154
  var ConfigRuleAddOutputSchema = storedMutationOutput("rule", "created", DirectoryRuleSchema);
17044
- var ConfigRuleSetInputSchema = z28.strictObject({
17045
- path: z28.string().min(1),
17046
- configProfile: z28.union([z28.string().min(1), z28.literal(false)]).optional(),
17047
- identity: z28.union([z28.string().min(1), z28.literal(false)]).optional()
17155
+ var ConfigRuleSetInputSchema = z29.strictObject({
17156
+ path: z29.string().min(1),
17157
+ configProfile: z29.union([z29.string().min(1), z29.literal(false)]).optional(),
17158
+ identity: z29.union([z29.string().min(1), z29.literal(false)]).optional()
17048
17159
  });
17049
17160
  var ConfigRuleSetOutputSchema = storedMutationOutput("rule", "updated", DirectoryRuleSchema);
17050
- var ConfigRuleRemoveInputSchema = z28.strictObject({ path: z28.string().min(1), confirm: RemovalConfirmationSchema });
17161
+ var ConfigRuleRemoveInputSchema = z29.strictObject({ path: z29.string().min(1), confirm: RemovalConfirmationSchema });
17051
17162
  var ConfigRuleRemoveOutputSchema = mutationOutput("rule", "removed");
17052
17163
 
17053
17164
  // src/frontdoor/configApi.ts
@@ -17360,43 +17471,43 @@ import { openapi as openapi4 } from "@orpc/openapi";
17360
17471
  import { eventIterator as eventIterator2, withEventMeta as withEventMeta2 } from "@orpc/server";
17361
17472
 
17362
17473
  // src/frontdoor/eventSchemas.ts
17363
- import { z as z29 } from "zod";
17474
+ import { z as z30 } from "zod";
17364
17475
  var DOOR_EVENT_SOURCE_RC = "rc";
17365
17476
  var LAUNCH_EVENT_SOURCE = "launch";
17366
17477
  var USAGE_EVENT_SOURCE = "usage";
17367
17478
  var DOOR_HEALTH_EVENT_SOURCE = "door";
17368
17479
  var QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
17369
- var DoorEventSchema = z29.strictObject({
17370
- source: z29.string().min(1),
17480
+ var DoorEventSchema = z30.strictObject({
17481
+ source: z30.string().min(1),
17371
17482
  /** A positive integer because the backbone's counters start at one and only ever increase. */
17372
- sequence: z29.number().int().positive(),
17373
- payload: z29.unknown()
17483
+ sequence: z30.number().int().positive(),
17484
+ payload: z30.unknown()
17374
17485
  });
17375
- var DoorEventSourceQuerySchema = z29.strictObject({
17376
- sources: z29.array(z29.string().min(1)).min(1).optional()
17486
+ var DoorEventSourceQuerySchema = z30.strictObject({
17487
+ sources: z30.array(z30.string().min(1)).min(1).optional()
17377
17488
  });
17378
- var LaunchLifecycleEventSchema = z29.strictObject({
17379
- kind: z29.enum(["registered", "pruned", "ended"]),
17380
- pid: z29.number().int().positive(),
17381
- startedAt: z29.number(),
17382
- observedAt: z29.number()
17489
+ var LaunchLifecycleEventSchema = z30.strictObject({
17490
+ kind: z30.enum(["registered", "pruned", "ended"]),
17491
+ pid: z30.number().int().positive(),
17492
+ startedAt: z30.number(),
17493
+ observedAt: z30.number()
17383
17494
  });
17384
- var DoorHealthEventSchema = z29.discriminatedUnion("kind", [
17385
- z29.strictObject({ kind: z29.literal("generation"), pid: z29.number().int().positive(), providerPort: z29.number().int().positive(), connectPort: z29.number().int().positive(), directPort: z29.number().int().positive(), observedAt: z29.number() }),
17386
- z29.strictObject({ kind: z29.literal("listenerFailed"), pid: z29.number().int().positive(), listener: z29.enum(["provider", "connect", "direct"]), message: z29.string(), observedAt: z29.number() }),
17387
- z29.strictObject({ kind: z29.literal("binaryTurnover"), pid: z29.number().int().positive(), observedAt: z29.number() }),
17388
- z29.strictObject({ kind: z29.literal("idleShutdown"), pid: z29.number().int().positive(), observedAt: z29.number() }),
17389
- z29.strictObject({ kind: z29.literal("superseded"), pid: z29.number().int().positive(), ownerPid: z29.number().int().positive(), observedAt: z29.number() }),
17390
- z29.strictObject({ kind: z29.literal("drained"), pid: z29.number().int().positive(), observedAt: z29.number() })
17495
+ var DoorHealthEventSchema = z30.discriminatedUnion("kind", [
17496
+ z30.strictObject({ kind: z30.literal("generation"), pid: z30.number().int().positive(), providerPort: z30.number().int().positive(), connectPort: z30.number().int().positive(), directPort: z30.number().int().positive(), observedAt: z30.number() }),
17497
+ z30.strictObject({ kind: z30.literal("listenerFailed"), pid: z30.number().int().positive(), listener: z30.enum(["provider", "connect", "direct"]), message: z30.string(), observedAt: z30.number() }),
17498
+ z30.strictObject({ kind: z30.literal("binaryTurnover"), pid: z30.number().int().positive(), observedAt: z30.number() }),
17499
+ z30.strictObject({ kind: z30.literal("idleShutdown"), pid: z30.number().int().positive(), observedAt: z30.number() }),
17500
+ z30.strictObject({ kind: z30.literal("superseded"), pid: z30.number().int().positive(), ownerPid: z30.number().int().positive(), observedAt: z30.number() }),
17501
+ z30.strictObject({ kind: z30.literal("drained"), pid: z30.number().int().positive(), observedAt: z30.number() })
17391
17502
  ]);
17392
- var QuotaExpiringEventSchema = z29.strictObject({
17393
- identity: z29.string().min(1),
17394
- provider: z29.string().min(1),
17395
- window: z29.enum(["fiveHour", "sevenDay"]),
17503
+ var QuotaExpiringEventSchema = z30.strictObject({
17504
+ identity: z30.string().min(1),
17505
+ provider: z30.string().min(1),
17506
+ window: z30.enum(["fiveHour", "sevenDay"]),
17396
17507
  /** 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. */
17397
- utilization: z29.number().min(0).max(1),
17398
- resetsAt: z29.iso.datetime(),
17399
- observedAt: z29.number()
17508
+ utilization: z30.number().min(0).max(1),
17509
+ resetsAt: z30.iso.datetime(),
17510
+ observedAt: z30.number()
17400
17511
  });
17401
17512
 
17402
17513
  // src/frontdoor/eventsApi.ts
@@ -17480,60 +17591,60 @@ import { openapi as openapi6 } from "@orpc/openapi";
17480
17591
 
17481
17592
  // src/frontdoor/launchSchemas.ts
17482
17593
  import path33 from "node:path";
17483
- import { z as z30 } from "zod";
17594
+ import { z as z31 } from "zod";
17484
17595
  init_statusline();
17485
17596
  init_claudeVersion();
17486
17597
  init_identity();
17487
- var LaunchResolveInputSchema = z30.strictObject({
17488
- path: z30.string().min(1),
17598
+ var LaunchResolveInputSchema = z31.strictObject({
17599
+ path: z31.string().min(1),
17489
17600
  /** `@name`, launch flags, then the arguments for `claude`; empty for a bare launch. */
17490
- argv: z30.readonly(z30.array(z30.string())).optional(),
17601
+ argv: z31.readonly(z31.array(z31.string())).optional(),
17491
17602
  /** 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. */
17492
- env: z30.record(z30.string(), z30.string()).optional()
17603
+ env: z31.record(z31.string(), z31.string()).optional()
17493
17604
  }).refine((input) => path33.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
17494
- var LaunchPoolDecisionSchema = z30.strictObject({
17495
- name: z30.string(),
17496
- reasons: z30.readonly(z30.array(z30.string())),
17497
- movedOff: z30.strictObject({ identity: z30.string(), reason: z30.string() }).optional()
17605
+ var LaunchPoolDecisionSchema = z31.strictObject({
17606
+ name: z31.string(),
17607
+ reasons: z31.readonly(z31.array(z31.string())),
17608
+ movedOff: z31.strictObject({ identity: z31.string(), reason: z31.string() }).optional()
17498
17609
  });
17499
- var LaunchDecisionSchema = z30.strictObject({
17500
- identity: z30.string().optional(),
17501
- identitySource: z30.enum(IDENTITY_DECISION_SOURCES),
17610
+ var LaunchDecisionSchema = z31.strictObject({
17611
+ identity: z31.string().optional(),
17612
+ identitySource: z31.enum(IDENTITY_DECISION_SOURCES),
17502
17613
  pool: LaunchPoolDecisionSchema.optional(),
17503
- configDirEscapeHatch: z30.boolean(),
17504
- configDir: z30.string().optional(),
17505
- configProfile: z30.string().optional(),
17506
- configProfileSource: z30.enum(CONFIG_PROFILE_DECISION_SOURCES),
17507
- provider: z30.string().optional()
17614
+ configDirEscapeHatch: z31.boolean(),
17615
+ configDir: z31.string().optional(),
17616
+ configProfile: z31.string().optional(),
17617
+ configProfileSource: z31.enum(CONFIG_PROFILE_DECISION_SOURCES),
17618
+ provider: z31.string().optional()
17508
17619
  });
17509
- var LaunchFlagsSchema = z30.strictObject({
17510
- skipPermissions: z30.boolean(),
17511
- remoteControl: z30.boolean(),
17512
- headroom: z30.boolean(),
17513
- trackUsage: z30.boolean(),
17514
- pause: z30.boolean(),
17515
- explain: z30.boolean(),
17620
+ var LaunchFlagsSchema = z31.strictObject({
17621
+ skipPermissions: z31.boolean(),
17622
+ remoteControl: z31.boolean(),
17623
+ headroom: z31.boolean(),
17624
+ trackUsage: z31.boolean(),
17625
+ pause: z31.boolean(),
17626
+ explain: z31.boolean(),
17516
17627
  /** How long the launch waits after its own output before it starts claude, in milliseconds. */
17517
- delayMs: z30.number(),
17628
+ delayMs: z31.number(),
17518
17629
  /** The hosts the launch keeps off the front door by adding them to the child's `NO_PROXY`. */
17519
- proxyBypass: z30.array(z30.string()).readonly(),
17630
+ proxyBypass: z31.array(z31.string()).readonly(),
17520
17631
  /** How the session's built-in statusline looks, when the launch configures any of it. */
17521
17632
  statusline: StatuslineSchema.optional()
17522
17633
  });
17523
- var LaunchResolveOutputSchema = z30.strictObject({
17634
+ var LaunchResolveOutputSchema = z31.strictObject({
17524
17635
  decision: LaunchDecisionSchema,
17525
17636
  flags: LaunchFlagsSchema,
17526
- claudeVersion: z30.strictObject({ version: z30.string(), source: z30.enum(CLAUDE_VERSION_SOURCES) }).optional(),
17637
+ claudeVersion: z31.strictObject({ version: z31.string(), source: z31.enum(CLAUDE_VERSION_SOURCES) }).optional(),
17527
17638
  /** The real `claude` binary the launch would spawn, on the door's host. */
17528
- bin: z30.string(),
17639
+ bin: z31.string(),
17529
17640
  /** The arguments the launch would pass it: the tool's own flags, then `CLAUDE_EXTRA_FLAGS`, then the caller's own. */
17530
- args: z30.readonly(z30.array(z30.string())),
17641
+ args: z31.readonly(z31.array(z31.string())),
17531
17642
  /** The credential the launch would authenticate with, by target and source kinds. Absent when none applies. */
17532
- credential: z30.strictObject({ subject: z30.enum(["provider", "identity"]), name: z30.string(), summary: CredentialSummarySchema }).optional(),
17533
- routing: z30.strictObject({ frontDoor: z30.boolean(), headroom: z30.boolean() }),
17643
+ credential: z31.strictObject({ subject: z31.enum(["provider", "identity"]), name: z31.string(), summary: CredentialSummarySchema }).optional(),
17644
+ routing: z31.strictObject({ frontDoor: z31.boolean(), headroom: z31.boolean() }),
17534
17645
  /** The names of the environment variables the launch would set or unset, sorted. Values are not reported. */
17535
- environment: z30.readonly(z30.array(z30.string())),
17536
- warnings: z30.readonly(z30.array(z30.string()))
17646
+ environment: z31.readonly(z31.array(z31.string())),
17647
+ warnings: z31.readonly(z31.array(z31.string()))
17537
17648
  });
17538
17649
 
17539
17650
  // src/frontdoor/launchApi.ts
@@ -17569,22 +17680,22 @@ function createLaunchApiRouter(deps) {
17569
17680
  // src/frontdoor/agentTreesApi.ts
17570
17681
  import { ORPCError as ORPCError6 } from "@orpc/client";
17571
17682
  import { openapi as openapi7 } from "@orpc/openapi";
17572
- import { z as z31 } from "zod";
17683
+ import { z as z32 } from "zod";
17573
17684
  init_cliError();
17574
- var AgentTreesListInputSchema = z31.strictObject({
17685
+ var AgentTreesListInputSchema = z32.strictObject({
17575
17686
  /** Only this identity's sessions. */
17576
- identity: z31.string().optional(),
17687
+ identity: z32.string().optional(),
17577
17688
  /** Include sessions that spawned no agent and ran no workflow. */
17578
- all: z31.boolean().optional()
17689
+ all: z32.boolean().optional()
17579
17690
  });
17580
- var AgentTreesListOutputSchema = z31.array(SessionSummarySchema);
17581
- var AgentTreesShowInputSchema = z31.strictObject({
17691
+ var AgentTreesListOutputSchema = z32.array(SessionSummarySchema);
17692
+ var AgentTreesShowInputSchema = z32.strictObject({
17582
17693
  /** A session id, or an unambiguous prefix of one. */
17583
- session: z31.string().min(1),
17694
+ session: z32.string().min(1),
17584
17695
  /** Look only in this identity. */
17585
- identity: z31.string().optional()
17696
+ identity: z32.string().optional()
17586
17697
  });
17587
- var AgentTreesShowOutputSchema = z31.strictObject({ identities: z31.array(z31.string()), ...MergedAgentTreeSchema.shape });
17698
+ var AgentTreesShowOutputSchema = z32.strictObject({ identities: z32.array(z32.string()), ...MergedAgentTreeSchema.shape });
17588
17699
  function asBadRequest(error) {
17589
17700
  if (error instanceof CliError) {
17590
17701
  throw new ORPCError6("BAD_REQUEST", { message: error.message });
@@ -19777,7 +19888,7 @@ init_poolPick();
19777
19888
 
19778
19889
  // src/agents/read.ts
19779
19890
  import path35 from "node:path";
19780
- import { z as z32 } from "zod";
19891
+ import { z as z33 } from "zod";
19781
19892
  var PROJECTS_DIR = "projects";
19782
19893
  var TASKS_DIR = "tasks";
19783
19894
  var SUBAGENTS_DIR = "subagents";
@@ -19896,14 +20007,14 @@ function parseJson2(text) {
19896
20007
  return void 0;
19897
20008
  }
19898
20009
  }
19899
- var TaskFileSchema = z32.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: z32.array(z32.string()).default([]), blockedBy: z32.array(z32.string()).default([]) });
19900
- var WorkflowRunFileSchema = z32.object({
19901
- runId: z32.string(),
19902
- workflowName: z32.string().optional(),
19903
- status: z32.string().optional(),
19904
- startTime: z32.number().optional(),
19905
- phases: z32.array(z32.object({ title: z32.string() })).default([]),
19906
- summary: z32.string().optional()
20010
+ var TaskFileSchema = z33.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: z33.array(z33.string()).default([]), blockedBy: z33.array(z33.string()).default([]) });
20011
+ var WorkflowRunFileSchema = z33.object({
20012
+ runId: z33.string(),
20013
+ workflowName: z33.string().optional(),
20014
+ status: z33.string().optional(),
20015
+ startTime: z33.number().optional(),
20016
+ phases: z33.array(z33.object({ title: z33.string() })).default([]),
20017
+ summary: z33.string().optional()
19907
20018
  });
19908
20019
  function summariseSession(fs14, configDir, ref) {
19909
20020
  const sessionRelative = path35.join(PROJECTS_DIR, ref.project, ref.entry);