Skip to content

History / Debugging Plugins zh

Revisions

  • docs(debugging): the probe driver now matches the twelve-argument load `PluginEngine::load(&path, allowlist, cwd, allow_fs, allow_net)` has not compiled since v0.12: it takes twelve arguments, one per gate, plus a store root, the plugin's identity (the `.wasm` stem, as the host derives it) and the events grant. A driver that does not compile is worse than no driver, since the reader assumes their plugin is at fault. Gates move into a struct: ten arguments, four of them bool, is one transposition away from testing a gate you did not mean to open. Adds a `deliver_event` probe, and the three ways a probe differs from a session: the store root points at a temp dir so it cannot clobber the real store, host-notify goes straight to stderr with no drain loop, and host-call-tool / host-send-user-message refuse regardless of the grant because both are wired up by an agent the probe does not have. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

    Dev committed Sep 7, 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