claude-use 11.46.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 +2 -0
- package/dist/cli.cjs +1077 -765
- package/dist/index.cjs +506 -451
- package/dist/index.mjs +502 -447
- package/dist/types/index.d.ts +12 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -293,7 +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
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. */
|
|
298
297
|
explain: import_zod.z.boolean().optional()
|
|
299
298
|
});
|
|
@@ -3146,7 +3145,7 @@ var init_package = __esm({
|
|
|
3146
3145
|
"package.json"() {
|
|
3147
3146
|
package_default = {
|
|
3148
3147
|
name: "claude-use",
|
|
3149
|
-
version: "11.
|
|
3148
|
+
version: "11.47.0",
|
|
3150
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.",
|
|
3151
3150
|
license: "MIT",
|
|
3152
3151
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -6519,6 +6518,7 @@ function buildLayoutPaths(root) {
|
|
|
6519
6518
|
identitiesDir: import_node_path23.default.join(root, "identities"),
|
|
6520
6519
|
configProfilesDir: import_node_path23.default.join(root, "config-profiles"),
|
|
6521
6520
|
providersDir: import_node_path23.default.join(root, "providers"),
|
|
6521
|
+
providerAliasesFile: import_node_path23.default.join(root, "provider-aliases.json"),
|
|
6522
6522
|
directoryRulesFile: import_node_path23.default.join(root, "directory-rules.json"),
|
|
6523
6523
|
activeIdentityFile: import_node_path23.default.join(root, "active-identity"),
|
|
6524
6524
|
globalConfigFile: import_node_path23.default.join(root, "config.json"),
|
|
@@ -6735,6 +6735,50 @@ var init_realCredentialCache = __esm({
|
|
|
6735
6735
|
}
|
|
6736
6736
|
});
|
|
6737
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
|
+
|
|
6738
6782
|
// src/credential.ts
|
|
6739
6783
|
function commandArgv(source) {
|
|
6740
6784
|
if ("command" in source) {
|
|
@@ -7139,6 +7183,11 @@ var init_families = __esm({
|
|
|
7139
7183
|
});
|
|
7140
7184
|
|
|
7141
7185
|
// src/providersStore.ts
|
|
7186
|
+
function requireValidProviderName(name) {
|
|
7187
|
+
if (!PROVIDER_NAME_RE.test(name)) {
|
|
7188
|
+
throw new InvalidProviderNameError(name);
|
|
7189
|
+
}
|
|
7190
|
+
}
|
|
7142
7191
|
function providerJsonPath(paths, name) {
|
|
7143
7192
|
return import_node_path25.default.join(paths.providersDir, `${name}.json`);
|
|
7144
7193
|
}
|
|
@@ -7259,9 +7308,7 @@ function addProvider(paths, name, input) {
|
|
|
7259
7308
|
if (providerExists(paths, name)) {
|
|
7260
7309
|
throw new ProviderAlreadyExistsError(name);
|
|
7261
7310
|
}
|
|
7262
|
-
|
|
7263
|
-
throw new InvalidProviderNameError(name);
|
|
7264
|
-
}
|
|
7311
|
+
requireValidProviderName(name);
|
|
7265
7312
|
const kind = input.kind ?? "http";
|
|
7266
7313
|
if (kind === "codex" && input.baseUrl !== void 0) {
|
|
7267
7314
|
throw new ProviderKindMismatchError("A codex provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
|
|
@@ -7392,10 +7439,11 @@ function cascadeProviderName(cascade) {
|
|
|
7392
7439
|
}
|
|
7393
7440
|
function selectProvider(params) {
|
|
7394
7441
|
const cliName = params.cliProvider !== void 0 && params.cliProvider !== "" ? params.cliProvider : void 0;
|
|
7395
|
-
const
|
|
7396
|
-
if (
|
|
7442
|
+
const named = cliName ?? (params.cascade === void 0 ? void 0 : cascadeProviderName(params.cascade));
|
|
7443
|
+
if (named === void 0) {
|
|
7397
7444
|
return void 0;
|
|
7398
7445
|
}
|
|
7446
|
+
const name = canonicalProviderName(named, (candidate) => loadProvider(params.paths.providersDir, candidate, params.port) !== void 0, () => loadProviderAliases(params.paths.providerAliasesFile, params.port));
|
|
7399
7447
|
const definition = loadProvider(params.paths.providersDir, name, params.port);
|
|
7400
7448
|
if (definition === void 0) {
|
|
7401
7449
|
const known = listProviderNames(params.port.readdir, params.paths.providersDir);
|
|
@@ -7495,6 +7543,7 @@ var init_providersStore = __esm({
|
|
|
7495
7543
|
init_unrecognisedKeys();
|
|
7496
7544
|
init_schema();
|
|
7497
7545
|
init_cliError();
|
|
7546
|
+
init_providerAliases();
|
|
7498
7547
|
init_credential();
|
|
7499
7548
|
init_walk();
|
|
7500
7549
|
init_families();
|
|
@@ -7782,21 +7831,21 @@ function findPathShadow(params) {
|
|
|
7782
7831
|
}
|
|
7783
7832
|
return params.pathDirs.some((dir) => import_node_path28.default.resolve(dir) === resolvedTargetDir) ? { status: "ok" } : { status: "not-on-path" };
|
|
7784
7833
|
}
|
|
7785
|
-
var import_node_fs7, import_node_path28,
|
|
7834
|
+
var import_node_fs7, import_node_path28, import_zod20, ClaudeShimStateSchema, nodeLinkFs;
|
|
7786
7835
|
var init_claudeShim = __esm({
|
|
7787
7836
|
"src/claudeShim.ts"() {
|
|
7788
7837
|
"use strict";
|
|
7789
7838
|
import_node_fs7 = __toESM(require("node:fs"), 1);
|
|
7790
7839
|
import_node_path28 = __toESM(require("node:path"), 1);
|
|
7791
|
-
|
|
7840
|
+
import_zod20 = require("zod");
|
|
7792
7841
|
init_commandDeps();
|
|
7793
7842
|
init_store();
|
|
7794
7843
|
init_realPorts();
|
|
7795
7844
|
init_cliError();
|
|
7796
|
-
ClaudeShimStateSchema =
|
|
7797
|
-
targetPath:
|
|
7798
|
-
method:
|
|
7799
|
-
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()
|
|
7800
7849
|
});
|
|
7801
7850
|
nodeLinkFs = { link: import_node_fs7.default.linkSync, copyFile: import_node_fs7.default.copyFileSync, chmod: import_node_fs7.default.chmodSync };
|
|
7802
7851
|
}
|
|
@@ -7892,62 +7941,62 @@ var init_signatures = __esm({
|
|
|
7892
7941
|
});
|
|
7893
7942
|
|
|
7894
7943
|
// src/codex/anthropic.ts
|
|
7895
|
-
var
|
|
7944
|
+
var import_zod24, TextBlockSchema, Base64ImageSourceSchema, UrlImageSourceSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultContentBlockSchema, ToolResultBlockSchema, OtherBlockSchema, ContentBlockSchema, MessageSchema, ToolSchema, ToolChoiceSchema, SystemSchema, MessagesRequestSchema, CountTokensRequestSchema;
|
|
7896
7945
|
var init_anthropic = __esm({
|
|
7897
7946
|
"src/codex/anthropic.ts"() {
|
|
7898
7947
|
"use strict";
|
|
7899
|
-
|
|
7900
|
-
TextBlockSchema =
|
|
7901
|
-
Base64ImageSourceSchema =
|
|
7902
|
-
UrlImageSourceSchema =
|
|
7903
|
-
ImageBlockSchema =
|
|
7904
|
-
type:
|
|
7905
|
-
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])
|
|
7906
7955
|
});
|
|
7907
|
-
ToolUseBlockSchema =
|
|
7908
|
-
type:
|
|
7909
|
-
id:
|
|
7910
|
-
name:
|
|
7911
|
-
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()
|
|
7912
7961
|
});
|
|
7913
|
-
ToolResultContentBlockSchema =
|
|
7914
|
-
ToolResultBlockSchema =
|
|
7915
|
-
type:
|
|
7916
|
-
tool_use_id:
|
|
7917
|
-
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()
|
|
7918
7967
|
});
|
|
7919
|
-
OtherBlockSchema =
|
|
7920
|
-
ContentBlockSchema =
|
|
7921
|
-
MessageSchema =
|
|
7922
|
-
role:
|
|
7923
|
-
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)])
|
|
7924
7973
|
});
|
|
7925
|
-
ToolSchema =
|
|
7926
|
-
name:
|
|
7927
|
-
description:
|
|
7928
|
-
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()
|
|
7929
7978
|
});
|
|
7930
|
-
ToolChoiceSchema =
|
|
7931
|
-
|
|
7932
|
-
|
|
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) })
|
|
7933
7982
|
]);
|
|
7934
|
-
SystemSchema =
|
|
7935
|
-
MessagesRequestSchema =
|
|
7936
|
-
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(),
|
|
7937
7986
|
system: SystemSchema.optional(),
|
|
7938
|
-
messages:
|
|
7939
|
-
tools:
|
|
7987
|
+
messages: import_zod24.z.array(MessageSchema),
|
|
7988
|
+
tools: import_zod24.z.array(ToolSchema).optional(),
|
|
7940
7989
|
tool_choice: ToolChoiceSchema.optional(),
|
|
7941
|
-
stream:
|
|
7990
|
+
stream: import_zod24.z.boolean().optional(),
|
|
7942
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. */
|
|
7943
|
-
metadata:
|
|
7992
|
+
metadata: import_zod24.z.looseObject({ user_id: import_zod24.z.string().optional() }).optional(),
|
|
7944
7993
|
/** Claude Code's effort setting. Any string is accepted; the translator honours only the levels the backend understands. */
|
|
7945
|
-
output_config:
|
|
7994
|
+
output_config: import_zod24.z.looseObject({ effort: import_zod24.z.string().optional() }).optional()
|
|
7946
7995
|
});
|
|
7947
|
-
CountTokensRequestSchema =
|
|
7948
|
-
system:
|
|
7949
|
-
messages:
|
|
7950
|
-
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()
|
|
7951
8000
|
});
|
|
7952
8001
|
}
|
|
7953
8002
|
});
|
|
@@ -8049,13 +8098,13 @@ function filterCatalogue(models, catalogue) {
|
|
|
8049
8098
|
const excluded = catalogue.exclude === void 0 ? void 0 : (0, import_picomatch4.default)(catalogue.exclude, { dot: true });
|
|
8050
8099
|
return models.filter((model) => included?.(model.id) !== false && excluded?.(model.id) !== true);
|
|
8051
8100
|
}
|
|
8052
|
-
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;
|
|
8053
8102
|
var init_providerCatalogue = __esm({
|
|
8054
8103
|
"src/providerCatalogue.ts"() {
|
|
8055
8104
|
"use strict";
|
|
8056
8105
|
import_node_path30 = __toESM(require("node:path"), 1);
|
|
8057
8106
|
import_picomatch4 = __toESM(require("picomatch"), 1);
|
|
8058
|
-
|
|
8107
|
+
import_zod25 = require("zod");
|
|
8059
8108
|
DEFAULT_CANDIDATE_URLS = 2;
|
|
8060
8109
|
MS_PER_SECOND5 = 1e3;
|
|
8061
8110
|
SECONDS_PER_HOUR2 = 3600;
|
|
@@ -8067,8 +8116,8 @@ var init_providerCatalogue = __esm({
|
|
|
8067
8116
|
CATALOGUE_REQUEST_SECONDS = 10;
|
|
8068
8117
|
CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND5;
|
|
8069
8118
|
CATALOGUE_REFRESH_TIMEOUT_MS = DEFAULT_CANDIDATE_URLS * CATALOGUE_REQUEST_TIMEOUT_MS;
|
|
8070
|
-
CatalogueModelSchema =
|
|
8071
|
-
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) });
|
|
8072
8121
|
}
|
|
8073
8122
|
});
|
|
8074
8123
|
|
|
@@ -10431,11 +10480,11 @@ var init_identityClaude = __esm({
|
|
|
10431
10480
|
});
|
|
10432
10481
|
|
|
10433
10482
|
// src/usage/providerQuota.ts
|
|
10434
|
-
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;
|
|
10435
10484
|
var init_providerQuota = __esm({
|
|
10436
10485
|
"src/usage/providerQuota.ts"() {
|
|
10437
10486
|
"use strict";
|
|
10438
|
-
|
|
10487
|
+
import_zod32 = require("zod");
|
|
10439
10488
|
init_cloudUpstream();
|
|
10440
10489
|
init_schema2();
|
|
10441
10490
|
MS_PER_SECOND9 = 1e3;
|
|
@@ -10450,35 +10499,35 @@ var init_providerQuota = __esm({
|
|
|
10450
10499
|
[ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND9],
|
|
10451
10500
|
[ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9]
|
|
10452
10501
|
]);
|
|
10453
|
-
ZaiLimitSchema =
|
|
10454
|
-
type:
|
|
10455
|
-
unit:
|
|
10456
|
-
number:
|
|
10457
|
-
percentage:
|
|
10458
|
-
nextResetTime:
|
|
10459
|
-
usage:
|
|
10460
|
-
currentValue:
|
|
10461
|
-
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()
|
|
10462
10511
|
});
|
|
10463
|
-
ZaiResponseSchema =
|
|
10464
|
-
success:
|
|
10465
|
-
msg:
|
|
10466
|
-
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) })
|
|
10467
10516
|
});
|
|
10468
10517
|
OPENROUTER_HOST = "openrouter.ai";
|
|
10469
10518
|
OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
|
|
10470
10519
|
OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
|
|
10471
10520
|
MS_PER_DAY3 = HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
10472
|
-
OpenRouterKeySchema =
|
|
10473
|
-
data:
|
|
10474
|
-
limit:
|
|
10475
|
-
limit_remaining:
|
|
10476
|
-
limit_reset:
|
|
10477
|
-
is_free_tier:
|
|
10478
|
-
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()
|
|
10479
10528
|
})
|
|
10480
10529
|
});
|
|
10481
|
-
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() }) });
|
|
10482
10531
|
ANTIGRAVITY_HOST = "daily-cloudcode-pa.googleapis.com";
|
|
10483
10532
|
ANTIGRAVITY_QUOTA_URL = `https://${ANTIGRAVITY_HOST}/v1internal:retrieveUserQuotaSummary`;
|
|
10484
10533
|
ANTIGRAVITY_USER_URL = `https://${ANTIGRAVITY_HOST}/v1internal:loadCodeAssist`;
|
|
@@ -10486,21 +10535,21 @@ var init_providerQuota = __esm({
|
|
|
10486
10535
|
DAYS_PER_WEEK2 = 7;
|
|
10487
10536
|
FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
10488
10537
|
WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
10489
|
-
AntigravityBucketSchema =
|
|
10490
|
-
bucketId:
|
|
10491
|
-
remainingFraction:
|
|
10492
|
-
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()
|
|
10493
10542
|
});
|
|
10494
|
-
AntigravitySummarySchema =
|
|
10495
|
-
GoogleTokenInfoSchema =
|
|
10496
|
-
email:
|
|
10497
|
-
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()
|
|
10498
10547
|
});
|
|
10499
|
-
AntigravityUserSchema =
|
|
10548
|
+
AntigravityUserSchema = import_zod32.z.object({
|
|
10500
10549
|
/** The code-assist tier context, which defaults to the free tier for every account. */
|
|
10501
|
-
currentTier:
|
|
10550
|
+
currentTier: import_zod32.z.object({ name: import_zod32.z.string().optional(), id: import_zod32.z.string().optional() }).optional(),
|
|
10502
10551
|
/** The account's paid subscription; absent when the account has none. */
|
|
10503
|
-
paidTier:
|
|
10552
|
+
paidTier: import_zod32.z.object({ name: import_zod32.z.string().optional(), id: import_zod32.z.string().optional() }).optional()
|
|
10504
10553
|
});
|
|
10505
10554
|
}
|
|
10506
10555
|
});
|
|
@@ -14801,7 +14850,7 @@ init_providersStore();
|
|
|
14801
14850
|
init_signIn();
|
|
14802
14851
|
init_realPorts();
|
|
14803
14852
|
var import_node_path27 = __toESM(require("node:path"), 1);
|
|
14804
|
-
var
|
|
14853
|
+
var import_zod16 = require("zod");
|
|
14805
14854
|
init_envBool();
|
|
14806
14855
|
init_load();
|
|
14807
14856
|
init_schema();
|
|
@@ -14881,9 +14930,9 @@ function lookupKeychainService(run, farmRoot) {
|
|
|
14881
14930
|
}
|
|
14882
14931
|
return { checked: true, found: true, serviceName, note: `Keychain service name for this identity: "${serviceName}".` };
|
|
14883
14932
|
}
|
|
14884
|
-
var SettingsSecretsShapeSchema =
|
|
14885
|
-
env:
|
|
14886
|
-
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()
|
|
14887
14936
|
});
|
|
14888
14937
|
function hookCommandCountOf(group) {
|
|
14889
14938
|
if (typeof group !== "object" || group === null) {
|
|
@@ -15176,7 +15225,7 @@ function collectCheckReport(params) {
|
|
|
15176
15225
|
}
|
|
15177
15226
|
|
|
15178
15227
|
// src/checkReportSchema.ts
|
|
15179
|
-
var
|
|
15228
|
+
var import_zod18 = require("zod");
|
|
15180
15229
|
init_schema();
|
|
15181
15230
|
init_claudeVersion();
|
|
15182
15231
|
init_identity();
|
|
@@ -15240,124 +15289,124 @@ var DIAGNOSTIC_CODES = [
|
|
|
15240
15289
|
var DIAGNOSTIC_SEVERITIES = ["error", "warning", "info"];
|
|
15241
15290
|
|
|
15242
15291
|
// src/usage/pickReportSchema.ts
|
|
15243
|
-
var
|
|
15292
|
+
var import_zod17 = require("zod");
|
|
15244
15293
|
init_plan2();
|
|
15245
|
-
var PoolPickCandidateViewSchema =
|
|
15246
|
-
identity:
|
|
15294
|
+
var PoolPickCandidateViewSchema = import_zod17.z.strictObject({
|
|
15295
|
+
identity: import_zod17.z.string(),
|
|
15247
15296
|
/** In pick order: `scored` has usable quota data, `unknown` has none, `pay-per-use` bills by use, `ineligible` is refused right now. */
|
|
15248
|
-
class:
|
|
15297
|
+
class: import_zod17.z.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
|
|
15249
15298
|
/** Plan-size-weighted remaining quota per hour until its reset; present for `scored` only. */
|
|
15250
|
-
score:
|
|
15299
|
+
score: import_zod17.z.number().optional(),
|
|
15251
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`. */
|
|
15252
|
-
scoreWindow:
|
|
15301
|
+
scoreWindow: import_zod17.z.enum(["sevenDay", "fiveHour"]).optional(),
|
|
15253
15302
|
/** False when the five-hour window would run dry, at the observed pace, before it resets. */
|
|
15254
|
-
feasible:
|
|
15303
|
+
feasible: import_zod17.z.boolean(),
|
|
15255
15304
|
/** When an `ineligible` member can be used again, as an ISO instant. */
|
|
15256
|
-
blockedUntil:
|
|
15305
|
+
blockedUntil: import_zod17.z.iso.datetime().optional(),
|
|
15257
15306
|
plan: PlanClassSchema,
|
|
15258
15307
|
/** The facts behind the class and score, in the order they matter. */
|
|
15259
|
-
reasons:
|
|
15308
|
+
reasons: import_zod17.z.array(import_zod17.z.string())
|
|
15260
15309
|
});
|
|
15261
|
-
var PoolPickReportSchema =
|
|
15262
|
-
pool:
|
|
15263
|
-
directory:
|
|
15310
|
+
var PoolPickReportSchema = import_zod17.z.strictObject({
|
|
15311
|
+
pool: import_zod17.z.string(),
|
|
15312
|
+
directory: import_zod17.z.string(),
|
|
15264
15313
|
/** The member a launch would run as, absent when every member is refused. */
|
|
15265
|
-
pick:
|
|
15266
|
-
candidates:
|
|
15314
|
+
pick: import_zod17.z.string().optional(),
|
|
15315
|
+
candidates: import_zod17.z.array(PoolPickCandidateViewSchema),
|
|
15267
15316
|
/** Identity members anywhere in the pool's graph that do not exist; a launch skips them. */
|
|
15268
|
-
missing:
|
|
15317
|
+
missing: import_zod17.z.array(import_zod17.z.string()),
|
|
15269
15318
|
/** When nothing can be picked, the soonest any member returns. */
|
|
15270
|
-
earliestReturn:
|
|
15319
|
+
earliestReturn: import_zod17.z.strictObject({ identity: import_zod17.z.string(), at: import_zod17.z.iso.datetime() }).optional(),
|
|
15271
15320
|
/** The member a resumed conversation started on but moved off, and why, when the ranking could not keep it. */
|
|
15272
|
-
movedOff:
|
|
15321
|
+
movedOff: import_zod17.z.strictObject({ identity: import_zod17.z.string(), reason: import_zod17.z.string() }).optional(),
|
|
15273
15322
|
/** Why the last-pick record could not be read, when that is the case. */
|
|
15274
|
-
stickyProblem:
|
|
15323
|
+
stickyProblem: import_zod17.z.string().optional()
|
|
15275
15324
|
});
|
|
15276
15325
|
|
|
15277
15326
|
// src/checkReportSchema.ts
|
|
15278
15327
|
var CHECK_CREDENTIAL_APPLIES = ["provider", "identity", "stored-login"];
|
|
15279
|
-
var CheckLayerViewSchema =
|
|
15280
|
-
id:
|
|
15281
|
-
kind:
|
|
15282
|
-
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()
|
|
15283
15332
|
});
|
|
15284
|
-
var CheckEntryViewSchema =
|
|
15285
|
-
path:
|
|
15286
|
-
shared:
|
|
15287
|
-
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),
|
|
15288
15337
|
/** The entry's real category, or null when nothing classifies it. */
|
|
15289
|
-
category:
|
|
15290
|
-
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(),
|
|
15291
15340
|
/** Rules that matched but whose `when` condition failed, each with the conditions that failed. */
|
|
15292
|
-
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()
|
|
15293
15342
|
});
|
|
15294
|
-
var CheckDiagnosticSchema =
|
|
15295
|
-
code:
|
|
15296
|
-
severity:
|
|
15297
|
-
message:
|
|
15298
|
-
subject:
|
|
15299
|
-
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()
|
|
15300
15349
|
});
|
|
15301
|
-
var CheckAmbientCredentialSchema =
|
|
15302
|
-
var CheckKeychainSchema =
|
|
15303
|
-
checked:
|
|
15304
|
-
found:
|
|
15305
|
-
serviceName:
|
|
15306
|
-
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()
|
|
15307
15356
|
});
|
|
15308
|
-
var CheckSettingsExposureSchema =
|
|
15309
|
-
file:
|
|
15310
|
-
envKeyNames:
|
|
15311
|
-
hookEventNames:
|
|
15312
|
-
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()
|
|
15313
15362
|
});
|
|
15314
|
-
var CredentialSourceSummarySchema =
|
|
15315
|
-
|
|
15316
|
-
|
|
15317
|
-
|
|
15318
|
-
|
|
15319
|
-
|
|
15320
|
-
|
|
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") })
|
|
15321
15370
|
]);
|
|
15322
|
-
var CredentialSummarySchema =
|
|
15323
|
-
target:
|
|
15324
|
-
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)),
|
|
15325
15374
|
cache: CredentialCacheSchema.optional()
|
|
15326
15375
|
});
|
|
15327
|
-
var CachedCredentialStateSchema =
|
|
15328
|
-
|
|
15329
|
-
|
|
15330
|
-
|
|
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() })
|
|
15331
15380
|
]);
|
|
15332
|
-
var CheckCredentialProviderSchema =
|
|
15333
|
-
|
|
15334
|
-
|
|
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() })
|
|
15335
15384
|
]);
|
|
15336
|
-
var CheckCredentialSchema =
|
|
15337
|
-
applies:
|
|
15385
|
+
var CheckCredentialSchema = import_zod18.z.strictObject({
|
|
15386
|
+
applies: import_zod18.z.enum(CHECK_CREDENTIAL_APPLIES),
|
|
15338
15387
|
provider: CheckCredentialProviderSchema.optional(),
|
|
15339
15388
|
identity: CredentialSummarySchema.optional(),
|
|
15340
15389
|
identityCached: CachedCredentialStateSchema.optional()
|
|
15341
15390
|
});
|
|
15342
|
-
var CheckClaudeVersionSchema =
|
|
15343
|
-
pinned:
|
|
15344
|
-
highestInstalled:
|
|
15345
|
-
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()))
|
|
15346
15395
|
});
|
|
15347
|
-
var CheckReportJsonSchema =
|
|
15348
|
-
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) }),
|
|
15349
15398
|
/** The pool ranking, when the launch named a pool instead of an identity. */
|
|
15350
15399
|
pool: PoolPickReportSchema.optional(),
|
|
15351
|
-
configProfile:
|
|
15352
|
-
layers:
|
|
15353
|
-
entries:
|
|
15354
|
-
projectEncodingAmbiguities:
|
|
15355
|
-
|
|
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() }))
|
|
15356
15405
|
),
|
|
15357
|
-
diagnostics:
|
|
15406
|
+
diagnostics: import_zod18.z.readonly(import_zod18.z.array(CheckDiagnosticSchema)),
|
|
15358
15407
|
ambientCredential: CheckAmbientCredentialSchema,
|
|
15359
15408
|
keychain: CheckKeychainSchema.optional(),
|
|
15360
|
-
settingsExposure:
|
|
15409
|
+
settingsExposure: import_zod18.z.readonly(import_zod18.z.array(CheckSettingsExposureSchema)),
|
|
15361
15410
|
credential: CheckCredentialSchema,
|
|
15362
15411
|
claudeVersion: CheckClaudeVersionSchema.optional()
|
|
15363
15412
|
});
|
|
@@ -15417,28 +15466,28 @@ function collectResets(snapshots, nowMs) {
|
|
|
15417
15466
|
}
|
|
15418
15467
|
|
|
15419
15468
|
// src/usage/resetsSchema.ts
|
|
15420
|
-
var
|
|
15421
|
-
var ResetRowSchema =
|
|
15422
|
-
identity:
|
|
15423
|
-
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(),
|
|
15424
15473
|
/** What the window is: `5h`, `7d` or `extra usage` for an Anthropic account, or the provider's own measure and period (`tokens 5h`). */
|
|
15425
|
-
window:
|
|
15474
|
+
window: import_zod19.z.string(),
|
|
15426
15475
|
/** When the state the window comes from was observed, as an ISO instant. */
|
|
15427
|
-
observedAt:
|
|
15476
|
+
observedAt: import_zod19.z.iso.datetime(),
|
|
15428
15477
|
/** When the window resets, as an ISO instant; absent when the upstream reported none. */
|
|
15429
|
-
resetsAt:
|
|
15478
|
+
resetsAt: import_zod19.z.iso.datetime().optional(),
|
|
15430
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. */
|
|
15431
|
-
reset:
|
|
15480
|
+
reset: import_zod19.z.boolean(),
|
|
15432
15481
|
/** The fraction used, as `effectiveWindow` reads it at the report's own clock. */
|
|
15433
|
-
utilization:
|
|
15482
|
+
utilization: import_zod19.z.number().optional(),
|
|
15434
15483
|
/** The window's own status, for a window that has not reset yet. */
|
|
15435
|
-
status:
|
|
15484
|
+
status: import_zod19.z.string().optional()
|
|
15436
15485
|
});
|
|
15437
|
-
var ResetScheduleSchema =
|
|
15486
|
+
var ResetScheduleSchema = import_zod19.z.strictObject({ resets: import_zod19.z.readonly(import_zod19.z.array(ResetRowSchema)) });
|
|
15438
15487
|
|
|
15439
15488
|
// src/frontdoor/controlSchemas.ts
|
|
15440
15489
|
var import_node_path32 = __toESM(require("node:path"), 1);
|
|
15441
|
-
var
|
|
15490
|
+
var import_zod26 = require("zod");
|
|
15442
15491
|
|
|
15443
15492
|
// src/doctorReport.ts
|
|
15444
15493
|
init_claudeShim();
|
|
@@ -15618,24 +15667,24 @@ var import_node_path31 = __toESM(require("node:path"), 1);
|
|
|
15618
15667
|
init_signIn();
|
|
15619
15668
|
|
|
15620
15669
|
// src/codex/siwcStore.ts
|
|
15621
|
-
var
|
|
15670
|
+
var import_zod23 = require("zod");
|
|
15622
15671
|
|
|
15623
15672
|
// src/codex/auth.ts
|
|
15624
|
-
var
|
|
15625
|
-
var AuthFileSchema =
|
|
15626
|
-
tokens:
|
|
15627
|
-
access_token:
|
|
15628
|
-
refresh_token:
|
|
15629
|
-
id_token:
|
|
15630
|
-
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()
|
|
15631
15680
|
}).nullish(),
|
|
15632
|
-
last_refresh:
|
|
15681
|
+
last_refresh: import_zod21.z.string().optional()
|
|
15633
15682
|
});
|
|
15634
|
-
var TokenGrantSchema =
|
|
15635
|
-
access_token:
|
|
15636
|
-
refresh_token:
|
|
15637
|
-
id_token:
|
|
15638
|
-
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()
|
|
15639
15688
|
});
|
|
15640
15689
|
var CodexAuthError = class extends Error {
|
|
15641
15690
|
constructor(message) {
|
|
@@ -15645,41 +15694,41 @@ var CodexAuthError = class extends Error {
|
|
|
15645
15694
|
};
|
|
15646
15695
|
|
|
15647
15696
|
// src/codex/siwc.ts
|
|
15648
|
-
var
|
|
15697
|
+
var import_zod22 = require("zod");
|
|
15649
15698
|
var SIWC_RESOURCE = "https://api.openai.com/v1";
|
|
15650
15699
|
var SIWC_RESPONSES_URL = `${SIWC_RESOURCE}/responses`;
|
|
15651
15700
|
var SIWC_PLAN_SCOPE = "chatgpt.tokens.use.direct";
|
|
15652
|
-
var TokenResponseSchema =
|
|
15653
|
-
access_token:
|
|
15654
|
-
refresh_token:
|
|
15655
|
-
id_token:
|
|
15656
|
-
expires_in:
|
|
15657
|
-
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()
|
|
15658
15707
|
});
|
|
15659
|
-
var JwtHeaderSchema =
|
|
15660
|
-
var IdTokenClaimsSchema =
|
|
15661
|
-
iss:
|
|
15662
|
-
sub:
|
|
15663
|
-
aud:
|
|
15664
|
-
exp:
|
|
15665
|
-
nonce:
|
|
15666
|
-
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()
|
|
15667
15716
|
});
|
|
15668
|
-
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() })) });
|
|
15669
15718
|
|
|
15670
15719
|
// src/codex/siwcStore.ts
|
|
15671
|
-
var SiwcGrantSchema =
|
|
15672
|
-
clientId:
|
|
15673
|
-
sub:
|
|
15674
|
-
email:
|
|
15675
|
-
idToken:
|
|
15676
|
-
accessToken:
|
|
15677
|
-
refreshToken:
|
|
15678
|
-
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(),
|
|
15679
15728
|
/** When the access token stops working, in milliseconds since the epoch. */
|
|
15680
|
-
expiresAt:
|
|
15729
|
+
expiresAt: import_zod23.z.number()
|
|
15681
15730
|
});
|
|
15682
|
-
var SiwcFileSchema =
|
|
15731
|
+
var SiwcFileSchema = import_zod23.z.strictObject({ registeredClientId: import_zod23.z.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
|
|
15683
15732
|
function parseSiwcFile(raw, filePath) {
|
|
15684
15733
|
let json;
|
|
15685
15734
|
try {
|
|
@@ -15961,6 +16010,7 @@ function realFrontDoorListenerProbes(paths) {
|
|
|
15961
16010
|
// src/doctorReport.ts
|
|
15962
16011
|
init_supervisorProcesses();
|
|
15963
16012
|
init_legacy();
|
|
16013
|
+
init_providerAliases();
|
|
15964
16014
|
init_providersStore();
|
|
15965
16015
|
init_guard();
|
|
15966
16016
|
init_identity();
|
|
@@ -16289,6 +16339,10 @@ function runDoctor(params) {
|
|
|
16289
16339
|
for (const entry of params.providers) {
|
|
16290
16340
|
pushProvider(push, entry, params.credentialCache, params.chatgptSignIn);
|
|
16291
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
|
+
}
|
|
16292
16346
|
if (params.platform !== "darwin" || params.run === void 0) {
|
|
16293
16347
|
push("keychain", "pass", "Skipped (not macOS).");
|
|
16294
16348
|
} else {
|
|
@@ -16578,6 +16632,7 @@ function collectDoctorReport(params) {
|
|
|
16578
16632
|
identities,
|
|
16579
16633
|
configProfiles,
|
|
16580
16634
|
providers,
|
|
16635
|
+
providerAliases: readProviderAliases(paths),
|
|
16581
16636
|
directoryRules: { path: paths.directoryRulesFile, raw: realFsPort.readFileUtf8(paths.directoryRulesFile) },
|
|
16582
16637
|
globalConfig: { path: paths.globalConfigFile, raw: realFsPort.readFileUtf8(paths.globalConfigFile) },
|
|
16583
16638
|
models: parsedModelsOf(paths),
|
|
@@ -16633,90 +16688,90 @@ function collectDoctorReport(params) {
|
|
|
16633
16688
|
// src/frontdoor/controlSchemas.ts
|
|
16634
16689
|
init_schema2();
|
|
16635
16690
|
init_state();
|
|
16636
|
-
var UsageListOutputSchema =
|
|
16637
|
-
var UsageWindowsInputSchema =
|
|
16638
|
-
identity:
|
|
16639
|
-
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()
|
|
16640
16695
|
});
|
|
16641
|
-
var EffectiveWindowSchema =
|
|
16696
|
+
var EffectiveWindowSchema = import_zod26.z.strictObject({
|
|
16642
16697
|
/** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
|
|
16643
|
-
reset:
|
|
16698
|
+
reset: import_zod26.z.boolean(),
|
|
16644
16699
|
/** The fraction used: 0 for a reset window, otherwise what was last observed, absent when none was reported. */
|
|
16645
|
-
utilization:
|
|
16700
|
+
utilization: import_zod26.z.number().optional(),
|
|
16646
16701
|
/** The reset instant, for a window that has not reset yet and reported one. */
|
|
16647
|
-
resetsAtMs:
|
|
16702
|
+
resetsAtMs: import_zod26.z.number().optional(),
|
|
16648
16703
|
/** The window's own status, for a window that has not reset yet. */
|
|
16649
|
-
status:
|
|
16704
|
+
status: import_zod26.z.string().optional()
|
|
16650
16705
|
});
|
|
16651
|
-
var UsageWindowsOutputSchema =
|
|
16652
|
-
identity:
|
|
16653
|
-
provider:
|
|
16706
|
+
var UsageWindowsOutputSchema = import_zod26.z.strictObject({
|
|
16707
|
+
identity: import_zod26.z.string(),
|
|
16708
|
+
provider: import_zod26.z.string(),
|
|
16654
16709
|
/** When the rate-limit state the windows come from was observed. */
|
|
16655
|
-
observedAt:
|
|
16710
|
+
observedAt: import_zod26.z.iso.datetime().optional(),
|
|
16656
16711
|
fiveHour: EffectiveWindowSchema.optional(),
|
|
16657
16712
|
sevenDay: EffectiveWindowSchema.optional()
|
|
16658
16713
|
});
|
|
16659
|
-
var UsageLiveOutputSchema =
|
|
16714
|
+
var UsageLiveOutputSchema = import_zod26.z.strictObject({
|
|
16660
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. */
|
|
16661
16716
|
latest: RcLiveRateLimitSchema.optional(),
|
|
16662
16717
|
/** One observation per session whose stream has filed a rate_limit_event this door generation. */
|
|
16663
|
-
sessions:
|
|
16718
|
+
sessions: import_zod26.z.readonly(import_zod26.z.array(RcLiveRateLimitSchema))
|
|
16664
16719
|
});
|
|
16665
|
-
var FrontDoorSessionStatusSchema =
|
|
16666
|
-
pid:
|
|
16667
|
-
startedAt:
|
|
16668
|
-
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()
|
|
16669
16724
|
});
|
|
16670
|
-
var HeadroomSocketTargetSchema =
|
|
16671
|
-
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({
|
|
16672
16727
|
state: FrontDoorStateSchema,
|
|
16673
|
-
supervisorAlive:
|
|
16674
|
-
sessions:
|
|
16728
|
+
supervisorAlive: import_zod26.z.boolean(),
|
|
16729
|
+
sessions: import_zod26.z.readonly(import_zod26.z.array(FrontDoorSessionStatusSchema)),
|
|
16675
16730
|
headroomSocket: HeadroomSocketTargetSchema.optional(),
|
|
16676
|
-
logPath:
|
|
16677
|
-
logExists:
|
|
16731
|
+
logPath: import_zod26.z.string(),
|
|
16732
|
+
logExists: import_zod26.z.boolean()
|
|
16678
16733
|
});
|
|
16679
|
-
var FrontDoorSessionsOutputSchema =
|
|
16680
|
-
var CheckRunInputSchema =
|
|
16681
|
-
path:
|
|
16682
|
-
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()
|
|
16683
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" });
|
|
16684
|
-
var PoolPickInputSchema =
|
|
16685
|
-
pool:
|
|
16686
|
-
path:
|
|
16739
|
+
var PoolPickInputSchema = import_zod26.z.strictObject({
|
|
16740
|
+
pool: import_zod26.z.string().min(1),
|
|
16741
|
+
path: import_zod26.z.string().min(1)
|
|
16687
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" });
|
|
16688
|
-
var DoctorFindingSchema =
|
|
16689
|
-
section:
|
|
16690
|
-
subject:
|
|
16691
|
-
severity:
|
|
16692
|
-
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()
|
|
16693
16748
|
});
|
|
16694
|
-
var DoctorRunOutputSchema =
|
|
16749
|
+
var DoctorRunOutputSchema = import_zod26.z.strictObject({
|
|
16695
16750
|
/** False exactly when any finding is a `fail`; a `warn` never fails the report on its own. */
|
|
16696
|
-
ok:
|
|
16697
|
-
findings:
|
|
16751
|
+
ok: import_zod26.z.boolean(),
|
|
16752
|
+
findings: import_zod26.z.readonly(import_zod26.z.array(DoctorFindingSchema))
|
|
16698
16753
|
});
|
|
16699
|
-
var FrontDoorRestartOutputSchema =
|
|
16700
|
-
action:
|
|
16701
|
-
previousPid:
|
|
16754
|
+
var FrontDoorRestartOutputSchema = import_zod26.z.strictObject({
|
|
16755
|
+
action: import_zod26.z.literal("restarting"),
|
|
16756
|
+
previousPid: import_zod26.z.int().positive()
|
|
16702
16757
|
});
|
|
16703
|
-
var UpdateCheckOutputSchema =
|
|
16704
|
-
current:
|
|
16705
|
-
latest:
|
|
16706
|
-
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"])
|
|
16707
16762
|
});
|
|
16708
|
-
var CodexSignInSchema =
|
|
16709
|
-
|
|
16710
|
-
|
|
16711
|
-
|
|
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() })
|
|
16712
16767
|
]);
|
|
16713
|
-
var CodexStatusOutputSchema =
|
|
16768
|
+
var CodexStatusOutputSchema = import_zod26.z.strictObject({
|
|
16714
16769
|
signIn: CodexSignInSchema,
|
|
16715
|
-
codexProviders:
|
|
16770
|
+
codexProviders: import_zod26.z.readonly(import_zod26.z.array(import_zod26.z.string()))
|
|
16716
16771
|
});
|
|
16717
|
-
var CodexLogoutOutputSchema =
|
|
16718
|
-
hadGrant:
|
|
16719
|
-
revoked:
|
|
16772
|
+
var CodexLogoutOutputSchema = import_zod26.z.strictObject({
|
|
16773
|
+
hadGrant: import_zod26.z.boolean(),
|
|
16774
|
+
revoked: import_zod26.z.boolean()
|
|
16720
16775
|
});
|
|
16721
16776
|
|
|
16722
16777
|
// src/frontdoor/codexApi.ts
|
|
@@ -16873,143 +16928,143 @@ init_identity();
|
|
|
16873
16928
|
init_providersStore();
|
|
16874
16929
|
|
|
16875
16930
|
// src/frontdoor/configSchemas.ts
|
|
16876
|
-
var
|
|
16931
|
+
var import_zod27 = require("zod");
|
|
16877
16932
|
init_schema();
|
|
16878
|
-
var RemovalConfirmationSchema =
|
|
16879
|
-
var CredentialWriteSchema = (targets) =>
|
|
16880
|
-
sources:
|
|
16881
|
-
target:
|
|
16882
|
-
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()
|
|
16883
16938
|
});
|
|
16884
|
-
var CredentialSummarySchema2 =
|
|
16885
|
-
target:
|
|
16886
|
-
sources:
|
|
16887
|
-
|
|
16888
|
-
|
|
16889
|
-
|
|
16890
|
-
|
|
16891
|
-
|
|
16892
|
-
|
|
16893
|
-
|
|
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") })
|
|
16894
16949
|
])
|
|
16895
16950
|
)),
|
|
16896
16951
|
cache: CredentialCacheSchema.optional()
|
|
16897
16952
|
});
|
|
16898
|
-
var mutationOutput = (kind, action) =>
|
|
16899
|
-
var storedMutationOutput = (kind, action, value) =>
|
|
16900
|
-
var IdentityValueSchema =
|
|
16901
|
-
name:
|
|
16902
|
-
defaultConfigProfile:
|
|
16903
|
-
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(),
|
|
16904
16959
|
credential: CredentialSummarySchema2.optional(),
|
|
16905
|
-
anchors:
|
|
16960
|
+
anchors: import_zod27.z.array(AnchorSchema).optional()
|
|
16906
16961
|
});
|
|
16907
16962
|
var ProfileValueSchema = ConfigProfileSchema.omit({ $schema: true });
|
|
16908
|
-
var ProviderValueSchema =
|
|
16909
|
-
name:
|
|
16910
|
-
kind:
|
|
16911
|
-
displayName:
|
|
16912
|
-
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(),
|
|
16913
16968
|
codex: CodexProviderConfigSchema.optional(),
|
|
16914
16969
|
credential: CredentialSummarySchema2.optional(),
|
|
16915
|
-
env:
|
|
16970
|
+
env: import_zod27.z.record(import_zod27.z.string(), import_zod27.z.string()).optional()
|
|
16916
16971
|
});
|
|
16917
|
-
var ConfigNameInputSchema =
|
|
16972
|
+
var ConfigNameInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1) });
|
|
16918
16973
|
var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
|
|
16919
|
-
var ConfigIdentitySetInputSchema =
|
|
16920
|
-
name:
|
|
16921
|
-
defaultConfigProfile:
|
|
16922
|
-
allowAmbientCredential:
|
|
16923
|
-
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(),
|
|
16924
16979
|
/** `false` removes the anchors; a list replaces them. */
|
|
16925
|
-
anchors:
|
|
16980
|
+
anchors: import_zod27.z.union([import_zod27.z.literal(false), import_zod27.z.array(AnchorSchema).min(1)]).optional()
|
|
16926
16981
|
});
|
|
16927
16982
|
var ConfigIdentitySetOutputSchema = storedMutationOutput("identity", "updated", IdentityValueSchema);
|
|
16928
|
-
var ConfigIdentityRemoveInputSchema =
|
|
16983
|
+
var ConfigIdentityRemoveInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16929
16984
|
var ConfigIdentityRemoveOutputSchema = mutationOutput("identity", "removed");
|
|
16930
16985
|
var ConfigIdentityUseOutputSchema = mutationOutput("identity", "selected");
|
|
16931
|
-
var ConfigProfileAddInputSchema =
|
|
16932
|
-
name:
|
|
16933
|
-
extends:
|
|
16934
|
-
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()
|
|
16935
16990
|
});
|
|
16936
16991
|
var ConfigProfileAddOutputSchema = storedMutationOutput("profile", "created", ProfileValueSchema);
|
|
16937
|
-
var ConfigProfileSetInputSchema =
|
|
16938
|
-
name:
|
|
16939
|
-
category:
|
|
16940
|
-
entry:
|
|
16941
|
-
extends:
|
|
16942
|
-
description:
|
|
16943
|
-
launch:
|
|
16944
|
-
skipPermissions:
|
|
16945
|
-
remoteControl:
|
|
16946
|
-
headroom:
|
|
16947
|
-
trackUsage:
|
|
16948
|
-
provider:
|
|
16949
|
-
claudeVersion:
|
|
16950
|
-
delay:
|
|
16951
|
-
pause:
|
|
16952
|
-
explain:
|
|
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()
|
|
16953
17008
|
}).optional()
|
|
16954
17009
|
});
|
|
16955
17010
|
var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
|
|
16956
|
-
var ConfigProfileRemoveInputSchema =
|
|
17011
|
+
var ConfigProfileRemoveInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16957
17012
|
var ConfigProfileRemoveOutputSchema = mutationOutput("profile", "removed");
|
|
16958
17013
|
var ConfigProfileUseOutputSchema = mutationOutput("profile", "selected");
|
|
16959
|
-
var PoolMembersInputSchema =
|
|
16960
|
-
var ConfigPoolAddInputSchema =
|
|
16961
|
-
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),
|
|
16962
17017
|
identities: PoolMembersInputSchema,
|
|
16963
|
-
preference:
|
|
16964
|
-
resumeOnLimit:
|
|
16965
|
-
compactBeforeLimit:
|
|
17018
|
+
preference: import_zod27.z.enum(POOL_PREFERENCES).optional(),
|
|
17019
|
+
resumeOnLimit: import_zod27.z.boolean().optional(),
|
|
17020
|
+
compactBeforeLimit: import_zod27.z.boolean().optional(),
|
|
16966
17021
|
compactAtUtilisation: CompactAtUtilisationSchema.optional()
|
|
16967
17022
|
});
|
|
16968
17023
|
var ConfigPoolAddOutputSchema = storedMutationOutput("pool", "created", PoolSchema);
|
|
16969
|
-
var ConfigPoolSetInputSchema =
|
|
16970
|
-
name:
|
|
17024
|
+
var ConfigPoolSetInputSchema = import_zod27.z.strictObject({
|
|
17025
|
+
name: import_zod27.z.string().min(1),
|
|
16971
17026
|
identities: PoolMembersInputSchema.optional(),
|
|
16972
|
-
preference:
|
|
16973
|
-
resumeOnLimit:
|
|
16974
|
-
compactBeforeLimit:
|
|
16975
|
-
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()
|
|
16976
17031
|
});
|
|
16977
17032
|
var ConfigPoolSetOutputSchema = storedMutationOutput("pool", "updated", PoolSchema);
|
|
16978
|
-
var ConfigPoolRemoveInputSchema =
|
|
17033
|
+
var ConfigPoolRemoveInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16979
17034
|
var ConfigPoolRemoveOutputSchema = mutationOutput("pool", "removed");
|
|
16980
17035
|
var ConfigPoolUseOutputSchema = mutationOutput("pool", "selected");
|
|
16981
|
-
var ConfigProviderAddInputSchema =
|
|
16982
|
-
name:
|
|
16983
|
-
kind:
|
|
16984
|
-
displayName:
|
|
16985
|
-
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(),
|
|
16986
17041
|
credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).required({ sources: true }),
|
|
16987
17042
|
codex: CodexProviderConfigSchema.optional()
|
|
16988
17043
|
});
|
|
16989
17044
|
var ConfigProviderAddOutputSchema = storedMutationOutput("provider", "created", ProviderValueSchema);
|
|
16990
|
-
var ConfigProviderSetInputSchema =
|
|
16991
|
-
name:
|
|
16992
|
-
displayName:
|
|
16993
|
-
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(),
|
|
16994
17049
|
credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).optional(),
|
|
16995
17050
|
codex: CodexProviderConfigSchema.optional()
|
|
16996
17051
|
});
|
|
16997
17052
|
var ConfigProviderSetOutputSchema = storedMutationOutput("provider", "updated", ProviderValueSchema);
|
|
16998
|
-
var ConfigProviderRemoveInputSchema =
|
|
17053
|
+
var ConfigProviderRemoveInputSchema = import_zod27.z.strictObject({ name: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16999
17054
|
var ConfigProviderRemoveOutputSchema = mutationOutput("provider", "removed");
|
|
17000
|
-
var ConfigRuleAddInputSchema =
|
|
17001
|
-
path:
|
|
17002
|
-
configProfile:
|
|
17003
|
-
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()
|
|
17004
17059
|
});
|
|
17005
17060
|
var ConfigRuleAddOutputSchema = storedMutationOutput("rule", "created", DirectoryRuleSchema);
|
|
17006
|
-
var ConfigRuleSetInputSchema =
|
|
17007
|
-
path:
|
|
17008
|
-
configProfile:
|
|
17009
|
-
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()
|
|
17010
17065
|
});
|
|
17011
17066
|
var ConfigRuleSetOutputSchema = storedMutationOutput("rule", "updated", DirectoryRuleSchema);
|
|
17012
|
-
var ConfigRuleRemoveInputSchema =
|
|
17067
|
+
var ConfigRuleRemoveInputSchema = import_zod27.z.strictObject({ path: import_zod27.z.string().min(1), confirm: RemovalConfirmationSchema });
|
|
17013
17068
|
var ConfigRuleRemoveOutputSchema = mutationOutput("rule", "removed");
|
|
17014
17069
|
|
|
17015
17070
|
// src/frontdoor/configApi.ts
|
|
@@ -17320,43 +17375,43 @@ var import_openapi4 = require("@orpc/openapi");
|
|
|
17320
17375
|
var import_server3 = require("@orpc/server");
|
|
17321
17376
|
|
|
17322
17377
|
// src/frontdoor/eventSchemas.ts
|
|
17323
|
-
var
|
|
17378
|
+
var import_zod28 = require("zod");
|
|
17324
17379
|
var DOOR_EVENT_SOURCE_RC = "rc";
|
|
17325
17380
|
var LAUNCH_EVENT_SOURCE = "launch";
|
|
17326
17381
|
var USAGE_EVENT_SOURCE = "usage";
|
|
17327
17382
|
var DOOR_HEALTH_EVENT_SOURCE = "door";
|
|
17328
17383
|
var QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
|
|
17329
|
-
var DoorEventSchema =
|
|
17330
|
-
source:
|
|
17384
|
+
var DoorEventSchema = import_zod28.z.strictObject({
|
|
17385
|
+
source: import_zod28.z.string().min(1),
|
|
17331
17386
|
/** A positive integer because the backbone's counters start at one and only ever increase. */
|
|
17332
|
-
sequence:
|
|
17333
|
-
payload:
|
|
17387
|
+
sequence: import_zod28.z.number().int().positive(),
|
|
17388
|
+
payload: import_zod28.z.unknown()
|
|
17334
17389
|
});
|
|
17335
|
-
var DoorEventSourceQuerySchema =
|
|
17336
|
-
sources:
|
|
17390
|
+
var DoorEventSourceQuerySchema = import_zod28.z.strictObject({
|
|
17391
|
+
sources: import_zod28.z.array(import_zod28.z.string().min(1)).min(1).optional()
|
|
17337
17392
|
});
|
|
17338
|
-
var LaunchLifecycleEventSchema =
|
|
17339
|
-
kind:
|
|
17340
|
-
pid:
|
|
17341
|
-
startedAt:
|
|
17342
|
-
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()
|
|
17343
17398
|
});
|
|
17344
|
-
var DoorHealthEventSchema =
|
|
17345
|
-
|
|
17346
|
-
|
|
17347
|
-
|
|
17348
|
-
|
|
17349
|
-
|
|
17350
|
-
|
|
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() })
|
|
17351
17406
|
]);
|
|
17352
|
-
var QuotaExpiringEventSchema =
|
|
17353
|
-
identity:
|
|
17354
|
-
provider:
|
|
17355
|
-
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"]),
|
|
17356
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. */
|
|
17357
|
-
utilization:
|
|
17358
|
-
resetsAt:
|
|
17359
|
-
observedAt:
|
|
17412
|
+
utilization: import_zod28.z.number().min(0).max(1),
|
|
17413
|
+
resetsAt: import_zod28.z.iso.datetime(),
|
|
17414
|
+
observedAt: import_zod28.z.number()
|
|
17360
17415
|
});
|
|
17361
17416
|
|
|
17362
17417
|
// src/frontdoor/eventsApi.ts
|
|
@@ -17440,55 +17495,55 @@ init_cliError();
|
|
|
17440
17495
|
|
|
17441
17496
|
// src/frontdoor/launchSchemas.ts
|
|
17442
17497
|
var import_node_path33 = __toESM(require("node:path"), 1);
|
|
17443
|
-
var
|
|
17498
|
+
var import_zod29 = require("zod");
|
|
17444
17499
|
init_claudeVersion();
|
|
17445
17500
|
init_identity();
|
|
17446
|
-
var LaunchResolveInputSchema =
|
|
17447
|
-
path:
|
|
17501
|
+
var LaunchResolveInputSchema = import_zod29.z.strictObject({
|
|
17502
|
+
path: import_zod29.z.string().min(1),
|
|
17448
17503
|
/** `@name`, launch flags, then the arguments for `claude`; empty for a bare launch. */
|
|
17449
|
-
argv:
|
|
17504
|
+
argv: import_zod29.z.readonly(import_zod29.z.array(import_zod29.z.string())).optional(),
|
|
17450
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. */
|
|
17451
|
-
env:
|
|
17506
|
+
env: import_zod29.z.record(import_zod29.z.string(), import_zod29.z.string()).optional()
|
|
17452
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" });
|
|
17453
|
-
var LaunchPoolDecisionSchema =
|
|
17454
|
-
name:
|
|
17455
|
-
reasons:
|
|
17456
|
-
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()
|
|
17457
17512
|
});
|
|
17458
|
-
var LaunchDecisionSchema =
|
|
17459
|
-
identity:
|
|
17460
|
-
identitySource:
|
|
17513
|
+
var LaunchDecisionSchema = import_zod29.z.strictObject({
|
|
17514
|
+
identity: import_zod29.z.string().optional(),
|
|
17515
|
+
identitySource: import_zod29.z.enum(IDENTITY_DECISION_SOURCES),
|
|
17461
17516
|
pool: LaunchPoolDecisionSchema.optional(),
|
|
17462
|
-
configDirEscapeHatch:
|
|
17463
|
-
configDir:
|
|
17464
|
-
configProfile:
|
|
17465
|
-
configProfileSource:
|
|
17466
|
-
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()
|
|
17467
17522
|
});
|
|
17468
|
-
var LaunchFlagsSchema =
|
|
17469
|
-
skipPermissions:
|
|
17470
|
-
remoteControl:
|
|
17471
|
-
headroom:
|
|
17472
|
-
trackUsage:
|
|
17473
|
-
pause:
|
|
17474
|
-
explain:
|
|
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(),
|
|
17475
17530
|
/** How long the launch waits after its own output before it starts claude, in milliseconds. */
|
|
17476
|
-
delayMs:
|
|
17531
|
+
delayMs: import_zod29.z.number()
|
|
17477
17532
|
});
|
|
17478
|
-
var LaunchResolveOutputSchema =
|
|
17533
|
+
var LaunchResolveOutputSchema = import_zod29.z.strictObject({
|
|
17479
17534
|
decision: LaunchDecisionSchema,
|
|
17480
17535
|
flags: LaunchFlagsSchema,
|
|
17481
|
-
claudeVersion:
|
|
17536
|
+
claudeVersion: import_zod29.z.strictObject({ version: import_zod29.z.string(), source: import_zod29.z.enum(CLAUDE_VERSION_SOURCES) }).optional(),
|
|
17482
17537
|
/** The real `claude` binary the launch would spawn, on the door's host. */
|
|
17483
|
-
bin:
|
|
17538
|
+
bin: import_zod29.z.string(),
|
|
17484
17539
|
/** The arguments the launch would pass it: the tool's own flags, then `CLAUDE_EXTRA_FLAGS`, then the caller's own. */
|
|
17485
|
-
args:
|
|
17540
|
+
args: import_zod29.z.readonly(import_zod29.z.array(import_zod29.z.string())),
|
|
17486
17541
|
/** The credential the launch would authenticate with, by target and source kinds. Absent when none applies. */
|
|
17487
|
-
credential:
|
|
17488
|
-
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() }),
|
|
17489
17544
|
/** The names of the environment variables the launch would set or unset, sorted. Values are not reported. */
|
|
17490
|
-
environment:
|
|
17491
|
-
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()))
|
|
17492
17547
|
});
|
|
17493
17548
|
|
|
17494
17549
|
// src/frontdoor/launchApi.ts
|
|
@@ -17524,22 +17579,22 @@ function createLaunchApiRouter(deps) {
|
|
|
17524
17579
|
// src/frontdoor/agentTreesApi.ts
|
|
17525
17580
|
var import_client6 = require("@orpc/client");
|
|
17526
17581
|
var import_openapi7 = require("@orpc/openapi");
|
|
17527
|
-
var
|
|
17582
|
+
var import_zod30 = require("zod");
|
|
17528
17583
|
init_cliError();
|
|
17529
|
-
var AgentTreesListInputSchema =
|
|
17584
|
+
var AgentTreesListInputSchema = import_zod30.z.strictObject({
|
|
17530
17585
|
/** Only this identity's sessions. */
|
|
17531
|
-
identity:
|
|
17586
|
+
identity: import_zod30.z.string().optional(),
|
|
17532
17587
|
/** Include sessions that spawned no agent and ran no workflow. */
|
|
17533
|
-
all:
|
|
17588
|
+
all: import_zod30.z.boolean().optional()
|
|
17534
17589
|
});
|
|
17535
|
-
var AgentTreesListOutputSchema =
|
|
17536
|
-
var AgentTreesShowInputSchema =
|
|
17590
|
+
var AgentTreesListOutputSchema = import_zod30.z.array(SessionSummarySchema);
|
|
17591
|
+
var AgentTreesShowInputSchema = import_zod30.z.strictObject({
|
|
17537
17592
|
/** A session id, or an unambiguous prefix of one. */
|
|
17538
|
-
session:
|
|
17593
|
+
session: import_zod30.z.string().min(1),
|
|
17539
17594
|
/** Look only in this identity. */
|
|
17540
|
-
identity:
|
|
17595
|
+
identity: import_zod30.z.string().optional()
|
|
17541
17596
|
});
|
|
17542
|
-
var AgentTreesShowOutputSchema =
|
|
17597
|
+
var AgentTreesShowOutputSchema = import_zod30.z.strictObject({ identities: import_zod30.z.array(import_zod30.z.string()), ...MergedAgentTreeSchema.shape });
|
|
17543
17598
|
function asBadRequest(error) {
|
|
17544
17599
|
if (error instanceof CliError) {
|
|
17545
17600
|
throw new import_client6.ORPCError("BAD_REQUEST", { message: error.message });
|
|
@@ -19722,7 +19777,7 @@ init_poolPick();
|
|
|
19722
19777
|
|
|
19723
19778
|
// src/agents/read.ts
|
|
19724
19779
|
var import_node_path35 = __toESM(require("node:path"), 1);
|
|
19725
|
-
var
|
|
19780
|
+
var import_zod31 = require("zod");
|
|
19726
19781
|
var PROJECTS_DIR = "projects";
|
|
19727
19782
|
var TASKS_DIR = "tasks";
|
|
19728
19783
|
var SUBAGENTS_DIR = "subagents";
|
|
@@ -19841,14 +19896,14 @@ function parseJson2(text) {
|
|
|
19841
19896
|
return void 0;
|
|
19842
19897
|
}
|
|
19843
19898
|
}
|
|
19844
|
-
var TaskFileSchema =
|
|
19845
|
-
var WorkflowRunFileSchema =
|
|
19846
|
-
runId:
|
|
19847
|
-
workflowName:
|
|
19848
|
-
status:
|
|
19849
|
-
startTime:
|
|
19850
|
-
phases:
|
|
19851
|
-
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()
|
|
19852
19907
|
});
|
|
19853
19908
|
function summariseSession(fs13, configDir, ref) {
|
|
19854
19909
|
const sessionRelative = import_node_path35.default.join(PROJECTS_DIR, ref.project, ref.entry);
|