fix: repoint dead .com hosts to live .dev (recoupable/chat#1819 §A+§B)
Part of the recoupable.com -> .dev migration (tracking issue recoupable/chat#1819, §A+§B). Repoints the dead .com hosts that this repo emits to their verified-live .dev equivalents.
Live targets (verified 200)
chat.recoupable.dev, api.recoupable.dev, docs.recoupable.dev. Apex recoupable.com/www is still alive, so it is untouched. Emails (INBOUND_EMAIL_DOMAIN, OUTBOUND_EMAIL_DOMAIN, agent@/shared@, noreply) are untouched.
Changes
| File | Change |
|---|---|
lib/composio/getFrontendBaseUrl.ts | production fallback chat.recoupable.com -> chat.recoupable.dev (env-var logic/fallback structure unchanged) |
lib/const.ts | new DOCS_BASE_URL = "https://docs.recoupable.dev" next to the email-domain consts |
lib/emails/getEmailFooter.ts | chat link now built from getFrontendBaseUrl() |
lib/agents/buildTaskCard.ts | task link now built from getFrontendBaseUrl() |
lib/coding-agent/handleGitHubWebhook.ts | task link now built from getFrontendBaseUrl() |
app/page.tsx | docs link -> DOCS_BASE_URL |
app/api/chat/route.ts | contract comment developers.recoupable.com -> docs.recoupable.dev |
lib/chat/recoupApiSkillPrompt.ts | doc host in the agent prompt -> docs.recoupable.dev |
lib/emails/inbound/extractRoomIdFromHtml.ts / extractRoomIdFromText.ts | host regex widened to recoupable.(com|dev) |
DRY approach
All chat-app links route through the existing getFrontendBaseUrl() centralizer rather than carrying their own host literal — flip the host once, every chat/task link follows. Docs links reference the single new DOCS_BASE_URL constant.
RED -> GREEN regex test
The inbound room-id extractors only matched chat.recoupable.com/chat/{uuid}. Added a failing test in both extractRoomIdFromHtml.test.ts and extractRoomIdFromText.test.ts asserting a https://chat.recoupable.dev/chat/<uuid> link extracts the room id, confirmed RED (2 failed / 22 passed), then widened the host part to recoupable.(com|dev):
- HTML: capturing
(com|dev)group added, UUID match index shifted 1 -> 2. - Text: non-capturing
(?:com|dev)keeps the UUID at group 1.
Legacy .com links still in flight continue to match (existing .com tests stay green), so old emails keep resolving.
Two existing behavioral tests (getEmailFooter, buildTaskCard) that asserted the hardcoded .com URL were updated to assert against getFrontendBaseUrl(), reflecting the DRY routing.
Excluded
lib/credits/const.ts:35sandbox.recoupable.com/settings/profile—sandbox.recoupable.devis not provisioned (404), so it stays.compending a sandbox.devdomain.- Two further
.comdoc-host references outside this PR's gate scope (lib/apify/sendApifyWebhookEmail.ts:39chat link,lib/mcp/tools/registerGetApiKeyTool.ts:25developers.recoupable.com/api.recoupable.com) were left for a follow-up since they fall outside the touched-domain test suites.
Gate results
vitest run lib/emails lib/agents lib/composio lib/coding-agent lib/chat: 1087 passed / 169 files (RED->GREEN.devtests included).tsc --noEmit: 0 errors in any changed file. 232 pre-existing errors remain in unrelated test files (lib/stripe,lib/supabase,lib/tasks,lib/trigger— mock-shape drift vs generated DB/Trigger types); none introduced by this PR.eslinton changed files: 0 errors (one benignapp/page.tsx"no matching configuration" warning, pre-existing flat-config coverage).
🤖 Generated with Claude Code
Summary by cubic
Repointed dead .com hosts to their live .dev equivalents and centralized link building to keep links working across the app (part of recoupable/chat#1819 §A+§B). Backward-compatible parsing keeps existing .com links valid.
-
Refactors
getFrontendBaseUrl()now resolves production to https://chat.recoupable.dev; all chat/task links use it (email footers, task cards, GitHub comments).- Added
DOCS_BASE_URL = "https://docs.recoupable.dev"and switched docs links (homepage, agent prompt, comments). - Removed superseded
/api/notificationsroute and its handlers/tests; use POST/api/emails.
-
Bug Fixes
- Updated room-id extractors to accept
recoupable.(com|dev)and added.devtests. - Fixed inline contract links to point at
docs.recoupable.dev.
- Updated room-id extractors to accept