import type { StandardSchemaV1 } from "@standard-schema/spec"; export type JsonSchemaObject = Record; /** * The two output contracts of an action that opts in with `mcpOutputSchema`. * * `semantic` describes the sanitized value `run` returns after `outputSchema` * validated it — what in-process callers and typed script bindings see. * `response` is what MCP advertises as the tool's `outputSchema`: the semantic * contract after the transport transform that builds `structuredContent` * (an array result is wrapped as `{ items }`, embed credentials are removed, * embed start URLs become the hidden-URL marker, `_agentImages` is lifted * into image content, and actions that produce an open link gain optional * `openLink` and `url` fields). Every value the semantic contract accepts must still satisfy the * response contract after that transform. */ export interface ActionMcpOutputContract { readonly semantic: JsonSchemaObject; readonly response: JsonSchemaObject; } /** Formats the MCP check validates (ajv-formats' full set). */ export declare const SUPPORTED_OUTPUT_FORMATS: ReadonlySet; /** * Convert an action's `outputSchema` to JSON Schema through the schema's own * Standard JSON Schema *output* converter. The input converter describes what * a schema accepts, which differs from what it produces wherever a default, * preprocess, or coercion runs. */ export declare function outputSchemaToJsonSchema(schema: StandardSchemaV1): JsonSchemaObject; /** * Derive the MCP response contract from the semantic one. Only an object * root, an object-only composition, or an array root (wrapped as `{ items }`) * can become `structuredContent`, so any other root is refused here rather * than advertised as a contract no response could meet. */ export declare function deriveMcpResponseOutputSchema(declared: JsonSchemaObject, options: { openLink: boolean; }): JsonSchemaObject; export declare function buildActionMcpOutputContract(outputSchema: StandardSchemaV1, options: { openLink: boolean; }): ActionMcpOutputContract; /** * An issue path built only from what the schema declares. Object keys can * repeat the data — a record key (`"42"` as much as `"dave@example.com"`) — so * the path is walked through `schema`: a segment survives only as an index * where the schema allows an array and no object at that point, or as a * property name the schema declares at that node. Every other segment is `*`; * without a schema, every segment is. */ export declare function maskedIssuePath(path: ReadonlyArray, schema: JsonSchemaObject | undefined): string[]; /** * One output-contract issue as `path: code`, built only from what the schema * declares. Messages can repeat the returned data — an unrecognized key, a * refinement message that interpolates a value — so only the masked path and a * reported code are kept. */ export declare function describeOutputContractIssue(path: ReadonlyArray, code: unknown, schema: JsonSchemaObject | undefined): string; /** * The JSON Schema an action's input accepts, from the schema's own Standard * JSON Schema *input* converter, which keeps nested fields behind a * `z.preprocess` that parses a JSON string. `undefined` when the schema has no * converter, so a path through it is masked whole. */ export declare function inputSchemaToJsonSchema(schema: StandardSchemaV1): JsonSchemaObject | undefined;