Commit Graph

75 Commits

Author SHA1 Message Date
bedd7d3470 feat(build): AI architecture recommendation with review + confirm flow
- New /api/projects/[projectId]/architecture (GET/POST/PATCH) — reads PRD
  + phases, calls AI to generate structured monorepo architecture JSON,
  persists to fs_projects.data.architecture; PATCH sets confirmed flag
- Rebuilt Build tab to show the AI-generated recommendation: expandable
  app cards (tech stack, key screens), shared packages, infrastructure,
  integrations, and risk notes; confirm button + "adjustable later" note

Made-with: Cursor
2026-03-03 21:02:06 -08:00
156232062d Fix: always show AtlasChat on overview (not OrchestratorChat after PRD save)
Made-with: Cursor
2026-03-03 20:45:26 -08:00
9e4450e400 Fix: strip tool messages from preloaded history (Gemini ordering error) + cast PRD param to text
Made-with: Cursor
2026-03-03 20:36:41 -08:00
3896eb671c feat: PWA support + mobile-responsive layout + QR code to open Atlas on phone
Made-with: Cursor
2026-03-02 20:56:20 -08:00
585343968e feat: live phase completion in right panel + saved phase data in PRD page
Made-with: Cursor
2026-03-02 20:44:36 -08:00
5bfbe86541 feat: inline Save Phase button in Atlas chat when phase is complete
Made-with: Cursor
2026-03-02 20:24:08 -08:00
7732b5fbea Fix settings layout: replace deleted components with VIBNSidebar
Made-with: Cursor
2026-03-02 19:37:12 -08:00
33ec7b787f Major cleanup: remove all dead pages and components
Components deleted (~27 files):
- components/ai/ (9 files — collector, extraction, vision, phase sidebar)
- components/assistant-ui/ (thread.tsx, markdown-text.tsx)
- components/mission/, sidebar/, extension/, icons/
- layout/app-shell, left-rail, right-panel, connect-sources-modal,
  mcp-connect-modal, page-header, page-template, project-sidebar,
  workspace-left-rail, PAGE_TEMPLATE_GUIDE
- chatgpt-import-card, mcp-connection-card, mcp-playground

Project pages deleted (~20 dirs):
- analytics, api-map, architecture, associate-sessions, audit,
  audit-test, automation, code, context, design-old, docs, features,
  getting-started, journey, market, mission, money, plan, product,
  progress, sandbox, sessions, tech, timeline-plan

Workspace routes deleted (~12 dirs):
- connections, costs, debug-projects, debug-sessions, keys, mcp,
  new-project, projects/new, test-api-key, test-auth, test-sessions, users

Remaining: 5 components, 2 layout files, 8 project tabs, 3 workspace routes
Made-with: Cursor
2026-03-02 19:22:13 -08:00
0146ae7df6 Persist Atlas chat history; fix re-greeting on refresh
- GET /api/projects/[id]/atlas-chat returns stored user+assistant messages
- POST handles __atlas_init__ trigger: runs once when no history exists,
  not stored as a user turn so Atlas intro appears cleanly
- Rewrite AtlasChat.tsx: fully self-contained component with own message
  state; loads history from DB on mount, only greets on first open
- Remove assistant-ui runtime dependency for message persistence
- Add Vision & Success Metrics, Integrations & Dependencies, Open Questions
  to PRD section tracker (now 12 sections matching the PDF)

Made-with: Cursor
2026-03-02 16:55:10 -08:00
9fc643f9b6 Restyle design page to match Stackless aesthetic
- Replace all Tailwind/shadcn classes with inline styles
- Use warm beige palette, Outfit/Newsreader fonts, Stackless card pattern
- Replace Lucide icons with simple Unicode glyphs
- Surface picker and left nav match the sidebar/activity visual language
- Controls bar (library tabs, swatches, lock-in) restyled to match

Made-with: Cursor
2026-03-02 16:44:37 -08:00
7f452c0420 Add Launch, Grow, Insights tabs; rename Deploy → Launch
- Rename Deploy tab label to Launch in ProjectShell
- Add Grow and Insights placeholder pages with Stackless styling

Made-with: Cursor
2026-03-02 16:39:13 -08:00
d60d300a64 Complete Stackless parity: Activity, Deploy, Settings, header desc
- Add project description line to project header (from productVision)
- Sidebar: add Activity nav item (Projects / Activity / Settings)
- New Activity page: timeline feed with type filters (Atlas/Builds/Deploys/You)
- New Activity layout using VIBNSidebar
- Rewrite Deploy tab: Project URLs, Custom Domain, Env Vars, Deploy History
  — fully Stackless style, real data from project API, no more MOCK_PROJECT
- Rewrite Project Settings tab: remove all Firebase refs (db, auth, Firestore)
  — General (name/description), Repo link, Collaborators, Export JSON/PDF,
  — Danger Zone with double-confirm delete
  — uses /api/projects/[id] PATCH for saves

Made-with: Cursor
2026-03-02 16:33:09 -08:00
59c8ec2e02 Switch to Outfit/Newsreader/IBM Plex Mono, add Stackless global polish
- Replace Geist with Outfit (sans), Newsreader (serif), IBM Plex Mono
  loaded via next/font for optimal performance and no layout shift
- Wire --font-sans/serif/mono CSS variables to new fonts
- body/button/input now render in Outfit by default
- Add Stackless global polish: 4px thin scrollbars (#d0ccc4 thumb),
  black ::selection, input placeholder color #b5b0a6

Made-with: Cursor
2026-03-02 16:21:20 -08:00
94bb9dbeb4 Add Stackless right panel to project shell
Shows Discovery phase tracker (Big Picture → Risks), Captured data
from Atlas, and Project Info (created, last active, features).
Data flows from DB via layout server component.

Made-with: Cursor
2026-03-02 16:11:58 -08:00
aaa3f51592 Adopt Stackless UI: warm palette, sidebar, project tab bar with Design tab
- Add Google Fonts (Newsreader/Outfit/IBM Plex Mono) + warm beige CSS palette
- New VIBNSidebar: Stackless-style 220px sidebar with project list + user footer
- New ProjectShell: project header with name/status/progress% + tab bar
- Tabs: Atlas → PRD → Design → Build → Deploy → Settings
- New /prd page: section-by-section progress view
- New /build page: locked until PRD complete
- Projects list page: Stackless-style row layout
- Simplify overview page to just render AtlasChat

Made-with: Cursor
2026-03-02 16:01:33 -08:00
7ba3b9563e refactor: move all design controls below scaffold render
Theme swatches removed from inside scaffold components. Theme state
lifted to SurfaceSection which passes themeColor down as a prop.

Controls bar below the scaffold now has three rows:
  1. Library tabs (shadcn / Mantine / HeroUI / Tremor etc.)
  2. Color theme swatches — only shown when the active library has
     theme variants (shadcn: 8, Mantine: 6, HeroUI: 5, Tremor: 5,
     DaisyUI: 12, HeroUI marketing: 6)
  3. Description + tags + Docs link + Lock in button

Scaffold renders cleanly with no UI chrome inside it.

Made-with: Cursor
2026-03-02 14:06:53 -08:00
817fe3a1a4 refactor: move design controls below scaffold preview
Made-with: Cursor
2026-03-02 13:50:15 -08:00
54248887f1 feat: design page scaffold previews with library toggle
Each surface now shows a realistic scaffold preview in a browser chrome
frame. Tab bar at the top toggles between library options (shadcn,
DaisyUI, HeroUI, Mantine, Aceternity, etc.) — the scaffold updates
instantly to show that library's visual language. Lock in confirms
the choice. Scaffolds cover all 6 surfaces × their library options.

Made-with: Cursor
2026-03-02 12:47:10 -08:00
7cf4f2ef78 feat: design page - left nav for surface selection, main area for theme picker
Made-with: Cursor
2026-03-02 12:36:40 -08:00
ea54440be7 refactor: simplify project nav to AI Chat (overview) + Design only
- AI Chat nav item now routes to /overview instead of /v_ai_chat
- Removed Plan, Docs, Tech, Journey nav items
- Deleted old v_ai_chat page
- Cleaned up unused imports and route detection logic

Made-with: Cursor
2026-03-02 12:29:32 -08:00
7be66f60b7 fix: qualify table references in design-surfaces SQL to resolve ambiguous column error
Made-with: Cursor
2026-03-01 21:30:12 -08:00
62731af91f feat: design surfaces page with two-phase theme picker
Phase 1: user picks which surfaces their product needs (Web App,
Marketing Site, Admin, Mobile, Email, Docs). Phase 2: per-surface
horizontal card gallery with mini visual previews of each UI library.
Lock in confirms the choice; locked themes are saved to DB and shown
to the AI coder. Surfaces and themes stored in fs_projects.data.

Made-with: Cursor
2026-03-01 21:14:20 -08:00
287bc96fac feat: design packages page — pick UI library per Turborepo app
Replaces the old design page with a per-app package selector. Fetches
real apps/ from the project's Gitea repo and lets users assign a UI
library (shadcn, DaisyUI, HeroUI, Mantine, Headless UI, or Tailwind
only) independently per app. Selections saved to fs_projects.data.designPackages.

Made-with: Cursor
2026-03-01 20:33:39 -08:00
c842a4b75b fix: clean up chat UI layout and align theme to neutral white
- Replace beige background with clean neutral white (matches Grok aesthetic)
- Remove hardcoded hex colors in thread.tsx - use CSS variables throughout
- Remove scroll-to-bottom button that showed incorrectly after auto-send
- Chat container now integrates visually with the page instead of floating

Made-with: Cursor
2026-03-01 20:21:39 -08:00
296324f424 refactor: simplify overview page — header above chat, remove widget grid
Move project name/badges/Refresh/Open IDE above the agent chat panel.
Remove stats, code repo, deployment, PRs, issues, resources sections.

Made-with: Cursor
2026-03-01 16:01:35 -08:00
26a11412b5 feat: add Atlas discovery chat UI and API route
- components/AtlasChat.tsx — conversational PRD discovery UI (violet theme)
- app/api/projects/[projectId]/atlas-chat/route.ts — proxy + DB persistence
- overview/page.tsx — show Atlas for new projects, Orchestrator once PRD done

Made-with: Cursor
2026-03-01 15:56:32 -08:00
35675b7d86 fix: stop prisma from dropping custom tables on every deploy
entrypoint.sh: removed --accept-data-loss from prisma db push.
That flag was silently dropping fs_users, fs_projects etc. on every
container restart, wiping all user/project data. Made the push
non-fatal so a schema mismatch doesn't block startup.

create/route.ts: fixed same broken ON CONFLICT expression as
authOptions.ts — replaced with explicit SELECT + INSERT/UPDATE
to reliably upsert fs_users before inserting the project.

Made-with: Cursor
2026-02-27 19:15:55 -08:00
8c3486dd58 feat: persistent AI memory — chat history + knowledge store
agent-chat/route.ts:
- Loads conversation history from chat_conversations before each turn
- Passes history + knowledge context to agent runner
- Saves returned history back to chat_conversations after each turn
- Saves AI-generated memory updates to fs_knowledge_items

knowledge/route.ts (new):
- GET  /api/projects/[id]/knowledge — list all knowledge items
- POST /api/projects/[id]/knowledge — add/update item by key
- DELETE /api/projects/[id]/knowledge?id=xxx — remove item

OrchestratorChat.tsx:
- Added "Saved to memory" label for save_memory tool calls

Made-with: Cursor
2026-02-27 18:55:41 -08:00
b2b3424b05 fix: clean up orchestrator chat UX
- Tool call names now show human-readable labels ("Dispatched agent"
  instead of "spawn_agent"), deduped if called multiple times
- Model label only shown when a real value is returned; "unknown"
  and null are suppressed; model names shortened (GLM-5, Gemini)

Made-with: Cursor
2026-02-27 18:15:50 -08:00
fe89087cc5 fix: correct auth import path in agent-chat route
Was importing from @/lib/auth (which doesn't exist); correct path
is @/lib/auth/authOptions — this caused the Turbopack build to fail.

Made-with: Cursor
2026-02-27 18:09:22 -08:00
8d95a74cc6 add orchestrator chat to project overview
- OrchestratorChat component with Lovable-style UI (suggestion chips, reasoning panel, tool call badges)
- /api/projects/[projectId]/agent-chat proxy route to agent runner
- Injects project context (repo, vision, deployment URL) into session
- AGENT_RUNNER_URL wired to agents.vibnai.com

Made-with: Cursor
2026-02-27 18:06:02 -08:00
c9ef2379ec fix: upsert fs_users before inserting fs_projects to satisfy FK constraint
Made-with: Cursor
2026-02-27 13:36:25 -08:00
ef7a88e913 migrate: replace Firebase with PostgreSQL across core routes
- chat-context.ts: session history now from fs_sessions
- /api/sessions: reads from fs_sessions (NextAuth session auth)
- /api/github/connect: NextAuth session + stores in fs_users.data
- /api/user/api-key: NextAuth session + stores in fs_users.data
- /api/projects/[id]/vision: PATCH to fs_projects JSONB
- /api/projects/[id]/knowledge/items: reads from fs_knowledge_items
- /api/projects/[id]/knowledge/import-ai-chat: uses pg createKnowledgeItem
- lib/server/knowledge.ts: fully rewritten to use PostgreSQL
- entrypoint.sh: add fs_knowledge_items and chat_conversations tables

Made-with: Cursor
2026-02-27 13:25:38 -08:00
8587644a62 feat: turborepo monorepo scaffold and provisioning
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 16:44:37 -08:00
f4ab70822c fix: handle Gitea 409 on project create by linking to existing repo
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 17:16:24 -08:00
aeedc76a18 fix: correct authOptions import path in prewarm route
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 16:26:43 -08:00
1ff58049c0 feat: pass GITEA_TOKEN to IDE containers + prewarm on project list load
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 16:13:09 -08:00
aa2f5dbc3a feat: add Provision IDE button for projects without a workspace
- POST /api/projects/[id]/workspace: provisions a Cloud Run Theia service
  on demand and saves the URL to the project record
- overview/page.tsx: shows 'Provision IDE' button when theiaWorkspaceUrl
  is null, 'Open IDE' link once provisioned
- Also fixes log spam: retired Firebase session tracking endpoint (410 Gone)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 15:36:18 -08:00
81cca70542 fix: retire legacy Firebase session tracking endpoint
Returns 410 Gone instead of crashing with adminDb.collection errors.
Was flooding logs with TypeError on every call from the old Cursor extension.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 15:26:12 -08:00
783700a7db feat: add proper marketing footer with privacy/terms links
- marketing/components/footer.tsx: multi-column footer with product,
  resources, and legal columns — Privacy Policy clearly linked on homepage
  (satisfies Google OAuth consent screen requirement)
- Replaces thin single-line footer in layout.tsx

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 15:16:53 -08:00
85a355334a feat: add privacy policy and terms of service pages
- /privacy — BC PIPA/PIPEDA compliant privacy policy
- /terms — Terms of service governed by BC law
- Footer updated with Privacy, Terms, and Contact links

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 15:06:49 -08:00
e7f33211b9 feat: migrate Gemini from Vertex AI to Google AI Studio API key
- gemini-client.ts: replaces Vertex AI REST + service account auth with
  direct generativelanguage.googleapis.com calls using GOOGLE_API_KEY.
  Removes all Firebase credential setup code.
- summarize/route.ts: same migration, simplified to a single fetch call.
- No longer depends on gen-lang-client-0980079410 GCP project for AI calls.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 14:35:44 -08:00
106d9c5ff1 feat: switch workspace provisioning from Coolify to Cloud Run
- lib/cloud-run-workspace.ts: provisions per-project Theia workspaces as
  Cloud Run services (theia-{slug}), scales to zero when idle, starts in
  ~5-15s from cached image
- create/route.ts: imports cloud-run-workspace instead of coolify-workspace
- Image: northamerica-northeast1-docker.pkg.dev/master-ai-484822/vibn-ide/theia:latest
- Includes prewarmWorkspace() for near-zero perceived load time on login

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 14:01:02 -08:00
a22d5a0f18 feat: provision dedicated per-project Theia workspaces
- lib/coolify-workspace.ts: creates a Coolify docker-image app at
  {slug}.ide.vibnai.com for each project, patches in vibn-auth Traefik
  labels, sets env vars, and starts deployment
- create/route.ts: provisions Theia workspace after Gitea repo creation;
  stores theiaWorkspaceUrl + theiaAppUuid on the project record
- theia-auth/route.ts: for *.ide.vibnai.com hosts, verifies the
  authenticated user is the project owner (slug → fs_projects lookup)
- overview/page.tsx: Open IDE always links (dedicated URL or shared fallback)
- project-creation-modal.tsx: shows dedicated workspace URL in success screen

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 13:14:21 -08:00
e3a6641e3c fix: migrate AI chat system from Firebase/Firestore to Postgres
Firebase was not configured so every chat request crashed with
'Firebase Admin credentials not configured'.

- chat-mode-resolver.ts: read project phase from fs_projects (Postgres)
- chat-context.ts: load project data from fs_projects instead of Firestore
- /api/ai/conversation: store/retrieve conversations in chat_conversations
  Postgres table (created automatically on first use)
- /api/ai/chat: replace all Firestore reads/writes with Postgres queries
- v_ai_chat/page.tsx: replace Firebase client auth with useSession from
  next-auth/react; remove Firestore listeners, use REST API for project data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 12:07:03 -08:00
6668cc84fa fix: wrap useSearchParams in Suspense, add linux-musl prisma target
- useSearchParams() requires a Suspense boundary in Next.js App Router
- Prisma binaryTargets was missing linux-musl (alpine build environment)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-18 18:21:10 -08:00
1146d8d129 fix: correct Theia ForwardAuth redirect loop
Two issues:
1. ForwardAuth redirect used x-forwarded-host which Traefik sets to
   vibnai.com (the auth service host), not theia.vibnai.com. Now
   hardcodes THEIA_URL as the callbackUrl destination.
2. /auth page ignored callbackUrl and always sent users to
   /marks-account/projects. Now follows callbackUrl when it points
   to theia.vibnai.com, so users land in the IDE after login.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-18 18:17:16 -08:00
d00979f89e fix: use rows array returned by query(), not result.rows
db-postgres.ts query() returns T[] directly, not a QueryResult object.
result.rows was undefined, causing the session lookup to always
return null and redirect to login even with a valid session token.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-18 17:39:41 -08:00
c410c1759a debug: add logging to theia-auth session lookup
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-18 17:35:56 -08:00
008b04d2dd debug: add ?debug=1 endpoint to theia-auth for cookie inspection
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-18 16:57:49 -08:00