/**
 * Shared types for the MCP adapter split (Phase 3).
 *
 * Extracted from mcp.ts to break the 5000-LOC monolith into manageable files.
 * This module owns the SessionTelemetry tracker and the McpHandlerCtx dependency
 * injection interface that all handler files receive.
 */
import type { NexusPrime } from '../../../index.js';
import type { OrchestratorEngine } from '../../../engines/index.js';
import type { SubAgentRuntime } from '../../../phantom/index.js';
import type { WorkspaceContext } from '../../../engines/workspace-resolver.js';
import type { DarwinLoop } from '../../../engines/darwin-loop.js';
import type { SessionDNAManager } from '../../../engines/session-dna.js';
import type { NgramIndex } from '../../../engines/ngram-index.js';
export type McpToolProfile = 'autonomous' | 'full';
export type LifecyclePhase = 'pre-bootstrap' | 'bootstrapped' | 'orchestrated' | 'working' | 'closing';
export type ResponseDetailLevel = 'compact' | 'standard' | 'debug' | 'full';
export type ResponseIntent = 'inspect' | 'plan' | 'mutate';
export type ResponseTopology = 'auto' | 'manager-tools' | 'handoff' | 'dag-pool' | 'worktree-swarm';
/** Session-level telemetry tracker. Moved to types.ts so handler files can
 *  reference the class without a circular import back into mcp.ts. */
export declare class SessionTelemetry {
    private startTime;
    private callCount;
    private tokensOptimized;
    private memoriesStored;
    private memoriesRecalled;
    private lifecyclePhase;
    private optimizeTokensCalled;
    private mindkitCheckCalled;
    private storeMemoryCalledPostOrchestrate;
    private sessionDnaCalled;
    private fileReadIntentCount;
    private callsSinceOrchestrate;
    private fileIntentPaths;
    private tokenAutoApplied;
    private stickyTokenOptimization;
    private tokenOptimizationPending;
    private orchestrationPending;
    bootstrapped: boolean;
    bootstrapCallCount: number;
    recordCall(): void;
    recordTokens(saved: number): void;
    recordStore(): void;
    recordRecall(count: number): void;
    snapshot(): {
        callCount: number;
        tokensOptimized: number;
        memoriesStored: number;
        memoriesRecalled: number;
        lifecyclePhase: LifecyclePhase;
        optimizeTokensCalled: boolean;
        mindkitCheckCalled: boolean;
        storeMemoryCalledPostOrchestrate: boolean;
        sessionDnaCalled: boolean;
        fileReadIntentCount: number;
        callsSinceOrchestrate: number;
        tokenAutoApplied: boolean;
        tokenOptimizationPending: boolean;
        orchestrationPending: boolean;
    };
    elapsedMs(): number;
    advancePhase(nextPhase: LifecyclePhase): void;
    observeSuccessfulToolCall(toolName: string, args: Record<string, unknown>): void;
    observeQueuedToolCall(toolName: string, args: Record<string, unknown>): void;
    needsOptimizeTokens(currentToolName?: string): boolean;
    markTokenAutoApplied(): void;
    needsOrchestration(currentToolName?: string): boolean;
    needsStoreMemory(currentToolName?: string): boolean;
    needsSessionDna(currentToolName?: string): boolean;
    notifyStore(priority: number, tags: string[], memStats: {
        cortex: number;
        totalLinks: number;
    }): string;
    notifyRecall(count: number, query: string, memStats: {
        hippocampus: number;
        cortex: number;
    }): string;
    notifyTokens(task: string, savings: number, pct: number, fileCount: number): string;
    /** Contextual planning nudges based on what just happened */
    planningNudge(event: string, context: Record<string, any>): string;
    format(memStats?: {
        totalLinks: number;
        prefrontal: number;
        hippocampus: number;
        cortex: number;
    }): string;
    private noteFileIntent;
    private resetFileIntentTracking;
    private isPostOrchestratePhase;
}
/**
 * Dependency injection context passed to every handler extracted from
 * the mcp.ts switch statement. Contains the subset of MCPAdapter methods
 * that switch case bodies need, presented as a plain interface so handler
 * files do not import MCPAdapter directly (which would create a circular dep).
 */
export interface McpHandlerCtx {
    /** The live NexusPrime instance — mandatory, handlers throw if absent */
    nexusRef: NexusPrime;
    /** Get (or lazy-create) the orchestrator engine for the given workspace */
    getOrchestrator(args?: Record<string, unknown>): OrchestratorEngine;
    /** Get (or lazy-create) the sub-agent runtime for the given workspace */
    getRuntime(args?: Record<string, unknown>): SubAgentRuntime;
    /** Resolve workspace context from tool arguments (workspace hint, cwd, etc.) */
    getWorkspace(args?: Record<string, unknown>): WorkspaceContext;
    /** Get the shared n-gram index for the current workspace */
    getRepoNgramIndex(args?: Record<string, unknown>): NgramIndex;
    /** Get (or create) the Darwin self-improvement loop for the current workspace */
    getDarwinLoop(args?: Record<string, unknown>): DarwinLoop;
    /** Current MCP tool profile — 'autonomous' or 'full' */
    getToolProfile(): McpToolProfile;
    /** Get decorated tool definitions for lazy tool discovery */
    getDecoratedToolDefinitions(profile?: McpToolProfile): Array<{
        name: string;
        description: string;
        inputSchema: Record<string, unknown>;
    }>;
    /** True if `target` looks like a package (node_modules, built artifacts, etc.) */
    isPackageLikeWorkspace(target: string): boolean;
    /** Resolve a candidate path relative to the workspace root */
    resolveToolPath(candidatePath: string, args?: Record<string, unknown>): string;
    /** Session-level telemetry tracker (mutable — handlers call recordStore etc.) */
    telemetry: SessionTelemetry;
    /** Session DNA manager for lifecycle checkpointing */
    sessionDNA: SessionDNAManager;
    /** Draw a boxed ASCII header to stderr */
    box(title: string, lines: string[], color?: string): void;
    /** Emit a sci-fi matrix log entry to stderr */
    sciFiMatrixLog(title: string, metrics: Record<string, any>, intent?: string): void;
    /** Scan source files in a directory (async, mtime-cached) */
    scanSourceFiles(cwd: string): Promise<string[]>;
    /** Format the "protocol compliance checklist" block */
    formatProtocolChecklist(): string;
    /** Format the "remaining protocol steps" reminder block */
    formatRemainingProtocolSteps(): string;
    /** Get the current task description */
    getCurrentTask(): string;
    /** Set the current task description (e.g. after bootstrap or orchestrate) */
    setCurrentTask(task: string): void;
}
