agent-shim 8.9.0 → 8.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/cli.cjs +159 -45
- package/dist/index.cjs +348 -239
- package/dist/index.mjs +350 -241
- package/dist/types/index.d.ts +35 -1
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ declare const LaunchSchema: z.ZodObject<{
|
|
|
76
76
|
provider: z.ZodOptional<z.ZodString>;
|
|
77
77
|
headroom: z.ZodOptional<z.ZodBoolean>;
|
|
78
78
|
trackUsage: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
claudeVersion: z.ZodOptional<z.ZodString>;
|
|
79
80
|
}, z.core.$strict>;
|
|
80
81
|
type LaunchFlags = z.infer<typeof LaunchSchema>;
|
|
81
82
|
/**
|
|
@@ -337,6 +338,7 @@ declare const ConfigProfileSchema: z.ZodObject<{
|
|
|
337
338
|
provider: z.ZodOptional<z.ZodString>;
|
|
338
339
|
headroom: z.ZodOptional<z.ZodBoolean>;
|
|
339
340
|
trackUsage: z.ZodOptional<z.ZodBoolean>;
|
|
341
|
+
claudeVersion: z.ZodOptional<z.ZodString>;
|
|
340
342
|
}, z.core.$strict>>;
|
|
341
343
|
}, z.core.$strict>;
|
|
342
344
|
type ConfigProfile = z.infer<typeof ConfigProfileSchema>;
|
|
@@ -380,6 +382,7 @@ declare const DirectoryRuleSchema: z.ZodObject<{
|
|
|
380
382
|
provider: z.ZodOptional<z.ZodString>;
|
|
381
383
|
headroom: z.ZodOptional<z.ZodBoolean>;
|
|
382
384
|
trackUsage: z.ZodOptional<z.ZodBoolean>;
|
|
385
|
+
claudeVersion: z.ZodOptional<z.ZodString>;
|
|
383
386
|
}, z.core.$strict>>;
|
|
384
387
|
path: z.ZodString;
|
|
385
388
|
configProfile: z.ZodOptional<z.ZodString>;
|
|
@@ -428,6 +431,7 @@ declare const DirectoryRulesSchema: z.ZodObject<{
|
|
|
428
431
|
provider: z.ZodOptional<z.ZodString>;
|
|
429
432
|
headroom: z.ZodOptional<z.ZodBoolean>;
|
|
430
433
|
trackUsage: z.ZodOptional<z.ZodBoolean>;
|
|
434
|
+
claudeVersion: z.ZodOptional<z.ZodString>;
|
|
431
435
|
}, z.core.$strict>>;
|
|
432
436
|
path: z.ZodString;
|
|
433
437
|
configProfile: z.ZodOptional<z.ZodString>;
|
|
@@ -477,6 +481,7 @@ declare const PortableConfigSchema: z.ZodObject<{
|
|
|
477
481
|
provider: z.ZodOptional<z.ZodString>;
|
|
478
482
|
headroom: z.ZodOptional<z.ZodBoolean>;
|
|
479
483
|
trackUsage: z.ZodOptional<z.ZodBoolean>;
|
|
484
|
+
claudeVersion: z.ZodOptional<z.ZodString>;
|
|
480
485
|
}, z.core.$strict>>;
|
|
481
486
|
configProfile: z.ZodOptional<z.ZodString>;
|
|
482
487
|
identity: z.ZodOptional<z.ZodString>;
|
|
@@ -545,6 +550,7 @@ declare const GlobalConfigSchema: z.ZodObject<{
|
|
|
545
550
|
provider: z.ZodOptional<z.ZodString>;
|
|
546
551
|
headroom: z.ZodOptional<z.ZodBoolean>;
|
|
547
552
|
trackUsage: z.ZodOptional<z.ZodBoolean>;
|
|
553
|
+
claudeVersion: z.ZodOptional<z.ZodString>;
|
|
548
554
|
}, z.core.$strict>>;
|
|
549
555
|
headroom: z.ZodOptional<z.ZodObject<{
|
|
550
556
|
source: z.ZodOptional<z.ZodString>;
|
|
@@ -3306,6 +3312,14 @@ declare function updateDirectoryRule(paths: LayoutPaths, rulePath: string, optio
|
|
|
3306
3312
|
/** Removes the directory rule for `rulePath`. Throws `DirectoryRuleNotFoundError` when no rule matches that exact path. */
|
|
3307
3313
|
declare function removeDirectoryRule(paths: LayoutPaths, rulePath: string): void;
|
|
3308
3314
|
|
|
3315
|
+
/** Where a pinned Claude Code version came from, strongest first: the launch's own flag, then the environment, then the cascade. */
|
|
3316
|
+
type ClaudeVersionSource = "flag" | "environment" | "cascade";
|
|
3317
|
+
/** The pinned version a launch runs, and which of the three forms named it. */
|
|
3318
|
+
interface PinnedClaudeVersion {
|
|
3319
|
+
readonly version: string;
|
|
3320
|
+
readonly source: ClaudeVersionSource;
|
|
3321
|
+
}
|
|
3322
|
+
|
|
3309
3323
|
/** Which precedence rule produced an identity decision. */
|
|
3310
3324
|
type IdentityDecisionSource =
|
|
3311
3325
|
/** `CLAUDE_CONFIG_DIR` was already set: identity resolution is skipped entirely and the real binary uses whatever it already points to. */
|
|
@@ -3430,6 +3444,8 @@ interface RunCheckParams {
|
|
|
3430
3444
|
readonly platform: string;
|
|
3431
3445
|
/** The provider a launch here would route through (`launch.provider` in the cascade), when one is selected. */
|
|
3432
3446
|
readonly provider?: CheckProviderInput;
|
|
3447
|
+
/** The Claude Code versions installed here, oldest first. Omit to leave the Claude Code version out of the report; with it, `check` says which version a launch here runs and whether a pin is installed. */
|
|
3448
|
+
readonly installedClaudeVersions?: readonly string[];
|
|
3433
3449
|
/** 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. */
|
|
3434
3450
|
readonly credentialCache?: CredentialCacheEnv;
|
|
3435
3451
|
}
|
|
@@ -3447,6 +3463,16 @@ interface CheckReport {
|
|
|
3447
3463
|
readonly keychain?: KeychainLookupResult;
|
|
3448
3464
|
readonly settingsExposure: readonly SettingsExposureReport[];
|
|
3449
3465
|
readonly credential: CredentialReport;
|
|
3466
|
+
/** The Claude Code version a launch here would run, when the installed versions were given. */
|
|
3467
|
+
readonly claudeVersion?: ClaudeVersionReport;
|
|
3468
|
+
}
|
|
3469
|
+
/** Which Claude Code version a launch would run: the pin and where it comes from, with whether it is installed, or the highest installed version when nothing pins one. */
|
|
3470
|
+
interface ClaudeVersionReport {
|
|
3471
|
+
readonly pinned?: PinnedClaudeVersion & {
|
|
3472
|
+
readonly installed: boolean;
|
|
3473
|
+
};
|
|
3474
|
+
readonly highestInstalled?: string;
|
|
3475
|
+
readonly installed: readonly string[];
|
|
3450
3476
|
}
|
|
3451
3477
|
/**
|
|
3452
3478
|
* Resolves the full cascade for one directory/identity and reports everything `agent-shim check` documents: every entry's resolved state and which layer/condition decided it, any ambiguous `history/projects/` encoding in scope, and the three always-on diagnostics (ambient-credential exposure, macOS Keychain service name, settings-secrets exposure).
|
|
@@ -3505,6 +3531,12 @@ interface DiscoveredClaudeBinary {
|
|
|
3505
3531
|
/** The version string, when discovered via the versions directory. */
|
|
3506
3532
|
version?: string;
|
|
3507
3533
|
}
|
|
3534
|
+
/** What a launch asks binary discovery for: nothing (the highest installed version) or an exact version. */
|
|
3535
|
+
interface ClaudeBinaryRequest {
|
|
3536
|
+
readonly version?: string;
|
|
3537
|
+
}
|
|
3538
|
+
/** Discovers the real `claude` binary to spawn, for the version a launch asked for. Injected into the launcher so it never reads the filesystem or PATH itself. */
|
|
3539
|
+
type ClaudeBinaryResolver = (request?: Readonly<ClaudeBinaryRequest>) => DiscoveredClaudeBinary;
|
|
3508
3540
|
|
|
3509
3541
|
type DoctorSeverity = "pass" | "warn" | "fail";
|
|
3510
3542
|
type DoctorSection = "ambient-credential" | "binary-discovery" | "claude-shim" | "path-resolution" | "legacy-name" | "config-profile" | "identity" | "pool" | "provider" | "keychain" | "directory-rules" | "global-config" | "categories-local" | "active-identity" | "headroom";
|
|
@@ -3566,6 +3598,8 @@ interface DoctorPathResolution {
|
|
|
3566
3598
|
/** Everything `runDoctor` needs, all of it already loaded/injected — nothing in `runDoctor` itself reads a file, shells out, or touches the farm. */
|
|
3567
3599
|
interface RunDoctorParams {
|
|
3568
3600
|
readonly env: Readonly<Record<string, string | undefined>>;
|
|
3601
|
+
/** The Claude Code versions installed here, oldest first. Omit to skip checking that a pinned version (`launch.claudeVersion`) is installed; with it, a profile, directory rule or global config pinning a version that is not installed is a warning. */
|
|
3602
|
+
readonly installedClaudeVersions?: readonly string[];
|
|
3569
3603
|
/** 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. */
|
|
3570
3604
|
readonly credentialCache?: CredentialCacheEnv;
|
|
3571
3605
|
readonly identities: readonly DoctorIdentityInput[];
|
|
@@ -3663,7 +3697,7 @@ interface PrepareLaunchParams {
|
|
|
3663
3697
|
readonly proc: ProcPort;
|
|
3664
3698
|
readonly log: LogPort;
|
|
3665
3699
|
/** Discovers the real `claude` binary to spawn. Injected so `runLauncher` never depends on `src/versionDiscovery.ts`'s own filesystem/PATH inputs directly — the caller (`src/cli.ts`) wires the real discovery, tests wire a fake that returns a fixed path. */
|
|
3666
|
-
readonly resolveClaudeBinary:
|
|
3700
|
+
readonly resolveClaudeBinary: ClaudeBinaryResolver;
|
|
3667
3701
|
/** An identity pinned to `$PWD` by a directory rule. Accepted as an already-resolved value — the rules-loading code that produces it lands in Phase 4/5. */
|
|
3668
3702
|
readonly directoryPinnedIdentity?: string;
|
|
3669
3703
|
/** A directory rule's `configProfile` selection for `$PWD`. Accepted as an already-resolved value for the same reason. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-shim",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.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>",
|