Versions in this module Expand all Collapse all v0 v0.72.0 Dec 1, 2026 Changes in this version + const Arg + const MaxMessageBytes + const MemoryLimitEnforced + const MinMemoryLimit + var ErrCrashed = errors.New("script sandbox crashed") + var ErrMemoryLimitExceeded = errors.New("script exceeded its memory limit") + var ErrMessageTooLarge = fmt.Errorf("sandbox message is larger than %d MiB", MaxMessageBytes >> 20) + func DecodeData(raw json.RawMessage) (any, error) + func DecodeValue(raw json.RawMessage) (any, error) + func EncodeData(data map[string]any) (json.RawMessage, error) + func EncodeValue(v any) (json.RawMessage, error) + func LimitMemory(limit uint64) error + type Call struct + Arguments json.RawMessage + ID uint64 + Name string + type CallFunc func(ctx context.Context, name string, args map[string]any) (json.RawMessage, error) + type Client struct + func NewClient(conn *Conn) *Client + func (c *Client) Call(ctx context.Context, name string, args map[string]any) (json.RawMessage, error) + func (c *Client) Run(onClose func()) + type Conn struct + func NewConn(r io.Reader, w io.Writer) *Conn + func (c *Conn) Receive() (*Message, error) + func (c *Conn) Send(msg *Message) error + type Done struct + Error string + Result json.RawMessage + Stats Stats + StepLimit bool + func Run(ctx context.Context, memoryLimit uint64, start *Start, call CallFunc) (*Done, error) + func Serve(ctx context.Context, conn *Conn, start *Start, call CallFunc) (*Done, error) + type Message struct + Call *Call + Done *Done + Reply *Reply + Start *Start + type Reply struct + Error string + ID uint64 + Result json.RawMessage + type Start struct + Data json.RawMessage + ParallelMax int + Script string + StepLimit uint64 + Tools []ToolInfo + type Stats struct + ParallelCalls int + ParallelTasks int + Steps uint64 + type ToolInfo struct + Description string + Name string