/** * sigil config at ~/.sigil/config.toml. Carries the OOB confirm transport * block and the optional local JSON-RPC signing proxy block. * * [confirm.ntfy] * topic = "an-unguessable-string" * server = "https://ntfy.sh" # optional, default https://ntfy.sh * * [rpc] * portal = "evm:bot" * upstream = "https://sepolia.example/v3/KEY" * token = "an-unguessable-string-16+chars" * port = 8547 # optional * * Missing file → SigilConfig with no transport configured. That's fine on * its own; we only fail closed at startup if some policy actually depends * on a transport (see `enforceConfirmTransportPresence`). */ export interface SigilConfig { confirm?: ConfirmConfig; rpc?: RpcConfigToml; } /** * Local JSON-RPC signing proxy (`[rpc]` block). All of portal/upstream/token * are required — the proxy never starts without an auth token, and a token * under 16 chars is rejected at parse time rather than silently weakening * the only thing standing between "any local process" and "signs with the * portal key". */ export interface RpcConfigToml { /** Portal handle whose key answers eth_accounts / signs eth_sendTransaction. */ portal: string; /** Upstream JSON-RPC node everything else is proxied to. http(s) only. */ upstream: string; /** Shared secret every request must present (Bearer or Basic password). */ token: string; /** Listen port on 127.0.0.1. Default 8547 (clear of anvil's 8545). */ port?: number; } export interface ConfirmConfig { /** Default timeout for any OOB confirm round-trip, in milliseconds. * Defaults to 60_000. Per-portal overrides come later. */ timeoutMs?: number; ntfy?: NtfyConfigToml; } export interface NtfyConfigToml { topic: string; server?: string; } export declare class SigilConfigError extends Error { constructor(message: string); } /** * Parse the file contents (an empty string is treated as "no file"). * Exported for tests; production loaders should use `loadConfig` so the * file-not-found case is handled uniformly. */ export declare function parseConfig(source: string): SigilConfig; /** Minimum length for the [rpc] auth token. Below this, brute force from a * rebound browser page or a local process stops being fanciful. */ export declare const RPC_TOKEN_MIN_LENGTH = 16; /** * Load + parse the file at ~/.sigil/config.toml. Returns an empty config if * the file is absent. Throws SigilConfigError on parse/schema errors. */ export declare function loadConfig(path: string): SigilConfig; /** * Walk every *.toml under the policy dir, parse each, and return true if * any of them can route a sign to the confirm gate: require_confirm_above_wei, * or strict-mode allow_contract_creation (deploys always confirm). A * malformed policy file is skipped (it'll surface its own error at sign * time); we only need to know whether some portal is *trying* to gate on * confirm. */ export declare function anyPolicyRequiresConfirm(policyDir: string): boolean; /** * Fail-closed check called at sigil-mcp boot: if any policy on disk uses * require_confirm_above_wei but the config has no transport, the process * cannot honour that policy — bail with a clear message instead of running * with a half-built safety net. */ export declare function enforceConfirmTransportPresence(config: SigilConfig, policyDir: string): void; //# sourceMappingURL=config.d.ts.map