OpenCode.Generated.Pty (opencode_sdk v0.1.88)

Copy Markdown View Source

Provides API endpoints related to pty

Summary

Functions

Connect to PTY session

Create PTY WebSocket token

Create PTY session

Get PTY session

List PTY sessions

Remove PTY session

List available shells

Connect to PTY session

Create PTY WebSocket token

Create PTY session

List PTY sessions

Types

pty_shells_200_json_resp()

@type pty_shells_200_json_resp() :: %{
  acceptable: boolean(),
  name: String.t(),
  path: String.t()
}

t()

@type t() :: %OpenCode.Generated.Pty{
  args: [String.t()],
  command: String.t(),
  cwd: String.t(),
  exit_code: integer() | nil,
  id: String.t(),
  pid: integer(),
  status: String.t(),
  title: String.t()
}

v2_pty_connect_token_200_json_resp()

@type v2_pty_connect_token_200_json_resp() :: %{
  data: OpenCode.Generated.PtyTicketConnectToken.t(),
  location: OpenCode.Generated.LocationInfo.t()
}

v2_pty_create_200_json_resp()

@type v2_pty_create_200_json_resp() :: %{
  data: t(),
  location: OpenCode.Generated.LocationInfo.t()
}

v2_pty_get_200_json_resp()

@type v2_pty_get_200_json_resp() :: %{
  data: t(),
  location: OpenCode.Generated.LocationInfo.t()
}

v2_pty_list_200_json_resp()

@type v2_pty_list_200_json_resp() :: %{
  data: [t()],
  location: OpenCode.Generated.LocationInfo.t()
}

v2_pty_update_200_json_resp()

@type v2_pty_update_200_json_resp() :: %{
  data: t(),
  location: OpenCode.Generated.LocationInfo.t()
}

Functions

pty_connect(ptyID, opts \\ [])

@spec pty_connect(ptyID :: String.t(), opts :: keyword()) ::
  {:ok, boolean()}
  | {:error,
     OpenCode.Generated.EffectHttpApiErrorForbidden.t()
     | OpenCode.Generated.NotFoundError.t()}

Connect to PTY session

Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.

Options

  • directory
  • workspace
  • cursor
  • ticket

pty_connect_token(ptyID, opts \\ [])

Create PTY WebSocket token

Create a short-lived ticket for opening a PTY WebSocket connection.

Options

  • directory
  • workspace

pty_create(body, opts \\ [])

@spec pty_create(body :: map(), opts :: keyword()) ::
  {:ok, t()}
  | {:error,
     OpenCode.Generated.EffectHttpApiErrorBadRequest.t()
     | OpenCode.Generated.InvalidRequestError.t()}

Create PTY session

Create a new pseudo-terminal (PTY) session for running shell commands and processes.

Options

  • directory
  • workspace

Request Body

Content Types: application/json

pty_get(ptyID, opts \\ [])

@spec pty_get(ptyID :: String.t(), opts :: keyword()) ::
  {:ok, t()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.PtyNotFoundError.t()}

Get PTY session

Retrieve detailed information about a specific pseudo-terminal (PTY) session.

Options

  • directory
  • workspace

pty_list(opts \\ [])

@spec pty_list(opts :: keyword()) ::
  {:ok, [t()]} | {:error, OpenCode.Generated.BadRequestError.t()}

List PTY sessions

Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.

Options

  • directory
  • workspace

pty_remove(ptyID, opts \\ [])

@spec pty_remove(ptyID :: String.t(), opts :: keyword()) ::
  {:ok, boolean()}
  | {:error,
     OpenCode.Generated.BadRequestError.t()
     | OpenCode.Generated.PtyNotFoundError.t()}

Remove PTY session

Remove and terminate a specific pseudo-terminal (PTY) session.

Options

  • directory
  • workspace

pty_shells(opts \\ [])

@spec pty_shells(opts :: keyword()) ::
  {:ok, [pty_shells_200_json_resp()]}
  | {:error, OpenCode.Generated.BadRequestError.t()}

List available shells

Get a list of available shells on the system.

Options

  • directory
  • workspace

pty_update(ptyID, body, opts \\ [])

Update PTY session

Update properties of an existing pseudo-terminal (PTY) session.

Options

  • directory
  • workspace

Request Body

Content Types: application/json

v2_pty_connect(ptyID, opts \\ [])

Connect to PTY session

Establish a WebSocket connection streaming PTY output and accepting terminal input.

Options

  • location[directory]
  • location[workspace]
  • cursor
  • ticket

v2_pty_connect_token(ptyID, opts \\ [])

Create PTY WebSocket token

Create a short-lived single-use ticket for opening a PTY WebSocket connection.

Options

  • location

v2_pty_create(body, opts \\ [])

@spec v2_pty_create(body :: map(), opts :: keyword()) ::
  {:ok, v2_pty_create_200_json_resp()}
  | {:error,
     OpenCode.Generated.InvalidRequestError.t()
     | OpenCode.Generated.UnauthorizedError.t()}

Create PTY session

Create a pseudo-terminal session for a location.

Options

  • location

Request Body

Content Types: application/json

v2_pty_get(ptyID, opts \\ [])

Get PTY session

Get one PTY session, including its exit code once exited.

Options

  • location

v2_pty_list(opts \\ [])

List PTY sessions

List PTY sessions for a location, including exited sessions retained until removal.

Options

  • location

v2_pty_remove(ptyID, opts \\ [])

Remove PTY session

Terminate and remove one PTY session.

Options

  • location

v2_pty_update(ptyID, body, opts \\ [])

Update PTY session

Update the title or viewport size of one PTY session.

Options

  • location

Request Body

Content Types: application/json