claude-use 11.49.2 → 11.50.1

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.cjs CHANGED
@@ -138,6 +138,68 @@ var init_proxyBypass = __esm({
138
138
  }
139
139
  });
140
140
 
141
+ // src/config/statusline.ts
142
+ function distinctList(member) {
143
+ return import_zod.z.array(member).refine((items) => new Set(items).size === items.length, "must not repeat a segment");
144
+ }
145
+ function resolveStatusline(settings) {
146
+ const resolved = {
147
+ header: settings?.header ?? STATUSLINE_DEFAULTS.header,
148
+ bars: settings?.bars ?? STATUSLINE_DEFAULTS.bars,
149
+ warnAt: settings?.warnAt ?? STATUSLINE_DEFAULTS.warnAt,
150
+ criticalAt: settings?.criticalAt ?? STATUSLINE_DEFAULTS.criticalAt,
151
+ fiveHourLabel: settings?.fiveHourLabel ?? STATUSLINE_DEFAULTS.fiveHourLabel,
152
+ sevenDayLabel: settings?.sevenDayLabel ?? STATUSLINE_DEFAULTS.sevenDayLabel,
153
+ barWidth: settings?.barWidth ?? STATUSLINE_DEFAULTS.barWidth
154
+ };
155
+ if (resolved.warnAt >= resolved.criticalAt) {
156
+ throw new RangeError(`statusline warnAt (${String(resolved.warnAt)}) must be below criticalAt (${String(resolved.criticalAt)})`);
157
+ }
158
+ return resolved;
159
+ }
160
+ var import_zod, STATUSLINE_HEADER_SEGMENTS, STATUSLINE_BAR_GROUPS, MAX_PERCENT, MAX_STATUSLINE_LABEL_CHARS, MAX_BAR_CELLS, LABEL_RE2, wholePercent, StatuslineSchema, StatuslineChangeSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
161
+ var init_statusline = __esm({
162
+ "src/config/statusline.ts"() {
163
+ "use strict";
164
+ import_zod = require("zod");
165
+ STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom"];
166
+ STATUSLINE_BAR_GROUPS = ["context", "quota"];
167
+ MAX_PERCENT = 100;
168
+ MAX_STATUSLINE_LABEL_CHARS = 12;
169
+ MAX_BAR_CELLS = 40;
170
+ LABEL_RE2 = /^[^\p{C}\p{Z}]+(?: [^\p{C}\p{Z}]+)*$/u;
171
+ wholePercent = import_zod.z.number().int().min(1).max(MAX_PERCENT);
172
+ StatuslineSchema = import_zod.z.strictObject({
173
+ header: distinctList(import_zod.z.enum(STATUSLINE_HEADER_SEGMENTS)).optional(),
174
+ bars: distinctList(import_zod.z.enum(STATUSLINE_BAR_GROUPS)).optional(),
175
+ warnAt: wholePercent.optional(),
176
+ criticalAt: wholePercent.optional(),
177
+ fiveHourLabel: import_zod.z.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters").optional(),
178
+ sevenDayLabel: import_zod.z.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters").optional(),
179
+ barWidth: import_zod.z.number().int().min(1).max(MAX_BAR_CELLS).optional()
180
+ });
181
+ StatuslineChangeSchema = import_zod.z.strictObject({
182
+ header: import_zod.z.union([StatuslineSchema.shape.header.unwrap(), import_zod.z.literal(false)]).optional(),
183
+ bars: import_zod.z.union([StatuslineSchema.shape.bars.unwrap(), import_zod.z.literal(false)]).optional(),
184
+ warnAt: import_zod.z.union([StatuslineSchema.shape.warnAt.unwrap(), import_zod.z.literal(false)]).optional(),
185
+ criticalAt: import_zod.z.union([StatuslineSchema.shape.criticalAt.unwrap(), import_zod.z.literal(false)]).optional(),
186
+ fiveHourLabel: import_zod.z.union([StatuslineSchema.shape.fiveHourLabel.unwrap(), import_zod.z.literal(false)]).optional(),
187
+ sevenDayLabel: import_zod.z.union([StatuslineSchema.shape.sevenDayLabel.unwrap(), import_zod.z.literal(false)]).optional(),
188
+ barWidth: import_zod.z.union([StatuslineSchema.shape.barWidth.unwrap(), import_zod.z.literal(false)]).optional()
189
+ });
190
+ STATUSLINE_DEFAULTS = {
191
+ header: STATUSLINE_HEADER_SEGMENTS,
192
+ bars: STATUSLINE_BAR_GROUPS,
193
+ warnAt: 70,
194
+ criticalAt: 90,
195
+ fiveHourLabel: "5h",
196
+ sevenDayLabel: "Wk",
197
+ barWidth: 10
198
+ };
199
+ STATUSLINE_ENV = "AGENT_SHIM_STATUSLINE";
200
+ }
201
+ });
202
+
141
203
  // src/cliError.ts
142
204
  var EXIT_FAILURE, EXIT_USAGE, CliError, UsageError;
143
205
  var init_cliError = __esm({
@@ -290,63 +352,66 @@ function isTimeZone(name) {
290
352
  return false;
291
353
  }
292
354
  }
293
- var import_node_path2, import_zod, import_trilean, CATEGORY_NAMES, OVERRIDABLE_CATEGORIES, CategoryMapSchema, DURATION_RE, DurationSchema, WhenConditionObjectSchema, WhenSchema, EntryValueSchema, ENTRY_KEY_RE, EntriesSchema, LaunchSchema, CREDENTIAL_TARGETS, PROVIDER_CREDENTIAL_TARGETS, CREDENTIAL_TARGET_VARS, ArgvSchema, CommandSourceOptions, EnvCredentialSourceSchema, FileCredentialSourceSchema, CommandCredentialSourceSchema, OpCredentialSourceSchema, KeychainCredentialSourceSchema, LiteralCredentialSourceSchema, CredentialSourceSchema, RemoteCredentialSourceSchema, CREDENTIAL_CACHE_STORES, CredentialCacheSchema, CredentialSchema, ProviderCredentialSchema, RESERVED_PROVIDER_ENV_KEYS, ProviderEnvSchema, PROVIDER_KINDS, ANTIGRAVITY_MODES, CLAUDE_TIERS, ANTIGRAVITY_EFFORTS, ANTIGRAVITY_DEFAULT_MODE, ANTIGRAVITY_DEFAULT_MODEL, ANTIGRAVITY_DEFAULT_TIER_MODELS, ANTIGRAVITY_DEFAULT_EFFORT, AntigravityModelTargetSchema, AntigravityProviderConfigSchema, CODEX_EFFORTS, CODEX_LOGINS, CODEX_DEFAULT_LOGIN, CODEX_DEFAULT_MODEL, CODEX_DEFAULT_TIER_MODELS, CODEX_DEFAULT_EFFORT, CodexProviderConfigSchema, ProviderRouteSchema, PickerModelSchema, PickerModelsSchema, ProviderCatalogueSchema, HttpProviderSchema, CodexProviderSchema, RouterProviderSchema, AntigravityProviderSchema, ProviderSchema, SELECTION_MODES, VirtualModelSchema, ModelPricesSchema, FamilySettingsSchema, ModelsConfigSchema, ModelsLayerSchema, ConfigProfileSchema, POOL_SELECTOR_PREFIX, POOL_NAME_PATTERN, IDENTITY_NAME_PATTERN, PoolNameSchema, SELECTOR_RE, IdentitySelectorSchema, PoolMemberSchema, POOL_PREFERENCES, PoolPreferenceSchema, WHOLE_PERCENT_MAX, CompactAtUtilisationSchema, PoolSchema, WEEKDAYS, AnchorSchema, JOB_WINDOWS, JobTriggerSchema, JobTargetSchema, JobSchema, DirectoryRuleSchema, DirectoryRulesSchema, PortableConfigSchema, HEADROOM_MODES, HEADROOM_CCR_MODES, HEADROOM_ROLLOUT_CHANNELS, INTERCEPT_CHANNELS, READ_MATURATION_CHANNELS, HeadroomGlobalConfigObjectSchema, HeadroomGlobalConfigSchema, HEADROOM_DEFAULT_SOURCE, HEADROOM_DEFAULT_IDLE_SHUTDOWN_MINUTES, FrontDoorGlobalConfigSchema, UPDATE_MODES, UpdateGlobalConfigSchema, GlobalConfigSchema, IdentitySchema, CategoryClassificationSchema, CategoryClassificationOverlaySchema, SHIPPED_CATEGORY_DEFAULTS;
355
+ var import_node_path2, import_zod2, import_trilean, CATEGORY_NAMES, OVERRIDABLE_CATEGORIES, CategoryMapSchema, DURATION_RE, DurationSchema, WhenConditionObjectSchema, WhenSchema, EntryValueSchema, ENTRY_KEY_RE, EntriesSchema, LaunchSchema, CREDENTIAL_TARGETS, PROVIDER_CREDENTIAL_TARGETS, CREDENTIAL_TARGET_VARS, ArgvSchema, CommandSourceOptions, EnvCredentialSourceSchema, FileCredentialSourceSchema, CommandCredentialSourceSchema, OpCredentialSourceSchema, KeychainCredentialSourceSchema, LiteralCredentialSourceSchema, CredentialSourceSchema, RemoteCredentialSourceSchema, CREDENTIAL_CACHE_STORES, CredentialCacheSchema, CredentialSchema, ProviderCredentialSchema, RESERVED_PROVIDER_ENV_KEYS, ProviderEnvSchema, PROVIDER_KINDS, ANTIGRAVITY_MODES, CLAUDE_TIERS, ANTIGRAVITY_EFFORTS, ANTIGRAVITY_DEFAULT_MODE, ANTIGRAVITY_DEFAULT_MODEL, ANTIGRAVITY_DEFAULT_TIER_MODELS, ANTIGRAVITY_DEFAULT_EFFORT, AntigravityModelTargetSchema, AntigravityProviderConfigSchema, CODEX_EFFORTS, CODEX_LOGINS, CODEX_DEFAULT_LOGIN, CODEX_DEFAULT_MODEL, CODEX_DEFAULT_TIER_MODELS, CODEX_DEFAULT_EFFORT, CodexProviderConfigSchema, ProviderRouteSchema, PickerModelSchema, PickerModelsSchema, ProviderCatalogueSchema, HttpProviderSchema, CodexProviderSchema, RouterProviderSchema, AntigravityProviderSchema, ProviderSchema, SELECTION_MODES, VirtualModelSchema, ModelPricesSchema, FamilySettingsSchema, ModelsConfigSchema, ModelsLayerSchema, ConfigProfileSchema, POOL_SELECTOR_PREFIX, POOL_NAME_PATTERN, IDENTITY_NAME_PATTERN, PoolNameSchema, SELECTOR_RE, IdentitySelectorSchema, PoolMemberSchema, POOL_PREFERENCES, PoolPreferenceSchema, WHOLE_PERCENT_MAX, CompactAtUtilisationSchema, PoolSchema, WEEKDAYS, AnchorSchema, JOB_WINDOWS, JobTriggerSchema, JobTargetSchema, JobSchema, DirectoryRuleSchema, DirectoryRulesSchema, PortableConfigSchema, HEADROOM_MODES, HEADROOM_CCR_MODES, HEADROOM_ROLLOUT_CHANNELS, INTERCEPT_CHANNELS, READ_MATURATION_CHANNELS, HeadroomGlobalConfigObjectSchema, HeadroomGlobalConfigSchema, HEADROOM_DEFAULT_SOURCE, HEADROOM_DEFAULT_IDLE_SHUTDOWN_MINUTES, FrontDoorGlobalConfigSchema, UPDATE_MODES, UpdateGlobalConfigSchema, GlobalConfigSchema, IdentitySchema, CategoryClassificationSchema, CategoryClassificationOverlaySchema, SHIPPED_CATEGORY_DEFAULTS;
294
356
  var init_schema = __esm({
295
357
  "src/config/schema.ts"() {
296
358
  "use strict";
297
359
  init_proxyBypass();
360
+ init_statusline();
298
361
  import_node_path2 = __toESM(require("node:path"), 1);
299
- import_zod = require("zod");
362
+ import_zod2 = require("zod");
300
363
  import_trilean = require("trilean");
301
364
  init_versionDiscovery();
302
365
  CATEGORY_NAMES = ["secret", "runtime", "history", "knowledge", "settings"];
303
366
  OVERRIDABLE_CATEGORIES = ["runtime", "history", "knowledge", "settings"];
304
- CategoryMapSchema = import_zod.z.strictObject({
305
- all: import_zod.z.boolean().optional(),
306
- runtime: import_zod.z.boolean().optional(),
307
- history: import_zod.z.boolean().optional(),
308
- knowledge: import_zod.z.boolean().optional(),
309
- settings: import_zod.z.boolean().optional()
367
+ CategoryMapSchema = import_zod2.z.strictObject({
368
+ all: import_zod2.z.boolean().optional(),
369
+ runtime: import_zod2.z.boolean().optional(),
370
+ history: import_zod2.z.boolean().optional(),
371
+ knowledge: import_zod2.z.boolean().optional(),
372
+ settings: import_zod2.z.boolean().optional()
310
373
  }).transform((input) => expandAllCategoryKey(input));
311
374
  DURATION_RE = /^(?:0|[1-9][0-9]*)(?:ms|s|m|h|d|w)$/;
312
- DurationSchema = import_zod.z.string().regex(DURATION_RE);
313
- WhenConditionObjectSchema = import_zod.z.strictObject({
375
+ DurationSchema = import_zod2.z.string().regex(DURATION_RE);
376
+ WhenConditionObjectSchema = import_zod2.z.strictObject({
314
377
  newerThan: DurationSchema.optional(),
315
378
  olderThan: DurationSchema.optional(),
316
- maxSizeBytes: import_zod.z.int().positive().optional(),
317
- branch: import_zod.z.string().min(1).optional(),
318
- env: import_zod.z.record(import_zod.z.string().min(1), import_zod.z.string()).optional()
379
+ maxSizeBytes: import_zod2.z.int().positive().optional(),
380
+ branch: import_zod2.z.string().min(1).optional(),
381
+ env: import_zod2.z.record(import_zod2.z.string().min(1), import_zod2.z.string()).optional()
319
382
  });
320
- WhenSchema = import_zod.z.union([WhenConditionObjectSchema, import_trilean.PredicateNodeSchema]);
321
- EntryValueSchema = import_zod.z.union([
322
- import_zod.z.boolean(),
323
- import_zod.z.strictObject({ value: import_zod.z.boolean(), when: WhenSchema })
383
+ WhenSchema = import_zod2.z.union([WhenConditionObjectSchema, import_trilean.PredicateNodeSchema]);
384
+ EntryValueSchema = import_zod2.z.union([
385
+ import_zod2.z.boolean(),
386
+ import_zod2.z.strictObject({ value: import_zod2.z.boolean(), when: WhenSchema })
324
387
  ]);
325
388
  ENTRY_KEY_RE = /^(?:secret|runtime|history|knowledge|settings)\/(?!\/)\S(?:.*\S)?$/;
326
- EntriesSchema = import_zod.z.record(import_zod.z.string().regex(ENTRY_KEY_RE), EntryValueSchema);
327
- LaunchSchema = import_zod.z.strictObject({
328
- skipPermissions: import_zod.z.boolean().optional(),
329
- remoteControl: import_zod.z.boolean().optional(),
330
- provider: import_zod.z.string().min(1).optional(),
331
- headroom: import_zod.z.boolean().optional(),
332
- trackUsage: import_zod.z.boolean().optional(),
389
+ EntriesSchema = import_zod2.z.record(import_zod2.z.string().regex(ENTRY_KEY_RE), EntryValueSchema);
390
+ LaunchSchema = import_zod2.z.strictObject({
391
+ skipPermissions: import_zod2.z.boolean().optional(),
392
+ remoteControl: import_zod2.z.boolean().optional(),
393
+ provider: import_zod2.z.string().min(1).optional(),
394
+ headroom: import_zod2.z.boolean().optional(),
395
+ trackUsage: import_zod2.z.boolean().optional(),
333
396
  /** The exact Claude Code version to run, as it is named in Claude Code's versions directory (`2.1.220`). A pin that is not installed fails the launch; it never falls back to the highest version. */
334
- claudeVersion: import_zod.z.string().regex(NUMERIC_DOTTED_VERSION_RE, "must be an exact dotted-numeric Claude Code version such as 2.1.220").optional(),
397
+ claudeVersion: import_zod2.z.string().regex(NUMERIC_DOTTED_VERSION_RE, "must be an exact dotted-numeric Claude Code version such as 2.1.220").optional(),
335
398
  /** How long the launcher waits after its own output before it starts claude, so that output can be read before Claude Code takes over the terminal (`5s`, `500ms`). Applies only when a terminal is watching. */
336
- delay: import_zod.z.string().regex(DURATION_RE, "must be a duration such as 5s or 500ms").optional(),
399
+ delay: import_zod2.z.string().regex(DURATION_RE, "must be a duration such as 5s or 500ms").optional(),
337
400
  /** 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. */
338
- pause: import_zod.z.boolean().optional(),
401
+ pause: import_zod2.z.boolean().optional(),
339
402
  /** 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. */
340
- explain: import_zod.z.boolean().optional(),
403
+ explain: import_zod2.z.boolean().optional(),
341
404
  /** Hosts a launch keeps off the front door by adding them to the child's `NO_PROXY`, so their traffic (an HTTP MCP server, say) goes direct and survives a door restart. Each entry is a host name (a leading `.` or `*.` covers its subdomains), an IPv4 address or a bracketed IPv6 address, with an optional `:port`; a malformed entry fails the load. A deeper layer's list replaces a shallower one's, and an empty list clears it. */
342
- proxyBypass: import_zod.z.array(
343
- import_zod.z.string().superRefine((entry, context) => {
405
+ proxyBypass: import_zod2.z.array(
406
+ import_zod2.z.string().superRefine((entry, context) => {
344
407
  const problem = proxyBypassSyntaxProblem(entry);
345
408
  if (problem !== void 0) {
346
409
  context.addIssue({ code: "custom", message: `"${entry}" ${problem}` });
347
410
  }
348
411
  })
349
- ).optional()
412
+ ).optional(),
413
+ /** How the launched session's built-in statusline looks, exported to it as `AGENT_SHIM_STATUSLINE`. Merged key by key across layers, unlike the flags above, which are single values. */
414
+ statusline: StatuslineSchema.optional()
350
415
  });
351
416
  CREDENTIAL_TARGETS = ["bearer", "apiKey", "oauthToken"];
352
417
  PROVIDER_CREDENTIAL_TARGETS = ["bearer", "apiKey"];
@@ -355,27 +420,27 @@ var init_schema = __esm({
355
420
  apiKey: "ANTHROPIC_API_KEY",
356
421
  oauthToken: "CLAUDE_CODE_OAUTH_TOKEN"
357
422
  };
358
- ArgvSchema = import_zod.z.tuple([import_zod.z.string().min(1)], import_zod.z.string());
423
+ ArgvSchema = import_zod2.z.tuple([import_zod2.z.string().min(1)], import_zod2.z.string());
359
424
  CommandSourceOptions = {
360
425
  /** True when running the command needs a person present (a desktop-unlocked secret store's approval prompt), so it is skipped when there is neither a terminal nor a desktop session. Defaults per source kind; see `isInteractiveSource`. */
361
- interactive: import_zod.z.boolean().optional(),
426
+ interactive: import_zod2.z.boolean().optional(),
362
427
  /** How long the command may run before it is killed and counted as failed. Defaults to `CREDENTIAL_COMMAND_TIMEOUT_MS`, or `CREDENTIAL_INTERACTIVE_TIMEOUT_MS` for an interactive source. */
363
- timeoutMs: import_zod.z.int().positive().optional()
428
+ timeoutMs: import_zod2.z.int().positive().optional()
364
429
  };
365
- EnvCredentialSourceSchema = import_zod.z.strictObject({ env: import_zod.z.string().min(1) });
366
- FileCredentialSourceSchema = import_zod.z.strictObject({
367
- file: import_zod.z.string().min(1).refine((filePath) => filePath.startsWith("~/") || import_node_path2.default.isAbsolute(filePath), {
430
+ EnvCredentialSourceSchema = import_zod2.z.strictObject({ env: import_zod2.z.string().min(1) });
431
+ FileCredentialSourceSchema = import_zod2.z.strictObject({
432
+ file: import_zod2.z.string().min(1).refine((filePath) => filePath.startsWith("~/") || import_node_path2.default.isAbsolute(filePath), {
368
433
  message: "a credential file must be an absolute or ~-rooted path, since a launch can start in any directory"
369
434
  })
370
435
  });
371
- CommandCredentialSourceSchema = import_zod.z.strictObject({ command: ArgvSchema, ...CommandSourceOptions });
372
- OpCredentialSourceSchema = import_zod.z.strictObject({ op: import_zod.z.string().startsWith("op://"), ...CommandSourceOptions });
373
- KeychainCredentialSourceSchema = import_zod.z.strictObject({
374
- keychain: import_zod.z.strictObject({ service: import_zod.z.string().min(1), account: import_zod.z.string().min(1).optional() }),
436
+ CommandCredentialSourceSchema = import_zod2.z.strictObject({ command: ArgvSchema, ...CommandSourceOptions });
437
+ OpCredentialSourceSchema = import_zod2.z.strictObject({ op: import_zod2.z.string().startsWith("op://"), ...CommandSourceOptions });
438
+ KeychainCredentialSourceSchema = import_zod2.z.strictObject({
439
+ keychain: import_zod2.z.strictObject({ service: import_zod2.z.string().min(1), account: import_zod2.z.string().min(1).optional() }),
375
440
  ...CommandSourceOptions
376
441
  });
377
- LiteralCredentialSourceSchema = import_zod.z.strictObject({ literal: import_zod.z.string().min(1) });
378
- CredentialSourceSchema = import_zod.z.union([
442
+ LiteralCredentialSourceSchema = import_zod2.z.strictObject({ literal: import_zod2.z.string().min(1) });
443
+ CredentialSourceSchema = import_zod2.z.union([
379
444
  EnvCredentialSourceSchema,
380
445
  FileCredentialSourceSchema,
381
446
  CommandCredentialSourceSchema,
@@ -383,7 +448,7 @@ var init_schema = __esm({
383
448
  KeychainCredentialSourceSchema,
384
449
  LiteralCredentialSourceSchema
385
450
  ]);
386
- RemoteCredentialSourceSchema = import_zod.z.union([
451
+ RemoteCredentialSourceSchema = import_zod2.z.union([
387
452
  EnvCredentialSourceSchema,
388
453
  FileCredentialSourceSchema,
389
454
  OpCredentialSourceSchema,
@@ -391,18 +456,18 @@ var init_schema = __esm({
391
456
  LiteralCredentialSourceSchema
392
457
  ]);
393
458
  CREDENTIAL_CACHE_STORES = ["keychain", "file"];
394
- CredentialCacheSchema = import_zod.z.strictObject({
395
- ttl: import_zod.z.string().regex(/^[1-9]\d*[smhd]$/, { message: "ttl is a whole number followed by s, m, h or d, for example 12h" }).optional(),
396
- store: import_zod.z.enum(CREDENTIAL_CACHE_STORES).optional()
459
+ CredentialCacheSchema = import_zod2.z.strictObject({
460
+ ttl: import_zod2.z.string().regex(/^[1-9]\d*[smhd]$/, { message: "ttl is a whole number followed by s, m, h or d, for example 12h" }).optional(),
461
+ store: import_zod2.z.enum(CREDENTIAL_CACHE_STORES).optional()
397
462
  });
398
- CredentialSchema = import_zod.z.strictObject({
399
- sources: import_zod.z.array(CredentialSourceSchema).min(1),
400
- target: import_zod.z.enum(CREDENTIAL_TARGETS).optional(),
463
+ CredentialSchema = import_zod2.z.strictObject({
464
+ sources: import_zod2.z.array(CredentialSourceSchema).min(1),
465
+ target: import_zod2.z.enum(CREDENTIAL_TARGETS).optional(),
401
466
  cache: CredentialCacheSchema.optional()
402
467
  });
403
- ProviderCredentialSchema = CredentialSchema.extend({ target: import_zod.z.enum(PROVIDER_CREDENTIAL_TARGETS).optional() });
468
+ ProviderCredentialSchema = CredentialSchema.extend({ target: import_zod2.z.enum(PROVIDER_CREDENTIAL_TARGETS).optional() });
404
469
  RESERVED_PROVIDER_ENV_KEYS = Object.values(CREDENTIAL_TARGET_VARS);
405
- ProviderEnvSchema = import_zod.z.record(import_zod.z.string().min(1), import_zod.z.string()).refine((env) => !Object.keys(env).some((key) => RESERVED_PROVIDER_ENV_KEYS.includes(key)), {
470
+ ProviderEnvSchema = import_zod2.z.record(import_zod2.z.string().min(1), import_zod2.z.string()).refine((env) => !Object.keys(env).some((key) => RESERVED_PROVIDER_ENV_KEYS.includes(key)), {
406
471
  message: `env may not set ${RESERVED_PROVIDER_ENV_KEYS.join(", ")}: the credential block's target sets one and agent-shim removes the others`
407
472
  });
408
473
  PROVIDER_KINDS = ["http", "codex", "antigravity", "router"];
@@ -418,33 +483,33 @@ var init_schema = __esm({
418
483
  haiku: ["gemini-3.8-flash-low", "gemini-4-argon-low", "claude-sonnet-5-5-low"]
419
484
  });
420
485
  ANTIGRAVITY_DEFAULT_EFFORT = "low";
421
- AntigravityModelTargetSchema = import_zod.z.union([import_zod.z.string().min(1), import_zod.z.array(import_zod.z.string().min(1)).min(1)]);
422
- AntigravityProviderConfigSchema = import_zod.z.strictObject({
486
+ AntigravityModelTargetSchema = import_zod2.z.union([import_zod2.z.string().min(1), import_zod2.z.array(import_zod2.z.string().min(1)).min(1)]);
487
+ AntigravityProviderConfigSchema = import_zod2.z.strictObject({
423
488
  /** Operational mode: direct cloud endpoint or local ACP daemon. Defaults to `cloud`. */
424
- mode: import_zod.z.enum(ANTIGRAVITY_MODES).optional(),
489
+ mode: import_zod2.z.enum(ANTIGRAVITY_MODES).optional(),
425
490
  /** The model a request maps to when no tier matches its model name. */
426
- defaultModel: import_zod.z.string().min(1).optional(),
491
+ defaultModel: import_zod2.z.string().min(1).optional(),
427
492
  /** Model name mapping. A key naming a tier (`fable`, `opus`, `sonnet`, `haiku`) overrides that tier's shipped model and is matched by substring of the requested name in `CLAUDE_TIERS` order; any other key is an alias, matched against the whole requested name case-insensitively, so `/model <alias>` selects its backend model. An alias outranks every other rule, including the pass-through of backend names. A value is one model or an ordered list of candidates: the request goes to the first whose quota windows are not spent, and when every candidate is spent, to the one whose binding window lifts soonest. */
428
- models: import_zod.z.record(import_zod.z.string().min(1), AntigravityModelTargetSchema).optional(),
493
+ models: import_zod2.z.record(import_zod2.z.string().min(1), AntigravityModelTargetSchema).optional(),
429
494
  /** When every candidate of the tier a request names has no quota left, serve it from the next tier down, and onward through the lower tiers, instead of failing with the quota limit. Applies to a name that selects a tier (`/model fable`), not to an alias or a backend model name. Defaults to false. */
430
- degradeDownTiers: import_zod.z.boolean().optional(),
495
+ degradeDownTiers: import_zod2.z.boolean().optional(),
431
496
  /** The reasoning effort used when the request's own effort is not one the backend accepts. */
432
- effort: import_zod.z.enum(ANTIGRAVITY_EFFORTS).optional(),
497
+ effort: import_zod2.z.enum(ANTIGRAVITY_EFFORTS).optional(),
433
498
  /** Cloud-specific settings (for `mode: "cloud"`). */
434
- cloud: import_zod.z.strictObject({
499
+ cloud: import_zod2.z.strictObject({
435
500
  /** Google Gemini API or custom gateway endpoint. Defaults to `https://generativelanguage.googleapis.com`. */
436
- endpoint: import_zod.z.url().optional(),
501
+ endpoint: import_zod2.z.url().optional(),
437
502
  /** Google Cloud Project ID (when using Vertex AI). */
438
- projectId: import_zod.z.string().min(1).optional(),
503
+ projectId: import_zod2.z.string().min(1).optional(),
439
504
  /** Google Cloud location/region (when using Vertex AI). */
440
- location: import_zod.z.string().min(1).optional()
505
+ location: import_zod2.z.string().min(1).optional()
441
506
  }).optional(),
442
507
  /** Local-specific settings (for `mode: "local"`). */
443
- local: import_zod.z.strictObject({
508
+ local: import_zod2.z.strictObject({
444
509
  /** Command and arguments to spawn the ACP server process. */
445
- command: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional(),
510
+ command: import_zod2.z.array(import_zod2.z.string().min(1)).min(1).optional(),
446
511
  /** Path to an existing Unix domain socket to connect to instead of spawning a process. */
447
- socketPath: import_zod.z.string().min(1).optional()
512
+ socketPath: import_zod2.z.string().min(1).optional()
448
513
  }).optional()
449
514
  });
450
515
  CODEX_EFFORTS = ["none", "low", "medium", "high"];
@@ -458,47 +523,47 @@ var init_schema = __esm({
458
523
  haiku: "gpt-5.6-luna"
459
524
  });
460
525
  CODEX_DEFAULT_EFFORT = "low";
461
- CodexProviderConfigSchema = import_zod.z.strictObject({
526
+ CodexProviderConfigSchema = import_zod2.z.strictObject({
462
527
  /** The codex model a request maps to when no tier matches its model name. */
463
- defaultModel: import_zod.z.string().min(1).optional(),
528
+ defaultModel: import_zod2.z.string().min(1).optional(),
464
529
  /** Per-tier overrides of the shipped mapping, matched by substring of the requested model name in `CLAUDE_TIERS` order. */
465
- models: import_zod.z.strictObject({
466
- fable: import_zod.z.string().min(1).optional(),
467
- opus: import_zod.z.string().min(1).optional(),
468
- sonnet: import_zod.z.string().min(1).optional(),
469
- haiku: import_zod.z.string().min(1).optional()
530
+ models: import_zod2.z.strictObject({
531
+ fable: import_zod2.z.string().min(1).optional(),
532
+ opus: import_zod2.z.string().min(1).optional(),
533
+ sonnet: import_zod2.z.string().min(1).optional(),
534
+ haiku: import_zod2.z.string().min(1).optional()
470
535
  }).optional(),
471
536
  /** The reasoning effort used when the request's own `output_config.effort` is not one the backend accepts. */
472
- effort: import_zod.z.enum(CODEX_EFFORTS).optional(),
537
+ effort: import_zod2.z.enum(CODEX_EFFORTS).optional(),
473
538
  /** Which login the upstream call is made with; see `CODEX_LOGINS`. */
474
- login: import_zod.z.enum(CODEX_LOGINS).optional()
539
+ login: import_zod2.z.enum(CODEX_LOGINS).optional()
475
540
  });
476
- ProviderRouteSchema = import_zod.z.strictObject({
541
+ ProviderRouteSchema = import_zod2.z.strictObject({
477
542
  /** The condition, the same `when` union a configuration cascade entry takes: the object form or a trilean predicate tree over the request facts the door resolves (`request.model` and kin). */
478
543
  when: WhenSchema,
479
544
  /** The provider a matching request is sent to, by the name a provider file carries. */
480
- provider: import_zod.z.string().min(1),
545
+ provider: import_zod2.z.string().min(1),
481
546
  /** The model name to rewrite the request to before it reaches the target, for a provider that expects another form (OpenRouter's `anthropic/claude-...` for instance). A route that rewrites reads the whole body, the one copy the rewrite needs. */
482
- model: import_zod.z.string().min(1).optional()
547
+ model: import_zod2.z.string().min(1).optional()
483
548
  });
484
- PickerModelSchema = import_zod.z.strictObject({
485
- model: import_zod.z.string().min(1),
486
- tier: import_zod.z.enum(CLAUDE_TIERS),
487
- label: import_zod.z.string().min(1).optional(),
488
- description: import_zod.z.string().min(1).optional()
549
+ PickerModelSchema = import_zod2.z.strictObject({
550
+ model: import_zod2.z.string().min(1),
551
+ tier: import_zod2.z.enum(CLAUDE_TIERS),
552
+ label: import_zod2.z.string().min(1).optional(),
553
+ description: import_zod2.z.string().min(1).optional()
489
554
  });
490
- PickerModelsSchema = import_zod.z.array(PickerModelSchema).refine((models) => new Set(models.map((entry) => entry.model)).size === models.length, { message: "pickerModels names a model more than once" });
491
- ProviderCatalogueSchema = import_zod.z.strictObject({
492
- tier: import_zod.z.enum(CLAUDE_TIERS),
493
- include: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional(),
494
- exclude: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional(),
495
- url: import_zod.z.url().optional()
555
+ PickerModelsSchema = import_zod2.z.array(PickerModelSchema).refine((models) => new Set(models.map((entry) => entry.model)).size === models.length, { message: "pickerModels names a model more than once" });
556
+ ProviderCatalogueSchema = import_zod2.z.strictObject({
557
+ tier: import_zod2.z.enum(CLAUDE_TIERS),
558
+ include: import_zod2.z.array(import_zod2.z.string().min(1)).min(1).optional(),
559
+ exclude: import_zod2.z.array(import_zod2.z.string().min(1)).min(1).optional(),
560
+ url: import_zod2.z.url().optional()
496
561
  });
497
- HttpProviderSchema = import_zod.z.strictObject({
498
- $schema: import_zod.z.string().optional(),
499
- kind: import_zod.z.literal("http").optional(),
500
- displayName: import_zod.z.string().min(1),
501
- baseUrl: import_zod.z.url(),
562
+ HttpProviderSchema = import_zod2.z.strictObject({
563
+ $schema: import_zod2.z.string().optional(),
564
+ kind: import_zod2.z.literal("http").optional(),
565
+ displayName: import_zod2.z.string().min(1),
566
+ baseUrl: import_zod2.z.url(),
502
567
  credential: ProviderCredentialSchema,
503
568
  env: ProviderEnvSchema.optional(),
504
569
  /** Extra models `/model` lists beside the ones the tier settings name. */
@@ -506,95 +571,95 @@ var init_schema = __esm({
506
571
  /** The provider's own model catalogue, listed in `/model` when set. */
507
572
  catalogue: ProviderCatalogueSchema.optional(),
508
573
  /** Per-request routing: when present, each request this provider would serve is matched against the list in order, and the first definite match is sent to that entry's provider instead (itself resolved exactly as a directly dialled request would be). Unmatched requests stay on this provider. */
509
- routes: import_zod.z.array(ProviderRouteSchema).optional()
574
+ routes: import_zod2.z.array(ProviderRouteSchema).optional()
510
575
  });
511
- CodexProviderSchema = import_zod.z.strictObject({
512
- $schema: import_zod.z.string().optional(),
513
- kind: import_zod.z.literal("codex"),
514
- displayName: import_zod.z.string().min(1),
576
+ CodexProviderSchema = import_zod2.z.strictObject({
577
+ $schema: import_zod2.z.string().optional(),
578
+ kind: import_zod2.z.literal("codex"),
579
+ displayName: import_zod2.z.string().min(1),
515
580
  credential: ProviderCredentialSchema,
516
581
  env: ProviderEnvSchema.optional(),
517
582
  /** Extra models `/model` lists beside the ones the tier settings name. */
518
583
  pickerModels: PickerModelsSchema.optional(),
519
584
  codex: CodexProviderConfigSchema.optional()
520
585
  });
521
- RouterProviderSchema = import_zod.z.strictObject({
522
- $schema: import_zod.z.string().optional(),
523
- kind: import_zod.z.literal("router"),
524
- displayName: import_zod.z.string().min(1)
586
+ RouterProviderSchema = import_zod2.z.strictObject({
587
+ $schema: import_zod2.z.string().optional(),
588
+ kind: import_zod2.z.literal("router"),
589
+ displayName: import_zod2.z.string().min(1)
525
590
  });
526
- AntigravityProviderSchema = import_zod.z.strictObject({
527
- $schema: import_zod.z.string().optional(),
528
- kind: import_zod.z.literal("antigravity"),
529
- displayName: import_zod.z.string().min(1),
591
+ AntigravityProviderSchema = import_zod2.z.strictObject({
592
+ $schema: import_zod2.z.string().optional(),
593
+ kind: import_zod2.z.literal("antigravity"),
594
+ displayName: import_zod2.z.string().min(1),
530
595
  credential: ProviderCredentialSchema,
531
596
  env: ProviderEnvSchema.optional(),
532
597
  /** Extra models `/model` lists beside the ones the tier settings name. */
533
598
  pickerModels: PickerModelsSchema.optional(),
534
599
  antigravity: AntigravityProviderConfigSchema.optional()
535
600
  });
536
- ProviderSchema = import_zod.z.discriminatedUnion("kind", [HttpProviderSchema, CodexProviderSchema, AntigravityProviderSchema, RouterProviderSchema]);
601
+ ProviderSchema = import_zod2.z.discriminatedUnion("kind", [HttpProviderSchema, CodexProviderSchema, AntigravityProviderSchema, RouterProviderSchema]);
537
602
  SELECTION_MODES = ["ordered", "most-allowance", "soonest-reset", "spread", "adaptive", "lowest-latency", "highest-success", "cheapest"];
538
- VirtualModelSchema = import_zod.z.strictObject({
603
+ VirtualModelSchema = import_zod2.z.strictObject({
539
604
  /** How the virtual model chooses its member for a request. */
540
- mode: import_zod.z.enum(SELECTION_MODES),
605
+ mode: import_zod2.z.enum(SELECTION_MODES),
541
606
  /** The members to choose among, in preference order where the mode reads order. Each names a target (`z/glm-5.3`), an account model (`acct:work/opus`), another virtual model, or a family (`family:<canonical>`). */
542
- members: import_zod.z.array(import_zod.z.string().min(1)).min(1)
607
+ members: import_zod2.z.array(import_zod2.z.string().min(1)).min(1)
543
608
  });
544
- ModelPricesSchema = import_zod.z.strictObject({
545
- input: import_zod.z.number().positive(),
546
- output: import_zod.z.number().positive()
609
+ ModelPricesSchema = import_zod2.z.strictObject({
610
+ input: import_zod2.z.number().positive(),
611
+ output: import_zod2.z.number().positive()
547
612
  });
548
- FamilySettingsSchema = import_zod.z.strictObject({
549
- names: import_zod.z.array(import_zod.z.string().min(1)).optional(),
550
- mode: import_zod.z.enum(SELECTION_MODES).optional(),
551
- context: import_zod.z.number().int().positive().optional(),
552
- vision: import_zod.z.boolean().optional(),
553
- tools: import_zod.z.boolean().optional(),
554
- thinking: import_zod.z.boolean().optional()
613
+ FamilySettingsSchema = import_zod2.z.strictObject({
614
+ names: import_zod2.z.array(import_zod2.z.string().min(1)).optional(),
615
+ mode: import_zod2.z.enum(SELECTION_MODES).optional(),
616
+ context: import_zod2.z.number().int().positive().optional(),
617
+ vision: import_zod2.z.boolean().optional(),
618
+ tools: import_zod2.z.boolean().optional(),
619
+ thinking: import_zod2.z.boolean().optional()
555
620
  });
556
- ModelsConfigSchema = import_zod.z.strictObject({
621
+ ModelsConfigSchema = import_zod2.z.strictObject({
557
622
  /** Virtual models, by name. */
558
- virtual: import_zod.z.record(import_zod.z.string().min(1), VirtualModelSchema).optional(),
623
+ virtual: import_zod2.z.record(import_zod2.z.string().min(1), VirtualModelSchema).optional(),
559
624
  /** Which model ref each Claude tier (`fable`, `opus`, `sonnet`, `haiku`) points at: a concrete target, an account model, a virtual model, or a family. */
560
- tiers: import_zod.z.strictObject({
561
- fable: import_zod.z.string().min(1).optional(),
562
- opus: import_zod.z.string().min(1).optional(),
563
- sonnet: import_zod.z.string().min(1).optional(),
564
- haiku: import_zod.z.string().min(1).optional()
625
+ tiers: import_zod2.z.strictObject({
626
+ fable: import_zod2.z.string().min(1).optional(),
627
+ opus: import_zod2.z.string().min(1).optional(),
628
+ sonnet: import_zod2.z.string().min(1).optional(),
629
+ haiku: import_zod2.z.string().min(1).optional()
565
630
  }).optional(),
566
631
  /** Prices per model ref, for the `cheapest` mode. */
567
- prices: import_zod.z.record(import_zod.z.string().min(1), ModelPricesSchema).optional(),
632
+ prices: import_zod2.z.record(import_zod2.z.string().min(1), ModelPricesSchema).optional(),
568
633
  /** Model refs hidden from the picker and from routing, whatever else names them. */
569
- hide: import_zod.z.array(import_zod.z.string().min(1)).optional(),
634
+ hide: import_zod2.z.array(import_zod2.z.string().min(1)).optional(),
570
635
  /** When set, the only model refs visible; everything else is hidden. */
571
- show: import_zod.z.array(import_zod.z.string().min(1)).optional(),
636
+ show: import_zod2.z.array(import_zod2.z.string().min(1)).optional(),
572
637
  /** Assertions that each group of refs is one model under several names, overriding what the names alone say. */
573
- same: import_zod.z.array(import_zod.z.array(import_zod.z.string().min(1)).min(2)).optional(),
638
+ same: import_zod2.z.array(import_zod2.z.array(import_zod2.z.string().min(1)).min(2)).optional(),
574
639
  /** Assertions that each pair of refs is two models however alike their names look. */
575
- distinct: import_zod.z.array(import_zod.z.tuple([import_zod.z.string().min(1), import_zod.z.string().min(1)])).optional(),
640
+ distinct: import_zod2.z.array(import_zod2.z.tuple([import_zod2.z.string().min(1), import_zod2.z.string().min(1)])).optional(),
576
641
  /** Per-family settings and the names the normaliser cannot know, by family key. */
577
- families: import_zod.z.record(import_zod.z.string().min(1), FamilySettingsSchema).optional()
642
+ families: import_zod2.z.record(import_zod2.z.string().min(1), FamilySettingsSchema).optional()
578
643
  });
579
- ModelsLayerSchema = import_zod.z.strictObject({
580
- virtual: import_zod.z.record(import_zod.z.string().min(1), import_zod.z.union([VirtualModelSchema, import_zod.z.null()])).optional(),
581
- tiers: import_zod.z.strictObject({
582
- fable: import_zod.z.union([import_zod.z.string().min(1), import_zod.z.null()]).optional(),
583
- opus: import_zod.z.union([import_zod.z.string().min(1), import_zod.z.null()]).optional(),
584
- sonnet: import_zod.z.union([import_zod.z.string().min(1), import_zod.z.null()]).optional(),
585
- haiku: import_zod.z.union([import_zod.z.string().min(1), import_zod.z.null()]).optional()
644
+ ModelsLayerSchema = import_zod2.z.strictObject({
645
+ virtual: import_zod2.z.record(import_zod2.z.string().min(1), import_zod2.z.union([VirtualModelSchema, import_zod2.z.null()])).optional(),
646
+ tiers: import_zod2.z.strictObject({
647
+ fable: import_zod2.z.union([import_zod2.z.string().min(1), import_zod2.z.null()]).optional(),
648
+ opus: import_zod2.z.union([import_zod2.z.string().min(1), import_zod2.z.null()]).optional(),
649
+ sonnet: import_zod2.z.union([import_zod2.z.string().min(1), import_zod2.z.null()]).optional(),
650
+ haiku: import_zod2.z.union([import_zod2.z.string().min(1), import_zod2.z.null()]).optional()
586
651
  }).optional(),
587
- prices: import_zod.z.record(import_zod.z.string().min(1), import_zod.z.union([ModelPricesSchema, import_zod.z.null()])).optional(),
588
- hide: import_zod.z.array(import_zod.z.string().min(1)).optional(),
589
- show: import_zod.z.array(import_zod.z.string().min(1)).optional(),
590
- same: import_zod.z.array(import_zod.z.array(import_zod.z.string().min(1)).min(2)).optional(),
591
- distinct: import_zod.z.array(import_zod.z.tuple([import_zod.z.string().min(1), import_zod.z.string().min(1)])).optional(),
592
- families: import_zod.z.record(import_zod.z.string().min(1), import_zod.z.union([FamilySettingsSchema, import_zod.z.null()])).optional()
652
+ prices: import_zod2.z.record(import_zod2.z.string().min(1), import_zod2.z.union([ModelPricesSchema, import_zod2.z.null()])).optional(),
653
+ hide: import_zod2.z.array(import_zod2.z.string().min(1)).optional(),
654
+ show: import_zod2.z.array(import_zod2.z.string().min(1)).optional(),
655
+ same: import_zod2.z.array(import_zod2.z.array(import_zod2.z.string().min(1)).min(2)).optional(),
656
+ distinct: import_zod2.z.array(import_zod2.z.tuple([import_zod2.z.string().min(1), import_zod2.z.string().min(1)])).optional(),
657
+ families: import_zod2.z.record(import_zod2.z.string().min(1), import_zod2.z.union([FamilySettingsSchema, import_zod2.z.null()])).optional()
593
658
  });
594
- ConfigProfileSchema = import_zod.z.strictObject({
595
- $schema: import_zod.z.string().optional(),
596
- description: import_zod.z.string().optional(),
597
- extends: import_zod.z.array(import_zod.z.string().min(1)).optional(),
659
+ ConfigProfileSchema = import_zod2.z.strictObject({
660
+ $schema: import_zod2.z.string().optional(),
661
+ description: import_zod2.z.string().optional(),
662
+ extends: import_zod2.z.array(import_zod2.z.string().min(1)).optional(),
598
663
  categories: CategoryMapSchema.optional(),
599
664
  entries: EntriesSchema.optional(),
600
665
  launch: LaunchSchema.optional(),
@@ -603,55 +668,55 @@ var init_schema = __esm({
603
668
  POOL_SELECTOR_PREFIX = "pool:";
604
669
  POOL_NAME_PATTERN = "[A-Za-z0-9][A-Za-z0-9._-]*";
605
670
  IDENTITY_NAME_PATTERN = "[A-Za-z0-9][A-Za-z0-9._@-]*";
606
- PoolNameSchema = import_zod.z.string().min(1).regex(new RegExp(`^${POOL_NAME_PATTERN}$`));
671
+ PoolNameSchema = import_zod2.z.string().min(1).regex(new RegExp(`^${POOL_NAME_PATTERN}$`));
607
672
  SELECTOR_RE = new RegExp(`^(${POOL_SELECTOR_PREFIX}${POOL_NAME_PATTERN}|${IDENTITY_NAME_PATTERN})$`);
608
- IdentitySelectorSchema = import_zod.z.string().min(1).regex(SELECTOR_RE);
609
- PoolMemberSchema = import_zod.z.union([import_zod.z.string().min(1).regex(SELECTOR_RE), import_zod.z.strictObject({ identity: import_zod.z.string().min(1).regex(SELECTOR_RE), when: WhenSchema })]);
673
+ IdentitySelectorSchema = import_zod2.z.string().min(1).regex(SELECTOR_RE);
674
+ PoolMemberSchema = import_zod2.z.union([import_zod2.z.string().min(1).regex(SELECTOR_RE), import_zod2.z.strictObject({ identity: import_zod2.z.string().min(1).regex(SELECTOR_RE), when: WhenSchema })]);
610
675
  POOL_PREFERENCES = ["score", "listed"];
611
- PoolPreferenceSchema = import_zod.z.enum(POOL_PREFERENCES);
676
+ PoolPreferenceSchema = import_zod2.z.enum(POOL_PREFERENCES);
612
677
  WHOLE_PERCENT_MAX = 100;
613
- CompactAtUtilisationSchema = import_zod.z.number().int().min(1).max(WHOLE_PERCENT_MAX);
614
- PoolSchema = import_zod.z.strictObject({
615
- identities: import_zod.z.array(PoolMemberSchema).min(1).refine((members) => new Set(members.map(poolMemberIdentity)).size === members.length, { message: "pool members must be unique" }),
678
+ CompactAtUtilisationSchema = import_zod2.z.number().int().min(1).max(WHOLE_PERCENT_MAX);
679
+ PoolSchema = import_zod2.z.strictObject({
680
+ identities: import_zod2.z.array(PoolMemberSchema).min(1).refine((members) => new Set(members.map(poolMemberIdentity)).size === members.length, { message: "pool members must be unique" }),
616
681
  preference: PoolPreferenceSchema.optional(),
617
682
  /** Whether an interactive launch from this pool keeps going when its identity runs out of quota: the launcher moves the session to the next member and resumes the conversation there. Absent means false. */
618
- resumeOnLimit: import_zod.z.boolean().optional(),
683
+ resumeOnLimit: import_zod2.z.boolean().optional(),
619
684
  /** Whether a supervised session's context is compacted before its identity's quota is spent, so the resume on the next member writes a small context instead of a large one. Needs `resumeOnLimit`. Absent means false. */
620
- compactBeforeLimit: import_zod.z.boolean().optional(),
685
+ compactBeforeLimit: import_zod2.z.boolean().optional(),
621
686
  /** The share of a quota window, in whole percent, at which sessions are compacted. Absent means the launcher decides from what compacting every session on the member would cost against what its five-hour window has left. Needs `compactBeforeLimit`. */
622
687
  compactAtUtilisation: CompactAtUtilisationSchema.optional()
623
688
  }).refine((pool) => pool.compactBeforeLimit !== true || pool.resumeOnLimit === true, { message: "compactBeforeLimit needs resumeOnLimit, since a session that is not moved has no cold cache to avoid", path: ["compactBeforeLimit"] }).refine((pool) => pool.compactAtUtilisation === void 0 || pool.compactBeforeLimit === true, { message: "compactAtUtilisation needs compactBeforeLimit", path: ["compactAtUtilisation"] });
624
689
  WEEKDAYS = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
625
- AnchorSchema = import_zod.z.strictObject({
626
- days: import_zod.z.array(import_zod.z.enum(WEEKDAYS)).min(1).refine((days) => new Set(days).size === days.length, "an anchor names each weekday at most once"),
627
- time: import_zod.z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "a 24-hour time such as 06:00"),
628
- timeZone: import_zod.z.string().refine(isTimeZone, "an IANA time zone such as Europe/London").optional()
690
+ AnchorSchema = import_zod2.z.strictObject({
691
+ days: import_zod2.z.array(import_zod2.z.enum(WEEKDAYS)).min(1).refine((days) => new Set(days).size === days.length, "an anchor names each weekday at most once"),
692
+ time: import_zod2.z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "a 24-hour time such as 06:00"),
693
+ timeZone: import_zod2.z.string().refine(isTimeZone, "an IANA time zone such as Europe/London").optional()
629
694
  });
630
695
  JOB_WINDOWS = ["fiveHour", "sevenDay"];
631
- JobTriggerSchema = import_zod.z.union([import_zod.z.strictObject({ at: import_zod.z.array(AnchorSchema).min(1) }), import_zod.z.strictObject({ beforeReset: import_zod.z.enum(JOB_WINDOWS), lead: import_zod.z.string().regex(DURATION_RE) })]);
632
- JobTargetSchema = import_zod.z.union([import_zod.z.strictObject({ identity: IdentitySelectorSchema }), import_zod.z.strictObject({ pool: PoolNameSchema })]);
633
- JobSchema = import_zod.z.strictObject({
696
+ JobTriggerSchema = import_zod2.z.union([import_zod2.z.strictObject({ at: import_zod2.z.array(AnchorSchema).min(1) }), import_zod2.z.strictObject({ beforeReset: import_zod2.z.enum(JOB_WINDOWS), lead: import_zod2.z.string().regex(DURATION_RE) })]);
697
+ JobTargetSchema = import_zod2.z.union([import_zod2.z.strictObject({ identity: IdentitySelectorSchema }), import_zod2.z.strictObject({ pool: PoolNameSchema })]);
698
+ JobSchema = import_zod2.z.strictObject({
634
699
  target: JobTargetSchema,
635
700
  trigger: JobTriggerSchema,
636
- prompt: import_zod.z.string().min(1),
701
+ prompt: import_zod2.z.string().min(1),
637
702
  /** The absolute directory the run works in. */
638
- cwd: import_zod.z.string().min(1),
639
- timeout: import_zod.z.string().regex(DURATION_RE),
640
- model: import_zod.z.string().min(1).optional(),
641
- allowedTools: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional()
703
+ cwd: import_zod2.z.string().min(1),
704
+ timeout: import_zod2.z.string().regex(DURATION_RE),
705
+ model: import_zod2.z.string().min(1).optional(),
706
+ allowedTools: import_zod2.z.array(import_zod2.z.string().min(1)).min(1).optional()
642
707
  });
643
708
  DirectoryRuleSchema = ConfigProfileSchema.omit({ description: true }).extend({
644
- path: import_zod.z.string().min(1),
645
- configProfile: import_zod.z.string().min(1).optional(),
709
+ path: import_zod2.z.string().min(1),
710
+ configProfile: import_zod2.z.string().min(1).optional(),
646
711
  identity: IdentitySelectorSchema.optional(),
647
712
  when: WhenSchema.optional()
648
713
  });
649
- DirectoryRulesSchema = import_zod.z.strictObject({
650
- $schema: import_zod.z.string().optional(),
651
- rules: import_zod.z.array(DirectoryRuleSchema)
714
+ DirectoryRulesSchema = import_zod2.z.strictObject({
715
+ $schema: import_zod2.z.string().optional(),
716
+ rules: import_zod2.z.array(DirectoryRuleSchema)
652
717
  });
653
718
  PortableConfigSchema = ConfigProfileSchema.omit({ description: true }).extend({
654
- configProfile: import_zod.z.string().min(1).optional(),
719
+ configProfile: import_zod2.z.string().min(1).optional(),
655
720
  identity: IdentitySelectorSchema.optional(),
656
721
  when: WhenSchema.optional()
657
722
  });
@@ -660,23 +725,23 @@ var init_schema = __esm({
660
725
  HEADROOM_ROLLOUT_CHANNELS = ["beta", "canary", "dev"];
661
726
  INTERCEPT_CHANNELS = ["canary", "dev"];
662
727
  READ_MATURATION_CHANNELS = ["beta", "dev"];
663
- HeadroomGlobalConfigObjectSchema = import_zod.z.strictObject({
728
+ HeadroomGlobalConfigObjectSchema = import_zod2.z.strictObject({
664
729
  /** Install spec handed to `uv tool install`. Defaults to HEADROOM_DEFAULT_SOURCE. */
665
- source: import_zod.z.string().min(1).optional(),
730
+ source: import_zod2.z.string().min(1).optional(),
666
731
  /** How long the daemon may sit with no registered sessions before the supervisor stops it. Defaults to HEADROOM_DEFAULT_IDLE_SHUTDOWN_MINUTES. */
667
- idleShutdownMinutes: import_zod.z.number().int().positive().optional(),
732
+ idleShutdownMinutes: import_zod2.z.number().int().positive().optional(),
668
733
  /** Optimisation mode, passed as `--mode`. Unset leaves headroom's own default (`cache`). */
669
- mode: import_zod.z.enum(HEADROOM_MODES).optional(),
734
+ mode: import_zod2.z.enum(HEADROOM_MODES).optional(),
670
735
  /** Keep-ratio for prose and code compression, passed as `--target-ratio`: lower is more aggressive. Unset lets headroom decide. */
671
- targetRatio: import_zod.z.number().gt(0).max(1).optional(),
736
+ targetRatio: import_zod2.z.number().gt(0).max(1).optional(),
672
737
  /** How compressed tool output stays recoverable. Unset leaves headroom's own default (`default`). */
673
- ccr: import_zod.z.enum(HEADROOM_CCR_MODES).optional(),
738
+ ccr: import_zod2.z.enum(HEADROOM_CCR_MODES).optional(),
674
739
  /** Headroom's experimental release channel, exported as `HEADROOM_ROLLOUT_CHANNEL`. Required by `interceptToolResults` and `readMaturation`, which are refused without a channel that unlocks them. */
675
- rolloutChannel: import_zod.z.enum(HEADROOM_ROLLOUT_CHANNELS).optional(),
740
+ rolloutChannel: import_zod2.z.enum(HEADROOM_ROLLOUT_CHANNELS).optional(),
676
741
  /** Opt in to headroom's tool-result interceptors (`--intercept-tool-results`). Needs `rolloutChannel` canary or dev. */
677
- interceptToolResults: import_zod.z.boolean().optional(),
742
+ interceptToolResults: import_zod2.z.boolean().optional(),
678
743
  /** Opt in to headroom's experimental read maturation (`--read-maturation`). Needs `rolloutChannel` beta or dev. */
679
- readMaturation: import_zod.z.boolean().optional()
744
+ readMaturation: import_zod2.z.boolean().optional()
680
745
  });
681
746
  HeadroomGlobalConfigSchema = HeadroomGlobalConfigObjectSchema.superRefine((config, context) => {
682
747
  if (config.interceptToolResults === true && !INTERCEPT_CHANNELS.includes(config.rolloutChannel ?? "")) {
@@ -688,53 +753,53 @@ var init_schema = __esm({
688
753
  });
689
754
  HEADROOM_DEFAULT_SOURCE = "headroom-ai[proxy] @ git+https://github.com/ExaDev/headroom@2dfa958e47814533751cdd0c5362d8f352ec5b75";
690
755
  HEADROOM_DEFAULT_IDLE_SHUTDOWN_MINUTES = 15;
691
- FrontDoorGlobalConfigSchema = import_zod.z.strictObject({
756
+ FrontDoorGlobalConfigSchema = import_zod2.z.strictObject({
692
757
  /** How long the front door may sit with no registered sessions before it closes and exits. Defaults to FRONTDOOR_DEFAULT_IDLE_SHUTDOWN_MINUTES. */
693
- idleShutdownMinutes: import_zod.z.number().int().positive().optional()
758
+ idleShutdownMinutes: import_zod2.z.number().int().positive().optional()
694
759
  });
695
760
  UPDATE_MODES = ["off", "notify", "auto"];
696
- UpdateGlobalConfigSchema = import_zod.z.strictObject({
761
+ UpdateGlobalConfigSchema = import_zod2.z.strictObject({
697
762
  /** What a launch does about a newer release of agent-shim itself; see `UPDATE_MODES`. Absent means `off`. */
698
- mode: import_zod.z.enum(UPDATE_MODES).optional()
763
+ mode: import_zod2.z.enum(UPDATE_MODES).optional()
699
764
  });
700
- GlobalConfigSchema = import_zod.z.strictObject({
701
- $schema: import_zod.z.string().optional(),
702
- defaultConfigProfile: import_zod.z.string().min(1).optional(),
703
- walkUpLimit: import_zod.z.string().min(1).optional(),
765
+ GlobalConfigSchema = import_zod2.z.strictObject({
766
+ $schema: import_zod2.z.string().optional(),
767
+ defaultConfigProfile: import_zod2.z.string().min(1).optional(),
768
+ walkUpLimit: import_zod2.z.string().min(1).optional(),
704
769
  categories: CategoryMapSchema.optional(),
705
770
  entries: EntriesSchema.optional(),
706
771
  launch: LaunchSchema.optional(),
707
772
  headroom: HeadroomGlobalConfigSchema.optional(),
708
773
  frontdoor: FrontDoorGlobalConfigSchema.optional(),
709
774
  update: UpdateGlobalConfigSchema.optional(),
710
- pools: import_zod.z.record(PoolNameSchema, PoolSchema).optional(),
775
+ pools: import_zod2.z.record(PoolNameSchema, PoolSchema).optional(),
711
776
  models: ModelsConfigSchema.optional(),
712
- jobs: import_zod.z.record(PoolNameSchema, JobSchema).optional()
777
+ jobs: import_zod2.z.record(PoolNameSchema, JobSchema).optional()
713
778
  });
714
- IdentitySchema = import_zod.z.strictObject({
715
- $schema: import_zod.z.string().optional(),
716
- name: import_zod.z.string().min(1).regex(/^[A-Za-z0-9][A-Za-z0-9._@-]*$/),
717
- defaultConfigProfile: import_zod.z.string().min(1).optional(),
718
- allowAmbientCredential: import_zod.z.boolean().default(false),
779
+ IdentitySchema = import_zod2.z.strictObject({
780
+ $schema: import_zod2.z.string().optional(),
781
+ name: import_zod2.z.string().min(1).regex(/^[A-Za-z0-9][A-Za-z0-9._@-]*$/),
782
+ defaultConfigProfile: import_zod2.z.string().min(1).optional(),
783
+ allowAmbientCredential: import_zod2.z.boolean().default(false),
719
784
  credential: CredentialSchema.optional(),
720
785
  /** When this identity's five-hour window should be open: the front door opens one at each anchor if none is. Absent, nothing is opened on a schedule. */
721
- anchors: import_zod.z.array(AnchorSchema).min(1).optional()
786
+ anchors: import_zod2.z.array(AnchorSchema).min(1).optional()
722
787
  });
723
- CategoryClassificationSchema = import_zod.z.strictObject({
724
- $schema: import_zod.z.string().optional(),
725
- secret: import_zod.z.array(import_zod.z.string().min(1)),
726
- runtime: import_zod.z.array(import_zod.z.string().min(1)),
727
- history: import_zod.z.array(import_zod.z.string().min(1)),
728
- knowledge: import_zod.z.array(import_zod.z.string().min(1)),
729
- settings: import_zod.z.array(import_zod.z.string().min(1))
788
+ CategoryClassificationSchema = import_zod2.z.strictObject({
789
+ $schema: import_zod2.z.string().optional(),
790
+ secret: import_zod2.z.array(import_zod2.z.string().min(1)),
791
+ runtime: import_zod2.z.array(import_zod2.z.string().min(1)),
792
+ history: import_zod2.z.array(import_zod2.z.string().min(1)),
793
+ knowledge: import_zod2.z.array(import_zod2.z.string().min(1)),
794
+ settings: import_zod2.z.array(import_zod2.z.string().min(1))
730
795
  });
731
- CategoryClassificationOverlaySchema = import_zod.z.strictObject({
732
- $schema: import_zod.z.string().optional(),
733
- secret: import_zod.z.array(import_zod.z.string().min(1)).optional(),
734
- runtime: import_zod.z.array(import_zod.z.string().min(1)).optional(),
735
- history: import_zod.z.array(import_zod.z.string().min(1)).optional(),
736
- knowledge: import_zod.z.array(import_zod.z.string().min(1)).optional(),
737
- settings: import_zod.z.array(import_zod.z.string().min(1)).optional()
796
+ CategoryClassificationOverlaySchema = import_zod2.z.strictObject({
797
+ $schema: import_zod2.z.string().optional(),
798
+ secret: import_zod2.z.array(import_zod2.z.string().min(1)).optional(),
799
+ runtime: import_zod2.z.array(import_zod2.z.string().min(1)).optional(),
800
+ history: import_zod2.z.array(import_zod2.z.string().min(1)).optional(),
801
+ knowledge: import_zod2.z.array(import_zod2.z.string().min(1)).optional(),
802
+ settings: import_zod2.z.array(import_zod2.z.string().min(1)).optional()
738
803
  });
739
804
  SHIPPED_CATEGORY_DEFAULTS = Object.freeze({
740
805
  secret: false,
@@ -1526,6 +1591,9 @@ function flattenLayers(layers, options) {
1526
1591
  if (layer.launch.proxyBypass !== void 0) {
1527
1592
  launch.proxyBypass = layer.launch.proxyBypass;
1528
1593
  }
1594
+ if (layer.launch.statusline !== void 0) {
1595
+ launch.statusline = { ...launch.statusline, ...layer.launch.statusline };
1596
+ }
1529
1597
  }
1530
1598
  if (layer.models !== void 0) {
1531
1599
  models = mergeModels(models, layer.models);
@@ -2913,27 +2981,27 @@ function recoveryDiagnostics(recovery, identity) {
2913
2981
  }
2914
2982
  ];
2915
2983
  }
2916
- var import_node_path7, import_zod2, FARM_MANIFEST_FILENAME, FarmManifestSchema;
2984
+ var import_node_path7, import_zod3, FARM_MANIFEST_FILENAME, FarmManifestSchema;
2917
2985
  var init_farm = __esm({
2918
2986
  "src/launcher/farm.ts"() {
2919
2987
  "use strict";
2920
2988
  import_node_path7 = __toESM(require("node:path"), 1);
2921
- import_zod2 = require("zod");
2989
+ import_zod3 = require("zod");
2922
2990
  init_classify();
2923
2991
  init_reconcile();
2924
2992
  init_pipeline();
2925
2993
  init_legacy();
2926
2994
  init_lock();
2927
2995
  FARM_MANIFEST_FILENAME = ".agent-shim-farm.json";
2928
- FarmManifestSchema = import_zod2.z.strictObject({
2929
- version: import_zod2.z.literal(1),
2930
- builtAtMs: import_zod2.z.number(),
2931
- identity: import_zod2.z.string(),
2932
- configProfile: import_zod2.z.string().optional(),
2933
- cwd: import_zod2.z.string(),
2934
- claudeHome: import_zod2.z.string(),
2935
- materialised: import_zod2.z.array(import_zod2.z.string()),
2936
- links: import_zod2.z.array(import_zod2.z.strictObject({ rel: import_zod2.z.string(), target: import_zod2.z.string() }))
2996
+ FarmManifestSchema = import_zod3.z.strictObject({
2997
+ version: import_zod3.z.literal(1),
2998
+ builtAtMs: import_zod3.z.number(),
2999
+ identity: import_zod3.z.string(),
3000
+ configProfile: import_zod3.z.string().optional(),
3001
+ cwd: import_zod3.z.string(),
3002
+ claudeHome: import_zod3.z.string(),
3003
+ materialised: import_zod3.z.array(import_zod3.z.string()),
3004
+ links: import_zod3.z.array(import_zod3.z.strictObject({ rel: import_zod3.z.string(), target: import_zod3.z.string() }))
2937
3005
  });
2938
3006
  }
2939
3007
  });
@@ -3463,47 +3531,47 @@ function pruneDeadFrontDoorSessions(fs14, sessionsDir, isRunning) {
3463
3531
  }
3464
3532
  return removed;
3465
3533
  }
3466
- var import_node_path8, import_zod3, FRONT_DOOR_PROTOCOL, FrontDoorSessionSchema, FrontDoorStateSchema, MAX_TCP_PORT, FrontDoorDirectRecordSchema, RECORD_TEMPORARY_FILE;
3534
+ var import_node_path8, import_zod4, FRONT_DOOR_PROTOCOL, FrontDoorSessionSchema, FrontDoorStateSchema, MAX_TCP_PORT, FrontDoorDirectRecordSchema, RECORD_TEMPORARY_FILE;
3467
3535
  var init_state = __esm({
3468
3536
  "src/frontdoor/state.ts"() {
3469
3537
  "use strict";
3470
3538
  import_node_path8 = __toESM(require("node:path"), 1);
3471
- import_zod3 = require("zod");
3539
+ import_zod4 = require("zod");
3472
3540
  init_schema();
3473
3541
  FRONT_DOOR_PROTOCOL = 5;
3474
- FrontDoorSessionSchema = import_zod3.z.strictObject({ pid: import_zod3.z.number().int().positive(), startedAt: import_zod3.z.number(), token: import_zod3.z.string().min(1), supervisorPid: import_zod3.z.number().int().positive().optional(), sessionId: import_zod3.z.string().min(1).optional(), models: ModelsConfigSchema.optional() });
3475
- FrontDoorStateSchema = import_zod3.z.strictObject({
3542
+ FrontDoorSessionSchema = import_zod4.z.strictObject({ pid: import_zod4.z.number().int().positive(), startedAt: import_zod4.z.number(), token: import_zod4.z.string().min(1), supervisorPid: import_zod4.z.number().int().positive().optional(), sessionId: import_zod4.z.string().min(1).optional(), models: ModelsConfigSchema.optional() });
3543
+ FrontDoorStateSchema = import_zod4.z.strictObject({
3476
3544
  /**
3477
3545
  * The launcher-to-door wire protocol this supervisor speaks, written once it is serving; absent in state written by a release that predates the field, which `ensureFrontDoor` reads as protocol 0. A launcher replaces a door whose protocol is lower than its own (see `FRONT_DOOR_PROTOCOL`).
3478
3546
  */
3479
- protocol: import_zod3.z.number().int().nonnegative().optional(),
3547
+ protocol: import_zod4.z.number().int().nonnegative().optional(),
3480
3548
  /** The supervisor process serving the front door. Alive means both listeners are up in that process. */
3481
- supervisorPid: import_zod3.z.number().int().positive().optional(),
3549
+ supervisorPid: import_zod4.z.number().int().positive().optional(),
3482
3550
  /** The loopback port the HTTPS provider listener serves on. Absent until the listener has bound and answered its health probe, so "port is set" is itself the ready signal a launcher polls for. */
3483
- port: import_zod3.z.number().int().positive().optional(),
3551
+ port: import_zod4.z.number().int().positive().optional(),
3484
3552
  /**
3485
3553
  * The sticky port preference for the provider listener: kept across crashes, restarts and idle shutdowns so every provider session, whose base URL was frozen at launch, keeps finding the front door at the same address.
3486
3554
  */
3487
- lastPort: import_zod3.z.number().int().positive().optional(),
3555
+ lastPort: import_zod4.z.number().int().positive().optional(),
3488
3556
  /**
3489
3557
  * The loopback port the CONNECT surface listens on. Absent whenever no supervisor is serving it, so "connectPort is set" is the ready signal an OAuth launch polls for alongside `port`.
3490
3558
  */
3491
- connectPort: import_zod3.z.number().int().positive().optional(),
3559
+ connectPort: import_zod4.z.number().int().positive().optional(),
3492
3560
  /**
3493
3561
  * The sticky port preference for the CONNECT surface, the exact analogue of `lastPort` for the second listener: it survives every shutdown, because every OAuth session's environment was frozen at launch with HTTPS_PROXY pointing at this address and a restart that moves strands them.
3494
3562
  */
3495
- lastConnectPort: import_zod3.z.number().int().positive().optional(),
3563
+ lastConnectPort: import_zod4.z.number().int().positive().optional(),
3496
3564
  /**
3497
3565
  * The loopback port the direct listener serves on: the listener a headroom hop tells the daemon to forward routed traffic back to. Sticky like the others, because headroom's allowlist admits its exact origin: the headroom supervisor rewrites the daemon's allowlist file when the origin moves, but a provider launch waits at its gate until it has, so an ephemeral port would hold launches up after every restart.
3498
3566
  */
3499
- directPort: import_zod3.z.number().int().positive().optional(),
3567
+ directPort: import_zod4.z.number().int().positive().optional(),
3500
3568
  /** The sticky port preference for the direct listener, for the reason `directPort` gives. */
3501
- lastDirectPort: import_zod3.z.number().int().positive().optional(),
3569
+ lastDirectPort: import_zod4.z.number().int().positive().optional(),
3502
3570
  /** The last fatal error, kept across shutdowns so `frontdoor status` can explain a front door that is not running. */
3503
- lastError: import_zod3.z.string().optional()
3571
+ lastError: import_zod4.z.string().optional()
3504
3572
  });
3505
3573
  MAX_TCP_PORT = 65535;
3506
- FrontDoorDirectRecordSchema = import_zod3.z.strictObject({ directPort: import_zod3.z.number().int().positive().max(MAX_TCP_PORT) });
3574
+ FrontDoorDirectRecordSchema = import_zod4.z.strictObject({ directPort: import_zod4.z.number().int().positive().max(MAX_TCP_PORT) });
3507
3575
  RECORD_TEMPORARY_FILE = /^[1-9]\d*\.json\.([1-9]\d*)\.tmp$/;
3508
3576
  }
3509
3577
  });
@@ -4191,7 +4259,7 @@ var init_package = __esm({
4191
4259
  "package.json"() {
4192
4260
  package_default = {
4193
4261
  name: "claude-use",
4194
- version: "11.49.2",
4262
+ version: "11.50.1",
4195
4263
  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.",
4196
4264
  license: "MIT",
4197
4265
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -4540,40 +4608,40 @@ function readStartLock(fs14, lockFile) {
4540
4608
  return void 0;
4541
4609
  }
4542
4610
  }
4543
- var import_node_crypto6, import_node_path11, import_zod8, HeadroomStateSchema, HeadroomSessionSchema, HeadroomLockSchema, HEADROOM_ALLOWLIST_FILE_FLAG, ALLOWLIST_LINE_BREAKS, ALLOWLIST_WHITESPACE, ALLOWLIST_FILE_SEPARATORS, ALLOWLIST_FILE_COMMENT, ALLOWLIST_ENTRY_WHITESPACE, ALLOWLIST_SURROUNDING_WHITESPACE, ALLOWLIST_SAFE_SCHEMES;
4611
+ var import_node_crypto6, import_node_path11, import_zod9, HeadroomStateSchema, HeadroomSessionSchema, HeadroomLockSchema, HEADROOM_ALLOWLIST_FILE_FLAG, ALLOWLIST_LINE_BREAKS, ALLOWLIST_WHITESPACE, ALLOWLIST_FILE_SEPARATORS, ALLOWLIST_FILE_COMMENT, ALLOWLIST_ENTRY_WHITESPACE, ALLOWLIST_SURROUNDING_WHITESPACE, ALLOWLIST_SAFE_SCHEMES;
4544
4612
  var init_state2 = __esm({
4545
4613
  "src/headroom/state.ts"() {
4546
4614
  "use strict";
4547
4615
  import_node_crypto6 = require("node:crypto");
4548
4616
  import_node_path11 = __toESM(require("node:path"), 1);
4549
- import_zod8 = require("zod");
4617
+ import_zod9 = require("zod");
4550
4618
  init_schema();
4551
- HeadroomStateSchema = import_zod8.z.strictObject({
4619
+ HeadroomStateSchema = import_zod9.z.strictObject({
4552
4620
  /** The supervisor process owning the daemon. Alive means someone is keeping headroom running. */
4553
- supervisorPid: import_zod8.z.number().int().positive().optional(),
4621
+ supervisorPid: import_zod9.z.number().int().positive().optional(),
4554
4622
  /** The headroom proxy process itself, recorded as soon as it is spawned (before it is ready, which `socketPath` signals) so a successor can find a daemon whose supervisor died during its start. Absent while the supervisor is between restarts. */
4555
- headroomPid: import_zod8.z.number().int().positive().optional(),
4623
+ headroomPid: import_zod9.z.number().int().positive().optional(),
4556
4624
  /**
4557
4625
  * The unix socket the proxy serves on, inside the owner-only socket directory. Absent until the proxy has passed its readiness check, so "socketPath is set" is itself the ready signal a launcher polls for. The front door reads it on every hop, so a restart (which keeps the generation's path) is followed without anything being relaunched.
4558
4626
  */
4559
- socketPath: import_zod8.z.string().min(1).optional(),
4627
+ socketPath: import_zod9.z.string().min(1).optional(),
4560
4628
  /** The `headroom --version` output of the running install. */
4561
- version: import_zod8.z.string().optional(),
4629
+ version: import_zod9.z.string().optional(),
4562
4630
  /**
4563
4631
  * Hash of the allowlist the running proxy serves. The supervisor records it in the same tick it writes that allowlist to `LayoutPaths.headroomAllowlistFile`, which the proxy re-reads on its next request, so a provider launch, whose requests come back through its front door's direct origin, waits until this names an allowlist holding that origin. A supervisor from an earlier release records here the hash of the allowlist its daemon was started with instead (see `earlierRelease.ts`).
4564
4632
  */
4565
- allowlistHash: import_zod8.z.string().optional(),
4633
+ allowlistHash: import_zod9.z.string().optional(),
4566
4634
  /** Hash of the token-saving settings the running proxy was started with, so a settings change is detected as drift. */
4567
- settingsHash: import_zod8.z.string().optional(),
4635
+ settingsHash: import_zod9.z.string().optional(),
4568
4636
  /** The install spec the running install was last installed from, so a `source` config change is detected as drift. */
4569
- installedSource: import_zod8.z.string().optional(),
4637
+ installedSource: import_zod9.z.string().optional(),
4570
4638
  /** The install spec the supervisor is installing right now, present only while `uv tool install` runs, so a launcher that finds a live supervisor with no daemon yet keeps waiting for the install instead of counting it against its start bound. Cleared by the write that follows the install, whatever its outcome. */
4571
- installing: import_zod8.z.string().optional(),
4639
+ installing: import_zod9.z.string().optional(),
4572
4640
  /** The last fatal error, kept across shutdowns so `headroom status` can explain a daemon that is not running. */
4573
- lastError: import_zod8.z.string().optional()
4641
+ lastError: import_zod9.z.string().optional()
4574
4642
  });
4575
- HeadroomSessionSchema = import_zod8.z.strictObject({ pid: import_zod8.z.number().int().positive(), startedAt: import_zod8.z.number(), supervisorPid: import_zod8.z.number().int().positive() });
4576
- HeadroomLockSchema = import_zod8.z.strictObject({ pid: import_zod8.z.number().int().positive(), at: import_zod8.z.number() });
4643
+ HeadroomSessionSchema = import_zod9.z.strictObject({ pid: import_zod9.z.number().int().positive(), startedAt: import_zod9.z.number(), supervisorPid: import_zod9.z.number().int().positive() });
4644
+ HeadroomLockSchema = import_zod9.z.strictObject({ pid: import_zod9.z.number().int().positive(), at: import_zod9.z.number() });
4577
4645
  HEADROOM_ALLOWLIST_FILE_FLAG = "--allowed-base-urls-file";
4578
4646
  ALLOWLIST_LINE_BREAKS = "\\n\\r\\u000b\\u000c\\u001c\\u001d\\u001e\\u0085\\u2028\\u2029";
4579
4647
  ALLOWLIST_WHITESPACE = "\\t\\n\\u000b\\u000c\\r\\u001c-\\u001f \\u0085\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000";
@@ -4987,14 +5055,14 @@ function pinnedGitCommit(spec) {
4987
5055
  const ref = GIT_SPEC_RE.exec(spec)?.[1];
4988
5056
  return ref !== void 0 && COMMIT_SHA_RE.test(ref) ? ref.toLowerCase() : void 0;
4989
5057
  }
4990
- var import_zod9, GIT_SPEC_RE, COMMIT_SHA_RE, DirectUrlSchema;
5058
+ var import_zod10, GIT_SPEC_RE, COMMIT_SHA_RE, DirectUrlSchema;
4991
5059
  var init_source = __esm({
4992
5060
  "src/headroom/source.ts"() {
4993
5061
  "use strict";
4994
- import_zod9 = require("zod");
5062
+ import_zod10 = require("zod");
4995
5063
  GIT_SPEC_RE = /git\+[^@\s]+(?:@([^\s#]+))?/;
4996
5064
  COMMIT_SHA_RE = /^[0-9a-f]{40}$/i;
4997
- DirectUrlSchema = import_zod9.z.object({ vcs_info: import_zod9.z.object({ commit_id: import_zod9.z.string() }) });
5065
+ DirectUrlSchema = import_zod10.z.object({ vcs_info: import_zod10.z.object({ commit_id: import_zod10.z.string() }) });
4998
5066
  }
4999
5067
  });
5000
5068
 
@@ -6124,161 +6192,161 @@ var init_identity = __esm({
6124
6192
  });
6125
6193
 
6126
6194
  // src/usage/schema.ts
6127
- var import_zod10, USAGE_SCHEMA_VERSION, VersionSchema, InstantSchema, TokenCountSchema, TokenUsageSchema, LIMIT_KINDS, LimitClassificationSchema, UsageRecordSchema, QuotaWindowSchema, ExtraUsageSpendSchema, UnifiedRateLimitSchema, RateLimitStateSchema, LimitEventSchema, ProviderQuotaWindowSchema, ProviderAccountSchema, ProviderQuotaSchema, ProviderUsageStateSchema, AccountMetadataSchema, UsageSnapshotSchema;
6195
+ var import_zod11, USAGE_SCHEMA_VERSION, VersionSchema, InstantSchema, TokenCountSchema, TokenUsageSchema, LIMIT_KINDS, LimitClassificationSchema, UsageRecordSchema, QuotaWindowSchema, ExtraUsageSpendSchema, UnifiedRateLimitSchema, RateLimitStateSchema, LimitEventSchema, ProviderQuotaWindowSchema, ProviderAccountSchema, ProviderQuotaSchema, ProviderUsageStateSchema, AccountMetadataSchema, UsageSnapshotSchema;
6128
6196
  var init_schema2 = __esm({
6129
6197
  "src/usage/schema.ts"() {
6130
6198
  "use strict";
6131
- import_zod10 = require("zod");
6199
+ import_zod11 = require("zod");
6132
6200
  USAGE_SCHEMA_VERSION = 1;
6133
- VersionSchema = import_zod10.z.literal(USAGE_SCHEMA_VERSION);
6134
- InstantSchema = import_zod10.z.iso.datetime();
6135
- TokenCountSchema = import_zod10.z.number().int().nonnegative();
6136
- TokenUsageSchema = import_zod10.z.strictObject({
6201
+ VersionSchema = import_zod11.z.literal(USAGE_SCHEMA_VERSION);
6202
+ InstantSchema = import_zod11.z.iso.datetime();
6203
+ TokenCountSchema = import_zod11.z.number().int().nonnegative();
6204
+ TokenUsageSchema = import_zod11.z.strictObject({
6137
6205
  inputTokens: TokenCountSchema.optional(),
6138
6206
  outputTokens: TokenCountSchema.optional(),
6139
6207
  cacheCreationInputTokens: TokenCountSchema.optional(),
6140
6208
  cacheReadInputTokens: TokenCountSchema.optional()
6141
6209
  });
6142
6210
  LIMIT_KINDS = ["rate-limited", "quota-exhausted"];
6143
- LimitClassificationSchema = import_zod10.z.strictObject({
6144
- kind: import_zod10.z.enum(LIMIT_KINDS),
6211
+ LimitClassificationSchema = import_zod11.z.strictObject({
6212
+ kind: import_zod11.z.enum(LIMIT_KINDS),
6145
6213
  /** Seconds to wait before retrying, from the response's `retry-after`. */
6146
- retryAfterSeconds: import_zod10.z.number().nonnegative().optional(),
6214
+ retryAfterSeconds: import_zod11.z.number().nonnegative().optional(),
6147
6215
  /** When the limiting window resets, from the upstream's own reset header. */
6148
6216
  resetAt: InstantSchema.optional(),
6149
6217
  /** The window the upstream named as the binding one (`anthropic-ratelimit-unified-representative-claim`), such as `five_hour` or `seven_day`. */
6150
- window: import_zod10.z.string().optional(),
6218
+ window: import_zod11.z.string().optional(),
6151
6219
  /** The signals the classification rests on, each `<name>=<value>` from a response header or the error body's `type` or `code`. Never the error message. */
6152
- evidence: import_zod10.z.array(import_zod10.z.string())
6220
+ evidence: import_zod11.z.array(import_zod11.z.string())
6153
6221
  });
6154
- UsageRecordSchema = import_zod10.z.strictObject({
6222
+ UsageRecordSchema = import_zod11.z.strictObject({
6155
6223
  schemaVersion: VersionSchema,
6156
6224
  /** When the front door received the request. */
6157
6225
  at: InstantSchema,
6158
6226
  /** The launching identity, when the launch resolved one. */
6159
- identity: import_zod10.z.string().optional(),
6227
+ identity: import_zod11.z.string().optional(),
6160
6228
  /** `anthropic` for an OAuth session's request to Claude Code's own API, otherwise the provider's name. */
6161
- provider: import_zod10.z.string(),
6229
+ provider: import_zod11.z.string(),
6162
6230
  /** The launch's session id, generated per launch. */
6163
- sessionId: import_zod10.z.string().optional(),
6231
+ sessionId: import_zod11.z.string().optional(),
6164
6232
  /** The project the launch ran in (its git repository root), when the launch sent one: headroom launches do. */
6165
- project: import_zod10.z.string().optional(),
6233
+ project: import_zod11.z.string().optional(),
6166
6234
  /** Whether the request crossed headroom on its way upstream. Absent on a record written before the door recorded it, and false when the request went direct. */
6167
- viaHeadroom: import_zod10.z.boolean().optional(),
6235
+ viaHeadroom: import_zod11.z.boolean().optional(),
6168
6236
  /** The front-door route that served the request. */
6169
- route: import_zod10.z.string(),
6170
- method: import_zod10.z.string(),
6237
+ route: import_zod11.z.string(),
6238
+ method: import_zod11.z.string(),
6171
6239
  /** The API path as the upstream sees it (`/v1/messages`), without the provider prefix or a query string. */
6172
- endpoint: import_zod10.z.string(),
6240
+ endpoint: import_zod11.z.string(),
6173
6241
  /** The model the response named. */
6174
- model: import_zod10.z.string().optional(),
6242
+ model: import_zod11.z.string().optional(),
6175
6243
  /** The model name the session asked for, when a routing layer chose among alternatives for it (a virtual model's or a tier alias's selection) and served the request under a different name. Absent when the session's own name reached the provider unchanged. */
6176
- requestedModel: import_zod10.z.string().optional(),
6244
+ requestedModel: import_zod11.z.string().optional(),
6177
6245
  /** The distinct providers the choice could have landed on, present only when there was more than one, so a reader can tell a choice that crossed providers from one that stayed inside a single provider's lineup. */
6178
- candidateProviders: import_zod10.z.array(import_zod10.z.string()).optional(),
6179
- status: import_zod10.z.number().int(),
6246
+ candidateProviders: import_zod11.z.array(import_zod11.z.string()).optional(),
6247
+ status: import_zod11.z.number().int(),
6180
6248
  /** Milliseconds from the request's arrival to its response head. */
6181
- latencyMs: import_zod10.z.number().int().nonnegative(),
6249
+ latencyMs: import_zod11.z.number().int().nonnegative(),
6182
6250
  /** Milliseconds from the request's arrival to the end of its response body. */
6183
- durationMs: import_zod10.z.number().int().nonnegative(),
6251
+ durationMs: import_zod11.z.number().int().nonnegative(),
6184
6252
  /** Whether the client received the whole body. */
6185
- outcome: import_zod10.z.enum(["completed", "aborted"]),
6253
+ outcome: import_zod11.z.enum(["completed", "aborted"]),
6186
6254
  usage: TokenUsageSchema.optional(),
6187
6255
  /** The response's quota and rate-limit headers, by name (see `isRateLimitHeader`). */
6188
- rateLimitHeaders: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.string()).optional(),
6256
+ rateLimitHeaders: import_zod11.z.record(import_zod11.z.string(), import_zod11.z.string()).optional(),
6189
6257
  limit: LimitClassificationSchema.optional(),
6190
6258
  /** The upstream's request id (`request-id`), for matching a record to the provider's own logs. */
6191
- requestId: import_zod10.z.string().optional()
6259
+ requestId: import_zod11.z.string().optional()
6192
6260
  });
6193
- QuotaWindowSchema = import_zod10.z.strictObject({
6261
+ QuotaWindowSchema = import_zod11.z.strictObject({
6194
6262
  /** The fraction of the window used, as the upstream reports it (0 to 1). */
6195
- utilization: import_zod10.z.number().nonnegative().optional(),
6263
+ utilization: import_zod11.z.number().nonnegative().optional(),
6196
6264
  resetsAt: InstantSchema.optional(),
6197
6265
  /** The window's own status (`allowed`, `allowed_warning`, `rejected`). */
6198
- status: import_zod10.z.string().optional(),
6266
+ status: import_zod11.z.string().optional(),
6199
6267
  /** The fraction of the window's grace allowance used, while the upstream reports the window in grace (the five-hour window only). Requests are served beyond the window's own full mark while it grows, but refusals have been seen at a small value, so nothing ranks on it. */
6200
- graceUtilization: import_zod10.z.number().nonnegative().optional()
6268
+ graceUtilization: import_zod11.z.number().nonnegative().optional()
6201
6269
  });
6202
- ExtraUsageSpendSchema = import_zod10.z.strictObject({
6270
+ ExtraUsageSpendSchema = import_zod11.z.strictObject({
6203
6271
  /** Spent so far in the allowance's period, in the currency's minor units (pence, cents). */
6204
- usedMinor: import_zod10.z.number().nonnegative(),
6272
+ usedMinor: import_zod11.z.number().nonnegative(),
6205
6273
  /** The allowance's cap in the same units, when it has one. */
6206
- limitMinor: import_zod10.z.number().nonnegative().optional(),
6274
+ limitMinor: import_zod11.z.number().nonnegative().optional(),
6207
6275
  /** The ISO 4217 currency code. */
6208
- currency: import_zod10.z.string()
6276
+ currency: import_zod11.z.string()
6209
6277
  });
6210
- UnifiedRateLimitSchema = import_zod10.z.strictObject({
6278
+ UnifiedRateLimitSchema = import_zod11.z.strictObject({
6211
6279
  /** The overall status: `allowed`, `allowed_warning` or `rejected`. */
6212
- status: import_zod10.z.string().optional(),
6280
+ status: import_zod11.z.string().optional(),
6213
6281
  fiveHour: QuotaWindowSchema.optional(),
6214
6282
  sevenDay: QuotaWindowSchema.optional(),
6215
6283
  /** The weekly window of the models whose usage may continue as extra usage (`7d_oi`), reported by some plans beside the all-models weekly window. */
6216
6284
  sevenDayOverageIncluded: QuotaWindowSchema.optional(),
6217
6285
  /** The window that currently binds. */
6218
- representativeClaim: import_zod10.z.string().optional(),
6286
+ representativeClaim: import_zod11.z.string().optional(),
6219
6287
  /** When the binding window resets. */
6220
6288
  resetAt: InstantSchema.optional(),
6221
6289
  /** Whether usage beyond the plan (extra usage) is available: `allowed` or `rejected`. */
6222
- overageStatus: import_zod10.z.string().optional(),
6290
+ overageStatus: import_zod11.z.string().optional(),
6223
6291
  /** The fraction of the extra-usage allowance used, as the upstream reports it (0 to 1). An account with no plan windows, such as an Enterprise one, is metered by this alone. */
6224
- overageUtilization: import_zod10.z.number().nonnegative().optional(),
6292
+ overageUtilization: import_zod11.z.number().nonnegative().optional(),
6225
6293
  /** When the extra-usage allowance resets. */
6226
6294
  overageResetsAt: InstantSchema.optional(),
6227
6295
  /** Why extra usage is unavailable, as the upstream names it (`out_of_credits`, for one). */
6228
- overageDisabledReason: import_zod10.z.string().optional(),
6296
+ overageDisabledReason: import_zod11.z.string().optional(),
6229
6297
  /** Whether the response was served on extra usage, as the upstream states it. */
6230
- overageInUse: import_zod10.z.boolean().optional(),
6298
+ overageInUse: import_zod11.z.boolean().optional(),
6231
6299
  /** The allowance in money, from the usage endpoint (the response headers state only the fraction). */
6232
6300
  extraUsageSpend: ExtraUsageSpendSchema.optional(),
6233
6301
  /** True when the upstream offers a fallback while a window is rejected: some requests, by model, are still served, though the rest are refused. */
6234
- fallbackAvailable: import_zod10.z.boolean().optional()
6302
+ fallbackAvailable: import_zod11.z.boolean().optional()
6235
6303
  });
6236
- RateLimitStateSchema = import_zod10.z.strictObject({
6304
+ RateLimitStateSchema = import_zod11.z.strictObject({
6237
6305
  observedAt: InstantSchema,
6238
6306
  /** Every quota and rate-limit header on that response, by name. */
6239
- headers: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.string()),
6307
+ headers: import_zod11.z.record(import_zod11.z.string(), import_zod11.z.string()),
6240
6308
  unified: UnifiedRateLimitSchema.optional(),
6241
6309
  /** When the usage endpoint last answered that it has no plan windows for the account, which a later response replaces. Its answer leaves the recorded `unified` state alone (a response's headers may be the only source of it), so this alone says the question was asked. */
6242
6310
  planWindowsUnavailableAt: InstantSchema.optional()
6243
6311
  });
6244
6312
  LimitEventSchema = LimitClassificationSchema.extend({
6245
6313
  observedAt: InstantSchema,
6246
- status: import_zod10.z.number().int()
6314
+ status: import_zod11.z.number().int()
6247
6315
  });
6248
- ProviderQuotaWindowSchema = import_zod10.z.strictObject({
6316
+ ProviderQuotaWindowSchema = import_zod11.z.strictObject({
6249
6317
  /** What the window measures, in the provider's terms (`tokens`, `tool-calls`). */
6250
- measures: import_zod10.z.string(),
6318
+ measures: import_zod11.z.string(),
6251
6319
  /** The window's length in milliseconds, when the provider's unit is one this project knows; absent for an unrecognised unit, with `period` carrying the raw code. */
6252
- periodMs: import_zod10.z.number().int().positive().optional(),
6320
+ periodMs: import_zod11.z.number().int().positive().optional(),
6253
6321
  /** The provider's own description of the period when `periodMs` could not be derived, such as `unit 4 x 1`. */
6254
- period: import_zod10.z.string().optional(),
6322
+ period: import_zod11.z.string().optional(),
6255
6323
  /** The fraction of the window used (0 to 1). */
6256
- utilization: import_zod10.z.number().nonnegative(),
6324
+ utilization: import_zod11.z.number().nonnegative(),
6257
6325
  resetsAt: InstantSchema.optional(),
6258
6326
  /** Absolute counts, when the provider reports them for this window. */
6259
- limit: import_zod10.z.number().nonnegative().optional(),
6260
- used: import_zod10.z.number().nonnegative().optional(),
6261
- remaining: import_zod10.z.number().nonnegative().optional()
6327
+ limit: import_zod11.z.number().nonnegative().optional(),
6328
+ used: import_zod11.z.number().nonnegative().optional(),
6329
+ remaining: import_zod11.z.number().nonnegative().optional()
6262
6330
  });
6263
- ProviderAccountSchema = import_zod10.z.strictObject({
6264
- email: import_zod10.z.string().optional(),
6265
- accountId: import_zod10.z.string().optional()
6331
+ ProviderAccountSchema = import_zod11.z.strictObject({
6332
+ email: import_zod11.z.string().optional(),
6333
+ accountId: import_zod11.z.string().optional()
6266
6334
  });
6267
- ProviderQuotaSchema = import_zod10.z.strictObject({
6335
+ ProviderQuotaSchema = import_zod11.z.strictObject({
6268
6336
  observedAt: InstantSchema,
6269
6337
  /** Which usage endpoint produced it (`z.ai`). */
6270
- source: import_zod10.z.string(),
6338
+ source: import_zod11.z.string(),
6271
6339
  /** The subscription level the endpoint reports, when it does. */
6272
- level: import_zod10.z.string().optional(),
6340
+ level: import_zod11.z.string().optional(),
6273
6341
  /** The account the provider's credential belongs to, when its endpoint reports it. */
6274
6342
  account: ProviderAccountSchema.optional(),
6275
- windows: import_zod10.z.array(ProviderQuotaWindowSchema)
6343
+ windows: import_zod11.z.array(ProviderQuotaWindowSchema)
6276
6344
  });
6277
- ProviderUsageStateSchema = import_zod10.z.strictObject({
6345
+ ProviderUsageStateSchema = import_zod11.z.strictObject({
6278
6346
  /** When the provider last served a request for the identity through the front door. Absent while the state holds only a rate-limit state fetched from the provider's usage endpoint, for an identity that has made no request. */
6279
6347
  lastRequestAt: InstantSchema.optional(),
6280
- lastStatus: import_zod10.z.number().int().optional(),
6281
- lastModel: import_zod10.z.string().optional(),
6348
+ lastStatus: import_zod11.z.number().int().optional(),
6349
+ lastModel: import_zod11.z.string().optional(),
6282
6350
  /** The latest rate-limit state, from the last response that carried any rate-limit header. */
6283
6351
  rateLimit: RateLimitStateSchema.optional(),
6284
6352
  /** The latest classified refusal. It stays after later successes, so a reader compares its `resetAt` (or `observedAt` plus `retryAfterSeconds`) with the current time. */
@@ -6286,31 +6354,31 @@ var init_schema2 = __esm({
6286
6354
  /** The latest quota the provider's usage endpoint reported, for providers whose quota is not visible in response headers. */
6287
6355
  quota: ProviderQuotaSchema.optional()
6288
6356
  });
6289
- AccountMetadataSchema = import_zod10.z.strictObject({
6290
- accountUuid: import_zod10.z.string().optional(),
6291
- emailAddress: import_zod10.z.string().optional(),
6292
- displayName: import_zod10.z.string().optional(),
6293
- organizationUuid: import_zod10.z.string().optional(),
6294
- organizationName: import_zod10.z.string().optional(),
6295
- organizationType: import_zod10.z.string().optional(),
6296
- organizationRole: import_zod10.z.string().optional(),
6297
- workspaceRole: import_zod10.z.string().optional(),
6298
- billingType: import_zod10.z.string().optional(),
6299
- seatTier: import_zod10.z.string().optional(),
6300
- organizationRateLimitTier: import_zod10.z.string().optional(),
6301
- userRateLimitTier: import_zod10.z.string().optional(),
6302
- hasExtraUsageEnabled: import_zod10.z.boolean().optional(),
6303
- subscriptionCreatedAt: import_zod10.z.string().optional(),
6304
- accountCreatedAt: import_zod10.z.string().optional()
6357
+ AccountMetadataSchema = import_zod11.z.strictObject({
6358
+ accountUuid: import_zod11.z.string().optional(),
6359
+ emailAddress: import_zod11.z.string().optional(),
6360
+ displayName: import_zod11.z.string().optional(),
6361
+ organizationUuid: import_zod11.z.string().optional(),
6362
+ organizationName: import_zod11.z.string().optional(),
6363
+ organizationType: import_zod11.z.string().optional(),
6364
+ organizationRole: import_zod11.z.string().optional(),
6365
+ workspaceRole: import_zod11.z.string().optional(),
6366
+ billingType: import_zod11.z.string().optional(),
6367
+ seatTier: import_zod11.z.string().optional(),
6368
+ organizationRateLimitTier: import_zod11.z.string().optional(),
6369
+ userRateLimitTier: import_zod11.z.string().optional(),
6370
+ hasExtraUsageEnabled: import_zod11.z.boolean().optional(),
6371
+ subscriptionCreatedAt: import_zod11.z.string().optional(),
6372
+ accountCreatedAt: import_zod11.z.string().optional()
6305
6373
  });
6306
- UsageSnapshotSchema = import_zod10.z.strictObject({
6374
+ UsageSnapshotSchema = import_zod11.z.strictObject({
6307
6375
  schemaVersion: VersionSchema,
6308
- identity: import_zod10.z.string(),
6376
+ identity: import_zod11.z.string(),
6309
6377
  updatedAt: InstantSchema,
6310
6378
  /** The identity's account metadata as of `updatedAt`. */
6311
6379
  account: AccountMetadataSchema.optional(),
6312
6380
  /** Latest state per provider, keyed by provider name (`anthropic` for OAuth sessions). */
6313
- providers: import_zod10.z.record(import_zod10.z.string(), ProviderUsageStateSchema)
6381
+ providers: import_zod11.z.record(import_zod11.z.string(), ProviderUsageStateSchema)
6314
6382
  });
6315
6383
  }
6316
6384
  });
@@ -6419,24 +6487,24 @@ function planOf(account) {
6419
6487
  }
6420
6488
  return { kind: "subscription", capacity: 1, recognised: BASE_TIER.test(tier), ...tierField };
6421
6489
  }
6422
- var import_zod11, PlanClassSchema, TIER_MULTIPLIER, ZERO_TIER, BASE_TIER;
6490
+ var import_zod12, PlanClassSchema, TIER_MULTIPLIER, ZERO_TIER, BASE_TIER;
6423
6491
  var init_plan2 = __esm({
6424
6492
  "src/usage/plan.ts"() {
6425
6493
  "use strict";
6426
- import_zod11 = require("zod");
6427
- PlanClassSchema = import_zod11.z.union([
6428
- import_zod11.z.strictObject({
6429
- kind: import_zod11.z.literal("subscription"),
6494
+ import_zod12 = require("zod");
6495
+ PlanClassSchema = import_zod12.z.union([
6496
+ import_zod12.z.strictObject({
6497
+ kind: import_zod12.z.literal("subscription"),
6430
6498
  /** The plan's size as a multiple of the smallest subscription tier (Max 5x is 5, Max 20x is 20). */
6431
- capacity: import_zod11.z.number().positive(),
6499
+ capacity: import_zod12.z.number().positive(),
6432
6500
  /** False when the tier string named no multiplier and no tier this project knows, so `capacity` is the neutral 1 rather than a reading. */
6433
- recognised: import_zod11.z.boolean(),
6501
+ recognised: import_zod12.z.boolean(),
6434
6502
  /** The tier string the classification rests on, when the account had one. */
6435
- tier: import_zod11.z.string().optional()
6503
+ tier: import_zod12.z.string().optional()
6436
6504
  }),
6437
- import_zod11.z.strictObject({
6438
- kind: import_zod11.z.literal("pay-per-use"),
6439
- tier: import_zod11.z.string().optional()
6505
+ import_zod12.z.strictObject({
6506
+ kind: import_zod12.z.literal("pay-per-use"),
6507
+ tier: import_zod12.z.string().optional()
6440
6508
  })
6441
6509
  ]);
6442
6510
  TIER_MULTIPLIER = /(?:^|_)(\d+)x$/;
@@ -6537,21 +6605,21 @@ var init_rateLimit = __esm({
6537
6605
  });
6538
6606
 
6539
6607
  // src/usage/scan.ts
6540
- var import_zod12, AnthropicUsageSchema, ErrorObjectSchema;
6608
+ var import_zod13, AnthropicUsageSchema, ErrorObjectSchema;
6541
6609
  var init_scan = __esm({
6542
6610
  "src/usage/scan.ts"() {
6543
6611
  "use strict";
6544
- import_zod12 = require("zod");
6545
- AnthropicUsageSchema = import_zod12.z.looseObject({
6546
- input_tokens: import_zod12.z.number().int().nonnegative().nullish(),
6547
- output_tokens: import_zod12.z.number().int().nonnegative().nullish(),
6548
- cache_creation_input_tokens: import_zod12.z.number().int().nonnegative().nullish(),
6549
- cache_read_input_tokens: import_zod12.z.number().int().nonnegative().nullish()
6612
+ import_zod13 = require("zod");
6613
+ AnthropicUsageSchema = import_zod13.z.looseObject({
6614
+ input_tokens: import_zod13.z.number().int().nonnegative().nullish(),
6615
+ output_tokens: import_zod13.z.number().int().nonnegative().nullish(),
6616
+ cache_creation_input_tokens: import_zod13.z.number().int().nonnegative().nullish(),
6617
+ cache_read_input_tokens: import_zod13.z.number().int().nonnegative().nullish()
6550
6618
  });
6551
- ErrorObjectSchema = import_zod12.z.looseObject({
6552
- type: import_zod12.z.string().optional(),
6553
- code: import_zod12.z.union([import_zod12.z.string(), import_zod12.z.number()]).optional(),
6554
- message: import_zod12.z.string().optional()
6619
+ ErrorObjectSchema = import_zod13.z.looseObject({
6620
+ type: import_zod13.z.string().optional(),
6621
+ code: import_zod13.z.union([import_zod13.z.string(), import_zod13.z.number()]).optional(),
6622
+ message: import_zod13.z.string().optional()
6555
6623
  });
6556
6624
  }
6557
6625
  });
@@ -7322,12 +7390,12 @@ function recordStickyPick(fs14, picksFile, directory, identity, nowMs) {
7322
7390
  fs14.writeFilePrivate(picksFile, `${JSON.stringify(next, null, 2)}
7323
7391
  `);
7324
7392
  }
7325
- var import_node_path21, import_zod13, PoolGraphError, SCHEMA_VERSION, PickEntrySchema, PicksFileSchema;
7393
+ var import_node_path21, import_zod14, PoolGraphError, SCHEMA_VERSION, PickEntrySchema, PicksFileSchema;
7326
7394
  var init_poolPick = __esm({
7327
7395
  "src/usage/poolPick.ts"() {
7328
7396
  "use strict";
7329
7397
  import_node_path21 = __toESM(require("node:path"), 1);
7330
- import_zod13 = require("zod");
7398
+ import_zod14 = require("zod");
7331
7399
  init_cliError();
7332
7400
  init_identity();
7333
7401
  init_schema();
@@ -7343,10 +7411,10 @@ var init_poolPick = __esm({
7343
7411
  }
7344
7412
  };
7345
7413
  SCHEMA_VERSION = 1;
7346
- PickEntrySchema = import_zod13.z.strictObject({ identity: import_zod13.z.string().min(1), at: import_zod13.z.iso.datetime() });
7347
- PicksFileSchema = import_zod13.z.strictObject({
7348
- schemaVersion: import_zod13.z.literal(SCHEMA_VERSION),
7349
- picks: import_zod13.z.record(import_zod13.z.string().min(1), PickEntrySchema)
7414
+ PickEntrySchema = import_zod14.z.strictObject({ identity: import_zod14.z.string().min(1), at: import_zod14.z.iso.datetime() });
7415
+ PicksFileSchema = import_zod14.z.strictObject({
7416
+ schemaVersion: import_zod14.z.literal(SCHEMA_VERSION),
7417
+ picks: import_zod14.z.record(import_zod14.z.string().min(1), PickEntrySchema)
7350
7418
  });
7351
7419
  }
7352
7420
  });
@@ -7450,6 +7518,17 @@ function removeProfile(paths, name) {
7450
7518
  requireProfileExists(paths, name);
7451
7519
  import_node_fs3.default.rmSync(profileJsonPath(paths, name));
7452
7520
  }
7521
+ function withStatuslineChange(existing, change) {
7522
+ const merged = new Map(Object.entries({ ...existing }));
7523
+ for (const [key, value] of Object.entries(change)) {
7524
+ if (value === false) {
7525
+ merged.delete(key);
7526
+ } else {
7527
+ merged.set(key, value);
7528
+ }
7529
+ }
7530
+ return merged.size === 0 ? void 0 : StatuslineSchema.parse(Object.fromEntries(merged));
7531
+ }
7453
7532
  function applyProfileChange(paths, name, change) {
7454
7533
  let touched = false;
7455
7534
  if (change.category !== void 0) {
@@ -7498,6 +7577,9 @@ function applyProfileChange(paths, name, change) {
7498
7577
  if (change.launchExplain !== void 0) {
7499
7578
  launchPatch.explain = change.launchExplain;
7500
7579
  }
7580
+ if (change.launchStatusline !== void 0) {
7581
+ launchPatch.statusline = withStatuslineChange(readProfile(paths, name)?.launch?.statusline, change.launchStatusline);
7582
+ }
7501
7583
  if (Object.keys(launchPatch).length > 0) {
7502
7584
  setProfileLaunchFlags(paths, name, launchPatch);
7503
7585
  touched = true;
@@ -7513,6 +7595,7 @@ var init_configProfilesStore = __esm({
7513
7595
  init_store();
7514
7596
  init_schema();
7515
7597
  init_cliError();
7598
+ init_statusline();
7516
7599
  init_load();
7517
7600
  ProfileNotFoundError = class extends CliError {
7518
7601
  constructor(profileName) {
@@ -7684,17 +7767,17 @@ function formatCachedCredentialState(state) {
7684
7767
  }
7685
7768
  return state.status === "fresh" ? `${age}, expires in ${formatAge(state.expiresInMs)}` : `${age}, expired ${formatAge(-state.expiresInMs)} ago`;
7686
7769
  }
7687
- var import_zod14, MS_PER_UNIT, CachedCredentialSchema;
7770
+ var import_zod15, MS_PER_UNIT, CachedCredentialSchema;
7688
7771
  var init_credentialCache = __esm({
7689
7772
  "src/credentialCache.ts"() {
7690
7773
  "use strict";
7691
- import_zod14 = require("zod");
7774
+ import_zod15 = require("zod");
7692
7775
  init_schema();
7693
7776
  init_preflight();
7694
7777
  MS_PER_UNIT = { s: 1e3, m: 6e4, h: 36e5, d: 864e5 };
7695
- CachedCredentialSchema = import_zod14.z.strictObject({
7696
- token: import_zod14.z.string().min(1),
7697
- fetchedAt: import_zod14.z.number().int().nonnegative(),
7778
+ CachedCredentialSchema = import_zod15.z.strictObject({
7779
+ token: import_zod15.z.string().min(1),
7780
+ fetchedAt: import_zod15.z.number().int().nonnegative(),
7698
7781
  source: CredentialSourceSchema
7699
7782
  });
7700
7783
  }
@@ -7817,15 +7900,15 @@ function aliasFindings(aliases, providerNames) {
7817
7900
  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.` };
7818
7901
  });
7819
7902
  }
7820
- var import_zod15, ProviderAliasesSchema;
7903
+ var import_zod16, ProviderAliasesSchema;
7821
7904
  var init_providerAliases = __esm({
7822
7905
  "src/providerAliases.ts"() {
7823
7906
  "use strict";
7824
- import_zod15 = require("zod");
7907
+ import_zod16 = require("zod");
7825
7908
  init_cliError();
7826
7909
  init_load();
7827
7910
  init_store();
7828
- ProviderAliasesSchema = import_zod15.z.record(import_zod15.z.string().min(1), import_zod15.z.string().min(1));
7911
+ ProviderAliasesSchema = import_zod16.z.record(import_zod16.z.string().min(1), import_zod16.z.string().min(1));
7829
7912
  }
7830
7913
  });
7831
7914
 
@@ -8881,21 +8964,21 @@ function findPathShadow(params) {
8881
8964
  }
8882
8965
  return params.pathDirs.some((dir) => import_node_path28.default.resolve(dir) === resolvedTargetDir) ? { status: "ok" } : { status: "not-on-path" };
8883
8966
  }
8884
- var import_node_fs7, import_node_path28, import_zod20, ClaudeShimStateSchema, nodeLinkFs;
8967
+ var import_node_fs7, import_node_path28, import_zod21, ClaudeShimStateSchema, nodeLinkFs;
8885
8968
  var init_claudeShim = __esm({
8886
8969
  "src/claudeShim.ts"() {
8887
8970
  "use strict";
8888
8971
  import_node_fs7 = __toESM(require("node:fs"), 1);
8889
8972
  import_node_path28 = __toESM(require("node:path"), 1);
8890
- import_zod20 = require("zod");
8973
+ import_zod21 = require("zod");
8891
8974
  init_commandDeps();
8892
8975
  init_store();
8893
8976
  init_realPorts();
8894
8977
  init_cliError();
8895
- ClaudeShimStateSchema = import_zod20.z.strictObject({
8896
- targetPath: import_zod20.z.string().min(1),
8897
- method: import_zod20.z.enum(["hardlink", "copy"]),
8898
- installedAtMs: import_zod20.z.number()
8978
+ ClaudeShimStateSchema = import_zod21.z.strictObject({
8979
+ targetPath: import_zod21.z.string().min(1),
8980
+ method: import_zod21.z.enum(["hardlink", "copy"]),
8981
+ installedAtMs: import_zod21.z.number()
8899
8982
  });
8900
8983
  nodeLinkFs = { link: import_node_fs7.default.linkSync, copyFile: import_node_fs7.default.copyFileSync, chmod: import_node_fs7.default.chmodSync };
8901
8984
  }
@@ -8991,62 +9074,62 @@ var init_signatures = __esm({
8991
9074
  });
8992
9075
 
8993
9076
  // src/codex/anthropic.ts
8994
- var import_zod24, TextBlockSchema, Base64ImageSourceSchema, UrlImageSourceSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultContentBlockSchema, ToolResultBlockSchema, OtherBlockSchema, ContentBlockSchema, MessageSchema, ToolSchema, ToolChoiceSchema, SystemSchema, MessagesRequestSchema, CountTokensRequestSchema;
9077
+ var import_zod25, TextBlockSchema, Base64ImageSourceSchema, UrlImageSourceSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultContentBlockSchema, ToolResultBlockSchema, OtherBlockSchema, ContentBlockSchema, MessageSchema, ToolSchema, ToolChoiceSchema, SystemSchema, MessagesRequestSchema, CountTokensRequestSchema;
8995
9078
  var init_anthropic = __esm({
8996
9079
  "src/codex/anthropic.ts"() {
8997
9080
  "use strict";
8998
- import_zod24 = require("zod");
8999
- TextBlockSchema = import_zod24.z.looseObject({ type: import_zod24.z.literal("text"), text: import_zod24.z.string() });
9000
- Base64ImageSourceSchema = import_zod24.z.looseObject({ type: import_zod24.z.literal("base64"), media_type: import_zod24.z.string().min(1), data: import_zod24.z.string() });
9001
- UrlImageSourceSchema = import_zod24.z.looseObject({ type: import_zod24.z.literal("url"), url: import_zod24.z.string().min(1) });
9002
- ImageBlockSchema = import_zod24.z.looseObject({
9003
- type: import_zod24.z.literal("image"),
9004
- source: import_zod24.z.union([Base64ImageSourceSchema, UrlImageSourceSchema])
9081
+ import_zod25 = require("zod");
9082
+ TextBlockSchema = import_zod25.z.looseObject({ type: import_zod25.z.literal("text"), text: import_zod25.z.string() });
9083
+ Base64ImageSourceSchema = import_zod25.z.looseObject({ type: import_zod25.z.literal("base64"), media_type: import_zod25.z.string().min(1), data: import_zod25.z.string() });
9084
+ UrlImageSourceSchema = import_zod25.z.looseObject({ type: import_zod25.z.literal("url"), url: import_zod25.z.string().min(1) });
9085
+ ImageBlockSchema = import_zod25.z.looseObject({
9086
+ type: import_zod25.z.literal("image"),
9087
+ source: import_zod25.z.union([Base64ImageSourceSchema, UrlImageSourceSchema])
9005
9088
  });
9006
- ToolUseBlockSchema = import_zod24.z.looseObject({
9007
- type: import_zod24.z.literal("tool_use"),
9008
- id: import_zod24.z.string().min(1),
9009
- name: import_zod24.z.string().min(1),
9010
- input: import_zod24.z.unknown()
9089
+ ToolUseBlockSchema = import_zod25.z.looseObject({
9090
+ type: import_zod25.z.literal("tool_use"),
9091
+ id: import_zod25.z.string().min(1),
9092
+ name: import_zod25.z.string().min(1),
9093
+ input: import_zod25.z.unknown()
9011
9094
  });
9012
- ToolResultContentBlockSchema = import_zod24.z.union([TextBlockSchema, import_zod24.z.looseObject({ type: import_zod24.z.string() })]);
9013
- ToolResultBlockSchema = import_zod24.z.looseObject({
9014
- type: import_zod24.z.literal("tool_result"),
9015
- tool_use_id: import_zod24.z.string().min(1),
9016
- content: import_zod24.z.union([import_zod24.z.string(), import_zod24.z.array(ToolResultContentBlockSchema)]).optional()
9095
+ ToolResultContentBlockSchema = import_zod25.z.union([TextBlockSchema, import_zod25.z.looseObject({ type: import_zod25.z.string() })]);
9096
+ ToolResultBlockSchema = import_zod25.z.looseObject({
9097
+ type: import_zod25.z.literal("tool_result"),
9098
+ tool_use_id: import_zod25.z.string().min(1),
9099
+ content: import_zod25.z.union([import_zod25.z.string(), import_zod25.z.array(ToolResultContentBlockSchema)]).optional()
9017
9100
  });
9018
- OtherBlockSchema = import_zod24.z.looseObject({ type: import_zod24.z.string() });
9019
- ContentBlockSchema = import_zod24.z.union([TextBlockSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultBlockSchema, OtherBlockSchema]);
9020
- MessageSchema = import_zod24.z.looseObject({
9021
- role: import_zod24.z.enum(["user", "assistant", "system"]),
9022
- content: import_zod24.z.union([import_zod24.z.string(), import_zod24.z.array(ContentBlockSchema)])
9101
+ OtherBlockSchema = import_zod25.z.looseObject({ type: import_zod25.z.string() });
9102
+ ContentBlockSchema = import_zod25.z.union([TextBlockSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultBlockSchema, OtherBlockSchema]);
9103
+ MessageSchema = import_zod25.z.looseObject({
9104
+ role: import_zod25.z.enum(["user", "assistant", "system"]),
9105
+ content: import_zod25.z.union([import_zod25.z.string(), import_zod25.z.array(ContentBlockSchema)])
9023
9106
  });
9024
- ToolSchema = import_zod24.z.looseObject({
9025
- name: import_zod24.z.string().min(1),
9026
- description: import_zod24.z.string().optional(),
9027
- input_schema: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.unknown()).optional()
9107
+ ToolSchema = import_zod25.z.looseObject({
9108
+ name: import_zod25.z.string().min(1),
9109
+ description: import_zod25.z.string().optional(),
9110
+ input_schema: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.unknown()).optional()
9028
9111
  });
9029
- ToolChoiceSchema = import_zod24.z.union([
9030
- import_zod24.z.looseObject({ type: import_zod24.z.enum(["auto", "none", "any"]) }),
9031
- import_zod24.z.looseObject({ type: import_zod24.z.literal("tool"), name: import_zod24.z.string().min(1) })
9112
+ ToolChoiceSchema = import_zod25.z.union([
9113
+ import_zod25.z.looseObject({ type: import_zod25.z.enum(["auto", "none", "any"]) }),
9114
+ import_zod25.z.looseObject({ type: import_zod25.z.literal("tool"), name: import_zod25.z.string().min(1) })
9032
9115
  ]);
9033
- SystemSchema = import_zod24.z.union([import_zod24.z.string(), import_zod24.z.array(import_zod24.z.union([TextBlockSchema, OtherBlockSchema]))]);
9034
- MessagesRequestSchema = import_zod24.z.looseObject({
9035
- model: import_zod24.z.string().optional(),
9116
+ SystemSchema = import_zod25.z.union([import_zod25.z.string(), import_zod25.z.array(import_zod25.z.union([TextBlockSchema, OtherBlockSchema]))]);
9117
+ MessagesRequestSchema = import_zod25.z.looseObject({
9118
+ model: import_zod25.z.string().optional(),
9036
9119
  system: SystemSchema.optional(),
9037
- messages: import_zod24.z.array(MessageSchema),
9038
- tools: import_zod24.z.array(ToolSchema).optional(),
9120
+ messages: import_zod25.z.array(MessageSchema),
9121
+ tools: import_zod25.z.array(ToolSchema).optional(),
9039
9122
  tool_choice: ToolChoiceSchema.optional(),
9040
- stream: import_zod24.z.boolean().optional(),
9123
+ stream: import_zod25.z.boolean().optional(),
9041
9124
  /** `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. */
9042
- metadata: import_zod24.z.looseObject({ user_id: import_zod24.z.string().optional() }).optional(),
9125
+ metadata: import_zod25.z.looseObject({ user_id: import_zod25.z.string().optional() }).optional(),
9043
9126
  /** Claude Code's effort setting. Any string is accepted; the translator honours only the levels the backend understands. */
9044
- output_config: import_zod24.z.looseObject({ effort: import_zod24.z.string().optional() }).optional()
9127
+ output_config: import_zod25.z.looseObject({ effort: import_zod25.z.string().optional() }).optional()
9045
9128
  });
9046
- CountTokensRequestSchema = import_zod24.z.looseObject({
9047
- system: import_zod24.z.unknown().optional(),
9048
- messages: import_zod24.z.unknown().optional(),
9049
- tools: import_zod24.z.unknown().optional()
9129
+ CountTokensRequestSchema = import_zod25.z.looseObject({
9130
+ system: import_zod25.z.unknown().optional(),
9131
+ messages: import_zod25.z.unknown().optional(),
9132
+ tools: import_zod25.z.unknown().optional()
9050
9133
  });
9051
9134
  }
9052
9135
  });
@@ -9148,13 +9231,13 @@ function filterCatalogue(models, catalogue) {
9148
9231
  const excluded = catalogue.exclude === void 0 ? void 0 : (0, import_picomatch4.default)(catalogue.exclude, { dot: true });
9149
9232
  return models.filter((model) => included?.(model.id) !== false && excluded?.(model.id) !== true);
9150
9233
  }
9151
- var import_node_path30, import_picomatch4, import_zod25, DEFAULT_CANDIDATE_URLS, MS_PER_SECOND5, SECONDS_PER_HOUR2, HOURS_PER_DAY5, MS_PER_HOUR4, HOURS_BETWEEN_RETRIES, CATALOGUE_MAX_AGE_MS, CATALOGUE_RETRY_MS, CATALOGUE_REQUEST_SECONDS, CATALOGUE_REQUEST_TIMEOUT_MS, CATALOGUE_REFRESH_TIMEOUT_MS, CatalogueModelSchema, CatalogueCacheSchema;
9234
+ var import_node_path30, import_picomatch4, import_zod26, DEFAULT_CANDIDATE_URLS, MS_PER_SECOND5, SECONDS_PER_HOUR2, HOURS_PER_DAY5, MS_PER_HOUR4, HOURS_BETWEEN_RETRIES, CATALOGUE_MAX_AGE_MS, CATALOGUE_RETRY_MS, CATALOGUE_REQUEST_SECONDS, CATALOGUE_REQUEST_TIMEOUT_MS, CATALOGUE_REFRESH_TIMEOUT_MS, CatalogueModelSchema, CatalogueCacheSchema;
9152
9235
  var init_providerCatalogue = __esm({
9153
9236
  "src/providerCatalogue.ts"() {
9154
9237
  "use strict";
9155
9238
  import_node_path30 = __toESM(require("node:path"), 1);
9156
9239
  import_picomatch4 = __toESM(require("picomatch"), 1);
9157
- import_zod25 = require("zod");
9240
+ import_zod26 = require("zod");
9158
9241
  DEFAULT_CANDIDATE_URLS = 2;
9159
9242
  MS_PER_SECOND5 = 1e3;
9160
9243
  SECONDS_PER_HOUR2 = 3600;
@@ -9166,8 +9249,8 @@ var init_providerCatalogue = __esm({
9166
9249
  CATALOGUE_REQUEST_SECONDS = 10;
9167
9250
  CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND5;
9168
9251
  CATALOGUE_REFRESH_TIMEOUT_MS = DEFAULT_CANDIDATE_URLS * CATALOGUE_REQUEST_TIMEOUT_MS;
9169
- CatalogueModelSchema = import_zod25.z.strictObject({ id: import_zod25.z.string().min(1), name: import_zod25.z.string().min(1).optional() });
9170
- CatalogueCacheSchema = import_zod25.z.strictObject({ fetchedAt: import_zod25.z.number(), url: import_zod25.z.string().min(1), models: import_zod25.z.array(CatalogueModelSchema) });
9252
+ CatalogueModelSchema = import_zod26.z.strictObject({ id: import_zod26.z.string().min(1), name: import_zod26.z.string().min(1).optional() });
9253
+ CatalogueCacheSchema = import_zod26.z.strictObject({ fetchedAt: import_zod26.z.number(), url: import_zod26.z.string().min(1), models: import_zod26.z.array(CatalogueModelSchema) });
9171
9254
  }
9172
9255
  });
9173
9256
 
@@ -9998,8 +10081,39 @@ var init_headers = __esm({
9998
10081
  }
9999
10082
  });
10000
10083
 
10084
+ // src/statusline/settings.ts
10085
+ function checkedStatusline(settings, source) {
10086
+ try {
10087
+ resolveStatusline(settings);
10088
+ } catch (error) {
10089
+ throw new UsageError(`${source}: ${error instanceof Error ? error.message : String(error)}.`);
10090
+ }
10091
+ return settings;
10092
+ }
10093
+ function statuslineSettingsFromEnv(raw, source) {
10094
+ let parsed;
10095
+ try {
10096
+ parsed = JSON.parse(raw);
10097
+ } catch {
10098
+ throw new UsageError(`${source}: not valid JSON.`);
10099
+ }
10100
+ const result = StatuslineSchema.safeParse(parsed);
10101
+ if (!result.success) {
10102
+ throw new UsageError(`${source}: ${result.error.issues.map((issue) => `${issue.path.join(".") || "(root)"}: ${issue.message}`).join("; ")}.`);
10103
+ }
10104
+ return checkedStatusline(result.data, source);
10105
+ }
10106
+ var init_settings2 = __esm({
10107
+ "src/statusline/settings.ts"() {
10108
+ "use strict";
10109
+ init_cliError();
10110
+ init_statusline();
10111
+ }
10112
+ });
10113
+
10001
10114
  // src/launcher/flags.ts
10002
10115
  function resolveLaunchFlags(params) {
10116
+ const statusline = resolveStatuslineSettings(params);
10003
10117
  return {
10004
10118
  skipPermissions: params.flags?.skipPermissions ?? parseEnvBool("AGENT_SHIM_SKIP_PERMISSIONS", params.env.AGENT_SHIM_SKIP_PERMISSIONS) ?? params.cascade?.skipPermissions ?? false,
10005
10119
  remoteControl: params.flags?.remoteControl ?? parseEnvBool("AGENT_SHIM_REMOTE_CONTROL", params.env.AGENT_SHIM_REMOTE_CONTROL) ?? params.cascade?.remoteControl ?? false,
@@ -10008,9 +10122,17 @@ function resolveLaunchFlags(params) {
10008
10122
  pause: params.flags?.pause ?? parseEnvBool("AGENT_SHIM_PAUSE", params.env.AGENT_SHIM_PAUSE) ?? params.cascade?.pause ?? false,
10009
10123
  explain: params.flags?.explain ?? parseEnvBool("AGENT_SHIM_EXPLAIN", params.env.AGENT_SHIM_EXPLAIN) ?? params.cascade?.explain ?? false,
10010
10124
  delayMs: resolveDelayMs(params),
10011
- proxyBypass: resolveProxyBypass(params)
10125
+ proxyBypass: resolveProxyBypass(params),
10126
+ ...statusline === void 0 ? {} : { statusline }
10012
10127
  };
10013
10128
  }
10129
+ function resolveStatuslineSettings(params) {
10130
+ const fromEnv = params.env[STATUSLINE_ENV] === "" ? void 0 : params.env[STATUSLINE_ENV];
10131
+ if (fromEnv !== void 0) {
10132
+ return statuslineSettingsFromEnv(fromEnv, STATUSLINE_ENV);
10133
+ }
10134
+ return params.cascade?.statusline === void 0 ? void 0 : checkedStatusline(params.cascade.statusline, "launch.statusline");
10135
+ }
10014
10136
  function resolveProxyBypass(params) {
10015
10137
  const fromEnv = params.env.AGENT_SHIM_PROXY_BYPASS === "" ? void 0 : params.env.AGENT_SHIM_PROXY_BYPASS;
10016
10138
  return fromEnv !== void 0 ? checkedProxyBypass(fromEnv.split(",").map((entry) => entry.trim()), "AGENT_SHIM_PROXY_BYPASS") : checkedProxyBypass(params.cascade?.proxyBypass ?? [], "launch.proxyBypass");
@@ -10094,6 +10216,9 @@ function buildEnv(params) {
10094
10216
  env.NO_PROXY = withBypassHosts(env.NO_PROXY, bypassed);
10095
10217
  env.no_proxy = withBypassHosts(env.no_proxy, bypassed);
10096
10218
  }
10219
+ if (params.statusline !== void 0) {
10220
+ env[STATUSLINE_ENV] = JSON.stringify(params.statusline);
10221
+ }
10097
10222
  return env;
10098
10223
  }
10099
10224
  var import_node_path37, LOOPBACK_HOSTS, PROVIDER_SESSION_PLACEHOLDER;
@@ -10109,6 +10234,8 @@ var init_flags = __esm({
10109
10234
  init_headers();
10110
10235
  init_capability();
10111
10236
  init_route();
10237
+ init_statusline();
10238
+ init_settings2();
10112
10239
  init_proxyBypass2();
10113
10240
  LOOPBACK_HOSTS = ["127.0.0.1", "localhost", "::1"];
10114
10241
  PROVIDER_SESSION_PLACEHOLDER = "agent-shim-provider-session";
@@ -11028,7 +11155,8 @@ function prepareLaunch(params) {
11028
11155
  sessionId,
11029
11156
  remoteControl: resolvedFlags.remoteControl,
11030
11157
  ...decided.models?.tiers === void 0 ? {} : { tierModels: decided.models.tiers },
11031
- proxyBypass: resolvedFlags.proxyBypass
11158
+ proxyBypass: resolvedFlags.proxyBypass,
11159
+ ...resolvedFlags.statusline === void 0 ? {} : { statusline: resolvedFlags.statusline }
11032
11160
  });
11033
11161
  const releases = [...headroom === void 0 || headroomPort === void 0 ? [] : [headroomPort.release], ...frontDoorRelease === void 0 ? [] : [frontDoorRelease]];
11034
11162
  const release = () => {
@@ -11056,7 +11184,8 @@ function resolveLaunch(params) {
11056
11184
  ...decided.flags.headroom ? { headroom: { socketPath: "", projectId: "" } } : {},
11057
11185
  sessionId: "",
11058
11186
  remoteControl: decided.flags.remoteControl,
11059
- proxyBypass: decided.flags.proxyBypass
11187
+ proxyBypass: decided.flags.proxyBypass,
11188
+ ...decided.flags.statusline === void 0 ? {} : { statusline: decided.flags.statusline }
11060
11189
  });
11061
11190
  const credentialNames = decided.identityCredentialBlock === void 0 ? [] : Object.keys(credentialVariables(decided.identityCredentialBlock.target ?? "bearer", ""));
11062
11191
  const environment = [.../* @__PURE__ */ new Set([...Object.keys(built).filter((name) => built[name] !== env[name]), ...credentialNames])].sort();
@@ -11619,11 +11748,11 @@ var init_identityClaude = __esm({
11619
11748
  });
11620
11749
 
11621
11750
  // src/usage/providerQuota.ts
11622
- var import_zod32, 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;
11751
+ var import_zod33, 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;
11623
11752
  var init_providerQuota = __esm({
11624
11753
  "src/usage/providerQuota.ts"() {
11625
11754
  "use strict";
11626
- import_zod32 = require("zod");
11755
+ import_zod33 = require("zod");
11627
11756
  init_cloudUpstream();
11628
11757
  init_schema2();
11629
11758
  MS_PER_SECOND9 = 1e3;
@@ -11638,35 +11767,35 @@ var init_providerQuota = __esm({
11638
11767
  [ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND9],
11639
11768
  [ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9]
11640
11769
  ]);
11641
- ZaiLimitSchema = import_zod32.z.object({
11642
- type: import_zod32.z.string(),
11643
- unit: import_zod32.z.number().int(),
11644
- number: import_zod32.z.number().int().positive(),
11645
- percentage: import_zod32.z.number().nonnegative(),
11646
- nextResetTime: import_zod32.z.number().positive().optional(),
11647
- usage: import_zod32.z.number().nonnegative().optional(),
11648
- currentValue: import_zod32.z.number().nonnegative().optional(),
11649
- remaining: import_zod32.z.number().nonnegative().optional()
11770
+ ZaiLimitSchema = import_zod33.z.object({
11771
+ type: import_zod33.z.string(),
11772
+ unit: import_zod33.z.number().int(),
11773
+ number: import_zod33.z.number().int().positive(),
11774
+ percentage: import_zod33.z.number().nonnegative(),
11775
+ nextResetTime: import_zod33.z.number().positive().optional(),
11776
+ usage: import_zod33.z.number().nonnegative().optional(),
11777
+ currentValue: import_zod33.z.number().nonnegative().optional(),
11778
+ remaining: import_zod33.z.number().nonnegative().optional()
11650
11779
  });
11651
- ZaiResponseSchema = import_zod32.z.object({
11652
- success: import_zod32.z.boolean(),
11653
- msg: import_zod32.z.string().optional(),
11654
- data: import_zod32.z.object({ level: import_zod32.z.string().optional(), limits: import_zod32.z.array(ZaiLimitSchema) })
11780
+ ZaiResponseSchema = import_zod33.z.object({
11781
+ success: import_zod33.z.boolean(),
11782
+ msg: import_zod33.z.string().optional(),
11783
+ data: import_zod33.z.object({ level: import_zod33.z.string().optional(), limits: import_zod33.z.array(ZaiLimitSchema) })
11655
11784
  });
11656
11785
  OPENROUTER_HOST = "openrouter.ai";
11657
11786
  OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
11658
11787
  OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
11659
11788
  MS_PER_DAY3 = HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
11660
- OpenRouterKeySchema = import_zod32.z.object({
11661
- data: import_zod32.z.object({
11662
- limit: import_zod32.z.number().nonnegative().nullable(),
11663
- limit_remaining: import_zod32.z.number().nullable(),
11664
- limit_reset: import_zod32.z.string().nullable(),
11665
- is_free_tier: import_zod32.z.boolean().optional(),
11666
- free_model_daily_requests: import_zod32.z.object({ used: import_zod32.z.number().nonnegative(), limit: import_zod32.z.number().nonnegative(), remaining: import_zod32.z.number() }).optional()
11789
+ OpenRouterKeySchema = import_zod33.z.object({
11790
+ data: import_zod33.z.object({
11791
+ limit: import_zod33.z.number().nonnegative().nullable(),
11792
+ limit_remaining: import_zod33.z.number().nullable(),
11793
+ limit_reset: import_zod33.z.string().nullable(),
11794
+ is_free_tier: import_zod33.z.boolean().optional(),
11795
+ free_model_daily_requests: import_zod33.z.object({ used: import_zod33.z.number().nonnegative(), limit: import_zod33.z.number().nonnegative(), remaining: import_zod33.z.number() }).optional()
11667
11796
  })
11668
11797
  });
11669
- OpenRouterCreditsSchema = import_zod32.z.object({ data: import_zod32.z.object({ total_credits: import_zod32.z.number().nonnegative(), total_usage: import_zod32.z.number().nonnegative() }) });
11798
+ OpenRouterCreditsSchema = import_zod33.z.object({ data: import_zod33.z.object({ total_credits: import_zod33.z.number().nonnegative(), total_usage: import_zod33.z.number().nonnegative() }) });
11670
11799
  ANTIGRAVITY_HOST = "daily-cloudcode-pa.googleapis.com";
11671
11800
  ANTIGRAVITY_QUOTA_URL = `https://${ANTIGRAVITY_HOST}/v1internal:retrieveUserQuotaSummary`;
11672
11801
  ANTIGRAVITY_USER_URL = `https://${ANTIGRAVITY_HOST}/v1internal:loadCodeAssist`;
@@ -11674,21 +11803,21 @@ var init_providerQuota = __esm({
11674
11803
  DAYS_PER_WEEK2 = 7;
11675
11804
  FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
11676
11805
  WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
11677
- AntigravityBucketSchema = import_zod32.z.object({
11678
- bucketId: import_zod32.z.string(),
11679
- remainingFraction: import_zod32.z.number().optional(),
11680
- resetTime: import_zod32.z.string().optional()
11806
+ AntigravityBucketSchema = import_zod33.z.object({
11807
+ bucketId: import_zod33.z.string(),
11808
+ remainingFraction: import_zod33.z.number().optional(),
11809
+ resetTime: import_zod33.z.string().optional()
11681
11810
  });
11682
- AntigravitySummarySchema = import_zod32.z.object({ groups: import_zod32.z.array(import_zod32.z.object({ buckets: import_zod32.z.array(AntigravityBucketSchema) })) });
11683
- GoogleTokenInfoSchema = import_zod32.z.object({
11684
- email: import_zod32.z.string().optional(),
11685
- sub: import_zod32.z.string().optional()
11811
+ AntigravitySummarySchema = import_zod33.z.object({ groups: import_zod33.z.array(import_zod33.z.object({ buckets: import_zod33.z.array(AntigravityBucketSchema) })) });
11812
+ GoogleTokenInfoSchema = import_zod33.z.object({
11813
+ email: import_zod33.z.string().optional(),
11814
+ sub: import_zod33.z.string().optional()
11686
11815
  });
11687
- AntigravityUserSchema = import_zod32.z.object({
11816
+ AntigravityUserSchema = import_zod33.z.object({
11688
11817
  /** The code-assist tier context, which defaults to the free tier for every account. */
11689
- currentTier: import_zod32.z.object({ name: import_zod32.z.string().optional(), id: import_zod32.z.string().optional() }).optional(),
11818
+ currentTier: import_zod33.z.object({ name: import_zod33.z.string().optional(), id: import_zod33.z.string().optional() }).optional(),
11690
11819
  /** The account's paid subscription; absent when the account has none. */
11691
- paidTier: import_zod32.z.object({ name: import_zod32.z.string().optional(), id: import_zod32.z.string().optional() }).optional()
11820
+ paidTier: import_zod33.z.object({ name: import_zod33.z.string().optional(), id: import_zod33.z.string().optional() }).optional()
11692
11821
  });
11693
11822
  }
11694
11823
  });
@@ -12188,130 +12317,130 @@ var HTTP_STATUS = {
12188
12317
  init_connect();
12189
12318
 
12190
12319
  // src/agents/liveTasks.ts
12191
- var import_zod5 = require("zod");
12320
+ var import_zod6 = require("zod");
12192
12321
 
12193
12322
  // src/agents/schema.ts
12194
- var import_zod4 = require("zod");
12195
- var AgentMetaSchema = import_zod4.z.looseObject({
12196
- agentType: import_zod4.z.string(),
12197
- isFork: import_zod4.z.boolean().optional(),
12198
- description: import_zod4.z.string().optional(),
12199
- name: import_zod4.z.string().optional(),
12200
- toolUseId: import_zod4.z.string().optional(),
12201
- spawnDepth: import_zod4.z.number().int().nonnegative().optional(),
12202
- parentAgentId: import_zod4.z.string().optional(),
12203
- model: import_zod4.z.string().optional(),
12204
- requestShape: import_zod4.z.string().optional(),
12205
- requestNonInteractive: import_zod4.z.boolean().optional(),
12206
- workflowPhase: import_zod4.z.string().optional(),
12207
- taskKind: import_zod4.z.string().optional(),
12208
- teamName: import_zod4.z.string().optional(),
12209
- worktreePath: import_zod4.z.string().optional(),
12210
- worktreeBranch: import_zod4.z.string().optional(),
12211
- stoppedByUser: import_zod4.z.boolean().optional()
12323
+ var import_zod5 = require("zod");
12324
+ var AgentMetaSchema = import_zod5.z.looseObject({
12325
+ agentType: import_zod5.z.string(),
12326
+ isFork: import_zod5.z.boolean().optional(),
12327
+ description: import_zod5.z.string().optional(),
12328
+ name: import_zod5.z.string().optional(),
12329
+ toolUseId: import_zod5.z.string().optional(),
12330
+ spawnDepth: import_zod5.z.number().int().nonnegative().optional(),
12331
+ parentAgentId: import_zod5.z.string().optional(),
12332
+ model: import_zod5.z.string().optional(),
12333
+ requestShape: import_zod5.z.string().optional(),
12334
+ requestNonInteractive: import_zod5.z.boolean().optional(),
12335
+ workflowPhase: import_zod5.z.string().optional(),
12336
+ taskKind: import_zod5.z.string().optional(),
12337
+ teamName: import_zod5.z.string().optional(),
12338
+ worktreePath: import_zod5.z.string().optional(),
12339
+ worktreeBranch: import_zod5.z.string().optional(),
12340
+ stoppedByUser: import_zod5.z.boolean().optional()
12212
12341
  });
12213
- var AgentKindSchema = import_zod4.z.enum(["subagent", "fork", "workflow-agent", "teammate"]);
12342
+ var AgentKindSchema = import_zod5.z.enum(["subagent", "fork", "workflow-agent", "teammate"]);
12214
12343
  var AgentNodeFields = {
12215
- id: import_zod4.z.string(),
12344
+ id: import_zod5.z.string(),
12216
12345
  kind: AgentKindSchema,
12217
- agentType: import_zod4.z.string(),
12218
- description: import_zod4.z.string().optional(),
12219
- name: import_zod4.z.string().optional(),
12220
- toolUseId: import_zod4.z.string().optional(),
12221
- spawnDepth: import_zod4.z.number().int().nonnegative().optional(),
12222
- model: import_zod4.z.string().optional(),
12223
- background: import_zod4.z.boolean().optional(),
12224
- workflowRunId: import_zod4.z.string().optional(),
12225
- workflowPhase: import_zod4.z.string().optional(),
12226
- teamName: import_zod4.z.string().optional(),
12227
- stoppedByUser: import_zod4.z.boolean().optional(),
12228
- transcript: import_zod4.z.string()
12346
+ agentType: import_zod5.z.string(),
12347
+ description: import_zod5.z.string().optional(),
12348
+ name: import_zod5.z.string().optional(),
12349
+ toolUseId: import_zod5.z.string().optional(),
12350
+ spawnDepth: import_zod5.z.number().int().nonnegative().optional(),
12351
+ model: import_zod5.z.string().optional(),
12352
+ background: import_zod5.z.boolean().optional(),
12353
+ workflowRunId: import_zod5.z.string().optional(),
12354
+ workflowPhase: import_zod5.z.string().optional(),
12355
+ teamName: import_zod5.z.string().optional(),
12356
+ stoppedByUser: import_zod5.z.boolean().optional(),
12357
+ transcript: import_zod5.z.string()
12229
12358
  };
12230
- var AgentNodeSchema = import_zod4.z.lazy(() => import_zod4.z.strictObject({ ...AgentNodeFields, children: import_zod4.z.array(AgentNodeSchema) }));
12231
- var TaskItemSchema = import_zod4.z.strictObject({
12232
- id: import_zod4.z.string(),
12233
- subject: import_zod4.z.string(),
12234
- description: import_zod4.z.string().optional(),
12235
- status: import_zod4.z.string(),
12359
+ var AgentNodeSchema = import_zod5.z.lazy(() => import_zod5.z.strictObject({ ...AgentNodeFields, children: import_zod5.z.array(AgentNodeSchema) }));
12360
+ var TaskItemSchema = import_zod5.z.strictObject({
12361
+ id: import_zod5.z.string(),
12362
+ subject: import_zod5.z.string(),
12363
+ description: import_zod5.z.string().optional(),
12364
+ status: import_zod5.z.string(),
12236
12365
  /** What a spinner shows while the task runs. */
12237
- activeForm: import_zod4.z.string().optional(),
12366
+ activeForm: import_zod5.z.string().optional(),
12238
12367
  /** The teammate or agent name the task is assigned to, as Agent Teams writes it. */
12239
- owner: import_zod4.z.string().optional(),
12368
+ owner: import_zod5.z.string().optional(),
12240
12369
  /** Free-form data the harness attaches to a task, kept as written. */
12241
- metadata: import_zod4.z.record(import_zod4.z.string(), import_zod4.z.unknown()).optional(),
12242
- blocks: import_zod4.z.array(import_zod4.z.string()),
12243
- blockedBy: import_zod4.z.array(import_zod4.z.string()),
12370
+ metadata: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.unknown()).optional(),
12371
+ blocks: import_zod5.z.array(import_zod5.z.string()),
12372
+ blockedBy: import_zod5.z.array(import_zod5.z.string()),
12244
12373
  /** The id of the shared task list this task belongs to (a team's name, or a custom list id), absent for the session's own list. */
12245
- taskList: import_zod4.z.string().optional()
12374
+ taskList: import_zod5.z.string().optional()
12246
12375
  });
12247
- var WorkflowRunSchema = import_zod4.z.strictObject({
12248
- runId: import_zod4.z.string(),
12249
- workflowName: import_zod4.z.string().optional(),
12250
- status: import_zod4.z.string().optional(),
12251
- startTime: import_zod4.z.number().optional(),
12252
- phases: import_zod4.z.array(import_zod4.z.string()),
12253
- summary: import_zod4.z.string().optional()
12376
+ var WorkflowRunSchema = import_zod5.z.strictObject({
12377
+ runId: import_zod5.z.string(),
12378
+ workflowName: import_zod5.z.string().optional(),
12379
+ status: import_zod5.z.string().optional(),
12380
+ startTime: import_zod5.z.number().optional(),
12381
+ phases: import_zod5.z.array(import_zod5.z.string()),
12382
+ summary: import_zod5.z.string().optional()
12254
12383
  });
12255
- var AgentTreeProblemSchema = import_zod4.z.strictObject({
12384
+ var AgentTreeProblemSchema = import_zod5.z.strictObject({
12256
12385
  /** Relative to the identity's configuration directory. */
12257
- path: import_zod4.z.string(),
12258
- reason: import_zod4.z.string()
12386
+ path: import_zod5.z.string(),
12387
+ reason: import_zod5.z.string()
12259
12388
  });
12260
- var SessionSummarySchema = import_zod4.z.strictObject({
12261
- project: import_zod4.z.string(),
12262
- sessionId: import_zod4.z.string(),
12263
- superseded: import_zod4.z.boolean(),
12389
+ var SessionSummarySchema = import_zod5.z.strictObject({
12390
+ project: import_zod5.z.string(),
12391
+ sessionId: import_zod5.z.string(),
12392
+ superseded: import_zod5.z.boolean(),
12264
12393
  /** The directory and transcript stem exactly as on disk, which differs from `sessionId` for a superseded session. */
12265
- entry: import_zod4.z.string(),
12266
- agentCount: import_zod4.z.number().int().nonnegative(),
12267
- workflowRunCount: import_zod4.z.number().int().nonnegative(),
12394
+ entry: import_zod5.z.string(),
12395
+ agentCount: import_zod5.z.number().int().nonnegative(),
12396
+ workflowRunCount: import_zod5.z.number().int().nonnegative(),
12268
12397
  /** When the transcript was last written, as an ISO instant; absent when there is no transcript file. */
12269
- updatedAt: import_zod4.z.iso.datetime().optional(),
12270
- identities: import_zod4.z.array(import_zod4.z.string())
12398
+ updatedAt: import_zod5.z.iso.datetime().optional(),
12399
+ identities: import_zod5.z.array(import_zod5.z.string())
12271
12400
  });
12272
- var SessionAgentTreeSchema = import_zod4.z.strictObject({
12273
- project: import_zod4.z.string(),
12274
- sessionId: import_zod4.z.string(),
12401
+ var SessionAgentTreeSchema = import_zod5.z.strictObject({
12402
+ project: import_zod5.z.string(),
12403
+ sessionId: import_zod5.z.string(),
12275
12404
  /** True for a session directory a resume superseded (`<session-id>.superseded-<epoch-ms>`). */
12276
- superseded: import_zod4.z.boolean(),
12405
+ superseded: import_zod5.z.boolean(),
12277
12406
  /** The agents the session itself spawned, each with its descendants. */
12278
- agents: import_zod4.z.array(AgentNodeSchema),
12279
- tasks: import_zod4.z.array(TaskItemSchema),
12280
- workflowRuns: import_zod4.z.array(WorkflowRunSchema),
12281
- problems: import_zod4.z.array(AgentTreeProblemSchema)
12407
+ agents: import_zod5.z.array(AgentNodeSchema),
12408
+ tasks: import_zod5.z.array(TaskItemSchema),
12409
+ workflowRuns: import_zod5.z.array(WorkflowRunSchema),
12410
+ problems: import_zod5.z.array(AgentTreeProblemSchema)
12282
12411
  });
12283
12412
 
12284
12413
  // src/agents/liveTasks.ts
12285
12414
  var LIVE_TASK_CAP = 512;
12286
12415
  var RUNNING_STATUS = "running";
12287
- var LiveTaskUsageSchema = import_zod5.z.strictObject({
12288
- totalTokens: import_zod5.z.number().optional(),
12289
- toolUses: import_zod5.z.number().optional(),
12290
- durationMs: import_zod5.z.number().optional()
12416
+ var LiveTaskUsageSchema = import_zod6.z.strictObject({
12417
+ totalTokens: import_zod6.z.number().optional(),
12418
+ toolUses: import_zod6.z.number().optional(),
12419
+ durationMs: import_zod6.z.number().optional()
12291
12420
  });
12292
- var LiveTaskSchema = import_zod5.z.strictObject({
12421
+ var LiveTaskSchema = import_zod6.z.strictObject({
12293
12422
  /** The `task_id`: for an unnamed subagent the stem of its `agent-<id>` files on disk. */
12294
- taskId: import_zod5.z.string(),
12423
+ taskId: import_zod6.z.string(),
12295
12424
  /** The `cse_` session whose stream carried the task. */
12296
- sessionId: import_zod5.z.string(),
12297
- runId: import_zod5.z.string().optional(),
12425
+ sessionId: import_zod6.z.string(),
12426
+ runId: import_zod6.z.string().optional(),
12298
12427
  /** The `tool_use` block in the spawning transcript, which is the meta file's `toolUseId`. */
12299
- toolUseId: import_zod5.z.string().optional(),
12428
+ toolUseId: import_zod6.z.string().optional(),
12300
12429
  /** `local_agent` for a subagent, `local_bash` for a backgrounded command; open because other kinds may exist. */
12301
- taskType: import_zod5.z.string().optional(),
12302
- description: import_zod5.z.string().optional(),
12303
- subagentType: import_zod5.z.string().optional(),
12304
- spawnDepth: import_zod5.z.number().int().nonnegative().optional(),
12305
- parentTaskId: import_zod5.z.string().optional(),
12306
- backgrounded: import_zod5.z.boolean().optional(),
12307
- status: import_zod5.z.string(),
12430
+ taskType: import_zod6.z.string().optional(),
12431
+ description: import_zod6.z.string().optional(),
12432
+ subagentType: import_zod6.z.string().optional(),
12433
+ spawnDepth: import_zod6.z.number().int().nonnegative().optional(),
12434
+ parentTaskId: import_zod6.z.string().optional(),
12435
+ backgrounded: import_zod6.z.boolean().optional(),
12436
+ status: import_zod6.z.string(),
12308
12437
  /** `<tmpdir>/<project-slug>/<local session id>/tasks/<task_id>.output`, which embeds the local session id. */
12309
- outputFile: import_zod5.z.string().optional(),
12310
- summary: import_zod5.z.string().optional(),
12311
- lastToolName: import_zod5.z.string().optional(),
12438
+ outputFile: import_zod6.z.string().optional(),
12439
+ summary: import_zod6.z.string().optional(),
12440
+ lastToolName: import_zod6.z.string().optional(),
12312
12441
  usage: LiveTaskUsageSchema.optional(),
12313
12442
  /** When the door last observed an event for this task, in epoch milliseconds from its injected clock. */
12314
- observedAt: import_zod5.z.number()
12443
+ observedAt: import_zod6.z.number()
12315
12444
  });
12316
12445
  var SYSTEM_SUBTYPES = ["task_started", "task_progress", "task_updated", "task_notification", "background_tasks_changed"];
12317
12446
  function isRecord3(value) {
@@ -12410,22 +12539,22 @@ function applyAgentTaskEvent(book, sessionId, payload, observedAt2) {
12410
12539
  }
12411
12540
  return bounded(next);
12412
12541
  }
12413
- var MergedProvenanceSchema = import_zod5.z.enum(["disk", "both"]);
12414
- var MergedAgentNodeSchema = import_zod5.z.lazy(
12415
- () => import_zod5.z.strictObject({
12542
+ var MergedProvenanceSchema = import_zod6.z.enum(["disk", "both"]);
12543
+ var MergedAgentNodeSchema = import_zod6.z.lazy(
12544
+ () => import_zod6.z.strictObject({
12416
12545
  ...AgentNodeFields,
12417
12546
  provenance: MergedProvenanceSchema,
12418
12547
  live: LiveTaskSchema.optional(),
12419
- children: import_zod5.z.array(MergedAgentNodeSchema)
12548
+ children: import_zod6.z.array(MergedAgentNodeSchema)
12420
12549
  })
12421
12550
  );
12422
- var MergedAgentTreeSchema = import_zod5.z.strictObject({
12551
+ var MergedAgentTreeSchema = import_zod6.z.strictObject({
12423
12552
  ...SessionAgentTreeSchema.shape,
12424
- agents: import_zod5.z.array(MergedAgentNodeSchema),
12553
+ agents: import_zod6.z.array(MergedAgentNodeSchema),
12425
12554
  /** The `cse_` sessions whose live tasks matched this session. Empty when the session is not live or the door has not observed it. */
12426
- remoteSessions: import_zod5.z.array(import_zod5.z.string()),
12555
+ remoteSessions: import_zod6.z.array(import_zod6.z.string()),
12427
12556
  /** Live tasks of those sessions that match no disk agent (a backgrounded command, or an agent whose files have not appeared yet). */
12428
- liveOnly: import_zod5.z.array(LiveTaskSchema)
12557
+ liveOnly: import_zod6.z.array(LiveTaskSchema)
12429
12558
  });
12430
12559
  function mergeLiveTasks(tree, live) {
12431
12560
  const byTaskId = new Map(live.map((task) => [task.taskId, task]));
@@ -14296,162 +14425,162 @@ init_package();
14296
14425
  init_capability();
14297
14426
 
14298
14427
  // src/frontdoor/rcSchemas.ts
14299
- var import_zod6 = require("zod");
14300
- var RcPermissionModeSchema = import_zod6.z.enum(RC_PERMISSION_MODES);
14301
- var RcSessionSummarySchema = import_zod6.z.strictObject({
14302
- id: import_zod6.z.string(),
14303
- createdAt: import_zod6.z.number(),
14304
- lastSeenAt: import_zod6.z.number()
14428
+ var import_zod7 = require("zod");
14429
+ var RcPermissionModeSchema = import_zod7.z.enum(RC_PERMISSION_MODES);
14430
+ var RcSessionSummarySchema = import_zod7.z.strictObject({
14431
+ id: import_zod7.z.string(),
14432
+ createdAt: import_zod7.z.number(),
14433
+ lastSeenAt: import_zod7.z.number()
14305
14434
  });
14306
14435
  function workerFactSchema(value) {
14307
- return import_zod6.z.strictObject({ value, observedAt: import_zod6.z.number() });
14308
- }
14309
- var RcPendingRequestSummarySchema = import_zod6.z.strictObject({
14310
- sessionId: import_zod6.z.string(),
14311
- requestId: import_zod6.z.string(),
14312
- type: import_zod6.z.string(),
14313
- summary: import_zod6.z.string(),
14314
- observedAt: import_zod6.z.number()
14436
+ return import_zod7.z.strictObject({ value, observedAt: import_zod7.z.number() });
14437
+ }
14438
+ var RcPendingRequestSummarySchema = import_zod7.z.strictObject({
14439
+ sessionId: import_zod7.z.string(),
14440
+ requestId: import_zod7.z.string(),
14441
+ type: import_zod7.z.string(),
14442
+ summary: import_zod7.z.string(),
14443
+ observedAt: import_zod7.z.number()
14315
14444
  });
14316
- var RcSessionStatusSchema = import_zod6.z.strictObject({
14445
+ var RcSessionStatusSchema = import_zod7.z.strictObject({
14317
14446
  ...RcSessionSummarySchema.shape,
14318
- workerState: workerFactSchema(import_zod6.z.string()).optional(),
14319
- workerIdleSeconds: workerFactSchema(import_zod6.z.number()).optional(),
14320
- pending: import_zod6.z.readonly(import_zod6.z.array(RcPendingRequestSummarySchema))
14447
+ workerState: workerFactSchema(import_zod7.z.string()).optional(),
14448
+ workerIdleSeconds: workerFactSchema(import_zod7.z.number()).optional(),
14449
+ pending: import_zod7.z.readonly(import_zod7.z.array(RcPendingRequestSummarySchema))
14321
14450
  });
14322
- var RcStreamEnvelopeSchema = import_zod6.z.looseObject({
14451
+ var RcStreamEnvelopeSchema = import_zod7.z.looseObject({
14323
14452
  /** The envelope's own event id, when the host sent one. */
14324
- event_id: import_zod6.z.string().optional(),
14453
+ event_id: import_zod7.z.string().optional(),
14325
14454
  /** The envelope's event type, the discriminator a consumer switches on (`control_request`, `user`, and kin). */
14326
- event_type: import_zod6.z.string(),
14455
+ event_type: import_zod7.z.string(),
14327
14456
  /** The sequence number the host assigned, the value a resume continues after. */
14328
- sequence_num: import_zod6.z.int(),
14457
+ sequence_num: import_zod7.z.int(),
14329
14458
  /** Who emitted the event (`worker` for the CLI's half, a client id for a client's). */
14330
- source: import_zod6.z.string(),
14459
+ source: import_zod7.z.string(),
14331
14460
  /** The event's payload, carried verbatim: its shape is the payload family's, narrowed by whichever consumer needs it. Optional in the schema's own type because the door forwards the host's envelope as it arrived, asserting only the fields it relies on itself. */
14332
- payload: import_zod6.z.unknown().optional(),
14461
+ payload: import_zod7.z.unknown().optional(),
14333
14462
  /** When the host created the event; the protocol's own type for this field is not established here, so it is forwarded rather than asserted. */
14334
- created_at: import_zod6.z.unknown().optional()
14463
+ created_at: import_zod7.z.unknown().optional()
14335
14464
  });
14336
- var RcStreamEventSchema = import_zod6.z.strictObject({
14337
- session: import_zod6.z.string(),
14465
+ var RcStreamEventSchema = import_zod7.z.strictObject({
14466
+ session: import_zod7.z.string(),
14338
14467
  envelope: RcStreamEnvelopeSchema
14339
14468
  });
14340
- var RcRateLimitWindowSchema = import_zod6.z.looseObject({
14469
+ var RcRateLimitWindowSchema = import_zod7.z.looseObject({
14341
14470
  /** The fraction of the window used, usually between 0 and 1, above 1 when usage legitimately runs past the window's cap (the CLI's own field description states both). */
14342
- utilization: import_zod6.z.number().optional(),
14471
+ utilization: import_zod7.z.number().optional(),
14343
14472
  /** When the window resets, in unix epoch seconds: the unit is the CLI's own field description, stated in the 2.1.289 bundle's schema. */
14344
- resetsAt: import_zod6.z.number().optional()
14473
+ resetsAt: import_zod7.z.number().optional()
14345
14474
  });
14346
- var RcRateLimitInfoSchema = import_zod6.z.looseObject({
14475
+ var RcRateLimitInfoSchema = import_zod7.z.looseObject({
14347
14476
  /** The limiting window's own status (`allowed`, `allowed_warning`, `rejected`), asserted only as a string because the vocabulary grows with the CLI. */
14348
- status: import_zod6.z.string(),
14477
+ status: import_zod7.z.string(),
14349
14478
  /** When the limiting window resets, in unix epoch seconds. */
14350
- resetsAt: import_zod6.z.number().optional(),
14479
+ resetsAt: import_zod7.z.number().optional(),
14351
14480
  /** Which window the top-level fields describe (`five_hour`, `seven_day`, and kin), the payload's own name for it. */
14352
- rateLimitType: import_zod6.z.string().optional(),
14481
+ rateLimitType: import_zod7.z.string().optional(),
14353
14482
  /** The fraction of the limiting window used, on the same scale the per-window utilizations carry. */
14354
- utilization: import_zod6.z.number().optional(),
14483
+ utilization: import_zod7.z.number().optional(),
14355
14484
  /** Whether usage beyond the plan (extra usage) is currently covering the overflow, the payload's own flag for it. */
14356
- isUsingOverage: import_zod6.z.boolean().optional(),
14485
+ isUsingOverage: import_zod7.z.boolean().optional(),
14357
14486
  /** The overage's own status, the same vocabulary the limiting window's `status` carries. */
14358
- overageStatus: import_zod6.z.string().optional(),
14487
+ overageStatus: import_zod7.z.string().optional(),
14359
14488
  /** When the overage window resets, in unix epoch seconds. */
14360
- overageResetsAt: import_zod6.z.number().optional(),
14489
+ overageResetsAt: import_zod7.z.number().optional(),
14361
14490
  /** Each subscription window the account's response headers carried: the session (five-hour), weekly (seven-day), and overage-included weekly windows, each present only when the account's responses carry it. */
14362
- unifiedWindows: import_zod6.z.looseObject({ five_hour: RcRateLimitWindowSchema.optional(), seven_day: RcRateLimitWindowSchema.optional(), seven_day_overage_included: RcRateLimitWindowSchema.optional() }).optional()
14491
+ unifiedWindows: import_zod7.z.looseObject({ five_hour: RcRateLimitWindowSchema.optional(), seven_day: RcRateLimitWindowSchema.optional(), seven_day_overage_included: RcRateLimitWindowSchema.optional() }).optional()
14363
14492
  });
14364
- var RcLiveRateLimitSchema = import_zod6.z.strictObject({
14365
- session: import_zod6.z.string(),
14366
- observedAt: import_zod6.z.number(),
14493
+ var RcLiveRateLimitSchema = import_zod7.z.strictObject({
14494
+ session: import_zod7.z.string(),
14495
+ observedAt: import_zod7.z.number(),
14367
14496
  rateLimit: RcRateLimitInfoSchema
14368
14497
  });
14369
- var RcSessionQuerySchema = import_zod6.z.strictObject({
14370
- session: import_zod6.z.string().min(1).optional()
14498
+ var RcSessionQuerySchema = import_zod7.z.strictObject({
14499
+ session: import_zod7.z.string().min(1).optional()
14371
14500
  });
14372
- var RcSendInputSchema = import_zod6.z.strictObject({
14373
- session: import_zod6.z.string().min(1),
14374
- text: import_zod6.z.string().min(1)
14501
+ var RcSendInputSchema = import_zod7.z.strictObject({
14502
+ session: import_zod7.z.string().min(1),
14503
+ text: import_zod7.z.string().min(1)
14375
14504
  });
14376
- var RcAnswerInputSchema = import_zod6.z.strictObject({
14377
- session: import_zod6.z.string().min(1),
14378
- request: import_zod6.z.string().min(1),
14379
- approve: import_zod6.z.boolean(),
14380
- text: import_zod6.z.string().optional()
14505
+ var RcAnswerInputSchema = import_zod7.z.strictObject({
14506
+ session: import_zod7.z.string().min(1),
14507
+ request: import_zod7.z.string().min(1),
14508
+ approve: import_zod7.z.boolean(),
14509
+ text: import_zod7.z.string().optional()
14381
14510
  }).refine((input) => !input.approve || input.text === void 0 || input.text === "", { message: "an approval carries no text (the protocol's allow result has no message field); text is the denial message" });
14382
- var RcInterruptInputSchema = import_zod6.z.strictObject({
14383
- session: import_zod6.z.string().min(1)
14511
+ var RcInterruptInputSchema = import_zod7.z.strictObject({
14512
+ session: import_zod7.z.string().min(1)
14384
14513
  });
14385
- var RcSetModelInputSchema = import_zod6.z.strictObject({
14386
- session: import_zod6.z.string().min(1),
14387
- model: import_zod6.z.string().min(1)
14514
+ var RcSetModelInputSchema = import_zod7.z.strictObject({
14515
+ session: import_zod7.z.string().min(1),
14516
+ model: import_zod7.z.string().min(1)
14388
14517
  });
14389
- var RcSetPermissionModeInputSchema = import_zod6.z.strictObject({
14390
- session: import_zod6.z.string().min(1),
14518
+ var RcSetPermissionModeInputSchema = import_zod7.z.strictObject({
14519
+ session: import_zod7.z.string().min(1),
14391
14520
  mode: RcPermissionModeSchema
14392
14521
  });
14393
- var RcEndSessionInputSchema = import_zod6.z.strictObject({
14394
- session: import_zod6.z.string().min(1),
14395
- reason: import_zod6.z.string().min(1).optional()
14522
+ var RcEndSessionInputSchema = import_zod7.z.strictObject({
14523
+ session: import_zod7.z.string().min(1),
14524
+ reason: import_zod7.z.string().min(1).optional()
14396
14525
  });
14397
- var RcGetUsageInputSchema = import_zod6.z.strictObject({
14398
- session: import_zod6.z.string().min(1),
14399
- skipBehaviors: import_zod6.z.boolean().optional()
14526
+ var RcGetUsageInputSchema = import_zod7.z.strictObject({
14527
+ session: import_zod7.z.string().min(1),
14528
+ skipBehaviors: import_zod7.z.boolean().optional()
14400
14529
  });
14401
- var RcGetContextUsageInputSchema = import_zod6.z.strictObject({
14402
- session: import_zod6.z.string().min(1),
14403
- detail: import_zod6.z.enum(RC_CONTEXT_USAGE_DETAILS).optional()
14530
+ var RcGetContextUsageInputSchema = import_zod7.z.strictObject({
14531
+ session: import_zod7.z.string().min(1),
14532
+ detail: import_zod7.z.enum(RC_CONTEXT_USAGE_DETAILS).optional()
14404
14533
  });
14405
- var RcReadFileInputSchema = import_zod6.z.strictObject({
14406
- session: import_zod6.z.string().min(1),
14407
- path: import_zod6.z.string().min(1),
14408
- maxBytes: import_zod6.z.number().int().positive().optional(),
14409
- encoding: import_zod6.z.enum(RC_READ_FILE_ENCODINGS).optional()
14534
+ var RcReadFileInputSchema = import_zod7.z.strictObject({
14535
+ session: import_zod7.z.string().min(1),
14536
+ path: import_zod7.z.string().min(1),
14537
+ maxBytes: import_zod7.z.number().int().positive().optional(),
14538
+ encoding: import_zod7.z.enum(RC_READ_FILE_ENCODINGS).optional()
14410
14539
  });
14411
- var RcFileSuggestionsInputSchema = import_zod6.z.strictObject({
14412
- session: import_zod6.z.string().min(1),
14413
- query: import_zod6.z.string()
14540
+ var RcFileSuggestionsInputSchema = import_zod7.z.strictObject({
14541
+ session: import_zod7.z.string().min(1),
14542
+ query: import_zod7.z.string()
14414
14543
  });
14415
- var RcKeepAliveInputSchema = import_zod6.z.strictObject({
14416
- session: import_zod6.z.string().min(1)
14544
+ var RcKeepAliveInputSchema = import_zod7.z.strictObject({
14545
+ session: import_zod7.z.string().min(1)
14417
14546
  });
14418
- var RcMcpStatusInputSchema = import_zod6.z.strictObject({
14419
- session: import_zod6.z.string().min(1)
14547
+ var RcMcpStatusInputSchema = import_zod7.z.strictObject({
14548
+ session: import_zod7.z.string().min(1)
14420
14549
  });
14421
- var RcMcpReconnectInputSchema = import_zod6.z.strictObject({
14422
- session: import_zod6.z.string().min(1),
14423
- serverName: import_zod6.z.string().min(1)
14550
+ var RcMcpReconnectInputSchema = import_zod7.z.strictObject({
14551
+ session: import_zod7.z.string().min(1),
14552
+ serverName: import_zod7.z.string().min(1)
14424
14553
  });
14425
- var RcMcpAuthenticateInputSchema = import_zod6.z.strictObject({
14426
- session: import_zod6.z.string().min(1),
14427
- serverName: import_zod6.z.string().min(1),
14428
- redirectUri: import_zod6.z.string().min(1)
14554
+ var RcMcpAuthenticateInputSchema = import_zod7.z.strictObject({
14555
+ session: import_zod7.z.string().min(1),
14556
+ serverName: import_zod7.z.string().min(1),
14557
+ redirectUri: import_zod7.z.string().min(1)
14429
14558
  });
14430
- var RcMcpOAuthCallbackUrlInputSchema = import_zod6.z.strictObject({
14431
- session: import_zod6.z.string().min(1),
14432
- serverName: import_zod6.z.string().min(1),
14433
- callbackUrl: import_zod6.z.string().min(1)
14559
+ var RcMcpOAuthCallbackUrlInputSchema = import_zod7.z.strictObject({
14560
+ session: import_zod7.z.string().min(1),
14561
+ serverName: import_zod7.z.string().min(1),
14562
+ callbackUrl: import_zod7.z.string().min(1)
14434
14563
  });
14435
- var RcTeleportInputSchema = import_zod6.z.strictObject({
14436
- session: import_zod6.z.string().min(1),
14437
- marker: import_zod6.z.string().min(1)
14564
+ var RcTeleportInputSchema = import_zod7.z.strictObject({
14565
+ session: import_zod7.z.string().min(1),
14566
+ marker: import_zod7.z.string().min(1)
14438
14567
  });
14439
- var RcListOutputSchema = import_zod6.z.strictObject({ sessions: import_zod6.z.readonly(import_zod6.z.array(RcSessionSummarySchema)) });
14440
- var RcStatusOutputSchema = import_zod6.z.strictObject({ statuses: import_zod6.z.readonly(import_zod6.z.array(RcSessionStatusSchema)) });
14441
- var RcPendingOutputSchema = import_zod6.z.strictObject({ pending: import_zod6.z.readonly(import_zod6.z.array(RcPendingRequestSummarySchema)) });
14442
- var RcWriteOutputSchema = import_zod6.z.strictObject({
14443
- session: import_zod6.z.string(),
14444
- sequenceNums: import_zod6.z.readonly(import_zod6.z.array(import_zod6.z.number()))
14568
+ var RcListOutputSchema = import_zod7.z.strictObject({ sessions: import_zod7.z.readonly(import_zod7.z.array(RcSessionSummarySchema)) });
14569
+ var RcStatusOutputSchema = import_zod7.z.strictObject({ statuses: import_zod7.z.readonly(import_zod7.z.array(RcSessionStatusSchema)) });
14570
+ var RcPendingOutputSchema = import_zod7.z.strictObject({ pending: import_zod7.z.readonly(import_zod7.z.array(RcPendingRequestSummarySchema)) });
14571
+ var RcWriteOutputSchema = import_zod7.z.strictObject({
14572
+ session: import_zod7.z.string(),
14573
+ sequenceNums: import_zod7.z.readonly(import_zod7.z.array(import_zod7.z.number()))
14445
14574
  });
14446
- var RcControlWriteOutputSchema = import_zod6.z.strictObject({
14447
- session: import_zod6.z.string(),
14448
- request: import_zod6.z.string(),
14449
- sequenceNums: import_zod6.z.readonly(import_zod6.z.array(import_zod6.z.number()))
14575
+ var RcControlWriteOutputSchema = import_zod7.z.strictObject({
14576
+ session: import_zod7.z.string(),
14577
+ request: import_zod7.z.string(),
14578
+ sequenceNums: import_zod7.z.readonly(import_zod7.z.array(import_zod7.z.number()))
14450
14579
  });
14451
- var RcAnswerOutputSchema = import_zod6.z.strictObject({
14452
- session: import_zod6.z.string(),
14453
- request: import_zod6.z.string(),
14454
- sequenceNums: import_zod6.z.readonly(import_zod6.z.array(import_zod6.z.number()))
14580
+ var RcAnswerOutputSchema = import_zod7.z.strictObject({
14581
+ session: import_zod7.z.string(),
14582
+ request: import_zod7.z.string(),
14583
+ sequenceNums: import_zod7.z.readonly(import_zod7.z.array(import_zod7.z.number()))
14455
14584
  });
14456
14585
 
14457
14586
  // src/frontdoor/rcApi.ts
@@ -14638,48 +14767,48 @@ init_cliError();
14638
14767
  init_package();
14639
14768
 
14640
14769
  // src/codex/appServerSchemas.ts
14641
- var import_zod7 = require("zod");
14770
+ var import_zod8 = require("zod");
14642
14771
  var CODEX_APP_SERVER_GENERATED_AGAINST = "0.160.0";
14643
- var RateLimitWindowSchema = import_zod7.z.object({
14644
- usedPercent: import_zod7.z.number(),
14645
- resetsAt: import_zod7.z.number().nullish(),
14646
- windowDurationMins: import_zod7.z.number().nullish()
14772
+ var RateLimitWindowSchema = import_zod8.z.object({
14773
+ usedPercent: import_zod8.z.number(),
14774
+ resetsAt: import_zod8.z.number().nullish(),
14775
+ windowDurationMins: import_zod8.z.number().nullish()
14647
14776
  });
14648
- var RateLimitSnapshotSchema = import_zod7.z.object({
14649
- limitId: import_zod7.z.string().nullish(),
14650
- limitName: import_zod7.z.string().nullish(),
14651
- planType: import_zod7.z.string().nullish(),
14777
+ var RateLimitSnapshotSchema = import_zod8.z.object({
14778
+ limitId: import_zod8.z.string().nullish(),
14779
+ limitName: import_zod8.z.string().nullish(),
14780
+ planType: import_zod8.z.string().nullish(),
14652
14781
  primary: RateLimitWindowSchema.nullish(),
14653
14782
  secondary: RateLimitWindowSchema.nullish(),
14654
- rateLimitReachedType: import_zod7.z.string().nullish(),
14655
- spendControlReached: import_zod7.z.boolean().nullish()
14783
+ rateLimitReachedType: import_zod8.z.string().nullish(),
14784
+ spendControlReached: import_zod8.z.boolean().nullish()
14656
14785
  });
14657
- var RateLimitResetCreditSchema = import_zod7.z.object({
14658
- id: import_zod7.z.string(),
14659
- grantedAt: import_zod7.z.number(),
14660
- expiresAt: import_zod7.z.number().nullish(),
14661
- resetType: import_zod7.z.string(),
14662
- status: import_zod7.z.string(),
14663
- title: import_zod7.z.string().nullish(),
14664
- description: import_zod7.z.string().nullish()
14786
+ var RateLimitResetCreditSchema = import_zod8.z.object({
14787
+ id: import_zod8.z.string(),
14788
+ grantedAt: import_zod8.z.number(),
14789
+ expiresAt: import_zod8.z.number().nullish(),
14790
+ resetType: import_zod8.z.string(),
14791
+ status: import_zod8.z.string(),
14792
+ title: import_zod8.z.string().nullish(),
14793
+ description: import_zod8.z.string().nullish()
14665
14794
  });
14666
- var CodexAccountSchema = import_zod7.z.discriminatedUnion("type", [
14667
- import_zod7.z.object({ type: import_zod7.z.literal("apiKey") }),
14668
- import_zod7.z.object({ type: import_zod7.z.literal("chatgpt"), email: import_zod7.z.string().nullable(), planType: import_zod7.z.string() }),
14669
- import_zod7.z.object({ type: import_zod7.z.literal("amazonBedrock"), usesCodexManagedCredentials: import_zod7.z.boolean().default(false) })
14795
+ var CodexAccountSchema = import_zod8.z.discriminatedUnion("type", [
14796
+ import_zod8.z.object({ type: import_zod8.z.literal("apiKey") }),
14797
+ import_zod8.z.object({ type: import_zod8.z.literal("chatgpt"), email: import_zod8.z.string().nullable(), planType: import_zod8.z.string() }),
14798
+ import_zod8.z.object({ type: import_zod8.z.literal("amazonBedrock"), usesCodexManagedCredentials: import_zod8.z.boolean().default(false) })
14670
14799
  ]);
14671
- var CodexAccountReadSchema = import_zod7.z.object({
14800
+ var CodexAccountReadSchema = import_zod8.z.object({
14672
14801
  account: CodexAccountSchema.nullable(),
14673
- requiresOpenaiAuth: import_zod7.z.boolean()
14802
+ requiresOpenaiAuth: import_zod8.z.boolean()
14674
14803
  });
14675
- var CodexRateLimitsReadSchema = import_zod7.z.object({
14804
+ var CodexRateLimitsReadSchema = import_zod8.z.object({
14676
14805
  rateLimits: RateLimitSnapshotSchema,
14677
- rateLimitsByLimitId: import_zod7.z.record(import_zod7.z.string(), RateLimitSnapshotSchema).nullish(),
14678
- rateLimitResetCredits: import_zod7.z.object({ availableCount: import_zod7.z.number(), credits: import_zod7.z.array(RateLimitResetCreditSchema).nullish() }).nullish(),
14679
- accountId: import_zod7.z.string().nullish(),
14680
- ordinaryUsageAllowed: import_zod7.z.boolean().nullish()
14806
+ rateLimitsByLimitId: import_zod8.z.record(import_zod8.z.string(), RateLimitSnapshotSchema).nullish(),
14807
+ rateLimitResetCredits: import_zod8.z.object({ availableCount: import_zod8.z.number(), credits: import_zod8.z.array(RateLimitResetCreditSchema).nullish() }).nullish(),
14808
+ accountId: import_zod8.z.string().nullish(),
14809
+ ordinaryUsageAllowed: import_zod8.z.boolean().nullish()
14681
14810
  });
14682
- var CodexInitializeResultSchema = import_zod7.z.object({ userAgent: import_zod7.z.string() });
14811
+ var CodexInitializeResultSchema = import_zod8.z.object({ userAgent: import_zod8.z.string() });
14683
14812
 
14684
14813
  // src/codex/appServer.ts
14685
14814
  var CodexAppServerUnavailableError = class extends CliError {
@@ -15108,7 +15237,7 @@ init_providersStore();
15108
15237
  init_signIn();
15109
15238
  init_realPorts();
15110
15239
  var import_node_path27 = __toESM(require("node:path"), 1);
15111
- var import_zod16 = require("zod");
15240
+ var import_zod17 = require("zod");
15112
15241
  init_envBool();
15113
15242
  init_load();
15114
15243
  init_schema();
@@ -15188,9 +15317,9 @@ function lookupKeychainService(run, farmRoot) {
15188
15317
  }
15189
15318
  return { checked: true, found: true, serviceName, note: `Keychain service name for this identity: "${serviceName}".` };
15190
15319
  }
15191
- var SettingsSecretsShapeSchema = import_zod16.z.looseObject({
15192
- env: import_zod16.z.record(import_zod16.z.string(), import_zod16.z.unknown()).optional(),
15193
- hooks: import_zod16.z.record(import_zod16.z.string(), import_zod16.z.array(import_zod16.z.unknown())).optional()
15320
+ var SettingsSecretsShapeSchema = import_zod17.z.looseObject({
15321
+ env: import_zod17.z.record(import_zod17.z.string(), import_zod17.z.unknown()).optional(),
15322
+ hooks: import_zod17.z.record(import_zod17.z.string(), import_zod17.z.array(import_zod17.z.unknown())).optional()
15194
15323
  });
15195
15324
  function hookCommandCountOf(group) {
15196
15325
  if (typeof group !== "object" || group === null) {
@@ -15483,7 +15612,7 @@ function collectCheckReport(params) {
15483
15612
  }
15484
15613
 
15485
15614
  // src/checkReportSchema.ts
15486
- var import_zod18 = require("zod");
15615
+ var import_zod19 = require("zod");
15487
15616
  init_schema();
15488
15617
  init_claudeVersion();
15489
15618
  init_identity();
@@ -15547,124 +15676,124 @@ var DIAGNOSTIC_CODES = [
15547
15676
  var DIAGNOSTIC_SEVERITIES = ["error", "warning", "info"];
15548
15677
 
15549
15678
  // src/usage/pickReportSchema.ts
15550
- var import_zod17 = require("zod");
15679
+ var import_zod18 = require("zod");
15551
15680
  init_plan2();
15552
- var PoolPickCandidateViewSchema = import_zod17.z.strictObject({
15553
- identity: import_zod17.z.string(),
15681
+ var PoolPickCandidateViewSchema = import_zod18.z.strictObject({
15682
+ identity: import_zod18.z.string(),
15554
15683
  /** In pick order: `scored` has usable quota data, `unknown` has none, `pay-per-use` bills by use, `ineligible` is refused right now. */
15555
- class: import_zod17.z.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
15684
+ class: import_zod18.z.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
15556
15685
  /** Plan-size-weighted remaining quota per hour until its reset; present for `scored` only. */
15557
- score: import_zod17.z.number().optional(),
15686
+ score: import_zod18.z.number().optional(),
15558
15687
  /** 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`. */
15559
- scoreWindow: import_zod17.z.enum(["sevenDay", "fiveHour"]).optional(),
15688
+ scoreWindow: import_zod18.z.enum(["sevenDay", "fiveHour"]).optional(),
15560
15689
  /** False when the five-hour window would run dry, at the observed pace, before it resets. */
15561
- feasible: import_zod17.z.boolean(),
15690
+ feasible: import_zod18.z.boolean(),
15562
15691
  /** When an `ineligible` member can be used again, as an ISO instant. */
15563
- blockedUntil: import_zod17.z.iso.datetime().optional(),
15692
+ blockedUntil: import_zod18.z.iso.datetime().optional(),
15564
15693
  plan: PlanClassSchema,
15565
15694
  /** The facts behind the class and score, in the order they matter. */
15566
- reasons: import_zod17.z.array(import_zod17.z.string())
15695
+ reasons: import_zod18.z.array(import_zod18.z.string())
15567
15696
  });
15568
- var PoolPickReportSchema = import_zod17.z.strictObject({
15569
- pool: import_zod17.z.string(),
15570
- directory: import_zod17.z.string(),
15697
+ var PoolPickReportSchema = import_zod18.z.strictObject({
15698
+ pool: import_zod18.z.string(),
15699
+ directory: import_zod18.z.string(),
15571
15700
  /** The member a launch would run as, absent when every member is refused. */
15572
- pick: import_zod17.z.string().optional(),
15573
- candidates: import_zod17.z.array(PoolPickCandidateViewSchema),
15701
+ pick: import_zod18.z.string().optional(),
15702
+ candidates: import_zod18.z.array(PoolPickCandidateViewSchema),
15574
15703
  /** Identity members anywhere in the pool's graph that do not exist; a launch skips them. */
15575
- missing: import_zod17.z.array(import_zod17.z.string()),
15704
+ missing: import_zod18.z.array(import_zod18.z.string()),
15576
15705
  /** When nothing can be picked, the soonest any member returns. */
15577
- earliestReturn: import_zod17.z.strictObject({ identity: import_zod17.z.string(), at: import_zod17.z.iso.datetime() }).optional(),
15706
+ earliestReturn: import_zod18.z.strictObject({ identity: import_zod18.z.string(), at: import_zod18.z.iso.datetime() }).optional(),
15578
15707
  /** The member a resumed conversation started on but moved off, and why, when the ranking could not keep it. */
15579
- movedOff: import_zod17.z.strictObject({ identity: import_zod17.z.string(), reason: import_zod17.z.string() }).optional(),
15708
+ movedOff: import_zod18.z.strictObject({ identity: import_zod18.z.string(), reason: import_zod18.z.string() }).optional(),
15580
15709
  /** Why the last-pick record could not be read, when that is the case. */
15581
- stickyProblem: import_zod17.z.string().optional()
15710
+ stickyProblem: import_zod18.z.string().optional()
15582
15711
  });
15583
15712
 
15584
15713
  // src/checkReportSchema.ts
15585
15714
  var CHECK_CREDENTIAL_APPLIES = ["provider", "identity", "stored-login"];
15586
- var CheckLayerViewSchema = import_zod18.z.strictObject({
15587
- id: import_zod18.z.int(),
15588
- kind: import_zod18.z.enum(LAYER_KINDS),
15589
- source: import_zod18.z.string()
15715
+ var CheckLayerViewSchema = import_zod19.z.strictObject({
15716
+ id: import_zod19.z.int(),
15717
+ kind: import_zod19.z.enum(LAYER_KINDS),
15718
+ source: import_zod19.z.string()
15590
15719
  });
15591
- var CheckEntryViewSchema = import_zod18.z.strictObject({
15592
- path: import_zod18.z.string(),
15593
- shared: import_zod18.z.boolean(),
15594
- via: import_zod18.z.enum(DECISION_VIAS),
15720
+ var CheckEntryViewSchema = import_zod19.z.strictObject({
15721
+ path: import_zod19.z.string(),
15722
+ shared: import_zod19.z.boolean(),
15723
+ via: import_zod19.z.enum(DECISION_VIAS),
15595
15724
  /** The entry's real category, or null when nothing classifies it. */
15596
- category: import_zod18.z.enum(CATEGORY_NAMES).nullable(),
15597
- rule: import_zod18.z.strictObject({ key: import_zod18.z.string(), layer: import_zod18.z.int() }).optional(),
15725
+ category: import_zod19.z.enum(CATEGORY_NAMES).nullable(),
15726
+ rule: import_zod19.z.strictObject({ key: import_zod19.z.string(), layer: import_zod19.z.int() }).optional(),
15598
15727
  /** Rules that matched but whose `when` condition failed, each with the conditions that failed. */
15599
- eliminated: import_zod18.z.readonly(import_zod18.z.array(import_zod18.z.strictObject({ key: import_zod18.z.string(), failed: import_zod18.z.readonly(import_zod18.z.array(import_zod18.z.string())) }))).optional()
15728
+ eliminated: import_zod19.z.readonly(import_zod19.z.array(import_zod19.z.strictObject({ key: import_zod19.z.string(), failed: import_zod19.z.readonly(import_zod19.z.array(import_zod19.z.string())) }))).optional()
15600
15729
  });
15601
- var CheckDiagnosticSchema = import_zod18.z.strictObject({
15602
- code: import_zod18.z.enum(DIAGNOSTIC_CODES),
15603
- severity: import_zod18.z.enum(DIAGNOSTIC_SEVERITIES),
15604
- message: import_zod18.z.string(),
15605
- subject: import_zod18.z.string().optional(),
15606
- layer: import_zod18.z.int().optional()
15730
+ var CheckDiagnosticSchema = import_zod19.z.strictObject({
15731
+ code: import_zod19.z.enum(DIAGNOSTIC_CODES),
15732
+ severity: import_zod19.z.enum(DIAGNOSTIC_SEVERITIES),
15733
+ message: import_zod19.z.string(),
15734
+ subject: import_zod19.z.string().optional(),
15735
+ layer: import_zod19.z.int().optional()
15607
15736
  });
15608
- var CheckAmbientCredentialSchema = import_zod18.z.union([import_zod18.z.strictObject({ ok: import_zod18.z.literal(true) }), import_zod18.z.strictObject({ ok: import_zod18.z.literal(false), variable: import_zod18.z.string(), message: import_zod18.z.string() })]);
15609
- var CheckKeychainSchema = import_zod18.z.strictObject({
15610
- checked: import_zod18.z.literal(true),
15611
- found: import_zod18.z.boolean(),
15612
- serviceName: import_zod18.z.string().optional(),
15613
- note: import_zod18.z.string()
15737
+ var CheckAmbientCredentialSchema = import_zod19.z.union([import_zod19.z.strictObject({ ok: import_zod19.z.literal(true) }), import_zod19.z.strictObject({ ok: import_zod19.z.literal(false), variable: import_zod19.z.string(), message: import_zod19.z.string() })]);
15738
+ var CheckKeychainSchema = import_zod19.z.strictObject({
15739
+ checked: import_zod19.z.literal(true),
15740
+ found: import_zod19.z.boolean(),
15741
+ serviceName: import_zod19.z.string().optional(),
15742
+ note: import_zod19.z.string()
15614
15743
  });
15615
- var CheckSettingsExposureSchema = import_zod18.z.strictObject({
15616
- file: import_zod18.z.string(),
15617
- envKeyNames: import_zod18.z.readonly(import_zod18.z.array(import_zod18.z.string())),
15618
- hookEventNames: import_zod18.z.readonly(import_zod18.z.array(import_zod18.z.string())),
15619
- hookCommandCount: import_zod18.z.int().nonnegative()
15744
+ var CheckSettingsExposureSchema = import_zod19.z.strictObject({
15745
+ file: import_zod19.z.string(),
15746
+ envKeyNames: import_zod19.z.readonly(import_zod19.z.array(import_zod19.z.string())),
15747
+ hookEventNames: import_zod19.z.readonly(import_zod19.z.array(import_zod19.z.string())),
15748
+ hookCommandCount: import_zod19.z.int().nonnegative()
15620
15749
  });
15621
- var CredentialSourceSummarySchema = import_zod18.z.union([
15622
- import_zod18.z.strictObject({ kind: import_zod18.z.literal("env"), variable: import_zod18.z.string() }),
15623
- import_zod18.z.strictObject({ kind: import_zod18.z.literal("file"), path: import_zod18.z.string() }),
15624
- import_zod18.z.strictObject({ kind: import_zod18.z.literal("command"), program: import_zod18.z.string() }),
15625
- import_zod18.z.strictObject({ kind: import_zod18.z.literal("op"), reference: import_zod18.z.string() }),
15626
- import_zod18.z.strictObject({ kind: import_zod18.z.literal("keychain"), service: import_zod18.z.string(), account: import_zod18.z.string().optional() }),
15627
- import_zod18.z.strictObject({ kind: import_zod18.z.literal("literal") })
15750
+ var CredentialSourceSummarySchema = import_zod19.z.union([
15751
+ import_zod19.z.strictObject({ kind: import_zod19.z.literal("env"), variable: import_zod19.z.string() }),
15752
+ import_zod19.z.strictObject({ kind: import_zod19.z.literal("file"), path: import_zod19.z.string() }),
15753
+ import_zod19.z.strictObject({ kind: import_zod19.z.literal("command"), program: import_zod19.z.string() }),
15754
+ import_zod19.z.strictObject({ kind: import_zod19.z.literal("op"), reference: import_zod19.z.string() }),
15755
+ import_zod19.z.strictObject({ kind: import_zod19.z.literal("keychain"), service: import_zod19.z.string(), account: import_zod19.z.string().optional() }),
15756
+ import_zod19.z.strictObject({ kind: import_zod19.z.literal("literal") })
15628
15757
  ]);
15629
- var CredentialSummarySchema = import_zod18.z.strictObject({
15630
- target: import_zod18.z.enum(CREDENTIAL_TARGETS),
15631
- sources: import_zod18.z.readonly(import_zod18.z.array(CredentialSourceSummarySchema)),
15758
+ var CredentialSummarySchema = import_zod19.z.strictObject({
15759
+ target: import_zod19.z.enum(CREDENTIAL_TARGETS),
15760
+ sources: import_zod19.z.readonly(import_zod19.z.array(CredentialSourceSummarySchema)),
15632
15761
  cache: CredentialCacheSchema.optional()
15633
15762
  });
15634
- var CachedCredentialStateSchema = import_zod18.z.union([
15635
- import_zod18.z.strictObject({ store: import_zod18.z.enum(CREDENTIAL_CACHE_STORES), status: import_zod18.z.literal("empty") }),
15636
- import_zod18.z.strictObject({ store: import_zod18.z.enum(CREDENTIAL_CACHE_STORES), status: import_zod18.z.literal("unreadable"), reason: import_zod18.z.string() }),
15637
- import_zod18.z.strictObject({ store: import_zod18.z.enum(CREDENTIAL_CACHE_STORES), status: import_zod18.z.enum(["fresh", "expired"]), ageMs: import_zod18.z.number(), expiresInMs: import_zod18.z.number().optional() })
15763
+ var CachedCredentialStateSchema = import_zod19.z.union([
15764
+ import_zod19.z.strictObject({ store: import_zod19.z.enum(CREDENTIAL_CACHE_STORES), status: import_zod19.z.literal("empty") }),
15765
+ import_zod19.z.strictObject({ store: import_zod19.z.enum(CREDENTIAL_CACHE_STORES), status: import_zod19.z.literal("unreadable"), reason: import_zod19.z.string() }),
15766
+ import_zod19.z.strictObject({ store: import_zod19.z.enum(CREDENTIAL_CACHE_STORES), status: import_zod19.z.enum(["fresh", "expired"]), ageMs: import_zod19.z.number(), expiresInMs: import_zod19.z.number().optional() })
15638
15767
  ]);
15639
- var CheckCredentialProviderSchema = import_zod18.z.union([
15640
- import_zod18.z.strictObject({ name: import_zod18.z.string(), credential: CredentialSummarySchema.optional(), cached: CachedCredentialStateSchema.optional() }),
15641
- import_zod18.z.strictObject({ name: import_zod18.z.string(), problem: import_zod18.z.string() })
15768
+ var CheckCredentialProviderSchema = import_zod19.z.union([
15769
+ import_zod19.z.strictObject({ name: import_zod19.z.string(), credential: CredentialSummarySchema.optional(), cached: CachedCredentialStateSchema.optional() }),
15770
+ import_zod19.z.strictObject({ name: import_zod19.z.string(), problem: import_zod19.z.string() })
15642
15771
  ]);
15643
- var CheckCredentialSchema = import_zod18.z.strictObject({
15644
- applies: import_zod18.z.enum(CHECK_CREDENTIAL_APPLIES),
15772
+ var CheckCredentialSchema = import_zod19.z.strictObject({
15773
+ applies: import_zod19.z.enum(CHECK_CREDENTIAL_APPLIES),
15645
15774
  provider: CheckCredentialProviderSchema.optional(),
15646
15775
  identity: CredentialSummarySchema.optional(),
15647
15776
  identityCached: CachedCredentialStateSchema.optional()
15648
15777
  });
15649
- var CheckClaudeVersionSchema = import_zod18.z.strictObject({
15650
- pinned: import_zod18.z.strictObject({ version: import_zod18.z.string(), source: import_zod18.z.enum(CLAUDE_VERSION_SOURCES), installed: import_zod18.z.boolean() }).optional(),
15651
- highestInstalled: import_zod18.z.string().optional(),
15652
- installed: import_zod18.z.readonly(import_zod18.z.array(import_zod18.z.string()))
15778
+ var CheckClaudeVersionSchema = import_zod19.z.strictObject({
15779
+ pinned: import_zod19.z.strictObject({ version: import_zod19.z.string(), source: import_zod19.z.enum(CLAUDE_VERSION_SOURCES), installed: import_zod19.z.boolean() }).optional(),
15780
+ highestInstalled: import_zod19.z.string().optional(),
15781
+ installed: import_zod19.z.readonly(import_zod19.z.array(import_zod19.z.string()))
15653
15782
  });
15654
- var CheckReportJsonSchema = import_zod18.z.strictObject({
15655
- identity: import_zod18.z.strictObject({ name: import_zod18.z.string().nullable(), source: import_zod18.z.enum(IDENTITY_DECISION_SOURCES) }),
15783
+ var CheckReportJsonSchema = import_zod19.z.strictObject({
15784
+ identity: import_zod19.z.strictObject({ name: import_zod19.z.string().nullable(), source: import_zod19.z.enum(IDENTITY_DECISION_SOURCES) }),
15656
15785
  /** The pool ranking, when the launch named a pool instead of an identity. */
15657
15786
  pool: PoolPickReportSchema.optional(),
15658
- configProfile: import_zod18.z.strictObject({ name: import_zod18.z.string().nullable(), source: import_zod18.z.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
15659
- layers: import_zod18.z.readonly(import_zod18.z.array(CheckLayerViewSchema)),
15660
- entries: import_zod18.z.readonly(import_zod18.z.array(CheckEntryViewSchema)),
15661
- projectEncodingAmbiguities: import_zod18.z.readonly(
15662
- import_zod18.z.array(import_zod18.z.strictObject({ fragment: import_zod18.z.string(), encoded: import_zod18.z.string(), reason: import_zod18.z.enum(ENCODING_AMBIGUITY_REASONS), detail: import_zod18.z.string() }))
15787
+ configProfile: import_zod19.z.strictObject({ name: import_zod19.z.string().nullable(), source: import_zod19.z.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
15788
+ layers: import_zod19.z.readonly(import_zod19.z.array(CheckLayerViewSchema)),
15789
+ entries: import_zod19.z.readonly(import_zod19.z.array(CheckEntryViewSchema)),
15790
+ projectEncodingAmbiguities: import_zod19.z.readonly(
15791
+ import_zod19.z.array(import_zod19.z.strictObject({ fragment: import_zod19.z.string(), encoded: import_zod19.z.string(), reason: import_zod19.z.enum(ENCODING_AMBIGUITY_REASONS), detail: import_zod19.z.string() }))
15663
15792
  ),
15664
- diagnostics: import_zod18.z.readonly(import_zod18.z.array(CheckDiagnosticSchema)),
15793
+ diagnostics: import_zod19.z.readonly(import_zod19.z.array(CheckDiagnosticSchema)),
15665
15794
  ambientCredential: CheckAmbientCredentialSchema,
15666
15795
  keychain: CheckKeychainSchema.optional(),
15667
- settingsExposure: import_zod18.z.readonly(import_zod18.z.array(CheckSettingsExposureSchema)),
15796
+ settingsExposure: import_zod19.z.readonly(import_zod19.z.array(CheckSettingsExposureSchema)),
15668
15797
  credential: CheckCredentialSchema,
15669
15798
  claudeVersion: CheckClaudeVersionSchema.optional()
15670
15799
  });
@@ -15724,28 +15853,28 @@ function collectResets(snapshots, nowMs) {
15724
15853
  }
15725
15854
 
15726
15855
  // src/usage/resetsSchema.ts
15727
- var import_zod19 = require("zod");
15728
- var ResetRowSchema = import_zod19.z.strictObject({
15729
- identity: import_zod19.z.string(),
15730
- provider: import_zod19.z.string(),
15856
+ var import_zod20 = require("zod");
15857
+ var ResetRowSchema = import_zod20.z.strictObject({
15858
+ identity: import_zod20.z.string(),
15859
+ provider: import_zod20.z.string(),
15731
15860
  /** What the window is: `5h`, `7d` or `extra usage` for an Anthropic account, or the provider's own measure and period (`tokens 5h`). */
15732
- window: import_zod19.z.string(),
15861
+ window: import_zod20.z.string(),
15733
15862
  /** When the state the window comes from was observed, as an ISO instant. */
15734
- observedAt: import_zod19.z.iso.datetime(),
15863
+ observedAt: import_zod20.z.iso.datetime(),
15735
15864
  /** When the window resets, as an ISO instant; absent when the upstream reported none. */
15736
- resetsAt: import_zod19.z.iso.datetime().optional(),
15865
+ resetsAt: import_zod20.z.iso.datetime().optional(),
15737
15866
  /** True when the reset time has passed, so the recorded observation describes a window that no longer exists and its utilisation reads as 0. */
15738
- reset: import_zod19.z.boolean(),
15867
+ reset: import_zod20.z.boolean(),
15739
15868
  /** The fraction used, as `effectiveWindow` reads it at the report's own clock. */
15740
- utilization: import_zod19.z.number().optional(),
15869
+ utilization: import_zod20.z.number().optional(),
15741
15870
  /** The window's own status, for a window that has not reset yet. */
15742
- status: import_zod19.z.string().optional()
15871
+ status: import_zod20.z.string().optional()
15743
15872
  });
15744
- var ResetScheduleSchema = import_zod19.z.strictObject({ resets: import_zod19.z.readonly(import_zod19.z.array(ResetRowSchema)) });
15873
+ var ResetScheduleSchema = import_zod20.z.strictObject({ resets: import_zod20.z.readonly(import_zod20.z.array(ResetRowSchema)) });
15745
15874
 
15746
15875
  // src/frontdoor/controlSchemas.ts
15747
15876
  var import_node_path32 = __toESM(require("node:path"), 1);
15748
- var import_zod26 = require("zod");
15877
+ var import_zod27 = require("zod");
15749
15878
 
15750
15879
  // src/doctorReport.ts
15751
15880
  init_claudeShim();
@@ -15925,24 +16054,24 @@ var import_node_path31 = __toESM(require("node:path"), 1);
15925
16054
  init_signIn();
15926
16055
 
15927
16056
  // src/codex/siwcStore.ts
15928
- var import_zod23 = require("zod");
16057
+ var import_zod24 = require("zod");
15929
16058
 
15930
16059
  // src/codex/auth.ts
15931
- var import_zod21 = require("zod");
15932
- var AuthFileSchema = import_zod21.z.looseObject({
15933
- tokens: import_zod21.z.looseObject({
15934
- access_token: import_zod21.z.string().optional(),
15935
- refresh_token: import_zod21.z.string().optional(),
15936
- id_token: import_zod21.z.string().optional(),
15937
- account_id: import_zod21.z.string().optional()
16060
+ var import_zod22 = require("zod");
16061
+ var AuthFileSchema = import_zod22.z.looseObject({
16062
+ tokens: import_zod22.z.looseObject({
16063
+ access_token: import_zod22.z.string().optional(),
16064
+ refresh_token: import_zod22.z.string().optional(),
16065
+ id_token: import_zod22.z.string().optional(),
16066
+ account_id: import_zod22.z.string().optional()
15938
16067
  }).nullish(),
15939
- last_refresh: import_zod21.z.string().optional()
16068
+ last_refresh: import_zod22.z.string().optional()
15940
16069
  });
15941
- var TokenGrantSchema = import_zod21.z.looseObject({
15942
- access_token: import_zod21.z.string().min(1).optional(),
15943
- refresh_token: import_zod21.z.string().min(1).optional(),
15944
- id_token: import_zod21.z.string().min(1).optional(),
15945
- account_id: import_zod21.z.string().min(1).optional()
16070
+ var TokenGrantSchema = import_zod22.z.looseObject({
16071
+ access_token: import_zod22.z.string().min(1).optional(),
16072
+ refresh_token: import_zod22.z.string().min(1).optional(),
16073
+ id_token: import_zod22.z.string().min(1).optional(),
16074
+ account_id: import_zod22.z.string().min(1).optional()
15946
16075
  });
15947
16076
  var CodexAuthError = class extends Error {
15948
16077
  constructor(message) {
@@ -15952,41 +16081,41 @@ var CodexAuthError = class extends Error {
15952
16081
  };
15953
16082
 
15954
16083
  // src/codex/siwc.ts
15955
- var import_zod22 = require("zod");
16084
+ var import_zod23 = require("zod");
15956
16085
  var SIWC_RESOURCE = "https://api.openai.com/v1";
15957
16086
  var SIWC_RESPONSES_URL = `${SIWC_RESOURCE}/responses`;
15958
16087
  var SIWC_PLAN_SCOPE = "chatgpt.tokens.use.direct";
15959
- var TokenResponseSchema = import_zod22.z.looseObject({
15960
- access_token: import_zod22.z.string().min(1),
15961
- refresh_token: import_zod22.z.string().min(1).optional(),
15962
- id_token: import_zod22.z.string().min(1).optional(),
15963
- expires_in: import_zod22.z.number().positive(),
15964
- scope: import_zod22.z.string().optional()
16088
+ var TokenResponseSchema = import_zod23.z.looseObject({
16089
+ access_token: import_zod23.z.string().min(1),
16090
+ refresh_token: import_zod23.z.string().min(1).optional(),
16091
+ id_token: import_zod23.z.string().min(1).optional(),
16092
+ expires_in: import_zod23.z.number().positive(),
16093
+ scope: import_zod23.z.string().optional()
15965
16094
  });
15966
- var JwtHeaderSchema = import_zod22.z.looseObject({ alg: import_zod22.z.string(), kid: import_zod22.z.string().optional() });
15967
- var IdTokenClaimsSchema = import_zod22.z.looseObject({
15968
- iss: import_zod22.z.string(),
15969
- sub: import_zod22.z.string().min(1),
15970
- aud: import_zod22.z.union([import_zod22.z.string(), import_zod22.z.array(import_zod22.z.string())]),
15971
- exp: import_zod22.z.number(),
15972
- nonce: import_zod22.z.string().optional(),
15973
- email: import_zod22.z.string().optional()
16095
+ var JwtHeaderSchema = import_zod23.z.looseObject({ alg: import_zod23.z.string(), kid: import_zod23.z.string().optional() });
16096
+ var IdTokenClaimsSchema = import_zod23.z.looseObject({
16097
+ iss: import_zod23.z.string(),
16098
+ sub: import_zod23.z.string().min(1),
16099
+ aud: import_zod23.z.union([import_zod23.z.string(), import_zod23.z.array(import_zod23.z.string())]),
16100
+ exp: import_zod23.z.number(),
16101
+ nonce: import_zod23.z.string().optional(),
16102
+ email: import_zod23.z.string().optional()
15974
16103
  });
15975
- var JwksSchema = import_zod22.z.object({ keys: import_zod22.z.array(import_zod22.z.looseObject({ kid: import_zod22.z.string().optional(), kty: import_zod22.z.string() })) });
16104
+ var JwksSchema = import_zod23.z.object({ keys: import_zod23.z.array(import_zod23.z.looseObject({ kid: import_zod23.z.string().optional(), kty: import_zod23.z.string() })) });
15976
16105
 
15977
16106
  // src/codex/siwcStore.ts
15978
- var SiwcGrantSchema = import_zod23.z.strictObject({
15979
- clientId: import_zod23.z.string().min(1),
15980
- sub: import_zod23.z.string().min(1),
15981
- email: import_zod23.z.string().optional(),
15982
- idToken: import_zod23.z.string().min(1),
15983
- accessToken: import_zod23.z.string().min(1),
15984
- refreshToken: import_zod23.z.string().min(1),
15985
- scopes: import_zod23.z.array(import_zod23.z.string()).readonly(),
16107
+ var SiwcGrantSchema = import_zod24.z.strictObject({
16108
+ clientId: import_zod24.z.string().min(1),
16109
+ sub: import_zod24.z.string().min(1),
16110
+ email: import_zod24.z.string().optional(),
16111
+ idToken: import_zod24.z.string().min(1),
16112
+ accessToken: import_zod24.z.string().min(1),
16113
+ refreshToken: import_zod24.z.string().min(1),
16114
+ scopes: import_zod24.z.array(import_zod24.z.string()).readonly(),
15986
16115
  /** When the access token stops working, in milliseconds since the epoch. */
15987
- expiresAt: import_zod23.z.number()
16116
+ expiresAt: import_zod24.z.number()
15988
16117
  });
15989
- var SiwcFileSchema = import_zod23.z.strictObject({ registeredClientId: import_zod23.z.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
16118
+ var SiwcFileSchema = import_zod24.z.strictObject({ registeredClientId: import_zod24.z.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
15990
16119
  function parseSiwcFile(raw, filePath) {
15991
16120
  let json;
15992
16121
  try {
@@ -16950,92 +17079,92 @@ function collectDoctorReport(params) {
16950
17079
  // src/frontdoor/controlSchemas.ts
16951
17080
  init_schema2();
16952
17081
  init_state();
16953
- var UsageListOutputSchema = import_zod26.z.strictObject({ snapshots: import_zod26.z.readonly(import_zod26.z.array(UsageSnapshotSchema)) });
16954
- var UsageWindowsInputSchema = import_zod26.z.strictObject({
16955
- identity: import_zod26.z.string().min(1),
16956
- provider: import_zod26.z.string().min(1).optional()
17082
+ var UsageListOutputSchema = import_zod27.z.strictObject({ snapshots: import_zod27.z.readonly(import_zod27.z.array(UsageSnapshotSchema)) });
17083
+ var UsageWindowsInputSchema = import_zod27.z.strictObject({
17084
+ identity: import_zod27.z.string().min(1),
17085
+ provider: import_zod27.z.string().min(1).optional()
16957
17086
  });
16958
- var EffectiveWindowSchema = import_zod26.z.strictObject({
17087
+ var EffectiveWindowSchema = import_zod27.z.strictObject({
16959
17088
  /** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
16960
- reset: import_zod26.z.boolean(),
17089
+ reset: import_zod27.z.boolean(),
16961
17090
  /** The fraction used: 0 for a reset window, otherwise what was last observed, absent when none was reported. */
16962
- utilization: import_zod26.z.number().optional(),
17091
+ utilization: import_zod27.z.number().optional(),
16963
17092
  /** The reset instant, for a window that has not reset yet and reported one. */
16964
- resetsAtMs: import_zod26.z.number().optional(),
17093
+ resetsAtMs: import_zod27.z.number().optional(),
16965
17094
  /** The window's own status, for a window that has not reset yet. */
16966
- status: import_zod26.z.string().optional()
17095
+ status: import_zod27.z.string().optional()
16967
17096
  });
16968
- var UsageWindowsOutputSchema = import_zod26.z.strictObject({
16969
- identity: import_zod26.z.string(),
16970
- provider: import_zod26.z.string(),
17097
+ var UsageWindowsOutputSchema = import_zod27.z.strictObject({
17098
+ identity: import_zod27.z.string(),
17099
+ provider: import_zod27.z.string(),
16971
17100
  /** When the rate-limit state the windows come from was observed. */
16972
- observedAt: import_zod26.z.iso.datetime().optional(),
17101
+ observedAt: import_zod27.z.iso.datetime().optional(),
16973
17102
  fiveHour: EffectiveWindowSchema.optional(),
16974
17103
  sevenDay: EffectiveWindowSchema.optional()
16975
17104
  });
16976
- var UsageLiveOutputSchema = import_zod26.z.strictObject({
17105
+ var UsageLiveOutputSchema = import_zod27.z.strictObject({
16977
17106
  /** 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. */
16978
17107
  latest: RcLiveRateLimitSchema.optional(),
16979
17108
  /** One observation per session whose stream has filed a rate_limit_event this door generation. */
16980
- sessions: import_zod26.z.readonly(import_zod26.z.array(RcLiveRateLimitSchema))
17109
+ sessions: import_zod27.z.readonly(import_zod27.z.array(RcLiveRateLimitSchema))
16981
17110
  });
16982
- var FrontDoorSessionStatusSchema = import_zod26.z.strictObject({
16983
- pid: import_zod26.z.int().positive(),
16984
- startedAt: import_zod26.z.number(),
16985
- alive: import_zod26.z.boolean()
17111
+ var FrontDoorSessionStatusSchema = import_zod27.z.strictObject({
17112
+ pid: import_zod27.z.int().positive(),
17113
+ startedAt: import_zod27.z.number(),
17114
+ alive: import_zod27.z.boolean()
16986
17115
  });
16987
- var HeadroomSocketTargetSchema = import_zod26.z.union([import_zod26.z.strictObject({ socketPath: import_zod26.z.string() }), import_zod26.z.strictObject({ refused: import_zod26.z.string() })]);
16988
- var FrontDoorStatusOutputSchema = import_zod26.z.strictObject({
17116
+ var HeadroomSocketTargetSchema = import_zod27.z.union([import_zod27.z.strictObject({ socketPath: import_zod27.z.string() }), import_zod27.z.strictObject({ refused: import_zod27.z.string() })]);
17117
+ var FrontDoorStatusOutputSchema = import_zod27.z.strictObject({
16989
17118
  state: FrontDoorStateSchema,
16990
- supervisorAlive: import_zod26.z.boolean(),
17119
+ supervisorAlive: import_zod27.z.boolean(),
16991
17120
  /** The pids of earlier doors that released their addresses and are finishing the connections they carried: running, but not serving anything new. */
16992
- draining: import_zod26.z.readonly(import_zod26.z.array(import_zod26.z.number().int().positive())),
16993
- sessions: import_zod26.z.readonly(import_zod26.z.array(FrontDoorSessionStatusSchema)),
17121
+ draining: import_zod27.z.readonly(import_zod27.z.array(import_zod27.z.number().int().positive())),
17122
+ sessions: import_zod27.z.readonly(import_zod27.z.array(FrontDoorSessionStatusSchema)),
16994
17123
  headroomSocket: HeadroomSocketTargetSchema.optional(),
16995
- logPath: import_zod26.z.string(),
16996
- logExists: import_zod26.z.boolean()
17124
+ logPath: import_zod27.z.string(),
17125
+ logExists: import_zod27.z.boolean()
16997
17126
  });
16998
- var FrontDoorSessionsOutputSchema = import_zod26.z.strictObject({ sessions: import_zod26.z.readonly(import_zod26.z.array(FrontDoorSessionStatusSchema)) });
16999
- var CheckRunInputSchema = import_zod26.z.strictObject({
17000
- path: import_zod26.z.string().min(1),
17001
- identity: import_zod26.z.string().min(1).optional()
17127
+ var FrontDoorSessionsOutputSchema = import_zod27.z.strictObject({ sessions: import_zod27.z.readonly(import_zod27.z.array(FrontDoorSessionStatusSchema)) });
17128
+ var CheckRunInputSchema = import_zod27.z.strictObject({
17129
+ path: import_zod27.z.string().min(1),
17130
+ identity: import_zod27.z.string().min(1).optional()
17002
17131
  }).refine((input) => import_node_path32.default.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
17003
- var PoolPickInputSchema = import_zod26.z.strictObject({
17004
- pool: import_zod26.z.string().min(1),
17005
- path: import_zod26.z.string().min(1)
17132
+ var PoolPickInputSchema = import_zod27.z.strictObject({
17133
+ pool: import_zod27.z.string().min(1),
17134
+ path: import_zod27.z.string().min(1)
17006
17135
  }).refine((input) => import_node_path32.default.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
17007
- var DoctorFindingSchema = import_zod26.z.strictObject({
17008
- section: import_zod26.z.enum(DOCTOR_SECTIONS),
17009
- subject: import_zod26.z.string().optional(),
17010
- severity: import_zod26.z.enum(DOCTOR_SEVERITIES),
17011
- message: import_zod26.z.string()
17136
+ var DoctorFindingSchema = import_zod27.z.strictObject({
17137
+ section: import_zod27.z.enum(DOCTOR_SECTIONS),
17138
+ subject: import_zod27.z.string().optional(),
17139
+ severity: import_zod27.z.enum(DOCTOR_SEVERITIES),
17140
+ message: import_zod27.z.string()
17012
17141
  });
17013
- var DoctorRunOutputSchema = import_zod26.z.strictObject({
17142
+ var DoctorRunOutputSchema = import_zod27.z.strictObject({
17014
17143
  /** False exactly when any finding is a `fail`; a `warn` never fails the report on its own. */
17015
- ok: import_zod26.z.boolean(),
17016
- findings: import_zod26.z.readonly(import_zod26.z.array(DoctorFindingSchema))
17144
+ ok: import_zod27.z.boolean(),
17145
+ findings: import_zod27.z.readonly(import_zod27.z.array(DoctorFindingSchema))
17017
17146
  });
17018
- var FrontDoorRestartOutputSchema = import_zod26.z.strictObject({
17019
- action: import_zod26.z.literal("restarting"),
17020
- previousPid: import_zod26.z.int().positive()
17147
+ var FrontDoorRestartOutputSchema = import_zod27.z.strictObject({
17148
+ action: import_zod27.z.literal("restarting"),
17149
+ previousPid: import_zod27.z.int().positive()
17021
17150
  });
17022
- var UpdateCheckOutputSchema = import_zod26.z.strictObject({
17023
- current: import_zod26.z.string(),
17024
- latest: import_zod26.z.string(),
17025
- action: import_zod26.z.enum(["current", "available", "updated"])
17151
+ var UpdateCheckOutputSchema = import_zod27.z.strictObject({
17152
+ current: import_zod27.z.string(),
17153
+ latest: import_zod27.z.string(),
17154
+ action: import_zod27.z.enum(["current", "available", "updated"])
17026
17155
  });
17027
- var CodexSignInSchema = import_zod26.z.discriminatedUnion("state", [
17028
- import_zod26.z.strictObject({ state: import_zod26.z.literal("none") }),
17029
- import_zod26.z.strictObject({ state: import_zod26.z.literal("signed-in"), email: import_zod26.z.string().optional(), planScope: import_zod26.z.boolean(), accessTokenExpiresAt: import_zod26.z.number() }),
17030
- import_zod26.z.strictObject({ state: import_zod26.z.literal("unreadable"), message: import_zod26.z.string() })
17156
+ var CodexSignInSchema = import_zod27.z.discriminatedUnion("state", [
17157
+ import_zod27.z.strictObject({ state: import_zod27.z.literal("none") }),
17158
+ import_zod27.z.strictObject({ state: import_zod27.z.literal("signed-in"), email: import_zod27.z.string().optional(), planScope: import_zod27.z.boolean(), accessTokenExpiresAt: import_zod27.z.number() }),
17159
+ import_zod27.z.strictObject({ state: import_zod27.z.literal("unreadable"), message: import_zod27.z.string() })
17031
17160
  ]);
17032
- var CodexStatusOutputSchema = import_zod26.z.strictObject({
17161
+ var CodexStatusOutputSchema = import_zod27.z.strictObject({
17033
17162
  signIn: CodexSignInSchema,
17034
- codexProviders: import_zod26.z.readonly(import_zod26.z.array(import_zod26.z.string()))
17163
+ codexProviders: import_zod27.z.readonly(import_zod27.z.array(import_zod27.z.string()))
17035
17164
  });
17036
- var CodexLogoutOutputSchema = import_zod26.z.strictObject({
17037
- hadGrant: import_zod26.z.boolean(),
17038
- revoked: import_zod26.z.boolean()
17165
+ var CodexLogoutOutputSchema = import_zod27.z.strictObject({
17166
+ hadGrant: import_zod27.z.boolean(),
17167
+ revoked: import_zod27.z.boolean()
17039
17168
  });
17040
17169
 
17041
17170
  // src/frontdoor/codexApi.ts
@@ -17193,144 +17322,146 @@ init_identity();
17193
17322
  init_providersStore();
17194
17323
 
17195
17324
  // src/frontdoor/configSchemas.ts
17196
- var import_zod27 = require("zod");
17325
+ var import_zod28 = require("zod");
17197
17326
  init_schema();
17198
- var RemovalConfirmationSchema = import_zod27.z.boolean();
17199
- var CredentialWriteSchema = (targets) => import_zod27.z.strictObject({
17200
- sources: import_zod27.z.array(RemoteCredentialSourceSchema).min(1).optional(),
17201
- target: import_zod27.z.enum(targets).optional(),
17202
- cache: import_zod27.z.union([import_zod27.z.literal(false), CredentialCacheSchema]).optional()
17327
+ init_statusline();
17328
+ var RemovalConfirmationSchema = import_zod28.z.boolean();
17329
+ var CredentialWriteSchema = (targets) => import_zod28.z.strictObject({
17330
+ sources: import_zod28.z.array(RemoteCredentialSourceSchema).min(1).optional(),
17331
+ target: import_zod28.z.enum(targets).optional(),
17332
+ cache: import_zod28.z.union([import_zod28.z.literal(false), CredentialCacheSchema]).optional()
17203
17333
  });
17204
- var CredentialSummarySchema2 = import_zod27.z.strictObject({
17205
- target: import_zod27.z.enum(CREDENTIAL_TARGETS),
17206
- sources: import_zod27.z.readonly(import_zod27.z.array(
17207
- import_zod27.z.discriminatedUnion("kind", [
17208
- import_zod27.z.strictObject({ kind: import_zod27.z.literal("env"), variable: import_zod27.z.string() }),
17209
- import_zod27.z.strictObject({ kind: import_zod27.z.literal("file"), path: import_zod27.z.string() }),
17210
- import_zod27.z.strictObject({ kind: import_zod27.z.literal("command"), program: import_zod27.z.string() }),
17211
- import_zod27.z.strictObject({ kind: import_zod27.z.literal("op"), reference: import_zod27.z.string() }),
17212
- import_zod27.z.strictObject({ kind: import_zod27.z.literal("keychain"), service: import_zod27.z.string(), account: import_zod27.z.string().optional() }),
17213
- import_zod27.z.strictObject({ kind: import_zod27.z.literal("literal") })
17334
+ var CredentialSummarySchema2 = import_zod28.z.strictObject({
17335
+ target: import_zod28.z.enum(CREDENTIAL_TARGETS),
17336
+ sources: import_zod28.z.readonly(import_zod28.z.array(
17337
+ import_zod28.z.discriminatedUnion("kind", [
17338
+ import_zod28.z.strictObject({ kind: import_zod28.z.literal("env"), variable: import_zod28.z.string() }),
17339
+ import_zod28.z.strictObject({ kind: import_zod28.z.literal("file"), path: import_zod28.z.string() }),
17340
+ import_zod28.z.strictObject({ kind: import_zod28.z.literal("command"), program: import_zod28.z.string() }),
17341
+ import_zod28.z.strictObject({ kind: import_zod28.z.literal("op"), reference: import_zod28.z.string() }),
17342
+ import_zod28.z.strictObject({ kind: import_zod28.z.literal("keychain"), service: import_zod28.z.string(), account: import_zod28.z.string().optional() }),
17343
+ import_zod28.z.strictObject({ kind: import_zod28.z.literal("literal") })
17214
17344
  ])
17215
17345
  )),
17216
17346
  cache: CredentialCacheSchema.optional()
17217
17347
  });
17218
- var mutationOutput = (kind, action) => import_zod27.z.strictObject({ action: import_zod27.z.literal(action), kind: import_zod27.z.literal(kind), name: import_zod27.z.string() });
17219
- var storedMutationOutput = (kind, action, value) => import_zod27.z.strictObject({ action: import_zod27.z.literal(action), kind: import_zod27.z.literal(kind), name: import_zod27.z.string(), value });
17220
- var IdentityValueSchema = import_zod27.z.strictObject({
17221
- name: import_zod27.z.string(),
17222
- defaultConfigProfile: import_zod27.z.string().optional(),
17223
- allowAmbientCredential: import_zod27.z.boolean(),
17348
+ var mutationOutput = (kind, action) => import_zod28.z.strictObject({ action: import_zod28.z.literal(action), kind: import_zod28.z.literal(kind), name: import_zod28.z.string() });
17349
+ var storedMutationOutput = (kind, action, value) => import_zod28.z.strictObject({ action: import_zod28.z.literal(action), kind: import_zod28.z.literal(kind), name: import_zod28.z.string(), value });
17350
+ var IdentityValueSchema = import_zod28.z.strictObject({
17351
+ name: import_zod28.z.string(),
17352
+ defaultConfigProfile: import_zod28.z.string().optional(),
17353
+ allowAmbientCredential: import_zod28.z.boolean(),
17224
17354
  credential: CredentialSummarySchema2.optional(),
17225
- anchors: import_zod27.z.array(AnchorSchema).optional()
17355
+ anchors: import_zod28.z.array(AnchorSchema).optional()
17226
17356
  });
17227
17357
  var ProfileValueSchema = ConfigProfileSchema.omit({ $schema: true });
17228
- var ProviderValueSchema = import_zod27.z.strictObject({
17229
- name: import_zod27.z.string(),
17230
- kind: import_zod27.z.enum(PROVIDER_KINDS),
17231
- displayName: import_zod27.z.string(),
17232
- baseUrl: import_zod27.z.string().optional(),
17358
+ var ProviderValueSchema = import_zod28.z.strictObject({
17359
+ name: import_zod28.z.string(),
17360
+ kind: import_zod28.z.enum(PROVIDER_KINDS),
17361
+ displayName: import_zod28.z.string(),
17362
+ baseUrl: import_zod28.z.string().optional(),
17233
17363
  codex: CodexProviderConfigSchema.optional(),
17234
17364
  credential: CredentialSummarySchema2.optional(),
17235
- env: import_zod27.z.record(import_zod27.z.string(), import_zod27.z.string()).optional()
17365
+ env: import_zod28.z.record(import_zod28.z.string(), import_zod28.z.string()).optional()
17236
17366
  });
17237
- var ConfigNameInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1) });
17367
+ var ConfigNameInputSchema = import_zod28.z.strictObject({ name: import_zod28.z.string().min(1) });
17238
17368
  var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
17239
- var ConfigIdentitySetInputSchema = import_zod27.z.strictObject({
17240
- name: import_zod27.z.string().min(1),
17241
- defaultConfigProfile: import_zod27.z.union([import_zod27.z.string().min(1), import_zod27.z.literal(false)]).optional(),
17242
- allowAmbientCredential: import_zod27.z.boolean().optional(),
17243
- credential: import_zod27.z.union([import_zod27.z.literal(false), CredentialWriteSchema(CREDENTIAL_TARGETS)]).optional(),
17369
+ var ConfigIdentitySetInputSchema = import_zod28.z.strictObject({
17370
+ name: import_zod28.z.string().min(1),
17371
+ defaultConfigProfile: import_zod28.z.union([import_zod28.z.string().min(1), import_zod28.z.literal(false)]).optional(),
17372
+ allowAmbientCredential: import_zod28.z.boolean().optional(),
17373
+ credential: import_zod28.z.union([import_zod28.z.literal(false), CredentialWriteSchema(CREDENTIAL_TARGETS)]).optional(),
17244
17374
  /** `false` removes the anchors; a list replaces them. */
17245
- anchors: import_zod27.z.union([import_zod27.z.literal(false), import_zod27.z.array(AnchorSchema).min(1)]).optional()
17375
+ anchors: import_zod28.z.union([import_zod28.z.literal(false), import_zod28.z.array(AnchorSchema).min(1)]).optional()
17246
17376
  });
17247
17377
  var ConfigIdentitySetOutputSchema = storedMutationOutput("identity", "updated", IdentityValueSchema);
17248
- var ConfigIdentityRemoveInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
17378
+ var ConfigIdentityRemoveInputSchema = import_zod28.z.strictObject({ name: import_zod28.z.string().min(1), confirm: RemovalConfirmationSchema });
17249
17379
  var ConfigIdentityRemoveOutputSchema = mutationOutput("identity", "removed");
17250
17380
  var ConfigIdentityUseOutputSchema = mutationOutput("identity", "selected");
17251
- var ConfigProfileAddInputSchema = import_zod27.z.strictObject({
17252
- name: import_zod27.z.string().min(1),
17253
- extends: import_zod27.z.array(import_zod27.z.string().min(1)).optional(),
17254
- description: import_zod27.z.string().optional()
17381
+ var ConfigProfileAddInputSchema = import_zod28.z.strictObject({
17382
+ name: import_zod28.z.string().min(1),
17383
+ extends: import_zod28.z.array(import_zod28.z.string().min(1)).optional(),
17384
+ description: import_zod28.z.string().optional()
17255
17385
  });
17256
17386
  var ConfigProfileAddOutputSchema = storedMutationOutput("profile", "created", ProfileValueSchema);
17257
- var ConfigProfileSetInputSchema = import_zod27.z.strictObject({
17258
- name: import_zod27.z.string().min(1),
17259
- category: import_zod27.z.record(import_zod27.z.string(), import_zod27.z.boolean()).optional(),
17260
- entry: import_zod27.z.record(import_zod27.z.string(), import_zod27.z.boolean()).optional(),
17261
- extends: import_zod27.z.union([import_zod27.z.array(import_zod27.z.string().min(1)), import_zod27.z.literal(false)]).optional(),
17262
- description: import_zod27.z.union([import_zod27.z.string(), import_zod27.z.literal(false)]).optional(),
17263
- launch: import_zod27.z.strictObject({
17264
- skipPermissions: import_zod27.z.boolean().optional(),
17265
- remoteControl: import_zod27.z.boolean().optional(),
17266
- headroom: import_zod27.z.boolean().optional(),
17267
- trackUsage: import_zod27.z.boolean().optional(),
17268
- provider: import_zod27.z.union([import_zod27.z.string().min(1), import_zod27.z.literal(false)]).optional(),
17269
- claudeVersion: import_zod27.z.union([import_zod27.z.string().min(1), import_zod27.z.literal(false)]).optional(),
17270
- delay: import_zod27.z.union([import_zod27.z.string().regex(DURATION_RE), import_zod27.z.literal(false)]).optional(),
17271
- pause: import_zod27.z.boolean().optional(),
17272
- explain: import_zod27.z.boolean().optional(),
17273
- proxyBypass: import_zod27.z.union([import_zod27.z.array(import_zod27.z.string().min(1)), import_zod27.z.literal(false)]).optional()
17387
+ var ConfigProfileSetInputSchema = import_zod28.z.strictObject({
17388
+ name: import_zod28.z.string().min(1),
17389
+ category: import_zod28.z.record(import_zod28.z.string(), import_zod28.z.boolean()).optional(),
17390
+ entry: import_zod28.z.record(import_zod28.z.string(), import_zod28.z.boolean()).optional(),
17391
+ extends: import_zod28.z.union([import_zod28.z.array(import_zod28.z.string().min(1)), import_zod28.z.literal(false)]).optional(),
17392
+ description: import_zod28.z.union([import_zod28.z.string(), import_zod28.z.literal(false)]).optional(),
17393
+ launch: import_zod28.z.strictObject({
17394
+ skipPermissions: import_zod28.z.boolean().optional(),
17395
+ remoteControl: import_zod28.z.boolean().optional(),
17396
+ headroom: import_zod28.z.boolean().optional(),
17397
+ trackUsage: import_zod28.z.boolean().optional(),
17398
+ provider: import_zod28.z.union([import_zod28.z.string().min(1), import_zod28.z.literal(false)]).optional(),
17399
+ claudeVersion: import_zod28.z.union([import_zod28.z.string().min(1), import_zod28.z.literal(false)]).optional(),
17400
+ delay: import_zod28.z.union([import_zod28.z.string().regex(DURATION_RE), import_zod28.z.literal(false)]).optional(),
17401
+ pause: import_zod28.z.boolean().optional(),
17402
+ explain: import_zod28.z.boolean().optional(),
17403
+ proxyBypass: import_zod28.z.union([import_zod28.z.array(import_zod28.z.string().min(1)), import_zod28.z.literal(false)]).optional(),
17404
+ statusline: StatuslineChangeSchema.optional()
17274
17405
  }).optional()
17275
17406
  });
17276
17407
  var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
17277
- var ConfigProfileRemoveInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
17408
+ var ConfigProfileRemoveInputSchema = import_zod28.z.strictObject({ name: import_zod28.z.string().min(1), confirm: RemovalConfirmationSchema });
17278
17409
  var ConfigProfileRemoveOutputSchema = mutationOutput("profile", "removed");
17279
17410
  var ConfigProfileUseOutputSchema = mutationOutput("profile", "selected");
17280
- var PoolMembersInputSchema = import_zod27.z.array(import_zod27.z.string().min(1)).min(1);
17281
- var ConfigPoolAddInputSchema = import_zod27.z.strictObject({
17282
- name: import_zod27.z.string().min(1),
17411
+ var PoolMembersInputSchema = import_zod28.z.array(import_zod28.z.string().min(1)).min(1);
17412
+ var ConfigPoolAddInputSchema = import_zod28.z.strictObject({
17413
+ name: import_zod28.z.string().min(1),
17283
17414
  identities: PoolMembersInputSchema,
17284
- preference: import_zod27.z.enum(POOL_PREFERENCES).optional(),
17285
- resumeOnLimit: import_zod27.z.boolean().optional(),
17286
- compactBeforeLimit: import_zod27.z.boolean().optional(),
17415
+ preference: import_zod28.z.enum(POOL_PREFERENCES).optional(),
17416
+ resumeOnLimit: import_zod28.z.boolean().optional(),
17417
+ compactBeforeLimit: import_zod28.z.boolean().optional(),
17287
17418
  compactAtUtilisation: CompactAtUtilisationSchema.optional()
17288
17419
  });
17289
17420
  var ConfigPoolAddOutputSchema = storedMutationOutput("pool", "created", PoolSchema);
17290
- var ConfigPoolSetInputSchema = import_zod27.z.strictObject({
17291
- name: import_zod27.z.string().min(1),
17421
+ var ConfigPoolSetInputSchema = import_zod28.z.strictObject({
17422
+ name: import_zod28.z.string().min(1),
17292
17423
  identities: PoolMembersInputSchema.optional(),
17293
- preference: import_zod27.z.union([import_zod27.z.enum(POOL_PREFERENCES), import_zod27.z.literal(false)]).optional(),
17294
- resumeOnLimit: import_zod27.z.boolean().optional(),
17295
- compactBeforeLimit: import_zod27.z.boolean().optional(),
17296
- compactAtUtilisation: import_zod27.z.union([CompactAtUtilisationSchema, import_zod27.z.literal(false)]).optional()
17424
+ preference: import_zod28.z.union([import_zod28.z.enum(POOL_PREFERENCES), import_zod28.z.literal(false)]).optional(),
17425
+ resumeOnLimit: import_zod28.z.boolean().optional(),
17426
+ compactBeforeLimit: import_zod28.z.boolean().optional(),
17427
+ compactAtUtilisation: import_zod28.z.union([CompactAtUtilisationSchema, import_zod28.z.literal(false)]).optional()
17297
17428
  });
17298
17429
  var ConfigPoolSetOutputSchema = storedMutationOutput("pool", "updated", PoolSchema);
17299
- var ConfigPoolRemoveInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
17430
+ var ConfigPoolRemoveInputSchema = import_zod28.z.strictObject({ name: import_zod28.z.string().min(1), confirm: RemovalConfirmationSchema });
17300
17431
  var ConfigPoolRemoveOutputSchema = mutationOutput("pool", "removed");
17301
17432
  var ConfigPoolUseOutputSchema = mutationOutput("pool", "selected");
17302
- var ConfigProviderAddInputSchema = import_zod27.z.strictObject({
17303
- name: import_zod27.z.string().min(1),
17304
- kind: import_zod27.z.enum(PROVIDER_KINDS).optional(),
17305
- displayName: import_zod27.z.string().min(1),
17306
- baseUrl: import_zod27.z.string().min(1).optional(),
17433
+ var ConfigProviderAddInputSchema = import_zod28.z.strictObject({
17434
+ name: import_zod28.z.string().min(1),
17435
+ kind: import_zod28.z.enum(PROVIDER_KINDS).optional(),
17436
+ displayName: import_zod28.z.string().min(1),
17437
+ baseUrl: import_zod28.z.string().min(1).optional(),
17307
17438
  credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).required({ sources: true }),
17308
17439
  codex: CodexProviderConfigSchema.optional()
17309
17440
  });
17310
17441
  var ConfigProviderAddOutputSchema = storedMutationOutput("provider", "created", ProviderValueSchema);
17311
- var ConfigProviderSetInputSchema = import_zod27.z.strictObject({
17312
- name: import_zod27.z.string().min(1),
17313
- displayName: import_zod27.z.string().min(1).optional(),
17314
- baseUrl: import_zod27.z.string().min(1).optional(),
17442
+ var ConfigProviderSetInputSchema = import_zod28.z.strictObject({
17443
+ name: import_zod28.z.string().min(1),
17444
+ displayName: import_zod28.z.string().min(1).optional(),
17445
+ baseUrl: import_zod28.z.string().min(1).optional(),
17315
17446
  credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).optional(),
17316
17447
  codex: CodexProviderConfigSchema.optional()
17317
17448
  });
17318
17449
  var ConfigProviderSetOutputSchema = storedMutationOutput("provider", "updated", ProviderValueSchema);
17319
- var ConfigProviderRemoveInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
17450
+ var ConfigProviderRemoveInputSchema = import_zod28.z.strictObject({ name: import_zod28.z.string().min(1), confirm: RemovalConfirmationSchema });
17320
17451
  var ConfigProviderRemoveOutputSchema = mutationOutput("provider", "removed");
17321
- var ConfigRuleAddInputSchema = import_zod27.z.strictObject({
17322
- path: import_zod27.z.string().min(1),
17323
- configProfile: import_zod27.z.string().min(1).optional(),
17324
- identity: import_zod27.z.string().min(1).optional()
17452
+ var ConfigRuleAddInputSchema = import_zod28.z.strictObject({
17453
+ path: import_zod28.z.string().min(1),
17454
+ configProfile: import_zod28.z.string().min(1).optional(),
17455
+ identity: import_zod28.z.string().min(1).optional()
17325
17456
  });
17326
17457
  var ConfigRuleAddOutputSchema = storedMutationOutput("rule", "created", DirectoryRuleSchema);
17327
- var ConfigRuleSetInputSchema = import_zod27.z.strictObject({
17328
- path: import_zod27.z.string().min(1),
17329
- configProfile: import_zod27.z.union([import_zod27.z.string().min(1), import_zod27.z.literal(false)]).optional(),
17330
- identity: import_zod27.z.union([import_zod27.z.string().min(1), import_zod27.z.literal(false)]).optional()
17458
+ var ConfigRuleSetInputSchema = import_zod28.z.strictObject({
17459
+ path: import_zod28.z.string().min(1),
17460
+ configProfile: import_zod28.z.union([import_zod28.z.string().min(1), import_zod28.z.literal(false)]).optional(),
17461
+ identity: import_zod28.z.union([import_zod28.z.string().min(1), import_zod28.z.literal(false)]).optional()
17331
17462
  });
17332
17463
  var ConfigRuleSetOutputSchema = storedMutationOutput("rule", "updated", DirectoryRuleSchema);
17333
- var ConfigRuleRemoveInputSchema = import_zod27.z.strictObject({ path: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
17464
+ var ConfigRuleRemoveInputSchema = import_zod28.z.strictObject({ path: import_zod28.z.string().min(1), confirm: RemovalConfirmationSchema });
17334
17465
  var ConfigRuleRemoveOutputSchema = mutationOutput("rule", "removed");
17335
17466
 
17336
17467
  // src/frontdoor/configApi.ts
@@ -17483,7 +17614,8 @@ function createConfigApiRouter(deps) {
17483
17614
  ...launch?.delay === void 0 ? {} : { launchDelay: launch.delay },
17484
17615
  ...launch?.pause === void 0 ? {} : { launchPause: launch.pause },
17485
17616
  ...launch?.explain === void 0 ? {} : { launchExplain: launch.explain },
17486
- ...launch?.proxyBypass === void 0 ? {} : { launchProxyBypass: launch.proxyBypass === false ? false : checkedProxyBypass(launch.proxyBypass, "launch.proxyBypass") }
17617
+ ...launch?.proxyBypass === void 0 ? {} : { launchProxyBypass: launch.proxyBypass === false ? false : checkedProxyBypass(launch.proxyBypass, "launch.proxyBypass") },
17618
+ ...launch?.statusline === void 0 ? {} : { launchStatusline: launch.statusline }
17487
17619
  });
17488
17620
  return { action: "updated", kind: "profile", name: input.name, value: profileValue(input.name, paths) };
17489
17621
  })
@@ -17642,43 +17774,43 @@ var import_openapi4 = require("@orpc/openapi");
17642
17774
  var import_server3 = require("@orpc/server");
17643
17775
 
17644
17776
  // src/frontdoor/eventSchemas.ts
17645
- var import_zod28 = require("zod");
17777
+ var import_zod29 = require("zod");
17646
17778
  var DOOR_EVENT_SOURCE_RC = "rc";
17647
17779
  var LAUNCH_EVENT_SOURCE = "launch";
17648
17780
  var USAGE_EVENT_SOURCE = "usage";
17649
17781
  var DOOR_HEALTH_EVENT_SOURCE = "door";
17650
17782
  var QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
17651
- var DoorEventSchema = import_zod28.z.strictObject({
17652
- source: import_zod28.z.string().min(1),
17783
+ var DoorEventSchema = import_zod29.z.strictObject({
17784
+ source: import_zod29.z.string().min(1),
17653
17785
  /** A positive integer because the backbone's counters start at one and only ever increase. */
17654
- sequence: import_zod28.z.number().int().positive(),
17655
- payload: import_zod28.z.unknown()
17786
+ sequence: import_zod29.z.number().int().positive(),
17787
+ payload: import_zod29.z.unknown()
17656
17788
  });
17657
- var DoorEventSourceQuerySchema = import_zod28.z.strictObject({
17658
- sources: import_zod28.z.array(import_zod28.z.string().min(1)).min(1).optional()
17789
+ var DoorEventSourceQuerySchema = import_zod29.z.strictObject({
17790
+ sources: import_zod29.z.array(import_zod29.z.string().min(1)).min(1).optional()
17659
17791
  });
17660
- var LaunchLifecycleEventSchema = import_zod28.z.strictObject({
17661
- kind: import_zod28.z.enum(["registered", "pruned", "ended"]),
17662
- pid: import_zod28.z.number().int().positive(),
17663
- startedAt: import_zod28.z.number(),
17664
- observedAt: import_zod28.z.number()
17792
+ var LaunchLifecycleEventSchema = import_zod29.z.strictObject({
17793
+ kind: import_zod29.z.enum(["registered", "pruned", "ended"]),
17794
+ pid: import_zod29.z.number().int().positive(),
17795
+ startedAt: import_zod29.z.number(),
17796
+ observedAt: import_zod29.z.number()
17665
17797
  });
17666
- var DoorHealthEventSchema = import_zod28.z.discriminatedUnion("kind", [
17667
- import_zod28.z.strictObject({ kind: import_zod28.z.literal("generation"), pid: import_zod28.z.number().int().positive(), providerPort: import_zod28.z.number().int().positive(), connectPort: import_zod28.z.number().int().positive(), directPort: import_zod28.z.number().int().positive(), observedAt: import_zod28.z.number() }),
17668
- import_zod28.z.strictObject({ kind: import_zod28.z.literal("listenerFailed"), pid: import_zod28.z.number().int().positive(), listener: import_zod28.z.enum(["provider", "connect", "direct"]), message: import_zod28.z.string(), observedAt: import_zod28.z.number() }),
17669
- import_zod28.z.strictObject({ kind: import_zod28.z.literal("binaryTurnover"), pid: import_zod28.z.number().int().positive(), observedAt: import_zod28.z.number() }),
17670
- import_zod28.z.strictObject({ kind: import_zod28.z.literal("idleShutdown"), pid: import_zod28.z.number().int().positive(), observedAt: import_zod28.z.number() }),
17671
- import_zod28.z.strictObject({ kind: import_zod28.z.literal("superseded"), pid: import_zod28.z.number().int().positive(), ownerPid: import_zod28.z.number().int().positive(), observedAt: import_zod28.z.number() }),
17672
- import_zod28.z.strictObject({ kind: import_zod28.z.literal("drained"), pid: import_zod28.z.number().int().positive(), observedAt: import_zod28.z.number() })
17798
+ var DoorHealthEventSchema = import_zod29.z.discriminatedUnion("kind", [
17799
+ import_zod29.z.strictObject({ kind: import_zod29.z.literal("generation"), pid: import_zod29.z.number().int().positive(), providerPort: import_zod29.z.number().int().positive(), connectPort: import_zod29.z.number().int().positive(), directPort: import_zod29.z.number().int().positive(), observedAt: import_zod29.z.number() }),
17800
+ import_zod29.z.strictObject({ kind: import_zod29.z.literal("listenerFailed"), pid: import_zod29.z.number().int().positive(), listener: import_zod29.z.enum(["provider", "connect", "direct"]), message: import_zod29.z.string(), observedAt: import_zod29.z.number() }),
17801
+ import_zod29.z.strictObject({ kind: import_zod29.z.literal("binaryTurnover"), pid: import_zod29.z.number().int().positive(), observedAt: import_zod29.z.number() }),
17802
+ import_zod29.z.strictObject({ kind: import_zod29.z.literal("idleShutdown"), pid: import_zod29.z.number().int().positive(), observedAt: import_zod29.z.number() }),
17803
+ import_zod29.z.strictObject({ kind: import_zod29.z.literal("superseded"), pid: import_zod29.z.number().int().positive(), ownerPid: import_zod29.z.number().int().positive(), observedAt: import_zod29.z.number() }),
17804
+ import_zod29.z.strictObject({ kind: import_zod29.z.literal("drained"), pid: import_zod29.z.number().int().positive(), observedAt: import_zod29.z.number() })
17673
17805
  ]);
17674
- var QuotaExpiringEventSchema = import_zod28.z.strictObject({
17675
- identity: import_zod28.z.string().min(1),
17676
- provider: import_zod28.z.string().min(1),
17677
- window: import_zod28.z.enum(["fiveHour", "sevenDay"]),
17806
+ var QuotaExpiringEventSchema = import_zod29.z.strictObject({
17807
+ identity: import_zod29.z.string().min(1),
17808
+ provider: import_zod29.z.string().min(1),
17809
+ window: import_zod29.z.enum(["fiveHour", "sevenDay"]),
17678
17810
  /** 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. */
17679
- utilization: import_zod28.z.number().min(0).max(1),
17680
- resetsAt: import_zod28.z.iso.datetime(),
17681
- observedAt: import_zod28.z.number()
17811
+ utilization: import_zod29.z.number().min(0).max(1),
17812
+ resetsAt: import_zod29.z.iso.datetime(),
17813
+ observedAt: import_zod29.z.number()
17682
17814
  });
17683
17815
 
17684
17816
  // src/frontdoor/eventsApi.ts
@@ -17762,57 +17894,60 @@ init_cliError();
17762
17894
 
17763
17895
  // src/frontdoor/launchSchemas.ts
17764
17896
  var import_node_path33 = __toESM(require("node:path"), 1);
17765
- var import_zod29 = require("zod");
17897
+ var import_zod30 = require("zod");
17898
+ init_statusline();
17766
17899
  init_claudeVersion();
17767
17900
  init_identity();
17768
- var LaunchResolveInputSchema = import_zod29.z.strictObject({
17769
- path: import_zod29.z.string().min(1),
17901
+ var LaunchResolveInputSchema = import_zod30.z.strictObject({
17902
+ path: import_zod30.z.string().min(1),
17770
17903
  /** `@name`, launch flags, then the arguments for `claude`; empty for a bare launch. */
17771
- argv: import_zod29.z.readonly(import_zod29.z.array(import_zod29.z.string())).optional(),
17904
+ argv: import_zod30.z.readonly(import_zod30.z.array(import_zod30.z.string())).optional(),
17772
17905
  /** 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. */
17773
- env: import_zod29.z.record(import_zod29.z.string(), import_zod29.z.string()).optional()
17906
+ env: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.string()).optional()
17774
17907
  }).refine((input) => import_node_path33.default.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
17775
- var LaunchPoolDecisionSchema = import_zod29.z.strictObject({
17776
- name: import_zod29.z.string(),
17777
- reasons: import_zod29.z.readonly(import_zod29.z.array(import_zod29.z.string())),
17778
- movedOff: import_zod29.z.strictObject({ identity: import_zod29.z.string(), reason: import_zod29.z.string() }).optional()
17908
+ var LaunchPoolDecisionSchema = import_zod30.z.strictObject({
17909
+ name: import_zod30.z.string(),
17910
+ reasons: import_zod30.z.readonly(import_zod30.z.array(import_zod30.z.string())),
17911
+ movedOff: import_zod30.z.strictObject({ identity: import_zod30.z.string(), reason: import_zod30.z.string() }).optional()
17779
17912
  });
17780
- var LaunchDecisionSchema = import_zod29.z.strictObject({
17781
- identity: import_zod29.z.string().optional(),
17782
- identitySource: import_zod29.z.enum(IDENTITY_DECISION_SOURCES),
17913
+ var LaunchDecisionSchema = import_zod30.z.strictObject({
17914
+ identity: import_zod30.z.string().optional(),
17915
+ identitySource: import_zod30.z.enum(IDENTITY_DECISION_SOURCES),
17783
17916
  pool: LaunchPoolDecisionSchema.optional(),
17784
- configDirEscapeHatch: import_zod29.z.boolean(),
17785
- configDir: import_zod29.z.string().optional(),
17786
- configProfile: import_zod29.z.string().optional(),
17787
- configProfileSource: import_zod29.z.enum(CONFIG_PROFILE_DECISION_SOURCES),
17788
- provider: import_zod29.z.string().optional()
17917
+ configDirEscapeHatch: import_zod30.z.boolean(),
17918
+ configDir: import_zod30.z.string().optional(),
17919
+ configProfile: import_zod30.z.string().optional(),
17920
+ configProfileSource: import_zod30.z.enum(CONFIG_PROFILE_DECISION_SOURCES),
17921
+ provider: import_zod30.z.string().optional()
17789
17922
  });
17790
- var LaunchFlagsSchema = import_zod29.z.strictObject({
17791
- skipPermissions: import_zod29.z.boolean(),
17792
- remoteControl: import_zod29.z.boolean(),
17793
- headroom: import_zod29.z.boolean(),
17794
- trackUsage: import_zod29.z.boolean(),
17795
- pause: import_zod29.z.boolean(),
17796
- explain: import_zod29.z.boolean(),
17923
+ var LaunchFlagsSchema = import_zod30.z.strictObject({
17924
+ skipPermissions: import_zod30.z.boolean(),
17925
+ remoteControl: import_zod30.z.boolean(),
17926
+ headroom: import_zod30.z.boolean(),
17927
+ trackUsage: import_zod30.z.boolean(),
17928
+ pause: import_zod30.z.boolean(),
17929
+ explain: import_zod30.z.boolean(),
17797
17930
  /** How long the launch waits after its own output before it starts claude, in milliseconds. */
17798
- delayMs: import_zod29.z.number(),
17931
+ delayMs: import_zod30.z.number(),
17799
17932
  /** The hosts the launch keeps off the front door by adding them to the child's `NO_PROXY`. */
17800
- proxyBypass: import_zod29.z.array(import_zod29.z.string()).readonly()
17933
+ proxyBypass: import_zod30.z.array(import_zod30.z.string()).readonly(),
17934
+ /** How the session's built-in statusline looks, when the launch configures any of it. */
17935
+ statusline: StatuslineSchema.optional()
17801
17936
  });
17802
- var LaunchResolveOutputSchema = import_zod29.z.strictObject({
17937
+ var LaunchResolveOutputSchema = import_zod30.z.strictObject({
17803
17938
  decision: LaunchDecisionSchema,
17804
17939
  flags: LaunchFlagsSchema,
17805
- claudeVersion: import_zod29.z.strictObject({ version: import_zod29.z.string(), source: import_zod29.z.enum(CLAUDE_VERSION_SOURCES) }).optional(),
17940
+ claudeVersion: import_zod30.z.strictObject({ version: import_zod30.z.string(), source: import_zod30.z.enum(CLAUDE_VERSION_SOURCES) }).optional(),
17806
17941
  /** The real `claude` binary the launch would spawn, on the door's host. */
17807
- bin: import_zod29.z.string(),
17942
+ bin: import_zod30.z.string(),
17808
17943
  /** The arguments the launch would pass it: the tool's own flags, then `CLAUDE_EXTRA_FLAGS`, then the caller's own. */
17809
- args: import_zod29.z.readonly(import_zod29.z.array(import_zod29.z.string())),
17944
+ args: import_zod30.z.readonly(import_zod30.z.array(import_zod30.z.string())),
17810
17945
  /** The credential the launch would authenticate with, by target and source kinds. Absent when none applies. */
17811
- credential: import_zod29.z.strictObject({ subject: import_zod29.z.enum(["provider", "identity"]), name: import_zod29.z.string(), summary: CredentialSummarySchema }).optional(),
17812
- routing: import_zod29.z.strictObject({ frontDoor: import_zod29.z.boolean(), headroom: import_zod29.z.boolean() }),
17946
+ credential: import_zod30.z.strictObject({ subject: import_zod30.z.enum(["provider", "identity"]), name: import_zod30.z.string(), summary: CredentialSummarySchema }).optional(),
17947
+ routing: import_zod30.z.strictObject({ frontDoor: import_zod30.z.boolean(), headroom: import_zod30.z.boolean() }),
17813
17948
  /** The names of the environment variables the launch would set or unset, sorted. Values are not reported. */
17814
- environment: import_zod29.z.readonly(import_zod29.z.array(import_zod29.z.string())),
17815
- warnings: import_zod29.z.readonly(import_zod29.z.array(import_zod29.z.string()))
17949
+ environment: import_zod30.z.readonly(import_zod30.z.array(import_zod30.z.string())),
17950
+ warnings: import_zod30.z.readonly(import_zod30.z.array(import_zod30.z.string()))
17816
17951
  });
17817
17952
 
17818
17953
  // src/frontdoor/launchApi.ts
@@ -17848,22 +17983,22 @@ function createLaunchApiRouter(deps) {
17848
17983
  // src/frontdoor/agentTreesApi.ts
17849
17984
  var import_client6 = require("@orpc/client");
17850
17985
  var import_openapi7 = require("@orpc/openapi");
17851
- var import_zod30 = require("zod");
17986
+ var import_zod31 = require("zod");
17852
17987
  init_cliError();
17853
- var AgentTreesListInputSchema = import_zod30.z.strictObject({
17988
+ var AgentTreesListInputSchema = import_zod31.z.strictObject({
17854
17989
  /** Only this identity's sessions. */
17855
- identity: import_zod30.z.string().optional(),
17990
+ identity: import_zod31.z.string().optional(),
17856
17991
  /** Include sessions that spawned no agent and ran no workflow. */
17857
- all: import_zod30.z.boolean().optional()
17992
+ all: import_zod31.z.boolean().optional()
17858
17993
  });
17859
- var AgentTreesListOutputSchema = import_zod30.z.array(SessionSummarySchema);
17860
- var AgentTreesShowInputSchema = import_zod30.z.strictObject({
17994
+ var AgentTreesListOutputSchema = import_zod31.z.array(SessionSummarySchema);
17995
+ var AgentTreesShowInputSchema = import_zod31.z.strictObject({
17861
17996
  /** A session id, or an unambiguous prefix of one. */
17862
- session: import_zod30.z.string().min(1),
17997
+ session: import_zod31.z.string().min(1),
17863
17998
  /** Look only in this identity. */
17864
- identity: import_zod30.z.string().optional()
17999
+ identity: import_zod31.z.string().optional()
17865
18000
  });
17866
- var AgentTreesShowOutputSchema = import_zod30.z.strictObject({ identities: import_zod30.z.array(import_zod30.z.string()), ...MergedAgentTreeSchema.shape });
18001
+ var AgentTreesShowOutputSchema = import_zod31.z.strictObject({ identities: import_zod31.z.array(import_zod31.z.string()), ...MergedAgentTreeSchema.shape });
17867
18002
  function asBadRequest(error) {
17868
18003
  if (error instanceof CliError) {
17869
18004
  throw new import_client6.ORPCError("BAD_REQUEST", { message: error.message });
@@ -20056,7 +20191,7 @@ init_poolPick();
20056
20191
 
20057
20192
  // src/agents/read.ts
20058
20193
  var import_node_path35 = __toESM(require("node:path"), 1);
20059
- var import_zod31 = require("zod");
20194
+ var import_zod32 = require("zod");
20060
20195
  var PROJECTS_DIR = "projects";
20061
20196
  var TASKS_DIR = "tasks";
20062
20197
  var SUBAGENTS_DIR = "subagents";
@@ -20175,14 +20310,14 @@ function parseJson2(text) {
20175
20310
  return void 0;
20176
20311
  }
20177
20312
  }
20178
- var TaskFileSchema = import_zod31.z.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: import_zod31.z.array(import_zod31.z.string()).default([]), blockedBy: import_zod31.z.array(import_zod31.z.string()).default([]) });
20179
- var WorkflowRunFileSchema = import_zod31.z.object({
20180
- runId: import_zod31.z.string(),
20181
- workflowName: import_zod31.z.string().optional(),
20182
- status: import_zod31.z.string().optional(),
20183
- startTime: import_zod31.z.number().optional(),
20184
- phases: import_zod31.z.array(import_zod31.z.object({ title: import_zod31.z.string() })).default([]),
20185
- summary: import_zod31.z.string().optional()
20313
+ var TaskFileSchema = import_zod32.z.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: import_zod32.z.array(import_zod32.z.string()).default([]), blockedBy: import_zod32.z.array(import_zod32.z.string()).default([]) });
20314
+ var WorkflowRunFileSchema = import_zod32.z.object({
20315
+ runId: import_zod32.z.string(),
20316
+ workflowName: import_zod32.z.string().optional(),
20317
+ status: import_zod32.z.string().optional(),
20318
+ startTime: import_zod32.z.number().optional(),
20319
+ phases: import_zod32.z.array(import_zod32.z.object({ title: import_zod32.z.string() })).default([]),
20320
+ summary: import_zod32.z.string().optional()
20186
20321
  });
20187
20322
  function summariseSession(fs14, configDir, ref) {
20188
20323
  const sessionRelative = import_node_path35.default.join(PROJECTS_DIR, ref.project, ref.entry);