Skip to content

Repository files navigation

@escalated-dev/plugin-runtime

TestsNode.jsTypeScriptLicense: MIT

Runtime host for Escalated plugins. Loads plugins built with the Plugin SDK and communicates with the host framework (Laravel, Rails, Django, AdonisJS) via JSON-RPC 2.0 over stdio.

escalated.dev — Learn more, view demos, and compare Cloud vs Self-Hosted options.

Installation

npm install @escalated-dev/plugin-runtime

This package is installed alongside any SDK plugins you want to use. The host framework's bridge spawns it automatically — you do not need to run it manually.

Usage

The runtime is started by the framework bridge (e.g., escalated-laravel, escalated-rails, escalated-django). You typically do not invoke it directly. The bridge spawns it as:

node node_modules/@escalated-dev/plugin-runtime/dist/index.js

Architecture

The runtime is a long-lived Node.js process that:

  1. Discovers and loads installed plugins from node_modules/@escalated-dev/plugin-*
  2. Responds to JSON-RPC messages from the host framework
  3. Routes hooks (actions, filters) to registered plugin handlers
  4. Proxies ctx.* calls back to the host for data operations
Host Framework (PHP/Ruby/Python) Plugin Runtime (Node.js)
┌──────────────────────────┐ stdio ┌──────────────────────────┐
│ Bridge │◄──────────►│ @escalated-dev/ │
│ - spawns subprocess │ JSON- │ plugin-runtime │
│ - dispatches hooks │ RPC 2.0 │ ┌────────────────────┐ │
│ - handles ctx.* calls │ │ │ plugin-slack │ │
│ │ │ │ plugin-jira │ │
│ │ │ │ your-custom-plugin │ │
└──────────────────────────┘ │ └────────────────────┘ │
└──────────────────────────┘

Resilience

  • Spawned lazily on first hook dispatch
  • Automatic restart with exponential backoff if the process crashes
  • Action hooks degrade gracefully when the runtime is unavailable
  • Filter hooks return unmodified values when the runtime is down

Broadcasting Event Forwarding

When the host framework has real-time broadcasting enabled, the runtime automatically forwards broadcasting events to plugins. The bridge sends these as standard action hooks (e.g., broadcast.ticket.updated, broadcast.ticket.replied) so plugins can react to real-time events without any additional configuration. See the Plugin SDK README for the full list of broadcastable events.

Protocol

Communication uses JSON-RPC 2.0 over stdin/stdout. See the Plugin SDK docs for the full protocol specification.

Related Packages

License

MIT

About

Runtime host for Escalated plugins — JSON-RPC subprocess bridge

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages