import type { ToolDef } from "@fabric-harness/sdk"; import type { DatabricksRawProtocolClient } from "./raw-protocol-client.js"; export interface DatabricksGenieAgentModeClientOptions { /** Explicit acknowledgement that Databricks currently labels this API Beta. */ acknowledgeBeta: true; /** A 32-character lowercase hexadecimal Genie Agent id. */ agentId: string; /** Maximum UTF-8 bytes accepted for one SSE event. Default 2 MiB. */ maxEventBytes?: number; /** Maximum events accepted in one response stream. Default 10,000. */ maxEvents?: number; /** Overall response deadline in milliseconds. Defaults to Databricks' 90-minute ceiling. */ timeoutMs?: number; /** Maximum silence between SSE chunks. Defaults to 2 minutes. */ idleTimeoutMs?: number; /** Server-side progress/lineage sink. Events are never inserted into model context. */ onEvent?: (event: DatabricksGenieAgentModeEvent) => void | Promise; } export interface DatabricksGenieAgentModeToolOptions { /** Maximum serialized terminal response exposed to the model. Default 1 MiB. */ maxOutputBytes?: number; } export interface DatabricksGenieAgentModeResponse { object?: string; id: string; model?: string; status: "in_progress" | "completed" | "failed" | string; conversationId: string; createdAt?: number; output: Array>; error?: DatabricksGenieAgentModeErrorInfo; } export interface DatabricksGenieAgentModeErrorInfo { type?: string; code?: string; message?: string; } interface DatabricksGenieAgentModeEventBase { sequenceNumber: number; /** Original event payload for forward-compatible access to Beta fields. */ raw: Record; } export interface DatabricksGenieAgentModeCreatedEvent extends DatabricksGenieAgentModeEventBase { type: "response.created"; response: DatabricksGenieAgentModeResponse; } export interface DatabricksGenieAgentModeOutputEvent extends DatabricksGenieAgentModeEventBase { type: "response.output_item.added" | "response.output_item.updated" | "response.output_item.done"; outputIndex?: number; item: Record; } export interface DatabricksGenieAgentModeCompletedEvent extends DatabricksGenieAgentModeEventBase { type: "response.completed"; response: DatabricksGenieAgentModeResponse; } export interface DatabricksGenieAgentModeFailedEvent extends DatabricksGenieAgentModeEventBase { type: "response.failed"; response: DatabricksGenieAgentModeResponse; } export interface DatabricksGenieAgentModeUnknownEvent extends DatabricksGenieAgentModeEventBase { type: "unknown"; eventType: string; } export type DatabricksGenieAgentModeEvent = DatabricksGenieAgentModeCreatedEvent | DatabricksGenieAgentModeOutputEvent | DatabricksGenieAgentModeCompletedEvent | DatabricksGenieAgentModeFailedEvent | DatabricksGenieAgentModeUnknownEvent; export interface DatabricksGenieAgentModeItemPage { object?: string; data: Array>; status?: string; firstId?: string; lastId?: string; hasMore?: boolean; } export declare class DatabricksGenieAgentModeProtocolError extends Error { constructor(message: string); } export declare class DatabricksGenieAgentModeResponseError extends Error { readonly response: DatabricksGenieAgentModeResponse; constructor(response: DatabricksGenieAgentModeResponse); } export declare class DatabricksGenieAgentModeTimeoutError extends Error { readonly phase: "overall" | "idle"; constructor(phase: "overall" | "idle", timeoutMs: number); } export declare class DatabricksGenieAgentModeClient { private readonly client; private readonly agentId; private readonly maxEventBytes; private readonly maxEvents; private readonly timeoutMs; private readonly idleTimeoutMs; private readonly onEvent?; constructor(client: DatabricksRawProtocolClient, options: DatabricksGenieAgentModeClientOptions); /** * Start or continue one Beta Agent Mode response. A failed terminal event is yielded and then * raises `DatabricksGenieAgentModeResponseError` on the next iterator step. */ respond(question: string, options?: { conversationId?: string; signal?: AbortSignal; }): AsyncGenerator; /** Consume a stream and return only its bounded terminal response. */ complete(question: string, options?: { conversationId?: string; signal?: AbortSignal; }): Promise; listConversationItems(conversationId: string, options?: { after?: string; limit?: number; signal?: AbortSignal; }): Promise; } export declare function databricksGenieAgentMode(client: DatabricksRawProtocolClient, options: DatabricksGenieAgentModeClientOptions): DatabricksGenieAgentModeClient; export declare function databricksGenieAgentModeTool(client: DatabricksGenieAgentModeClient, agentId: string, options?: DatabricksGenieAgentModeToolOptions): ToolDef; export {}; //# sourceMappingURL=genie-agent-mode.d.ts.map