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

Copy Markdown

Reads agents' status and logs for operations.

Summary

Functions

Returns the calls the agent waits on a person for.

Returns :ok if the agent id exists, or a not_found error.

Returns the agent id's name. A conversation has its agent's name.

Returns when the agent id's next scheduled trigger runs, or nil.

Returns when each of the agent id's triggers runs next, by name. Webhooks are nil.

Returns a page of the logs patterns cover.

Returns the node the agent id runs on, or nil if it's asleep.

Returns the running agent id, or a not_found error if it's asleep.

Returns "asleep" if the agent id isn't running, or else its status/1.

Returns "idle", "running", or "parked" when waiting on a person.

Streams the logs patterns cover.

Returns the agent id's summary, as lists show it.

Returns whether event is one of types. Always true if types is nil.

Functions

interrupts(map)

@spec interrupts(map()) :: [map()]

Returns the calls the agent waits on a person for.

known(wardrik, id)

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

Returns :ok if the agent id exists, or a not_found error.

name(id)

@spec name(String.t()) :: String.t()

Returns the agent id's name. A conversation has its agent's name.

next_run(wardrik, id)

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

Returns when the agent id's next scheduled trigger runs, or nil.

next_runs(wardrik, id)

@spec next_runs(Wardrik.t(), String.t()) :: %{
  required(String.t()) => String.t() | nil
}

Returns when each of the agent id's triggers runs next, by name. Webhooks are nil.

page(scope, patterns, opts)

@spec page(Wardrik.Scope.t(), [String.t()], keyword()) ::
  {:ok, map()} | {:error, Wardrik.Error.t()}

Returns a page of the logs patterns cover.

placed(wardrik, id)

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

Returns the node the agent id runs on, or nil if it's asleep.

running(wardrik, id)

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

Returns the running agent id, or a not_found error if it's asleep.

state(wardrik, id, activity)

@spec state(Wardrik.t(), String.t(), map()) :: String.t()

Returns "asleep" if the agent id isn't running, or else its status/1.

status(map)

@spec status(map()) :: String.t()

Returns "idle", "running", or "parked" when waiting on a person.

stream(scope, patterns, opts)

@spec stream(Wardrik.Scope.t(), [String.t()], keyword()) ::
  {:ok, Enumerable.t()} | {:error, Wardrik.Error.t()}

Streams the logs patterns cover.

summary(wardrik, id)

@spec summary(Wardrik.t(), String.t()) :: map()

Returns the agent id's summary, as lists show it.

typed?(arg1, types)

@spec typed?(map(), [String.t()] | nil) :: boolean()

Returns whether event is one of types. Always true if types is nil.