Public API for the Minga agent runtime.
Unifies session management, tool execution, and introspection into a single entry point. External clients (API gateway, CLI tools, IDE extensions) should call this module rather than reaching into SessionManager, Tool.Registry, or Tool.Executor directly.
All functions here are Layer 1 (MingaAgent.*). They work in both
headless mode (Minga.Runtime.start/1) and full editor mode.
Summary
Functions
Aborts the current operation on a session.
Returns a capabilities manifest describing the runtime.
Returns structured descriptions of all active sessions.
Returns structured descriptions of all registered tools.
Executes a tool by name with the given arguments.
Looks up the PID for a session ID.
Looks up a tool spec by name.
Lists all active sessions as {id, pid, metadata} tuples.
Returns all registered tool specs.
Sends a user prompt to a session.
Starts the API gateway (WebSocket + JSON-RPC).
Starts a new agent session. Returns {:ok, session_id, pid}.
Stops a session by its human-readable ID.
Returns true if a tool with the given name is registered.
Functions
@spec abort(String.t()) :: :ok | {:error, :not_found}
Aborts the current operation on a session.
@spec capabilities() :: MingaAgent.Introspection.capabilities_manifest()
Returns a capabilities manifest describing the runtime.
@spec describe_sessions() :: [MingaAgent.Introspection.session_description()]
Returns structured descriptions of all active sessions.
@spec describe_tools() :: [MingaAgent.Introspection.tool_description()]
Returns structured descriptions of all registered tools.
@spec execute_tool(String.t(), map()) :: MingaAgent.Tool.Executor.result()
Executes a tool by name with the given arguments.
Looks up the PID for a session ID.
@spec get_tool(String.t()) :: {:ok, MingaAgent.Tool.Spec.t()} | :error
Looks up a tool spec by name.
@spec list_sessions() :: [{String.t(), pid(), MingaAgent.SessionMetadata.t()}]
Lists all active sessions as {id, pid, metadata} tuples.
@spec list_tools() :: [MingaAgent.Tool.Spec.t()]
Returns all registered tool specs.
Sends a user prompt to a session.
Starts the API gateway (WebSocket + JSON-RPC).
Does not start by default. Call explicitly from headless mode or when external clients need to connect. The Editor boot path never calls this.
Options:
:port- TCP port to listen on (default: 4820)
Starts a new agent session. Returns {:ok, session_id, pid}.
@spec stop_session(String.t()) :: :ok | {:error, :not_found}
Stops a session by its human-readable ID.
Returns true if a tool with the given name is registered.