Skip to content
This page was generated and translated with the assistance of AI. If you spot any inaccuracies, feel free to help improve it. Edit on GitHub

Plugin Architecture ​

The PRX plugin system is built on a WASM runtime that provides a secure, portable execution environment for third-party code. This page describes the technical architecture.

Runtime ​

PRX uses the Wasmtime runtime to execute WASM plugins. Each plugin instance runs in its own WASM store with isolated linear memory.

┌──────────────────────────────┐
│         PRX Host             │
│                              │
│  ┌────────────────────────┐  │
│  │    WASM Runtime         │  │
│  │  ┌──────┐  ┌──────┐   │  │
│  │  │Plugin│  │Plugin│   │  │
│  │  │  A   │  │  B   │   │  │
│  │  └──┬───┘  └──┬───┘   │  │
│  │     │         │        │  │
│  │  Host Functions API    │  │
│  └────────────────────────┘  │
└──────────────────────────────┘

Host-Guest Boundary ​

Plugins communicate with the host through a defined set of host functions. The boundary enforces:

  • Type safety -- all function parameters are validated
  • Resource limits -- memory and CPU usage are capped
  • Permission checks -- each host function call is authorized against the plugin's permission manifest

Memory Model ​

Each plugin has its own linear memory space (default 64 MB). Data is exchanged between host and guest through shared memory buffers with explicit serialization.

Plugin Lifecycle ​

  1. Load -- WASM binary is loaded and validated
  2. Initialize -- plugin's init() function is called with configuration
  3. Ready -- plugin registers its capabilities (tools, channels, etc.)
  4. Execute -- host invokes plugin functions as needed
  5. Shutdown -- plugin's shutdown() function is called for cleanup

Released under the Apache-2.0 License.