Versions in this module Expand all Collapse all v1 v1.5.0 Oct 17, 2026 v1.4.0 Oct 17, 2026 v1.3.1 Oct 16, 2026 v1.3.0 Oct 15, 2026 Changes in this version + const AnyPlatform + const NativeABI + var ErrNativeABI = errors.New("plugin: native call failed") + var ErrNativeExited = errors.New("plugin: native plugin exited") + var NativeLimits = Limits + var Platforms = []string + var ScriptLimits = Limits + func CompareVersions(a, b string) int + func FileSHA256(path string) (string, error) + func IsNativeFailure(err error) bool + func LibraryName() string + func PlatformKey() string + func ServeNative(args []string, stdin io.Reader, stdout, stderr io.Writer) int + func ServeNativeWith(args []string, stdin io.Reader, stdout, stderr io.Writer, open NativeOpener) int + type Artifact struct + SHA256 string + Size int64 + URL string type InvocationKind + const KindTranslate + type Limits struct + File int64 + Total int64 type Manifest + Capabilities []string + Native *NativeSpec + func (m Manifest) IsNative() bool + type NativeCall func(method string, req []byte) ([]byte, error) + type NativeError struct + Code string + Message string + Retryable bool + func (e *NativeError) Error() string + type NativeOpener func(path string, hostABI uint32) (NativeCall, error) + func FakeNativeOpener(stderr io.Writer) NativeOpener + type NativeOptions struct + Command []string + Env []string + Idle time.Duration + Library string + OnStart func(ctx context.Context, ...) error + Redact func(string) string + SHA256 string + Timeout time.Duration + type NativeProcess struct + func NewNativeProcess(o NativeOptions) *NativeProcess + func (n *NativeProcess) Call(ctx context.Context, method string, params any) (json.RawMessage, error) + func (n *NativeProcess) Close() + func (n *NativeProcess) Start(ctx context.Context) error + type NativeSpec struct + ABI uint32 type Plugin + func (p *Plugin) Translate(ctx context.Context, inv Invocation, req any) (any, error) + type Registry struct + Plugins []RegistryPlugin + Schema int + Updated time.Time + func CheckRegistry(data []byte) (Registry, error) + func ParseRegistry(data []byte) (Registry, error) + type RegistryPlugin struct + Homepage string + Name string + Releases []RegistryRelease + Summary Text + Title Text + Unsupported []RegistryRelease + func (p RegistryPlugin) Pick(platform, appVersion string) (RegistryRelease, Artifact, string) + type RegistryRelease struct + Artifacts map[string]Artifact + Manifest json.RawMessage + MinGodwit string + Parsed Manifest + Version string v1.1.0 Oct 15, 2026 v1.0.1 Oct 14, 2026 v1.0.0 Oct 13, 2026 v0 v0.3.0 Oct 13, 2026 v0.2.0 Oct 12, 2026 v0.1.0 Oct 12, 2026 Changes in this version + const BuildDir + const EventBeforeSend + const EventReceived + const FetchTimeout + const MaxBodyBytes + const MaxFetchBody + const MaxFetchResponse + const MaxFileBytes + const MaxLLMBytes + const MaxQuestions + const MaxResultBytes + const MaxStorageTotal + const MaxStorageValue + const MaxTotalBytes + var ErrClosed = errors.New("plugin: closed") + var ErrMemoryLimit = errors.New("plugin: memory limit exceeded") + var ErrPermission = errors.New("plugin: permission denied") + var ErrTimeout = errors.New("plugin: call timed out") + var ErrTooLarge = errors.New("plugin: data too large") + func Build(dir, main string) ([]byte, error) + func BuildWith(c Compiler, dir, main string) ([]byte, error) + func EgressFor(kind InvocationKind, m Manifest, granted, holdsMail, scopeReadMail bool) (hosts []string, needsApproval bool) + func FailReason(err error) string + func HashDir(dir string) (string, error) + func HostPort(u *url.URL) string + func QuestionBytes(qs []Question) int + func ScrubPaths(s string) string + func Snapshot(src, dst string) (sourceHash string, err error) + type ActionInfo struct + ID string + Label Text + On []string + type Answer struct + Choice string + Name string + Probability *float64 + Refused bool + Score *float64 + type AttachmentMeta struct + Name string + Size int64 + Type string + type CallScope struct + func (c *CallScope) Async(fn func(ctx context.Context) (any, error)) goja.Value + func (c *CallScope) Context() context.Context + func (c *CallScope) Invocation() Invocation + func (c *CallScope) Runtime() *goja.Runtime + func (c *CallScope) VM() *VM + type Client struct + func NewClient(opts NetOptions) *Client + func (c *Client) Do(ctx context.Context, allowed []string, req FetchRequest) (FetchResponse, []Hop, error) + func (c *Client) Transport() *http.Transport + type Clock interface + AfterFunc func(d time.Duration, f func()) (stop func() bool) + type Compiler interface + Compile func(dir, main string) ([]byte, error) + Key func() string + var ESBuild Compiler = esbuildCompiler{} + type ConfigField struct + AllowCustom bool + Default json.RawMessage + Key string + Label Text + Options []Option + Required bool + Type string + When *When + func (f ConfigField) Accepts(v json.RawMessage) bool + type ConfigSnapshot struct + Err error + Values map[string]any + Version int64 + type DraftInput struct + AccountID int64 + Cc []string + HTML string + Subject string + To []string + type DraftUpdate struct + DraftID int64 + HTML string + Revision int64 + type FetchRequest struct + Body string + Headers map[string]string + Method string + URL string + type FetchResponse struct + Body string + Headers map[string]string + Status int + type Hop struct + Decision string + Dest string + Reason string + type Host interface + AuditEgress func(ctx context.Context, inv Invocation, dest, decision, reason string) error + Fetch func(ctx context.Context, inv Invocation, req FetchRequest) (FetchResponse, error) + LLMComplete func(ctx context.Context, prompt string) (string, error) + LLMDecide func(ctx context.Context, state string, qs []Question) ([]Answer, error) + MailCreateDraft func(ctx context.Context, d DraftInput) (int64, error) + MailGet func(ctx context.Context, id int64) (MailMessage, error) + MailMove func(ctx context.Context, ids []int64, folderID int64) error + MailSearch func(ctx context.Context, q string, limit int) ([]MailSummary, error) + MailSetFlags func(ctx context.Context, ids []int64, add, remove []string) error + MailUpdateDraft func(ctx context.Context, u DraftUpdate) (int64, error) + StorageDelete func(ctx context.Context, key string) error + StorageGet func(ctx context.Context, key string) (string, bool, error) + StorageSet func(ctx context.Context, key, value string) error + type Invocation struct + Approved bool + Config *ConfigSnapshot + EgressHosts []string + ID string + Kind InvocationKind + Unapproved bool + Write bool + type InvocationKind string + const KindAction + const KindBeforeSend + const KindCard + const KindHook + const KindInit + const KindTool + type MailMessage struct + Attachments []AttachmentMeta + Cc []string + Date time.Time + From string + HTML string + ID int64 + Subject string + Text string + To []string + Truncated bool + type MailSummary struct + Date time.Time + From string + ID int64 + Snippet string + Subject string + type Manifest struct + Config []ConfigField + Description Text + Main string + Name string + Permissions Permissions + Version string + func ParseManifest(data []byte, dirName string) (Manifest, error) + func (m Manifest) PermissionHash() string + type NetError struct + Host string + Reason string + func (e *NetError) Error() string + type NetOptions struct + AllowHTTP bool + AllowLoopback bool + Dial func(ctx context.Context, network, addr string) (net.Conn, error) + MaxBody int64 + Resolver interface{ ... } + Timeout time.Duration + UserAgent string + type Option struct + Label Text + Value string + type PermissionError struct + Perm string + func (e *PermissionError) Error() string + func (e *PermissionError) Is(target error) bool + type Permissions struct + LLM bool + Mail []string + Net []string + type Plugin struct + Name string + func Load(ctx context.Context, vm *VM, m Manifest, h Host, cfg *ConfigSnapshot) (*Plugin, error) + func (p *Plugin) Actions() []ActionInfo + func (p *Plugin) Card(ctx context.Context, inv Invocation, m MailMessage) (res any, matched bool, err error) + func (p *Plugin) Emit(ctx context.Context, inv Invocation, event string, args ...any) error + func (p *Plugin) EmitResult(ctx context.Context, inv Invocation, event string, args ...any) (any, error) + func (p *Plugin) Events() []string + func (p *Plugin) Handles(event string) bool + func (p *Plugin) HasCard() bool + func (p *Plugin) RunAction(ctx context.Context, inv Invocation, id string, target any) (any, error) + func (p *Plugin) RunTool(ctx context.Context, inv Invocation, name string, args any) (any, error) + func (p *Plugin) Tools() []ToolInfo + func (p *Plugin) VM() *VM + type Question struct + Choices []QuestionOption + Instructions string + Levels []QuestionOption + Name string + Type string + type QuestionOption struct + Description string + Value string + type Text struct + ByLang map[string]string + Default string + func (t *Text) UnmarshalJSON(b []byte) error + func (t Text) For(lang string) string + func (t Text) MarshalJSON() ([]byte, error) + type ToolInfo struct + Description string + Name string + Schema map[string]any + Write bool + type VM struct + func NewVM(name string, program *goja.Program, opts VMOptions) *VM + func (v *VM) Call(ctx context.Context, inv Invocation, fn func(c *CallScope) (any, error)) (any, error) + func (v *VM) Close() + func (v *VM) HostFunc(name string, fn func(c *CallScope, call goja.FunctionCall) goja.Value) goja.Value + func (v *VM) Init(ctx context.Context, inv Invocation, jsCtx func(c *CallScope) goja.Value) error + type VMOptions struct + Clock Clock + Redact func(string) string + Watchdog *Watchdog + type Watchdog struct + Clock Clock + Interval time.Duration + Meter func() uint64 + Threshold uint64 + func (w *Watchdog) Watch(v *VM, callID uint64) (release func()) + type When struct + Equals json.RawMessage + Key string + NotEquals json.RawMessage + func (w *When) Match(v json.RawMessage) bool