/**
 * Zero-knowledge / JIT secret delivery over MCP (issue #333).
 *
 * A stdio MCP server exposing a single `get_secret(bundle, key)` tool. Unlike
 * `agents secrets exec`, which spawns the child process with EVERY resolved
 * value baked into `process.env` (any subprocess can `printenv` the lot — see
 * buildSecretsExecEnv in src/commands/secrets.ts), this server hands an
 * MCP-speaking agent framework ONE credential at a time, by name, at call
 * time. The raw value is returned only inside the tool result: it never enters
 * the child's environment, is never logged, and never appears in `tools/list`
 * metadata (names only).
 *
 * Resolution reuses the canonical bundle read path
 * (readAndResolveBundleEnv -> getKeychainToken); no keychain access is
 * re-implemented here. On Linux the libsecret backend (or its encrypted-file
 * fallback for locked/headless collections) applies transparently through that
 * abstraction, so the server stays backend-agnostic and works unchanged on
 * macOS.
 *
 * Transport: the MCP stdio transport is newline-delimited JSON-RPC 2.0 (one
 * message per line, UTF-8, no embedded newlines). That framing is trivial, so
 * we implement it directly rather than pull in the @modelcontextprotocol/sdk
 * server dependency — keeping the tree dependency-free and the handler pure and
 * unit-testable in-process.
 */
/** MCP protocol revision this server negotiates. */
export declare const MCP_PROTOCOL_VERSION = "2024-11-05";
/** The single tool this server exposes. */
export declare const GET_SECRET_TOOL = "get_secret";
/** serverInfo.name reported at `initialize`. */
export declare const MCP_SERVER_NAME = "agents-secrets";
export interface JsonRpcRequest {
    jsonrpc?: string;
    id?: string | number | null;
    method?: string;
    params?: unknown;
}
interface JsonRpcSuccess {
    jsonrpc: '2.0';
    id: string | number | null;
    result: unknown;
}
interface JsonRpcErrorResponse {
    jsonrpc: '2.0';
    id: string | number | null;
    error: {
        code: number;
        message: string;
    };
}
export type JsonRpcResponse = JsonRpcSuccess | JsonRpcErrorResponse;
/** Per-bundle metadata for `tools/list` — names only, NEVER values. */
export interface BundleKeyMetadata {
    bundle: string;
    description?: string;
    keys: string[];
}
/**
 * Enumerate every bundle and its key names WITHOUT resolving or reading any
 * value. Mirrors how `agents secrets list` surfaces bundle metadata: names are
 * safe to expose, values are not. `listBundles()` reads only the bundle
 * metadata items (var definitions), never the secret items behind them.
 */
export declare function listSecretMetadata(): BundleKeyMetadata[];
/**
 * Resolve a single secret value by bundle + key through the canonical read
 * path. Throws a clear error when the bundle or the key is absent.
 *
 * The bundle metadata is read first (readBundle) so a missing key is reported
 * without triggering resolution — and, on macOS, without prompting Touch ID —
 * for the other keys in the bundle.
 */
export declare function resolveSecret(bundle: string, key: string): string;
/**
 * Handle one parsed JSON-RPC request. Returns the response object, or `null`
 * for notifications (which take no reply). Pure — no I/O, no logging — so tests
 * drive it directly.
 */
export declare function handleMcpRequest(req: JsonRpcRequest, ctx?: {
    version?: string;
}): JsonRpcResponse | null;
/**
 * Run the stdio MCP server: read newline-delimited JSON-RPC requests from
 * `input`, write responses to `output`. Resolves when the input stream ends.
 * Streams are injectable so tests can drive a full request/response loop
 * without spawning a process.
 */
export declare function runSecretsMcpServer(opts?: {
    input?: NodeJS.ReadableStream;
    output?: NodeJS.WritableStream;
    version?: string;
}): Promise<void>;
export {};
