import { a as AppToolContext } from './types-BCxK0wyS.js';

/**
 * Header names carrying the server-set per-turn context + the capability token.
 * Defaults are product-neutral (`X-Agent-App-*`); a product that already ships
 * a header convention (e.g. `X-Acme-User-Id`) passes its own.
 */
interface ToolHeaderNames {
    userId: string;
    workspaceId: string;
    threadId: string;
}
/** Provide default HTTP header names for user, workspace, and thread identification */
declare const DEFAULT_HEADER_NAMES: ToolHeaderNames;
/** Define options to verify bearer tokens and customize authentication header names */
interface AuthenticateOptions {
    /** Verify the bearer capability token belongs to `userId`. The product's
     *  HMAC/JWT impl — the seam that keeps token crypto out of this package. */
    verifyToken: (userId: string, bearer: string) => Promise<boolean>;
    headerNames?: ToolHeaderNames;
}
/** Represent the result of tool authentication with success context or failure response */
type ToolAuthResult = {
    ok: true;
    ctx: AppToolContext;
} | {
    ok: false;
    response: Response;
};
/**
 * Recover + verify the trusted context for a tool request. The user comes from
 * a server-set header and the bearer token MUST verify against THAT user; the
 * workspace comes from a header too — never from tool args — so the model can
 * neither forge identity nor target another workspace. Fail-closed: any missing
 * credential or a token minted for another user yields a 401/400 Response.
 */
declare function authenticateToolRequest(request: Request, opts: AuthenticateOptions): Promise<ToolAuthResult>;
/** Read a tool's argument object from the request body, tolerant of MCP host
 *  aliases (`args` / `arguments`) or a bare body. Returns null on non-JSON. */
declare function readToolArgs<T>(request: Request): Promise<T | null>;

export { type AuthenticateOptions as A, DEFAULT_HEADER_NAMES as D, type ToolHeaderNames as T, type ToolAuthResult as a, authenticateToolRequest as b, readToolArgs as r };
