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