import type { ClientLike } from '../mcp/tools/types.js'; import type { ClientRegistry } from './clientRegistry.js'; /** * A ClientLike proxy that delegates to a specific base client * based on the async context set via runWithBase(). This ensures * thread-safe routing even with concurrent tool calls — each call * gets its own isolated base context via AsyncLocalStorage. */ export declare class ContextualClient implements ClientLike { private readonly registry; constructor(registry: ClientRegistry); /** * Run a function with the given base name bound to the async context. * All client method calls within `fn` (including across await boundaries) * will route to the specified base. */ runWithBase(name: string | undefined, fn: () => T): T; /** * Resolving outside a runWithBase() scope is always a programming error, and * it used to hide well: with a single base it quietly succeeded via the * registry default, and only with two or more did it surface — as "Specify * base parameter", which blames the caller for omitting an argument they * did supply. It cost five months to find that way once, so it is named * here and fails the same way whatever the base count. */ private get client(); getBaseInfo(): { dtableUuid?: string; appName?: string; }; listTables(): Promise<{ name: string; _id: string; }[]>; getMetadata(): Promise; clearMetadataCache(): void; listRows(query: { table: string; page?: number; page_size?: number; }): Promise<{ rows: any[]; page?: number; page_size?: number; total?: number; has_more?: boolean; }>; getRow(table: string, rowId: string): Promise; addRow(table: string, row: Record): Promise; addRows(table: string, rows: Array>): Promise; updateRow(table: string, rowId: string, row: Record): Promise; updateRows(table: string, updates: Array<{ row_id: string; row: Record; }>): Promise<{ success: boolean; }>; deleteRow(table: string, rowId: string): Promise<{ success: boolean; }>; deleteRows(table: string, rowIds: string[]): Promise<{ success: boolean; }>; searchRows(table: string, query: Record): Promise<{ rows: any[]; page?: number; page_size?: number; total?: number; has_more?: boolean; }>; querySql(sql: string, parameters?: any[]): Promise<{ metadata: any; results: any[]; }>; listCollaborators(): Promise<{ email: string; name: string; }[]>; createLinks(args: { table: string; linkColumn: string; pairs: Array<{ fromRowId: string; toRowId: string; }>; }): Promise; deleteLinks(args: { table: string; linkColumn: string; pairs: Array<{ fromRowId: string; toRowId: string; }>; }): Promise; addColumnOptions(args: { table: string; column: string; options: Array<{ name: string; color?: string; textColor?: string; }>; }): Promise; getRowActivities(rowId: string, page?: number): Promise<{ activities: any[]; total_count: number; }>; createSnapshot(): Promise<{ status: string; snapshot: { dtable_uuid: string; dtable_name: string; commit_id: string; ctime: number; }; }>; uploadFile(args: { table: string; column: string; rowId: string; fileName: string; fileData: string; replace?: boolean; }): Promise<{ file_name: string; file_size: number; asset_url: string; column_type: string; }>; downloadFile(args: { table: string; column: string; rowId: string; fileName?: string; }): Promise<{ file_name: string; file_size: number; content: string; content_type: "text" | "pdf_text" | "binary_url"; download_link?: string; }>; } //# sourceMappingURL=contextualClient.d.ts.map