Skip to main content

Module plugins

Module plugins 

Source
Expand description

Plugin system for spool.

This module provides a stable extension point for the (future) Pro version. The open-source build always returns an empty PluginRegistry — Pro builds will dynamically load .dylib/.so/.dll files from ~/.spool/plugins/.

§Design goals

  1. Zero overhead in OSS build — no plugin loading code path is taken when no plugins are installed.
  2. License boundary — plugins are independent dynamic libraries with their own license, never compiled into the OSS binary.
  3. Stable interface — the MemoryPlugin trait is the public API contract; Pro plugins are written against this.

§Future Pro version flow

User installs Spool-Pro.dmg
  → Drops `team-sync.dylib` into ~/.spool/plugins/
  → Writes ~/.spool/license.json
  → Spool detects plugins on next start, loads them
  → Team features become available

The OSS code is untouched. The load_from_dir function below currently returns an empty registry; the Pro distribution will replace this binary with one that includes a real loader (or use libloading).

Structs§

PluginRegistry
Plugin registry. The OSS build always constructs an empty registry; the Pro build will populate it from ~/.spool/plugins/.

Traits§

MemoryPlugin
Stable plugin interface. Pro plugins implement this trait and export a registration function via C ABI.