Defines the host<->guest wire contract for the .so -> wazero migration as a repo-local buf module (abi/proto/v1, generated Go in abi/v1): - manifest.proto: PluginManifest mirroring every static field of plugin.PluginRegistration (abi_version, deps, block/template registrations, admin pages, settings schema, theme presets, fonts, master pages, AI actions, RBAC method roles, CSS manifest, icon packs, directory extensions, job types, RAG fetcher types, settings panel, hook flags, core service bindings) - invoke.proto: bn_invoke envelope, Hook catalog (RENDER_BLOCK, RENDER_TEMPLATE, HANDLE_HTTP, JOB, LOAD, UNLOAD, RAG_FETCH, MEDIA_HOOK, DESCRIBE), AbiError, and job/lifecycle/rag/media/describe payloads - render.proto: RenderBlock/RenderTemplate payloads + RenderContext enumerating every ctx value from blocks/context.go (incl. BlockContext 1:1) - http.proto: buffered HttpRequest/HttpResponse for HANDLE_HTTP - db.proto: guest sql-driver messages (DbValue oneof over pgx-mappable types, query/exec/tx with host-side tx handles, SQLSTATE-carrying DbError) - capability.proto: HostCall envelope + one request/response pair per CoreServices interface method (content, settings+update, gating, crypto, menus, datasources, users, subscriptions, media.deposit, email.send, ai.text_call, ai.tools.register, bridge, jobs.submit, embeddings, rag, reviews, badges.refresh) The abi/ buf module is deliberately separate from the repo-root config: proto/ is the shared block/proto submodule (service API contracts); the ABI is SDK-internal and versions in lockstep with the guest shim. New `make abi` target runs buf lint + generate. docs/wasm-abi.md documents the ptr+len calling convention (bn_alloc, bn_invoke, packed u64), hook catalog, error semantics, abi_version evolution rules, and the full registration/ CoreServices coverage tables. Verified: `cd abi && buf lint` exit 0; `go build ./...` exit 0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
BlockNinja Plugin SDK
Types, interfaces, and utilities for building BlockNinja plugins.
Package Structure
| Package | Purpose |
|---|---|
plugin/ |
PluginRegistration, CoreServices, RegisterFunc |
blocks/ |
BlockMeta, BlockFunc, BlockRegistry interface, BlockContext |
blocks/builtin/ |
Reusable block implementations (HTMLBlock) |
templates/ |
TemplateRegistry interface |
templates/bn/ |
Shared templ components (head, engagement, toolbar) |
auth/ |
Claims types, context extractors |
content/ |
Content access interface |
settings/ |
Settings access interface |
gating/ |
Access gating evaluation |
crypto/ |
Encrypt/Decrypt interface |
render/ |
Rich text rendering utilities |
video/ |
Video embed URL parsing |
ai/ |
AI tool registry interface and types |
rbac/ |
Role type definition |
Usage
import "git.dev.alexdunmow.com/ninja/core/plugin"
Description
Languages
Go
83.5%
templ
15.5%
Makefile
1%