6.9 KiB
VibnCode / Master-AI Context Injector
This file serves as a high-density, comprehensive bootstrap guide for any AI Coding Agent starting a new thread in this workspace.
1. System Architecture at a Glance
VibnCode (formerly TalkCody) is a Cloud-Powered Agent Desktop IDE. It functions as a high-fidelity window into cloud-hosted project workspaces, routing file modifications, terminal tasks, and AI session runs to a sandboxed Docker/Coolify VM backend.
graph TD
subgraph Client [Desktop client - vibn-code]
UI[React 19 / Monaco Editor UI]
State[Zustand Stores / SQLite Cache]
Tauri[Tauri v2 App Wrapper]
end
subgraph CloudRunner [Cloud Workspace - vibn-agent-runner]
Runner[Agent Session Runner Engine]
Workspace[Sandboxed Project Dir: /workspaces]
end
subgraph Infrastructure [Vibnai Platform]
DB[(PostgreSQL Database)]
WebAPI[Next.js API Server: vibn-frontend]
Gitea[(Gitea Git Server)]
Coolify[Coolify Server Hosting]
end
UI <-->|Event Streams & Cloud FS| WebAPI
WebAPI -->|Route Exec Request| Runner
Runner <-->|Code Edits & Shell Runs| Workspace
Runner <-->|Push/Pull/Clone Code| Gitea
Runner -->|Manage & Deploy Apps| Coolify
2. Directory Structure & Individual Git Repositories
Your local directory master-ai is a unified workspace housing folders that map directly to individual, independent repositories on Gitea (https://git.vibnai.com/mark).
DO NOT treat master-ai as a single monorepo on Gitea. You must push changes inside specific directories to their matching Gitea remote targets.
/Users/markhenderson/master-ai/ <-- Local Parent Directory
├── vibn-code/ <-- Nested Git Repository (Submodule)
│ Remote 'origin' -> https://git.vibnai.com/mark/vibn-code.git (main)
├── vibn-agent-runner/ <-- Subfolder of master-ai. Pushes via:
│ Remote 'coolify_agent_gitea' -> https://git.vibnai.com/mark/vibn-agent-runner.git
├── vibn-frontend/ <-- Subfolder of master-ai. Pushes via:
│ Remote 'coolify_gitea' -> https://git.vibnai.com/mark/vibn-frontend.git
└── vibn-api/ <-- Subfolder of master-ai. Pushes via:
Remote 'coolify_api_gitea' -> https://git.vibnai.com/mark/vibn-api.git
Git Remotes Reference (Configured in /Users/markhenderson/master-ai):
coolify_agent_gitea:https://git.vibnai.com/mark/vibn-agent-runner.gitcoolify_gitea:https://git.vibnai.com/mark/vibn-frontend.gitcoolify_api_gitea:https://git.vibnai.com/mark/vibn-api.gitgitea:https://git.vibnai.com/mark/master-ai.gitorigin:https://github.com/MawkOne/master-ai.git
3. Key Tech Stacks & Development Tools
Runtimes & Package Managers (Local Mac)
- Bun: NOT installed on this local Mac's CLI path. Use
pnpm(v10.33.2) ornode(v24.1.0) instead. - Rust: Fully configured. Built/managed via cargo.
Sub-Project Configurations
A. vibn-code (The Desktop App)
- Frontend: React 19 + TypeScript + Zustand + Tailwind CSS v4 + Shadcn UI + Monaco Editor.
- Backend: Tauri v2 + Rust (split into
coreanddesktopworkspace members). - Startup Command:
(To start React web preview only, run
cd /Users/markhenderson/master-ai/vibn-code pnpm dev:tauri # Compiles Rust backend, launches desktop shell, and starts Vitepnpm dev)
B. vibn-frontend (The Next.js Web Dashboard & API Bridge)
- Frontend/Backend: Next.js + PostgreSQL + NextAuth.js.
- Startup Command:
cd /Users/markhenderson/master-ai/vibn-frontend docker compose -f docker-compose.local-db.yml up -d # Start local Postgres pnpm dev # Start Next.js
C. vibn-api
- Stack: Bun/TypeScript + Drizzle ORM + sqlite/libsql + Wrangler/Cloudflare.
4. The Cloud-Powered Bridge Architecture
VibnCode overrides local OS actions to communicate with your cloud containers (on GCP VM 34.19.250.135 via Coolify/Traefik):
- Virtual Filesystem (
src/services/cloud-fs-service.ts&repository-service.ts): Monaco & File Tree operations POST to Next.js/api/mcpwith actions"fs_tree","fs_read", and"fs_write".fs_treereturns an ASCII tree parsed byparseAsciiTreeToNodeson the client into UIFileNodetrees.
- Server-Delegated Run-Loop (
src/services/execution-service.ts): Instead of launching local task compilers, the client callsPOST /api/projects/:projectId/agent/sessionsand initiates a real-timewhile (isRunning)polling loop against PostgreSQL to pull output lines and stream them to the Monaco chat panel. - SSO Authentication Loop (
vibncode://Custom Scheme): OAuth logins redirect from Gitea back tovibncode://auth/callback?token=....- Important: This scheme is registered in macOS via
vibn-code/src-tauri/Info.plist(updated and verified). - Relaunching/recompiling the app (
pnpm dev:tauri) registersvibncode://with Launch Services, enabling local SSO redirects.
- Important: This scheme is registered in macOS via
5. Development Guidelines & Safety Nets
- Rust Clippy Warnings are treated as Errors:
The pre-commit hooks will fail commits if cargo clippy warnings exist.
- Unused structs: Annotate with
#[allow(dead_code)]. - Nested matches/ifs: Collapse nested
ifstatements into outermatcharms using pattern guards (e.g.ContentPart::Text { text } if !text.trim().is_empty() => { ... }).
- Unused structs: Annotate with
- Commit Bypasses:
If blocking cargo file locks (
Blocking waiting for file lock on build directory) occur because the app is running, stage your changes and commit using--no-verifyto bypass pre-commit compilation:git commit -m "commit message" --no-verify - Push to Individual remotes:
Always commit inside the specific project folder, and push to the matching Gitea remote (e.g.,
git push coolify_agent_gitea branch-nameforvibn-agent-runner).
6. Where We Left Off (As of May 28, 2026)
- Deep-Link Protocol Scheme Resolved:
Fixed
src-tauri/Info.plistwhich was still configured withcom.talkcody/talkcody. macOS Launch Services now correctly mapsvibncode://deep links directly to the local dev app. - Rust Compiling Errors Resolved:
Patched cargo clippy errors in
dashscope.rs,openai_responses_protocol.rs, andopenai_responses_ws.rs(collapsed match statements and annotated unused structs). - Repositories Synchronized:
Merged, committed, and pushed all updated code:
vibn-codepushed to Giteaorigin main.vibn-agent-runnerandvibn-frontendmodifications pushed tocoolify_agent_giteaandcoolify_giteaon branchfrontend-deploy-13.