import type { LeetCodeClient } from "../leetcode/client.js"; import type { CapabilityManifest, NotesDocument, Region, ToolErrorCode, ToolFailure, ToolResult, UserNoteMutationResult, UserNotesGetResult, UserNotesSearchResult, UserStatus } from "../types.js"; import { type ToolName } from "./contract.js"; import { type DiagnosticsOperation, type DiagnosticsSnapshot } from "./diagnostics.js"; export interface SubmitConfirmationRequest { region: Region; titleSlug: string; language: string; codeHash: string; } export type GatewayInteractionBridge = { hasUI: false; } | { hasUI: true; confirm(title: string, message: string, signal?: AbortSignal): Promise; }; export interface GatewayExecuteOptions { signal?: AbortSignal; requestId?: string; interaction?: GatewayInteractionBridge; } export interface CreateGatewayOptions { client: LeetCodeClient; interactiveUI: boolean; now?: () => Date; } export interface ToolGateway { getCapabilities(): CapabilityManifest; getDiagnosticsSnapshot(): DiagnosticsSnapshot; updateDiagnosticsQueue(region: Region, depth: number, limit: number): void; recordDiagnosticsResult(operation: DiagnosticsOperation, region: Region, result: ToolResult): void; execute(name: ToolName | string, input: unknown, options?: GatewayExecuteOptions): Promise>; readNotes(input: unknown, options?: GatewayExecuteOptions): Promise>; writeNotes(input: unknown, options?: GatewayExecuteOptions): Promise>; getUserStatus(input: unknown, options?: GatewayExecuteOptions): Promise>; searchUserNotes(input: unknown, options?: GatewayExecuteOptions): Promise>; getUserNotes(input: unknown, options?: GatewayExecuteOptions): Promise>; createUserNote(input: unknown, options?: GatewayExecuteOptions): Promise>; updateUserNote(input: unknown, options?: GatewayExecuteOptions): Promise>; setProviderConflict(conflicted: boolean): void; close(): Promise; } export declare function createGatewayFailure(code: ToolErrorCode, message: string, options?: { requestId?: string; region?: Region; retryable?: boolean; operationId?: string; details?: Record; manifest?: CapabilityManifest; }): ToolFailure; export declare function createUnavailableResult(name: string, input: unknown, requestId?: string): ToolFailure; export declare class LeetCodeToolGateway implements ToolGateway { #private; constructor(options: CreateGatewayOptions); getCapabilities(): CapabilityManifest; getDiagnosticsSnapshot(): DiagnosticsSnapshot; updateDiagnosticsQueue(region: Region, depth: number, limit: number): void; recordDiagnosticsResult(operation: DiagnosticsOperation, region: Region, result: ToolResult): void; setProviderConflict(conflicted: boolean): void; execute(name: ToolName | string, input: unknown, options?: GatewayExecuteOptions): Promise>; readNotes(input: unknown, options?: GatewayExecuteOptions): Promise>; writeNotes(input: unknown, options?: GatewayExecuteOptions): Promise>; getUserStatus(input: unknown, options?: GatewayExecuteOptions): Promise>; searchUserNotes(input: unknown, options?: GatewayExecuteOptions): Promise>; getUserNotes(input: unknown, options?: GatewayExecuteOptions): Promise>; createUserNote(input: unknown, options?: GatewayExecuteOptions): Promise>; updateUserNote(input: unknown, options?: GatewayExecuteOptions): Promise>; close(): Promise; } export declare function createToolGateway(options: CreateGatewayOptions): ToolGateway; //# sourceMappingURL=gateway.d.ts.map