Skip to main content

Platform v1 Complete Capability Inventory

Purpose

This document is the exhaustive, evidence-backed inventory of what v1 currently does across the whole monorepo. Status tags used:
  • active: implemented and wired to real logic
  • partial: present but incomplete/TODO/mock-dependent
  • duplicate: multiple implementations for same surface
  • legacy: stale/old preserved implementation
  • uncertain: intent exists but behavior or usage is not fully provable from current code
Architecture-vs-implementation rule used throughout:
  • Preserve architecture ideas separately from code reuse decisions.
  • A capability can be strategically important while its current implementation remains non-reusable.

How v1 Currently Works (System Narrative)

1) Runtime topology (Open to changing or deleting this)

  • Monorepo is organized into deployable apps, shared packages, and a worker service.
  • Core deployables:
    • apps/platform (multi-tenant control plane)
    • apps/chat (public business chat runtime)
    • apps/kb-studio (KB studio UI, scaffold state)
    • services/worker (KB job execution)
  • Evidence:
    • docs/monorepo-architecture.md
    • docs/dokploy-monorepo.md

2) Shell and tenancy flow (Keep this for v2 after stability is verified)

  • Platform root routes authenticated users into admin shell and unauthenticated users to login.
  • Admin shell wraps pages with auth checks, user loading, role context, sidebar, and settings/theme hydration.
  • Tenancy model is Platform -> Agency -> Business with scoped access and role matrix.
  • Evidence:
    • apps/platform/src/app/page.tsx
    • apps/platform/src/app/admin/layout.tsx
    • apps/platform/src/lib/auth.js
    • apps/platform/src/lib/tenant-context.js
    • supabase/migrations/001_multi_tenant_schema.sql
    • supabase/migrations/002_rls_policies.sql

3) Impersonation and effective identity (Keep this for v2 after stability is verified)

  • Impersonation state is stored in local storage and cookie platform_impersonation.
  • Super admin can impersonate agency/business; agency admin can impersonate business in-scope.
  • Effective user/role/tenant ids are normalized on server for scoped APIs.
  • Evidence:
    • apps/platform/src/context/ImpersonationContext.tsx
    • apps/platform/src/lib/tenant-context.js
    • apps/platform/src/app/api/settings/route.js

4) Inheritance and settings resolution (Keep this for v2 after stability is verified)

  • Settings inherit/merge through platform-level settings, then agency-level overrides, then business-level overrides.
  • Same pattern appears for integration sharing and branding controls.
  • Evidence:
    • apps/platform/src/app/api/settings/route.js
    • packages/db/src/integration-sharing.js
    • apps/platform/src/app/api/agencies/[agencyId]/branding/route.js
    • apps/platform/src/app/api/businesses/[businessId]/branding/route.js

5) Module import/catalog model (Unstable. Open to rebuilding this)

  • Platform app catalog supports listing apps, importing app packages, assessing manifests, storing import metadata.
  • Manifest and normalization rules live in app-sdk layer.
  • Evidence:
    • apps/platform/src/features/app-catalog/PlatformAppCatalogScreen.jsx
    • apps/platform/src/app/api/platform/apps/route.js
    • apps/platform/src/app/api/platform/apps/import/route.js
    • packages/app-sdk/src/imports.js
    • packages/app-sdk/src/manifests.js
    • supabase/migrations/008_app_platform_catalog.sql
    • supabase/migrations/20260315120000_platform_app_imports.sql
    • supabase/migrations/20260315180025_create_normalization_reports.sql

6) Chat runtime model(s) (Unstable. Open to rebuilding this)

  • Business-facing chat runtime is implemented as standalone apps/chat and mirrored in parts of platform APIs.
  • Public chat routes load business runtime config, process AI responses, persist conversations, and capture leads.
  • Platform also has chat-related admin/service surfaces and overlapping API behavior.
  • Evidence:
    • apps/chat/src/app/[accountId]/page.jsx
    • apps/chat/src/app/api/chat/route.js
    • apps/chat/src/app/api/leads/route.js
    • apps/platform/src/app/api/chat/route.js
    • apps/platform/src/app/admin/services/chat/*

7) KB generation and worker pipeline (Unstable. Open to rebuilding this)

  • Onboarding/KB APIs create and manage KB generation jobs.
  • Worker service claims and runs jobs with KB engine functions.
  • KB Studio app exists but is currently scaffold-level.
  • Evidence:
    • apps/platform/src/app/api/kb-jobs/route.js
    • apps/platform/src/app/api/knowledge-base/route.js
    • services/worker/src/index.js
    • services/worker/src/run-job.js
    • packages/kb-engine/src/*
    • apps/kb-studio/src/app/*

8) Auth/permissions/RLS/security behavior (Keep this for v2 after stability is verified)

  • Auth via Supabase helpers and service-role API clients.
  • Role checks are in permissions package and platform auth library wrappers.
  • RLS policies encode tenant-scoped data access across key tables.
  • Evidence:
    • packages/permissions/src/auth.js
    • apps/platform/src/lib/auth.js
    • supabase/migrations/002_rls_policies.sql

9) Theming/branding/white-label/custom domain behavior (Unstable. Open to rebuilding this)

  • Platform/agency/business branding APIs exist with merge/fallback behavior.
  • Login/secure-login/setup-account and domain verification flows support white-label style runtime customization.
  • Custom domains and verification endpoints exist for businesses.
  • Evidence:
    • apps/platform/src/app/api/agencies/[agencyId]/branding/route.js
    • apps/platform/src/app/api/businesses/[businessId]/branding/route.js
    • apps/platform/src/app/api/businesses/[businessId]/domains/route.js
    • apps/platform/src/app/api/verify-domain/route.js
    • apps/platform/src/app/secure-login/page.tsx
    • apps/platform/src/app/setup-account/page.tsx
    • apps/chat/src/app/page.jsx

10) Deployment/runtime operational model (Keep this for v2 after stability is verified)

  • Dokploy deployments are app-specific by workspace/build args/watch paths using root Dockerfile.
  • Required env vars include Supabase and encryption keys with app-specific public URL wiring.
  • Evidence:
    • docs/dokploy-monorepo.md
    • Dockerfile

Capability Index by Subsystem

  • A1 Authentication and session routing
  • A2 Tenancy and impersonation
  • A3 Agency/business/user administration
  • A4 Branding/theming/white-label/custom domains
  • A5 Module catalog/import/manifest normalization
  • A6 Capabilities library (n8n-template and import lane)
  • A7 Integrations/connectors/composio/http requests
  • A8 Chat runtime and conversation handling
  • A9 Lead capture, webhook, email delivery
  • A10 Knowledge base onboarding/jobs/worker pipeline
  • A11 Billing/reporting/account/settings utilities
  • A12 SDK and shared package layer
  • A13 DB schema/migrations/RLS/infra
  • A14 Non-canonical surfaces (duplicate/legacy/partial)

Capability Catalog (Comprehensive)

IDSubsystemCapabilityWhat it doesWhere it livesDependency chain (key)AudienceStatus
C-001A1Root auth redirectRedirects authenticated to /admin, unauthenticated to /loginapps/platform/src/app/page.tsxSupabase auth helper -> router replaceuser-facingactive
C-002A1Login/password authEmail/password sign-in, post-login destination resolveapps/platform/src/app/login/page.tsx, apps/platform/src/app/api/auth/post-login-destination/route.jsSupabase auth -> user role lookup -> destination routeuser-facingactive
C-003A1Google OAuth loginOptional Google sign-in flowapps/platform/src/app/login/page.tsx, apps/platform/src/app/auth/callback/route.jsSupabase OAuth provideruser-facingactive
C-004A1White-label login variantAlternate secure login page pathapps/platform/src/app/secure-login/page.tsxBranding/theming + authuser-facingactive
C-005A1Account setup flowInvitation/setup password entry flowapps/platform/src/app/setup-account/page.tsx, apps/platform/src/app/api/agencies/[agencyId]/resend-welcome/route.jsUser management + email deliveryuser-facingactive
C-006A2Admin shell role contextWraps /admin/* with auth, user, nav, and settings loadapps/platform/src/app/admin/layout.tsxSupabase auth + /api/settings + impersonation contextoperator-facingactive
C-007A2Effective tenant context resolverBuilds effective role, agency/business scope, impersonation normalizationapps/platform/src/lib/tenant-context.jsusers/businesses lookups + role group logicinternalactive
C-008A2Impersonation persistence + lifecycleStart/stop agency/business impersonation with cookie/local storageapps/platform/src/context/ImpersonationContext.tsxtenant-context + /api/agencies/* /api/businesses/* validationoperator-facingactive
C-009A2Authorized business scope helperRestricts business-target API actions by role and tenantapps/platform/src/lib/business-scope.jstenant-context derived roles + businesses queryinternalactive
C-010A2Settings inheritance resolutionMerges platform/agency/business settings with impersonation-awarenessapps/platform/src/app/api/settings/route.jstenant-context + dashboard settings merge + db integration helpersinternal/operator-facingactive
C-011A3Agencies CRUD + onboardingCreate/list/update/delete agencies, user setup hooksapps/platform/src/app/api/agencies/route.js, apps/platform/src/app/admin/agencies/page.tsxauth + tenant checks + app offering defaultsoperator-facingactive
C-012A3Agency detail opsAgency profile, credentials, users, app offering bindingsapps/platform/src/app/api/agencies/[agencyId]/*, apps/platform/src/app/admin/agencies/[agencyId]/page.tsxusers/agencies/businesses tables + app catalog tablesoperator-facingactive
C-013A3Businesses CRUDCreate/list/update businesses with tenant checksapps/platform/src/app/api/businesses/route.js, apps/platform/src/app/api/businesses/[businessId]/route.js, apps/platform/src/app/admin/sub-accounts/page.jsxtenant context + agencies/businesses tablesoperator-facingactive
C-014A3Users CRUD and profile managementUser creation/update/list with scoped role logicapps/platform/src/app/api/users/route.js, apps/platform/src/app/admin/users/page.jsx, apps/platform/src/app/admin/account/*auth + tenant rules + users tableoperator-facingactive
C-015A4Agency branding managementGet/save agency branding and dashboard settingsapps/platform/src/app/api/agencies/[agencyId]/branding/route.js, apps/platform/src/app/admin/agencies/[agencyId]/branding/page.tsxsettings defaults + agency record + merge utilitiesoperator-facingactive
C-016A4Business branding managementGet/save business branding, chat settings, advanced themeapps/platform/src/app/api/businesses/[businessId]/branding/route.js, apps/platform/src/app/admin/branding/page.jsxbusiness + agency + platform branding fallbackoperator-facingactive
C-017A4Platform branding controlsGlobal branding/dash theme controlsapps/platform/src/app/admin/platform/branding/page.jsx, apps/platform/src/app/api/settings/route.jssettings table + admin theme helpersoperator-facingactive
C-018A4Dashboard theme editorDashboard colors/fonts/spacing controlsapps/platform/src/app/admin/dashboard-settings/page.tsxsettings API + theme token mappingoperator-facingactive
C-019A4Custom domain managementConfigure/verify business custom domainsapps/platform/src/app/api/businesses/[businessId]/domains/route.js, apps/platform/src/app/api/verify-domain/route.js, apps/platform/src/app/admin/settings/domains/page.jsxbusinesses table (custom_domain, domain_verified)operator-facingactive
C-020A4Domain-based chat routingHostname -> business account resolution for chat runtimeapps/chat/src/app/page.jsxSupabase business lookup by custom_domainuser-facingactive
C-021A5Platform app catalog browsingLists managed/imported apps and connection metadataapps/platform/src/features/app-catalog/PlatformAppCatalogScreen.jsx, apps/platform/src/app/admin/platform/apps/page.jsx@sec-admn/app-sdk + /api/platform/appsoperator-facingactive
C-022A5Module import pipelineUpload zip, normalize imports/colors, assess manifest, persist reportapps/platform/src/app/api/platform/apps/import/route.js, packages/app-sdk/src/imports.js, sdk/packages/schemas/src/index.ts, sdk/packages/ui/src/components/NormalizationReport.tsxapp-sdk normalization -> db report storageoperator-facing/infrastructureactive
C-023A5Manifest validation and compatibility assessmentValidates module manifest contract and connection requirementspackages/app-sdk/src/manifests.js, packages/app-sdk/src/imports.js, apps/platform/src/app/(dashboard)/modules/upload/assessment/page.tsxmanifest parser/validator + assessment reportinternal/operator-facingactive
C-024A5App availability resolution by tenantReturns installable apps for tenant scopeapps/platform/src/app/api/apps/available/route.jsapp catalog tables + tenant contextoperator-facingactive
C-025A6Capabilities registry APIsCRUD/list categories/requirements for capabilitiesapps/platform/src/app/api/capabilities/*capabilities tables + requirement resolveroperator-facingactive
C-026A6Capability install flowInstalls capabilities for business contextapps/platform/src/app/api/capabilities/[id]/install/route.js, apps/platform/src/app/admin/capabilities/[slug]/requirements/page.tsxcapability tables + business bindingsoperator-facingactive
C-027A6n8n template intake laneImports/reads n8n template-backed capabilitiesapps/platform/src/app/api/capabilities/n8n-templates/route.js, apps/platform/src/app/admin/platform/capabilities/page.jsxtemplate parsing + capabilities import routeoperator-facingactive
C-028A6Capabilities compiler workflowConverts workflow payload into capability recordsapps/platform/src/lib/compiler/*, apps/platform/src/app/api/capabilities/import/route.jsparser -> compiler -> db writeinternal/operator-facingactive
C-029A7Integration settings managementAI provider/webhook/http request integration settings by scopeapps/platform/src/app/admin/integrations/page.tsx, apps/platform/src/app/api/agencies/[agencyId]/integrations/route.js, apps/platform/src/app/api/businesses/[businessId]/connectors/*tenant context + integration sharing merge + encryption helpersoperator-facingactive
C-030A7Composio connection flowConnect/disconnect/callback for external toolkitsapps/platform/src/app/api/connections/*, apps/platform/src/app/api/integrations/composio/callback/route.js, apps/platform/src/lib/composio/*composio libs + business connector stateoperator-facingactive
C-031A7Business connector state APIsRead/update connector settings per businessapps/platform/src/app/api/businesses/[businessId]/connectors/*connector settings schema + db helperoperator-facingactive
C-032A8Public business chat runtime UIMain chat UI, messages, guided flow, lead form renderingapps/chat/src/app/[accountId]/page.jsx/api/business-settings + /api/chat + /api/conversations + /api/leadsuser-facingactive
C-033A8Chat response generation APIRuns AI provider, tool usage, structured response parseapps/chat/src/app/api/chat/route.js, packages/chat-core/src/*runtime-config + ai-config + structured-response + db integration sharinginfrastructure/user-facingactive
C-034A8Conversation persistence APICreate/update/read conversations by session/businessapps/chat/src/app/api/conversations/route.js, apps/platform/src/app/api/conversations/route.jsconversations table + tenant scopinginfrastructureactive
C-035A8Platform chat API variantOverlapping chat API in platform app with capability tool loadingapps/platform/src/app/api/chat/route.jschat-core + platform capability tool-loaderinternalduplicate
C-036A8Embed widget deployment docsEmbed script examples and runtime guidanceapps/chat/src/app/embed/page.jsx, apps/chat/public/widget.jschat runtime URL/account idoperator-facingactive
C-037A9Lead capture ingestionValidates form data, writes lead record, routes deliveryapps/chat/src/app/api/leads/route.js, packages/chat-core/src/lead-capture.js, packages/chat-core/src/lead-delivery.jslead forms + delivery routing + decrypt/encryptioninfrastructureactive
C-038A9Lead routing admin surfaceConfigure forms, fields, delivery routes in platform adminapps/platform/src/app/admin/services/chat/lead-capture/page.jsx, apps/platform/src/app/api/businesses/[businessId]/lead-capture/route.jslead forms/routing tables + business scopeoperator-facingactive
C-039A9Webhook delivery pipelineOutbound webhook calls for lead/chat eventsapps/chat/src/app/api/webhook/route.js, apps/platform/src/app/api/webhook/route.jssettings/integration state + retries/logginginfrastructureactive
C-040A9Email delivery pipelineSMTP/config-based lead/email dispatchapps/chat/src/app/api/email/route.js, apps/platform/src/app/api/email/route.jssettings decrypt + nodemailerinfrastructureactive
C-041A10KB onboarding wizard UIMulti-step onboarding for business setup and KB bootstrappingapps/platform/src/components/onboarding/OnboardingWizard.tsx, apps/platform/src/app/onboarding/page.tsxonboarding context API + upload docs + kb jobsoperator-facingactive
C-042A10Onboarding context/complete APIsRead and persist onboarding progress/configapps/platform/src/app/api/onboarding/context/route.js, apps/platform/src/app/api/onboarding/complete/route.jsbusinesses/users/kb jobs tables + integration sharinginfrastructureactive
C-043A10KB jobs APIQueue/list/get/restore/process knowledge base jobsapps/platform/src/app/api/kb-jobs/*, apps/platform/src/app/api/agency/kb-jobs/[businessId]/route.jskb_generation_jobs + knowledge-base store + worker launcherinfrastructureactive
C-044A10KB generation workerClaims/requeues/processes KB jobsservices/worker/src/index.js, services/worker/src/run-job.jskb-engine + db integration sharing + encryptioninfrastructureactive
C-045A10KB engine pipeline packageScrape/extract/research/compile/system-prompt/quiz/starterspackages/kb-engine/src/*AI providers + compiler + runtime helpersinternalactive
C-046A10KB Studio app scaffoldProjects/review/publish shell pagesapps/kb-studio/src/app/*next/react + planned @sec-admn/kb-engine dependencyoperator-facingpartial
C-047A11Billing dashboardBilling overview and configuration UIsapps/platform/src/app/admin/billing/page.tsx, apps/platform/src/app/admin/billing/configuration/page.tsx, apps/platform/src/app/api/billing/configuration/route.jsstripe config tables + settings + tenant scopeoperator-facingpartial
C-048A11Billing invoices/payments/subscriptions pagesInvoice/payment/subscription management viewsapps/platform/src/app/admin/billing/invoices/page.tsx, .../payments/page.tsx, .../subscriptions/page.tsxbilling APIs + TODO markersoperator-facingpartial
C-049A11Reporting dashboardActivity/metrics reporting surfacesapps/platform/src/app/admin/reporting/page.jsx, apps/platform/src/app/api/dashboard/stats/route.js, apps/platform/src/app/api/dashboard/overview/route.jssessions/leads/business stats + window selectorsoperator-facingpartial
C-050A11Session/live session pagesLists and filters conversations/sessionsapps/platform/src/app/admin/live-sessions/page.jsx, apps/platform/src/app/admin/services/chat/sessions/page.jsx, apps/platform/src/app/api/sessions/route.jschat_sessions + tenant scopeoperator-facingactive
C-051A11Leads admin viewLead listing and operations UIapps/platform/src/app/admin/leads/page.jsx, apps/platform/src/app/api/leads/route.jsnew_leads table + tenant scopeoperator-facingactive
C-052A11Business info and email settings pagesTenant profile data and email config controlsapps/platform/src/app/admin/business-info/page.tsx, apps/platform/src/app/admin/email-settings/page.tsx/api/settings + /api/test-connectionoperator-facingactive
C-053A11Account profile/password/notifications pagesUser self-management and account preferencesapps/platform/src/app/admin/account/*users API + profile/password formsoperator-facingpartial
C-054A11Platform changelog/admin pagesPlatform-level admin surfacesapps/platform/src/app/admin/platform/changelog/page.jsx, apps/platform/src/app/admin/platform/branding/page.jsxsettings APIs + UI componentsoperator-facingactive
C-055A11Plasmic host + render/studio-link APIsCMS-like hosted visual content integrationapps/platform/src/app/plasmic-host/page.tsx, apps/platform/src/app/api/plasmic/*plasmic loader + auth helpersoperator-facing/internalactive
C-056A12app-sdk packageManifest normalization, UI import/color normalization, assessment helperspackages/app-sdk/src/*parser/validator + normalization report schemainternalactive
C-057A12chat-core packageAI config, runtime config, lead capture/delivery, composio hooks, rate-limitpackages/chat-core/src/*db/runtime config + provider adaptersinternalactive
C-058A12db packageBrowser/server supabase clients and integration sharing logicpackages/db/src/*supabase client wrappers + integration merge logicinternalactive
C-059A12permissions packageRole constants and auth checkspackages/permissions/src/*consumed by apps/platform/src/lib/auth.jsinternalactive
C-060A12branding packageTheme defaults and merge helperpackages/branding/src/index.jsdeclared dependency, low direct usage evidenceinternaluncertain
C-061A12auth packageLogin route constants helperpackages/auth/src/index.jsdependency declared, low direct runtime useinternaluncertain
C-062A12contracts packageShared contracts placeholder packagepackages/contracts/src/index.jswidely declared dependency, sparse runtime importsinternaluncertain
C-063A12config packageWorkspace config helperpackages/config/src/index.jsno clear app-level consumerinternallegacy
C-064A12sdk schemas packageTyped core data/normalization contractssdk/packages/schemas/src/index.tsconsumed by sdk/ui and platform import assessmentinternalactive
C-065A12sdk ui packageShared UI primitives and normalization report componentsdk/packages/ui/src/*used in assessment/editor contextsinternalactive
C-066A12sdk client packageplatform client (emit/call/usage) for module interactionssdk/packages/client/src/index.tsmodule-runtime integration contractinternalactive
C-067A12sdk manifest packageManifest schema/validator packagesdk/packages/manifest/src/index.tsmodule manifest contract layerinternalactive
C-068A12sdk cli scaffoldercreate-aiconnected-module module generatorsdk/packages/cli/src/index.tsscaffolding for module dev flowoperator-facing/internalactive
C-069A13Supabase schema baselineCore multi-tenant tables and constraintssupabase/migrations/001_multi_tenant_schema.sqlagencies/businesses/users + related domain tablesinfrastructureactive
C-070A13RLS policy baselineRole-scoped row-level access policies across core tablessupabase/migrations/002_rls_policies.sqlauth.uid + users role mappinginfrastructureactive
C-071A13Extended migration laneAdds onboarding, dashboard settings, capabilities, connectors, billing, imports, normalization reportssupabase/migrations/003_*.sql through 20260315180025_*.sqliterative schema evolutioninfrastructureactive
C-072A13Full deploy migration aggregateOne-shot deploy migration scriptsupabase/migrations/999_full_deploy.sqlaggregate schema deployment laneinfrastructureuncertain
C-073A13Dokploy monorepo deployment modelApp-specific build args/watch paths and shared Docker strategydocs/dokploy-monorepo.md, Dockerfileworkspace-targeted build/deployinfrastructureactive
C-074A14Duplicate route implementationsSame route in .jsx and .tsx for many admin pages/layoutse.g. apps/platform/src/app/admin/dashboard/page.jsx + .../page.tsxduplicate UI logic pathsinternalduplicate
C-075A14Legacy .old route filesStale preserved route variants in active treee.g. apps/platform/src/app/admin/page.jsx.old, apps/platform/src/app/admin/settings/domains/page.jsx.oldhistorical carry-overinternallegacy
C-076A14Mock/TODO billing/reporting pathsMock data and TODO comments in billing/reporting flowsapps/platform/src/app/admin/billing/page.tsx, .../billing/invoices/page.tsx, .../billing/subscriptions/page.tsx, apps/platform/src/app/admin/reporting/page.jsxmissing production wiring in partsoperator-facingpartial
C-077A14KB Studio scaffold-only implementationPages exist but no substantive feature wiring/fetch/APIapps/kb-studio/src/app/*, apps/kb-studio/src/features/*/.gitkeepplaceholder application shelloperator-facingpartial
C-078A14Deep-import internal package couplingImports package internals via @sec-admn/*/src/* pathsapps/chat/src/app/api/leads/route.js, apps/chat/src/app/[accountId]/page.jsx, services/worker/src/run-job.js, apps/platform/src/lib/supabase-server.jsboundary bypass increases fragilityinternallegacy

Capability Labels (Migration + v2 Placement)

Label set 1:
  • Safe To Migrate
  • Rebuild In v2
  • Do Not Migrate
Label set 2:
  • Shell
  • Module
  • Other
IDMigration LabelPlacement Label
C-001Safe To MigrateShell
C-002Safe To MigrateShell
C-003Safe To MigrateShell
C-004Rebuild In v2Shell
C-005Rebuild In v2Shell
C-006Safe To MigrateShell
C-007Safe To MigrateShell
C-008Safe To MigrateShell
C-009Safe To MigrateShell
C-010Safe To MigrateShell
C-011Safe To MigrateShell
C-012Safe To MigrateShell
C-013Safe To MigrateShell
C-014Rebuild In v2Shell
C-015Rebuild In v2Shell
C-016Rebuild In v2Shell
C-017Safe To MigrateShell
C-018Rebuild In v2Shell
C-019Rebuild In v2Shell
C-020Rebuild In v2Module
C-021Safe To MigrateShell
C-022Safe To MigrateShell
C-023Safe To MigrateShell
C-024Safe To MigrateShell
C-025Do Not MigrateOther
C-026Do Not MigrateOther
C-027Do Not MigrateOther
C-028Do Not MigrateOther
C-029Rebuild In v2Shell
C-030Rebuild In v2Module
C-031Rebuild In v2Module
C-032Rebuild In v2Module
C-033Rebuild In v2Module
C-034Rebuild In v2Module
C-035Do Not MigrateOther
C-036Rebuild In v2Module
C-037Rebuild In v2Module
C-038Rebuild In v2Module
C-039Rebuild In v2Module
C-040Rebuild In v2Module
C-041Rebuild In v2Module
C-042Rebuild In v2Module
C-043Rebuild In v2Module
C-044Rebuild In v2Module
C-045Safe To MigrateModule
C-046Rebuild In v2Module
C-047Rebuild In v2Shell
C-048Rebuild In v2Shell
C-049Rebuild In v2Shell
C-050Rebuild In v2Module
C-051Rebuild In v2Module
C-052Rebuild In v2Shell
C-053Rebuild In v2Shell
C-054Rebuild In v2Shell
C-055Do Not MigrateOther
C-056Safe To MigrateShell
C-057Safe To MigrateModule
C-058Safe To MigrateOther
C-059Safe To MigrateShell
C-060Rebuild In v2Shell
C-061Do Not MigrateOther
C-062Rebuild In v2Other
C-063Do Not MigrateOther
C-064Safe To MigrateOther
C-065Safe To MigrateOther
C-066Safe To MigrateModule
C-067Safe To MigrateOther
C-068Safe To MigrateModule
C-069Safe To MigrateShell
C-070Safe To MigrateShell
C-071Rebuild In v2Other
C-072Do Not MigrateOther
C-073Safe To MigrateOther
C-074Do Not MigrateOther
C-075Do Not MigrateOther
C-076Do Not MigrateOther
C-077Rebuild In v2Module
C-078Do Not MigrateOther

Capability Index by Status Tag

active

C-001, C-002, C-003, C-004, C-005, C-006, C-007, C-008, C-009, C-010, C-011, C-012, C-013, C-014, C-015, C-016, C-017, C-018, C-019, C-020, C-021, C-022, C-023, C-024, C-025, C-026, C-027, C-028, C-029, C-030, C-031, C-032, C-033, C-034, C-036, C-037, C-038, C-039, C-040, C-041, C-042, C-043, C-044, C-045, C-050, C-051, C-052, C-054, C-055, C-056, C-057, C-058, C-059, C-064, C-065, C-066, C-067, C-068, C-069, C-070, C-071, C-073

partial

C-046, C-047, C-048, C-049, C-053, C-076, C-077

duplicate

C-035, C-074

legacy

C-063, C-075, C-078

uncertain

C-060, C-061, C-062, C-072

v1 Capability Coverage Matrix (PRD Handoff)

SubsystemActivePartialDuplicateLegacyUncertain
A1 Authentication/session50000
A2 Tenancy/impersonation/inheritance50000
A3 Agency/business/user admin40000
A4 Branding/white-label/domains60000
A5 Module import/catalog40000
A6 Capabilities library lane40000
A7 Integrations/connectors/composio30000
A8 Chat runtime/conversation40100
A9 Leads/webhook/email40000
A10 KB onboarding/jobs/worker51000
A11 Billing/reporting/account/plasmic44000
A12 SDK/shared packages80013
A13 DB/infra/deploy40001
A14 Non-canonical surfaces02120

Non-Canonical and Edge Capability Surfaces (Explicit)

  • Whitelabel/custom domains:
    • apps/platform/src/app/api/businesses/[businessId]/domains/route.js
    • apps/platform/src/app/api/verify-domain/route.js
    • apps/chat/src/app/page.jsx
  • Impersonation:
    • apps/platform/src/context/ImpersonationContext.tsx
    • apps/platform/src/lib/tenant-context.js
  • User/tenant-specific UI customization:
    • apps/platform/src/app/admin/branding/page.jsx
    • apps/platform/src/app/admin/dashboard-settings/page.tsx
    • apps/platform/src/app/api/settings/route.js
  • Partial/placeholder and TODO/mocks:
    • apps/platform/src/app/admin/billing/subscriptions/page.tsx
    • apps/platform/src/app/admin/billing/invoices/page.tsx
    • apps/platform/src/app/admin/billing/page.tsx
    • apps/kb-studio/src/app/projects/page.jsx
  • Duplicated implementations:
    • .jsx and .tsx pairs under apps/platform/src/app/admin/**
    • overlapping chat API implementations in apps/platform/src/app/api/chat/route.js and apps/chat/src/app/api/chat/route.js
  • Legacy .old route files:
    • apps/platform/src/app/admin/**/*.old

Cross-Doc Alignment Check

This inventory is aligned with:
  • docs/v1-audit/01-repo-map.md
  • docs/v1-audit/02-foundation-vs-apps.md
  • docs/v1-audit/03a-auth-and-permissions.md
  • docs/v1-audit/03b-module-manifest-system.md
  • docs/v1-audit/03c-branding-and-theming.md
  • docs/v1-audit/03d-chat-core.md
  • docs/v1-audit/03e-kb-engine.md
  • docs/v1-audit/03f-db-client-server-patterns.md
  • docs/v1-audit/04-app-audit-platform.md
  • docs/v1-audit/04-app-audit-chat.md
  • docs/v1-audit/04-app-audit-kb-studio.md
  • docs/v1-audit/05-delete-list-with-reasons.md
  • docs/v1-audit/06-prd-input-summary.md
  • docs/v1-audit/07-multi-tenancy-clean-port-plan.md

Appendix A: Complete Route Surface Inventory (apps/platform)

apps/platform/src/app/(dashboard)/modules/upload/assessment/page.jsx
apps/platform/src/app/(dashboard)/modules/upload/assessment/page.tsx
apps/platform/src/app/[...catchall]/page.tsx
apps/platform/src/app/admin/account/notifications/page.tsx
apps/platform/src/app/admin/account/page.tsx
apps/platform/src/app/admin/account/password/page.jsx
apps/platform/src/app/admin/account/password/page.tsx
apps/platform/src/app/admin/account/profile/page.jsx
apps/platform/src/app/admin/account/profile/page.tsx
apps/platform/src/app/admin/agencies/[agencyId]/billing/page.tsx
apps/platform/src/app/admin/agencies/[agencyId]/branding/page.jsx
apps/platform/src/app/admin/agencies/[agencyId]/branding/page.tsx
apps/platform/src/app/admin/agencies/[agencyId]/page.tsx
apps/platform/src/app/admin/agencies/page.tsx
apps/platform/src/app/admin/agency/branding/page.jsx
apps/platform/src/app/admin/agency/branding/page.tsx
apps/platform/src/app/admin/billing/configuration/page.jsx
apps/platform/src/app/admin/billing/configuration/page.tsx
apps/platform/src/app/admin/billing/invoices/page.jsx
apps/platform/src/app/admin/billing/invoices/page.tsx
apps/platform/src/app/admin/billing/page.jsx
apps/platform/src/app/admin/billing/page.tsx
apps/platform/src/app/admin/billing/payments/page.jsx
apps/platform/src/app/admin/billing/payments/page.tsx
apps/platform/src/app/admin/billing/subscriptions/page.jsx
apps/platform/src/app/admin/billing/subscriptions/page.tsx
apps/platform/src/app/admin/branding/page.jsx
apps/platform/src/app/admin/business-info/page.jsx
apps/platform/src/app/admin/business-info/page.tsx
apps/platform/src/app/admin/capabilities/[slug]/page.jsx
apps/platform/src/app/admin/capabilities/[slug]/page.tsx
apps/platform/src/app/admin/capabilities/[slug]/requirements/page.jsx
apps/platform/src/app/admin/capabilities/[slug]/requirements/page.tsx
apps/platform/src/app/admin/capabilities/page.jsx
apps/platform/src/app/admin/capabilities/page.tsx
apps/platform/src/app/admin/chat-settings/page.jsx
apps/platform/src/app/admin/chat-settings/page.tsx
apps/platform/src/app/admin/clients/[clientId]/page.jsx
apps/platform/src/app/admin/clients/[clientId]/page.jsx.old
apps/platform/src/app/admin/clients/page.jsx.old
apps/platform/src/app/admin/clients/page.tsx
apps/platform/src/app/admin/dashboard-settings/page.jsx
apps/platform/src/app/admin/dashboard-settings/page.tsx
apps/platform/src/app/admin/dashboard/page.jsx
apps/platform/src/app/admin/dashboard/page.tsx
apps/platform/src/app/admin/email-settings/page.jsx
apps/platform/src/app/admin/email-settings/page.tsx
apps/platform/src/app/admin/embed/page.jsx
apps/platform/src/app/admin/embed/page.tsx
apps/platform/src/app/admin/integrations/page.jsx
apps/platform/src/app/admin/integrations/page.tsx
apps/platform/src/app/admin/knowledge-base/page.jsx
apps/platform/src/app/admin/knowledge-base/page.tsx
apps/platform/src/app/admin/layout.jsx
apps/platform/src/app/admin/layout.tsx
apps/platform/src/app/admin/leads/page.jsx
apps/platform/src/app/admin/live-sessions/page.jsx
apps/platform/src/app/admin/page.jsx
apps/platform/src/app/admin/page.jsx.old
apps/platform/src/app/admin/page.tsx
apps/platform/src/app/admin/platform/apps/page.jsx
apps/platform/src/app/admin/platform/branding/page.jsx
apps/platform/src/app/admin/platform/capabilities/page.jsx
apps/platform/src/app/admin/platform/changelog/page.jsx
apps/platform/src/app/admin/prompts/page.jsx
apps/platform/src/app/admin/reporting/page.jsx
apps/platform/src/app/admin/services/[appKey]/page.jsx
apps/platform/src/app/admin/services/chat/history/page.jsx
apps/platform/src/app/admin/services/chat/knowledge/page.jsx
apps/platform/src/app/admin/services/chat/lead-capture/page.jsx
apps/platform/src/app/admin/services/chat/prompts/page.jsx
apps/platform/src/app/admin/services/chat/sessions/page.jsx
apps/platform/src/app/admin/session-history/page.jsx
apps/platform/src/app/admin/settings/api-calls/page.jsx
apps/platform/src/app/admin/settings/api-keys/page.jsx
apps/platform/src/app/admin/settings/apps/page.jsx
apps/platform/src/app/admin/settings/domains/page.jsx
apps/platform/src/app/admin/settings/domains/page.jsx.old
apps/platform/src/app/admin/settings/embed/page.jsx
apps/platform/src/app/admin/settings/embed/page.jsx.old
apps/platform/src/app/admin/settings/integrations/page.jsx
apps/platform/src/app/admin/settings/mcps/page.jsx
apps/platform/src/app/admin/settings/page.jsx
apps/platform/src/app/admin/settings/platform/page.jsx.old
apps/platform/src/app/admin/settings/platform/page.tsx
apps/platform/src/app/admin/settings/theme/page.jsx
apps/platform/src/app/admin/settings/white-label/page.jsx.old
apps/platform/src/app/admin/settings/white-label/page.tsx
apps/platform/src/app/admin/sub-accounts/page.jsx
apps/platform/src/app/admin/team/page.jsx
apps/platform/src/app/admin/users/page.jsx
apps/platform/src/app/api/agencies/[agencyId]/apps/route.js
apps/platform/src/app/api/agencies/[agencyId]/branding/route.js
apps/platform/src/app/api/agencies/[agencyId]/credentials/route.js
apps/platform/src/app/api/agencies/[agencyId]/integrations/route.js
apps/platform/src/app/api/agencies/[agencyId]/resend-welcome/route.js
apps/platform/src/app/api/agencies/[agencyId]/route.js
apps/platform/src/app/api/agencies/[agencyId]/user/route.js
apps/platform/src/app/api/agencies/route.js
apps/platform/src/app/api/agency/kb-jobs/[businessId]/route.js
apps/platform/src/app/api/agency/settings/route.js
apps/platform/src/app/api/apps/available/route.js
apps/platform/src/app/api/auth/post-login-destination/route.js
apps/platform/src/app/api/billing/configuration/route.js
apps/platform/src/app/api/branding/generate-from-website/route.js
apps/platform/src/app/api/business-settings/route.js
apps/platform/src/app/api/businesses/[businessId]/apps/route.js
apps/platform/src/app/api/businesses/[businessId]/branding/route.js
apps/platform/src/app/api/businesses/[businessId]/connectors/[toolkit]/connect/route.js
apps/platform/src/app/api/businesses/[businessId]/connectors/[toolkit]/disconnect/route.js
apps/platform/src/app/api/businesses/[businessId]/connectors/[toolkit]/route.js
apps/platform/src/app/api/businesses/[businessId]/connectors/route.js
apps/platform/src/app/api/businesses/[businessId]/domains/route.js
apps/platform/src/app/api/businesses/[businessId]/kb-onboarding/route.js
apps/platform/src/app/api/businesses/[businessId]/lead-capture/route.js
apps/platform/src/app/api/businesses/[businessId]/route.js
apps/platform/src/app/api/businesses/route.js
apps/platform/src/app/api/capabilities/[id]/install/route.js
apps/platform/src/app/api/capabilities/[id]/requirements/route.js
apps/platform/src/app/api/capabilities/[id]/route.js
apps/platform/src/app/api/capabilities/categories/route.js
apps/platform/src/app/api/capabilities/import/route.js
apps/platform/src/app/api/capabilities/n8n-templates/route.js
apps/platform/src/app/api/capabilities/requirements/route.js
apps/platform/src/app/api/capabilities/route.js
apps/platform/src/app/api/chat/route.js
apps/platform/src/app/api/connections/[app]/connect/route.js
apps/platform/src/app/api/connections/callback/route.js
apps/platform/src/app/api/connections/route.js
apps/platform/src/app/api/conversations/route.js
apps/platform/src/app/api/dashboard/overview/route.js
apps/platform/src/app/api/dashboard/stats/route.js
apps/platform/src/app/api/email/route.js
apps/platform/src/app/api/health/route.js
apps/platform/src/app/api/integrations/composio/callback/route.js
apps/platform/src/app/api/kb-jobs/[id]/restore/route.js
apps/platform/src/app/api/kb-jobs/[id]/route.js
apps/platform/src/app/api/kb-jobs/process/route.js
apps/platform/src/app/api/kb-jobs/route.js
apps/platform/src/app/api/knowledge-base/route.js
apps/platform/src/app/api/leads/route.js
apps/platform/src/app/api/onboarding/complete/route.js
apps/platform/src/app/api/onboarding/context/route.js
apps/platform/src/app/api/plasmic/render-data/route.ts
apps/platform/src/app/api/plasmic/studio-link/route.ts
apps/platform/src/app/api/platform/apps/[appKey]/route.js
apps/platform/src/app/api/platform/apps/import/route.js
apps/platform/src/app/api/platform/apps/route.js
apps/platform/src/app/api/sessions/route.js
apps/platform/src/app/api/settings/route.js
apps/platform/src/app/api/test-connection/route.js
apps/platform/src/app/api/themes/route.js
apps/platform/src/app/api/upload-documents/route.js
apps/platform/src/app/api/upload/route.js
apps/platform/src/app/api/users/route.js
apps/platform/src/app/api/verify-domain/route.js
apps/platform/src/app/api/webhook/route.js
apps/platform/src/app/auth/callback/route.js
apps/platform/src/app/auth/confirm/route.js
apps/platform/src/app/chat/[accountId]/page.tsx
apps/platform/src/app/chat/layout.tsx
apps/platform/src/app/chat/page.tsx
apps/platform/src/app/layout.tsx
apps/platform/src/app/login/page.tsx
apps/platform/src/app/onboarding/page.tsx
apps/platform/src/app/page.tsx
apps/platform/src/app/plasmic-host/page.tsx
apps/platform/src/app/secure-login/page.tsx
apps/platform/src/app/setup-account/page.tsx

Appendix B: Complete Route Surface Inventory (apps/chat)

apps/chat/src/app/[accountId]/layout.jsx
apps/chat/src/app/[accountId]/page.jsx
apps/chat/src/app/api/business-settings/route.js
apps/chat/src/app/api/chat/route.js
apps/chat/src/app/api/conversations/route.js
apps/chat/src/app/api/email/route.js
apps/chat/src/app/api/leads/route.js
apps/chat/src/app/api/webhook/route.js
apps/chat/src/app/embed/page.jsx
apps/chat/src/app/layout.jsx
apps/chat/src/app/page.jsx

Appendix C: Complete Route Surface Inventory (apps/kb-studio)

apps/kb-studio/src/app/layout.jsx
apps/kb-studio/src/app/page.jsx
apps/kb-studio/src/app/projects/page.jsx
apps/kb-studio/src/app/publish/page.jsx
apps/kb-studio/src/app/review/page.jsx

Appendix D: Package and Service Capability Layers

D1 packages/*

packages/app-sdk/package.json
packages/auth/package.json
packages/branding/package.json
packages/chat-core/package.json
packages/config/package.json
packages/contracts/package.json
packages/db/package.json
packages/kb-engine/package.json
packages/permissions/package.json
packages/ui/package.json

D2 sdk/packages/*

sdk/packages/cli/package.json
sdk/packages/client/package.json
sdk/packages/manifest/package.json
sdk/packages/schemas/package.json
sdk/packages/ui/package.json

D3 services/*

services/worker/package.json
services/worker/src/index.js
services/worker/src/run-job.js

Appendix E: Migration Capability Surface (supabase/migrations)

supabase/migrations/001_multi_tenant_schema.sql
supabase/migrations/002_rls_policies.sql
supabase/migrations/003_kb_onboarding.sql
supabase/migrations/004_agency_enhancements.sql
supabase/migrations/004_agency_kb_onboarding_control.sql
supabase/migrations/005_add_performance_indexes.sql
supabase/migrations/006_fix_rls_recursion.sql
supabase/migrations/006_fix_rls_recursion_v2.sql
supabase/migrations/007_agency_dashboard_settings.sql
supabase/migrations/008_app_platform_catalog.sql
supabase/migrations/009_business_dashboard_customization.sql
supabase/migrations/010_business_runtime_fields.sql
supabase/migrations/011_agency_profile_and_invite_fields.sql
supabase/migrations/012_production_schema_repairs.sql
supabase/migrations/013_fix_knowledge_base_conflict_constraint.sql
supabase/migrations/014_business_onboarding_state.sql
supabase/migrations/015_public_chat_runtime_restore.sql
supabase/migrations/016_lead_capture_routing.sql
supabase/migrations/017_http_request_integrations.sql
supabase/migrations/018_business_connector_settings.sql
supabase/migrations/019_stripe_billing_configuration.sql
supabase/migrations/20260311120000_capabilities_system.sql
supabase/migrations/20260311120001_capabilities_rls.sql
supabase/migrations/20260311120002_add_composio_entity_id.sql
supabase/migrations/20260315120000_platform_app_imports.sql
supabase/migrations/20260315180025_create_normalization_reports.sql
supabase/migrations/999_full_deploy.sql
Last modified on April 20, 2026