claude-use 9.8.0 → 9.9.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/dist/cli.cjs +1 -1
- package/dist/index.cjs +780 -524
- package/dist/index.mjs +767 -521
- package/dist/types/index.d.ts +137 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -607,9 +607,9 @@ function applyPatch(filePath, schema, patch, options = {}) {
|
|
|
607
607
|
if (!result.success) {
|
|
608
608
|
throw new ConfigValidationError(filePath, result.error.issues);
|
|
609
609
|
}
|
|
610
|
-
const
|
|
611
|
-
writeJsonAtomic(filePath,
|
|
612
|
-
return
|
|
610
|
+
const validated3 = result.data;
|
|
611
|
+
writeJsonAtomic(filePath, validated3, storeFs);
|
|
612
|
+
return validated3;
|
|
613
613
|
}
|
|
614
614
|
var nodeStoreFs;
|
|
615
615
|
var init_store = __esm({
|
|
@@ -2639,7 +2639,7 @@ var init_package = __esm({
|
|
|
2639
2639
|
"package.json"() {
|
|
2640
2640
|
package_default = {
|
|
2641
2641
|
name: "claude-use",
|
|
2642
|
-
version: "9.
|
|
2642
|
+
version: "9.9.0",
|
|
2643
2643
|
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.",
|
|
2644
2644
|
license: "MIT",
|
|
2645
2645
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -2745,7 +2745,7 @@ var init_package = __esm({
|
|
|
2745
2745
|
// src/headroom/state.ts
|
|
2746
2746
|
import { createHash as createHash3 } from "node:crypto";
|
|
2747
2747
|
import path11 from "node:path";
|
|
2748
|
-
import { z as
|
|
2748
|
+
import { z as z6 } from "zod";
|
|
2749
2749
|
function parseJson(raw, schema) {
|
|
2750
2750
|
if (raw === void 0 || raw.trim() === "") {
|
|
2751
2751
|
return void 0;
|
|
@@ -2876,28 +2876,28 @@ var init_state2 = __esm({
|
|
|
2876
2876
|
"use strict";
|
|
2877
2877
|
init_schema();
|
|
2878
2878
|
HEADROOM_ANTHROPIC_UPSTREAM = "https://api.anthropic.com";
|
|
2879
|
-
HeadroomStateSchema =
|
|
2879
|
+
HeadroomStateSchema = z6.strictObject({
|
|
2880
2880
|
/** The supervisor process owning the daemon. Alive means someone is keeping headroom running. */
|
|
2881
|
-
supervisorPid:
|
|
2881
|
+
supervisorPid: z6.number().int().positive().optional(),
|
|
2882
2882
|
/** The headroom proxy process itself. Absent while the supervisor is between restarts. */
|
|
2883
|
-
headroomPid:
|
|
2883
|
+
headroomPid: z6.number().int().positive().optional(),
|
|
2884
2884
|
/**
|
|
2885
2885
|
* The unix socket the proxy serves on, inside the owner-only socket directory. Absent until the proxy has passed its readiness check, so "socketPath is set" is itself the ready signal a launcher polls for. The front door reads it on every hop, so a restart (which keeps the generation's path) is followed without anything being relaunched.
|
|
2886
2886
|
*/
|
|
2887
|
-
socketPath:
|
|
2887
|
+
socketPath: z6.string().min(1).optional(),
|
|
2888
2888
|
/** The `headroom --version` output of the running install. */
|
|
2889
|
-
version:
|
|
2889
|
+
version: z6.string().optional(),
|
|
2890
2890
|
/** Hash of the allowlist the running proxy was started with, so a provider-file change is detected as drift. */
|
|
2891
|
-
allowlistHash:
|
|
2891
|
+
allowlistHash: z6.string().optional(),
|
|
2892
2892
|
/** Hash of the token-saving settings the running proxy was started with, so a settings change is detected as drift. */
|
|
2893
|
-
settingsHash:
|
|
2893
|
+
settingsHash: z6.string().optional(),
|
|
2894
2894
|
/** The install spec the running install was last installed from, so a `source` config change is detected as drift. */
|
|
2895
|
-
installedSource:
|
|
2895
|
+
installedSource: z6.string().optional(),
|
|
2896
2896
|
/** The last fatal error, kept across shutdowns so `headroom status` can explain a daemon that is not running. */
|
|
2897
|
-
lastError:
|
|
2897
|
+
lastError: z6.string().optional()
|
|
2898
2898
|
});
|
|
2899
|
-
HeadroomSessionSchema =
|
|
2900
|
-
HeadroomLockSchema =
|
|
2899
|
+
HeadroomSessionSchema = z6.strictObject({ pid: z6.number().int().positive(), startedAt: z6.number(), supervisorPid: z6.number().int().positive() });
|
|
2900
|
+
HeadroomLockSchema = z6.strictObject({ pid: z6.number().int().positive(), at: z6.number() });
|
|
2901
2901
|
}
|
|
2902
2902
|
});
|
|
2903
2903
|
|
|
@@ -3091,7 +3091,7 @@ var init_socket = __esm({
|
|
|
3091
3091
|
});
|
|
3092
3092
|
|
|
3093
3093
|
// src/headroom/source.ts
|
|
3094
|
-
import { z as
|
|
3094
|
+
import { z as z7 } from "zod";
|
|
3095
3095
|
function isMovingGitSource(spec) {
|
|
3096
3096
|
const match = GIT_SPEC_RE.exec(spec);
|
|
3097
3097
|
if (match === null) {
|
|
@@ -3110,7 +3110,7 @@ var init_source = __esm({
|
|
|
3110
3110
|
"use strict";
|
|
3111
3111
|
GIT_SPEC_RE = /git\+[^@\s]+(?:@([^\s#]+))?/;
|
|
3112
3112
|
COMMIT_SHA_RE = /^[0-9a-f]{40}$/i;
|
|
3113
|
-
DirectUrlSchema =
|
|
3113
|
+
DirectUrlSchema = z7.object({ vcs_info: z7.object({ commit_id: z7.string() }) });
|
|
3114
3114
|
}
|
|
3115
3115
|
});
|
|
3116
3116
|
|
|
@@ -3378,7 +3378,7 @@ var init_supervisor = __esm({
|
|
|
3378
3378
|
});
|
|
3379
3379
|
|
|
3380
3380
|
// src/realPorts.ts
|
|
3381
|
-
import { spawn, spawnSync } from "node:child_process";
|
|
3381
|
+
import { spawn as spawn2, spawnSync } from "node:child_process";
|
|
3382
3382
|
import { createHash as createHash5 } from "node:crypto";
|
|
3383
3383
|
import fs3 from "node:fs";
|
|
3384
3384
|
import os3 from "node:os";
|
|
@@ -3456,7 +3456,7 @@ function spawnDetachedDaemon(invocation, paths, subcommand, logPath) {
|
|
|
3456
3456
|
fs3.mkdirSync(path13.dirname(logPath), { recursive: true });
|
|
3457
3457
|
const logFd = fs3.openSync(logPath, "a");
|
|
3458
3458
|
try {
|
|
3459
|
-
const child =
|
|
3459
|
+
const child = spawn2(invocation.command, invocation.args, detachedDaemonSpawnOptions(logFd, { ...process.env, AGENT_SHIM_HOME: paths.root }));
|
|
3460
3460
|
child.unref();
|
|
3461
3461
|
if (child.pid === void 0) {
|
|
3462
3462
|
throw new Error(`spawning ${subcommand} returned no pid`);
|
|
@@ -4014,149 +4014,149 @@ var init_identity = __esm({
|
|
|
4014
4014
|
});
|
|
4015
4015
|
|
|
4016
4016
|
// src/usage/schema.ts
|
|
4017
|
-
import { z as
|
|
4017
|
+
import { z as z8 } from "zod";
|
|
4018
4018
|
var USAGE_SCHEMA_VERSION, VersionSchema, InstantSchema, TokenCountSchema, TokenUsageSchema, LIMIT_KINDS, LimitClassificationSchema, UsageRecordSchema, QuotaWindowSchema, ExtraUsageSpendSchema, UnifiedRateLimitSchema, RateLimitStateSchema, LimitEventSchema, ProviderQuotaWindowSchema, ProviderQuotaSchema, ProviderUsageStateSchema, AccountMetadataSchema, UsageSnapshotSchema;
|
|
4019
4019
|
var init_schema2 = __esm({
|
|
4020
4020
|
"src/usage/schema.ts"() {
|
|
4021
4021
|
"use strict";
|
|
4022
4022
|
USAGE_SCHEMA_VERSION = 1;
|
|
4023
|
-
VersionSchema =
|
|
4024
|
-
InstantSchema =
|
|
4025
|
-
TokenCountSchema =
|
|
4026
|
-
TokenUsageSchema =
|
|
4023
|
+
VersionSchema = z8.literal(USAGE_SCHEMA_VERSION);
|
|
4024
|
+
InstantSchema = z8.iso.datetime();
|
|
4025
|
+
TokenCountSchema = z8.number().int().nonnegative();
|
|
4026
|
+
TokenUsageSchema = z8.strictObject({
|
|
4027
4027
|
inputTokens: TokenCountSchema.optional(),
|
|
4028
4028
|
outputTokens: TokenCountSchema.optional(),
|
|
4029
4029
|
cacheCreationInputTokens: TokenCountSchema.optional(),
|
|
4030
4030
|
cacheReadInputTokens: TokenCountSchema.optional()
|
|
4031
4031
|
});
|
|
4032
4032
|
LIMIT_KINDS = ["rate-limited", "quota-exhausted"];
|
|
4033
|
-
LimitClassificationSchema =
|
|
4034
|
-
kind:
|
|
4033
|
+
LimitClassificationSchema = z8.strictObject({
|
|
4034
|
+
kind: z8.enum(LIMIT_KINDS),
|
|
4035
4035
|
/** Seconds to wait before retrying, from the response's `retry-after`. */
|
|
4036
|
-
retryAfterSeconds:
|
|
4036
|
+
retryAfterSeconds: z8.number().nonnegative().optional(),
|
|
4037
4037
|
/** When the limiting window resets, from the upstream's own reset header. */
|
|
4038
4038
|
resetAt: InstantSchema.optional(),
|
|
4039
4039
|
/** The window the upstream named as the binding one (`anthropic-ratelimit-unified-representative-claim`), such as `five_hour` or `seven_day`. */
|
|
4040
|
-
window:
|
|
4040
|
+
window: z8.string().optional(),
|
|
4041
4041
|
/** The signals the classification rests on, each `<name>=<value>` from a response header or the error body's `type` or `code`. Never the error message. */
|
|
4042
|
-
evidence:
|
|
4042
|
+
evidence: z8.array(z8.string())
|
|
4043
4043
|
});
|
|
4044
|
-
UsageRecordSchema =
|
|
4044
|
+
UsageRecordSchema = z8.strictObject({
|
|
4045
4045
|
schemaVersion: VersionSchema,
|
|
4046
4046
|
/** When the front door received the request. */
|
|
4047
4047
|
at: InstantSchema,
|
|
4048
4048
|
/** The launching identity, when the launch resolved one. */
|
|
4049
|
-
identity:
|
|
4049
|
+
identity: z8.string().optional(),
|
|
4050
4050
|
/** `anthropic` for an OAuth session's request to Claude Code's own API, otherwise the provider's name. */
|
|
4051
|
-
provider:
|
|
4051
|
+
provider: z8.string(),
|
|
4052
4052
|
/** The launch's session id, generated per launch. */
|
|
4053
|
-
sessionId:
|
|
4053
|
+
sessionId: z8.string().optional(),
|
|
4054
4054
|
/** The project the launch ran in (its git repository root), when the launch sent one: headroom launches do. */
|
|
4055
|
-
project:
|
|
4055
|
+
project: z8.string().optional(),
|
|
4056
4056
|
/** The front-door route that served the request. */
|
|
4057
|
-
route:
|
|
4058
|
-
method:
|
|
4057
|
+
route: z8.string(),
|
|
4058
|
+
method: z8.string(),
|
|
4059
4059
|
/** The API path as the upstream sees it (`/v1/messages`), without the provider prefix or a query string. */
|
|
4060
|
-
endpoint:
|
|
4060
|
+
endpoint: z8.string(),
|
|
4061
4061
|
/** The model the response named. */
|
|
4062
|
-
model:
|
|
4063
|
-
status:
|
|
4062
|
+
model: z8.string().optional(),
|
|
4063
|
+
status: z8.number().int(),
|
|
4064
4064
|
/** Milliseconds from the request's arrival to its response head. */
|
|
4065
|
-
latencyMs:
|
|
4065
|
+
latencyMs: z8.number().int().nonnegative(),
|
|
4066
4066
|
/** Milliseconds from the request's arrival to the end of its response body. */
|
|
4067
|
-
durationMs:
|
|
4067
|
+
durationMs: z8.number().int().nonnegative(),
|
|
4068
4068
|
/** Whether the client received the whole body. */
|
|
4069
|
-
outcome:
|
|
4069
|
+
outcome: z8.enum(["completed", "aborted"]),
|
|
4070
4070
|
usage: TokenUsageSchema.optional(),
|
|
4071
4071
|
/** The response's quota and rate-limit headers, by name (see `isRateLimitHeader`). */
|
|
4072
|
-
rateLimitHeaders:
|
|
4072
|
+
rateLimitHeaders: z8.record(z8.string(), z8.string()).optional(),
|
|
4073
4073
|
limit: LimitClassificationSchema.optional(),
|
|
4074
4074
|
/** The upstream's request id (`request-id`), for matching a record to the provider's own logs. */
|
|
4075
|
-
requestId:
|
|
4075
|
+
requestId: z8.string().optional()
|
|
4076
4076
|
});
|
|
4077
|
-
QuotaWindowSchema =
|
|
4077
|
+
QuotaWindowSchema = z8.strictObject({
|
|
4078
4078
|
/** The fraction of the window used, as the upstream reports it (0 to 1). */
|
|
4079
|
-
utilization:
|
|
4079
|
+
utilization: z8.number().nonnegative().optional(),
|
|
4080
4080
|
resetsAt: InstantSchema.optional(),
|
|
4081
4081
|
/** The window's own status (`allowed`, `allowed_warning`, `rejected`). */
|
|
4082
|
-
status:
|
|
4082
|
+
status: z8.string().optional(),
|
|
4083
4083
|
/** The fraction of the window's grace allowance used, while the upstream reports the window in grace (the five-hour window only). Requests are served beyond the window's own full mark while it grows, but refusals have been seen at a small value, so nothing ranks on it. */
|
|
4084
|
-
graceUtilization:
|
|
4084
|
+
graceUtilization: z8.number().nonnegative().optional()
|
|
4085
4085
|
});
|
|
4086
|
-
ExtraUsageSpendSchema =
|
|
4086
|
+
ExtraUsageSpendSchema = z8.strictObject({
|
|
4087
4087
|
/** Spent so far in the allowance's period, in the currency's minor units (pence, cents). */
|
|
4088
|
-
usedMinor:
|
|
4088
|
+
usedMinor: z8.number().nonnegative(),
|
|
4089
4089
|
/** The allowance's cap in the same units, when it has one. */
|
|
4090
|
-
limitMinor:
|
|
4090
|
+
limitMinor: z8.number().nonnegative().optional(),
|
|
4091
4091
|
/** The ISO 4217 currency code. */
|
|
4092
|
-
currency:
|
|
4092
|
+
currency: z8.string()
|
|
4093
4093
|
});
|
|
4094
|
-
UnifiedRateLimitSchema =
|
|
4094
|
+
UnifiedRateLimitSchema = z8.strictObject({
|
|
4095
4095
|
/** The overall status: `allowed`, `allowed_warning` or `rejected`. */
|
|
4096
|
-
status:
|
|
4096
|
+
status: z8.string().optional(),
|
|
4097
4097
|
fiveHour: QuotaWindowSchema.optional(),
|
|
4098
4098
|
sevenDay: QuotaWindowSchema.optional(),
|
|
4099
4099
|
/** The weekly window of the models whose usage may continue as extra usage (`7d_oi`), reported by some plans beside the all-models weekly window. */
|
|
4100
4100
|
sevenDayOverageIncluded: QuotaWindowSchema.optional(),
|
|
4101
4101
|
/** The window that currently binds. */
|
|
4102
|
-
representativeClaim:
|
|
4102
|
+
representativeClaim: z8.string().optional(),
|
|
4103
4103
|
/** When the binding window resets. */
|
|
4104
4104
|
resetAt: InstantSchema.optional(),
|
|
4105
4105
|
/** Whether usage beyond the plan (extra usage) is available: `allowed` or `rejected`. */
|
|
4106
|
-
overageStatus:
|
|
4106
|
+
overageStatus: z8.string().optional(),
|
|
4107
4107
|
/** The fraction of the extra-usage allowance used, as the upstream reports it (0 to 1). An account with no plan windows, such as an Enterprise one, is metered by this alone. */
|
|
4108
|
-
overageUtilization:
|
|
4108
|
+
overageUtilization: z8.number().nonnegative().optional(),
|
|
4109
4109
|
/** When the extra-usage allowance resets. */
|
|
4110
4110
|
overageResetsAt: InstantSchema.optional(),
|
|
4111
4111
|
/** Why extra usage is unavailable, as the upstream names it (`out_of_credits`, for one). */
|
|
4112
|
-
overageDisabledReason:
|
|
4112
|
+
overageDisabledReason: z8.string().optional(),
|
|
4113
4113
|
/** Whether the response was served on extra usage, as the upstream states it. */
|
|
4114
|
-
overageInUse:
|
|
4114
|
+
overageInUse: z8.boolean().optional(),
|
|
4115
4115
|
/** The allowance in money, from the usage endpoint (the response headers state only the fraction). */
|
|
4116
4116
|
extraUsageSpend: ExtraUsageSpendSchema.optional(),
|
|
4117
4117
|
/** True when the upstream offers a fallback while a window is rejected: some requests, by model, are still served, though the rest are refused. */
|
|
4118
|
-
fallbackAvailable:
|
|
4118
|
+
fallbackAvailable: z8.boolean().optional()
|
|
4119
4119
|
});
|
|
4120
|
-
RateLimitStateSchema =
|
|
4120
|
+
RateLimitStateSchema = z8.strictObject({
|
|
4121
4121
|
observedAt: InstantSchema,
|
|
4122
4122
|
/** Every quota and rate-limit header on that response, by name. */
|
|
4123
|
-
headers:
|
|
4123
|
+
headers: z8.record(z8.string(), z8.string()),
|
|
4124
4124
|
unified: UnifiedRateLimitSchema.optional(),
|
|
4125
4125
|
/** When the usage endpoint last answered that it has no plan windows for the account, which a later response replaces. Its answer leaves the recorded `unified` state alone (a response's headers may be the only source of it), so this alone says the question was asked. */
|
|
4126
4126
|
planWindowsUnavailableAt: InstantSchema.optional()
|
|
4127
4127
|
});
|
|
4128
4128
|
LimitEventSchema = LimitClassificationSchema.extend({
|
|
4129
4129
|
observedAt: InstantSchema,
|
|
4130
|
-
status:
|
|
4130
|
+
status: z8.number().int()
|
|
4131
4131
|
});
|
|
4132
|
-
ProviderQuotaWindowSchema =
|
|
4132
|
+
ProviderQuotaWindowSchema = z8.strictObject({
|
|
4133
4133
|
/** What the window measures, in the provider's terms (`tokens`, `tool-calls`). */
|
|
4134
|
-
measures:
|
|
4134
|
+
measures: z8.string(),
|
|
4135
4135
|
/** The window's length in milliseconds, when the provider's unit is one this project knows; absent for an unrecognised unit, with `period` carrying the raw code. */
|
|
4136
|
-
periodMs:
|
|
4136
|
+
periodMs: z8.number().int().positive().optional(),
|
|
4137
4137
|
/** The provider's own description of the period when `periodMs` could not be derived, such as `unit 4 x 1`. */
|
|
4138
|
-
period:
|
|
4138
|
+
period: z8.string().optional(),
|
|
4139
4139
|
/** The fraction of the window used (0 to 1). */
|
|
4140
|
-
utilization:
|
|
4140
|
+
utilization: z8.number().nonnegative(),
|
|
4141
4141
|
resetsAt: InstantSchema.optional(),
|
|
4142
4142
|
/** Absolute counts, when the provider reports them for this window. */
|
|
4143
|
-
limit:
|
|
4144
|
-
used:
|
|
4145
|
-
remaining:
|
|
4143
|
+
limit: z8.number().nonnegative().optional(),
|
|
4144
|
+
used: z8.number().nonnegative().optional(),
|
|
4145
|
+
remaining: z8.number().nonnegative().optional()
|
|
4146
4146
|
});
|
|
4147
|
-
ProviderQuotaSchema =
|
|
4147
|
+
ProviderQuotaSchema = z8.strictObject({
|
|
4148
4148
|
observedAt: InstantSchema,
|
|
4149
4149
|
/** Which usage endpoint produced it (`z.ai`). */
|
|
4150
|
-
source:
|
|
4150
|
+
source: z8.string(),
|
|
4151
4151
|
/** The subscription level the endpoint reports, when it does. */
|
|
4152
|
-
level:
|
|
4153
|
-
windows:
|
|
4152
|
+
level: z8.string().optional(),
|
|
4153
|
+
windows: z8.array(ProviderQuotaWindowSchema)
|
|
4154
4154
|
});
|
|
4155
|
-
ProviderUsageStateSchema =
|
|
4155
|
+
ProviderUsageStateSchema = z8.strictObject({
|
|
4156
4156
|
/** When the provider last served a request for the identity through the front door. Absent while the state holds only a rate-limit state fetched from the provider's usage endpoint, for an identity that has made no request. */
|
|
4157
4157
|
lastRequestAt: InstantSchema.optional(),
|
|
4158
|
-
lastStatus:
|
|
4159
|
-
lastModel:
|
|
4158
|
+
lastStatus: z8.number().int().optional(),
|
|
4159
|
+
lastModel: z8.string().optional(),
|
|
4160
4160
|
/** The latest rate-limit state, from the last response that carried any rate-limit header. */
|
|
4161
4161
|
rateLimit: RateLimitStateSchema.optional(),
|
|
4162
4162
|
/** The latest classified refusal. It stays after later successes, so a reader compares its `resetAt` (or `observedAt` plus `retryAfterSeconds`) with the current time. */
|
|
@@ -4164,31 +4164,31 @@ var init_schema2 = __esm({
|
|
|
4164
4164
|
/** The latest quota the provider's usage endpoint reported, for providers whose quota is not visible in response headers. */
|
|
4165
4165
|
quota: ProviderQuotaSchema.optional()
|
|
4166
4166
|
});
|
|
4167
|
-
AccountMetadataSchema =
|
|
4168
|
-
accountUuid:
|
|
4169
|
-
emailAddress:
|
|
4170
|
-
displayName:
|
|
4171
|
-
organizationUuid:
|
|
4172
|
-
organizationName:
|
|
4173
|
-
organizationType:
|
|
4174
|
-
organizationRole:
|
|
4175
|
-
workspaceRole:
|
|
4176
|
-
billingType:
|
|
4177
|
-
seatTier:
|
|
4178
|
-
organizationRateLimitTier:
|
|
4179
|
-
userRateLimitTier:
|
|
4180
|
-
hasExtraUsageEnabled:
|
|
4181
|
-
subscriptionCreatedAt:
|
|
4182
|
-
accountCreatedAt:
|
|
4167
|
+
AccountMetadataSchema = z8.strictObject({
|
|
4168
|
+
accountUuid: z8.string().optional(),
|
|
4169
|
+
emailAddress: z8.string().optional(),
|
|
4170
|
+
displayName: z8.string().optional(),
|
|
4171
|
+
organizationUuid: z8.string().optional(),
|
|
4172
|
+
organizationName: z8.string().optional(),
|
|
4173
|
+
organizationType: z8.string().optional(),
|
|
4174
|
+
organizationRole: z8.string().optional(),
|
|
4175
|
+
workspaceRole: z8.string().optional(),
|
|
4176
|
+
billingType: z8.string().optional(),
|
|
4177
|
+
seatTier: z8.string().optional(),
|
|
4178
|
+
organizationRateLimitTier: z8.string().optional(),
|
|
4179
|
+
userRateLimitTier: z8.string().optional(),
|
|
4180
|
+
hasExtraUsageEnabled: z8.boolean().optional(),
|
|
4181
|
+
subscriptionCreatedAt: z8.string().optional(),
|
|
4182
|
+
accountCreatedAt: z8.string().optional()
|
|
4183
4183
|
});
|
|
4184
|
-
UsageSnapshotSchema =
|
|
4184
|
+
UsageSnapshotSchema = z8.strictObject({
|
|
4185
4185
|
schemaVersion: VersionSchema,
|
|
4186
|
-
identity:
|
|
4186
|
+
identity: z8.string(),
|
|
4187
4187
|
updatedAt: InstantSchema,
|
|
4188
4188
|
/** The identity's account metadata as of `updatedAt`. */
|
|
4189
4189
|
account: AccountMetadataSchema.optional(),
|
|
4190
4190
|
/** Latest state per provider, keyed by provider name (`anthropic` for OAuth sessions). */
|
|
4191
|
-
providers:
|
|
4191
|
+
providers: z8.record(z8.string(), ProviderUsageStateSchema)
|
|
4192
4192
|
});
|
|
4193
4193
|
}
|
|
4194
4194
|
});
|
|
@@ -4276,7 +4276,7 @@ var init_account = __esm({
|
|
|
4276
4276
|
});
|
|
4277
4277
|
|
|
4278
4278
|
// src/usage/plan.ts
|
|
4279
|
-
import { z as
|
|
4279
|
+
import { z as z9 } from "zod";
|
|
4280
4280
|
function planOf(account) {
|
|
4281
4281
|
const userTier = account?.userRateLimitTier;
|
|
4282
4282
|
if (userTier !== void 0 && ZERO_TIER.test(userTier)) {
|
|
@@ -4300,19 +4300,19 @@ var PlanClassSchema, TIER_MULTIPLIER, ZERO_TIER, BASE_TIER;
|
|
|
4300
4300
|
var init_plan2 = __esm({
|
|
4301
4301
|
"src/usage/plan.ts"() {
|
|
4302
4302
|
"use strict";
|
|
4303
|
-
PlanClassSchema =
|
|
4304
|
-
|
|
4305
|
-
kind:
|
|
4303
|
+
PlanClassSchema = z9.union([
|
|
4304
|
+
z9.strictObject({
|
|
4305
|
+
kind: z9.literal("subscription"),
|
|
4306
4306
|
/** The plan's size as a multiple of the smallest subscription tier (Max 5x is 5, Max 20x is 20). */
|
|
4307
|
-
capacity:
|
|
4307
|
+
capacity: z9.number().positive(),
|
|
4308
4308
|
/** False when the tier string named no multiplier and no tier this project knows, so `capacity` is the neutral 1 rather than a reading. */
|
|
4309
|
-
recognised:
|
|
4309
|
+
recognised: z9.boolean(),
|
|
4310
4310
|
/** The tier string the classification rests on, when the account had one. */
|
|
4311
|
-
tier:
|
|
4311
|
+
tier: z9.string().optional()
|
|
4312
4312
|
}),
|
|
4313
|
-
|
|
4314
|
-
kind:
|
|
4315
|
-
tier:
|
|
4313
|
+
z9.strictObject({
|
|
4314
|
+
kind: z9.literal("pay-per-use"),
|
|
4315
|
+
tier: z9.string().optional()
|
|
4316
4316
|
})
|
|
4317
4317
|
]);
|
|
4318
4318
|
TIER_MULTIPLIER = /(?:^|_)(\d+)x$/;
|
|
@@ -4413,21 +4413,21 @@ var init_rateLimit = __esm({
|
|
|
4413
4413
|
});
|
|
4414
4414
|
|
|
4415
4415
|
// src/usage/scan.ts
|
|
4416
|
-
import { z as
|
|
4416
|
+
import { z as z10 } from "zod";
|
|
4417
4417
|
var AnthropicUsageSchema, ErrorObjectSchema;
|
|
4418
4418
|
var init_scan = __esm({
|
|
4419
4419
|
"src/usage/scan.ts"() {
|
|
4420
4420
|
"use strict";
|
|
4421
|
-
AnthropicUsageSchema =
|
|
4422
|
-
input_tokens:
|
|
4423
|
-
output_tokens:
|
|
4424
|
-
cache_creation_input_tokens:
|
|
4425
|
-
cache_read_input_tokens:
|
|
4421
|
+
AnthropicUsageSchema = z10.looseObject({
|
|
4422
|
+
input_tokens: z10.number().int().nonnegative().nullish(),
|
|
4423
|
+
output_tokens: z10.number().int().nonnegative().nullish(),
|
|
4424
|
+
cache_creation_input_tokens: z10.number().int().nonnegative().nullish(),
|
|
4425
|
+
cache_read_input_tokens: z10.number().int().nonnegative().nullish()
|
|
4426
4426
|
});
|
|
4427
|
-
ErrorObjectSchema =
|
|
4428
|
-
type:
|
|
4429
|
-
code:
|
|
4430
|
-
message:
|
|
4427
|
+
ErrorObjectSchema = z10.looseObject({
|
|
4428
|
+
type: z10.string().optional(),
|
|
4429
|
+
code: z10.union([z10.string(), z10.number()]).optional(),
|
|
4430
|
+
message: z10.string().optional()
|
|
4431
4431
|
});
|
|
4432
4432
|
}
|
|
4433
4433
|
});
|
|
@@ -5001,7 +5001,7 @@ var init_store2 = __esm({
|
|
|
5001
5001
|
|
|
5002
5002
|
// src/usage/poolPick.ts
|
|
5003
5003
|
import path20 from "node:path";
|
|
5004
|
-
import { z as
|
|
5004
|
+
import { z as z11 } from "zod";
|
|
5005
5005
|
function errorMessage(error) {
|
|
5006
5006
|
return error instanceof Error ? error.message : String(error);
|
|
5007
5007
|
}
|
|
@@ -5151,10 +5151,10 @@ var init_poolPick = __esm({
|
|
|
5151
5151
|
}
|
|
5152
5152
|
};
|
|
5153
5153
|
SCHEMA_VERSION = 1;
|
|
5154
|
-
PickEntrySchema =
|
|
5155
|
-
PicksFileSchema =
|
|
5156
|
-
schemaVersion:
|
|
5157
|
-
picks:
|
|
5154
|
+
PickEntrySchema = z11.strictObject({ identity: z11.string().min(1), at: z11.iso.datetime() });
|
|
5155
|
+
PicksFileSchema = z11.strictObject({
|
|
5156
|
+
schemaVersion: z11.literal(SCHEMA_VERSION),
|
|
5157
|
+
picks: z11.record(z11.string().min(1), PickEntrySchema)
|
|
5158
5158
|
});
|
|
5159
5159
|
}
|
|
5160
5160
|
});
|
|
@@ -5230,7 +5230,7 @@ var init_paths = __esm({
|
|
|
5230
5230
|
});
|
|
5231
5231
|
|
|
5232
5232
|
// src/credentialCache.ts
|
|
5233
|
-
import { z as
|
|
5233
|
+
import { z as z12 } from "zod";
|
|
5234
5234
|
function effectiveStore(cache, platform) {
|
|
5235
5235
|
return cache.store ?? (platform === "darwin" ? "keychain" : "file");
|
|
5236
5236
|
}
|
|
@@ -5297,9 +5297,9 @@ var init_credentialCache = __esm({
|
|
|
5297
5297
|
init_schema();
|
|
5298
5298
|
init_preflight();
|
|
5299
5299
|
MS_PER_UNIT = { s: 1e3, m: 6e4, h: 36e5, d: 864e5 };
|
|
5300
|
-
CachedCredentialSchema =
|
|
5301
|
-
token:
|
|
5302
|
-
fetchedAt:
|
|
5300
|
+
CachedCredentialSchema = z12.strictObject({
|
|
5301
|
+
token: z12.string().min(1),
|
|
5302
|
+
fetchedAt: z12.number().int().nonnegative(),
|
|
5303
5303
|
source: CredentialSourceSchema
|
|
5304
5304
|
});
|
|
5305
5305
|
}
|
|
@@ -5901,7 +5901,7 @@ var init_envBool = __esm({
|
|
|
5901
5901
|
});
|
|
5902
5902
|
|
|
5903
5903
|
// src/launcher/claudeVersion.ts
|
|
5904
|
-
function
|
|
5904
|
+
function validated2(value, origin) {
|
|
5905
5905
|
if (!NUMERIC_DOTTED_VERSION_RE.test(value)) {
|
|
5906
5906
|
throw new InvalidClaudeVersionError(value, origin);
|
|
5907
5907
|
}
|
|
@@ -5909,11 +5909,11 @@ function validated(value, origin) {
|
|
|
5909
5909
|
}
|
|
5910
5910
|
function resolveClaudeVersion(params) {
|
|
5911
5911
|
if (params.flag !== void 0) {
|
|
5912
|
-
return { version:
|
|
5912
|
+
return { version: validated2(params.flag, "--claude-version"), source: "flag" };
|
|
5913
5913
|
}
|
|
5914
5914
|
const fromEnv = params.env.AGENT_SHIM_CLAUDE_VERSION;
|
|
5915
5915
|
if (fromEnv !== void 0 && fromEnv !== "") {
|
|
5916
|
-
return { version:
|
|
5916
|
+
return { version: validated2(fromEnv, "AGENT_SHIM_CLAUDE_VERSION"), source: "environment" };
|
|
5917
5917
|
}
|
|
5918
5918
|
return params.cascade === void 0 ? void 0 : { version: params.cascade, source: "cascade" };
|
|
5919
5919
|
}
|
|
@@ -6001,7 +6001,7 @@ var init_commandDeps = __esm({
|
|
|
6001
6001
|
// src/claudeShim.ts
|
|
6002
6002
|
import fs8 from "node:fs";
|
|
6003
6003
|
import path26 from "node:path";
|
|
6004
|
-
import { z as
|
|
6004
|
+
import { z as z16 } from "zod";
|
|
6005
6005
|
function commandFilename(ownExecutablePath, commandName) {
|
|
6006
6006
|
return ownExecutablePath.toLowerCase().endsWith(".exe") ? `${commandName}.exe` : commandName;
|
|
6007
6007
|
}
|
|
@@ -6051,10 +6051,10 @@ var init_claudeShim = __esm({
|
|
|
6051
6051
|
init_store();
|
|
6052
6052
|
init_realPorts();
|
|
6053
6053
|
init_cliError();
|
|
6054
|
-
ClaudeShimStateSchema =
|
|
6055
|
-
targetPath:
|
|
6056
|
-
method:
|
|
6057
|
-
installedAtMs:
|
|
6054
|
+
ClaudeShimStateSchema = z16.strictObject({
|
|
6055
|
+
targetPath: z16.string().min(1),
|
|
6056
|
+
method: z16.enum(["hardlink", "copy"]),
|
|
6057
|
+
installedAtMs: z16.number()
|
|
6058
6058
|
});
|
|
6059
6059
|
nodeLinkFs = { link: fs8.linkSync, copyFile: fs8.copyFileSync, chmod: fs8.chmodSync };
|
|
6060
6060
|
}
|
|
@@ -7182,10 +7182,10 @@ function resolveLaunch(params) {
|
|
|
7182
7182
|
environment
|
|
7183
7183
|
};
|
|
7184
7184
|
}
|
|
7185
|
-
function runLaunchPlan(plan,
|
|
7185
|
+
function runLaunchPlan(plan, spawn3) {
|
|
7186
7186
|
try {
|
|
7187
7187
|
plan.markChildStarted();
|
|
7188
|
-
const result =
|
|
7188
|
+
const result = spawn3.spawnSync(plan.bin, plan.args, { stdio: "inherit", env: plan.env });
|
|
7189
7189
|
if (result.error !== void 0) {
|
|
7190
7190
|
throw result.error;
|
|
7191
7191
|
}
|
|
@@ -7689,7 +7689,7 @@ var init_anthropicUsageRefresh = __esm({
|
|
|
7689
7689
|
});
|
|
7690
7690
|
|
|
7691
7691
|
// src/usage/providerQuota.ts
|
|
7692
|
-
import { z as
|
|
7692
|
+
import { z as z24 } from "zod";
|
|
7693
7693
|
var MS_PER_SECOND7, SECONDS_PER_HOUR, HOURS_PER_DAY3, 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;
|
|
7694
7694
|
var init_providerQuota = __esm({
|
|
7695
7695
|
"src/usage/providerQuota.ts"() {
|
|
@@ -7707,35 +7707,35 @@ var init_providerQuota = __esm({
|
|
|
7707
7707
|
[ZAI_UNIT_HOURS, SECONDS_PER_HOUR * MS_PER_SECOND7],
|
|
7708
7708
|
[ZAI_UNIT_MONTHS, DAYS_PER_MONTH * HOURS_PER_DAY3 * SECONDS_PER_HOUR * MS_PER_SECOND7]
|
|
7709
7709
|
]);
|
|
7710
|
-
ZaiLimitSchema =
|
|
7711
|
-
type:
|
|
7712
|
-
unit:
|
|
7713
|
-
number:
|
|
7714
|
-
percentage:
|
|
7715
|
-
nextResetTime:
|
|
7716
|
-
usage:
|
|
7717
|
-
currentValue:
|
|
7718
|
-
remaining:
|
|
7710
|
+
ZaiLimitSchema = z24.object({
|
|
7711
|
+
type: z24.string(),
|
|
7712
|
+
unit: z24.number().int(),
|
|
7713
|
+
number: z24.number().int().positive(),
|
|
7714
|
+
percentage: z24.number().nonnegative(),
|
|
7715
|
+
nextResetTime: z24.number().positive().optional(),
|
|
7716
|
+
usage: z24.number().nonnegative().optional(),
|
|
7717
|
+
currentValue: z24.number().nonnegative().optional(),
|
|
7718
|
+
remaining: z24.number().nonnegative().optional()
|
|
7719
7719
|
});
|
|
7720
|
-
ZaiResponseSchema =
|
|
7721
|
-
success:
|
|
7722
|
-
msg:
|
|
7723
|
-
data:
|
|
7720
|
+
ZaiResponseSchema = z24.object({
|
|
7721
|
+
success: z24.boolean(),
|
|
7722
|
+
msg: z24.string().optional(),
|
|
7723
|
+
data: z24.object({ level: z24.string().optional(), limits: z24.array(ZaiLimitSchema) })
|
|
7724
7724
|
});
|
|
7725
7725
|
OPENROUTER_HOST = "openrouter.ai";
|
|
7726
7726
|
OPENROUTER_KEY_URL = `https://${OPENROUTER_HOST}/api/v1/key`;
|
|
7727
7727
|
OPENROUTER_CREDITS_URL = `https://${OPENROUTER_HOST}/api/v1/credits`;
|
|
7728
7728
|
MS_PER_DAY3 = HOURS_PER_DAY3 * SECONDS_PER_HOUR * MS_PER_SECOND7;
|
|
7729
|
-
OpenRouterKeySchema =
|
|
7730
|
-
data:
|
|
7731
|
-
limit:
|
|
7732
|
-
limit_remaining:
|
|
7733
|
-
limit_reset:
|
|
7734
|
-
is_free_tier:
|
|
7735
|
-
free_model_daily_requests:
|
|
7729
|
+
OpenRouterKeySchema = z24.object({
|
|
7730
|
+
data: z24.object({
|
|
7731
|
+
limit: z24.number().nonnegative().nullable(),
|
|
7732
|
+
limit_remaining: z24.number().nullable(),
|
|
7733
|
+
limit_reset: z24.string().nullable(),
|
|
7734
|
+
is_free_tier: z24.boolean().optional(),
|
|
7735
|
+
free_model_daily_requests: z24.object({ used: z24.number().nonnegative(), limit: z24.number().nonnegative(), remaining: z24.number() }).optional()
|
|
7736
7736
|
})
|
|
7737
7737
|
});
|
|
7738
|
-
OpenRouterCreditsSchema =
|
|
7738
|
+
OpenRouterCreditsSchema = z24.object({ data: z24.object({ total_credits: z24.number().nonnegative(), total_usage: z24.number().nonnegative() }) });
|
|
7739
7739
|
}
|
|
7740
7740
|
});
|
|
7741
7741
|
|
|
@@ -10896,6 +10896,242 @@ function frontDoorRcApiClient(port, ca, token) {
|
|
|
10896
10896
|
return createORPCClient(frontDoorApiLink(port, ca, token));
|
|
10897
10897
|
}
|
|
10898
10898
|
|
|
10899
|
+
// src/codex/appServer.ts
|
|
10900
|
+
init_cliError();
|
|
10901
|
+
init_package();
|
|
10902
|
+
|
|
10903
|
+
// src/codex/appServerSchemas.ts
|
|
10904
|
+
import { z as z5 } from "zod";
|
|
10905
|
+
var CODEX_APP_SERVER_GENERATED_AGAINST = "0.160.0";
|
|
10906
|
+
var RateLimitWindowSchema = z5.object({
|
|
10907
|
+
usedPercent: z5.number(),
|
|
10908
|
+
resetsAt: z5.number().nullish(),
|
|
10909
|
+
windowDurationMins: z5.number().nullish()
|
|
10910
|
+
});
|
|
10911
|
+
var RateLimitSnapshotSchema = z5.object({
|
|
10912
|
+
limitId: z5.string().nullish(),
|
|
10913
|
+
limitName: z5.string().nullish(),
|
|
10914
|
+
planType: z5.string().nullish(),
|
|
10915
|
+
primary: RateLimitWindowSchema.nullish(),
|
|
10916
|
+
secondary: RateLimitWindowSchema.nullish(),
|
|
10917
|
+
rateLimitReachedType: z5.string().nullish(),
|
|
10918
|
+
spendControlReached: z5.boolean().nullish()
|
|
10919
|
+
});
|
|
10920
|
+
var RateLimitResetCreditSchema = z5.object({
|
|
10921
|
+
id: z5.string(),
|
|
10922
|
+
grantedAt: z5.number(),
|
|
10923
|
+
expiresAt: z5.number().nullish(),
|
|
10924
|
+
resetType: z5.string(),
|
|
10925
|
+
status: z5.string(),
|
|
10926
|
+
title: z5.string().nullish(),
|
|
10927
|
+
description: z5.string().nullish()
|
|
10928
|
+
});
|
|
10929
|
+
var CodexAccountSchema = z5.discriminatedUnion("type", [
|
|
10930
|
+
z5.object({ type: z5.literal("apiKey") }),
|
|
10931
|
+
z5.object({ type: z5.literal("chatgpt"), email: z5.string().nullable(), planType: z5.string() }),
|
|
10932
|
+
z5.object({ type: z5.literal("amazonBedrock"), usesCodexManagedCredentials: z5.boolean().default(false) })
|
|
10933
|
+
]);
|
|
10934
|
+
var CodexAccountReadSchema = z5.object({
|
|
10935
|
+
account: CodexAccountSchema.nullable(),
|
|
10936
|
+
requiresOpenaiAuth: z5.boolean()
|
|
10937
|
+
});
|
|
10938
|
+
var CodexRateLimitsReadSchema = z5.object({
|
|
10939
|
+
rateLimits: RateLimitSnapshotSchema,
|
|
10940
|
+
rateLimitsByLimitId: z5.record(z5.string(), RateLimitSnapshotSchema).nullish(),
|
|
10941
|
+
rateLimitResetCredits: z5.object({ availableCount: z5.number(), credits: z5.array(RateLimitResetCreditSchema).nullish() }).nullish(),
|
|
10942
|
+
accountId: z5.string().nullish(),
|
|
10943
|
+
ordinaryUsageAllowed: z5.boolean().nullish()
|
|
10944
|
+
});
|
|
10945
|
+
var CodexInitializeResultSchema = z5.object({ userAgent: z5.string() });
|
|
10946
|
+
|
|
10947
|
+
// src/codex/appServer.ts
|
|
10948
|
+
var CodexAppServerUnavailableError = class extends CliError {
|
|
10949
|
+
constructor(detail) {
|
|
10950
|
+
super(`The Codex app-server is not available: ${detail}.`);
|
|
10951
|
+
this.name = "CodexAppServerUnavailableError";
|
|
10952
|
+
}
|
|
10953
|
+
};
|
|
10954
|
+
var CodexAppServerRequestError = class extends CliError {
|
|
10955
|
+
constructor(method, rpcCode, detail) {
|
|
10956
|
+
super(`Codex app-server ${method} failed (${String(rpcCode)}): ${detail}`);
|
|
10957
|
+
this.method = method;
|
|
10958
|
+
this.rpcCode = rpcCode;
|
|
10959
|
+
this.name = "CodexAppServerRequestError";
|
|
10960
|
+
}
|
|
10961
|
+
method;
|
|
10962
|
+
rpcCode;
|
|
10963
|
+
};
|
|
10964
|
+
var CodexAppServerProtocolError = class extends CliError {
|
|
10965
|
+
constructor(method, installedVersion, detail) {
|
|
10966
|
+
super(
|
|
10967
|
+
`Codex app-server ${method} answered in a shape this reader does not know (installed Codex ${installedVersion ?? "of unknown version"}, shapes generated against ${CODEX_APP_SERVER_GENERATED_AGAINST}): ${detail}`
|
|
10968
|
+
);
|
|
10969
|
+
this.method = method;
|
|
10970
|
+
this.installedVersion = installedVersion;
|
|
10971
|
+
this.name = "CodexAppServerProtocolError";
|
|
10972
|
+
}
|
|
10973
|
+
method;
|
|
10974
|
+
installedVersion;
|
|
10975
|
+
};
|
|
10976
|
+
var CODEX_APP_SERVER_TIMEOUT_MS = 3e4;
|
|
10977
|
+
var CLIENT_NAME = "agent-shim";
|
|
10978
|
+
function installedVersionOf(userAgent) {
|
|
10979
|
+
return /^[^/\s]+\/(\S+)/.exec(userAgent)?.[1];
|
|
10980
|
+
}
|
|
10981
|
+
function responseTo(message, id) {
|
|
10982
|
+
if (typeof message !== "object" || message === null || !("id" in message) || message.id !== id) {
|
|
10983
|
+
return void 0;
|
|
10984
|
+
}
|
|
10985
|
+
if ("error" in message && typeof message.error === "object" && message.error !== null) {
|
|
10986
|
+
const { error } = message;
|
|
10987
|
+
const code = "code" in error && typeof error.code === "number" ? error.code : 0;
|
|
10988
|
+
const detail = "message" in error && typeof error.message === "string" ? error.message : "no message";
|
|
10989
|
+
return { error: { code, message: detail } };
|
|
10990
|
+
}
|
|
10991
|
+
return "result" in message ? { result: message.result } : void 0;
|
|
10992
|
+
}
|
|
10993
|
+
async function withAppServer(port, options, ask) {
|
|
10994
|
+
const connection = await port.open({ bin: options.bin ?? "codex", codexHome: options.codexHome });
|
|
10995
|
+
let nextId = 0;
|
|
10996
|
+
const timeoutMs = options.timeoutMs ?? CODEX_APP_SERVER_TIMEOUT_MS;
|
|
10997
|
+
const stopper = AbortSignal.any([...options.signal === void 0 ? [] : [options.signal], AbortSignal.timeout(timeoutMs)]);
|
|
10998
|
+
const stopReason = () => {
|
|
10999
|
+
if (options.signal?.aborted !== true) {
|
|
11000
|
+
return new CodexAppServerUnavailableError(`it did not answer within ${String(timeoutMs)} ms`);
|
|
11001
|
+
}
|
|
11002
|
+
const reason = options.signal.reason;
|
|
11003
|
+
return reason instanceof Error ? reason : new Error(`the Codex app-server read was aborted: ${String(reason)}`);
|
|
11004
|
+
};
|
|
11005
|
+
const aborted = new Promise((_resolve, reject) => {
|
|
11006
|
+
if (stopper.aborted) {
|
|
11007
|
+
reject(stopReason());
|
|
11008
|
+
return;
|
|
11009
|
+
}
|
|
11010
|
+
stopper.addEventListener(
|
|
11011
|
+
"abort",
|
|
11012
|
+
() => {
|
|
11013
|
+
reject(stopReason());
|
|
11014
|
+
},
|
|
11015
|
+
{ once: true }
|
|
11016
|
+
);
|
|
11017
|
+
});
|
|
11018
|
+
aborted.catch(() => void 0);
|
|
11019
|
+
const request4 = async (method, params) => {
|
|
11020
|
+
nextId += 1;
|
|
11021
|
+
const id = nextId;
|
|
11022
|
+
connection.send({ jsonrpc: "2.0", id, method, params });
|
|
11023
|
+
for (; ; ) {
|
|
11024
|
+
const message = await Promise.race([connection.receive(), aborted]);
|
|
11025
|
+
if (message === void 0) {
|
|
11026
|
+
throw new CodexAppServerUnavailableError(`it ended before answering ${method}`);
|
|
11027
|
+
}
|
|
11028
|
+
const response = responseTo(message, id);
|
|
11029
|
+
if (response === void 0) {
|
|
11030
|
+
continue;
|
|
11031
|
+
}
|
|
11032
|
+
if ("error" in response) {
|
|
11033
|
+
throw new CodexAppServerRequestError(method, response.error.code, response.error.message);
|
|
11034
|
+
}
|
|
11035
|
+
return response.result;
|
|
11036
|
+
}
|
|
11037
|
+
};
|
|
11038
|
+
try {
|
|
11039
|
+
const initialised = CodexInitializeResultSchema.safeParse(await request4("initialize", { clientInfo: { name: CLIENT_NAME, title: null, version: package_default.version } }));
|
|
11040
|
+
if (!initialised.success) {
|
|
11041
|
+
throw new CodexAppServerProtocolError("initialize", void 0, initialised.error.message);
|
|
11042
|
+
}
|
|
11043
|
+
connection.send({ jsonrpc: "2.0", method: "initialized" });
|
|
11044
|
+
return await ask(request4, installedVersionOf(initialised.data.userAgent));
|
|
11045
|
+
} finally {
|
|
11046
|
+
await connection.close();
|
|
11047
|
+
}
|
|
11048
|
+
}
|
|
11049
|
+
function validated(method, installedVersion, schema, value) {
|
|
11050
|
+
const parsed = schema.safeParse(value);
|
|
11051
|
+
if (!parsed.success) {
|
|
11052
|
+
throw new CodexAppServerProtocolError(method, installedVersion, parsed.error.message);
|
|
11053
|
+
}
|
|
11054
|
+
return parsed.data;
|
|
11055
|
+
}
|
|
11056
|
+
async function readCodexAccount(port, options) {
|
|
11057
|
+
return await withAppServer(port, options, async (request4, version) => validated("account/read", version, CodexAccountReadSchema, await request4("account/read", { refreshToken: false })));
|
|
11058
|
+
}
|
|
11059
|
+
async function readCodexRateLimits(port, options) {
|
|
11060
|
+
return await withAppServer(port, options, async (request4, version) => validated("account/rateLimits/read", version, CodexRateLimitsReadSchema, await request4("account/rateLimits/read", void 0)));
|
|
11061
|
+
}
|
|
11062
|
+
|
|
11063
|
+
// src/codex/realAppServer.ts
|
|
11064
|
+
import { spawn } from "node:child_process";
|
|
11065
|
+
import readline from "node:readline";
|
|
11066
|
+
var SHUTDOWN_GRACE_MS = 5e3;
|
|
11067
|
+
var realCodexAppServerPort = {
|
|
11068
|
+
open: async ({ bin, codexHome }) => {
|
|
11069
|
+
const child = spawn(bin, ["app-server"], { stdio: ["pipe", "pipe", "ignore"], env: { ...process.env, CODEX_HOME: codexHome } });
|
|
11070
|
+
await new Promise((resolve, reject) => {
|
|
11071
|
+
child.once("spawn", resolve);
|
|
11072
|
+
child.once("error", (error) => {
|
|
11073
|
+
reject(new CodexAppServerUnavailableError(`${bin} could not be started (${error.message})`));
|
|
11074
|
+
});
|
|
11075
|
+
});
|
|
11076
|
+
const exited = new Promise((resolve) => {
|
|
11077
|
+
child.once("exit", () => {
|
|
11078
|
+
resolve();
|
|
11079
|
+
});
|
|
11080
|
+
});
|
|
11081
|
+
const pending = [];
|
|
11082
|
+
const waiting = [];
|
|
11083
|
+
let ended = false;
|
|
11084
|
+
const deliver = (message) => {
|
|
11085
|
+
const waiter = waiting.shift();
|
|
11086
|
+
if (waiter === void 0) {
|
|
11087
|
+
pending.push(message);
|
|
11088
|
+
} else {
|
|
11089
|
+
waiter(message);
|
|
11090
|
+
}
|
|
11091
|
+
};
|
|
11092
|
+
const lines = readline.createInterface({ input: child.stdout });
|
|
11093
|
+
lines.on("line", (line) => {
|
|
11094
|
+
try {
|
|
11095
|
+
deliver(JSON.parse(line));
|
|
11096
|
+
} catch {
|
|
11097
|
+
}
|
|
11098
|
+
});
|
|
11099
|
+
lines.on("close", () => {
|
|
11100
|
+
ended = true;
|
|
11101
|
+
for (const waiter of waiting.splice(0)) {
|
|
11102
|
+
waiter(void 0);
|
|
11103
|
+
}
|
|
11104
|
+
});
|
|
11105
|
+
const connection = {
|
|
11106
|
+
send: (message) => {
|
|
11107
|
+
child.stdin.write(`${JSON.stringify(message)}
|
|
11108
|
+
`);
|
|
11109
|
+
},
|
|
11110
|
+
receive: async () => {
|
|
11111
|
+
if (pending.length > 0) {
|
|
11112
|
+
return pending.shift();
|
|
11113
|
+
}
|
|
11114
|
+
if (ended) {
|
|
11115
|
+
return void 0;
|
|
11116
|
+
}
|
|
11117
|
+
return await new Promise((resolve) => {
|
|
11118
|
+
waiting.push(resolve);
|
|
11119
|
+
});
|
|
11120
|
+
},
|
|
11121
|
+
close: async () => {
|
|
11122
|
+
child.stdin.end();
|
|
11123
|
+
const timer = setTimeout(() => {
|
|
11124
|
+
child.kill("SIGKILL");
|
|
11125
|
+
}, SHUTDOWN_GRACE_MS);
|
|
11126
|
+
await exited;
|
|
11127
|
+
clearTimeout(timer);
|
|
11128
|
+
lines.close();
|
|
11129
|
+
}
|
|
11130
|
+
};
|
|
11131
|
+
return connection;
|
|
11132
|
+
}
|
|
11133
|
+
};
|
|
11134
|
+
|
|
10899
11135
|
// src/frontdoor/doorClient.ts
|
|
10900
11136
|
init_cliError();
|
|
10901
11137
|
init_realPorts();
|
|
@@ -11294,7 +11530,7 @@ init_providersStore();
|
|
|
11294
11530
|
init_projects();
|
|
11295
11531
|
init_pipeline();
|
|
11296
11532
|
import path25 from "node:path";
|
|
11297
|
-
import { z as
|
|
11533
|
+
import { z as z13 } from "zod";
|
|
11298
11534
|
var HISTORY_PROJECTS_KEY_PREFIX = "history/projects/";
|
|
11299
11535
|
function projectFragmentOf(rawKey) {
|
|
11300
11536
|
return rawKey.startsWith(HISTORY_PROJECTS_KEY_PREFIX) ? rawKey.slice(HISTORY_PROJECTS_KEY_PREFIX.length) : void 0;
|
|
@@ -11371,9 +11607,9 @@ function lookupKeychainService(run, farmRoot) {
|
|
|
11371
11607
|
note: serviceName === void 0 ? `A Keychain entry was found for account "${farmRoot}" but its service name could not be parsed from security's output.` : `Keychain service name for this identity: "${serviceName}".`
|
|
11372
11608
|
};
|
|
11373
11609
|
}
|
|
11374
|
-
var SettingsSecretsShapeSchema =
|
|
11375
|
-
env:
|
|
11376
|
-
hooks:
|
|
11610
|
+
var SettingsSecretsShapeSchema = z13.looseObject({
|
|
11611
|
+
env: z13.record(z13.string(), z13.unknown()).optional(),
|
|
11612
|
+
hooks: z13.record(z13.string(), z13.array(z13.unknown())).optional()
|
|
11377
11613
|
});
|
|
11378
11614
|
function hookCommandCountOf(group) {
|
|
11379
11615
|
if (typeof group !== "object" || group === null) {
|
|
@@ -11669,7 +11905,7 @@ init_schema();
|
|
|
11669
11905
|
init_claudeVersion();
|
|
11670
11906
|
init_identity();
|
|
11671
11907
|
init_projects();
|
|
11672
|
-
import { z as
|
|
11908
|
+
import { z as z15 } from "zod";
|
|
11673
11909
|
|
|
11674
11910
|
// src/resolve/types.ts
|
|
11675
11911
|
var LAYER_KINDS = [
|
|
@@ -11730,123 +11966,123 @@ var DIAGNOSTIC_SEVERITIES = ["error", "warning", "info"];
|
|
|
11730
11966
|
|
|
11731
11967
|
// src/usage/pickReportSchema.ts
|
|
11732
11968
|
init_plan2();
|
|
11733
|
-
import { z as
|
|
11734
|
-
var PoolPickCandidateViewSchema =
|
|
11735
|
-
identity:
|
|
11969
|
+
import { z as z14 } from "zod";
|
|
11970
|
+
var PoolPickCandidateViewSchema = z14.strictObject({
|
|
11971
|
+
identity: z14.string(),
|
|
11736
11972
|
/** In pick order: `scored` has usable quota data, `unknown` has none, `pay-per-use` bills by use, `ineligible` is refused right now. */
|
|
11737
|
-
class:
|
|
11973
|
+
class: z14.enum(["scored", "unknown", "pay-per-use", "ineligible"]),
|
|
11738
11974
|
/** Plan-size-weighted remaining quota per hour until its reset; present for `scored` only. */
|
|
11739
|
-
score:
|
|
11975
|
+
score: z14.number().optional(),
|
|
11740
11976
|
/** Which window's reset divides the score: the seven-day window, or the five-hour one when the member reports no seven-day utilisation; present with `score`. */
|
|
11741
|
-
scoreWindow:
|
|
11977
|
+
scoreWindow: z14.enum(["sevenDay", "fiveHour"]).optional(),
|
|
11742
11978
|
/** False when the five-hour window would run dry, at the observed pace, before it resets. */
|
|
11743
|
-
feasible:
|
|
11979
|
+
feasible: z14.boolean(),
|
|
11744
11980
|
/** When an `ineligible` member can be used again, as an ISO instant. */
|
|
11745
|
-
blockedUntil:
|
|
11981
|
+
blockedUntil: z14.iso.datetime().optional(),
|
|
11746
11982
|
plan: PlanClassSchema,
|
|
11747
11983
|
/** The facts behind the class and score, in the order they matter. */
|
|
11748
|
-
reasons:
|
|
11984
|
+
reasons: z14.array(z14.string())
|
|
11749
11985
|
});
|
|
11750
|
-
var PoolPickReportSchema =
|
|
11751
|
-
pool:
|
|
11752
|
-
directory:
|
|
11986
|
+
var PoolPickReportSchema = z14.strictObject({
|
|
11987
|
+
pool: z14.string(),
|
|
11988
|
+
directory: z14.string(),
|
|
11753
11989
|
/** The member a launch would run as, absent when every member is refused. */
|
|
11754
|
-
pick:
|
|
11755
|
-
candidates:
|
|
11990
|
+
pick: z14.string().optional(),
|
|
11991
|
+
candidates: z14.array(PoolPickCandidateViewSchema),
|
|
11756
11992
|
/** Identity members anywhere in the pool's graph that do not exist; a launch skips them. */
|
|
11757
|
-
missing:
|
|
11993
|
+
missing: z14.array(z14.string()),
|
|
11758
11994
|
/** When nothing can be picked, the soonest any member returns. */
|
|
11759
|
-
earliestReturn:
|
|
11995
|
+
earliestReturn: z14.strictObject({ identity: z14.string(), at: z14.iso.datetime() }).optional(),
|
|
11760
11996
|
/** The member a resumed conversation started on but moved off, and why, when the ranking could not keep it. */
|
|
11761
|
-
movedOff:
|
|
11997
|
+
movedOff: z14.strictObject({ identity: z14.string(), reason: z14.string() }).optional(),
|
|
11762
11998
|
/** Why the last-pick record could not be read, when that is the case. */
|
|
11763
|
-
stickyProblem:
|
|
11999
|
+
stickyProblem: z14.string().optional()
|
|
11764
12000
|
});
|
|
11765
12001
|
|
|
11766
12002
|
// src/checkReportSchema.ts
|
|
11767
12003
|
var CHECK_CREDENTIAL_APPLIES = ["provider", "identity", "stored-login"];
|
|
11768
|
-
var CheckLayerViewSchema =
|
|
11769
|
-
id:
|
|
11770
|
-
kind:
|
|
11771
|
-
source:
|
|
11772
|
-
});
|
|
11773
|
-
var CheckEntryViewSchema =
|
|
11774
|
-
path:
|
|
11775
|
-
shared:
|
|
11776
|
-
via:
|
|
12004
|
+
var CheckLayerViewSchema = z15.strictObject({
|
|
12005
|
+
id: z15.int(),
|
|
12006
|
+
kind: z15.enum(LAYER_KINDS),
|
|
12007
|
+
source: z15.string()
|
|
12008
|
+
});
|
|
12009
|
+
var CheckEntryViewSchema = z15.strictObject({
|
|
12010
|
+
path: z15.string(),
|
|
12011
|
+
shared: z15.boolean(),
|
|
12012
|
+
via: z15.enum(DECISION_VIAS),
|
|
11777
12013
|
/** The entry's real category, or null when nothing classifies it. */
|
|
11778
|
-
category:
|
|
11779
|
-
rule:
|
|
12014
|
+
category: z15.enum(CATEGORY_NAMES).nullable(),
|
|
12015
|
+
rule: z15.strictObject({ key: z15.string(), layer: z15.int() }).optional(),
|
|
11780
12016
|
/** Rules that matched but whose `when` condition failed, each with the conditions that failed. */
|
|
11781
|
-
eliminated:
|
|
11782
|
-
});
|
|
11783
|
-
var CheckDiagnosticSchema =
|
|
11784
|
-
code:
|
|
11785
|
-
severity:
|
|
11786
|
-
message:
|
|
11787
|
-
subject:
|
|
11788
|
-
layer:
|
|
11789
|
-
});
|
|
11790
|
-
var CheckAmbientCredentialSchema =
|
|
11791
|
-
var CheckKeychainSchema =
|
|
11792
|
-
checked:
|
|
11793
|
-
found:
|
|
11794
|
-
serviceName:
|
|
11795
|
-
note:
|
|
11796
|
-
});
|
|
11797
|
-
var CheckSettingsExposureSchema =
|
|
11798
|
-
file:
|
|
11799
|
-
envKeyNames:
|
|
11800
|
-
hookEventNames:
|
|
11801
|
-
hookCommandCount:
|
|
11802
|
-
});
|
|
11803
|
-
var CredentialSourceSummarySchema =
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
|
|
12017
|
+
eliminated: z15.readonly(z15.array(z15.strictObject({ key: z15.string(), failed: z15.readonly(z15.array(z15.string())) }))).optional()
|
|
12018
|
+
});
|
|
12019
|
+
var CheckDiagnosticSchema = z15.strictObject({
|
|
12020
|
+
code: z15.enum(DIAGNOSTIC_CODES),
|
|
12021
|
+
severity: z15.enum(DIAGNOSTIC_SEVERITIES),
|
|
12022
|
+
message: z15.string(),
|
|
12023
|
+
subject: z15.string().optional(),
|
|
12024
|
+
layer: z15.int().optional()
|
|
12025
|
+
});
|
|
12026
|
+
var CheckAmbientCredentialSchema = z15.union([z15.strictObject({ ok: z15.literal(true) }), z15.strictObject({ ok: z15.literal(false), variable: z15.string(), message: z15.string() })]);
|
|
12027
|
+
var CheckKeychainSchema = z15.strictObject({
|
|
12028
|
+
checked: z15.literal(true),
|
|
12029
|
+
found: z15.boolean(),
|
|
12030
|
+
serviceName: z15.string().optional(),
|
|
12031
|
+
note: z15.string()
|
|
12032
|
+
});
|
|
12033
|
+
var CheckSettingsExposureSchema = z15.strictObject({
|
|
12034
|
+
file: z15.string(),
|
|
12035
|
+
envKeyNames: z15.readonly(z15.array(z15.string())),
|
|
12036
|
+
hookEventNames: z15.readonly(z15.array(z15.string())),
|
|
12037
|
+
hookCommandCount: z15.int().nonnegative()
|
|
12038
|
+
});
|
|
12039
|
+
var CredentialSourceSummarySchema = z15.union([
|
|
12040
|
+
z15.strictObject({ kind: z15.literal("env"), variable: z15.string() }),
|
|
12041
|
+
z15.strictObject({ kind: z15.literal("file"), path: z15.string() }),
|
|
12042
|
+
z15.strictObject({ kind: z15.literal("command"), program: z15.string() }),
|
|
12043
|
+
z15.strictObject({ kind: z15.literal("op"), reference: z15.string() }),
|
|
12044
|
+
z15.strictObject({ kind: z15.literal("keychain"), service: z15.string(), account: z15.string().optional() }),
|
|
12045
|
+
z15.strictObject({ kind: z15.literal("literal") })
|
|
11810
12046
|
]);
|
|
11811
|
-
var CredentialSummarySchema =
|
|
11812
|
-
target:
|
|
11813
|
-
sources:
|
|
12047
|
+
var CredentialSummarySchema = z15.strictObject({
|
|
12048
|
+
target: z15.enum(CREDENTIAL_TARGETS),
|
|
12049
|
+
sources: z15.readonly(z15.array(CredentialSourceSummarySchema)),
|
|
11814
12050
|
cache: CredentialCacheSchema.optional()
|
|
11815
12051
|
});
|
|
11816
|
-
var CachedCredentialStateSchema =
|
|
11817
|
-
|
|
11818
|
-
|
|
11819
|
-
|
|
12052
|
+
var CachedCredentialStateSchema = z15.union([
|
|
12053
|
+
z15.strictObject({ store: z15.enum(CREDENTIAL_CACHE_STORES), status: z15.literal("empty") }),
|
|
12054
|
+
z15.strictObject({ store: z15.enum(CREDENTIAL_CACHE_STORES), status: z15.literal("unreadable"), reason: z15.string() }),
|
|
12055
|
+
z15.strictObject({ store: z15.enum(CREDENTIAL_CACHE_STORES), status: z15.enum(["fresh", "expired"]), ageMs: z15.number(), expiresInMs: z15.number().optional() })
|
|
11820
12056
|
]);
|
|
11821
|
-
var CheckCredentialProviderSchema =
|
|
11822
|
-
|
|
11823
|
-
|
|
12057
|
+
var CheckCredentialProviderSchema = z15.union([
|
|
12058
|
+
z15.strictObject({ name: z15.string(), credential: CredentialSummarySchema, cached: CachedCredentialStateSchema.optional() }),
|
|
12059
|
+
z15.strictObject({ name: z15.string(), problem: z15.string() })
|
|
11824
12060
|
]);
|
|
11825
|
-
var CheckCredentialSchema =
|
|
11826
|
-
applies:
|
|
12061
|
+
var CheckCredentialSchema = z15.strictObject({
|
|
12062
|
+
applies: z15.enum(CHECK_CREDENTIAL_APPLIES),
|
|
11827
12063
|
provider: CheckCredentialProviderSchema.optional(),
|
|
11828
12064
|
identity: CredentialSummarySchema.optional(),
|
|
11829
12065
|
identityCached: CachedCredentialStateSchema.optional()
|
|
11830
12066
|
});
|
|
11831
|
-
var CheckClaudeVersionSchema =
|
|
11832
|
-
pinned:
|
|
11833
|
-
highestInstalled:
|
|
11834
|
-
installed:
|
|
12067
|
+
var CheckClaudeVersionSchema = z15.strictObject({
|
|
12068
|
+
pinned: z15.strictObject({ version: z15.string(), source: z15.enum(CLAUDE_VERSION_SOURCES), installed: z15.boolean() }).optional(),
|
|
12069
|
+
highestInstalled: z15.string().optional(),
|
|
12070
|
+
installed: z15.readonly(z15.array(z15.string()))
|
|
11835
12071
|
});
|
|
11836
|
-
var CheckReportJsonSchema =
|
|
11837
|
-
identity:
|
|
12072
|
+
var CheckReportJsonSchema = z15.strictObject({
|
|
12073
|
+
identity: z15.strictObject({ name: z15.string().nullable(), source: z15.enum(IDENTITY_DECISION_SOURCES) }),
|
|
11838
12074
|
/** The pool ranking, when the launch named a pool instead of an identity. */
|
|
11839
12075
|
pool: PoolPickReportSchema.optional(),
|
|
11840
|
-
configProfile:
|
|
11841
|
-
layers:
|
|
11842
|
-
entries:
|
|
11843
|
-
projectEncodingAmbiguities:
|
|
11844
|
-
|
|
12076
|
+
configProfile: z15.strictObject({ name: z15.string().nullable(), source: z15.enum(CONFIG_PROFILE_DECISION_SOURCES) }),
|
|
12077
|
+
layers: z15.readonly(z15.array(CheckLayerViewSchema)),
|
|
12078
|
+
entries: z15.readonly(z15.array(CheckEntryViewSchema)),
|
|
12079
|
+
projectEncodingAmbiguities: z15.readonly(
|
|
12080
|
+
z15.array(z15.strictObject({ fragment: z15.string(), encoded: z15.string(), reason: z15.enum(ENCODING_AMBIGUITY_REASONS), detail: z15.string() }))
|
|
11845
12081
|
),
|
|
11846
|
-
diagnostics:
|
|
12082
|
+
diagnostics: z15.readonly(z15.array(CheckDiagnosticSchema)),
|
|
11847
12083
|
ambientCredential: CheckAmbientCredentialSchema,
|
|
11848
12084
|
keychain: CheckKeychainSchema.optional(),
|
|
11849
|
-
settingsExposure:
|
|
12085
|
+
settingsExposure: z15.readonly(z15.array(CheckSettingsExposureSchema)),
|
|
11850
12086
|
credential: CheckCredentialSchema,
|
|
11851
12087
|
claudeVersion: CheckClaudeVersionSchema.optional()
|
|
11852
12088
|
});
|
|
@@ -11857,7 +12093,7 @@ init_preflight();
|
|
|
11857
12093
|
|
|
11858
12094
|
// src/frontdoor/controlSchemas.ts
|
|
11859
12095
|
import path30 from "node:path";
|
|
11860
|
-
import { z as
|
|
12096
|
+
import { z as z20 } from "zod";
|
|
11861
12097
|
|
|
11862
12098
|
// src/doctorReport.ts
|
|
11863
12099
|
init_claudeShim();
|
|
@@ -12052,24 +12288,24 @@ function credentialsFilePath(farmRoot) {
|
|
|
12052
12288
|
}
|
|
12053
12289
|
|
|
12054
12290
|
// src/codex/siwcStore.ts
|
|
12055
|
-
import { z as
|
|
12291
|
+
import { z as z19 } from "zod";
|
|
12056
12292
|
|
|
12057
12293
|
// src/codex/auth.ts
|
|
12058
|
-
import { z as
|
|
12059
|
-
var AuthFileSchema =
|
|
12060
|
-
tokens:
|
|
12061
|
-
access_token:
|
|
12062
|
-
refresh_token:
|
|
12063
|
-
id_token:
|
|
12064
|
-
account_id:
|
|
12294
|
+
import { z as z17 } from "zod";
|
|
12295
|
+
var AuthFileSchema = z17.looseObject({
|
|
12296
|
+
tokens: z17.looseObject({
|
|
12297
|
+
access_token: z17.string().optional(),
|
|
12298
|
+
refresh_token: z17.string().optional(),
|
|
12299
|
+
id_token: z17.string().optional(),
|
|
12300
|
+
account_id: z17.string().optional()
|
|
12065
12301
|
}).nullish(),
|
|
12066
|
-
last_refresh:
|
|
12302
|
+
last_refresh: z17.string().optional()
|
|
12067
12303
|
});
|
|
12068
|
-
var TokenGrantSchema =
|
|
12069
|
-
access_token:
|
|
12070
|
-
refresh_token:
|
|
12071
|
-
id_token:
|
|
12072
|
-
account_id:
|
|
12304
|
+
var TokenGrantSchema = z17.looseObject({
|
|
12305
|
+
access_token: z17.string().min(1).optional(),
|
|
12306
|
+
refresh_token: z17.string().min(1).optional(),
|
|
12307
|
+
id_token: z17.string().min(1).optional(),
|
|
12308
|
+
account_id: z17.string().min(1).optional()
|
|
12073
12309
|
});
|
|
12074
12310
|
var CodexAuthError = class extends Error {
|
|
12075
12311
|
constructor(message) {
|
|
@@ -12079,41 +12315,41 @@ var CodexAuthError = class extends Error {
|
|
|
12079
12315
|
};
|
|
12080
12316
|
|
|
12081
12317
|
// src/codex/siwc.ts
|
|
12082
|
-
import { z as
|
|
12318
|
+
import { z as z18 } from "zod";
|
|
12083
12319
|
var SIWC_RESOURCE = "https://api.openai.com/v1";
|
|
12084
12320
|
var SIWC_RESPONSES_URL = `${SIWC_RESOURCE}/responses`;
|
|
12085
12321
|
var SIWC_PLAN_SCOPE = "chatgpt.tokens.use.direct";
|
|
12086
|
-
var TokenResponseSchema =
|
|
12087
|
-
access_token:
|
|
12088
|
-
refresh_token:
|
|
12089
|
-
id_token:
|
|
12090
|
-
expires_in:
|
|
12091
|
-
scope:
|
|
12322
|
+
var TokenResponseSchema = z18.looseObject({
|
|
12323
|
+
access_token: z18.string().min(1),
|
|
12324
|
+
refresh_token: z18.string().min(1).optional(),
|
|
12325
|
+
id_token: z18.string().min(1).optional(),
|
|
12326
|
+
expires_in: z18.number().positive(),
|
|
12327
|
+
scope: z18.string().optional()
|
|
12092
12328
|
});
|
|
12093
|
-
var JwtHeaderSchema =
|
|
12094
|
-
var IdTokenClaimsSchema =
|
|
12095
|
-
iss:
|
|
12096
|
-
sub:
|
|
12097
|
-
aud:
|
|
12098
|
-
exp:
|
|
12099
|
-
nonce:
|
|
12100
|
-
email:
|
|
12329
|
+
var JwtHeaderSchema = z18.looseObject({ alg: z18.string(), kid: z18.string().optional() });
|
|
12330
|
+
var IdTokenClaimsSchema = z18.looseObject({
|
|
12331
|
+
iss: z18.string(),
|
|
12332
|
+
sub: z18.string().min(1),
|
|
12333
|
+
aud: z18.union([z18.string(), z18.array(z18.string())]),
|
|
12334
|
+
exp: z18.number(),
|
|
12335
|
+
nonce: z18.string().optional(),
|
|
12336
|
+
email: z18.string().optional()
|
|
12101
12337
|
});
|
|
12102
|
-
var JwksSchema =
|
|
12338
|
+
var JwksSchema = z18.object({ keys: z18.array(z18.looseObject({ kid: z18.string().optional(), kty: z18.string() })) });
|
|
12103
12339
|
|
|
12104
12340
|
// src/codex/siwcStore.ts
|
|
12105
|
-
var SiwcGrantSchema =
|
|
12106
|
-
clientId:
|
|
12107
|
-
sub:
|
|
12108
|
-
email:
|
|
12109
|
-
idToken:
|
|
12110
|
-
accessToken:
|
|
12111
|
-
refreshToken:
|
|
12112
|
-
scopes:
|
|
12341
|
+
var SiwcGrantSchema = z19.strictObject({
|
|
12342
|
+
clientId: z19.string().min(1),
|
|
12343
|
+
sub: z19.string().min(1),
|
|
12344
|
+
email: z19.string().optional(),
|
|
12345
|
+
idToken: z19.string().min(1),
|
|
12346
|
+
accessToken: z19.string().min(1),
|
|
12347
|
+
refreshToken: z19.string().min(1),
|
|
12348
|
+
scopes: z19.array(z19.string()).readonly(),
|
|
12113
12349
|
/** When the access token stops working, in milliseconds since the epoch. */
|
|
12114
|
-
expiresAt:
|
|
12350
|
+
expiresAt: z19.number()
|
|
12115
12351
|
});
|
|
12116
|
-
var SiwcFileSchema =
|
|
12352
|
+
var SiwcFileSchema = z19.strictObject({ registeredClientId: z19.string().min(1).optional(), grant: SiwcGrantSchema.optional() });
|
|
12117
12353
|
function parseSiwcFile(raw, filePath) {
|
|
12118
12354
|
let json;
|
|
12119
12355
|
try {
|
|
@@ -12273,17 +12509,17 @@ function pushProvider(push, entry, cacheEnv, signIn) {
|
|
|
12273
12509
|
push("provider", "fail", new LegacyProviderFileError(entry.path, conversion).message, entry.name);
|
|
12274
12510
|
return;
|
|
12275
12511
|
}
|
|
12276
|
-
const
|
|
12277
|
-
if (!
|
|
12278
|
-
push("provider", "fail", new ConfigValidationError(entry.path,
|
|
12512
|
+
const validated3 = ProviderSchema.safeParse(parsed);
|
|
12513
|
+
if (!validated3.success) {
|
|
12514
|
+
push("provider", "fail", new ConfigValidationError(entry.path, validated3.error.issues).message, entry.name);
|
|
12279
12515
|
return;
|
|
12280
12516
|
}
|
|
12281
|
-
const cache = cacheClause(cacheEnv, `provider ${entry.name}`,
|
|
12282
|
-
push("provider", cache.unreadable ? "fail" : "pass", `${entry.name} is valid (${describeProviderEndpoint(
|
|
12283
|
-
if (
|
|
12517
|
+
const cache = cacheClause(cacheEnv, `provider ${entry.name}`, validated3.data.credential);
|
|
12518
|
+
push("provider", cache.unreadable ? "fail" : "pass", `${entry.name} is valid (${describeProviderEndpoint(validated3.data)}, credential ${describeCredential(validated3.data.credential)})${cache.text}.`, entry.name);
|
|
12519
|
+
if (validated3.data.env?.ENABLE_TOOL_SEARCH === void 0) {
|
|
12284
12520
|
push("provider", "warn", `${entry.name} does not set ENABLE_TOOL_SEARCH: a session on this provider keeps Claude Code's own API as its base URL, so it defers MCP tool loading and sends tool_reference payloads the upstream backend must understand. Set ENABLE_TOOL_SEARCH=false in the provider's env block to load tools upfront instead, when the backend does not support them.`, entry.name);
|
|
12285
12521
|
}
|
|
12286
|
-
if (signIn !== void 0 && isCodexProvider(
|
|
12522
|
+
if (signIn !== void 0 && isCodexProvider(validated3.data) && validated3.data.codex?.login === "chatgpt-sign-in") {
|
|
12287
12523
|
const problem = signInProblem(signIn);
|
|
12288
12524
|
if (problem !== void 0) {
|
|
12289
12525
|
push("provider", "warn", `${entry.name} uses the Sign in with ChatGPT login, but ${problem}`, entry.name);
|
|
@@ -12351,13 +12587,13 @@ function runDoctor(params) {
|
|
|
12351
12587
|
pushLegacyName(push, params);
|
|
12352
12588
|
const profileSources = /* @__PURE__ */ new Map();
|
|
12353
12589
|
for (const entry of params.configProfiles) {
|
|
12354
|
-
const
|
|
12355
|
-
if (!
|
|
12356
|
-
push("config-profile", "fail",
|
|
12590
|
+
const validated3 = validateJson(ConfigProfileSchema, entry);
|
|
12591
|
+
if (!validated3.ok) {
|
|
12592
|
+
push("config-profile", "fail", validated3.message, entry.name);
|
|
12357
12593
|
continue;
|
|
12358
12594
|
}
|
|
12359
|
-
profileSources.set(entry.name, { name: entry.name, profile:
|
|
12360
|
-
checkPin("config-profile", entry.name, `Configuration profile "${entry.name}"`,
|
|
12595
|
+
profileSources.set(entry.name, { name: entry.name, profile: validated3.data });
|
|
12596
|
+
checkPin("config-profile", entry.name, `Configuration profile "${entry.name}"`, validated3.data.launch?.claudeVersion);
|
|
12361
12597
|
}
|
|
12362
12598
|
const loadProfile = (name) => profileSources.get(name);
|
|
12363
12599
|
for (const name of profileSources.keys()) {
|
|
@@ -12373,13 +12609,13 @@ function runDoctor(params) {
|
|
|
12373
12609
|
const validProfileNames = new Set(profileSources.keys());
|
|
12374
12610
|
const validIdentityNames = /* @__PURE__ */ new Set();
|
|
12375
12611
|
for (const entry of params.identities) {
|
|
12376
|
-
const
|
|
12377
|
-
if (!
|
|
12378
|
-
push("identity", "fail",
|
|
12612
|
+
const validated3 = validateJson(IdentitySchema, entry);
|
|
12613
|
+
if (!validated3.ok) {
|
|
12614
|
+
push("identity", "fail", validated3.message, entry.name);
|
|
12379
12615
|
continue;
|
|
12380
12616
|
}
|
|
12381
12617
|
validIdentityNames.add(entry.name);
|
|
12382
|
-
const defaultProfile =
|
|
12618
|
+
const defaultProfile = validated3.data.defaultConfigProfile;
|
|
12383
12619
|
if (defaultProfile !== void 0 && !validProfileNames.has(defaultProfile)) {
|
|
12384
12620
|
push(
|
|
12385
12621
|
"identity",
|
|
@@ -12388,7 +12624,7 @@ function runDoctor(params) {
|
|
|
12388
12624
|
entry.name
|
|
12389
12625
|
);
|
|
12390
12626
|
} else {
|
|
12391
|
-
const credential =
|
|
12627
|
+
const credential = validated3.data.credential;
|
|
12392
12628
|
const cache = credential === void 0 ? { text: "", unreadable: false } : cacheClause(params.credentialCache, `identity ${entry.name}`, credential);
|
|
12393
12629
|
push(
|
|
12394
12630
|
"identity",
|
|
@@ -12459,12 +12695,12 @@ function runDoctor(params) {
|
|
|
12459
12695
|
if (params.directoryRules.raw === void 0) {
|
|
12460
12696
|
push("directory-rules", "pass", "No directory-rules.json configured.");
|
|
12461
12697
|
} else {
|
|
12462
|
-
const
|
|
12463
|
-
if (!
|
|
12464
|
-
push("directory-rules", "fail",
|
|
12698
|
+
const validated3 = validateJson(DirectoryRulesSchema, params.directoryRules);
|
|
12699
|
+
if (!validated3.ok) {
|
|
12700
|
+
push("directory-rules", "fail", validated3.message);
|
|
12465
12701
|
} else {
|
|
12466
12702
|
push("directory-rules", "pass", `${params.directoryRules.path} is valid.`);
|
|
12467
|
-
for (const rule of
|
|
12703
|
+
for (const rule of validated3.data.rules) {
|
|
12468
12704
|
const badRefs = [];
|
|
12469
12705
|
if (rule.identity !== void 0 && !selectionExists(rule.identity)) {
|
|
12470
12706
|
badRefs.push(poolNameOf(rule.identity) === void 0 ? `identity "${rule.identity}"` : `pool "${poolNameOf(rule.identity) ?? ""}"`);
|
|
@@ -12484,11 +12720,11 @@ function runDoctor(params) {
|
|
|
12484
12720
|
if (params.globalConfig.raw === void 0) {
|
|
12485
12721
|
push("global-config", "pass", "No config.json configured.");
|
|
12486
12722
|
} else {
|
|
12487
|
-
const
|
|
12488
|
-
if (!
|
|
12489
|
-
push("global-config", "fail",
|
|
12723
|
+
const validated3 = validateJson(GlobalConfigSchema, params.globalConfig);
|
|
12724
|
+
if (!validated3.ok) {
|
|
12725
|
+
push("global-config", "fail", validated3.message);
|
|
12490
12726
|
} else {
|
|
12491
|
-
const defaultProfile =
|
|
12727
|
+
const defaultProfile = validated3.data.defaultConfigProfile;
|
|
12492
12728
|
if (defaultProfile !== void 0 && !validProfileNames.has(defaultProfile)) {
|
|
12493
12729
|
push(
|
|
12494
12730
|
"global-config",
|
|
@@ -12497,18 +12733,18 @@ function runDoctor(params) {
|
|
|
12497
12733
|
);
|
|
12498
12734
|
} else {
|
|
12499
12735
|
push("global-config", "pass", `${params.globalConfig.path} is valid.`);
|
|
12500
|
-
checkPin("global-config", void 0, "config.json",
|
|
12736
|
+
checkPin("global-config", void 0, "config.json", validated3.data.launch?.claudeVersion);
|
|
12501
12737
|
}
|
|
12502
12738
|
}
|
|
12503
12739
|
}
|
|
12504
12740
|
if (params.categoriesLocal.raw === void 0) {
|
|
12505
12741
|
push("categories-local", "pass", "No categories.local.json configured.");
|
|
12506
12742
|
} else {
|
|
12507
|
-
const
|
|
12743
|
+
const validated3 = validateJson(CategoryClassificationOverlaySchema, params.categoriesLocal);
|
|
12508
12744
|
push(
|
|
12509
12745
|
"categories-local",
|
|
12510
|
-
|
|
12511
|
-
|
|
12746
|
+
validated3.ok ? "pass" : "fail",
|
|
12747
|
+
validated3.ok ? `${params.categoriesLocal.path} is valid.` : validated3.message
|
|
12512
12748
|
);
|
|
12513
12749
|
}
|
|
12514
12750
|
if (params.headroom.state.raw === void 0) {
|
|
@@ -12516,11 +12752,11 @@ function runDoctor(params) {
|
|
|
12516
12752
|
} else if (tcpPortEraRecord(params.headroom.state.raw)) {
|
|
12517
12753
|
push("headroom", "pass", `${params.headroom.state.path} holds a previous release's TCP-port state record; the next launch through headroom claims over it.`);
|
|
12518
12754
|
} else {
|
|
12519
|
-
const
|
|
12520
|
-
if (!
|
|
12521
|
-
push("headroom", "fail",
|
|
12755
|
+
const validated3 = validateJson(HeadroomStateSchema, params.headroom.state);
|
|
12756
|
+
if (!validated3.ok) {
|
|
12757
|
+
push("headroom", "fail", validated3.message);
|
|
12522
12758
|
} else {
|
|
12523
|
-
const state =
|
|
12759
|
+
const state = validated3.data;
|
|
12524
12760
|
const supervisorAlive = state.supervisorPid !== void 0 && params.headroom.isRunning(state.supervisorPid);
|
|
12525
12761
|
const headroomAlive = state.headroomPid !== void 0 && params.headroom.isRunning(state.headroomPid);
|
|
12526
12762
|
if (state.supervisorPid === void 0) {
|
|
@@ -12736,90 +12972,90 @@ function collectDoctorReport(params) {
|
|
|
12736
12972
|
// src/frontdoor/controlSchemas.ts
|
|
12737
12973
|
init_schema2();
|
|
12738
12974
|
init_state();
|
|
12739
|
-
var UsageListOutputSchema =
|
|
12740
|
-
var UsageWindowsInputSchema =
|
|
12741
|
-
identity:
|
|
12742
|
-
provider:
|
|
12975
|
+
var UsageListOutputSchema = z20.strictObject({ snapshots: z20.readonly(z20.array(UsageSnapshotSchema)) });
|
|
12976
|
+
var UsageWindowsInputSchema = z20.strictObject({
|
|
12977
|
+
identity: z20.string().min(1),
|
|
12978
|
+
provider: z20.string().min(1).optional()
|
|
12743
12979
|
});
|
|
12744
|
-
var EffectiveWindowSchema =
|
|
12980
|
+
var EffectiveWindowSchema = z20.strictObject({
|
|
12745
12981
|
/** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
|
|
12746
|
-
reset:
|
|
12982
|
+
reset: z20.boolean(),
|
|
12747
12983
|
/** The fraction used: 0 for a reset window, otherwise what was last observed, absent when none was reported. */
|
|
12748
|
-
utilization:
|
|
12984
|
+
utilization: z20.number().optional(),
|
|
12749
12985
|
/** The reset instant, for a window that has not reset yet and reported one. */
|
|
12750
|
-
resetsAtMs:
|
|
12986
|
+
resetsAtMs: z20.number().optional(),
|
|
12751
12987
|
/** The window's own status, for a window that has not reset yet. */
|
|
12752
|
-
status:
|
|
12988
|
+
status: z20.string().optional()
|
|
12753
12989
|
});
|
|
12754
|
-
var UsageWindowsOutputSchema =
|
|
12755
|
-
identity:
|
|
12756
|
-
provider:
|
|
12990
|
+
var UsageWindowsOutputSchema = z20.strictObject({
|
|
12991
|
+
identity: z20.string(),
|
|
12992
|
+
provider: z20.string(),
|
|
12757
12993
|
/** When the rate-limit state the windows come from was observed. */
|
|
12758
|
-
observedAt:
|
|
12994
|
+
observedAt: z20.iso.datetime().optional(),
|
|
12759
12995
|
fiveHour: EffectiveWindowSchema.optional(),
|
|
12760
12996
|
sevenDay: EffectiveWindowSchema.optional()
|
|
12761
12997
|
});
|
|
12762
|
-
var UsageLiveOutputSchema =
|
|
12998
|
+
var UsageLiveOutputSchema = z20.strictObject({
|
|
12763
12999
|
/** 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. */
|
|
12764
13000
|
latest: RcLiveRateLimitSchema.optional(),
|
|
12765
13001
|
/** One observation per session whose stream has filed a rate_limit_event this door generation. */
|
|
12766
|
-
sessions:
|
|
13002
|
+
sessions: z20.readonly(z20.array(RcLiveRateLimitSchema))
|
|
12767
13003
|
});
|
|
12768
|
-
var FrontDoorSessionStatusSchema =
|
|
12769
|
-
pid:
|
|
12770
|
-
startedAt:
|
|
12771
|
-
alive:
|
|
13004
|
+
var FrontDoorSessionStatusSchema = z20.strictObject({
|
|
13005
|
+
pid: z20.int().positive(),
|
|
13006
|
+
startedAt: z20.number(),
|
|
13007
|
+
alive: z20.boolean()
|
|
12772
13008
|
});
|
|
12773
|
-
var HeadroomSocketTargetSchema =
|
|
12774
|
-
var FrontDoorStatusOutputSchema =
|
|
13009
|
+
var HeadroomSocketTargetSchema = z20.union([z20.strictObject({ socketPath: z20.string() }), z20.strictObject({ refused: z20.string() })]);
|
|
13010
|
+
var FrontDoorStatusOutputSchema = z20.strictObject({
|
|
12775
13011
|
state: FrontDoorStateSchema,
|
|
12776
|
-
supervisorAlive:
|
|
12777
|
-
sessions:
|
|
13012
|
+
supervisorAlive: z20.boolean(),
|
|
13013
|
+
sessions: z20.readonly(z20.array(FrontDoorSessionStatusSchema)),
|
|
12778
13014
|
headroomSocket: HeadroomSocketTargetSchema.optional(),
|
|
12779
|
-
logPath:
|
|
12780
|
-
logExists:
|
|
13015
|
+
logPath: z20.string(),
|
|
13016
|
+
logExists: z20.boolean()
|
|
12781
13017
|
});
|
|
12782
|
-
var FrontDoorSessionsOutputSchema =
|
|
12783
|
-
var CheckRunInputSchema =
|
|
12784
|
-
path:
|
|
12785
|
-
identity:
|
|
13018
|
+
var FrontDoorSessionsOutputSchema = z20.strictObject({ sessions: z20.readonly(z20.array(FrontDoorSessionStatusSchema)) });
|
|
13019
|
+
var CheckRunInputSchema = z20.strictObject({
|
|
13020
|
+
path: z20.string().min(1),
|
|
13021
|
+
identity: z20.string().min(1).optional()
|
|
12786
13022
|
}).refine((input) => path30.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
12787
|
-
var PoolPickInputSchema =
|
|
12788
|
-
pool:
|
|
12789
|
-
path:
|
|
13023
|
+
var PoolPickInputSchema = z20.strictObject({
|
|
13024
|
+
pool: z20.string().min(1),
|
|
13025
|
+
path: z20.string().min(1)
|
|
12790
13026
|
}).refine((input) => path30.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
12791
|
-
var DoctorFindingSchema =
|
|
12792
|
-
section:
|
|
12793
|
-
subject:
|
|
12794
|
-
severity:
|
|
12795
|
-
message:
|
|
13027
|
+
var DoctorFindingSchema = z20.strictObject({
|
|
13028
|
+
section: z20.enum(DOCTOR_SECTIONS),
|
|
13029
|
+
subject: z20.string().optional(),
|
|
13030
|
+
severity: z20.enum(DOCTOR_SEVERITIES),
|
|
13031
|
+
message: z20.string()
|
|
12796
13032
|
});
|
|
12797
|
-
var DoctorRunOutputSchema =
|
|
13033
|
+
var DoctorRunOutputSchema = z20.strictObject({
|
|
12798
13034
|
/** False exactly when any finding is a `fail`; a `warn` never fails the report on its own. */
|
|
12799
|
-
ok:
|
|
12800
|
-
findings:
|
|
12801
|
-
});
|
|
12802
|
-
var FrontDoorRestartOutputSchema =
|
|
12803
|
-
action:
|
|
12804
|
-
previousPid:
|
|
12805
|
-
});
|
|
12806
|
-
var UpdateCheckOutputSchema =
|
|
12807
|
-
current:
|
|
12808
|
-
latest:
|
|
12809
|
-
action:
|
|
12810
|
-
});
|
|
12811
|
-
var CodexSignInSchema =
|
|
12812
|
-
|
|
12813
|
-
|
|
12814
|
-
|
|
13035
|
+
ok: z20.boolean(),
|
|
13036
|
+
findings: z20.readonly(z20.array(DoctorFindingSchema))
|
|
13037
|
+
});
|
|
13038
|
+
var FrontDoorRestartOutputSchema = z20.strictObject({
|
|
13039
|
+
action: z20.literal("restarting"),
|
|
13040
|
+
previousPid: z20.int().positive()
|
|
13041
|
+
});
|
|
13042
|
+
var UpdateCheckOutputSchema = z20.strictObject({
|
|
13043
|
+
current: z20.string(),
|
|
13044
|
+
latest: z20.string(),
|
|
13045
|
+
action: z20.enum(["current", "available", "updated"])
|
|
13046
|
+
});
|
|
13047
|
+
var CodexSignInSchema = z20.discriminatedUnion("state", [
|
|
13048
|
+
z20.strictObject({ state: z20.literal("none") }),
|
|
13049
|
+
z20.strictObject({ state: z20.literal("signed-in"), email: z20.string().optional(), planScope: z20.boolean(), accessTokenExpiresAt: z20.number() }),
|
|
13050
|
+
z20.strictObject({ state: z20.literal("unreadable"), message: z20.string() })
|
|
12815
13051
|
]);
|
|
12816
|
-
var CodexStatusOutputSchema =
|
|
13052
|
+
var CodexStatusOutputSchema = z20.strictObject({
|
|
12817
13053
|
signIn: CodexSignInSchema,
|
|
12818
|
-
codexProviders:
|
|
13054
|
+
codexProviders: z20.readonly(z20.array(z20.string()))
|
|
12819
13055
|
});
|
|
12820
|
-
var CodexLogoutOutputSchema =
|
|
12821
|
-
hadGrant:
|
|
12822
|
-
revoked:
|
|
13056
|
+
var CodexLogoutOutputSchema = z20.strictObject({
|
|
13057
|
+
hadGrant: z20.boolean(),
|
|
13058
|
+
revoked: z20.boolean()
|
|
12823
13059
|
});
|
|
12824
13060
|
|
|
12825
13061
|
// src/frontdoor/codexApi.ts
|
|
@@ -12976,130 +13212,130 @@ init_providersStore();
|
|
|
12976
13212
|
|
|
12977
13213
|
// src/frontdoor/configSchemas.ts
|
|
12978
13214
|
init_schema();
|
|
12979
|
-
import { z as
|
|
12980
|
-
var RemovalConfirmationSchema =
|
|
12981
|
-
var CredentialWriteSchema = (targets) =>
|
|
12982
|
-
sources:
|
|
12983
|
-
target:
|
|
12984
|
-
cache:
|
|
12985
|
-
});
|
|
12986
|
-
var CredentialSummarySchema2 =
|
|
12987
|
-
target:
|
|
12988
|
-
sources:
|
|
12989
|
-
|
|
12990
|
-
|
|
12991
|
-
|
|
12992
|
-
|
|
12993
|
-
|
|
12994
|
-
|
|
12995
|
-
|
|
13215
|
+
import { z as z21 } from "zod";
|
|
13216
|
+
var RemovalConfirmationSchema = z21.boolean();
|
|
13217
|
+
var CredentialWriteSchema = (targets) => z21.strictObject({
|
|
13218
|
+
sources: z21.array(RemoteCredentialSourceSchema).min(1).optional(),
|
|
13219
|
+
target: z21.enum(targets).optional(),
|
|
13220
|
+
cache: z21.union([z21.literal(false), CredentialCacheSchema]).optional()
|
|
13221
|
+
});
|
|
13222
|
+
var CredentialSummarySchema2 = z21.strictObject({
|
|
13223
|
+
target: z21.enum(CREDENTIAL_TARGETS),
|
|
13224
|
+
sources: z21.readonly(z21.array(
|
|
13225
|
+
z21.discriminatedUnion("kind", [
|
|
13226
|
+
z21.strictObject({ kind: z21.literal("env"), variable: z21.string() }),
|
|
13227
|
+
z21.strictObject({ kind: z21.literal("file"), path: z21.string() }),
|
|
13228
|
+
z21.strictObject({ kind: z21.literal("command"), program: z21.string() }),
|
|
13229
|
+
z21.strictObject({ kind: z21.literal("op"), reference: z21.string() }),
|
|
13230
|
+
z21.strictObject({ kind: z21.literal("keychain"), service: z21.string(), account: z21.string().optional() }),
|
|
13231
|
+
z21.strictObject({ kind: z21.literal("literal") })
|
|
12996
13232
|
])
|
|
12997
13233
|
)),
|
|
12998
13234
|
cache: CredentialCacheSchema.optional()
|
|
12999
13235
|
});
|
|
13000
|
-
var mutationOutput = (kind, action) =>
|
|
13001
|
-
var storedMutationOutput = (kind, action, value) =>
|
|
13002
|
-
var IdentityValueSchema =
|
|
13003
|
-
name:
|
|
13004
|
-
defaultConfigProfile:
|
|
13005
|
-
allowAmbientCredential:
|
|
13236
|
+
var mutationOutput = (kind, action) => z21.strictObject({ action: z21.literal(action), kind: z21.literal(kind), name: z21.string() });
|
|
13237
|
+
var storedMutationOutput = (kind, action, value) => z21.strictObject({ action: z21.literal(action), kind: z21.literal(kind), name: z21.string(), value });
|
|
13238
|
+
var IdentityValueSchema = z21.strictObject({
|
|
13239
|
+
name: z21.string(),
|
|
13240
|
+
defaultConfigProfile: z21.string().optional(),
|
|
13241
|
+
allowAmbientCredential: z21.boolean(),
|
|
13006
13242
|
credential: CredentialSummarySchema2.optional()
|
|
13007
13243
|
});
|
|
13008
13244
|
var ProfileValueSchema = ConfigProfileSchema.omit({ $schema: true });
|
|
13009
|
-
var ProviderValueSchema =
|
|
13010
|
-
name:
|
|
13011
|
-
kind:
|
|
13012
|
-
displayName:
|
|
13013
|
-
baseUrl:
|
|
13245
|
+
var ProviderValueSchema = z21.strictObject({
|
|
13246
|
+
name: z21.string(),
|
|
13247
|
+
kind: z21.enum(PROVIDER_KINDS),
|
|
13248
|
+
displayName: z21.string(),
|
|
13249
|
+
baseUrl: z21.string().optional(),
|
|
13014
13250
|
codex: CodexProviderConfigSchema.optional(),
|
|
13015
13251
|
credential: CredentialSummarySchema2,
|
|
13016
|
-
env:
|
|
13252
|
+
env: z21.record(z21.string(), z21.string()).optional()
|
|
13017
13253
|
});
|
|
13018
|
-
var ConfigNameInputSchema =
|
|
13254
|
+
var ConfigNameInputSchema = z21.strictObject({ name: z21.string().min(1) });
|
|
13019
13255
|
var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
|
|
13020
|
-
var ConfigIdentitySetInputSchema =
|
|
13021
|
-
name:
|
|
13022
|
-
defaultConfigProfile:
|
|
13023
|
-
allowAmbientCredential:
|
|
13024
|
-
credential:
|
|
13256
|
+
var ConfigIdentitySetInputSchema = z21.strictObject({
|
|
13257
|
+
name: z21.string().min(1),
|
|
13258
|
+
defaultConfigProfile: z21.union([z21.string().min(1), z21.literal(false)]).optional(),
|
|
13259
|
+
allowAmbientCredential: z21.boolean().optional(),
|
|
13260
|
+
credential: z21.union([z21.literal(false), CredentialWriteSchema(CREDENTIAL_TARGETS)]).optional()
|
|
13025
13261
|
});
|
|
13026
13262
|
var ConfigIdentitySetOutputSchema = storedMutationOutput("identity", "updated", IdentityValueSchema);
|
|
13027
|
-
var ConfigIdentityRemoveInputSchema =
|
|
13263
|
+
var ConfigIdentityRemoveInputSchema = z21.strictObject({ name: z21.string().min(1), confirm: RemovalConfirmationSchema });
|
|
13028
13264
|
var ConfigIdentityRemoveOutputSchema = mutationOutput("identity", "removed");
|
|
13029
13265
|
var ConfigIdentityUseOutputSchema = mutationOutput("identity", "selected");
|
|
13030
|
-
var ConfigProfileAddInputSchema =
|
|
13031
|
-
name:
|
|
13032
|
-
extends:
|
|
13033
|
-
description:
|
|
13266
|
+
var ConfigProfileAddInputSchema = z21.strictObject({
|
|
13267
|
+
name: z21.string().min(1),
|
|
13268
|
+
extends: z21.array(z21.string().min(1)).optional(),
|
|
13269
|
+
description: z21.string().optional()
|
|
13034
13270
|
});
|
|
13035
13271
|
var ConfigProfileAddOutputSchema = storedMutationOutput("profile", "created", ProfileValueSchema);
|
|
13036
|
-
var ConfigProfileSetInputSchema =
|
|
13037
|
-
name:
|
|
13038
|
-
category:
|
|
13039
|
-
entry:
|
|
13040
|
-
extends:
|
|
13041
|
-
description:
|
|
13042
|
-
launch:
|
|
13043
|
-
skipPermissions:
|
|
13044
|
-
remoteControl:
|
|
13045
|
-
headroom:
|
|
13046
|
-
trackUsage:
|
|
13047
|
-
provider:
|
|
13048
|
-
claudeVersion:
|
|
13272
|
+
var ConfigProfileSetInputSchema = z21.strictObject({
|
|
13273
|
+
name: z21.string().min(1),
|
|
13274
|
+
category: z21.record(z21.string(), z21.boolean()).optional(),
|
|
13275
|
+
entry: z21.record(z21.string(), z21.boolean()).optional(),
|
|
13276
|
+
extends: z21.union([z21.array(z21.string().min(1)), z21.literal(false)]).optional(),
|
|
13277
|
+
description: z21.union([z21.string(), z21.literal(false)]).optional(),
|
|
13278
|
+
launch: z21.strictObject({
|
|
13279
|
+
skipPermissions: z21.boolean().optional(),
|
|
13280
|
+
remoteControl: z21.boolean().optional(),
|
|
13281
|
+
headroom: z21.boolean().optional(),
|
|
13282
|
+
trackUsage: z21.boolean().optional(),
|
|
13283
|
+
provider: z21.union([z21.string().min(1), z21.literal(false)]).optional(),
|
|
13284
|
+
claudeVersion: z21.union([z21.string().min(1), z21.literal(false)]).optional()
|
|
13049
13285
|
}).optional()
|
|
13050
13286
|
});
|
|
13051
13287
|
var ConfigProfileSetOutputSchema = storedMutationOutput("profile", "updated", ProfileValueSchema);
|
|
13052
|
-
var ConfigProfileRemoveInputSchema =
|
|
13288
|
+
var ConfigProfileRemoveInputSchema = z21.strictObject({ name: z21.string().min(1), confirm: RemovalConfirmationSchema });
|
|
13053
13289
|
var ConfigProfileRemoveOutputSchema = mutationOutput("profile", "removed");
|
|
13054
13290
|
var ConfigProfileUseOutputSchema = mutationOutput("profile", "selected");
|
|
13055
|
-
var PoolMembersInputSchema =
|
|
13056
|
-
var ConfigPoolAddInputSchema =
|
|
13057
|
-
name:
|
|
13291
|
+
var PoolMembersInputSchema = z21.array(z21.string().min(1)).min(1);
|
|
13292
|
+
var ConfigPoolAddInputSchema = z21.strictObject({
|
|
13293
|
+
name: z21.string().min(1),
|
|
13058
13294
|
identities: PoolMembersInputSchema,
|
|
13059
|
-
preference:
|
|
13295
|
+
preference: z21.enum(POOL_PREFERENCES).optional()
|
|
13060
13296
|
});
|
|
13061
13297
|
var ConfigPoolAddOutputSchema = storedMutationOutput("pool", "created", PoolSchema);
|
|
13062
|
-
var ConfigPoolSetInputSchema =
|
|
13063
|
-
name:
|
|
13298
|
+
var ConfigPoolSetInputSchema = z21.strictObject({
|
|
13299
|
+
name: z21.string().min(1),
|
|
13064
13300
|
identities: PoolMembersInputSchema.optional(),
|
|
13065
|
-
preference:
|
|
13301
|
+
preference: z21.union([z21.enum(POOL_PREFERENCES), z21.literal(false)]).optional()
|
|
13066
13302
|
});
|
|
13067
13303
|
var ConfigPoolSetOutputSchema = storedMutationOutput("pool", "updated", PoolSchema);
|
|
13068
|
-
var ConfigPoolRemoveInputSchema =
|
|
13304
|
+
var ConfigPoolRemoveInputSchema = z21.strictObject({ name: z21.string().min(1), confirm: RemovalConfirmationSchema });
|
|
13069
13305
|
var ConfigPoolRemoveOutputSchema = mutationOutput("pool", "removed");
|
|
13070
13306
|
var ConfigPoolUseOutputSchema = mutationOutput("pool", "selected");
|
|
13071
|
-
var ConfigProviderAddInputSchema =
|
|
13072
|
-
name:
|
|
13073
|
-
kind:
|
|
13074
|
-
displayName:
|
|
13075
|
-
baseUrl:
|
|
13307
|
+
var ConfigProviderAddInputSchema = z21.strictObject({
|
|
13308
|
+
name: z21.string().min(1),
|
|
13309
|
+
kind: z21.enum(PROVIDER_KINDS).optional(),
|
|
13310
|
+
displayName: z21.string().min(1),
|
|
13311
|
+
baseUrl: z21.string().min(1).optional(),
|
|
13076
13312
|
credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).required({ sources: true }),
|
|
13077
13313
|
codex: CodexProviderConfigSchema.optional()
|
|
13078
13314
|
});
|
|
13079
13315
|
var ConfigProviderAddOutputSchema = storedMutationOutput("provider", "created", ProviderValueSchema);
|
|
13080
|
-
var ConfigProviderSetInputSchema =
|
|
13081
|
-
name:
|
|
13082
|
-
displayName:
|
|
13083
|
-
baseUrl:
|
|
13316
|
+
var ConfigProviderSetInputSchema = z21.strictObject({
|
|
13317
|
+
name: z21.string().min(1),
|
|
13318
|
+
displayName: z21.string().min(1).optional(),
|
|
13319
|
+
baseUrl: z21.string().min(1).optional(),
|
|
13084
13320
|
credential: CredentialWriteSchema(PROVIDER_CREDENTIAL_TARGETS).optional(),
|
|
13085
13321
|
codex: CodexProviderConfigSchema.optional()
|
|
13086
13322
|
});
|
|
13087
13323
|
var ConfigProviderSetOutputSchema = storedMutationOutput("provider", "updated", ProviderValueSchema);
|
|
13088
|
-
var ConfigProviderRemoveInputSchema =
|
|
13324
|
+
var ConfigProviderRemoveInputSchema = z21.strictObject({ name: z21.string().min(1), confirm: RemovalConfirmationSchema });
|
|
13089
13325
|
var ConfigProviderRemoveOutputSchema = mutationOutput("provider", "removed");
|
|
13090
|
-
var ConfigRuleAddInputSchema =
|
|
13091
|
-
path:
|
|
13092
|
-
configProfile:
|
|
13093
|
-
identity:
|
|
13326
|
+
var ConfigRuleAddInputSchema = z21.strictObject({
|
|
13327
|
+
path: z21.string().min(1),
|
|
13328
|
+
configProfile: z21.string().min(1).optional(),
|
|
13329
|
+
identity: z21.string().min(1).optional()
|
|
13094
13330
|
});
|
|
13095
13331
|
var ConfigRuleAddOutputSchema = storedMutationOutput("rule", "created", DirectoryRuleSchema);
|
|
13096
|
-
var ConfigRuleSetInputSchema =
|
|
13097
|
-
path:
|
|
13098
|
-
configProfile:
|
|
13099
|
-
identity:
|
|
13332
|
+
var ConfigRuleSetInputSchema = z21.strictObject({
|
|
13333
|
+
path: z21.string().min(1),
|
|
13334
|
+
configProfile: z21.union([z21.string().min(1), z21.literal(false)]).optional(),
|
|
13335
|
+
identity: z21.union([z21.string().min(1), z21.literal(false)]).optional()
|
|
13100
13336
|
});
|
|
13101
13337
|
var ConfigRuleSetOutputSchema = storedMutationOutput("rule", "updated", DirectoryRuleSchema);
|
|
13102
|
-
var ConfigRuleRemoveInputSchema =
|
|
13338
|
+
var ConfigRuleRemoveInputSchema = z21.strictObject({ path: z21.string().min(1), confirm: RemovalConfirmationSchema });
|
|
13103
13339
|
var ConfigRuleRemoveOutputSchema = mutationOutput("rule", "removed");
|
|
13104
13340
|
|
|
13105
13341
|
// src/frontdoor/configApi.ts
|
|
@@ -13405,41 +13641,41 @@ import { openapi as openapi4 } from "@orpc/openapi";
|
|
|
13405
13641
|
import { eventIterator as eventIterator2, withEventMeta as withEventMeta2 } from "@orpc/server";
|
|
13406
13642
|
|
|
13407
13643
|
// src/frontdoor/eventSchemas.ts
|
|
13408
|
-
import { z as
|
|
13644
|
+
import { z as z22 } from "zod";
|
|
13409
13645
|
var DOOR_EVENT_SOURCE_RC = "rc";
|
|
13410
13646
|
var LAUNCH_EVENT_SOURCE = "launch";
|
|
13411
13647
|
var USAGE_EVENT_SOURCE = "usage";
|
|
13412
13648
|
var DOOR_HEALTH_EVENT_SOURCE = "door";
|
|
13413
13649
|
var QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
|
|
13414
|
-
var DoorEventSchema =
|
|
13415
|
-
source:
|
|
13650
|
+
var DoorEventSchema = z22.strictObject({
|
|
13651
|
+
source: z22.string().min(1),
|
|
13416
13652
|
/** A positive integer because the backbone's counters start at one and only ever increase. */
|
|
13417
|
-
sequence:
|
|
13418
|
-
payload:
|
|
13419
|
-
});
|
|
13420
|
-
var DoorEventSourceQuerySchema =
|
|
13421
|
-
sources:
|
|
13422
|
-
});
|
|
13423
|
-
var LaunchLifecycleEventSchema =
|
|
13424
|
-
kind:
|
|
13425
|
-
pid:
|
|
13426
|
-
startedAt:
|
|
13427
|
-
observedAt:
|
|
13428
|
-
});
|
|
13429
|
-
var DoorHealthEventSchema =
|
|
13430
|
-
|
|
13431
|
-
|
|
13432
|
-
|
|
13433
|
-
|
|
13653
|
+
sequence: z22.number().int().positive(),
|
|
13654
|
+
payload: z22.unknown()
|
|
13655
|
+
});
|
|
13656
|
+
var DoorEventSourceQuerySchema = z22.strictObject({
|
|
13657
|
+
sources: z22.array(z22.string().min(1)).min(1).optional()
|
|
13658
|
+
});
|
|
13659
|
+
var LaunchLifecycleEventSchema = z22.strictObject({
|
|
13660
|
+
kind: z22.enum(["registered", "pruned", "ended"]),
|
|
13661
|
+
pid: z22.number().int().positive(),
|
|
13662
|
+
startedAt: z22.number(),
|
|
13663
|
+
observedAt: z22.number()
|
|
13664
|
+
});
|
|
13665
|
+
var DoorHealthEventSchema = z22.discriminatedUnion("kind", [
|
|
13666
|
+
z22.strictObject({ kind: z22.literal("generation"), pid: z22.number().int().positive(), providerPort: z22.number().int().positive(), connectPort: z22.number().int().positive(), directPort: z22.number().int().positive(), observedAt: z22.number() }),
|
|
13667
|
+
z22.strictObject({ kind: z22.literal("listenerFailed"), pid: z22.number().int().positive(), listener: z22.enum(["provider", "connect", "direct"]), message: z22.string(), observedAt: z22.number() }),
|
|
13668
|
+
z22.strictObject({ kind: z22.literal("binaryTurnover"), pid: z22.number().int().positive(), observedAt: z22.number() }),
|
|
13669
|
+
z22.strictObject({ kind: z22.literal("idleShutdown"), pid: z22.number().int().positive(), observedAt: z22.number() })
|
|
13434
13670
|
]);
|
|
13435
|
-
var QuotaExpiringEventSchema =
|
|
13436
|
-
identity:
|
|
13437
|
-
provider:
|
|
13438
|
-
window:
|
|
13671
|
+
var QuotaExpiringEventSchema = z22.strictObject({
|
|
13672
|
+
identity: z22.string().min(1),
|
|
13673
|
+
provider: z22.string().min(1),
|
|
13674
|
+
window: z22.enum(["fiveHour", "sevenDay"]),
|
|
13439
13675
|
/** 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. */
|
|
13440
|
-
utilization:
|
|
13441
|
-
resetsAt:
|
|
13442
|
-
observedAt:
|
|
13676
|
+
utilization: z22.number().min(0).max(1),
|
|
13677
|
+
resetsAt: z22.iso.datetime(),
|
|
13678
|
+
observedAt: z22.number()
|
|
13443
13679
|
});
|
|
13444
13680
|
|
|
13445
13681
|
// src/frontdoor/eventsApi.ts
|
|
@@ -13523,51 +13759,51 @@ import { openapi as openapi6 } from "@orpc/openapi";
|
|
|
13523
13759
|
|
|
13524
13760
|
// src/frontdoor/launchSchemas.ts
|
|
13525
13761
|
import path31 from "node:path";
|
|
13526
|
-
import { z as
|
|
13762
|
+
import { z as z23 } from "zod";
|
|
13527
13763
|
init_claudeVersion();
|
|
13528
13764
|
init_identity();
|
|
13529
|
-
var LaunchResolveInputSchema =
|
|
13530
|
-
path:
|
|
13765
|
+
var LaunchResolveInputSchema = z23.strictObject({
|
|
13766
|
+
path: z23.string().min(1),
|
|
13531
13767
|
/** `@name`, launch flags, then the arguments for `claude`; empty for a bare launch. */
|
|
13532
|
-
argv:
|
|
13768
|
+
argv: z23.readonly(z23.array(z23.string())).optional(),
|
|
13533
13769
|
/** 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. */
|
|
13534
|
-
env:
|
|
13770
|
+
env: z23.record(z23.string(), z23.string()).optional()
|
|
13535
13771
|
}).refine((input) => path31.isAbsolute(input.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
|
|
13536
|
-
var LaunchPoolDecisionSchema =
|
|
13537
|
-
name:
|
|
13538
|
-
reasons:
|
|
13539
|
-
movedOff:
|
|
13540
|
-
});
|
|
13541
|
-
var LaunchDecisionSchema =
|
|
13542
|
-
identity:
|
|
13543
|
-
identitySource:
|
|
13772
|
+
var LaunchPoolDecisionSchema = z23.strictObject({
|
|
13773
|
+
name: z23.string(),
|
|
13774
|
+
reasons: z23.readonly(z23.array(z23.string())),
|
|
13775
|
+
movedOff: z23.strictObject({ identity: z23.string(), reason: z23.string() }).optional()
|
|
13776
|
+
});
|
|
13777
|
+
var LaunchDecisionSchema = z23.strictObject({
|
|
13778
|
+
identity: z23.string().optional(),
|
|
13779
|
+
identitySource: z23.enum(IDENTITY_DECISION_SOURCES),
|
|
13544
13780
|
pool: LaunchPoolDecisionSchema.optional(),
|
|
13545
|
-
configDirEscapeHatch:
|
|
13546
|
-
configDir:
|
|
13547
|
-
configProfile:
|
|
13548
|
-
configProfileSource:
|
|
13549
|
-
provider:
|
|
13550
|
-
});
|
|
13551
|
-
var LaunchFlagsSchema =
|
|
13552
|
-
skipPermissions:
|
|
13553
|
-
remoteControl:
|
|
13554
|
-
headroom:
|
|
13555
|
-
trackUsage:
|
|
13556
|
-
});
|
|
13557
|
-
var LaunchResolveOutputSchema =
|
|
13781
|
+
configDirEscapeHatch: z23.boolean(),
|
|
13782
|
+
configDir: z23.string().optional(),
|
|
13783
|
+
configProfile: z23.string().optional(),
|
|
13784
|
+
configProfileSource: z23.enum(CONFIG_PROFILE_DECISION_SOURCES),
|
|
13785
|
+
provider: z23.string().optional()
|
|
13786
|
+
});
|
|
13787
|
+
var LaunchFlagsSchema = z23.strictObject({
|
|
13788
|
+
skipPermissions: z23.boolean(),
|
|
13789
|
+
remoteControl: z23.boolean(),
|
|
13790
|
+
headroom: z23.boolean(),
|
|
13791
|
+
trackUsage: z23.boolean()
|
|
13792
|
+
});
|
|
13793
|
+
var LaunchResolveOutputSchema = z23.strictObject({
|
|
13558
13794
|
decision: LaunchDecisionSchema,
|
|
13559
13795
|
flags: LaunchFlagsSchema,
|
|
13560
|
-
claudeVersion:
|
|
13796
|
+
claudeVersion: z23.strictObject({ version: z23.string(), source: z23.enum(CLAUDE_VERSION_SOURCES) }).optional(),
|
|
13561
13797
|
/** The real `claude` binary the launch would spawn, on the door's host. */
|
|
13562
|
-
bin:
|
|
13798
|
+
bin: z23.string(),
|
|
13563
13799
|
/** The arguments the launch would pass it: the tool's own flags, then `CLAUDE_EXTRA_FLAGS`, then the caller's own. */
|
|
13564
|
-
args:
|
|
13800
|
+
args: z23.readonly(z23.array(z23.string())),
|
|
13565
13801
|
/** The credential the launch would authenticate with, by target and source kinds. Absent when none applies. */
|
|
13566
|
-
credential:
|
|
13567
|
-
routing:
|
|
13802
|
+
credential: z23.strictObject({ subject: z23.enum(["provider", "identity"]), name: z23.string(), summary: CredentialSummarySchema }).optional(),
|
|
13803
|
+
routing: z23.strictObject({ frontDoor: z23.boolean(), headroom: z23.boolean() }),
|
|
13568
13804
|
/** The names of the environment variables the launch would set or unset, sorted. Values are not reported. */
|
|
13569
|
-
environment:
|
|
13570
|
-
warnings:
|
|
13805
|
+
environment: z23.readonly(z23.array(z23.string())),
|
|
13806
|
+
warnings: z23.readonly(z23.array(z23.string()))
|
|
13571
13807
|
});
|
|
13572
13808
|
|
|
13573
13809
|
// src/frontdoor/launchApi.ts
|
|
@@ -15834,6 +16070,8 @@ init_ownCli();
|
|
|
15834
16070
|
export {
|
|
15835
16071
|
AMBIENT_CREDENTIAL_VARS,
|
|
15836
16072
|
CHECK_CREDENTIAL_APPLIES,
|
|
16073
|
+
CODEX_APP_SERVER_GENERATED_AGAINST,
|
|
16074
|
+
CODEX_APP_SERVER_TIMEOUT_MS,
|
|
15837
16075
|
CONNECT_INTERCEPT_HOST,
|
|
15838
16076
|
CONNECT_INTERCEPT_HOSTS,
|
|
15839
16077
|
CONNECT_LIMITS,
|
|
@@ -15844,7 +16082,12 @@ export {
|
|
|
15844
16082
|
CheckReportJsonSchema,
|
|
15845
16083
|
CheckRunInputSchema,
|
|
15846
16084
|
CliError,
|
|
16085
|
+
CodexAccountReadSchema,
|
|
16086
|
+
CodexAppServerProtocolError,
|
|
16087
|
+
CodexAppServerRequestError,
|
|
16088
|
+
CodexAppServerUnavailableError,
|
|
15847
16089
|
CodexLogoutOutputSchema,
|
|
16090
|
+
CodexRateLimitsReadSchema,
|
|
15848
16091
|
CodexSignInSchema,
|
|
15849
16092
|
CodexStatusOutputSchema,
|
|
15850
16093
|
ConfigIdentityAddOutputSchema,
|
|
@@ -16102,6 +16345,8 @@ export {
|
|
|
16102
16345
|
rcSelfHostFromEnv,
|
|
16103
16346
|
rcWebFetchAllowsPrivateFromEnv,
|
|
16104
16347
|
readActiveIdentity2 as readActiveIdentity,
|
|
16348
|
+
readCodexAccount,
|
|
16349
|
+
readCodexRateLimits,
|
|
16105
16350
|
readDirectoryRules,
|
|
16106
16351
|
readFarmManifest,
|
|
16107
16352
|
readFrontDoorControlMaterial,
|
|
@@ -16113,6 +16358,7 @@ export {
|
|
|
16113
16358
|
readRcSelfHostRecord,
|
|
16114
16359
|
readRcSessionFile,
|
|
16115
16360
|
readUsageSnapshot,
|
|
16361
|
+
realCodexAppServerPort,
|
|
16116
16362
|
realConnectCertStore,
|
|
16117
16363
|
realConnectEffects,
|
|
16118
16364
|
realRcControlTransport,
|