/** * Ory CLI execution wrapper. * * Runs `ory` subcommands via child_process.execFile and returns structured results. * Always appends `--format json` for parseable output. */ export interface ExecResult { stdout: string; stderr: string; exitCode: number; } export declare class OryCliNotFoundError extends Error { constructor(); } /** * Run an ory CLI command and return the result. * * Non-zero exit codes are not thrown — the caller inspects stdout/stderr. * Only truly fatal errors (binary missing, timeout) are thrown. */ export declare function runOryCommand(args: string[]): Promise; /** * Build the common args appended to every ory command. * Adds --format json and optional --project / --workspace flags. */ export declare function buildCommonArgs(params: { project?: string; workspace?: string; format?: boolean; }): string[]; /** * Helper to format an ory command result as an MCP tool response. */ export declare function formatToolResult(result: ExecResult): { content: Array<{ type: "text"; text: string; }>; isError?: boolean; }; /** * Run an ory command and return a formatted MCP tool response. * Catches OryCliNotFoundError and returns a user-friendly message. */ export declare function execOryTool(args: string[]): Promise<{ content: Array<{ type: "text"; text: string; }>; isError?: boolean; }>; /** * For CLI commands that accept either a file path or inline content, * write the content to a tempfile and clean up afterwards. * * Returns an MCP error response if neither is provided. Pass `extension` * to control the temp file suffix (e.g. ".json", ".ts"). */ export declare function withFileOrContent(params: { file?: string; content?: string; }, extension: string, fn: (filePath: string) => Promise<{ content: Array<{ type: "text"; text: string; }>; isError?: boolean; }>): Promise<{ content: Array<{ type: "text"; text: string; }>; isError?: boolean; }>;