Commit Graph

19 Commits

Author SHA1 Message Date
Alem Tuzlak 5ecdee36b8 feat(bot): pluggable StateStore persistence + cross-platform transcripts
Adds a durable persistence layer for @copilotkit/bot, replacing the
in-memory-only ActionStore with a pluggable StateStore.

- StateStore interface (kv/list/lock/dedup/queue) with a shared
  conformance suite; MemoryStore default plus @copilotkit/bot-store-redis
  and @copilotkit/bot-store-postgres backends.
- createBot({ store }): typed per-thread state via Standard Schema,
  action snapshots persisted through the store, per-conversation turn
  lock (onLockConflict drop|force), and inbound-event dedup keyed on a
  stable eventId. ActionStore is kept as a deprecated alias.
- Cross-platform transcripts (bot.transcripts + identity resolver) with
  age-bounded retention (prune on append + filter on read), and
  runAgent({ transcript: true }) to auto-inject history and capture the
  reply.
- createBot({ components }) re-registers components so durable actions
  re-fire after a restart; restart-durability demo in examples/slack.
- Dedup is marked seen only after the turn lock is acquired, so a turn
  dropped on lock-conflict does not burn its eventId (no lost retries).
- Release lockstep: bot-store-redis/postgres version with bot + bot-ui.
2026-06-23 18:33:38 +02:00
Alem Tuzlak 9d0313761f style: oxfmt whatsapp/slack fold 2026-06-17 15:16:45 +02:00
Alem Tuzlak 03fca76c2c fix(whatsapp-fold): address code review
- webhook: don't let GET / health shadow the verify handshake when WHATSAPP_PATH=/
- adapters: fail loud on a malformed PORT instead of binding NaN
- tests: cover the id-only senderContext branch, the 404-regression for the
  health route, and the PORT guard
- docs: update README senderContext snippets to the 2-arg signature
2026-06-17 15:14:35 +02:00
Alem Tuzlak 810899c82e feat(bot-whatsapp): add GET / health route to the webhook server 2026-06-17 14:41:08 +02:00
Alem Tuzlak 42636d0094 style: oxfmt bot-whatsapp + example 2026-06-16 19:26:52 +02:00
Alem Tuzlak 0214e5ac63 fix(bot-whatsapp): correct IR rendering, HITL buttons, typing, quote-reply
- render: walk the real renderToIR tree — read text nodes' `value` and recurse
  into nested containers, so card text and buttons inside <Actions> render
  (previously produced zero payloads → silent no-send)
- render: value-only buttons (awaitChoice HITL confirm/cancel) now render,
  encoding the value in the reply id so the engine's waiter resolves
- adapter: native WhatsApp typing indicator on every inbound (read receipt +
  typing_indicator); supportsTyping = true
- ingress: resolve quote-replies — the webhook sends only the quoted message's
  id, so look it up in history and prepend its text to the turn
- adapter: record every outbound message (text + cards) in history keyed by its
  wamid, so quote-replies to the bot's own messages resolve too
- tests: +9 covering the renderToIR shape, value-only buttons, typing, quote
  resolution, and outbound recording (71 total)
2026-06-16 19:19:43 +02:00
github-actions[bot] a574bbad90 style: auto-fix formatting 2026-06-15 15:13:03 +00:00
Alem Tuzlak 210d5ded66 docs(bot-whatsapp): package README/ARCHITECTURE + example setup guide 2026-06-15 17:08:06 +02:00
Alem Tuzlak 865d5f812d fix(bot-whatsapp): address code review — command history, id round-trip, hmac, deps 2026-06-15 16:02:11 +02:00
Alem Tuzlak c60674bfb5 feat(bot-whatsapp): public exports 2026-06-15 15:24:16 +02:00
Alem Tuzlak c1ee1a818f feat(bot-whatsapp): WhatsAppAdapter implementing PlatformAdapter 2026-06-15 15:03:20 +02:00
Alem Tuzlak 9e168bd937 feat(bot-whatsapp): default context (formatting + no-streaming guidance) 2026-06-15 14:50:44 +02:00
Alem Tuzlak fa239e99fc feat(bot-whatsapp): webhook ingress — listener + signed HTTP server 2026-06-15 14:46:50 +02:00
Alem Tuzlak 2dc28f4901 feat(bot-whatsapp): buffered run renderer (no streaming) 2026-06-15 14:40:05 +02:00
Alem Tuzlak b61cdc0e94 feat(bot-whatsapp): pluggable HistoryStore + per-turn history replay 2026-06-15 14:35:46 +02:00
Alem Tuzlak d261e70ebe feat(bot-whatsapp): interaction decode, Cloud API client, inbound media parts 2026-06-15 14:30:54 +02:00
Alem Tuzlak 4cbc178f6d feat(bot-whatsapp): map IR to Cloud API text/button/list payloads 2026-06-15 14:12:16 +02:00
Alem Tuzlak 185814ba61 feat(bot-whatsapp): add types, render limits, and markdown->WhatsApp transform 2026-06-15 14:03:56 +02:00
Alem Tuzlak 61c13f86bb chore(bot-whatsapp): scaffold package 2026-06-15 13:51:01 +02:00