codemode

package
v0.2.52 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultConcurrency = 16
	MaxConcurrency     = 64
)

Variables

This section is empty.

Functions

func BuildCatalog

func BuildCatalog(tools []ToolDesc) (map[string]ToolDesc, error)

func CallKey

func CallKey(ctx context.Context) string

func Format added in v0.2.48

func Format(source string) (string, error)

func Run

func Run(ctx context.Context, source string, tools []ToolDesc, decide DecideFunc, call CallFunc, host []HostTool) (string, error)

func SanitizeTool

func SanitizeTool(mcpToolName string) string

func StarlarkName

func StarlarkName(server, mcpToolName string) string

Types

type CallFunc

type CallFunc func(ctx context.Context, server, name string, args map[string]any) (string, error)

type DecideFunc

type DecideFunc func(ctx context.Context, subject string, args map[string]any) error

type HostTool

type HostTool struct {
	Name        string
	InputSchema map[string]any
	CallValue   func(ctx context.Context, args map[string]any) (starlark.Value, error)
}

type ToolDesc

type ToolDesc struct {
	Server, Name, Description string
	InputSchema               map[string]any
}

Jump to

Keyboard shortcuts

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