/** * Platform-specific advisories surfaced before capture-class tool calls. * * Today this only handles the macOS 26.x `task_for_pid` regression that * blocks `leaks --outputGraph`, `heap`, and `xctrace --template Allocations` * against iOS simulator processes regardless of `MallocStackLogging`. * Surfaced from the notelet investigation 2026-05-12, where three CLI * memory-introspection paths all failed with `Failed to get DYLD info for * task` / minimal-corpse, and even Xcode's "View Memory Graph Hierarchy" * failed unless Malloc Stack Logging was enabled in the scheme. * * The advisory is informational and idempotent: emitted once per server * instance via {@link maybeLogPlatformAdvisoryOnce} (stderr), and returned * as a structured `platformAdvisory` field on capture-class tool responses * via {@link getPlatformAdvisory} so agents can surface it to the user * before any tool work. */ export type PlatformAdvisory = { issue: "macos-26-task-for-pid-broken"; message: string; recommendedActions: string[]; }; /** * Pure: returns the structured platform advisory for the current host, * or `null` when no advisory applies. * * The advisory is suppressed when: * - Host is not macOS. * - Host is macOS but not in the 26.x range (Darwin kernel 25.x). * - `MEMORYDETECTIVE_SUPPRESS_PLATFORM_ADVISORY=1` is set in the environment. * * Conservative: when the Darwin major cannot be parsed, returns `null` * (no advisory) rather than emitting a false positive. The macOS 27.x case * (Darwin 26.x) is also `null` pending verification of whether Apple * shipped a kernel fix; reopen this helper when 27.x lands. * * @param env - Environment lookup (defaults to `process.env`). * Threaded as a parameter for testability. * @param osPlatform - `os.platform()` value (defaults to live). * @param osRelease - `os.release()` value (defaults to live). */ export declare function getPlatformAdvisory(env?: Readonly>, osPlatform?: () => NodeJS.Platform, osRelease?: () => string): PlatformAdvisory | null; /** * Side-effecting: emits the platform advisory to stderr on the FIRST call * per server instance, then no-ops on subsequent calls. Safe to call at * the top of every capture-class tool. * * The once-per-instance flag is module-level so it survives across tool * calls within the same server process. Tests can reset via * {@link resetPlatformAdvisoryFlagForTests}. */ export declare function maybeLogPlatformAdvisoryOnce(advisory: PlatformAdvisory | null, writer?: (line: string) => void): void; /** Test-only: reset the once-per-instance flag. */ export declare function resetPlatformAdvisoryFlagForTests(): void;