Documentation
¶
Overview ¶
Package tools exposes risk-gated connection routes as agent tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfirmRequest ¶
type ConfirmRequest struct {
ToolCallID string
ToolName string
RouteID string
Risk plugin.RiskLevel
Destructive bool
Params map[string]string
Body map[string]any
}
ConfirmRequest describes a pending write/destructive tool call awaiting the user's decision.
type Confirmer ¶
type Confirmer interface {
Confirm(ctx context.Context, req ConfirmRequest) (bool, error)
}
Confirmer asks the user to approve a mutation before it runs. It returns true to proceed, false to decline. Reads never reach a confirmer.
type Invoker ¶
type Invoker interface {
InvokeRoute(ctx context.Context, user models.User, connID, routeID string, params map[string]string, body []byte) (any, error)
}
Invoker runs a route as the user through the secure pipeline.
type RouteSource ¶
RouteSource enumerates a protocol's routes (satisfied by *plugin.Registry).
type ToolSet ¶
type ToolSet struct {
// contains filtered or unexported fields
}
ToolSet is the risk-gated tool catalogue for one connection. It implements engine.ToolExecutor.
func Build ¶
func Build(src RouteSource, protocol string, allowed map[plugin.RiskLevel]bool, invoker Invoker, user models.User, connID string) (*ToolSet, error)
Build produces tools from allowed, non-streaming protocol routes.
func (*ToolSet) WithConfirmer ¶
WithConfirmer attaches a confirmer that gates write/destructive tool calls.