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