/** * WS PTY Protocol Messages * * Defines WebSocket-specific PTY protocol messages for mesh networking. * These are used for Desktop-to-Desktop session sharing over the mesh. */ /** * WS PTY message type constants */ export declare const WS_PTY_MESSAGE_TYPES: { readonly SESSION_ENDED: "pty:session:ended"; readonly SUBSCRIBE: "pty:subscribe"; readonly UNSUBSCRIBE: "pty:unsubscribe"; readonly INPUT: "pty:input"; readonly RESIZE: "pty:resize"; readonly KILL: "pty:kill"; readonly OUTPUT: "pty:output"; readonly RESIZED: "pty:resized"; readonly FOCUS_CHANGED: "pty:focus:changed"; readonly CREATE_SESSION: "pty:create:session"; readonly SESSION_CREATED: "pty:session:created"; readonly CREATE_FAILED: "pty:create:failed"; }; export type WSPTYMessageType = (typeof WS_PTY_MESSAGE_TYPES)[keyof typeof WS_PTY_MESSAGE_TYPES]; export interface WSSessionEndedPayload { sessionId: string; exitCode?: number; signal?: string; } export interface WSSubscribePayload { sessionId: string; } export interface WSUnsubscribePayload { sessionId: string; } export interface WSInputPayload { sessionId: string; /** Base64 encoded input data */ data: string; } export interface WSResizePayload { sessionId: string; cols: number; rows: number; } export interface WSKillPayload { sessionId: string; signal?: string; } export interface WSOutputPayload { sessionId: string; /** Base64 encoded output data */ data: string; } export interface WSResizedPayload { sessionId: string; cols: number; rows: number; } export interface WSFocusChangedPayload { sessionId: string; focused: boolean; } export interface WSCreateSessionPayload { cwd?: string; cols?: number; rows?: number; command?: string; args?: string[]; } export interface WSSessionCreatedPayload { sessionId: string; pid: number; command: string; cwd: string; cols: number; rows: number; } export interface WSCreateFailedPayload { error: string; code?: string; } export interface WSRemoteSessionMetadata { ownerDeviceId: string; ownerDeviceName?: string; originalSource: 'local' | 'ipc'; focusedDeviceId?: string; hasFocus?: boolean; } export declare function isWSPTYMessageType(type: string): type is WSPTYMessageType; export declare function isWSOutputPayload(payload: unknown): payload is WSOutputPayload; export declare function isWSInputPayload(payload: unknown): payload is WSInputPayload; export declare function isWSResizePayload(payload: unknown): payload is WSResizePayload; export declare function isWSSubscribePayload(payload: unknown): payload is WSSubscribePayload; //# sourceMappingURL=ws-messages.d.ts.map