Spatio.Api.Terminal (spatio_sdk v0.0.2)

API calls for all endpoints tagged Terminal.

Summary

Functions

Create a terminal session record. PTY bytes flow renderer ↔ local-agent over IPC and never traverse this API.

Delete a terminal session record.

List the caller's terminal sessions (metadata only — no PTY bytes).

Update terminal session metadata (title, cwd, etc.).

Functions

create_terminal_session(connection, request_body, opts \\ [])

@spec create_terminal_session(
  Tesla.Env.client(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Create a terminal session record. PTY bytes flow renderer ↔ local-agent over IPC and never traverse this API.

Parameters

  • connection (Spatio.Connection): Connection to server
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

delete_terminal_session(connection, id, opts \\ [])

@spec delete_terminal_session(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}

Delete a terminal session record.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

get_terminal_session(connection, id, opts \\ [])

@spec get_terminal_session(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Fetch a terminal session.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

list_terminal_sessions(connection, opts \\ [])

@spec list_terminal_sessions(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List the caller's terminal sessions (metadata only — no PTY bytes).

Parameters

  • connection (Spatio.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

update_terminal_session(connection, id, request_body, opts \\ [])

@spec update_terminal_session(
  Tesla.Env.client(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Update terminal session metadata (title, cwd, etc.).

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure