Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

826 B
Raw Blame
export interface TerminalWorkerBoot {
    wasmUrl: string
    bios: ArrayBuffer
    vgaBios: ArrayBuffer
    kernel: ArrayBuffer
    canvas: OffscreenCanvas
}

export type TerminalWorkerRequest =
    | ({ type: 'start' } & TerminalWorkerBoot)
    | { type: 'run' }
    | { type: 'serial'; port: number; bytes: Uint8Array }
    | { type: 'keyboard'; codes: number[] }
    | { type: 'mouse'; event: 'mouse-click' | 'mouse-delta'; value: boolean[] | number[] }
    | { type: 'display'; visible: boolean }
    | { type: '9p'; id: number; bytes: Uint8Array }

export type TerminalWorkerResponse =
    | { type: 'loaded' }
    | { type: 'serial'; port: number; bytes: Uint8Array }
    | { type: '9p'; id: number; bytes: Uint8Array }
    | { type: 'error'; message: string; cause: { name: string; message: string; stack?: string } }