Add AI auto-responder, flow builder, contacts, ecommerce webhook - #49
Closed
Jbelieve wants to merge 2 commits into
Closed
Add AI auto-responder, flow builder, contacts, ecommerce webhook#49Jbelieve wants to merge 2 commits into
Jbelieve wants to merge 2 commits into
Conversation
- Believe Blue accent + BrandMark wordmark (Be cyan, Reply blue, cyan dot) in sidebar, login, verify-request, invite pages - Sidebar recolored to Believe Blue 950 with negative wordmark variant - Root page now redirects to /dashboard or /login instead of the OSS marketing landing - Favicon/app icons generated natively via next/og ImageResponse, replacing static PNGs - docker-compose.prod.yml for self-hosted deploy (web+worker+cron+ postgres+redis behind Coolify/Traefik), secrets sourced from .env Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Four modules built in parallel (Sonnet: AI/contacts/webhook, Opus: flow
builder), then wired together into the existing DM worker without
touching the plain keyword->dmMessage path for campaigns that use
neither feature.
- lib/ai/responder.ts: Claude-backed auto-responder, tool-use structured
output ({reply, escalate, reason}), deterministic opt-out regex ahead
of the model call, 15s hard timeout, never throws.
- lib/flow/engine.ts + components/flow-builder/*: visual trigger->action
canvas (@xyflow/react, ported from Maasy's WhatsAppFlowBuilder pattern)
for condition/send_dm/add_tag/ai_reply nodes. Pure engine, no I/O.
- lib/contacts.ts + app/(dashboard)/contacts: per-workspace Contact
model with freeform tags, populated as messages come in.
- app/api/webhooks/ecommerce: HMAC-verified inbound webhook for
BeCommerce/Medusa order events, mirroring the existing
pushOrderToMaasyCrm subscriber pattern. Logs only for now — no
Contact matching, since there is no real link between a BeCommerce
order email and an Instagram igUserId yet.
- dm-worker.ts: aiEnabled/flow campaigns resolve a smart reply after
the follow gate clears; escalation releases the DM reservation and
logs SKIPPED_ESCALATED (new DmStatus value) instead of guessing.
- Migration is additive only: new nullable columns, one new table, one
new enum value. Verified against a fresh local Postgres via
migrate diff + migrate deploy before touching production.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@Jbelieve is attempting to deploy a commit to the diwenne's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Closing — opened by mistake against the wrong base repo (internal fork PR, not meant for upstream). Apologies for the noise. |
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
Test plan
npx tsc --noEmitcleannpm run buildclean (all new routes present)npx vitest run— 191/191 passing (17 files)Approved by Jorge for merge + deploy.
🤖 Generated with Claude Code