@opentag/dispatcher
v0.1.0
Published
Embeddable OpenTag dispatcher Hono app and callback sinks.
Maintainers
Readme
@opentag/dispatcher
Embeddable dispatcher service for OpenTag.
Use this package when you want to host the OpenTag dispatcher inside another Node or Hono-compatible service instead of running @opentag/dispatcher-app.
Install
pnpm add @opentag/dispatcherExports
createDispatcherApp: creates the Hono app that exposes the OpenTag dispatcher API.createGitHubCallbackSink: posts callback messages to GitHub issue or PR comments.createSlackCallbackSink: posts callback messages to Slack threads throughchat.postMessage.createCompositeCallbackSink: fans callback delivery out to multiple sinks.CallbackMessage,CallbackSink: callback delivery contracts.
Example
import {
createCompositeCallbackSink,
createDispatcherApp,
createGitHubCallbackSink,
createSlackCallbackSink
} from "@opentag/dispatcher";
export const dispatcher = createDispatcherApp({
databasePath: "opentag.db",
pairingToken: process.env.OPENTAG_PAIRING_TOKEN,
callbackSink: createCompositeCallbackSink([
createGitHubCallbackSink({ token: process.env.OPENTAG_GITHUB_TOKEN }),
createSlackCallbackSink({ botToken: process.env.OPENTAG_SLACK_BOT_TOKEN })
])
});API Shape
The app exposes /healthz and /v1/* dispatcher endpoints for runners, repository bindings, Slack channel bindings, runs, progress, heartbeats, completion, and audit event lookup.
When pairingToken is set, every /v1/* endpoint requires:
Authorization: Bearer <pairingToken>Stability
The Hono app factory and callback sink interfaces are public API. Individual HTTP endpoint semantics should remain backward compatible within a major version.
