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.mjs
CHANGED
|
@@ -271,7 +271,6 @@ var init_schema = __esm({
|
|
|
271
271
|
delay: z.string().regex(DURATION_RE, "must be a duration such as 5s or 500ms").optional(),
|
|
272
272
|
/** 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. */
|
|
273
273
|
pause: z.boolean().optional(),
|
|
274
|
-
/** 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. */
|
|
275
274
|
/** 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. */
|
|
276
275
|
explain: z.boolean().optional()
|
|
277
276
|
});
|
|
@@ -3122,7 +3121,7 @@ var init_package = __esm({
|
|
|
3122
3121
|
"package.json"() {
|
|
3123
3122
|
package_default = {
|
|
3124
3123
|
name: "claude-use",
|
|
3125
|
-
version: "11.
|
|
3124
|
+
version: "11.47.0",
|
|
3126
3125
|
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.",
|
|
3127
3126
|
license: "MIT",
|
|
3128
3127
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -6496,6 +6495,7 @@ function buildLayoutPaths(root) {
|
|
|
6496
6495
|
identitiesDir: path23.join(root, "identities"),
|
|
6497
6496
|
configProfilesDir: path23.join(root, "config-profiles"),
|
|
6498
6497
|
providersDir: path23.join(root, "providers"),
|
|
6498
|
+
providerAliasesFile: path23.join(root, "provider-aliases.json"),
|
|
6499
6499
|
directoryRulesFile: path23.join(root, "directory-rules.json"),
|
|
6500
6500
|
activeIdentityFile: path23.join(root, "active-identity"),
|
|
6501
6501
|
globalConfigFile: path23.join(root, "config.json"),
|
|
@@ -6708,6 +6708,50 @@ var init_realCredentialCache = __esm({
|
|
|
6708
6708
|
}
|
|
6709
6709
|
});
|
|
6710
6710
|
|
|
6711
|
+
// src/providerAliases.ts
|
|
6712
|
+
import { z as z15 } from "zod";
|
|
6713
|
+
function parseAliases(file, raw) {
|
|
6714
|
+
const parsed = ProviderAliasesSchema.safeParse(raw);
|
|
6715
|
+
if (!parsed.success) {
|
|
6716
|
+
throw new ConfigValidationError(file, parsed.error.issues);
|
|
6717
|
+
}
|
|
6718
|
+
return parsed.data;
|
|
6719
|
+
}
|
|
6720
|
+
function readProviderAliases(paths) {
|
|
6721
|
+
return readJson(paths.providerAliasesFile, ProviderAliasesSchema) ?? {};
|
|
6722
|
+
}
|
|
6723
|
+
function loadProviderAliases(file, port) {
|
|
6724
|
+
const raw = port.readConfigFile(file);
|
|
6725
|
+
return raw === void 0 ? {} : parseAliases(file, raw);
|
|
6726
|
+
}
|
|
6727
|
+
function canonicalProviderName(name, defined, aliases) {
|
|
6728
|
+
if (defined(name)) {
|
|
6729
|
+
return name;
|
|
6730
|
+
}
|
|
6731
|
+
return aliases()[name] ?? name;
|
|
6732
|
+
}
|
|
6733
|
+
function aliasFindings(aliases, providerNames) {
|
|
6734
|
+
return Object.entries(aliases).map(([alias, target]) => {
|
|
6735
|
+
if (!providerNames.has(target)) {
|
|
6736
|
+
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}\`.` };
|
|
6737
|
+
}
|
|
6738
|
+
if (providerNames.has(alias)) {
|
|
6739
|
+
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}\`.` };
|
|
6740
|
+
}
|
|
6741
|
+
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.` };
|
|
6742
|
+
});
|
|
6743
|
+
}
|
|
6744
|
+
var ProviderAliasesSchema;
|
|
6745
|
+
var init_providerAliases = __esm({
|
|
6746
|
+
"src/providerAliases.ts"() {
|
|
6747
|
+
"use strict";
|
|
6748
|
+
init_cliError();
|
|
6749
|
+
init_load();
|
|
6750
|
+
init_store();
|
|
6751
|
+
ProviderAliasesSchema = z15.record(z15.string().min(1), z15.string().min(1));
|
|
6752
|
+
}
|
|
6753
|
+
});
|
|
6754
|
+
|
|
6711
6755
|
// src/credential.ts
|
|
6712
6756
|
function commandArgv(source) {
|
|
6713
6757
|
if ("command" in source) {
|
|
@@ -7114,6 +7158,11 @@ var init_families = __esm({
|
|
|
7114
7158
|
// src/providersStore.ts
|
|
7115
7159
|
import fs7 from "node:fs";
|
|
7116
7160
|
import path25 from "node:path";
|
|
7161
|
+
function requireValidProviderName(name) {
|
|
7162
|
+
if (!PROVIDER_NAME_RE.test(name)) {
|
|
7163
|
+
throw new InvalidProviderNameError(name);
|
|
7164
|
+
}
|
|
7165
|
+
}
|
|
7117
7166
|
function providerJsonPath(paths, name) {
|
|
7118
7167
|
return path25.join(paths.providersDir, `${name}.json`);
|
|
7119
7168
|
}
|
|
@@ -7234,9 +7283,7 @@ function addProvider(paths, name, input) {
|
|
|
7234
7283
|
if (providerExists(paths, name)) {
|
|
7235
7284
|
throw new ProviderAlreadyExistsError(name);
|
|
7236
7285
|
}
|
|
7237
|
-
|
|
7238
|
-
throw new InvalidProviderNameError(name);
|
|
7239
|
-
}
|
|
7286
|
+
requireValidProviderName(name);
|
|
7240
7287
|
const kind = input.kind ?? "http";
|
|
7241
7288
|
if (kind === "codex" && input.baseUrl !== void 0) {
|
|
7242
7289
|
throw new ProviderKindMismatchError("A codex provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
|
|
@@ -7367,10 +7414,11 @@ function cascadeProviderName(cascade) {
|
|
|
7367
7414
|
}
|
|
7368
7415
|
function selectProvider(params) {
|
|
7369
7416
|
const cliName = params.cliProvider !== void 0 && params.cliProvider !== "" ? params.cliProvider : void 0;
|
|
7370
|
-
const
|
|
7371
|
-
if (
|
|
7417
|
+
const named = cliName ?? (params.cascade === void 0 ? void 0 : cascadeProviderName(params.cascade));
|
|
7418
|
+
if (named === void 0) {
|
|
7372
7419
|
return void 0;
|
|
7373
7420
|
}
|
|
7421
|
+
const name = canonicalProviderName(named, (candidate) => loadProvider(params.paths.providersDir, candidate, params.port) !== void 0, () => loadProviderAliases(params.paths.providerAliasesFile, params.port));
|
|
7374
7422
|
const definition = loadProvider(params.paths.providersDir, name, params.port);
|
|
7375
7423
|
if (definition === void 0) {
|
|
7376
7424
|
const known = listProviderNames(params.port.readdir, params.paths.providersDir);
|
|
@@ -7468,6 +7516,7 @@ var init_providersStore = __esm({
|
|
|
7468
7516
|
init_unrecognisedKeys();
|
|
7469
7517
|
init_schema();
|
|
7470
7518
|
init_cliError();
|
|
7519
|
+
init_providerAliases();
|
|
7471
7520
|
init_credential();
|
|
7472
7521
|
init_walk();
|
|
7473
7522
|
init_families();
|
|
@@ -7716,7 +7765,7 @@ var init_commandDeps = __esm({
|
|
|
7716
7765
|
// src/claudeShim.ts
|
|
7717
7766
|
import fs8 from "node:fs";
|
|
7718
7767
|
import path28 from "node:path";
|
|
7719
|
-
import { z as
|
|
7768
|
+
import { z as z20 } from "zod";
|
|
7720
7769
|
function commandFilename(ownExecutablePath, commandName) {
|
|
7721
7770
|
return ownExecutablePath.toLowerCase().endsWith(".exe") ? `${commandName}.exe` : commandName;
|
|
7722
7771
|
}
|
|
@@ -7766,10 +7815,10 @@ var init_claudeShim = __esm({
|
|
|
7766
7815
|
init_store();
|
|
7767
7816
|
init_realPorts();
|
|
7768
7817
|
init_cliError();
|
|
7769
|
-
ClaudeShimStateSchema =
|
|
7770
|
-
targetPath:
|
|
7771
|
-
method:
|
|
7772
|
-
installedAtMs:
|
|
7818
|
+
ClaudeShimStateSchema = z20.strictObject({
|
|
7819
|
+
targetPath: z20.string().min(1),
|
|
7820
|
+
method: z20.enum(["hardlink", "copy"]),
|
|
7821
|
+
installedAtMs: z20.number()
|
|
7773
7822
|
});
|
|
7774
7823
|
nodeLinkFs = { link: fs8.linkSync, copyFile: fs8.copyFileSync, chmod: fs8.chmodSync };
|
|
7775
7824
|
}
|
|
@@ -7865,62 +7914,62 @@ var init_signatures = __esm({
|
|
|
7865
7914
|
});
|
|
7866
7915
|
|
|
7867
7916
|
// src/codex/anthropic.ts
|
|
7868
|
-
import { z as
|
|
7917
|
+
import { z as z24 } from "zod";
|
|
7869
7918
|
var TextBlockSchema, Base64ImageSourceSchema, UrlImageSourceSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultContentBlockSchema, ToolResultBlockSchema, OtherBlockSchema, ContentBlockSchema, MessageSchema, ToolSchema, ToolChoiceSchema, SystemSchema, MessagesRequestSchema, CountTokensRequestSchema;
|
|
7870
7919
|
var init_anthropic = __esm({
|
|
7871
7920
|
"src/codex/anthropic.ts"() {
|
|
7872
7921
|
"use strict";
|
|
7873
|
-
TextBlockSchema =
|
|
7874
|
-
Base64ImageSourceSchema =
|
|
7875
|
-
UrlImageSourceSchema =
|
|
7876
|
-
ImageBlockSchema =
|
|
7877
|
-
type:
|
|
7878
|
-
source:
|
|
7922
|
+
TextBlockSchema = z24.looseObject({ type: z24.literal("text"), text: z24.string() });
|
|
7923
|
+
Base64ImageSourceSchema = z24.looseObject({ type: z24.literal("base64"), media_type: z24.string().min(1), data: z24.string() });
|
|
7924
|
+
UrlImageSourceSchema = z24.looseObject({ type: z24.literal("url"), url: z24.string().min(1) });
|
|
7925
|
+
ImageBlockSchema = z24.looseObject({
|
|
7926
|
+
type: z24.literal("image"),
|
|
7927
|
+
source: z24.union([Base64ImageSourceSchema, UrlImageSourceSchema])
|
|
7879
7928
|
});
|
|
7880
|
-
ToolUseBlockSchema =
|
|
7881
|
-
type:
|
|
7882
|
-
id:
|
|
7883
|
-
name:
|
|
7884
|
-
input:
|
|
7929
|
+
ToolUseBlockSchema = z24.looseObject({
|
|
7930
|
+
type: z24.literal("tool_use"),
|
|
7931
|
+
id: z24.string().min(1),
|
|
7932
|
+
name: z24.string().min(1),
|
|
7933
|
+
input: z24.unknown()
|
|
7885
7934
|
});
|
|
7886
|
-
ToolResultContentBlockSchema =
|
|
7887
|
-
ToolResultBlockSchema =
|
|
7888
|
-
type:
|
|
7889
|
-
tool_use_id:
|
|
7890
|
-
content:
|
|
7935
|
+
ToolResultContentBlockSchema = z24.union([TextBlockSchema, z24.looseObject({ type: z24.string() })]);
|
|
7936
|
+
ToolResultBlockSchema = z24.looseObject({
|
|
7937
|
+
type: z24.literal("tool_result"),
|
|
7938
|
+
tool_use_id: z24.string().min(1),
|
|
7939
|
+
content: z24.union([z24.string(), z24.array(ToolResultContentBlockSchema)]).optional()
|
|
7891
7940
|
});
|
|
7892
|
-
OtherBlockSchema =
|
|
7893
|
-
ContentBlockSchema =
|
|
7894
|
-
MessageSchema =
|
|
7895
|
-
role:
|
|
7896
|
-
content:
|
|
7941
|
+
OtherBlockSchema = z24.looseObject({ type: z24.string() });
|
|
7942
|
+
ContentBlockSchema = z24.union([TextBlockSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultBlockSchema, OtherBlockSchema]);
|
|
7943
|
+
MessageSchema = z24.looseObject({
|
|
7944
|
+
role: z24.enum(["user", "assistant", "system"]),
|
|
7945
|
+
content: z24.union([z24.string(), z24.array(ContentBlockSchema)])
|
|
7897
7946
|
});
|
|
7898
|
-
ToolSchema =
|
|
7899
|
-
name:
|
|
7900
|
-
description:
|
|
7901
|
-
input_schema:
|
|
7947
|
+
ToolSchema = z24.looseObject({
|
|
7948
|
+
name: z24.string().min(1),
|
|
7949
|
+
description: z24.string().optional(),
|
|
7950
|
+
input_schema: z24.record(z24.string(), z24.unknown()).optional()
|
|
7902
7951
|
});
|
|
7903
|
-
ToolChoiceSchema =
|
|
7904
|
-
|
|
7905
|
-
|
|
7952
|
+
ToolChoiceSchema = z24.union([
|
|
7953
|
+
z24.looseObject({ type: z24.enum(["auto", "none", "any"]) }),
|
|
7954
|
+
z24.looseObject({ type: z24.literal("tool"), name: z24.string().min(1) })
|
|
7906
7955
|
]);
|
|
7907
|
-
SystemSchema =
|
|
7908
|
-
MessagesRequestSchema =
|
|
7909
|
-
model:
|
|
7956
|
+
SystemSchema = z24.union([z24.string(), z24.array(z24.union([TextBlockSchema, OtherBlockSchema]))]);
|
|
7957
|
+
MessagesRequestSchema = z24.looseObject({
|
|
7958
|
+
model: z24.string().optional(),
|
|
7910
7959
|
system: SystemSchema.optional(),
|
|
7911
|
-
messages:
|
|
7912
|
-
tools:
|
|
7960
|
+
messages: z24.array(MessageSchema),
|
|
7961
|
+
tools: z24.array(ToolSchema).optional(),
|
|
7913
7962
|
tool_choice: ToolChoiceSchema.optional(),
|
|
7914
|
-
stream:
|
|
7963
|
+
stream: z24.boolean().optional(),
|
|
7915
7964
|
/** `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. */
|
|
7916
|
-
metadata:
|
|
7965
|
+
metadata: z24.looseObject({ user_id: z24.string().optional() }).optional(),
|
|
7917
7966
|
/** Claude Code's effort setting. Any string is accepted; the translator honours only the levels the backend understands. */
|
|
7918
|
-
output_config:
|
|
7967
|
+
output_config: z24.looseObject({ effort: z24.string().optional() }).optional()
|
|
7919
7968
|
});
|
|
7920
|
-
CountTokensRequestSchema =
|
|
7921
|
-
system:
|
|
7922
|
-
messages:
|
|
7923
|
-
tools:
|
|
7969
|
+
CountTokensRequestSchema = z24.looseObject({
|
|
7970
|
+
system: z24.unknown().optional(),
|
|
7971
|
+
messages: z24.unknown().optional(),
|
|
7972
|
+
tools: z24.unknown().optional()
|
|
7924
7973
|
});
|
|
7925
7974
|
}
|
|
7926
7975
|
});
|
|
@@ -8005,7 +8054,7 @@ var init_translate2 = __esm({
|
|
|
8005
8054
|
// src/providerCatalogue.ts
|
|
8006
8055
|
import path30 from "node:path";
|
|
8007
8056
|
import picomatch4 from "picomatch";
|
|
8008
|
-
import { z as
|
|
8057
|
+
import { z as z25 } from "zod";
|
|
8009
8058
|
function catalogueCachePath(paths, name) {
|
|
8010
8059
|
return path30.join(paths.catalogueDir, `${name}.json`);
|
|
8011
8060
|
}
|
|
@@ -8040,8 +8089,8 @@ var init_providerCatalogue = __esm({
|
|
|
8040
8089
|
CATALOGUE_REQUEST_SECONDS = 10;
|
|
8041
8090
|
CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND5;
|
|
8042
8091
|
CATALOGUE_REFRESH_TIMEOUT_MS = DEFAULT_CANDIDATE_URLS * CATALOGUE_REQUEST_TIMEOUT_MS;
|
|
8043
|
-
CatalogueModelSchema =
|
|
8044
|
-
CatalogueCacheSchema =
|
|
8092
|
+
CatalogueModelSchema = z25.strictObject({ id: z25.string().min(1), name: z25.string().min(1).optional() });
|
|
8093
|
+
CatalogueCacheSchema = z25.strictObject({ fetchedAt: z25.number(), url: z25.string().min(1), models: z25.array(CatalogueModelSchema) });
|
|
8045
8094
|
}
|
|
8046
8095
|
});
|
|
8047
8096
|
|
|
@@ -10402,7 +10451,7 @@ var init_identityClaude = __esm({
|
|
|
10402
10451
|
});
|
|
10403
10452
|
|
|
10404
10453
|
// src/usage/providerQuota.ts
|
|
10405
|
-
import { z as
|
|
10454
|
+
import { z as z32 } from "zod";
|
|
10406
10455
|
var MS_PER_SECOND9, SECONDS_PER_HOUR3, HOURS_PER_DAY6, DAYS_PER_MONTH, ZAI_HOST, ZAI_QUOTA_URL, ZAI_UNIT_HOURS, ZAI_UNIT_MONTHS, ZAI_UNIT_MS, ZaiLimitSchema, ZaiResponseSchema, OPENROUTER_HOST, OPENROUTER_KEY_URL, OPENROUTER_CREDITS_URL, MS_PER_DAY3, OpenRouterKeySchema, OpenRouterCreditsSchema, ANTIGRAVITY_HOST, ANTIGRAVITY_QUOTA_URL, ANTIGRAVITY_USER_URL, FIVE_HOURS2, DAYS_PER_WEEK2, FIVE_HOURS_MS, WEEK_MS, AntigravityBucketSchema, AntigravitySummarySchema, GoogleTokenInfoSchema, AntigravityUserSchema;
|
|
10407
10456
|
var init_providerQuota = __esm({
|
|
10408
10457
|
"src/usage/providerQuota.ts"() {
|
|
@@ -10421,35 +10470,35 @@ var init_providerQuota = __esm({
|
|
|
10421
10470
|
[ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND9],
|
|
10422
10471
|
[ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9]
|
|
10423
10472
|
]);
|
|
10424
|
-
ZaiLimitSchema =
|
|
10425
|
-
type:
|
|
10426
|
-
unit:
|
|
10427
|
-
number:
|
|
10428
|
-
percentage:
|
|
10429
|
-
nextResetTime:
|
|
10430
|
-
usage:
|
|
10431
|
-
currentValue:
|
|
10432
|
-
remaining:
|
|
10473
|
+
ZaiLimitSchema = z32.object({
|
|
10474
|
+
type: z32.string(),
|
|
10475
|
+
unit: z32.number().int(),
|
|
10476
|
+
number: z32.number().int().positive(),
|
|
10477
|
+
percentage: z32.number().nonnegative(),
|
|
10478
|
+
nextResetTime: z32.number().positive().optional(),
|
|
10479
|
+
usage: z32.number().nonnegative().optional(),
|
|
10480
|
+
currentValue: z32.number().nonnegative().optional(),
|
|
10481
|
+
remaining: z32.number().nonnegative().optional()
|
|
10433
10482
|
});
|
|
10434
|
-
ZaiResponseSchema =
|
|
10435
|
-
success:
|
|
10436
|
-
msg:
|
|
10437
|
-
data:
|
|
10483
|
+
ZaiResponseSchema = z32.object({
|
|
10484
|
+
success: z32.boolean(),
|
|
10485
|
+
msg: z32.string().optional(),
|
|
10486
|
+
data: z32.object({ level: z32.string().optional(), limits: z32.array(ZaiLimitSchema) })
|
|
10438
10487
|
});
|
|
10439
10488
|
OPENROUTER_HOST = "openrouter.ai";
|
|
10440
10489
|
OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
|
|
10441
10490
|
OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
|
|
10442
10491
|
MS_PER_DAY3 = HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
10443
|
-
OpenRouterKeySchema =
|
|
10444
|
-
data:
|
|
10445
|
-
limit:
|
|
10446
|
-
limit_remaining:
|
|
10447
|
-
limit_reset:
|
|
10448
|
-
is_free_tier:
|
|
10449
|
-
free_model_daily_requests:
|
|
10492
|
+
OpenRouterKeySchema = z32.object({
|
|
10493
|
+
data: z32.object({
|
|
10494
|
+
limit: z32.number().nonnegative().nullable(),
|
|
10495
|
+
limit_remaining: z32.number().nullable(),
|
|
10496
|
+
limit_reset: z32.string().nullable(),
|
|
10497
|
+
is_free_tier: z32.boolean().optional(),
|
|
10498
|
+
free_model_daily_requests: z32.object({ used: z32.number().nonnegative(), limit: z32.number().nonnegative(), remaining: z32.number() }).optional()
|
|
10450
10499
|
})
|
|
10451
10500
|
});
|
|
10452
|
-
OpenRouterCreditsSchema =
|
|
10501
|
+
OpenRouterCreditsSchema = z32.object({ data: z32.object({ total_credits: z32.number().nonnegative(), total_usage: z32.number().nonnegative() }) });
|
|
10453
10502
|
ANTIGRAVITY_HOST = "daily-cloudcode-pa.googleapis.com";
|
|
10454
10503
|
ANTIGRAVITY_QUOTA_URL = `https://${ANTIGRAVITY_HOST}/v1internal:retrieveUserQuotaSummary`;
|
|
10455
10504
|
ANTIGRAVITY_USER_URL = `https://${ANTIGRAVITY_HOST}/v1internal:loadCodeAssist`;
|
|
@@ -10457,21 +10506,21 @@ var init_providerQuota = __esm({
|
|
|
10457
10506
|
DAYS_PER_WEEK2 = 7;
|
|
10458
10507
|
FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
10459
10508
|
WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
10460
|
-
AntigravityBucketSchema =
|
|
10461
|
-
bucketId:
|
|
10462
|
-
remainingFraction:
|
|
10463
|
-
resetTime:
|
|
10509
|
+
AntigravityBucketSchema = z32.object({
|
|
10510
|
+
bucketId: z32.string(),
|
|
10511
|
+
remainingFraction: z32.number().optional(),
|
|
10512
|
+
resetTime: z32.string().optional()
|
|
10464
10513
|
});
|
|
10465
|
-
AntigravitySummarySchema =
|
|
10466
|
-
GoogleTokenInfoSchema =
|
|
10467
|
-
email:
|
|
10468
|
-
sub:
|
|
10514
|
+
AntigravitySummarySchema = z32.object({ groups: z32.array(z32.object({ buckets: z32.array(AntigravityBucketSchema) })) });
|
|
10515
|
+
GoogleTokenInfoSchema = z32.object({
|
|
10516
|
+
email: z32.string().optional(),
|
|
10517
|
+
sub: z32.string().optional()
|
|
10469
10518
|
});
|
|
10470
|
-
AntigravityUserSchema =
|
|
10519
|
+
AntigravityUserSchema = z32.object({
|
|
10471
10520
|
/** The code-assist tier context, which defaults to the free tier for every account. */
|
|
10472
|
-
currentTier:
|
|
10521
|
+
currentTier: z32.object({ name: z32.string().optional(), id: z32.string().optional() }).optional(),
|
|
10473
10522
|
/** The account's paid subscription; absent when the account has none. */
|
|
10474
|
-
paidTier:
|
|
10523
|
+
paidTier: z32.object({ name: z32.string().optional(), id: z32.string().optional() }).optional()
|
|
10475
10524
|
});
|
|
10476
10525
|
}
|
|
10477
10526
|
});
|
|
@@ -14399,7 +14448,7 @@ init_providersStore();
|
|
|
14399
14448
|
init_projects();
|
|
14400
14449
|
init_pipeline();
|
|
14401
14450
|
import path27 from "node:path";
|
|
14402
|
-
import { z as
|
|
14451
|
+
import { z as z16 } from "zod";
|
|
14403
14452
|
var HISTORY_PROJECTS_KEY_PREFIX = "history/projects/";
|
|
14404
14453
|
function projectFragmentOf(rawKey) {
|
|
14405
14454
|
return rawKey.startsWith(HISTORY_PROJECTS_KEY_PREFIX) ? rawKey.slice(HISTORY_PROJECTS_KEY_PREFIX.length) : void 0;
|
|
@@ -14468,9 +14517,9 @@ function lookupKeychainService(run, farmRoot) {
|
|
|
14468
14517
|
}
|
|
14469
14518
|
return { checked: true, found: true, serviceName, note: `Keychain service name for this identity: "${serviceName}".` };
|
|
14470
14519
|
}
|
|
14471
|
-
var SettingsSecretsShapeSchema =
|
|
14472
|
-
env:
|
|
14473
|
-
hooks:
|
|
14520
|
+
var SettingsSecretsShapeSchema = z16.looseObject({
|
|
14521
|
+
env: z16.record(z16.string(), z16.unknown()).optional(),
|
|
14522
|
+
hooks: z16.record(z16.string(), z16.array(z16.unknown())).optional()
|
|
14474
14523
|
});
|
|
14475
14524
|
function hookCommandCountOf(group) {
|
|
14476
14525
|
if (typeof group !== "object" || group === null) {
|
|
@@ -14767,7 +14816,7 @@ init_schema();
|
|
|
14767
14816
|
init_claudeVersion();
|
|
14768
14817
|
init_identity();
|
|
14769
14818
|
init_projects();
|
|
14770
|
-
import { z as
|
|
14819
|
+
import { z as z18 } from "zod";
|
|
14771
14820
|
|
|
14772
14821
|
// src/resolve/types.ts
|
|
14773
14822
|
var LAYER_KINDS = [
|
|
@@ -14828,123 +14877,123 @@ var DIAGNOSTIC_SEVERITIES = ["error", "warning", "info"];
|
|
|
14828
14877
|
|
|
14829
14878
|
// src/usage/pickReportSchema.ts
|
|
14830
14879
|
init_plan2();
|
|
14831
|
-
import { z as
|
|
14832
|
-
var PoolPickCandidateViewSchema =
|
|
14833
|
-
identity:
|
|
14880
|
+
import { z as z17 } from "zod";
|
|
14881
|
+
var PoolPickCandidateViewSchema = z17.strictObject({
|
|
14882
|
+
identity: z17.string(),
|
|
14834
14883
|
/** In pick order: `scored` has usable quota data, `unknown` has none, `pay-per-use` bills by use, `ineligible` is refused right now. */
|
|
14835
|
-
class:
|
|
14884
|
+
class: z17.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
|
|
14836
14885
|
/** Plan-size-weighted remaining quota per hour until its reset; present for `scored` only. */
|
|
14837
|
-
score:
|
|
14886
|
+
score: z17.number().optional(),
|
|
14838
14887
|
/** 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`. */
|
|
14839
|
-
scoreWindow:
|
|
14888
|
+
scoreWindow: z17.enum(["sevenDay", "fiveHour"]).optional(),
|
|
14840
14889
|
/** False when the five-hour window would run dry, at the observed pace, before it resets. */
|
|
14841
|
-
feasible:
|
|
14890
|
+
feasible: z17.boolean(),
|
|
14842
14891
|
/** When an `ineligible` member can be used again, as an ISO instant. */
|
|
14843
|
-
blockedUntil:
|
|
14892
|
+
blockedUntil: z17.iso.datetime().optional(),
|
|
14844
14893
|
plan: PlanClassSchema,
|
|
14845
14894
|
/** The facts behind the class and score, in the order they matter. */
|
|
14846
|
-
reasons:
|
|
14895
|
+
reasons: z17.array(z17.string())
|
|
14847
14896
|
});
|
|
14848
|
-
var PoolPickReportSchema =
|
|
14849
|
-
pool:
|
|
14850
|
-
directory:
|
|
14897
|
+
var PoolPickReportSchema = z17.strictObject({
|
|
14898
|
+
pool: z17.string(),
|
|
14899
|
+
directory: z17.string(),
|
|
14851
14900
|
/** The member a launch would run as, absent when every member is refused. */
|
|
14852
|
-
pick:
|
|
14853
|
-
candidates:
|
|
14901
|
+
pick: z17.string().optional(),
|
|
14902
|
+
candidates: z17.array(PoolPickCandidateViewSchema),
|
|
14854
14903
|
/** Identity members anywhere in the pool's graph that do not exist; a launch skips them. */
|
|
14855
|
-
missing:
|
|
14904
|
+
missing: z17.array(z17.string()),
|
|
14856
14905
|
/** When nothing can be picked, the soonest any member returns. */
|
|
14857
|
-
earliestReturn:
|
|
14906
|
+
earliestReturn: z17.strictObject({ identity: z17.string(), at: z17.iso.datetime() }).optional(),
|
|
14858
14907
|
/** The member a resumed conversation started on but moved off, and why, when the ranking could not keep it. */
|
|
14859
|
-
movedOff:
|
|
14908
|
+
movedOff: z17.strictObject({ identity: z17.string(), reason: z17.string() }).optional(),
|
|
14860
14909
|
/** Why the last-pick record could not be read, when that is the case. */
|
|
14861
|
-
stickyProblem:
|
|
14910
|
+
stickyProblem: z17.string().optional()
|
|
14862
14911
|
});
|
|
14863
14912
|
|
|
14864
14913
|
// src/checkReportSchema.ts
|
|
14865
14914
|
var CHECK_CREDENTIAL_APPLIES = ["provider", "identity", "stored-login"];
|
|
14866
|
-
var CheckLayerViewSchema =
|
|
14867
|
-
id:
|
|
14868
|
-
kind:
|
|
14869
|
-
source:
|
|
14915
|
+
var CheckLayerViewSchema = z18.strictObject({
|
|
14916
|
+
id: z18.int(),
|
|
14917
|
+
kind: z18.enum(LAYER_KINDS),
|
|
14918
|
+
source: z18.string()
|
|
14870
14919
|
});
|
|
14871
|
-
var CheckEntryViewSchema =
|
|
14872
|
-
path:
|
|
14873
|
-
shared:
|
|
14874
|
-
via:
|
|
14920
|
+
var CheckEntryViewSchema = z18.strictObject({
|
|
14921
|
+
path: z18.string(),
|
|
14922
|
+
shared: z18.boolean(),
|
|
14923
|
+
via: z18.enum(DECISION_VIAS),
|
|
14875
14924
|
/** The entry's real category, or null when nothing classifies it. */
|
|
14876
|
-
category:
|
|
14877
|
-
rule:
|
|
14925
|
+
category: z18.enum(CATEGORY_NAMES).nullable(),
|
|
14926
|
+
rule: z18.strictObject({ key: z18.string(), layer: z18.int() }).optional(),
|
|
14878
14927
|
/** Rules that matched but whose `when` condition failed, each with the conditions that failed. */
|
|
14879
|
-
eliminated:
|
|
14928
|
+
eliminated: z18.readonly(z18.array(z18.strictObject({ key: z18.string(), failed: z18.readonly(z18.array(z18.string())) }))).optional()
|
|
14880
14929
|
});
|
|
14881
|
-
var CheckDiagnosticSchema =
|
|
14882
|
-
code:
|
|
14883
|
-
severity:
|
|
14884
|
-
message:
|
|
14885
|
-
subject:
|
|
14886
|
-
layer:
|
|
14930
|
+
var CheckDiagnosticSchema = z18.strictObject({
|
|
14931
|
+
code: z18.enum(DIAGNOSTIC_CODES),
|
|
14932
|
+
severity: z18.enum(DIAGNOSTIC_SEVERITIES),
|
|
14933
|
+
message: z18.string(),
|
|
14934
|
+
subject: z18.string().optional(),
|
|
14935
|
+
layer: z18.int().optional()
|
|
14887
14936
|
});
|
|
14888
|
-
var CheckAmbientCredentialSchema =
|
|
14889
|
-
var CheckKeychainSchema =
|
|
14890
|
-
checked:
|
|
14891
|
-
found:
|
|
14892
|
-
serviceName:
|
|
14893
|
-
note:
|
|
14937
|
+
var CheckAmbientCredentialSchema = z18.union([z18.strictObject({ ok: z18.literal(true) }), z18.strictObject({ ok: z18.literal(false), variable: z18.string(), message: z18.string() })]);
|
|
14938
|
+
var CheckKeychainSchema = z18.strictObject({
|
|
14939
|
+
checked: z18.literal(true),
|
|
14940
|
+
found: z18.boolean(),
|
|
14941
|
+
serviceName: z18.string().optional(),
|
|
14942
|
+
note: z18.string()
|
|
14894
14943
|
});
|
|
14895
|
-
var CheckSettingsExposureSchema =
|
|
14896
|
-
file:
|
|
14897
|
-
envKeyNames:
|
|
14898
|
-
hookEventNames:
|
|
14899
|
-
hookCommandCount:
|
|
14944
|
+
var CheckSettingsExposureSchema = z18.strictObject({
|
|
14945
|
+
file: z18.string(),
|
|
14946
|
+
envKeyNames: z18.readonly(z18.array(z18.string())),
|
|
14947
|
+
hookEventNames: z18.readonly(z18.array(z18.string())),
|
|
14948
|
+
hookCommandCount: z18.int().nonnegative()
|
|
14900
14949
|
});
|
|
14901
|
-
var CredentialSourceSummarySchema =
|
|
14902
|
-
|
|
14903
|
-
|
|
14904
|
-
|
|
14905
|
-
|
|
14906
|
-
|
|
14907
|
-
|
|
14950
|
+
var CredentialSourceSummarySchema = z18.union([
|
|
14951
|
+
z18.strictObject({ kind: z18.literal("env"), variable: z18.string() }),
|
|
14952
|
+
z18.strictObject({ kind: z18.literal("file"), path: z18.string() }),
|
|
14953
|
+
z18.strictObject({ kind: z18.literal("command"), program: z18.string() }),
|
|
14954
|
+
z18.strictObject({ kind: z18.literal("op"), reference: z18.string() }),
|
|
14955
|
+
z18.strictObject({ kind: z18.literal("keychain"), service: z18.string(), account: z18.string().optional() }),
|
|
14956
|
+
z18.strictObject({ kind: z18.literal("literal") })
|
|
14908
14957
|
]);
|
|
14909
|
-
var CredentialSummarySchema =
|
|
14910
|
-
target:
|
|
14911
|
-
sources:
|
|
14958
|
+
var CredentialSummarySchema = z18.strictObject({
|
|
14959
|
+
target: z18.enum(CREDENTIAL_TARGETS),
|
|
14960
|
+
sources: z18.readonly(z18.array(CredentialSourceSummarySchema)),
|
|
14912
14961
|
cache: CredentialCacheSchema.optional()
|
|
14913
14962
|
});
|
|
14914
|
-
var CachedCredentialStateSchema =
|
|
14915
|
-
|
|
14916
|
-
|
|
14917
|
-
|
|
14963
|
+
var CachedCredentialStateSchema = z18.union([
|
|
14964
|
+
z18.strictObject({ store: z18.enum(CREDENTIAL_CACHE_STORES), status: z18.literal("empty") }),
|
|
14965
|
+
z18.strictObject({ store: z18.enum(CREDENTIAL_CACHE_STORES), status: z18.literal("unreadable"), reason: z18.string() }),
|
|
14966
|
+
z18.strictObject({ store: z18.enum(CREDENTIAL_CACHE_STORES), status: z18.enum(["fresh", "expired"]), ageMs: z18.number(), expiresInMs: z18.number().optional() })
|
|
14918
14967
|
]);
|
|
14919
|
-
var CheckCredentialProviderSchema =
|
|
14920
|
-
|
|
14921
|
-
|
|
14968
|
+
var CheckCredentialProviderSchema = z18.union([
|
|
14969
|
+
z18.strictObject({ name: z18.string(), credential: CredentialSummarySchema.optional(), cached: CachedCredentialStateSchema.optional() }),
|
|
14970
|
+
z18.strictObject({ name: z18.string(), problem: z18.string() })
|
|
14922
14971
|
]);
|
|
14923
|
-
var CheckCredentialSchema =
|
|
14924
|
-
applies:
|
|
14972
|
+
var CheckCredentialSchema = z18.strictObject({
|
|
14973
|
+
applies: z18.enum(CHECK_CREDENTIAL_APPLIES),
|
|
14925
14974
|
provider: CheckCredentialProviderSchema.optional(),
|
|
14926
14975
|
identity: CredentialSummarySchema.optional(),
|
|
14927
14976
|
identityCached: CachedCredentialStateSchema.optional()
|
|
14928
14977
|
});
|
|
14929
|
-
var CheckClaudeVersionSchema =
|
|
14930
|
-
pinned:
|
|
14931
|
-
highestInstalled:
|
|
14932
|
-
installed:
|
|
14978
|
+
var CheckClaudeVersionSchema = z18.strictObject({
|
|
14979
|
+
pinned: z18.strictObject({ version: z18.string(), source: z18.enum(CLAUDE_VERSION_SOURCES), installed: z18.boolean() }).optional(),
|
|
14980
|
+
highestInstalled: z18.string().optional(),
|
|
14981
|
+
installed: z18.readonly(z18.array(z18.string()))
|
|
14933
14982
|
});
|
|
14934
|
-
var CheckReportJsonSchema =
|
|
14935
|
-
identity:
|
|
14983
|
+
var CheckReportJsonSchema = z18.strictObject({
|
|
14984
|
+
identity: z18.strictObject({ name: z18.string().nullable(), source: z18.enum(IDENTITY_DECISION_SOURCES) }),
|
|
14936
14985
|
/** The pool ranking, when the launch named a pool instead of an identity. */
|
|
14937
14986
|
pool: PoolPickReportSchema.optional(),
|
|
14938
|
-
configProfile:
|
|
14939
|
-
layers:
|
|
14940
|
-
entries:
|
|
14941
|
-
projectEncodingAmbiguities:
|
|
14942
|
-
|
|
14987
|
+
configProfile: z18.strictObject({ name: z18.string().nullable(), source: z18.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
|
|
14988
|
+
layers: z18.readonly(z18.array(CheckLayerViewSchema)),
|
|
14989
|
+
entries: z18.readonly(z18.array(CheckEntryViewSchema)),
|
|
14990
|
+
projectEncodingAmbiguities: z18.readonly(
|
|
14991
|
+
z18.array(z18.strictObject({ fragment: z18.string(), encoded: z18.string(), reason: z18.enum(ENCODING_AMBIGUITY_REASONS), detail: z18.string() }))
|
|
14943
14992
|
),
|
|
14944
|
-
diagnostics:
|
|
14993
|
+
diagnostics: z18.readonly(z18.array(CheckDiagnosticSchema)),
|
|
14945
14994
|
ambientCredential: CheckAmbientCredentialSchema,
|
|
14946
14995
|
keychain: CheckKeychainSchema.optional(),
|
|
14947
|
-
settingsExposure:
|
|
14996
|
+
settingsExposure: z18.readonly(z18.array(CheckSettingsExposureSchema)),
|
|
14948
14997
|
credential: CheckCredentialSchema,
|
|
14949
14998
|
claudeVersion: CheckClaudeVersionSchema.optional()
|
|
14950
14999
|
});
|
|
@@ -15004,28 +15053,28 @@ function collectResets(snapshots, nowMs) {
|
|
|
15004
15053
|
}
|
|
15005
15054
|
|
|
15006
15055
|
// src/usage/resetsSchema.ts
|
|
15007
|
-
import { z as
|
|
15008
|
-
var ResetRowSchema =
|
|
15009
|
-
identity:
|
|
15010
|
-
provider:
|
|
15056
|
+
import { z as z19 } from "zod";
|
|
15057
|
+
var ResetRowSchema = z19.strictObject({
|
|
15058
|
+
identity: z19.string(),
|
|
15059
|
+
provider: z19.string(),
|
|
15011
15060
|
/** What the window is: `5h`, `7d` or `extra usage` for an Anthropic account, or the provider's own measure and period (`tokens 5h`). */
|
|
15012
|
-
window:
|
|
15061
|
+
window: z19.string(),
|
|
15013
15062
|
/** When the state the window comes from was observed, as an ISO instant. */
|
|
15014
|
-
observedAt:
|
|
15063
|
+
observedAt: z19.iso.datetime(),
|
|
15015
15064
|
/** When the window resets, as an ISO instant; absent when the upstream reported none. */
|
|
15016
|
-
resetsAt:
|
|
15065
|
+
resetsAt: z19.iso.datetime().optional(),
|
|
15017
15066
|
/** True when the reset time has passed, so the recorded observation describes a window that no longer exists and its utilisation reads as 0. */
|
|
15018
|
-
reset:
|
|
15067
|
+
reset: z19.boolean(),
|
|
15019
15068
|
/** The fraction used, as `effectiveWindow` reads it at the report's own clock. */
|
|
15020
|
-
utilization:
|
|
15069
|
+
utilization: z19.number().optional(),
|
|
15021
15070
|
/** The window's own status, for a window that has not reset yet. */
|
|
15022
|
-
status:
|
|
15071
|
+
status: z19.string().optional()
|
|
15023
15072
|
});
|
|
15024
|
-
var ResetScheduleSchema =
|
|
15073
|
+
var ResetScheduleSchema = z19.strictObject({ resets: z19.readonly(z19.array(ResetRowSchema)) });
|
|
15025
15074
|
|
|
15026
15075
|
// src/frontdoor/controlSchemas.ts
|
|
15027
15076
|
import path32 from "node:path";
|
|
15028
|
-
import { z as
|
|
15077
|
+
import { z as z26 } from "zod";
|
|
15029
15078
|
|
|
15030
15079
|
// src/doctorReport.ts
|
|
15031
15080
|
init_claudeShim();
|
|
@@ -15205,24 +15254,24 @@ import path31 from "node:path";
|
|
|
15205
15254
|
init_signIn();
|
|
15206
15255
|
|
|
15207
15256
|
// src/codex/siwcStore.ts
|
|
15208
|
-
import { z as
|
|
15257
|
+
import { z as z23 } from "zod";
|
|
15209
15258
|
|
|
15210
15259
|
// src/codex/auth.ts
|
|
15211
|
-
import { z as
|
|
15212
|
-
var AuthFileSchema =
|
|
15213
|
-
tokens:
|
|
15214
|
-
access_token:
|
|
15215
|
-
refresh_token:
|
|
15216
|
-
id_token:
|
|
15217
|
-
account_id:
|
|
15260
|
+
import { z as z21 } from "zod";
|
|
15261
|
+
var AuthFileSchema = z21.looseObject({
|
|
15262
|
+
tokens: z21.looseObject({
|
|
15263
|
+
access_token: z21.string().optional(),
|
|
15264
|
+
refresh_token: z21.string().optional(),
|
|
15265
|
+
id_token: z21.string().optional(),
|
|
15266
|
+
account_id: z21.string().optional()
|
|
15218
15267
|
}).nullish(),
|
|
15219
|
-
last_refresh:
|
|
15268
|
+
last_refresh: z21.string().optional()
|
|
15220
15269
|
});
|
|
15221
|
-
var TokenGrantSchema =
|
|
15222
|
-
access_token:
|
|
15223
|
-
refresh_token:
|
|
15224
|
-
id_token:
|
|
15225
|
-
account_id:
|
|
15270
|
+
var TokenGrantSchema = z21.looseObject({
|
|
15271
|
+
access_token: z21.string().min(1).optional(),
|
|
15272
|
+
refresh_token: z21.string().min(1).optional(),
|
|
15273
|
+
id_token: z21.string().min(1).optional(),
|
|
15274
|
+
account_id: z21.string().min(1).optional()
|
|
15226
15275
|
});
|
|
15227
15276
|
var CodexAuthError = class extends Error {
|
|
15228
15277
|
constructor(message) {
|
|
@@ -15232,41 +15281,41 @@ var CodexAuthError = class extends Error {
|
|
|
15232
15281
|
};
|
|
15233
15282
|
|
|
15234
15283
|
// src/codex/siwc.ts
|
|
15235
|
-
import { z as
|
|
15284
|
+
import { z as z22 } from "zod";
|
|
15236
15285
|
var SIWC_RESOURCE = "https://api.openai.com/v1";
|
|
15237
15286
|
var SIWC_RESPONSES_URL = `${SIWC_RESOURCE}/responses`;
|
|
15238
15287
|
var SIWC_PLAN_SCOPE = "chatgpt.tokens.use.direct";
|
|
15239
|
-
var TokenResponseSchema =
|
|
15240
|
-
access_token:
|
|
15241
|
-
refresh_token:
|
|
15242
|
-
id_token:
|
|
15243
|
-
expires_in:
|
|
15244
|
-
scope:
|
|
15288
|
+
var TokenResponseSchema = z22.looseObject({
|
|
15289
|
+
access_token: z22.string().min(1),
|
|
15290
|
+
refresh_token: z22.string().min(1).optional(),
|
|
15291
|
+
id_token: z22.string().min(1).optional(),
|
|
15292
|
+
expires_in: z22.number().positive(),
|
|
15293
|
+
scope: z22.string().optional()
|
|
15245
15294
|
});
|
|
15246
|
-
var JwtHeaderSchema =
|
|
15247
|
-
var IdTokenClaimsSchema =
|
|
15248
|
-
iss:
|
|
15249
|
-
sub:
|
|
15250
|
-
aud:
|
|
15251
|
-
exp:
|
|
15252
|
-
nonce:
|
|
15253
|
-
email:
|
|
15295
|
+
var JwtHeaderSchema = z22.looseObject({ alg: z22.string(), kid: z22.string().optional() });
|
|
15296
|
+
var IdTokenClaimsSchema = z22.looseObject({
|
|
15297
|
+
iss: z22.string(),
|
|
15298
|
+
sub: z22.string().min(1),
|
|
15299
|
+
aud: z22.union([z22.string(), z22.array(z22.string())]),
|
|
15300
|
+
exp: z22.number(),
|
|
15301
|
+
nonce: z22.string().optional(),
|
|
15302
|
+
email: z22.string().optional()
|
|
15254
15303
|
});
|
|
15255
|
-
var JwksSchema =
|
|
15304
|
+
var JwksSchema = z22.object({ keys: z22.array(z22.looseObject({ kid: z22.string().optional(), kty: z22.string() })) });
|
|
15256
15305
|
|
|
15257
15306
|
// src/codex/siwcStore.ts
|
|
15258
|
-
var SiwcGrantSchema =
|
|
15259
|
-
clientId:
|
|
15260
|
-
sub:
|
|
15261
|
-
email:
|
|
15262
|
-
idToken:
|
|
15263
|
-
accessToken:
|
|
15264
|
-
refreshToken:
|
|
15265
|
-
scopes:
|
|
15307
|
+
var SiwcGrantSchema = z23.strictObject({
|
|
15308
|
+
clientId: z23.string().min(1),
|
|
15309
|
+
sub: z23.string().min(1),
|
|
15310
|
+
email: z23.string().optional(),
|
|
15311
|
+
idToken: z23.string().min(1),
|
|
15312
|
+
accessToken: z23.string().min(1),
|
|
15313
|
+
refreshToken: z23.string().min(1),
|
|
15314
|
+
scopes: z23.array(z23.string()).readonly(),
|
|
15266
15315
|
/** When the access token stops working, in milliseconds since the epoch. */
|
|
15267
|
-
expiresAt:
|
|
15316
|
+
expiresAt: z23.number()
|
|
15268
15317
|
});
|
|
15269
|
-
var SiwcFileSchema =
|
|
15318
|
+
var SiwcFileSchema = z23.strictObject({ registeredClientId: z23.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
|
|
15270
15319
|
function parseSiwcFile(raw, filePath) {
|
|
15271
15320
|
let json;
|
|
15272
15321
|
try {
|
|
@@ -15548,6 +15597,7 @@ function realFrontDoorListenerProbes(paths) {
|
|
|
15548
15597
|
// src/doctorReport.ts
|
|
15549
15598
|
init_supervisorProcesses();
|
|
15550
15599
|
init_legacy();
|
|
15600
|
+
init_providerAliases();
|
|
15551
15601
|
init_providersStore();
|
|
15552
15602
|
init_guard();
|
|
15553
15603
|
init_identity();
|
|
@@ -15876,6 +15926,10 @@ function runDoctor(params) {
|
|
|
15876
15926
|
for (const entry of params.providers) {
|
|
15877
15927
|
pushProvider(push, entry, params.credentialCache, params.chatgptSignIn);
|
|
15878
15928
|
}
|
|
15929
|
+
const providerNames = new Set(params.providers.map((entry) => entry.name));
|
|
15930
|
+
for (const finding of aliasFindings(params.providerAliases ?? {}, providerNames)) {
|
|
15931
|
+
push("provider", finding.level, finding.message, finding.alias);
|
|
15932
|
+
}
|
|
15879
15933
|
if (params.platform !== "darwin" || params.run === void 0) {
|
|
15880
15934
|
push("keychain", "pass", "Skipped (not macOS).");
|
|
15881
15935
|
} else {
|
|
@@ -16165,6 +16219,7 @@ function collectDoctorReport(params) {
|
|
|
16165
16219
|
identities,
|
|
16166
16220
|
configProfiles,
|
|
16167
16221
|
providers,
|
|
16222
|
+
providerAliases: readProviderAliases(paths),
|
|
16168
16223
|
directoryRules: { path: paths.directoryRulesFile, raw: realFsPort.readFileUtf8(paths.directoryRulesFile) },
|
|
16169
16224
|
globalConfig: { path: paths.globalConfigFile, raw: realFsPort.readFileUtf8(paths.globalConfigFile) },
|
|
16170
16225
|
models: parsedModelsOf(paths),
|
|
@@ -16220,90 +16275,90 @@ function collectDoctorReport(params) {
|
|
|
16220
16275
|
// src/frontdoor/controlSchemas.ts
|
|
16221
16276
|
init_schema2();
|
|
16222
16277
|
init_state();
|
|
16223
|
-
var UsageListOutputSchema =
|
|
16224
|
-
var UsageWindowsInputSchema =
|
|
16225
|
-
identity:
|
|
16226
|
-
provider:
|
|
16278
|
+
var UsageListOutputSchema = z26.strictObject({ snapshots: z26.readonly(z26.array(UsageSnapshotSchema)) });
|
|
16279
|
+
var UsageWindowsInputSchema = z26.strictObject({
|
|
16280
|
+
identity: z26.string().min(1),
|
|
16281
|
+
provider: z26.string().min(1).optional()
|
|
16227
16282
|
});
|
|
16228
|
-
var EffectiveWindowSchema =
|
|
16283
|
+
var EffectiveWindowSchema = z26.strictObject({
|
|
16229
16284
|
/** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
|
|
16230
|
-
reset:
|
|
16285
|
+
reset: z26.boolean(),
|
|
16231
16286
|
/** The fraction used: 0 for a reset window, otherwise what was last observed, absent when none was reported. */
|
|
16232
|
-
utilization:
|
|
16287
|
+
utilization: z26.number().optional(),
|
|
16233
16288
|
/** The reset instant, for a window that has not reset yet and reported one. */
|
|
16234
|
-
resetsAtMs:
|
|
16289
|
+
resetsAtMs: z26.number().optional(),
|
|
16235
16290
|
/** The window's own status, for a window that has not reset yet. */
|
|
16236
|
-
status:
|
|
16291
|
+
status: z26.string().optional()
|
|
16237
16292
|
});
|
|
16238
|
-
var UsageWindowsOutputSchema =
|
|
16239
|
-
identity:
|
|
16240
|
-
provider:
|
|
16293
|
+
var UsageWindowsOutputSchema = z26.strictObject({
|
|
16294
|
+
identity: z26.string(),
|
|
16295
|
+
provider: z26.string(),
|
|
16241
16296
|
/** When the rate-limit state the windows come from was observed. */
|
|
16242
|
-
observedAt:
|
|
16297
|
+
observedAt: z26.iso.datetime().optional(),
|
|
16243
16298
|
fiveHour: EffectiveWindowSchema.optional(),
|
|
16244
16299
|
sevenDay: EffectiveWindowSchema.optional()
|
|
16245
16300
|
});
|
|
16246
|
-
var UsageLiveOutputSchema =
|
|
16301
|
+
var UsageLiveOutputSchema = z26.strictObject({
|
|
16247
16302
|
/** 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. */
|
|
16248
16303
|
latest: RcLiveRateLimitSchema.optional(),
|
|
16249
16304
|
/** One observation per session whose stream has filed a rate_limit_event this door generation. */
|
|
16250
|
-
sessions:
|
|
16305
|
+
sessions: z26.readonly(z26.array(RcLiveRateLimitSchema))
|
|
16251
16306
|
});
|
|
16252
|
-
var FrontDoorSessionStatusSchema =
|
|
16253
|
-
pid:
|
|
16254
|
-
startedAt:
|
|
16255
|
-
alive:
|
|
16307
|
+
var FrontDoorSessionStatusSchema = z26.strictObject({
|
|
16308
|
+
pid: z26.int().positive(),
|
|
16309
|
+
startedAt: z26.number(),
|
|
16310
|
+
alive: z26.boolean()
|
|
16256
16311
|
});
|
|
16257
|
-
var HeadroomSocketTargetSchema =
|
|
16258
|
-
var FrontDoorStatusOutputSchema =
|
|
16312
|
+
var HeadroomSocketTargetSchema = z26.union([z26.strictObject({ socketPath: z26.string() }), z26.strictObject({ refused: z26.string() })]);
|
|
16313
|
+
var FrontDoorStatusOutputSchema = z26.strictObject({
|
|
16259
16314
|
state: FrontDoorStateSchema,
|
|
16260
|
-
supervisorAlive:
|
|
16261
|
-
sessions:
|
|
16315
|
+
supervisorAlive: z26.boolean(),
|
|
16316
|
+
sessions: z26.readonly(z26.array(FrontDoorSessionStatusSchema)),
|
|
16262
16317
|
headroomSocket: HeadroomSocketTargetSchema.optional(),
|
|
16263
|
-
logPath:
|
|
16264
|
-
logExists:
|
|
16318
|
+
logPath: z26.string(),
|
|
16319
|
+
logExists: z26.boolean()
|
|
16265
16320
|
});
|
|
16266
|
-
var FrontDoorSessionsOutputSchema =
|
|
16267
|
-
var CheckRunInputSchema =
|
|
16268
|
-
path:
|
|
16269
|
-
identity:
|
|
16321
|
+
var FrontDoorSessionsOutputSchema = z26.strictObject({ sessions: z26.readonly(z26.array(FrontDoorSessionStatusSchema)) });
|
|
16322
|
+
var CheckRunInputSchema = z26.strictObject({
|
|
16323
|
+
path: z26.string().min(1),
|
|
16324
|
+
identity: z26.string().min(1).optional()
|
|
16270
16325
|
}).refine((input) => path32.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
16271
|
-
var PoolPickInputSchema =
|
|
16272
|
-
pool:
|
|
16273
|
-
path:
|
|
16326
|
+
var PoolPickInputSchema = z26.strictObject({
|
|
16327
|
+
pool: z26.string().min(1),
|
|
16328
|
+
path: z26.string().min(1)
|
|
16274
16329
|
}).refine((input) => path32.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
16275
|
-
var DoctorFindingSchema =
|
|
16276
|
-
section:
|
|
16277
|
-
subject:
|
|
16278
|
-
severity:
|
|
16279
|
-
message:
|
|
16330
|
+
var DoctorFindingSchema = z26.strictObject({
|
|
16331
|
+
section: z26.enum(DOCTOR_SECTIONS),
|
|
16332
|
+
subject: z26.string().optional(),
|
|
16333
|
+
severity: z26.enum(DOCTOR_SEVERITIES),
|
|
16334
|
+
message: z26.string()
|
|
16280
16335
|
});
|
|
16281
|
-
var DoctorRunOutputSchema =
|
|
16336
|
+
var DoctorRunOutputSchema = z26.strictObject({
|
|
16282
16337
|
/** False exactly when any finding is a `fail`; a `warn` never fails the report on its own. */
|
|
16283
|
-
ok:
|
|
16284
|
-
findings:
|
|
16338
|
+
ok: z26.boolean(),
|
|
16339
|
+
findings: z26.readonly(z26.array(DoctorFindingSchema))
|
|
16285
16340
|
});
|
|
16286
|
-
var FrontDoorRestartOutputSchema =
|
|
16287
|
-
action:
|
|
16288
|
-
previousPid:
|
|
16341
|
+
var FrontDoorRestartOutputSchema = z26.strictObject({
|
|
16342
|
+
action: z26.literal("restarting"),
|
|
16343
|
+
previousPid: z26.int().positive()
|
|
16289
16344
|
});
|
|
16290
|
-
var UpdateCheckOutputSchema =
|
|
16291
|
-
current:
|
|
16292
|
-
latest:
|
|
16293
|
-
action:
|
|
16345
|
+
var UpdateCheckOutputSchema = z26.strictObject({
|
|
16346
|
+
current: z26.string(),
|
|
16347
|
+
latest: z26.string(),
|
|
16348
|
+
action: z26.enum(["current", "available", "updated"])
|
|
16294
16349
|
});
|
|
16295
|
-
var CodexSignInSchema =
|
|
16296
|
-
|
|
16297
|
-
|
|
16298
|
-
|
|
16350
|
+
var CodexSignInSchema = z26.discriminatedUnion("state", [
|
|
16351
|
+
z26.strictObject({ state: z26.literal("none") }),
|
|
16352
|
+
z26.strictObject({ state: z26.literal("signed-in"), email: z26.string().optional(), planScope: z26.boolean(), accessTokenExpiresAt: z26.number() }),
|
|
16353
|
+
z26.strictObject({ state: z26.literal("unreadable"), message: z26.string() })
|
|
16299
16354
|
]);
|
|
16300
|
-
var CodexStatusOutputSchema =
|
|
16355
|
+
var CodexStatusOutputSchema = z26.strictObject({
|
|
16301
16356
|
signIn: CodexSignInSchema,
|
|
16302
|
-
codexProviders:
|
|
16357
|
+
codexProviders: z26.readonly(z26.array(z26.string()))
|
|
16303
16358
|
});
|
|
16304
|
-
var CodexLogoutOutputSchema =
|
|
16305
|
-
hadGrant:
|
|
16306
|
-
revoked:
|
|
16359
|
+
var CodexLogoutOutputSchema = z26.strictObject({
|
|
16360
|
+
hadGrant: z26.boolean(),
|
|
16361
|
+
revoked: z26.boolean()
|
|
16307
16362
|
});
|
|
16308
16363
|
|
|
16309
16364
|
// src/frontdoor/codexApi.ts
|
|
@@ -16461,142 +16516,142 @@ init_providersStore();
|
|
|
16461
16516
|
|
|
16462
16517
|
// src/frontdoor/configSchemas.ts
|
|
16463
16518
|
init_schema();
|
|
16464
|
-
import { z as
|
|
16465
|
-
var RemovalConfirmationSchema =
|
|
16466
|
-
var CredentialWriteSchema = (targets) =>
|
|
16467
|
-
sources:
|
|
16468
|
-
target:
|
|
16469
|
-
cache:
|
|
16519
|
+
import { z as z27 } from "zod";
|
|
16520
|
+
var RemovalConfirmationSchema = z27.boolean();
|
|
16521
|
+
var CredentialWriteSchema = (targets) => z27.strictObject({
|
|
16522
|
+
sources: z27.array(RemoteCredentialSourceSchema).min(1).optional(),
|
|
16523
|
+
target: z27.enum(targets).optional(),
|
|
16524
|
+
cache: z27.union([z27.literal(false), CredentialCacheSchema]).optional()
|
|
16470
16525
|
});
|
|
16471
|
-
var CredentialSummarySchema2 =
|
|
16472
|
-
target:
|
|
16473
|
-
sources:
|
|
16474
|
-
|
|
16475
|
-
|
|
16476
|
-
|
|
16477
|
-
|
|
16478
|
-
|
|
16479
|
-
|
|
16480
|
-
|
|
16526
|
+
var CredentialSummarySchema2 = z27.strictObject({
|
|
16527
|
+
target: z27.enum(CREDENTIAL_TARGETS),
|
|
16528
|
+
sources: z27.readonly(z27.array(
|
|
16529
|
+
z27.discriminatedUnion("kind", [
|
|
16530
|
+
z27.strictObject({ kind: z27.literal("env"), variable: z27.string() }),
|
|
16531
|
+
z27.strictObject({ kind: z27.literal("file"), path: z27.string() }),
|
|
16532
|
+
z27.strictObject({ kind: z27.literal("command"), program: z27.string() }),
|
|
16533
|
+
z27.strictObject({ kind: z27.literal("op"), reference: z27.string() }),
|
|
16534
|
+
z27.strictObject({ kind: z27.literal("keychain"), service: z27.string(), account: z27.string().optional() }),
|
|
16535
|
+
z27.strictObject({ kind: z27.literal("literal") })
|
|
16481
16536
|
])
|
|
16482
16537
|
)),
|
|
16483
16538
|
cache: CredentialCacheSchema.optional()
|
|
16484
16539
|
});
|
|
16485
|
-
var mutationOutput = (kind, action) =>
|
|
16486
|
-
var storedMutationOutput = (kind, action, value) =>
|
|
16487
|
-
var IdentityValueSchema =
|
|
16488
|
-
name:
|
|
16489
|
-
defaultConfigProfile:
|
|
16490
|
-
allowAmbientCredential:
|
|
16540
|
+
var mutationOutput = (kind, action) => z27.strictObject({ action: z27.literal(action), kind: z27.literal(kind), name: z27.string() });
|
|
16541
|
+
var storedMutationOutput = (kind, action, value) => z27.strictObject({ action: z27.literal(action), kind: z27.literal(kind), name: z27.string(), value });
|
|
16542
|
+
var IdentityValueSchema = z27.strictObject({
|
|
16543
|
+
name: z27.string(),
|
|
16544
|
+
defaultConfigProfile: z27.string().optional(),
|
|
16545
|
+
allowAmbientCredential: z27.boolean(),
|
|
16491
16546
|
credential: CredentialSummarySchema2.optional(),
|
|
16492
|
-
anchors:
|
|
16547
|
+
anchors: z27.array(AnchorSchema).optional()
|
|
16493
16548
|
});
|
|
16494
16549
|
var ProfileValueSchema = ConfigProfileSchema.omit({ $schema: true });
|
|
16495
|
-
var ProviderValueSchema =
|
|
16496
|
-
name:
|
|
16497
|
-
kind:
|
|
16498
|
-
displayName:
|
|
16499
|
-
baseUrl:
|
|
16550
|
+
var ProviderValueSchema = z27.strictObject({
|
|
16551
|
+
name: z27.string(),
|
|
16552
|
+
kind: z27.enum(PROVIDER_KINDS),
|
|
16553
|
+
displayName: z27.string(),
|
|
16554
|
+
baseUrl: z27.string().optional(),
|
|
16500
16555
|
codex: CodexProviderConfigSchema.optional(),
|
|
16501
16556
|
credential: CredentialSummarySchema2.optional(),
|
|
16502
|
-
env:
|
|
16557
|
+
env: z27.record(z27.string(), z27.string()).optional()
|
|
16503
16558
|
});
|
|
16504
|
-
var ConfigNameInputSchema =
|
|
16559
|
+
var ConfigNameInputSchema = z27.strictObject({ name: z27.string().min(1) });
|
|
16505
16560
|
var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
|
|
16506
|
-
var ConfigIdentitySetInputSchema =
|
|
16507
|
-
name:
|
|
16508
|
-
defaultConfigProfile:
|
|
16509
|
-
allowAmbientCredential:
|
|
16510
|
-
credential:
|
|
16561
|
+
var ConfigIdentitySetInputSchema = z27.strictObject({
|
|
16562
|
+
name: z27.string().min(1),
|
|
16563
|
+
defaultConfigProfile: z27.union([z27.string().min(1), z27.literal(false)]).optional(),
|
|
16564
|
+
allowAmbientCredential: z27.boolean().optional(),
|
|
16565
|
+
credential: z27.union([z27.literal(false), CredentialWriteSchema(CREDENTIAL_TARGETS)]).optional(),
|
|
16511
16566
|
/** `false` removes the anchors; a list replaces them. */
|
|
16512
|
-
anchors:
|
|
16567
|
+
anchors: z27.union([z27.literal(false), z27.array(AnchorSchema).min(1)]).optional()
|
|
16513
16568
|
});
|
|
16514
16569
|
var ConfigIdentitySetOutputSchema = storedMutationOutput("identity", "updated", IdentityValueSchema);
|
|
16515
|
-
var ConfigIdentityRemoveInputSchema =
|
|
16570
|
+
var ConfigIdentityRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16516
16571
|
var ConfigIdentityRemoveOutputSchema = mutationOutput("identity", "removed");
|
|
16517
16572
|
var ConfigIdentityUseOutputSchema = mutationOutput("identity", "selected");
|
|
16518
|
-
var ConfigProfileAddInputSchema =
|
|
16519
|
-
name:
|
|
16520
|
-
extends:
|
|
16521
|
-
description:
|
|
16573
|
+
var ConfigProfileAddInputSchema = z27.strictObject({
|
|
16574
|
+
name: z27.string().min(1),
|
|
16575
|
+
extends: z27.array(z27.string().min(1)).optional(),
|
|
16576
|
+
description: z27.string().optional()
|
|
16522
16577
|
});
|
|
16523
16578
|
var ConfigProfileAddOutputSchema = storedMutationOutput("profile", "created", ProfileValueSchema);
|
|
16524
|
-
var ConfigProfileSetInputSchema =
|
|
16525
|
-
name:
|
|
16526
|
-
category:
|
|
16527
|
-
entry:
|
|
16528
|
-
extends:
|
|
16529
|
-
description:
|
|
16530
|
-
launch:
|
|
16531
|
-
skipPermissions:
|
|
16532
|
-
remoteControl:
|
|
16533
|
-
headroom:
|
|
16534
|
-
trackUsage:
|
|
16535
|
-
provider:
|
|
16536
|
-
claudeVersion:
|
|
16537
|
-
delay:
|
|
16538
|
-
pause:
|
|
16539
|
-
explain:
|
|
16579
|
+
var ConfigProfileSetInputSchema = z27.strictObject({
|
|
16580
|
+
name: z27.string().min(1),
|
|
16581
|
+
category: z27.record(z27.string(), z27.boolean()).optional(),
|
|
16582
|
+
entry: z27.record(z27.string(), z27.boolean()).optional(),
|
|
16583
|
+
extends: z27.union([z27.array(z27.string().min(1)), z27.literal(false)]).optional(),
|
|
16584
|
+
description: z27.union([z27.string(), z27.literal(false)]).optional(),
|
|
16585
|
+
launch: z27.strictObject({
|
|
16586
|
+
skipPermissions: z27.boolean().optional(),
|
|
16587
|
+
remoteControl: z27.boolean().optional(),
|
|
16588
|
+
headroom: z27.boolean().optional(),
|
|
16589
|
+
trackUsage: z27.boolean().optional(),
|
|
16590
|
+
provider: z27.union([z27.string().min(1), z27.literal(false)]).optional(),
|
|
16591
|
+
claudeVersion: z27.union([z27.string().min(1), z27.literal(false)]).optional(),
|
|
16592
|
+
delay: z27.union([z27.string().regex(DURATION_RE), z27.literal(false)]).optional(),
|
|
16593
|
+
pause: z27.boolean().optional(),
|
|
16594
|
+
explain: z27.boolean().optional()
|
|
16540
16595
|
}).optional()
|
|
16541
16596
|
});
|
|
16542
16597
|
var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
|
|
16543
|
-
var ConfigProfileRemoveInputSchema =
|
|
16598
|
+
var ConfigProfileRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16544
16599
|
var ConfigProfileRemoveOutputSchema = mutationOutput("profile", "removed");
|
|
16545
16600
|
var ConfigProfileUseOutputSchema = mutationOutput("profile", "selected");
|
|
16546
|
-
var PoolMembersInputSchema =
|
|
16547
|
-
var ConfigPoolAddInputSchema =
|
|
16548
|
-
name:
|
|
16601
|
+
var PoolMembersInputSchema = z27.array(z27.string().min(1)).min(1);
|
|
16602
|
+
var ConfigPoolAddInputSchema = z27.strictObject({
|
|
16603
|
+
name: z27.string().min(1),
|
|
16549
16604
|
identities: PoolMembersInputSchema,
|
|
16550
|
-
preference:
|
|
16551
|
-
resumeOnLimit:
|
|
16552
|
-
compactBeforeLimit:
|
|
16605
|
+
preference: z27.enum(POOL_PREFERENCES).optional(),
|
|
16606
|
+
resumeOnLimit: z27.boolean().optional(),
|
|
16607
|
+
compactBeforeLimit: z27.boolean().optional(),
|
|
16553
16608
|
compactAtUtilisation: CompactAtUtilisationSchema.optional()
|
|
16554
16609
|
});
|
|
16555
16610
|
var ConfigPoolAddOutputSchema = storedMutationOutput("pool", "created", PoolSchema);
|
|
16556
|
-
var ConfigPoolSetInputSchema =
|
|
16557
|
-
name:
|
|
16611
|
+
var ConfigPoolSetInputSchema = z27.strictObject({
|
|
16612
|
+
name: z27.string().min(1),
|
|
16558
16613
|
identities: PoolMembersInputSchema.optional(),
|
|
16559
|
-
preference:
|
|
16560
|
-
resumeOnLimit:
|
|
16561
|
-
compactBeforeLimit:
|
|
16562
|
-
compactAtUtilisation:
|
|
16614
|
+
preference: z27.union([z27.enum(POOL_PREFERENCES), z27.literal(false)]).optional(),
|
|
16615
|
+
resumeOnLimit: z27.boolean().optional(),
|
|
16616
|
+
compactBeforeLimit: z27.boolean().optional(),
|
|
16617
|
+
compactAtUtilisation: z27.union([CompactAtUtilisationSchema, z27.literal(false)]).optional()
|
|
16563
16618
|
});
|
|
16564
16619
|
var ConfigPoolSetOutputSchema = storedMutationOutput("pool", "updated", PoolSchema);
|
|
16565
|
-
var ConfigPoolRemoveInputSchema =
|
|
16620
|
+
var ConfigPoolRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16566
16621
|
var ConfigPoolRemoveOutputSchema = mutationOutput("pool", "removed");
|
|
16567
16622
|
var ConfigPoolUseOutputSchema = mutationOutput("pool", "selected");
|
|
16568
|
-
var ConfigProviderAddInputSchema =
|
|
16569
|
-
name:
|
|
16570
|
-
kind:
|
|
16571
|
-
displayName:
|
|
16572
|
-
baseUrl:
|
|
16623
|
+
var ConfigProviderAddInputSchema = z27.strictObject({
|
|
16624
|
+
name: z27.string().min(1),
|
|
16625
|
+
kind: z27.enum(PROVIDER_KINDS).optional(),
|
|
16626
|
+
displayName: z27.string().min(1),
|
|
16627
|
+
baseUrl: z27.string().min(1).optional(),
|
|
16573
16628
|
credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).required({ sources: true }),
|
|
16574
16629
|
codex: CodexProviderConfigSchema.optional()
|
|
16575
16630
|
});
|
|
16576
16631
|
var ConfigProviderAddOutputSchema = storedMutationOutput("provider", "created", ProviderValueSchema);
|
|
16577
|
-
var ConfigProviderSetInputSchema =
|
|
16578
|
-
name:
|
|
16579
|
-
displayName:
|
|
16580
|
-
baseUrl:
|
|
16632
|
+
var ConfigProviderSetInputSchema = z27.strictObject({
|
|
16633
|
+
name: z27.string().min(1),
|
|
16634
|
+
displayName: z27.string().min(1).optional(),
|
|
16635
|
+
baseUrl: z27.string().min(1).optional(),
|
|
16581
16636
|
credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).optional(),
|
|
16582
16637
|
codex: CodexProviderConfigSchema.optional()
|
|
16583
16638
|
});
|
|
16584
16639
|
var ConfigProviderSetOutputSchema = storedMutationOutput("provider", "updated", ProviderValueSchema);
|
|
16585
|
-
var ConfigProviderRemoveInputSchema =
|
|
16640
|
+
var ConfigProviderRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16586
16641
|
var ConfigProviderRemoveOutputSchema = mutationOutput("provider", "removed");
|
|
16587
|
-
var ConfigRuleAddInputSchema =
|
|
16588
|
-
path:
|
|
16589
|
-
configProfile:
|
|
16590
|
-
identity:
|
|
16642
|
+
var ConfigRuleAddInputSchema = z27.strictObject({
|
|
16643
|
+
path: z27.string().min(1),
|
|
16644
|
+
configProfile: z27.string().min(1).optional(),
|
|
16645
|
+
identity: z27.string().min(1).optional()
|
|
16591
16646
|
});
|
|
16592
16647
|
var ConfigRuleAddOutputSchema = storedMutationOutput("rule", "created", DirectoryRuleSchema);
|
|
16593
|
-
var ConfigRuleSetInputSchema =
|
|
16594
|
-
path:
|
|
16595
|
-
configProfile:
|
|
16596
|
-
identity:
|
|
16648
|
+
var ConfigRuleSetInputSchema = z27.strictObject({
|
|
16649
|
+
path: z27.string().min(1),
|
|
16650
|
+
configProfile: z27.union([z27.string().min(1), z27.literal(false)]).optional(),
|
|
16651
|
+
identity: z27.union([z27.string().min(1), z27.literal(false)]).optional()
|
|
16597
16652
|
});
|
|
16598
16653
|
var ConfigRuleSetOutputSchema = storedMutationOutput("rule", "updated", DirectoryRuleSchema);
|
|
16599
|
-
var ConfigRuleRemoveInputSchema =
|
|
16654
|
+
var ConfigRuleRemoveInputSchema = z27.strictObject({ path: z27.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16600
16655
|
var ConfigRuleRemoveOutputSchema = mutationOutput("rule", "removed");
|
|
16601
16656
|
|
|
16602
16657
|
// src/frontdoor/configApi.ts
|
|
@@ -16907,43 +16962,43 @@ import { openapi as openapi4 } from "@orpc/openapi";
|
|
|
16907
16962
|
import { eventIterator as eventIterator2, withEventMeta as withEventMeta2 } from "@orpc/server";
|
|
16908
16963
|
|
|
16909
16964
|
// src/frontdoor/eventSchemas.ts
|
|
16910
|
-
import { z as
|
|
16965
|
+
import { z as z28 } from "zod";
|
|
16911
16966
|
var DOOR_EVENT_SOURCE_RC = "rc";
|
|
16912
16967
|
var LAUNCH_EVENT_SOURCE = "launch";
|
|
16913
16968
|
var USAGE_EVENT_SOURCE = "usage";
|
|
16914
16969
|
var DOOR_HEALTH_EVENT_SOURCE = "door";
|
|
16915
16970
|
var QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
|
|
16916
|
-
var DoorEventSchema =
|
|
16917
|
-
source:
|
|
16971
|
+
var DoorEventSchema = z28.strictObject({
|
|
16972
|
+
source: z28.string().min(1),
|
|
16918
16973
|
/** A positive integer because the backbone's counters start at one and only ever increase. */
|
|
16919
|
-
sequence:
|
|
16920
|
-
payload:
|
|
16974
|
+
sequence: z28.number().int().positive(),
|
|
16975
|
+
payload: z28.unknown()
|
|
16921
16976
|
});
|
|
16922
|
-
var DoorEventSourceQuerySchema =
|
|
16923
|
-
sources:
|
|
16977
|
+
var DoorEventSourceQuerySchema = z28.strictObject({
|
|
16978
|
+
sources: z28.array(z28.string().min(1)).min(1).optional()
|
|
16924
16979
|
});
|
|
16925
|
-
var LaunchLifecycleEventSchema =
|
|
16926
|
-
kind:
|
|
16927
|
-
pid:
|
|
16928
|
-
startedAt:
|
|
16929
|
-
observedAt:
|
|
16980
|
+
var LaunchLifecycleEventSchema = z28.strictObject({
|
|
16981
|
+
kind: z28.enum(["registered", "pruned", "ended"]),
|
|
16982
|
+
pid: z28.number().int().positive(),
|
|
16983
|
+
startedAt: z28.number(),
|
|
16984
|
+
observedAt: z28.number()
|
|
16930
16985
|
});
|
|
16931
|
-
var DoorHealthEventSchema =
|
|
16932
|
-
|
|
16933
|
-
|
|
16934
|
-
|
|
16935
|
-
|
|
16936
|
-
|
|
16937
|
-
|
|
16986
|
+
var DoorHealthEventSchema = z28.discriminatedUnion("kind", [
|
|
16987
|
+
z28.strictObject({ kind: z28.literal("generation"), pid: z28.number().int().positive(), providerPort: z28.number().int().positive(), connectPort: z28.number().int().positive(), directPort: z28.number().int().positive(), observedAt: z28.number() }),
|
|
16988
|
+
z28.strictObject({ kind: z28.literal("listenerFailed"), pid: z28.number().int().positive(), listener: z28.enum(["provider", "connect", "direct"]), message: z28.string(), observedAt: z28.number() }),
|
|
16989
|
+
z28.strictObject({ kind: z28.literal("binaryTurnover"), pid: z28.number().int().positive(), observedAt: z28.number() }),
|
|
16990
|
+
z28.strictObject({ kind: z28.literal("idleShutdown"), pid: z28.number().int().positive(), observedAt: z28.number() }),
|
|
16991
|
+
z28.strictObject({ kind: z28.literal("superseded"), pid: z28.number().int().positive(), ownerPid: z28.number().int().positive(), observedAt: z28.number() }),
|
|
16992
|
+
z28.strictObject({ kind: z28.literal("drained"), pid: z28.number().int().positive(), observedAt: z28.number() })
|
|
16938
16993
|
]);
|
|
16939
|
-
var QuotaExpiringEventSchema =
|
|
16940
|
-
identity:
|
|
16941
|
-
provider:
|
|
16942
|
-
window:
|
|
16994
|
+
var QuotaExpiringEventSchema = z28.strictObject({
|
|
16995
|
+
identity: z28.string().min(1),
|
|
16996
|
+
provider: z28.string().min(1),
|
|
16997
|
+
window: z28.enum(["fiveHour", "sevenDay"]),
|
|
16943
16998
|
/** 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. */
|
|
16944
|
-
utilization:
|
|
16945
|
-
resetsAt:
|
|
16946
|
-
observedAt:
|
|
16999
|
+
utilization: z28.number().min(0).max(1),
|
|
17000
|
+
resetsAt: z28.iso.datetime(),
|
|
17001
|
+
observedAt: z28.number()
|
|
16947
17002
|
});
|
|
16948
17003
|
|
|
16949
17004
|
// src/frontdoor/eventsApi.ts
|
|
@@ -17027,55 +17082,55 @@ import { openapi as openapi6 } from "@orpc/openapi";
|
|
|
17027
17082
|
|
|
17028
17083
|
// src/frontdoor/launchSchemas.ts
|
|
17029
17084
|
import path33 from "node:path";
|
|
17030
|
-
import { z as
|
|
17085
|
+
import { z as z29 } from "zod";
|
|
17031
17086
|
init_claudeVersion();
|
|
17032
17087
|
init_identity();
|
|
17033
|
-
var LaunchResolveInputSchema =
|
|
17034
|
-
path:
|
|
17088
|
+
var LaunchResolveInputSchema = z29.strictObject({
|
|
17089
|
+
path: z29.string().min(1),
|
|
17035
17090
|
/** `@name`, launch flags, then the arguments for `claude`; empty for a bare launch. */
|
|
17036
|
-
argv:
|
|
17091
|
+
argv: z29.readonly(z29.array(z29.string())).optional(),
|
|
17037
17092
|
/** 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. */
|
|
17038
|
-
env:
|
|
17093
|
+
env: z29.record(z29.string(), z29.string()).optional()
|
|
17039
17094
|
}).refine((input) => path33.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
17040
|
-
var LaunchPoolDecisionSchema =
|
|
17041
|
-
name:
|
|
17042
|
-
reasons:
|
|
17043
|
-
movedOff:
|
|
17095
|
+
var LaunchPoolDecisionSchema = z29.strictObject({
|
|
17096
|
+
name: z29.string(),
|
|
17097
|
+
reasons: z29.readonly(z29.array(z29.string())),
|
|
17098
|
+
movedOff: z29.strictObject({ identity: z29.string(), reason: z29.string() }).optional()
|
|
17044
17099
|
});
|
|
17045
|
-
var LaunchDecisionSchema =
|
|
17046
|
-
identity:
|
|
17047
|
-
identitySource:
|
|
17100
|
+
var LaunchDecisionSchema = z29.strictObject({
|
|
17101
|
+
identity: z29.string().optional(),
|
|
17102
|
+
identitySource: z29.enum(IDENTITY_DECISION_SOURCES),
|
|
17048
17103
|
pool: LaunchPoolDecisionSchema.optional(),
|
|
17049
|
-
configDirEscapeHatch:
|
|
17050
|
-
configDir:
|
|
17051
|
-
configProfile:
|
|
17052
|
-
configProfileSource:
|
|
17053
|
-
provider:
|
|
17104
|
+
configDirEscapeHatch: z29.boolean(),
|
|
17105
|
+
configDir: z29.string().optional(),
|
|
17106
|
+
configProfile: z29.string().optional(),
|
|
17107
|
+
configProfileSource: z29.enum(CONFIG_PROFILE_DECISION_SOURCES),
|
|
17108
|
+
provider: z29.string().optional()
|
|
17054
17109
|
});
|
|
17055
|
-
var LaunchFlagsSchema =
|
|
17056
|
-
skipPermissions:
|
|
17057
|
-
remoteControl:
|
|
17058
|
-
headroom:
|
|
17059
|
-
trackUsage:
|
|
17060
|
-
pause:
|
|
17061
|
-
explain:
|
|
17110
|
+
var LaunchFlagsSchema = z29.strictObject({
|
|
17111
|
+
skipPermissions: z29.boolean(),
|
|
17112
|
+
remoteControl: z29.boolean(),
|
|
17113
|
+
headroom: z29.boolean(),
|
|
17114
|
+
trackUsage: z29.boolean(),
|
|
17115
|
+
pause: z29.boolean(),
|
|
17116
|
+
explain: z29.boolean(),
|
|
17062
17117
|
/** How long the launch waits after its own output before it starts claude, in milliseconds. */
|
|
17063
|
-
delayMs:
|
|
17118
|
+
delayMs: z29.number()
|
|
17064
17119
|
});
|
|
17065
|
-
var LaunchResolveOutputSchema =
|
|
17120
|
+
var LaunchResolveOutputSchema = z29.strictObject({
|
|
17066
17121
|
decision: LaunchDecisionSchema,
|
|
17067
17122
|
flags: LaunchFlagsSchema,
|
|
17068
|
-
claudeVersion:
|
|
17123
|
+
claudeVersion: z29.strictObject({ version: z29.string(), source: z29.enum(CLAUDE_VERSION_SOURCES) }).optional(),
|
|
17069
17124
|
/** The real `claude` binary the launch would spawn, on the door's host. */
|
|
17070
|
-
bin:
|
|
17125
|
+
bin: z29.string(),
|
|
17071
17126
|
/** The arguments the launch would pass it: the tool's own flags, then `CLAUDE_EXTRA_FLAGS`, then the caller's own. */
|
|
17072
|
-
args:
|
|
17127
|
+
args: z29.readonly(z29.array(z29.string())),
|
|
17073
17128
|
/** The credential the launch would authenticate with, by target and source kinds. Absent when none applies. */
|
|
17074
|
-
credential:
|
|
17075
|
-
routing:
|
|
17129
|
+
credential: z29.strictObject({ subject: z29.enum(["provider", "identity"]), name: z29.string(), summary: CredentialSummarySchema }).optional(),
|
|
17130
|
+
routing: z29.strictObject({ frontDoor: z29.boolean(), headroom: z29.boolean() }),
|
|
17076
17131
|
/** The names of the environment variables the launch would set or unset, sorted. Values are not reported. */
|
|
17077
|
-
environment:
|
|
17078
|
-
warnings:
|
|
17132
|
+
environment: z29.readonly(z29.array(z29.string())),
|
|
17133
|
+
warnings: z29.readonly(z29.array(z29.string()))
|
|
17079
17134
|
});
|
|
17080
17135
|
|
|
17081
17136
|
// src/frontdoor/launchApi.ts
|
|
@@ -17111,22 +17166,22 @@ function createLaunchApiRouter(deps) {
|
|
|
17111
17166
|
// src/frontdoor/agentTreesApi.ts
|
|
17112
17167
|
import { ORPCError as ORPCError6 } from "@orpc/client";
|
|
17113
17168
|
import { openapi as openapi7 } from "@orpc/openapi";
|
|
17114
|
-
import { z as
|
|
17169
|
+
import { z as z30 } from "zod";
|
|
17115
17170
|
init_cliError();
|
|
17116
|
-
var AgentTreesListInputSchema =
|
|
17171
|
+
var AgentTreesListInputSchema = z30.strictObject({
|
|
17117
17172
|
/** Only this identity's sessions. */
|
|
17118
|
-
identity:
|
|
17173
|
+
identity: z30.string().optional(),
|
|
17119
17174
|
/** Include sessions that spawned no agent and ran no workflow. */
|
|
17120
|
-
all:
|
|
17175
|
+
all: z30.boolean().optional()
|
|
17121
17176
|
});
|
|
17122
|
-
var AgentTreesListOutputSchema =
|
|
17123
|
-
var AgentTreesShowInputSchema =
|
|
17177
|
+
var AgentTreesListOutputSchema = z30.array(SessionSummarySchema);
|
|
17178
|
+
var AgentTreesShowInputSchema = z30.strictObject({
|
|
17124
17179
|
/** A session id, or an unambiguous prefix of one. */
|
|
17125
|
-
session:
|
|
17180
|
+
session: z30.string().min(1),
|
|
17126
17181
|
/** Look only in this identity. */
|
|
17127
|
-
identity:
|
|
17182
|
+
identity: z30.string().optional()
|
|
17128
17183
|
});
|
|
17129
|
-
var AgentTreesShowOutputSchema =
|
|
17184
|
+
var AgentTreesShowOutputSchema = z30.strictObject({ identities: z30.array(z30.string()), ...MergedAgentTreeSchema.shape });
|
|
17130
17185
|
function asBadRequest(error) {
|
|
17131
17186
|
if (error instanceof CliError) {
|
|
17132
17187
|
throw new ORPCError6("BAD_REQUEST", { message: error.message });
|
|
@@ -19309,7 +19364,7 @@ init_poolPick();
|
|
|
19309
19364
|
|
|
19310
19365
|
// src/agents/read.ts
|
|
19311
19366
|
import path35 from "node:path";
|
|
19312
|
-
import { z as
|
|
19367
|
+
import { z as z31 } from "zod";
|
|
19313
19368
|
var PROJECTS_DIR = "projects";
|
|
19314
19369
|
var TASKS_DIR = "tasks";
|
|
19315
19370
|
var SUBAGENTS_DIR = "subagents";
|
|
@@ -19428,14 +19483,14 @@ function parseJson2(text) {
|
|
|
19428
19483
|
return void 0;
|
|
19429
19484
|
}
|
|
19430
19485
|
}
|
|
19431
|
-
var TaskFileSchema =
|
|
19432
|
-
var WorkflowRunFileSchema =
|
|
19433
|
-
runId:
|
|
19434
|
-
workflowName:
|
|
19435
|
-
status:
|
|
19436
|
-
startTime:
|
|
19437
|
-
phases:
|
|
19438
|
-
summary:
|
|
19486
|
+
var TaskFileSchema = z31.object({ ...TaskItemSchema.omit({ taskList: true }).shape, blocks: z31.array(z31.string()).default([]), blockedBy: z31.array(z31.string()).default([]) });
|
|
19487
|
+
var WorkflowRunFileSchema = z31.object({
|
|
19488
|
+
runId: z31.string(),
|
|
19489
|
+
workflowName: z31.string().optional(),
|
|
19490
|
+
status: z31.string().optional(),
|
|
19491
|
+
startTime: z31.number().optional(),
|
|
19492
|
+
phases: z31.array(z31.object({ title: z31.string() })).default([]),
|
|
19493
|
+
summary: z31.string().optional()
|
|
19439
19494
|
});
|
|
19440
19495
|
function summariseSession(fs13, configDir, ref) {
|
|
19441
19496
|
const sessionRelative = path35.join(PROJECTS_DIR, ref.project, ref.entry);
|