import { type ActionMcpOutputContract } from "../action-output-contract.js"; import { type ActionOutputEffect } from "../action.js"; /** * Build an opted-in action's `structuredContent` and enforce its MCP response * contract on it. Returns the JSON form the client receives. Every failure * after the action ran — the transform throwing, a value JSON cannot carry, the * validator throwing, or a mismatch — is an `ActionOutputContractError` that * keeps the call's effect. */ export type McpResponseOutputCheck = (build: () => Record, failure: { actionName: string; effect: ActionOutputEffect; }) => Record; /** * An opted-in action's result as the JSON the client receives, computed once * so the structured check and the text read the same plain data: a `toJSON` * that changes or throws on a second call cannot pass the check and then fail * the text. */ export declare function mcpContractValue(value: unknown, failure: { actionName: string; effect: ActionOutputEffect; }): unknown; /** * Compile the check for an opted-in action's MCP response contract. Call it * before `run`: a contract that cannot be enforced must fail while nothing has * been applied, not after a write. */ export declare function mcpResponseOutputCheck(contract: ActionMcpOutputContract): McpResponseOutputCheck;