/** * LocalSocketServer — IPC for `loopsy shell` / `loopsy attach`. * * A Unix-domain-socket server wired into the same PtySessionManager the * relay client uses, so a phone connected over WAN and a local terminal * connected over the local socket can share the same long-lived PTY. * Auth is filesystem-permission-based: the socket is created mode 0600, * owned by whoever launched the daemon. * * Wire protocol — length-prefix framed, no WebSocket: * 4 bytes BE: payload+type length (everything after these 4 bytes) * 1 byte: frame type * 0x01 = JSON control (utf-8) * 0x02 = binary PTY data * N bytes: payload * * The session id is implicit per connection — once a client attaches to * a session, all binary frames on that connection target it. This is the * key difference from the relay protocol, which prefixes every binary * frame with a 16-byte session UUID because it multiplexes many sessions * over one device WS. */ import type { PtySessionManager } from './pty-session-manager.js'; import type { CustomCommand } from '@loopsy/protocol'; interface ClientLogger { info(msg: string, ctx?: Record): void; warn(msg: string, ctx?: Record): void; error(msg: string, ctx?: Record): void; } export interface LocalSocketServerConfig { socketPath: string; pty: PtySessionManager; logger?: ClientLogger; /** Returns the daemon's current trusted custom-command list. */ customCommands?: () => CustomCommand[]; } export declare class LocalSocketServer { private server; private pty; private socketPath; private log; private getCustomCommands; private clients; constructor(cfg: LocalSocketServerConfig); start(): Promise; stop(): Promise; private handleConnection; } export {}; //# sourceMappingURL=local-socket-server.d.ts.map