import { APIResource } from '../core/resource.js'; import { APIPromise } from '../core/api-promise.js'; import { OffsetPaginationIssues, type OffsetPaginationIssuesParams, PagePromise } from '../core/pagination.js'; import { RequestOptions } from '../internal/request-options.js'; export declare class Issues extends APIResource { /** * **Beta:** This endpoint is in active development and may change without notice. * * Returns one issue for the authenticated tenant. */ retrieve(id: string, options?: RequestOptions): APIPromise; /** * **Beta:** This endpoint is in active development and may change without notice. * * Returns issues for the authenticated tenant, optionally filtered by session, * status, severity, tag, linked trace, or last modified time. */ list(query?: IssueListParams | null | undefined, options?: RequestOptions): PagePromise; } export type IssuesOffsetPaginationIssues = OffsetPaginationIssues; export interface Issue { id?: string; actions?: unknown; auto_resolution_evidence?: unknown; /** * Nil unless eligible: "auto_close" or "prompt". Evidence carries the deciding * gate. */ auto_resolution_state?: string; created_at?: string; description?: string; first_seen_at?: string; fix_branch?: string; fix_dispatched_at?: string; fix_pr_number?: number; fix_prompt?: string; fix_verification?: unknown; last_seen_at?: string; linear_sync?: Issue.LinearSync; name?: string; proposed_context_fixes?: Array; proposed_examples?: Array; proposed_fix?: string; proposed_prompt_fixes?: Array; /** * RecurrencesSinceWatching counts linked traces whose run start_time is after * watching_since — i.e. recurrences observed during the current watch period. */ recurrences_since_watching?: number; session_id?: string; severity?: 0 | 1 | 2 | 3; status?: 'open' | 'fixing' | 'watching' | 'completed' | 'ignored'; tags?: Array; tenant_id?: string; traces?: unknown; updated_at?: string; watching_since?: string; } export declare namespace Issue { interface LinearSync { identifier?: string; issue_id?: string; last_attempted_at?: string; last_error?: string; last_synced_at?: string; linear_issue_id?: string; state?: 'pending' | 'synced' | 'failed' | 'auth_required' | 'paused'; url?: string; } } export interface IssueListParams extends OffsetPaginationIssuesParams { /** * Filter by session ID (UUID) */ session_id?: string; /** * Filter by session name (exact match) */ session_name?: string; /** * Filter by severity */ severity?: 0 | 1 | 2 | 3; /** * Sort field */ sort_by?: 'created_at' | 'updated_at' | 'severity'; /** * Filter by status */ status?: 'open' | 'fixing' | 'watching' | 'completed' | 'ignored'; /** * Filter by tag (exact match) */ tag?: string; /** * Return only issues with a linked run in this trace */ trace_id?: string; /** * Return only issues updated at or after this RFC3339 timestamp */ updated_at?: string; } export declare namespace Issues { export { type Issue as Issue, type IssuesOffsetPaginationIssues as IssuesOffsetPaginationIssues, type IssueListParams as IssueListParams, }; }