codemode

package
v0.2.69 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 30 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 CallLine added in v0.2.59

func CallLine(ctx context.Context) (number int, code string)

func Decoded added in v0.2.59

func Decoded(v starlark.Value) starlark.Value

func Format added in v0.2.48

func Format(source string) (string, error)

func FreeNames added in v0.2.59

func FreeNames(source string) ([]string, error)

func HostResult added in v0.2.59

func HostResult(tool string, value starlark.Value, err error) starlark.Value

func IsFailure added in v0.2.59

func IsFailure(v starlark.Value) bool

func ResultAttr added in v0.2.59

func ResultAttr(v starlark.Value, failure *Error, name string) (starlark.Value, bool)

func ResultAttrNames added in v0.2.59

func ResultAttrNames(extra ...string) []string

func Run

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

func SanitizeTool

func SanitizeTool(mcpToolName string) string

func StarlarkName

func StarlarkName(server, mcpToolName string) string

Types

type CallDetails added in v0.2.59

type CallDetails interface {
	Details(args map[string]any) starlark.StringDict
}

type CallFunc

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

type DecideFunc

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

type Error added in v0.2.59

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

func NewFailure added in v0.2.59

func NewFailure(tool, message string, details starlark.StringDict) *Error

func (*Error) Attr added in v0.2.59

func (e *Error) Attr(name string) (starlark.Value, error)

func (*Error) AttrNames added in v0.2.59

func (e *Error) AttrNames() []string

func (*Error) CallInternal added in v0.2.59

func (e *Error) CallInternal(*starlark.Thread, starlark.Tuple, []starlark.Tuple) (starlark.Value, error)

func (*Error) CompareSameType added in v0.2.59

func (e *Error) CompareSameType(op syntax.Token, y starlark.Value, _ int) (bool, error)

func (*Error) Freeze added in v0.2.59

func (e *Error) Freeze()

func (*Error) Hash added in v0.2.59

func (e *Error) Hash() (uint32, error)

func (*Error) MarshalJSON added in v0.2.59

func (e *Error) MarshalJSON() ([]byte, error)

func (*Error) Message added in v0.2.59

func (e *Error) Message() string

func (*Error) Name added in v0.2.59

func (e *Error) Name() string

func (*Error) Ok added in v0.2.59

func (e *Error) Ok() bool

func (*Error) String added in v0.2.59

func (e *Error) String() string

func (*Error) Tool added in v0.2.59

func (e *Error) Tool() string

func (*Error) Truth added in v0.2.59

func (e *Error) Truth() starlark.Bool

func (*Error) Type added in v0.2.59

func (e *Error) Type() string

type File added in v0.2.59

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

func ArgFile added in v0.2.59

func ArgFile(ctx context.Context, sha256 string) (*File, bool)

func NewFile added in v0.2.59

func NewFile(spec FileSpec) *File

func (*File) Attr added in v0.2.59

func (f *File) Attr(name string) (starlark.Value, error)

func (*File) AttrNames added in v0.2.59

func (f *File) AttrNames() []string

func (*File) CompareSameType added in v0.2.59

func (f *File) CompareSameType(op syntax.Token, y starlark.Value, _ int) (bool, error)

func (*File) Content added in v0.2.59

func (f *File) Content() string

func (*File) Dimensions added in v0.2.59

func (f *File) Dimensions() (width, height int, ok bool)

func (*File) Freeze added in v0.2.59

func (f *File) Freeze()

func (*File) Hash added in v0.2.59

func (f *File) Hash() (uint32, error)

func (*File) MarshalJSON added in v0.2.59

func (f *File) MarshalJSON() ([]byte, error)

func (*File) Mime added in v0.2.59

func (f *File) Mime() string

func (*File) Name added in v0.2.59

func (f *File) Name() string

func (*File) Ok added in v0.2.59

func (f *File) Ok() bool

func (*File) SHA256 added in v0.2.59

func (f *File) SHA256() string

func (*File) Size added in v0.2.59

func (f *File) Size() int

func (*File) Source added in v0.2.59

func (f *File) Source() string

func (*File) String added in v0.2.59

func (f *File) String() string

func (*File) Truth added in v0.2.59

func (f *File) Truth() starlark.Bool

func (*File) Type added in v0.2.59

func (f *File) Type() string

type FileSpec added in v0.2.59

type FileSpec struct {
	Name, Mime string
	Content    string
	Source     string
}

type HostTool

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

type Match added in v0.2.59

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

func NewMatch added in v0.2.59

func NewMatch(path string, line int, text string) *Match

func (*Match) Attr added in v0.2.59

func (m *Match) Attr(name string) (starlark.Value, error)

func (*Match) AttrNames added in v0.2.59

func (m *Match) AttrNames() []string

func (*Match) Freeze added in v0.2.59

func (m *Match) Freeze()

func (*Match) Hash added in v0.2.59

func (m *Match) Hash() (uint32, error)

func (*Match) MarshalJSON added in v0.2.59

func (m *Match) MarshalJSON() ([]byte, error)

func (*Match) Ok added in v0.2.59

func (m *Match) Ok() bool

func (*Match) String added in v0.2.59

func (m *Match) String() string

func (*Match) Truth added in v0.2.59

func (m *Match) Truth() starlark.Bool

func (*Match) Type added in v0.2.59

func (m *Match) Type() string

type NoDetails added in v0.2.59

type NoDetails struct{}

func (NoDetails) Details added in v0.2.59

func (NoDetails) Details(map[string]any) starlark.StringDict

type Result added in v0.2.59

type Result interface {
	String() string
	Type() string
	Freeze()
	Truth() starlark.Bool
	Hash() (uint32, error)
	Ok() bool
}

type TextValue added in v0.2.59

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

func NewText added in v0.2.59

func NewText(kind, content string, attrs starlark.StringDict, data json.RawMessage) *TextValue

func (*TextValue) Attr added in v0.2.59

func (t *TextValue) Attr(name string) (starlark.Value, error)

func (*TextValue) AttrNames added in v0.2.59

func (t *TextValue) AttrNames() []string

func (*TextValue) Binary added in v0.2.59

func (t *TextValue) Binary(op syntax.Token, y starlark.Value, side starlark.Side) (starlark.Value, error)

func (*TextValue) CompareSameType added in v0.2.59

func (t *TextValue) CompareSameType(op syntax.Token, y starlark.Value, depth int) (bool, error)

func (*TextValue) Freeze added in v0.2.59

func (t *TextValue) Freeze()

func (*TextValue) Hash added in v0.2.59

func (t *TextValue) Hash() (uint32, error)

func (*TextValue) Index added in v0.2.59

func (t *TextValue) Index(i int) starlark.Value

func (*TextValue) Len added in v0.2.59

func (t *TextValue) Len() int

func (*TextValue) MarshalJSON added in v0.2.59

func (t *TextValue) MarshalJSON() ([]byte, error)

func (*TextValue) Ok added in v0.2.59

func (t *TextValue) Ok() bool

func (*TextValue) Slice added in v0.2.59

func (t *TextValue) Slice(start, end, step int) starlark.Value

func (*TextValue) String added in v0.2.59

func (t *TextValue) String() string

func (*TextValue) Truth added in v0.2.59

func (t *TextValue) Truth() starlark.Bool

func (*TextValue) Type added in v0.2.59

func (t *TextValue) Type() string

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