agent-shim 8.6.0 → 8.8.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 +277 -209
- package/dist/index.cjs +2021 -1904
- package/dist/index.mjs +2008 -1900
- package/dist/types/index.d.ts +263 -60
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -2049,6 +2049,73 @@ interface RunFrontDoorSupervisorOptions {
|
|
|
2049
2049
|
*/
|
|
2050
2050
|
declare function runFrontDoorSupervisor(idleShutdownMinutes: number, ports: FrontDoorSupervisorPorts, options?: RunFrontDoorSupervisorOptions): Promise<number>;
|
|
2051
2051
|
|
|
2052
|
+
/** One routed request, appended to the usage log when its response has finished. */
|
|
2053
|
+
declare const UsageRecordSchema: z.ZodObject<{
|
|
2054
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
2055
|
+
at: z.ZodISODateTime;
|
|
2056
|
+
identity: z.ZodOptional<z.ZodString>;
|
|
2057
|
+
provider: z.ZodString;
|
|
2058
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
2059
|
+
project: z.ZodOptional<z.ZodString>;
|
|
2060
|
+
route: z.ZodString;
|
|
2061
|
+
method: z.ZodString;
|
|
2062
|
+
endpoint: z.ZodString;
|
|
2063
|
+
model: z.ZodOptional<z.ZodString>;
|
|
2064
|
+
status: z.ZodNumber;
|
|
2065
|
+
latencyMs: z.ZodNumber;
|
|
2066
|
+
durationMs: z.ZodNumber;
|
|
2067
|
+
outcome: z.ZodEnum<{
|
|
2068
|
+
completed: "completed";
|
|
2069
|
+
aborted: "aborted";
|
|
2070
|
+
}>;
|
|
2071
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
2072
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
2073
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
2074
|
+
cacheCreationInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
2075
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
2076
|
+
}, z.core.$strict>>;
|
|
2077
|
+
rateLimitHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2078
|
+
limit: z.ZodOptional<z.ZodObject<{
|
|
2079
|
+
kind: z.ZodEnum<{
|
|
2080
|
+
"rate-limited": "rate-limited";
|
|
2081
|
+
"quota-exhausted": "quota-exhausted";
|
|
2082
|
+
}>;
|
|
2083
|
+
retryAfterSeconds: z.ZodOptional<z.ZodNumber>;
|
|
2084
|
+
resetAt: z.ZodOptional<z.ZodISODateTime>;
|
|
2085
|
+
window: z.ZodOptional<z.ZodString>;
|
|
2086
|
+
evidence: z.ZodArray<z.ZodString>;
|
|
2087
|
+
}, z.core.$strict>>;
|
|
2088
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
2089
|
+
}, z.core.$strict>;
|
|
2090
|
+
type UsageRecord = z.infer<typeof UsageRecordSchema>;
|
|
2091
|
+
/** One quota window from Anthropic's unified rate-limit headers. */
|
|
2092
|
+
declare const QuotaWindowSchema: z.ZodObject<{
|
|
2093
|
+
utilization: z.ZodOptional<z.ZodNumber>;
|
|
2094
|
+
resetsAt: z.ZodOptional<z.ZodISODateTime>;
|
|
2095
|
+
status: z.ZodOptional<z.ZodString>;
|
|
2096
|
+
}, z.core.$strict>;
|
|
2097
|
+
type QuotaWindow = z.infer<typeof QuotaWindowSchema>;
|
|
2098
|
+
/**
|
|
2099
|
+
* The account fields copied from an identity's stored Claude login (`oauthAccount` in the identity's `.claude.json`): who the account is and which plan and tier it is on. Never the token, which Claude Code keeps elsewhere. Each field is present only when the stored login has it; a setup-token identity has no profile scope and so none of them (see issue #44).
|
|
2100
|
+
*/
|
|
2101
|
+
declare const AccountMetadataSchema: z.ZodObject<{
|
|
2102
|
+
accountUuid: z.ZodOptional<z.ZodString>;
|
|
2103
|
+
emailAddress: z.ZodOptional<z.ZodString>;
|
|
2104
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
2105
|
+
organizationUuid: z.ZodOptional<z.ZodString>;
|
|
2106
|
+
organizationName: z.ZodOptional<z.ZodString>;
|
|
2107
|
+
organizationType: z.ZodOptional<z.ZodString>;
|
|
2108
|
+
organizationRole: z.ZodOptional<z.ZodString>;
|
|
2109
|
+
workspaceRole: z.ZodOptional<z.ZodString>;
|
|
2110
|
+
billingType: z.ZodOptional<z.ZodString>;
|
|
2111
|
+
seatTier: z.ZodOptional<z.ZodString>;
|
|
2112
|
+
organizationRateLimitTier: z.ZodOptional<z.ZodString>;
|
|
2113
|
+
userRateLimitTier: z.ZodOptional<z.ZodString>;
|
|
2114
|
+
hasExtraUsageEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
2115
|
+
subscriptionCreatedAt: z.ZodOptional<z.ZodString>;
|
|
2116
|
+
accountCreatedAt: z.ZodOptional<z.ZodString>;
|
|
2117
|
+
}, z.core.$strict>;
|
|
2118
|
+
type AccountMetadata = z.infer<typeof AccountMetadataSchema>;
|
|
2052
2119
|
/**
|
|
2053
2120
|
* The latest state for one identity, rewritten atomically after each recorded response: the snapshot file other tools read (`~/.agent-shim/usage/snapshots/<identity>.json`) without shelling out to `agent-shim`.
|
|
2054
2121
|
*/
|
|
@@ -2145,6 +2212,175 @@ declare function readUsageSnapshot(fs: Pick<FarmFs, "readFileUtf8">, snapshotsDi
|
|
|
2145
2212
|
/** Reads every identity's snapshot, by identity name. */
|
|
2146
2213
|
declare function listUsageSnapshots(fs: UsageReadFs, snapshotsDir: string): readonly UsageSnapshot[];
|
|
2147
2214
|
|
|
2215
|
+
/** A quota window as it stands at a given instant. */
|
|
2216
|
+
interface EffectiveWindow {
|
|
2217
|
+
/** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
|
|
2218
|
+
readonly reset: boolean;
|
|
2219
|
+
/** The fraction used: 0 for a reset window, otherwise what was last observed (a lower bound, since utilisation only rises within a window), or undefined when none was reported. */
|
|
2220
|
+
readonly utilization?: number;
|
|
2221
|
+
/** The reset instant, for a window that has not reset yet and reported one. */
|
|
2222
|
+
readonly resetsAtMs?: number;
|
|
2223
|
+
/** The window's own status, for a window that has not reset yet. */
|
|
2224
|
+
readonly status?: string;
|
|
2225
|
+
}
|
|
2226
|
+
/** Reads a recorded window at `nowMs`: a window whose reset has passed is empty and carries no status, so every consumer agrees on what an old observation still means. */
|
|
2227
|
+
declare function effectiveWindow(window: Readonly<QuotaWindow>, nowMs: number): EffectiveWindow;
|
|
2228
|
+
|
|
2229
|
+
/**
|
|
2230
|
+
* What an account's plan means for picking it: a subscription with a capacity relative to the smallest paid tier, or an account billed by use.
|
|
2231
|
+
*/
|
|
2232
|
+
declare const PlanClassSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
2233
|
+
kind: z.ZodLiteral<"subscription">;
|
|
2234
|
+
capacity: z.ZodNumber;
|
|
2235
|
+
recognised: z.ZodBoolean;
|
|
2236
|
+
tier: z.ZodOptional<z.ZodString>;
|
|
2237
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
2238
|
+
kind: z.ZodLiteral<"pay-per-use">;
|
|
2239
|
+
tier: z.ZodOptional<z.ZodString>;
|
|
2240
|
+
}, z.core.$strict>]>;
|
|
2241
|
+
type PlanClass = z.infer<typeof PlanClassSchema>;
|
|
2242
|
+
/**
|
|
2243
|
+
* Classifies an account from the rate-limit tier of its stored login (`organizationRateLimitTier`, which decides the organisation's limits, then `userRateLimitTier`). The tier strings are free text on Anthropic's side, so only the shapes seen are read: a trailing `<n>x` is that multiple, a bare `pro` is 1, a `zero` tier is pay-per-use. Anything else is a subscription of unrecognised size, counted as 1 and marked so the ranking can say it guessed.
|
|
2244
|
+
*/
|
|
2245
|
+
declare function planOf(account: AccountMetadata | undefined): PlanClass;
|
|
2246
|
+
|
|
2247
|
+
/** Anthropic's longest prompt-cache lifetime (the one-hour tier): a conversation resumed within it still has a warm cache on the account that served it, and the cache is per organisation, so it is lost by switching. */
|
|
2248
|
+
declare const PROMPT_CACHE_TTL_MS: number;
|
|
2249
|
+
/** The state a member's ranking was built from. */
|
|
2250
|
+
interface PoolMember {
|
|
2251
|
+
readonly identity: string;
|
|
2252
|
+
/** The identity's usage snapshot, when it has one. */
|
|
2253
|
+
readonly snapshot?: UsageSnapshot;
|
|
2254
|
+
/** Why the member's recorded state could not be read (a corrupt or newer-schema snapshot, an unreadable login file), when that is the case. */
|
|
2255
|
+
readonly readError?: string;
|
|
2256
|
+
readonly account?: AccountMetadata;
|
|
2257
|
+
/** The member's usage-log records from the current five-hour window on. */
|
|
2258
|
+
readonly records: readonly UsageRecord[];
|
|
2259
|
+
}
|
|
2260
|
+
/** The member last picked for this directory, kept so a conversation stays on the account whose prompt cache is warm. */
|
|
2261
|
+
interface StickyPick {
|
|
2262
|
+
readonly identity: string;
|
|
2263
|
+
readonly at: string;
|
|
2264
|
+
}
|
|
2265
|
+
interface RankPoolInput {
|
|
2266
|
+
readonly members: readonly PoolMember[];
|
|
2267
|
+
readonly nowMs: number;
|
|
2268
|
+
readonly sticky?: StickyPick;
|
|
2269
|
+
/** True when the launch continues or resumes a conversation, which belongs on the account it started on whatever the cache lifetime. */
|
|
2270
|
+
readonly resuming: boolean;
|
|
2271
|
+
}
|
|
2272
|
+
/** In pick order. `scored` has usable quota data; `unknown` has none (never recorded, or unreadable); `pay-per-use` bills by use instead of drawing on a plan; `ineligible` is refused right now. */
|
|
2273
|
+
type CandidateClass = "scored" | "unknown" | "pay-per-use" | "ineligible";
|
|
2274
|
+
interface Candidate {
|
|
2275
|
+
readonly identity: string;
|
|
2276
|
+
readonly class: CandidateClass;
|
|
2277
|
+
/** Plan-size-weighted remaining quota per hour until its reset: higher is more wasted if left unused. Present for `scored` only. */
|
|
2278
|
+
readonly score?: number;
|
|
2279
|
+
/** False when the five-hour window would run dry, at the observed pace, before it resets. A `scored` candidate that is not feasible ranks below every feasible one. */
|
|
2280
|
+
readonly feasible: boolean;
|
|
2281
|
+
/** When an `ineligible` candidate can be used again. */
|
|
2282
|
+
readonly blockedUntilMs?: number;
|
|
2283
|
+
readonly plan: PlanClass;
|
|
2284
|
+
/** Human-readable facts behind the class and score, in the order they matter. */
|
|
2285
|
+
readonly reasons: readonly string[];
|
|
2286
|
+
}
|
|
2287
|
+
interface PoolRanking {
|
|
2288
|
+
/** Every member, best first. */
|
|
2289
|
+
readonly candidates: readonly Candidate[];
|
|
2290
|
+
/** The member to launch on: the best one that is not refused. Undefined when every member is refused. */
|
|
2291
|
+
readonly pick?: Candidate;
|
|
2292
|
+
/** When nothing can be picked, the soonest any member comes back. */
|
|
2293
|
+
readonly earliestReturn?: {
|
|
2294
|
+
readonly identity: string;
|
|
2295
|
+
readonly atMs: number;
|
|
2296
|
+
};
|
|
2297
|
+
}
|
|
2298
|
+
/**
|
|
2299
|
+
* Ranks `members` for a launch.
|
|
2300
|
+
*
|
|
2301
|
+
* A member is `ineligible` while a window of its plan, or a refusal it last hit, still binds; it is `unknown` without recorded quota, `pay-per-use` when its usage bills by use, and otherwise `scored`. Scored members order by how much plan-size-weighted quota would expire unused per hour of runway, with any whose five-hour window would run dry at the observed pace (their own, or the person's pace on another member rescaled by plan size) placed behind those that would not. The member last picked for this directory then moves to the front if it is still usable and either the launch resumes a conversation or its prompt cache is still warm.
|
|
2302
|
+
*/
|
|
2303
|
+
declare function rankPool(input: RankPoolInput): PoolRanking;
|
|
2304
|
+
|
|
2305
|
+
/** What `pool pick` reports: the ranking a launch from `directory` would act on right now. */
|
|
2306
|
+
declare const PoolPickReportSchema: z.ZodObject<{
|
|
2307
|
+
pool: z.ZodString;
|
|
2308
|
+
directory: z.ZodString;
|
|
2309
|
+
pick: z.ZodOptional<z.ZodString>;
|
|
2310
|
+
candidates: z.ZodArray<z.ZodObject<{
|
|
2311
|
+
identity: z.ZodString;
|
|
2312
|
+
class: z.ZodEnum<{
|
|
2313
|
+
unknown: "unknown";
|
|
2314
|
+
"pay-per-use": "pay-per-use";
|
|
2315
|
+
scored: "scored";
|
|
2316
|
+
ineligible: "ineligible";
|
|
2317
|
+
}>;
|
|
2318
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
2319
|
+
feasible: z.ZodBoolean;
|
|
2320
|
+
blockedUntil: z.ZodOptional<z.ZodISODateTime>;
|
|
2321
|
+
plan: z.ZodUnion<readonly [z.ZodObject<{
|
|
2322
|
+
kind: z.ZodLiteral<"subscription">;
|
|
2323
|
+
capacity: z.ZodNumber;
|
|
2324
|
+
recognised: z.ZodBoolean;
|
|
2325
|
+
tier: z.ZodOptional<z.ZodString>;
|
|
2326
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
2327
|
+
kind: z.ZodLiteral<"pay-per-use">;
|
|
2328
|
+
tier: z.ZodOptional<z.ZodString>;
|
|
2329
|
+
}, z.core.$strict>]>;
|
|
2330
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
2331
|
+
}, z.core.$strict>>;
|
|
2332
|
+
missing: z.ZodArray<z.ZodString>;
|
|
2333
|
+
earliestReturn: z.ZodOptional<z.ZodObject<{
|
|
2334
|
+
identity: z.ZodString;
|
|
2335
|
+
at: z.ZodISODateTime;
|
|
2336
|
+
}, z.core.$strict>>;
|
|
2337
|
+
stickyProblem: z.ZodOptional<z.ZodString>;
|
|
2338
|
+
}, z.core.$strict>;
|
|
2339
|
+
type PoolPickReport = z.infer<typeof PoolPickReportSchema>;
|
|
2340
|
+
|
|
2341
|
+
/**
|
|
2342
|
+
* Ranks a pool exactly as a launch from `directory` would right now, without recording a pick. Shares `rankPoolFromStore` with the launcher, so what this prints is what a launch does.
|
|
2343
|
+
*/
|
|
2344
|
+
declare function collectPoolPick(params: Readonly<{
|
|
2345
|
+
paths: LayoutPaths;
|
|
2346
|
+
fs: FsPort;
|
|
2347
|
+
usageFs: FarmFs;
|
|
2348
|
+
poolName: string;
|
|
2349
|
+
pool: Pool;
|
|
2350
|
+
directory: string;
|
|
2351
|
+
nowMs: number;
|
|
2352
|
+
}>): PoolPickReport;
|
|
2353
|
+
|
|
2354
|
+
/** Everything a `when` condition can be evaluated against, injected rather than read. */
|
|
2355
|
+
interface ConditionContext {
|
|
2356
|
+
readonly nowMs: number;
|
|
2357
|
+
/** Facts about the specific entry being decided. Absent when evaluating a rule-level condition that has no single entry (a directory rule's own `when`). */
|
|
2358
|
+
readonly fact?: EntryFact;
|
|
2359
|
+
/** The branch checked out at `cwd`, or undefined when `cwd` is not in a repository. */
|
|
2360
|
+
readonly branch?: string;
|
|
2361
|
+
/** True when the repository is in detached-HEAD state, in which case no `branch` condition can match. */
|
|
2362
|
+
readonly branchDetached?: boolean;
|
|
2363
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
2364
|
+
}
|
|
2365
|
+
/** The result of evaluating one `when` object. */
|
|
2366
|
+
interface WhenEvaluation {
|
|
2367
|
+
readonly passed: boolean;
|
|
2368
|
+
/** Which condition fields were present and evaluated. */
|
|
2369
|
+
readonly checked: readonly string[];
|
|
2370
|
+
/** Which of those fields did not hold. Empty when `passed` is true. */
|
|
2371
|
+
readonly failed: readonly string[];
|
|
2372
|
+
}
|
|
2373
|
+
/** True when `branch` matches `pattern`. The pattern is glob-capable (`client/*`); a detached HEAD or a non-repository directory never matches. */
|
|
2374
|
+
declare function matchBranch(pattern: string, branch: string | undefined, detached?: boolean): boolean;
|
|
2375
|
+
/**
|
|
2376
|
+
* Evaluates a `when` object. Every present field must hold — conditions AND together within one object.
|
|
2377
|
+
*
|
|
2378
|
+
* An absent condition is vacuously true, so `when: {}` passes; `agent-shim check` warns about that rather than erroring, since an empty object is more likely a half-finished edit than an intentional statement.
|
|
2379
|
+
*
|
|
2380
|
+
* `newerThan`, `olderThan`, and `maxSizeBytes` read the subtree-aggregated facts (`latestMtimeMs`, `totalSizeBytes`), never the entry's own inode stat: a directory's own mtime does not change when a file three levels beneath it is rewritten, and its own size is a ~4KB inode figure that says nothing about what it contains.
|
|
2381
|
+
*/
|
|
2382
|
+
declare function evaluateWhen(when: WhenCondition | undefined, context: ConditionContext): WhenEvaluation;
|
|
2383
|
+
|
|
2148
2384
|
/** Raised when the daemon cannot be brought up in time, or reports a fatal `lastError`: a launch that asked for headroom must never silently fall back to a direct connection. */
|
|
2149
2385
|
declare class HeadroomStartError extends CliError {
|
|
2150
2386
|
constructor(message: string);
|
|
@@ -2497,6 +2733,24 @@ interface CredentialCachePort {
|
|
|
2497
2733
|
readonly write: (store: CredentialCacheStore, owner: string, entry: CachedCredential) => void;
|
|
2498
2734
|
readonly remove: (store: CredentialCacheStore, owner: string) => void;
|
|
2499
2735
|
}
|
|
2736
|
+
/**
|
|
2737
|
+
* What the cache holds for one credential, without the token: whether there is an entry, how old it is, and whether it is still within the block's TTL. `expiresInMs` is absent for a block with no expiry.
|
|
2738
|
+
*/
|
|
2739
|
+
type CachedCredentialState = {
|
|
2740
|
+
readonly store: CredentialCacheStore;
|
|
2741
|
+
readonly status: "empty";
|
|
2742
|
+
}
|
|
2743
|
+
/** The store cannot be read here (the keychain store configured on a platform without a Keychain): reported with its reason rather than failing the whole report. */
|
|
2744
|
+
| {
|
|
2745
|
+
readonly store: CredentialCacheStore;
|
|
2746
|
+
readonly status: "unreadable";
|
|
2747
|
+
readonly reason: string;
|
|
2748
|
+
} | {
|
|
2749
|
+
readonly store: CredentialCacheStore;
|
|
2750
|
+
readonly status: "fresh" | "expired";
|
|
2751
|
+
readonly ageMs: number;
|
|
2752
|
+
readonly expiresInMs?: number;
|
|
2753
|
+
};
|
|
2500
2754
|
|
|
2501
2755
|
/** What reading one `file` source found: nothing at that path, or its contents and permission bits. `mode` is undefined on a platform with no POSIX permission bits (Windows), where the looseness check cannot apply. */
|
|
2502
2756
|
type SecretFileRead = {
|
|
@@ -2737,64 +2991,6 @@ type ConfigProfileDecisionSource =
|
|
|
2737
2991
|
/** Nothing resolved a configuration profile at all. */
|
|
2738
2992
|
| "none";
|
|
2739
2993
|
|
|
2740
|
-
/** What an account's plan means for picking it: a subscription with a capacity relative to the smallest paid tier, or an account billed by use. */
|
|
2741
|
-
type PlanClass = {
|
|
2742
|
-
readonly kind: "subscription";
|
|
2743
|
-
/** The plan's size as a multiple of the smallest subscription tier (Max 5x is 5, Max 20x is 20). */
|
|
2744
|
-
readonly capacity: number;
|
|
2745
|
-
/** False when the tier string named no multiplier and no tier this project knows, so `capacity` is the neutral 1 rather than a reading. */
|
|
2746
|
-
readonly recognised: boolean;
|
|
2747
|
-
/** The tier string the classification rests on, when the account had one. */
|
|
2748
|
-
readonly tier?: string;
|
|
2749
|
-
} | {
|
|
2750
|
-
readonly kind: "pay-per-use";
|
|
2751
|
-
readonly tier?: string;
|
|
2752
|
-
};
|
|
2753
|
-
|
|
2754
|
-
/** In pick order. `scored` has usable quota data; `unknown` has none (never recorded, or unreadable); `pay-per-use` bills by use instead of drawing on a plan; `ineligible` is refused right now. */
|
|
2755
|
-
type CandidateClass = "scored" | "unknown" | "pay-per-use" | "ineligible";
|
|
2756
|
-
interface Candidate {
|
|
2757
|
-
readonly identity: string;
|
|
2758
|
-
readonly class: CandidateClass;
|
|
2759
|
-
/** Plan-size-weighted remaining quota per hour until its reset: higher is more wasted if left unused. Present for `scored` only. */
|
|
2760
|
-
readonly score?: number;
|
|
2761
|
-
/** False when the five-hour window would run dry, at the observed pace, before it resets. A `scored` candidate that is not feasible ranks below every feasible one. */
|
|
2762
|
-
readonly feasible: boolean;
|
|
2763
|
-
/** When an `ineligible` candidate can be used again. */
|
|
2764
|
-
readonly blockedUntilMs?: number;
|
|
2765
|
-
readonly plan: PlanClass;
|
|
2766
|
-
/** Human-readable facts behind the class and score, in the order they matter. */
|
|
2767
|
-
readonly reasons: readonly string[];
|
|
2768
|
-
}
|
|
2769
|
-
|
|
2770
|
-
/** What `pool pick` reports: the ranking a launch from `directory` would act on right now. */
|
|
2771
|
-
interface PoolPickReport {
|
|
2772
|
-
readonly pool: string;
|
|
2773
|
-
readonly directory: string;
|
|
2774
|
-
/** The member a launch would run as, absent when every member is refused. */
|
|
2775
|
-
readonly pick?: string;
|
|
2776
|
-
readonly candidates: readonly PoolPickCandidateView[];
|
|
2777
|
-
/** Members that name an identity that does not exist; a launch skips them. */
|
|
2778
|
-
readonly missing: readonly string[];
|
|
2779
|
-
/** When nothing can be picked, the soonest any member returns. */
|
|
2780
|
-
readonly earliestReturn?: {
|
|
2781
|
-
readonly identity: string;
|
|
2782
|
-
readonly at: string;
|
|
2783
|
-
};
|
|
2784
|
-
/** Why the last-pick record could not be read, when that is the case. */
|
|
2785
|
-
readonly stickyProblem?: string;
|
|
2786
|
-
}
|
|
2787
|
-
/** One ranked member as `pool pick --json` prints it. */
|
|
2788
|
-
interface PoolPickCandidateView {
|
|
2789
|
-
readonly identity: string;
|
|
2790
|
-
readonly class: Candidate["class"];
|
|
2791
|
-
readonly score?: number;
|
|
2792
|
-
readonly feasible: boolean;
|
|
2793
|
-
readonly blockedUntil?: string;
|
|
2794
|
-
readonly plan: Candidate["plan"];
|
|
2795
|
-
readonly reasons: readonly string[];
|
|
2796
|
-
}
|
|
2797
|
-
|
|
2798
2994
|
/**
|
|
2799
2995
|
* Forward-only encoding of a real working directory into the single directory name Claude Code gives it under `~/.claude/projects/`.
|
|
2800
2996
|
*
|
|
@@ -2850,8 +3046,11 @@ interface CredentialReport {
|
|
|
2850
3046
|
readonly name: string;
|
|
2851
3047
|
readonly credential?: CredentialSummary;
|
|
2852
3048
|
readonly problem?: string;
|
|
3049
|
+
readonly cached?: CachedCredentialState;
|
|
2853
3050
|
};
|
|
2854
3051
|
readonly identity?: CredentialSummary;
|
|
3052
|
+
/** What the identity's own credential cache holds, when its block caches and the cache could be read. */
|
|
3053
|
+
readonly identityCached?: CachedCredentialState;
|
|
2855
3054
|
}
|
|
2856
3055
|
/** Inputs to `runCheck` — everything already loaded/injected, exactly like the resolver core and the launcher: nothing in this function touches a real filesystem, git repository, clock, or environment itself. */
|
|
2857
3056
|
interface RunCheckParams {
|
|
@@ -2887,6 +3086,8 @@ interface RunCheckParams {
|
|
|
2887
3086
|
readonly platform: string;
|
|
2888
3087
|
/** The provider a launch here would route through (`launch.provider` in the cascade), when one is selected. */
|
|
2889
3088
|
readonly provider?: CheckProviderInput;
|
|
3089
|
+
/** Where cached credentials live. Omit to skip reporting a credential cache's age; with it, a block that caches reports whether it holds an entry, how old it is and whether it has expired, never the token. */
|
|
3090
|
+
readonly credentialCache?: CredentialCacheEnv;
|
|
2890
3091
|
}
|
|
2891
3092
|
/** Everything `agent-shim check` reports about one directory/identity, without touching the farm or spawning anything. */
|
|
2892
3093
|
interface CheckReport {
|
|
@@ -3021,6 +3222,8 @@ interface DoctorPathResolution {
|
|
|
3021
3222
|
/** Everything `runDoctor` needs, all of it already loaded/injected — nothing in `runDoctor` itself reads a file, shells out, or touches the farm. */
|
|
3022
3223
|
interface RunDoctorParams {
|
|
3023
3224
|
readonly env: Readonly<Record<string, string | undefined>>;
|
|
3225
|
+
/** Where cached credentials live. Omit to leave a credential cache's age out of the identity and provider findings; with it, a block that caches reports whether it holds an entry, how old it is and whether it has expired, never the token. */
|
|
3226
|
+
readonly credentialCache?: CredentialCacheEnv;
|
|
3024
3227
|
readonly identities: readonly DoctorIdentityInput[];
|
|
3025
3228
|
readonly configProfiles: readonly DoctorConfigProfileInput[];
|
|
3026
3229
|
readonly providers: readonly DoctorProviderInput[];
|
|
@@ -3184,5 +3387,5 @@ interface PrepareClaudeLaunchOptions {
|
|
|
3184
3387
|
*/
|
|
3185
3388
|
declare function prepareClaudeLaunch(options: PrepareClaudeLaunchOptions): LaunchPlan;
|
|
3186
3389
|
|
|
3187
|
-
export { AMBIENT_CREDENTIAL_VARS, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CliError, ConfigProfileSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, EXIT_FAILURE, EXIT_USAGE, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorStartError, GlobalConfigSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LaunchRefusedError, LegacyProviderFileError, PoolNameSchema, PoolNotFoundError, PoolSchema, PortableConfigSchema, ProfileAlreadyExistsError, ProfileNotFoundError, ProviderAlreadyExistsError, ProviderKindMismatchError, ProviderNotFoundError, ProviderSchema, RC_IDLE_EXPIRY_MS, RC_PENDING_DEADLINE_MS, RC_PERMISSION_MODES, RC_REQUEST_PARSE_CAP_BYTES, RC_SESSIONS_PATH_PREFIX, ROUTED_PATH_PREFIX, UsageError, UsageSnapshotError, UsageSnapshotSchema, WhenSchema, addDirectoryRule, addIdentity, addPool, addProvider, answerRcControlRequest, buildEntryFacts, buildLayoutPaths, buildRcControlResponsePayload, buildRcEventWriteBody, buildRcInterruptPayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, createLeafCache, createProfile, createRcControlHandler, createRcSessionTracker, describeProviderEndpoint, detectAmbientCredential, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, forwardableHeaders, frontDoorRcControl, generateCa, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isRcPermissionMode, listDirectoryRules, listIdentities, listProfiles, listProviders, listUsageSnapshots, mintLeaf, observingRoutedRoute, parseConnectTarget, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rcEventWriteResultFromAnswer, rcObserverAsPassthrough, readActiveIdentity, readDirectoryRules, readFarmManifest, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readUsageSnapshot, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, recoverFarm, recoveryDiagnostics, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveDecisions, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runDoctor, runFrontDoorSupervisor, runSupervisor, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, snapshotPath, startConnectServer, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, writeDirectoryRules };
|
|
3188
|
-
export type { AddDirectoryRuleOptions, AddProviderInput, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, BuildEntryFactsParams, CaMaterial, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectServerConfig, ConnectServerHandle, ConnectTarget, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorRcControl, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, InjectedCredential, LaunchPlan, Layer, LayerId, LayoutPaths, LeafCert, Pool, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, RcAnswerDecision, RcAnswerDeps, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcDialAnswer, RcDialTarget, RcEventDial, RcEventWriteResult, RcExchangeObserver, RcInjectDeps, RcObservedCredential, RcObservedRequest, RcPendingRequestSummary, RcPermissionMode, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcWorkerFact, RcWriteHeaders, RecoverFarmParams, RecoveryResult, ResolveDecisionsInput, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunDoctorParams, RunFrontDoorSupervisorOptions, RunSupervisorOptions, SupervisorPorts, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageReadFs, UsageSnapshot, WhenCondition };
|
|
3390
|
+
export { AMBIENT_CREDENTIAL_VARS, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CliError, ConfigProfileSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, EXIT_FAILURE, EXIT_USAGE, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorStartError, GlobalConfigSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LaunchRefusedError, LegacyProviderFileError, PROMPT_CACHE_TTL_MS, PlanClassSchema, PoolNameSchema, PoolNotFoundError, PoolPickReportSchema, PoolSchema, PortableConfigSchema, ProfileAlreadyExistsError, ProfileNotFoundError, ProviderAlreadyExistsError, ProviderKindMismatchError, ProviderNotFoundError, ProviderSchema, RC_IDLE_EXPIRY_MS, RC_PENDING_DEADLINE_MS, RC_PERMISSION_MODES, RC_REQUEST_PARSE_CAP_BYTES, RC_SESSIONS_PATH_PREFIX, ROUTED_PATH_PREFIX, UsageError, UsageSnapshotError, UsageSnapshotSchema, WhenSchema, addDirectoryRule, addIdentity, addPool, addProvider, answerRcControlRequest, buildEntryFacts, buildLayoutPaths, buildRcControlResponsePayload, buildRcEventWriteBody, buildRcInterruptPayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectPoolPick, createLeafCache, createProfile, createRcControlHandler, createRcSessionTracker, describeProviderEndpoint, detectAmbientCredential, effectiveWindow, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, evaluateWhen, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, forwardableHeaders, frontDoorRcControl, generateCa, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isRcPermissionMode, listDirectoryRules, listIdentities, listProfiles, listProviders, listUsageSnapshots, matchBranch, mintLeaf, observingRoutedRoute, parseConnectTarget, planOf, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcObserverAsPassthrough, readActiveIdentity, readDirectoryRules, readFarmManifest, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readUsageSnapshot, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, recoverFarm, recoveryDiagnostics, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveDecisions, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runDoctor, runFrontDoorSupervisor, runSupervisor, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, snapshotPath, startConnectServer, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, writeDirectoryRules };
|
|
3391
|
+
export type { AddDirectoryRuleOptions, AddProviderInput, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectServerConfig, ConnectServerHandle, ConnectTarget, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorRcControl, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, InjectedCredential, LaunchPlan, Layer, LayerId, LayoutPaths, LeafCert, PlanClass, Pool, PoolMember, PoolPickReport, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcDialAnswer, RcDialTarget, RcEventDial, RcEventWriteResult, RcExchangeObserver, RcInjectDeps, RcObservedCredential, RcObservedRequest, RcPendingRequestSummary, RcPermissionMode, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcWorkerFact, RcWriteHeaders, RecoverFarmParams, RecoveryResult, ResolveDecisionsInput, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunDoctorParams, RunFrontDoorSupervisorOptions, RunSupervisorOptions, StickyPick, SupervisorPorts, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-shim",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.8.0",
|
|
4
4
|
"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.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Joseph Mearman <joseph@mearman.co.uk>",
|