- Add `bun lint` and `bun typecheck` as required done criteria - Expand package role descriptions, including `apps/desktop` - Update contracts note to `effect/Schema` terminology
2.4 KiB
2.4 KiB
CLAUDE.md
Project Snapshot
T3 Code is a minimal web GUI for using code agents like Codex and Claude Code (coming soon).
This repository is a VERY EARLY WIP. Proposing sweeping changes that improve long-term maintainability is encouraged.
Core Priorities
- Performance first.
- Reliability first.
- Keep behavior predictable under load and during failures (session restarts, reconnects, partial streams).
If a tradeoff is required, choose correctness and robustness over short-term convenience.
Required Commands
bun lintbun typecheck
Both of these commands should pass for a task to be considered "done".
Package Roles
apps/desktop: Electron desktop app. Wraps the Node.js WebSocket server and React web app.apps/server: Node.js orchestration runtime and WebSocket edge. Implements the orchestrator<->provider adapter pattern, brokering turns/events between provider runtimes and clients while serving the React web app. Currently supported providers are Codex (through the Codex app-server).apps/web: React/Vite UI. Owns session UX, conversation/event rendering, and client-side state. Connects to the server via WebSocket.packages/contracts: Sharedeffect/Schemaschemas and TypeScript contracts for provider events, WebSocket protocol, and model/session types.
Codex App Server (Important)
T3 Code is currently Codex-first. The server starts codex app-server (JSON-RPC over stdio) per provider session, then streams structured events to the browser through WebSocket push messages.
How we use it in this codebase:
- Session startup/resume and turn lifecycle are brokered in
apps/server/src/codexAppServerManager.ts. - Provider dispatch and thread event logging are coordinated in
apps/server/src/providerManager.ts. - WebSocket server routes NativeApi methods in
apps/server/src/wsServer.ts. - Web app consumes orchestration domain events via WebSocket push on channel
orchestration.domainEvent(provider runtime activity is projected into orchestration events server-side).
Docs:
- Codex App Server docs: https://developers.openai.com/codex/sdk/#app-server
Reference Repos
- Open-source Codex repo: https://github.com/openai/codex
- Codex-Monitor (Tauri, feature-complete, strong reference implementation): https://github.com/Dimillian/CodexMonitor
Use these as implementation references when designing protocol handling, UX flows, and operational safeguards.