Wardrik.Operations.Running (wardrik v0.1.0-rc.1)

Copy Markdown

Finds the agents operations act on, waking them from their definitions if needed.

Summary

Functions

Returns the agent id, waking it from its definition if needed, or a not_found error.

Starts the agent opts describe, or reconfigures it if it's running.

Returns :ok if the agent id can have its own definition. Conversations can't.

Returns the agent id's definition, or a not_found error. A conversation uses its agent's.

Returns whether the agent id is running, saved or defined.

Returns the running agent id, or nil.

Functions

awake(wardrik, id)

@spec awake(Wardrik.t(), String.t()) :: {:ok, pid()} | {:error, Wardrik.Error.t()}

Returns the agent id, waking it from its definition if needed, or a not_found error.

bring(wardrik, opts)

@spec bring(Wardrik.t(), keyword()) :: {:ok, pid()} | {:error, Wardrik.Error.t()}

Starts the agent opts describe, or reconfigures it if it's running.

A running agent uses the new options from its next turn. A saved agent uses them as it loads.

definable(id)

@spec definable(String.t()) :: :ok | {:error, Wardrik.Error.t()}

Returns :ok if the agent id can have its own definition. Conversations can't.

definition(wardrik, id)

@spec definition(Wardrik.t(), String.t()) ::
  {:ok, map()} | {:error, Wardrik.Error.t()}

Returns the agent id's definition, or a not_found error. A conversation uses its agent's.

known?(wardrik, id)

@spec known?(Wardrik.t(), String.t()) :: boolean()

Returns whether the agent id is running, saved or defined.

whereis(wardrik, id)

@spec whereis(Wardrik.t(), String.t()) :: pid() | nil

Returns the running agent id, or nil.