Miosa.OpenComputers.Agents (Miosa v1.0.0)

Copy Markdown View Source

AI agent dispatch for registered hosts.

Dispatch an AI agent to autonomously complete a task on your host. The agent can run commands, edit files, browse the web, and more.

Summary

Functions

Cancel a running agent session.

Dispatch an AI agent to run a task on the host.

Stream live events from an agent session (SSE).

Get a specific agent session.

List agent sessions for a host.

Types

result()

@type result() :: {:ok, map()} | {:error, Miosa.Error.t()}

Functions

cancel(client, host_id, session_id)

@spec cancel(Miosa.Client.t(), String.t(), String.t()) :: result()

Cancel a running agent session.

dispatch(client, host_id, attrs)

@spec dispatch(Miosa.Client.t(), String.t(), map()) :: result()

Dispatch an AI agent to run a task on the host.

attrs must include :task. Optional: :model_id, :max_turns, :context.

events(client, host_id, session_id, callback)

@spec events(Miosa.Client.t(), String.t(), String.t(), function()) ::
  :ok | {:error, Miosa.Error.t()}

Stream live events from an agent session (SSE).

The callback receives %{type: type, data: data} maps. Blocks until done.

get(client, host_id, session_id)

@spec get(Miosa.Client.t(), String.t(), String.t()) :: result()

Get a specific agent session.

list(client, host_id)

@spec list(Miosa.Client.t(), String.t()) :: result()

List agent sessions for a host.