Toolnexus.Context (toolnexus v0.17.0)

Copy Markdown View Source

Execution context passed to every tool (SPEC §1).

answer is set only on the §10 re-execution after a wait_for resolved a suspension.

signal is the cooperative cancellation token: a zero-arity predicate (aborted when it returns true — the caller owns the backing state) or a pid (aborted when the process is no longer alive). nil means never cancelled.

Summary

Types

t()

@type t() :: %Toolnexus.Context{
  agent: String.t() | nil,
  answer: Toolnexus.Answer.t() | nil,
  call_id: String.t() | nil,
  extra: map() | nil,
  message_id: String.t() | nil,
  session_id: String.t() | nil,
  signal: (-> boolean()) | pid() | nil,
  timeout: non_neg_integer() | nil
}