agent-shim 0.0.0 → 7.1.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.
Files changed (44) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +233 -0
  3. package/dist/cli.cjs +69549 -0
  4. package/dist/index.cjs +3620 -0
  5. package/dist/index.mjs +3545 -0
  6. package/dist/types/cliError.d.ts +27 -0
  7. package/dist/types/config/classify.d.ts +49 -0
  8. package/dist/types/config/load.d.ts +42 -0
  9. package/dist/types/config/schema.d.ts +746 -0
  10. package/dist/types/config/store.d.ts +46 -0
  11. package/dist/types/frontdoor/capability.d.ts +19 -0
  12. package/dist/types/frontdoor/connect.d.ts +179 -0
  13. package/dist/types/frontdoor/ensure.d.ts +34 -0
  14. package/dist/types/frontdoor/probe.d.ts +13 -0
  15. package/dist/types/frontdoor/state.d.ts +50 -0
  16. package/dist/types/frontdoor/supervisor.d.ts +48 -0
  17. package/dist/types/frontdoor/x509.d.ts +11 -0
  18. package/dist/types/headroom/ensure.d.ts +31 -0
  19. package/dist/types/headroom/settings.d.ts +13 -0
  20. package/dist/types/headroom/source.d.ts +8 -0
  21. package/dist/types/headroom/state.d.ts +77 -0
  22. package/dist/types/headroom/supervisor.d.ts +107 -0
  23. package/dist/types/index.d.ts +21 -0
  24. package/dist/types/launcher/farm.d.ts +165 -0
  25. package/dist/types/launcher/guard.d.ts +57 -0
  26. package/dist/types/launcher/lock.d.ts +41 -0
  27. package/dist/types/launcher/ports.d.ts +135 -0
  28. package/dist/types/legacy.d.ts +24 -0
  29. package/dist/types/paths.d.ts +79 -0
  30. package/dist/types/resolve/conditions.d.ts +37 -0
  31. package/dist/types/resolve/decide.d.ts +45 -0
  32. package/dist/types/resolve/extends.d.ts +41 -0
  33. package/dist/types/resolve/flatten.d.ts +13 -0
  34. package/dist/types/resolve/match.d.ts +58 -0
  35. package/dist/types/resolve/pipeline.d.ts +30 -0
  36. package/dist/types/resolve/plan.d.ts +57 -0
  37. package/dist/types/resolve/projects.d.ts +61 -0
  38. package/dist/types/resolve/reconcile.d.ts +80 -0
  39. package/dist/types/resolve/types.d.ts +159 -0
  40. package/dist/types/resolve/walk.d.ts +85 -0
  41. package/dist/types/usage/account.d.ts +20 -0
  42. package/dist/types/usage/read.d.ts +70 -0
  43. package/dist/types/usage/schema.d.ts +318 -0
  44. package/package.json +91 -2
@@ -0,0 +1,746 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Every category a `~/.claude` entry can be classified into. `secret` is deliberately part of this list — it is a real classification the resolver acts on — but it is NOT part of `CategoryMapSchema`'s shape, because no configuration layer may ever toggle it. See OVERRIDABLE_CATEGORIES.
4
+ */
5
+ export declare const CATEGORY_NAMES: readonly ["secret", "runtime", "history", "knowledge", "settings"];
6
+ export type CategoryName = (typeof CATEGORY_NAMES)[number];
7
+ /** The four categories a configuration layer is allowed to toggle. `secret` is absent by design. */
8
+ export declare const OVERRIDABLE_CATEGORIES: readonly ["runtime", "history", "knowledge", "settings"];
9
+ export type OverridableCategory = (typeof OVERRIDABLE_CATEGORIES)[number];
10
+ /** True when `name` is one of the four categories a configuration layer may toggle. */
11
+ export declare function isOverridableCategory(name: string): name is OverridableCategory;
12
+ /** True when `name` is any of the five classification categories, including `secret`. */
13
+ export declare function isCategoryName(name: string): name is CategoryName;
14
+ /**
15
+ * The category toggle map's resolved shape — always exactly the four overridable categories, never the `all` pseudo-key `CategoryMapSchema` also accepts on input. Derived directly from `OverridableCategory` rather than `z.infer`red from a schema, since `CategoryMapSchema` itself carries a `.transform()` (whose inferred type follows the transform's *output*, so it can't be used to define its own output type without circularity) and a schema built solely to be `typeof`'d, never actually parsed with, would be dead weight at runtime for no benefit over a plain mapped type.
16
+ */
17
+ export type CategoryMap = Partial<Record<OverridableCategory, boolean>>;
18
+ /**
19
+ * Expands the `all` pseudo-category key, dropping `all` itself from the result. `all: true` opens every category meant to be shared across identities, which is every overridable category except `runtime`: `runtime` holds live per-process and per-machine state (daemon locks and auth status, PIDs, IDE and shell snapshots) that must never be pooled across running identities, so it opens only when named explicitly. `all: false` closes every overridable category, `runtime` included, so it also closes a `runtime` an earlier layer opened. An explicit named category always wins over the `all` expansion regardless of where it appears relative to `all` in the input: `{ all: true, runtime: true }` opens `runtime` too, and `{ all: true, history: false }` means "share everything except history", not "history is false, then immediately overwritten back to true".
20
+ *
21
+ * This is the one shared implementation `CategoryMapSchema`'s own transform, `launcher/cliOverride.ts`'s `--category`/`AGENT_SHIM_CATEGORY_OVERRIDE` handling, and `configProfiles.ts`'s `agent-shim profile set --category` all call, so `all` means the same thing regardless of which of those three input paths it arrived through.
22
+ */
23
+ export declare function expandAllCategoryKey(pairs: Readonly<Record<string, boolean>>): Record<string, boolean>;
24
+ /**
25
+ * The category toggle map as written by hand: the four overridable categories, plus `all` as shorthand for "every shareable category at once" (expanded by `expandAllCategoryKey` above). `secret` is omitted from the shape entirely, so `{ "categories": { "secret": true } }` is rejected at parse time rather than relying solely on the resolver's runtime floor check. The closed shape is also what lets the published JSON Schema offer real key-name autocomplete, which an open record type cannot.
26
+ */
27
+ export declare const CategoryMapSchema: z.ZodPipe<z.ZodObject<{
28
+ all: z.ZodOptional<z.ZodBoolean>;
29
+ runtime: z.ZodOptional<z.ZodBoolean>;
30
+ history: z.ZodOptional<z.ZodBoolean>;
31
+ knowledge: z.ZodOptional<z.ZodBoolean>;
32
+ settings: z.ZodOptional<z.ZodBoolean>;
33
+ }, z.core.$strict>, z.ZodTransform<Partial<Record<"runtime" | "history" | "knowledge" | "settings", boolean>>, {
34
+ all?: boolean | undefined;
35
+ runtime?: boolean | undefined;
36
+ history?: boolean | undefined;
37
+ knowledge?: boolean | undefined;
38
+ settings?: boolean | undefined;
39
+ }>>;
40
+ /** A duration literal: a positive integer count followed by a unit. Used by `newerThan`/`olderThan`. */
41
+ export declare const DURATION_RE: RegExp;
42
+ /**
43
+ * A conditional guard on an entries value or a whole directory rule. Every field present within one `when` object must hold (AND logic). An empty object is vacuously true — `agent-shim check` warns about it, it is never an error.
44
+ */
45
+ export declare const WhenSchema: z.ZodObject<{
46
+ newerThan: z.ZodOptional<z.ZodString>;
47
+ olderThan: z.ZodOptional<z.ZodString>;
48
+ maxSizeBytes: z.ZodOptional<z.ZodInt>;
49
+ branch: z.ZodOptional<z.ZodString>;
50
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
51
+ }, z.core.$strict>;
52
+ export type WhenCondition = z.infer<typeof WhenSchema>;
53
+ /** An entries value: a flat boolean, or a boolean guarded by a `when` condition. */
54
+ export declare const EntryValueSchema: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
55
+ value: z.ZodBoolean;
56
+ when: z.ZodObject<{
57
+ newerThan: z.ZodOptional<z.ZodString>;
58
+ olderThan: z.ZodOptional<z.ZodString>;
59
+ maxSizeBytes: z.ZodOptional<z.ZodInt>;
60
+ branch: z.ZodOptional<z.ZodString>;
61
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
62
+ }, z.core.$strict>;
63
+ }, z.core.$strict>]>;
64
+ export type EntryValue = z.infer<typeof EntryValueSchema>;
65
+ /**
66
+ * Every entries key is `<category>/<real-relative-path>`, always — never a bare path. The prefix is what makes a key unambiguous when two categories happen to share a top-level name, and it is what lets the resolver cross-check a key's *declared* category against the *real* classification of the path it names, catching an entry that tries to launder a secret path through a `runtime/...` key.
67
+ */
68
+ export declare const ENTRY_KEY_RE: RegExp;
69
+ export declare const EntriesSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
70
+ value: z.ZodBoolean;
71
+ when: z.ZodObject<{
72
+ newerThan: z.ZodOptional<z.ZodString>;
73
+ olderThan: z.ZodOptional<z.ZodString>;
74
+ maxSizeBytes: z.ZodOptional<z.ZodInt>;
75
+ branch: z.ZodOptional<z.ZodString>;
76
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
77
+ }, z.core.$strict>;
78
+ }, z.core.$strict>]>>;
79
+ export type Entries = z.infer<typeof EntriesSchema>;
80
+ /** Launch flags, resolved through the same cascade as categories and entries. */
81
+ declare const LaunchSchema: z.ZodObject<{
82
+ skipPermissions: z.ZodOptional<z.ZodBoolean>;
83
+ remoteControl: z.ZodOptional<z.ZodBoolean>;
84
+ provider: z.ZodOptional<z.ZodString>;
85
+ headroom: z.ZodOptional<z.ZodBoolean>;
86
+ trackUsage: z.ZodOptional<z.ZodBoolean>;
87
+ }, z.core.$strict>;
88
+ export type LaunchFlags = z.infer<typeof LaunchSchema>;
89
+ /**
90
+ * Where a resolved credential lands in the child's environment. `bearer` exports it as `ANTHROPIC_AUTH_TOKEN` (what relays and aggregators expect, and the default), `apiKey` as `ANTHROPIC_API_KEY` (sent as `x-api-key`, what a regular Anthropic API key needs), and `oauthToken` as `CLAUDE_CODE_OAUTH_TOKEN` (a long-lived subscription token from `claude setup-token`). `oauthToken` authenticates a login, not an endpoint, so only an identity may use it; see `PROVIDER_CREDENTIAL_TARGETS`.
91
+ */
92
+ export declare const CREDENTIAL_TARGETS: readonly ["bearer", "apiKey", "oauthToken"];
93
+ export type CredentialTarget = (typeof CREDENTIAL_TARGETS)[number];
94
+ /** The targets a provider's credential may use: every target except `oauthToken`, which only an identity can carry. */
95
+ export declare const PROVIDER_CREDENTIAL_TARGETS: readonly ["bearer", "apiKey"];
96
+ /** The environment variable each credential target exports the token as. These are also the variables no provider `env` block may set, since agent-shim sets and clears them itself. */
97
+ export declare const CREDENTIAL_TARGET_VARS: {
98
+ readonly bearer: "ANTHROPIC_AUTH_TOKEN";
99
+ readonly apiKey: "ANTHROPIC_API_KEY";
100
+ readonly oauthToken: "CLAUDE_CODE_OAUTH_TOKEN";
101
+ };
102
+ export type CredentialTargetVar = (typeof CREDENTIAL_TARGET_VARS)[CredentialTarget];
103
+ /**
104
+ * One place a credential can come from. Each kind is an object with exactly one kind-naming key, so the kinds are told apart by which key is present rather than by a separate tag, and `strictObject` rejects an object naming two.
105
+ *
106
+ * - `env`: the NAME of an environment variable in the launching shell, never its value.
107
+ * - `file`: an absolute or `~`-rooted path to a file holding the token, which must not be readable or writable by group or others (mode 600 or stricter).
108
+ * - `command`: an argv run at launch whose trimmed stdout is the token, so the credential exists only in the child.
109
+ * - `op`: a 1Password secret reference, run as `op read <ref>`. A 1Password service account needs nothing here: `OP_SERVICE_ACCOUNT_TOKEN` in the launching environment is inherited by the command.
110
+ * - `keychain`: a macOS Keychain generic password, run as `security find-generic-password -s <service> [-a <account>] -w`.
111
+ * - `literal`: a fixed value written in the file itself. It is NOT a place for a secret: it exists for local proxies that accept any placeholder token (a codex-translation proxy, say) and so have no real credential to keep out of committed config. Anything with a real credential must use one of the other kinds.
112
+ */
113
+ export declare const CredentialSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
114
+ env: z.ZodString;
115
+ }, z.core.$strict>, z.ZodObject<{
116
+ file: z.ZodString;
117
+ }, z.core.$strict>, z.ZodObject<{
118
+ interactive: z.ZodOptional<z.ZodBoolean>;
119
+ timeoutMs: z.ZodOptional<z.ZodInt>;
120
+ command: z.ZodTuple<[z.ZodString], z.ZodString>;
121
+ }, z.core.$strict>, z.ZodObject<{
122
+ interactive: z.ZodOptional<z.ZodBoolean>;
123
+ timeoutMs: z.ZodOptional<z.ZodInt>;
124
+ op: z.ZodString;
125
+ }, z.core.$strict>, z.ZodObject<{
126
+ interactive: z.ZodOptional<z.ZodBoolean>;
127
+ timeoutMs: z.ZodOptional<z.ZodInt>;
128
+ keychain: z.ZodObject<{
129
+ service: z.ZodString;
130
+ account: z.ZodOptional<z.ZodString>;
131
+ }, z.core.$strict>;
132
+ }, z.core.$strict>, z.ZodObject<{
133
+ literal: z.ZodString;
134
+ }, z.core.$strict>]>;
135
+ export type CredentialSource = z.infer<typeof CredentialSourceSchema>;
136
+ /** Where a cached credential is kept: the macOS login Keychain, or a mode-0600 file under the agent-shim home. */
137
+ export declare const CREDENTIAL_CACHE_STORES: readonly ["keychain", "file"];
138
+ export type CredentialCacheStore = (typeof CREDENTIAL_CACHE_STORES)[number];
139
+ /**
140
+ * An optional cache on a credential block: the resolved token is kept for `ttl` (a whole number followed by `s`, `m`, `h` or `d`, for example `12h`) so a launch does not re-run a source that needs a person, such as a desktop-unlocked `op`. With no `ttl` the cached token never expires and is replaced only by `credential warm` or removed by `credential forget`. `store` defaults to the Keychain on macOS and a file elsewhere. A block with no `cache` stores nothing and fetches on every launch.
141
+ */
142
+ export declare const CredentialCacheSchema: z.ZodObject<{
143
+ ttl: z.ZodOptional<z.ZodString>;
144
+ store: z.ZodOptional<z.ZodEnum<{
145
+ file: "file";
146
+ keychain: "keychain";
147
+ }>>;
148
+ }, z.core.$strict>;
149
+ export type CredentialCache = z.infer<typeof CredentialCacheSchema>;
150
+ /**
151
+ * The credential block providers and identities share: an ordered list of sources, tried in turn until one yields a non-empty token, and the target that token is exported as. `target` defaults to `bearer`.
152
+ */
153
+ export declare const CredentialSchema: z.ZodObject<{
154
+ sources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
155
+ env: z.ZodString;
156
+ }, z.core.$strict>, z.ZodObject<{
157
+ file: z.ZodString;
158
+ }, z.core.$strict>, z.ZodObject<{
159
+ interactive: z.ZodOptional<z.ZodBoolean>;
160
+ timeoutMs: z.ZodOptional<z.ZodInt>;
161
+ command: z.ZodTuple<[z.ZodString], z.ZodString>;
162
+ }, z.core.$strict>, z.ZodObject<{
163
+ interactive: z.ZodOptional<z.ZodBoolean>;
164
+ timeoutMs: z.ZodOptional<z.ZodInt>;
165
+ op: z.ZodString;
166
+ }, z.core.$strict>, z.ZodObject<{
167
+ interactive: z.ZodOptional<z.ZodBoolean>;
168
+ timeoutMs: z.ZodOptional<z.ZodInt>;
169
+ keychain: z.ZodObject<{
170
+ service: z.ZodString;
171
+ account: z.ZodOptional<z.ZodString>;
172
+ }, z.core.$strict>;
173
+ }, z.core.$strict>, z.ZodObject<{
174
+ literal: z.ZodString;
175
+ }, z.core.$strict>]>>;
176
+ target: z.ZodOptional<z.ZodEnum<{
177
+ bearer: "bearer";
178
+ apiKey: "apiKey";
179
+ oauthToken: "oauthToken";
180
+ }>>;
181
+ cache: z.ZodOptional<z.ZodObject<{
182
+ ttl: z.ZodOptional<z.ZodString>;
183
+ store: z.ZodOptional<z.ZodEnum<{
184
+ file: "file";
185
+ keychain: "keychain";
186
+ }>>;
187
+ }, z.core.$strict>>;
188
+ }, z.core.$strict>;
189
+ export type Credential = z.infer<typeof CredentialSchema>;
190
+ /** The kinds of provider: `http` is an Anthropic Messages endpoint at a fixed `baseUrl` (the default when `kind` is absent), and `codex` is ChatGPT's Codex backend reached through agent-shim's own supervised translation daemon. */
191
+ export declare const PROVIDER_KINDS: readonly ["http", "codex"];
192
+ /**
193
+ * The Claude model tiers the codex translator maps, in the order they are matched: the first tier whose name is a substring of the requested model (case-insensitive) decides the codex model. `fable` comes before `opus` because a fable model name is the most specific.
194
+ */
195
+ export declare const CODEX_TIERS: readonly ["fable", "opus", "sonnet", "haiku"];
196
+ export type CodexTier = (typeof CODEX_TIERS)[number];
197
+ /** The reasoning efforts the codex backend accepts, plus `none`, which omits the reasoning block from the upstream request entirely. */
198
+ export declare const CODEX_EFFORTS: readonly ["none", "low", "medium", "high"];
199
+ export type CodexEffort = (typeof CODEX_EFFORTS)[number];
200
+ /** The codex model every tier maps to when neither its own tier entry nor `defaultModel` says otherwise. */
201
+ export declare const CODEX_DEFAULT_MODEL = "gpt-5.6-sol";
202
+ /** The shipped tier mapping: the flagship model for fable and opus, the mid-size one for sonnet, the small one for haiku. */
203
+ export declare const CODEX_DEFAULT_TIER_MODELS: Readonly<Record<CodexTier, string>>;
204
+ /** The shipped reasoning effort for a request that does not ask for one the backend accepts. */
205
+ export declare const CODEX_DEFAULT_EFFORT: CodexEffort;
206
+ /**
207
+ * How a codex provider translates Claude Code's requests. Every field is optional and defaults to the shipped mapping (`CODEX_DEFAULT_MODEL`, `CODEX_DEFAULT_TIER_MODELS`, `CODEX_DEFAULT_EFFORT`), so an absent block means the stock behaviour. A requested model that already names a codex model (`gpt-...`) passes through untouched whatever this says.
208
+ */
209
+ export declare const CodexProviderConfigSchema: z.ZodObject<{
210
+ defaultModel: z.ZodOptional<z.ZodString>;
211
+ models: z.ZodOptional<z.ZodObject<{
212
+ fable: z.ZodOptional<z.ZodString>;
213
+ opus: z.ZodOptional<z.ZodString>;
214
+ sonnet: z.ZodOptional<z.ZodString>;
215
+ haiku: z.ZodOptional<z.ZodString>;
216
+ }, z.core.$strict>>;
217
+ effort: z.ZodOptional<z.ZodEnum<{
218
+ none: "none";
219
+ low: "low";
220
+ medium: "medium";
221
+ high: "high";
222
+ }>>;
223
+ }, z.core.$strict>;
224
+ export type CodexProviderConfig = z.infer<typeof CodexProviderConfigSchema>;
225
+ /** A `codex` provider: see `ProviderSchema`. */
226
+ declare const CodexProviderSchema: z.ZodObject<{
227
+ $schema: z.ZodOptional<z.ZodString>;
228
+ kind: z.ZodLiteral<"codex">;
229
+ displayName: z.ZodString;
230
+ credential: z.ZodObject<{
231
+ sources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
232
+ env: z.ZodString;
233
+ }, z.core.$strict>, z.ZodObject<{
234
+ file: z.ZodString;
235
+ }, z.core.$strict>, z.ZodObject<{
236
+ interactive: z.ZodOptional<z.ZodBoolean>;
237
+ timeoutMs: z.ZodOptional<z.ZodInt>;
238
+ command: z.ZodTuple<[z.ZodString], z.ZodString>;
239
+ }, z.core.$strict>, z.ZodObject<{
240
+ interactive: z.ZodOptional<z.ZodBoolean>;
241
+ timeoutMs: z.ZodOptional<z.ZodInt>;
242
+ op: z.ZodString;
243
+ }, z.core.$strict>, z.ZodObject<{
244
+ interactive: z.ZodOptional<z.ZodBoolean>;
245
+ timeoutMs: z.ZodOptional<z.ZodInt>;
246
+ keychain: z.ZodObject<{
247
+ service: z.ZodString;
248
+ account: z.ZodOptional<z.ZodString>;
249
+ }, z.core.$strict>;
250
+ }, z.core.$strict>, z.ZodObject<{
251
+ literal: z.ZodString;
252
+ }, z.core.$strict>]>>;
253
+ cache: z.ZodOptional<z.ZodObject<{
254
+ ttl: z.ZodOptional<z.ZodString>;
255
+ store: z.ZodOptional<z.ZodEnum<{
256
+ file: "file";
257
+ keychain: "keychain";
258
+ }>>;
259
+ }, z.core.$strict>>;
260
+ target: z.ZodOptional<z.ZodEnum<{
261
+ bearer: "bearer";
262
+ apiKey: "apiKey";
263
+ }>>;
264
+ }, z.core.$strict>;
265
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
266
+ codex: z.ZodOptional<z.ZodObject<{
267
+ defaultModel: z.ZodOptional<z.ZodString>;
268
+ models: z.ZodOptional<z.ZodObject<{
269
+ fable: z.ZodOptional<z.ZodString>;
270
+ opus: z.ZodOptional<z.ZodString>;
271
+ sonnet: z.ZodOptional<z.ZodString>;
272
+ haiku: z.ZodOptional<z.ZodString>;
273
+ }, z.core.$strict>>;
274
+ effort: z.ZodOptional<z.ZodEnum<{
275
+ none: "none";
276
+ low: "low";
277
+ medium: "medium";
278
+ high: "high";
279
+ }>>;
280
+ }, z.core.$strict>>;
281
+ }, z.core.$strict>;
282
+ export type CodexProvider = z.infer<typeof CodexProviderSchema>;
283
+ /** Either kind of provider; see `HttpProviderSchema` for the shared fields. */
284
+ export declare const ProviderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
285
+ $schema: z.ZodOptional<z.ZodString>;
286
+ kind: z.ZodOptional<z.ZodLiteral<"http">>;
287
+ displayName: z.ZodString;
288
+ baseUrl: z.ZodURL;
289
+ credential: z.ZodObject<{
290
+ sources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
291
+ env: z.ZodString;
292
+ }, z.core.$strict>, z.ZodObject<{
293
+ file: z.ZodString;
294
+ }, z.core.$strict>, z.ZodObject<{
295
+ interactive: z.ZodOptional<z.ZodBoolean>;
296
+ timeoutMs: z.ZodOptional<z.ZodInt>;
297
+ command: z.ZodTuple<[z.ZodString], z.ZodString>;
298
+ }, z.core.$strict>, z.ZodObject<{
299
+ interactive: z.ZodOptional<z.ZodBoolean>;
300
+ timeoutMs: z.ZodOptional<z.ZodInt>;
301
+ op: z.ZodString;
302
+ }, z.core.$strict>, z.ZodObject<{
303
+ interactive: z.ZodOptional<z.ZodBoolean>;
304
+ timeoutMs: z.ZodOptional<z.ZodInt>;
305
+ keychain: z.ZodObject<{
306
+ service: z.ZodString;
307
+ account: z.ZodOptional<z.ZodString>;
308
+ }, z.core.$strict>;
309
+ }, z.core.$strict>, z.ZodObject<{
310
+ literal: z.ZodString;
311
+ }, z.core.$strict>]>>;
312
+ cache: z.ZodOptional<z.ZodObject<{
313
+ ttl: z.ZodOptional<z.ZodString>;
314
+ store: z.ZodOptional<z.ZodEnum<{
315
+ file: "file";
316
+ keychain: "keychain";
317
+ }>>;
318
+ }, z.core.$strict>>;
319
+ target: z.ZodOptional<z.ZodEnum<{
320
+ bearer: "bearer";
321
+ apiKey: "apiKey";
322
+ }>>;
323
+ }, z.core.$strict>;
324
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
325
+ }, z.core.$strict>, z.ZodObject<{
326
+ $schema: z.ZodOptional<z.ZodString>;
327
+ kind: z.ZodLiteral<"codex">;
328
+ displayName: z.ZodString;
329
+ credential: z.ZodObject<{
330
+ sources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
331
+ env: z.ZodString;
332
+ }, z.core.$strict>, z.ZodObject<{
333
+ file: z.ZodString;
334
+ }, z.core.$strict>, z.ZodObject<{
335
+ interactive: z.ZodOptional<z.ZodBoolean>;
336
+ timeoutMs: z.ZodOptional<z.ZodInt>;
337
+ command: z.ZodTuple<[z.ZodString], z.ZodString>;
338
+ }, z.core.$strict>, z.ZodObject<{
339
+ interactive: z.ZodOptional<z.ZodBoolean>;
340
+ timeoutMs: z.ZodOptional<z.ZodInt>;
341
+ op: z.ZodString;
342
+ }, z.core.$strict>, z.ZodObject<{
343
+ interactive: z.ZodOptional<z.ZodBoolean>;
344
+ timeoutMs: z.ZodOptional<z.ZodInt>;
345
+ keychain: z.ZodObject<{
346
+ service: z.ZodString;
347
+ account: z.ZodOptional<z.ZodString>;
348
+ }, z.core.$strict>;
349
+ }, z.core.$strict>, z.ZodObject<{
350
+ literal: z.ZodString;
351
+ }, z.core.$strict>]>>;
352
+ cache: z.ZodOptional<z.ZodObject<{
353
+ ttl: z.ZodOptional<z.ZodString>;
354
+ store: z.ZodOptional<z.ZodEnum<{
355
+ file: "file";
356
+ keychain: "keychain";
357
+ }>>;
358
+ }, z.core.$strict>>;
359
+ target: z.ZodOptional<z.ZodEnum<{
360
+ bearer: "bearer";
361
+ apiKey: "apiKey";
362
+ }>>;
363
+ }, z.core.$strict>;
364
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
365
+ codex: z.ZodOptional<z.ZodObject<{
366
+ defaultModel: z.ZodOptional<z.ZodString>;
367
+ models: z.ZodOptional<z.ZodObject<{
368
+ fable: z.ZodOptional<z.ZodString>;
369
+ opus: z.ZodOptional<z.ZodString>;
370
+ sonnet: z.ZodOptional<z.ZodString>;
371
+ haiku: z.ZodOptional<z.ZodString>;
372
+ }, z.core.$strict>>;
373
+ effort: z.ZodOptional<z.ZodEnum<{
374
+ none: "none";
375
+ low: "low";
376
+ medium: "medium";
377
+ high: "high";
378
+ }>>;
379
+ }, z.core.$strict>>;
380
+ }, z.core.$strict>], "kind">;
381
+ export type Provider = z.infer<typeof ProviderSchema>;
382
+ /** True when `provider` is a codex provider. `kind` is the tag, since a codex provider's own distinguishing block is optional. */
383
+ export declare function isCodexProvider(provider: Provider): provider is CodexProvider;
384
+ /**
385
+ * A named, reusable configuration profile at `~/.agent-shim/config-profiles/<name>.json`.
386
+ *
387
+ * `extends` is a flat array of other profiles' *names*, deliberately not a self-referential `z.lazy()` schema: nothing in this shape points back at a profile object, so each file validates in isolation and the extends graph is walked at resolve time. That also means Zod cannot detect a circular `extends` definition — the walker in `src/resolve/extends.ts` carries its own cycle guard.
388
+ */
389
+ export declare const ConfigProfileSchema: z.ZodObject<{
390
+ $schema: z.ZodOptional<z.ZodString>;
391
+ description: z.ZodOptional<z.ZodString>;
392
+ extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
393
+ categories: z.ZodOptional<z.ZodPipe<z.ZodObject<{
394
+ all: z.ZodOptional<z.ZodBoolean>;
395
+ runtime: z.ZodOptional<z.ZodBoolean>;
396
+ history: z.ZodOptional<z.ZodBoolean>;
397
+ knowledge: z.ZodOptional<z.ZodBoolean>;
398
+ settings: z.ZodOptional<z.ZodBoolean>;
399
+ }, z.core.$strict>, z.ZodTransform<Partial<Record<"runtime" | "history" | "knowledge" | "settings", boolean>>, {
400
+ all?: boolean | undefined;
401
+ runtime?: boolean | undefined;
402
+ history?: boolean | undefined;
403
+ knowledge?: boolean | undefined;
404
+ settings?: boolean | undefined;
405
+ }>>>;
406
+ entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
407
+ value: z.ZodBoolean;
408
+ when: z.ZodObject<{
409
+ newerThan: z.ZodOptional<z.ZodString>;
410
+ olderThan: z.ZodOptional<z.ZodString>;
411
+ maxSizeBytes: z.ZodOptional<z.ZodInt>;
412
+ branch: z.ZodOptional<z.ZodString>;
413
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
414
+ }, z.core.$strict>;
415
+ }, z.core.$strict>]>>>;
416
+ launch: z.ZodOptional<z.ZodObject<{
417
+ skipPermissions: z.ZodOptional<z.ZodBoolean>;
418
+ remoteControl: z.ZodOptional<z.ZodBoolean>;
419
+ provider: z.ZodOptional<z.ZodString>;
420
+ headroom: z.ZodOptional<z.ZodBoolean>;
421
+ trackUsage: z.ZodOptional<z.ZodBoolean>;
422
+ }, z.core.$strict>>;
423
+ }, z.core.$strict>;
424
+ export type ConfigProfile = z.infer<typeof ConfigProfileSchema>;
425
+ /** The prefix that turns a pool name into an identity selector. `:` is outside an identity name's character set, so a selector can never be mistaken for an identity. */
426
+ export declare const POOL_SELECTOR_PREFIX = "pool:";
427
+ /** A pool's own name: the identity alphabet minus `@`, since a pool is never an email address. */
428
+ export declare const PoolNameSchema: z.ZodString;
429
+ /** A named, explicit set of identities to choose among at launch. Never implicit: a pool lists its members, so an identity that bills a client is only ever picked when someone put it there. */
430
+ declare const PoolSchema: z.ZodObject<{
431
+ identities: z.ZodArray<z.ZodString>;
432
+ }, z.core.$strict>;
433
+ export type Pool = z.infer<typeof PoolSchema>;
434
+ /** One directory rule in `~/.agent-shim/directory-rules.json`, scoped to an explicit absolute (or `~`-rooted) path. */
435
+ export declare const DirectoryRuleSchema: z.ZodObject<{
436
+ entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
437
+ value: z.ZodBoolean;
438
+ when: z.ZodObject<{
439
+ newerThan: z.ZodOptional<z.ZodString>;
440
+ olderThan: z.ZodOptional<z.ZodString>;
441
+ maxSizeBytes: z.ZodOptional<z.ZodInt>;
442
+ branch: z.ZodOptional<z.ZodString>;
443
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
444
+ }, z.core.$strict>;
445
+ }, z.core.$strict>]>>>;
446
+ $schema: z.ZodOptional<z.ZodString>;
447
+ extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
448
+ categories: z.ZodOptional<z.ZodPipe<z.ZodObject<{
449
+ all: z.ZodOptional<z.ZodBoolean>;
450
+ runtime: z.ZodOptional<z.ZodBoolean>;
451
+ history: z.ZodOptional<z.ZodBoolean>;
452
+ knowledge: z.ZodOptional<z.ZodBoolean>;
453
+ settings: z.ZodOptional<z.ZodBoolean>;
454
+ }, z.core.$strict>, z.ZodTransform<Partial<Record<"runtime" | "history" | "knowledge" | "settings", boolean>>, {
455
+ all?: boolean | undefined;
456
+ runtime?: boolean | undefined;
457
+ history?: boolean | undefined;
458
+ knowledge?: boolean | undefined;
459
+ settings?: boolean | undefined;
460
+ }>>>;
461
+ launch: z.ZodOptional<z.ZodObject<{
462
+ skipPermissions: z.ZodOptional<z.ZodBoolean>;
463
+ remoteControl: z.ZodOptional<z.ZodBoolean>;
464
+ provider: z.ZodOptional<z.ZodString>;
465
+ headroom: z.ZodOptional<z.ZodBoolean>;
466
+ trackUsage: z.ZodOptional<z.ZodBoolean>;
467
+ }, z.core.$strict>>;
468
+ path: z.ZodString;
469
+ configProfile: z.ZodOptional<z.ZodString>;
470
+ identity: z.ZodOptional<z.ZodString>;
471
+ when: z.ZodOptional<z.ZodObject<{
472
+ newerThan: z.ZodOptional<z.ZodString>;
473
+ olderThan: z.ZodOptional<z.ZodString>;
474
+ maxSizeBytes: z.ZodOptional<z.ZodInt>;
475
+ branch: z.ZodOptional<z.ZodString>;
476
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
477
+ }, z.core.$strict>>;
478
+ }, z.core.$strict>;
479
+ export type DirectoryRule = z.infer<typeof DirectoryRuleSchema>;
480
+ /** The `~/.agent-shim/directory-rules.json` file. */
481
+ export declare const DirectoryRulesSchema: z.ZodObject<{
482
+ $schema: z.ZodOptional<z.ZodString>;
483
+ rules: z.ZodArray<z.ZodObject<{
484
+ entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
485
+ value: z.ZodBoolean;
486
+ when: z.ZodObject<{
487
+ newerThan: z.ZodOptional<z.ZodString>;
488
+ olderThan: z.ZodOptional<z.ZodString>;
489
+ maxSizeBytes: z.ZodOptional<z.ZodInt>;
490
+ branch: z.ZodOptional<z.ZodString>;
491
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
492
+ }, z.core.$strict>;
493
+ }, z.core.$strict>]>>>;
494
+ $schema: z.ZodOptional<z.ZodString>;
495
+ extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
496
+ categories: z.ZodOptional<z.ZodPipe<z.ZodObject<{
497
+ all: z.ZodOptional<z.ZodBoolean>;
498
+ runtime: z.ZodOptional<z.ZodBoolean>;
499
+ history: z.ZodOptional<z.ZodBoolean>;
500
+ knowledge: z.ZodOptional<z.ZodBoolean>;
501
+ settings: z.ZodOptional<z.ZodBoolean>;
502
+ }, z.core.$strict>, z.ZodTransform<Partial<Record<"runtime" | "history" | "knowledge" | "settings", boolean>>, {
503
+ all?: boolean | undefined;
504
+ runtime?: boolean | undefined;
505
+ history?: boolean | undefined;
506
+ knowledge?: boolean | undefined;
507
+ settings?: boolean | undefined;
508
+ }>>>;
509
+ launch: z.ZodOptional<z.ZodObject<{
510
+ skipPermissions: z.ZodOptional<z.ZodBoolean>;
511
+ remoteControl: z.ZodOptional<z.ZodBoolean>;
512
+ provider: z.ZodOptional<z.ZodString>;
513
+ headroom: z.ZodOptional<z.ZodBoolean>;
514
+ trackUsage: z.ZodOptional<z.ZodBoolean>;
515
+ }, z.core.$strict>>;
516
+ path: z.ZodString;
517
+ configProfile: z.ZodOptional<z.ZodString>;
518
+ identity: z.ZodOptional<z.ZodString>;
519
+ when: z.ZodOptional<z.ZodObject<{
520
+ newerThan: z.ZodOptional<z.ZodString>;
521
+ olderThan: z.ZodOptional<z.ZodString>;
522
+ maxSizeBytes: z.ZodOptional<z.ZodInt>;
523
+ branch: z.ZodOptional<z.ZodString>;
524
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
525
+ }, z.core.$strict>>;
526
+ }, z.core.$strict>>;
527
+ }, z.core.$strict>;
528
+ export type DirectoryRules = z.infer<typeof DirectoryRulesSchema>;
529
+ /**
530
+ * A committed `.agent-shim.json` (or its gitignored `.agent-shim.local.json` sibling). Structurally a directory rule without the `path` field: its scope is implicit — wherever the file lives, and everything below it — which is exactly what makes it portable across clone locations.
531
+ */
532
+ export declare const PortableConfigSchema: z.ZodObject<{
533
+ entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
534
+ value: z.ZodBoolean;
535
+ when: z.ZodObject<{
536
+ newerThan: z.ZodOptional<z.ZodString>;
537
+ olderThan: z.ZodOptional<z.ZodString>;
538
+ maxSizeBytes: z.ZodOptional<z.ZodInt>;
539
+ branch: z.ZodOptional<z.ZodString>;
540
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
541
+ }, z.core.$strict>;
542
+ }, z.core.$strict>]>>>;
543
+ $schema: z.ZodOptional<z.ZodString>;
544
+ extends: z.ZodOptional<z.ZodArray<z.ZodString>>;
545
+ categories: z.ZodOptional<z.ZodPipe<z.ZodObject<{
546
+ all: z.ZodOptional<z.ZodBoolean>;
547
+ runtime: z.ZodOptional<z.ZodBoolean>;
548
+ history: z.ZodOptional<z.ZodBoolean>;
549
+ knowledge: z.ZodOptional<z.ZodBoolean>;
550
+ settings: z.ZodOptional<z.ZodBoolean>;
551
+ }, z.core.$strict>, z.ZodTransform<Partial<Record<"runtime" | "history" | "knowledge" | "settings", boolean>>, {
552
+ all?: boolean | undefined;
553
+ runtime?: boolean | undefined;
554
+ history?: boolean | undefined;
555
+ knowledge?: boolean | undefined;
556
+ settings?: boolean | undefined;
557
+ }>>>;
558
+ launch: z.ZodOptional<z.ZodObject<{
559
+ skipPermissions: z.ZodOptional<z.ZodBoolean>;
560
+ remoteControl: z.ZodOptional<z.ZodBoolean>;
561
+ provider: z.ZodOptional<z.ZodString>;
562
+ headroom: z.ZodOptional<z.ZodBoolean>;
563
+ trackUsage: z.ZodOptional<z.ZodBoolean>;
564
+ }, z.core.$strict>>;
565
+ configProfile: z.ZodOptional<z.ZodString>;
566
+ identity: z.ZodOptional<z.ZodString>;
567
+ when: z.ZodOptional<z.ZodObject<{
568
+ newerThan: z.ZodOptional<z.ZodString>;
569
+ olderThan: z.ZodOptional<z.ZodString>;
570
+ maxSizeBytes: z.ZodOptional<z.ZodInt>;
571
+ branch: z.ZodOptional<z.ZodString>;
572
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
573
+ }, z.core.$strict>>;
574
+ }, z.core.$strict>;
575
+ export type PortableConfig = z.infer<typeof PortableConfigSchema>;
576
+ declare const HeadroomGlobalConfigSchema: z.ZodObject<{
577
+ source: z.ZodOptional<z.ZodString>;
578
+ idleShutdownMinutes: z.ZodOptional<z.ZodNumber>;
579
+ mode: z.ZodOptional<z.ZodEnum<{
580
+ cache: "cache";
581
+ token: "token";
582
+ }>>;
583
+ targetRatio: z.ZodOptional<z.ZodNumber>;
584
+ ccr: z.ZodOptional<z.ZodEnum<{
585
+ default: "default";
586
+ none: "none";
587
+ lossless: "lossless";
588
+ }>>;
589
+ rolloutChannel: z.ZodOptional<z.ZodEnum<{
590
+ beta: "beta";
591
+ canary: "canary";
592
+ dev: "dev";
593
+ }>>;
594
+ interceptToolResults: z.ZodOptional<z.ZodBoolean>;
595
+ readMaturation: z.ZodOptional<z.ZodBoolean>;
596
+ }, z.core.$strict>;
597
+ export type HeadroomGlobalConfig = z.infer<typeof HeadroomGlobalConfigSchema>;
598
+ /**
599
+ * The default `headroom.source` install spec: the ExaDev headroom repository, with the `proxy` extra that provides the `headroom proxy` entry point. Pinned to a full commit SHA (the fork's `exadev-per-session-savings-1` tag), because a branch name can be rebased or deleted and would change or break every fresh install; bump it deliberately when the fork's per-session savings work changes. Kept here rather than in the supervisor because it is the schema's own documented default, referenced by `HeadroomGlobalConfigSchema`'s field docs.
600
+ */
601
+ export declare const HEADROOM_DEFAULT_SOURCE = "headroom-ai[proxy] @ git+https://github.com/ExaDev/headroom@ecd1c351fcfed97499721e86852e148436ff2ee6";
602
+ /**
603
+ * The default `headroom.idleShutdownMinutes`: long enough that back-to-back sessions keep the daemon warm through a coffee break, short enough that an abandoned daemon frees its memory the same working day rather than squatting until reboot.
604
+ */
605
+ export declare const HEADROOM_DEFAULT_IDLE_SHUTDOWN_MINUTES = 15;
606
+ /**
607
+ * The default `frontdoor.idleShutdownMinutes`, the same trade-off as headroom's: warm through a break, gone the same working day once abandoned.
608
+ */
609
+ export declare const FRONTDOOR_DEFAULT_IDLE_SHUTDOWN_MINUTES = 15;
610
+ /** The user-global `~/.agent-shim/config.json`. */
611
+ export declare const GlobalConfigSchema: z.ZodObject<{
612
+ $schema: z.ZodOptional<z.ZodString>;
613
+ defaultConfigProfile: z.ZodOptional<z.ZodString>;
614
+ walkUpLimit: z.ZodOptional<z.ZodString>;
615
+ categories: z.ZodOptional<z.ZodPipe<z.ZodObject<{
616
+ all: z.ZodOptional<z.ZodBoolean>;
617
+ runtime: z.ZodOptional<z.ZodBoolean>;
618
+ history: z.ZodOptional<z.ZodBoolean>;
619
+ knowledge: z.ZodOptional<z.ZodBoolean>;
620
+ settings: z.ZodOptional<z.ZodBoolean>;
621
+ }, z.core.$strict>, z.ZodTransform<Partial<Record<"runtime" | "history" | "knowledge" | "settings", boolean>>, {
622
+ all?: boolean | undefined;
623
+ runtime?: boolean | undefined;
624
+ history?: boolean | undefined;
625
+ knowledge?: boolean | undefined;
626
+ settings?: boolean | undefined;
627
+ }>>>;
628
+ entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
629
+ value: z.ZodBoolean;
630
+ when: z.ZodObject<{
631
+ newerThan: z.ZodOptional<z.ZodString>;
632
+ olderThan: z.ZodOptional<z.ZodString>;
633
+ maxSizeBytes: z.ZodOptional<z.ZodInt>;
634
+ branch: z.ZodOptional<z.ZodString>;
635
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
636
+ }, z.core.$strict>;
637
+ }, z.core.$strict>]>>>;
638
+ launch: z.ZodOptional<z.ZodObject<{
639
+ skipPermissions: z.ZodOptional<z.ZodBoolean>;
640
+ remoteControl: z.ZodOptional<z.ZodBoolean>;
641
+ provider: z.ZodOptional<z.ZodString>;
642
+ headroom: z.ZodOptional<z.ZodBoolean>;
643
+ trackUsage: z.ZodOptional<z.ZodBoolean>;
644
+ }, z.core.$strict>>;
645
+ headroom: z.ZodOptional<z.ZodObject<{
646
+ source: z.ZodOptional<z.ZodString>;
647
+ idleShutdownMinutes: z.ZodOptional<z.ZodNumber>;
648
+ mode: z.ZodOptional<z.ZodEnum<{
649
+ cache: "cache";
650
+ token: "token";
651
+ }>>;
652
+ targetRatio: z.ZodOptional<z.ZodNumber>;
653
+ ccr: z.ZodOptional<z.ZodEnum<{
654
+ default: "default";
655
+ none: "none";
656
+ lossless: "lossless";
657
+ }>>;
658
+ rolloutChannel: z.ZodOptional<z.ZodEnum<{
659
+ beta: "beta";
660
+ canary: "canary";
661
+ dev: "dev";
662
+ }>>;
663
+ interceptToolResults: z.ZodOptional<z.ZodBoolean>;
664
+ readMaturation: z.ZodOptional<z.ZodBoolean>;
665
+ }, z.core.$strict>>;
666
+ frontdoor: z.ZodOptional<z.ZodObject<{
667
+ idleShutdownMinutes: z.ZodOptional<z.ZodNumber>;
668
+ }, z.core.$strict>>;
669
+ pools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
670
+ identities: z.ZodArray<z.ZodString>;
671
+ }, z.core.$strict>>>;
672
+ }, z.core.$strict>;
673
+ export type GlobalConfig = z.infer<typeof GlobalConfigSchema>;
674
+ /**
675
+ * An identity's own `identity.json`. `credential`, when present, authenticates the identity from a token instead of (or ahead of) its stored login: the launcher resolves it and exports it as its target (typically `oauthToken`, a `claude setup-token` token) in the child's environment only. Without it the identity uses the login stored in its own directory.
676
+ */
677
+ export declare const IdentitySchema: z.ZodObject<{
678
+ $schema: z.ZodOptional<z.ZodString>;
679
+ name: z.ZodString;
680
+ defaultConfigProfile: z.ZodOptional<z.ZodString>;
681
+ allowAmbientCredential: z.ZodDefault<z.ZodBoolean>;
682
+ credential: z.ZodOptional<z.ZodObject<{
683
+ sources: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
684
+ env: z.ZodString;
685
+ }, z.core.$strict>, z.ZodObject<{
686
+ file: z.ZodString;
687
+ }, z.core.$strict>, z.ZodObject<{
688
+ interactive: z.ZodOptional<z.ZodBoolean>;
689
+ timeoutMs: z.ZodOptional<z.ZodInt>;
690
+ command: z.ZodTuple<[z.ZodString], z.ZodString>;
691
+ }, z.core.$strict>, z.ZodObject<{
692
+ interactive: z.ZodOptional<z.ZodBoolean>;
693
+ timeoutMs: z.ZodOptional<z.ZodInt>;
694
+ op: z.ZodString;
695
+ }, z.core.$strict>, z.ZodObject<{
696
+ interactive: z.ZodOptional<z.ZodBoolean>;
697
+ timeoutMs: z.ZodOptional<z.ZodInt>;
698
+ keychain: z.ZodObject<{
699
+ service: z.ZodString;
700
+ account: z.ZodOptional<z.ZodString>;
701
+ }, z.core.$strict>;
702
+ }, z.core.$strict>, z.ZodObject<{
703
+ literal: z.ZodString;
704
+ }, z.core.$strict>]>>;
705
+ target: z.ZodOptional<z.ZodEnum<{
706
+ bearer: "bearer";
707
+ apiKey: "apiKey";
708
+ oauthToken: "oauthToken";
709
+ }>>;
710
+ cache: z.ZodOptional<z.ZodObject<{
711
+ ttl: z.ZodOptional<z.ZodString>;
712
+ store: z.ZodOptional<z.ZodEnum<{
713
+ file: "file";
714
+ keychain: "keychain";
715
+ }>>;
716
+ }, z.core.$strict>>;
717
+ }, z.core.$strict>>;
718
+ }, z.core.$strict>;
719
+ export type Identity = z.infer<typeof IdentitySchema>;
720
+ /**
721
+ * The OTHER "categories" concept, and a different shape from CategoryMapSchema entirely: this maps each category name to the list of literal names and globs whose top-level `~/.claude` entries belong to it. CategoryMapSchema says *whether* a category is shared; this says *which entries are in* a category. Do not conflate them.
722
+ */
723
+ export declare const CategoryClassificationSchema: z.ZodObject<{
724
+ $schema: z.ZodOptional<z.ZodString>;
725
+ secret: z.ZodArray<z.ZodString>;
726
+ runtime: z.ZodArray<z.ZodString>;
727
+ history: z.ZodArray<z.ZodString>;
728
+ knowledge: z.ZodArray<z.ZodString>;
729
+ settings: z.ZodArray<z.ZodString>;
730
+ }, z.core.$strict>;
731
+ export type CategoryClassification = z.infer<typeof CategoryClassificationSchema>;
732
+ /** The gitignored `~/.agent-shim/categories.local.json` overlay: any subset of the classification lists, answering "what category is this new entry?" without editing the shipped default map. */
733
+ export declare const CategoryClassificationOverlaySchema: z.ZodObject<{
734
+ $schema: z.ZodOptional<z.ZodString>;
735
+ secret: z.ZodOptional<z.ZodArray<z.ZodString>>;
736
+ runtime: z.ZodOptional<z.ZodArray<z.ZodString>>;
737
+ history: z.ZodOptional<z.ZodArray<z.ZodString>>;
738
+ knowledge: z.ZodOptional<z.ZodArray<z.ZodString>>;
739
+ settings: z.ZodOptional<z.ZodArray<z.ZodString>>;
740
+ }, z.core.$strict>;
741
+ export type CategoryClassificationOverlay = z.infer<typeof CategoryClassificationOverlaySchema>;
742
+ /**
743
+ * Whether a category is shared when no configuration layer says otherwise. This is the final fallback beneath every layer of the cascade, matching the README's category table: every identity shares the same `knowledge`, `settings`, and `history` out of the box — only `runtime` (live per-process/machine state that cannot be meaningfully shared) stays closed by default, and `secret` can never be shared at all. Identities differ in credentials, not in the data they see.
744
+ */
745
+ export declare const SHIPPED_CATEGORY_DEFAULTS: Readonly<Record<CategoryName, boolean>>;
746
+ export {};