Repository navigation
docs: document the closed forwarded-event surface for browser plugin halves (emit vs waterfall) #5897
Replies: 1 comment
|
I built the same kind of browser-half plugin and hit the identical wall — Confirmed against master (c389f96):
The exact "two closures":
On the emit vs waterfall trap — your read is exactly right. Support for the docs page — your proposed structure is good and the placement under |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Out-of-tree ("bundle") plugins that ship a browser half have no documentation in the extension path (
docs/user/develop/*,docs/cookbook/*) describing which Host events actually reach the browser, that the set is closed, and the emit-vs-waterfall semantic trap. The only source of truth is an internal package README (packages/api/remotes/README.md→API_REMOTE_FORWARDED_EVENTS), which is not discoverable from the authoring guides.Why it matters
We built a plugin whose browser half blinks the tab title when a workspace finishes / errors / waits for the user. Two of our first three attempts failed because the authoring docs do not state:
ctx.remote.$on(...)events listed inAPI_REMOTE_FORWARDED_EVENTS(indsh-api-remotes) reach the browser. A plugin cannot add a host→client channel (e.g.ctx.emit('my-custom-event')on the host is never forwarded) — that requires the internal Typert toolchain.emitevents are broadcast to every listener;waterfallevents (e.g.user-questions/request,approval/request) are single-consumer and claimed by the official answerers in registration order, so a passive observer can silently lose them.Suggested documentation
A page under
docs/user/develop/(or the extension cookbook) titled roughly "Observing Host state from a browser plugin", covering:packages/api/remotes,src/remote-events.ts).emitvswaterfalldelivery difference and its consequence for passive observers../types, cross-linked).Environment
@deepseek-ai/dsh0.1.2-rc.1 (and current main at time of writing).All reactions