import type { AxiosInstance } from 'axios'; export interface CheckResult { id: string; checkId: string; name: string; hasFailures: boolean; hasErrors: boolean; isDegraded: boolean | null; overMaxResponseTime: boolean | null; runLocation: string; startedAt: string; stoppedAt: string; created_at: string; responseTime: number; checkRunId: number; attempts: number; resultType: 'FINAL' | 'ATTEMPT'; sequenceId?: string | null; errorGroupIds?: string[] | null; apiCheckResult?: ApiCheckResult | null; browserCheckResult?: BrowserCheckResult | null; multiStepCheckResult?: MultiStepCheckResult | null; agenticCheckResult?: AgenticCheckResult | null; } export interface ApiCheckAssertion { source: string; comparison: string; target: string | number; property?: string; } export interface ApiCheckResult { assertions: ApiCheckAssertion[] | null; request: { method: string; url: string; data: string; headers: Record; params: Record; }; response: { status: number; statusText: string; body: string; headers: Record | null; timings: { socket: number; lookup: number; connect: number; response: number; end: number; } | null; timingPhases: { wait: number; dns: number; tcp: number; firstByte: number; download: number; total: number; } | null; }; requestError: string | null; jobLog: unknown | null; jobAssets: string[] | null; pcapDataUrl: string | null; } export interface WebVitalEntry { score: 'GOOD' | 'NEEDS_IMPROVEMENT' | 'POOR'; value: number; } export interface BrowserCheckResult { type: string; traceSummary: { consoleErrors: number; networkErrors: number; documentErrors: number; userScriptErrors: number; }; errors: string[]; pages: Array<{ url: string; webVitals: { CLS?: WebVitalEntry; FCP?: WebVitalEntry; LCP?: WebVitalEntry; TBT?: WebVitalEntry; TTFB?: WebVitalEntry; }; }>; startTime: number; endTime: number; runtimeVersion: string; jobLog: Array<{ time: number; msg: string; level: string; }> | null; jobAssets: string[] | null; playwrightTestVideos?: string[]; playwrightTestTraces?: string[]; playwrightTestJsonReportFile?: string; } export interface MultiStepCheckResult { errors: string[]; startTime: number; endTime: number; runtimeVersion: string; jobLog: Array<{ time: number; msg: string; level: string; }> | null; jobAssets: string[] | null; playwrightTestTraces?: string[]; playwrightTestJsonReportFile?: string; } export interface AgenticAssertion { condition?: string | null; passed?: boolean | null; actual?: string | null; expected?: string | null; } export interface AgenticSuggestion { summary?: string | null; prompt?: string | null; secrets?: string[] | null; category?: 'credentials' | 'endpoint' | 'configuration' | null; } export interface AgenticStep { type?: 'tool_call' | 'tool_result' | 'message' | null; name?: string | null; input?: Record | null; output?: string | null; timestamp?: string | null; sequenceNumber?: number | null; } /** * The agentic check result shape returned by the public API for AGENTIC * checks. Every field is optional/nullable on purpose: the agentic product * is still early-stage, and the backend may reshape this payload under a * new API version. Consumers should degrade gracefully when fields are * missing rather than assume a particular structure. * * Note: `model`, `costUsd`, and `tokensUsed` exist in the runner's raw * metadata but are intentionally NOT part of the public response shape. * The backend strips them from the serialized response today, and the CLI * does not render them even if they ever re-appear on an envelope it * receives. */ export interface AgenticCheckResult { summary?: string | null; prompt?: string | null; assertions?: AgenticAssertion[] | null; suggestions?: AgenticSuggestion[] | null; steps?: AgenticStep[] | null; errors?: Array<{ error?: { message?: string | null; } | null; }> | null; artifactManifest?: Record | null; jobLog?: unknown | null; jobAssets?: string[] | null; } export interface CheckResultsPage { length: number; entries: CheckResult[]; nextId: string | null; } export interface ListCheckResultsParams { limit?: number; nextId?: string; from?: number; to?: number; hasFailures?: boolean; resultType?: 'FINAL' | 'ATTEMPT' | 'ALL'; } declare class CheckResults { api: AxiosInstance; constructor(api: AxiosInstance); getAll(checkId: string, params?: ListCheckResultsParams): Promise>; get(checkId: string, checkResultId: string): Promise>; } export default CheckResults;