/**
 * Tool-watch Observation Scope for Story 95-5
 *
 * Delivers tool call information (name, params, results) from primary agent
 * to backseat observer within one tool-use cycle. Truncates large results
 * to configurable max size. Non-blocking to primary.
 *
 * Hook side: processToolCall() appends JSONL to transport file (synchronous, fast).
 * Backseat side: startToolWatcher() polls JSONL and writes observations.
 */
export interface ToolCallEntry {
    timestamp: string;
    toolName: string;
    params: Record<string, unknown>;
    resultPreview: string;
    resultSize: number;
}
export interface ToolWatchConfig {
    sessionDir: string;
    storyId: string;
    agent: string;
    persona: string;
    phase: string;
    pollIntervalMs?: number;
    maxResultSize?: number;
    observationFilePath?: string;
}
export interface ToolWatchHandle {
    running: boolean;
    pollIntervalMs: number;
}
export interface ToolWatchResult<T = unknown> {
    success: boolean;
    data?: T;
    error?: string;
}
export interface ProcessToolCallParams {
    sessionDir: string;
    storyId: string;
    toolName: string;
    params: Record<string, unknown>;
    toolResult: string;
    maxResultSize?: number;
}
/**
 * Truncate a tool result string to maxSize characters.
 * Appends `[truncated from N chars]` indicator when truncated.
 */
export declare function truncateResult(result: string, maxSize: number): string;
/**
 * Record a tool call to the JSONL transport file.
 * Called from the PostToolUse hook — must be synchronous and fast.
 */
export declare function processToolCall(params: ProcessToolCallParams): ToolWatchResult;
/**
 * Read tool call entries from a JSONL transport file.
 * Skips malformed lines gracefully.
 */
export declare function readToolCalls(filePath: string): ToolWatchResult<ToolCallEntry[]>;
/**
 * Start a polling tool watcher that reads JSONL entries and writes observations.
 */
export declare function startToolWatcher(config: ToolWatchConfig): Promise<ToolWatchResult<ToolWatchHandle>>;
/**
 * Stop a running tool watcher. Idempotent — safe to call multiple times.
 */
export declare function stopToolWatcher(handle: ToolWatchHandle): Promise<ToolWatchResult>;
//# sourceMappingURL=tool-watch.d.ts.map