import { type MachineEntry, type MachineRegistry } from '../tasks/dispatch-utils.js'; interface CommandParams { action: string; params: Record; timeout?: number; } declare function startClientManager(port: number): void; declare function stopClientManager(): void; declare function getOnlineDevices(): Array<{ device: string; platform: string; connectedAt: Date; lastHeartbeat: Date; capabilities: string[]; }>; declare function isDeviceOnline(device: string): boolean; declare function sendCommand(device: string, command: CommandParams): Promise; declare function getPid(device: string): number | undefined; declare function setPid(device: string, pid: number): void; declare function deletePid(device: string): void; declare const clientPids: { get: typeof getPid; set: typeof setPid; delete: typeof deletePid; }; declare function sshExec(host: string, command: string, timeout?: number): Promise; type SshExec = (host: string, command: string, timeout?: number) => Promise; /** * Build the shell command run over SSH to spawn cortex-client on a remote device. * * Windows note: WMI `Win32_Process.Create` does NOT perform PATH lookup, and * `cortex-client` installed by npm on Windows is a `.cmd` shim * (e.g. `C:\Users\\AppData\Roaming\npm\cortex-client.cmd`). Passing the bare * name returns ReturnValue=9 (Path Not Found) with an empty ProcessId, which * over SSH serializes to "" and the parent caller logs * `Failed to parse PID for : ""`. Wrapping with `cmd.exe /c` makes cmd * do the PATH lookup and run the .cmd shim correctly. * * Linux note: the shell handles PATH lookup; `nohup` detaches and `echo $!` * returns the child PID on stdout. */ declare function buildRemoteSpawnCommand(reg: MachineEntry, clientToken?: string): string; declare function startRemoteClient(device: string): Promise; /** Start clients on all registered devices */ declare function startAllRemoteClients(): Promise; declare function _setSshExecForTesting(fn: SshExec): void; declare function _setMachineRegistryProviderForTesting(fn: () => MachineRegistry): void; declare function _getRestartTimerCount(): number; declare function _testReset(): void; export { startClientManager, stopClientManager, getOnlineDevices, isDeviceOnline, sendCommand, startRemoteClient, startAllRemoteClients, buildRemoteSpawnCommand, clientPids, sshExec, _setSshExecForTesting, _setMachineRegistryProviderForTesting, _getRestartTimerCount, _testReset, };