ExAgent.Toolset (ExAgent v3.0.0)

View Source

Compose ordered tool inventories at agent construction time.

Stability — Stable.

Selections and mappings use the current names at that point in the pipeline. Permission globs apply to the final names. Use require_approval/2 for a requirement that travels with a tool through subsequent transformations.

Summary

Functions

Keep named tools, exclude names with {:except, names}, or keep predicate matches.

Prepend the literal prefix to each name, including any desired separator.

Simultaneously rename current names using an old-name to new-name map.

Require review of the selected tools even when permission rules allow them.

Types

selection()

@type selection() ::
  [String.t()] | {:except, [String.t()]} | (ExAgent.Tool.t() -> boolean())

Functions

filter(tools, selection)

@spec filter([ExAgent.Tool.t()], selection()) :: [ExAgent.Tool.t()]

Keep named tools, exclude names with {:except, names}, or keep predicate matches.

prefix(tools, prefix)

@spec prefix([ExAgent.Tool.t()], String.t()) :: [ExAgent.Tool.t()]

Prepend the literal prefix to each name, including any desired separator.

rename(tools, mapping)

@spec rename([ExAgent.Tool.t()], %{required(String.t()) => String.t()}) :: [
  ExAgent.Tool.t()
]

Simultaneously rename current names using an old-name to new-name map.

require_approval(tools, selection \\ :all)

@spec require_approval([ExAgent.Tool.t()], :all | selection()) :: [ExAgent.Tool.t()]

Require review of the selected tools even when permission rules allow them.