tools

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRuntime

func NewRuntime(cfg RuntimeConfig, deps RuntimeDeps) (agentkit.ToolRuntime, error)

NewRuntime registers tools/runtime: Tool orchestration: visibility, policy evaluation, hooks, execution, result capping.

Best practices:

  • Policies are the enforcement plane; hooks only observe and rewrite. Put a security rule in a policy.
  • The approval dep is consulted only for ask decisions, so it never sees an allowed or denied call.

func ResultText

func ResultText(result agentkit.ToolResult) string

Types

type Runtime

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

Runtime executes tools through the policy and approval pipeline.

func (*Runtime) Execute

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

func (*Runtime) Visible

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

type RuntimeConfig

type RuntimeConfig struct {
	// DefaultTimeoutSeconds is per-call timeout when a tool has no specific entry.
	DefaultTimeoutSeconds int `json:"defaultTimeoutSeconds"`
	// MaxResultBytes is truncation limit applied to every tool result.
	MaxResultBytes int `json:"maxResultBytes"`
	// ToolTimeouts are per-tool timeout overrides, keyed by tool name.
	ToolTimeouts map[string]int `json:"toolTimeouts,omitempty"`
}

type RuntimeDeps

type RuntimeDeps struct {
	Tools        []agentkit.Tool         `json:"tools,omitempty"`
	ToolPacks    []agentkit.ToolPack     `json:"toolPacks,omitempty"`
	DynamicTools []agentkit.ToolProvider `json:"dynamicTools,omitempty"`
	Policies     []agentkit.Policy       `json:"policies,omitempty"`
	Approval     agentkit.Approval       `json:"approval,omitempty"`
	Hooks        agentkit.HookRuntime    `json:"hooks,omitempty"`
}

Jump to

Keyboard shortcuts

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