/**
 * @module        outputParser
 * @description   Worker 输出解析工具，提供日志尾读、会话 ID 解析与进程检查
 *
 * @author        eddy
 * @organization  wykj
 * @ownership     wykj/eddy
 *
 * @created       2026-03-25
 * @updated       2026-04-03
 *
 * @role          provider
 * @layer         provider
 * @boundedContext worker-runtime
 */
/**
 * Read the last N lines from a file efficiently.
 * Returns empty string if file doesn't exist.
 */
export declare function tailFile(filePath: string, lines: number): string;
/**
 * Get file size in bytes (for checking if output is being written).
 */
export declare function fileSize(filePath: string): number;
/**
 * Parse session ID from a Claude stream-json output file.
 *
 * Claude --output-format stream-json emits lines like:
 *   {"type":"result",...,"session_id":"uuid",...}
 *
 * We also check the very first system message.
 */
export declare function parseClaudeSessionId(filePath: string): string | null;
/**
 * Check if a process is alive by sending signal 0.
 */
export declare function isProcessAlive(pid: number | null | undefined): boolean;
/**
 * Kill a process group. First SIGTERM, then SIGKILL after timeout.
 * Uses negative PID to signal the entire process group.
 */
export declare function killProcessGroup(pid: number, timeoutMs?: number): Promise<void>;
/**
 * Check if a branch has commits ahead of a base branch.
 * This is the most reliable signal that the worker actually did work.
 *
 * Returns the number of commits ahead, or -1 on error.
 */
export declare function branchCommitsAhead(worktree: string, branch: string, baseBranch: string): number;
/**
 * Check if branch has been pushed to remote (remote tracking ref exists).
 */
export declare function branchPushed(worktree: string, branch: string): boolean;
/**
 * Extract the last assistant message text from Claude stream-json output.
 * Useful for verifying task completion.
 */
export declare function extractLastAssistantText(filePath: string): string;
//# sourceMappingURL=outputParser.d.ts.map