/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * CoreToolScheduler singleton factory * Separated from Config to avoid circular dependencies during module loading */ import type { Config } from './config.js'; import type { CompletedToolCall, CoreToolScheduler, ToolCall } from '../core/coreToolScheduler.js'; import type { EditorType } from '../utils/editor.js'; import type { AnsiOutput } from '../utils/terminalSerializer.js'; export interface SchedulerCallbacks { outputUpdateHandler?: (toolCallId: string, outputChunk: string | AnsiOutput) => void; onAllToolCallsComplete?: (completedToolCalls: CompletedToolCall[]) => Promise; onToolCallsUpdate?: (toolCalls: ToolCall[]) => void; getPreferredEditor: () => EditorType | undefined; onEditorClose: () => void; onEditorOpen?: () => void; } /** * Options for scheduler creation via the singleton factory. */ export interface SchedulerOptions { /** * Whether the scheduler operates in interactive mode. * When false, the scheduler is configured for non-interactive/subagent contexts * (e.g., no live progress display, no editor support). * Defaults to true for backward compatibility. */ interactiveMode?: boolean; } export declare function getOrCreateScheduler(config: Config, sessionId: string, callbacks: SchedulerCallbacks, options?: SchedulerOptions): Promise; export declare function disposeScheduler(sessionId: string): void; export declare function getSchedulerInstance(sessionId: string): CoreToolScheduler | undefined; export declare function clearAllSchedulers(): void;