/**
 * Context-watch Observation Scope for Story 95-6
 *
 * Delivers periodic conversation summaries from primary agent to backseat
 * observer at configurable turn intervals. Summary generation is non-blocking.
 * Token overhead stays under 25% per phase when combined with other scopes.
 *
 * Hook side: incrementTurnCounter() tracks tool calls (synchronous, fast).
 * Backseat side: startContextWatcher() polls counter and writes context observations.
 */
export interface ContextWatchConfig {
    sessionDir: string;
    storyId: string;
    agent: string;
    persona: string;
    phase: string;
    pollIntervalMs?: number;
    turnInterval?: number;
    observationFilePath?: string;
    sessionFilePath?: string;
}
export interface ContextWatchHandle {
    running: boolean;
    pollIntervalMs: number;
}
export interface ContextWatchResult<T = unknown> {
    success: boolean;
    data?: T;
    error?: string;
}
export interface ContextSnapshotParams {
    sessionDir: string;
    storyId: string;
    sessionFilePath: string;
    turnCount: number;
}
export interface ContextSnapshotData {
    content: string;
    estimatedTokens: number;
}
/**
 * Increment the turn counter for context-watch polling.
 * Called from the PostToolUse hook — must be synchronous and fast.
 */
export declare function incrementTurnCounter(sessionDir: string): ContextWatchResult<number>;
/**
 * Read the current turn counter value.
 */
export declare function readTurnCounter(sessionDir: string): ContextWatchResult<number>;
/**
 * Reset the turn counter to 0.
 */
export declare function resetTurnCounter(sessionDir: string): ContextWatchResult;
/**
 * Pure function: determine whether the current turn count should trigger
 * a context summary based on the configured interval.
 */
export declare function shouldTriggerSummary(turnCount: number, interval: number): boolean;
/**
 * Write a context snapshot from the current session file state.
 * Reads the session file, extracts tail content, writes bounded snapshot.
 * Returns snapshot data with estimated token count.
 */
export declare function writeContextSnapshot(params: ContextSnapshotParams): ContextWatchResult<ContextSnapshotData>;
/**
 * Read the most recent context snapshot for a story.
 * Returns empty content if no prior snapshot exists.
 */
export declare function readContextSnapshot(sessionDir: string, storyId: string): ContextWatchResult<{
    content: string;
}>;
/**
 * Start a polling context watcher that monitors the turn counter and
 * writes context observations at configured intervals.
 */
export declare function startContextWatcher(config: ContextWatchConfig): Promise<ContextWatchResult<ContextWatchHandle>>;
/**
 * Stop a running context watcher. Idempotent — safe to call multiple times.
 */
export declare function stopContextWatcher(handle: ContextWatchHandle): Promise<ContextWatchResult>;
//# sourceMappingURL=context-watch.d.ts.map