Help us shape the future of Go! Take the 2026 Go Developer Survey

deferred

package
v0.4.45 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToolSearch   = "tool_search"
	ToolList     = "tool_list"
	ToolDescribe = "tool_describe"
	ToolCall     = "tool_call"
)

Variables

This section is empty.

Functions

func IsBridge

func IsBridge(name string) bool

func New

func New(cfg Config, deps Deps) (agentkit.ToolRuntime, error)

New registers tools/deferred: same config/deps shape as tools/runtime; builds runtime internally.

Set config.enabled true to replace dynamic tool schemas with tool_search / tool_list / tool_describe / tool_call.

Types

type Config

type Config struct {
	tools.RuntimeConfig
	DisclosureConfig
}

Config matches tools/runtime config at the top level, plus disclosure fields. Swap use: tools/runtime → tools/deferred without changing deps or timeout/allowTools keys.

func (Config) Normalize

func (c Config) Normalize() Config

func (*Config) SetDefaults added in v0.3.48

func (c *Config) SetDefaults()

SetDefaults implements pluginkit.Defaulter.

func (*Config) Validate added in v0.3.48

func (c *Config) Validate() error

Validate implements pluginkit.Validator.

type Deps

type Deps = tools.RuntimeDeps

Deps are the same slots as tools/runtime (hooks, tools, toolPacks, dynamicTools, policies, approval).

type DisclosureConfig

type DisclosureConfig struct {
	Enabled            EnabledSetting `json:"enabled"`
	ThresholdPct       float64        `json:"thresholdPct"`
	ListingMaxTokens   int            `json:"listingMaxTokens"`
	SearchDefaultLimit int            `json:"searchDefaultLimit"`
	MaxSearchLimit     int            `json:"maxSearchLimit"`
	ListDefaultLimit   int            `json:"listDefaultLimit"`
	ListMaxLimit       int            `json:"listMaxLimit"`
	ListMaxBytes       int            `json:"listMaxBytes"`
	Listing            string         `json:"listing"` // auto | on | off
	// SearchInlineSchemaMax inlines full input schemas for the top-N search hits
	// in the tool_search result, so the model can invoke immediately without
	// tool_describe. 0 = default (5); negative = disable inlining.
	SearchInlineSchemaMax int `json:"searchInlineSchemaMax"`
	// CallBridge controls the tool_call bridge: on | off (default on). With
	// reveal + inline schemas, searched tools are directly callable by name, so
	// off drops the redundant bridge from the model's tool list.
	CallBridge string   `json:"callBridge"`
	EagerTools []string `json:"eagerTools,omitempty"`
	DeferTools []string `json:"deferTools,omitempty"`
}

DisclosureConfig controls progressive tool disclosure only.

func (DisclosureConfig) Normalize

func (c DisclosureConfig) Normalize() DisclosureConfig

func (*DisclosureConfig) SetDefaults added in v0.3.48

func (c *DisclosureConfig) SetDefaults()

SetDefaults implements pluginkit.Defaulter.

func (*DisclosureConfig) Validate added in v0.3.48

func (c *DisclosureConfig) Validate() error

Validate implements pluginkit.Validator.

type EnabledSetting

type EnabledSetting string

EnabledSetting controls when deferred bridges replace deferrable tools.

const (
	EnabledOff  EnabledSetting = "off"
	EnabledOn   EnabledSetting = "on"
	EnabledAuto EnabledSetting = "auto"
)

func (*EnabledSetting) UnmarshalJSON

func (e *EnabledSetting) UnmarshalJSON(data []byte) error

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime wraps tools/runtime with progressive disclosure for dynamic tools.

func (*Runtime) Execute

func (d *Runtime) Execute(ctx context.Context, call agentkit.ToolCall) (agentkit.ToolResult, error)

func (*Runtime) PreflightTool added in v0.3.55

PreflightTool implements agentkit.ToolBatchRuntime. Bridge tools (tool_search / tool_describe / tool_call) exist only in this wrapper — the inner runtime catalog has no such names, so delegating their preflight would deny them with "tool not found". Bridges are catalog-level operations handled entirely here during preflight (runBody=false); policy/hooks for the real tool behind tool_call still run inside inner.Execute. Eager tools and revealed deferred tools (called directly after search) delegate to the inner preflight pipeline unchanged.

func (*Runtime) RunToolBody added in v0.3.55

func (d *Runtime) RunToolBody(ctx context.Context, call agentkit.ToolCall) (agentkit.ToolResult, error)

func (*Runtime) Visible

func (d *Runtime) Visible(ctx context.Context) ([]agentkit.ToolSpec, error)

Jump to

Keyboard shortcuts

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