joao-paulo-santos/dsh-event-relay0

dsh-event-relay

事件中继:将主机端通知推送至已订阅浏览器界面的单 SSE 通道

AI 分析

核心用途是实现宿主到浏览器的单向事件推送。适合需要实时同步状态、接收后台通知的 DSH 插件开发者。

包名
dsh-event-relay
版本
0.2.0
最近更新
2026年8月24日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:joao-paulo-santos/dsh-event-relay

dsh-event-relay

The ONE host→browser push channel for DSH plugins: a single SSE route (/relay/events) that holds every subscriber's response open and streams JSON frames {"topic","payload"} as things happen.

Producers (host plugins)

const relay = ctx.get('eventRelay')            // optional — degrade if absent
relay.publish('my-topic', payload)             // direct
relay.forward('my/event')                      // tap an existing Cordis event (idempotent)

Consumers (browser bundles)

const relay = ctx.get('eventRelay')            // provided by this package's client half
const off = relay.subscribe('kanban', (topic, payload) => { ... })  // prefix match
// or raw: new EventSource('/relay/events?topics=kanban,notifications')

Design

Transport, not a bus: Cordis events remain the host-side event system; this only carries them across the plane boundary. Liveness, not correctness — consumers should fall back to pull-on-focus when the relay is absent. Route roots are composition-level contracts (/api, /plugins, /workspace-history, /notifications, /granular-settings are taken).