Skip to content

History / Plugin Development

Revisions

  • docs(plugin-dev): all nine imports, three worlds, and why the ladder needs stubs The world snippet listed three imports and one world, and the page then told the reader outright that plugins receive no lifecycle events. Both were true in v0.11 and neither is now. Adds the six remaining imports (with the two-string flattening the template did not need before), the linear ladder, and the consequence that trips people at build time: WIT cannot express an optional export, so `--world extension-events` means shipping `list-commands` / `execute-command` stubs. The host resolves those optionally — it is the guest-side `component new` that refuses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

    Dev committed Sep 7, 2026
  • docs: lifecycle hooks reference (EN + zh) Full reference for the eleven hook events in v0.11.0: trigger points, which can block or transform, the stdin/stdout wire protocol, matcher semantics per event, timeout-as-block, the four cumulative config files, and --no-hooks. Two runnable examples (PreToolUse guard, PostToolUse redaction). States explicitly that hooks and WASM plugins are separate mechanisms and that plugins receive no hook events; cross-links added on Plugin-Development and Configuration in both languages.

    Chris Zhang committed Sep 2, 2026
  • docs: bilingual plugin & configuration wiki (v0.11.0) Ten pages, English and Chinese, covering what the repo does not: writing a WASM plugin end to end, the capability gates, debugging a plugin without an LLM, and the two-layer config with its three merge behaviours. Content is from an actual walkthrough on Linux + wasmtime 19 — the template compiles, the build commands ran, and the gate outputs are pasted from real runs rather than inferred from the source. Things that cost time to discover and are now written down: - import returning a string takes a TRAILING ret_area out-param, while an export returns a pointer to the (ptr,len) pair. Getting it backwards fails at `wasm-tools component new`, not at runtime. - `~` in extensions.path expands to $HOME and ignores NANOPI_HOME. - extensions and hooks CONCATENATE across config layers; only scalars override. You cannot disable a global plugin from a project config. - the repo ships its own .nanopi/config.toml, which overrides global settings when you test from the repo root. - only imports you actually call survive LTO into the component world. Chinese pages additionally cover working behind a restricted network (crates.io index timeouts, --offline, mirror config, installing wasm32-wasip1 when rustup can't). The English pages deliberately omit all of it and use the standard commands. Every page states the version it was verified against and how to re-verify, since a wiki has no PR review to keep it honest. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

    @ChrisZhangJin ChrisZhangJin committed Aug 30, 2026