/** * AgentRuntime — facade for AgentLink's local agent process drivers. * * Claude is still exposed through the legacy claude.ts surface plus a * ClaudeBackend contract adapter. Copilot and Codex are exec-style drivers * that emit normalized backend_event messages and are routed by connection.ts. * * Both the legacy `ChatFile` type (from claude.ts) and the backend-neutral * `BackendFileAttachment` type are exported side-by-side. The AgentBackend * instance is constructed lazily on first import so that: * * 1) tests can `vi.mock('./claude.js', ...)` without forcing a backend * construction order, and * 2) connection.ts can import one facade while backend-specific drivers * remain split into small modules. * * Future evolution: move all drivers behind AgentBackend and replace the * direct re-export shim with NormalizedEvent subscription + outbound * translation. */ import { type AgentBackend, type BackendFileAttachment } from './backends/index.js'; import type { BackendType } from './backends/types.js'; export declare function getBackendType(): BackendType; export declare function setBackendType(type: BackendType): void; export declare function isCopilotBackend(): boolean; export declare function isCodexBackend(): boolean; export declare function isPiBackend(): boolean; export declare function isYeaftBackend(): boolean; export { addCopilotSendFn, handleCopilotChat, cancelCopilotExecution, listCopilotSessions, listCopilotSessionsPage, readCopilotSessionMessages, getCopilotSessionWorkDir, deleteCopilotSession, renameCopilotSession, moveCopilotSession, listAllCopilotSessions, listAllCopilotSessionsPage, getCopilotConversation, getCopilotConversations, createCopilotPlaceholder, restartCopilotConversation, rebindCopilotConversation, cleanupAllCopilotConversations, copilotCapabilities, type CopilotConversationState, } from './copilot.js'; export { addCodexSendFn, handleCodexChat, cancelCodexExecution, listCodexSessions, listCodexSessionsPage, readCodexSessionMessages, deleteCodexSession, renameCodexSession, moveCodexSession, listAllCodexSessions, listAllCodexSessionsPage, getCodexConversation, getCodexConversations, createCodexPlaceholder, restartCodexConversation, rebindCodexConversation, cleanupAllCodexConversations, evictByCodexSessionId, codexCapabilities, type CodexConversationState, } from './codex.js'; export { addPiSendFn, handlePiChat, cancelPiExecution, listPiSessions, listPiSessionsPage, readPiSessionMessages, getPiSessionWorkDir, deletePiSession, renamePiSession, movePiSession, listAllPiSessions, listAllPiSessionsPage, getPiConversation, getPiConversations, createPiPlaceholder, restartPiConversation, rebindPiConversation, cleanupAllPiConversations, evictByPiSessionId, getPiAvailableModels, piCapabilities, type PiConversationState, type PiOptions, } from './pi.js'; export { addYeaftSendFn, handleYeaftChat, handleYeaftUserAnswer, cancelYeaftExecution, listYeaftSessions, listYeaftSessionsPage, readYeaftSessionMessages, deleteYeaftSession, renameYeaftSession, moveYeaftSession, listAllYeaftSessions, listAllYeaftSessionsPage, getYeaftConversation, getYeaftConversations, createYeaftPlaceholder, restartYeaftConversation, rebindYeaftConversation, cleanupAllYeaftConversations, evictByYeaftSessionId, yeaftCapabilities, type YeaftConversationState, } from './yeaft.js'; /** * Get (or lazily construct) the AgentBackend abstraction instance. * Production routing for Copilot/Codex still uses the direct process drivers. */ export declare function getBackend(): AgentBackend; /** Test-only: reset the backend singleton between specs. * Awaits shutdown() on the existing instance before nulling it out so the * ClaudeBackend's addSendFn / addOnSessionStarted subscriptions are detached * — otherwise stale instances keep receiving events and tests double-fire. */ export declare function _resetBackendForTests(): Promise; export { handleChat, setSendFn, addSendFn, abort, abortAll, cancelExecution, handleUserAnswer, handleToolPermissionResponse, handleBtwQuestion, getConversation, getConversations, getIsCompacting, clearSessionId, evictByClaudeSessionId, rebindConversation, addOutputObserver, removeOutputObserver, addCloseObserver, removeCloseObserver, setOutputObserver, clearOutputObserver, setCloseObserver, clearCloseObserver, restartConversation, createPlaceholderConversation, getPendingQuestions, getPendingToolPermissions, setModel, getEffectiveModel, setOnSessionStarted, addOnSessionStarted, } from './claude.js'; export type { ChatFile } from './claude.js'; export type { BackendFileAttachment };