tools

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sha

func Sha(parts ...string) string

Sha returns a stable sha for the prompt parts the agent saw.

Types

type Ctx

type Ctx struct {
	DB    *db.DB
	DBDir string
	// AcceptedProposals[file_path] = sql
	AcceptedProposals map[string]string
}

Ctx carries the smig internals the tools need.

func New

func New(d *db.DB, dbDir string) *Ctx

func (*Ctx) Dispatch

func (c *Ctx) Dispatch(ctx context.Context, name string, input json.RawMessage) (any, error)

Dispatch runs the named tool. Returns a JSON-stringifiable result or an error.

func (*Ctx) Schemas

func (c *Ctx) Schemas() []ToolDef

Schemas returns the tool definitions for the Anthropic Messages API.

type ToolDef

type ToolDef struct {
	Name        string
	Description string
	InputSchema json.RawMessage
}

Jump to

Keyboard shortcuts

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