Toolnexus.Builtin (toolnexus v0.9.4)

Copy Markdown View Source

Built-in tool source (source: "builtin") — SPEC §4A.

The default toolset toolnexus ships so an agent can act with zero custom wiring: opencode's built-ins, ported with identical tool names + input schemas. Every tool obeys the uniform Tool/ToolResult contract: a failure is a %ToolResult{is_error: true}, never a raise across the boundary. Paths resolve relative to the process working directory unless absolute.

The ten tools, in fixed parity order: bash, read, write, edit, grep, glob, webfetch, question, apply_patch, todowrite.

Summary

Functions

Whether the builtin source is on. Default ON. Same precedence as MCP: disabled: true wins, else enabled: false disables, otherwise enabled.

Resolve the active builtin tools for a config. Whole-source-off wins and returns []. Otherwise all ten are on; a tools name→bool map drops any tool mapped to false (all-on baseline; true/absent stay on; unknown names are ignored). SPEC §4A.

Build the ten built-in tools (each source: "builtin"). The order is fixed for parity: bash, read, write, edit, grep, glob, webfetch, question, apply_patch, todowrite.

Functions

enabled?(cfg)

@spec enabled?(nil | boolean() | map()) :: boolean()

Whether the builtin source is on. Default ON. Same precedence as MCP: disabled: true wins, else enabled: false disables, otherwise enabled.

load(cfg \\ nil)

@spec load(nil | boolean() | map()) :: [Toolnexus.Tool.t()]

Resolve the active builtin tools for a config. Whole-source-off wins and returns []. Otherwise all ten are on; a tools name→bool map drops any tool mapped to false (all-on baseline; true/absent stay on; unknown names are ignored). SPEC §4A.

tools()

@spec tools() :: [Toolnexus.Tool.t()]

Build the ten built-in tools (each source: "builtin"). The order is fixed for parity: bash, read, write, edit, grep, glob, webfetch, question, apply_patch, todowrite.