claude-use 11.45.0 → 11.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/cli.cjs +1105 -817
- package/dist/index.cjs +524 -489
- package/dist/index.mjs +520 -485
- package/dist/types/index.d.ts +12 -31
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -271,8 +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
|
-
routeByName: z.boolean().optional(),
|
|
276
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. */
|
|
277
275
|
explain: z.boolean().optional()
|
|
278
276
|
});
|
|
@@ -1451,9 +1449,6 @@ function flattenLayers(layers, options) {
|
|
|
1451
1449
|
if (layer.launch.explain !== void 0) {
|
|
1452
1450
|
launch.explain = layer.launch.explain;
|
|
1453
1451
|
}
|
|
1454
|
-
if (layer.launch.routeByName !== void 0) {
|
|
1455
|
-
launch.routeByName = layer.launch.routeByName;
|
|
1456
|
-
}
|
|
1457
1452
|
}
|
|
1458
1453
|
if (layer.models !== void 0) {
|
|
1459
1454
|
models = mergeModels(models, layer.models);
|
|
@@ -2906,7 +2901,7 @@ var init_capability = __esm({
|
|
|
2906
2901
|
});
|
|
2907
2902
|
|
|
2908
2903
|
// src/frontdoor/route.ts
|
|
2909
|
-
var IDENTITY_HEADER, SESSION_HEADER, PROVIDER_HEADER, HEADROOM_FLAG_HEADER,
|
|
2904
|
+
var IDENTITY_HEADER, SESSION_HEADER, PROVIDER_HEADER, HEADROOM_FLAG_HEADER, PROJECT_ID_HEADER, AUTH_HEADER;
|
|
2910
2905
|
var init_route = __esm({
|
|
2911
2906
|
"src/frontdoor/route.ts"() {
|
|
2912
2907
|
"use strict";
|
|
@@ -2914,7 +2909,6 @@ var init_route = __esm({
|
|
|
2914
2909
|
SESSION_HEADER = "x-agent-shim-session";
|
|
2915
2910
|
PROVIDER_HEADER = "x-agent-shim-provider";
|
|
2916
2911
|
HEADROOM_FLAG_HEADER = "x-agent-shim-headroom";
|
|
2917
|
-
ROUTE_BY_NAME_HEADER = "x-agent-shim-route-by-name";
|
|
2918
2912
|
PROJECT_ID_HEADER = "x-headroom-project-id";
|
|
2919
2913
|
AUTH_HEADER = "x-agent-shim-auth";
|
|
2920
2914
|
}
|
|
@@ -3054,7 +3048,7 @@ var init_state = __esm({
|
|
|
3054
3048
|
"src/frontdoor/state.ts"() {
|
|
3055
3049
|
"use strict";
|
|
3056
3050
|
init_schema();
|
|
3057
|
-
FRONT_DOOR_PROTOCOL =
|
|
3051
|
+
FRONT_DOOR_PROTOCOL = 5;
|
|
3058
3052
|
FrontDoorSessionSchema = z3.strictObject({ pid: z3.number().int().positive(), startedAt: z3.number(), token: z3.string().min(1), supervisorPid: z3.number().int().positive().optional(), sessionId: z3.string().min(1).optional(), models: ModelsConfigSchema.optional() });
|
|
3059
3053
|
FrontDoorStateSchema = z3.strictObject({
|
|
3060
3054
|
/**
|
|
@@ -3127,7 +3121,7 @@ var init_package = __esm({
|
|
|
3127
3121
|
"package.json"() {
|
|
3128
3122
|
package_default = {
|
|
3129
3123
|
name: "claude-use",
|
|
3130
|
-
version: "11.
|
|
3124
|
+
version: "11.47.0",
|
|
3131
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.",
|
|
3132
3126
|
license: "MIT",
|
|
3133
3127
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -6431,9 +6425,6 @@ function applyProfileChange(paths, name, change) {
|
|
|
6431
6425
|
if (change.launchExplain !== void 0) {
|
|
6432
6426
|
launchPatch.explain = change.launchExplain;
|
|
6433
6427
|
}
|
|
6434
|
-
if (change.launchRouteByName !== void 0) {
|
|
6435
|
-
launchPatch.routeByName = change.launchRouteByName;
|
|
6436
|
-
}
|
|
6437
6428
|
if (Object.keys(launchPatch).length > 0) {
|
|
6438
6429
|
setProfileLaunchFlags(paths, name, launchPatch);
|
|
6439
6430
|
touched = true;
|
|
@@ -6504,6 +6495,7 @@ function buildLayoutPaths(root) {
|
|
|
6504
6495
|
identitiesDir: path23.join(root, "identities"),
|
|
6505
6496
|
configProfilesDir: path23.join(root, "config-profiles"),
|
|
6506
6497
|
providersDir: path23.join(root, "providers"),
|
|
6498
|
+
providerAliasesFile: path23.join(root, "provider-aliases.json"),
|
|
6507
6499
|
directoryRulesFile: path23.join(root, "directory-rules.json"),
|
|
6508
6500
|
activeIdentityFile: path23.join(root, "active-identity"),
|
|
6509
6501
|
globalConfigFile: path23.join(root, "config.json"),
|
|
@@ -6716,6 +6708,50 @@ var init_realCredentialCache = __esm({
|
|
|
6716
6708
|
}
|
|
6717
6709
|
});
|
|
6718
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
|
+
|
|
6719
6755
|
// src/credential.ts
|
|
6720
6756
|
function commandArgv(source) {
|
|
6721
6757
|
if ("command" in source) {
|
|
@@ -7122,6 +7158,11 @@ var init_families = __esm({
|
|
|
7122
7158
|
// src/providersStore.ts
|
|
7123
7159
|
import fs7 from "node:fs";
|
|
7124
7160
|
import path25 from "node:path";
|
|
7161
|
+
function requireValidProviderName(name) {
|
|
7162
|
+
if (!PROVIDER_NAME_RE.test(name)) {
|
|
7163
|
+
throw new InvalidProviderNameError(name);
|
|
7164
|
+
}
|
|
7165
|
+
}
|
|
7125
7166
|
function providerJsonPath(paths, name) {
|
|
7126
7167
|
return path25.join(paths.providersDir, `${name}.json`);
|
|
7127
7168
|
}
|
|
@@ -7242,9 +7283,7 @@ function addProvider(paths, name, input) {
|
|
|
7242
7283
|
if (providerExists(paths, name)) {
|
|
7243
7284
|
throw new ProviderAlreadyExistsError(name);
|
|
7244
7285
|
}
|
|
7245
|
-
|
|
7246
|
-
throw new InvalidProviderNameError(name);
|
|
7247
|
-
}
|
|
7286
|
+
requireValidProviderName(name);
|
|
7248
7287
|
const kind = input.kind ?? "http";
|
|
7249
7288
|
if (kind === "codex" && input.baseUrl !== void 0) {
|
|
7250
7289
|
throw new ProviderKindMismatchError("A codex provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
|
|
@@ -7375,10 +7414,11 @@ function cascadeProviderName(cascade) {
|
|
|
7375
7414
|
}
|
|
7376
7415
|
function selectProvider(params) {
|
|
7377
7416
|
const cliName = params.cliProvider !== void 0 && params.cliProvider !== "" ? params.cliProvider : void 0;
|
|
7378
|
-
const
|
|
7379
|
-
if (
|
|
7417
|
+
const named = cliName ?? (params.cascade === void 0 ? void 0 : cascadeProviderName(params.cascade));
|
|
7418
|
+
if (named === void 0) {
|
|
7380
7419
|
return void 0;
|
|
7381
7420
|
}
|
|
7421
|
+
const name = canonicalProviderName(named, (candidate) => loadProvider(params.paths.providersDir, candidate, params.port) !== void 0, () => loadProviderAliases(params.paths.providerAliasesFile, params.port));
|
|
7382
7422
|
const definition = loadProvider(params.paths.providersDir, name, params.port);
|
|
7383
7423
|
if (definition === void 0) {
|
|
7384
7424
|
const known = listProviderNames(params.port.readdir, params.paths.providersDir);
|
|
@@ -7476,6 +7516,7 @@ var init_providersStore = __esm({
|
|
|
7476
7516
|
init_unrecognisedKeys();
|
|
7477
7517
|
init_schema();
|
|
7478
7518
|
init_cliError();
|
|
7519
|
+
init_providerAliases();
|
|
7479
7520
|
init_credential();
|
|
7480
7521
|
init_walk();
|
|
7481
7522
|
init_families();
|
|
@@ -7724,7 +7765,7 @@ var init_commandDeps = __esm({
|
|
|
7724
7765
|
// src/claudeShim.ts
|
|
7725
7766
|
import fs8 from "node:fs";
|
|
7726
7767
|
import path28 from "node:path";
|
|
7727
|
-
import { z as
|
|
7768
|
+
import { z as z20 } from "zod";
|
|
7728
7769
|
function commandFilename(ownExecutablePath, commandName) {
|
|
7729
7770
|
return ownExecutablePath.toLowerCase().endsWith(".exe") ? `${commandName}.exe` : commandName;
|
|
7730
7771
|
}
|
|
@@ -7774,10 +7815,10 @@ var init_claudeShim = __esm({
|
|
|
7774
7815
|
init_store();
|
|
7775
7816
|
init_realPorts();
|
|
7776
7817
|
init_cliError();
|
|
7777
|
-
ClaudeShimStateSchema =
|
|
7778
|
-
targetPath:
|
|
7779
|
-
method:
|
|
7780
|
-
installedAtMs:
|
|
7818
|
+
ClaudeShimStateSchema = z20.strictObject({
|
|
7819
|
+
targetPath: z20.string().min(1),
|
|
7820
|
+
method: z20.enum(["hardlink", "copy"]),
|
|
7821
|
+
installedAtMs: z20.number()
|
|
7781
7822
|
});
|
|
7782
7823
|
nodeLinkFs = { link: fs8.linkSync, copyFile: fs8.copyFileSync, chmod: fs8.chmodSync };
|
|
7783
7824
|
}
|
|
@@ -7873,62 +7914,62 @@ var init_signatures = __esm({
|
|
|
7873
7914
|
});
|
|
7874
7915
|
|
|
7875
7916
|
// src/codex/anthropic.ts
|
|
7876
|
-
import { z as
|
|
7917
|
+
import { z as z24 } from "zod";
|
|
7877
7918
|
var TextBlockSchema, Base64ImageSourceSchema, UrlImageSourceSchema, ImageBlockSchema, ToolUseBlockSchema, ToolResultContentBlockSchema, ToolResultBlockSchema, OtherBlockSchema, ContentBlockSchema, MessageSchema, ToolSchema, ToolChoiceSchema, SystemSchema, MessagesRequestSchema, CountTokensRequestSchema;
|
|
7878
7919
|
var init_anthropic = __esm({
|
|
7879
7920
|
"src/codex/anthropic.ts"() {
|
|
7880
7921
|
"use strict";
|
|
7881
|
-
TextBlockSchema =
|
|
7882
|
-
Base64ImageSourceSchema =
|
|
7883
|
-
UrlImageSourceSchema =
|
|
7884
|
-
ImageBlockSchema =
|
|
7885
|
-
type:
|
|
7886
|
-
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])
|
|
7887
7928
|
});
|
|
7888
|
-
ToolUseBlockSchema =
|
|
7889
|
-
type:
|
|
7890
|
-
id:
|
|
7891
|
-
name:
|
|
7892
|
-
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()
|
|
7893
7934
|
});
|
|
7894
|
-
ToolResultContentBlockSchema =
|
|
7895
|
-
ToolResultBlockSchema =
|
|
7896
|
-
type:
|
|
7897
|
-
tool_use_id:
|
|
7898
|
-
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()
|
|
7899
7940
|
});
|
|
7900
|
-
OtherBlockSchema =
|
|
7901
|
-
ContentBlockSchema =
|
|
7902
|
-
MessageSchema =
|
|
7903
|
-
role:
|
|
7904
|
-
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)])
|
|
7905
7946
|
});
|
|
7906
|
-
ToolSchema =
|
|
7907
|
-
name:
|
|
7908
|
-
description:
|
|
7909
|
-
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()
|
|
7910
7951
|
});
|
|
7911
|
-
ToolChoiceSchema =
|
|
7912
|
-
|
|
7913
|
-
|
|
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) })
|
|
7914
7955
|
]);
|
|
7915
|
-
SystemSchema =
|
|
7916
|
-
MessagesRequestSchema =
|
|
7917
|
-
model:
|
|
7956
|
+
SystemSchema = z24.union([z24.string(), z24.array(z24.union([TextBlockSchema, OtherBlockSchema]))]);
|
|
7957
|
+
MessagesRequestSchema = z24.looseObject({
|
|
7958
|
+
model: z24.string().optional(),
|
|
7918
7959
|
system: SystemSchema.optional(),
|
|
7919
|
-
messages:
|
|
7920
|
-
tools:
|
|
7960
|
+
messages: z24.array(MessageSchema),
|
|
7961
|
+
tools: z24.array(ToolSchema).optional(),
|
|
7921
7962
|
tool_choice: ToolChoiceSchema.optional(),
|
|
7922
|
-
stream:
|
|
7963
|
+
stream: z24.boolean().optional(),
|
|
7923
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. */
|
|
7924
|
-
metadata:
|
|
7965
|
+
metadata: z24.looseObject({ user_id: z24.string().optional() }).optional(),
|
|
7925
7966
|
/** Claude Code's effort setting. Any string is accepted; the translator honours only the levels the backend understands. */
|
|
7926
|
-
output_config:
|
|
7967
|
+
output_config: z24.looseObject({ effort: z24.string().optional() }).optional()
|
|
7927
7968
|
});
|
|
7928
|
-
CountTokensRequestSchema =
|
|
7929
|
-
system:
|
|
7930
|
-
messages:
|
|
7931
|
-
tools:
|
|
7969
|
+
CountTokensRequestSchema = z24.looseObject({
|
|
7970
|
+
system: z24.unknown().optional(),
|
|
7971
|
+
messages: z24.unknown().optional(),
|
|
7972
|
+
tools: z24.unknown().optional()
|
|
7932
7973
|
});
|
|
7933
7974
|
}
|
|
7934
7975
|
});
|
|
@@ -8013,7 +8054,7 @@ var init_translate2 = __esm({
|
|
|
8013
8054
|
// src/providerCatalogue.ts
|
|
8014
8055
|
import path30 from "node:path";
|
|
8015
8056
|
import picomatch4 from "picomatch";
|
|
8016
|
-
import { z as
|
|
8057
|
+
import { z as z25 } from "zod";
|
|
8017
8058
|
function catalogueCachePath(paths, name) {
|
|
8018
8059
|
return path30.join(paths.catalogueDir, `${name}.json`);
|
|
8019
8060
|
}
|
|
@@ -8048,8 +8089,8 @@ var init_providerCatalogue = __esm({
|
|
|
8048
8089
|
CATALOGUE_REQUEST_SECONDS = 10;
|
|
8049
8090
|
CATALOGUE_REQUEST_TIMEOUT_MS = CATALOGUE_REQUEST_SECONDS * MS_PER_SECOND5;
|
|
8050
8091
|
CATALOGUE_REFRESH_TIMEOUT_MS = DEFAULT_CANDIDATE_URLS * CATALOGUE_REQUEST_TIMEOUT_MS;
|
|
8051
|
-
CatalogueModelSchema =
|
|
8052
|
-
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) });
|
|
8053
8094
|
}
|
|
8054
8095
|
});
|
|
8055
8096
|
|
|
@@ -8135,7 +8176,7 @@ function providerModelRows(provider, catalogue = []) {
|
|
|
8135
8176
|
const taken = new Set(named.map((row) => labelOf(row.model)));
|
|
8136
8177
|
return [...named, ...catalogueRows(provider, catalogue).filter((row) => !taken.has(labelOf(row.model)))];
|
|
8137
8178
|
}
|
|
8138
|
-
function routedModelRows(models, providers
|
|
8179
|
+
function routedModelRows(models, providers) {
|
|
8139
8180
|
const hidden = new Set(models.hide ?? []);
|
|
8140
8181
|
const shown = models.show === void 0 ? void 0 : new Set(models.show);
|
|
8141
8182
|
const visible = (model) => shown === void 0 ? !hidden.has(model) : shown.has(model);
|
|
@@ -8143,17 +8184,17 @@ function routedModelRows(models, providers, bare = true) {
|
|
|
8143
8184
|
const concreteByRef = new Map(concrete.map((row) => [row.model, row]));
|
|
8144
8185
|
const families = buildFamilies([...concrete.map((row) => row.model), ...accountRefsOf(models)], models);
|
|
8145
8186
|
const handlingOf = (refs) => refs.map((ref) => concreteByRef.get(ref)?.behavesAs).find((behavesAs) => behavesAs !== void 0) ?? TIER_BEHAVES_AS.sonnet;
|
|
8146
|
-
const virtual =
|
|
8187
|
+
const virtual = Object.entries(models.virtual ?? {}).flatMap(([name, definition]) => {
|
|
8147
8188
|
if (!visible(name)) {
|
|
8148
8189
|
return [];
|
|
8149
8190
|
}
|
|
8150
8191
|
const targets = expandFamilyMembers(safeExpand(name, models), families);
|
|
8151
8192
|
return [{ model: name, label: name, description: `Virtual (${definition.mode})`, behavesAs: handlingOf(targets) }];
|
|
8152
|
-
})
|
|
8153
|
-
const familyRows =
|
|
8193
|
+
});
|
|
8194
|
+
const familyRows = sharedFamilies(families).flatMap((family) => {
|
|
8154
8195
|
const member = `${FAMILY_PREFIX}${family.key}`;
|
|
8155
8196
|
return visible(member) ? [{ model: member, label: family.key, description: `Family (${familyMode(family.settings)}): ${family.refs.join(", ")}`, behavesAs: handlingOf(family.refs) }] : [];
|
|
8156
|
-
})
|
|
8197
|
+
});
|
|
8157
8198
|
return [...virtual, ...familyRows, ...concrete.filter((row) => visible(row.model))];
|
|
8158
8199
|
}
|
|
8159
8200
|
function safeExpand(name, models) {
|
|
@@ -8633,8 +8674,7 @@ var init_argv = __esm({
|
|
|
8633
8674
|
{ flag: "--remote-control", key: "remoteControl" },
|
|
8634
8675
|
{ flag: "--wait", key: "wait" },
|
|
8635
8676
|
{ flag: "--pause", key: "pause" },
|
|
8636
|
-
{ flag: "--explain", key: "explain" }
|
|
8637
|
-
{ flag: "--route-by-name", key: "routeByName" }
|
|
8677
|
+
{ flag: "--explain", key: "explain" }
|
|
8638
8678
|
];
|
|
8639
8679
|
LAUNCHER_FLAG_NAMES = [
|
|
8640
8680
|
...VALUED_FLAGS,
|
|
@@ -8825,7 +8865,6 @@ function resolveLaunchFlags(params) {
|
|
|
8825
8865
|
trackUsage: params.flags?.trackUsage ?? parseEnvBool("AGENT_SHIM_TRACK_USAGE", params.env.AGENT_SHIM_TRACK_USAGE) ?? params.cascade?.trackUsage ?? true,
|
|
8826
8866
|
pause: params.flags?.pause ?? parseEnvBool("AGENT_SHIM_PAUSE", params.env.AGENT_SHIM_PAUSE) ?? params.cascade?.pause ?? false,
|
|
8827
8867
|
explain: params.flags?.explain ?? parseEnvBool("AGENT_SHIM_EXPLAIN", params.env.AGENT_SHIM_EXPLAIN) ?? params.cascade?.explain ?? false,
|
|
8828
|
-
routeByName: params.flags?.routeByName ?? parseEnvBool("AGENT_SHIM_ROUTE_BY_NAME", params.env.AGENT_SHIM_ROUTE_BY_NAME) ?? params.cascade?.routeByName ?? false,
|
|
8829
8868
|
delayMs: resolveDelayMs(params)
|
|
8830
8869
|
};
|
|
8831
8870
|
}
|
|
@@ -8874,12 +8913,10 @@ function buildEnv(params) {
|
|
|
8874
8913
|
env[key] = value;
|
|
8875
8914
|
}
|
|
8876
8915
|
}
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
env[`ANTHROPIC_DEFAULT_${tier.toUpperCase()}_MODEL`] = ref;
|
|
8882
|
-
}
|
|
8916
|
+
for (const tier of CLAUDE_TIERS) {
|
|
8917
|
+
const ref = params.tierModels?.[tier];
|
|
8918
|
+
if (ref !== void 0) {
|
|
8919
|
+
env[`ANTHROPIC_DEFAULT_${tier.toUpperCase()}_MODEL`] = ref;
|
|
8883
8920
|
}
|
|
8884
8921
|
}
|
|
8885
8922
|
if (params.provider !== void 0) {
|
|
@@ -8902,7 +8939,6 @@ function buildEnv(params) {
|
|
|
8902
8939
|
{ name: SESSION_HEADER, value: params.sessionId },
|
|
8903
8940
|
{ name: AUTH_HEADER, value: params.frontdoor.sessionToken },
|
|
8904
8941
|
...params.provider === void 0 ? [] : [{ name: PROVIDER_HEADER, value: params.provider.name }],
|
|
8905
|
-
...params.routeByName ? [{ name: ROUTE_BY_NAME_HEADER, value: "1" }] : [],
|
|
8906
8942
|
...params.headroom === void 0 ? [] : [
|
|
8907
8943
|
{ name: HEADROOM_FLAG_HEADER, value: "1" },
|
|
8908
8944
|
{ name: PROJECT_ID_HEADER, value: params.headroom.projectId }
|
|
@@ -9682,7 +9718,6 @@ function decideLaunch(params, readOnly) {
|
|
|
9682
9718
|
...parsedArgv.trackUsage === void 0 ? {} : { trackUsage: parsedArgv.trackUsage },
|
|
9683
9719
|
...parsedArgv.pause === void 0 ? {} : { pause: parsedArgv.pause },
|
|
9684
9720
|
...parsedArgv.explain === void 0 ? {} : { explain: parsedArgv.explain },
|
|
9685
|
-
...parsedArgv.routeByName === void 0 ? {} : { routeByName: parsedArgv.routeByName },
|
|
9686
9721
|
...parsedArgv.delay === void 0 ? {} : { delay: parsedArgv.delay }
|
|
9687
9722
|
}
|
|
9688
9723
|
});
|
|
@@ -9692,7 +9727,6 @@ function decideLaunch(params, readOnly) {
|
|
|
9692
9727
|
notes.push(`${loginlessProvider.identity} has no stored login, so Remote Control is off; provider ${loginlessProvider.provider} runs without it`);
|
|
9693
9728
|
}
|
|
9694
9729
|
const flags = loginlessProvider === void 0 ? requestedFlags : { ...requestedFlags, remoteControl: false };
|
|
9695
|
-
const routesByName = flags.routeByName || selectedProvider !== void 0 && isRouterProvider(selectedProvider.definition);
|
|
9696
9730
|
const globalModels = loadConfigFile(paths.globalConfigFile, GlobalConfigSchema, params.fs.readConfigFile)?.config.models;
|
|
9697
9731
|
const models = launchCascade !== void 0 && params.farm !== void 0 ? cascadeModels : globalModels;
|
|
9698
9732
|
const listedProviders = listProviderNames(fs13.readdir, paths.providersDir).flatMap((name) => {
|
|
@@ -9703,7 +9737,7 @@ function decideLaunch(params, readOnly) {
|
|
|
9703
9737
|
return [];
|
|
9704
9738
|
}
|
|
9705
9739
|
});
|
|
9706
|
-
const pickerSettings = modelPickerSettingsFromRows(routedModelRows(models ?? {}, listedProviders
|
|
9740
|
+
const pickerSettings = modelPickerSettingsFromRows(routedModelRows(models ?? {}, listedProviders), selectedProvider !== void 0);
|
|
9707
9741
|
const callerSettings = hasSettingsArgument(parsedArgv.rest);
|
|
9708
9742
|
if (pickerSettings !== void 0 && callerSettings) {
|
|
9709
9743
|
notes.push("--settings was passed, so /model keeps Claude Code's own model names");
|
|
@@ -9807,8 +9841,8 @@ function prepareLaunch(params) {
|
|
|
9807
9841
|
if (decided.pinnedVersion !== void 0) {
|
|
9808
9842
|
rows.push(pinnedVersionRow(decided.pinnedVersion.version, decided.pinnedVersion.source));
|
|
9809
9843
|
}
|
|
9810
|
-
const
|
|
9811
|
-
if (
|
|
9844
|
+
const namesResolved = decided.models !== void 0;
|
|
9845
|
+
if (namesResolved) {
|
|
9812
9846
|
const check = resolveRoutedProviderCredentials({ paths, port: params.fs, env, ...params.credentials === void 0 ? {} : { credentials: params.credentials }, models: decided.models, targets: () => targetRefs(paths) });
|
|
9813
9847
|
if (!check.ok) {
|
|
9814
9848
|
log.error(check.message);
|
|
@@ -9849,7 +9883,6 @@ function prepareLaunch(params) {
|
|
|
9849
9883
|
...headroom === void 0 ? {} : { headroom },
|
|
9850
9884
|
sessionId,
|
|
9851
9885
|
remoteControl: resolvedFlags.remoteControl,
|
|
9852
|
-
routeByName: routesByName,
|
|
9853
9886
|
...decided.models?.tiers === void 0 ? {} : { tierModels: decided.models.tiers }
|
|
9854
9887
|
});
|
|
9855
9888
|
const releases = [...headroom === void 0 || headroomPort === void 0 ? [] : [headroomPort.release], ...frontDoorRelease === void 0 ? [] : [frontDoorRelease]];
|
|
@@ -9877,8 +9910,7 @@ function resolveLaunch(params) {
|
|
|
9877
9910
|
...frontDoor ? { frontdoor: { port: 0, connectPort: 0, trustBundlePath: "", sessionToken: "" } } : {},
|
|
9878
9911
|
...decided.flags.headroom ? { headroom: { socketPath: "", projectId: "" } } : {},
|
|
9879
9912
|
sessionId: "",
|
|
9880
|
-
remoteControl: decided.flags.remoteControl
|
|
9881
|
-
routeByName: decided.flags.routeByName
|
|
9913
|
+
remoteControl: decided.flags.remoteControl
|
|
9882
9914
|
});
|
|
9883
9915
|
const credentialNames = decided.identityCredentialBlock === void 0 ? [] : Object.keys(credentialVariables(decided.identityCredentialBlock.target ?? "bearer", ""));
|
|
9884
9916
|
const environment = [.../* @__PURE__ */ new Set([...Object.keys(built).filter((name) => built[name] !== env[name]), ...credentialNames])].sort();
|
|
@@ -9890,7 +9922,7 @@ function resolveLaunch(params) {
|
|
|
9890
9922
|
bin: decided.bin,
|
|
9891
9923
|
args: decided.args,
|
|
9892
9924
|
...credential === void 0 ? {} : { credential },
|
|
9893
|
-
routing: { frontDoor, headroom: decided.flags.headroom
|
|
9925
|
+
routing: { frontDoor, headroom: decided.flags.headroom },
|
|
9894
9926
|
environment
|
|
9895
9927
|
};
|
|
9896
9928
|
}
|
|
@@ -10419,7 +10451,7 @@ var init_identityClaude = __esm({
|
|
|
10419
10451
|
});
|
|
10420
10452
|
|
|
10421
10453
|
// src/usage/providerQuota.ts
|
|
10422
|
-
import { z as
|
|
10454
|
+
import { z as z32 } from "zod";
|
|
10423
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;
|
|
10424
10456
|
var init_providerQuota = __esm({
|
|
10425
10457
|
"src/usage/providerQuota.ts"() {
|
|
@@ -10438,35 +10470,35 @@ var init_providerQuota = __esm({
|
|
|
10438
10470
|
[ZAI_UNIT_HOURS, SECONDS_PER_HOUR3 * MS_PER_SECOND9],
|
|
10439
10471
|
[ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9]
|
|
10440
10472
|
]);
|
|
10441
|
-
ZaiLimitSchema =
|
|
10442
|
-
type:
|
|
10443
|
-
unit:
|
|
10444
|
-
number:
|
|
10445
|
-
percentage:
|
|
10446
|
-
nextResetTime:
|
|
10447
|
-
usage:
|
|
10448
|
-
currentValue:
|
|
10449
|
-
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()
|
|
10450
10482
|
});
|
|
10451
|
-
ZaiResponseSchema =
|
|
10452
|
-
success:
|
|
10453
|
-
msg:
|
|
10454
|
-
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) })
|
|
10455
10487
|
});
|
|
10456
10488
|
OPENROUTER_HOST = "openrouter.ai";
|
|
10457
10489
|
OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
|
|
10458
10490
|
OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
|
|
10459
10491
|
MS_PER_DAY3 = HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
10460
|
-
OpenRouterKeySchema =
|
|
10461
|
-
data:
|
|
10462
|
-
limit:
|
|
10463
|
-
limit_remaining:
|
|
10464
|
-
limit_reset:
|
|
10465
|
-
is_free_tier:
|
|
10466
|
-
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()
|
|
10467
10499
|
})
|
|
10468
10500
|
});
|
|
10469
|
-
OpenRouterCreditsSchema =
|
|
10501
|
+
OpenRouterCreditsSchema = z32.object({ data: z32.object({ total_credits: z32.number().nonnegative(), total_usage: z32.number().nonnegative() }) });
|
|
10470
10502
|
ANTIGRAVITY_HOST = "daily-cloudcode-pa.googleapis.com";
|
|
10471
10503
|
ANTIGRAVITY_QUOTA_URL = `https://${ANTIGRAVITY_HOST}/v1internal:retrieveUserQuotaSummary`;
|
|
10472
10504
|
ANTIGRAVITY_USER_URL = `https://${ANTIGRAVITY_HOST}/v1internal:loadCodeAssist`;
|
|
@@ -10474,21 +10506,21 @@ var init_providerQuota = __esm({
|
|
|
10474
10506
|
DAYS_PER_WEEK2 = 7;
|
|
10475
10507
|
FIVE_HOURS_MS = FIVE_HOURS2 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
10476
10508
|
WEEK_MS = DAYS_PER_WEEK2 * HOURS_PER_DAY6 * SECONDS_PER_HOUR3 * MS_PER_SECOND9;
|
|
10477
|
-
AntigravityBucketSchema =
|
|
10478
|
-
bucketId:
|
|
10479
|
-
remainingFraction:
|
|
10480
|
-
resetTime:
|
|
10509
|
+
AntigravityBucketSchema = z32.object({
|
|
10510
|
+
bucketId: z32.string(),
|
|
10511
|
+
remainingFraction: z32.number().optional(),
|
|
10512
|
+
resetTime: z32.string().optional()
|
|
10481
10513
|
});
|
|
10482
|
-
AntigravitySummarySchema =
|
|
10483
|
-
GoogleTokenInfoSchema =
|
|
10484
|
-
email:
|
|
10485
|
-
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()
|
|
10486
10518
|
});
|
|
10487
|
-
AntigravityUserSchema =
|
|
10519
|
+
AntigravityUserSchema = z32.object({
|
|
10488
10520
|
/** The code-assist tier context, which defaults to the free tier for every account. */
|
|
10489
|
-
currentTier:
|
|
10521
|
+
currentTier: z32.object({ name: z32.string().optional(), id: z32.string().optional() }).optional(),
|
|
10490
10522
|
/** The account's paid subscription; absent when the account has none. */
|
|
10491
|
-
paidTier:
|
|
10523
|
+
paidTier: z32.object({ name: z32.string().optional(), id: z32.string().optional() }).optional()
|
|
10492
10524
|
});
|
|
10493
10525
|
}
|
|
10494
10526
|
});
|
|
@@ -14416,7 +14448,7 @@ init_providersStore();
|
|
|
14416
14448
|
init_projects();
|
|
14417
14449
|
init_pipeline();
|
|
14418
14450
|
import path27 from "node:path";
|
|
14419
|
-
import { z as
|
|
14451
|
+
import { z as z16 } from "zod";
|
|
14420
14452
|
var HISTORY_PROJECTS_KEY_PREFIX = "history/projects/";
|
|
14421
14453
|
function projectFragmentOf(rawKey) {
|
|
14422
14454
|
return rawKey.startsWith(HISTORY_PROJECTS_KEY_PREFIX) ? rawKey.slice(HISTORY_PROJECTS_KEY_PREFIX.length) : void 0;
|
|
@@ -14485,9 +14517,9 @@ function lookupKeychainService(run, farmRoot) {
|
|
|
14485
14517
|
}
|
|
14486
14518
|
return { checked: true, found: true, serviceName, note: `Keychain service name for this identity: "${serviceName}".` };
|
|
14487
14519
|
}
|
|
14488
|
-
var SettingsSecretsShapeSchema =
|
|
14489
|
-
env:
|
|
14490
|
-
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()
|
|
14491
14523
|
});
|
|
14492
14524
|
function hookCommandCountOf(group) {
|
|
14493
14525
|
if (typeof group !== "object" || group === null) {
|
|
@@ -14784,7 +14816,7 @@ init_schema();
|
|
|
14784
14816
|
init_claudeVersion();
|
|
14785
14817
|
init_identity();
|
|
14786
14818
|
init_projects();
|
|
14787
|
-
import { z as
|
|
14819
|
+
import { z as z18 } from "zod";
|
|
14788
14820
|
|
|
14789
14821
|
// src/resolve/types.ts
|
|
14790
14822
|
var LAYER_KINDS = [
|
|
@@ -14845,123 +14877,123 @@ var DIAGNOSTIC_SEVERITIES = ["error", "warning", "info"];
|
|
|
14845
14877
|
|
|
14846
14878
|
// src/usage/pickReportSchema.ts
|
|
14847
14879
|
init_plan2();
|
|
14848
|
-
import { z as
|
|
14849
|
-
var PoolPickCandidateViewSchema =
|
|
14850
|
-
identity:
|
|
14880
|
+
import { z as z17 } from "zod";
|
|
14881
|
+
var PoolPickCandidateViewSchema = z17.strictObject({
|
|
14882
|
+
identity: z17.string(),
|
|
14851
14883
|
/** In pick order: `scored` has usable quota data, `unknown` has none, `pay-per-use` bills by use, `ineligible` is refused right now. */
|
|
14852
|
-
class:
|
|
14884
|
+
class: z17.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
|
|
14853
14885
|
/** Plan-size-weighted remaining quota per hour until its reset; present for `scored` only. */
|
|
14854
|
-
score:
|
|
14886
|
+
score: z17.number().optional(),
|
|
14855
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`. */
|
|
14856
|
-
scoreWindow:
|
|
14888
|
+
scoreWindow: z17.enum(["sevenDay", "fiveHour"]).optional(),
|
|
14857
14889
|
/** False when the five-hour window would run dry, at the observed pace, before it resets. */
|
|
14858
|
-
feasible:
|
|
14890
|
+
feasible: z17.boolean(),
|
|
14859
14891
|
/** When an `ineligible` member can be used again, as an ISO instant. */
|
|
14860
|
-
blockedUntil:
|
|
14892
|
+
blockedUntil: z17.iso.datetime().optional(),
|
|
14861
14893
|
plan: PlanClassSchema,
|
|
14862
14894
|
/** The facts behind the class and score, in the order they matter. */
|
|
14863
|
-
reasons:
|
|
14895
|
+
reasons: z17.array(z17.string())
|
|
14864
14896
|
});
|
|
14865
|
-
var PoolPickReportSchema =
|
|
14866
|
-
pool:
|
|
14867
|
-
directory:
|
|
14897
|
+
var PoolPickReportSchema = z17.strictObject({
|
|
14898
|
+
pool: z17.string(),
|
|
14899
|
+
directory: z17.string(),
|
|
14868
14900
|
/** The member a launch would run as, absent when every member is refused. */
|
|
14869
|
-
pick:
|
|
14870
|
-
candidates:
|
|
14901
|
+
pick: z17.string().optional(),
|
|
14902
|
+
candidates: z17.array(PoolPickCandidateViewSchema),
|
|
14871
14903
|
/** Identity members anywhere in the pool's graph that do not exist; a launch skips them. */
|
|
14872
|
-
missing:
|
|
14904
|
+
missing: z17.array(z17.string()),
|
|
14873
14905
|
/** When nothing can be picked, the soonest any member returns. */
|
|
14874
|
-
earliestReturn:
|
|
14906
|
+
earliestReturn: z17.strictObject({ identity: z17.string(), at: z17.iso.datetime() }).optional(),
|
|
14875
14907
|
/** The member a resumed conversation started on but moved off, and why, when the ranking could not keep it. */
|
|
14876
|
-
movedOff:
|
|
14908
|
+
movedOff: z17.strictObject({ identity: z17.string(), reason: z17.string() }).optional(),
|
|
14877
14909
|
/** Why the last-pick record could not be read, when that is the case. */
|
|
14878
|
-
stickyProblem:
|
|
14910
|
+
stickyProblem: z17.string().optional()
|
|
14879
14911
|
});
|
|
14880
14912
|
|
|
14881
14913
|
// src/checkReportSchema.ts
|
|
14882
14914
|
var CHECK_CREDENTIAL_APPLIES = ["provider", "identity", "stored-login"];
|
|
14883
|
-
var CheckLayerViewSchema =
|
|
14884
|
-
id:
|
|
14885
|
-
kind:
|
|
14886
|
-
source:
|
|
14915
|
+
var CheckLayerViewSchema = z18.strictObject({
|
|
14916
|
+
id: z18.int(),
|
|
14917
|
+
kind: z18.enum(LAYER_KINDS),
|
|
14918
|
+
source: z18.string()
|
|
14887
14919
|
});
|
|
14888
|
-
var CheckEntryViewSchema =
|
|
14889
|
-
path:
|
|
14890
|
-
shared:
|
|
14891
|
-
via:
|
|
14920
|
+
var CheckEntryViewSchema = z18.strictObject({
|
|
14921
|
+
path: z18.string(),
|
|
14922
|
+
shared: z18.boolean(),
|
|
14923
|
+
via: z18.enum(DECISION_VIAS),
|
|
14892
14924
|
/** The entry's real category, or null when nothing classifies it. */
|
|
14893
|
-
category:
|
|
14894
|
-
rule:
|
|
14925
|
+
category: z18.enum(CATEGORY_NAMES).nullable(),
|
|
14926
|
+
rule: z18.strictObject({ key: z18.string(), layer: z18.int() }).optional(),
|
|
14895
14927
|
/** Rules that matched but whose `when` condition failed, each with the conditions that failed. */
|
|
14896
|
-
eliminated:
|
|
14928
|
+
eliminated: z18.readonly(z18.array(z18.strictObject({ key: z18.string(), failed: z18.readonly(z18.array(z18.string())) }))).optional()
|
|
14897
14929
|
});
|
|
14898
|
-
var CheckDiagnosticSchema =
|
|
14899
|
-
code:
|
|
14900
|
-
severity:
|
|
14901
|
-
message:
|
|
14902
|
-
subject:
|
|
14903
|
-
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()
|
|
14904
14936
|
});
|
|
14905
|
-
var CheckAmbientCredentialSchema =
|
|
14906
|
-
var CheckKeychainSchema =
|
|
14907
|
-
checked:
|
|
14908
|
-
found:
|
|
14909
|
-
serviceName:
|
|
14910
|
-
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()
|
|
14911
14943
|
});
|
|
14912
|
-
var CheckSettingsExposureSchema =
|
|
14913
|
-
file:
|
|
14914
|
-
envKeyNames:
|
|
14915
|
-
hookEventNames:
|
|
14916
|
-
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()
|
|
14917
14949
|
});
|
|
14918
|
-
var CredentialSourceSummarySchema =
|
|
14919
|
-
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14923
|
-
|
|
14924
|
-
|
|
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") })
|
|
14925
14957
|
]);
|
|
14926
|
-
var CredentialSummarySchema =
|
|
14927
|
-
target:
|
|
14928
|
-
sources:
|
|
14958
|
+
var CredentialSummarySchema = z18.strictObject({
|
|
14959
|
+
target: z18.enum(CREDENTIAL_TARGETS),
|
|
14960
|
+
sources: z18.readonly(z18.array(CredentialSourceSummarySchema)),
|
|
14929
14961
|
cache: CredentialCacheSchema.optional()
|
|
14930
14962
|
});
|
|
14931
|
-
var CachedCredentialStateSchema =
|
|
14932
|
-
|
|
14933
|
-
|
|
14934
|
-
|
|
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() })
|
|
14935
14967
|
]);
|
|
14936
|
-
var CheckCredentialProviderSchema =
|
|
14937
|
-
|
|
14938
|
-
|
|
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() })
|
|
14939
14971
|
]);
|
|
14940
|
-
var CheckCredentialSchema =
|
|
14941
|
-
applies:
|
|
14972
|
+
var CheckCredentialSchema = z18.strictObject({
|
|
14973
|
+
applies: z18.enum(CHECK_CREDENTIAL_APPLIES),
|
|
14942
14974
|
provider: CheckCredentialProviderSchema.optional(),
|
|
14943
14975
|
identity: CredentialSummarySchema.optional(),
|
|
14944
14976
|
identityCached: CachedCredentialStateSchema.optional()
|
|
14945
14977
|
});
|
|
14946
|
-
var CheckClaudeVersionSchema =
|
|
14947
|
-
pinned:
|
|
14948
|
-
highestInstalled:
|
|
14949
|
-
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()))
|
|
14950
14982
|
});
|
|
14951
|
-
var CheckReportJsonSchema =
|
|
14952
|
-
identity:
|
|
14983
|
+
var CheckReportJsonSchema = z18.strictObject({
|
|
14984
|
+
identity: z18.strictObject({ name: z18.string().nullable(), source: z18.enum(IDENTITY_DECISION_SOURCES) }),
|
|
14953
14985
|
/** The pool ranking, when the launch named a pool instead of an identity. */
|
|
14954
14986
|
pool: PoolPickReportSchema.optional(),
|
|
14955
|
-
configProfile:
|
|
14956
|
-
layers:
|
|
14957
|
-
entries:
|
|
14958
|
-
projectEncodingAmbiguities:
|
|
14959
|
-
|
|
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() }))
|
|
14960
14992
|
),
|
|
14961
|
-
diagnostics:
|
|
14993
|
+
diagnostics: z18.readonly(z18.array(CheckDiagnosticSchema)),
|
|
14962
14994
|
ambientCredential: CheckAmbientCredentialSchema,
|
|
14963
14995
|
keychain: CheckKeychainSchema.optional(),
|
|
14964
|
-
settingsExposure:
|
|
14996
|
+
settingsExposure: z18.readonly(z18.array(CheckSettingsExposureSchema)),
|
|
14965
14997
|
credential: CheckCredentialSchema,
|
|
14966
14998
|
claudeVersion: CheckClaudeVersionSchema.optional()
|
|
14967
14999
|
});
|
|
@@ -15021,28 +15053,28 @@ function collectResets(snapshots, nowMs) {
|
|
|
15021
15053
|
}
|
|
15022
15054
|
|
|
15023
15055
|
// src/usage/resetsSchema.ts
|
|
15024
|
-
import { z as
|
|
15025
|
-
var ResetRowSchema =
|
|
15026
|
-
identity:
|
|
15027
|
-
provider:
|
|
15056
|
+
import { z as z19 } from "zod";
|
|
15057
|
+
var ResetRowSchema = z19.strictObject({
|
|
15058
|
+
identity: z19.string(),
|
|
15059
|
+
provider: z19.string(),
|
|
15028
15060
|
/** What the window is: `5h`, `7d` or `extra usage` for an Anthropic account, or the provider's own measure and period (`tokens 5h`). */
|
|
15029
|
-
window:
|
|
15061
|
+
window: z19.string(),
|
|
15030
15062
|
/** When the state the window comes from was observed, as an ISO instant. */
|
|
15031
|
-
observedAt:
|
|
15063
|
+
observedAt: z19.iso.datetime(),
|
|
15032
15064
|
/** When the window resets, as an ISO instant; absent when the upstream reported none. */
|
|
15033
|
-
resetsAt:
|
|
15065
|
+
resetsAt: z19.iso.datetime().optional(),
|
|
15034
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. */
|
|
15035
|
-
reset:
|
|
15067
|
+
reset: z19.boolean(),
|
|
15036
15068
|
/** The fraction used, as `effectiveWindow` reads it at the report's own clock. */
|
|
15037
|
-
utilization:
|
|
15069
|
+
utilization: z19.number().optional(),
|
|
15038
15070
|
/** The window's own status, for a window that has not reset yet. */
|
|
15039
|
-
status:
|
|
15071
|
+
status: z19.string().optional()
|
|
15040
15072
|
});
|
|
15041
|
-
var ResetScheduleSchema =
|
|
15073
|
+
var ResetScheduleSchema = z19.strictObject({ resets: z19.readonly(z19.array(ResetRowSchema)) });
|
|
15042
15074
|
|
|
15043
15075
|
// src/frontdoor/controlSchemas.ts
|
|
15044
15076
|
import path32 from "node:path";
|
|
15045
|
-
import { z as
|
|
15077
|
+
import { z as z26 } from "zod";
|
|
15046
15078
|
|
|
15047
15079
|
// src/doctorReport.ts
|
|
15048
15080
|
init_claudeShim();
|
|
@@ -15222,24 +15254,24 @@ import path31 from "node:path";
|
|
|
15222
15254
|
init_signIn();
|
|
15223
15255
|
|
|
15224
15256
|
// src/codex/siwcStore.ts
|
|
15225
|
-
import { z as
|
|
15257
|
+
import { z as z23 } from "zod";
|
|
15226
15258
|
|
|
15227
15259
|
// src/codex/auth.ts
|
|
15228
|
-
import { z as
|
|
15229
|
-
var AuthFileSchema =
|
|
15230
|
-
tokens:
|
|
15231
|
-
access_token:
|
|
15232
|
-
refresh_token:
|
|
15233
|
-
id_token:
|
|
15234
|
-
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()
|
|
15235
15267
|
}).nullish(),
|
|
15236
|
-
last_refresh:
|
|
15268
|
+
last_refresh: z21.string().optional()
|
|
15237
15269
|
});
|
|
15238
|
-
var TokenGrantSchema =
|
|
15239
|
-
access_token:
|
|
15240
|
-
refresh_token:
|
|
15241
|
-
id_token:
|
|
15242
|
-
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()
|
|
15243
15275
|
});
|
|
15244
15276
|
var CodexAuthError = class extends Error {
|
|
15245
15277
|
constructor(message) {
|
|
@@ -15249,41 +15281,41 @@ var CodexAuthError = class extends Error {
|
|
|
15249
15281
|
};
|
|
15250
15282
|
|
|
15251
15283
|
// src/codex/siwc.ts
|
|
15252
|
-
import { z as
|
|
15284
|
+
import { z as z22 } from "zod";
|
|
15253
15285
|
var SIWC_RESOURCE = "https://api.openai.com/v1";
|
|
15254
15286
|
var SIWC_RESPONSES_URL = `${SIWC_RESOURCE}/responses`;
|
|
15255
15287
|
var SIWC_PLAN_SCOPE = "chatgpt.tokens.use.direct";
|
|
15256
|
-
var TokenResponseSchema =
|
|
15257
|
-
access_token:
|
|
15258
|
-
refresh_token:
|
|
15259
|
-
id_token:
|
|
15260
|
-
expires_in:
|
|
15261
|
-
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()
|
|
15262
15294
|
});
|
|
15263
|
-
var JwtHeaderSchema =
|
|
15264
|
-
var IdTokenClaimsSchema =
|
|
15265
|
-
iss:
|
|
15266
|
-
sub:
|
|
15267
|
-
aud:
|
|
15268
|
-
exp:
|
|
15269
|
-
nonce:
|
|
15270
|
-
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()
|
|
15271
15303
|
});
|
|
15272
|
-
var JwksSchema =
|
|
15304
|
+
var JwksSchema = z22.object({ keys: z22.array(z22.looseObject({ kid: z22.string().optional(), kty: z22.string() })) });
|
|
15273
15305
|
|
|
15274
15306
|
// src/codex/siwcStore.ts
|
|
15275
|
-
var SiwcGrantSchema =
|
|
15276
|
-
clientId:
|
|
15277
|
-
sub:
|
|
15278
|
-
email:
|
|
15279
|
-
idToken:
|
|
15280
|
-
accessToken:
|
|
15281
|
-
refreshToken:
|
|
15282
|
-
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(),
|
|
15283
15315
|
/** When the access token stops working, in milliseconds since the epoch. */
|
|
15284
|
-
expiresAt:
|
|
15316
|
+
expiresAt: z23.number()
|
|
15285
15317
|
});
|
|
15286
|
-
var SiwcFileSchema =
|
|
15318
|
+
var SiwcFileSchema = z23.strictObject({ registeredClientId: z23.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
|
|
15287
15319
|
function parseSiwcFile(raw, filePath) {
|
|
15288
15320
|
let json;
|
|
15289
15321
|
try {
|
|
@@ -15565,6 +15597,7 @@ function realFrontDoorListenerProbes(paths) {
|
|
|
15565
15597
|
// src/doctorReport.ts
|
|
15566
15598
|
init_supervisorProcesses();
|
|
15567
15599
|
init_legacy();
|
|
15600
|
+
init_providerAliases();
|
|
15568
15601
|
init_providersStore();
|
|
15569
15602
|
init_guard();
|
|
15570
15603
|
init_identity();
|
|
@@ -15893,6 +15926,10 @@ function runDoctor(params) {
|
|
|
15893
15926
|
for (const entry of params.providers) {
|
|
15894
15927
|
pushProvider(push, entry, params.credentialCache, params.chatgptSignIn);
|
|
15895
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
|
+
}
|
|
15896
15933
|
if (params.platform !== "darwin" || params.run === void 0) {
|
|
15897
15934
|
push("keychain", "pass", "Skipped (not macOS).");
|
|
15898
15935
|
} else {
|
|
@@ -16182,6 +16219,7 @@ function collectDoctorReport(params) {
|
|
|
16182
16219
|
identities,
|
|
16183
16220
|
configProfiles,
|
|
16184
16221
|
providers,
|
|
16222
|
+
providerAliases: readProviderAliases(paths),
|
|
16185
16223
|
directoryRules: { path: paths.directoryRulesFile, raw: realFsPort.readFileUtf8(paths.directoryRulesFile) },
|
|
16186
16224
|
globalConfig: { path: paths.globalConfigFile, raw: realFsPort.readFileUtf8(paths.globalConfigFile) },
|
|
16187
16225
|
models: parsedModelsOf(paths),
|
|
@@ -16237,90 +16275,90 @@ function collectDoctorReport(params) {
|
|
|
16237
16275
|
// src/frontdoor/controlSchemas.ts
|
|
16238
16276
|
init_schema2();
|
|
16239
16277
|
init_state();
|
|
16240
|
-
var UsageListOutputSchema =
|
|
16241
|
-
var UsageWindowsInputSchema =
|
|
16242
|
-
identity:
|
|
16243
|
-
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()
|
|
16244
16282
|
});
|
|
16245
|
-
var EffectiveWindowSchema =
|
|
16283
|
+
var EffectiveWindowSchema = z26.strictObject({
|
|
16246
16284
|
/** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
|
|
16247
|
-
reset:
|
|
16285
|
+
reset: z26.boolean(),
|
|
16248
16286
|
/** The fraction used: 0 for a reset window, otherwise what was last observed, absent when none was reported. */
|
|
16249
|
-
utilization:
|
|
16287
|
+
utilization: z26.number().optional(),
|
|
16250
16288
|
/** The reset instant, for a window that has not reset yet and reported one. */
|
|
16251
|
-
resetsAtMs:
|
|
16289
|
+
resetsAtMs: z26.number().optional(),
|
|
16252
16290
|
/** The window's own status, for a window that has not reset yet. */
|
|
16253
|
-
status:
|
|
16291
|
+
status: z26.string().optional()
|
|
16254
16292
|
});
|
|
16255
|
-
var UsageWindowsOutputSchema =
|
|
16256
|
-
identity:
|
|
16257
|
-
provider:
|
|
16293
|
+
var UsageWindowsOutputSchema = z26.strictObject({
|
|
16294
|
+
identity: z26.string(),
|
|
16295
|
+
provider: z26.string(),
|
|
16258
16296
|
/** When the rate-limit state the windows come from was observed. */
|
|
16259
|
-
observedAt:
|
|
16297
|
+
observedAt: z26.iso.datetime().optional(),
|
|
16260
16298
|
fiveHour: EffectiveWindowSchema.optional(),
|
|
16261
16299
|
sevenDay: EffectiveWindowSchema.optional()
|
|
16262
16300
|
});
|
|
16263
|
-
var UsageLiveOutputSchema =
|
|
16301
|
+
var UsageLiveOutputSchema = z26.strictObject({
|
|
16264
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. */
|
|
16265
16303
|
latest: RcLiveRateLimitSchema.optional(),
|
|
16266
16304
|
/** One observation per session whose stream has filed a rate_limit_event this door generation. */
|
|
16267
|
-
sessions:
|
|
16305
|
+
sessions: z26.readonly(z26.array(RcLiveRateLimitSchema))
|
|
16268
16306
|
});
|
|
16269
|
-
var FrontDoorSessionStatusSchema =
|
|
16270
|
-
pid:
|
|
16271
|
-
startedAt:
|
|
16272
|
-
alive:
|
|
16307
|
+
var FrontDoorSessionStatusSchema = z26.strictObject({
|
|
16308
|
+
pid: z26.int().positive(),
|
|
16309
|
+
startedAt: z26.number(),
|
|
16310
|
+
alive: z26.boolean()
|
|
16273
16311
|
});
|
|
16274
|
-
var HeadroomSocketTargetSchema =
|
|
16275
|
-
var FrontDoorStatusOutputSchema =
|
|
16312
|
+
var HeadroomSocketTargetSchema = z26.union([z26.strictObject({ socketPath: z26.string() }), z26.strictObject({ refused: z26.string() })]);
|
|
16313
|
+
var FrontDoorStatusOutputSchema = z26.strictObject({
|
|
16276
16314
|
state: FrontDoorStateSchema,
|
|
16277
|
-
supervisorAlive:
|
|
16278
|
-
sessions:
|
|
16315
|
+
supervisorAlive: z26.boolean(),
|
|
16316
|
+
sessions: z26.readonly(z26.array(FrontDoorSessionStatusSchema)),
|
|
16279
16317
|
headroomSocket: HeadroomSocketTargetSchema.optional(),
|
|
16280
|
-
logPath:
|
|
16281
|
-
logExists:
|
|
16318
|
+
logPath: z26.string(),
|
|
16319
|
+
logExists: z26.boolean()
|
|
16282
16320
|
});
|
|
16283
|
-
var FrontDoorSessionsOutputSchema =
|
|
16284
|
-
var CheckRunInputSchema =
|
|
16285
|
-
path:
|
|
16286
|
-
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()
|
|
16287
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" });
|
|
16288
|
-
var PoolPickInputSchema =
|
|
16289
|
-
pool:
|
|
16290
|
-
path:
|
|
16326
|
+
var PoolPickInputSchema = z26.strictObject({
|
|
16327
|
+
pool: z26.string().min(1),
|
|
16328
|
+
path: z26.string().min(1)
|
|
16291
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" });
|
|
16292
|
-
var DoctorFindingSchema =
|
|
16293
|
-
section:
|
|
16294
|
-
subject:
|
|
16295
|
-
severity:
|
|
16296
|
-
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()
|
|
16297
16335
|
});
|
|
16298
|
-
var DoctorRunOutputSchema =
|
|
16336
|
+
var DoctorRunOutputSchema = z26.strictObject({
|
|
16299
16337
|
/** False exactly when any finding is a `fail`; a `warn` never fails the report on its own. */
|
|
16300
|
-
ok:
|
|
16301
|
-
findings:
|
|
16338
|
+
ok: z26.boolean(),
|
|
16339
|
+
findings: z26.readonly(z26.array(DoctorFindingSchema))
|
|
16302
16340
|
});
|
|
16303
|
-
var FrontDoorRestartOutputSchema =
|
|
16304
|
-
action:
|
|
16305
|
-
previousPid:
|
|
16341
|
+
var FrontDoorRestartOutputSchema = z26.strictObject({
|
|
16342
|
+
action: z26.literal("restarting"),
|
|
16343
|
+
previousPid: z26.int().positive()
|
|
16306
16344
|
});
|
|
16307
|
-
var UpdateCheckOutputSchema =
|
|
16308
|
-
current:
|
|
16309
|
-
latest:
|
|
16310
|
-
action:
|
|
16345
|
+
var UpdateCheckOutputSchema = z26.strictObject({
|
|
16346
|
+
current: z26.string(),
|
|
16347
|
+
latest: z26.string(),
|
|
16348
|
+
action: z26.enum(["current", "available", "updated"])
|
|
16311
16349
|
});
|
|
16312
|
-
var CodexSignInSchema =
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
|
|
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() })
|
|
16316
16354
|
]);
|
|
16317
|
-
var CodexStatusOutputSchema =
|
|
16355
|
+
var CodexStatusOutputSchema = z26.strictObject({
|
|
16318
16356
|
signIn: CodexSignInSchema,
|
|
16319
|
-
codexProviders:
|
|
16357
|
+
codexProviders: z26.readonly(z26.array(z26.string()))
|
|
16320
16358
|
});
|
|
16321
|
-
var CodexLogoutOutputSchema =
|
|
16322
|
-
hadGrant:
|
|
16323
|
-
revoked:
|
|
16359
|
+
var CodexLogoutOutputSchema = z26.strictObject({
|
|
16360
|
+
hadGrant: z26.boolean(),
|
|
16361
|
+
revoked: z26.boolean()
|
|
16324
16362
|
});
|
|
16325
16363
|
|
|
16326
16364
|
// src/frontdoor/codexApi.ts
|
|
@@ -16478,143 +16516,142 @@ init_providersStore();
|
|
|
16478
16516
|
|
|
16479
16517
|
// src/frontdoor/configSchemas.ts
|
|
16480
16518
|
init_schema();
|
|
16481
|
-
import { z as
|
|
16482
|
-
var RemovalConfirmationSchema =
|
|
16483
|
-
var CredentialWriteSchema = (targets) =>
|
|
16484
|
-
sources:
|
|
16485
|
-
target:
|
|
16486
|
-
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()
|
|
16487
16525
|
});
|
|
16488
|
-
var CredentialSummarySchema2 =
|
|
16489
|
-
target:
|
|
16490
|
-
sources:
|
|
16491
|
-
|
|
16492
|
-
|
|
16493
|
-
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
|
|
16497
|
-
|
|
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") })
|
|
16498
16536
|
])
|
|
16499
16537
|
)),
|
|
16500
16538
|
cache: CredentialCacheSchema.optional()
|
|
16501
16539
|
});
|
|
16502
|
-
var mutationOutput = (kind, action) =>
|
|
16503
|
-
var storedMutationOutput = (kind, action, value) =>
|
|
16504
|
-
var IdentityValueSchema =
|
|
16505
|
-
name:
|
|
16506
|
-
defaultConfigProfile:
|
|
16507
|
-
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(),
|
|
16508
16546
|
credential: CredentialSummarySchema2.optional(),
|
|
16509
|
-
anchors:
|
|
16547
|
+
anchors: z27.array(AnchorSchema).optional()
|
|
16510
16548
|
});
|
|
16511
16549
|
var ProfileValueSchema = ConfigProfileSchema.omit({ $schema: true });
|
|
16512
|
-
var ProviderValueSchema =
|
|
16513
|
-
name:
|
|
16514
|
-
kind:
|
|
16515
|
-
displayName:
|
|
16516
|
-
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(),
|
|
16517
16555
|
codex: CodexProviderConfigSchema.optional(),
|
|
16518
16556
|
credential: CredentialSummarySchema2.optional(),
|
|
16519
|
-
env:
|
|
16557
|
+
env: z27.record(z27.string(), z27.string()).optional()
|
|
16520
16558
|
});
|
|
16521
|
-
var ConfigNameInputSchema =
|
|
16559
|
+
var ConfigNameInputSchema = z27.strictObject({ name: z27.string().min(1) });
|
|
16522
16560
|
var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
|
|
16523
|
-
var ConfigIdentitySetInputSchema =
|
|
16524
|
-
name:
|
|
16525
|
-
defaultConfigProfile:
|
|
16526
|
-
allowAmbientCredential:
|
|
16527
|
-
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(),
|
|
16528
16566
|
/** `false` removes the anchors; a list replaces them. */
|
|
16529
|
-
anchors:
|
|
16567
|
+
anchors: z27.union([z27.literal(false), z27.array(AnchorSchema).min(1)]).optional()
|
|
16530
16568
|
});
|
|
16531
16569
|
var ConfigIdentitySetOutputSchema = storedMutationOutput("identity", "updated", IdentityValueSchema);
|
|
16532
|
-
var ConfigIdentityRemoveInputSchema =
|
|
16570
|
+
var ConfigIdentityRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16533
16571
|
var ConfigIdentityRemoveOutputSchema = mutationOutput("identity", "removed");
|
|
16534
16572
|
var ConfigIdentityUseOutputSchema = mutationOutput("identity", "selected");
|
|
16535
|
-
var ConfigProfileAddInputSchema =
|
|
16536
|
-
name:
|
|
16537
|
-
extends:
|
|
16538
|
-
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()
|
|
16539
16577
|
});
|
|
16540
16578
|
var ConfigProfileAddOutputSchema = storedMutationOutput("profile", "created", ProfileValueSchema);
|
|
16541
|
-
var ConfigProfileSetInputSchema =
|
|
16542
|
-
name:
|
|
16543
|
-
category:
|
|
16544
|
-
entry:
|
|
16545
|
-
extends:
|
|
16546
|
-
description:
|
|
16547
|
-
launch:
|
|
16548
|
-
skipPermissions:
|
|
16549
|
-
remoteControl:
|
|
16550
|
-
headroom:
|
|
16551
|
-
trackUsage:
|
|
16552
|
-
provider:
|
|
16553
|
-
claudeVersion:
|
|
16554
|
-
delay:
|
|
16555
|
-
pause:
|
|
16556
|
-
explain:
|
|
16557
|
-
routeByName: z26.boolean().optional()
|
|
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()
|
|
16558
16595
|
}).optional()
|
|
16559
16596
|
});
|
|
16560
16597
|
var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
|
|
16561
|
-
var ConfigProfileRemoveInputSchema =
|
|
16598
|
+
var ConfigProfileRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16562
16599
|
var ConfigProfileRemoveOutputSchema = mutationOutput("profile", "removed");
|
|
16563
16600
|
var ConfigProfileUseOutputSchema = mutationOutput("profile", "selected");
|
|
16564
|
-
var PoolMembersInputSchema =
|
|
16565
|
-
var ConfigPoolAddInputSchema =
|
|
16566
|
-
name:
|
|
16601
|
+
var PoolMembersInputSchema = z27.array(z27.string().min(1)).min(1);
|
|
16602
|
+
var ConfigPoolAddInputSchema = z27.strictObject({
|
|
16603
|
+
name: z27.string().min(1),
|
|
16567
16604
|
identities: PoolMembersInputSchema,
|
|
16568
|
-
preference:
|
|
16569
|
-
resumeOnLimit:
|
|
16570
|
-
compactBeforeLimit:
|
|
16605
|
+
preference: z27.enum(POOL_PREFERENCES).optional(),
|
|
16606
|
+
resumeOnLimit: z27.boolean().optional(),
|
|
16607
|
+
compactBeforeLimit: z27.boolean().optional(),
|
|
16571
16608
|
compactAtUtilisation: CompactAtUtilisationSchema.optional()
|
|
16572
16609
|
});
|
|
16573
16610
|
var ConfigPoolAddOutputSchema = storedMutationOutput("pool", "created", PoolSchema);
|
|
16574
|
-
var ConfigPoolSetInputSchema =
|
|
16575
|
-
name:
|
|
16611
|
+
var ConfigPoolSetInputSchema = z27.strictObject({
|
|
16612
|
+
name: z27.string().min(1),
|
|
16576
16613
|
identities: PoolMembersInputSchema.optional(),
|
|
16577
|
-
preference:
|
|
16578
|
-
resumeOnLimit:
|
|
16579
|
-
compactBeforeLimit:
|
|
16580
|
-
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()
|
|
16581
16618
|
});
|
|
16582
16619
|
var ConfigPoolSetOutputSchema = storedMutationOutput("pool", "updated", PoolSchema);
|
|
16583
|
-
var ConfigPoolRemoveInputSchema =
|
|
16620
|
+
var ConfigPoolRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16584
16621
|
var ConfigPoolRemoveOutputSchema = mutationOutput("pool", "removed");
|
|
16585
16622
|
var ConfigPoolUseOutputSchema = mutationOutput("pool", "selected");
|
|
16586
|
-
var ConfigProviderAddInputSchema =
|
|
16587
|
-
name:
|
|
16588
|
-
kind:
|
|
16589
|
-
displayName:
|
|
16590
|
-
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(),
|
|
16591
16628
|
credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).required({ sources: true }),
|
|
16592
16629
|
codex: CodexProviderConfigSchema.optional()
|
|
16593
16630
|
});
|
|
16594
16631
|
var ConfigProviderAddOutputSchema = storedMutationOutput("provider", "created", ProviderValueSchema);
|
|
16595
|
-
var ConfigProviderSetInputSchema =
|
|
16596
|
-
name:
|
|
16597
|
-
displayName:
|
|
16598
|
-
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(),
|
|
16599
16636
|
credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).optional(),
|
|
16600
16637
|
codex: CodexProviderConfigSchema.optional()
|
|
16601
16638
|
});
|
|
16602
16639
|
var ConfigProviderSetOutputSchema = storedMutationOutput("provider", "updated", ProviderValueSchema);
|
|
16603
|
-
var ConfigProviderRemoveInputSchema =
|
|
16640
|
+
var ConfigProviderRemoveInputSchema = z27.strictObject({ name: z27.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16604
16641
|
var ConfigProviderRemoveOutputSchema = mutationOutput("provider", "removed");
|
|
16605
|
-
var ConfigRuleAddInputSchema =
|
|
16606
|
-
path:
|
|
16607
|
-
configProfile:
|
|
16608
|
-
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()
|
|
16609
16646
|
});
|
|
16610
16647
|
var ConfigRuleAddOutputSchema = storedMutationOutput("rule", "created", DirectoryRuleSchema);
|
|
16611
|
-
var ConfigRuleSetInputSchema =
|
|
16612
|
-
path:
|
|
16613
|
-
configProfile:
|
|
16614
|
-
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()
|
|
16615
16652
|
});
|
|
16616
16653
|
var ConfigRuleSetOutputSchema = storedMutationOutput("rule", "updated", DirectoryRuleSchema);
|
|
16617
|
-
var ConfigRuleRemoveInputSchema =
|
|
16654
|
+
var ConfigRuleRemoveInputSchema = z27.strictObject({ path: z27.string().min(1), confirm: RemovalConfirmationSchema });
|
|
16618
16655
|
var ConfigRuleRemoveOutputSchema = mutationOutput("rule", "removed");
|
|
16619
16656
|
|
|
16620
16657
|
// src/frontdoor/configApi.ts
|
|
@@ -16766,8 +16803,7 @@ function createConfigApiRouter(deps) {
|
|
|
16766
16803
|
...launch?.claudeVersion === void 0 ? {} : { launchClaudeVersion: launch.claudeVersion },
|
|
16767
16804
|
...launch?.delay === void 0 ? {} : { launchDelay: launch.delay },
|
|
16768
16805
|
...launch?.pause === void 0 ? {} : { launchPause: launch.pause },
|
|
16769
|
-
...launch?.explain === void 0 ? {} : { launchExplain: launch.explain }
|
|
16770
|
-
...launch?.routeByName === void 0 ? {} : { launchRouteByName: launch.routeByName }
|
|
16806
|
+
...launch?.explain === void 0 ? {} : { launchExplain: launch.explain }
|
|
16771
16807
|
});
|
|
16772
16808
|
return { action: "updated", kind: "profile", name: input.name, value: profileValue(input.name, paths) };
|
|
16773
16809
|
})
|
|
@@ -16926,43 +16962,43 @@ import { openapi as openapi4 } from "@orpc/openapi";
|
|
|
16926
16962
|
import { eventIterator as eventIterator2, withEventMeta as withEventMeta2 } from "@orpc/server";
|
|
16927
16963
|
|
|
16928
16964
|
// src/frontdoor/eventSchemas.ts
|
|
16929
|
-
import { z as
|
|
16965
|
+
import { z as z28 } from "zod";
|
|
16930
16966
|
var DOOR_EVENT_SOURCE_RC = "rc";
|
|
16931
16967
|
var LAUNCH_EVENT_SOURCE = "launch";
|
|
16932
16968
|
var USAGE_EVENT_SOURCE = "usage";
|
|
16933
16969
|
var DOOR_HEALTH_EVENT_SOURCE = "door";
|
|
16934
16970
|
var QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
|
|
16935
|
-
var DoorEventSchema =
|
|
16936
|
-
source:
|
|
16971
|
+
var DoorEventSchema = z28.strictObject({
|
|
16972
|
+
source: z28.string().min(1),
|
|
16937
16973
|
/** A positive integer because the backbone's counters start at one and only ever increase. */
|
|
16938
|
-
sequence:
|
|
16939
|
-
payload:
|
|
16974
|
+
sequence: z28.number().int().positive(),
|
|
16975
|
+
payload: z28.unknown()
|
|
16940
16976
|
});
|
|
16941
|
-
var DoorEventSourceQuerySchema =
|
|
16942
|
-
sources:
|
|
16977
|
+
var DoorEventSourceQuerySchema = z28.strictObject({
|
|
16978
|
+
sources: z28.array(z28.string().min(1)).min(1).optional()
|
|
16943
16979
|
});
|
|
16944
|
-
var LaunchLifecycleEventSchema =
|
|
16945
|
-
kind:
|
|
16946
|
-
pid:
|
|
16947
|
-
startedAt:
|
|
16948
|
-
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()
|
|
16949
16985
|
});
|
|
16950
|
-
var DoorHealthEventSchema =
|
|
16951
|
-
|
|
16952
|
-
|
|
16953
|
-
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
|
|
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() })
|
|
16957
16993
|
]);
|
|
16958
|
-
var QuotaExpiringEventSchema =
|
|
16959
|
-
identity:
|
|
16960
|
-
provider:
|
|
16961
|
-
window:
|
|
16994
|
+
var QuotaExpiringEventSchema = z28.strictObject({
|
|
16995
|
+
identity: z28.string().min(1),
|
|
16996
|
+
provider: z28.string().min(1),
|
|
16997
|
+
window: z28.enum(["fiveHour", "sevenDay"]),
|
|
16962
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. */
|
|
16963
|
-
utilization:
|
|
16964
|
-
resetsAt:
|
|
16965
|
-
observedAt:
|
|
16999
|
+
utilization: z28.number().min(0).max(1),
|
|
17000
|
+
resetsAt: z28.iso.datetime(),
|
|
17001
|
+
observedAt: z28.number()
|
|
16966
17002
|
});
|
|
16967
17003
|
|
|
16968
17004
|
// src/frontdoor/eventsApi.ts
|
|
@@ -17046,56 +17082,55 @@ import { openapi as openapi6 } from "@orpc/openapi";
|
|
|
17046
17082
|
|
|
17047
17083
|
// src/frontdoor/launchSchemas.ts
|
|
17048
17084
|
import path33 from "node:path";
|
|
17049
|
-
import { z as
|
|
17085
|
+
import { z as z29 } from "zod";
|
|
17050
17086
|
init_claudeVersion();
|
|
17051
17087
|
init_identity();
|
|
17052
|
-
var LaunchResolveInputSchema =
|
|
17053
|
-
path:
|
|
17088
|
+
var LaunchResolveInputSchema = z29.strictObject({
|
|
17089
|
+
path: z29.string().min(1),
|
|
17054
17090
|
/** `@name`, launch flags, then the arguments for `claude`; empty for a bare launch. */
|
|
17055
|
-
argv:
|
|
17091
|
+
argv: z29.readonly(z29.array(z29.string())).optional(),
|
|
17056
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. */
|
|
17057
|
-
env:
|
|
17093
|
+
env: z29.record(z29.string(), z29.string()).optional()
|
|
17058
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" });
|
|
17059
|
-
var LaunchPoolDecisionSchema =
|
|
17060
|
-
name:
|
|
17061
|
-
reasons:
|
|
17062
|
-
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()
|
|
17063
17099
|
});
|
|
17064
|
-
var LaunchDecisionSchema =
|
|
17065
|
-
identity:
|
|
17066
|
-
identitySource:
|
|
17100
|
+
var LaunchDecisionSchema = z29.strictObject({
|
|
17101
|
+
identity: z29.string().optional(),
|
|
17102
|
+
identitySource: z29.enum(IDENTITY_DECISION_SOURCES),
|
|
17067
17103
|
pool: LaunchPoolDecisionSchema.optional(),
|
|
17068
|
-
configDirEscapeHatch:
|
|
17069
|
-
configDir:
|
|
17070
|
-
configProfile:
|
|
17071
|
-
configProfileSource:
|
|
17072
|
-
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()
|
|
17073
17109
|
});
|
|
17074
|
-
var LaunchFlagsSchema =
|
|
17075
|
-
skipPermissions:
|
|
17076
|
-
remoteControl:
|
|
17077
|
-
headroom:
|
|
17078
|
-
trackUsage:
|
|
17079
|
-
pause:
|
|
17080
|
-
explain:
|
|
17081
|
-
routeByName: z28.boolean(),
|
|
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(),
|
|
17082
17117
|
/** How long the launch waits after its own output before it starts claude, in milliseconds. */
|
|
17083
|
-
delayMs:
|
|
17118
|
+
delayMs: z29.number()
|
|
17084
17119
|
});
|
|
17085
|
-
var LaunchResolveOutputSchema =
|
|
17120
|
+
var LaunchResolveOutputSchema = z29.strictObject({
|
|
17086
17121
|
decision: LaunchDecisionSchema,
|
|
17087
17122
|
flags: LaunchFlagsSchema,
|
|
17088
|
-
claudeVersion:
|
|
17123
|
+
claudeVersion: z29.strictObject({ version: z29.string(), source: z29.enum(CLAUDE_VERSION_SOURCES) }).optional(),
|
|
17089
17124
|
/** The real `claude` binary the launch would spawn, on the door's host. */
|
|
17090
|
-
bin:
|
|
17125
|
+
bin: z29.string(),
|
|
17091
17126
|
/** The arguments the launch would pass it: the tool's own flags, then `CLAUDE_EXTRA_FLAGS`, then the caller's own. */
|
|
17092
|
-
args:
|
|
17127
|
+
args: z29.readonly(z29.array(z29.string())),
|
|
17093
17128
|
/** The credential the launch would authenticate with, by target and source kinds. Absent when none applies. */
|
|
17094
|
-
credential:
|
|
17095
|
-
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() }),
|
|
17096
17131
|
/** The names of the environment variables the launch would set or unset, sorted. Values are not reported. */
|
|
17097
|
-
environment:
|
|
17098
|
-
warnings:
|
|
17132
|
+
environment: z29.readonly(z29.array(z29.string())),
|
|
17133
|
+
warnings: z29.readonly(z29.array(z29.string()))
|
|
17099
17134
|
});
|
|
17100
17135
|
|
|
17101
17136
|
// src/frontdoor/launchApi.ts
|
|
@@ -17131,22 +17166,22 @@ function createLaunchApiRouter(deps) {
|
|
|
17131
17166
|
// src/frontdoor/agentTreesApi.ts
|
|
17132
17167
|
import { ORPCError as ORPCError6 } from "@orpc/client";
|
|
17133
17168
|
import { openapi as openapi7 } from "@orpc/openapi";
|
|
17134
|
-
import { z as
|
|
17169
|
+
import { z as z30 } from "zod";
|
|
17135
17170
|
init_cliError();
|
|
17136
|
-
var AgentTreesListInputSchema =
|
|
17171
|
+
var AgentTreesListInputSchema = z30.strictObject({
|
|
17137
17172
|
/** Only this identity's sessions. */
|
|
17138
|
-
identity:
|
|
17173
|
+
identity: z30.string().optional(),
|
|
17139
17174
|
/** Include sessions that spawned no agent and ran no workflow. */
|
|
17140
|
-
all:
|
|
17175
|
+
all: z30.boolean().optional()
|
|
17141
17176
|
});
|
|
17142
|
-
var AgentTreesListOutputSchema =
|
|
17143
|
-
var AgentTreesShowInputSchema =
|
|
17177
|
+
var AgentTreesListOutputSchema = z30.array(SessionSummarySchema);
|
|
17178
|
+
var AgentTreesShowInputSchema = z30.strictObject({
|
|
17144
17179
|
/** A session id, or an unambiguous prefix of one. */
|
|
17145
|
-
session:
|
|
17180
|
+
session: z30.string().min(1),
|
|
17146
17181
|
/** Look only in this identity. */
|
|
17147
|
-
identity:
|
|
17182
|
+
identity: z30.string().optional()
|
|
17148
17183
|
});
|
|
17149
|
-
var AgentTreesShowOutputSchema =
|
|
17184
|
+
var AgentTreesShowOutputSchema = z30.strictObject({ identities: z30.array(z30.string()), ...MergedAgentTreeSchema.shape });
|
|
17150
17185
|
function asBadRequest(error) {
|
|
17151
17186
|
if (error instanceof CliError) {
|
|
17152
17187
|
throw new ORPCError6("BAD_REQUEST", { message: error.message });
|
|
@@ -19329,7 +19364,7 @@ init_poolPick();
|
|
|
19329
19364
|
|
|
19330
19365
|
// src/agents/read.ts
|
|
19331
19366
|
import path35 from "node:path";
|
|
19332
|
-
import { z as
|
|
19367
|
+
import { z as z31 } from "zod";
|
|
19333
19368
|
var PROJECTS_DIR = "projects";
|
|
19334
19369
|
var TASKS_DIR = "tasks";
|
|
19335
19370
|
var SUBAGENTS_DIR = "subagents";
|
|
@@ -19448,14 +19483,14 @@ function parseJson2(text) {
|
|
|
19448
19483
|
return void 0;
|
|
19449
19484
|
}
|
|
19450
19485
|
}
|
|
19451
|
-
var TaskFileSchema =
|
|
19452
|
-
var WorkflowRunFileSchema =
|
|
19453
|
-
runId:
|
|
19454
|
-
workflowName:
|
|
19455
|
-
status:
|
|
19456
|
-
startTime:
|
|
19457
|
-
phases:
|
|
19458
|
-
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()
|
|
19459
19494
|
});
|
|
19460
19495
|
function summariseSession(fs13, configDir, ref) {
|
|
19461
19496
|
const sessionRelative = path35.join(PROJECTS_DIR, ref.project, ref.entry);
|