import type { Config } from '../../config/schema.js'; import type { UserTurnAttachment } from '../../gateway/user-turn-input.js'; import type { SessionConfigStore } from '../../session/index.js'; import type { SessionStore } from '../../session/store.js'; export interface RunExternalDirectTurnInput { conversationId: string; content: string; attachments?: UserTurnAttachment[]; thinking?: string; runId?: string; signal?: AbortSignal; deadlineAtMs?: number; cfg?: Config; sessionStore?: SessionStore; sessionConfigStore?: SessionConfigStore; /** Called with cumulative visible assistant text during streaming (e.g. Telegram draft stream). */ onTextUpdate?: (fullText: string) => void; } export type ExternalDirectTurnResult = { status: 'succeeded'; text: string; } | { status: 'failed' | 'interrupted'; text: string; error: Error; }; /** * Execute a non-webchat turn (Channels like Telegram/Weixin, Automations, CLI direct runs) * on an external coding runtime (`codex`, `agy`, `claude`) using the unified `runExternalProjectTurn` pipeline. * Returns `null` if the conversation is not bound to an external agent. */ export declare function runExternalDirectTurn(input: RunExternalDirectTurnInput): Promise;