Cotal TypeScript packages
    Preparing search index...

    Interface AttachSession

    A live attach onto a running agent's terminal — the stream cotal attach (and, later, the browser console) consumes. PTY frames flow here directly, never over the mesh.

    interface AttachSession {
        cols: number;
        rows: number;
        backlog(): Buffer<ArrayBufferLike> | Promise<Buffer<ArrayBufferLike>>;
        onData(fn: (chunk: Buffer) => void): () => void;
        onExit(fn: () => void): () => void;
        resize(cols: number, rows: number): void;
        write(data: string): void;
    }
    Index
    cols: number
    rows: number
    • A snapshot to bootstrap a late/concurrent attach: bytes that repaint the current screen. May be async — a backend can reconstruct a full-screen (alternate-screen) TUI's buffer rather than replay raw scrollback, so an attach paints correctly without the child having to repaint.

      Returns Buffer<ArrayBufferLike> | Promise<Buffer<ArrayBufferLike>>

    • Subscribe to live output; returns an unsubscribe fn.

      Parameters

      • fn: (chunk: Buffer) => void

      Returns () => void

    • Fires when the underlying process exits; returns an unsubscribe fn.

      Parameters

      • fn: () => void

      Returns () => void

    • Resize the pseudo-terminal.

      Parameters

      • cols: number
      • rows: number

      Returns void

    • Forward keystrokes to the process.

      Parameters

      • data: string

      Returns void