Skip to main content

V4 Source Code Reference

This document describes the source code copied from the coditect-v4 submodule for reference and potential integration.

Overview

All directories are prefixed with v4- to clearly distinguish them from the current t2 project source code.

Directory Mapping

Original (coditect-v4)Copied To (t2)SizeDescription
src/frontendsrc/frontend-original2.6MReact frontend with TypeScript
src/ai-prompt-refiner-server-clientsrc/v4-ai-prompt-refiner-server-client1.0MAI prompt refinement service
src/graph-ragsrc/v4-graph-rag904KGraph-based RAG implementation
src/api-v2src/v4-api-v2432KAPI v2 backend (Rust/Axum)
src/dspy-servicesrc/v4-dspy-service148KDSPy integration service
src/websocket-gatewaysrc/v4-websocket-gateway104KWebSocket gateway for real-time
src/sdksrc/v4-sdk60KTypeScript SDK
src/terminal-coresrc/v4-terminal-core56Kterminal core functionality
src/coditect-serversrc/v4-coditect-server8KCODI server stub
src/terminalsrc/v4-terminal8Kterminal wrapper
src/feedback-servicesrc/v4-feedback-service4KFeedback collection service

Total Size: ~5.3MB

Purpose

These directories serve as reference implementations for:

  1. Frontend Integration - Compare React frontend with Eclipse theia approach
  2. API Design - Review Rust/Axum API patterns for FoundationDB integration
  3. Real-time Features - WebSocket gateway architecture
  4. AI Integration - Prompt refinement and DSPy patterns
  5. terminal - xterm.js integration patterns

Current t2 Project Structure

The t2 project is building on Eclipse theia (NOT building from scratch) with:

  • src/browser/ - theia browser extensions (llm integration, etc.)
  • src/agents/ - Multi-agent system
  • src/services/ - Core services (llm, MCP, A2A, FDB)
  • src/file-monitor/ - Rust file monitoring (active development)

Integration Strategy

Do NOT Copy Directly

The v4 code is a traditional web app. The t2 project is building theia extensions.

Use as Reference

  1. API Patterns (v4-api-v2) - FoundationDB integration patterns
  2. WebSocket (v4-websocket-gateway) - Real-time communication approach
  3. Frontend Components (frontend-original) - UI patterns (adapt for theia)
  4. SDK (v4-sdk) - TypeScript type definitions

Key Differences

AspectV4 (Reference)T2 (Current)
IDECustom React appEclipse theia extensions
editorCustom Monaco integrationtheia's Monaco
terminalCustom xterm.jstheia's terminal
File TreeCustom componenttheia's file explorer
BuildVitetheia build (Webpack)
ArchitectureStandalone web appExtension-based

When to Reference V4 Code

Good reasons to reference:

  • Understanding FoundationDB keyspace patterns
  • WebSocket message formats
  • API endpoint design
  • Type definitions
  • UI component styling ideas

Bad reasons to reference:

  • Copying IDE features (theia has them)
  • editor implementation (use theia's)
  • File tree implementation (use theia's)
  • terminal implementation (use theia's)
  • Main CLAUDE.md - Project guidance at /workspace/PROJECTS/t2/CLAUDE.md
  • ADR-014 - Eclipse theia decision (why NOT building from scratch)
  • Architecture - System design at docs/architecture/architecture.md
  • File Monitor - Rust implementation at src/file-monitor/

Cleanup Strategy

After extracting needed patterns and types:

  1. Document what was learned/extracted
  2. Create integration guides for specific features
  3. Consider archiving reference code to reduce clutter
  4. Keep only actively referenced directories

Notes

  • Copied: 2025-10-06
  • Source: coditect-v4 submodule (commit as of 2025-10-06)
  • All symlinks preserved with cp -a
  • Total: 11 directories, ~5.3MB

Remember: These are reference implementations for a traditional web app. The t2 project is building theia extensions, not a standalone IDE.