/** * ProxyPTYSession — `IPTYSession` implementation over an `IPTYTransport`. * * This is the canonical proxy session used by `PTYSessionManager`: every * remote session announced by a transport is wrapped in one of these. Local * operations (`write`, `resize`, `kill`) are forwarded to the transport using * the remote (un-namespaced) session ID; incoming transport events (`output`, * `resized`, `sessionEnded`, `focusChanged`) are filtered by that ID and * translated back into base-class state via `pushOutput` / `setSize` / * `setExited` / `setFocus`. * * Wire it up with `PTYSessionManager.setProxySessionFactory(createProxyPTYSession)`. */ import { BasePTYSession } from '#types'; import type { IPTYSession, IPTYTransport, SessionSource, IPCSessionMetadata, WSSessionMetadata } from '#types'; import type { ProxySessionFactory } from './pty-session-manager.js'; /** * Factory options — mirrors the shape that `PTYSessionManager` passes to * a `ProxySessionFactory` when creating a proxy session. */ export interface ProxyPTYSessionOptions { /** Namespaced session ID (unique within this manager). */ id: string; /** Source type — 'ipc' or 'ws' for proxies. */ source: SessionSource; /** The un-namespaced session ID on the remote side. */ remoteSessionId: string; pid: number; command: string; cwd: string; cols: number; rows: number; metadata: IPCSessionMetadata | WSSessionMetadata; } export declare class ProxyPTYSession extends BasePTYSession implements IPTYSession { private readonly transport; private readonly remoteSessionId; private readonly onOutput; private readonly onResized; private readonly onSessionEnded; private readonly onFocusChanged; constructor(transport: IPTYTransport, options: ProxyPTYSessionOptions); write(data: string | Buffer): void; resize(cols: number, rows: number): void; kill(signal?: string): void; dispose(): void; } /** * Factory suitable for * `PTYSessionManager.setProxySessionFactory(createProxyPTYSession)`. * * Typed as `ProxySessionFactory` so TypeScript verifies the shape against the * manager's contract at definition time — no cast needed at the call site. */ export declare const createProxyPTYSession: ProxySessionFactory; //# sourceMappingURL=proxy-pty-session.d.ts.map