toolsreg

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package toolsreg assembles the set of built-in tool definitions advertised to the model. It is the single place that decides which tools are offered for a given set of session capabilities, keeping the top-level session and subagent runner in agreement instead of each maintaining its own list.

It owns advertisement only — the model-facing list. Dispatch of an incoming tool_use to its handler lives in core/toolexec, which is coupled to the executor's runtime state (sandbox, LSP manager, skill registry, plan store).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Definitions

func Definitions(c Capabilities) []tooldef.Definition

Definitions returns the tool definitions to advertise to the model for the given capabilities, base tools first, in a stable order.

Types

type Capabilities

type Capabilities struct {
	// Skills advertises the load_skill tool. Set when the skill registry is
	// non-empty; there is no point offering it when no skills are registered.
	Skills bool
	// LSP advertises the use_lsp tool. Set when a language server is available.
	LSP bool
	// Plan advertises the plan-store tools. Set when the session has a plan
	// store. Subagents leave this false — only the top-level session plans.
	Plan bool
	// PlanResearchSubagent advertises the research_codebase tool. Set when
	// the session has a plan store and the plan.research_subagent model is
	// configured.
	PlanResearchSubagent bool
	// ReviewTicket advertises the review_ticket tool. Set when the session
	// has a plan store and the review.reviewer_subagent model is configured.
	ReviewTicket bool
	// TaskList advertises the standalone task-list tools (create_task_list,
	// add_task_to_task_list, ...). Set when the session has a task store.
	// Subagents leave this false.
	TaskList bool
	// WebFetch advertises the web_fetch tool. Enabled for top-level sessions;
	// disabled for subagents to limit their network surface.
	WebFetch bool
}

Capabilities describes the optional tools available in a session. The three base tools (run_shell, edit_file, run_unsafe_shell) are always advertised; each flag here gates an additional tool that depends on session-specific state.

Source Files

  • toolsreg.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL