Skip to main content

Multimodal Agent Interface Wiring Map

Execution coordinates for the engineering agent. All paths relative to the implementation worktree.

Pages

ScreenRouteFilePattern to Copy
Chat Interface/chatBLOCKER: path unknown — likely app/(app)/chat/page.tsxapp/(app)/crm/contacts/page.tsx (list page with data fetching)

Components

ComponentFileServes
ChatWindowBLOCKER: libs/ui/src/components/chat/ChatWindow.tsxScreen: Chat (#1, #4, #8-10)
MessageInputBLOCKER: libs/ui/src/components/chat/MessageInput.tsxScreen: Chat (#1)
FileUploadBLOCKER: libs/ui/src/components/chat/FileUpload.tsxScreen: Chat (#2)
VoiceInputBLOCKER: libs/ui/src/components/chat/VoiceInput.tsxScreen: Chat (#3)
RichMessageBLOCKER: libs/ui/src/components/chat/RichMessage.tsxScreen: Chat (#10)
StreamProgressBLOCKER: libs/ui/src/components/chat/StreamProgress.tsxScreen: Chat (#8)

Server Actions

FileActionsPermission Required
BLOCKER: actions/chat.actions.tssendMessage(orgId, message), uploadFile(orgId, file)chat:send
BLOCKER: actions/crm-query.actions.tsqueryCRM(orgId, naturalLanguageQuery)crm:read

Infrastructure

LayerFilePurpose
Streaming APIBLOCKER: app/api/chat/route.tsVercel AI SDK streaming endpoint
Session StoreBLOCKER: depends on Agent Platform memory architecturePer-user, per-org session context
Modality RouterBLOCKER: libs/agency/src/modality/router.tsInput classification + routing
Input NormaliserBLOCKER: libs/agency/src/modality/normaliser.tsPDF/image/voice to text
Feature FlagBLOCKER: depends on org settings schemaPer-org conversational mode

Existing Tests

TypeFileCovers
e2eBLOCKER: apps/drmg-sales-e2e/src/e2e/chat-*.spec.tsS1, S2, S3
integrationBLOCKER: libs/agency/src/__tests__/session-memory.spec.tsS4
integrationBLOCKER: libs/agency/src/__tests__/modality-router.spec.tsS5

Seeds and Fixtures

  • Org with >=3 deals across 2+ stages (for S2 pipeline query)
  • Org with venture + 0 RFP questions (for S1 PDF extraction)
  • Contact with company_name = 'Acme Corp' (for S3 outreach)
  • Answer library with >=3 approved answers (for S1b auto-fill)
  • Test user with chat:send and crm:read permissions
  • Sample PDF with RFP questions in body + appendix (for S1 coverage test)
  • Ambiguous image file (whiteboard photo, for S5 classification test)

Implementation Guardrails

  • Use existing (app) layout; do not introduce a new layout
  • Follow page.tsx as the pattern (server-component-first unless client interactivity needed)
  • New mutations must go through actions/ directory
  • Do not create alternate domain terminology; use spec naming (WorkChart, not "workflow" or "pipeline")
  • Chat streaming must use Vercel AI SDK useChat hook — do not build custom streaming
  • All CRM queries must go through existing Convex query functions — do not bypass with direct DB access
  • Feature flag must be org-level, not user-level — consistent experience per organisation