export interface PermissionHookMarker { host: string; scriptPath: string; settingsPath?: string; additionalPaths?: string[]; configured?: boolean; assetsPrepared?: boolean; installedAt: string; } export interface PermissionHookStatus { installed: boolean; configured?: boolean; assetsPrepared?: boolean; assetsCurrent?: boolean; autoRepaired?: boolean; needsRepair?: boolean; repairError?: string; host?: string; scriptPath?: string; settingsPath?: string; additionalPaths?: string[]; } /** Latest JSONL diagnostic event emitted by a local permission hook wrapper. */ export interface PermissionHookDiagnosticRecord { timestamp: string; invocationId: string; event: string; platform: string; stage: string; outcome?: string; reason?: string; hookPath?: string; diagnosticsLogPath?: string; sessionId?: string; toolName?: string; toolInput?: string; rawInput?: string; authorityHost?: string; authorityMode?: string; endpoint?: string; port?: string; payload?: string; response?: string; normalizedResponse?: string; emittedResponse?: string; attempt?: string; maxRetries?: string; timeoutSeconds?: string; curlExit?: string; rawInputLength?: number; normalizedResponseLength?: number; emittedResponseLength?: number; responseLength?: number; } export interface InstallPermissionHookResult { supported: boolean; installed: boolean; configured: boolean; assetsPrepared?: boolean; host: string; scriptPath?: string; settingsPath?: string; additionalPaths?: string[]; markerPath?: string; backupPath?: string; message: string; } export interface InstallPermissionHookOptions { homeDir?: string; sourceScriptPath?: string; now?: Date; } export interface ReconcilePermissionHookOptions { homeDir?: string; sourceScriptPath?: string; autoRepair?: boolean; } /** Aggregate health and repair state for all managed local hook hosts. */ export interface PermissionHookAuditSummary { installedHosts: string[]; currentHosts: string[]; repairedHosts: string[]; needsRepairHosts: string[]; diagnosticsPath: string; lastDiagnostic: PermissionHookDiagnosticRecord | null; lastStartupRepair: PermissionHookStartupRepairSummary | null; } /** Condensed health view surfaced in setup, permissions, and build info. */ export interface PermissionHookHealthSummary { status: 'ok' | 'warning' | 'error'; message: string; repairedCount: number; needsRepairCount: number; lastCheckedAt?: string; } export interface PermissionHookStartupRepairHostResult extends PermissionHookStatus { host: string; outcome: 'current' | 'repaired' | 'needs_repair' | 'not_installed' | 'error'; } /** Result summary for the most recent startup-time hook asset repair pass. */ export interface PermissionHookStartupRepairSummary { startedAt: string; completedAt: string; durationMs: number; repairedCount: number; needsRepairCount: number; hostResults: PermissionHookStartupRepairHostResult[]; } export interface HookAssetDescriptor { kind: 'bridge' | 'port-helper' | 'config-helper' | 'wrapper'; sourcePath: string; targetPath: string; } export interface HookAssetAuditResult { assetsPrepared: boolean; assetsCurrent: boolean; staleAssets: HookAssetDescriptor[]; } export declare const MANAGED_HOOK_WRAPPER_BASENAMES: { readonly vscode: "pretooluse-vscode.sh"; readonly cursor: "pretooluse-cursor.sh"; readonly windsurf: "pretooluse-windsurf.sh"; readonly 'gemini-cli': "pretooluse-gemini.sh"; readonly codex: "pretooluse-codex.sh"; }; export declare const WRAPPER_HOOK_HOSTS: Array; export declare const AUTO_REPAIRABLE_HOOK_HOSTS: readonly ["claude-code", ...("cursor" | "vscode" | "windsurf" | "gemini-cli" | "codex")[]]; export declare function isMissingFileError(error: unknown): boolean; export declare function detectIndent(raw: string): number | string; export declare function getPermissionHookScriptPath(homeDir?: string): string; export declare function getPermissionHookDiagnosticsPath(homeDir?: string): string; export declare function normalizeHookHost(host: string): string; export declare function readHostSpecificHookStatus(homeDir: string, host: string): PermissionHookStatus; export declare function collectHookMarkerPaths(homeDir: string): Set; export declare function collectHookMarkerPathsAsync(homeDir: string): Promise>; export declare function summarizeMarkerStatuses(markerPaths: Iterable): PermissionHookStatus; export declare function getHookWrapperBasename(host: string): string | null; export declare function getHookWrapperPath(host: string, homeDir?: string): string | null; export declare function getHookSourcePath(host: string): string; export declare function supportsManagedHookAssets(host: string): boolean; export declare function getPrimaryHookScriptPath(host: string, homeDir?: string): string; export declare function readLastPermissionHookDiagnostic(homeDir?: string): Promise; export declare function getManagedHookAssets(host: string, homeDir?: string, sourceScriptPath?: string): HookAssetDescriptor[]; export declare function auditHookAssets(host: string, homeDir?: string, sourceScriptPath?: string): Promise; export declare function getPermissionHookMarkerPath(homeDir?: string, host?: string): string; export declare function getClaudeHookSettingsPath(homeDir?: string): string; export declare function getVsCodeHookSettingsPath(homeDir?: string): string; export declare function getVsCodeUserSettingsPath(homeDir?: string): string; export declare function getGeminiHookSettingsPath(homeDir?: string): string; export declare function getCursorHookSettingsPath(homeDir?: string): string; export declare function getWindsurfHookSettingsPath(homeDir?: string): string; export declare function getCodexHookSettingsPath(homeDir?: string): string; export declare function getCodexConfigPath(homeDir?: string): string; export declare function normalizeHooksRoot(parsed: Record): Record; export declare function ensureCommandHook(parsed: Record, eventName: string, command: string, matcher: string, extraHookFields?: Record): { changed: boolean; parsed: Record; }; export declare function readOptionalUtf8(filePath: string, fallback: string): Promise; export declare function writeBackupIfPresent(filePath: string, raw: string): Promise; export declare function writeHookMarker(homeDir: string, marker: PermissionHookMarker): Promise; export declare function installHookAssetsForHost(client: string, homeDir: string, sourceScriptPath?: string): Promise<{ scriptPath: string; }>; //# sourceMappingURL=permissionHookShared.d.ts.map