/** How much of a Host stderr log the report carries. */ export declare const DIAG_ERR_TAIL_BYTES = 2000; export interface DiagHostState { /** 'none' — no lock file; 'live' — owner alive and channel reachable; * 'zombie' — owner alive but the channel does not answer; * 'stale' — lock exists but its owner is gone (stealable). */ kind: 'none' | 'live' | 'zombie' | 'stale'; pid?: number; /** Lock state as written by the Host (`attached`/`paused`/`running-detached`). */ state?: string; agentStatus?: string; disconnectPolicy?: string; tty?: string; /** Owner identity check: 'verified', 'mismatch', or 'unverifiable'. */ identity?: 'verified' | 'mismatch' | 'unverifiable'; lockPath?: string; path: string; } export interface DiagSnapshot { pluginVersion: string; hostVersion: string; nodeVersion: string; platform: string; /** * Which terminal we classified, and the capabilities we then claimed. A * Windows report that says "the mouse does nothing" or "copy did nothing" is * otherwise guesswork: conhost and Windows Terminal look identical from the * transcript, and the claimed flags are what the TUI actually acted on. */ terminal?: { family: string; label: string; mouse: boolean; bracketedPaste: boolean; alternateScreen: boolean; osc52: boolean; osc8: boolean; title: boolean; /** `DSH_TUI_TERM_CAPS` tokens that were rejected (typos), for the row. */ ignoredOverrides: readonly string[]; /** Chrome is being drawn in ASCII because the console cannot decode UTF-8. */ ascii: boolean; }; /** * What the palette resolved to and which hints decided it. A "no colour on * Windows" report is otherwise guesswork: `TERM` is unset there by default. */ color?: { depth: string; term?: string; colorTerm?: string; windowsTerminal: boolean; }; sessionId: string; /** This process is the detached Host rather than the launcher. */ hostProcess: boolean; locksDisabled: boolean; dshHome: string; sockPath: string; /** `true` when a connect to the channel succeeded. */ sockReachable: boolean; /** A socket *file* exists on disk (POSIX only; pipes are invisible to fs). */ sockFilePresent?: boolean; host: DiagHostState; link: { kind: 'ssh' | 'local'; rttMs?: number; probeState: 'measured' | 'unknown' | 'unprobed'; paintIntervalMs?: number; }; lockHeldByThisProcess: boolean; sessionLog?: { format: string; bytes: number; modifiedAt?: number; events?: number; seq?: number; }; /** Last lines the Host wrote to its stderr log, if any. */ errTail?: string; /** Locks found under DSH_HOME for *other* sessions (context for "who holds it"). */ otherLocks: Array<{ sessionId: string; pid: number; state?: string; }>; } /** Tail of a Host stderr log, or undefined when there is nothing to read. */ export declare function readErrTail(sessionId: string, dshHome?: string): Promise; /** * Why `--resume` would behave the way it does, as an ordered chain of verdicts. * The first entry is the actionable one; the rest is supporting context. */ export declare function diagVerdicts(snapshot: DiagSnapshot): string[]; export declare function formatDiag(snapshot: DiagSnapshot): string[]; /** Gather everything the report needs. Every probe is best-effort. */ export declare function collectDiag(options: { sessionId: string; pluginVersion: string; hostVersion: string; hostProcess: boolean; link: DiagSnapshot['link']; paintIntervalMs?: number; dshHome?: string; color?: DiagSnapshot['color']; }): Promise; /** Directory holding the per-session index, for callers that report it. */ export declare function diagIndexPath(dshHome?: string): string;