/**
 * SessionInspector — read-only / introspection-oriented operations on a session.
 *
 * Owns the five methods previously scattered across `AgentService` that all
 * compute a "summary view" of one session:
 *   - `compact` (manual user-triggered compaction)
 *   - `btwQuery` (one-shot LLM answer with transcript as background)
 *   - `report` (Markdown / JSON `/context` summary)
 *   - `agentConfig` (resolved thinking + model + workspace for the Web UI)
 *   - `contextUsage` (rough token budget vs estimated transcript)
 *
 * The shared helper `computeStats` keeps the three callsites that need
 * `getWindowStats` / `getCompactionStats` / `estimateTokenUsage` in lockstep.
 */
import type { AgentMessage } from '@earendil-works/pi-agent-core';
import type { ThinkingLevel } from '@earendil-works/pi-agent-core';
import type { Config } from '../../config/schema.js';
import { type SessionConfigStore } from '../../session/index.js';
import type { SessionStore } from '../../session/store.js';
import type { CompactionResult } from '../memory/compaction.js';
import type { ModelManager } from '../models/index.js';
import type { AgentInstanceGateway } from '../agent-instance-gateway.js';
import type { ReasoningLevel } from '../transcript/thinking-types.js';
import type { SessionHydrator } from './session-hydrator.js';
export interface SessionInspectorOptions {
    sessionStore: SessionStore;
    sessionConfigStore: SessionConfigStore;
    modelManager: ModelManager;
    agentManager: AgentInstanceGateway;
    sessionHydrator: SessionHydrator;
    /** Effective config snapshot accessor (honours runtime overrides). */
    getConfig: () => Config | undefined;
    /**
     * Nominal context window the session is budgeted against. Currently derived
     * from `agents.defaults.maxTokens * 4`, defaulting to 128k.
     */
    getContextWindow: () => number;
}
export interface SessionContextUsage {
    estimatedTokens: number;
    contextWindow: number;
    usagePercent: number | null;
}
export interface SessionAgentConfigView {
    thinkingLevel: ThinkingLevel;
    model: string;
    reasoningLevel: ReasoningLevel;
    effectiveWorkspacePath: string;
    workingDirectoryLocked: boolean;
}
export declare class SessionInspector {
    private readonly opts;
    constructor(opts: SessionInspectorOptions);
    /**
     * Manual compaction triggered by a user / API. Always forces a compaction
     * pass (`force: true` by default) and evicts the in-memory agent so the
     * next turn reloads from the compacted transcript.
     */
    compact(sessionKey: string, options?: {
        instructions?: string;
        force?: boolean;
    }): Promise<CompactionResult>;
    /** One-shot LLM answer for `/btw`: transcript as background, not persisted. */
    btwQuery(sessionKey: string, question: string): Promise<{
        text: string;
        error?: string;
    }>;
    /** Cheap stats used by both the report and other callers. */
    stats(sessionKey: string, messages: AgentMessage[]): {
        windowStats: ReturnType<SessionStore['getWindowStats']>;
        compactionStats: ReturnType<SessionStore['getCompactionStats']>;
        tokenEstimate: ReturnType<SessionStore['estimateTokenUsage']>;
    };
    /** Rough context usage for TUI footer (estimated tokens vs nominal budget). */
    contextUsage(sessionKey: string): Promise<SessionContextUsage>;
    /** Markdown or JSON summary for `/context`. */
    report(sessionKey: string, mode: 'list' | 'detail' | 'json'): Promise<string>;
    /** Resolved thinking / model / workspace for the Web UI. */
    agentConfig(sessionKey: string): Promise<SessionAgentConfigView>;
}
