/** * ForgeAPIError — structured error for non-ok HTTP responses from the ForgeOS engine. * * Parses the engine's standard error envelope: * { detail, error, context, suggestion, request_id, docs_url } * * Sprint 2 additions : * next_actions — structured recovery steps for agents * missing_artifacts — gate-blocking artifact requirements * toAgentMessage() — plain JSON output (no ANSI, no formatting) * * Design: single source of truth for how callers present engine errors to end * users. Both the MCP transport and the CLI binary import this class; neither * duplicates the formatting logic. */ export interface NextAction { /** CLI command the agent should run next. e.g. "forge gate check --initiative " */ command: string; /** Why this action is recommended. */ reason: string; } export interface ArtifactRequirement { /** Artifact type identifier. e.g. "unit_test", "security_scan" */ type: string; /** Human-readable description of what this artifact must contain. */ description: string; /** The CLI command that produces this artifact. */ produces_via: string; } export declare class ForgeAPIError extends Error { status: number; detail: string; context: Record | null; suggestion: string | null; requestId: string | null; docsUrl: string | null; /** Sprint 2: structured recovery steps the agent should take. */ next_actions: NextAction[]; /** Sprint 2: artifact requirements blocking a gate (populated when status === 422 or gate-related). */ missing_artifacts: ArtifactRequirement[]; constructor(status: number, body: Record); /** * Return a user-facing message that includes the error detail plus any * actionable hints the engine provided. */ toUserMessage(): string; /** * Sprint 2: Return a plain JSON-serialisable object for agent consumption. * No ANSI codes. No CLI formatting. Machine-readable only. */ toAgentMessage(): object; } //# sourceMappingURL=errors.d.ts.map