Summary
Ship the official Go SDK (sdk-go) for plugin authors. TinyGo-targeted build. Provides: hook.AddAction/hook.AddFilter, typed host calls (db.Query, kv.Get, http.Fetch, ...), the hook_handler entry-point glue, msgpack codec, manifest synthesizer.
Target build command: tinygo build -target=wasi -o server/plugin.wasm ./. Bundle base size goal: ~300KB. Cold-start goal: ~10ms.
Design reference
docs/02-plugin-system.md §9.1, §9.4
Acceptance criteria
Module path github.com/gonext/sdk-go
hook.AddAction(name, priority, fn) / hook.AddFilter(name, priority, fn) developer surface; fn signature reflected to typed args
Generic hook_handler WASM export auto-generated by SDK; dispatches by name to registered handlers
Host-call wrappers: host.DB.Query(sql, args...) ([]Row, error), host.KV.Get/Set/Del, host.HTTP.Fetch(req) (*Response, error), host.Log.Info/Warn, host.Time.Now(), host.Secrets.Get(key), etc. — one per capability
Msgpack codec (TinyGo-compatible, avoid reflection-heavy libs): generates per-type pack/unpack via go:generate or use a tinygo-friendly library
//go:wasmexport init and func main() {} (required by TinyGo)
gonext manifest gen subcommand: synthesizes manifest.json from code annotations (//gonext:capability db.read core.posts) + a gonext.toml config
Tests via the SDK test harness (separate issue): trivial filter, action, host-call round-trip; reproducible WASM build
Documentation: Hello World + reference for each host API; recommended project layout
Dependencies
#85 (host ABI), #95 (hook handler)
Complexity
L
Summary
Ship the official Go SDK (
sdk-go) for plugin authors. TinyGo-targeted build. Provides:hook.AddAction/hook.AddFilter, typed host calls (db.Query,kv.Get,http.Fetch, ...), thehook_handlerentry-point glue, msgpack codec, manifest synthesizer.Target build command:
tinygo build -target=wasi -o server/plugin.wasm ./. Bundle base size goal: ~300KB. Cold-start goal: ~10ms.Design reference
Acceptance criteria
github.com/gonext/sdk-gohook.AddAction(name, priority, fn)/hook.AddFilter(name, priority, fn)developer surface; fn signature reflected to typed argshook_handlerWASM export auto-generated by SDK; dispatches by name to registered handlershost.DB.Query(sql, args...) ([]Row, error),host.KV.Get/Set/Del,host.HTTP.Fetch(req) (*Response, error),host.Log.Info/Warn,host.Time.Now(),host.Secrets.Get(key), etc. — one per capabilitygo:generateor use a tinygo-friendly library//go:wasmexport initandfunc main() {}(required by TinyGo)gonext manifest gensubcommand: synthesizesmanifest.jsonfrom code annotations (//gonext:capability db.read core.posts) + agonext.tomlconfigDependencies
#85 (host ABI), #95 (hook handler)
Complexity
L