/** * LSP Auto-Diagnostics Hook * * Tracks files modified by Write/Edit tools and automatically runs * TypeScript/Python diagnostics on them, injecting results into the system prompt. * * Pattern inspired by oh-my-openagent's omo-lsp PostToolUse hook, * adapted for agent-hive's plugin architecture. * * The diagnostics run on `experimental.chat.system.transform` (before the next * LLM call), not synchronously after every edit — this keeps the experience * snappy while still catching type errors proactively. */ export interface LspDiagnosticsState { /** Set of file paths modified by Write/Edit since last check */ modifiedFiles: Set; } export declare function createLspDiagnosticsState(): LspDiagnosticsState; /** * Call from a `tool.execute.after` hook to track files changed by write/edit * tools. */ export declare function trackFileModification(state: LspDiagnosticsState, tool: string, args: Record | undefined): void; /** * Run `tsc --noEmit` and extract diagnostics relevant to the tracked files. * * Returns a formatted diagnostics block, or `null` if everything is clean. */ export declare function runTypeScriptDiagnostics(state: LspDiagnosticsState, projectDir: string): string | null; /** * Run pyright diagnostics on tracked Python files. * * Returns a formatted diagnostics block, or `null` if everything is clean * or pyright is not available. */ export declare function runPythonDiagnostics(state: LspDiagnosticsState, projectDir: string): string | null; /** Reset state — call from `experimental.session.compacting`. */ export declare function resetDiagnostics(state: LspDiagnosticsState): void;