wasm

package
v0.32.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package wasm is the wazero-backed sandbox for agent-generated Go snippets. Boots an embedded Yaegi runner compiled for GOOS=wasip1; the host instantiates a fresh module per call and feeds the snippet source through stdin. Result envelope arrives on stdout after a sentinel that separates it from any user-emitted output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend implements sandbox.Sandbox by routing Go snippets through an embedded Yaegi-on-Wasm runner. Holds one wazero.Runtime + compiled module for the life of the backend; per-Exec instantiates a fresh wasm module so snippets cannot share state.

func (*Backend) Capabilities

func (b *Backend) Capabilities() sandbox.CapabilitySet

Capabilities reports the wasm backend's enforcement reach.

func (*Backend) Close

func (b *Backend) Close() error

Close releases the wazero runtime + compiled module.

func (*Backend) Exec

Exec runs the snippet inside a fresh wasm instance.

Directories

Path Synopsis
Package host implements the wasm host module that backs the nexus_sdk/* snippet API.
Package host implements the wasm host module that backs the nexus_sdk/* snippet API.

Jump to

Keyboard shortcuts

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