import type { ThinkingLevel } from '@earendil-works/pi-agent-core'; import type { InMemoryTranscriptRuntime } from '../../agent/embedded/transcript-runtime.js'; import { type ExternalStoredAgent } from '../../agent/external/index.js'; import type { UserTurnAttachment } from '../user-turn-input.js'; import type { SideChatExternalBindingState } from './manager.js'; export interface RunSideChatExternalTurnInput { executionConversationId: string; parentConversationId: string; runId: string; externalAgent: ExternalStoredAgent; workspacePath: string; content: string; attachments?: UserTurnAttachment[]; modelRef?: string; thinkingLevel?: ThinkingLevel; serviceTier?: string; transcriptRuntime: InMemoryTranscriptRuntime; existingBindingState?: SideChatExternalBindingState; onBindingUpdated: (state: SideChatExternalBindingState | undefined) => void; abortSignal: AbortSignal; onEvent: (event: { type: string; [key: string]: unknown; }) => void; } export interface RunSideChatExternalTurnResult { ok: boolean; errorMessage?: string; } /** * Build a concise handoff prompt from the side chat's baseline parent snapshot * (including any user selections) plus prior side-chat messages so an external * runtime starting a fresh native session has the full side-chat context. */ export declare function buildSideChatExternalContextPrompt(runtime: InMemoryTranscriptRuntime): string | undefined; export declare function runSideChatExternalTurn(input: RunSideChatExternalTurnInput): Promise;