Interface: InterceptorContext
The handle passed to each interceptor.
Example
Section titled “Example”import { appkit } from "@dbx-tools/appkit";
await appkit.createApp({ plugins: [server()], interceptor: (ctx) => { const portr = spawnPortr(ctx.env.databricksHost); ctx.bindProcess(portr); // app <-> portr live/die together ctx.onLifecycle("shutdown", () => portr.kill("SIGTERM")); },});Properties
Section titled “Properties”
readonlyenv:ResolvedAppEnv
The env auto-configuration computed before boot.
Methods
Section titled “Methods”bindProcess()
Section titled “bindProcess()”bindProcess(
child):void
Supervise a child process alongside the app, concurrently-style: signals pass through, and if EITHER the child or the app dies the whole set comes down. Safe to call for several children; teardown is idempotent.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
broadcastSignal()
Section titled “broadcastSignal()”broadcastSignal(
signal):void
Broadcast a termination signal from the main app to every bound process.
Called automatically when this process receives SIGINT/SIGTERM/SIGHUP;
exposed so an interceptor can trigger teardown itself.
Parameters
Section titled “Parameters”signal
Section titled “signal”Signals
Returns
Section titled “Returns”void
onLifecycle()
Section titled “onLifecycle()”onLifecycle(
event,fn):void
Subscribe to an AppKit lifecycle event. Mirrors PluginContext.onLifecycle;
the injected lifecycleBridge relays the real events here once the app
boots. A handler registered for an event that already fired is NOT called
retroactively (same semantics as AppKit).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void