eventslisted
Install: claude install-skill deeleeramone/PyWry
# PyWry Event System — Agent Reference
> **The event bus is the plumbing underneath every MCP tool.** You
> rarely need to think about it — the typed tools wrap emit + wait +
> state-poll for you — but when you reach for `send_event` or
> interpret tool results, this is how it works.
## Event names are namespaced
Every event has the form `namespace:event-name`, e.g.:
- `tvchart:symbol-search` — ask the chart to open symbol search
- `tvchart:state-response` — chart's reply with its current state
- `tvchart:data-request` — chart asks Python for bars
- `tvchart:data-response` — Python delivers bars
- `toolbar:request-state` — ask a toolbar component for its value
- `toolbar:state-response` — component's reply
- `chat:user-message` — user typed something
- `chat:ai-response` — model produced a token
- `pywry:update-theme` — dark/light mode change
Never emit an event with a name that doesn't match `namespace:event-name`
— the framework rejects it.
## Widget IDs vs component IDs
**widget_id** — identifies the top-level PyWry widget (a chart, a grid,
a chat panel, a dashboard). Every MCP tool takes `widget_id` as an
argument because all events route to the widget first.
**componentId** — identifies a child *inside* a widget (a specific
toolbar button, a marquee ticker slot, a chart pane). Component IDs
are scoped to their containing widget.
When you call `send_event(widget_id, event_type, data)`, the
`widget_id` picks the ta