feat(channels): org-chat integrations — Microsoft Teams, Discord & WhatsApp#3749
Open
vibegui wants to merge 5 commits into
Open
feat(channels): org-chat integrations — Microsoft Teams, Discord & WhatsApp#3749vibegui wants to merge 5 commits into
vibegui wants to merge 5 commits into
Conversation
Contributor
🧪 BenchmarkShould we run the Virtual MCP strategy benchmark for this PR? React with 👍 to run the benchmark.
Benchmark will run on the next push after you react. |
ba68143 to
21666e3
Compare
…cord
Add a first-class org "Channels" feature (sibling to AI Providers) that lets an
org connect chat-platform bots. Each channel registers a synthetic bot
org-member; an inbound platform message runs a Decopilot agent turn and the
reply is posted back into the conversation.
Backend:
- migration 106-channels.ts + ChannelStorage (vault-encrypted credentials)
- channel adapters (Discord Ed25519 interactions, Teams Bot Framework JWT) via
node:crypto + jose, no new deps
- bot identity (synthetic user + member, bypassing the signup auto-org hook)
- runChannelTurn reuses the per-thread gate (awaitThreadRun) for a
memory-carrying, serialized agent turn; reply read back from the thread
- CHANNEL_* MCP tools + channels:manage capability
- inbound webhooks at /api/:org/channels/:channelId/{teams,discord}
(verify signature, ACK within deadline, run agent async, send reply)
Frontend:
- Channels settings page + guided draft-first setup wizard (StepIndicator,
copyable endpoint URL, masked credential inputs, agent picker, status,
resume/edit/delete), effect-free per React 19 rules
- route + nav item + use-channels hooks + query keys
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Empty state and connected-channels header now show direct "Add Microsoft Teams" / "Add Discord" buttons (one per supported platform) instead of a generic "Add channel" leading to an in-dialog grid. - Platform selection creates the draft channel at the page level on click, then opens the wizard straight at the instructions step — removing the redundant in-dialog grid that rendered an empty body when opened without a selection (the lazy reducer init defaulted to the unrendered "closed" state). - Trim the now-unreachable grid/closed/creating-draft states from the wizard reducer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Single-word step labels (no 'Create app' wrap that misaligned the first circle), wider dialog (max-w-xl), and a centered overflow-safe stepper container so the 4-step header never breaks the dialog layout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The webhook URL <code> had flex-1 + truncate but no min-w-0, so it refused to shrink below its content width and pushed itself + the copy button past the dialog's right edge. Add min-w-0 so truncate works. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b0aab7e to
856fdd1
Compare
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3b13b13 to
cbf5b54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A first-class org Channels feature (sibling to AI Providers) connecting chat platforms. Three integrations ship here:
Teams / Discord
channelstable +ChannelStorage(vault-encrypted creds), adapters (Discord Ed25519 interactions, Teams Bot Framework JWT —node:crypto+jose, no new deps), bot identity,CHANNEL_*tools, per-org webhooks at/api/:org/channels/:channelId/{teams,discord}, and a draft-first setup wizard.WhatsApp (concierge)
migration 108-user-phones,PHONE_LINK_START/GET/DELETE, profile "Link WhatsApp" UI that polls until verified).POST /api/whatsapp/ingest(shared-secret auth, async): verify code → resolve phone→user → resolve target org (default-org + in-chat numbered pick-list /switch) → run the agent as the real user (runChannelTurn,botUserId→userId) → deliver via the worker's/send.CHANNELS_LISTadvertises it (setupKind: "shared"),CHANNEL_CREATEactivates immediately with a chosen agent; the page shows an "Add WhatsApp" enable dialog. Only available whenWHATSAPP_WORKER_URL/TOKEN,WHATSAPP_INGEST_SECRET,WHATSAPP_CONCIERGE_NUMBERare set.mangabeira) stays the WABA owner and becomes a thin relay; the integration prompt for it is in.context/whatsapp-worker-integration-prompt.md.Testing
bun run check0 errors ·bun run lintclean ·bun run fmtapplied.curlthe ingest endpoint with a mock/send). Runbun run --cwd=apps/mesh migratefirst.Risks / follow-ups
🤖 Generated with Claude Code