opencode/packages/plugin-widgets
Sebastian Herrlinger 256ba026e4 feat(widgets): a native table node
ui.table(columns, rows, props) is a header and rows of text: columns with a label and an align (end for numbers),
rows of strings and numbers, an optional sort indicator and selected row. onPress(state, row) takes a row's press and
onSort(state, column) a header's (as change); the host walk sets selectable and sortable. widget-wire writes it as
type 17 with props 39 to 45, and widget-web walks it too. The web host draws an HTML table that scrolls sideways; the
TUI writes aligned text. Clients draw it like their markdown tables.
2026-11-27 13:38:26 +01:00
..
script feat(core): move widgets into the opt-in @opencode/plugin-widgets server plugin 2026-11-20 21:01:02 +00:00
src feat(widgets): a native table node 2026-11-27 13:38:26 +01:00
test feat(widgets): widget.storage on server spaces, one space per widget template 2026-11-27 11:44:20 +01:00
package.json build(core): widget runs have typed arrays (psychoscript rust b30b1c2, typedArrays: true) 2026-11-23 00:05:49 +00:00
README.md refactor(core): call the widget concept a widget template everywhere 2026-11-21 21:10:16 +00:00
tsconfig.build.json feat(core): move widgets into the opt-in @opencode/plugin-widgets server plugin 2026-11-20 21:01:02 +00:00
tsconfig.json feat(core): move widgets into the opt-in @opencode/plugin-widgets server plugin 2026-11-20 21:01:02 +00:00
tsconfig.test.json feat(core): move widgets into the opt-in @opencode/plugin-widgets server plugin 2026-11-20 21:01:02 +00:00

Widgets plugin

@opencode/plugin-widgets lets agents show interactive widgets in a session: option cards with images, forms, confirmations, charts and custom widget templates. Each widget is a PsychoScript program from @opencode/widget plus JSON data; clients run the program and render its view natively. The contract is specs/v2/widgets.md.

The plugin uses only the public plugin API. It owns the widget and widget_template tools, the widgets skill, widget template versions and widget states in plugin storage, the opencode.widget RPC (Widget.Definition in @opencode/schema/widget) with its changed event, and the delivery of answers to the model as synthetic messages. Core registers it only while the opt-in widgets flag is on.