Missing documentation about Pty class in SDK v2 #8224

Open
opened 2026-02-16 18:09:27 -05:00 by yindo · 2 comments
Owner

Originally created by @MBanucu on GitHub (Feb 1, 2026).

Originally assigned to: @jayair on GitHub.

Description

Look at this:

export declare class Pty extends HeyApiClient {
    /**
     * List PTY sessions
     *
     * Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.
     */
    list<ThrowOnError extends boolean = false>(parameters?: {
        directory?: string;
    }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyListResponses, unknown, ThrowOnError, "fields">;
    /**
     * Create PTY session
     *
     * Create a new pseudo-terminal (PTY) session for running shell commands and processes.
     */
    create<ThrowOnError extends boolean = false>(parameters?: {
        directory?: string;
        command?: string;
        args?: Array<string>;
        cwd?: string;
        title?: string;
        env?: {
            [key: string]: string;
        };
    }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyCreateResponses, PtyCreateErrors, ThrowOnError, "fields">;
    /**
     * Remove PTY session
     *
     * Remove and terminate a specific pseudo-terminal (PTY) session.
     */
    remove<ThrowOnError extends boolean = false>(parameters: {
        ptyID: string;
        directory?: string;
    }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyRemoveResponses, PtyRemoveErrors, ThrowOnError, "fields">;
    /**
     * Get PTY session
     *
     * Retrieve detailed information about a specific pseudo-terminal (PTY) session.
     */
    get<ThrowOnError extends boolean = false>(parameters: {
        ptyID: string;
        directory?: string;
    }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyGetResponses, PtyGetErrors, ThrowOnError, "fields">;
    /**
     * Update PTY session
     *
     * Update properties of an existing pseudo-terminal (PTY) session.
     */
    update<ThrowOnError extends boolean = false>(parameters: {
        ptyID: string;
        directory?: string;
        title?: string;
        size?: {
            rows: number;
            cols: number;
        };
    }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyUpdateResponses, PtyUpdateErrors, ThrowOnError, "fields">;
    /**
     * Connect to PTY session
     *
     * Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.
     */
    connect<ThrowOnError extends boolean = false>(parameters: {
        ptyID: string;
        directory?: string;
    }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyConnectResponses, PtyConnectErrors, ThrowOnError, "fields">;
}

This is from node_modules/@opencode-ai/sdk/dist/v2/gen/sdk.gen.d.ts. There is nothing about it writting in the docs. What does it do? In what context does it belong? Are there also listed the terminal sessions that the coding agent created? Why is there no notification/event system on_data, on_exit, ... built in? Without notification system it sound as if one has to poll for it 😭🤮

Plugins

No response

OpenCode version

1.1.48

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

NixOS 25.11

Terminal

No response

Originally created by @MBanucu on GitHub (Feb 1, 2026). Originally assigned to: @jayair on GitHub. ### Description Look at this: ```ts export declare class Pty extends HeyApiClient { /** * List PTY sessions * * Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode. */ list<ThrowOnError extends boolean = false>(parameters?: { directory?: string; }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyListResponses, unknown, ThrowOnError, "fields">; /** * Create PTY session * * Create a new pseudo-terminal (PTY) session for running shell commands and processes. */ create<ThrowOnError extends boolean = false>(parameters?: { directory?: string; command?: string; args?: Array<string>; cwd?: string; title?: string; env?: { [key: string]: string; }; }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyCreateResponses, PtyCreateErrors, ThrowOnError, "fields">; /** * Remove PTY session * * Remove and terminate a specific pseudo-terminal (PTY) session. */ remove<ThrowOnError extends boolean = false>(parameters: { ptyID: string; directory?: string; }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyRemoveResponses, PtyRemoveErrors, ThrowOnError, "fields">; /** * Get PTY session * * Retrieve detailed information about a specific pseudo-terminal (PTY) session. */ get<ThrowOnError extends boolean = false>(parameters: { ptyID: string; directory?: string; }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyGetResponses, PtyGetErrors, ThrowOnError, "fields">; /** * Update PTY session * * Update properties of an existing pseudo-terminal (PTY) session. */ update<ThrowOnError extends boolean = false>(parameters: { ptyID: string; directory?: string; title?: string; size?: { rows: number; cols: number; }; }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyUpdateResponses, PtyUpdateErrors, ThrowOnError, "fields">; /** * Connect to PTY session * * Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time. */ connect<ThrowOnError extends boolean = false>(parameters: { ptyID: string; directory?: string; }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyConnectResponses, PtyConnectErrors, ThrowOnError, "fields">; } ``` This is from `node_modules/@opencode-ai/sdk/dist/v2/gen/sdk.gen.d.ts`. There is nothing about it writting in the [docs](https://opencode.ai/docs/sdk/). What does it do? In what context does it belong? Are there also listed the terminal sessions that the coding agent created? Why is there no notification/event system `on_data`, `on_exit`, `...` built in? Without notification system it sound as if one has to poll for it 😭🤮 ### Plugins _No response_ ### OpenCode version 1.1.48 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System NixOS 25.11 ### Terminal _No response_
yindo added the bugdocs labels 2026-02-16 18:09:27 -05:00
Author
Owner

@MBanucu commented on GitHub (Feb 1, 2026):

How to fix: Update the docs.

@MBanucu commented on GitHub (Feb 1, 2026): How to fix: Update the docs.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 1, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #11610: Bug in documentation of plugin SDK - mentions missing v2 SDK documentation
  • #7451: Dose APIs of opencode support session-level SSE event listener? - addresses the event/notification system question
  • #9650: [FEATURE]:Support sessionID Filter for SSE Event Subscription - related to event filtering

The main documentation gap appears to be SDK v2 API documentation. Issue #11610 specifically flags this issue as well.

@github-actions[bot] commented on GitHub (Feb 1, 2026): This issue might be a duplicate of existing issues. Please check: - #11610: Bug in documentation of plugin SDK - mentions missing v2 SDK documentation - #7451: Dose APIs of opencode support session-level SSE event listener? - addresses the event/notification system question - #9650: [FEATURE]:Support `sessionID` Filter for SSE Event Subscription - related to event filtering The main documentation gap appears to be SDK v2 API documentation. Issue #11610 specifically flags this issue as well.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8224