Spatio.Api.Agents (spatio_sdk v0.0.2)

API calls for all endpoints tagged Agents.

Summary

Functions

Create a new agent-platform conversation.

Delete an agent configuration.

Execute an action through the agent platform.

Fetch one agent configuration.

Identity bundle for the SessionStart hook (user + org + workspace + connected accounts) so the agent doesn't fish on its first turn.

List messages on an agent conversation.

List the caller's agent-platform conversations. Distinct from /v1/conversations (renderer-driven sidebar persistence).

List the caller's agent configurations.

Curated featured agents (e.g. "Claude Code", "Research Assistant"). Read-only — these are surfaced by the renderer's preconfigured-picker UI.

Functions

create_agent(connection, create_agent_request, opts \\ [])

Create a new agent configuration.

Parameters

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

Returns

  • {:ok, Spatio.Model.Agent.t} on success
  • {:error, Tesla.Env.t} on failure

create_agent_conversation(connection, opts \\ [])

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

Create a new agent-platform conversation.

Parameters

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

Returns

  • {:ok, Spatio.Model.AgentConversation.t} on success
  • {:error, Tesla.Env.t} on failure

create_agent_message(connection, id, create_agent_message_request, opts \\ [])

Append a message to an agent conversation.

Parameters

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

Returns

  • {:ok, Spatio.Model.AgentMessage.t} on success
  • {:error, Tesla.Env.t} on failure

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

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

Delete an agent configuration.

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

execute_agent_action(connection, execute_action_request, opts \\ [])

Execute an action through the agent platform.

Parameters

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

Returns

  • {:ok, Spatio.Model.ExecuteActionResponse.t} on success
  • {:error, Tesla.Env.t} on failure

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

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

Fetch one agent configuration.

Parameters

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

Returns

  • {:ok, Spatio.Model.Agent.t} on success
  • {:error, Tesla.Env.t} on failure

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

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

Fetch one agent conversation.

Parameters

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

Returns

  • {:ok, Spatio.Model.AgentConversation.t} on success
  • {:error, Tesla.Env.t} on failure

get_agent_session_context(connection, opts \\ [])

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

Identity bundle for the SessionStart hook (user + org + workspace + connected accounts) so the agent doesn't fish on its first turn.

Parameters

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

Returns

  • {:ok, Spatio.Model.AgentSessionContext.t} on success
  • {:error, Tesla.Env.t} on failure

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

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

List messages on an agent conversation.

Parameters

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

Returns

  • {:ok, Spatio.Model.AgentMessageListResponse.t} on success
  • {:error, Tesla.Env.t} on failure

list_agent_conversations(connection, opts \\ [])

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

List the caller's agent-platform conversations. Distinct from /v1/conversations (renderer-driven sidebar persistence).

Parameters

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

Returns

  • {:ok, Spatio.Model.AgentConversationListResponse.t} on success
  • {:error, Tesla.Env.t} on failure

list_agents(connection, opts \\ [])

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

List the caller's agent configurations.

Parameters

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

Returns

  • {:ok, Spatio.Model.AgentListResponse.t} on success
  • {:error, Tesla.Env.t} on failure

list_preconfigured_agents(connection, opts \\ [])

@spec list_preconfigured_agents(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, [Spatio.Model.PreconfiguredAgent.t()]}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Curated featured agents (e.g. "Claude Code", "Research Assistant"). Read-only — these are surfaced by the renderer's preconfigured-picker UI.

Parameters

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

Returns

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

update_agent(connection, id, update_agent_request, opts \\ [])

Update an agent configuration.

Parameters

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

Returns

  • {:ok, Spatio.Model.Agent.t} on success
  • {:error, Tesla.Env.t} on failure