/** * Typed error codes carried in the devtools JSON envelope. The string code * travels over every transport (a DBus error-name suffix, a WS JSON * `error.code`) so the MCP bridge can map a failure to a clear, actionable * tool result. * * Convention: a method handler signals a typed failure by throwing a * {@link DevtoolsError} whose `code` is one of these; transports serialise * `code` + `message` and the bridge re-surfaces them verbatim. */ export type DevtoolsErrorCode = 'paused' | 'human-only' | 'unavailable' | 'not-found' | 'unsupported' | 'invalid-params' | 'internal'; /** A failure a devtools method handler can throw to carry a typed code. */ export declare class DevtoolsError extends Error { readonly name = "DevtoolsError"; readonly code: DevtoolsErrorCode; readonly data?: unknown; constructor(code: DevtoolsErrorCode, message: string, data?: unknown); } /** Narrow an unknown thrown value to the envelope's error payload shape. */ export declare function toErrorPayload(err: unknown): { code: DevtoolsErrorCode; message: string; data?: unknown; }; /** * Encode a code into an error message as a `": "` prefix. * DBus carries only the message string of a thrown error, so the in-app DBus * adapter prefixes the code this way and the bridge recovers it with * {@link parseDbusErrorMessage} — the typed code survives the wire. */ export declare function formatDbusErrorMessage(code: DevtoolsErrorCode, message: string): string; /** Recover a `{ code, message }` from a `": "` DBus error string. */ export declare function parseDbusErrorMessage(raw: string): { code: DevtoolsErrorCode; message: string; };