/**
 * Command Context Implementation
 *
 * Provides the concrete implementation of CommandContext interface,
 * bridging commands to core services (AgentService, SessionStore, etc.)
 */
import type { CommandContext, ReplyOptions, UIComponent, SessionInfo, ModelInfo, UsageStats, PlatformFeature, MessageSource, CompactSessionResult } from './types.js';
import type { Config } from '../config/schema.js';
import type { AgentMessage } from '@earendil-works/pi-agent-core';
import type { MessageBus } from '../infra/bus/index.js';
import type { SessionStore, SessionConfigStore } from '../session/index.js';
import type { ThinkLevel, ReasoningLevel, VerboseLevel } from '../agent/transcript/thinking-types.js';
import type { CompactionResult } from '../agent/memory/compaction.js';
import type { PersistentGoalApis } from '../agent/goals/persistent-goal-apis.js';
export interface CommandContextDeps {
    sessionKey: string;
    source: MessageSource;
    channelId: string;
    chatId: string;
    senderId: string;
    isGroup: boolean;
    config: Config;
    bus: MessageBus;
    sessionStore: SessionStore;
    sessionConfigStore?: SessionConfigStore;
    /** After persisting session thinking, sync pi-agent in-memory state */
    applySessionThinkingLevel?: (sessionKey: string, level: ThinkLevel) => void;
    replyHandler: (text: string, options?: ReplyOptions) => Promise<void>;
    componentHandler?: (component: UIComponent) => Promise<void>;
    typingHandler?: (typing: boolean) => Promise<void>;
    supportedFeatures: PlatformFeature[];
    /** Called after session files are removed so in-memory agents match disk */
    invalidateAgentSession?: (sessionKey: string) => void;
    /** Reset session in place (archive + new session id); optional — falls back to clearSession */
    resetSession?: (sessionKey: string) => Promise<void>;
    getCurrentModel?: () => string;
    switchModel?: (modelId: string) => Promise<boolean>;
    listModels?: () => Promise<ModelInfo[]>;
    getUsage?: () => Promise<UsageStats>;
    /** Stop current LLM turn and clear channel preview stream (Telegram draft, etc.) */
    abortCurrentTurn?: () => Promise<void>;
    compactSession?: (sessionKey: string, options?: {
        instructions?: string;
        force?: boolean;
    }) => Promise<CompactionResult>;
    btwQuery?: (sessionKey: string, question: string) => Promise<{
        text: string;
        error?: string;
    }>;
    getSessionContextReport?: (sessionKey: string, mode: 'list' | 'detail' | 'json') => Promise<string>;
    persistentGoalApis?: PersistentGoalApis;
}
export declare class CommandContextImpl implements CommandContext {
    readonly sessionKey: string;
    readonly source: MessageSource;
    readonly channelId: string;
    readonly chatId: string;
    readonly senderId: string;
    readonly isGroup: boolean;
    readonly config: Config;
    readonly abortCurrentTurn?: () => Promise<void>;
    readonly persistentGoalApis?: PersistentGoalApis;
    private deps;
    constructor(deps: CommandContextDeps);
    reply(text: string, options?: ReplyOptions): Promise<void>;
    replyComponent(component: UIComponent): Promise<void>;
    setTyping(typing: boolean): Promise<void>;
    getSession(): Promise<AgentMessage[]>;
    resetSession(): Promise<void>;
    clearSession(): Promise<void>;
    archiveSession(): Promise<void>;
    listSessions(): Promise<SessionInfo[]>;
    switchSession(sessionKey: string): Promise<void>;
    getCurrentModel(): string;
    listModels(): Promise<ModelInfo[]>;
    switchModel(modelId: string): Promise<boolean>;
    getUsage(): Promise<UsageStats>;
    supports(feature: PlatformFeature): boolean;
    getConfig(): Config;
    updateConfig(path: string, value: unknown): Promise<boolean>;
    /**
     * Get the session config store (if available)
     */
    getSessionConfigStore(): SessionConfigStore | undefined;
    /**
     * Get current thinking level (session override or default)
     */
    getThinkingLevel(): Promise<ThinkLevel | undefined>;
    /**
     * Set thinking level for this session
     */
    setThinkingLevel(level: ThinkLevel): Promise<void>;
    syncAgentThinkingLevel(level: ThinkLevel): void;
    compactSession(options?: {
        instructions?: string;
        force?: boolean;
    }): Promise<CompactSessionResult | null>;
    btwQuery(question: string): Promise<{
        text: string;
        error?: string;
    }>;
    exportSessionToWorkspace(format: 'markdown' | 'html' | 'json'): Promise<{
        path: string;
    }>;
    agentContextReport(mode?: 'list' | 'detail' | 'json'): Promise<string>;
    /**
     * Get current reasoning level (session override or default)
     */
    getReasoningLevel(): Promise<ReasoningLevel | undefined>;
    /**
     * Set reasoning level for this session
     */
    setReasoningLevel(level: ReasoningLevel): Promise<void>;
    /**
     * Get current verbose level (session override or default)
     */
    getVerboseLevel(): Promise<VerboseLevel | undefined>;
    /**
     * Set verbose level for this session
     */
    setVerboseLevel(level: VerboseLevel): Promise<void>;
    private renderComponentAsText;
}
/**
 * Create a command context from dependencies
 */
export declare function createCommandContext(deps: CommandContextDeps): CommandContext;
