//#region src/schema.d.ts /** * Ferry configuration contract. * * A `ferry.config.ts` (or `.mjs` / `.js`) declares which secrets exist, where * each one is resolved from (a backend ref built with `op()` / `file()` / * `env()`), and which commands are permitted to receive it. The config is a * plain, JSON-serializable object — no functions survive into the resolved * shape — so it can be loaded, validated, and audited without executing * arbitrary logic at read time. */ /** Which backend resolves a secret's value. */ type BackendKind = "op" | "file" | "env"; /** * A backend reference. `kind` selects the resolver; `ref` is the backend's * lookup key (a 1Password `op://…` ref, a name in the encrypted file store, or * an env var name). Built via the `op()` / `file()` / `env()` helpers so a * config never hand-writes the discriminant. */ interface BackendRef { kind: BackendKind; ref: string; } /** 1Password backend: resolves via the `op read ` CLI. */ declare function op(ref: string): BackendRef; /** Encrypted-local backend: resolves `name` from the AES-GCM file store. */ declare function file(name: string): BackendRef; /** * Process-env backend (lowest security; local dev). With no argument the * secret's own declared NAME is used as the env var; pass `varName` to read a * differently-named variable. */ declare function env(varName?: string): BackendRef; /** One declared secret. */ interface SecretDef { /** Where the value comes from. */ backend: BackendRef; /** * Glob(s) of commands permitted to receive this secret, matched POSITIONALLY * against the command's argv (per-arg, not a flattened string). Within a * token `*` matches any run of characters; a trailing bare `*` soaks up any * remaining args, otherwise the arity must match exactly (so an extra, * unauthorized arg is refused). e.g. `["vercel *"]`, * `["convex deploy", "convex env *"]`. */ allow: string[]; /** Optional human note (shown by `ferry list`). Never a value. */ description?: string; } /** The full Ferry config. */ interface FerryConfig { /** ENV_VAR name → declaration. The key is the variable injected into the child. */ secrets: Record; /** Append-only JSONL audit log path. Default: `.ferry/audit.log`. */ audit?: string; /** * When true, the child receives only a minimal safe base environment * (PATH/HOME/…) plus the injected secrets — NOT Ferry's full ambient env. * Use it to keep undeclared ambient secrets (other API keys) out of the * child. Default: false (full passthrough, minus Ferry-managed vars). */ cleanEnv?: boolean; } declare const DEFAULT_AUDIT_PATH = ".ferry/audit.log"; /** Identity helper — gives a config object its type + a place for editor docs. */ declare function defineFerry(config: FerryConfig): FerryConfig; /** * Hand-validate an untrusted config shape (no schema library). Returns a list * of human-readable problems; an empty array means the shape is valid. */ declare function validateConfig(input: unknown): string[]; /** Structural parse: returns a typed config or throws with all problems joined. */ declare function parseConfig(input: unknown): FerryConfig; //#endregion export { SecretDef as a, file as c, validateConfig as d, FerryConfig as i, op as l, BackendRef as n, defineFerry as o, DEFAULT_AUDIT_PATH as r, env as s, BackendKind as t, parseConfig as u }; //# sourceMappingURL=schema-CZgZlno6.d.ts.map