Documentation
¶
Index ¶
- Constants
- func IsBridge(name string) bool
- func New(cfg Config, deps Deps) (agentkit.ToolRuntime, error)
- type Config
- type Deps
- type DisclosureConfig
- type EnabledSetting
- type Runtime
- func (d *Runtime) Execute(ctx context.Context, call agentkit.ToolCall) (agentkit.ToolResult, error)
- func (d *Runtime) PreflightTool(ctx context.Context, call agentkit.ToolCall) (agentkit.ToolResult, agentkit.ToolCall, bool, error)
- func (d *Runtime) RunToolBody(ctx context.Context, call agentkit.ToolCall) (agentkit.ToolResult, error)
- func (d *Runtime) Visible(ctx context.Context) ([]agentkit.ToolSpec, error)
Constants ¶
const ( ToolSearch = "tool_search" ToolDescribe = "tool_describe" ToolCall = "tool_call" )
Variables ¶
This section is empty.
Functions ¶
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) SetDefaults ¶ added in v0.3.48
func (c *Config) SetDefaults()
SetDefaults implements pluginkit.Defaulter.
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"`
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) PreflightTool ¶ added in v0.3.55
func (d *Runtime) PreflightTool(ctx context.Context, call agentkit.ToolCall) (agentkit.ToolResult, agentkit.ToolCall, bool, error)
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.