import type { CliPaths, SessionPaths } from '../io/paths';
import type { Renderer } from '../repl/renderer';
import type { CliAnalyzeService } from './cliAnalyzeService';
import type { CodeAwareMode } from '../../services/codebase/codeAwareFeature';
import type { CliAnalysisMode, TraceCaptureResult } from '../types';
export interface TurnRunnerContext {
    paths: CliPaths;
    service: CliAnalyzeService;
    renderer: Renderer;
}
export interface TurnResult {
    sessionId: string;
    sessionDir: string;
    turn: number;
    success: boolean;
    /** True when the resume path had to fall back to Level 3 (fresh load +
     *  preamble). Callers can surface a note to the user. */
    degraded: boolean;
}
/**
 * Fresh analyze — loads the trace, creates a new session, runs turn 1.
 * Equivalent to what `smartperfetto analyze <trace>` does, minus the
 * bootstrap / service-lifecycle work around it.
 */
export declare function startSession(ctx: TurnRunnerContext, input: {
    tracePath: string;
    query: string;
    referenceTracePath?: string;
    analysisMode?: CliAnalysisMode;
    codeAwareMode?: CodeAwareMode;
    codebaseIds?: string[];
    capture?: TraceCaptureResult;
}): Promise<TurnResult>;
/**
 * Continue an existing session — reloads the trace (with the original id
 * when possible), runs turn N+1, and commits outputs to the same folder.
 *
 * Three-level degradation (plan §G.3): Level 1/2 keep sessionId+sdkSessionId
 * intact; Level 3 falls back to a fresh load with the prior conclusion
 * injected as preamble but keeps the CLI-visible session id stable.
 */
export declare function continueSession(ctx: TurnRunnerContext, input: {
    sessionId: string;
    query: string;
}): Promise<TurnResult>;
export declare function buildResumeContextQuery(sp: SessionPaths, userQuery: string): string;
/**
 * Truncate at a sentence/paragraph boundary at or before `maxChars` so the
 * preamble doesn't end mid-sentence. Falls back to a hard char cut if no
 * suitable boundary exists in the trailing 30% of the window.
 *
 * Boundaries searched (CJK + Latin): paragraph break > full stop > newline.
 */
export declare function truncateAtBoundary(text: string, maxChars: number): string;
//# sourceMappingURL=turnRunner.d.ts.map