agent-shim 11.50.2 → 11.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cli.cjs +435 -240
- package/dist/index.cjs +628 -516
- package/dist/index.mjs +621 -510
- package/dist/types/index.d.ts +563 -440
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -142,59 +142,73 @@ var init_proxyBypass = __esm({
|
|
|
142
142
|
function distinctList(member) {
|
|
143
143
|
return import_zod.z.array(member).refine((items) => new Set(items).size === items.length, "must not repeat a segment");
|
|
144
144
|
}
|
|
145
|
+
function isPlainObject(value) {
|
|
146
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
147
|
+
}
|
|
148
|
+
function mergeStatuslineSettings(base, over) {
|
|
149
|
+
if (!isPlainObject(base) || !isPlainObject(over)) {
|
|
150
|
+
return over === void 0 ? base : over;
|
|
151
|
+
}
|
|
152
|
+
const merged = { ...base };
|
|
153
|
+
for (const [key, value] of Object.entries(over)) {
|
|
154
|
+
merged[key] = key in base ? mergeStatuslineSettings(base[key], value) : value;
|
|
155
|
+
}
|
|
156
|
+
return merged;
|
|
157
|
+
}
|
|
145
158
|
function resolveStatusline(settings) {
|
|
146
|
-
const resolved =
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
warnAt: settings?.warnAt ?? STATUSLINE_DEFAULTS.warnAt,
|
|
150
|
-
criticalAt: settings?.criticalAt ?? STATUSLINE_DEFAULTS.criticalAt,
|
|
151
|
-
fiveHourLabel: settings?.fiveHourLabel ?? STATUSLINE_DEFAULTS.fiveHourLabel,
|
|
152
|
-
sevenDayLabel: settings?.sevenDayLabel ?? STATUSLINE_DEFAULTS.sevenDayLabel,
|
|
153
|
-
barWidth: settings?.barWidth ?? STATUSLINE_DEFAULTS.barWidth
|
|
154
|
-
};
|
|
155
|
-
if (resolved.warnAt >= resolved.criticalAt) {
|
|
156
|
-
throw new RangeError(`statusline warnAt (${String(resolved.warnAt)}) must be below criticalAt (${String(resolved.criticalAt)})`);
|
|
159
|
+
const resolved = ResolvedStatuslineSchema.parse(mergeStatuslineSettings(STATUSLINE_DEFAULTS, settings));
|
|
160
|
+
if (resolved.bands.warnAt >= resolved.bands.criticalAt) {
|
|
161
|
+
throw new RangeError(`statusline bands.warnAt (${String(resolved.bands.warnAt)}) must be below bands.criticalAt (${String(resolved.bands.criticalAt)})`);
|
|
157
162
|
}
|
|
158
163
|
return resolved;
|
|
159
164
|
}
|
|
160
|
-
var import_zod, STATUSLINE_HEADER_SEGMENTS,
|
|
165
|
+
var import_zod, STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, MAX_PERCENT, MAX_STATUSLINE_LABEL_CHARS, MAX_BAR_CELLS, LABEL_RE2, labelText, wholePercent, SHAPES, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
|
|
161
166
|
var init_statusline = __esm({
|
|
162
167
|
"src/config/statusline.ts"() {
|
|
163
168
|
"use strict";
|
|
164
169
|
import_zod = require("zod");
|
|
165
170
|
STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom"];
|
|
166
|
-
|
|
171
|
+
STATUSLINE_ROWS = ["context", "quota"];
|
|
167
172
|
MAX_PERCENT = 100;
|
|
168
173
|
MAX_STATUSLINE_LABEL_CHARS = 12;
|
|
169
174
|
MAX_BAR_CELLS = 40;
|
|
170
175
|
LABEL_RE2 = /^[^\p{C}\p{Z}]+(?: [^\p{C}\p{Z}]+)*$/u;
|
|
176
|
+
labelText = import_zod.z.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters");
|
|
171
177
|
wholePercent = import_zod.z.number().int().min(1).max(MAX_PERCENT);
|
|
178
|
+
SHAPES = {
|
|
179
|
+
layout: {
|
|
180
|
+
header: distinctList(import_zod.z.enum(STATUSLINE_HEADER_SEGMENTS)).describe("The header segments to draw, in drawing order; a segment left out is hidden, and an empty list hides the header."),
|
|
181
|
+
rows: distinctList(import_zod.z.enum(STATUSLINE_ROWS)).describe("The rows to draw below the header, in drawing order; a row left out is hidden, and an empty list hides every row.")
|
|
182
|
+
},
|
|
183
|
+
bands: {
|
|
184
|
+
warnAt: wholePercent.describe("The whole percentage of use at which a bar turns yellow; it must be below criticalAt."),
|
|
185
|
+
criticalAt: wholePercent.describe("The whole percentage of use at which a bar turns red.")
|
|
186
|
+
},
|
|
187
|
+
labels: {
|
|
188
|
+
fiveHour: labelText.describe("The name of the five-hour subscription window."),
|
|
189
|
+
sevenDay: labelText.describe("The name of the weekly subscription window.")
|
|
190
|
+
},
|
|
191
|
+
bar: {
|
|
192
|
+
width: import_zod.z.number().int().min(1).max(MAX_BAR_CELLS).describe("A bar's width in cells before the line's spare width is shared out among the bars.")
|
|
193
|
+
}
|
|
194
|
+
};
|
|
172
195
|
StatuslineSchema = import_zod.z.strictObject({
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
fiveHourLabel: import_zod.z.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters").optional(),
|
|
178
|
-
sevenDayLabel: import_zod.z.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters").optional(),
|
|
179
|
-
barWidth: import_zod.z.number().int().min(1).max(MAX_BAR_CELLS).optional()
|
|
196
|
+
layout: import_zod.z.strictObject(SHAPES.layout).partial().optional(),
|
|
197
|
+
bands: import_zod.z.strictObject(SHAPES.bands).partial().optional(),
|
|
198
|
+
labels: import_zod.z.strictObject(SHAPES.labels).partial().optional(),
|
|
199
|
+
bar: import_zod.z.strictObject(SHAPES.bar).partial().optional()
|
|
180
200
|
});
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
fiveHourLabel: import_zod.z.union([StatuslineSchema.shape.fiveHourLabel.unwrap(), import_zod.z.literal(false)]).optional(),
|
|
187
|
-
sevenDayLabel: import_zod.z.union([StatuslineSchema.shape.sevenDayLabel.unwrap(), import_zod.z.literal(false)]).optional(),
|
|
188
|
-
barWidth: import_zod.z.union([StatuslineSchema.shape.barWidth.unwrap(), import_zod.z.literal(false)]).optional()
|
|
201
|
+
ResolvedStatuslineSchema = import_zod.z.strictObject({
|
|
202
|
+
layout: import_zod.z.strictObject(SHAPES.layout),
|
|
203
|
+
bands: import_zod.z.strictObject(SHAPES.bands),
|
|
204
|
+
labels: import_zod.z.strictObject(SHAPES.labels),
|
|
205
|
+
bar: import_zod.z.strictObject(SHAPES.bar)
|
|
189
206
|
});
|
|
190
207
|
STATUSLINE_DEFAULTS = {
|
|
191
|
-
header: STATUSLINE_HEADER_SEGMENTS,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
fiveHourLabel: "5h",
|
|
196
|
-
sevenDayLabel: "Wk",
|
|
197
|
-
barWidth: 10
|
|
208
|
+
layout: { header: [...STATUSLINE_HEADER_SEGMENTS], rows: [...STATUSLINE_ROWS] },
|
|
209
|
+
bands: { warnAt: 70, criticalAt: 90 },
|
|
210
|
+
labels: { fiveHour: "5h", sevenDay: "Wk" },
|
|
211
|
+
bar: { width: 10 }
|
|
198
212
|
};
|
|
199
213
|
STATUSLINE_ENV = "AGENT_SHIM_STATUSLINE";
|
|
200
214
|
}
|
|
@@ -1592,7 +1606,7 @@ function flattenLayers(layers, options) {
|
|
|
1592
1606
|
launch.proxyBypass = layer.launch.proxyBypass;
|
|
1593
1607
|
}
|
|
1594
1608
|
if (layer.launch.statusline !== void 0) {
|
|
1595
|
-
launch.statusline =
|
|
1609
|
+
launch.statusline = StatuslineSchema.parse(mergeStatuslineSettings(launch.statusline, layer.launch.statusline));
|
|
1596
1610
|
}
|
|
1597
1611
|
}
|
|
1598
1612
|
if (layer.models !== void 0) {
|
|
@@ -1773,6 +1787,7 @@ var init_flatten = __esm({
|
|
|
1773
1787
|
"src/resolve/flatten.ts"() {
|
|
1774
1788
|
"use strict";
|
|
1775
1789
|
init_schema();
|
|
1790
|
+
init_statusline();
|
|
1776
1791
|
init_conditions();
|
|
1777
1792
|
init_match();
|
|
1778
1793
|
}
|
|
@@ -4259,7 +4274,7 @@ var init_package = __esm({
|
|
|
4259
4274
|
"package.json"() {
|
|
4260
4275
|
package_default = {
|
|
4261
4276
|
name: "agent-shim",
|
|
4262
|
-
version: "11.
|
|
4277
|
+
version: "11.51.0",
|
|
4263
4278
|
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.",
|
|
4264
4279
|
license: "MIT",
|
|
4265
4280
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -7419,6 +7434,112 @@ var init_poolPick = __esm({
|
|
|
7419
7434
|
}
|
|
7420
7435
|
});
|
|
7421
7436
|
|
|
7437
|
+
// src/statusline/keys.ts
|
|
7438
|
+
function valueAt(source, path43) {
|
|
7439
|
+
let current = source;
|
|
7440
|
+
for (const part of path43) {
|
|
7441
|
+
if (!isPlainObject(current)) {
|
|
7442
|
+
return void 0;
|
|
7443
|
+
}
|
|
7444
|
+
current = current[part];
|
|
7445
|
+
}
|
|
7446
|
+
return current;
|
|
7447
|
+
}
|
|
7448
|
+
function keyOf(path43, leaf) {
|
|
7449
|
+
const common = { path: path43.join("."), description: leaf.description ?? "", defaultValue: valueAt(STATUSLINE_DEFAULTS, path43) };
|
|
7450
|
+
if (leaf instanceof import_zod15.z.ZodNumber) {
|
|
7451
|
+
return { ...common, kind: "integer", choices: [] };
|
|
7452
|
+
}
|
|
7453
|
+
if (leaf instanceof import_zod15.z.ZodString) {
|
|
7454
|
+
return { ...common, kind: "text", choices: [] };
|
|
7455
|
+
}
|
|
7456
|
+
if (leaf instanceof import_zod15.z.ZodEnum) {
|
|
7457
|
+
return { ...common, kind: "choice", choices: Object.values(leaf.enum).map(String) };
|
|
7458
|
+
}
|
|
7459
|
+
if (leaf instanceof import_zod15.z.ZodArray && leaf.element instanceof import_zod15.z.ZodEnum) {
|
|
7460
|
+
return { ...common, kind: "list", choices: Object.values(leaf.element.enum).map(String) };
|
|
7461
|
+
}
|
|
7462
|
+
throw new TypeError(`statusline setting ${path43.join(".")} has a kind the key listing does not describe`);
|
|
7463
|
+
}
|
|
7464
|
+
function walk(shape, prefix) {
|
|
7465
|
+
return Object.entries(shape).flatMap(([name, schema]) => schema instanceof import_zod15.z.ZodObject ? walk(schema.shape, [...prefix, name]) : [keyOf([...prefix, name], schema)]);
|
|
7466
|
+
}
|
|
7467
|
+
function statuslineKeys() {
|
|
7468
|
+
return walk(ResolvedStatuslineSchema.shape, []);
|
|
7469
|
+
}
|
|
7470
|
+
var import_zod15;
|
|
7471
|
+
var init_keys = __esm({
|
|
7472
|
+
"src/statusline/keys.ts"() {
|
|
7473
|
+
"use strict";
|
|
7474
|
+
import_zod15 = require("zod");
|
|
7475
|
+
init_statusline();
|
|
7476
|
+
}
|
|
7477
|
+
});
|
|
7478
|
+
|
|
7479
|
+
// src/statusline/change.ts
|
|
7480
|
+
function keyNamed(path43) {
|
|
7481
|
+
const found = statuslineKeys().find((key) => key.path === path43);
|
|
7482
|
+
if (found === void 0) {
|
|
7483
|
+
throw new UsageError(`"${path43}" is not a statusline setting; \`agent-shim statusline keys\` lists them.`);
|
|
7484
|
+
}
|
|
7485
|
+
return found;
|
|
7486
|
+
}
|
|
7487
|
+
function setAt(target, path43, value) {
|
|
7488
|
+
const [head, ...rest] = path43;
|
|
7489
|
+
if (head === void 0) {
|
|
7490
|
+
return;
|
|
7491
|
+
}
|
|
7492
|
+
if (rest.length === 0) {
|
|
7493
|
+
target[head] = value;
|
|
7494
|
+
return;
|
|
7495
|
+
}
|
|
7496
|
+
const child = target[head];
|
|
7497
|
+
const next = isPlainObject(child) ? child : {};
|
|
7498
|
+
target[head] = next;
|
|
7499
|
+
setAt(next, rest, value);
|
|
7500
|
+
}
|
|
7501
|
+
function removeAt(target, path43) {
|
|
7502
|
+
const [head, ...rest] = path43;
|
|
7503
|
+
if (head === void 0) {
|
|
7504
|
+
return;
|
|
7505
|
+
}
|
|
7506
|
+
const child = target[head];
|
|
7507
|
+
if (rest.length === 0) {
|
|
7508
|
+
Reflect.deleteProperty(target, head);
|
|
7509
|
+
return;
|
|
7510
|
+
}
|
|
7511
|
+
if (isPlainObject(child)) {
|
|
7512
|
+
removeAt(child, rest);
|
|
7513
|
+
if (Object.keys(child).length === 0) {
|
|
7514
|
+
Reflect.deleteProperty(target, head);
|
|
7515
|
+
}
|
|
7516
|
+
}
|
|
7517
|
+
}
|
|
7518
|
+
function applyStatuslineChange(existing, change) {
|
|
7519
|
+
const draft = structuredClone(existing ?? {});
|
|
7520
|
+
for (const [path43, value] of Object.entries(change.set ?? {})) {
|
|
7521
|
+
keyNamed(path43);
|
|
7522
|
+
setAt(draft, path43.split("."), value);
|
|
7523
|
+
}
|
|
7524
|
+
for (const path43 of change.unset ?? []) {
|
|
7525
|
+
keyNamed(path43);
|
|
7526
|
+
removeAt(draft, path43.split("."));
|
|
7527
|
+
}
|
|
7528
|
+
const result = StatuslineSchema.safeParse(draft);
|
|
7529
|
+
if (!result.success) {
|
|
7530
|
+
throw new UsageError(`statusline: ${result.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ")}.`);
|
|
7531
|
+
}
|
|
7532
|
+
return Object.keys(result.data).length === 0 ? void 0 : result.data;
|
|
7533
|
+
}
|
|
7534
|
+
var init_change = __esm({
|
|
7535
|
+
"src/statusline/change.ts"() {
|
|
7536
|
+
"use strict";
|
|
7537
|
+
init_cliError();
|
|
7538
|
+
init_statusline();
|
|
7539
|
+
init_keys();
|
|
7540
|
+
}
|
|
7541
|
+
});
|
|
7542
|
+
|
|
7422
7543
|
// src/configProfilesStore.ts
|
|
7423
7544
|
function profileJsonPath(paths, name) {
|
|
7424
7545
|
return import_node_path22.default.join(paths.configProfilesDir, `${name}.json`);
|
|
@@ -7518,17 +7639,6 @@ function removeProfile(paths, name) {
|
|
|
7518
7639
|
requireProfileExists(paths, name);
|
|
7519
7640
|
import_node_fs3.default.rmSync(profileJsonPath(paths, name));
|
|
7520
7641
|
}
|
|
7521
|
-
function withStatuslineChange(existing, change) {
|
|
7522
|
-
const merged = new Map(Object.entries({ ...existing }));
|
|
7523
|
-
for (const [key, value] of Object.entries(change)) {
|
|
7524
|
-
if (value === false) {
|
|
7525
|
-
merged.delete(key);
|
|
7526
|
-
} else {
|
|
7527
|
-
merged.set(key, value);
|
|
7528
|
-
}
|
|
7529
|
-
}
|
|
7530
|
-
return merged.size === 0 ? void 0 : StatuslineSchema.parse(Object.fromEntries(merged));
|
|
7531
|
-
}
|
|
7532
7642
|
function applyProfileChange(paths, name, change) {
|
|
7533
7643
|
let touched = false;
|
|
7534
7644
|
if (change.category !== void 0) {
|
|
@@ -7578,7 +7688,7 @@ function applyProfileChange(paths, name, change) {
|
|
|
7578
7688
|
launchPatch.explain = change.launchExplain;
|
|
7579
7689
|
}
|
|
7580
7690
|
if (change.launchStatusline !== void 0) {
|
|
7581
|
-
launchPatch.statusline =
|
|
7691
|
+
launchPatch.statusline = applyStatuslineChange(readProfile(paths, name)?.launch?.statusline, change.launchStatusline);
|
|
7582
7692
|
}
|
|
7583
7693
|
if (Object.keys(launchPatch).length > 0) {
|
|
7584
7694
|
setProfileLaunchFlags(paths, name, launchPatch);
|
|
@@ -7595,7 +7705,7 @@ var init_configProfilesStore = __esm({
|
|
|
7595
7705
|
init_store();
|
|
7596
7706
|
init_schema();
|
|
7597
7707
|
init_cliError();
|
|
7598
|
-
|
|
7708
|
+
init_change();
|
|
7599
7709
|
init_load();
|
|
7600
7710
|
ProfileNotFoundError = class extends CliError {
|
|
7601
7711
|
constructor(profileName) {
|
|
@@ -7767,17 +7877,17 @@ function formatCachedCredentialState(state) {
|
|
|
7767
7877
|
}
|
|
7768
7878
|
return state.status === "fresh" ? `${age}, expires in ${formatAge(state.expiresInMs)}` : `${age}, expired ${formatAge(-state.expiresInMs)} ago`;
|
|
7769
7879
|
}
|
|
7770
|
-
var
|
|
7880
|
+
var import_zod16, MS_PER_UNIT, CachedCredentialSchema;
|
|
7771
7881
|
var init_credentialCache = __esm({
|
|
7772
7882
|
"src/credentialCache.ts"() {
|
|
7773
7883
|
"use strict";
|
|
7774
|
-
|
|
7884
|
+
import_zod16 = require("zod");
|
|
7775
7885
|
init_schema();
|
|
7776
7886
|
init_preflight();
|
|
7777
7887
|
MS_PER_UNIT = { s: 1e3, m: 6e4, h: 36e5, d: 864e5 };
|
|
7778
|
-
CachedCredentialSchema =
|
|
7779
|
-
token:
|
|
7780
|
-
fetchedAt:
|
|
7888
|
+
CachedCredentialSchema = import_zod16.z.strictObject({
|
|
7889
|
+
token: import_zod16.z.string().min(1),
|
|
7890
|
+
fetchedAt: import_zod16.z.number().int().nonnegative(),
|
|
7781
7891
|
source: CredentialSourceSchema
|
|
7782
7892
|
});
|
|
7783
7893
|
}
|
|
@@ -7900,15 +8010,15 @@ function aliasFindings(aliases, providerNames) {
|
|
|
7900
8010
|
return { level: "pass", alias, message: `${alias} is a former name of ${target}, still honoured for sessions launched under it. Run \`agent-shim provider unalias ${alias}\` once none is running.` };
|
|
7901
8011
|
});
|
|
7902
8012
|
}
|
|
7903
|
-
var
|
|
8013
|
+
var import_zod17, ProviderAliasesSchema;
|
|
7904
8014
|
var init_providerAliases = __esm({
|
|
7905
8015
|
"src/providerAliases.ts"() {
|
|
7906
8016
|
"use strict";
|
|
7907
|
-
|
|
8017
|
+
import_zod17 = require("zod");
|
|
7908
8018
|
init_cliError();
|
|
7909
8019
|
init_load();
|
|
7910
8020
|
init_store();
|
|
7911
|
-
ProviderAliasesSchema =
|
|
8021
|
+
ProviderAliasesSchema = import_zod17.z.record(import_zod17.z.string().min(1), import_zod17.z.string().min(1));
|
|
7912
8022
|
}
|
|
7913
8023
|
});
|
|
7914
8024
|
|
|
@@ -8964,21 +9074,21 @@ function findPathShadow(params) {
|
|
|
8964
9074
|
}
|
|
8965
9075
|
return params.pathDirs.some((dir) => import_node_path28.default.resolve(dir) === resolvedTargetDir) ? { status: "ok" } : { status: "not-on-path" };
|
|
8966
9076
|
}
|
|
8967
|
-
var import_node_fs7, import_node_path28,
|
|
9077
|
+
var import_node_fs7, import_node_path28, import_zod22, ClaudeShimStateSchema, nodeLinkFs;
|
|
8968
9078
|
var init_claudeShim = __esm({
|
|
8969
9079
|
"src/claudeShim.ts"() {
|
|
8970
9080
|
"use strict";
|
|
8971
9081
|
import_node_fs7 = __toESM(require("node:fs"), 1);
|
|
8972
9082
|
import_node_path28 = __toESM(require("node:path"), 1);
|
|
8973
|
-
|
|
9083
|
+
import_zod22 = require("zod");
|
|
8974
9084
|
init_commandDeps();
|
|
8975
9085
|
init_store();
|
|
8976
9086
|
init_realPorts();
|
|
8977
9087
|
init_cliError();
|
|
8978
|
-
ClaudeShimStateSchema =
|
|
8979
|
-
targetPath:
|
|
8980
|
-
method:
|
|
8981
|
-
installedAtMs:
|
|
9088
|
+
ClaudeShimStateSchema = import_zod22.z.strictObject({
|
|
9089
|
+
targetPath: import_zod22.z.string().min(1),
|
|
9090
|
+
method: import_zod22.z.enum(["hardlink", "copy"]),
|
|
9091
|
+
installedAtMs: import_zod22.z.number()
|
|
8982
9092
|
});
|
|
8983
9093
|
nodeLinkFs = { link: import_node_fs7.default.linkSync, copyFile: import_node_fs7.default.copyFileSync, chmod: import_node_fs7.default.chmodSync };
|
|
8984
9094
|
}
|
|
@@ -8997,14 +9107,14 @@ function memberKindOf(ref, models) {
|
|
|
8997
9107
|
function expandMembers(name, models) {
|
|
8998
9108
|
const virtual = models?.virtual ?? {};
|
|
8999
9109
|
const expanded = [];
|
|
9000
|
-
const
|
|
9110
|
+
const walk2 = (current, chain) => {
|
|
9001
9111
|
const nested = virtual[current];
|
|
9002
9112
|
if (nested !== void 0) {
|
|
9003
9113
|
if (chain.includes(current)) {
|
|
9004
9114
|
throw new Error(`virtual model cycle: ${[...chain, current].join(" -> ")}`);
|
|
9005
9115
|
}
|
|
9006
9116
|
for (const member of nested.members) {
|
|
9007
|
-
|
|
9117
|
+
walk2(member, [...chain, current]);
|
|
9008
9118
|
}
|
|
9009
9119
|
return;
|
|
9010
9120
|
}
|
|
@@ -9017,7 +9127,7 @@ function expandMembers(name, models) {
|
|
|
9017
9127
|
throw new VirtualModelNotFoundError(name);
|
|
9018
9128
|
}
|
|
9019
9129
|
for (const member of top.members) {
|
|
9020
|
-
|
|
9130
|
+
walk2(member, [name]);
|
|
9021
9131
|
}
|
|
9022
9132
|
return expanded;
|
|
9023
9133
|
}
|
|
@@ -9074,62 +9184,62 @@ var init_signatures = __esm({
|
|
|
9074
9184
|
});
|
|
9075
9185
|
|
|
9076
9186
|
// src/codex/anthropic.ts
|
|
9077
|
-
var
|
|
9187
|
+
var import_zod26, TextBlockSchema, Base64ImageSourceSchema, UrlImageSourceSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultContentBlockSchema, ToolResultBlockSchema, OtherBlockSchema, ContentBlockSchema, MessageSchema, ToolSchema, ToolChoiceSchema, SystemSchema, MessagesRequestSchema, CountTokensRequestSchema;
|
|
9078
9188
|
var init_anthropic = __esm({
|
|
9079
9189
|
"src/codex/anthropic.ts"() {
|
|
9080
9190
|
"use strict";
|
|
9081
|
-
|
|
9082
|
-
TextBlockSchema =
|
|
9083
|
-
Base64ImageSourceSchema =
|
|
9084
|
-
UrlImageSourceSchema =
|
|
9085
|
-
ImageBlockSchema =
|
|
9086
|
-
type:
|
|
9087
|
-
source:
|
|
9191
|
+
import_zod26 = require("zod");
|
|
9192
|
+
TextBlockSchema = import_zod26.z.looseObject({ type: import_zod26.z.literal("text"), text: import_zod26.z.string() });
|
|
9193
|
+
Base64ImageSourceSchema = import_zod26.z.looseObject({ type: import_zod26.z.literal("base64"), media_type: import_zod26.z.string().min(1), data: import_zod26.z.string() });
|
|
9194
|
+
UrlImageSourceSchema = import_zod26.z.looseObject({ type: import_zod26.z.literal("url"), url: import_zod26.z.string().min(1) });
|
|
9195
|
+
ImageBlockSchema = import_zod26.z.looseObject({
|
|
9196
|
+
type: import_zod26.z.literal("image"),
|
|
9197
|
+
source: import_zod26.z.union([Base64ImageSourceSchema, UrlImageSourceSchema])
|
|
9088
9198
|
});
|
|
9089
|
-
ToolUseBlockSchema =
|
|
9090
|
-
type:
|
|
9091
|
-
id:
|
|
9092
|
-
name:
|
|
9093
|
-
input:
|
|
9199
|
+
ToolUseBlockSchema = import_zod26.z.looseObject({
|
|
9200
|
+
type: import_zod26.z.literal("tool_use"),
|
|
9201
|
+
id: import_zod26.z.string().min(1),
|
|
9202
|
+
name: import_zod26.z.string().min(1),
|
|
9203
|
+
input: import_zod26.z.unknown()
|
|
9094
9204
|
});
|
|
9095
|
-
ToolResultContentBlockSchema =
|
|
9096
|
-
ToolResultBlockSchema =
|
|
9097
|
-
type:
|
|
9098
|
-
tool_use_id:
|
|
9099
|
-
content:
|
|
9205
|
+
ToolResultContentBlockSchema = import_zod26.z.union([TextBlockSchema, import_zod26.z.looseObject({ type: import_zod26.z.string() })]);
|
|
9206
|
+
ToolResultBlockSchema = import_zod26.z.looseObject({
|
|
9207
|
+
type: import_zod26.z.literal("tool_result"),
|
|
9208
|
+
tool_use_id: import_zod26.z.string().min(1),
|
|
9209
|
+
content: import_zod26.z.union([import_zod26.z.string(), import_zod26.z.array(ToolResultContentBlockSchema)]).optional()
|
|
9100
9210
|
});
|
|
9101
|
-
OtherBlockSchema =
|
|
9102
|
-
ContentBlockSchema =
|
|
9103
|
-
MessageSchema =
|
|
9104
|
-
role:
|
|
9105
|
-
content:
|
|
9211
|
+
OtherBlockSchema = import_zod26.z.looseObject({ type: import_zod26.z.string() });
|
|
9212
|
+
ContentBlockSchema = import_zod26.z.union([TextBlockSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultBlockSchema, OtherBlockSchema]);
|
|
9213
|
+
MessageSchema = import_zod26.z.looseObject({
|
|
9214
|
+
role: import_zod26.z.enum(["user", "assistant", "system"]),
|
|
9215
|
+
content: import_zod26.z.union([import_zod26.z.string(), import_zod26.z.array(ContentBlockSchema)])
|
|
9106
9216
|
});
|
|
9107
|
-
ToolSchema =
|
|
9108
|
-
name:
|
|
9109
|
-
description:
|
|
9110
|
-
input_schema:
|
|
9217
|
+
ToolSchema = import_zod26.z.looseObject({
|
|
9218
|
+
name: import_zod26.z.string().min(1),
|
|
9219
|
+
description: import_zod26.z.string().optional(),
|
|
9220
|
+
input_schema: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.unknown()).optional()
|
|
9111
9221
|
});
|
|
9112
|
-
ToolChoiceSchema =
|
|
9113
|
-
|
|
9114
|
-
|
|
9222
|
+
ToolChoiceSchema = import_zod26.z.union([
|
|
9223
|
+
import_zod26.z.looseObject({ type: import_zod26.z.enum(["auto", "none", "any"]) }),
|
|
9224
|
+
import_zod26.z.looseObject({ type: import_zod26.z.literal("tool"), name: import_zod26.z.string().min(1) })
|
|
9115
9225
|
]);
|
|
9116
|
-
SystemSchema =
|
|
9117
|
-
MessagesRequestSchema =
|
|
9118
|
-
model:
|
|
9226
|
+
SystemSchema = import_zod26.z.union([import_zod26.z.string(), import_zod26.z.array(import_zod26.z.union([TextBlockSchema, OtherBlockSchema]))]);
|
|
9227
|
+
MessagesRequestSchema = import_zod26.z.looseObject({
|
|
9228
|
+
model: import_zod26.z.string().optional(),
|
|
9119
9229
|
system: SystemSchema.optional(),
|
|
9120
|
-
messages:
|
|
9121
|
-
tools:
|
|
9230
|
+
messages: import_zod26.z.array(MessageSchema),
|
|
9231
|
+
tools: import_zod26.z.array(ToolSchema).optional(),
|
|
9122
9232
|
tool_choice: ToolChoiceSchema.optional(),
|
|
9123
|
-
stream:
|
|
9233
|
+
stream: import_zod26.z.boolean().optional(),
|
|
9124
9234
|
/** `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. */
|
|
9125
|
-
metadata:
|
|
9235
|
+
metadata: import_zod26.z.looseObject({ user_id: import_zod26.z.string().optional() }).optional(),
|
|
9126
9236
|
/** Claude Code's effort setting. Any string is accepted; the translator honours only the levels the backend understands. */
|
|
9127
|
-
output_config:
|
|
9237
|
+
output_config: import_zod26.z.looseObject({ effort: import_zod26.z.string().optional() }).optional()
|
|
9128
9238
|
});
|
|
9129
|
-
CountTokensRequestSchema =
|
|
9130
|
-
system:
|
|
9131
|
-
messages:
|
|
9132
|
-
tools:
|
|
9239
|
+
CountTokensRequestSchema = import_zod26.z.looseObject({
|
|
9240
|
+
system: import_zod26.z.unknown().optional(),
|
|
9241
|
+
messages: import_zod26.z.unknown().optional(),
|
|
9242
|
+
tools: import_zod26.z.unknown().optional()
|
|
9133
9243
|
});
|
|
9134
9244
|
}
|
|
9135
9245
|
});
|
|
@@ -9231,13 +9341,13 @@ function filterCatalogue(models, catalogue) {
|
|
|
9231
9341
|
const excluded = catalogue.exclude === void 0 ? void 0 : (0, import_picomatch4.default)(catalogue.exclude, { dot: true });
|
|
9232
9342
|
return models.filter((model) => included?.(model.id) !== false && excluded?.(model.id) !== true);
|
|
9233
9343
|
}
|
|
9234
|
-
var import_node_path30, import_picomatch4,
|
|
9344
|
+
var import_node_path30, import_picomatch4, import_zod27, DEFAULT_CANDIDATE_URLS, MS_PER_SECOND5, SECONDS_PER_HOUR2, HOURS_PER_DAY5, MS_PER_HOUR4, HOURS_BETWEEN_RETRIES, CATALOGUE_MAX_AGE_MS, CATALOGUE_RETRY_MS, CATALOGUE_REQUEST_SECONDS, CATALOGUE_REQUEST_TIMEOUT_MS, CATALOGUE_REFRESH_TIMEOUT_MS, CatalogueModelSchema, CatalogueCacheSchema;
|
|
9235
9345
|
var init_providerCatalogue = __esm({
|
|
9236
9346
|
"src/providerCatalogue.ts"() {
|
|
9237
9347
|
"use strict";
|
|
9238
9348
|
import_node_path30 = __toESM(require("node:path"), 1);
|
|
9239
9349
|
import_picomatch4 = __toESM(require("picomatch"), 1);
|
|
9240
|
-
|
|
9350
|
+
import_zod27 = require("zod");
|
|
9241
9351
|
DEFAULT_CANDIDATE_URLS = 2;
|
|
9242
9352
|
MS_PER_SECOND5 = 1e3;
|
|
9243
9353
|
SECONDS_PER_HOUR2 = 3600;
|
|
@@ -9249,8 +9359,8 @@ var init_providerCatalogue = __esm({
|
|
|
9249
9359
|
CATALOGUE_REQUEST_SECONDS = 10;
|
|
9250
9360
|
CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND5;
|
|
9251
9361
|
CATALOGUE_REFRESH_TIMEOUT_MS = DEFAULT_CANDIDATE_URLS * CATALOGUE_REQUEST_TIMEOUT_MS;
|
|
9252
|
-
CatalogueModelSchema =
|
|
9253
|
-
CatalogueCacheSchema =
|
|
9362
|
+
CatalogueModelSchema = import_zod27.z.strictObject({ id: import_zod27.z.string().min(1), name: import_zod27.z.string().min(1).optional() });
|
|
9363
|
+
CatalogueCacheSchema = import_zod27.z.strictObject({ fetchedAt: import_zod27.z.number(), url: import_zod27.z.string().min(1), models: import_zod27.z.array(CatalogueModelSchema) });
|
|
9254
9364
|
}
|
|
9255
9365
|
});
|
|
9256
9366
|
|
|
@@ -11613,7 +11723,7 @@ function isAnthropicUsageStale(member, nowMs) {
|
|
|
11613
11723
|
function poolIdentityNames(pools, poolName) {
|
|
11614
11724
|
const seenPools = /* @__PURE__ */ new Set();
|
|
11615
11725
|
const identities = /* @__PURE__ */ new Set();
|
|
11616
|
-
const
|
|
11726
|
+
const walk2 = (name) => {
|
|
11617
11727
|
const pool = pools[name];
|
|
11618
11728
|
if (pool === void 0 || seenPools.has(name)) {
|
|
11619
11729
|
return;
|
|
@@ -11625,11 +11735,11 @@ function poolIdentityNames(pools, poolName) {
|
|
|
11625
11735
|
if (nested === void 0) {
|
|
11626
11736
|
identities.add(member);
|
|
11627
11737
|
} else {
|
|
11628
|
-
|
|
11738
|
+
walk2(nested);
|
|
11629
11739
|
}
|
|
11630
11740
|
}
|
|
11631
11741
|
};
|
|
11632
|
-
|
|
11742
|
+
walk2(poolName);
|
|
11633
11743
|
return [...identities];
|
|
11634
11744
|
}
|
|
11635
11745
|
function describeError(error) {
|
|
@@ -11748,11 +11858,11 @@ var init_identityClaude = __esm({
|
|
|
11748
11858
|
});
|
|
11749
11859
|
|
|
11750
11860
|
// src/usage/providerQuota.ts
|
|
11751
|
-
var
|
|
11861
|
+
var import_zod34, 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;
|
|
11752
11862
|
var init_providerQuota = __esm({
|
|
11753
11863
|
"src/usage/providerQuota.ts"() {
|
|
11754
11864
|
"use strict";
|
|
11755
|
-
|
|
11865
|
+
import_zod34 = require("zod");
|
|
11756
11866
|
init_cloudUpstream();
|
|
11757
11867
|
init_schema2();
|
|
11758
11868
|
MS_PER_SECOND9 = 1e3;
|
|
@@ -11767,35 +11877,35 @@ var init_providerQuota = __esm({
|
|
|
11767
11877
|
[ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND9],
|
|
11768
11878
|
[ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9]
|
|
11769
11879
|
]);
|
|
11770
|
-
ZaiLimitSchema =
|
|
11771
|
-
type:
|
|
11772
|
-
unit:
|
|
11773
|
-
number:
|
|
11774
|
-
percentage:
|
|
11775
|
-
nextResetTime:
|
|
11776
|
-
usage:
|
|
11777
|
-
currentValue:
|
|
11778
|
-
remaining:
|
|
11880
|
+
ZaiLimitSchema = import_zod34.z.object({
|
|
11881
|
+
type: import_zod34.z.string(),
|
|
11882
|
+
unit: import_zod34.z.number().int(),
|
|
11883
|
+
number: import_zod34.z.number().int().positive(),
|
|
11884
|
+
percentage: import_zod34.z.number().nonnegative(),
|
|
11885
|
+
nextResetTime: import_zod34.z.number().positive().optional(),
|
|
11886
|
+
usage: import_zod34.z.number().nonnegative().optional(),
|
|
11887
|
+
currentValue: import_zod34.z.number().nonnegative().optional(),
|
|
11888
|
+
remaining: import_zod34.z.number().nonnegative().optional()
|
|
11779
11889
|
});
|
|
11780
|
-
ZaiResponseSchema =
|
|
11781
|
-
success:
|
|
11782
|
-
msg:
|
|
11783
|
-
data:
|
|
11890
|
+
ZaiResponseSchema = import_zod34.z.object({
|
|
11891
|
+
success: import_zod34.z.boolean(),
|
|
11892
|
+
msg: import_zod34.z.string().optional(),
|
|
11893
|
+
data: import_zod34.z.object({ level: import_zod34.z.string().optional(), limits: import_zod34.z.array(ZaiLimitSchema) })
|
|
11784
11894
|
});
|
|
11785
11895
|
OPENROUTER_HOST = "openrouter.ai";
|
|
11786
11896
|
OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
|
|
11787
11897
|
OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
|
|
11788
11898
|
MS_PER_DAY3 = HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
11789
|
-
OpenRouterKeySchema =
|
|
11790
|
-
data:
|
|
11791
|
-
limit:
|
|
11792
|
-
limit_remaining:
|
|
11793
|
-
limit_reset:
|
|
11794
|
-
is_free_tier:
|
|
11795
|
-
free_model_daily_requests:
|
|
11899
|
+
OpenRouterKeySchema = import_zod34.z.object({
|
|
11900
|
+
data: import_zod34.z.object({
|
|
11901
|
+
limit: import_zod34.z.number().nonnegative().nullable(),
|
|
11902
|
+
limit_remaining: import_zod34.z.number().nullable(),
|
|
11903
|
+
limit_reset: import_zod34.z.string().nullable(),
|
|
11904
|
+
is_free_tier: import_zod34.z.boolean().optional(),
|
|
11905
|
+
free_model_daily_requests: import_zod34.z.object({ used: import_zod34.z.number().nonnegative(), limit: import_zod34.z.number().nonnegative(), remaining: import_zod34.z.number() }).optional()
|
|
11796
11906
|
})
|
|
11797
11907
|
});
|
|
11798
|
-
OpenRouterCreditsSchema =
|
|
11908
|
+
OpenRouterCreditsSchema = import_zod34.z.object({ data: import_zod34.z.object({ total_credits: import_zod34.z.number().nonnegative(), total_usage: import_zod34.z.number().nonnegative() }) });
|
|
11799
11909
|
ANTIGRAVITY_HOST = "daily-cloudcode-pa.googleapis.com";
|
|
11800
11910
|
ANTIGRAVITY_QUOTA_URL = `https://${ANTIGRAVITY_HOST}/v1internal:retrieveUserQuotaSummary`;
|
|
11801
11911
|
ANTIGRAVITY_USER_URL = `https://${ANTIGRAVITY_HOST}/v1internal:loadCodeAssist`;
|
|
@@ -11803,21 +11913,21 @@ var init_providerQuota = __esm({
|
|
|
11803
11913
|
DAYS_PER_WEEK2 = 7;
|
|
11804
11914
|
FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
11805
11915
|
WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
11806
|
-
AntigravityBucketSchema =
|
|
11807
|
-
bucketId:
|
|
11808
|
-
remainingFraction:
|
|
11809
|
-
resetTime:
|
|
11916
|
+
AntigravityBucketSchema = import_zod34.z.object({
|
|
11917
|
+
bucketId: import_zod34.z.string(),
|
|
11918
|
+
remainingFraction: import_zod34.z.number().optional(),
|
|
11919
|
+
resetTime: import_zod34.z.string().optional()
|
|
11810
11920
|
});
|
|
11811
|
-
AntigravitySummarySchema =
|
|
11812
|
-
GoogleTokenInfoSchema =
|
|
11813
|
-
email:
|
|
11814
|
-
sub:
|
|
11921
|
+
AntigravitySummarySchema = import_zod34.z.object({ groups: import_zod34.z.array(import_zod34.z.object({ buckets: import_zod34.z.array(AntigravityBucketSchema) })) });
|
|
11922
|
+
GoogleTokenInfoSchema = import_zod34.z.object({
|
|
11923
|
+
email: import_zod34.z.string().optional(),
|
|
11924
|
+
sub: import_zod34.z.string().optional()
|
|
11815
11925
|
});
|
|
11816
|
-
AntigravityUserSchema =
|
|
11926
|
+
AntigravityUserSchema = import_zod34.z.object({
|
|
11817
11927
|
/** The code-assist tier context, which defaults to the free tier for every account. */
|
|
11818
|
-
currentTier:
|
|
11928
|
+
currentTier: import_zod34.z.object({ name: import_zod34.z.string().optional(), id: import_zod34.z.string().optional() }).optional(),
|
|
11819
11929
|
/** The account's paid subscription; absent when the account has none. */
|
|
11820
|
-
paidTier:
|
|
11930
|
+
paidTier: import_zod34.z.object({ name: import_zod34.z.string().optional(), id: import_zod34.z.string().optional() }).optional()
|
|
11821
11931
|
});
|
|
11822
11932
|
}
|
|
11823
11933
|
});
|
|
@@ -15100,7 +15210,7 @@ function writePools(paths, pools) {
|
|
|
15100
15210
|
applyPatch(paths.globalConfigFile, GlobalConfigSchema, { pools }, { defaults: {} });
|
|
15101
15211
|
}
|
|
15102
15212
|
function poolCycleOf(pools, name) {
|
|
15103
|
-
const
|
|
15213
|
+
const walk2 = (current, path43) => {
|
|
15104
15214
|
for (const entry of pools[current]?.identities ?? []) {
|
|
15105
15215
|
const nested = poolNameOf(poolMemberIdentity(entry));
|
|
15106
15216
|
if (nested === void 0) {
|
|
@@ -15112,14 +15222,14 @@ function poolCycleOf(pools, name) {
|
|
|
15112
15222
|
if (path43.includes(nested)) {
|
|
15113
15223
|
continue;
|
|
15114
15224
|
}
|
|
15115
|
-
const found =
|
|
15225
|
+
const found = walk2(nested, [...path43, nested]);
|
|
15116
15226
|
if (found !== void 0) {
|
|
15117
15227
|
return found;
|
|
15118
15228
|
}
|
|
15119
15229
|
}
|
|
15120
15230
|
return void 0;
|
|
15121
15231
|
};
|
|
15122
|
-
return
|
|
15232
|
+
return walk2(name, [name]);
|
|
15123
15233
|
}
|
|
15124
15234
|
function validateMembers(pools, name, members) {
|
|
15125
15235
|
for (const entry of members) {
|
|
@@ -15237,7 +15347,7 @@ init_providersStore();
|
|
|
15237
15347
|
init_signIn();
|
|
15238
15348
|
init_realPorts();
|
|
15239
15349
|
var import_node_path27 = __toESM(require("node:path"), 1);
|
|
15240
|
-
var
|
|
15350
|
+
var import_zod18 = require("zod");
|
|
15241
15351
|
init_envBool();
|
|
15242
15352
|
init_load();
|
|
15243
15353
|
init_schema();
|
|
@@ -15317,9 +15427,9 @@ function lookupKeychainService(run, farmRoot) {
|
|
|
15317
15427
|
}
|
|
15318
15428
|
return { checked: true, found: true, serviceName, note: `Keychain service name for this identity: "${serviceName}".` };
|
|
15319
15429
|
}
|
|
15320
|
-
var SettingsSecretsShapeSchema =
|
|
15321
|
-
env:
|
|
15322
|
-
hooks:
|
|
15430
|
+
var SettingsSecretsShapeSchema = import_zod18.z.looseObject({
|
|
15431
|
+
env: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.unknown()).optional(),
|
|
15432
|
+
hooks: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.array(import_zod18.z.unknown())).optional()
|
|
15323
15433
|
});
|
|
15324
15434
|
function hookCommandCountOf(group) {
|
|
15325
15435
|
if (typeof group !== "object" || group === null) {
|
|
@@ -15612,7 +15722,7 @@ function collectCheckReport(params) {
|
|
|
15612
15722
|
}
|
|
15613
15723
|
|
|
15614
15724
|
// src/checkReportSchema.ts
|
|
15615
|
-
var
|
|
15725
|
+
var import_zod20 = require("zod");
|
|
15616
15726
|
init_schema();
|
|
15617
15727
|
init_claudeVersion();
|
|
15618
15728
|
init_identity();
|
|
@@ -15676,124 +15786,124 @@ var DIAGNOSTIC_CODES = [
|
|
|
15676
15786
|
var DIAGNOSTIC_SEVERITIES = ["error", "warning", "info"];
|
|
15677
15787
|
|
|
15678
15788
|
// src/usage/pickReportSchema.ts
|
|
15679
|
-
var
|
|
15789
|
+
var import_zod19 = require("zod");
|
|
15680
15790
|
init_plan2();
|
|
15681
|
-
var PoolPickCandidateViewSchema =
|
|
15682
|
-
identity:
|
|
15791
|
+
var PoolPickCandidateViewSchema = import_zod19.z.strictObject({
|
|
15792
|
+
identity: import_zod19.z.string(),
|
|
15683
15793
|
/** In pick order: `scored` has usable quota data, `unknown` has none, `pay-per-use` bills by use, `ineligible` is refused right now. */
|
|
15684
|
-
class:
|
|
15794
|
+
class: import_zod19.z.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
|
|
15685
15795
|
/** Plan-size-weighted remaining quota per hour until its reset; present for `scored` only. */
|
|
15686
|
-
score:
|
|
15796
|
+
score: import_zod19.z.number().optional(),
|
|
15687
15797
|
/** 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`. */
|
|
15688
|
-
scoreWindow:
|
|
15798
|
+
scoreWindow: import_zod19.z.enum(["sevenDay", "fiveHour"]).optional(),
|
|
15689
15799
|
/** False when the five-hour window would run dry, at the observed pace, before it resets. */
|
|
15690
|
-
feasible:
|
|
15800
|
+
feasible: import_zod19.z.boolean(),
|
|
15691
15801
|
/** When an `ineligible` member can be used again, as an ISO instant. */
|
|
15692
|
-
blockedUntil:
|
|
15802
|
+
blockedUntil: import_zod19.z.iso.datetime().optional(),
|
|
15693
15803
|
plan: PlanClassSchema,
|
|
15694
15804
|
/** The facts behind the class and score, in the order they matter. */
|
|
15695
|
-
reasons:
|
|
15805
|
+
reasons: import_zod19.z.array(import_zod19.z.string())
|
|
15696
15806
|
});
|
|
15697
|
-
var PoolPickReportSchema =
|
|
15698
|
-
pool:
|
|
15699
|
-
directory:
|
|
15807
|
+
var PoolPickReportSchema = import_zod19.z.strictObject({
|
|
15808
|
+
pool: import_zod19.z.string(),
|
|
15809
|
+
directory: import_zod19.z.string(),
|
|
15700
15810
|
/** The member a launch would run as, absent when every member is refused. */
|
|
15701
|
-
pick:
|
|
15702
|
-
candidates:
|
|
15811
|
+
pick: import_zod19.z.string().optional(),
|
|
15812
|
+
candidates: import_zod19.z.array(PoolPickCandidateViewSchema),
|
|
15703
15813
|
/** Identity members anywhere in the pool's graph that do not exist; a launch skips them. */
|
|
15704
|
-
missing:
|
|
15814
|
+
missing: import_zod19.z.array(import_zod19.z.string()),
|
|
15705
15815
|
/** When nothing can be picked, the soonest any member returns. */
|
|
15706
|
-
earliestReturn:
|
|
15816
|
+
earliestReturn: import_zod19.z.strictObject({ identity: import_zod19.z.string(), at: import_zod19.z.iso.datetime() }).optional(),
|
|
15707
15817
|
/** The member a resumed conversation started on but moved off, and why, when the ranking could not keep it. */
|
|
15708
|
-
movedOff:
|
|
15818
|
+
movedOff: import_zod19.z.strictObject({ identity: import_zod19.z.string(), reason: import_zod19.z.string() }).optional(),
|
|
15709
15819
|
/** Why the last-pick record could not be read, when that is the case. */
|
|
15710
|
-
stickyProblem:
|
|
15820
|
+
stickyProblem: import_zod19.z.string().optional()
|
|
15711
15821
|
});
|
|
15712
15822
|
|
|
15713
15823
|
// src/checkReportSchema.ts
|
|
15714
15824
|
var CHECK_CREDENTIAL_APPLIES = ["provider", "identity", "stored-login"];
|
|
15715
|
-
var CheckLayerViewSchema =
|
|
15716
|
-
id:
|
|
15717
|
-
kind:
|
|
15718
|
-
source:
|
|
15825
|
+
var CheckLayerViewSchema = import_zod20.z.strictObject({
|
|
15826
|
+
id: import_zod20.z.int(),
|
|
15827
|
+
kind: import_zod20.z.enum(LAYER_KINDS),
|
|
15828
|
+
source: import_zod20.z.string()
|
|
15719
15829
|
});
|
|
15720
|
-
var CheckEntryViewSchema =
|
|
15721
|
-
path:
|
|
15722
|
-
shared:
|
|
15723
|
-
via:
|
|
15830
|
+
var CheckEntryViewSchema = import_zod20.z.strictObject({
|
|
15831
|
+
path: import_zod20.z.string(),
|
|
15832
|
+
shared: import_zod20.z.boolean(),
|
|
15833
|
+
via: import_zod20.z.enum(DECISION_VIAS),
|
|
15724
15834
|
/** The entry's real category, or null when nothing classifies it. */
|
|
15725
|
-
category:
|
|
15726
|
-
rule:
|
|
15835
|
+
category: import_zod20.z.enum(CATEGORY_NAMES).nullable(),
|
|
15836
|
+
rule: import_zod20.z.strictObject({ key: import_zod20.z.string(), layer: import_zod20.z.int() }).optional(),
|
|
15727
15837
|
/** Rules that matched but whose `when` condition failed, each with the conditions that failed. */
|
|
15728
|
-
eliminated:
|
|
15838
|
+
eliminated: import_zod20.z.readonly(import_zod20.z.array(import_zod20.z.strictObject({ key: import_zod20.z.string(), failed: import_zod20.z.readonly(import_zod20.z.array(import_zod20.z.string())) }))).optional()
|
|
15729
15839
|
});
|
|
15730
|
-
var CheckDiagnosticSchema =
|
|
15731
|
-
code:
|
|
15732
|
-
severity:
|
|
15733
|
-
message:
|
|
15734
|
-
subject:
|
|
15735
|
-
layer:
|
|
15840
|
+
var CheckDiagnosticSchema = import_zod20.z.strictObject({
|
|
15841
|
+
code: import_zod20.z.enum(DIAGNOSTIC_CODES),
|
|
15842
|
+
severity: import_zod20.z.enum(DIAGNOSTIC_SEVERITIES),
|
|
15843
|
+
message: import_zod20.z.string(),
|
|
15844
|
+
subject: import_zod20.z.string().optional(),
|
|
15845
|
+
layer: import_zod20.z.int().optional()
|
|
15736
15846
|
});
|
|
15737
|
-
var CheckAmbientCredentialSchema =
|
|
15738
|
-
var CheckKeychainSchema =
|
|
15739
|
-
checked:
|
|
15740
|
-
found:
|
|
15741
|
-
serviceName:
|
|
15742
|
-
note:
|
|
15847
|
+
var CheckAmbientCredentialSchema = import_zod20.z.union([import_zod20.z.strictObject({ ok: import_zod20.z.literal(true) }), import_zod20.z.strictObject({ ok: import_zod20.z.literal(false), variable: import_zod20.z.string(), message: import_zod20.z.string() })]);
|
|
15848
|
+
var CheckKeychainSchema = import_zod20.z.strictObject({
|
|
15849
|
+
checked: import_zod20.z.literal(true),
|
|
15850
|
+
found: import_zod20.z.boolean(),
|
|
15851
|
+
serviceName: import_zod20.z.string().optional(),
|
|
15852
|
+
note: import_zod20.z.string()
|
|
15743
15853
|
});
|
|
15744
|
-
var CheckSettingsExposureSchema =
|
|
15745
|
-
file:
|
|
15746
|
-
envKeyNames:
|
|
15747
|
-
hookEventNames:
|
|
15748
|
-
hookCommandCount:
|
|
15854
|
+
var CheckSettingsExposureSchema = import_zod20.z.strictObject({
|
|
15855
|
+
file: import_zod20.z.string(),
|
|
15856
|
+
envKeyNames: import_zod20.z.readonly(import_zod20.z.array(import_zod20.z.string())),
|
|
15857
|
+
hookEventNames: import_zod20.z.readonly(import_zod20.z.array(import_zod20.z.string())),
|
|
15858
|
+
hookCommandCount: import_zod20.z.int().nonnegative()
|
|
15749
15859
|
});
|
|
15750
|
-
var CredentialSourceSummarySchema =
|
|
15751
|
-
|
|
15752
|
-
|
|
15753
|
-
|
|
15754
|
-
|
|
15755
|
-
|
|
15756
|
-
|
|
15860
|
+
var CredentialSourceSummarySchema = import_zod20.z.union([
|
|
15861
|
+
import_zod20.z.strictObject({ kind: import_zod20.z.literal("env"), variable: import_zod20.z.string() }),
|
|
15862
|
+
import_zod20.z.strictObject({ kind: import_zod20.z.literal("file"), path: import_zod20.z.string() }),
|
|
15863
|
+
import_zod20.z.strictObject({ kind: import_zod20.z.literal("command"), program: import_zod20.z.string() }),
|
|
15864
|
+
import_zod20.z.strictObject({ kind: import_zod20.z.literal("op"), reference: import_zod20.z.string() }),
|
|
15865
|
+
import_zod20.z.strictObject({ kind: import_zod20.z.literal("keychain"), service: import_zod20.z.string(), account: import_zod20.z.string().optional() }),
|
|
15866
|
+
import_zod20.z.strictObject({ kind: import_zod20.z.literal("literal") })
|
|
15757
15867
|
]);
|
|
15758
|
-
var CredentialSummarySchema =
|
|
15759
|
-
target:
|
|
15760
|
-
sources:
|
|
15868
|
+
var CredentialSummarySchema = import_zod20.z.strictObject({
|
|
15869
|
+
target: import_zod20.z.enum(CREDENTIAL_TARGETS),
|
|
15870
|
+
sources: import_zod20.z.readonly(import_zod20.z.array(CredentialSourceSummarySchema)),
|
|
15761
15871
|
cache: CredentialCacheSchema.optional()
|
|
15762
15872
|
});
|
|
15763
|
-
var CachedCredentialStateSchema =
|
|
15764
|
-
|
|
15765
|
-
|
|
15766
|
-
|
|
15873
|
+
var CachedCredentialStateSchema = import_zod20.z.union([
|
|
15874
|
+
import_zod20.z.strictObject({ store: import_zod20.z.enum(CREDENTIAL_CACHE_STORES), status: import_zod20.z.literal("empty") }),
|
|
15875
|
+
import_zod20.z.strictObject({ store: import_zod20.z.enum(CREDENTIAL_CACHE_STORES), status: import_zod20.z.literal("unreadable"), reason: import_zod20.z.string() }),
|
|
15876
|
+
import_zod20.z.strictObject({ store: import_zod20.z.enum(CREDENTIAL_CACHE_STORES), status: import_zod20.z.enum(["fresh", "expired"]), ageMs: import_zod20.z.number(), expiresInMs: import_zod20.z.number().optional() })
|
|
15767
15877
|
]);
|
|
15768
|
-
var CheckCredentialProviderSchema =
|
|
15769
|
-
|
|
15770
|
-
|
|
15878
|
+
var CheckCredentialProviderSchema = import_zod20.z.union([
|
|
15879
|
+
import_zod20.z.strictObject({ name: import_zod20.z.string(), credential: CredentialSummarySchema.optional(), cached: CachedCredentialStateSchema.optional() }),
|
|
15880
|
+
import_zod20.z.strictObject({ name: import_zod20.z.string(), problem: import_zod20.z.string() })
|
|
15771
15881
|
]);
|
|
15772
|
-
var CheckCredentialSchema =
|
|
15773
|
-
applies:
|
|
15882
|
+
var CheckCredentialSchema = import_zod20.z.strictObject({
|
|
15883
|
+
applies: import_zod20.z.enum(CHECK_CREDENTIAL_APPLIES),
|
|
15774
15884
|
provider: CheckCredentialProviderSchema.optional(),
|
|
15775
15885
|
identity: CredentialSummarySchema.optional(),
|
|
15776
15886
|
identityCached: CachedCredentialStateSchema.optional()
|
|
15777
15887
|
});
|
|
15778
|
-
var CheckClaudeVersionSchema =
|
|
15779
|
-
pinned:
|
|
15780
|
-
highestInstalled:
|
|
15781
|
-
installed:
|
|
15888
|
+
var CheckClaudeVersionSchema = import_zod20.z.strictObject({
|
|
15889
|
+
pinned: import_zod20.z.strictObject({ version: import_zod20.z.string(), source: import_zod20.z.enum(CLAUDE_VERSION_SOURCES), installed: import_zod20.z.boolean() }).optional(),
|
|
15890
|
+
highestInstalled: import_zod20.z.string().optional(),
|
|
15891
|
+
installed: import_zod20.z.readonly(import_zod20.z.array(import_zod20.z.string()))
|
|
15782
15892
|
});
|
|
15783
|
-
var CheckReportJsonSchema =
|
|
15784
|
-
identity:
|
|
15893
|
+
var CheckReportJsonSchema = import_zod20.z.strictObject({
|
|
15894
|
+
identity: import_zod20.z.strictObject({ name: import_zod20.z.string().nullable(), source: import_zod20.z.enum(IDENTITY_DECISION_SOURCES) }),
|
|
15785
15895
|
/** The pool ranking, when the launch named a pool instead of an identity. */
|
|
15786
15896
|
pool: PoolPickReportSchema.optional(),
|
|
15787
|
-
configProfile:
|
|
15788
|
-
layers:
|
|
15789
|
-
entries:
|
|
15790
|
-
projectEncodingAmbiguities:
|
|
15791
|
-
|
|
15897
|
+
configProfile: import_zod20.z.strictObject({ name: import_zod20.z.string().nullable(), source: import_zod20.z.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
|
|
15898
|
+
layers: import_zod20.z.readonly(import_zod20.z.array(CheckLayerViewSchema)),
|
|
15899
|
+
entries: import_zod20.z.readonly(import_zod20.z.array(CheckEntryViewSchema)),
|
|
15900
|
+
projectEncodingAmbiguities: import_zod20.z.readonly(
|
|
15901
|
+
import_zod20.z.array(import_zod20.z.strictObject({ fragment: import_zod20.z.string(), encoded: import_zod20.z.string(), reason: import_zod20.z.enum(ENCODING_AMBIGUITY_REASONS), detail: import_zod20.z.string() }))
|
|
15792
15902
|
),
|
|
15793
|
-
diagnostics:
|
|
15903
|
+
diagnostics: import_zod20.z.readonly(import_zod20.z.array(CheckDiagnosticSchema)),
|
|
15794
15904
|
ambientCredential: CheckAmbientCredentialSchema,
|
|
15795
15905
|
keychain: CheckKeychainSchema.optional(),
|
|
15796
|
-
settingsExposure:
|
|
15906
|
+
settingsExposure: import_zod20.z.readonly(import_zod20.z.array(CheckSettingsExposureSchema)),
|
|
15797
15907
|
credential: CheckCredentialSchema,
|
|
15798
15908
|
claudeVersion: CheckClaudeVersionSchema.optional()
|
|
15799
15909
|
});
|
|
@@ -15853,28 +15963,28 @@ function collectResets(snapshots, nowMs) {
|
|
|
15853
15963
|
}
|
|
15854
15964
|
|
|
15855
15965
|
// src/usage/resetsSchema.ts
|
|
15856
|
-
var
|
|
15857
|
-
var ResetRowSchema =
|
|
15858
|
-
identity:
|
|
15859
|
-
provider:
|
|
15966
|
+
var import_zod21 = require("zod");
|
|
15967
|
+
var ResetRowSchema = import_zod21.z.strictObject({
|
|
15968
|
+
identity: import_zod21.z.string(),
|
|
15969
|
+
provider: import_zod21.z.string(),
|
|
15860
15970
|
/** What the window is: `5h`, `7d` or `extra usage` for an Anthropic account, or the provider's own measure and period (`tokens 5h`). */
|
|
15861
|
-
window:
|
|
15971
|
+
window: import_zod21.z.string(),
|
|
15862
15972
|
/** When the state the window comes from was observed, as an ISO instant. */
|
|
15863
|
-
observedAt:
|
|
15973
|
+
observedAt: import_zod21.z.iso.datetime(),
|
|
15864
15974
|
/** When the window resets, as an ISO instant; absent when the upstream reported none. */
|
|
15865
|
-
resetsAt:
|
|
15975
|
+
resetsAt: import_zod21.z.iso.datetime().optional(),
|
|
15866
15976
|
/** True when the reset time has passed, so the recorded observation describes a window that no longer exists and its utilisation reads as 0. */
|
|
15867
|
-
reset:
|
|
15977
|
+
reset: import_zod21.z.boolean(),
|
|
15868
15978
|
/** The fraction used, as `effectiveWindow` reads it at the report's own clock. */
|
|
15869
|
-
utilization:
|
|
15979
|
+
utilization: import_zod21.z.number().optional(),
|
|
15870
15980
|
/** The window's own status, for a window that has not reset yet. */
|
|
15871
|
-
status:
|
|
15981
|
+
status: import_zod21.z.string().optional()
|
|
15872
15982
|
});
|
|
15873
|
-
var ResetScheduleSchema =
|
|
15983
|
+
var ResetScheduleSchema = import_zod21.z.strictObject({ resets: import_zod21.z.readonly(import_zod21.z.array(ResetRowSchema)) });
|
|
15874
15984
|
|
|
15875
15985
|
// src/frontdoor/controlSchemas.ts
|
|
15876
15986
|
var import_node_path32 = __toESM(require("node:path"), 1);
|
|
15877
|
-
var
|
|
15987
|
+
var import_zod28 = require("zod");
|
|
15878
15988
|
|
|
15879
15989
|
// src/doctorReport.ts
|
|
15880
15990
|
init_claudeShim();
|
|
@@ -16054,24 +16164,24 @@ var import_node_path31 = __toESM(require("node:path"), 1);
|
|
|
16054
16164
|
init_signIn();
|
|
16055
16165
|
|
|
16056
16166
|
// src/codex/siwcStore.ts
|
|
16057
|
-
var
|
|
16167
|
+
var import_zod25 = require("zod");
|
|
16058
16168
|
|
|
16059
16169
|
// src/codex/auth.ts
|
|
16060
|
-
var
|
|
16061
|
-
var AuthFileSchema =
|
|
16062
|
-
tokens:
|
|
16063
|
-
access_token:
|
|
16064
|
-
refresh_token:
|
|
16065
|
-
id_token:
|
|
16066
|
-
account_id:
|
|
16170
|
+
var import_zod23 = require("zod");
|
|
16171
|
+
var AuthFileSchema = import_zod23.z.looseObject({
|
|
16172
|
+
tokens: import_zod23.z.looseObject({
|
|
16173
|
+
access_token: import_zod23.z.string().optional(),
|
|
16174
|
+
refresh_token: import_zod23.z.string().optional(),
|
|
16175
|
+
id_token: import_zod23.z.string().optional(),
|
|
16176
|
+
account_id: import_zod23.z.string().optional()
|
|
16067
16177
|
}).nullish(),
|
|
16068
|
-
last_refresh:
|
|
16178
|
+
last_refresh: import_zod23.z.string().optional()
|
|
16069
16179
|
});
|
|
16070
|
-
var TokenGrantSchema =
|
|
16071
|
-
access_token:
|
|
16072
|
-
refresh_token:
|
|
16073
|
-
id_token:
|
|
16074
|
-
account_id:
|
|
16180
|
+
var TokenGrantSchema = import_zod23.z.looseObject({
|
|
16181
|
+
access_token: import_zod23.z.string().min(1).optional(),
|
|
16182
|
+
refresh_token: import_zod23.z.string().min(1).optional(),
|
|
16183
|
+
id_token: import_zod23.z.string().min(1).optional(),
|
|
16184
|
+
account_id: import_zod23.z.string().min(1).optional()
|
|
16075
16185
|
});
|
|
16076
16186
|
var CodexAuthError = class extends Error {
|
|
16077
16187
|
constructor(message) {
|
|
@@ -16081,41 +16191,41 @@ var CodexAuthError = class extends Error {
|
|
|
16081
16191
|
};
|
|
16082
16192
|
|
|
16083
16193
|
// src/codex/siwc.ts
|
|
16084
|
-
var
|
|
16194
|
+
var import_zod24 = require("zod");
|
|
16085
16195
|
var SIWC_RESOURCE = "https://api.openai.com/v1";
|
|
16086
16196
|
var SIWC_RESPONSES_URL = `${SIWC_RESOURCE}/responses`;
|
|
16087
16197
|
var SIWC_PLAN_SCOPE = "chatgpt.tokens.use.direct";
|
|
16088
|
-
var TokenResponseSchema =
|
|
16089
|
-
access_token:
|
|
16090
|
-
refresh_token:
|
|
16091
|
-
id_token:
|
|
16092
|
-
expires_in:
|
|
16093
|
-
scope:
|
|
16198
|
+
var TokenResponseSchema = import_zod24.z.looseObject({
|
|
16199
|
+
access_token: import_zod24.z.string().min(1),
|
|
16200
|
+
refresh_token: import_zod24.z.string().min(1).optional(),
|
|
16201
|
+
id_token: import_zod24.z.string().min(1).optional(),
|
|
16202
|
+
expires_in: import_zod24.z.number().positive(),
|
|
16203
|
+
scope: import_zod24.z.string().optional()
|
|
16094
16204
|
});
|
|
16095
|
-
var JwtHeaderSchema =
|
|
16096
|
-
var IdTokenClaimsSchema =
|
|
16097
|
-
iss:
|
|
16098
|
-
sub:
|
|
16099
|
-
aud:
|
|
16100
|
-
exp:
|
|
16101
|
-
nonce:
|
|
16102
|
-
email:
|
|
16205
|
+
var JwtHeaderSchema = import_zod24.z.looseObject({ alg: import_zod24.z.string(), kid: import_zod24.z.string().optional() });
|
|
16206
|
+
var IdTokenClaimsSchema = import_zod24.z.looseObject({
|
|
16207
|
+
iss: import_zod24.z.string(),
|
|
16208
|
+
sub: import_zod24.z.string().min(1),
|
|
16209
|
+
aud: import_zod24.z.union([import_zod24.z.string(), import_zod24.z.array(import_zod24.z.string())]),
|
|
16210
|
+
exp: import_zod24.z.number(),
|
|
16211
|
+
nonce: import_zod24.z.string().optional(),
|
|
16212
|
+
email: import_zod24.z.string().optional()
|
|
16103
16213
|
});
|
|
16104
|
-
var JwksSchema =
|
|
16214
|
+
var JwksSchema = import_zod24.z.object({ keys: import_zod24.z.array(import_zod24.z.looseObject({ kid: import_zod24.z.string().optional(), kty: import_zod24.z.string() })) });
|
|
16105
16215
|
|
|
16106
16216
|
// src/codex/siwcStore.ts
|
|
16107
|
-
var SiwcGrantSchema =
|
|
16108
|
-
clientId:
|
|
16109
|
-
sub:
|
|
16110
|
-
email:
|
|
16111
|
-
idToken:
|
|
16112
|
-
accessToken:
|
|
16113
|
-
refreshToken:
|
|
16114
|
-
scopes:
|
|
16217
|
+
var SiwcGrantSchema = import_zod25.z.strictObject({
|
|
16218
|
+
clientId: import_zod25.z.string().min(1),
|
|
16219
|
+
sub: import_zod25.z.string().min(1),
|
|
16220
|
+
email: import_zod25.z.string().optional(),
|
|
16221
|
+
idToken: import_zod25.z.string().min(1),
|
|
16222
|
+
accessToken: import_zod25.z.string().min(1),
|
|
16223
|
+
refreshToken: import_zod25.z.string().min(1),
|
|
16224
|
+
scopes: import_zod25.z.array(import_zod25.z.string()).readonly(),
|
|
16115
16225
|
/** When the access token stops working, in milliseconds since the epoch. */
|
|
16116
|
-
expiresAt:
|
|
16226
|
+
expiresAt: import_zod25.z.number()
|
|
16117
16227
|
});
|
|
16118
|
-
var SiwcFileSchema =
|
|
16228
|
+
var SiwcFileSchema = import_zod25.z.strictObject({ registeredClientId: import_zod25.z.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
|
|
16119
16229
|
function parseSiwcFile(raw, filePath) {
|
|
16120
16230
|
let json;
|
|
16121
16231
|
try {
|
|
@@ -17079,92 +17189,92 @@ function collectDoctorReport(params) {
|
|
|
17079
17189
|
// src/frontdoor/controlSchemas.ts
|
|
17080
17190
|
init_schema2();
|
|
17081
17191
|
init_state();
|
|
17082
|
-
var UsageListOutputSchema =
|
|
17083
|
-
var UsageWindowsInputSchema =
|
|
17084
|
-
identity:
|
|
17085
|
-
provider:
|
|
17192
|
+
var UsageListOutputSchema = import_zod28.z.strictObject({ snapshots: import_zod28.z.readonly(import_zod28.z.array(UsageSnapshotSchema)) });
|
|
17193
|
+
var UsageWindowsInputSchema = import_zod28.z.strictObject({
|
|
17194
|
+
identity: import_zod28.z.string().min(1),
|
|
17195
|
+
provider: import_zod28.z.string().min(1).optional()
|
|
17086
17196
|
});
|
|
17087
|
-
var EffectiveWindowSchema =
|
|
17197
|
+
var EffectiveWindowSchema = import_zod28.z.strictObject({
|
|
17088
17198
|
/** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
|
|
17089
|
-
reset:
|
|
17199
|
+
reset: import_zod28.z.boolean(),
|
|
17090
17200
|
/** The fraction used: 0 for a reset window, otherwise what was last observed, absent when none was reported. */
|
|
17091
|
-
utilization:
|
|
17201
|
+
utilization: import_zod28.z.number().optional(),
|
|
17092
17202
|
/** The reset instant, for a window that has not reset yet and reported one. */
|
|
17093
|
-
resetsAtMs:
|
|
17203
|
+
resetsAtMs: import_zod28.z.number().optional(),
|
|
17094
17204
|
/** The window's own status, for a window that has not reset yet. */
|
|
17095
|
-
status:
|
|
17205
|
+
status: import_zod28.z.string().optional()
|
|
17096
17206
|
});
|
|
17097
|
-
var UsageWindowsOutputSchema =
|
|
17098
|
-
identity:
|
|
17099
|
-
provider:
|
|
17207
|
+
var UsageWindowsOutputSchema = import_zod28.z.strictObject({
|
|
17208
|
+
identity: import_zod28.z.string(),
|
|
17209
|
+
provider: import_zod28.z.string(),
|
|
17100
17210
|
/** When the rate-limit state the windows come from was observed. */
|
|
17101
|
-
observedAt:
|
|
17211
|
+
observedAt: import_zod28.z.iso.datetime().optional(),
|
|
17102
17212
|
fiveHour: EffectiveWindowSchema.optional(),
|
|
17103
17213
|
sevenDay: EffectiveWindowSchema.optional()
|
|
17104
17214
|
});
|
|
17105
|
-
var UsageLiveOutputSchema =
|
|
17215
|
+
var UsageLiveOutputSchema = import_zod28.z.strictObject({
|
|
17106
17216
|
/** 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. */
|
|
17107
17217
|
latest: RcLiveRateLimitSchema.optional(),
|
|
17108
17218
|
/** One observation per session whose stream has filed a rate_limit_event this door generation. */
|
|
17109
|
-
sessions:
|
|
17219
|
+
sessions: import_zod28.z.readonly(import_zod28.z.array(RcLiveRateLimitSchema))
|
|
17110
17220
|
});
|
|
17111
|
-
var FrontDoorSessionStatusSchema =
|
|
17112
|
-
pid:
|
|
17113
|
-
startedAt:
|
|
17114
|
-
alive:
|
|
17221
|
+
var FrontDoorSessionStatusSchema = import_zod28.z.strictObject({
|
|
17222
|
+
pid: import_zod28.z.int().positive(),
|
|
17223
|
+
startedAt: import_zod28.z.number(),
|
|
17224
|
+
alive: import_zod28.z.boolean()
|
|
17115
17225
|
});
|
|
17116
|
-
var HeadroomSocketTargetSchema =
|
|
17117
|
-
var FrontDoorStatusOutputSchema =
|
|
17226
|
+
var HeadroomSocketTargetSchema = import_zod28.z.union([import_zod28.z.strictObject({ socketPath: import_zod28.z.string() }), import_zod28.z.strictObject({ refused: import_zod28.z.string() })]);
|
|
17227
|
+
var FrontDoorStatusOutputSchema = import_zod28.z.strictObject({
|
|
17118
17228
|
state: FrontDoorStateSchema,
|
|
17119
|
-
supervisorAlive:
|
|
17229
|
+
supervisorAlive: import_zod28.z.boolean(),
|
|
17120
17230
|
/** The pids of earlier doors that released their addresses and are finishing the connections they carried: running, but not serving anything new. */
|
|
17121
|
-
draining:
|
|
17122
|
-
sessions:
|
|
17231
|
+
draining: import_zod28.z.readonly(import_zod28.z.array(import_zod28.z.number().int().positive())),
|
|
17232
|
+
sessions: import_zod28.z.readonly(import_zod28.z.array(FrontDoorSessionStatusSchema)),
|
|
17123
17233
|
headroomSocket: HeadroomSocketTargetSchema.optional(),
|
|
17124
|
-
logPath:
|
|
17125
|
-
logExists:
|
|
17234
|
+
logPath: import_zod28.z.string(),
|
|
17235
|
+
logExists: import_zod28.z.boolean()
|
|
17126
17236
|
});
|
|
17127
|
-
var FrontDoorSessionsOutputSchema =
|
|
17128
|
-
var CheckRunInputSchema =
|
|
17129
|
-
path:
|
|
17130
|
-
identity:
|
|
17237
|
+
var FrontDoorSessionsOutputSchema = import_zod28.z.strictObject({ sessions: import_zod28.z.readonly(import_zod28.z.array(FrontDoorSessionStatusSchema)) });
|
|
17238
|
+
var CheckRunInputSchema = import_zod28.z.strictObject({
|
|
17239
|
+
path: import_zod28.z.string().min(1),
|
|
17240
|
+
identity: import_zod28.z.string().min(1).optional()
|
|
17131
17241
|
}).refine((input) => import_node_path32.default.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
17132
|
-
var PoolPickInputSchema =
|
|
17133
|
-
pool:
|
|
17134
|
-
path:
|
|
17242
|
+
var PoolPickInputSchema = import_zod28.z.strictObject({
|
|
17243
|
+
pool: import_zod28.z.string().min(1),
|
|
17244
|
+
path: import_zod28.z.string().min(1)
|
|
17135
17245
|
}).refine((input) => import_node_path32.default.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
17136
|
-
var DoctorFindingSchema =
|
|
17137
|
-
section:
|
|
17138
|
-
subject:
|
|
17139
|
-
severity:
|
|
17140
|
-
message:
|
|
17246
|
+
var DoctorFindingSchema = import_zod28.z.strictObject({
|
|
17247
|
+
section: import_zod28.z.enum(DOCTOR_SECTIONS),
|
|
17248
|
+
subject: import_zod28.z.string().optional(),
|
|
17249
|
+
severity: import_zod28.z.enum(DOCTOR_SEVERITIES),
|
|
17250
|
+
message: import_zod28.z.string()
|
|
17141
17251
|
});
|
|
17142
|
-
var DoctorRunOutputSchema =
|
|
17252
|
+
var DoctorRunOutputSchema = import_zod28.z.strictObject({
|
|
17143
17253
|
/** False exactly when any finding is a `fail`; a `warn` never fails the report on its own. */
|
|
17144
|
-
ok:
|
|
17145
|
-
findings:
|
|
17254
|
+
ok: import_zod28.z.boolean(),
|
|
17255
|
+
findings: import_zod28.z.readonly(import_zod28.z.array(DoctorFindingSchema))
|
|
17146
17256
|
});
|
|
17147
|
-
var FrontDoorRestartOutputSchema =
|
|
17148
|
-
action:
|
|
17149
|
-
previousPid:
|
|
17257
|
+
var FrontDoorRestartOutputSchema = import_zod28.z.strictObject({
|
|
17258
|
+
action: import_zod28.z.literal("restarting"),
|
|
17259
|
+
previousPid: import_zod28.z.int().positive()
|
|
17150
17260
|
});
|
|
17151
|
-
var UpdateCheckOutputSchema =
|
|
17152
|
-
current:
|
|
17153
|
-
latest:
|
|
17154
|
-
action:
|
|
17261
|
+
var UpdateCheckOutputSchema = import_zod28.z.strictObject({
|
|
17262
|
+
current: import_zod28.z.string(),
|
|
17263
|
+
latest: import_zod28.z.string(),
|
|
17264
|
+
action: import_zod28.z.enum(["current", "available", "updated"])
|
|
17155
17265
|
});
|
|
17156
|
-
var CodexSignInSchema =
|
|
17157
|
-
|
|
17158
|
-
|
|
17159
|
-
|
|
17266
|
+
var CodexSignInSchema = import_zod28.z.discriminatedUnion("state", [
|
|
17267
|
+
import_zod28.z.strictObject({ state: import_zod28.z.literal("none") }),
|
|
17268
|
+
import_zod28.z.strictObject({ state: import_zod28.z.literal("signed-in"), email: import_zod28.z.string().optional(), planScope: import_zod28.z.boolean(), accessTokenExpiresAt: import_zod28.z.number() }),
|
|
17269
|
+
import_zod28.z.strictObject({ state: import_zod28.z.literal("unreadable"), message: import_zod28.z.string() })
|
|
17160
17270
|
]);
|
|
17161
|
-
var CodexStatusOutputSchema =
|
|
17271
|
+
var CodexStatusOutputSchema = import_zod28.z.strictObject({
|
|
17162
17272
|
signIn: CodexSignInSchema,
|
|
17163
|
-
codexProviders:
|
|
17273
|
+
codexProviders: import_zod28.z.readonly(import_zod28.z.array(import_zod28.z.string()))
|
|
17164
17274
|
});
|
|
17165
|
-
var CodexLogoutOutputSchema =
|
|
17166
|
-
hadGrant:
|
|
17167
|
-
revoked:
|
|
17275
|
+
var CodexLogoutOutputSchema = import_zod28.z.strictObject({
|
|
17276
|
+
hadGrant: import_zod28.z.boolean(),
|
|
17277
|
+
revoked: import_zod28.z.boolean()
|
|
17168
17278
|
});
|
|
17169
17279
|
|
|
17170
17280
|
// src/frontdoor/codexApi.ts
|
|
@@ -17322,146 +17432,148 @@ init_identity();
|
|
|
17322
17432
|
init_providersStore();
|
|
17323
17433
|
|
|
17324
17434
|
// src/frontdoor/configSchemas.ts
|
|
17325
|
-
var
|
|
17435
|
+
var import_zod29 = require("zod");
|
|
17326
17436
|
init_schema();
|
|
17327
|
-
|
|
17328
|
-
var
|
|
17329
|
-
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
cache: import_zod28.z.union([import_zod28.z.literal(false), CredentialCacheSchema]).optional()
|
|
17437
|
+
var RemovalConfirmationSchema = import_zod29.z.boolean();
|
|
17438
|
+
var CredentialWriteSchema = (targets) => import_zod29.z.strictObject({
|
|
17439
|
+
sources: import_zod29.z.array(RemoteCredentialSourceSchema).min(1).optional(),
|
|
17440
|
+
target: import_zod29.z.enum(targets).optional(),
|
|
17441
|
+
cache: import_zod29.z.union([import_zod29.z.literal(false), CredentialCacheSchema]).optional()
|
|
17333
17442
|
});
|
|
17334
|
-
var CredentialSummarySchema2 =
|
|
17335
|
-
target:
|
|
17336
|
-
sources:
|
|
17337
|
-
|
|
17338
|
-
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17443
|
+
var CredentialSummarySchema2 = import_zod29.z.strictObject({
|
|
17444
|
+
target: import_zod29.z.enum(CREDENTIAL_TARGETS),
|
|
17445
|
+
sources: import_zod29.z.readonly(import_zod29.z.array(
|
|
17446
|
+
import_zod29.z.discriminatedUnion("kind", [
|
|
17447
|
+
import_zod29.z.strictObject({ kind: import_zod29.z.literal("env"), variable: import_zod29.z.string() }),
|
|
17448
|
+
import_zod29.z.strictObject({ kind: import_zod29.z.literal("file"), path: import_zod29.z.string() }),
|
|
17449
|
+
import_zod29.z.strictObject({ kind: import_zod29.z.literal("command"), program: import_zod29.z.string() }),
|
|
17450
|
+
import_zod29.z.strictObject({ kind: import_zod29.z.literal("op"), reference: import_zod29.z.string() }),
|
|
17451
|
+
import_zod29.z.strictObject({ kind: import_zod29.z.literal("keychain"), service: import_zod29.z.string(), account: import_zod29.z.string().optional() }),
|
|
17452
|
+
import_zod29.z.strictObject({ kind: import_zod29.z.literal("literal") })
|
|
17344
17453
|
])
|
|
17345
17454
|
)),
|
|
17346
17455
|
cache: CredentialCacheSchema.optional()
|
|
17347
17456
|
});
|
|
17348
|
-
var mutationOutput = (kind, action) =>
|
|
17349
|
-
var storedMutationOutput = (kind, action, value) =>
|
|
17350
|
-
var IdentityValueSchema =
|
|
17351
|
-
name:
|
|
17352
|
-
defaultConfigProfile:
|
|
17353
|
-
allowAmbientCredential:
|
|
17457
|
+
var mutationOutput = (kind, action) => import_zod29.z.strictObject({ action: import_zod29.z.literal(action), kind: import_zod29.z.literal(kind), name: import_zod29.z.string() });
|
|
17458
|
+
var storedMutationOutput = (kind, action, value) => import_zod29.z.strictObject({ action: import_zod29.z.literal(action), kind: import_zod29.z.literal(kind), name: import_zod29.z.string(), value });
|
|
17459
|
+
var IdentityValueSchema = import_zod29.z.strictObject({
|
|
17460
|
+
name: import_zod29.z.string(),
|
|
17461
|
+
defaultConfigProfile: import_zod29.z.string().optional(),
|
|
17462
|
+
allowAmbientCredential: import_zod29.z.boolean(),
|
|
17354
17463
|
credential: CredentialSummarySchema2.optional(),
|
|
17355
|
-
anchors:
|
|
17464
|
+
anchors: import_zod29.z.array(AnchorSchema).optional()
|
|
17356
17465
|
});
|
|
17357
17466
|
var ProfileValueSchema = ConfigProfileSchema.omit({ $schema: true });
|
|
17358
|
-
var ProviderValueSchema =
|
|
17359
|
-
name:
|
|
17360
|
-
kind:
|
|
17361
|
-
displayName:
|
|
17362
|
-
baseUrl:
|
|
17467
|
+
var ProviderValueSchema = import_zod29.z.strictObject({
|
|
17468
|
+
name: import_zod29.z.string(),
|
|
17469
|
+
kind: import_zod29.z.enum(PROVIDER_KINDS),
|
|
17470
|
+
displayName: import_zod29.z.string(),
|
|
17471
|
+
baseUrl: import_zod29.z.string().optional(),
|
|
17363
17472
|
codex: CodexProviderConfigSchema.optional(),
|
|
17364
17473
|
credential: CredentialSummarySchema2.optional(),
|
|
17365
|
-
env:
|
|
17474
|
+
env: import_zod29.z.record(import_zod29.z.string(), import_zod29.z.string()).optional()
|
|
17366
17475
|
});
|
|
17367
|
-
var ConfigNameInputSchema =
|
|
17476
|
+
var ConfigNameInputSchema = import_zod29.z.strictObject({ name: import_zod29.z.string().min(1) });
|
|
17368
17477
|
var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
|
|
17369
|
-
var ConfigIdentitySetInputSchema =
|
|
17370
|
-
name:
|
|
17371
|
-
defaultConfigProfile:
|
|
17372
|
-
allowAmbientCredential:
|
|
17373
|
-
credential:
|
|
17478
|
+
var ConfigIdentitySetInputSchema = import_zod29.z.strictObject({
|
|
17479
|
+
name: import_zod29.z.string().min(1),
|
|
17480
|
+
defaultConfigProfile: import_zod29.z.union([import_zod29.z.string().min(1), import_zod29.z.literal(false)]).optional(),
|
|
17481
|
+
allowAmbientCredential: import_zod29.z.boolean().optional(),
|
|
17482
|
+
credential: import_zod29.z.union([import_zod29.z.literal(false), CredentialWriteSchema(CREDENTIAL_TARGETS)]).optional(),
|
|
17374
17483
|
/** `false` removes the anchors; a list replaces them. */
|
|
17375
|
-
anchors:
|
|
17484
|
+
anchors: import_zod29.z.union([import_zod29.z.literal(false), import_zod29.z.array(AnchorSchema).min(1)]).optional()
|
|
17376
17485
|
});
|
|
17377
17486
|
var ConfigIdentitySetOutputSchema = storedMutationOutput("identity", "updated", IdentityValueSchema);
|
|
17378
|
-
var ConfigIdentityRemoveInputSchema =
|
|
17487
|
+
var ConfigIdentityRemoveInputSchema = import_zod29.z.strictObject({ name: import_zod29.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
17379
17488
|
var ConfigIdentityRemoveOutputSchema = mutationOutput("identity", "removed");
|
|
17380
17489
|
var ConfigIdentityUseOutputSchema = mutationOutput("identity", "selected");
|
|
17381
|
-
var ConfigProfileAddInputSchema =
|
|
17382
|
-
name:
|
|
17383
|
-
extends:
|
|
17384
|
-
description:
|
|
17490
|
+
var ConfigProfileAddInputSchema = import_zod29.z.strictObject({
|
|
17491
|
+
name: import_zod29.z.string().min(1),
|
|
17492
|
+
extends: import_zod29.z.array(import_zod29.z.string().min(1)).optional(),
|
|
17493
|
+
description: import_zod29.z.string().optional()
|
|
17385
17494
|
});
|
|
17386
17495
|
var ConfigProfileAddOutputSchema = storedMutationOutput("profile", "created", ProfileValueSchema);
|
|
17387
|
-
var ConfigProfileSetInputSchema =
|
|
17388
|
-
name:
|
|
17389
|
-
category:
|
|
17390
|
-
entry:
|
|
17391
|
-
extends:
|
|
17392
|
-
description:
|
|
17393
|
-
launch:
|
|
17394
|
-
skipPermissions:
|
|
17395
|
-
remoteControl:
|
|
17396
|
-
headroom:
|
|
17397
|
-
trackUsage:
|
|
17398
|
-
provider:
|
|
17399
|
-
claudeVersion:
|
|
17400
|
-
delay:
|
|
17401
|
-
pause:
|
|
17402
|
-
explain:
|
|
17403
|
-
proxyBypass:
|
|
17404
|
-
statusline:
|
|
17496
|
+
var ConfigProfileSetInputSchema = import_zod29.z.strictObject({
|
|
17497
|
+
name: import_zod29.z.string().min(1),
|
|
17498
|
+
category: import_zod29.z.record(import_zod29.z.string(), import_zod29.z.boolean()).optional(),
|
|
17499
|
+
entry: import_zod29.z.record(import_zod29.z.string(), import_zod29.z.boolean()).optional(),
|
|
17500
|
+
extends: import_zod29.z.union([import_zod29.z.array(import_zod29.z.string().min(1)), import_zod29.z.literal(false)]).optional(),
|
|
17501
|
+
description: import_zod29.z.union([import_zod29.z.string(), import_zod29.z.literal(false)]).optional(),
|
|
17502
|
+
launch: import_zod29.z.strictObject({
|
|
17503
|
+
skipPermissions: import_zod29.z.boolean().optional(),
|
|
17504
|
+
remoteControl: import_zod29.z.boolean().optional(),
|
|
17505
|
+
headroom: import_zod29.z.boolean().optional(),
|
|
17506
|
+
trackUsage: import_zod29.z.boolean().optional(),
|
|
17507
|
+
provider: import_zod29.z.union([import_zod29.z.string().min(1), import_zod29.z.literal(false)]).optional(),
|
|
17508
|
+
claudeVersion: import_zod29.z.union([import_zod29.z.string().min(1), import_zod29.z.literal(false)]).optional(),
|
|
17509
|
+
delay: import_zod29.z.union([import_zod29.z.string().regex(DURATION_RE), import_zod29.z.literal(false)]).optional(),
|
|
17510
|
+
pause: import_zod29.z.boolean().optional(),
|
|
17511
|
+
explain: import_zod29.z.boolean().optional(),
|
|
17512
|
+
proxyBypass: import_zod29.z.union([import_zod29.z.array(import_zod29.z.string().min(1)), import_zod29.z.literal(false)]).optional(),
|
|
17513
|
+
statusline: import_zod29.z.strictObject({
|
|
17514
|
+
set: import_zod29.z.record(import_zod29.z.string(), import_zod29.z.unknown()).optional(),
|
|
17515
|
+
unset: import_zod29.z.array(import_zod29.z.string()).optional()
|
|
17516
|
+
}).optional()
|
|
17405
17517
|
}).optional()
|
|
17406
17518
|
});
|
|
17407
17519
|
var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
|
|
17408
|
-
var ConfigProfileRemoveInputSchema =
|
|
17520
|
+
var ConfigProfileRemoveInputSchema = import_zod29.z.strictObject({ name: import_zod29.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
17409
17521
|
var ConfigProfileRemoveOutputSchema = mutationOutput("profile", "removed");
|
|
17410
17522
|
var ConfigProfileUseOutputSchema = mutationOutput("profile", "selected");
|
|
17411
|
-
var PoolMembersInputSchema =
|
|
17412
|
-
var ConfigPoolAddInputSchema =
|
|
17413
|
-
name:
|
|
17523
|
+
var PoolMembersInputSchema = import_zod29.z.array(import_zod29.z.string().min(1)).min(1);
|
|
17524
|
+
var ConfigPoolAddInputSchema = import_zod29.z.strictObject({
|
|
17525
|
+
name: import_zod29.z.string().min(1),
|
|
17414
17526
|
identities: PoolMembersInputSchema,
|
|
17415
|
-
preference:
|
|
17416
|
-
resumeOnLimit:
|
|
17417
|
-
compactBeforeLimit:
|
|
17527
|
+
preference: import_zod29.z.enum(POOL_PREFERENCES).optional(),
|
|
17528
|
+
resumeOnLimit: import_zod29.z.boolean().optional(),
|
|
17529
|
+
compactBeforeLimit: import_zod29.z.boolean().optional(),
|
|
17418
17530
|
compactAtUtilisation: CompactAtUtilisationSchema.optional()
|
|
17419
17531
|
});
|
|
17420
17532
|
var ConfigPoolAddOutputSchema = storedMutationOutput("pool", "created", PoolSchema);
|
|
17421
|
-
var ConfigPoolSetInputSchema =
|
|
17422
|
-
name:
|
|
17533
|
+
var ConfigPoolSetInputSchema = import_zod29.z.strictObject({
|
|
17534
|
+
name: import_zod29.z.string().min(1),
|
|
17423
17535
|
identities: PoolMembersInputSchema.optional(),
|
|
17424
|
-
preference:
|
|
17425
|
-
resumeOnLimit:
|
|
17426
|
-
compactBeforeLimit:
|
|
17427
|
-
compactAtUtilisation:
|
|
17536
|
+
preference: import_zod29.z.union([import_zod29.z.enum(POOL_PREFERENCES), import_zod29.z.literal(false)]).optional(),
|
|
17537
|
+
resumeOnLimit: import_zod29.z.boolean().optional(),
|
|
17538
|
+
compactBeforeLimit: import_zod29.z.boolean().optional(),
|
|
17539
|
+
compactAtUtilisation: import_zod29.z.union([CompactAtUtilisationSchema, import_zod29.z.literal(false)]).optional()
|
|
17428
17540
|
});
|
|
17429
17541
|
var ConfigPoolSetOutputSchema = storedMutationOutput("pool", "updated", PoolSchema);
|
|
17430
|
-
var ConfigPoolRemoveInputSchema =
|
|
17542
|
+
var ConfigPoolRemoveInputSchema = import_zod29.z.strictObject({ name: import_zod29.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
17431
17543
|
var ConfigPoolRemoveOutputSchema = mutationOutput("pool", "removed");
|
|
17432
17544
|
var ConfigPoolUseOutputSchema = mutationOutput("pool", "selected");
|
|
17433
|
-
var ConfigProviderAddInputSchema =
|
|
17434
|
-
name:
|
|
17435
|
-
kind:
|
|
17436
|
-
displayName:
|
|
17437
|
-
baseUrl:
|
|
17545
|
+
var ConfigProviderAddInputSchema = import_zod29.z.strictObject({
|
|
17546
|
+
name: import_zod29.z.string().min(1),
|
|
17547
|
+
kind: import_zod29.z.enum(PROVIDER_KINDS).optional(),
|
|
17548
|
+
displayName: import_zod29.z.string().min(1),
|
|
17549
|
+
baseUrl: import_zod29.z.string().min(1).optional(),
|
|
17438
17550
|
credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).required({ sources: true }),
|
|
17439
17551
|
codex: CodexProviderConfigSchema.optional()
|
|
17440
17552
|
});
|
|
17441
17553
|
var ConfigProviderAddOutputSchema = storedMutationOutput("provider", "created", ProviderValueSchema);
|
|
17442
|
-
var ConfigProviderSetInputSchema =
|
|
17443
|
-
name:
|
|
17444
|
-
displayName:
|
|
17445
|
-
baseUrl:
|
|
17554
|
+
var ConfigProviderSetInputSchema = import_zod29.z.strictObject({
|
|
17555
|
+
name: import_zod29.z.string().min(1),
|
|
17556
|
+
displayName: import_zod29.z.string().min(1).optional(),
|
|
17557
|
+
baseUrl: import_zod29.z.string().min(1).optional(),
|
|
17446
17558
|
credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).optional(),
|
|
17447
17559
|
codex: CodexProviderConfigSchema.optional()
|
|
17448
17560
|
});
|
|
17449
17561
|
var ConfigProviderSetOutputSchema = storedMutationOutput("provider", "updated", ProviderValueSchema);
|
|
17450
|
-
var ConfigProviderRemoveInputSchema =
|
|
17562
|
+
var ConfigProviderRemoveInputSchema = import_zod29.z.strictObject({ name: import_zod29.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
17451
17563
|
var ConfigProviderRemoveOutputSchema = mutationOutput("provider", "removed");
|
|
17452
|
-
var ConfigRuleAddInputSchema =
|
|
17453
|
-
path:
|
|
17454
|
-
configProfile:
|
|
17455
|
-
identity:
|
|
17564
|
+
var ConfigRuleAddInputSchema = import_zod29.z.strictObject({
|
|
17565
|
+
path: import_zod29.z.string().min(1),
|
|
17566
|
+
configProfile: import_zod29.z.string().min(1).optional(),
|
|
17567
|
+
identity: import_zod29.z.string().min(1).optional()
|
|
17456
17568
|
});
|
|
17457
17569
|
var ConfigRuleAddOutputSchema = storedMutationOutput("rule", "created", DirectoryRuleSchema);
|
|
17458
|
-
var ConfigRuleSetInputSchema =
|
|
17459
|
-
path:
|
|
17460
|
-
configProfile:
|
|
17461
|
-
identity:
|
|
17570
|
+
var ConfigRuleSetInputSchema = import_zod29.z.strictObject({
|
|
17571
|
+
path: import_zod29.z.string().min(1),
|
|
17572
|
+
configProfile: import_zod29.z.union([import_zod29.z.string().min(1), import_zod29.z.literal(false)]).optional(),
|
|
17573
|
+
identity: import_zod29.z.union([import_zod29.z.string().min(1), import_zod29.z.literal(false)]).optional()
|
|
17462
17574
|
});
|
|
17463
17575
|
var ConfigRuleSetOutputSchema = storedMutationOutput("rule", "updated", DirectoryRuleSchema);
|
|
17464
|
-
var ConfigRuleRemoveInputSchema =
|
|
17576
|
+
var ConfigRuleRemoveInputSchema = import_zod29.z.strictObject({ path: import_zod29.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
17465
17577
|
var ConfigRuleRemoveOutputSchema = mutationOutput("rule", "removed");
|
|
17466
17578
|
|
|
17467
17579
|
// src/frontdoor/configApi.ts
|
|
@@ -17774,43 +17886,43 @@ var import_openapi4 = require("@orpc/openapi");
|
|
|
17774
17886
|
var import_server3 = require("@orpc/server");
|
|
17775
17887
|
|
|
17776
17888
|
// src/frontdoor/eventSchemas.ts
|
|
17777
|
-
var
|
|
17889
|
+
var import_zod30 = require("zod");
|
|
17778
17890
|
var DOOR_EVENT_SOURCE_RC = "rc";
|
|
17779
17891
|
var LAUNCH_EVENT_SOURCE = "launch";
|
|
17780
17892
|
var USAGE_EVENT_SOURCE = "usage";
|
|
17781
17893
|
var DOOR_HEALTH_EVENT_SOURCE = "door";
|
|
17782
17894
|
var QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
|
|
17783
|
-
var DoorEventSchema =
|
|
17784
|
-
source:
|
|
17895
|
+
var DoorEventSchema = import_zod30.z.strictObject({
|
|
17896
|
+
source: import_zod30.z.string().min(1),
|
|
17785
17897
|
/** A positive integer because the backbone's counters start at one and only ever increase. */
|
|
17786
|
-
sequence:
|
|
17787
|
-
payload:
|
|
17898
|
+
sequence: import_zod30.z.number().int().positive(),
|
|
17899
|
+
payload: import_zod30.z.unknown()
|
|
17788
17900
|
});
|
|
17789
|
-
var DoorEventSourceQuerySchema =
|
|
17790
|
-
sources:
|
|
17901
|
+
var DoorEventSourceQuerySchema = import_zod30.z.strictObject({
|
|
17902
|
+
sources: import_zod30.z.array(import_zod30.z.string().min(1)).min(1).optional()
|
|
17791
17903
|
});
|
|
17792
|
-
var LaunchLifecycleEventSchema =
|
|
17793
|
-
kind:
|
|
17794
|
-
pid:
|
|
17795
|
-
startedAt:
|
|
17796
|
-
observedAt:
|
|
17904
|
+
var LaunchLifecycleEventSchema = import_zod30.z.strictObject({
|
|
17905
|
+
kind: import_zod30.z.enum(["registered", "pruned", "ended"]),
|
|
17906
|
+
pid: import_zod30.z.number().int().positive(),
|
|
17907
|
+
startedAt: import_zod30.z.number(),
|
|
17908
|
+
observedAt: import_zod30.z.number()
|
|
17797
17909
|
});
|
|
17798
|
-
var DoorHealthEventSchema =
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
|
|
17802
|
-
|
|
17803
|
-
|
|
17804
|
-
|
|
17910
|
+
var DoorHealthEventSchema = import_zod30.z.discriminatedUnion("kind", [
|
|
17911
|
+
import_zod30.z.strictObject({ kind: import_zod30.z.literal("generation"), pid: import_zod30.z.number().int().positive(), providerPort: import_zod30.z.number().int().positive(), connectPort: import_zod30.z.number().int().positive(), directPort: import_zod30.z.number().int().positive(), observedAt: import_zod30.z.number() }),
|
|
17912
|
+
import_zod30.z.strictObject({ kind: import_zod30.z.literal("listenerFailed"), pid: import_zod30.z.number().int().positive(), listener: import_zod30.z.enum(["provider", "connect", "direct"]), message: import_zod30.z.string(), observedAt: import_zod30.z.number() }),
|
|
17913
|
+
import_zod30.z.strictObject({ kind: import_zod30.z.literal("binaryTurnover"), pid: import_zod30.z.number().int().positive(), observedAt: import_zod30.z.number() }),
|
|
17914
|
+
import_zod30.z.strictObject({ kind: import_zod30.z.literal("idleShutdown"), pid: import_zod30.z.number().int().positive(), observedAt: import_zod30.z.number() }),
|
|
17915
|
+
import_zod30.z.strictObject({ kind: import_zod30.z.literal("superseded"), pid: import_zod30.z.number().int().positive(), ownerPid: import_zod30.z.number().int().positive(), observedAt: import_zod30.z.number() }),
|
|
17916
|
+
import_zod30.z.strictObject({ kind: import_zod30.z.literal("drained"), pid: import_zod30.z.number().int().positive(), observedAt: import_zod30.z.number() })
|
|
17805
17917
|
]);
|
|
17806
|
-
var QuotaExpiringEventSchema =
|
|
17807
|
-
identity:
|
|
17808
|
-
provider:
|
|
17809
|
-
window:
|
|
17918
|
+
var QuotaExpiringEventSchema = import_zod30.z.strictObject({
|
|
17919
|
+
identity: import_zod30.z.string().min(1),
|
|
17920
|
+
provider: import_zod30.z.string().min(1),
|
|
17921
|
+
window: import_zod30.z.enum(["fiveHour", "sevenDay"]),
|
|
17810
17922
|
/** 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. */
|
|
17811
|
-
utilization:
|
|
17812
|
-
resetsAt:
|
|
17813
|
-
observedAt:
|
|
17923
|
+
utilization: import_zod30.z.number().min(0).max(1),
|
|
17924
|
+
resetsAt: import_zod30.z.iso.datetime(),
|
|
17925
|
+
observedAt: import_zod30.z.number()
|
|
17814
17926
|
});
|
|
17815
17927
|
|
|
17816
17928
|
// src/frontdoor/eventsApi.ts
|
|
@@ -17894,60 +18006,60 @@ init_cliError();
|
|
|
17894
18006
|
|
|
17895
18007
|
// src/frontdoor/launchSchemas.ts
|
|
17896
18008
|
var import_node_path33 = __toESM(require("node:path"), 1);
|
|
17897
|
-
var
|
|
18009
|
+
var import_zod31 = require("zod");
|
|
17898
18010
|
init_statusline();
|
|
17899
18011
|
init_claudeVersion();
|
|
17900
18012
|
init_identity();
|
|
17901
|
-
var LaunchResolveInputSchema =
|
|
17902
|
-
path:
|
|
18013
|
+
var LaunchResolveInputSchema = import_zod31.z.strictObject({
|
|
18014
|
+
path: import_zod31.z.string().min(1),
|
|
17903
18015
|
/** `@name`, launch flags, then the arguments for `claude`; empty for a bare launch. */
|
|
17904
|
-
argv:
|
|
18016
|
+
argv: import_zod31.z.readonly(import_zod31.z.array(import_zod31.z.string())).optional(),
|
|
17905
18017
|
/** 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. */
|
|
17906
|
-
env:
|
|
18018
|
+
env: import_zod31.z.record(import_zod31.z.string(), import_zod31.z.string()).optional()
|
|
17907
18019
|
}).refine((input) => import_node_path33.default.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
17908
|
-
var LaunchPoolDecisionSchema =
|
|
17909
|
-
name:
|
|
17910
|
-
reasons:
|
|
17911
|
-
movedOff:
|
|
18020
|
+
var LaunchPoolDecisionSchema = import_zod31.z.strictObject({
|
|
18021
|
+
name: import_zod31.z.string(),
|
|
18022
|
+
reasons: import_zod31.z.readonly(import_zod31.z.array(import_zod31.z.string())),
|
|
18023
|
+
movedOff: import_zod31.z.strictObject({ identity: import_zod31.z.string(), reason: import_zod31.z.string() }).optional()
|
|
17912
18024
|
});
|
|
17913
|
-
var LaunchDecisionSchema =
|
|
17914
|
-
identity:
|
|
17915
|
-
identitySource:
|
|
18025
|
+
var LaunchDecisionSchema = import_zod31.z.strictObject({
|
|
18026
|
+
identity: import_zod31.z.string().optional(),
|
|
18027
|
+
identitySource: import_zod31.z.enum(IDENTITY_DECISION_SOURCES),
|
|
17916
18028
|
pool: LaunchPoolDecisionSchema.optional(),
|
|
17917
|
-
configDirEscapeHatch:
|
|
17918
|
-
configDir:
|
|
17919
|
-
configProfile:
|
|
17920
|
-
configProfileSource:
|
|
17921
|
-
provider:
|
|
18029
|
+
configDirEscapeHatch: import_zod31.z.boolean(),
|
|
18030
|
+
configDir: import_zod31.z.string().optional(),
|
|
18031
|
+
configProfile: import_zod31.z.string().optional(),
|
|
18032
|
+
configProfileSource: import_zod31.z.enum(CONFIG_PROFILE_DECISION_SOURCES),
|
|
18033
|
+
provider: import_zod31.z.string().optional()
|
|
17922
18034
|
});
|
|
17923
|
-
var LaunchFlagsSchema =
|
|
17924
|
-
skipPermissions:
|
|
17925
|
-
remoteControl:
|
|
17926
|
-
headroom:
|
|
17927
|
-
trackUsage:
|
|
17928
|
-
pause:
|
|
17929
|
-
explain:
|
|
18035
|
+
var LaunchFlagsSchema = import_zod31.z.strictObject({
|
|
18036
|
+
skipPermissions: import_zod31.z.boolean(),
|
|
18037
|
+
remoteControl: import_zod31.z.boolean(),
|
|
18038
|
+
headroom: import_zod31.z.boolean(),
|
|
18039
|
+
trackUsage: import_zod31.z.boolean(),
|
|
18040
|
+
pause: import_zod31.z.boolean(),
|
|
18041
|
+
explain: import_zod31.z.boolean(),
|
|
17930
18042
|
/** How long the launch waits after its own output before it starts claude, in milliseconds. */
|
|
17931
|
-
delayMs:
|
|
18043
|
+
delayMs: import_zod31.z.number(),
|
|
17932
18044
|
/** The hosts the launch keeps off the front door by adding them to the child's `NO_PROXY`. */
|
|
17933
|
-
proxyBypass:
|
|
18045
|
+
proxyBypass: import_zod31.z.array(import_zod31.z.string()).readonly(),
|
|
17934
18046
|
/** How the session's built-in statusline looks, when the launch configures any of it. */
|
|
17935
18047
|
statusline: StatuslineSchema.optional()
|
|
17936
18048
|
});
|
|
17937
|
-
var LaunchResolveOutputSchema =
|
|
18049
|
+
var LaunchResolveOutputSchema = import_zod31.z.strictObject({
|
|
17938
18050
|
decision: LaunchDecisionSchema,
|
|
17939
18051
|
flags: LaunchFlagsSchema,
|
|
17940
|
-
claudeVersion:
|
|
18052
|
+
claudeVersion: import_zod31.z.strictObject({ version: import_zod31.z.string(), source: import_zod31.z.enum(CLAUDE_VERSION_SOURCES) }).optional(),
|
|
17941
18053
|
/** The real `claude` binary the launch would spawn, on the door's host. */
|
|
17942
|
-
bin:
|
|
18054
|
+
bin: import_zod31.z.string(),
|
|
17943
18055
|
/** The arguments the launch would pass it: the tool's own flags, then `CLAUDE_EXTRA_FLAGS`, then the caller's own. */
|
|
17944
|
-
args:
|
|
18056
|
+
args: import_zod31.z.readonly(import_zod31.z.array(import_zod31.z.string())),
|
|
17945
18057
|
/** The credential the launch would authenticate with, by target and source kinds. Absent when none applies. */
|
|
17946
|
-
credential:
|
|
17947
|
-
routing:
|
|
18058
|
+
credential: import_zod31.z.strictObject({ subject: import_zod31.z.enum(["provider", "identity"]), name: import_zod31.z.string(), summary: CredentialSummarySchema }).optional(),
|
|
18059
|
+
routing: import_zod31.z.strictObject({ frontDoor: import_zod31.z.boolean(), headroom: import_zod31.z.boolean() }),
|
|
17948
18060
|
/** The names of the environment variables the launch would set or unset, sorted. Values are not reported. */
|
|
17949
|
-
environment:
|
|
17950
|
-
warnings:
|
|
18061
|
+
environment: import_zod31.z.readonly(import_zod31.z.array(import_zod31.z.string())),
|
|
18062
|
+
warnings: import_zod31.z.readonly(import_zod31.z.array(import_zod31.z.string()))
|
|
17951
18063
|
});
|
|
17952
18064
|
|
|
17953
18065
|
// src/frontdoor/launchApi.ts
|
|
@@ -17983,22 +18095,22 @@ function createLaunchApiRouter(deps) {
|
|
|
17983
18095
|
// src/frontdoor/agentTreesApi.ts
|
|
17984
18096
|
var import_client6 = require("@orpc/client");
|
|
17985
18097
|
var import_openapi7 = require("@orpc/openapi");
|
|
17986
|
-
var
|
|
18098
|
+
var import_zod32 = require("zod");
|
|
17987
18099
|
init_cliError();
|
|
17988
|
-
var AgentTreesListInputSchema =
|
|
18100
|
+
var AgentTreesListInputSchema = import_zod32.z.strictObject({
|
|
17989
18101
|
/** Only this identity's sessions. */
|
|
17990
|
-
identity:
|
|
18102
|
+
identity: import_zod32.z.string().optional(),
|
|
17991
18103
|
/** Include sessions that spawned no agent and ran no workflow. */
|
|
17992
|
-
all:
|
|
18104
|
+
all: import_zod32.z.boolean().optional()
|
|
17993
18105
|
});
|
|
17994
|
-
var AgentTreesListOutputSchema =
|
|
17995
|
-
var AgentTreesShowInputSchema =
|
|
18106
|
+
var AgentTreesListOutputSchema = import_zod32.z.array(SessionSummarySchema);
|
|
18107
|
+
var AgentTreesShowInputSchema = import_zod32.z.strictObject({
|
|
17996
18108
|
/** A session id, or an unambiguous prefix of one. */
|
|
17997
|
-
session:
|
|
18109
|
+
session: import_zod32.z.string().min(1),
|
|
17998
18110
|
/** Look only in this identity. */
|
|
17999
|
-
identity:
|
|
18111
|
+
identity: import_zod32.z.string().optional()
|
|
18000
18112
|
});
|
|
18001
|
-
var AgentTreesShowOutputSchema =
|
|
18113
|
+
var AgentTreesShowOutputSchema = import_zod32.z.strictObject({ identities: import_zod32.z.array(import_zod32.z.string()), ...MergedAgentTreeSchema.shape });
|
|
18002
18114
|
function asBadRequest(error) {
|
|
18003
18115
|
if (error instanceof CliError) {
|
|
18004
18116
|
throw new import_client6.ORPCError("BAD_REQUEST", { message: error.message });
|
|
@@ -20191,7 +20303,7 @@ init_poolPick();
|
|
|
20191
20303
|
|
|
20192
20304
|
// src/agents/read.ts
|
|
20193
20305
|
var import_node_path35 = __toESM(require("node:path"), 1);
|
|
20194
|
-
var
|
|
20306
|
+
var import_zod33 = require("zod");
|
|
20195
20307
|
var PROJECTS_DIR = "projects";
|
|
20196
20308
|
var TASKS_DIR = "tasks";
|
|
20197
20309
|
var SUBAGENTS_DIR = "subagents";
|
|
@@ -20310,14 +20422,14 @@ function parseJson2(text) {
|
|
|
20310
20422
|
return void 0;
|
|
20311
20423
|
}
|
|
20312
20424
|
}
|
|
20313
|
-
var TaskFileSchema =
|
|
20314
|
-
var WorkflowRunFileSchema =
|
|
20315
|
-
runId:
|
|
20316
|
-
workflowName:
|
|
20317
|
-
status:
|
|
20318
|
-
startTime:
|
|
20319
|
-
phases:
|
|
20320
|
-
summary:
|
|
20425
|
+
var TaskFileSchema = import_zod33.z.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: import_zod33.z.array(import_zod33.z.string()).default([]), blockedBy: import_zod33.z.array(import_zod33.z.string()).default([]) });
|
|
20426
|
+
var WorkflowRunFileSchema = import_zod33.z.object({
|
|
20427
|
+
runId: import_zod33.z.string(),
|
|
20428
|
+
workflowName: import_zod33.z.string().optional(),
|
|
20429
|
+
status: import_zod33.z.string().optional(),
|
|
20430
|
+
startTime: import_zod33.z.number().optional(),
|
|
20431
|
+
phases: import_zod33.z.array(import_zod33.z.object({ title: import_zod33.z.string() })).default([]),
|
|
20432
|
+
summary: import_zod33.z.string().optional()
|
|
20321
20433
|
});
|
|
20322
20434
|
function summariseSession(fs14, configDir, ref) {
|
|
20323
20435
|
const sessionRelative = import_node_path35.default.join(PROJECTS_DIR, ref.project, ref.entry);
|