claude-use 11.45.0 → 11.47.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 +3 -2
- package/dist/cli.cjs +1105 -817
- package/dist/index.cjs +524 -489
- package/dist/index.mjs +520 -485
- package/dist/types/index.d.ts +12 -31
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -293,8 +293,6 @@ var init_schema = __esm({
|
|
|
293
293
|
delay: import_zod.z.string().regex(DURATION_RE, "must be a duration such as 5s or 500ms").optional(),
|
|
294
294
|
/** 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. */
|
|
295
295
|
pause: import_zod.z.boolean().optional(),
|
|
296
|
-
/** Whether a provider session routes provider-qualified model names (`z/glm-5.3`, `auto`) through the `models` block to the provider that serves them, instead of sending every request to the launch provider. */
|
|
297
|
-
routeByName: import_zod.z.boolean().optional(),
|
|
298
296
|
/** 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. */
|
|
299
297
|
explain: import_zod.z.boolean().optional()
|
|
300
298
|
});
|
|
@@ -1473,9 +1471,6 @@ function flattenLayers(layers, options) {
|
|
|
1473
1471
|
if (layer.launch.explain !== void 0) {
|
|
1474
1472
|
launch.explain = layer.launch.explain;
|
|
1475
1473
|
}
|
|
1476
|
-
if (layer.launch.routeByName !== void 0) {
|
|
1477
|
-
launch.routeByName = layer.launch.routeByName;
|
|
1478
|
-
}
|
|
1479
1474
|
}
|
|
1480
1475
|
if (layer.models !== void 0) {
|
|
1481
1476
|
models = mergeModels(models, layer.models);
|
|
@@ -2930,7 +2925,7 @@ var init_capability = __esm({
|
|
|
2930
2925
|
});
|
|
2931
2926
|
|
|
2932
2927
|
// src/frontdoor/route.ts
|
|
2933
|
-
var IDENTITY_HEADER, SESSION_HEADER, PROVIDER_HEADER, HEADROOM_FLAG_HEADER,
|
|
2928
|
+
var IDENTITY_HEADER, SESSION_HEADER, PROVIDER_HEADER, HEADROOM_FLAG_HEADER, PROJECT_ID_HEADER, AUTH_HEADER;
|
|
2934
2929
|
var init_route = __esm({
|
|
2935
2930
|
"src/frontdoor/route.ts"() {
|
|
2936
2931
|
"use strict";
|
|
@@ -2938,7 +2933,6 @@ var init_route = __esm({
|
|
|
2938
2933
|
SESSION_HEADER = "x-agent-shim-session";
|
|
2939
2934
|
PROVIDER_HEADER = "x-agent-shim-provider";
|
|
2940
2935
|
HEADROOM_FLAG_HEADER = "x-agent-shim-headroom";
|
|
2941
|
-
ROUTE_BY_NAME_HEADER = "x-agent-shim-route-by-name";
|
|
2942
2936
|
PROJECT_ID_HEADER = "x-headroom-project-id";
|
|
2943
2937
|
AUTH_HEADER = "x-agent-shim-auth";
|
|
2944
2938
|
}
|
|
@@ -3078,7 +3072,7 @@ var init_state = __esm({
|
|
|
3078
3072
|
import_node_path8 = __toESM(require("node:path"), 1);
|
|
3079
3073
|
import_zod3 = require("zod");
|
|
3080
3074
|
init_schema();
|
|
3081
|
-
FRONT_DOOR_PROTOCOL =
|
|
3075
|
+
FRONT_DOOR_PROTOCOL = 5;
|
|
3082
3076
|
FrontDoorSessionSchema = import_zod3.z.strictObject({ pid: import_zod3.z.number().int().positive(), startedAt: import_zod3.z.number(), token: import_zod3.z.string().min(1), supervisorPid: import_zod3.z.number().int().positive().optional(), sessionId: import_zod3.z.string().min(1).optional(), models: ModelsConfigSchema.optional() });
|
|
3083
3077
|
FrontDoorStateSchema = import_zod3.z.strictObject({
|
|
3084
3078
|
/**
|
|
@@ -3151,7 +3145,7 @@ var init_package = __esm({
|
|
|
3151
3145
|
"package.json"() {
|
|
3152
3146
|
package_default = {
|
|
3153
3147
|
name: "claude-use",
|
|
3154
|
-
version: "11.
|
|
3148
|
+
version: "11.47.0",
|
|
3155
3149
|
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.",
|
|
3156
3150
|
license: "MIT",
|
|
3157
3151
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -6455,9 +6449,6 @@ function applyProfileChange(paths, name, change) {
|
|
|
6455
6449
|
if (change.launchExplain !== void 0) {
|
|
6456
6450
|
launchPatch.explain = change.launchExplain;
|
|
6457
6451
|
}
|
|
6458
|
-
if (change.launchRouteByName !== void 0) {
|
|
6459
|
-
launchPatch.routeByName = change.launchRouteByName;
|
|
6460
|
-
}
|
|
6461
6452
|
if (Object.keys(launchPatch).length > 0) {
|
|
6462
6453
|
setProfileLaunchFlags(paths, name, launchPatch);
|
|
6463
6454
|
touched = true;
|
|
@@ -6527,6 +6518,7 @@ function buildLayoutPaths(root) {
|
|
|
6527
6518
|
identitiesDir: import_node_path23.default.join(root, "identities"),
|
|
6528
6519
|
configProfilesDir: import_node_path23.default.join(root, "config-profiles"),
|
|
6529
6520
|
providersDir: import_node_path23.default.join(root, "providers"),
|
|
6521
|
+
providerAliasesFile: import_node_path23.default.join(root, "provider-aliases.json"),
|
|
6530
6522
|
directoryRulesFile: import_node_path23.default.join(root, "directory-rules.json"),
|
|
6531
6523
|
activeIdentityFile: import_node_path23.default.join(root, "active-identity"),
|
|
6532
6524
|
globalConfigFile: import_node_path23.default.join(root, "config.json"),
|
|
@@ -6743,6 +6735,50 @@ var init_realCredentialCache = __esm({
|
|
|
6743
6735
|
}
|
|
6744
6736
|
});
|
|
6745
6737
|
|
|
6738
|
+
// src/providerAliases.ts
|
|
6739
|
+
function parseAliases(file, raw) {
|
|
6740
|
+
const parsed = ProviderAliasesSchema.safeParse(raw);
|
|
6741
|
+
if (!parsed.success) {
|
|
6742
|
+
throw new ConfigValidationError(file, parsed.error.issues);
|
|
6743
|
+
}
|
|
6744
|
+
return parsed.data;
|
|
6745
|
+
}
|
|
6746
|
+
function readProviderAliases(paths) {
|
|
6747
|
+
return readJson(paths.providerAliasesFile, ProviderAliasesSchema) ?? {};
|
|
6748
|
+
}
|
|
6749
|
+
function loadProviderAliases(file, port) {
|
|
6750
|
+
const raw = port.readConfigFile(file);
|
|
6751
|
+
return raw === void 0 ? {} : parseAliases(file, raw);
|
|
6752
|
+
}
|
|
6753
|
+
function canonicalProviderName(name, defined, aliases) {
|
|
6754
|
+
if (defined(name)) {
|
|
6755
|
+
return name;
|
|
6756
|
+
}
|
|
6757
|
+
return aliases()[name] ?? name;
|
|
6758
|
+
}
|
|
6759
|
+
function aliasFindings(aliases, providerNames) {
|
|
6760
|
+
return Object.entries(aliases).map(([alias, target]) => {
|
|
6761
|
+
if (!providerNames.has(target)) {
|
|
6762
|
+
return { level: "fail", alias, message: `${alias} is recorded as a former name of ${target}, which is not a provider. Run \`agent-shim provider unalias ${alias}\`.` };
|
|
6763
|
+
}
|
|
6764
|
+
if (providerNames.has(alias)) {
|
|
6765
|
+
return { level: "warn", alias, message: `${alias} is both a provider and a recorded former name of ${target}; the provider wins. Run \`agent-shim provider unalias ${alias}\`.` };
|
|
6766
|
+
}
|
|
6767
|
+
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.` };
|
|
6768
|
+
});
|
|
6769
|
+
}
|
|
6770
|
+
var import_zod15, ProviderAliasesSchema;
|
|
6771
|
+
var init_providerAliases = __esm({
|
|
6772
|
+
"src/providerAliases.ts"() {
|
|
6773
|
+
"use strict";
|
|
6774
|
+
import_zod15 = require("zod");
|
|
6775
|
+
init_cliError();
|
|
6776
|
+
init_load();
|
|
6777
|
+
init_store();
|
|
6778
|
+
ProviderAliasesSchema = import_zod15.z.record(import_zod15.z.string().min(1), import_zod15.z.string().min(1));
|
|
6779
|
+
}
|
|
6780
|
+
});
|
|
6781
|
+
|
|
6746
6782
|
// src/credential.ts
|
|
6747
6783
|
function commandArgv(source) {
|
|
6748
6784
|
if ("command" in source) {
|
|
@@ -7147,6 +7183,11 @@ var init_families = __esm({
|
|
|
7147
7183
|
});
|
|
7148
7184
|
|
|
7149
7185
|
// src/providersStore.ts
|
|
7186
|
+
function requireValidProviderName(name) {
|
|
7187
|
+
if (!PROVIDER_NAME_RE.test(name)) {
|
|
7188
|
+
throw new InvalidProviderNameError(name);
|
|
7189
|
+
}
|
|
7190
|
+
}
|
|
7150
7191
|
function providerJsonPath(paths, name) {
|
|
7151
7192
|
return import_node_path25.default.join(paths.providersDir, `${name}.json`);
|
|
7152
7193
|
}
|
|
@@ -7267,9 +7308,7 @@ function addProvider(paths, name, input) {
|
|
|
7267
7308
|
if (providerExists(paths, name)) {
|
|
7268
7309
|
throw new ProviderAlreadyExistsError(name);
|
|
7269
7310
|
}
|
|
7270
|
-
|
|
7271
|
-
throw new InvalidProviderNameError(name);
|
|
7272
|
-
}
|
|
7311
|
+
requireValidProviderName(name);
|
|
7273
7312
|
const kind = input.kind ?? "http";
|
|
7274
7313
|
if (kind === "codex" && input.baseUrl !== void 0) {
|
|
7275
7314
|
throw new ProviderKindMismatchError("A codex provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
|
|
@@ -7400,10 +7439,11 @@ function cascadeProviderName(cascade) {
|
|
|
7400
7439
|
}
|
|
7401
7440
|
function selectProvider(params) {
|
|
7402
7441
|
const cliName = params.cliProvider !== void 0 && params.cliProvider !== "" ? params.cliProvider : void 0;
|
|
7403
|
-
const
|
|
7404
|
-
if (
|
|
7442
|
+
const named = cliName ?? (params.cascade === void 0 ? void 0 : cascadeProviderName(params.cascade));
|
|
7443
|
+
if (named === void 0) {
|
|
7405
7444
|
return void 0;
|
|
7406
7445
|
}
|
|
7446
|
+
const name = canonicalProviderName(named, (candidate) => loadProvider(params.paths.providersDir, candidate, params.port) !== void 0, () => loadProviderAliases(params.paths.providerAliasesFile, params.port));
|
|
7407
7447
|
const definition = loadProvider(params.paths.providersDir, name, params.port);
|
|
7408
7448
|
if (definition === void 0) {
|
|
7409
7449
|
const known = listProviderNames(params.port.readdir, params.paths.providersDir);
|
|
@@ -7503,6 +7543,7 @@ var init_providersStore = __esm({
|
|
|
7503
7543
|
init_unrecognisedKeys();
|
|
7504
7544
|
init_schema();
|
|
7505
7545
|
init_cliError();
|
|
7546
|
+
init_providerAliases();
|
|
7506
7547
|
init_credential();
|
|
7507
7548
|
init_walk();
|
|
7508
7549
|
init_families();
|
|
@@ -7790,21 +7831,21 @@ function findPathShadow(params) {
|
|
|
7790
7831
|
}
|
|
7791
7832
|
return params.pathDirs.some((dir) => import_node_path28.default.resolve(dir) === resolvedTargetDir) ? { status: "ok" } : { status: "not-on-path" };
|
|
7792
7833
|
}
|
|
7793
|
-
var import_node_fs7, import_node_path28,
|
|
7834
|
+
var import_node_fs7, import_node_path28, import_zod20, ClaudeShimStateSchema, nodeLinkFs;
|
|
7794
7835
|
var init_claudeShim = __esm({
|
|
7795
7836
|
"src/claudeShim.ts"() {
|
|
7796
7837
|
"use strict";
|
|
7797
7838
|
import_node_fs7 = __toESM(require("node:fs"), 1);
|
|
7798
7839
|
import_node_path28 = __toESM(require("node:path"), 1);
|
|
7799
|
-
|
|
7840
|
+
import_zod20 = require("zod");
|
|
7800
7841
|
init_commandDeps();
|
|
7801
7842
|
init_store();
|
|
7802
7843
|
init_realPorts();
|
|
7803
7844
|
init_cliError();
|
|
7804
|
-
ClaudeShimStateSchema =
|
|
7805
|
-
targetPath:
|
|
7806
|
-
method:
|
|
7807
|
-
installedAtMs:
|
|
7845
|
+
ClaudeShimStateSchema = import_zod20.z.strictObject({
|
|
7846
|
+
targetPath: import_zod20.z.string().min(1),
|
|
7847
|
+
method: import_zod20.z.enum(["hardlink", "copy"]),
|
|
7848
|
+
installedAtMs: import_zod20.z.number()
|
|
7808
7849
|
});
|
|
7809
7850
|
nodeLinkFs = { link: import_node_fs7.default.linkSync, copyFile: import_node_fs7.default.copyFileSync, chmod: import_node_fs7.default.chmodSync };
|
|
7810
7851
|
}
|
|
@@ -7900,62 +7941,62 @@ var init_signatures = __esm({
|
|
|
7900
7941
|
});
|
|
7901
7942
|
|
|
7902
7943
|
// src/codex/anthropic.ts
|
|
7903
|
-
var
|
|
7944
|
+
var import_zod24, TextBlockSchema, Base64ImageSourceSchema, UrlImageSourceSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultContentBlockSchema, ToolResultBlockSchema, OtherBlockSchema, ContentBlockSchema, MessageSchema, ToolSchema, ToolChoiceSchema, SystemSchema, MessagesRequestSchema, CountTokensRequestSchema;
|
|
7904
7945
|
var init_anthropic = __esm({
|
|
7905
7946
|
"src/codex/anthropic.ts"() {
|
|
7906
7947
|
"use strict";
|
|
7907
|
-
|
|
7908
|
-
TextBlockSchema =
|
|
7909
|
-
Base64ImageSourceSchema =
|
|
7910
|
-
UrlImageSourceSchema =
|
|
7911
|
-
ImageBlockSchema =
|
|
7912
|
-
type:
|
|
7913
|
-
source:
|
|
7948
|
+
import_zod24 = require("zod");
|
|
7949
|
+
TextBlockSchema = import_zod24.z.looseObject({ type: import_zod24.z.literal("text"), text: import_zod24.z.string() });
|
|
7950
|
+
Base64ImageSourceSchema = import_zod24.z.looseObject({ type: import_zod24.z.literal("base64"), media_type: import_zod24.z.string().min(1), data: import_zod24.z.string() });
|
|
7951
|
+
UrlImageSourceSchema = import_zod24.z.looseObject({ type: import_zod24.z.literal("url"), url: import_zod24.z.string().min(1) });
|
|
7952
|
+
ImageBlockSchema = import_zod24.z.looseObject({
|
|
7953
|
+
type: import_zod24.z.literal("image"),
|
|
7954
|
+
source: import_zod24.z.union([Base64ImageSourceSchema, UrlImageSourceSchema])
|
|
7914
7955
|
});
|
|
7915
|
-
ToolUseBlockSchema =
|
|
7916
|
-
type:
|
|
7917
|
-
id:
|
|
7918
|
-
name:
|
|
7919
|
-
input:
|
|
7956
|
+
ToolUseBlockSchema = import_zod24.z.looseObject({
|
|
7957
|
+
type: import_zod24.z.literal("tool_use"),
|
|
7958
|
+
id: import_zod24.z.string().min(1),
|
|
7959
|
+
name: import_zod24.z.string().min(1),
|
|
7960
|
+
input: import_zod24.z.unknown()
|
|
7920
7961
|
});
|
|
7921
|
-
ToolResultContentBlockSchema =
|
|
7922
|
-
ToolResultBlockSchema =
|
|
7923
|
-
type:
|
|
7924
|
-
tool_use_id:
|
|
7925
|
-
content:
|
|
7962
|
+
ToolResultContentBlockSchema = import_zod24.z.union([TextBlockSchema, import_zod24.z.looseObject({ type: import_zod24.z.string() })]);
|
|
7963
|
+
ToolResultBlockSchema = import_zod24.z.looseObject({
|
|
7964
|
+
type: import_zod24.z.literal("tool_result"),
|
|
7965
|
+
tool_use_id: import_zod24.z.string().min(1),
|
|
7966
|
+
content: import_zod24.z.union([import_zod24.z.string(), import_zod24.z.array(ToolResultContentBlockSchema)]).optional()
|
|
7926
7967
|
});
|
|
7927
|
-
OtherBlockSchema =
|
|
7928
|
-
ContentBlockSchema =
|
|
7929
|
-
MessageSchema =
|
|
7930
|
-
role:
|
|
7931
|
-
content:
|
|
7968
|
+
OtherBlockSchema = import_zod24.z.looseObject({ type: import_zod24.z.string() });
|
|
7969
|
+
ContentBlockSchema = import_zod24.z.union([TextBlockSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultBlockSchema, OtherBlockSchema]);
|
|
7970
|
+
MessageSchema = import_zod24.z.looseObject({
|
|
7971
|
+
role: import_zod24.z.enum(["user", "assistant", "system"]),
|
|
7972
|
+
content: import_zod24.z.union([import_zod24.z.string(), import_zod24.z.array(ContentBlockSchema)])
|
|
7932
7973
|
});
|
|
7933
|
-
ToolSchema =
|
|
7934
|
-
name:
|
|
7935
|
-
description:
|
|
7936
|
-
input_schema:
|
|
7974
|
+
ToolSchema = import_zod24.z.looseObject({
|
|
7975
|
+
name: import_zod24.z.string().min(1),
|
|
7976
|
+
description: import_zod24.z.string().optional(),
|
|
7977
|
+
input_schema: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.unknown()).optional()
|
|
7937
7978
|
});
|
|
7938
|
-
ToolChoiceSchema =
|
|
7939
|
-
|
|
7940
|
-
|
|
7979
|
+
ToolChoiceSchema = import_zod24.z.union([
|
|
7980
|
+
import_zod24.z.looseObject({ type: import_zod24.z.enum(["auto", "none", "any"]) }),
|
|
7981
|
+
import_zod24.z.looseObject({ type: import_zod24.z.literal("tool"), name: import_zod24.z.string().min(1) })
|
|
7941
7982
|
]);
|
|
7942
|
-
SystemSchema =
|
|
7943
|
-
MessagesRequestSchema =
|
|
7944
|
-
model:
|
|
7983
|
+
SystemSchema = import_zod24.z.union([import_zod24.z.string(), import_zod24.z.array(import_zod24.z.union([TextBlockSchema, OtherBlockSchema]))]);
|
|
7984
|
+
MessagesRequestSchema = import_zod24.z.looseObject({
|
|
7985
|
+
model: import_zod24.z.string().optional(),
|
|
7945
7986
|
system: SystemSchema.optional(),
|
|
7946
|
-
messages:
|
|
7947
|
-
tools:
|
|
7987
|
+
messages: import_zod24.z.array(MessageSchema),
|
|
7988
|
+
tools: import_zod24.z.array(ToolSchema).optional(),
|
|
7948
7989
|
tool_choice: ToolChoiceSchema.optional(),
|
|
7949
|
-
stream:
|
|
7990
|
+
stream: import_zod24.z.boolean().optional(),
|
|
7950
7991
|
/** `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. */
|
|
7951
|
-
metadata:
|
|
7992
|
+
metadata: import_zod24.z.looseObject({ user_id: import_zod24.z.string().optional() }).optional(),
|
|
7952
7993
|
/** Claude Code's effort setting. Any string is accepted; the translator honours only the levels the backend understands. */
|
|
7953
|
-
output_config:
|
|
7994
|
+
output_config: import_zod24.z.looseObject({ effort: import_zod24.z.string().optional() }).optional()
|
|
7954
7995
|
});
|
|
7955
|
-
CountTokensRequestSchema =
|
|
7956
|
-
system:
|
|
7957
|
-
messages:
|
|
7958
|
-
tools:
|
|
7996
|
+
CountTokensRequestSchema = import_zod24.z.looseObject({
|
|
7997
|
+
system: import_zod24.z.unknown().optional(),
|
|
7998
|
+
messages: import_zod24.z.unknown().optional(),
|
|
7999
|
+
tools: import_zod24.z.unknown().optional()
|
|
7959
8000
|
});
|
|
7960
8001
|
}
|
|
7961
8002
|
});
|
|
@@ -8057,13 +8098,13 @@ function filterCatalogue(models, catalogue) {
|
|
|
8057
8098
|
const excluded = catalogue.exclude === void 0 ? void 0 : (0, import_picomatch4.default)(catalogue.exclude, { dot: true });
|
|
8058
8099
|
return models.filter((model) => included?.(model.id) !== false && excluded?.(model.id) !== true);
|
|
8059
8100
|
}
|
|
8060
|
-
var import_node_path30, import_picomatch4,
|
|
8101
|
+
var import_node_path30, import_picomatch4, import_zod25, DEFAULT_CANDIDATE_URLS, MS_PER_SECOND5, SECONDS_PER_HOUR2, HOURS_PER_DAY5, MS_PER_HOUR4, HOURS_BETWEEN_RETRIES, CATALOGUE_MAX_AGE_MS, CATALOGUE_RETRY_MS, CATALOGUE_REQUEST_SECONDS, CATALOGUE_REQUEST_TIMEOUT_MS, CATALOGUE_REFRESH_TIMEOUT_MS, CatalogueModelSchema, CatalogueCacheSchema;
|
|
8061
8102
|
var init_providerCatalogue = __esm({
|
|
8062
8103
|
"src/providerCatalogue.ts"() {
|
|
8063
8104
|
"use strict";
|
|
8064
8105
|
import_node_path30 = __toESM(require("node:path"), 1);
|
|
8065
8106
|
import_picomatch4 = __toESM(require("picomatch"), 1);
|
|
8066
|
-
|
|
8107
|
+
import_zod25 = require("zod");
|
|
8067
8108
|
DEFAULT_CANDIDATE_URLS = 2;
|
|
8068
8109
|
MS_PER_SECOND5 = 1e3;
|
|
8069
8110
|
SECONDS_PER_HOUR2 = 3600;
|
|
@@ -8075,8 +8116,8 @@ var init_providerCatalogue = __esm({
|
|
|
8075
8116
|
CATALOGUE_REQUEST_SECONDS = 10;
|
|
8076
8117
|
CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND5;
|
|
8077
8118
|
CATALOGUE_REFRESH_TIMEOUT_MS = DEFAULT_CANDIDATE_URLS * CATALOGUE_REQUEST_TIMEOUT_MS;
|
|
8078
|
-
CatalogueModelSchema =
|
|
8079
|
-
CatalogueCacheSchema =
|
|
8119
|
+
CatalogueModelSchema = import_zod25.z.strictObject({ id: import_zod25.z.string().min(1), name: import_zod25.z.string().min(1).optional() });
|
|
8120
|
+
CatalogueCacheSchema = import_zod25.z.strictObject({ fetchedAt: import_zod25.z.number(), url: import_zod25.z.string().min(1), models: import_zod25.z.array(CatalogueModelSchema) });
|
|
8080
8121
|
}
|
|
8081
8122
|
});
|
|
8082
8123
|
|
|
@@ -8162,7 +8203,7 @@ function providerModelRows(provider, catalogue = []) {
|
|
|
8162
8203
|
const taken = new Set(named.map((row) => labelOf(row.model)));
|
|
8163
8204
|
return [...named, ...catalogueRows(provider, catalogue).filter((row) => !taken.has(labelOf(row.model)))];
|
|
8164
8205
|
}
|
|
8165
|
-
function routedModelRows(models, providers
|
|
8206
|
+
function routedModelRows(models, providers) {
|
|
8166
8207
|
const hidden = new Set(models.hide ?? []);
|
|
8167
8208
|
const shown = models.show === void 0 ? void 0 : new Set(models.show);
|
|
8168
8209
|
const visible = (model) => shown === void 0 ? !hidden.has(model) : shown.has(model);
|
|
@@ -8170,17 +8211,17 @@ function routedModelRows(models, providers, bare = true) {
|
|
|
8170
8211
|
const concreteByRef = new Map(concrete.map((row) => [row.model, row]));
|
|
8171
8212
|
const families = buildFamilies([...concrete.map((row) => row.model), ...accountRefsOf(models)], models);
|
|
8172
8213
|
const handlingOf = (refs) => refs.map((ref) => concreteByRef.get(ref)?.behavesAs).find((behavesAs) => behavesAs !== void 0) ?? TIER_BEHAVES_AS.sonnet;
|
|
8173
|
-
const virtual =
|
|
8214
|
+
const virtual = Object.entries(models.virtual ?? {}).flatMap(([name, definition]) => {
|
|
8174
8215
|
if (!visible(name)) {
|
|
8175
8216
|
return [];
|
|
8176
8217
|
}
|
|
8177
8218
|
const targets = expandFamilyMembers(safeExpand(name, models), families);
|
|
8178
8219
|
return [{ model: name, label: name, description: `Virtual (${definition.mode})`, behavesAs: handlingOf(targets) }];
|
|
8179
|
-
})
|
|
8180
|
-
const familyRows =
|
|
8220
|
+
});
|
|
8221
|
+
const familyRows = sharedFamilies(families).flatMap((family) => {
|
|
8181
8222
|
const member = `${FAMILY_PREFIX}${family.key}`;
|
|
8182
8223
|
return visible(member) ? [{ model: member, label: family.key, description: `Family (${familyMode(family.settings)}): ${family.refs.join(", ")}`, behavesAs: handlingOf(family.refs) }] : [];
|
|
8183
|
-
})
|
|
8224
|
+
});
|
|
8184
8225
|
return [...virtual, ...familyRows, ...concrete.filter((row) => visible(row.model))];
|
|
8185
8226
|
}
|
|
8186
8227
|
function safeExpand(name, models) {
|
|
@@ -8660,8 +8701,7 @@ var init_argv = __esm({
|
|
|
8660
8701
|
{ flag: "--remote-control", key: "remoteControl" },
|
|
8661
8702
|
{ flag: "--wait", key: "wait" },
|
|
8662
8703
|
{ flag: "--pause", key: "pause" },
|
|
8663
|
-
{ flag: "--explain", key: "explain" }
|
|
8664
|
-
{ flag: "--route-by-name", key: "routeByName" }
|
|
8704
|
+
{ flag: "--explain", key: "explain" }
|
|
8665
8705
|
];
|
|
8666
8706
|
LAUNCHER_FLAG_NAMES = [
|
|
8667
8707
|
...VALUED_FLAGS,
|
|
@@ -8851,7 +8891,6 @@ function resolveLaunchFlags(params) {
|
|
|
8851
8891
|
trackUsage: params.flags?.trackUsage ?? parseEnvBool("AGENT_SHIM_TRACK_USAGE", params.env.AGENT_SHIM_TRACK_USAGE) ?? params.cascade?.trackUsage ?? true,
|
|
8852
8892
|
pause: params.flags?.pause ?? parseEnvBool("AGENT_SHIM_PAUSE", params.env.AGENT_SHIM_PAUSE) ?? params.cascade?.pause ?? false,
|
|
8853
8893
|
explain: params.flags?.explain ?? parseEnvBool("AGENT_SHIM_EXPLAIN", params.env.AGENT_SHIM_EXPLAIN) ?? params.cascade?.explain ?? false,
|
|
8854
|
-
routeByName: params.flags?.routeByName ?? parseEnvBool("AGENT_SHIM_ROUTE_BY_NAME", params.env.AGENT_SHIM_ROUTE_BY_NAME) ?? params.cascade?.routeByName ?? false,
|
|
8855
8894
|
delayMs: resolveDelayMs(params)
|
|
8856
8895
|
};
|
|
8857
8896
|
}
|
|
@@ -8900,12 +8939,10 @@ function buildEnv(params) {
|
|
|
8900
8939
|
env[key] = value;
|
|
8901
8940
|
}
|
|
8902
8941
|
}
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
env[`ANTHROPIC_DEFAULT_${tier.toUpperCase()}_MODEL`] = ref;
|
|
8908
|
-
}
|
|
8942
|
+
for (const tier of CLAUDE_TIERS) {
|
|
8943
|
+
const ref = params.tierModels?.[tier];
|
|
8944
|
+
if (ref !== void 0) {
|
|
8945
|
+
env[`ANTHROPIC_DEFAULT_${tier.toUpperCase()}_MODEL`] = ref;
|
|
8909
8946
|
}
|
|
8910
8947
|
}
|
|
8911
8948
|
if (params.provider !== void 0) {
|
|
@@ -8928,7 +8965,6 @@ function buildEnv(params) {
|
|
|
8928
8965
|
{ name: SESSION_HEADER, value: params.sessionId },
|
|
8929
8966
|
{ name: AUTH_HEADER, value: params.frontdoor.sessionToken },
|
|
8930
8967
|
...params.provider === void 0 ? [] : [{ name: PROVIDER_HEADER, value: params.provider.name }],
|
|
8931
|
-
...params.routeByName ? [{ name: ROUTE_BY_NAME_HEADER, value: "1" }] : [],
|
|
8932
8968
|
...params.headroom === void 0 ? [] : [
|
|
8933
8969
|
{ name: HEADROOM_FLAG_HEADER, value: "1" },
|
|
8934
8970
|
{ name: PROJECT_ID_HEADER, value: params.headroom.projectId }
|
|
@@ -9707,7 +9743,6 @@ function decideLaunch(params, readOnly) {
|
|
|
9707
9743
|
...parsedArgv.trackUsage === void 0 ? {} : { trackUsage: parsedArgv.trackUsage },
|
|
9708
9744
|
...parsedArgv.pause === void 0 ? {} : { pause: parsedArgv.pause },
|
|
9709
9745
|
...parsedArgv.explain === void 0 ? {} : { explain: parsedArgv.explain },
|
|
9710
|
-
...parsedArgv.routeByName === void 0 ? {} : { routeByName: parsedArgv.routeByName },
|
|
9711
9746
|
...parsedArgv.delay === void 0 ? {} : { delay: parsedArgv.delay }
|
|
9712
9747
|
}
|
|
9713
9748
|
});
|
|
@@ -9717,7 +9752,6 @@ function decideLaunch(params, readOnly) {
|
|
|
9717
9752
|
notes.push(`${loginlessProvider.identity} has no stored login, so Remote Control is off; provider ${loginlessProvider.provider} runs without it`);
|
|
9718
9753
|
}
|
|
9719
9754
|
const flags = loginlessProvider === void 0 ? requestedFlags : { ...requestedFlags, remoteControl: false };
|
|
9720
|
-
const routesByName = flags.routeByName || selectedProvider !== void 0 && isRouterProvider(selectedProvider.definition);
|
|
9721
9755
|
const globalModels = loadConfigFile(paths.globalConfigFile, GlobalConfigSchema, params.fs.readConfigFile)?.config.models;
|
|
9722
9756
|
const models = launchCascade !== void 0 && params.farm !== void 0 ? cascadeModels : globalModels;
|
|
9723
9757
|
const listedProviders = listProviderNames(fs13.readdir, paths.providersDir).flatMap((name) => {
|
|
@@ -9728,7 +9762,7 @@ function decideLaunch(params, readOnly) {
|
|
|
9728
9762
|
return [];
|
|
9729
9763
|
}
|
|
9730
9764
|
});
|
|
9731
|
-
const pickerSettings = modelPickerSettingsFromRows(routedModelRows(models ?? {}, listedProviders
|
|
9765
|
+
const pickerSettings = modelPickerSettingsFromRows(routedModelRows(models ?? {}, listedProviders), selectedProvider !== void 0);
|
|
9732
9766
|
const callerSettings = hasSettingsArgument(parsedArgv.rest);
|
|
9733
9767
|
if (pickerSettings !== void 0 && callerSettings) {
|
|
9734
9768
|
notes.push("--settings was passed, so /model keeps Claude Code's own model names");
|
|
@@ -9832,8 +9866,8 @@ function prepareLaunch(params) {
|
|
|
9832
9866
|
if (decided.pinnedVersion !== void 0) {
|
|
9833
9867
|
rows.push(pinnedVersionRow(decided.pinnedVersion.version, decided.pinnedVersion.source));
|
|
9834
9868
|
}
|
|
9835
|
-
const
|
|
9836
|
-
if (
|
|
9869
|
+
const namesResolved = decided.models !== void 0;
|
|
9870
|
+
if (namesResolved) {
|
|
9837
9871
|
const check = resolveRoutedProviderCredentials({ paths, port: params.fs, env, ...params.credentials === void 0 ? {} : { credentials: params.credentials }, models: decided.models, targets: () => targetRefs(paths) });
|
|
9838
9872
|
if (!check.ok) {
|
|
9839
9873
|
log.error(check.message);
|
|
@@ -9874,7 +9908,6 @@ function prepareLaunch(params) {
|
|
|
9874
9908
|
...headroom === void 0 ? {} : { headroom },
|
|
9875
9909
|
sessionId,
|
|
9876
9910
|
remoteControl: resolvedFlags.remoteControl,
|
|
9877
|
-
routeByName: routesByName,
|
|
9878
9911
|
...decided.models?.tiers === void 0 ? {} : { tierModels: decided.models.tiers }
|
|
9879
9912
|
});
|
|
9880
9913
|
const releases = [...headroom === void 0 || headroomPort === void 0 ? [] : [headroomPort.release], ...frontDoorRelease === void 0 ? [] : [frontDoorRelease]];
|
|
@@ -9902,8 +9935,7 @@ function resolveLaunch(params) {
|
|
|
9902
9935
|
...frontDoor ? { frontdoor: { port: 0, connectPort: 0, trustBundlePath: "", sessionToken: "" } } : {},
|
|
9903
9936
|
...decided.flags.headroom ? { headroom: { socketPath: "", projectId: "" } } : {},
|
|
9904
9937
|
sessionId: "",
|
|
9905
|
-
remoteControl: decided.flags.remoteControl
|
|
9906
|
-
routeByName: decided.flags.routeByName
|
|
9938
|
+
remoteControl: decided.flags.remoteControl
|
|
9907
9939
|
});
|
|
9908
9940
|
const credentialNames = decided.identityCredentialBlock === void 0 ? [] : Object.keys(credentialVariables(decided.identityCredentialBlock.target ?? "bearer", ""));
|
|
9909
9941
|
const environment = [.../* @__PURE__ */ new Set([...Object.keys(built).filter((name) => built[name] !== env[name]), ...credentialNames])].sort();
|
|
@@ -9915,7 +9947,7 @@ function resolveLaunch(params) {
|
|
|
9915
9947
|
bin: decided.bin,
|
|
9916
9948
|
args: decided.args,
|
|
9917
9949
|
...credential === void 0 ? {} : { credential },
|
|
9918
|
-
routing: { frontDoor, headroom: decided.flags.headroom
|
|
9950
|
+
routing: { frontDoor, headroom: decided.flags.headroom },
|
|
9919
9951
|
environment
|
|
9920
9952
|
};
|
|
9921
9953
|
}
|
|
@@ -10448,11 +10480,11 @@ var init_identityClaude = __esm({
|
|
|
10448
10480
|
});
|
|
10449
10481
|
|
|
10450
10482
|
// src/usage/providerQuota.ts
|
|
10451
|
-
var
|
|
10483
|
+
var import_zod32, MS_PER_SECOND9, SECONDS_PER_HOUR3, HOURS_PER_DAY6, DAYS_PER_MONTH, ZAI_HOST, ZAI_QUOTA_URL, ZAI_UNIT_HOURS, ZAI_UNIT_MONTHS, ZAI_UNIT_MS, ZaiLimitSchema, ZaiResponseSchema, OPENROUTER_HOST, OPENROUTER_KEY_URL, OPENROUTER_CREDITS_URL, MS_PER_DAY3, OpenRouterKeySchema, OpenRouterCreditsSchema, ANTIGRAVITY_HOST, ANTIGRAVITY_QUOTA_URL, ANTIGRAVITY_USER_URL, FIVE_HOURS2, DAYS_PER_WEEK2, FIVE_HOURS_MS, WEEK_MS, AntigravityBucketSchema, AntigravitySummarySchema, GoogleTokenInfoSchema, AntigravityUserSchema;
|
|
10452
10484
|
var init_providerQuota = __esm({
|
|
10453
10485
|
"src/usage/providerQuota.ts"() {
|
|
10454
10486
|
"use strict";
|
|
10455
|
-
|
|
10487
|
+
import_zod32 = require("zod");
|
|
10456
10488
|
init_cloudUpstream();
|
|
10457
10489
|
init_schema2();
|
|
10458
10490
|
MS_PER_SECOND9 = 1e3;
|
|
@@ -10467,35 +10499,35 @@ var init_providerQuota = __esm({
|
|
|
10467
10499
|
[ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND9],
|
|
10468
10500
|
[ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9]
|
|
10469
10501
|
]);
|
|
10470
|
-
ZaiLimitSchema =
|
|
10471
|
-
type:
|
|
10472
|
-
unit:
|
|
10473
|
-
number:
|
|
10474
|
-
percentage:
|
|
10475
|
-
nextResetTime:
|
|
10476
|
-
usage:
|
|
10477
|
-
currentValue:
|
|
10478
|
-
remaining:
|
|
10502
|
+
ZaiLimitSchema = import_zod32.z.object({
|
|
10503
|
+
type: import_zod32.z.string(),
|
|
10504
|
+
unit: import_zod32.z.number().int(),
|
|
10505
|
+
number: import_zod32.z.number().int().positive(),
|
|
10506
|
+
percentage: import_zod32.z.number().nonnegative(),
|
|
10507
|
+
nextResetTime: import_zod32.z.number().positive().optional(),
|
|
10508
|
+
usage: import_zod32.z.number().nonnegative().optional(),
|
|
10509
|
+
currentValue: import_zod32.z.number().nonnegative().optional(),
|
|
10510
|
+
remaining: import_zod32.z.number().nonnegative().optional()
|
|
10479
10511
|
});
|
|
10480
|
-
ZaiResponseSchema =
|
|
10481
|
-
success:
|
|
10482
|
-
msg:
|
|
10483
|
-
data:
|
|
10512
|
+
ZaiResponseSchema = import_zod32.z.object({
|
|
10513
|
+
success: import_zod32.z.boolean(),
|
|
10514
|
+
msg: import_zod32.z.string().optional(),
|
|
10515
|
+
data: import_zod32.z.object({ level: import_zod32.z.string().optional(), limits: import_zod32.z.array(ZaiLimitSchema) })
|
|
10484
10516
|
});
|
|
10485
10517
|
OPENROUTER_HOST = "openrouter.ai";
|
|
10486
10518
|
OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
|
|
10487
10519
|
OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
|
|
10488
10520
|
MS_PER_DAY3 = HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
10489
|
-
OpenRouterKeySchema =
|
|
10490
|
-
data:
|
|
10491
|
-
limit:
|
|
10492
|
-
limit_remaining:
|
|
10493
|
-
limit_reset:
|
|
10494
|
-
is_free_tier:
|
|
10495
|
-
free_model_daily_requests:
|
|
10521
|
+
OpenRouterKeySchema = import_zod32.z.object({
|
|
10522
|
+
data: import_zod32.z.object({
|
|
10523
|
+
limit: import_zod32.z.number().nonnegative().nullable(),
|
|
10524
|
+
limit_remaining: import_zod32.z.number().nullable(),
|
|
10525
|
+
limit_reset: import_zod32.z.string().nullable(),
|
|
10526
|
+
is_free_tier: import_zod32.z.boolean().optional(),
|
|
10527
|
+
free_model_daily_requests: import_zod32.z.object({ used: import_zod32.z.number().nonnegative(), limit: import_zod32.z.number().nonnegative(), remaining: import_zod32.z.number() }).optional()
|
|
10496
10528
|
})
|
|
10497
10529
|
});
|
|
10498
|
-
OpenRouterCreditsSchema =
|
|
10530
|
+
OpenRouterCreditsSchema = import_zod32.z.object({ data: import_zod32.z.object({ total_credits: import_zod32.z.number().nonnegative(), total_usage: import_zod32.z.number().nonnegative() }) });
|
|
10499
10531
|
ANTIGRAVITY_HOST = "daily-cloudcode-pa.googleapis.com";
|
|
10500
10532
|
ANTIGRAVITY_QUOTA_URL = `https://${ANTIGRAVITY_HOST}/v1internal:retrieveUserQuotaSummary`;
|
|
10501
10533
|
ANTIGRAVITY_USER_URL = `https://${ANTIGRAVITY_HOST}/v1internal:loadCodeAssist`;
|
|
@@ -10503,21 +10535,21 @@ var init_providerQuota = __esm({
|
|
|
10503
10535
|
DAYS_PER_WEEK2 = 7;
|
|
10504
10536
|
FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
10505
10537
|
WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
10506
|
-
AntigravityBucketSchema =
|
|
10507
|
-
bucketId:
|
|
10508
|
-
remainingFraction:
|
|
10509
|
-
resetTime:
|
|
10538
|
+
AntigravityBucketSchema = import_zod32.z.object({
|
|
10539
|
+
bucketId: import_zod32.z.string(),
|
|
10540
|
+
remainingFraction: import_zod32.z.number().optional(),
|
|
10541
|
+
resetTime: import_zod32.z.string().optional()
|
|
10510
10542
|
});
|
|
10511
|
-
AntigravitySummarySchema =
|
|
10512
|
-
GoogleTokenInfoSchema =
|
|
10513
|
-
email:
|
|
10514
|
-
sub:
|
|
10543
|
+
AntigravitySummarySchema = import_zod32.z.object({ groups: import_zod32.z.array(import_zod32.z.object({ buckets: import_zod32.z.array(AntigravityBucketSchema) })) });
|
|
10544
|
+
GoogleTokenInfoSchema = import_zod32.z.object({
|
|
10545
|
+
email: import_zod32.z.string().optional(),
|
|
10546
|
+
sub: import_zod32.z.string().optional()
|
|
10515
10547
|
});
|
|
10516
|
-
AntigravityUserSchema =
|
|
10548
|
+
AntigravityUserSchema = import_zod32.z.object({
|
|
10517
10549
|
/** The code-assist tier context, which defaults to the free tier for every account. */
|
|
10518
|
-
currentTier:
|
|
10550
|
+
currentTier: import_zod32.z.object({ name: import_zod32.z.string().optional(), id: import_zod32.z.string().optional() }).optional(),
|
|
10519
10551
|
/** The account's paid subscription; absent when the account has none. */
|
|
10520
|
-
paidTier:
|
|
10552
|
+
paidTier: import_zod32.z.object({ name: import_zod32.z.string().optional(), id: import_zod32.z.string().optional() }).optional()
|
|
10521
10553
|
});
|
|
10522
10554
|
}
|
|
10523
10555
|
});
|
|
@@ -14818,7 +14850,7 @@ init_providersStore();
|
|
|
14818
14850
|
init_signIn();
|
|
14819
14851
|
init_realPorts();
|
|
14820
14852
|
var import_node_path27 = __toESM(require("node:path"), 1);
|
|
14821
|
-
var
|
|
14853
|
+
var import_zod16 = require("zod");
|
|
14822
14854
|
init_envBool();
|
|
14823
14855
|
init_load();
|
|
14824
14856
|
init_schema();
|
|
@@ -14898,9 +14930,9 @@ function lookupKeychainService(run, farmRoot) {
|
|
|
14898
14930
|
}
|
|
14899
14931
|
return { checked: true, found: true, serviceName, note: `Keychain service name for this identity: "${serviceName}".` };
|
|
14900
14932
|
}
|
|
14901
|
-
var SettingsSecretsShapeSchema =
|
|
14902
|
-
env:
|
|
14903
|
-
hooks:
|
|
14933
|
+
var SettingsSecretsShapeSchema = import_zod16.z.looseObject({
|
|
14934
|
+
env: import_zod16.z.record(import_zod16.z.string(), import_zod16.z.unknown()).optional(),
|
|
14935
|
+
hooks: import_zod16.z.record(import_zod16.z.string(), import_zod16.z.array(import_zod16.z.unknown())).optional()
|
|
14904
14936
|
});
|
|
14905
14937
|
function hookCommandCountOf(group) {
|
|
14906
14938
|
if (typeof group !== "object" || group === null) {
|
|
@@ -15193,7 +15225,7 @@ function collectCheckReport(params) {
|
|
|
15193
15225
|
}
|
|
15194
15226
|
|
|
15195
15227
|
// src/checkReportSchema.ts
|
|
15196
|
-
var
|
|
15228
|
+
var import_zod18 = require("zod");
|
|
15197
15229
|
init_schema();
|
|
15198
15230
|
init_claudeVersion();
|
|
15199
15231
|
init_identity();
|
|
@@ -15257,124 +15289,124 @@ var DIAGNOSTIC_CODES = [
|
|
|
15257
15289
|
var DIAGNOSTIC_SEVERITIES = ["error", "warning", "info"];
|
|
15258
15290
|
|
|
15259
15291
|
// src/usage/pickReportSchema.ts
|
|
15260
|
-
var
|
|
15292
|
+
var import_zod17 = require("zod");
|
|
15261
15293
|
init_plan2();
|
|
15262
|
-
var PoolPickCandidateViewSchema =
|
|
15263
|
-
identity:
|
|
15294
|
+
var PoolPickCandidateViewSchema = import_zod17.z.strictObject({
|
|
15295
|
+
identity: import_zod17.z.string(),
|
|
15264
15296
|
/** In pick order: `scored` has usable quota data, `unknown` has none, `pay-per-use` bills by use, `ineligible` is refused right now. */
|
|
15265
|
-
class:
|
|
15297
|
+
class: import_zod17.z.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
|
|
15266
15298
|
/** Plan-size-weighted remaining quota per hour until its reset; present for `scored` only. */
|
|
15267
|
-
score:
|
|
15299
|
+
score: import_zod17.z.number().optional(),
|
|
15268
15300
|
/** 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`. */
|
|
15269
|
-
scoreWindow:
|
|
15301
|
+
scoreWindow: import_zod17.z.enum(["sevenDay", "fiveHour"]).optional(),
|
|
15270
15302
|
/** False when the five-hour window would run dry, at the observed pace, before it resets. */
|
|
15271
|
-
feasible:
|
|
15303
|
+
feasible: import_zod17.z.boolean(),
|
|
15272
15304
|
/** When an `ineligible` member can be used again, as an ISO instant. */
|
|
15273
|
-
blockedUntil:
|
|
15305
|
+
blockedUntil: import_zod17.z.iso.datetime().optional(),
|
|
15274
15306
|
plan: PlanClassSchema,
|
|
15275
15307
|
/** The facts behind the class and score, in the order they matter. */
|
|
15276
|
-
reasons:
|
|
15308
|
+
reasons: import_zod17.z.array(import_zod17.z.string())
|
|
15277
15309
|
});
|
|
15278
|
-
var PoolPickReportSchema =
|
|
15279
|
-
pool:
|
|
15280
|
-
directory:
|
|
15310
|
+
var PoolPickReportSchema = import_zod17.z.strictObject({
|
|
15311
|
+
pool: import_zod17.z.string(),
|
|
15312
|
+
directory: import_zod17.z.string(),
|
|
15281
15313
|
/** The member a launch would run as, absent when every member is refused. */
|
|
15282
|
-
pick:
|
|
15283
|
-
candidates:
|
|
15314
|
+
pick: import_zod17.z.string().optional(),
|
|
15315
|
+
candidates: import_zod17.z.array(PoolPickCandidateViewSchema),
|
|
15284
15316
|
/** Identity members anywhere in the pool's graph that do not exist; a launch skips them. */
|
|
15285
|
-
missing:
|
|
15317
|
+
missing: import_zod17.z.array(import_zod17.z.string()),
|
|
15286
15318
|
/** When nothing can be picked, the soonest any member returns. */
|
|
15287
|
-
earliestReturn:
|
|
15319
|
+
earliestReturn: import_zod17.z.strictObject({ identity: import_zod17.z.string(), at: import_zod17.z.iso.datetime() }).optional(),
|
|
15288
15320
|
/** The member a resumed conversation started on but moved off, and why, when the ranking could not keep it. */
|
|
15289
|
-
movedOff:
|
|
15321
|
+
movedOff: import_zod17.z.strictObject({ identity: import_zod17.z.string(), reason: import_zod17.z.string() }).optional(),
|
|
15290
15322
|
/** Why the last-pick record could not be read, when that is the case. */
|
|
15291
|
-
stickyProblem:
|
|
15323
|
+
stickyProblem: import_zod17.z.string().optional()
|
|
15292
15324
|
});
|
|
15293
15325
|
|
|
15294
15326
|
// src/checkReportSchema.ts
|
|
15295
15327
|
var CHECK_CREDENTIAL_APPLIES = ["provider", "identity", "stored-login"];
|
|
15296
|
-
var CheckLayerViewSchema =
|
|
15297
|
-
id:
|
|
15298
|
-
kind:
|
|
15299
|
-
source:
|
|
15328
|
+
var CheckLayerViewSchema = import_zod18.z.strictObject({
|
|
15329
|
+
id: import_zod18.z.int(),
|
|
15330
|
+
kind: import_zod18.z.enum(LAYER_KINDS),
|
|
15331
|
+
source: import_zod18.z.string()
|
|
15300
15332
|
});
|
|
15301
|
-
var CheckEntryViewSchema =
|
|
15302
|
-
path:
|
|
15303
|
-
shared:
|
|
15304
|
-
via:
|
|
15333
|
+
var CheckEntryViewSchema = import_zod18.z.strictObject({
|
|
15334
|
+
path: import_zod18.z.string(),
|
|
15335
|
+
shared: import_zod18.z.boolean(),
|
|
15336
|
+
via: import_zod18.z.enum(DECISION_VIAS),
|
|
15305
15337
|
/** The entry's real category, or null when nothing classifies it. */
|
|
15306
|
-
category:
|
|
15307
|
-
rule:
|
|
15338
|
+
category: import_zod18.z.enum(CATEGORY_NAMES).nullable(),
|
|
15339
|
+
rule: import_zod18.z.strictObject({ key: import_zod18.z.string(), layer: import_zod18.z.int() }).optional(),
|
|
15308
15340
|
/** Rules that matched but whose `when` condition failed, each with the conditions that failed. */
|
|
15309
|
-
eliminated:
|
|
15341
|
+
eliminated: import_zod18.z.readonly(import_zod18.z.array(import_zod18.z.strictObject({ key: import_zod18.z.string(), failed: import_zod18.z.readonly(import_zod18.z.array(import_zod18.z.string())) }))).optional()
|
|
15310
15342
|
});
|
|
15311
|
-
var CheckDiagnosticSchema =
|
|
15312
|
-
code:
|
|
15313
|
-
severity:
|
|
15314
|
-
message:
|
|
15315
|
-
subject:
|
|
15316
|
-
layer:
|
|
15343
|
+
var CheckDiagnosticSchema = import_zod18.z.strictObject({
|
|
15344
|
+
code: import_zod18.z.enum(DIAGNOSTIC_CODES),
|
|
15345
|
+
severity: import_zod18.z.enum(DIAGNOSTIC_SEVERITIES),
|
|
15346
|
+
message: import_zod18.z.string(),
|
|
15347
|
+
subject: import_zod18.z.string().optional(),
|
|
15348
|
+
layer: import_zod18.z.int().optional()
|
|
15317
15349
|
});
|
|
15318
|
-
var CheckAmbientCredentialSchema =
|
|
15319
|
-
var CheckKeychainSchema =
|
|
15320
|
-
checked:
|
|
15321
|
-
found:
|
|
15322
|
-
serviceName:
|
|
15323
|
-
note:
|
|
15350
|
+
var CheckAmbientCredentialSchema = import_zod18.z.union([import_zod18.z.strictObject({ ok: import_zod18.z.literal(true) }), import_zod18.z.strictObject({ ok: import_zod18.z.literal(false), variable: import_zod18.z.string(), message: import_zod18.z.string() })]);
|
|
15351
|
+
var CheckKeychainSchema = import_zod18.z.strictObject({
|
|
15352
|
+
checked: import_zod18.z.literal(true),
|
|
15353
|
+
found: import_zod18.z.boolean(),
|
|
15354
|
+
serviceName: import_zod18.z.string().optional(),
|
|
15355
|
+
note: import_zod18.z.string()
|
|
15324
15356
|
});
|
|
15325
|
-
var CheckSettingsExposureSchema =
|
|
15326
|
-
file:
|
|
15327
|
-
envKeyNames:
|
|
15328
|
-
hookEventNames:
|
|
15329
|
-
hookCommandCount:
|
|
15357
|
+
var CheckSettingsExposureSchema = import_zod18.z.strictObject({
|
|
15358
|
+
file: import_zod18.z.string(),
|
|
15359
|
+
envKeyNames: import_zod18.z.readonly(import_zod18.z.array(import_zod18.z.string())),
|
|
15360
|
+
hookEventNames: import_zod18.z.readonly(import_zod18.z.array(import_zod18.z.string())),
|
|
15361
|
+
hookCommandCount: import_zod18.z.int().nonnegative()
|
|
15330
15362
|
});
|
|
15331
|
-
var CredentialSourceSummarySchema =
|
|
15332
|
-
|
|
15333
|
-
|
|
15334
|
-
|
|
15335
|
-
|
|
15336
|
-
|
|
15337
|
-
|
|
15363
|
+
var CredentialSourceSummarySchema = import_zod18.z.union([
|
|
15364
|
+
import_zod18.z.strictObject({ kind: import_zod18.z.literal("env"), variable: import_zod18.z.string() }),
|
|
15365
|
+
import_zod18.z.strictObject({ kind: import_zod18.z.literal("file"), path: import_zod18.z.string() }),
|
|
15366
|
+
import_zod18.z.strictObject({ kind: import_zod18.z.literal("command"), program: import_zod18.z.string() }),
|
|
15367
|
+
import_zod18.z.strictObject({ kind: import_zod18.z.literal("op"), reference: import_zod18.z.string() }),
|
|
15368
|
+
import_zod18.z.strictObject({ kind: import_zod18.z.literal("keychain"), service: import_zod18.z.string(), account: import_zod18.z.string().optional() }),
|
|
15369
|
+
import_zod18.z.strictObject({ kind: import_zod18.z.literal("literal") })
|
|
15338
15370
|
]);
|
|
15339
|
-
var CredentialSummarySchema =
|
|
15340
|
-
target:
|
|
15341
|
-
sources:
|
|
15371
|
+
var CredentialSummarySchema = import_zod18.z.strictObject({
|
|
15372
|
+
target: import_zod18.z.enum(CREDENTIAL_TARGETS),
|
|
15373
|
+
sources: import_zod18.z.readonly(import_zod18.z.array(CredentialSourceSummarySchema)),
|
|
15342
15374
|
cache: CredentialCacheSchema.optional()
|
|
15343
15375
|
});
|
|
15344
|
-
var CachedCredentialStateSchema =
|
|
15345
|
-
|
|
15346
|
-
|
|
15347
|
-
|
|
15376
|
+
var CachedCredentialStateSchema = import_zod18.z.union([
|
|
15377
|
+
import_zod18.z.strictObject({ store: import_zod18.z.enum(CREDENTIAL_CACHE_STORES), status: import_zod18.z.literal("empty") }),
|
|
15378
|
+
import_zod18.z.strictObject({ store: import_zod18.z.enum(CREDENTIAL_CACHE_STORES), status: import_zod18.z.literal("unreadable"), reason: import_zod18.z.string() }),
|
|
15379
|
+
import_zod18.z.strictObject({ store: import_zod18.z.enum(CREDENTIAL_CACHE_STORES), status: import_zod18.z.enum(["fresh", "expired"]), ageMs: import_zod18.z.number(), expiresInMs: import_zod18.z.number().optional() })
|
|
15348
15380
|
]);
|
|
15349
|
-
var CheckCredentialProviderSchema =
|
|
15350
|
-
|
|
15351
|
-
|
|
15381
|
+
var CheckCredentialProviderSchema = import_zod18.z.union([
|
|
15382
|
+
import_zod18.z.strictObject({ name: import_zod18.z.string(), credential: CredentialSummarySchema.optional(), cached: CachedCredentialStateSchema.optional() }),
|
|
15383
|
+
import_zod18.z.strictObject({ name: import_zod18.z.string(), problem: import_zod18.z.string() })
|
|
15352
15384
|
]);
|
|
15353
|
-
var CheckCredentialSchema =
|
|
15354
|
-
applies:
|
|
15385
|
+
var CheckCredentialSchema = import_zod18.z.strictObject({
|
|
15386
|
+
applies: import_zod18.z.enum(CHECK_CREDENTIAL_APPLIES),
|
|
15355
15387
|
provider: CheckCredentialProviderSchema.optional(),
|
|
15356
15388
|
identity: CredentialSummarySchema.optional(),
|
|
15357
15389
|
identityCached: CachedCredentialStateSchema.optional()
|
|
15358
15390
|
});
|
|
15359
|
-
var CheckClaudeVersionSchema =
|
|
15360
|
-
pinned:
|
|
15361
|
-
highestInstalled:
|
|
15362
|
-
installed:
|
|
15391
|
+
var CheckClaudeVersionSchema = import_zod18.z.strictObject({
|
|
15392
|
+
pinned: import_zod18.z.strictObject({ version: import_zod18.z.string(), source: import_zod18.z.enum(CLAUDE_VERSION_SOURCES), installed: import_zod18.z.boolean() }).optional(),
|
|
15393
|
+
highestInstalled: import_zod18.z.string().optional(),
|
|
15394
|
+
installed: import_zod18.z.readonly(import_zod18.z.array(import_zod18.z.string()))
|
|
15363
15395
|
});
|
|
15364
|
-
var CheckReportJsonSchema =
|
|
15365
|
-
identity:
|
|
15396
|
+
var CheckReportJsonSchema = import_zod18.z.strictObject({
|
|
15397
|
+
identity: import_zod18.z.strictObject({ name: import_zod18.z.string().nullable(), source: import_zod18.z.enum(IDENTITY_DECISION_SOURCES) }),
|
|
15366
15398
|
/** The pool ranking, when the launch named a pool instead of an identity. */
|
|
15367
15399
|
pool: PoolPickReportSchema.optional(),
|
|
15368
|
-
configProfile:
|
|
15369
|
-
layers:
|
|
15370
|
-
entries:
|
|
15371
|
-
projectEncodingAmbiguities:
|
|
15372
|
-
|
|
15400
|
+
configProfile: import_zod18.z.strictObject({ name: import_zod18.z.string().nullable(), source: import_zod18.z.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
|
|
15401
|
+
layers: import_zod18.z.readonly(import_zod18.z.array(CheckLayerViewSchema)),
|
|
15402
|
+
entries: import_zod18.z.readonly(import_zod18.z.array(CheckEntryViewSchema)),
|
|
15403
|
+
projectEncodingAmbiguities: import_zod18.z.readonly(
|
|
15404
|
+
import_zod18.z.array(import_zod18.z.strictObject({ fragment: import_zod18.z.string(), encoded: import_zod18.z.string(), reason: import_zod18.z.enum(ENCODING_AMBIGUITY_REASONS), detail: import_zod18.z.string() }))
|
|
15373
15405
|
),
|
|
15374
|
-
diagnostics:
|
|
15406
|
+
diagnostics: import_zod18.z.readonly(import_zod18.z.array(CheckDiagnosticSchema)),
|
|
15375
15407
|
ambientCredential: CheckAmbientCredentialSchema,
|
|
15376
15408
|
keychain: CheckKeychainSchema.optional(),
|
|
15377
|
-
settingsExposure:
|
|
15409
|
+
settingsExposure: import_zod18.z.readonly(import_zod18.z.array(CheckSettingsExposureSchema)),
|
|
15378
15410
|
credential: CheckCredentialSchema,
|
|
15379
15411
|
claudeVersion: CheckClaudeVersionSchema.optional()
|
|
15380
15412
|
});
|
|
@@ -15434,28 +15466,28 @@ function collectResets(snapshots, nowMs) {
|
|
|
15434
15466
|
}
|
|
15435
15467
|
|
|
15436
15468
|
// src/usage/resetsSchema.ts
|
|
15437
|
-
var
|
|
15438
|
-
var ResetRowSchema =
|
|
15439
|
-
identity:
|
|
15440
|
-
provider:
|
|
15469
|
+
var import_zod19 = require("zod");
|
|
15470
|
+
var ResetRowSchema = import_zod19.z.strictObject({
|
|
15471
|
+
identity: import_zod19.z.string(),
|
|
15472
|
+
provider: import_zod19.z.string(),
|
|
15441
15473
|
/** What the window is: `5h`, `7d` or `extra usage` for an Anthropic account, or the provider's own measure and period (`tokens 5h`). */
|
|
15442
|
-
window:
|
|
15474
|
+
window: import_zod19.z.string(),
|
|
15443
15475
|
/** When the state the window comes from was observed, as an ISO instant. */
|
|
15444
|
-
observedAt:
|
|
15476
|
+
observedAt: import_zod19.z.iso.datetime(),
|
|
15445
15477
|
/** When the window resets, as an ISO instant; absent when the upstream reported none. */
|
|
15446
|
-
resetsAt:
|
|
15478
|
+
resetsAt: import_zod19.z.iso.datetime().optional(),
|
|
15447
15479
|
/** True when the reset time has passed, so the recorded observation describes a window that no longer exists and its utilisation reads as 0. */
|
|
15448
|
-
reset:
|
|
15480
|
+
reset: import_zod19.z.boolean(),
|
|
15449
15481
|
/** The fraction used, as `effectiveWindow` reads it at the report's own clock. */
|
|
15450
|
-
utilization:
|
|
15482
|
+
utilization: import_zod19.z.number().optional(),
|
|
15451
15483
|
/** The window's own status, for a window that has not reset yet. */
|
|
15452
|
-
status:
|
|
15484
|
+
status: import_zod19.z.string().optional()
|
|
15453
15485
|
});
|
|
15454
|
-
var ResetScheduleSchema =
|
|
15486
|
+
var ResetScheduleSchema = import_zod19.z.strictObject({ resets: import_zod19.z.readonly(import_zod19.z.array(ResetRowSchema)) });
|
|
15455
15487
|
|
|
15456
15488
|
// src/frontdoor/controlSchemas.ts
|
|
15457
15489
|
var import_node_path32 = __toESM(require("node:path"), 1);
|
|
15458
|
-
var
|
|
15490
|
+
var import_zod26 = require("zod");
|
|
15459
15491
|
|
|
15460
15492
|
// src/doctorReport.ts
|
|
15461
15493
|
init_claudeShim();
|
|
@@ -15635,24 +15667,24 @@ var import_node_path31 = __toESM(require("node:path"), 1);
|
|
|
15635
15667
|
init_signIn();
|
|
15636
15668
|
|
|
15637
15669
|
// src/codex/siwcStore.ts
|
|
15638
|
-
var
|
|
15670
|
+
var import_zod23 = require("zod");
|
|
15639
15671
|
|
|
15640
15672
|
// src/codex/auth.ts
|
|
15641
|
-
var
|
|
15642
|
-
var AuthFileSchema =
|
|
15643
|
-
tokens:
|
|
15644
|
-
access_token:
|
|
15645
|
-
refresh_token:
|
|
15646
|
-
id_token:
|
|
15647
|
-
account_id:
|
|
15673
|
+
var import_zod21 = require("zod");
|
|
15674
|
+
var AuthFileSchema = import_zod21.z.looseObject({
|
|
15675
|
+
tokens: import_zod21.z.looseObject({
|
|
15676
|
+
access_token: import_zod21.z.string().optional(),
|
|
15677
|
+
refresh_token: import_zod21.z.string().optional(),
|
|
15678
|
+
id_token: import_zod21.z.string().optional(),
|
|
15679
|
+
account_id: import_zod21.z.string().optional()
|
|
15648
15680
|
}).nullish(),
|
|
15649
|
-
last_refresh:
|
|
15681
|
+
last_refresh: import_zod21.z.string().optional()
|
|
15650
15682
|
});
|
|
15651
|
-
var TokenGrantSchema =
|
|
15652
|
-
access_token:
|
|
15653
|
-
refresh_token:
|
|
15654
|
-
id_token:
|
|
15655
|
-
account_id:
|
|
15683
|
+
var TokenGrantSchema = import_zod21.z.looseObject({
|
|
15684
|
+
access_token: import_zod21.z.string().min(1).optional(),
|
|
15685
|
+
refresh_token: import_zod21.z.string().min(1).optional(),
|
|
15686
|
+
id_token: import_zod21.z.string().min(1).optional(),
|
|
15687
|
+
account_id: import_zod21.z.string().min(1).optional()
|
|
15656
15688
|
});
|
|
15657
15689
|
var CodexAuthError = class extends Error {
|
|
15658
15690
|
constructor(message) {
|
|
@@ -15662,41 +15694,41 @@ var CodexAuthError = class extends Error {
|
|
|
15662
15694
|
};
|
|
15663
15695
|
|
|
15664
15696
|
// src/codex/siwc.ts
|
|
15665
|
-
var
|
|
15697
|
+
var import_zod22 = require("zod");
|
|
15666
15698
|
var SIWC_RESOURCE = "https://api.openai.com/v1";
|
|
15667
15699
|
var SIWC_RESPONSES_URL = `${SIWC_RESOURCE}/responses`;
|
|
15668
15700
|
var SIWC_PLAN_SCOPE = "chatgpt.tokens.use.direct";
|
|
15669
|
-
var TokenResponseSchema =
|
|
15670
|
-
access_token:
|
|
15671
|
-
refresh_token:
|
|
15672
|
-
id_token:
|
|
15673
|
-
expires_in:
|
|
15674
|
-
scope:
|
|
15701
|
+
var TokenResponseSchema = import_zod22.z.looseObject({
|
|
15702
|
+
access_token: import_zod22.z.string().min(1),
|
|
15703
|
+
refresh_token: import_zod22.z.string().min(1).optional(),
|
|
15704
|
+
id_token: import_zod22.z.string().min(1).optional(),
|
|
15705
|
+
expires_in: import_zod22.z.number().positive(),
|
|
15706
|
+
scope: import_zod22.z.string().optional()
|
|
15675
15707
|
});
|
|
15676
|
-
var JwtHeaderSchema =
|
|
15677
|
-
var IdTokenClaimsSchema =
|
|
15678
|
-
iss:
|
|
15679
|
-
sub:
|
|
15680
|
-
aud:
|
|
15681
|
-
exp:
|
|
15682
|
-
nonce:
|
|
15683
|
-
email:
|
|
15708
|
+
var JwtHeaderSchema = import_zod22.z.looseObject({ alg: import_zod22.z.string(), kid: import_zod22.z.string().optional() });
|
|
15709
|
+
var IdTokenClaimsSchema = import_zod22.z.looseObject({
|
|
15710
|
+
iss: import_zod22.z.string(),
|
|
15711
|
+
sub: import_zod22.z.string().min(1),
|
|
15712
|
+
aud: import_zod22.z.union([import_zod22.z.string(), import_zod22.z.array(import_zod22.z.string())]),
|
|
15713
|
+
exp: import_zod22.z.number(),
|
|
15714
|
+
nonce: import_zod22.z.string().optional(),
|
|
15715
|
+
email: import_zod22.z.string().optional()
|
|
15684
15716
|
});
|
|
15685
|
-
var JwksSchema =
|
|
15717
|
+
var JwksSchema = import_zod22.z.object({ keys: import_zod22.z.array(import_zod22.z.looseObject({ kid: import_zod22.z.string().optional(), kty: import_zod22.z.string() })) });
|
|
15686
15718
|
|
|
15687
15719
|
// src/codex/siwcStore.ts
|
|
15688
|
-
var SiwcGrantSchema =
|
|
15689
|
-
clientId:
|
|
15690
|
-
sub:
|
|
15691
|
-
email:
|
|
15692
|
-
idToken:
|
|
15693
|
-
accessToken:
|
|
15694
|
-
refreshToken:
|
|
15695
|
-
scopes:
|
|
15720
|
+
var SiwcGrantSchema = import_zod23.z.strictObject({
|
|
15721
|
+
clientId: import_zod23.z.string().min(1),
|
|
15722
|
+
sub: import_zod23.z.string().min(1),
|
|
15723
|
+
email: import_zod23.z.string().optional(),
|
|
15724
|
+
idToken: import_zod23.z.string().min(1),
|
|
15725
|
+
accessToken: import_zod23.z.string().min(1),
|
|
15726
|
+
refreshToken: import_zod23.z.string().min(1),
|
|
15727
|
+
scopes: import_zod23.z.array(import_zod23.z.string()).readonly(),
|
|
15696
15728
|
/** When the access token stops working, in milliseconds since the epoch. */
|
|
15697
|
-
expiresAt:
|
|
15729
|
+
expiresAt: import_zod23.z.number()
|
|
15698
15730
|
});
|
|
15699
|
-
var SiwcFileSchema =
|
|
15731
|
+
var SiwcFileSchema = import_zod23.z.strictObject({ registeredClientId: import_zod23.z.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
|
|
15700
15732
|
function parseSiwcFile(raw, filePath) {
|
|
15701
15733
|
let json;
|
|
15702
15734
|
try {
|
|
@@ -15978,6 +16010,7 @@ function realFrontDoorListenerProbes(paths) {
|
|
|
15978
16010
|
// src/doctorReport.ts
|
|
15979
16011
|
init_supervisorProcesses();
|
|
15980
16012
|
init_legacy();
|
|
16013
|
+
init_providerAliases();
|
|
15981
16014
|
init_providersStore();
|
|
15982
16015
|
init_guard();
|
|
15983
16016
|
init_identity();
|
|
@@ -16306,6 +16339,10 @@ function runDoctor(params) {
|
|
|
16306
16339
|
for (const entry of params.providers) {
|
|
16307
16340
|
pushProvider(push, entry, params.credentialCache, params.chatgptSignIn);
|
|
16308
16341
|
}
|
|
16342
|
+
const providerNames = new Set(params.providers.map((entry) => entry.name));
|
|
16343
|
+
for (const finding of aliasFindings(params.providerAliases ?? {}, providerNames)) {
|
|
16344
|
+
push("provider", finding.level, finding.message, finding.alias);
|
|
16345
|
+
}
|
|
16309
16346
|
if (params.platform !== "darwin" || params.run === void 0) {
|
|
16310
16347
|
push("keychain", "pass", "Skipped (not macOS).");
|
|
16311
16348
|
} else {
|
|
@@ -16595,6 +16632,7 @@ function collectDoctorReport(params) {
|
|
|
16595
16632
|
identities,
|
|
16596
16633
|
configProfiles,
|
|
16597
16634
|
providers,
|
|
16635
|
+
providerAliases: readProviderAliases(paths),
|
|
16598
16636
|
directoryRules: { path: paths.directoryRulesFile, raw: realFsPort.readFileUtf8(paths.directoryRulesFile) },
|
|
16599
16637
|
globalConfig: { path: paths.globalConfigFile, raw: realFsPort.readFileUtf8(paths.globalConfigFile) },
|
|
16600
16638
|
models: parsedModelsOf(paths),
|
|
@@ -16650,90 +16688,90 @@ function collectDoctorReport(params) {
|
|
|
16650
16688
|
// src/frontdoor/controlSchemas.ts
|
|
16651
16689
|
init_schema2();
|
|
16652
16690
|
init_state();
|
|
16653
|
-
var UsageListOutputSchema =
|
|
16654
|
-
var UsageWindowsInputSchema =
|
|
16655
|
-
identity:
|
|
16656
|
-
provider:
|
|
16691
|
+
var UsageListOutputSchema = import_zod26.z.strictObject({ snapshots: import_zod26.z.readonly(import_zod26.z.array(UsageSnapshotSchema)) });
|
|
16692
|
+
var UsageWindowsInputSchema = import_zod26.z.strictObject({
|
|
16693
|
+
identity: import_zod26.z.string().min(1),
|
|
16694
|
+
provider: import_zod26.z.string().min(1).optional()
|
|
16657
16695
|
});
|
|
16658
|
-
var EffectiveWindowSchema =
|
|
16696
|
+
var EffectiveWindowSchema = import_zod26.z.strictObject({
|
|
16659
16697
|
/** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
|
|
16660
|
-
reset:
|
|
16698
|
+
reset: import_zod26.z.boolean(),
|
|
16661
16699
|
/** The fraction used: 0 for a reset window, otherwise what was last observed, absent when none was reported. */
|
|
16662
|
-
utilization:
|
|
16700
|
+
utilization: import_zod26.z.number().optional(),
|
|
16663
16701
|
/** The reset instant, for a window that has not reset yet and reported one. */
|
|
16664
|
-
resetsAtMs:
|
|
16702
|
+
resetsAtMs: import_zod26.z.number().optional(),
|
|
16665
16703
|
/** The window's own status, for a window that has not reset yet. */
|
|
16666
|
-
status:
|
|
16704
|
+
status: import_zod26.z.string().optional()
|
|
16667
16705
|
});
|
|
16668
|
-
var UsageWindowsOutputSchema =
|
|
16669
|
-
identity:
|
|
16670
|
-
provider:
|
|
16706
|
+
var UsageWindowsOutputSchema = import_zod26.z.strictObject({
|
|
16707
|
+
identity: import_zod26.z.string(),
|
|
16708
|
+
provider: import_zod26.z.string(),
|
|
16671
16709
|
/** When the rate-limit state the windows come from was observed. */
|
|
16672
|
-
observedAt:
|
|
16710
|
+
observedAt: import_zod26.z.iso.datetime().optional(),
|
|
16673
16711
|
fiveHour: EffectiveWindowSchema.optional(),
|
|
16674
16712
|
sevenDay: EffectiveWindowSchema.optional()
|
|
16675
16713
|
});
|
|
16676
|
-
var UsageLiveOutputSchema =
|
|
16714
|
+
var UsageLiveOutputSchema = import_zod26.z.strictObject({
|
|
16677
16715
|
/** 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. */
|
|
16678
16716
|
latest: RcLiveRateLimitSchema.optional(),
|
|
16679
16717
|
/** One observation per session whose stream has filed a rate_limit_event this door generation. */
|
|
16680
|
-
sessions:
|
|
16718
|
+
sessions: import_zod26.z.readonly(import_zod26.z.array(RcLiveRateLimitSchema))
|
|
16681
16719
|
});
|
|
16682
|
-
var FrontDoorSessionStatusSchema =
|
|
16683
|
-
pid:
|
|
16684
|
-
startedAt:
|
|
16685
|
-
alive:
|
|
16720
|
+
var FrontDoorSessionStatusSchema = import_zod26.z.strictObject({
|
|
16721
|
+
pid: import_zod26.z.int().positive(),
|
|
16722
|
+
startedAt: import_zod26.z.number(),
|
|
16723
|
+
alive: import_zod26.z.boolean()
|
|
16686
16724
|
});
|
|
16687
|
-
var HeadroomSocketTargetSchema =
|
|
16688
|
-
var FrontDoorStatusOutputSchema =
|
|
16725
|
+
var HeadroomSocketTargetSchema = import_zod26.z.union([import_zod26.z.strictObject({ socketPath: import_zod26.z.string() }), import_zod26.z.strictObject({ refused: import_zod26.z.string() })]);
|
|
16726
|
+
var FrontDoorStatusOutputSchema = import_zod26.z.strictObject({
|
|
16689
16727
|
state: FrontDoorStateSchema,
|
|
16690
|
-
supervisorAlive:
|
|
16691
|
-
sessions:
|
|
16728
|
+
supervisorAlive: import_zod26.z.boolean(),
|
|
16729
|
+
sessions: import_zod26.z.readonly(import_zod26.z.array(FrontDoorSessionStatusSchema)),
|
|
16692
16730
|
headroomSocket: HeadroomSocketTargetSchema.optional(),
|
|
16693
|
-
logPath:
|
|
16694
|
-
logExists:
|
|
16731
|
+
logPath: import_zod26.z.string(),
|
|
16732
|
+
logExists: import_zod26.z.boolean()
|
|
16695
16733
|
});
|
|
16696
|
-
var FrontDoorSessionsOutputSchema =
|
|
16697
|
-
var CheckRunInputSchema =
|
|
16698
|
-
path:
|
|
16699
|
-
identity:
|
|
16734
|
+
var FrontDoorSessionsOutputSchema = import_zod26.z.strictObject({ sessions: import_zod26.z.readonly(import_zod26.z.array(FrontDoorSessionStatusSchema)) });
|
|
16735
|
+
var CheckRunInputSchema = import_zod26.z.strictObject({
|
|
16736
|
+
path: import_zod26.z.string().min(1),
|
|
16737
|
+
identity: import_zod26.z.string().min(1).optional()
|
|
16700
16738
|
}).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" });
|
|
16701
|
-
var PoolPickInputSchema =
|
|
16702
|
-
pool:
|
|
16703
|
-
path:
|
|
16739
|
+
var PoolPickInputSchema = import_zod26.z.strictObject({
|
|
16740
|
+
pool: import_zod26.z.string().min(1),
|
|
16741
|
+
path: import_zod26.z.string().min(1)
|
|
16704
16742
|
}).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" });
|
|
16705
|
-
var DoctorFindingSchema =
|
|
16706
|
-
section:
|
|
16707
|
-
subject:
|
|
16708
|
-
severity:
|
|
16709
|
-
message:
|
|
16743
|
+
var DoctorFindingSchema = import_zod26.z.strictObject({
|
|
16744
|
+
section: import_zod26.z.enum(DOCTOR_SECTIONS),
|
|
16745
|
+
subject: import_zod26.z.string().optional(),
|
|
16746
|
+
severity: import_zod26.z.enum(DOCTOR_SEVERITIES),
|
|
16747
|
+
message: import_zod26.z.string()
|
|
16710
16748
|
});
|
|
16711
|
-
var DoctorRunOutputSchema =
|
|
16749
|
+
var DoctorRunOutputSchema = import_zod26.z.strictObject({
|
|
16712
16750
|
/** False exactly when any finding is a `fail`; a `warn` never fails the report on its own. */
|
|
16713
|
-
ok:
|
|
16714
|
-
findings:
|
|
16751
|
+
ok: import_zod26.z.boolean(),
|
|
16752
|
+
findings: import_zod26.z.readonly(import_zod26.z.array(DoctorFindingSchema))
|
|
16715
16753
|
});
|
|
16716
|
-
var FrontDoorRestartOutputSchema =
|
|
16717
|
-
action:
|
|
16718
|
-
previousPid:
|
|
16754
|
+
var FrontDoorRestartOutputSchema = import_zod26.z.strictObject({
|
|
16755
|
+
action: import_zod26.z.literal("restarting"),
|
|
16756
|
+
previousPid: import_zod26.z.int().positive()
|
|
16719
16757
|
});
|
|
16720
|
-
var UpdateCheckOutputSchema =
|
|
16721
|
-
current:
|
|
16722
|
-
latest:
|
|
16723
|
-
action:
|
|
16758
|
+
var UpdateCheckOutputSchema = import_zod26.z.strictObject({
|
|
16759
|
+
current: import_zod26.z.string(),
|
|
16760
|
+
latest: import_zod26.z.string(),
|
|
16761
|
+
action: import_zod26.z.enum(["current", "available", "updated"])
|
|
16724
16762
|
});
|
|
16725
|
-
var CodexSignInSchema =
|
|
16726
|
-
|
|
16727
|
-
|
|
16728
|
-
|
|
16763
|
+
var CodexSignInSchema = import_zod26.z.discriminatedUnion("state", [
|
|
16764
|
+
import_zod26.z.strictObject({ state: import_zod26.z.literal("none") }),
|
|
16765
|
+
import_zod26.z.strictObject({ state: import_zod26.z.literal("signed-in"), email: import_zod26.z.string().optional(), planScope: import_zod26.z.boolean(), accessTokenExpiresAt: import_zod26.z.number() }),
|
|
16766
|
+
import_zod26.z.strictObject({ state: import_zod26.z.literal("unreadable"), message: import_zod26.z.string() })
|
|
16729
16767
|
]);
|
|
16730
|
-
var CodexStatusOutputSchema =
|
|
16768
|
+
var CodexStatusOutputSchema = import_zod26.z.strictObject({
|
|
16731
16769
|
signIn: CodexSignInSchema,
|
|
16732
|
-
codexProviders:
|
|
16770
|
+
codexProviders: import_zod26.z.readonly(import_zod26.z.array(import_zod26.z.string()))
|
|
16733
16771
|
});
|
|
16734
|
-
var CodexLogoutOutputSchema =
|
|
16735
|
-
hadGrant:
|
|
16736
|
-
revoked:
|
|
16772
|
+
var CodexLogoutOutputSchema = import_zod26.z.strictObject({
|
|
16773
|
+
hadGrant: import_zod26.z.boolean(),
|
|
16774
|
+
revoked: import_zod26.z.boolean()
|
|
16737
16775
|
});
|
|
16738
16776
|
|
|
16739
16777
|
// src/frontdoor/codexApi.ts
|
|
@@ -16890,144 +16928,143 @@ init_identity();
|
|
|
16890
16928
|
init_providersStore();
|
|
16891
16929
|
|
|
16892
16930
|
// src/frontdoor/configSchemas.ts
|
|
16893
|
-
var
|
|
16931
|
+
var import_zod27 = require("zod");
|
|
16894
16932
|
init_schema();
|
|
16895
|
-
var RemovalConfirmationSchema =
|
|
16896
|
-
var CredentialWriteSchema = (targets) =>
|
|
16897
|
-
sources:
|
|
16898
|
-
target:
|
|
16899
|
-
cache:
|
|
16933
|
+
var RemovalConfirmationSchema = import_zod27.z.boolean();
|
|
16934
|
+
var CredentialWriteSchema = (targets) => import_zod27.z.strictObject({
|
|
16935
|
+
sources: import_zod27.z.array(RemoteCredentialSourceSchema).min(1).optional(),
|
|
16936
|
+
target: import_zod27.z.enum(targets).optional(),
|
|
16937
|
+
cache: import_zod27.z.union([import_zod27.z.literal(false), CredentialCacheSchema]).optional()
|
|
16900
16938
|
});
|
|
16901
|
-
var CredentialSummarySchema2 =
|
|
16902
|
-
target:
|
|
16903
|
-
sources:
|
|
16904
|
-
|
|
16905
|
-
|
|
16906
|
-
|
|
16907
|
-
|
|
16908
|
-
|
|
16909
|
-
|
|
16910
|
-
|
|
16939
|
+
var CredentialSummarySchema2 = import_zod27.z.strictObject({
|
|
16940
|
+
target: import_zod27.z.enum(CREDENTIAL_TARGETS),
|
|
16941
|
+
sources: import_zod27.z.readonly(import_zod27.z.array(
|
|
16942
|
+
import_zod27.z.discriminatedUnion("kind", [
|
|
16943
|
+
import_zod27.z.strictObject({ kind: import_zod27.z.literal("env"), variable: import_zod27.z.string() }),
|
|
16944
|
+
import_zod27.z.strictObject({ kind: import_zod27.z.literal("file"), path: import_zod27.z.string() }),
|
|
16945
|
+
import_zod27.z.strictObject({ kind: import_zod27.z.literal("command"), program: import_zod27.z.string() }),
|
|
16946
|
+
import_zod27.z.strictObject({ kind: import_zod27.z.literal("op"), reference: import_zod27.z.string() }),
|
|
16947
|
+
import_zod27.z.strictObject({ kind: import_zod27.z.literal("keychain"), service: import_zod27.z.string(), account: import_zod27.z.string().optional() }),
|
|
16948
|
+
import_zod27.z.strictObject({ kind: import_zod27.z.literal("literal") })
|
|
16911
16949
|
])
|
|
16912
16950
|
)),
|
|
16913
16951
|
cache: CredentialCacheSchema.optional()
|
|
16914
16952
|
});
|
|
16915
|
-
var mutationOutput = (kind, action) =>
|
|
16916
|
-
var storedMutationOutput = (kind, action, value) =>
|
|
16917
|
-
var IdentityValueSchema =
|
|
16918
|
-
name:
|
|
16919
|
-
defaultConfigProfile:
|
|
16920
|
-
allowAmbientCredential:
|
|
16953
|
+
var mutationOutput = (kind, action) => import_zod27.z.strictObject({ action: import_zod27.z.literal(action), kind: import_zod27.z.literal(kind), name: import_zod27.z.string() });
|
|
16954
|
+
var storedMutationOutput = (kind, action, value) => import_zod27.z.strictObject({ action: import_zod27.z.literal(action), kind: import_zod27.z.literal(kind), name: import_zod27.z.string(), value });
|
|
16955
|
+
var IdentityValueSchema = import_zod27.z.strictObject({
|
|
16956
|
+
name: import_zod27.z.string(),
|
|
16957
|
+
defaultConfigProfile: import_zod27.z.string().optional(),
|
|
16958
|
+
allowAmbientCredential: import_zod27.z.boolean(),
|
|
16921
16959
|
credential: CredentialSummarySchema2.optional(),
|
|
16922
|
-
anchors:
|
|
16960
|
+
anchors: import_zod27.z.array(AnchorSchema).optional()
|
|
16923
16961
|
});
|
|
16924
16962
|
var ProfileValueSchema = ConfigProfileSchema.omit({ $schema: true });
|
|
16925
|
-
var ProviderValueSchema =
|
|
16926
|
-
name:
|
|
16927
|
-
kind:
|
|
16928
|
-
displayName:
|
|
16929
|
-
baseUrl:
|
|
16963
|
+
var ProviderValueSchema = import_zod27.z.strictObject({
|
|
16964
|
+
name: import_zod27.z.string(),
|
|
16965
|
+
kind: import_zod27.z.enum(PROVIDER_KINDS),
|
|
16966
|
+
displayName: import_zod27.z.string(),
|
|
16967
|
+
baseUrl: import_zod27.z.string().optional(),
|
|
16930
16968
|
codex: CodexProviderConfigSchema.optional(),
|
|
16931
16969
|
credential: CredentialSummarySchema2.optional(),
|
|
16932
|
-
env:
|
|
16970
|
+
env: import_zod27.z.record(import_zod27.z.string(), import_zod27.z.string()).optional()
|
|
16933
16971
|
});
|
|
16934
|
-
var ConfigNameInputSchema =
|
|
16972
|
+
var ConfigNameInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1) });
|
|
16935
16973
|
var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
|
|
16936
|
-
var ConfigIdentitySetInputSchema =
|
|
16937
|
-
name:
|
|
16938
|
-
defaultConfigProfile:
|
|
16939
|
-
allowAmbientCredential:
|
|
16940
|
-
credential:
|
|
16974
|
+
var ConfigIdentitySetInputSchema = import_zod27.z.strictObject({
|
|
16975
|
+
name: import_zod27.z.string().min(1),
|
|
16976
|
+
defaultConfigProfile: import_zod27.z.union([import_zod27.z.string().min(1), import_zod27.z.literal(false)]).optional(),
|
|
16977
|
+
allowAmbientCredential: import_zod27.z.boolean().optional(),
|
|
16978
|
+
credential: import_zod27.z.union([import_zod27.z.literal(false), CredentialWriteSchema(CREDENTIAL_TARGETS)]).optional(),
|
|
16941
16979
|
/** `false` removes the anchors; a list replaces them. */
|
|
16942
|
-
anchors:
|
|
16980
|
+
anchors: import_zod27.z.union([import_zod27.z.literal(false), import_zod27.z.array(AnchorSchema).min(1)]).optional()
|
|
16943
16981
|
});
|
|
16944
16982
|
var ConfigIdentitySetOutputSchema = storedMutationOutput("identity", "updated", IdentityValueSchema);
|
|
16945
|
-
var ConfigIdentityRemoveInputSchema =
|
|
16983
|
+
var ConfigIdentityRemoveInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16946
16984
|
var ConfigIdentityRemoveOutputSchema = mutationOutput("identity", "removed");
|
|
16947
16985
|
var ConfigIdentityUseOutputSchema = mutationOutput("identity", "selected");
|
|
16948
|
-
var ConfigProfileAddInputSchema =
|
|
16949
|
-
name:
|
|
16950
|
-
extends:
|
|
16951
|
-
description:
|
|
16986
|
+
var ConfigProfileAddInputSchema = import_zod27.z.strictObject({
|
|
16987
|
+
name: import_zod27.z.string().min(1),
|
|
16988
|
+
extends: import_zod27.z.array(import_zod27.z.string().min(1)).optional(),
|
|
16989
|
+
description: import_zod27.z.string().optional()
|
|
16952
16990
|
});
|
|
16953
16991
|
var ConfigProfileAddOutputSchema = storedMutationOutput("profile", "created", ProfileValueSchema);
|
|
16954
|
-
var ConfigProfileSetInputSchema =
|
|
16955
|
-
name:
|
|
16956
|
-
category:
|
|
16957
|
-
entry:
|
|
16958
|
-
extends:
|
|
16959
|
-
description:
|
|
16960
|
-
launch:
|
|
16961
|
-
skipPermissions:
|
|
16962
|
-
remoteControl:
|
|
16963
|
-
headroom:
|
|
16964
|
-
trackUsage:
|
|
16965
|
-
provider:
|
|
16966
|
-
claudeVersion:
|
|
16967
|
-
delay:
|
|
16968
|
-
pause:
|
|
16969
|
-
explain:
|
|
16970
|
-
routeByName: import_zod26.z.boolean().optional()
|
|
16992
|
+
var ConfigProfileSetInputSchema = import_zod27.z.strictObject({
|
|
16993
|
+
name: import_zod27.z.string().min(1),
|
|
16994
|
+
category: import_zod27.z.record(import_zod27.z.string(), import_zod27.z.boolean()).optional(),
|
|
16995
|
+
entry: import_zod27.z.record(import_zod27.z.string(), import_zod27.z.boolean()).optional(),
|
|
16996
|
+
extends: import_zod27.z.union([import_zod27.z.array(import_zod27.z.string().min(1)), import_zod27.z.literal(false)]).optional(),
|
|
16997
|
+
description: import_zod27.z.union([import_zod27.z.string(), import_zod27.z.literal(false)]).optional(),
|
|
16998
|
+
launch: import_zod27.z.strictObject({
|
|
16999
|
+
skipPermissions: import_zod27.z.boolean().optional(),
|
|
17000
|
+
remoteControl: import_zod27.z.boolean().optional(),
|
|
17001
|
+
headroom: import_zod27.z.boolean().optional(),
|
|
17002
|
+
trackUsage: import_zod27.z.boolean().optional(),
|
|
17003
|
+
provider: import_zod27.z.union([import_zod27.z.string().min(1), import_zod27.z.literal(false)]).optional(),
|
|
17004
|
+
claudeVersion: import_zod27.z.union([import_zod27.z.string().min(1), import_zod27.z.literal(false)]).optional(),
|
|
17005
|
+
delay: import_zod27.z.union([import_zod27.z.string().regex(DURATION_RE), import_zod27.z.literal(false)]).optional(),
|
|
17006
|
+
pause: import_zod27.z.boolean().optional(),
|
|
17007
|
+
explain: import_zod27.z.boolean().optional()
|
|
16971
17008
|
}).optional()
|
|
16972
17009
|
});
|
|
16973
17010
|
var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
|
|
16974
|
-
var ConfigProfileRemoveInputSchema =
|
|
17011
|
+
var ConfigProfileRemoveInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16975
17012
|
var ConfigProfileRemoveOutputSchema = mutationOutput("profile", "removed");
|
|
16976
17013
|
var ConfigProfileUseOutputSchema = mutationOutput("profile", "selected");
|
|
16977
|
-
var PoolMembersInputSchema =
|
|
16978
|
-
var ConfigPoolAddInputSchema =
|
|
16979
|
-
name:
|
|
17014
|
+
var PoolMembersInputSchema = import_zod27.z.array(import_zod27.z.string().min(1)).min(1);
|
|
17015
|
+
var ConfigPoolAddInputSchema = import_zod27.z.strictObject({
|
|
17016
|
+
name: import_zod27.z.string().min(1),
|
|
16980
17017
|
identities: PoolMembersInputSchema,
|
|
16981
|
-
preference:
|
|
16982
|
-
resumeOnLimit:
|
|
16983
|
-
compactBeforeLimit:
|
|
17018
|
+
preference: import_zod27.z.enum(POOL_PREFERENCES).optional(),
|
|
17019
|
+
resumeOnLimit: import_zod27.z.boolean().optional(),
|
|
17020
|
+
compactBeforeLimit: import_zod27.z.boolean().optional(),
|
|
16984
17021
|
compactAtUtilisation: CompactAtUtilisationSchema.optional()
|
|
16985
17022
|
});
|
|
16986
17023
|
var ConfigPoolAddOutputSchema = storedMutationOutput("pool", "created", PoolSchema);
|
|
16987
|
-
var ConfigPoolSetInputSchema =
|
|
16988
|
-
name:
|
|
17024
|
+
var ConfigPoolSetInputSchema = import_zod27.z.strictObject({
|
|
17025
|
+
name: import_zod27.z.string().min(1),
|
|
16989
17026
|
identities: PoolMembersInputSchema.optional(),
|
|
16990
|
-
preference:
|
|
16991
|
-
resumeOnLimit:
|
|
16992
|
-
compactBeforeLimit:
|
|
16993
|
-
compactAtUtilisation:
|
|
17027
|
+
preference: import_zod27.z.union([import_zod27.z.enum(POOL_PREFERENCES), import_zod27.z.literal(false)]).optional(),
|
|
17028
|
+
resumeOnLimit: import_zod27.z.boolean().optional(),
|
|
17029
|
+
compactBeforeLimit: import_zod27.z.boolean().optional(),
|
|
17030
|
+
compactAtUtilisation: import_zod27.z.union([CompactAtUtilisationSchema, import_zod27.z.literal(false)]).optional()
|
|
16994
17031
|
});
|
|
16995
17032
|
var ConfigPoolSetOutputSchema = storedMutationOutput("pool", "updated", PoolSchema);
|
|
16996
|
-
var ConfigPoolRemoveInputSchema =
|
|
17033
|
+
var ConfigPoolRemoveInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16997
17034
|
var ConfigPoolRemoveOutputSchema = mutationOutput("pool", "removed");
|
|
16998
17035
|
var ConfigPoolUseOutputSchema = mutationOutput("pool", "selected");
|
|
16999
|
-
var ConfigProviderAddInputSchema =
|
|
17000
|
-
name:
|
|
17001
|
-
kind:
|
|
17002
|
-
displayName:
|
|
17003
|
-
baseUrl:
|
|
17036
|
+
var ConfigProviderAddInputSchema = import_zod27.z.strictObject({
|
|
17037
|
+
name: import_zod27.z.string().min(1),
|
|
17038
|
+
kind: import_zod27.z.enum(PROVIDER_KINDS).optional(),
|
|
17039
|
+
displayName: import_zod27.z.string().min(1),
|
|
17040
|
+
baseUrl: import_zod27.z.string().min(1).optional(),
|
|
17004
17041
|
credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).required({ sources: true }),
|
|
17005
17042
|
codex: CodexProviderConfigSchema.optional()
|
|
17006
17043
|
});
|
|
17007
17044
|
var ConfigProviderAddOutputSchema = storedMutationOutput("provider", "created", ProviderValueSchema);
|
|
17008
|
-
var ConfigProviderSetInputSchema =
|
|
17009
|
-
name:
|
|
17010
|
-
displayName:
|
|
17011
|
-
baseUrl:
|
|
17045
|
+
var ConfigProviderSetInputSchema = import_zod27.z.strictObject({
|
|
17046
|
+
name: import_zod27.z.string().min(1),
|
|
17047
|
+
displayName: import_zod27.z.string().min(1).optional(),
|
|
17048
|
+
baseUrl: import_zod27.z.string().min(1).optional(),
|
|
17012
17049
|
credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).optional(),
|
|
17013
17050
|
codex: CodexProviderConfigSchema.optional()
|
|
17014
17051
|
});
|
|
17015
17052
|
var ConfigProviderSetOutputSchema = storedMutationOutput("provider", "updated", ProviderValueSchema);
|
|
17016
|
-
var ConfigProviderRemoveInputSchema =
|
|
17053
|
+
var ConfigProviderRemoveInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
17017
17054
|
var ConfigProviderRemoveOutputSchema = mutationOutput("provider", "removed");
|
|
17018
|
-
var ConfigRuleAddInputSchema =
|
|
17019
|
-
path:
|
|
17020
|
-
configProfile:
|
|
17021
|
-
identity:
|
|
17055
|
+
var ConfigRuleAddInputSchema = import_zod27.z.strictObject({
|
|
17056
|
+
path: import_zod27.z.string().min(1),
|
|
17057
|
+
configProfile: import_zod27.z.string().min(1).optional(),
|
|
17058
|
+
identity: import_zod27.z.string().min(1).optional()
|
|
17022
17059
|
});
|
|
17023
17060
|
var ConfigRuleAddOutputSchema = storedMutationOutput("rule", "created", DirectoryRuleSchema);
|
|
17024
|
-
var ConfigRuleSetInputSchema =
|
|
17025
|
-
path:
|
|
17026
|
-
configProfile:
|
|
17027
|
-
identity:
|
|
17061
|
+
var ConfigRuleSetInputSchema = import_zod27.z.strictObject({
|
|
17062
|
+
path: import_zod27.z.string().min(1),
|
|
17063
|
+
configProfile: import_zod27.z.union([import_zod27.z.string().min(1), import_zod27.z.literal(false)]).optional(),
|
|
17064
|
+
identity: import_zod27.z.union([import_zod27.z.string().min(1), import_zod27.z.literal(false)]).optional()
|
|
17028
17065
|
});
|
|
17029
17066
|
var ConfigRuleSetOutputSchema = storedMutationOutput("rule", "updated", DirectoryRuleSchema);
|
|
17030
|
-
var ConfigRuleRemoveInputSchema =
|
|
17067
|
+
var ConfigRuleRemoveInputSchema = import_zod27.z.strictObject({ path: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
17031
17068
|
var ConfigRuleRemoveOutputSchema = mutationOutput("rule", "removed");
|
|
17032
17069
|
|
|
17033
17070
|
// src/frontdoor/configApi.ts
|
|
@@ -17179,8 +17216,7 @@ function createConfigApiRouter(deps) {
|
|
|
17179
17216
|
...launch?.claudeVersion === void 0 ? {} : { launchClaudeVersion: launch.claudeVersion },
|
|
17180
17217
|
...launch?.delay === void 0 ? {} : { launchDelay: launch.delay },
|
|
17181
17218
|
...launch?.pause === void 0 ? {} : { launchPause: launch.pause },
|
|
17182
|
-
...launch?.explain === void 0 ? {} : { launchExplain: launch.explain }
|
|
17183
|
-
...launch?.routeByName === void 0 ? {} : { launchRouteByName: launch.routeByName }
|
|
17219
|
+
...launch?.explain === void 0 ? {} : { launchExplain: launch.explain }
|
|
17184
17220
|
});
|
|
17185
17221
|
return { action: "updated", kind: "profile", name: input.name, value: profileValue(input.name, paths) };
|
|
17186
17222
|
})
|
|
@@ -17339,43 +17375,43 @@ var import_openapi4 = require("@orpc/openapi");
|
|
|
17339
17375
|
var import_server3 = require("@orpc/server");
|
|
17340
17376
|
|
|
17341
17377
|
// src/frontdoor/eventSchemas.ts
|
|
17342
|
-
var
|
|
17378
|
+
var import_zod28 = require("zod");
|
|
17343
17379
|
var DOOR_EVENT_SOURCE_RC = "rc";
|
|
17344
17380
|
var LAUNCH_EVENT_SOURCE = "launch";
|
|
17345
17381
|
var USAGE_EVENT_SOURCE = "usage";
|
|
17346
17382
|
var DOOR_HEALTH_EVENT_SOURCE = "door";
|
|
17347
17383
|
var QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
|
|
17348
|
-
var DoorEventSchema =
|
|
17349
|
-
source:
|
|
17384
|
+
var DoorEventSchema = import_zod28.z.strictObject({
|
|
17385
|
+
source: import_zod28.z.string().min(1),
|
|
17350
17386
|
/** A positive integer because the backbone's counters start at one and only ever increase. */
|
|
17351
|
-
sequence:
|
|
17352
|
-
payload:
|
|
17387
|
+
sequence: import_zod28.z.number().int().positive(),
|
|
17388
|
+
payload: import_zod28.z.unknown()
|
|
17353
17389
|
});
|
|
17354
|
-
var DoorEventSourceQuerySchema =
|
|
17355
|
-
sources:
|
|
17390
|
+
var DoorEventSourceQuerySchema = import_zod28.z.strictObject({
|
|
17391
|
+
sources: import_zod28.z.array(import_zod28.z.string().min(1)).min(1).optional()
|
|
17356
17392
|
});
|
|
17357
|
-
var LaunchLifecycleEventSchema =
|
|
17358
|
-
kind:
|
|
17359
|
-
pid:
|
|
17360
|
-
startedAt:
|
|
17361
|
-
observedAt:
|
|
17393
|
+
var LaunchLifecycleEventSchema = import_zod28.z.strictObject({
|
|
17394
|
+
kind: import_zod28.z.enum(["registered", "pruned", "ended"]),
|
|
17395
|
+
pid: import_zod28.z.number().int().positive(),
|
|
17396
|
+
startedAt: import_zod28.z.number(),
|
|
17397
|
+
observedAt: import_zod28.z.number()
|
|
17362
17398
|
});
|
|
17363
|
-
var DoorHealthEventSchema =
|
|
17364
|
-
|
|
17365
|
-
|
|
17366
|
-
|
|
17367
|
-
|
|
17368
|
-
|
|
17369
|
-
|
|
17399
|
+
var DoorHealthEventSchema = import_zod28.z.discriminatedUnion("kind", [
|
|
17400
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("generation"), pid: import_zod28.z.number().int().positive(), providerPort: import_zod28.z.number().int().positive(), connectPort: import_zod28.z.number().int().positive(), directPort: import_zod28.z.number().int().positive(), observedAt: import_zod28.z.number() }),
|
|
17401
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("listenerFailed"), pid: import_zod28.z.number().int().positive(), listener: import_zod28.z.enum(["provider", "connect", "direct"]), message: import_zod28.z.string(), observedAt: import_zod28.z.number() }),
|
|
17402
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("binaryTurnover"), pid: import_zod28.z.number().int().positive(), observedAt: import_zod28.z.number() }),
|
|
17403
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("idleShutdown"), pid: import_zod28.z.number().int().positive(), observedAt: import_zod28.z.number() }),
|
|
17404
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("superseded"), pid: import_zod28.z.number().int().positive(), ownerPid: import_zod28.z.number().int().positive(), observedAt: import_zod28.z.number() }),
|
|
17405
|
+
import_zod28.z.strictObject({ kind: import_zod28.z.literal("drained"), pid: import_zod28.z.number().int().positive(), observedAt: import_zod28.z.number() })
|
|
17370
17406
|
]);
|
|
17371
|
-
var QuotaExpiringEventSchema =
|
|
17372
|
-
identity:
|
|
17373
|
-
provider:
|
|
17374
|
-
window:
|
|
17407
|
+
var QuotaExpiringEventSchema = import_zod28.z.strictObject({
|
|
17408
|
+
identity: import_zod28.z.string().min(1),
|
|
17409
|
+
provider: import_zod28.z.string().min(1),
|
|
17410
|
+
window: import_zod28.z.enum(["fiveHour", "sevenDay"]),
|
|
17375
17411
|
/** 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. */
|
|
17376
|
-
utilization:
|
|
17377
|
-
resetsAt:
|
|
17378
|
-
observedAt:
|
|
17412
|
+
utilization: import_zod28.z.number().min(0).max(1),
|
|
17413
|
+
resetsAt: import_zod28.z.iso.datetime(),
|
|
17414
|
+
observedAt: import_zod28.z.number()
|
|
17379
17415
|
});
|
|
17380
17416
|
|
|
17381
17417
|
// src/frontdoor/eventsApi.ts
|
|
@@ -17459,56 +17495,55 @@ init_cliError();
|
|
|
17459
17495
|
|
|
17460
17496
|
// src/frontdoor/launchSchemas.ts
|
|
17461
17497
|
var import_node_path33 = __toESM(require("node:path"), 1);
|
|
17462
|
-
var
|
|
17498
|
+
var import_zod29 = require("zod");
|
|
17463
17499
|
init_claudeVersion();
|
|
17464
17500
|
init_identity();
|
|
17465
|
-
var LaunchResolveInputSchema =
|
|
17466
|
-
path:
|
|
17501
|
+
var LaunchResolveInputSchema = import_zod29.z.strictObject({
|
|
17502
|
+
path: import_zod29.z.string().min(1),
|
|
17467
17503
|
/** `@name`, launch flags, then the arguments for `claude`; empty for a bare launch. */
|
|
17468
|
-
argv:
|
|
17504
|
+
argv: import_zod29.z.readonly(import_zod29.z.array(import_zod29.z.string())).optional(),
|
|
17469
17505
|
/** 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. */
|
|
17470
|
-
env:
|
|
17506
|
+
env: import_zod29.z.record(import_zod29.z.string(), import_zod29.z.string()).optional()
|
|
17471
17507
|
}).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" });
|
|
17472
|
-
var LaunchPoolDecisionSchema =
|
|
17473
|
-
name:
|
|
17474
|
-
reasons:
|
|
17475
|
-
movedOff:
|
|
17508
|
+
var LaunchPoolDecisionSchema = import_zod29.z.strictObject({
|
|
17509
|
+
name: import_zod29.z.string(),
|
|
17510
|
+
reasons: import_zod29.z.readonly(import_zod29.z.array(import_zod29.z.string())),
|
|
17511
|
+
movedOff: import_zod29.z.strictObject({ identity: import_zod29.z.string(), reason: import_zod29.z.string() }).optional()
|
|
17476
17512
|
});
|
|
17477
|
-
var LaunchDecisionSchema =
|
|
17478
|
-
identity:
|
|
17479
|
-
identitySource:
|
|
17513
|
+
var LaunchDecisionSchema = import_zod29.z.strictObject({
|
|
17514
|
+
identity: import_zod29.z.string().optional(),
|
|
17515
|
+
identitySource: import_zod29.z.enum(IDENTITY_DECISION_SOURCES),
|
|
17480
17516
|
pool: LaunchPoolDecisionSchema.optional(),
|
|
17481
|
-
configDirEscapeHatch:
|
|
17482
|
-
configDir:
|
|
17483
|
-
configProfile:
|
|
17484
|
-
configProfileSource:
|
|
17485
|
-
provider:
|
|
17517
|
+
configDirEscapeHatch: import_zod29.z.boolean(),
|
|
17518
|
+
configDir: import_zod29.z.string().optional(),
|
|
17519
|
+
configProfile: import_zod29.z.string().optional(),
|
|
17520
|
+
configProfileSource: import_zod29.z.enum(CONFIG_PROFILE_DECISION_SOURCES),
|
|
17521
|
+
provider: import_zod29.z.string().optional()
|
|
17486
17522
|
});
|
|
17487
|
-
var LaunchFlagsSchema =
|
|
17488
|
-
skipPermissions:
|
|
17489
|
-
remoteControl:
|
|
17490
|
-
headroom:
|
|
17491
|
-
trackUsage:
|
|
17492
|
-
pause:
|
|
17493
|
-
explain:
|
|
17494
|
-
routeByName: import_zod28.z.boolean(),
|
|
17523
|
+
var LaunchFlagsSchema = import_zod29.z.strictObject({
|
|
17524
|
+
skipPermissions: import_zod29.z.boolean(),
|
|
17525
|
+
remoteControl: import_zod29.z.boolean(),
|
|
17526
|
+
headroom: import_zod29.z.boolean(),
|
|
17527
|
+
trackUsage: import_zod29.z.boolean(),
|
|
17528
|
+
pause: import_zod29.z.boolean(),
|
|
17529
|
+
explain: import_zod29.z.boolean(),
|
|
17495
17530
|
/** How long the launch waits after its own output before it starts claude, in milliseconds. */
|
|
17496
|
-
delayMs:
|
|
17531
|
+
delayMs: import_zod29.z.number()
|
|
17497
17532
|
});
|
|
17498
|
-
var LaunchResolveOutputSchema =
|
|
17533
|
+
var LaunchResolveOutputSchema = import_zod29.z.strictObject({
|
|
17499
17534
|
decision: LaunchDecisionSchema,
|
|
17500
17535
|
flags: LaunchFlagsSchema,
|
|
17501
|
-
claudeVersion:
|
|
17536
|
+
claudeVersion: import_zod29.z.strictObject({ version: import_zod29.z.string(), source: import_zod29.z.enum(CLAUDE_VERSION_SOURCES) }).optional(),
|
|
17502
17537
|
/** The real `claude` binary the launch would spawn, on the door's host. */
|
|
17503
|
-
bin:
|
|
17538
|
+
bin: import_zod29.z.string(),
|
|
17504
17539
|
/** The arguments the launch would pass it: the tool's own flags, then `CLAUDE_EXTRA_FLAGS`, then the caller's own. */
|
|
17505
|
-
args:
|
|
17540
|
+
args: import_zod29.z.readonly(import_zod29.z.array(import_zod29.z.string())),
|
|
17506
17541
|
/** The credential the launch would authenticate with, by target and source kinds. Absent when none applies. */
|
|
17507
|
-
credential:
|
|
17508
|
-
routing:
|
|
17542
|
+
credential: import_zod29.z.strictObject({ subject: import_zod29.z.enum(["provider", "identity"]), name: import_zod29.z.string(), summary: CredentialSummarySchema }).optional(),
|
|
17543
|
+
routing: import_zod29.z.strictObject({ frontDoor: import_zod29.z.boolean(), headroom: import_zod29.z.boolean() }),
|
|
17509
17544
|
/** The names of the environment variables the launch would set or unset, sorted. Values are not reported. */
|
|
17510
|
-
environment:
|
|
17511
|
-
warnings:
|
|
17545
|
+
environment: import_zod29.z.readonly(import_zod29.z.array(import_zod29.z.string())),
|
|
17546
|
+
warnings: import_zod29.z.readonly(import_zod29.z.array(import_zod29.z.string()))
|
|
17512
17547
|
});
|
|
17513
17548
|
|
|
17514
17549
|
// src/frontdoor/launchApi.ts
|
|
@@ -17544,22 +17579,22 @@ function createLaunchApiRouter(deps) {
|
|
|
17544
17579
|
// src/frontdoor/agentTreesApi.ts
|
|
17545
17580
|
var import_client6 = require("@orpc/client");
|
|
17546
17581
|
var import_openapi7 = require("@orpc/openapi");
|
|
17547
|
-
var
|
|
17582
|
+
var import_zod30 = require("zod");
|
|
17548
17583
|
init_cliError();
|
|
17549
|
-
var AgentTreesListInputSchema =
|
|
17584
|
+
var AgentTreesListInputSchema = import_zod30.z.strictObject({
|
|
17550
17585
|
/** Only this identity's sessions. */
|
|
17551
|
-
identity:
|
|
17586
|
+
identity: import_zod30.z.string().optional(),
|
|
17552
17587
|
/** Include sessions that spawned no agent and ran no workflow. */
|
|
17553
|
-
all:
|
|
17588
|
+
all: import_zod30.z.boolean().optional()
|
|
17554
17589
|
});
|
|
17555
|
-
var AgentTreesListOutputSchema =
|
|
17556
|
-
var AgentTreesShowInputSchema =
|
|
17590
|
+
var AgentTreesListOutputSchema = import_zod30.z.array(SessionSummarySchema);
|
|
17591
|
+
var AgentTreesShowInputSchema = import_zod30.z.strictObject({
|
|
17557
17592
|
/** A session id, or an unambiguous prefix of one. */
|
|
17558
|
-
session:
|
|
17593
|
+
session: import_zod30.z.string().min(1),
|
|
17559
17594
|
/** Look only in this identity. */
|
|
17560
|
-
identity:
|
|
17595
|
+
identity: import_zod30.z.string().optional()
|
|
17561
17596
|
});
|
|
17562
|
-
var AgentTreesShowOutputSchema =
|
|
17597
|
+
var AgentTreesShowOutputSchema = import_zod30.z.strictObject({ identities: import_zod30.z.array(import_zod30.z.string()), ...MergedAgentTreeSchema.shape });
|
|
17563
17598
|
function asBadRequest(error) {
|
|
17564
17599
|
if (error instanceof CliError) {
|
|
17565
17600
|
throw new import_client6.ORPCError("BAD_REQUEST", { message: error.message });
|
|
@@ -19742,7 +19777,7 @@ init_poolPick();
|
|
|
19742
19777
|
|
|
19743
19778
|
// src/agents/read.ts
|
|
19744
19779
|
var import_node_path35 = __toESM(require("node:path"), 1);
|
|
19745
|
-
var
|
|
19780
|
+
var import_zod31 = require("zod");
|
|
19746
19781
|
var PROJECTS_DIR = "projects";
|
|
19747
19782
|
var TASKS_DIR = "tasks";
|
|
19748
19783
|
var SUBAGENTS_DIR = "subagents";
|
|
@@ -19861,14 +19896,14 @@ function parseJson2(text) {
|
|
|
19861
19896
|
return void 0;
|
|
19862
19897
|
}
|
|
19863
19898
|
}
|
|
19864
|
-
var TaskFileSchema =
|
|
19865
|
-
var WorkflowRunFileSchema =
|
|
19866
|
-
runId:
|
|
19867
|
-
workflowName:
|
|
19868
|
-
status:
|
|
19869
|
-
startTime:
|
|
19870
|
-
phases:
|
|
19871
|
-
summary:
|
|
19899
|
+
var TaskFileSchema = import_zod31.z.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: import_zod31.z.array(import_zod31.z.string()).default([]), blockedBy: import_zod31.z.array(import_zod31.z.string()).default([]) });
|
|
19900
|
+
var WorkflowRunFileSchema = import_zod31.z.object({
|
|
19901
|
+
runId: import_zod31.z.string(),
|
|
19902
|
+
workflowName: import_zod31.z.string().optional(),
|
|
19903
|
+
status: import_zod31.z.string().optional(),
|
|
19904
|
+
startTime: import_zod31.z.number().optional(),
|
|
19905
|
+
phases: import_zod31.z.array(import_zod31.z.object({ title: import_zod31.z.string() })).default([]),
|
|
19906
|
+
summary: import_zod31.z.string().optional()
|
|
19872
19907
|
});
|
|
19873
19908
|
function summariseSession(fs13, configDir, ref) {
|
|
19874
19909
|
const sessionRelative = import_node_path35.default.join(PROJECTS_DIR, ref.project, ref.entry);
|