import type { InlineToolRunnable } from '../tools/types'; /** * Options for inline assistant generation */ export interface InlineAssistantOptions { /** The prompt to send to the assistant */ prompt: string; /** Origin of the request for analytics tracking (e.g., 'grafana/panel-editor/title', 'grafana-slo-app/slo-form/description') */ origin: string; /** * Optional logical inline agent name for instrumentation. * This is namespaced by the origin namespace, so integrations can safely reuse * names like 'title-generator' without colliding in Sigil. */ agentName?: string; /** * Optional agent version or implementation identifier for instrumentation. * Useful when the same logical agent has multiple implementations over time. */ agentId?: string; /** Optional system prompt to guide the assistant's behavior */ systemPrompt?: string; /** Optional array of tools to make available to the assistant for this generation */ tools?: InlineToolRunnable[]; /** Callback invoked when generation completes successfully */ onComplete?: (text: string) => void; /** Callback invoked if an error occurs during generation */ onError?: (error: Error) => void; /** Callback invoked when streaming tokens are received */ onDelta?: (delta: string) => void; } /** * State for the inline assistant hook */ export interface InlineAssistantState { /** Whether generation is currently in progress */ isGenerating: boolean; /** Accumulated content from streaming */ content: string; /** Error that occurred during generation, if any */ error: Error | null; } /** * Return type of the useInlineAssistant hook */ export interface InlineAssistantResult { /** Start generating content with the given options */ generate: (options: InlineAssistantOptions) => Promise; /** Whether generation is currently in progress */ isGenerating: boolean; /** Accumulated streaming content (updates in real-time) */ content: string; /** Error that occurred during generation, if any */ error: Error | null; /** Cancel the current generation */ cancel: () => void; /** Clear error and content state */ reset: () => void; } /** * Streaming event types from the backend */ export interface MessageStreamStartEvent { type: 'message.stream.start'; payload: { messageId: string; chatId: string; role: string; }; } export interface MessageContentDeltaEvent { type: 'message.content.delta'; payload: { messageId: string; chatId: string; contentIndex: number; contentType: string; delta?: string; toolUse?: unknown; }; } export interface MessageStreamCompleteEvent { type: 'message.stream.complete'; payload: { messageId: string; chatId: string; stopReason: string; usage: { inputTokens: number; outputTokens: number; }; }; } export type StreamEvent = MessageStreamStartEvent | MessageContentDeltaEvent | MessageStreamCompleteEvent; //# sourceMappingURL=types.d.ts.map