v0.15.0+v0.16.0: /api/respond reply endpoint + message-id in notifier wrapper, GET /api/forwarded ring #36

Merged
kamilkrzywda merged 6 commits from feat/respond-endpoint into main 2026-09-25 17:53:55 +02:00
Owner

Two related features for the mesh→opencode reply flow (one branch per repo convention — same subsystem):

v0.15.0 — POST /api/respond + MCP respond tool

  • Reply to any earlier message by packet id: body { messageId, content }. Routing is automatic — rx records are answered as a DM back to the original sender unless the original was a broadcast (then the reply is a broadcast); tx records go to their destination; injected messages without a sender get a broadcast. The reply always rides the record's channel and carries replyId = messageId so the recipient app renders it as a threaded quote of that packet.
  • 400 on invalid messageId/content, 404 when no message has the given id (in memory or in SQLite), 503 when the bridge is down. Returns { id }.
  • RX history records now persist their destination (to) so DM vs broadcast can be told apart later (column already existed for tx rows — no migration).
  • Notifier wrapper gains the packet id: New mesh message (id <n>) from node <m>: "<text>" — please react to it.

v0.16.0 — GET /api/forwarded

  • In-memory ring of the last 100 messages that passed the notify gate and were forwarded to opencode, newest first as { id, from?, text, channel, at }[]. Recorded at hand-off in notifyRx (after channel gate + self-echo filter; injected messages count when they pass). Gives the replying agent exactly the notified subset with ids for /api/respond, without scanning all of /api/messages.

Tests 88 → 102 (all green), npm run build clean, oxlint clean. Lockfile untouched per repo convention.

Two related features for the mesh→opencode reply flow (one branch per repo convention — same subsystem): **v0.15.0 — POST /api/respond + MCP `respond` tool** - Reply to any earlier message by packet id: body `{ messageId, content }`. Routing is automatic — rx records are answered as a DM back to the original sender unless the original was a broadcast (then the reply is a broadcast); tx records go to their destination; injected messages without a sender get a broadcast. The reply always rides the record's channel and carries `replyId = messageId` so the recipient app renders it as a threaded quote of that packet. - 400 on invalid messageId/content, 404 when no message has the given id (in memory or in SQLite), 503 when the bridge is down. Returns `{ id }`. - RX history records now persist their destination (`to`) so DM vs broadcast can be told apart later (column already existed for tx rows — no migration). - Notifier wrapper gains the packet id: `New mesh message (id <n>) from node <m>: "<text>" — please react to it.` **v0.16.0 — GET /api/forwarded** - In-memory ring of the last 100 messages that passed the notify gate and were forwarded to opencode, newest first as `{ id, from?, text, channel, at }[]`. Recorded at hand-off in `notifyRx` (after channel gate + self-echo filter; injected messages count when they pass). Gives the replying agent exactly the notified subset with ids for `/api/respond`, without scanning all of `/api/messages`. Tests 88 → 102 (all green), `npm run build` clean, oxlint clean. Lockfile untouched per repo convention.
kamilkrzywda added 6 commits 2026-09-25 17:53:48 +02:00
kamilkrzywda merged commit ff57f3eae1 into main 2026-09-25 17:53:55 +02:00
kamilkrzywda deleted branch feat/respond-endpoint 2026-09-25 17:53:55 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/MeshBot#36