Repository navigation
v2.1.0
Brainstem on npm, with plugins as npm packages. The app installs with npm install -g @brainstem-dev/brainstem. Every plugin, the built-ins included, is its own package that can be installed, pinned, updated and removed, and third-party plugins work the same way. See Plugins and ADR-0010.
Upgrading:
- Nothing to change for existing installs. Configs with paths (
./plugins/matrix/index.mjs) keep working, Docker images contain every built-in plugin as before, and no migrations run. - The npm package is
@brainstem-dev/brainstem(the@jurrebuunk/brainstemname was never published). - The app's npm package no longer contains the plugins. After
npm install -g @brainstem-dev/brainstem, runbrainstem initto install them.
Changes:
- Plugins are npm packages:
@brainstem-dev/plugin-<name>for each of the 11 built-ins, each with its own dependencies. IMAP libraries now come only with email-imap, and the agentOS runtime only with agentos-runner. brainstem initcreatesbrainstem.config.mjsand the plugin folder, then installs the default plugins. These are http-health, tls-certificate, github-issues, log-file, static-observations, http-json, log-decisions and matrix.brainstem plugins list|add|remove|updatemanages the plugin folder (--plugins-dir,BRAINSTEM_PLUGINS_DIR, default./brainstem-plugins) with npm. It takes any npm spec, and built-ins can be given by short name (brainstem plugins add email-imap). Installed packages are checked to load as plugins, and rolled back when they don't.- The config names plugins by package (
module: "@brainstem-dev/plugin-matrix"). The loader looks in the plugin folder, next to the working directory, then next to Brainstem, and honoursexports/main. Local files and the built-ins' old paths still work. A missing package's error says how to install it. @brainstem-dev/sdkis the plugin API as its own package with no dependencies: defining and validating plugins,createObservation, contexts and plugin state. Its test kit (@brainstem-dev/sdk/testing:runInput,runDestination,createTestOutput) runs a plugin the way the runtime does.- Publishing: the
npmworkflow publishes all packages from the release tag with provenance, through npm trusted publishing after the first release (scripts/npm-publish.mjs, release checklist). - CI runs a packaging smoke test (
scripts/npm-smoke.mjs). It publishes every package to a throwaway local registry, installs the app globally, runsbrainstem init, removes and adds plugins, polls, and serves the Web UI. - The npm package includes the prebuilt Web UI (
brainstem --role web). - email-imap:
mailparser3.14, which fixes thenodemaileradvisories.npm auditreports no vulnerabilities in runtime dependencies.