/**
 * Narrow, shell-facing surfaces over `AgentSession`. These contracts decouple
 * shell components from the full session class so they can be reused with
 * non-local session backings (RPC, embedded) without depending on internals.
 */
import type { ImageContent, Model, TextContent } from '../ai/types.js';
import type { AgentSession } from '../app/agent-session.js';
import type { ExtensionSessionSetupStore } from '../app/extensions/types.js';
import { switchMode as runSwitchMode, type SwitchModeOptions } from '../app/modes/switch-mode.js';
import type { PromptTemplate } from '../app/resources/prompt-templates.js';
import type { RuntimeSkillSource } from '../contracts/agent-resources.js';
import type { SessionContext, SessionEntry, SessionHeader, SessionTreeNode } from '../core/session-schema.js';
export interface ShellAuthStorage {
    list(): string[];
    get(providerId: string): {
        type?: string;
        access?: string;
    } | undefined;
    has(providerId: string): boolean;
    getApiKey(providerId: string): Promise<string | undefined>;
    login(providerId: string, options: {
        onAuth: (info: {
            url: string;
            instructions?: string;
        }) => void;
        onPrompt: (prompt: {
            message: string;
            placeholder?: string;
        }) => Promise<string>;
        onProgress: (message: string) => void;
        signal: AbortSignal;
    }): Promise<void>;
    logout(providerId: string): void;
}
export interface ShellModelRegistry {
    authStorage: ShellAuthStorage;
    find(provider: string, modelId: string): Model<any> | undefined;
    getAll(): Model<any>[];
    getAvailable(): Model<any>[];
    getApiKey(model: Model<any>): Promise<string | undefined>;
    getError(): string | undefined;
    isUsingOAuth(model: Model<any>): boolean;
    refresh(): void;
}
export interface ShellSkill {
    name: string;
    description: string;
    filePath: string;
    baseDir: string;
    source: RuntimeSkillSource;
    disableModelInvocation: boolean;
}
export interface ShellResourceDiagnostic {
    type: 'warning' | 'error' | 'collision';
    message: string;
    path?: string;
    collision?: {
        resourceType: 'agent' | 'extension' | 'skill' | 'prompt' | 'theme';
        name: string;
        winnerPath: string;
        loserPath: string;
        winnerSource?: string;
        loserSource?: string;
    };
}
export interface ShellPathMetadata {
    source: string;
    scope: 'user' | 'project' | 'temporary';
    origin: 'package' | 'top-level';
    baseDir?: string;
}
export interface ShellResourceLoader {
    getExtensions(): {
        errors: Array<{
            error: string;
            path?: string;
        }>;
    };
    getPathMetadata(): Map<string, ShellPathMetadata>;
    getPrompts(): {
        prompts: PromptTemplate[];
        diagnostics: ShellResourceDiagnostic[];
    };
    getSkills(): {
        skills: ShellSkill[];
        diagnostics: ShellResourceDiagnostic[];
    };
}
export interface ShellSessionStore {
    appendLabelChange(targetId: string, label?: string): string;
    appendCustomEntry<T = unknown>(customType: string, data?: T): string;
    appendCustomMessageEntry<T = unknown>(customType: string, content: string | (TextContent | ImageContent)[], display: boolean, details?: T): string;
    appendMessage(message: any, durationMs?: number): string;
    appendModelChange(provider: string, modelId: string): string;
    appendSessionInfo(name: string): string;
    appendThinkingLevelChange(thinkingLevel: string): string;
    buildSessionContext(): SessionContext;
    getBranch(): SessionEntry[];
    getCwd(): string;
    getEntry(entryId: string): SessionEntry | undefined;
    getEntries(): SessionEntry[];
    getHeader(): SessionHeader | null;
    getLabel(entryId: string): string | undefined;
    getLeafId(): string | null;
    getLeafEntry(): SessionEntry | undefined;
    getSessionDir(): string;
    getSessionFile(): string | undefined;
    getSessionId(): string;
    getSessionName(): string | undefined;
    getTree(): SessionTreeNode[];
}
export interface ShellSettingsStore {
    getAutoApproveDefault(): boolean;
    setAutoApproveDefault(value: boolean): void;
    getClearOnShrink(): boolean;
    getCodeBlockIndent(): string;
    getCollapseChangelog(): boolean;
    setCollapseChangelog(value: boolean): void;
    getDangerouslySkipRuntimePermissions(): boolean;
    setDangerouslySkipRuntimePermissions(value: boolean): void;
    getDurableMemoryEnabled(): boolean;
    setDurableMemoryEnabled(value: boolean): void;
    getEnableSkillCommands(): boolean;
    getHideThinkingBlock(): boolean;
    setHideThinkingBlock(value: boolean): void;
    getLastChangelogVersion(): string | undefined;
    setLastChangelogVersion(version: string): void;
    getGlobalSettings(): {
        skills?: string[];
    };
    getProjectSettings(): {
        skills?: string[];
    };
    getQuietStartup(): boolean;
    setQuietStartup(value: boolean): void;
    getShowCacheTokens(): boolean;
    setShowCacheTokens(value: boolean): void;
    getShowHardwareCursor(): boolean;
    getShowImages(): boolean;
    setShowImages(value: boolean): void;
    getTelemetry(): boolean;
    setTelemetry(value: boolean): void;
    getTheme(): string | undefined;
    setTheme(theme: string): void;
    getToolSummariesEnabled(): boolean;
    setToolSummariesEnabled(value: boolean): void;
    getDisabledSkills(): string[];
    isSkillDisabled(skillName: string): boolean;
    setDefaultModelAndProvider(provider: string, modelId: string): void;
    setProjectSkillPaths(paths: string[]): void;
    setSkillPaths(paths: string[]): void;
    enableSkill(skillName: string): void;
    disableSkill(skillName: string): void;
}
export type SlashCommandSettingsStore = Pick<ShellSettingsStore, 'getHideThinkingBlock' | 'setHideThinkingBlock'>;
export type ShellSkillPathSettingsStore = Pick<ShellSettingsStore, 'getGlobalSettings' | 'getProjectSettings' | 'setProjectSkillPaths' | 'setSkillPaths'>;
export type SlashCommandSessionInfoStore = Pick<ShellSessionStore, 'appendSessionInfo' | 'getSessionName'>;
export type PrintModeSessionStore = ExtensionSessionSetupStore;
interface LocalSessionServices {
    modelRegistry: ShellModelRegistry;
    resourceLoader: ShellResourceLoader;
    sessionManager: ShellSessionStore;
    settingsManager: ShellSettingsStore;
}
export interface InteractiveSessionClient extends LocalSessionServices {
    readonly agent: AgentSession['agent'];
    readonly approvalState: AgentSession['approvalState'];
    collabClient: AgentSession['collabClient'];
    readonly extensionRunner: AgentSession['extensionRunner'];
    readonly lastPrePromptDetails: AgentSession['lastPrePromptDetails'];
    readonly messages: AgentSession['messages'];
    readonly model: AgentSession['model'];
    readonly promptTemplates: AgentSession['promptTemplates'];
    readonly retryAttempt: AgentSession['retryAttempt'];
    sheetPool: AgentSession['sheetPool'];
    readonly state: AgentSession['state'];
    readonly isFastModeAllowed: AgentSession['isFastModeAllowed'];
    readonly isFastModeAvailable: AgentSession['isFastModeAvailable'];
    readonly fastModeDisabledReason: AgentSession['fastModeDisabledReason'];
    readonly isFastModeEnabled: AgentSession['isFastModeEnabled'];
    readonly thinkingLevel: AgentSession['thinkingLevel'];
    readonly tools: AgentSession['tools'];
    abortCompaction: AgentSession['abortCompaction'];
    abortRetry: AgentSession['abortRetry'];
    bindExtensions: AgentSession['bindExtensions'];
    clearQueue: AgentSession['clearQueue'];
    compact: AgentSession['compact'];
    consumePendingRefresh: AgentSession['consumePendingRefresh'];
    cycleModel: AgentSession['cycleModel'];
    cycleThinkingLevel: AgentSession['cycleThinkingLevel'];
    followUp: AgentSession['followUp'];
    fork: AgentSession['fork'];
    getAvailableThinkingLevels: AgentSession['getAvailableThinkingLevels'];
    getContextUsage: AgentSession['getContextUsage'];
    getFollowUpMessages: AgentSession['getFollowUpMessages'];
    getSessionStats: AgentSession['getSessionStats'];
    getSteeringMessages: AgentSession['getSteeringMessages'];
    getToolNames: AgentSession['getToolNames'];
    getToolSummaryDiagnostics: AgentSession['getToolSummaryDiagnostics'];
    readonly isCompacting: AgentSession['isCompacting'];
    readonly isRetrying: AgentSession['isRetrying'];
    readonly isStreaming: AgentSession['isStreaming'];
    navigateTree: AgentSession['navigateTree'];
    newSession: AgentSession['newSession'];
    preparePendingRefresh: AgentSession['preparePendingRefresh'];
    prompt: AgentSession['prompt'];
    reload: AgentSession['reload'];
    replaceToolsByName: AgentSession['replaceToolsByName'];
    setModel: AgentSession['setModel'];
    setFastModeEnabled: AgentSession['setFastModeEnabled'];
    setThinkingLevel: AgentSession['setThinkingLevel'];
    startAutonomous: AgentSession['startAutonomous'];
    steer: AgentSession['steer'];
    subscribe: AgentSession['subscribe'];
    switchMode(modeName: string, options?: SwitchModeOptions): ReturnType<typeof runSwitchMode>;
    switchSession: AgentSession['switchSession'];
    toggleFastMode: AgentSession['toggleFastMode'];
}
export interface InteractiveSessionEventSource {
    subscribe: AgentSession['subscribe'];
}
export interface SlashCommandSessionClient extends Pick<LocalSessionServices, 'modelRegistry' | 'resourceLoader'> {
    readonly messages: AgentSession['messages'];
    getSessionStats: AgentSession['getSessionStats'];
    prompt: AgentSession['prompt'];
    startAutonomous: AgentSession['startAutonomous'];
}
export interface SessionWorkflowSessionClient {
    navigateTree: AgentSession['navigateTree'];
    switchSession: AgentSession['switchSession'];
}
export interface ReloadWorkflowSessionClient extends Pick<LocalSessionServices, 'modelRegistry'> {
    readonly extensionRunner: AgentSession['extensionRunner'];
    readonly isCompacting: AgentSession['isCompacting'];
    readonly isStreaming: AgentSession['isStreaming'];
    reload: AgentSession['reload'];
}
export interface AuthWorkflowSessionClient extends Pick<LocalSessionServices, 'modelRegistry'> {
    readonly model: AgentSession['model'];
    setModel: AgentSession['setModel'];
}
export interface FooterSessionClient extends Pick<LocalSessionServices, 'modelRegistry' | 'sessionManager' | 'settingsManager'> {
    readonly approvalState: AgentSession['approvalState'];
    getContextUsage: AgentSession['getContextUsage'];
    readonly isFastModeAvailable: AgentSession['isFastModeAvailable'];
    readonly isFastModeEnabled: AgentSession['isFastModeEnabled'];
    readonly state: AgentSession['state'];
}
export interface PrintModeSessionClient {
    readonly agent: AgentSession['agent'];
    readonly sessionManager: PrintModeSessionStore;
    readonly isRetrying: AgentSession['isRetrying'];
    bindExtensions: AgentSession['bindExtensions'];
    consumePendingRefresh: AgentSession['consumePendingRefresh'];
    fork: AgentSession['fork'];
    navigateTree: AgentSession['navigateTree'];
    newSession: AgentSession['newSession'];
    preparePendingRefresh: AgentSession['preparePendingRefresh'];
    prompt: AgentSession['prompt'];
    reload: AgentSession['reload'];
    subscribe: AgentSession['subscribe'];
    switchSession: AgentSession['switchSession'];
}
/** Wrap an `AgentSession` in the narrow surface the interactive shell consumes. */
export declare function createInteractiveSessionClient(session: AgentSession): InteractiveSessionClient;
/** Wrap an `AgentSession` in the narrow surface print mode requires. */
export declare function createPrintModeSessionClient(session: AgentSession): PrintModeSessionClient;
export {};
//# sourceMappingURL=session-client.d.ts.map