import type { Breakpoint, BreakpointAnswer, BreakpointBrowserSession, BreakpointSessionView, ResponderProfile } from "../types.js"; /** * Error thrown when the server returns a non-OK response. */ export declare class ServerError extends Error { readonly status: number; readonly statusText: string; readonly body?: string | undefined; constructor(status: number, statusText: string, body?: string | undefined); } /** * Lightweight wrapper around an SSE connection using fetch + ReadableStream. * Provides an EventSource-like interface without requiring the EventSource API. */ export interface SSEStream { /** Register a handler for a named event type. */ on(event: string, handler: (data: string) => void): void; /** Register a handler for errors. */ onError(handler: (error: Error) => void): void; /** Close the underlying connection. */ close(): void; } export interface ServerClientOptions { baseUrl?: string; defaultHeaders?: Record; } export declare const DEFAULT_BMUX_SERVER_URL = "https://tasks-adapter.a5c.ai/api/v1"; /** * HTTP client for communicating with the Breakpoints Adapter server. */ export declare class ServerClient { readonly baseUrl: string; private readonly defaultHeaders; constructor(options?: string | ServerClientOptions); /** * Submit a new breakpoint to the server. */ submitBreakpoint(breakpoint: { text: string; context: Breakpoint["context"]; routing: Breakpoint["routing"]; projectId: string; repoId: string; }): Promise; /** * Retrieve a breakpoint by its ID. */ getBreakpoint(breakpointId: string): Promise; createBrowserSession(breakpointId: string, options?: { mode?: "same-user" | "responder"; responderId?: string; responderName?: string; }): Promise; getBreakpointSession(authToken: string): Promise; submitSessionAnswer(authToken: string, answer: { text: string; confidence?: number; references?: string[]; followUpQuestions?: string[]; decisionMemory?: { applicabilityContext: string; reasoning: string; }; }): Promise; /** * Open an SSE stream for real-time updates on a breakpoint. */ getBreakpointStream(breakpointId: string, signal?: AbortSignal): SSEStream; /** * List responder profiles, optionally scoped to a project or repo. */ listResponders(filters?: { projectId?: string; repoId?: string; }): Promise; /** * List pending breakpoints for a specific responder. */ listPendingBreakpoints(responderId: string, filters?: { projectId?: string; repoId?: string; status?: string; }): Promise; /** * Claim a breakpoint as a responder. */ claimBreakpoint(breakpointId: string, responderId: string): Promise; /** * Submit an answer for a breakpoint. */ submitAnswer(breakpointId: string, answer: { responderId: string; responderName: string; text: string; confidence?: number; references?: string[]; followUpQuestions?: string[]; decisionMemory?: { applicabilityContext: string; reasoning: string; }; }): Promise; /** * Cancel (delete) a breakpoint. */ cancelBreakpoint(breakpointId: string): Promise; /** * Check server health. */ healthCheck(): Promise<{ status: string; }>; /** @internal Exposed for composition by AuthClient. */ get(path: string, extraHeaders?: Record): Promise; /** @internal Exposed for composition by AuthClient. */ post(path: string, body: unknown, extraHeaders?: Record): Promise; /** @internal Exposed for composition by AuthClient. */ put(path: string, body: unknown, extraHeaders?: Record): Promise; /** @internal Exposed for composition by AuthClient. */ delete(path: string, extraHeaders?: Record): Promise; private request; protected resolveUrl(path: string): string; } //# sourceMappingURL=server-client.d.ts.map