paritytech / paritytech/host-rust-core
Chat modality status
Open
@eugypalu is already working on this.
Since Sep 11, 2026.
Chat v1.5
Jollity
R2 blocker
rfc
- Dominant language
- Swift
- Stars
- 10
- Forks
- 3
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 148
Description
What landed
| PR | What it does |
|---|---|
| #326 | Brings the modality into the core: ProductExecutionKind with dispatcher filtering so an app-kind connection is denied every chat method, the connection-scoped action stream with its pre-subscribe buffer, custom rendering as a host-initiated request with byte-identical legacy encoding, and uniffi derives so renderer trees cross into Swift and Kotlin as typed values |
| #430 | Implements register_bot as ChatPlatform::register_chat_bot, with central field validation and wire fixtures. Until then it fell through to the trait default |
| #400 | Lets a JS host serve chat as an optional capability, where omitting it keeps the Unsupported answer, and renames the platform methods to create_chat_room, post_chat_message and subscribe_chat_rooms. Closes #383 |
| #453 | Collapses the two post methods into post_message(room_id, content), so the host receives every content variant and decides what it can store instead of the core refusing first, and moves content screening up into the runtime. Adds the Kotlin host surface and the CLI's in-memory chat host with its battery |
| #459 | Serves inbound actions and custom rendering from a JS host, the half #422 tracked. Matches execution kinds to the manifest: Spa and Chat become App, Widget and Worker, which moves the SCALE indices and so is a wire change |
| #541 | Declares the playground's chat worker in the product manifest, so a host can discover it |
| paritytech/polkadot-ios-community#56 (in review) | Serves the modality from the community iOS host: one ProductChatMessaging port shared by both runtimes with ChatHostBridge over it, rooms forwarded into the core so a product's list_subscribe sees native changes, and a native renderer path that maps CustomRendererNode straight onto the widget node. register_bot is rejected, since the native host has no bot registry, and post_message takes text and custom only |
Requirements
- A product drives five methods:
create_room,register_bot,list_subscribe,post_messageandaction_subscribe. The host initiates the sixth,custom_message_render. - Chat is served only to a Worker execution with an active session, on a host that installed a chat adapter.
- A wrong execution kind or a missing session answers
Deniedand a host with no adapter answersUnsupported; neither is a domain error, and the two subscriptions complete empty instead of reporting the gate. - Rooms and bots are product-scoped and host-owned, and neither has a delete. The protocol answers
NeworExistsfor both, so resolving a repeat registration is the host's obligation. - A message carries no bot identity, so a product posts under the one it registered.
- The core carries all seven content types:
Text,RichText,Actions,File,Reaction,ReactionRemoved,Custom. It rejects only what breaks its own size and shape limits, and a host refuses what it cannot store. - A product cannot ask what a host stores or renders. It learns by being refused, and v2 does not add discovery either.
list_subscribeemits the whole room list on every change. The action stream is connection-scoped, deliversMessagePosted,ActionTriggeredandCommand, buffers and drains in order across a detach, and is not a read path.- The host asks for a custom message body when it needs to draw one, and the product answers with a tree for as long as the host holds the stream open, one per state change.
- The tree has nine node types:
Nil,String,Box,Column,Row,Spacer,Text,Button,TextField. The host paints it in its own colour and typography tokens, and there is no image or icon node. - A button's
click_actionand a text field'svalue_change_actioncome back asActionTriggeredagainst themessage_idthatpost_messagereturned. - History, pagination, reaction aggregation and room deletion belong to v2 (#487).
Tasks
- RFC document body
- Implementation — rust-core
- Implementation — hosts
- dotli
- Desktop
- iOS (in review paritytech/polkadot-ios-community#56)
- Android
- host-cli
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.