Scaffold jp-serve-chat with a transport-neutral turn loop
Create the jp-serve-chat command plugin (jp serve chat) under crates/plugins/command/serve-chat. Like jp-serve-web, the plugin does not call models or execute tools itself; the host runs every turn. This ticket covers the transport-neutral turn loop and fake-transport test suite.
[plugins.command.serve-chat.options]
transport = "signal"
persona = "personas/planner"
admin = "maintainer"
[plugins.command.serve-chat.options.people.maintainer]
name = "<name>"
signal = "<account id>"
[plugins.command.serve-chat.options.people.client]
name = "<name>"
signal = "<account id>"Transport. Define a transport interface for inbound messages (chat, sender IDs, text, attachment count), outbound replies, and typing indicators. Replies always go back to the originating chat; the model cannot choose a recipient.
People. Drop messages from unconfigured senders and log the sender ID without the message body. Pass the sender's display name on each query via
--cfgasuser.nameand as<Name> via jpfor theticket,rfd, andwikipluginassistantoptions alongside the configuredpersona.Conversations. Route each chat to one conversation per rollover period, created with
new = true, a title naming the chat and period date, andexpires_in. Persist the chat-to-conversation mapping across restarts.One turn at a time. Forward messages arriving during an active turn on the same chat as
interruptrequests (action = "reply"). If the host rejects the interrupt because the turn already finished, queue the message for the nextquery. Batch messages queued between turns into a singlequery.Answers. When
query_completearrives, fetch the conversation events viaread_eventsand send the assistant's final response to the chat. On turn failure, send a brief error notice to the chat and log the full error.Reply to messages with attachments explaining that the bridge only reads text, rather than dropping attachments silently.