/** * Shared session utilities for council and background managers. */ import type { PluginInput } from '@opencode-ai/plugin'; type OpencodeClient = PluginInput['client']; export declare const SESSION_ABORT_TIMEOUT_MS = 1000; export declare class OperationTimeoutError extends Error { constructor(message: string); } export declare function withTimeout(operation: Promise, timeoutMs: number, message: string): Promise; export declare function abortSessionWithTimeout(client: OpencodeClient, sessionId: string, timeoutMs?: number): Promise; /** * Extract the short model label from a "provider/model" string. * E.g. "openai/gpt-5.4-mini" → "gpt-5.4-mini" */ export declare function shortModelLabel(model: string): string; export type PromptBody = { messageID?: string; model?: { providerID: string; modelID: string; }; agent?: string; noReply?: boolean; system?: string; tools?: { [key: string]: boolean; }; parts: Array<{ type: 'text'; text: string; }>; variant?: string; }; /** * Parse a model reference string into provider and model IDs. * @param model - Model string in format "provider/model" * @returns Object with providerID and modelID, or null if invalid */ export declare function parseModelReference(model: string): { providerID: string; modelID: string; } | null; /** * Send a prompt to a session with optional timeout. * If timeout is exceeded, the session is aborted and an error is thrown. * @param client - OpenCode client instance * @param args - Arguments for session.prompt() * @param timeoutMs - Timeout in milliseconds (0 = no timeout) * @throws Error if timeout is exceeded */ export declare function promptWithTimeout(client: OpencodeClient, args: Parameters[0], timeoutMs: number, signal?: AbortSignal): Promise; /** * Result of extracting session content. * `empty` is true when the assistant produced zero text content — * the provider returned an empty response (e.g. rate-limited silently). */ export interface SessionExtractionResult { text: string; empty: boolean; } /** * Extract the result text from a session. * Collects all assistant messages and concatenates their text parts. * @param client - OpenCode client instance * @param sessionId - Session ID to extract from * @param options - Optional: `includeReasoning` (default true) controls whether * reasoning/chain-of-thought parts are included. * @returns Object with extracted text and an `empty` flag for zero-content detection */ export declare function extractSessionResult(client: OpencodeClient, sessionId: string, options?: { directory?: string; includeReasoning?: boolean; }): Promise; export {};