import type { ServiceAdapter, ServiceStatus, InstallResult } from './types.js'; export declare const TASK_NAME = "AstraMemoryD"; export declare const WATCHDOG_TASK_NAME = "AstraMemoryDWatchdog"; declare function startupScriptPath(): string; declare function backupStartupScriptPath(): string; /** Rejection shape from runCmd() — carries the ORIGINAL exec() error's * `.code`/`.signal` alongside whatever the command printed before it * failed, so callers can tell "the command ran and reported a real * negative state" apart from "we could not run/finish the query at all". */ export interface RunCmdError extends Error { code?: string | number | null; signal?: NodeJS.Signals | null; stdout?: string; } export declare function runCmd(cmd: string): Promise; /** * True when a runCmd() rejection means "we could not determine the * answer" (our own timeout killed it, or `schtasks.exe` itself is * missing) rather than "the command ran to completion and reported a * real negative state" (`schtasks /query` for a task that genuinely * doesn't exist exits non-zero promptly with "ERROR: The system cannot * find the file specified" — a real answer, not a query failure). This * is the exact distinction status() below used to collapse: a query that * timed out used to report `installed: false` for a task we already knew * existed, telling the user to reinstall a service that was already * there and simply slow to answer (ADR-015 rule 4). */ export declare function isInconclusiveFailure(err: unknown): boolean; /** * Best-effort elevation probe. `net session` succeeds only in an elevated * shell; exit code 2 (access denied) means non-elevated. Used for DIAGNOSTICS * only — never as a gate: schtasks is always attempted regardless. */ export declare function isElevated(): Promise; /** * Split a possibly-quoted command line into executable + argument string. * `"C:\Program Files\nodejs\node.exe" "C:\x\index.js"` → * { command: 'C:\Program Files\nodejs\node.exe', args: '"C:\x\index.js"' } */ export declare function splitCommand(execPath: string): { command: string; args: string; }; export declare class SchtasksAdapter implements ServiceAdapter { readonly platform: "win32"; install(execPath: string, port: number): Promise; uninstall(): Promise; start(): Promise; stop(): Promise; status(): Promise; installBackupTimer(execPath: string, keep: number): Promise; uninstallBackupTimer(): Promise; /** * Hang-watchdog probe task (issue #206, mirroring FEAT-443 SLICE-2's * systemd/launchd timer — see watchdog-probe.ts's header for why the * PT5M keepalive alone can never catch a wedged-but-lock-holding daemon). * Registers a SECOND scheduled task that runs * ` service watchdog-probe` on its own repeating cadence, * independent of the daemon task's own PT5M keepalive tick. * * XML-first, same reason as install()/installBackupTimer(): a current-user * XML registration installs without elevation on boxes where the CLI * `/create` form gets "Access is denied". Reuses buildTaskXml's proven * logon-trigger-with-repetition shape (task-xml.ts) at `intervalSec`'s * cadence instead of the daemon task's fixed PT5M. */ installWatchdogTimer(execPath: string, intervalSec: number): Promise; /** Idempotent — no-op if the watchdog task was never installed. */ uninstallWatchdogTimer(): Promise; } /** Exported for tests — resolve the startup-shortcut path without constructing an adapter instance. */ export { startupScriptPath, backupStartupScriptPath };