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.mjs CHANGED
@@ -116,6 +116,68 @@ var init_proxyBypass = __esm({
116
116
  }
117
117
  });
118
118
 
119
+ // src/config/statusline.ts
120
+ import { z } from "zod";
121
+ function distinctList(member) {
122
+ return z.array(member).refine((items) => new Set(items).size === items.length, "must not repeat a segment");
123
+ }
124
+ function resolveStatusline(settings) {
125
+ const resolved = {
126
+ header: settings?.header ?? STATUSLINE_DEFAULTS.header,
127
+ bars: settings?.bars ?? STATUSLINE_DEFAULTS.bars,
128
+ warnAt: settings?.warnAt ?? STATUSLINE_DEFAULTS.warnAt,
129
+ criticalAt: settings?.criticalAt ?? STATUSLINE_DEFAULTS.criticalAt,
130
+ fiveHourLabel: settings?.fiveHourLabel ?? STATUSLINE_DEFAULTS.fiveHourLabel,
131
+ sevenDayLabel: settings?.sevenDayLabel ?? STATUSLINE_DEFAULTS.sevenDayLabel,
132
+ barWidth: settings?.barWidth ?? STATUSLINE_DEFAULTS.barWidth
133
+ };
134
+ if (resolved.warnAt >= resolved.criticalAt) {
135
+ throw new RangeError(`statusline warnAt (${String(resolved.warnAt)}) must be below criticalAt (${String(resolved.criticalAt)})`);
136
+ }
137
+ return resolved;
138
+ }
139
+ var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_BAR_GROUPS, MAX_PERCENT, MAX_STATUSLINE_LABEL_CHARS, MAX_BAR_CELLS, LABEL_RE2, wholePercent, StatuslineSchema, StatuslineChangeSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
140
+ var init_statusline = __esm({
141
+ "src/config/statusline.ts"() {
142
+ "use strict";
143
+ STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom"];
144
+ STATUSLINE_BAR_GROUPS = ["context", "quota"];
145
+ MAX_PERCENT = 100;
146
+ MAX_STATUSLINE_LABEL_CHARS = 12;
147
+ MAX_BAR_CELLS = 40;
148
+ LABEL_RE2 = /^[^\p{C}\p{Z}]+(?: [^\p{C}\p{Z}]+)*$/u;
149
+ wholePercent = z.number().int().min(1).max(MAX_PERCENT);
150
+ StatuslineSchema = z.strictObject({
151
+ header: distinctList(z.enum(STATUSLINE_HEADER_SEGMENTS)).optional(),
152
+ bars: distinctList(z.enum(STATUSLINE_BAR_GROUPS)).optional(),
153
+ warnAt: wholePercent.optional(),
154
+ criticalAt: wholePercent.optional(),
155
+ fiveHourLabel: z.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters").optional(),
156
+ sevenDayLabel: z.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters").optional(),
157
+ barWidth: z.number().int().min(1).max(MAX_BAR_CELLS).optional()
158
+ });
159
+ StatuslineChangeSchema = z.strictObject({
160
+ header: z.union([StatuslineSchema.shape.header.unwrap(), z.literal(false)]).optional(),
161
+ bars: z.union([StatuslineSchema.shape.bars.unwrap(), z.literal(false)]).optional(),
162
+ warnAt: z.union([StatuslineSchema.shape.warnAt.unwrap(), z.literal(false)]).optional(),
163
+ criticalAt: z.union([StatuslineSchema.shape.criticalAt.unwrap(), z.literal(false)]).optional(),
164
+ fiveHourLabel: z.union([StatuslineSchema.shape.fiveHourLabel.unwrap(), z.literal(false)]).optional(),
165
+ sevenDayLabel: z.union([StatuslineSchema.shape.sevenDayLabel.unwrap(), z.literal(false)]).optional(),
166
+ barWidth: z.union([StatuslineSchema.shape.barWidth.unwrap(), z.literal(false)]).optional()
167
+ });
168
+ STATUSLINE_DEFAULTS = {
169
+ header: STATUSLINE_HEADER_SEGMENTS,
170
+ bars: STATUSLINE_BAR_GROUPS,
171
+ warnAt: 70,
172
+ criticalAt: 90,
173
+ fiveHourLabel: "5h",
174
+ sevenDayLabel: "Wk",
175
+ barWidth: 10
176
+ };
177
+ STATUSLINE_ENV = "AGENT_SHIM_STATUSLINE";
178
+ }
179
+ });
180
+
119
181
  // src/cliError.ts
120
182
  var EXIT_FAILURE, EXIT_USAGE, CliError, UsageError;
121
183
  var init_cliError = __esm({
@@ -232,7 +294,7 @@ var init_versionDiscovery = __esm({
232
294
 
233
295
  // src/config/schema.ts
234
296
  import path2 from "node:path";
235
- import { z } from "zod";
297
+ import { z as z2 } from "zod";
236
298
  import { PredicateNodeSchema } from "trilean";
237
299
  function isOverridableCategory(name) {
238
300
  return OVERRIDABLE_CATEGORIES.some((category) => category === name);
@@ -276,55 +338,58 @@ var init_schema = __esm({
276
338
  "src/config/schema.ts"() {
277
339
  "use strict";
278
340
  init_proxyBypass();
341
+ init_statusline();
279
342
  init_versionDiscovery();
280
343
  CATEGORY_NAMES = ["secret", "runtime", "history", "knowledge", "settings"];
281
344
  OVERRIDABLE_CATEGORIES = ["runtime", "history", "knowledge", "settings"];
282
- CategoryMapSchema = z.strictObject({
283
- all: z.boolean().optional(),
284
- runtime: z.boolean().optional(),
285
- history: z.boolean().optional(),
286
- knowledge: z.boolean().optional(),
287
- settings: z.boolean().optional()
345
+ CategoryMapSchema = z2.strictObject({
346
+ all: z2.boolean().optional(),
347
+ runtime: z2.boolean().optional(),
348
+ history: z2.boolean().optional(),
349
+ knowledge: z2.boolean().optional(),
350
+ settings: z2.boolean().optional()
288
351
  }).transform((input) => expandAllCategoryKey(input));
289
352
  DURATION_RE = /^(?:0|[1-9][0-9]*)(?:ms|s|m|h|d|w)$/;
290
- DurationSchema = z.string().regex(DURATION_RE);
291
- WhenConditionObjectSchema = z.strictObject({
353
+ DurationSchema = z2.string().regex(DURATION_RE);
354
+ WhenConditionObjectSchema = z2.strictObject({
292
355
  newerThan: DurationSchema.optional(),
293
356
  olderThan: DurationSchema.optional(),
294
- maxSizeBytes: z.int().positive().optional(),
295
- branch: z.string().min(1).optional(),
296
- env: z.record(z.string().min(1), z.string()).optional()
357
+ maxSizeBytes: z2.int().positive().optional(),
358
+ branch: z2.string().min(1).optional(),
359
+ env: z2.record(z2.string().min(1), z2.string()).optional()
297
360
  });
298
- WhenSchema = z.union([WhenConditionObjectSchema, PredicateNodeSchema]);
299
- EntryValueSchema = z.union([
300
- z.boolean(),
301
- z.strictObject({ value: z.boolean(), when: WhenSchema })
361
+ WhenSchema = z2.union([WhenConditionObjectSchema, PredicateNodeSchema]);
362
+ EntryValueSchema = z2.union([
363
+ z2.boolean(),
364
+ z2.strictObject({ value: z2.boolean(), when: WhenSchema })
302
365
  ]);
303
366
  ENTRY_KEY_RE = /^(?:secret|runtime|history|knowledge|settings)\/(?!\/)\S(?:.*\S)?$/;
304
- EntriesSchema = z.record(z.string().regex(ENTRY_KEY_RE), EntryValueSchema);
305
- LaunchSchema = z.strictObject({
306
- skipPermissions: z.boolean().optional(),
307
- remoteControl: z.boolean().optional(),
308
- provider: z.string().min(1).optional(),
309
- headroom: z.boolean().optional(),
310
- trackUsage: z.boolean().optional(),
367
+ EntriesSchema = z2.record(z2.string().regex(ENTRY_KEY_RE), EntryValueSchema);
368
+ LaunchSchema = z2.strictObject({
369
+ skipPermissions: z2.boolean().optional(),
370
+ remoteControl: z2.boolean().optional(),
371
+ provider: z2.string().min(1).optional(),
372
+ headroom: z2.boolean().optional(),
373
+ trackUsage: z2.boolean().optional(),
311
374
  /** 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. */
312
- claudeVersion: z.string().regex(NUMERIC_DOTTED_VERSION_RE, "must be an exact dotted-numeric Claude Code version such as 2.1.220").optional(),
375
+ claudeVersion: z2.string().regex(NUMERIC_DOTTED_VERSION_RE, "must be an exact dotted-numeric Claude Code version such as 2.1.220").optional(),
313
376
  /** 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. */
314
- delay: z.string().regex(DURATION_RE, "must be a duration such as 5s or 500ms").optional(),
377
+ delay: z2.string().regex(DURATION_RE, "must be a duration such as 5s or 500ms").optional(),
315
378
  /** 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. */
316
- pause: z.boolean().optional(),
379
+ pause: z2.boolean().optional(),
317
380
  /** 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. */
318
- explain: z.boolean().optional(),
381
+ explain: z2.boolean().optional(),
319
382
  /** 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. */
320
- proxyBypass: z.array(
321
- z.string().superRefine((entry, context) => {
383
+ proxyBypass: z2.array(
384
+ z2.string().superRefine((entry, context) => {
322
385
  const problem = proxyBypassSyntaxProblem(entry);
323
386
  if (problem !== void 0) {
324
387
  context.addIssue({ code: "custom", message: `"${entry}" ${problem}` });
325
388
  }
326
389
  })
327
- ).optional()
390
+ ).optional(),
391
+ /** 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. */
392
+ statusline: StatuslineSchema.optional()
328
393
  });
329
394
  CREDENTIAL_TARGETS = ["bearer", "apiKey", "oauthToken"];
330
395
  PROVIDER_CREDENTIAL_TARGETS = ["bearer", "apiKey"];
@@ -333,27 +398,27 @@ var init_schema = __esm({
333
398
  apiKey: "ANTHROPIC_API_KEY",
334
399
  oauthToken: "CLAUDE_CODE_OAUTH_TOKEN"
335
400
  };
336
- ArgvSchema = z.tuple([z.string().min(1)], z.string());
401
+ ArgvSchema = z2.tuple([z2.string().min(1)], z2.string());
337
402
  CommandSourceOptions = {
338
403
  /** 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`. */
339
- interactive: z.boolean().optional(),
404
+ interactive: z2.boolean().optional(),
340
405
  /** 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. */
341
- timeoutMs: z.int().positive().optional()
406
+ timeoutMs: z2.int().positive().optional()
342
407
  };
343
- EnvCredentialSourceSchema = z.strictObject({ env: z.string().min(1) });
344
- FileCredentialSourceSchema = z.strictObject({
345
- file: z.string().min(1).refine((filePath) => filePath.startsWith("~/") || path2.isAbsolute(filePath), {
408
+ EnvCredentialSourceSchema = z2.strictObject({ env: z2.string().min(1) });
409
+ FileCredentialSourceSchema = z2.strictObject({
410
+ file: z2.string().min(1).refine((filePath) => filePath.startsWith("~/") || path2.isAbsolute(filePath), {
346
411
  message: "a credential file must be an absolute or ~-rooted path, since a launch can start in any directory"
347
412
  })
348
413
  });
349
- CommandCredentialSourceSchema = z.strictObject({ command: ArgvSchema, ...CommandSourceOptions });
350
- OpCredentialSourceSchema = z.strictObject({ op: z.string().startsWith("op://"), ...CommandSourceOptions });
351
- KeychainCredentialSourceSchema = z.strictObject({
352
- keychain: z.strictObject({ service: z.string().min(1), account: z.string().min(1).optional() }),
414
+ CommandCredentialSourceSchema = z2.strictObject({ command: ArgvSchema, ...CommandSourceOptions });
415
+ OpCredentialSourceSchema = z2.strictObject({ op: z2.string().startsWith("op://"), ...CommandSourceOptions });
416
+ KeychainCredentialSourceSchema = z2.strictObject({
417
+ keychain: z2.strictObject({ service: z2.string().min(1), account: z2.string().min(1).optional() }),
353
418
  ...CommandSourceOptions
354
419
  });
355
- LiteralCredentialSourceSchema = z.strictObject({ literal: z.string().min(1) });
356
- CredentialSourceSchema = z.union([
420
+ LiteralCredentialSourceSchema = z2.strictObject({ literal: z2.string().min(1) });
421
+ CredentialSourceSchema = z2.union([
357
422
  EnvCredentialSourceSchema,
358
423
  FileCredentialSourceSchema,
359
424
  CommandCredentialSourceSchema,
@@ -361,7 +426,7 @@ var init_schema = __esm({
361
426
  KeychainCredentialSourceSchema,
362
427
  LiteralCredentialSourceSchema
363
428
  ]);
364
- RemoteCredentialSourceSchema = z.union([
429
+ RemoteCredentialSourceSchema = z2.union([
365
430
  EnvCredentialSourceSchema,
366
431
  FileCredentialSourceSchema,
367
432
  OpCredentialSourceSchema,
@@ -369,18 +434,18 @@ var init_schema = __esm({
369
434
  LiteralCredentialSourceSchema
370
435
  ]);
371
436
  CREDENTIAL_CACHE_STORES = ["keychain", "file"];
372
- CredentialCacheSchema = z.strictObject({
373
- ttl: z.string().regex(/^[1-9]\d*[smhd]$/, { message: "ttl is a whole number followed by s, m, h or d, for example 12h" }).optional(),
374
- store: z.enum(CREDENTIAL_CACHE_STORES).optional()
437
+ CredentialCacheSchema = z2.strictObject({
438
+ ttl: z2.string().regex(/^[1-9]\d*[smhd]$/, { message: "ttl is a whole number followed by s, m, h or d, for example 12h" }).optional(),
439
+ store: z2.enum(CREDENTIAL_CACHE_STORES).optional()
375
440
  });
376
- CredentialSchema = z.strictObject({
377
- sources: z.array(CredentialSourceSchema).min(1),
378
- target: z.enum(CREDENTIAL_TARGETS).optional(),
441
+ CredentialSchema = z2.strictObject({
442
+ sources: z2.array(CredentialSourceSchema).min(1),
443
+ target: z2.enum(CREDENTIAL_TARGETS).optional(),
379
444
  cache: CredentialCacheSchema.optional()
380
445
  });
381
- ProviderCredentialSchema = CredentialSchema.extend({ target: z.enum(PROVIDER_CREDENTIAL_TARGETS).optional() });
446
+ ProviderCredentialSchema = CredentialSchema.extend({ target: z2.enum(PROVIDER_CREDENTIAL_TARGETS).optional() });
382
447
  RESERVED_PROVIDER_ENV_KEYS = Object.values(CREDENTIAL_TARGET_VARS);
383
- ProviderEnvSchema = z.record(z.string().min(1), z.string()).refine((env) => !Object.keys(env).some((key) => RESERVED_PROVIDER_ENV_KEYS.includes(key)), {
448
+ ProviderEnvSchema = z2.record(z2.string().min(1), z2.string()).refine((env) => !Object.keys(env).some((key) => RESERVED_PROVIDER_ENV_KEYS.includes(key)), {
384
449
  message: `env may not set ${RESERVED_PROVIDER_ENV_KEYS.join(", ")}: the credential block's target sets one and agent-shim removes the others`
385
450
  });
386
451
  PROVIDER_KINDS = ["http", "codex", "antigravity", "router"];
@@ -396,33 +461,33 @@ var init_schema = __esm({
396
461
  haiku: ["gemini-3.8-flash-low", "gemini-4-argon-low", "claude-sonnet-5-5-low"]
397
462
  });
398
463
  ANTIGRAVITY_DEFAULT_EFFORT = "low";
399
- AntigravityModelTargetSchema = z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]);
400
- AntigravityProviderConfigSchema = z.strictObject({
464
+ AntigravityModelTargetSchema = z2.union([z2.string().min(1), z2.array(z2.string().min(1)).min(1)]);
465
+ AntigravityProviderConfigSchema = z2.strictObject({
401
466
  /** Operational mode: direct cloud endpoint or local ACP daemon. Defaults to `cloud`. */
402
- mode: z.enum(ANTIGRAVITY_MODES).optional(),
467
+ mode: z2.enum(ANTIGRAVITY_MODES).optional(),
403
468
  /** The model a request maps to when no tier matches its model name. */
404
- defaultModel: z.string().min(1).optional(),
469
+ defaultModel: z2.string().min(1).optional(),
405
470
  /** 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. */
406
- models: z.record(z.string().min(1), AntigravityModelTargetSchema).optional(),
471
+ models: z2.record(z2.string().min(1), AntigravityModelTargetSchema).optional(),
407
472
  /** 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. */
408
- degradeDownTiers: z.boolean().optional(),
473
+ degradeDownTiers: z2.boolean().optional(),
409
474
  /** The reasoning effort used when the request's own effort is not one the backend accepts. */
410
- effort: z.enum(ANTIGRAVITY_EFFORTS).optional(),
475
+ effort: z2.enum(ANTIGRAVITY_EFFORTS).optional(),
411
476
  /** Cloud-specific settings (for `mode: "cloud"`). */
412
- cloud: z.strictObject({
477
+ cloud: z2.strictObject({
413
478
  /** Google Gemini API or custom gateway endpoint. Defaults to `https://generativelanguage.googleapis.com`. */
414
- endpoint: z.url().optional(),
479
+ endpoint: z2.url().optional(),
415
480
  /** Google Cloud Project ID (when using Vertex AI). */
416
- projectId: z.string().min(1).optional(),
481
+ projectId: z2.string().min(1).optional(),
417
482
  /** Google Cloud location/region (when using Vertex AI). */
418
- location: z.string().min(1).optional()
483
+ location: z2.string().min(1).optional()
419
484
  }).optional(),
420
485
  /** Local-specific settings (for `mode: "local"`). */
421
- local: z.strictObject({
486
+ local: z2.strictObject({
422
487
  /** Command and arguments to spawn the ACP server process. */
423
- command: z.array(z.string().min(1)).min(1).optional(),
488
+ command: z2.array(z2.string().min(1)).min(1).optional(),
424
489
  /** Path to an existing Unix domain socket to connect to instead of spawning a process. */
425
- socketPath: z.string().min(1).optional()
490
+ socketPath: z2.string().min(1).optional()
426
491
  }).optional()
427
492
  });
428
493
  CODEX_EFFORTS = ["none", "low", "medium", "high"];
@@ -436,47 +501,47 @@ var init_schema = __esm({
436
501
  haiku: "gpt-5.6-luna"
437
502
  });
438
503
  CODEX_DEFAULT_EFFORT = "low";
439
- CodexProviderConfigSchema = z.strictObject({
504
+ CodexProviderConfigSchema = z2.strictObject({
440
505
  /** The codex model a request maps to when no tier matches its model name. */
441
- defaultModel: z.string().min(1).optional(),
506
+ defaultModel: z2.string().min(1).optional(),
442
507
  /** Per-tier overrides of the shipped mapping, matched by substring of the requested model name in `CLAUDE_TIERS` order. */
443
- models: z.strictObject({
444
- fable: z.string().min(1).optional(),
445
- opus: z.string().min(1).optional(),
446
- sonnet: z.string().min(1).optional(),
447
- haiku: z.string().min(1).optional()
508
+ models: z2.strictObject({
509
+ fable: z2.string().min(1).optional(),
510
+ opus: z2.string().min(1).optional(),
511
+ sonnet: z2.string().min(1).optional(),
512
+ haiku: z2.string().min(1).optional()
448
513
  }).optional(),
449
514
  /** The reasoning effort used when the request's own `output_config.effort` is not one the backend accepts. */
450
- effort: z.enum(CODEX_EFFORTS).optional(),
515
+ effort: z2.enum(CODEX_EFFORTS).optional(),
451
516
  /** Which login the upstream call is made with; see `CODEX_LOGINS`. */
452
- login: z.enum(CODEX_LOGINS).optional()
517
+ login: z2.enum(CODEX_LOGINS).optional()
453
518
  });
454
- ProviderRouteSchema = z.strictObject({
519
+ ProviderRouteSchema = z2.strictObject({
455
520
  /** 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). */
456
521
  when: WhenSchema,
457
522
  /** The provider a matching request is sent to, by the name a provider file carries. */
458
- provider: z.string().min(1),
523
+ provider: z2.string().min(1),
459
524
  /** 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. */
460
- model: z.string().min(1).optional()
525
+ model: z2.string().min(1).optional()
461
526
  });
462
- PickerModelSchema = z.strictObject({
463
- model: z.string().min(1),
464
- tier: z.enum(CLAUDE_TIERS),
465
- label: z.string().min(1).optional(),
466
- description: z.string().min(1).optional()
527
+ PickerModelSchema = z2.strictObject({
528
+ model: z2.string().min(1),
529
+ tier: z2.enum(CLAUDE_TIERS),
530
+ label: z2.string().min(1).optional(),
531
+ description: z2.string().min(1).optional()
467
532
  });
468
- PickerModelsSchema = z.array(PickerModelSchema).refine((models) => new Set(models.map((entry) => entry.model)).size === models.length, { message: "pickerModels names a model more than once" });
469
- ProviderCatalogueSchema = z.strictObject({
470
- tier: z.enum(CLAUDE_TIERS),
471
- include: z.array(z.string().min(1)).min(1).optional(),
472
- exclude: z.array(z.string().min(1)).min(1).optional(),
473
- url: z.url().optional()
533
+ PickerModelsSchema = z2.array(PickerModelSchema).refine((models) => new Set(models.map((entry) => entry.model)).size === models.length, { message: "pickerModels names a model more than once" });
534
+ ProviderCatalogueSchema = z2.strictObject({
535
+ tier: z2.enum(CLAUDE_TIERS),
536
+ include: z2.array(z2.string().min(1)).min(1).optional(),
537
+ exclude: z2.array(z2.string().min(1)).min(1).optional(),
538
+ url: z2.url().optional()
474
539
  });
475
- HttpProviderSchema = z.strictObject({
476
- $schema: z.string().optional(),
477
- kind: z.literal("http").optional(),
478
- displayName: z.string().min(1),
479
- baseUrl: z.url(),
540
+ HttpProviderSchema = z2.strictObject({
541
+ $schema: z2.string().optional(),
542
+ kind: z2.literal("http").optional(),
543
+ displayName: z2.string().min(1),
544
+ baseUrl: z2.url(),
480
545
  credential: ProviderCredentialSchema,
481
546
  env: ProviderEnvSchema.optional(),
482
547
  /** Extra models `/model` lists beside the ones the tier settings name. */
@@ -484,95 +549,95 @@ var init_schema = __esm({
484
549
  /** The provider's own model catalogue, listed in `/model` when set. */
485
550
  catalogue: ProviderCatalogueSchema.optional(),
486
551
  /** 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. */
487
- routes: z.array(ProviderRouteSchema).optional()
552
+ routes: z2.array(ProviderRouteSchema).optional()
488
553
  });
489
- CodexProviderSchema = z.strictObject({
490
- $schema: z.string().optional(),
491
- kind: z.literal("codex"),
492
- displayName: z.string().min(1),
554
+ CodexProviderSchema = z2.strictObject({
555
+ $schema: z2.string().optional(),
556
+ kind: z2.literal("codex"),
557
+ displayName: z2.string().min(1),
493
558
  credential: ProviderCredentialSchema,
494
559
  env: ProviderEnvSchema.optional(),
495
560
  /** Extra models `/model` lists beside the ones the tier settings name. */
496
561
  pickerModels: PickerModelsSchema.optional(),
497
562
  codex: CodexProviderConfigSchema.optional()
498
563
  });
499
- RouterProviderSchema = z.strictObject({
500
- $schema: z.string().optional(),
501
- kind: z.literal("router"),
502
- displayName: z.string().min(1)
564
+ RouterProviderSchema = z2.strictObject({
565
+ $schema: z2.string().optional(),
566
+ kind: z2.literal("router"),
567
+ displayName: z2.string().min(1)
503
568
  });
504
- AntigravityProviderSchema = z.strictObject({
505
- $schema: z.string().optional(),
506
- kind: z.literal("antigravity"),
507
- displayName: z.string().min(1),
569
+ AntigravityProviderSchema = z2.strictObject({
570
+ $schema: z2.string().optional(),
571
+ kind: z2.literal("antigravity"),
572
+ displayName: z2.string().min(1),
508
573
  credential: ProviderCredentialSchema,
509
574
  env: ProviderEnvSchema.optional(),
510
575
  /** Extra models `/model` lists beside the ones the tier settings name. */
511
576
  pickerModels: PickerModelsSchema.optional(),
512
577
  antigravity: AntigravityProviderConfigSchema.optional()
513
578
  });
514
- ProviderSchema = z.discriminatedUnion("kind", [HttpProviderSchema, CodexProviderSchema, AntigravityProviderSchema, RouterProviderSchema]);
579
+ ProviderSchema = z2.discriminatedUnion("kind", [HttpProviderSchema, CodexProviderSchema, AntigravityProviderSchema, RouterProviderSchema]);
515
580
  SELECTION_MODES = ["ordered", "most-allowance", "soonest-reset", "spread", "adaptive", "lowest-latency", "highest-success", "cheapest"];
516
- VirtualModelSchema = z.strictObject({
581
+ VirtualModelSchema = z2.strictObject({
517
582
  /** How the virtual model chooses its member for a request. */
518
- mode: z.enum(SELECTION_MODES),
583
+ mode: z2.enum(SELECTION_MODES),
519
584
  /** 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>`). */
520
- members: z.array(z.string().min(1)).min(1)
585
+ members: z2.array(z2.string().min(1)).min(1)
521
586
  });
522
- ModelPricesSchema = z.strictObject({
523
- input: z.number().positive(),
524
- output: z.number().positive()
587
+ ModelPricesSchema = z2.strictObject({
588
+ input: z2.number().positive(),
589
+ output: z2.number().positive()
525
590
  });
526
- FamilySettingsSchema = z.strictObject({
527
- names: z.array(z.string().min(1)).optional(),
528
- mode: z.enum(SELECTION_MODES).optional(),
529
- context: z.number().int().positive().optional(),
530
- vision: z.boolean().optional(),
531
- tools: z.boolean().optional(),
532
- thinking: z.boolean().optional()
591
+ FamilySettingsSchema = z2.strictObject({
592
+ names: z2.array(z2.string().min(1)).optional(),
593
+ mode: z2.enum(SELECTION_MODES).optional(),
594
+ context: z2.number().int().positive().optional(),
595
+ vision: z2.boolean().optional(),
596
+ tools: z2.boolean().optional(),
597
+ thinking: z2.boolean().optional()
533
598
  });
534
- ModelsConfigSchema = z.strictObject({
599
+ ModelsConfigSchema = z2.strictObject({
535
600
  /** Virtual models, by name. */
536
- virtual: z.record(z.string().min(1), VirtualModelSchema).optional(),
601
+ virtual: z2.record(z2.string().min(1), VirtualModelSchema).optional(),
537
602
  /** Which model ref each Claude tier (`fable`, `opus`, `sonnet`, `haiku`) points at: a concrete target, an account model, a virtual model, or a family. */
538
- tiers: z.strictObject({
539
- fable: z.string().min(1).optional(),
540
- opus: z.string().min(1).optional(),
541
- sonnet: z.string().min(1).optional(),
542
- haiku: z.string().min(1).optional()
603
+ tiers: z2.strictObject({
604
+ fable: z2.string().min(1).optional(),
605
+ opus: z2.string().min(1).optional(),
606
+ sonnet: z2.string().min(1).optional(),
607
+ haiku: z2.string().min(1).optional()
543
608
  }).optional(),
544
609
  /** Prices per model ref, for the `cheapest` mode. */
545
- prices: z.record(z.string().min(1), ModelPricesSchema).optional(),
610
+ prices: z2.record(z2.string().min(1), ModelPricesSchema).optional(),
546
611
  /** Model refs hidden from the picker and from routing, whatever else names them. */
547
- hide: z.array(z.string().min(1)).optional(),
612
+ hide: z2.array(z2.string().min(1)).optional(),
548
613
  /** When set, the only model refs visible; everything else is hidden. */
549
- show: z.array(z.string().min(1)).optional(),
614
+ show: z2.array(z2.string().min(1)).optional(),
550
615
  /** Assertions that each group of refs is one model under several names, overriding what the names alone say. */
551
- same: z.array(z.array(z.string().min(1)).min(2)).optional(),
616
+ same: z2.array(z2.array(z2.string().min(1)).min(2)).optional(),
552
617
  /** Assertions that each pair of refs is two models however alike their names look. */
553
- distinct: z.array(z.tuple([z.string().min(1), z.string().min(1)])).optional(),
618
+ distinct: z2.array(z2.tuple([z2.string().min(1), z2.string().min(1)])).optional(),
554
619
  /** Per-family settings and the names the normaliser cannot know, by family key. */
555
- families: z.record(z.string().min(1), FamilySettingsSchema).optional()
620
+ families: z2.record(z2.string().min(1), FamilySettingsSchema).optional()
556
621
  });
557
- ModelsLayerSchema = z.strictObject({
558
- virtual: z.record(z.string().min(1), z.union([VirtualModelSchema, z.null()])).optional(),
559
- tiers: z.strictObject({
560
- fable: z.union([z.string().min(1), z.null()]).optional(),
561
- opus: z.union([z.string().min(1), z.null()]).optional(),
562
- sonnet: z.union([z.string().min(1), z.null()]).optional(),
563
- haiku: z.union([z.string().min(1), z.null()]).optional()
622
+ ModelsLayerSchema = z2.strictObject({
623
+ virtual: z2.record(z2.string().min(1), z2.union([VirtualModelSchema, z2.null()])).optional(),
624
+ tiers: z2.strictObject({
625
+ fable: z2.union([z2.string().min(1), z2.null()]).optional(),
626
+ opus: z2.union([z2.string().min(1), z2.null()]).optional(),
627
+ sonnet: z2.union([z2.string().min(1), z2.null()]).optional(),
628
+ haiku: z2.union([z2.string().min(1), z2.null()]).optional()
564
629
  }).optional(),
565
- prices: z.record(z.string().min(1), z.union([ModelPricesSchema, z.null()])).optional(),
566
- hide: z.array(z.string().min(1)).optional(),
567
- show: z.array(z.string().min(1)).optional(),
568
- same: z.array(z.array(z.string().min(1)).min(2)).optional(),
569
- distinct: z.array(z.tuple([z.string().min(1), z.string().min(1)])).optional(),
570
- families: z.record(z.string().min(1), z.union([FamilySettingsSchema, z.null()])).optional()
630
+ prices: z2.record(z2.string().min(1), z2.union([ModelPricesSchema, z2.null()])).optional(),
631
+ hide: z2.array(z2.string().min(1)).optional(),
632
+ show: z2.array(z2.string().min(1)).optional(),
633
+ same: z2.array(z2.array(z2.string().min(1)).min(2)).optional(),
634
+ distinct: z2.array(z2.tuple([z2.string().min(1), z2.string().min(1)])).optional(),
635
+ families: z2.record(z2.string().min(1), z2.union([FamilySettingsSchema, z2.null()])).optional()
571
636
  });
572
- ConfigProfileSchema = z.strictObject({
573
- $schema: z.string().optional(),
574
- description: z.string().optional(),
575
- extends: z.array(z.string().min(1)).optional(),
637
+ ConfigProfileSchema = z2.strictObject({
638
+ $schema: z2.string().optional(),
639
+ description: z2.string().optional(),
640
+ extends: z2.array(z2.string().min(1)).optional(),
576
641
  categories: CategoryMapSchema.optional(),
577
642
  entries: EntriesSchema.optional(),
578
643
  launch: LaunchSchema.optional(),
@@ -581,55 +646,55 @@ var init_schema = __esm({
581
646
  POOL_SELECTOR_PREFIX = "pool:";
582
647
  POOL_NAME_PATTERN = "[A-Za-z0-9][A-Za-z0-9._-]*";
583
648
  IDENTITY_NAME_PATTERN = "[A-Za-z0-9][A-Za-z0-9._@-]*";
584
- PoolNameSchema = z.string().min(1).regex(new RegExp(`^${POOL_NAME_PATTERN}$`));
649
+ PoolNameSchema = z2.string().min(1).regex(new RegExp(`^${POOL_NAME_PATTERN}$`));
585
650
  SELECTOR_RE = new RegExp(`^(${POOL_SELECTOR_PREFIX}${POOL_NAME_PATTERN}|${IDENTITY_NAME_PATTERN})$`);
586
- IdentitySelectorSchema = z.string().min(1).regex(SELECTOR_RE);
587
- PoolMemberSchema = z.union([z.string().min(1).regex(SELECTOR_RE), z.strictObject({ identity: z.string().min(1).regex(SELECTOR_RE), when: WhenSchema })]);
651
+ IdentitySelectorSchema = z2.string().min(1).regex(SELECTOR_RE);
652
+ PoolMemberSchema = z2.union([z2.string().min(1).regex(SELECTOR_RE), z2.strictObject({ identity: z2.string().min(1).regex(SELECTOR_RE), when: WhenSchema })]);
588
653
  POOL_PREFERENCES = ["score", "listed"];
589
- PoolPreferenceSchema = z.enum(POOL_PREFERENCES);
654
+ PoolPreferenceSchema = z2.enum(POOL_PREFERENCES);
590
655
  WHOLE_PERCENT_MAX = 100;
591
- CompactAtUtilisationSchema = z.number().int().min(1).max(WHOLE_PERCENT_MAX);
592
- PoolSchema = z.strictObject({
593
- identities: z.array(PoolMemberSchema).min(1).refine((members) => new Set(members.map(poolMemberIdentity)).size === members.length, { message: "pool members must be unique" }),
656
+ CompactAtUtilisationSchema = z2.number().int().min(1).max(WHOLE_PERCENT_MAX);
657
+ PoolSchema = z2.strictObject({
658
+ identities: z2.array(PoolMemberSchema).min(1).refine((members) => new Set(members.map(poolMemberIdentity)).size === members.length, { message: "pool members must be unique" }),
594
659
  preference: PoolPreferenceSchema.optional(),
595
660
  /** 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. */
596
- resumeOnLimit: z.boolean().optional(),
661
+ resumeOnLimit: z2.boolean().optional(),
597
662
  /** 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. */
598
- compactBeforeLimit: z.boolean().optional(),
663
+ compactBeforeLimit: z2.boolean().optional(),
599
664
  /** 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`. */
600
665
  compactAtUtilisation: CompactAtUtilisationSchema.optional()
601
666
  }).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"] });
602
667
  WEEKDAYS = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
603
- AnchorSchema = z.strictObject({
604
- days: z.array(z.enum(WEEKDAYS)).min(1).refine((days) => new Set(days).size === days.length, "an anchor names each weekday at most once"),
605
- time: z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "a 24-hour time such as 06:00"),
606
- timeZone: z.string().refine(isTimeZone, "an IANA time zone such as Europe/London").optional()
668
+ AnchorSchema = z2.strictObject({
669
+ days: z2.array(z2.enum(WEEKDAYS)).min(1).refine((days) => new Set(days).size === days.length, "an anchor names each weekday at most once"),
670
+ time: z2.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "a 24-hour time such as 06:00"),
671
+ timeZone: z2.string().refine(isTimeZone, "an IANA time zone such as Europe/London").optional()
607
672
  });
608
673
  JOB_WINDOWS = ["fiveHour", "sevenDay"];
609
- JobTriggerSchema = z.union([z.strictObject({ at: z.array(AnchorSchema).min(1) }), z.strictObject({ beforeReset: z.enum(JOB_WINDOWS), lead: z.string().regex(DURATION_RE) })]);
610
- JobTargetSchema = z.union([z.strictObject({ identity: IdentitySelectorSchema }), z.strictObject({ pool: PoolNameSchema })]);
611
- JobSchema = z.strictObject({
674
+ JobTriggerSchema = z2.union([z2.strictObject({ at: z2.array(AnchorSchema).min(1) }), z2.strictObject({ beforeReset: z2.enum(JOB_WINDOWS), lead: z2.string().regex(DURATION_RE) })]);
675
+ JobTargetSchema = z2.union([z2.strictObject({ identity: IdentitySelectorSchema }), z2.strictObject({ pool: PoolNameSchema })]);
676
+ JobSchema = z2.strictObject({
612
677
  target: JobTargetSchema,
613
678
  trigger: JobTriggerSchema,
614
- prompt: z.string().min(1),
679
+ prompt: z2.string().min(1),
615
680
  /** The absolute directory the run works in. */
616
- cwd: z.string().min(1),
617
- timeout: z.string().regex(DURATION_RE),
618
- model: z.string().min(1).optional(),
619
- allowedTools: z.array(z.string().min(1)).min(1).optional()
681
+ cwd: z2.string().min(1),
682
+ timeout: z2.string().regex(DURATION_RE),
683
+ model: z2.string().min(1).optional(),
684
+ allowedTools: z2.array(z2.string().min(1)).min(1).optional()
620
685
  });
621
686
  DirectoryRuleSchema = ConfigProfileSchema.omit({ description: true }).extend({
622
- path: z.string().min(1),
623
- configProfile: z.string().min(1).optional(),
687
+ path: z2.string().min(1),
688
+ configProfile: z2.string().min(1).optional(),
624
689
  identity: IdentitySelectorSchema.optional(),
625
690
  when: WhenSchema.optional()
626
691
  });
627
- DirectoryRulesSchema = z.strictObject({
628
- $schema: z.string().optional(),
629
- rules: z.array(DirectoryRuleSchema)
692
+ DirectoryRulesSchema = z2.strictObject({
693
+ $schema: z2.string().optional(),
694
+ rules: z2.array(DirectoryRuleSchema)
630
695
  });
631
696
  PortableConfigSchema = ConfigProfileSchema.omit({ description: true }).extend({
632
- configProfile: z.string().min(1).optional(),
697
+ configProfile: z2.string().min(1).optional(),
633
698
  identity: IdentitySelectorSchema.optional(),
634
699
  when: WhenSchema.optional()
635
700
  });
@@ -638,23 +703,23 @@ var init_schema = __esm({
638
703
  HEADROOM_ROLLOUT_CHANNELS = ["beta", "canary", "dev"];
639
704
  INTERCEPT_CHANNELS = ["canary", "dev"];
640
705
  READ_MATURATION_CHANNELS = ["beta", "dev"];
641
- HeadroomGlobalConfigObjectSchema = z.strictObject({
706
+ HeadroomGlobalConfigObjectSchema = z2.strictObject({
642
707
  /** Install spec handed to `uv tool install`. Defaults to HEADROOM_DEFAULT_SOURCE. */
643
- source: z.string().min(1).optional(),
708
+ source: z2.string().min(1).optional(),
644
709
  /** How long the daemon may sit with no registered sessions before the supervisor stops it. Defaults to HEADROOM_DEFAULT_IDLE_SHUTDOWN_MINUTES. */
645
- idleShutdownMinutes: z.number().int().positive().optional(),
710
+ idleShutdownMinutes: z2.number().int().positive().optional(),
646
711
  /** Optimisation mode, passed as `--mode`. Unset leaves headroom's own default (`cache`). */
647
- mode: z.enum(HEADROOM_MODES).optional(),
712
+ mode: z2.enum(HEADROOM_MODES).optional(),
648
713
  /** Keep-ratio for prose and code compression, passed as `--target-ratio`: lower is more aggressive. Unset lets headroom decide. */
649
- targetRatio: z.number().gt(0).max(1).optional(),
714
+ targetRatio: z2.number().gt(0).max(1).optional(),
650
715
  /** How compressed tool output stays recoverable. Unset leaves headroom's own default (`default`). */
651
- ccr: z.enum(HEADROOM_CCR_MODES).optional(),
716
+ ccr: z2.enum(HEADROOM_CCR_MODES).optional(),
652
717
  /** Headroom's experimental release channel, exported as `HEADROOM_ROLLOUT_CHANNEL`. Required by `interceptToolResults` and `readMaturation`, which are refused without a channel that unlocks them. */
653
- rolloutChannel: z.enum(HEADROOM_ROLLOUT_CHANNELS).optional(),
718
+ rolloutChannel: z2.enum(HEADROOM_ROLLOUT_CHANNELS).optional(),
654
719
  /** Opt in to headroom's tool-result interceptors (`--intercept-tool-results`). Needs `rolloutChannel` canary or dev. */
655
- interceptToolResults: z.boolean().optional(),
720
+ interceptToolResults: z2.boolean().optional(),
656
721
  /** Opt in to headroom's experimental read maturation (`--read-maturation`). Needs `rolloutChannel` beta or dev. */
657
- readMaturation: z.boolean().optional()
722
+ readMaturation: z2.boolean().optional()
658
723
  });
659
724
  HeadroomGlobalConfigSchema = HeadroomGlobalConfigObjectSchema.superRefine((config, context) => {
660
725
  if (config.interceptToolResults === true && !INTERCEPT_CHANNELS.includes(config.rolloutChannel ?? "")) {
@@ -666,53 +731,53 @@ var init_schema = __esm({
666
731
  });
667
732
  HEADROOM_DEFAULT_SOURCE = "headroom-ai[proxy] @ git+https://github.com/ExaDev/headroom@2dfa958e47814533751cdd0c5362d8f352ec5b75";
668
733
  HEADROOM_DEFAULT_IDLE_SHUTDOWN_MINUTES = 15;
669
- FrontDoorGlobalConfigSchema = z.strictObject({
734
+ FrontDoorGlobalConfigSchema = z2.strictObject({
670
735
  /** How long the front door may sit with no registered sessions before it closes and exits. Defaults to FRONTDOOR_DEFAULT_IDLE_SHUTDOWN_MINUTES. */
671
- idleShutdownMinutes: z.number().int().positive().optional()
736
+ idleShutdownMinutes: z2.number().int().positive().optional()
672
737
  });
673
738
  UPDATE_MODES = ["off", "notify", "auto"];
674
- UpdateGlobalConfigSchema = z.strictObject({
739
+ UpdateGlobalConfigSchema = z2.strictObject({
675
740
  /** What a launch does about a newer release of agent-shim itself; see `UPDATE_MODES`. Absent means `off`. */
676
- mode: z.enum(UPDATE_MODES).optional()
741
+ mode: z2.enum(UPDATE_MODES).optional()
677
742
  });
678
- GlobalConfigSchema = z.strictObject({
679
- $schema: z.string().optional(),
680
- defaultConfigProfile: z.string().min(1).optional(),
681
- walkUpLimit: z.string().min(1).optional(),
743
+ GlobalConfigSchema = z2.strictObject({
744
+ $schema: z2.string().optional(),
745
+ defaultConfigProfile: z2.string().min(1).optional(),
746
+ walkUpLimit: z2.string().min(1).optional(),
682
747
  categories: CategoryMapSchema.optional(),
683
748
  entries: EntriesSchema.optional(),
684
749
  launch: LaunchSchema.optional(),
685
750
  headroom: HeadroomGlobalConfigSchema.optional(),
686
751
  frontdoor: FrontDoorGlobalConfigSchema.optional(),
687
752
  update: UpdateGlobalConfigSchema.optional(),
688
- pools: z.record(PoolNameSchema, PoolSchema).optional(),
753
+ pools: z2.record(PoolNameSchema, PoolSchema).optional(),
689
754
  models: ModelsConfigSchema.optional(),
690
- jobs: z.record(PoolNameSchema, JobSchema).optional()
755
+ jobs: z2.record(PoolNameSchema, JobSchema).optional()
691
756
  });
692
- IdentitySchema = z.strictObject({
693
- $schema: z.string().optional(),
694
- name: z.string().min(1).regex(/^[A-Za-z0-9][A-Za-z0-9._@-]*$/),
695
- defaultConfigProfile: z.string().min(1).optional(),
696
- allowAmbientCredential: z.boolean().default(false),
757
+ IdentitySchema = z2.strictObject({
758
+ $schema: z2.string().optional(),
759
+ name: z2.string().min(1).regex(/^[A-Za-z0-9][A-Za-z0-9._@-]*$/),
760
+ defaultConfigProfile: z2.string().min(1).optional(),
761
+ allowAmbientCredential: z2.boolean().default(false),
697
762
  credential: CredentialSchema.optional(),
698
763
  /** 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. */
699
- anchors: z.array(AnchorSchema).min(1).optional()
764
+ anchors: z2.array(AnchorSchema).min(1).optional()
700
765
  });
701
- CategoryClassificationSchema = z.strictObject({
702
- $schema: z.string().optional(),
703
- secret: z.array(z.string().min(1)),
704
- runtime: z.array(z.string().min(1)),
705
- history: z.array(z.string().min(1)),
706
- knowledge: z.array(z.string().min(1)),
707
- settings: z.array(z.string().min(1))
766
+ CategoryClassificationSchema = z2.strictObject({
767
+ $schema: z2.string().optional(),
768
+ secret: z2.array(z2.string().min(1)),
769
+ runtime: z2.array(z2.string().min(1)),
770
+ history: z2.array(z2.string().min(1)),
771
+ knowledge: z2.array(z2.string().min(1)),
772
+ settings: z2.array(z2.string().min(1))
708
773
  });
709
- CategoryClassificationOverlaySchema = z.strictObject({
710
- $schema: z.string().optional(),
711
- secret: z.array(z.string().min(1)).optional(),
712
- runtime: z.array(z.string().min(1)).optional(),
713
- history: z.array(z.string().min(1)).optional(),
714
- knowledge: z.array(z.string().min(1)).optional(),
715
- settings: z.array(z.string().min(1)).optional()
774
+ CategoryClassificationOverlaySchema = z2.strictObject({
775
+ $schema: z2.string().optional(),
776
+ secret: z2.array(z2.string().min(1)).optional(),
777
+ runtime: z2.array(z2.string().min(1)).optional(),
778
+ history: z2.array(z2.string().min(1)).optional(),
779
+ knowledge: z2.array(z2.string().min(1)).optional(),
780
+ settings: z2.array(z2.string().min(1)).optional()
716
781
  });
717
782
  SHIPPED_CATEGORY_DEFAULTS = Object.freeze({
718
783
  secret: false,
@@ -1504,6 +1569,9 @@ function flattenLayers(layers, options) {
1504
1569
  if (layer.launch.proxyBypass !== void 0) {
1505
1570
  launch.proxyBypass = layer.launch.proxyBypass;
1506
1571
  }
1572
+ if (layer.launch.statusline !== void 0) {
1573
+ launch.statusline = { ...launch.statusline, ...layer.launch.statusline };
1574
+ }
1507
1575
  }
1508
1576
  if (layer.models !== void 0) {
1509
1577
  models = mergeModels(models, layer.models);
@@ -2429,7 +2497,7 @@ var init_lock = __esm({
2429
2497
 
2430
2498
  // src/launcher/farm.ts
2431
2499
  import path7 from "node:path";
2432
- import { z as z2 } from "zod";
2500
+ import { z as z3 } from "zod";
2433
2501
  function readFarmManifest(fs14, farmRoot) {
2434
2502
  const raw = fs14.readFileUtf8(path7.join(farmRoot, FARM_MANIFEST_FILENAME)) ?? fs14.readFileUtf8(path7.join(farmRoot, LEGACY_FARM_MANIFEST_FILENAME));
2435
2503
  if (raw === void 0) {
@@ -2901,15 +2969,15 @@ var init_farm = __esm({
2901
2969
  init_legacy();
2902
2970
  init_lock();
2903
2971
  FARM_MANIFEST_FILENAME = ".agent-shim-farm.json";
2904
- FarmManifestSchema = z2.strictObject({
2905
- version: z2.literal(1),
2906
- builtAtMs: z2.number(),
2907
- identity: z2.string(),
2908
- configProfile: z2.string().optional(),
2909
- cwd: z2.string(),
2910
- claudeHome: z2.string(),
2911
- materialised: z2.array(z2.string()),
2912
- links: z2.array(z2.strictObject({ rel: z2.string(), target: z2.string() }))
2972
+ FarmManifestSchema = z3.strictObject({
2973
+ version: z3.literal(1),
2974
+ builtAtMs: z3.number(),
2975
+ identity: z3.string(),
2976
+ configProfile: z3.string().optional(),
2977
+ cwd: z3.string(),
2978
+ claudeHome: z3.string(),
2979
+ materialised: z3.array(z3.string()),
2980
+ links: z3.array(z3.strictObject({ rel: z3.string(), target: z3.string() }))
2913
2981
  });
2914
2982
  }
2915
2983
  });
@@ -3304,7 +3372,7 @@ var init_route = __esm({
3304
3372
 
3305
3373
  // src/frontdoor/state.ts
3306
3374
  import path8 from "node:path";
3307
- import { z as z3 } from "zod";
3375
+ import { z as z4 } from "zod";
3308
3376
  function readFrontDoorState(fs14, stateFile) {
3309
3377
  let raw;
3310
3378
  try {
@@ -3447,39 +3515,39 @@ var init_state = __esm({
3447
3515
  "use strict";
3448
3516
  init_schema();
3449
3517
  FRONT_DOOR_PROTOCOL = 5;
3450
- FrontDoorSessionSchema = z3.strictObject({ pid: z3.number().int().positive(), startedAt: z3.number(), token: z3.string().min(1), supervisorPid: z3.number().int().positive().optional(), sessionId: z3.string().min(1).optional(), models: ModelsConfigSchema.optional() });
3451
- FrontDoorStateSchema = z3.strictObject({
3518
+ FrontDoorSessionSchema = z4.strictObject({ pid: z4.number().int().positive(), startedAt: z4.number(), token: z4.string().min(1), supervisorPid: z4.number().int().positive().optional(), sessionId: z4.string().min(1).optional(), models: ModelsConfigSchema.optional() });
3519
+ FrontDoorStateSchema = z4.strictObject({
3452
3520
  /**
3453
3521
  * 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`).
3454
3522
  */
3455
- protocol: z3.number().int().nonnegative().optional(),
3523
+ protocol: z4.number().int().nonnegative().optional(),
3456
3524
  /** The supervisor process serving the front door. Alive means both listeners are up in that process. */
3457
- supervisorPid: z3.number().int().positive().optional(),
3525
+ supervisorPid: z4.number().int().positive().optional(),
3458
3526
  /** 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. */
3459
- port: z3.number().int().positive().optional(),
3527
+ port: z4.number().int().positive().optional(),
3460
3528
  /**
3461
3529
  * 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.
3462
3530
  */
3463
- lastPort: z3.number().int().positive().optional(),
3531
+ lastPort: z4.number().int().positive().optional(),
3464
3532
  /**
3465
3533
  * 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`.
3466
3534
  */
3467
- connectPort: z3.number().int().positive().optional(),
3535
+ connectPort: z4.number().int().positive().optional(),
3468
3536
  /**
3469
3537
  * 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.
3470
3538
  */
3471
- lastConnectPort: z3.number().int().positive().optional(),
3539
+ lastConnectPort: z4.number().int().positive().optional(),
3472
3540
  /**
3473
3541
  * 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.
3474
3542
  */
3475
- directPort: z3.number().int().positive().optional(),
3543
+ directPort: z4.number().int().positive().optional(),
3476
3544
  /** The sticky port preference for the direct listener, for the reason `directPort` gives. */
3477
- lastDirectPort: z3.number().int().positive().optional(),
3545
+ lastDirectPort: z4.number().int().positive().optional(),
3478
3546
  /** The last fatal error, kept across shutdowns so `frontdoor status` can explain a front door that is not running. */
3479
- lastError: z3.string().optional()
3547
+ lastError: z4.string().optional()
3480
3548
  });
3481
3549
  MAX_TCP_PORT = 65535;
3482
- FrontDoorDirectRecordSchema = z3.strictObject({ directPort: z3.number().int().positive().max(MAX_TCP_PORT) });
3550
+ FrontDoorDirectRecordSchema = z4.strictObject({ directPort: z4.number().int().positive().max(MAX_TCP_PORT) });
3483
3551
  RECORD_TEMPORARY_FILE = /^[1-9]\d*\.json\.([1-9]\d*)\.tmp$/;
3484
3552
  }
3485
3553
  });
@@ -4167,7 +4235,7 @@ var init_package = __esm({
4167
4235
  "package.json"() {
4168
4236
  package_default = {
4169
4237
  name: "claude-use",
4170
- version: "11.49.2",
4238
+ version: "11.50.1",
4171
4239
  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.",
4172
4240
  license: "MIT",
4173
4241
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -4367,7 +4435,7 @@ var init_supervisorProcesses = __esm({
4367
4435
  // src/headroom/state.ts
4368
4436
  import { createHash as createHash3 } from "node:crypto";
4369
4437
  import path11 from "node:path";
4370
- import { z as z8 } from "zod";
4438
+ import { z as z9 } from "zod";
4371
4439
  function parseJson(raw, schema) {
4372
4440
  if (raw === void 0 || raw.trim() === "") {
4373
4441
  return void 0;
@@ -4524,32 +4592,32 @@ var init_state2 = __esm({
4524
4592
  "src/headroom/state.ts"() {
4525
4593
  "use strict";
4526
4594
  init_schema();
4527
- HeadroomStateSchema = z8.strictObject({
4595
+ HeadroomStateSchema = z9.strictObject({
4528
4596
  /** The supervisor process owning the daemon. Alive means someone is keeping headroom running. */
4529
- supervisorPid: z8.number().int().positive().optional(),
4597
+ supervisorPid: z9.number().int().positive().optional(),
4530
4598
  /** 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. */
4531
- headroomPid: z8.number().int().positive().optional(),
4599
+ headroomPid: z9.number().int().positive().optional(),
4532
4600
  /**
4533
4601
  * 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.
4534
4602
  */
4535
- socketPath: z8.string().min(1).optional(),
4603
+ socketPath: z9.string().min(1).optional(),
4536
4604
  /** The `headroom --version` output of the running install. */
4537
- version: z8.string().optional(),
4605
+ version: z9.string().optional(),
4538
4606
  /**
4539
4607
  * 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`).
4540
4608
  */
4541
- allowlistHash: z8.string().optional(),
4609
+ allowlistHash: z9.string().optional(),
4542
4610
  /** Hash of the token-saving settings the running proxy was started with, so a settings change is detected as drift. */
4543
- settingsHash: z8.string().optional(),
4611
+ settingsHash: z9.string().optional(),
4544
4612
  /** The install spec the running install was last installed from, so a `source` config change is detected as drift. */
4545
- installedSource: z8.string().optional(),
4613
+ installedSource: z9.string().optional(),
4546
4614
  /** 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. */
4547
- installing: z8.string().optional(),
4615
+ installing: z9.string().optional(),
4548
4616
  /** The last fatal error, kept across shutdowns so `headroom status` can explain a daemon that is not running. */
4549
- lastError: z8.string().optional()
4617
+ lastError: z9.string().optional()
4550
4618
  });
4551
- HeadroomSessionSchema = z8.strictObject({ pid: z8.number().int().positive(), startedAt: z8.number(), supervisorPid: z8.number().int().positive() });
4552
- HeadroomLockSchema = z8.strictObject({ pid: z8.number().int().positive(), at: z8.number() });
4619
+ HeadroomSessionSchema = z9.strictObject({ pid: z9.number().int().positive(), startedAt: z9.number(), supervisorPid: z9.number().int().positive() });
4620
+ HeadroomLockSchema = z9.strictObject({ pid: z9.number().int().positive(), at: z9.number() });
4553
4621
  HEADROOM_ALLOWLIST_FILE_FLAG = "--allowed-base-urls-file";
4554
4622
  ALLOWLIST_LINE_BREAKS = "\\n\\r\\u000b\\u000c\\u001c\\u001d\\u001e\\u0085\\u2028\\u2029";
4555
4623
  ALLOWLIST_WHITESPACE = "\\t\\n\\u000b\\u000c\\r\\u001c-\\u001f \\u0085\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000";
@@ -4950,7 +5018,7 @@ var init_socket = __esm({
4950
5018
  });
4951
5019
 
4952
5020
  // src/headroom/source.ts
4953
- import { z as z9 } from "zod";
5021
+ import { z as z10 } from "zod";
4954
5022
  function isMovingGitSource(spec) {
4955
5023
  const match = GIT_SPEC_RE.exec(spec);
4956
5024
  if (match === null) {
@@ -4969,7 +5037,7 @@ var init_source = __esm({
4969
5037
  "use strict";
4970
5038
  GIT_SPEC_RE = /git\+[^@\s]+(?:@([^\s#]+))?/;
4971
5039
  COMMIT_SHA_RE = /^[0-9a-f]{40}$/i;
4972
- DirectUrlSchema = z9.object({ vcs_info: z9.object({ commit_id: z9.string() }) });
5040
+ DirectUrlSchema = z10.object({ vcs_info: z10.object({ commit_id: z10.string() }) });
4973
5041
  }
4974
5042
  });
4975
5043
 
@@ -6098,161 +6166,161 @@ var init_identity = __esm({
6098
6166
  });
6099
6167
 
6100
6168
  // src/usage/schema.ts
6101
- import { z as z10 } from "zod";
6169
+ import { z as z11 } from "zod";
6102
6170
  var USAGE_SCHEMA_VERSION, VersionSchema, InstantSchema, TokenCountSchema, TokenUsageSchema, LIMIT_KINDS, LimitClassificationSchema, UsageRecordSchema, QuotaWindowSchema, ExtraUsageSpendSchema, UnifiedRateLimitSchema, RateLimitStateSchema, LimitEventSchema, ProviderQuotaWindowSchema, ProviderAccountSchema, ProviderQuotaSchema, ProviderUsageStateSchema, AccountMetadataSchema, UsageSnapshotSchema;
6103
6171
  var init_schema2 = __esm({
6104
6172
  "src/usage/schema.ts"() {
6105
6173
  "use strict";
6106
6174
  USAGE_SCHEMA_VERSION = 1;
6107
- VersionSchema = z10.literal(USAGE_SCHEMA_VERSION);
6108
- InstantSchema = z10.iso.datetime();
6109
- TokenCountSchema = z10.number().int().nonnegative();
6110
- TokenUsageSchema = z10.strictObject({
6175
+ VersionSchema = z11.literal(USAGE_SCHEMA_VERSION);
6176
+ InstantSchema = z11.iso.datetime();
6177
+ TokenCountSchema = z11.number().int().nonnegative();
6178
+ TokenUsageSchema = z11.strictObject({
6111
6179
  inputTokens: TokenCountSchema.optional(),
6112
6180
  outputTokens: TokenCountSchema.optional(),
6113
6181
  cacheCreationInputTokens: TokenCountSchema.optional(),
6114
6182
  cacheReadInputTokens: TokenCountSchema.optional()
6115
6183
  });
6116
6184
  LIMIT_KINDS = ["rate-limited", "quota-exhausted"];
6117
- LimitClassificationSchema = z10.strictObject({
6118
- kind: z10.enum(LIMIT_KINDS),
6185
+ LimitClassificationSchema = z11.strictObject({
6186
+ kind: z11.enum(LIMIT_KINDS),
6119
6187
  /** Seconds to wait before retrying, from the response's `retry-after`. */
6120
- retryAfterSeconds: z10.number().nonnegative().optional(),
6188
+ retryAfterSeconds: z11.number().nonnegative().optional(),
6121
6189
  /** When the limiting window resets, from the upstream's own reset header. */
6122
6190
  resetAt: InstantSchema.optional(),
6123
6191
  /** The window the upstream named as the binding one (`anthropic-ratelimit-unified-representative-claim`), such as `five_hour` or `seven_day`. */
6124
- window: z10.string().optional(),
6192
+ window: z11.string().optional(),
6125
6193
  /** 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. */
6126
- evidence: z10.array(z10.string())
6194
+ evidence: z11.array(z11.string())
6127
6195
  });
6128
- UsageRecordSchema = z10.strictObject({
6196
+ UsageRecordSchema = z11.strictObject({
6129
6197
  schemaVersion: VersionSchema,
6130
6198
  /** When the front door received the request. */
6131
6199
  at: InstantSchema,
6132
6200
  /** The launching identity, when the launch resolved one. */
6133
- identity: z10.string().optional(),
6201
+ identity: z11.string().optional(),
6134
6202
  /** `anthropic` for an OAuth session's request to Claude Code's own API, otherwise the provider's name. */
6135
- provider: z10.string(),
6203
+ provider: z11.string(),
6136
6204
  /** The launch's session id, generated per launch. */
6137
- sessionId: z10.string().optional(),
6205
+ sessionId: z11.string().optional(),
6138
6206
  /** The project the launch ran in (its git repository root), when the launch sent one: headroom launches do. */
6139
- project: z10.string().optional(),
6207
+ project: z11.string().optional(),
6140
6208
  /** 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. */
6141
- viaHeadroom: z10.boolean().optional(),
6209
+ viaHeadroom: z11.boolean().optional(),
6142
6210
  /** The front-door route that served the request. */
6143
- route: z10.string(),
6144
- method: z10.string(),
6211
+ route: z11.string(),
6212
+ method: z11.string(),
6145
6213
  /** The API path as the upstream sees it (`/v1/messages`), without the provider prefix or a query string. */
6146
- endpoint: z10.string(),
6214
+ endpoint: z11.string(),
6147
6215
  /** The model the response named. */
6148
- model: z10.string().optional(),
6216
+ model: z11.string().optional(),
6149
6217
  /** 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. */
6150
- requestedModel: z10.string().optional(),
6218
+ requestedModel: z11.string().optional(),
6151
6219
  /** 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. */
6152
- candidateProviders: z10.array(z10.string()).optional(),
6153
- status: z10.number().int(),
6220
+ candidateProviders: z11.array(z11.string()).optional(),
6221
+ status: z11.number().int(),
6154
6222
  /** Milliseconds from the request's arrival to its response head. */
6155
- latencyMs: z10.number().int().nonnegative(),
6223
+ latencyMs: z11.number().int().nonnegative(),
6156
6224
  /** Milliseconds from the request's arrival to the end of its response body. */
6157
- durationMs: z10.number().int().nonnegative(),
6225
+ durationMs: z11.number().int().nonnegative(),
6158
6226
  /** Whether the client received the whole body. */
6159
- outcome: z10.enum(["completed", "aborted"]),
6227
+ outcome: z11.enum(["completed", "aborted"]),
6160
6228
  usage: TokenUsageSchema.optional(),
6161
6229
  /** The response's quota and rate-limit headers, by name (see `isRateLimitHeader`). */
6162
- rateLimitHeaders: z10.record(z10.string(), z10.string()).optional(),
6230
+ rateLimitHeaders: z11.record(z11.string(), z11.string()).optional(),
6163
6231
  limit: LimitClassificationSchema.optional(),
6164
6232
  /** The upstream's request id (`request-id`), for matching a record to the provider's own logs. */
6165
- requestId: z10.string().optional()
6233
+ requestId: z11.string().optional()
6166
6234
  });
6167
- QuotaWindowSchema = z10.strictObject({
6235
+ QuotaWindowSchema = z11.strictObject({
6168
6236
  /** The fraction of the window used, as the upstream reports it (0 to 1). */
6169
- utilization: z10.number().nonnegative().optional(),
6237
+ utilization: z11.number().nonnegative().optional(),
6170
6238
  resetsAt: InstantSchema.optional(),
6171
6239
  /** The window's own status (`allowed`, `allowed_warning`, `rejected`). */
6172
- status: z10.string().optional(),
6240
+ status: z11.string().optional(),
6173
6241
  /** 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. */
6174
- graceUtilization: z10.number().nonnegative().optional()
6242
+ graceUtilization: z11.number().nonnegative().optional()
6175
6243
  });
6176
- ExtraUsageSpendSchema = z10.strictObject({
6244
+ ExtraUsageSpendSchema = z11.strictObject({
6177
6245
  /** Spent so far in the allowance's period, in the currency's minor units (pence, cents). */
6178
- usedMinor: z10.number().nonnegative(),
6246
+ usedMinor: z11.number().nonnegative(),
6179
6247
  /** The allowance's cap in the same units, when it has one. */
6180
- limitMinor: z10.number().nonnegative().optional(),
6248
+ limitMinor: z11.number().nonnegative().optional(),
6181
6249
  /** The ISO 4217 currency code. */
6182
- currency: z10.string()
6250
+ currency: z11.string()
6183
6251
  });
6184
- UnifiedRateLimitSchema = z10.strictObject({
6252
+ UnifiedRateLimitSchema = z11.strictObject({
6185
6253
  /** The overall status: `allowed`, `allowed_warning` or `rejected`. */
6186
- status: z10.string().optional(),
6254
+ status: z11.string().optional(),
6187
6255
  fiveHour: QuotaWindowSchema.optional(),
6188
6256
  sevenDay: QuotaWindowSchema.optional(),
6189
6257
  /** 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. */
6190
6258
  sevenDayOverageIncluded: QuotaWindowSchema.optional(),
6191
6259
  /** The window that currently binds. */
6192
- representativeClaim: z10.string().optional(),
6260
+ representativeClaim: z11.string().optional(),
6193
6261
  /** When the binding window resets. */
6194
6262
  resetAt: InstantSchema.optional(),
6195
6263
  /** Whether usage beyond the plan (extra usage) is available: `allowed` or `rejected`. */
6196
- overageStatus: z10.string().optional(),
6264
+ overageStatus: z11.string().optional(),
6197
6265
  /** 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. */
6198
- overageUtilization: z10.number().nonnegative().optional(),
6266
+ overageUtilization: z11.number().nonnegative().optional(),
6199
6267
  /** When the extra-usage allowance resets. */
6200
6268
  overageResetsAt: InstantSchema.optional(),
6201
6269
  /** Why extra usage is unavailable, as the upstream names it (`out_of_credits`, for one). */
6202
- overageDisabledReason: z10.string().optional(),
6270
+ overageDisabledReason: z11.string().optional(),
6203
6271
  /** Whether the response was served on extra usage, as the upstream states it. */
6204
- overageInUse: z10.boolean().optional(),
6272
+ overageInUse: z11.boolean().optional(),
6205
6273
  /** The allowance in money, from the usage endpoint (the response headers state only the fraction). */
6206
6274
  extraUsageSpend: ExtraUsageSpendSchema.optional(),
6207
6275
  /** True when the upstream offers a fallback while a window is rejected: some requests, by model, are still served, though the rest are refused. */
6208
- fallbackAvailable: z10.boolean().optional()
6276
+ fallbackAvailable: z11.boolean().optional()
6209
6277
  });
6210
- RateLimitStateSchema = z10.strictObject({
6278
+ RateLimitStateSchema = z11.strictObject({
6211
6279
  observedAt: InstantSchema,
6212
6280
  /** Every quota and rate-limit header on that response, by name. */
6213
- headers: z10.record(z10.string(), z10.string()),
6281
+ headers: z11.record(z11.string(), z11.string()),
6214
6282
  unified: UnifiedRateLimitSchema.optional(),
6215
6283
  /** 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. */
6216
6284
  planWindowsUnavailableAt: InstantSchema.optional()
6217
6285
  });
6218
6286
  LimitEventSchema = LimitClassificationSchema.extend({
6219
6287
  observedAt: InstantSchema,
6220
- status: z10.number().int()
6288
+ status: z11.number().int()
6221
6289
  });
6222
- ProviderQuotaWindowSchema = z10.strictObject({
6290
+ ProviderQuotaWindowSchema = z11.strictObject({
6223
6291
  /** What the window measures, in the provider's terms (`tokens`, `tool-calls`). */
6224
- measures: z10.string(),
6292
+ measures: z11.string(),
6225
6293
  /** 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. */
6226
- periodMs: z10.number().int().positive().optional(),
6294
+ periodMs: z11.number().int().positive().optional(),
6227
6295
  /** The provider's own description of the period when `periodMs` could not be derived, such as `unit 4 x 1`. */
6228
- period: z10.string().optional(),
6296
+ period: z11.string().optional(),
6229
6297
  /** The fraction of the window used (0 to 1). */
6230
- utilization: z10.number().nonnegative(),
6298
+ utilization: z11.number().nonnegative(),
6231
6299
  resetsAt: InstantSchema.optional(),
6232
6300
  /** Absolute counts, when the provider reports them for this window. */
6233
- limit: z10.number().nonnegative().optional(),
6234
- used: z10.number().nonnegative().optional(),
6235
- remaining: z10.number().nonnegative().optional()
6301
+ limit: z11.number().nonnegative().optional(),
6302
+ used: z11.number().nonnegative().optional(),
6303
+ remaining: z11.number().nonnegative().optional()
6236
6304
  });
6237
- ProviderAccountSchema = z10.strictObject({
6238
- email: z10.string().optional(),
6239
- accountId: z10.string().optional()
6305
+ ProviderAccountSchema = z11.strictObject({
6306
+ email: z11.string().optional(),
6307
+ accountId: z11.string().optional()
6240
6308
  });
6241
- ProviderQuotaSchema = z10.strictObject({
6309
+ ProviderQuotaSchema = z11.strictObject({
6242
6310
  observedAt: InstantSchema,
6243
6311
  /** Which usage endpoint produced it (`z.ai`). */
6244
- source: z10.string(),
6312
+ source: z11.string(),
6245
6313
  /** The subscription level the endpoint reports, when it does. */
6246
- level: z10.string().optional(),
6314
+ level: z11.string().optional(),
6247
6315
  /** The account the provider's credential belongs to, when its endpoint reports it. */
6248
6316
  account: ProviderAccountSchema.optional(),
6249
- windows: z10.array(ProviderQuotaWindowSchema)
6317
+ windows: z11.array(ProviderQuotaWindowSchema)
6250
6318
  });
6251
- ProviderUsageStateSchema = z10.strictObject({
6319
+ ProviderUsageStateSchema = z11.strictObject({
6252
6320
  /** 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. */
6253
6321
  lastRequestAt: InstantSchema.optional(),
6254
- lastStatus: z10.number().int().optional(),
6255
- lastModel: z10.string().optional(),
6322
+ lastStatus: z11.number().int().optional(),
6323
+ lastModel: z11.string().optional(),
6256
6324
  /** The latest rate-limit state, from the last response that carried any rate-limit header. */
6257
6325
  rateLimit: RateLimitStateSchema.optional(),
6258
6326
  /** The latest classified refusal. It stays after later successes, so a reader compares its `resetAt` (or `observedAt` plus `retryAfterSeconds`) with the current time. */
@@ -6260,31 +6328,31 @@ var init_schema2 = __esm({
6260
6328
  /** The latest quota the provider's usage endpoint reported, for providers whose quota is not visible in response headers. */
6261
6329
  quota: ProviderQuotaSchema.optional()
6262
6330
  });
6263
- AccountMetadataSchema = z10.strictObject({
6264
- accountUuid: z10.string().optional(),
6265
- emailAddress: z10.string().optional(),
6266
- displayName: z10.string().optional(),
6267
- organizationUuid: z10.string().optional(),
6268
- organizationName: z10.string().optional(),
6269
- organizationType: z10.string().optional(),
6270
- organizationRole: z10.string().optional(),
6271
- workspaceRole: z10.string().optional(),
6272
- billingType: z10.string().optional(),
6273
- seatTier: z10.string().optional(),
6274
- organizationRateLimitTier: z10.string().optional(),
6275
- userRateLimitTier: z10.string().optional(),
6276
- hasExtraUsageEnabled: z10.boolean().optional(),
6277
- subscriptionCreatedAt: z10.string().optional(),
6278
- accountCreatedAt: z10.string().optional()
6331
+ AccountMetadataSchema = z11.strictObject({
6332
+ accountUuid: z11.string().optional(),
6333
+ emailAddress: z11.string().optional(),
6334
+ displayName: z11.string().optional(),
6335
+ organizationUuid: z11.string().optional(),
6336
+ organizationName: z11.string().optional(),
6337
+ organizationType: z11.string().optional(),
6338
+ organizationRole: z11.string().optional(),
6339
+ workspaceRole: z11.string().optional(),
6340
+ billingType: z11.string().optional(),
6341
+ seatTier: z11.string().optional(),
6342
+ organizationRateLimitTier: z11.string().optional(),
6343
+ userRateLimitTier: z11.string().optional(),
6344
+ hasExtraUsageEnabled: z11.boolean().optional(),
6345
+ subscriptionCreatedAt: z11.string().optional(),
6346
+ accountCreatedAt: z11.string().optional()
6279
6347
  });
6280
- UsageSnapshotSchema = z10.strictObject({
6348
+ UsageSnapshotSchema = z11.strictObject({
6281
6349
  schemaVersion: VersionSchema,
6282
- identity: z10.string(),
6350
+ identity: z11.string(),
6283
6351
  updatedAt: InstantSchema,
6284
6352
  /** The identity's account metadata as of `updatedAt`. */
6285
6353
  account: AccountMetadataSchema.optional(),
6286
6354
  /** Latest state per provider, keyed by provider name (`anthropic` for OAuth sessions). */
6287
- providers: z10.record(z10.string(), ProviderUsageStateSchema)
6355
+ providers: z11.record(z11.string(), ProviderUsageStateSchema)
6288
6356
  });
6289
6357
  }
6290
6358
  });
@@ -6374,7 +6442,7 @@ var init_account = __esm({
6374
6442
  });
6375
6443
 
6376
6444
  // src/usage/plan.ts
6377
- import { z as z11 } from "zod";
6445
+ import { z as z12 } from "zod";
6378
6446
  function planOf(account) {
6379
6447
  const userTier = account?.userRateLimitTier;
6380
6448
  if (userTier !== void 0 && ZERO_TIER.test(userTier)) {
@@ -6398,19 +6466,19 @@ var PlanClassSchema, TIER_MULTIPLIER, ZERO_TIER, BASE_TIER;
6398
6466
  var init_plan2 = __esm({
6399
6467
  "src/usage/plan.ts"() {
6400
6468
  "use strict";
6401
- PlanClassSchema = z11.union([
6402
- z11.strictObject({
6403
- kind: z11.literal("subscription"),
6469
+ PlanClassSchema = z12.union([
6470
+ z12.strictObject({
6471
+ kind: z12.literal("subscription"),
6404
6472
  /** The plan's size as a multiple of the smallest subscription tier (Max 5x is 5, Max 20x is 20). */
6405
- capacity: z11.number().positive(),
6473
+ capacity: z12.number().positive(),
6406
6474
  /** False when the tier string named no multiplier and no tier this project knows, so `capacity` is the neutral 1 rather than a reading. */
6407
- recognised: z11.boolean(),
6475
+ recognised: z12.boolean(),
6408
6476
  /** The tier string the classification rests on, when the account had one. */
6409
- tier: z11.string().optional()
6477
+ tier: z12.string().optional()
6410
6478
  }),
6411
- z11.strictObject({
6412
- kind: z11.literal("pay-per-use"),
6413
- tier: z11.string().optional()
6479
+ z12.strictObject({
6480
+ kind: z12.literal("pay-per-use"),
6481
+ tier: z12.string().optional()
6414
6482
  })
6415
6483
  ]);
6416
6484
  TIER_MULTIPLIER = /(?:^|_)(\d+)x$/;
@@ -6511,21 +6579,21 @@ var init_rateLimit = __esm({
6511
6579
  });
6512
6580
 
6513
6581
  // src/usage/scan.ts
6514
- import { z as z12 } from "zod";
6582
+ import { z as z13 } from "zod";
6515
6583
  var AnthropicUsageSchema, ErrorObjectSchema;
6516
6584
  var init_scan = __esm({
6517
6585
  "src/usage/scan.ts"() {
6518
6586
  "use strict";
6519
- AnthropicUsageSchema = z12.looseObject({
6520
- input_tokens: z12.number().int().nonnegative().nullish(),
6521
- output_tokens: z12.number().int().nonnegative().nullish(),
6522
- cache_creation_input_tokens: z12.number().int().nonnegative().nullish(),
6523
- cache_read_input_tokens: z12.number().int().nonnegative().nullish()
6587
+ AnthropicUsageSchema = z13.looseObject({
6588
+ input_tokens: z13.number().int().nonnegative().nullish(),
6589
+ output_tokens: z13.number().int().nonnegative().nullish(),
6590
+ cache_creation_input_tokens: z13.number().int().nonnegative().nullish(),
6591
+ cache_read_input_tokens: z13.number().int().nonnegative().nullish()
6524
6592
  });
6525
- ErrorObjectSchema = z12.looseObject({
6526
- type: z12.string().optional(),
6527
- code: z12.union([z12.string(), z12.number()]).optional(),
6528
- message: z12.string().optional()
6593
+ ErrorObjectSchema = z13.looseObject({
6594
+ type: z13.string().optional(),
6595
+ code: z13.union([z13.string(), z13.number()]).optional(),
6596
+ message: z13.string().optional()
6529
6597
  });
6530
6598
  }
6531
6599
  });
@@ -7165,7 +7233,7 @@ var init_store2 = __esm({
7165
7233
 
7166
7234
  // src/usage/poolPick.ts
7167
7235
  import path21 from "node:path";
7168
- import { z as z13 } from "zod";
7236
+ import { z as z14 } from "zod";
7169
7237
  function errorMessage(error) {
7170
7238
  return error instanceof Error ? error.message : String(error);
7171
7239
  }
@@ -7317,10 +7385,10 @@ var init_poolPick = __esm({
7317
7385
  }
7318
7386
  };
7319
7387
  SCHEMA_VERSION = 1;
7320
- PickEntrySchema = z13.strictObject({ identity: z13.string().min(1), at: z13.iso.datetime() });
7321
- PicksFileSchema = z13.strictObject({
7322
- schemaVersion: z13.literal(SCHEMA_VERSION),
7323
- picks: z13.record(z13.string().min(1), PickEntrySchema)
7388
+ PickEntrySchema = z14.strictObject({ identity: z14.string().min(1), at: z14.iso.datetime() });
7389
+ PicksFileSchema = z14.strictObject({
7390
+ schemaVersion: z14.literal(SCHEMA_VERSION),
7391
+ picks: z14.record(z14.string().min(1), PickEntrySchema)
7324
7392
  });
7325
7393
  }
7326
7394
  });
@@ -7426,6 +7494,17 @@ function removeProfile(paths, name) {
7426
7494
  requireProfileExists(paths, name);
7427
7495
  fs4.rmSync(profileJsonPath(paths, name));
7428
7496
  }
7497
+ function withStatuslineChange(existing, change) {
7498
+ const merged = new Map(Object.entries({ ...existing }));
7499
+ for (const [key, value] of Object.entries(change)) {
7500
+ if (value === false) {
7501
+ merged.delete(key);
7502
+ } else {
7503
+ merged.set(key, value);
7504
+ }
7505
+ }
7506
+ return merged.size === 0 ? void 0 : StatuslineSchema.parse(Object.fromEntries(merged));
7507
+ }
7429
7508
  function applyProfileChange(paths, name, change) {
7430
7509
  let touched = false;
7431
7510
  if (change.category !== void 0) {
@@ -7474,6 +7553,9 @@ function applyProfileChange(paths, name, change) {
7474
7553
  if (change.launchExplain !== void 0) {
7475
7554
  launchPatch.explain = change.launchExplain;
7476
7555
  }
7556
+ if (change.launchStatusline !== void 0) {
7557
+ launchPatch.statusline = withStatuslineChange(readProfile(paths, name)?.launch?.statusline, change.launchStatusline);
7558
+ }
7477
7559
  if (Object.keys(launchPatch).length > 0) {
7478
7560
  setProfileLaunchFlags(paths, name, launchPatch);
7479
7561
  touched = true;
@@ -7487,6 +7569,7 @@ var init_configProfilesStore = __esm({
7487
7569
  init_store();
7488
7570
  init_schema();
7489
7571
  init_cliError();
7572
+ init_statusline();
7490
7573
  init_load();
7491
7574
  ProfileNotFoundError = class extends CliError {
7492
7575
  constructor(profileName) {
@@ -7598,7 +7681,7 @@ var init_paths = __esm({
7598
7681
  });
7599
7682
 
7600
7683
  // src/credentialCache.ts
7601
- import { z as z14 } from "zod";
7684
+ import { z as z15 } from "zod";
7602
7685
  function effectiveStore(cache, platform) {
7603
7686
  return cache.store ?? (platform === "darwin" ? "keychain" : "file");
7604
7687
  }
@@ -7665,9 +7748,9 @@ var init_credentialCache = __esm({
7665
7748
  init_schema();
7666
7749
  init_preflight();
7667
7750
  MS_PER_UNIT = { s: 1e3, m: 6e4, h: 36e5, d: 864e5 };
7668
- CachedCredentialSchema = z14.strictObject({
7669
- token: z14.string().min(1),
7670
- fetchedAt: z14.number().int().nonnegative(),
7751
+ CachedCredentialSchema = z15.strictObject({
7752
+ token: z15.string().min(1),
7753
+ fetchedAt: z15.number().int().nonnegative(),
7671
7754
  source: CredentialSourceSchema
7672
7755
  });
7673
7756
  }
@@ -7759,7 +7842,7 @@ var init_realCredentialCache = __esm({
7759
7842
  });
7760
7843
 
7761
7844
  // src/providerAliases.ts
7762
- import { z as z15 } from "zod";
7845
+ import { z as z16 } from "zod";
7763
7846
  function parseAliases(file, raw) {
7764
7847
  const parsed = ProviderAliasesSchema.safeParse(raw);
7765
7848
  if (!parsed.success) {
@@ -7798,7 +7881,7 @@ var init_providerAliases = __esm({
7798
7881
  init_cliError();
7799
7882
  init_load();
7800
7883
  init_store();
7801
- ProviderAliasesSchema = z15.record(z15.string().min(1), z15.string().min(1));
7884
+ ProviderAliasesSchema = z16.record(z16.string().min(1), z16.string().min(1));
7802
7885
  }
7803
7886
  });
7804
7887
 
@@ -8815,7 +8898,7 @@ var init_commandDeps = __esm({
8815
8898
  // src/claudeShim.ts
8816
8899
  import fs8 from "node:fs";
8817
8900
  import path28 from "node:path";
8818
- import { z as z20 } from "zod";
8901
+ import { z as z21 } from "zod";
8819
8902
  function commandFilename(ownExecutablePath, commandName) {
8820
8903
  return ownExecutablePath.toLowerCase().endsWith(".exe") ? `${commandName}.exe` : commandName;
8821
8904
  }
@@ -8865,10 +8948,10 @@ var init_claudeShim = __esm({
8865
8948
  init_store();
8866
8949
  init_realPorts();
8867
8950
  init_cliError();
8868
- ClaudeShimStateSchema = z20.strictObject({
8869
- targetPath: z20.string().min(1),
8870
- method: z20.enum(["hardlink", "copy"]),
8871
- installedAtMs: z20.number()
8951
+ ClaudeShimStateSchema = z21.strictObject({
8952
+ targetPath: z21.string().min(1),
8953
+ method: z21.enum(["hardlink", "copy"]),
8954
+ installedAtMs: z21.number()
8872
8955
  });
8873
8956
  nodeLinkFs = { link: fs8.linkSync, copyFile: fs8.copyFileSync, chmod: fs8.chmodSync };
8874
8957
  }
@@ -8964,62 +9047,62 @@ var init_signatures = __esm({
8964
9047
  });
8965
9048
 
8966
9049
  // src/codex/anthropic.ts
8967
- import { z as z24 } from "zod";
9050
+ import { z as z25 } from "zod";
8968
9051
  var TextBlockSchema, Base64ImageSourceSchema, UrlImageSourceSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultContentBlockSchema, ToolResultBlockSchema, OtherBlockSchema, ContentBlockSchema, MessageSchema, ToolSchema, ToolChoiceSchema, SystemSchema, MessagesRequestSchema, CountTokensRequestSchema;
8969
9052
  var init_anthropic = __esm({
8970
9053
  "src/codex/anthropic.ts"() {
8971
9054
  "use strict";
8972
- TextBlockSchema = z24.looseObject({ type: z24.literal("text"), text: z24.string() });
8973
- Base64ImageSourceSchema = z24.looseObject({ type: z24.literal("base64"), media_type: z24.string().min(1), data: z24.string() });
8974
- UrlImageSourceSchema = z24.looseObject({ type: z24.literal("url"), url: z24.string().min(1) });
8975
- ImageBlockSchema = z24.looseObject({
8976
- type: z24.literal("image"),
8977
- source: z24.union([Base64ImageSourceSchema, UrlImageSourceSchema])
9055
+ TextBlockSchema = z25.looseObject({ type: z25.literal("text"), text: z25.string() });
9056
+ Base64ImageSourceSchema = z25.looseObject({ type: z25.literal("base64"), media_type: z25.string().min(1), data: z25.string() });
9057
+ UrlImageSourceSchema = z25.looseObject({ type: z25.literal("url"), url: z25.string().min(1) });
9058
+ ImageBlockSchema = z25.looseObject({
9059
+ type: z25.literal("image"),
9060
+ source: z25.union([Base64ImageSourceSchema, UrlImageSourceSchema])
8978
9061
  });
8979
- ToolUseBlockSchema = z24.looseObject({
8980
- type: z24.literal("tool_use"),
8981
- id: z24.string().min(1),
8982
- name: z24.string().min(1),
8983
- input: z24.unknown()
9062
+ ToolUseBlockSchema = z25.looseObject({
9063
+ type: z25.literal("tool_use"),
9064
+ id: z25.string().min(1),
9065
+ name: z25.string().min(1),
9066
+ input: z25.unknown()
8984
9067
  });
8985
- ToolResultContentBlockSchema = z24.union([TextBlockSchema, z24.looseObject({ type: z24.string() })]);
8986
- ToolResultBlockSchema = z24.looseObject({
8987
- type: z24.literal("tool_result"),
8988
- tool_use_id: z24.string().min(1),
8989
- content: z24.union([z24.string(), z24.array(ToolResultContentBlockSchema)]).optional()
9068
+ ToolResultContentBlockSchema = z25.union([TextBlockSchema, z25.looseObject({ type: z25.string() })]);
9069
+ ToolResultBlockSchema = z25.looseObject({
9070
+ type: z25.literal("tool_result"),
9071
+ tool_use_id: z25.string().min(1),
9072
+ content: z25.union([z25.string(), z25.array(ToolResultContentBlockSchema)]).optional()
8990
9073
  });
8991
- OtherBlockSchema = z24.looseObject({ type: z24.string() });
8992
- ContentBlockSchema = z24.union([TextBlockSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultBlockSchema, OtherBlockSchema]);
8993
- MessageSchema = z24.looseObject({
8994
- role: z24.enum(["user", "assistant", "system"]),
8995
- content: z24.union([z24.string(), z24.array(ContentBlockSchema)])
9074
+ OtherBlockSchema = z25.looseObject({ type: z25.string() });
9075
+ ContentBlockSchema = z25.union([TextBlockSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultBlockSchema, OtherBlockSchema]);
9076
+ MessageSchema = z25.looseObject({
9077
+ role: z25.enum(["user", "assistant", "system"]),
9078
+ content: z25.union([z25.string(), z25.array(ContentBlockSchema)])
8996
9079
  });
8997
- ToolSchema = z24.looseObject({
8998
- name: z24.string().min(1),
8999
- description: z24.string().optional(),
9000
- input_schema: z24.record(z24.string(), z24.unknown()).optional()
9080
+ ToolSchema = z25.looseObject({
9081
+ name: z25.string().min(1),
9082
+ description: z25.string().optional(),
9083
+ input_schema: z25.record(z25.string(), z25.unknown()).optional()
9001
9084
  });
9002
- ToolChoiceSchema = z24.union([
9003
- z24.looseObject({ type: z24.enum(["auto", "none", "any"]) }),
9004
- z24.looseObject({ type: z24.literal("tool"), name: z24.string().min(1) })
9085
+ ToolChoiceSchema = z25.union([
9086
+ z25.looseObject({ type: z25.enum(["auto", "none", "any"]) }),
9087
+ z25.looseObject({ type: z25.literal("tool"), name: z25.string().min(1) })
9005
9088
  ]);
9006
- SystemSchema = z24.union([z24.string(), z24.array(z24.union([TextBlockSchema, OtherBlockSchema]))]);
9007
- MessagesRequestSchema = z24.looseObject({
9008
- model: z24.string().optional(),
9089
+ SystemSchema = z25.union([z25.string(), z25.array(z25.union([TextBlockSchema, OtherBlockSchema]))]);
9090
+ MessagesRequestSchema = z25.looseObject({
9091
+ model: z25.string().optional(),
9009
9092
  system: SystemSchema.optional(),
9010
- messages: z24.array(MessageSchema),
9011
- tools: z24.array(ToolSchema).optional(),
9093
+ messages: z25.array(MessageSchema),
9094
+ tools: z25.array(ToolSchema).optional(),
9012
9095
  tool_choice: ToolChoiceSchema.optional(),
9013
- stream: z24.boolean().optional(),
9096
+ stream: z25.boolean().optional(),
9014
9097
  /** `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. */
9015
- metadata: z24.looseObject({ user_id: z24.string().optional() }).optional(),
9098
+ metadata: z25.looseObject({ user_id: z25.string().optional() }).optional(),
9016
9099
  /** Claude Code's effort setting. Any string is accepted; the translator honours only the levels the backend understands. */
9017
- output_config: z24.looseObject({ effort: z24.string().optional() }).optional()
9100
+ output_config: z25.looseObject({ effort: z25.string().optional() }).optional()
9018
9101
  });
9019
- CountTokensRequestSchema = z24.looseObject({
9020
- system: z24.unknown().optional(),
9021
- messages: z24.unknown().optional(),
9022
- tools: z24.unknown().optional()
9102
+ CountTokensRequestSchema = z25.looseObject({
9103
+ system: z25.unknown().optional(),
9104
+ messages: z25.unknown().optional(),
9105
+ tools: z25.unknown().optional()
9023
9106
  });
9024
9107
  }
9025
9108
  });
@@ -9104,7 +9187,7 @@ var init_translate2 = __esm({
9104
9187
  // src/providerCatalogue.ts
9105
9188
  import path30 from "node:path";
9106
9189
  import picomatch4 from "picomatch";
9107
- import { z as z25 } from "zod";
9190
+ import { z as z26 } from "zod";
9108
9191
  function catalogueCachePath(paths, name) {
9109
9192
  return path30.join(paths.catalogueDir, `${name}.json`);
9110
9193
  }
@@ -9139,8 +9222,8 @@ var init_providerCatalogue = __esm({
9139
9222
  CATALOGUE_REQUEST_SECONDS = 10;
9140
9223
  CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND5;
9141
9224
  CATALOGUE_REFRESH_TIMEOUT_MS = DEFAULT_CANDIDATE_URLS * CATALOGUE_REQUEST_TIMEOUT_MS;
9142
- CatalogueModelSchema = z25.strictObject({ id: z25.string().min(1), name: z25.string().min(1).optional() });
9143
- CatalogueCacheSchema = z25.strictObject({ fetchedAt: z25.number(), url: z25.string().min(1), models: z25.array(CatalogueModelSchema) });
9225
+ CatalogueModelSchema = z26.strictObject({ id: z26.string().min(1), name: z26.string().min(1).optional() });
9226
+ CatalogueCacheSchema = z26.strictObject({ fetchedAt: z26.number(), url: z26.string().min(1), models: z26.array(CatalogueModelSchema) });
9144
9227
  }
9145
9228
  });
9146
9229
 
@@ -9971,9 +10054,40 @@ var init_headers = __esm({
9971
10054
  }
9972
10055
  });
9973
10056
 
10057
+ // src/statusline/settings.ts
10058
+ function checkedStatusline(settings, source) {
10059
+ try {
10060
+ resolveStatusline(settings);
10061
+ } catch (error) {
10062
+ throw new UsageError(`${source}: ${error instanceof Error ? error.message : String(error)}.`);
10063
+ }
10064
+ return settings;
10065
+ }
10066
+ function statuslineSettingsFromEnv(raw, source) {
10067
+ let parsed;
10068
+ try {
10069
+ parsed = JSON.parse(raw);
10070
+ } catch {
10071
+ throw new UsageError(`${source}: not valid JSON.`);
10072
+ }
10073
+ const result = StatuslineSchema.safeParse(parsed);
10074
+ if (!result.success) {
10075
+ throw new UsageError(`${source}: ${result.error.issues.map((issue) => `${issue.path.join(".") || "(root)"}: ${issue.message}`).join("; ")}.`);
10076
+ }
10077
+ return checkedStatusline(result.data, source);
10078
+ }
10079
+ var init_settings2 = __esm({
10080
+ "src/statusline/settings.ts"() {
10081
+ "use strict";
10082
+ init_cliError();
10083
+ init_statusline();
10084
+ }
10085
+ });
10086
+
9974
10087
  // src/launcher/flags.ts
9975
10088
  import path37 from "node:path";
9976
10089
  function resolveLaunchFlags(params) {
10090
+ const statusline = resolveStatuslineSettings(params);
9977
10091
  return {
9978
10092
  skipPermissions: params.flags?.skipPermissions ?? parseEnvBool("AGENT_SHIM_SKIP_PERMISSIONS", params.env.AGENT_SHIM_SKIP_PERMISSIONS) ?? params.cascade?.skipPermissions ?? false,
9979
10093
  remoteControl: params.flags?.remoteControl ?? parseEnvBool("AGENT_SHIM_REMOTE_CONTROL", params.env.AGENT_SHIM_REMOTE_CONTROL) ?? params.cascade?.remoteControl ?? false,
@@ -9982,9 +10096,17 @@ function resolveLaunchFlags(params) {
9982
10096
  pause: params.flags?.pause ?? parseEnvBool("AGENT_SHIM_PAUSE", params.env.AGENT_SHIM_PAUSE) ?? params.cascade?.pause ?? false,
9983
10097
  explain: params.flags?.explain ?? parseEnvBool("AGENT_SHIM_EXPLAIN", params.env.AGENT_SHIM_EXPLAIN) ?? params.cascade?.explain ?? false,
9984
10098
  delayMs: resolveDelayMs(params),
9985
- proxyBypass: resolveProxyBypass(params)
10099
+ proxyBypass: resolveProxyBypass(params),
10100
+ ...statusline === void 0 ? {} : { statusline }
9986
10101
  };
9987
10102
  }
10103
+ function resolveStatuslineSettings(params) {
10104
+ const fromEnv = params.env[STATUSLINE_ENV] === "" ? void 0 : params.env[STATUSLINE_ENV];
10105
+ if (fromEnv !== void 0) {
10106
+ return statuslineSettingsFromEnv(fromEnv, STATUSLINE_ENV);
10107
+ }
10108
+ return params.cascade?.statusline === void 0 ? void 0 : checkedStatusline(params.cascade.statusline, "launch.statusline");
10109
+ }
9988
10110
  function resolveProxyBypass(params) {
9989
10111
  const fromEnv = params.env.AGENT_SHIM_PROXY_BYPASS === "" ? void 0 : params.env.AGENT_SHIM_PROXY_BYPASS;
9990
10112
  return fromEnv !== void 0 ? checkedProxyBypass(fromEnv.split(",").map((entry) => entry.trim()), "AGENT_SHIM_PROXY_BYPASS") : checkedProxyBypass(params.cascade?.proxyBypass ?? [], "launch.proxyBypass");
@@ -10068,6 +10190,9 @@ function buildEnv(params) {
10068
10190
  env.NO_PROXY = withBypassHosts(env.NO_PROXY, bypassed);
10069
10191
  env.no_proxy = withBypassHosts(env.no_proxy, bypassed);
10070
10192
  }
10193
+ if (params.statusline !== void 0) {
10194
+ env[STATUSLINE_ENV] = JSON.stringify(params.statusline);
10195
+ }
10071
10196
  return env;
10072
10197
  }
10073
10198
  var LOOPBACK_HOSTS, PROVIDER_SESSION_PLACEHOLDER;
@@ -10082,6 +10207,8 @@ var init_flags = __esm({
10082
10207
  init_headers();
10083
10208
  init_capability();
10084
10209
  init_route();
10210
+ init_statusline();
10211
+ init_settings2();
10085
10212
  init_proxyBypass2();
10086
10213
  LOOPBACK_HOSTS = ["127.0.0.1", "localhost", "::1"];
10087
10214
  PROVIDER_SESSION_PLACEHOLDER = "agent-shim-provider-session";
@@ -11003,7 +11130,8 @@ function prepareLaunch(params) {
11003
11130
  sessionId,
11004
11131
  remoteControl: resolvedFlags.remoteControl,
11005
11132
  ...decided.models?.tiers === void 0 ? {} : { tierModels: decided.models.tiers },
11006
- proxyBypass: resolvedFlags.proxyBypass
11133
+ proxyBypass: resolvedFlags.proxyBypass,
11134
+ ...resolvedFlags.statusline === void 0 ? {} : { statusline: resolvedFlags.statusline }
11007
11135
  });
11008
11136
  const releases = [...headroom === void 0 || headroomPort === void 0 ? [] : [headroomPort.release], ...frontDoorRelease === void 0 ? [] : [frontDoorRelease]];
11009
11137
  const release = () => {
@@ -11031,7 +11159,8 @@ function resolveLaunch(params) {
11031
11159
  ...decided.flags.headroom ? { headroom: { socketPath: "", projectId: "" } } : {},
11032
11160
  sessionId: "",
11033
11161
  remoteControl: decided.flags.remoteControl,
11034
- proxyBypass: decided.flags.proxyBypass
11162
+ proxyBypass: decided.flags.proxyBypass,
11163
+ ...decided.flags.statusline === void 0 ? {} : { statusline: decided.flags.statusline }
11035
11164
  });
11036
11165
  const credentialNames = decided.identityCredentialBlock === void 0 ? [] : Object.keys(credentialVariables(decided.identityCredentialBlock.target ?? "bearer", ""));
11037
11166
  const environment = [.../* @__PURE__ */ new Set([...Object.keys(built).filter((name) => built[name] !== env[name]), ...credentialNames])].sort();
@@ -11589,7 +11718,7 @@ var init_identityClaude = __esm({
11589
11718
  });
11590
11719
 
11591
11720
  // src/usage/providerQuota.ts
11592
- import { z as z32 } from "zod";
11721
+ import { z as z33 } from "zod";
11593
11722
  var MS_PER_SECOND9, SECONDS_PER_HOUR3, HOURS_PER_DAY6, DAYS_PER_MONTH, ZAI_HOST, ZAI_QUOTA_URL, ZAI_UNIT_HOURS, ZAI_UNIT_MONTHS, ZAI_UNIT_MS, ZaiLimitSchema, ZaiResponseSchema, OPENROUTER_HOST, OPENROUTER_KEY_URL, OPENROUTER_CREDITS_URL, MS_PER_DAY3, OpenRouterKeySchema, OpenRouterCreditsSchema, ANTIGRAVITY_HOST, ANTIGRAVITY_QUOTA_URL, ANTIGRAVITY_USER_URL, FIVE_HOURS2, DAYS_PER_WEEK2, FIVE_HOURS_MS, WEEK_MS, AntigravityBucketSchema, AntigravitySummarySchema, GoogleTokenInfoSchema, AntigravityUserSchema;
11594
11723
  var init_providerQuota = __esm({
11595
11724
  "src/usage/providerQuota.ts"() {
@@ -11608,35 +11737,35 @@ var init_providerQuota = __esm({
11608
11737
  [ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND9],
11609
11738
  [ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9]
11610
11739
  ]);
11611
- ZaiLimitSchema = z32.object({
11612
- type: z32.string(),
11613
- unit: z32.number().int(),
11614
- number: z32.number().int().positive(),
11615
- percentage: z32.number().nonnegative(),
11616
- nextResetTime: z32.number().positive().optional(),
11617
- usage: z32.number().nonnegative().optional(),
11618
- currentValue: z32.number().nonnegative().optional(),
11619
- remaining: z32.number().nonnegative().optional()
11740
+ ZaiLimitSchema = z33.object({
11741
+ type: z33.string(),
11742
+ unit: z33.number().int(),
11743
+ number: z33.number().int().positive(),
11744
+ percentage: z33.number().nonnegative(),
11745
+ nextResetTime: z33.number().positive().optional(),
11746
+ usage: z33.number().nonnegative().optional(),
11747
+ currentValue: z33.number().nonnegative().optional(),
11748
+ remaining: z33.number().nonnegative().optional()
11620
11749
  });
11621
- ZaiResponseSchema = z32.object({
11622
- success: z32.boolean(),
11623
- msg: z32.string().optional(),
11624
- data: z32.object({ level: z32.string().optional(), limits: z32.array(ZaiLimitSchema) })
11750
+ ZaiResponseSchema = z33.object({
11751
+ success: z33.boolean(),
11752
+ msg: z33.string().optional(),
11753
+ data: z33.object({ level: z33.string().optional(), limits: z33.array(ZaiLimitSchema) })
11625
11754
  });
11626
11755
  OPENROUTER_HOST = "openrouter.ai";
11627
11756
  OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
11628
11757
  OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
11629
11758
  MS_PER_DAY3 = HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
11630
- OpenRouterKeySchema = z32.object({
11631
- data: z32.object({
11632
- limit: z32.number().nonnegative().nullable(),
11633
- limit_remaining: z32.number().nullable(),
11634
- limit_reset: z32.string().nullable(),
11635
- is_free_tier: z32.boolean().optional(),
11636
- free_model_daily_requests: z32.object({ used: z32.number().nonnegative(), limit: z32.number().nonnegative(), remaining: z32.number() }).optional()
11759
+ OpenRouterKeySchema = z33.object({
11760
+ data: z33.object({
11761
+ limit: z33.number().nonnegative().nullable(),
11762
+ limit_remaining: z33.number().nullable(),
11763
+ limit_reset: z33.string().nullable(),
11764
+ is_free_tier: z33.boolean().optional(),
11765
+ free_model_daily_requests: z33.object({ used: z33.number().nonnegative(), limit: z33.number().nonnegative(), remaining: z33.number() }).optional()
11637
11766
  })
11638
11767
  });
11639
- OpenRouterCreditsSchema = z32.object({ data: z32.object({ total_credits: z32.number().nonnegative(), total_usage: z32.number().nonnegative() }) });
11768
+ OpenRouterCreditsSchema = z33.object({ data: z33.object({ total_credits: z33.number().nonnegative(), total_usage: z33.number().nonnegative() }) });
11640
11769
  ANTIGRAVITY_HOST = "daily-cloudcode-pa.googleapis.com";
11641
11770
  ANTIGRAVITY_QUOTA_URL = `https://${ANTIGRAVITY_HOST}/v1internal:retrieveUserQuotaSummary`;
11642
11771
  ANTIGRAVITY_USER_URL = `https://${ANTIGRAVITY_HOST}/v1internal:loadCodeAssist`;
@@ -11644,21 +11773,21 @@ var init_providerQuota = __esm({
11644
11773
  DAYS_PER_WEEK2 = 7;
11645
11774
  FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
11646
11775
  WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
11647
- AntigravityBucketSchema = z32.object({
11648
- bucketId: z32.string(),
11649
- remainingFraction: z32.number().optional(),
11650
- resetTime: z32.string().optional()
11776
+ AntigravityBucketSchema = z33.object({
11777
+ bucketId: z33.string(),
11778
+ remainingFraction: z33.number().optional(),
11779
+ resetTime: z33.string().optional()
11651
11780
  });
11652
- AntigravitySummarySchema = z32.object({ groups: z32.array(z32.object({ buckets: z32.array(AntigravityBucketSchema) })) });
11653
- GoogleTokenInfoSchema = z32.object({
11654
- email: z32.string().optional(),
11655
- sub: z32.string().optional()
11781
+ AntigravitySummarySchema = z33.object({ groups: z33.array(z33.object({ buckets: z33.array(AntigravityBucketSchema) })) });
11782
+ GoogleTokenInfoSchema = z33.object({
11783
+ email: z33.string().optional(),
11784
+ sub: z33.string().optional()
11656
11785
  });
11657
- AntigravityUserSchema = z32.object({
11786
+ AntigravityUserSchema = z33.object({
11658
11787
  /** The code-assist tier context, which defaults to the free tier for every account. */
11659
- currentTier: z32.object({ name: z32.string().optional(), id: z32.string().optional() }).optional(),
11788
+ currentTier: z33.object({ name: z33.string().optional(), id: z33.string().optional() }).optional(),
11660
11789
  /** The account's paid subscription; absent when the account has none. */
11661
- paidTier: z32.object({ name: z32.string().optional(), id: z32.string().optional() }).optional()
11790
+ paidTier: z33.object({ name: z33.string().optional(), id: z33.string().optional() }).optional()
11662
11791
  });
11663
11792
  }
11664
11793
  });
@@ -11774,130 +11903,130 @@ var HTTP_STATUS = {
11774
11903
  init_connect();
11775
11904
 
11776
11905
  // src/agents/liveTasks.ts
11777
- import { z as z5 } from "zod";
11906
+ import { z as z6 } from "zod";
11778
11907
 
11779
11908
  // src/agents/schema.ts
11780
- import { z as z4 } from "zod";
11781
- var AgentMetaSchema = z4.looseObject({
11782
- agentType: z4.string(),
11783
- isFork: z4.boolean().optional(),
11784
- description: z4.string().optional(),
11785
- name: z4.string().optional(),
11786
- toolUseId: z4.string().optional(),
11787
- spawnDepth: z4.number().int().nonnegative().optional(),
11788
- parentAgentId: z4.string().optional(),
11789
- model: z4.string().optional(),
11790
- requestShape: z4.string().optional(),
11791
- requestNonInteractive: z4.boolean().optional(),
11792
- workflowPhase: z4.string().optional(),
11793
- taskKind: z4.string().optional(),
11794
- teamName: z4.string().optional(),
11795
- worktreePath: z4.string().optional(),
11796
- worktreeBranch: z4.string().optional(),
11797
- stoppedByUser: z4.boolean().optional()
11909
+ import { z as z5 } from "zod";
11910
+ var AgentMetaSchema = z5.looseObject({
11911
+ agentType: z5.string(),
11912
+ isFork: z5.boolean().optional(),
11913
+ description: z5.string().optional(),
11914
+ name: z5.string().optional(),
11915
+ toolUseId: z5.string().optional(),
11916
+ spawnDepth: z5.number().int().nonnegative().optional(),
11917
+ parentAgentId: z5.string().optional(),
11918
+ model: z5.string().optional(),
11919
+ requestShape: z5.string().optional(),
11920
+ requestNonInteractive: z5.boolean().optional(),
11921
+ workflowPhase: z5.string().optional(),
11922
+ taskKind: z5.string().optional(),
11923
+ teamName: z5.string().optional(),
11924
+ worktreePath: z5.string().optional(),
11925
+ worktreeBranch: z5.string().optional(),
11926
+ stoppedByUser: z5.boolean().optional()
11798
11927
  });
11799
- var AgentKindSchema = z4.enum(["subagent", "fork", "workflow-agent", "teammate"]);
11928
+ var AgentKindSchema = z5.enum(["subagent", "fork", "workflow-agent", "teammate"]);
11800
11929
  var AgentNodeFields = {
11801
- id: z4.string(),
11930
+ id: z5.string(),
11802
11931
  kind: AgentKindSchema,
11803
- agentType: z4.string(),
11804
- description: z4.string().optional(),
11805
- name: z4.string().optional(),
11806
- toolUseId: z4.string().optional(),
11807
- spawnDepth: z4.number().int().nonnegative().optional(),
11808
- model: z4.string().optional(),
11809
- background: z4.boolean().optional(),
11810
- workflowRunId: z4.string().optional(),
11811
- workflowPhase: z4.string().optional(),
11812
- teamName: z4.string().optional(),
11813
- stoppedByUser: z4.boolean().optional(),
11814
- transcript: z4.string()
11932
+ agentType: z5.string(),
11933
+ description: z5.string().optional(),
11934
+ name: z5.string().optional(),
11935
+ toolUseId: z5.string().optional(),
11936
+ spawnDepth: z5.number().int().nonnegative().optional(),
11937
+ model: z5.string().optional(),
11938
+ background: z5.boolean().optional(),
11939
+ workflowRunId: z5.string().optional(),
11940
+ workflowPhase: z5.string().optional(),
11941
+ teamName: z5.string().optional(),
11942
+ stoppedByUser: z5.boolean().optional(),
11943
+ transcript: z5.string()
11815
11944
  };
11816
- var AgentNodeSchema = z4.lazy(() => z4.strictObject({ ...AgentNodeFields, children: z4.array(AgentNodeSchema) }));
11817
- var TaskItemSchema = z4.strictObject({
11818
- id: z4.string(),
11819
- subject: z4.string(),
11820
- description: z4.string().optional(),
11821
- status: z4.string(),
11945
+ var AgentNodeSchema = z5.lazy(() => z5.strictObject({ ...AgentNodeFields, children: z5.array(AgentNodeSchema) }));
11946
+ var TaskItemSchema = z5.strictObject({
11947
+ id: z5.string(),
11948
+ subject: z5.string(),
11949
+ description: z5.string().optional(),
11950
+ status: z5.string(),
11822
11951
  /** What a spinner shows while the task runs. */
11823
- activeForm: z4.string().optional(),
11952
+ activeForm: z5.string().optional(),
11824
11953
  /** The teammate or agent name the task is assigned to, as Agent Teams writes it. */
11825
- owner: z4.string().optional(),
11954
+ owner: z5.string().optional(),
11826
11955
  /** Free-form data the harness attaches to a task, kept as written. */
11827
- metadata: z4.record(z4.string(), z4.unknown()).optional(),
11828
- blocks: z4.array(z4.string()),
11829
- blockedBy: z4.array(z4.string()),
11956
+ metadata: z5.record(z5.string(), z5.unknown()).optional(),
11957
+ blocks: z5.array(z5.string()),
11958
+ blockedBy: z5.array(z5.string()),
11830
11959
  /** 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. */
11831
- taskList: z4.string().optional()
11960
+ taskList: z5.string().optional()
11832
11961
  });
11833
- var WorkflowRunSchema = z4.strictObject({
11834
- runId: z4.string(),
11835
- workflowName: z4.string().optional(),
11836
- status: z4.string().optional(),
11837
- startTime: z4.number().optional(),
11838
- phases: z4.array(z4.string()),
11839
- summary: z4.string().optional()
11962
+ var WorkflowRunSchema = z5.strictObject({
11963
+ runId: z5.string(),
11964
+ workflowName: z5.string().optional(),
11965
+ status: z5.string().optional(),
11966
+ startTime: z5.number().optional(),
11967
+ phases: z5.array(z5.string()),
11968
+ summary: z5.string().optional()
11840
11969
  });
11841
- var AgentTreeProblemSchema = z4.strictObject({
11970
+ var AgentTreeProblemSchema = z5.strictObject({
11842
11971
  /** Relative to the identity's configuration directory. */
11843
- path: z4.string(),
11844
- reason: z4.string()
11972
+ path: z5.string(),
11973
+ reason: z5.string()
11845
11974
  });
11846
- var SessionSummarySchema = z4.strictObject({
11847
- project: z4.string(),
11848
- sessionId: z4.string(),
11849
- superseded: z4.boolean(),
11975
+ var SessionSummarySchema = z5.strictObject({
11976
+ project: z5.string(),
11977
+ sessionId: z5.string(),
11978
+ superseded: z5.boolean(),
11850
11979
  /** The directory and transcript stem exactly as on disk, which differs from `sessionId` for a superseded session. */
11851
- entry: z4.string(),
11852
- agentCount: z4.number().int().nonnegative(),
11853
- workflowRunCount: z4.number().int().nonnegative(),
11980
+ entry: z5.string(),
11981
+ agentCount: z5.number().int().nonnegative(),
11982
+ workflowRunCount: z5.number().int().nonnegative(),
11854
11983
  /** When the transcript was last written, as an ISO instant; absent when there is no transcript file. */
11855
- updatedAt: z4.iso.datetime().optional(),
11856
- identities: z4.array(z4.string())
11984
+ updatedAt: z5.iso.datetime().optional(),
11985
+ identities: z5.array(z5.string())
11857
11986
  });
11858
- var SessionAgentTreeSchema = z4.strictObject({
11859
- project: z4.string(),
11860
- sessionId: z4.string(),
11987
+ var SessionAgentTreeSchema = z5.strictObject({
11988
+ project: z5.string(),
11989
+ sessionId: z5.string(),
11861
11990
  /** True for a session directory a resume superseded (`<session-id>.superseded-<epoch-ms>`). */
11862
- superseded: z4.boolean(),
11991
+ superseded: z5.boolean(),
11863
11992
  /** The agents the session itself spawned, each with its descendants. */
11864
- agents: z4.array(AgentNodeSchema),
11865
- tasks: z4.array(TaskItemSchema),
11866
- workflowRuns: z4.array(WorkflowRunSchema),
11867
- problems: z4.array(AgentTreeProblemSchema)
11993
+ agents: z5.array(AgentNodeSchema),
11994
+ tasks: z5.array(TaskItemSchema),
11995
+ workflowRuns: z5.array(WorkflowRunSchema),
11996
+ problems: z5.array(AgentTreeProblemSchema)
11868
11997
  });
11869
11998
 
11870
11999
  // src/agents/liveTasks.ts
11871
12000
  var LIVE_TASK_CAP = 512;
11872
12001
  var RUNNING_STATUS = "running";
11873
- var LiveTaskUsageSchema = z5.strictObject({
11874
- totalTokens: z5.number().optional(),
11875
- toolUses: z5.number().optional(),
11876
- durationMs: z5.number().optional()
12002
+ var LiveTaskUsageSchema = z6.strictObject({
12003
+ totalTokens: z6.number().optional(),
12004
+ toolUses: z6.number().optional(),
12005
+ durationMs: z6.number().optional()
11877
12006
  });
11878
- var LiveTaskSchema = z5.strictObject({
12007
+ var LiveTaskSchema = z6.strictObject({
11879
12008
  /** The `task_id`: for an unnamed subagent the stem of its `agent-<id>` files on disk. */
11880
- taskId: z5.string(),
12009
+ taskId: z6.string(),
11881
12010
  /** The `cse_` session whose stream carried the task. */
11882
- sessionId: z5.string(),
11883
- runId: z5.string().optional(),
12011
+ sessionId: z6.string(),
12012
+ runId: z6.string().optional(),
11884
12013
  /** The `tool_use` block in the spawning transcript, which is the meta file's `toolUseId`. */
11885
- toolUseId: z5.string().optional(),
12014
+ toolUseId: z6.string().optional(),
11886
12015
  /** `local_agent` for a subagent, `local_bash` for a backgrounded command; open because other kinds may exist. */
11887
- taskType: z5.string().optional(),
11888
- description: z5.string().optional(),
11889
- subagentType: z5.string().optional(),
11890
- spawnDepth: z5.number().int().nonnegative().optional(),
11891
- parentTaskId: z5.string().optional(),
11892
- backgrounded: z5.boolean().optional(),
11893
- status: z5.string(),
12016
+ taskType: z6.string().optional(),
12017
+ description: z6.string().optional(),
12018
+ subagentType: z6.string().optional(),
12019
+ spawnDepth: z6.number().int().nonnegative().optional(),
12020
+ parentTaskId: z6.string().optional(),
12021
+ backgrounded: z6.boolean().optional(),
12022
+ status: z6.string(),
11894
12023
  /** `<tmpdir>/<project-slug>/<local session id>/tasks/<task_id>.output`, which embeds the local session id. */
11895
- outputFile: z5.string().optional(),
11896
- summary: z5.string().optional(),
11897
- lastToolName: z5.string().optional(),
12024
+ outputFile: z6.string().optional(),
12025
+ summary: z6.string().optional(),
12026
+ lastToolName: z6.string().optional(),
11898
12027
  usage: LiveTaskUsageSchema.optional(),
11899
12028
  /** When the door last observed an event for this task, in epoch milliseconds from its injected clock. */
11900
- observedAt: z5.number()
12029
+ observedAt: z6.number()
11901
12030
  });
11902
12031
  var SYSTEM_SUBTYPES = ["task_started", "task_progress", "task_updated", "task_notification", "background_tasks_changed"];
11903
12032
  function isRecord3(value) {
@@ -11996,22 +12125,22 @@ function applyAgentTaskEvent(book, sessionId, payload, observedAt2) {
11996
12125
  }
11997
12126
  return bounded(next);
11998
12127
  }
11999
- var MergedProvenanceSchema = z5.enum(["disk", "both"]);
12000
- var MergedAgentNodeSchema = z5.lazy(
12001
- () => z5.strictObject({
12128
+ var MergedProvenanceSchema = z6.enum(["disk", "both"]);
12129
+ var MergedAgentNodeSchema = z6.lazy(
12130
+ () => z6.strictObject({
12002
12131
  ...AgentNodeFields,
12003
12132
  provenance: MergedProvenanceSchema,
12004
12133
  live: LiveTaskSchema.optional(),
12005
- children: z5.array(MergedAgentNodeSchema)
12134
+ children: z6.array(MergedAgentNodeSchema)
12006
12135
  })
12007
12136
  );
12008
- var MergedAgentTreeSchema = z5.strictObject({
12137
+ var MergedAgentTreeSchema = z6.strictObject({
12009
12138
  ...SessionAgentTreeSchema.shape,
12010
- agents: z5.array(MergedAgentNodeSchema),
12139
+ agents: z6.array(MergedAgentNodeSchema),
12011
12140
  /** The `cse_` sessions whose live tasks matched this session. Empty when the session is not live or the door has not observed it. */
12012
- remoteSessions: z5.array(z5.string()),
12141
+ remoteSessions: z6.array(z6.string()),
12013
12142
  /** Live tasks of those sessions that match no disk agent (a backgrounded command, or an agent whose files have not appeared yet). */
12014
- liveOnly: z5.array(LiveTaskSchema)
12143
+ liveOnly: z6.array(LiveTaskSchema)
12015
12144
  });
12016
12145
  function mergeLiveTasks(tree, live) {
12017
12146
  const byTaskId = new Map(live.map((task) => [task.taskId, task]));
@@ -13882,162 +14011,162 @@ import { Agent as Agent3, fetch as undiciFetch } from "undici";
13882
14011
  init_capability();
13883
14012
 
13884
14013
  // src/frontdoor/rcSchemas.ts
13885
- import { z as z6 } from "zod";
13886
- var RcPermissionModeSchema = z6.enum(RC_PERMISSION_MODES);
13887
- var RcSessionSummarySchema = z6.strictObject({
13888
- id: z6.string(),
13889
- createdAt: z6.number(),
13890
- lastSeenAt: z6.number()
14014
+ import { z as z7 } from "zod";
14015
+ var RcPermissionModeSchema = z7.enum(RC_PERMISSION_MODES);
14016
+ var RcSessionSummarySchema = z7.strictObject({
14017
+ id: z7.string(),
14018
+ createdAt: z7.number(),
14019
+ lastSeenAt: z7.number()
13891
14020
  });
13892
14021
  function workerFactSchema(value) {
13893
- return z6.strictObject({ value, observedAt: z6.number() });
13894
- }
13895
- var RcPendingRequestSummarySchema = z6.strictObject({
13896
- sessionId: z6.string(),
13897
- requestId: z6.string(),
13898
- type: z6.string(),
13899
- summary: z6.string(),
13900
- observedAt: z6.number()
14022
+ return z7.strictObject({ value, observedAt: z7.number() });
14023
+ }
14024
+ var RcPendingRequestSummarySchema = z7.strictObject({
14025
+ sessionId: z7.string(),
14026
+ requestId: z7.string(),
14027
+ type: z7.string(),
14028
+ summary: z7.string(),
14029
+ observedAt: z7.number()
13901
14030
  });
13902
- var RcSessionStatusSchema = z6.strictObject({
14031
+ var RcSessionStatusSchema = z7.strictObject({
13903
14032
  ...RcSessionSummarySchema.shape,
13904
- workerState: workerFactSchema(z6.string()).optional(),
13905
- workerIdleSeconds: workerFactSchema(z6.number()).optional(),
13906
- pending: z6.readonly(z6.array(RcPendingRequestSummarySchema))
14033
+ workerState: workerFactSchema(z7.string()).optional(),
14034
+ workerIdleSeconds: workerFactSchema(z7.number()).optional(),
14035
+ pending: z7.readonly(z7.array(RcPendingRequestSummarySchema))
13907
14036
  });
13908
- var RcStreamEnvelopeSchema = z6.looseObject({
14037
+ var RcStreamEnvelopeSchema = z7.looseObject({
13909
14038
  /** The envelope's own event id, when the host sent one. */
13910
- event_id: z6.string().optional(),
14039
+ event_id: z7.string().optional(),
13911
14040
  /** The envelope's event type, the discriminator a consumer switches on (`control_request`, `user`, and kin). */
13912
- event_type: z6.string(),
14041
+ event_type: z7.string(),
13913
14042
  /** The sequence number the host assigned, the value a resume continues after. */
13914
- sequence_num: z6.int(),
14043
+ sequence_num: z7.int(),
13915
14044
  /** Who emitted the event (`worker` for the CLI's half, a client id for a client's). */
13916
- source: z6.string(),
14045
+ source: z7.string(),
13917
14046
  /** 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. */
13918
- payload: z6.unknown().optional(),
14047
+ payload: z7.unknown().optional(),
13919
14048
  /** 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. */
13920
- created_at: z6.unknown().optional()
14049
+ created_at: z7.unknown().optional()
13921
14050
  });
13922
- var RcStreamEventSchema = z6.strictObject({
13923
- session: z6.string(),
14051
+ var RcStreamEventSchema = z7.strictObject({
14052
+ session: z7.string(),
13924
14053
  envelope: RcStreamEnvelopeSchema
13925
14054
  });
13926
- var RcRateLimitWindowSchema = z6.looseObject({
14055
+ var RcRateLimitWindowSchema = z7.looseObject({
13927
14056
  /** 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). */
13928
- utilization: z6.number().optional(),
14057
+ utilization: z7.number().optional(),
13929
14058
  /** 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. */
13930
- resetsAt: z6.number().optional()
14059
+ resetsAt: z7.number().optional()
13931
14060
  });
13932
- var RcRateLimitInfoSchema = z6.looseObject({
14061
+ var RcRateLimitInfoSchema = z7.looseObject({
13933
14062
  /** The limiting window's own status (`allowed`, `allowed_warning`, `rejected`), asserted only as a string because the vocabulary grows with the CLI. */
13934
- status: z6.string(),
14063
+ status: z7.string(),
13935
14064
  /** When the limiting window resets, in unix epoch seconds. */
13936
- resetsAt: z6.number().optional(),
14065
+ resetsAt: z7.number().optional(),
13937
14066
  /** Which window the top-level fields describe (`five_hour`, `seven_day`, and kin), the payload's own name for it. */
13938
- rateLimitType: z6.string().optional(),
14067
+ rateLimitType: z7.string().optional(),
13939
14068
  /** The fraction of the limiting window used, on the same scale the per-window utilizations carry. */
13940
- utilization: z6.number().optional(),
14069
+ utilization: z7.number().optional(),
13941
14070
  /** Whether usage beyond the plan (extra usage) is currently covering the overflow, the payload's own flag for it. */
13942
- isUsingOverage: z6.boolean().optional(),
14071
+ isUsingOverage: z7.boolean().optional(),
13943
14072
  /** The overage's own status, the same vocabulary the limiting window's `status` carries. */
13944
- overageStatus: z6.string().optional(),
14073
+ overageStatus: z7.string().optional(),
13945
14074
  /** When the overage window resets, in unix epoch seconds. */
13946
- overageResetsAt: z6.number().optional(),
14075
+ overageResetsAt: z7.number().optional(),
13947
14076
  /** 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. */
13948
- unifiedWindows: z6.looseObject({ five_hour: RcRateLimitWindowSchema.optional(), seven_day: RcRateLimitWindowSchema.optional(), seven_day_overage_included: RcRateLimitWindowSchema.optional() }).optional()
14077
+ unifiedWindows: z7.looseObject({ five_hour: RcRateLimitWindowSchema.optional(), seven_day: RcRateLimitWindowSchema.optional(), seven_day_overage_included: RcRateLimitWindowSchema.optional() }).optional()
13949
14078
  });
13950
- var RcLiveRateLimitSchema = z6.strictObject({
13951
- session: z6.string(),
13952
- observedAt: z6.number(),
14079
+ var RcLiveRateLimitSchema = z7.strictObject({
14080
+ session: z7.string(),
14081
+ observedAt: z7.number(),
13953
14082
  rateLimit: RcRateLimitInfoSchema
13954
14083
  });
13955
- var RcSessionQuerySchema = z6.strictObject({
13956
- session: z6.string().min(1).optional()
14084
+ var RcSessionQuerySchema = z7.strictObject({
14085
+ session: z7.string().min(1).optional()
13957
14086
  });
13958
- var RcSendInputSchema = z6.strictObject({
13959
- session: z6.string().min(1),
13960
- text: z6.string().min(1)
14087
+ var RcSendInputSchema = z7.strictObject({
14088
+ session: z7.string().min(1),
14089
+ text: z7.string().min(1)
13961
14090
  });
13962
- var RcAnswerInputSchema = z6.strictObject({
13963
- session: z6.string().min(1),
13964
- request: z6.string().min(1),
13965
- approve: z6.boolean(),
13966
- text: z6.string().optional()
14091
+ var RcAnswerInputSchema = z7.strictObject({
14092
+ session: z7.string().min(1),
14093
+ request: z7.string().min(1),
14094
+ approve: z7.boolean(),
14095
+ text: z7.string().optional()
13967
14096
  }).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" });
13968
- var RcInterruptInputSchema = z6.strictObject({
13969
- session: z6.string().min(1)
14097
+ var RcInterruptInputSchema = z7.strictObject({
14098
+ session: z7.string().min(1)
13970
14099
  });
13971
- var RcSetModelInputSchema = z6.strictObject({
13972
- session: z6.string().min(1),
13973
- model: z6.string().min(1)
14100
+ var RcSetModelInputSchema = z7.strictObject({
14101
+ session: z7.string().min(1),
14102
+ model: z7.string().min(1)
13974
14103
  });
13975
- var RcSetPermissionModeInputSchema = z6.strictObject({
13976
- session: z6.string().min(1),
14104
+ var RcSetPermissionModeInputSchema = z7.strictObject({
14105
+ session: z7.string().min(1),
13977
14106
  mode: RcPermissionModeSchema
13978
14107
  });
13979
- var RcEndSessionInputSchema = z6.strictObject({
13980
- session: z6.string().min(1),
13981
- reason: z6.string().min(1).optional()
14108
+ var RcEndSessionInputSchema = z7.strictObject({
14109
+ session: z7.string().min(1),
14110
+ reason: z7.string().min(1).optional()
13982
14111
  });
13983
- var RcGetUsageInputSchema = z6.strictObject({
13984
- session: z6.string().min(1),
13985
- skipBehaviors: z6.boolean().optional()
14112
+ var RcGetUsageInputSchema = z7.strictObject({
14113
+ session: z7.string().min(1),
14114
+ skipBehaviors: z7.boolean().optional()
13986
14115
  });
13987
- var RcGetContextUsageInputSchema = z6.strictObject({
13988
- session: z6.string().min(1),
13989
- detail: z6.enum(RC_CONTEXT_USAGE_DETAILS).optional()
14116
+ var RcGetContextUsageInputSchema = z7.strictObject({
14117
+ session: z7.string().min(1),
14118
+ detail: z7.enum(RC_CONTEXT_USAGE_DETAILS).optional()
13990
14119
  });
13991
- var RcReadFileInputSchema = z6.strictObject({
13992
- session: z6.string().min(1),
13993
- path: z6.string().min(1),
13994
- maxBytes: z6.number().int().positive().optional(),
13995
- encoding: z6.enum(RC_READ_FILE_ENCODINGS).optional()
14120
+ var RcReadFileInputSchema = z7.strictObject({
14121
+ session: z7.string().min(1),
14122
+ path: z7.string().min(1),
14123
+ maxBytes: z7.number().int().positive().optional(),
14124
+ encoding: z7.enum(RC_READ_FILE_ENCODINGS).optional()
13996
14125
  });
13997
- var RcFileSuggestionsInputSchema = z6.strictObject({
13998
- session: z6.string().min(1),
13999
- query: z6.string()
14126
+ var RcFileSuggestionsInputSchema = z7.strictObject({
14127
+ session: z7.string().min(1),
14128
+ query: z7.string()
14000
14129
  });
14001
- var RcKeepAliveInputSchema = z6.strictObject({
14002
- session: z6.string().min(1)
14130
+ var RcKeepAliveInputSchema = z7.strictObject({
14131
+ session: z7.string().min(1)
14003
14132
  });
14004
- var RcMcpStatusInputSchema = z6.strictObject({
14005
- session: z6.string().min(1)
14133
+ var RcMcpStatusInputSchema = z7.strictObject({
14134
+ session: z7.string().min(1)
14006
14135
  });
14007
- var RcMcpReconnectInputSchema = z6.strictObject({
14008
- session: z6.string().min(1),
14009
- serverName: z6.string().min(1)
14136
+ var RcMcpReconnectInputSchema = z7.strictObject({
14137
+ session: z7.string().min(1),
14138
+ serverName: z7.string().min(1)
14010
14139
  });
14011
- var RcMcpAuthenticateInputSchema = z6.strictObject({
14012
- session: z6.string().min(1),
14013
- serverName: z6.string().min(1),
14014
- redirectUri: z6.string().min(1)
14140
+ var RcMcpAuthenticateInputSchema = z7.strictObject({
14141
+ session: z7.string().min(1),
14142
+ serverName: z7.string().min(1),
14143
+ redirectUri: z7.string().min(1)
14015
14144
  });
14016
- var RcMcpOAuthCallbackUrlInputSchema = z6.strictObject({
14017
- session: z6.string().min(1),
14018
- serverName: z6.string().min(1),
14019
- callbackUrl: z6.string().min(1)
14145
+ var RcMcpOAuthCallbackUrlInputSchema = z7.strictObject({
14146
+ session: z7.string().min(1),
14147
+ serverName: z7.string().min(1),
14148
+ callbackUrl: z7.string().min(1)
14020
14149
  });
14021
- var RcTeleportInputSchema = z6.strictObject({
14022
- session: z6.string().min(1),
14023
- marker: z6.string().min(1)
14150
+ var RcTeleportInputSchema = z7.strictObject({
14151
+ session: z7.string().min(1),
14152
+ marker: z7.string().min(1)
14024
14153
  });
14025
- var RcListOutputSchema = z6.strictObject({ sessions: z6.readonly(z6.array(RcSessionSummarySchema)) });
14026
- var RcStatusOutputSchema = z6.strictObject({ statuses: z6.readonly(z6.array(RcSessionStatusSchema)) });
14027
- var RcPendingOutputSchema = z6.strictObject({ pending: z6.readonly(z6.array(RcPendingRequestSummarySchema)) });
14028
- var RcWriteOutputSchema = z6.strictObject({
14029
- session: z6.string(),
14030
- sequenceNums: z6.readonly(z6.array(z6.number()))
14154
+ var RcListOutputSchema = z7.strictObject({ sessions: z7.readonly(z7.array(RcSessionSummarySchema)) });
14155
+ var RcStatusOutputSchema = z7.strictObject({ statuses: z7.readonly(z7.array(RcSessionStatusSchema)) });
14156
+ var RcPendingOutputSchema = z7.strictObject({ pending: z7.readonly(z7.array(RcPendingRequestSummarySchema)) });
14157
+ var RcWriteOutputSchema = z7.strictObject({
14158
+ session: z7.string(),
14159
+ sequenceNums: z7.readonly(z7.array(z7.number()))
14031
14160
  });
14032
- var RcControlWriteOutputSchema = z6.strictObject({
14033
- session: z6.string(),
14034
- request: z6.string(),
14035
- sequenceNums: z6.readonly(z6.array(z6.number()))
14161
+ var RcControlWriteOutputSchema = z7.strictObject({
14162
+ session: z7.string(),
14163
+ request: z7.string(),
14164
+ sequenceNums: z7.readonly(z7.array(z7.number()))
14036
14165
  });
14037
- var RcAnswerOutputSchema = z6.strictObject({
14038
- session: z6.string(),
14039
- request: z6.string(),
14040
- sequenceNums: z6.readonly(z6.array(z6.number()))
14166
+ var RcAnswerOutputSchema = z7.strictObject({
14167
+ session: z7.string(),
14168
+ request: z7.string(),
14169
+ sequenceNums: z7.readonly(z7.array(z7.number()))
14041
14170
  });
14042
14171
 
14043
14172
  // src/frontdoor/rcApi.ts
@@ -14224,48 +14353,48 @@ init_cliError();
14224
14353
  init_package();
14225
14354
 
14226
14355
  // src/codex/appServerSchemas.ts
14227
- import { z as z7 } from "zod";
14356
+ import { z as z8 } from "zod";
14228
14357
  var CODEX_APP_SERVER_GENERATED_AGAINST = "0.160.0";
14229
- var RateLimitWindowSchema = z7.object({
14230
- usedPercent: z7.number(),
14231
- resetsAt: z7.number().nullish(),
14232
- windowDurationMins: z7.number().nullish()
14358
+ var RateLimitWindowSchema = z8.object({
14359
+ usedPercent: z8.number(),
14360
+ resetsAt: z8.number().nullish(),
14361
+ windowDurationMins: z8.number().nullish()
14233
14362
  });
14234
- var RateLimitSnapshotSchema = z7.object({
14235
- limitId: z7.string().nullish(),
14236
- limitName: z7.string().nullish(),
14237
- planType: z7.string().nullish(),
14363
+ var RateLimitSnapshotSchema = z8.object({
14364
+ limitId: z8.string().nullish(),
14365
+ limitName: z8.string().nullish(),
14366
+ planType: z8.string().nullish(),
14238
14367
  primary: RateLimitWindowSchema.nullish(),
14239
14368
  secondary: RateLimitWindowSchema.nullish(),
14240
- rateLimitReachedType: z7.string().nullish(),
14241
- spendControlReached: z7.boolean().nullish()
14369
+ rateLimitReachedType: z8.string().nullish(),
14370
+ spendControlReached: z8.boolean().nullish()
14242
14371
  });
14243
- var RateLimitResetCreditSchema = z7.object({
14244
- id: z7.string(),
14245
- grantedAt: z7.number(),
14246
- expiresAt: z7.number().nullish(),
14247
- resetType: z7.string(),
14248
- status: z7.string(),
14249
- title: z7.string().nullish(),
14250
- description: z7.string().nullish()
14372
+ var RateLimitResetCreditSchema = z8.object({
14373
+ id: z8.string(),
14374
+ grantedAt: z8.number(),
14375
+ expiresAt: z8.number().nullish(),
14376
+ resetType: z8.string(),
14377
+ status: z8.string(),
14378
+ title: z8.string().nullish(),
14379
+ description: z8.string().nullish()
14251
14380
  });
14252
- var CodexAccountSchema = z7.discriminatedUnion("type", [
14253
- z7.object({ type: z7.literal("apiKey") }),
14254
- z7.object({ type: z7.literal("chatgpt"), email: z7.string().nullable(), planType: z7.string() }),
14255
- z7.object({ type: z7.literal("amazonBedrock"), usesCodexManagedCredentials: z7.boolean().default(false) })
14381
+ var CodexAccountSchema = z8.discriminatedUnion("type", [
14382
+ z8.object({ type: z8.literal("apiKey") }),
14383
+ z8.object({ type: z8.literal("chatgpt"), email: z8.string().nullable(), planType: z8.string() }),
14384
+ z8.object({ type: z8.literal("amazonBedrock"), usesCodexManagedCredentials: z8.boolean().default(false) })
14256
14385
  ]);
14257
- var CodexAccountReadSchema = z7.object({
14386
+ var CodexAccountReadSchema = z8.object({
14258
14387
  account: CodexAccountSchema.nullable(),
14259
- requiresOpenaiAuth: z7.boolean()
14388
+ requiresOpenaiAuth: z8.boolean()
14260
14389
  });
14261
- var CodexRateLimitsReadSchema = z7.object({
14390
+ var CodexRateLimitsReadSchema = z8.object({
14262
14391
  rateLimits: RateLimitSnapshotSchema,
14263
- rateLimitsByLimitId: z7.record(z7.string(), RateLimitSnapshotSchema).nullish(),
14264
- rateLimitResetCredits: z7.object({ availableCount: z7.number(), credits: z7.array(RateLimitResetCreditSchema).nullish() }).nullish(),
14265
- accountId: z7.string().nullish(),
14266
- ordinaryUsageAllowed: z7.boolean().nullish()
14392
+ rateLimitsByLimitId: z8.record(z8.string(), RateLimitSnapshotSchema).nullish(),
14393
+ rateLimitResetCredits: z8.object({ availableCount: z8.number(), credits: z8.array(RateLimitResetCreditSchema).nullish() }).nullish(),
14394
+ accountId: z8.string().nullish(),
14395
+ ordinaryUsageAllowed: z8.boolean().nullish()
14267
14396
  });
14268
- var CodexInitializeResultSchema = z7.object({ userAgent: z7.string() });
14397
+ var CodexInitializeResultSchema = z8.object({ userAgent: z8.string() });
14269
14398
 
14270
14399
  // src/codex/appServer.ts
14271
14400
  var CodexAppServerUnavailableError = class extends CliError {
@@ -14705,7 +14834,7 @@ init_providersStore();
14705
14834
  init_projects();
14706
14835
  init_pipeline();
14707
14836
  import path27 from "node:path";
14708
- import { z as z16 } from "zod";
14837
+ import { z as z17 } from "zod";
14709
14838
  var HISTORY_PROJECTS_KEY_PREFIX = "history/projects/";
14710
14839
  function projectFragmentOf(rawKey) {
14711
14840
  return rawKey.startsWith(HISTORY_PROJECTS_KEY_PREFIX) ? rawKey.slice(HISTORY_PROJECTS_KEY_PREFIX.length) : void 0;
@@ -14774,9 +14903,9 @@ function lookupKeychainService(run, farmRoot) {
14774
14903
  }
14775
14904
  return { checked: true, found: true, serviceName, note: `Keychain service name for this identity: "${serviceName}".` };
14776
14905
  }
14777
- var SettingsSecretsShapeSchema = z16.looseObject({
14778
- env: z16.record(z16.string(), z16.unknown()).optional(),
14779
- hooks: z16.record(z16.string(), z16.array(z16.unknown())).optional()
14906
+ var SettingsSecretsShapeSchema = z17.looseObject({
14907
+ env: z17.record(z17.string(), z17.unknown()).optional(),
14908
+ hooks: z17.record(z17.string(), z17.array(z17.unknown())).optional()
14780
14909
  });
14781
14910
  function hookCommandCountOf(group) {
14782
14911
  if (typeof group !== "object" || group === null) {
@@ -15073,7 +15202,7 @@ init_schema();
15073
15202
  init_claudeVersion();
15074
15203
  init_identity();
15075
15204
  init_projects();
15076
- import { z as z18 } from "zod";
15205
+ import { z as z19 } from "zod";
15077
15206
 
15078
15207
  // src/resolve/types.ts
15079
15208
  var LAYER_KINDS = [
@@ -15134,123 +15263,123 @@ var DIAGNOSTIC_SEVERITIES = ["error", "warning", "info"];
15134
15263
 
15135
15264
  // src/usage/pickReportSchema.ts
15136
15265
  init_plan2();
15137
- import { z as z17 } from "zod";
15138
- var PoolPickCandidateViewSchema = z17.strictObject({
15139
- identity: z17.string(),
15266
+ import { z as z18 } from "zod";
15267
+ var PoolPickCandidateViewSchema = z18.strictObject({
15268
+ identity: z18.string(),
15140
15269
  /** In pick order: `scored` has usable quota data, `unknown` has none, `pay-per-use` bills by use, `ineligible` is refused right now. */
15141
- class: z17.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
15270
+ class: z18.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
15142
15271
  /** Plan-size-weighted remaining quota per hour until its reset; present for `scored` only. */
15143
- score: z17.number().optional(),
15272
+ score: z18.number().optional(),
15144
15273
  /** 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`. */
15145
- scoreWindow: z17.enum(["sevenDay", "fiveHour"]).optional(),
15274
+ scoreWindow: z18.enum(["sevenDay", "fiveHour"]).optional(),
15146
15275
  /** False when the five-hour window would run dry, at the observed pace, before it resets. */
15147
- feasible: z17.boolean(),
15276
+ feasible: z18.boolean(),
15148
15277
  /** When an `ineligible` member can be used again, as an ISO instant. */
15149
- blockedUntil: z17.iso.datetime().optional(),
15278
+ blockedUntil: z18.iso.datetime().optional(),
15150
15279
  plan: PlanClassSchema,
15151
15280
  /** The facts behind the class and score, in the order they matter. */
15152
- reasons: z17.array(z17.string())
15281
+ reasons: z18.array(z18.string())
15153
15282
  });
15154
- var PoolPickReportSchema = z17.strictObject({
15155
- pool: z17.string(),
15156
- directory: z17.string(),
15283
+ var PoolPickReportSchema = z18.strictObject({
15284
+ pool: z18.string(),
15285
+ directory: z18.string(),
15157
15286
  /** The member a launch would run as, absent when every member is refused. */
15158
- pick: z17.string().optional(),
15159
- candidates: z17.array(PoolPickCandidateViewSchema),
15287
+ pick: z18.string().optional(),
15288
+ candidates: z18.array(PoolPickCandidateViewSchema),
15160
15289
  /** Identity members anywhere in the pool's graph that do not exist; a launch skips them. */
15161
- missing: z17.array(z17.string()),
15290
+ missing: z18.array(z18.string()),
15162
15291
  /** When nothing can be picked, the soonest any member returns. */
15163
- earliestReturn: z17.strictObject({ identity: z17.string(), at: z17.iso.datetime() }).optional(),
15292
+ earliestReturn: z18.strictObject({ identity: z18.string(), at: z18.iso.datetime() }).optional(),
15164
15293
  /** The member a resumed conversation started on but moved off, and why, when the ranking could not keep it. */
15165
- movedOff: z17.strictObject({ identity: z17.string(), reason: z17.string() }).optional(),
15294
+ movedOff: z18.strictObject({ identity: z18.string(), reason: z18.string() }).optional(),
15166
15295
  /** Why the last-pick record could not be read, when that is the case. */
15167
- stickyProblem: z17.string().optional()
15296
+ stickyProblem: z18.string().optional()
15168
15297
  });
15169
15298
 
15170
15299
  // src/checkReportSchema.ts
15171
15300
  var CHECK_CREDENTIAL_APPLIES = ["provider", "identity", "stored-login"];
15172
- var CheckLayerViewSchema = z18.strictObject({
15173
- id: z18.int(),
15174
- kind: z18.enum(LAYER_KINDS),
15175
- source: z18.string()
15301
+ var CheckLayerViewSchema = z19.strictObject({
15302
+ id: z19.int(),
15303
+ kind: z19.enum(LAYER_KINDS),
15304
+ source: z19.string()
15176
15305
  });
15177
- var CheckEntryViewSchema = z18.strictObject({
15178
- path: z18.string(),
15179
- shared: z18.boolean(),
15180
- via: z18.enum(DECISION_VIAS),
15306
+ var CheckEntryViewSchema = z19.strictObject({
15307
+ path: z19.string(),
15308
+ shared: z19.boolean(),
15309
+ via: z19.enum(DECISION_VIAS),
15181
15310
  /** The entry's real category, or null when nothing classifies it. */
15182
- category: z18.enum(CATEGORY_NAMES).nullable(),
15183
- rule: z18.strictObject({ key: z18.string(), layer: z18.int() }).optional(),
15311
+ category: z19.enum(CATEGORY_NAMES).nullable(),
15312
+ rule: z19.strictObject({ key: z19.string(), layer: z19.int() }).optional(),
15184
15313
  /** Rules that matched but whose `when` condition failed, each with the conditions that failed. */
15185
- eliminated: z18.readonly(z18.array(z18.strictObject({ key: z18.string(), failed: z18.readonly(z18.array(z18.string())) }))).optional()
15314
+ eliminated: z19.readonly(z19.array(z19.strictObject({ key: z19.string(), failed: z19.readonly(z19.array(z19.string())) }))).optional()
15186
15315
  });
15187
- var CheckDiagnosticSchema = z18.strictObject({
15188
- code: z18.enum(DIAGNOSTIC_CODES),
15189
- severity: z18.enum(DIAGNOSTIC_SEVERITIES),
15190
- message: z18.string(),
15191
- subject: z18.string().optional(),
15192
- layer: z18.int().optional()
15316
+ var CheckDiagnosticSchema = z19.strictObject({
15317
+ code: z19.enum(DIAGNOSTIC_CODES),
15318
+ severity: z19.enum(DIAGNOSTIC_SEVERITIES),
15319
+ message: z19.string(),
15320
+ subject: z19.string().optional(),
15321
+ layer: z19.int().optional()
15193
15322
  });
15194
- var CheckAmbientCredentialSchema = z18.union([z18.strictObject({ ok: z18.literal(true) }), z18.strictObject({ ok: z18.literal(false), variable: z18.string(), message: z18.string() })]);
15195
- var CheckKeychainSchema = z18.strictObject({
15196
- checked: z18.literal(true),
15197
- found: z18.boolean(),
15198
- serviceName: z18.string().optional(),
15199
- note: z18.string()
15323
+ var CheckAmbientCredentialSchema = z19.union([z19.strictObject({ ok: z19.literal(true) }), z19.strictObject({ ok: z19.literal(false), variable: z19.string(), message: z19.string() })]);
15324
+ var CheckKeychainSchema = z19.strictObject({
15325
+ checked: z19.literal(true),
15326
+ found: z19.boolean(),
15327
+ serviceName: z19.string().optional(),
15328
+ note: z19.string()
15200
15329
  });
15201
- var CheckSettingsExposureSchema = z18.strictObject({
15202
- file: z18.string(),
15203
- envKeyNames: z18.readonly(z18.array(z18.string())),
15204
- hookEventNames: z18.readonly(z18.array(z18.string())),
15205
- hookCommandCount: z18.int().nonnegative()
15330
+ var CheckSettingsExposureSchema = z19.strictObject({
15331
+ file: z19.string(),
15332
+ envKeyNames: z19.readonly(z19.array(z19.string())),
15333
+ hookEventNames: z19.readonly(z19.array(z19.string())),
15334
+ hookCommandCount: z19.int().nonnegative()
15206
15335
  });
15207
- var CredentialSourceSummarySchema = z18.union([
15208
- z18.strictObject({ kind: z18.literal("env"), variable: z18.string() }),
15209
- z18.strictObject({ kind: z18.literal("file"), path: z18.string() }),
15210
- z18.strictObject({ kind: z18.literal("command"), program: z18.string() }),
15211
- z18.strictObject({ kind: z18.literal("op"), reference: z18.string() }),
15212
- z18.strictObject({ kind: z18.literal("keychain"), service: z18.string(), account: z18.string().optional() }),
15213
- z18.strictObject({ kind: z18.literal("literal") })
15336
+ var CredentialSourceSummarySchema = z19.union([
15337
+ z19.strictObject({ kind: z19.literal("env"), variable: z19.string() }),
15338
+ z19.strictObject({ kind: z19.literal("file"), path: z19.string() }),
15339
+ z19.strictObject({ kind: z19.literal("command"), program: z19.string() }),
15340
+ z19.strictObject({ kind: z19.literal("op"), reference: z19.string() }),
15341
+ z19.strictObject({ kind: z19.literal("keychain"), service: z19.string(), account: z19.string().optional() }),
15342
+ z19.strictObject({ kind: z19.literal("literal") })
15214
15343
  ]);
15215
- var CredentialSummarySchema = z18.strictObject({
15216
- target: z18.enum(CREDENTIAL_TARGETS),
15217
- sources: z18.readonly(z18.array(CredentialSourceSummarySchema)),
15344
+ var CredentialSummarySchema = z19.strictObject({
15345
+ target: z19.enum(CREDENTIAL_TARGETS),
15346
+ sources: z19.readonly(z19.array(CredentialSourceSummarySchema)),
15218
15347
  cache: CredentialCacheSchema.optional()
15219
15348
  });
15220
- var CachedCredentialStateSchema = z18.union([
15221
- z18.strictObject({ store: z18.enum(CREDENTIAL_CACHE_STORES), status: z18.literal("empty") }),
15222
- z18.strictObject({ store: z18.enum(CREDENTIAL_CACHE_STORES), status: z18.literal("unreadable"), reason: z18.string() }),
15223
- z18.strictObject({ store: z18.enum(CREDENTIAL_CACHE_STORES), status: z18.enum(["fresh", "expired"]), ageMs: z18.number(), expiresInMs: z18.number().optional() })
15349
+ var CachedCredentialStateSchema = z19.union([
15350
+ z19.strictObject({ store: z19.enum(CREDENTIAL_CACHE_STORES), status: z19.literal("empty") }),
15351
+ z19.strictObject({ store: z19.enum(CREDENTIAL_CACHE_STORES), status: z19.literal("unreadable"), reason: z19.string() }),
15352
+ z19.strictObject({ store: z19.enum(CREDENTIAL_CACHE_STORES), status: z19.enum(["fresh", "expired"]), ageMs: z19.number(), expiresInMs: z19.number().optional() })
15224
15353
  ]);
15225
- var CheckCredentialProviderSchema = z18.union([
15226
- z18.strictObject({ name: z18.string(), credential: CredentialSummarySchema.optional(), cached: CachedCredentialStateSchema.optional() }),
15227
- z18.strictObject({ name: z18.string(), problem: z18.string() })
15354
+ var CheckCredentialProviderSchema = z19.union([
15355
+ z19.strictObject({ name: z19.string(), credential: CredentialSummarySchema.optional(), cached: CachedCredentialStateSchema.optional() }),
15356
+ z19.strictObject({ name: z19.string(), problem: z19.string() })
15228
15357
  ]);
15229
- var CheckCredentialSchema = z18.strictObject({
15230
- applies: z18.enum(CHECK_CREDENTIAL_APPLIES),
15358
+ var CheckCredentialSchema = z19.strictObject({
15359
+ applies: z19.enum(CHECK_CREDENTIAL_APPLIES),
15231
15360
  provider: CheckCredentialProviderSchema.optional(),
15232
15361
  identity: CredentialSummarySchema.optional(),
15233
15362
  identityCached: CachedCredentialStateSchema.optional()
15234
15363
  });
15235
- var CheckClaudeVersionSchema = z18.strictObject({
15236
- pinned: z18.strictObject({ version: z18.string(), source: z18.enum(CLAUDE_VERSION_SOURCES), installed: z18.boolean() }).optional(),
15237
- highestInstalled: z18.string().optional(),
15238
- installed: z18.readonly(z18.array(z18.string()))
15364
+ var CheckClaudeVersionSchema = z19.strictObject({
15365
+ pinned: z19.strictObject({ version: z19.string(), source: z19.enum(CLAUDE_VERSION_SOURCES), installed: z19.boolean() }).optional(),
15366
+ highestInstalled: z19.string().optional(),
15367
+ installed: z19.readonly(z19.array(z19.string()))
15239
15368
  });
15240
- var CheckReportJsonSchema = z18.strictObject({
15241
- identity: z18.strictObject({ name: z18.string().nullable(), source: z18.enum(IDENTITY_DECISION_SOURCES) }),
15369
+ var CheckReportJsonSchema = z19.strictObject({
15370
+ identity: z19.strictObject({ name: z19.string().nullable(), source: z19.enum(IDENTITY_DECISION_SOURCES) }),
15242
15371
  /** The pool ranking, when the launch named a pool instead of an identity. */
15243
15372
  pool: PoolPickReportSchema.optional(),
15244
- configProfile: z18.strictObject({ name: z18.string().nullable(), source: z18.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
15245
- layers: z18.readonly(z18.array(CheckLayerViewSchema)),
15246
- entries: z18.readonly(z18.array(CheckEntryViewSchema)),
15247
- projectEncodingAmbiguities: z18.readonly(
15248
- z18.array(z18.strictObject({ fragment: z18.string(), encoded: z18.string(), reason: z18.enum(ENCODING_AMBIGUITY_REASONS), detail: z18.string() }))
15373
+ configProfile: z19.strictObject({ name: z19.string().nullable(), source: z19.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
15374
+ layers: z19.readonly(z19.array(CheckLayerViewSchema)),
15375
+ entries: z19.readonly(z19.array(CheckEntryViewSchema)),
15376
+ projectEncodingAmbiguities: z19.readonly(
15377
+ z19.array(z19.strictObject({ fragment: z19.string(), encoded: z19.string(), reason: z19.enum(ENCODING_AMBIGUITY_REASONS), detail: z19.string() }))
15249
15378
  ),
15250
- diagnostics: z18.readonly(z18.array(CheckDiagnosticSchema)),
15379
+ diagnostics: z19.readonly(z19.array(CheckDiagnosticSchema)),
15251
15380
  ambientCredential: CheckAmbientCredentialSchema,
15252
15381
  keychain: CheckKeychainSchema.optional(),
15253
- settingsExposure: z18.readonly(z18.array(CheckSettingsExposureSchema)),
15382
+ settingsExposure: z19.readonly(z19.array(CheckSettingsExposureSchema)),
15254
15383
  credential: CheckCredentialSchema,
15255
15384
  claudeVersion: CheckClaudeVersionSchema.optional()
15256
15385
  });
@@ -15310,28 +15439,28 @@ function collectResets(snapshots, nowMs) {
15310
15439
  }
15311
15440
 
15312
15441
  // src/usage/resetsSchema.ts
15313
- import { z as z19 } from "zod";
15314
- var ResetRowSchema = z19.strictObject({
15315
- identity: z19.string(),
15316
- provider: z19.string(),
15442
+ import { z as z20 } from "zod";
15443
+ var ResetRowSchema = z20.strictObject({
15444
+ identity: z20.string(),
15445
+ provider: z20.string(),
15317
15446
  /** What the window is: `5h`, `7d` or `extra usage` for an Anthropic account, or the provider's own measure and period (`tokens 5h`). */
15318
- window: z19.string(),
15447
+ window: z20.string(),
15319
15448
  /** When the state the window comes from was observed, as an ISO instant. */
15320
- observedAt: z19.iso.datetime(),
15449
+ observedAt: z20.iso.datetime(),
15321
15450
  /** When the window resets, as an ISO instant; absent when the upstream reported none. */
15322
- resetsAt: z19.iso.datetime().optional(),
15451
+ resetsAt: z20.iso.datetime().optional(),
15323
15452
  /** True when the reset time has passed, so the recorded observation describes a window that no longer exists and its utilisation reads as 0. */
15324
- reset: z19.boolean(),
15453
+ reset: z20.boolean(),
15325
15454
  /** The fraction used, as `effectiveWindow` reads it at the report's own clock. */
15326
- utilization: z19.number().optional(),
15455
+ utilization: z20.number().optional(),
15327
15456
  /** The window's own status, for a window that has not reset yet. */
15328
- status: z19.string().optional()
15457
+ status: z20.string().optional()
15329
15458
  });
15330
- var ResetScheduleSchema = z19.strictObject({ resets: z19.readonly(z19.array(ResetRowSchema)) });
15459
+ var ResetScheduleSchema = z20.strictObject({ resets: z20.readonly(z20.array(ResetRowSchema)) });
15331
15460
 
15332
15461
  // src/frontdoor/controlSchemas.ts
15333
15462
  import path32 from "node:path";
15334
- import { z as z26 } from "zod";
15463
+ import { z as z27 } from "zod";
15335
15464
 
15336
15465
  // src/doctorReport.ts
15337
15466
  init_claudeShim();
@@ -15511,24 +15640,24 @@ import path31 from "node:path";
15511
15640
  init_signIn();
15512
15641
 
15513
15642
  // src/codex/siwcStore.ts
15514
- import { z as z23 } from "zod";
15643
+ import { z as z24 } from "zod";
15515
15644
 
15516
15645
  // src/codex/auth.ts
15517
- import { z as z21 } from "zod";
15518
- var AuthFileSchema = z21.looseObject({
15519
- tokens: z21.looseObject({
15520
- access_token: z21.string().optional(),
15521
- refresh_token: z21.string().optional(),
15522
- id_token: z21.string().optional(),
15523
- account_id: z21.string().optional()
15646
+ import { z as z22 } from "zod";
15647
+ var AuthFileSchema = z22.looseObject({
15648
+ tokens: z22.looseObject({
15649
+ access_token: z22.string().optional(),
15650
+ refresh_token: z22.string().optional(),
15651
+ id_token: z22.string().optional(),
15652
+ account_id: z22.string().optional()
15524
15653
  }).nullish(),
15525
- last_refresh: z21.string().optional()
15654
+ last_refresh: z22.string().optional()
15526
15655
  });
15527
- var TokenGrantSchema = z21.looseObject({
15528
- access_token: z21.string().min(1).optional(),
15529
- refresh_token: z21.string().min(1).optional(),
15530
- id_token: z21.string().min(1).optional(),
15531
- account_id: z21.string().min(1).optional()
15656
+ var TokenGrantSchema = z22.looseObject({
15657
+ access_token: z22.string().min(1).optional(),
15658
+ refresh_token: z22.string().min(1).optional(),
15659
+ id_token: z22.string().min(1).optional(),
15660
+ account_id: z22.string().min(1).optional()
15532
15661
  });
15533
15662
  var CodexAuthError = class extends Error {
15534
15663
  constructor(message) {
@@ -15538,41 +15667,41 @@ var CodexAuthError = class extends Error {
15538
15667
  };
15539
15668
 
15540
15669
  // src/codex/siwc.ts
15541
- import { z as z22 } from "zod";
15670
+ import { z as z23 } from "zod";
15542
15671
  var SIWC_RESOURCE = "https://api.openai.com/v1";
15543
15672
  var SIWC_RESPONSES_URL = `${SIWC_RESOURCE}/responses`;
15544
15673
  var SIWC_PLAN_SCOPE = "chatgpt.tokens.use.direct";
15545
- var TokenResponseSchema = z22.looseObject({
15546
- access_token: z22.string().min(1),
15547
- refresh_token: z22.string().min(1).optional(),
15548
- id_token: z22.string().min(1).optional(),
15549
- expires_in: z22.number().positive(),
15550
- scope: z22.string().optional()
15674
+ var TokenResponseSchema = z23.looseObject({
15675
+ access_token: z23.string().min(1),
15676
+ refresh_token: z23.string().min(1).optional(),
15677
+ id_token: z23.string().min(1).optional(),
15678
+ expires_in: z23.number().positive(),
15679
+ scope: z23.string().optional()
15551
15680
  });
15552
- var JwtHeaderSchema = z22.looseObject({ alg: z22.string(), kid: z22.string().optional() });
15553
- var IdTokenClaimsSchema = z22.looseObject({
15554
- iss: z22.string(),
15555
- sub: z22.string().min(1),
15556
- aud: z22.union([z22.string(), z22.array(z22.string())]),
15557
- exp: z22.number(),
15558
- nonce: z22.string().optional(),
15559
- email: z22.string().optional()
15681
+ var JwtHeaderSchema = z23.looseObject({ alg: z23.string(), kid: z23.string().optional() });
15682
+ var IdTokenClaimsSchema = z23.looseObject({
15683
+ iss: z23.string(),
15684
+ sub: z23.string().min(1),
15685
+ aud: z23.union([z23.string(), z23.array(z23.string())]),
15686
+ exp: z23.number(),
15687
+ nonce: z23.string().optional(),
15688
+ email: z23.string().optional()
15560
15689
  });
15561
- var JwksSchema = z22.object({ keys: z22.array(z22.looseObject({ kid: z22.string().optional(), kty: z22.string() })) });
15690
+ var JwksSchema = z23.object({ keys: z23.array(z23.looseObject({ kid: z23.string().optional(), kty: z23.string() })) });
15562
15691
 
15563
15692
  // src/codex/siwcStore.ts
15564
- var SiwcGrantSchema = z23.strictObject({
15565
- clientId: z23.string().min(1),
15566
- sub: z23.string().min(1),
15567
- email: z23.string().optional(),
15568
- idToken: z23.string().min(1),
15569
- accessToken: z23.string().min(1),
15570
- refreshToken: z23.string().min(1),
15571
- scopes: z23.array(z23.string()).readonly(),
15693
+ var SiwcGrantSchema = z24.strictObject({
15694
+ clientId: z24.string().min(1),
15695
+ sub: z24.string().min(1),
15696
+ email: z24.string().optional(),
15697
+ idToken: z24.string().min(1),
15698
+ accessToken: z24.string().min(1),
15699
+ refreshToken: z24.string().min(1),
15700
+ scopes: z24.array(z24.string()).readonly(),
15572
15701
  /** When the access token stops working, in milliseconds since the epoch. */
15573
- expiresAt: z23.number()
15702
+ expiresAt: z24.number()
15574
15703
  });
15575
- var SiwcFileSchema = z23.strictObject({ registeredClientId: z23.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
15704
+ var SiwcFileSchema = z24.strictObject({ registeredClientId: z24.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
15576
15705
  function parseSiwcFile(raw, filePath) {
15577
15706
  let json;
15578
15707
  try {
@@ -16536,92 +16665,92 @@ function collectDoctorReport(params) {
16536
16665
  // src/frontdoor/controlSchemas.ts
16537
16666
  init_schema2();
16538
16667
  init_state();
16539
- var UsageListOutputSchema = z26.strictObject({ snapshots: z26.readonly(z26.array(UsageSnapshotSchema)) });
16540
- var UsageWindowsInputSchema = z26.strictObject({
16541
- identity: z26.string().min(1),
16542
- provider: z26.string().min(1).optional()
16668
+ var UsageListOutputSchema = z27.strictObject({ snapshots: z27.readonly(z27.array(UsageSnapshotSchema)) });
16669
+ var UsageWindowsInputSchema = z27.strictObject({
16670
+ identity: z27.string().min(1),
16671
+ provider: z27.string().min(1).optional()
16543
16672
  });
16544
- var EffectiveWindowSchema = z26.strictObject({
16673
+ var EffectiveWindowSchema = z27.strictObject({
16545
16674
  /** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
16546
- reset: z26.boolean(),
16675
+ reset: z27.boolean(),
16547
16676
  /** The fraction used: 0 for a reset window, otherwise what was last observed, absent when none was reported. */
16548
- utilization: z26.number().optional(),
16677
+ utilization: z27.number().optional(),
16549
16678
  /** The reset instant, for a window that has not reset yet and reported one. */
16550
- resetsAtMs: z26.number().optional(),
16679
+ resetsAtMs: z27.number().optional(),
16551
16680
  /** The window's own status, for a window that has not reset yet. */
16552
- status: z26.string().optional()
16681
+ status: z27.string().optional()
16553
16682
  });
16554
- var UsageWindowsOutputSchema = z26.strictObject({
16555
- identity: z26.string(),
16556
- provider: z26.string(),
16683
+ var UsageWindowsOutputSchema = z27.strictObject({
16684
+ identity: z27.string(),
16685
+ provider: z27.string(),
16557
16686
  /** When the rate-limit state the windows come from was observed. */
16558
- observedAt: z26.iso.datetime().optional(),
16687
+ observedAt: z27.iso.datetime().optional(),
16559
16688
  fiveHour: EffectiveWindowSchema.optional(),
16560
16689
  sevenDay: EffectiveWindowSchema.optional()
16561
16690
  });
16562
- var UsageLiveOutputSchema = z26.strictObject({
16691
+ var UsageLiveOutputSchema = z27.strictObject({
16563
16692
  /** 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. */
16564
16693
  latest: RcLiveRateLimitSchema.optional(),
16565
16694
  /** One observation per session whose stream has filed a rate_limit_event this door generation. */
16566
- sessions: z26.readonly(z26.array(RcLiveRateLimitSchema))
16695
+ sessions: z27.readonly(z27.array(RcLiveRateLimitSchema))
16567
16696
  });
16568
- var FrontDoorSessionStatusSchema = z26.strictObject({
16569
- pid: z26.int().positive(),
16570
- startedAt: z26.number(),
16571
- alive: z26.boolean()
16697
+ var FrontDoorSessionStatusSchema = z27.strictObject({
16698
+ pid: z27.int().positive(),
16699
+ startedAt: z27.number(),
16700
+ alive: z27.boolean()
16572
16701
  });
16573
- var HeadroomSocketTargetSchema = z26.union([z26.strictObject({ socketPath: z26.string() }), z26.strictObject({ refused: z26.string() })]);
16574
- var FrontDoorStatusOutputSchema = z26.strictObject({
16702
+ var HeadroomSocketTargetSchema = z27.union([z27.strictObject({ socketPath: z27.string() }), z27.strictObject({ refused: z27.string() })]);
16703
+ var FrontDoorStatusOutputSchema = z27.strictObject({
16575
16704
  state: FrontDoorStateSchema,
16576
- supervisorAlive: z26.boolean(),
16705
+ supervisorAlive: z27.boolean(),
16577
16706
  /** The pids of earlier doors that released their addresses and are finishing the connections they carried: running, but not serving anything new. */
16578
- draining: z26.readonly(z26.array(z26.number().int().positive())),
16579
- sessions: z26.readonly(z26.array(FrontDoorSessionStatusSchema)),
16707
+ draining: z27.readonly(z27.array(z27.number().int().positive())),
16708
+ sessions: z27.readonly(z27.array(FrontDoorSessionStatusSchema)),
16580
16709
  headroomSocket: HeadroomSocketTargetSchema.optional(),
16581
- logPath: z26.string(),
16582
- logExists: z26.boolean()
16710
+ logPath: z27.string(),
16711
+ logExists: z27.boolean()
16583
16712
  });
16584
- var FrontDoorSessionsOutputSchema = z26.strictObject({ sessions: z26.readonly(z26.array(FrontDoorSessionStatusSchema)) });
16585
- var CheckRunInputSchema = z26.strictObject({
16586
- path: z26.string().min(1),
16587
- identity: z26.string().min(1).optional()
16713
+ var FrontDoorSessionsOutputSchema = z27.strictObject({ sessions: z27.readonly(z27.array(FrontDoorSessionStatusSchema)) });
16714
+ var CheckRunInputSchema = z27.strictObject({
16715
+ path: z27.string().min(1),
16716
+ identity: z27.string().min(1).optional()
16588
16717
  }).refine((input) => path32.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
16589
- var PoolPickInputSchema = z26.strictObject({
16590
- pool: z26.string().min(1),
16591
- path: z26.string().min(1)
16718
+ var PoolPickInputSchema = z27.strictObject({
16719
+ pool: z27.string().min(1),
16720
+ path: z27.string().min(1)
16592
16721
  }).refine((input) => path32.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
16593
- var DoctorFindingSchema = z26.strictObject({
16594
- section: z26.enum(DOCTOR_SECTIONS),
16595
- subject: z26.string().optional(),
16596
- severity: z26.enum(DOCTOR_SEVERITIES),
16597
- message: z26.string()
16722
+ var DoctorFindingSchema = z27.strictObject({
16723
+ section: z27.enum(DOCTOR_SECTIONS),
16724
+ subject: z27.string().optional(),
16725
+ severity: z27.enum(DOCTOR_SEVERITIES),
16726
+ message: z27.string()
16598
16727
  });
16599
- var DoctorRunOutputSchema = z26.strictObject({
16728
+ var DoctorRunOutputSchema = z27.strictObject({
16600
16729
  /** False exactly when any finding is a `fail`; a `warn` never fails the report on its own. */
16601
- ok: z26.boolean(),
16602
- findings: z26.readonly(z26.array(DoctorFindingSchema))
16730
+ ok: z27.boolean(),
16731
+ findings: z27.readonly(z27.array(DoctorFindingSchema))
16603
16732
  });
16604
- var FrontDoorRestartOutputSchema = z26.strictObject({
16605
- action: z26.literal("restarting"),
16606
- previousPid: z26.int().positive()
16733
+ var FrontDoorRestartOutputSchema = z27.strictObject({
16734
+ action: z27.literal("restarting"),
16735
+ previousPid: z27.int().positive()
16607
16736
  });
16608
- var UpdateCheckOutputSchema = z26.strictObject({
16609
- current: z26.string(),
16610
- latest: z26.string(),
16611
- action: z26.enum(["current", "available", "updated"])
16737
+ var UpdateCheckOutputSchema = z27.strictObject({
16738
+ current: z27.string(),
16739
+ latest: z27.string(),
16740
+ action: z27.enum(["current", "available", "updated"])
16612
16741
  });
16613
- var CodexSignInSchema = z26.discriminatedUnion("state", [
16614
- z26.strictObject({ state: z26.literal("none") }),
16615
- z26.strictObject({ state: z26.literal("signed-in"), email: z26.string().optional(), planScope: z26.boolean(), accessTokenExpiresAt: z26.number() }),
16616
- z26.strictObject({ state: z26.literal("unreadable"), message: z26.string() })
16742
+ var CodexSignInSchema = z27.discriminatedUnion("state", [
16743
+ z27.strictObject({ state: z27.literal("none") }),
16744
+ z27.strictObject({ state: z27.literal("signed-in"), email: z27.string().optional(), planScope: z27.boolean(), accessTokenExpiresAt: z27.number() }),
16745
+ z27.strictObject({ state: z27.literal("unreadable"), message: z27.string() })
16617
16746
  ]);
16618
- var CodexStatusOutputSchema = z26.strictObject({
16747
+ var CodexStatusOutputSchema = z27.strictObject({
16619
16748
  signIn: CodexSignInSchema,
16620
- codexProviders: z26.readonly(z26.array(z26.string()))
16749
+ codexProviders: z27.readonly(z27.array(z27.string()))
16621
16750
  });
16622
- var CodexLogoutOutputSchema = z26.strictObject({
16623
- hadGrant: z26.boolean(),
16624
- revoked: z26.boolean()
16751
+ var CodexLogoutOutputSchema = z27.strictObject({
16752
+ hadGrant: z27.boolean(),
16753
+ revoked: z27.boolean()
16625
16754
  });
16626
16755
 
16627
16756
  // src/frontdoor/codexApi.ts
@@ -16780,143 +16909,145 @@ init_providersStore();
16780
16909
 
16781
16910
  // src/frontdoor/configSchemas.ts
16782
16911
  init_schema();
16783
- import { z as z27 } from "zod";
16784
- var RemovalConfirmationSchema = z27.boolean();
16785
- var CredentialWriteSchema = (targets) => z27.strictObject({
16786
- sources: z27.array(RemoteCredentialSourceSchema).min(1).optional(),
16787
- target: z27.enum(targets).optional(),
16788
- cache: z27.union([z27.literal(false), CredentialCacheSchema]).optional()
16912
+ init_statusline();
16913
+ import { z as z28 } from "zod";
16914
+ var RemovalConfirmationSchema = z28.boolean();
16915
+ var CredentialWriteSchema = (targets) => z28.strictObject({
16916
+ sources: z28.array(RemoteCredentialSourceSchema).min(1).optional(),
16917
+ target: z28.enum(targets).optional(),
16918
+ cache: z28.union([z28.literal(false), CredentialCacheSchema]).optional()
16789
16919
  });
16790
- var CredentialSummarySchema2 = z27.strictObject({
16791
- target: z27.enum(CREDENTIAL_TARGETS),
16792
- sources: z27.readonly(z27.array(
16793
- z27.discriminatedUnion("kind", [
16794
- z27.strictObject({ kind: z27.literal("env"), variable: z27.string() }),
16795
- z27.strictObject({ kind: z27.literal("file"), path: z27.string() }),
16796
- z27.strictObject({ kind: z27.literal("command"), program: z27.string() }),
16797
- z27.strictObject({ kind: z27.literal("op"), reference: z27.string() }),
16798
- z27.strictObject({ kind: z27.literal("keychain"), service: z27.string(), account: z27.string().optional() }),
16799
- z27.strictObject({ kind: z27.literal("literal") })
16920
+ var CredentialSummarySchema2 = z28.strictObject({
16921
+ target: z28.enum(CREDENTIAL_TARGETS),
16922
+ sources: z28.readonly(z28.array(
16923
+ z28.discriminatedUnion("kind", [
16924
+ z28.strictObject({ kind: z28.literal("env"), variable: z28.string() }),
16925
+ z28.strictObject({ kind: z28.literal("file"), path: z28.string() }),
16926
+ z28.strictObject({ kind: z28.literal("command"), program: z28.string() }),
16927
+ z28.strictObject({ kind: z28.literal("op"), reference: z28.string() }),
16928
+ z28.strictObject({ kind: z28.literal("keychain"), service: z28.string(), account: z28.string().optional() }),
16929
+ z28.strictObject({ kind: z28.literal("literal") })
16800
16930
  ])
16801
16931
  )),
16802
16932
  cache: CredentialCacheSchema.optional()
16803
16933
  });
16804
- var mutationOutput = (kind, action) => z27.strictObject({ action: z27.literal(action), kind: z27.literal(kind), name: z27.string() });
16805
- var storedMutationOutput = (kind, action, value) => z27.strictObject({ action: z27.literal(action), kind: z27.literal(kind), name: z27.string(), value });
16806
- var IdentityValueSchema = z27.strictObject({
16807
- name: z27.string(),
16808
- defaultConfigProfile: z27.string().optional(),
16809
- allowAmbientCredential: z27.boolean(),
16934
+ var mutationOutput = (kind, action) => z28.strictObject({ action: z28.literal(action), kind: z28.literal(kind), name: z28.string() });
16935
+ var storedMutationOutput = (kind, action, value) => z28.strictObject({ action: z28.literal(action), kind: z28.literal(kind), name: z28.string(), value });
16936
+ var IdentityValueSchema = z28.strictObject({
16937
+ name: z28.string(),
16938
+ defaultConfigProfile: z28.string().optional(),
16939
+ allowAmbientCredential: z28.boolean(),
16810
16940
  credential: CredentialSummarySchema2.optional(),
16811
- anchors: z27.array(AnchorSchema).optional()
16941
+ anchors: z28.array(AnchorSchema).optional()
16812
16942
  });
16813
16943
  var ProfileValueSchema = ConfigProfileSchema.omit({ $schema: true });
16814
- var ProviderValueSchema = z27.strictObject({
16815
- name: z27.string(),
16816
- kind: z27.enum(PROVIDER_KINDS),
16817
- displayName: z27.string(),
16818
- baseUrl: z27.string().optional(),
16944
+ var ProviderValueSchema = z28.strictObject({
16945
+ name: z28.string(),
16946
+ kind: z28.enum(PROVIDER_KINDS),
16947
+ displayName: z28.string(),
16948
+ baseUrl: z28.string().optional(),
16819
16949
  codex: CodexProviderConfigSchema.optional(),
16820
16950
  credential: CredentialSummarySchema2.optional(),
16821
- env: z27.record(z27.string(), z27.string()).optional()
16951
+ env: z28.record(z28.string(), z28.string()).optional()
16822
16952
  });
16823
- var ConfigNameInputSchema = z27.strictObject({ name: z27.string().min(1) });
16953
+ var ConfigNameInputSchema = z28.strictObject({ name: z28.string().min(1) });
16824
16954
  var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
16825
- var ConfigIdentitySetInputSchema = z27.strictObject({
16826
- name: z27.string().min(1),
16827
- defaultConfigProfile: z27.union([z27.string().min(1), z27.literal(false)]).optional(),
16828
- allowAmbientCredential: z27.boolean().optional(),
16829
- credential: z27.union([z27.literal(false), CredentialWriteSchema(CREDENTIAL_TARGETS)]).optional(),
16955
+ var ConfigIdentitySetInputSchema = z28.strictObject({
16956
+ name: z28.string().min(1),
16957
+ defaultConfigProfile: z28.union([z28.string().min(1), z28.literal(false)]).optional(),
16958
+ allowAmbientCredential: z28.boolean().optional(),
16959
+ credential: z28.union([z28.literal(false), CredentialWriteSchema(CREDENTIAL_TARGETS)]).optional(),
16830
16960
  /** `false` removes the anchors; a list replaces them. */
16831
- anchors: z27.union([z27.literal(false), z27.array(AnchorSchema).min(1)]).optional()
16961
+ anchors: z28.union([z28.literal(false), z28.array(AnchorSchema).min(1)]).optional()
16832
16962
  });
16833
16963
  var ConfigIdentitySetOutputSchema = storedMutationOutput("identity", "updated", IdentityValueSchema);
16834
- var ConfigIdentityRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
16964
+ var ConfigIdentityRemoveInputSchema = z28.strictObject({ name: z28.string().min(1), confirm: RemovalConfirmationSchema });
16835
16965
  var ConfigIdentityRemoveOutputSchema = mutationOutput("identity", "removed");
16836
16966
  var ConfigIdentityUseOutputSchema = mutationOutput("identity", "selected");
16837
- var ConfigProfileAddInputSchema = z27.strictObject({
16838
- name: z27.string().min(1),
16839
- extends: z27.array(z27.string().min(1)).optional(),
16840
- description: z27.string().optional()
16967
+ var ConfigProfileAddInputSchema = z28.strictObject({
16968
+ name: z28.string().min(1),
16969
+ extends: z28.array(z28.string().min(1)).optional(),
16970
+ description: z28.string().optional()
16841
16971
  });
16842
16972
  var ConfigProfileAddOutputSchema = storedMutationOutput("profile", "created", ProfileValueSchema);
16843
- var ConfigProfileSetInputSchema = z27.strictObject({
16844
- name: z27.string().min(1),
16845
- category: z27.record(z27.string(), z27.boolean()).optional(),
16846
- entry: z27.record(z27.string(), z27.boolean()).optional(),
16847
- extends: z27.union([z27.array(z27.string().min(1)), z27.literal(false)]).optional(),
16848
- description: z27.union([z27.string(), z27.literal(false)]).optional(),
16849
- launch: z27.strictObject({
16850
- skipPermissions: z27.boolean().optional(),
16851
- remoteControl: z27.boolean().optional(),
16852
- headroom: z27.boolean().optional(),
16853
- trackUsage: z27.boolean().optional(),
16854
- provider: z27.union([z27.string().min(1), z27.literal(false)]).optional(),
16855
- claudeVersion: z27.union([z27.string().min(1), z27.literal(false)]).optional(),
16856
- delay: z27.union([z27.string().regex(DURATION_RE), z27.literal(false)]).optional(),
16857
- pause: z27.boolean().optional(),
16858
- explain: z27.boolean().optional(),
16859
- proxyBypass: z27.union([z27.array(z27.string().min(1)), z27.literal(false)]).optional()
16973
+ var ConfigProfileSetInputSchema = z28.strictObject({
16974
+ name: z28.string().min(1),
16975
+ category: z28.record(z28.string(), z28.boolean()).optional(),
16976
+ entry: z28.record(z28.string(), z28.boolean()).optional(),
16977
+ extends: z28.union([z28.array(z28.string().min(1)), z28.literal(false)]).optional(),
16978
+ description: z28.union([z28.string(), z28.literal(false)]).optional(),
16979
+ launch: z28.strictObject({
16980
+ skipPermissions: z28.boolean().optional(),
16981
+ remoteControl: z28.boolean().optional(),
16982
+ headroom: z28.boolean().optional(),
16983
+ trackUsage: z28.boolean().optional(),
16984
+ provider: z28.union([z28.string().min(1), z28.literal(false)]).optional(),
16985
+ claudeVersion: z28.union([z28.string().min(1), z28.literal(false)]).optional(),
16986
+ delay: z28.union([z28.string().regex(DURATION_RE), z28.literal(false)]).optional(),
16987
+ pause: z28.boolean().optional(),
16988
+ explain: z28.boolean().optional(),
16989
+ proxyBypass: z28.union([z28.array(z28.string().min(1)), z28.literal(false)]).optional(),
16990
+ statusline: StatuslineChangeSchema.optional()
16860
16991
  }).optional()
16861
16992
  });
16862
16993
  var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
16863
- var ConfigProfileRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
16994
+ var ConfigProfileRemoveInputSchema = z28.strictObject({ name: z28.string().min(1), confirm: RemovalConfirmationSchema });
16864
16995
  var ConfigProfileRemoveOutputSchema = mutationOutput("profile", "removed");
16865
16996
  var ConfigProfileUseOutputSchema = mutationOutput("profile", "selected");
16866
- var PoolMembersInputSchema = z27.array(z27.string().min(1)).min(1);
16867
- var ConfigPoolAddInputSchema = z27.strictObject({
16868
- name: z27.string().min(1),
16997
+ var PoolMembersInputSchema = z28.array(z28.string().min(1)).min(1);
16998
+ var ConfigPoolAddInputSchema = z28.strictObject({
16999
+ name: z28.string().min(1),
16869
17000
  identities: PoolMembersInputSchema,
16870
- preference: z27.enum(POOL_PREFERENCES).optional(),
16871
- resumeOnLimit: z27.boolean().optional(),
16872
- compactBeforeLimit: z27.boolean().optional(),
17001
+ preference: z28.enum(POOL_PREFERENCES).optional(),
17002
+ resumeOnLimit: z28.boolean().optional(),
17003
+ compactBeforeLimit: z28.boolean().optional(),
16873
17004
  compactAtUtilisation: CompactAtUtilisationSchema.optional()
16874
17005
  });
16875
17006
  var ConfigPoolAddOutputSchema = storedMutationOutput("pool", "created", PoolSchema);
16876
- var ConfigPoolSetInputSchema = z27.strictObject({
16877
- name: z27.string().min(1),
17007
+ var ConfigPoolSetInputSchema = z28.strictObject({
17008
+ name: z28.string().min(1),
16878
17009
  identities: PoolMembersInputSchema.optional(),
16879
- preference: z27.union([z27.enum(POOL_PREFERENCES), z27.literal(false)]).optional(),
16880
- resumeOnLimit: z27.boolean().optional(),
16881
- compactBeforeLimit: z27.boolean().optional(),
16882
- compactAtUtilisation: z27.union([CompactAtUtilisationSchema, z27.literal(false)]).optional()
17010
+ preference: z28.union([z28.enum(POOL_PREFERENCES), z28.literal(false)]).optional(),
17011
+ resumeOnLimit: z28.boolean().optional(),
17012
+ compactBeforeLimit: z28.boolean().optional(),
17013
+ compactAtUtilisation: z28.union([CompactAtUtilisationSchema, z28.literal(false)]).optional()
16883
17014
  });
16884
17015
  var ConfigPoolSetOutputSchema = storedMutationOutput("pool", "updated", PoolSchema);
16885
- var ConfigPoolRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
17016
+ var ConfigPoolRemoveInputSchema = z28.strictObject({ name: z28.string().min(1), confirm: RemovalConfirmationSchema });
16886
17017
  var ConfigPoolRemoveOutputSchema = mutationOutput("pool", "removed");
16887
17018
  var ConfigPoolUseOutputSchema = mutationOutput("pool", "selected");
16888
- var ConfigProviderAddInputSchema = z27.strictObject({
16889
- name: z27.string().min(1),
16890
- kind: z27.enum(PROVIDER_KINDS).optional(),
16891
- displayName: z27.string().min(1),
16892
- baseUrl: z27.string().min(1).optional(),
17019
+ var ConfigProviderAddInputSchema = z28.strictObject({
17020
+ name: z28.string().min(1),
17021
+ kind: z28.enum(PROVIDER_KINDS).optional(),
17022
+ displayName: z28.string().min(1),
17023
+ baseUrl: z28.string().min(1).optional(),
16893
17024
  credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).required({ sources: true }),
16894
17025
  codex: CodexProviderConfigSchema.optional()
16895
17026
  });
16896
17027
  var ConfigProviderAddOutputSchema = storedMutationOutput("provider", "created", ProviderValueSchema);
16897
- var ConfigProviderSetInputSchema = z27.strictObject({
16898
- name: z27.string().min(1),
16899
- displayName: z27.string().min(1).optional(),
16900
- baseUrl: z27.string().min(1).optional(),
17028
+ var ConfigProviderSetInputSchema = z28.strictObject({
17029
+ name: z28.string().min(1),
17030
+ displayName: z28.string().min(1).optional(),
17031
+ baseUrl: z28.string().min(1).optional(),
16901
17032
  credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).optional(),
16902
17033
  codex: CodexProviderConfigSchema.optional()
16903
17034
  });
16904
17035
  var ConfigProviderSetOutputSchema = storedMutationOutput("provider", "updated", ProviderValueSchema);
16905
- var ConfigProviderRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
17036
+ var ConfigProviderRemoveInputSchema = z28.strictObject({ name: z28.string().min(1), confirm: RemovalConfirmationSchema });
16906
17037
  var ConfigProviderRemoveOutputSchema = mutationOutput("provider", "removed");
16907
- var ConfigRuleAddInputSchema = z27.strictObject({
16908
- path: z27.string().min(1),
16909
- configProfile: z27.string().min(1).optional(),
16910
- identity: z27.string().min(1).optional()
17038
+ var ConfigRuleAddInputSchema = z28.strictObject({
17039
+ path: z28.string().min(1),
17040
+ configProfile: z28.string().min(1).optional(),
17041
+ identity: z28.string().min(1).optional()
16911
17042
  });
16912
17043
  var ConfigRuleAddOutputSchema = storedMutationOutput("rule", "created", DirectoryRuleSchema);
16913
- var ConfigRuleSetInputSchema = z27.strictObject({
16914
- path: z27.string().min(1),
16915
- configProfile: z27.union([z27.string().min(1), z27.literal(false)]).optional(),
16916
- identity: z27.union([z27.string().min(1), z27.literal(false)]).optional()
17044
+ var ConfigRuleSetInputSchema = z28.strictObject({
17045
+ path: z28.string().min(1),
17046
+ configProfile: z28.union([z28.string().min(1), z28.literal(false)]).optional(),
17047
+ identity: z28.union([z28.string().min(1), z28.literal(false)]).optional()
16917
17048
  });
16918
17049
  var ConfigRuleSetOutputSchema = storedMutationOutput("rule", "updated", DirectoryRuleSchema);
16919
- var ConfigRuleRemoveInputSchema = z27.strictObject({ path: z27.string().min(1), confirm: RemovalConfirmationSchema });
17050
+ var ConfigRuleRemoveInputSchema = z28.strictObject({ path: z28.string().min(1), confirm: RemovalConfirmationSchema });
16920
17051
  var ConfigRuleRemoveOutputSchema = mutationOutput("rule", "removed");
16921
17052
 
16922
17053
  // src/frontdoor/configApi.ts
@@ -17069,7 +17200,8 @@ function createConfigApiRouter(deps) {
17069
17200
  ...launch?.delay === void 0 ? {} : { launchDelay: launch.delay },
17070
17201
  ...launch?.pause === void 0 ? {} : { launchPause: launch.pause },
17071
17202
  ...launch?.explain === void 0 ? {} : { launchExplain: launch.explain },
17072
- ...launch?.proxyBypass === void 0 ? {} : { launchProxyBypass: launch.proxyBypass === false ? false : checkedProxyBypass(launch.proxyBypass, "launch.proxyBypass") }
17203
+ ...launch?.proxyBypass === void 0 ? {} : { launchProxyBypass: launch.proxyBypass === false ? false : checkedProxyBypass(launch.proxyBypass, "launch.proxyBypass") },
17204
+ ...launch?.statusline === void 0 ? {} : { launchStatusline: launch.statusline }
17073
17205
  });
17074
17206
  return { action: "updated", kind: "profile", name: input.name, value: profileValue(input.name, paths) };
17075
17207
  })
@@ -17228,43 +17360,43 @@ import { openapi as openapi4 } from "@orpc/openapi";
17228
17360
  import { eventIterator as eventIterator2, withEventMeta as withEventMeta2 } from "@orpc/server";
17229
17361
 
17230
17362
  // src/frontdoor/eventSchemas.ts
17231
- import { z as z28 } from "zod";
17363
+ import { z as z29 } from "zod";
17232
17364
  var DOOR_EVENT_SOURCE_RC = "rc";
17233
17365
  var LAUNCH_EVENT_SOURCE = "launch";
17234
17366
  var USAGE_EVENT_SOURCE = "usage";
17235
17367
  var DOOR_HEALTH_EVENT_SOURCE = "door";
17236
17368
  var QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
17237
- var DoorEventSchema = z28.strictObject({
17238
- source: z28.string().min(1),
17369
+ var DoorEventSchema = z29.strictObject({
17370
+ source: z29.string().min(1),
17239
17371
  /** A positive integer because the backbone's counters start at one and only ever increase. */
17240
- sequence: z28.number().int().positive(),
17241
- payload: z28.unknown()
17372
+ sequence: z29.number().int().positive(),
17373
+ payload: z29.unknown()
17242
17374
  });
17243
- var DoorEventSourceQuerySchema = z28.strictObject({
17244
- sources: z28.array(z28.string().min(1)).min(1).optional()
17375
+ var DoorEventSourceQuerySchema = z29.strictObject({
17376
+ sources: z29.array(z29.string().min(1)).min(1).optional()
17245
17377
  });
17246
- var LaunchLifecycleEventSchema = z28.strictObject({
17247
- kind: z28.enum(["registered", "pruned", "ended"]),
17248
- pid: z28.number().int().positive(),
17249
- startedAt: z28.number(),
17250
- observedAt: z28.number()
17378
+ var LaunchLifecycleEventSchema = z29.strictObject({
17379
+ kind: z29.enum(["registered", "pruned", "ended"]),
17380
+ pid: z29.number().int().positive(),
17381
+ startedAt: z29.number(),
17382
+ observedAt: z29.number()
17251
17383
  });
17252
- var DoorHealthEventSchema = z28.discriminatedUnion("kind", [
17253
- z28.strictObject({ kind: z28.literal("generation"), pid: z28.number().int().positive(), providerPort: z28.number().int().positive(), connectPort: z28.number().int().positive(), directPort: z28.number().int().positive(), observedAt: z28.number() }),
17254
- z28.strictObject({ kind: z28.literal("listenerFailed"), pid: z28.number().int().positive(), listener: z28.enum(["provider", "connect", "direct"]), message: z28.string(), observedAt: z28.number() }),
17255
- z28.strictObject({ kind: z28.literal("binaryTurnover"), pid: z28.number().int().positive(), observedAt: z28.number() }),
17256
- z28.strictObject({ kind: z28.literal("idleShutdown"), pid: z28.number().int().positive(), observedAt: z28.number() }),
17257
- z28.strictObject({ kind: z28.literal("superseded"), pid: z28.number().int().positive(), ownerPid: z28.number().int().positive(), observedAt: z28.number() }),
17258
- z28.strictObject({ kind: z28.literal("drained"), pid: z28.number().int().positive(), observedAt: z28.number() })
17384
+ var DoorHealthEventSchema = z29.discriminatedUnion("kind", [
17385
+ z29.strictObject({ kind: z29.literal("generation"), pid: z29.number().int().positive(), providerPort: z29.number().int().positive(), connectPort: z29.number().int().positive(), directPort: z29.number().int().positive(), observedAt: z29.number() }),
17386
+ z29.strictObject({ kind: z29.literal("listenerFailed"), pid: z29.number().int().positive(), listener: z29.enum(["provider", "connect", "direct"]), message: z29.string(), observedAt: z29.number() }),
17387
+ z29.strictObject({ kind: z29.literal("binaryTurnover"), pid: z29.number().int().positive(), observedAt: z29.number() }),
17388
+ z29.strictObject({ kind: z29.literal("idleShutdown"), pid: z29.number().int().positive(), observedAt: z29.number() }),
17389
+ z29.strictObject({ kind: z29.literal("superseded"), pid: z29.number().int().positive(), ownerPid: z29.number().int().positive(), observedAt: z29.number() }),
17390
+ z29.strictObject({ kind: z29.literal("drained"), pid: z29.number().int().positive(), observedAt: z29.number() })
17259
17391
  ]);
17260
- var QuotaExpiringEventSchema = z28.strictObject({
17261
- identity: z28.string().min(1),
17262
- provider: z28.string().min(1),
17263
- window: z28.enum(["fiveHour", "sevenDay"]),
17392
+ var QuotaExpiringEventSchema = z29.strictObject({
17393
+ identity: z29.string().min(1),
17394
+ provider: z29.string().min(1),
17395
+ window: z29.enum(["fiveHour", "sevenDay"]),
17264
17396
  /** 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. */
17265
- utilization: z28.number().min(0).max(1),
17266
- resetsAt: z28.iso.datetime(),
17267
- observedAt: z28.number()
17397
+ utilization: z29.number().min(0).max(1),
17398
+ resetsAt: z29.iso.datetime(),
17399
+ observedAt: z29.number()
17268
17400
  });
17269
17401
 
17270
17402
  // src/frontdoor/eventsApi.ts
@@ -17348,57 +17480,60 @@ import { openapi as openapi6 } from "@orpc/openapi";
17348
17480
 
17349
17481
  // src/frontdoor/launchSchemas.ts
17350
17482
  import path33 from "node:path";
17351
- import { z as z29 } from "zod";
17483
+ import { z as z30 } from "zod";
17484
+ init_statusline();
17352
17485
  init_claudeVersion();
17353
17486
  init_identity();
17354
- var LaunchResolveInputSchema = z29.strictObject({
17355
- path: z29.string().min(1),
17487
+ var LaunchResolveInputSchema = z30.strictObject({
17488
+ path: z30.string().min(1),
17356
17489
  /** `@name`, launch flags, then the arguments for `claude`; empty for a bare launch. */
17357
- argv: z29.readonly(z29.array(z29.string())).optional(),
17490
+ argv: z30.readonly(z30.array(z30.string())).optional(),
17358
17491
  /** 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. */
17359
- env: z29.record(z29.string(), z29.string()).optional()
17492
+ env: z30.record(z30.string(), z30.string()).optional()
17360
17493
  }).refine((input) => path33.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
17361
- var LaunchPoolDecisionSchema = z29.strictObject({
17362
- name: z29.string(),
17363
- reasons: z29.readonly(z29.array(z29.string())),
17364
- movedOff: z29.strictObject({ identity: z29.string(), reason: z29.string() }).optional()
17494
+ var LaunchPoolDecisionSchema = z30.strictObject({
17495
+ name: z30.string(),
17496
+ reasons: z30.readonly(z30.array(z30.string())),
17497
+ movedOff: z30.strictObject({ identity: z30.string(), reason: z30.string() }).optional()
17365
17498
  });
17366
- var LaunchDecisionSchema = z29.strictObject({
17367
- identity: z29.string().optional(),
17368
- identitySource: z29.enum(IDENTITY_DECISION_SOURCES),
17499
+ var LaunchDecisionSchema = z30.strictObject({
17500
+ identity: z30.string().optional(),
17501
+ identitySource: z30.enum(IDENTITY_DECISION_SOURCES),
17369
17502
  pool: LaunchPoolDecisionSchema.optional(),
17370
- configDirEscapeHatch: z29.boolean(),
17371
- configDir: z29.string().optional(),
17372
- configProfile: z29.string().optional(),
17373
- configProfileSource: z29.enum(CONFIG_PROFILE_DECISION_SOURCES),
17374
- provider: z29.string().optional()
17503
+ configDirEscapeHatch: z30.boolean(),
17504
+ configDir: z30.string().optional(),
17505
+ configProfile: z30.string().optional(),
17506
+ configProfileSource: z30.enum(CONFIG_PROFILE_DECISION_SOURCES),
17507
+ provider: z30.string().optional()
17375
17508
  });
17376
- var LaunchFlagsSchema = z29.strictObject({
17377
- skipPermissions: z29.boolean(),
17378
- remoteControl: z29.boolean(),
17379
- headroom: z29.boolean(),
17380
- trackUsage: z29.boolean(),
17381
- pause: z29.boolean(),
17382
- explain: z29.boolean(),
17509
+ var LaunchFlagsSchema = z30.strictObject({
17510
+ skipPermissions: z30.boolean(),
17511
+ remoteControl: z30.boolean(),
17512
+ headroom: z30.boolean(),
17513
+ trackUsage: z30.boolean(),
17514
+ pause: z30.boolean(),
17515
+ explain: z30.boolean(),
17383
17516
  /** How long the launch waits after its own output before it starts claude, in milliseconds. */
17384
- delayMs: z29.number(),
17517
+ delayMs: z30.number(),
17385
17518
  /** The hosts the launch keeps off the front door by adding them to the child's `NO_PROXY`. */
17386
- proxyBypass: z29.array(z29.string()).readonly()
17519
+ proxyBypass: z30.array(z30.string()).readonly(),
17520
+ /** How the session's built-in statusline looks, when the launch configures any of it. */
17521
+ statusline: StatuslineSchema.optional()
17387
17522
  });
17388
- var LaunchResolveOutputSchema = z29.strictObject({
17523
+ var LaunchResolveOutputSchema = z30.strictObject({
17389
17524
  decision: LaunchDecisionSchema,
17390
17525
  flags: LaunchFlagsSchema,
17391
- claudeVersion: z29.strictObject({ version: z29.string(), source: z29.enum(CLAUDE_VERSION_SOURCES) }).optional(),
17526
+ claudeVersion: z30.strictObject({ version: z30.string(), source: z30.enum(CLAUDE_VERSION_SOURCES) }).optional(),
17392
17527
  /** The real `claude` binary the launch would spawn, on the door's host. */
17393
- bin: z29.string(),
17528
+ bin: z30.string(),
17394
17529
  /** The arguments the launch would pass it: the tool's own flags, then `CLAUDE_EXTRA_FLAGS`, then the caller's own. */
17395
- args: z29.readonly(z29.array(z29.string())),
17530
+ args: z30.readonly(z30.array(z30.string())),
17396
17531
  /** The credential the launch would authenticate with, by target and source kinds. Absent when none applies. */
17397
- credential: z29.strictObject({ subject: z29.enum(["provider", "identity"]), name: z29.string(), summary: CredentialSummarySchema }).optional(),
17398
- routing: z29.strictObject({ frontDoor: z29.boolean(), headroom: z29.boolean() }),
17532
+ credential: z30.strictObject({ subject: z30.enum(["provider", "identity"]), name: z30.string(), summary: CredentialSummarySchema }).optional(),
17533
+ routing: z30.strictObject({ frontDoor: z30.boolean(), headroom: z30.boolean() }),
17399
17534
  /** The names of the environment variables the launch would set or unset, sorted. Values are not reported. */
17400
- environment: z29.readonly(z29.array(z29.string())),
17401
- warnings: z29.readonly(z29.array(z29.string()))
17535
+ environment: z30.readonly(z30.array(z30.string())),
17536
+ warnings: z30.readonly(z30.array(z30.string()))
17402
17537
  });
17403
17538
 
17404
17539
  // src/frontdoor/launchApi.ts
@@ -17434,22 +17569,22 @@ function createLaunchApiRouter(deps) {
17434
17569
  // src/frontdoor/agentTreesApi.ts
17435
17570
  import { ORPCError as ORPCError6 } from "@orpc/client";
17436
17571
  import { openapi as openapi7 } from "@orpc/openapi";
17437
- import { z as z30 } from "zod";
17572
+ import { z as z31 } from "zod";
17438
17573
  init_cliError();
17439
- var AgentTreesListInputSchema = z30.strictObject({
17574
+ var AgentTreesListInputSchema = z31.strictObject({
17440
17575
  /** Only this identity's sessions. */
17441
- identity: z30.string().optional(),
17576
+ identity: z31.string().optional(),
17442
17577
  /** Include sessions that spawned no agent and ran no workflow. */
17443
- all: z30.boolean().optional()
17578
+ all: z31.boolean().optional()
17444
17579
  });
17445
- var AgentTreesListOutputSchema = z30.array(SessionSummarySchema);
17446
- var AgentTreesShowInputSchema = z30.strictObject({
17580
+ var AgentTreesListOutputSchema = z31.array(SessionSummarySchema);
17581
+ var AgentTreesShowInputSchema = z31.strictObject({
17447
17582
  /** A session id, or an unambiguous prefix of one. */
17448
- session: z30.string().min(1),
17583
+ session: z31.string().min(1),
17449
17584
  /** Look only in this identity. */
17450
- identity: z30.string().optional()
17585
+ identity: z31.string().optional()
17451
17586
  });
17452
- var AgentTreesShowOutputSchema = z30.strictObject({ identities: z30.array(z30.string()), ...MergedAgentTreeSchema.shape });
17587
+ var AgentTreesShowOutputSchema = z31.strictObject({ identities: z31.array(z31.string()), ...MergedAgentTreeSchema.shape });
17453
17588
  function asBadRequest(error) {
17454
17589
  if (error instanceof CliError) {
17455
17590
  throw new ORPCError6("BAD_REQUEST", { message: error.message });
@@ -19642,7 +19777,7 @@ init_poolPick();
19642
19777
 
19643
19778
  // src/agents/read.ts
19644
19779
  import path35 from "node:path";
19645
- import { z as z31 } from "zod";
19780
+ import { z as z32 } from "zod";
19646
19781
  var PROJECTS_DIR = "projects";
19647
19782
  var TASKS_DIR = "tasks";
19648
19783
  var SUBAGENTS_DIR = "subagents";
@@ -19761,14 +19896,14 @@ function parseJson2(text) {
19761
19896
  return void 0;
19762
19897
  }
19763
19898
  }
19764
- var TaskFileSchema = z31.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: z31.array(z31.string()).default([]), blockedBy: z31.array(z31.string()).default([]) });
19765
- var WorkflowRunFileSchema = z31.object({
19766
- runId: z31.string(),
19767
- workflowName: z31.string().optional(),
19768
- status: z31.string().optional(),
19769
- startTime: z31.number().optional(),
19770
- phases: z31.array(z31.object({ title: z31.string() })).default([]),
19771
- summary: z31.string().optional()
19899
+ var TaskFileSchema = z32.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: z32.array(z32.string()).default([]), blockedBy: z32.array(z32.string()).default([]) });
19900
+ var WorkflowRunFileSchema = z32.object({
19901
+ runId: z32.string(),
19902
+ workflowName: z32.string().optional(),
19903
+ status: z32.string().optional(),
19904
+ startTime: z32.number().optional(),
19905
+ phases: z32.array(z32.object({ title: z32.string() })).default([]),
19906
+ summary: z32.string().optional()
19772
19907
  });
19773
19908
  function summariseSession(fs14, configDir, ref) {
19774
19909
  const sessionRelative = path35.join(PROJECTS_DIR, ref.project, ref.entry);