wyrd/tools
esc

    ↑↓ Move ↵ Open t3c results first Search by Pagefind
    Releases

    Terminal API

    Terminal API

    Classes

    TerminalApi

    Server terminal operations and event streams. attach accepts optional boolean resume. With resume: true, resubscriptions preserve closed, exited and evicted terminals instead of restarting them, even when restartIfNotRunning: true. Unknown terminal IDs can recover when cwd is supplied, including after a server restart. Omission and false retain ordinary attach behavior; unknown IDs without cwd fail lookup.

    TerminalApi

    Server terminal operations and event streams. attach accepts optional boolean resume. With resume: true, resubscriptions preserve closed, exited and evicted terminals instead of restarting them, even when restartIfNotRunning: true. Unknown terminal IDs can recover when cwd is supplied, including after a server restart. Omission and false retain ordinary attach behavior; unknown IDs without cwd fail lookup.

    Kind: global class

    terminalApi.open()

    Open a server terminal.

    open(
        input: RpcPayload<RpcMethods, "terminal.open">,
        signal?: AbortSignal,
      ): Promise<RpcSuccess<RpcMethods, "terminal.open">>;

    Kind: instance method of TerminalApi

    terminalApi.attach()

    Attach to a terminal output stream.

    attach(
        input: RpcPayload<RpcMethods, "terminal.attach">,
        options?: { readonly signal?: AbortSignal },
      ): AsyncIterable<DecodedStreamItem<RpcSuccess<RpcMethods, "terminal.attach">>>;

    Kind: instance method of TerminalApi

    terminalApi.write()

    Write input to a server terminal.

    write(
        input: RpcPayload<RpcMethods, "terminal.write">,
        signal?: AbortSignal,
      ): Promise<RpcSuccess<RpcMethods, "terminal.write">>;

    Kind: instance method of TerminalApi

    terminalApi.resize()

    Resize a server terminal.

    resize(
        input: RpcPayload<RpcMethods, "terminal.resize">,
        signal?: AbortSignal,
      ): Promise<RpcSuccess<RpcMethods, "terminal.resize">>;

    Kind: instance method of TerminalApi

    terminalApi.close()

    Close a server terminal.

    close(
        input: RpcPayload<RpcMethods, "terminal.close">,
        signal?: AbortSignal,
      ): Promise<RpcSuccess<RpcMethods, "terminal.close">>;

    Kind: instance method of TerminalApi

    terminalApi.observe()

    Follow one terminal without starting it: a snapshot with its retained history, then output and state events. Needs only terminal:read. An unknown terminal fails with TerminalSessionLookupError.

    observe(
        input: RpcPayload<RpcMethods, "terminal.observe">,
        options?: { readonly signal?: AbortSignal },
      ): AsyncIterable<DecodedStreamItem<RpcSuccess<RpcMethods, "terminal.observe">>>;

    Kind: instance method of TerminalApi

    terminalApi.watchMetadata()

    Follow every terminal: a snapshot of all of them, then upsert and remove events.

    watchMetadata(options?: {
        readonly signal?: AbortSignal;
      }): AsyncIterable<DecodedStreamItem<RpcSuccess<RpcMethods, "subscribeTerminalMetadata">>>;

    Kind: instance method of TerminalApi

    terminalApi.list()

    Every terminal the server keeps, from the first metadata snapshot.

    async list(signal?: AbortSignal): Promise<TerminalSummary[]>;

    Kind: instance method of TerminalApi

    terminalApi.read()

    One terminal’s current snapshot, with the history the server retains. Does not start or attach to the terminal. An unknown terminal fails with TerminalSessionLookupError.

    async read(
        input: RpcPayload<RpcMethods, "terminal.observe">,
        signal?: AbortSignal,
      ): Promise<TerminalSessionSnapshot>;

    Kind: instance method of TerminalApi