AI Engineering Workspace
PartialChat, files, terminal and preview in one place. Chat sessions run on a durable Postgres-backed queue (chat only: no tools or shell). Live models need an API key; the terminal is unavailable.
Project files
read-onlyCLAUDE.md
1# CLAUDE.md23This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.45## Environment quirks6- No passwordless sudo: everything runs in user space. Node 22 lives in `~/.local/node/bin` (not on PATH by default): `export PATH=$HOME/.local/node/bin:$PATH`. `scripts/env.sh` does this for scripts.7- Do not use `pkill -f` with patterns that appear in your own command line (it kills the tool shell). Use `scripts/stop-app.sh`.8- Keep `typescript@5.9` — Next 15 does not support TypeScript 7.9- SQLite rows are null-prototype objects: map to plain objects before passing to Client Components.10- Chromium for Playwright needs libs unpacked in `~/.local/chromelibs`: `export LD_LIBRARY_PATH=$HOME/.local/chromelibs/usr/lib/x86_64-linux-gnu`.1112## Commands (run from `app/` unless noted)13- Build: `npx next build` · Typecheck: `npx tsc --noEmit`14- Deploy (build, restart, health-check, record deployment): `scripts/deploy.sh [version]` from repo root. Edge serves HTTP `:8080` (read-only) and HTTPS `:8443`; Next app is loopback `:3000`. Build takes ~2 min: run in background and do not edit `app/src` meanwhile.15- Supervisor: `scripts/ensure-running.sh` (cron `@reboot` + every minute). Logs in `.runtime/`.16- Also `node qa/opencode-engine.mjs` and `node qa/ai-adapters.mjs` (test doubles). Sign-ins are rate-limited (8/min): QA uses `qaLogin`/`uiLogin` retry helpers.17- Full browser QA (5 viewports, functional, security): `node qa/run.mjs [baseUrl]` — writes `design/verification/results.json` and publishes screenshots.1819## Architecture20- `app/` Next.js App Router. Server components read directly from `src/lib/*`; mutations go through `src/app/api/*` route handlers guarded by `requireWrite()` (same-origin check + session).21- Data is PostgreSQL 16 in user space (`scripts/pg-*.sh`). Route groups: `(marketing)` public Zoo Cloud site, `(app)` authenticated shell (`/console` home). Endpoints/cookies come from `src/lib/config.ts` (never hard-code a domain).22- AI: `app/scripts/worker.mjs` claims `ai_runs` (SKIP LOCKED, lease/heartbeat, retries, handoff); adapters in `ai-adapters.mjs`; OpenCode engine in `opencode-engine.mjs` (CLI child process, deny-by-default policy, per-project lock + git worktree). Never use `pkill -f`/`pgrep -f` with your own command text; keep supervisor lock fd out of children (see ensure-running.sh).23- Auth is an interim local token (`~/.config/zoo-cloud-studio/admin-token`) with server-side sessions in PostgreSQL, HTTPS-only, pending Zoo IAM OIDC. Public visitors see a read-only demo view; project data, audit log and all writes require sign-in.24- `src/lib/modules.ts` is the single source of module/feature maturity; `/progress` and the sidebar derive from it. Update it whenever a feature's real state changes — never mark simulated things as functional.25- `src/lib/design.ts`: public `/design-assets/*` serves only files listed in `design/manifests/manifest.json` whose sha256 still matches. Screenshots are staged then published with a manifest rebuild (`POST /api/design/rebuild`). `src/lib/ssrf.ts` guards URL ingestion.26- `src/lib/audit.ts`: append-only SHA-256 hash-chained audit log. `src/lib/files.ts`: read-only, deny-listed file explorer.27- Data: PostgreSQL (SQLite file `app/data/studio.db` retained only as migration backup). Workspaces: `app/data/workspaces/<projectId>`. Design assets: `design/`.2829## Project state docs30`docs/SPEC.md` (R0 architecture, authoritative), `docs/TRACKER.md`, plus root `PROJECT-STATE.md`, `BLOCKERS.md`, `NEXT-ACTIONS.md`, `EXECUTION-QUEUE.md`, `DEPLOYMENT-STATUS.md`, `TEST-RESULTS.md`, `DESIGN-STATUS.md`, `MASTER-TRACKER.md`. `BLOCKERS.md` and `NEXT-ACTIONS.md` bullets feed `/progress`.3132## Constraints33Dedicated OIDC client `zoo-cloud-studio` only; never touch other Zoo systems; no secrets in repo/UI; agents never get host root or docker.sock; no simulated integration shown as live.34
Conversation
PartialSign in to start AI sessions.
Task checklist
- Application shell deployed
- Persistent projects
- Agent runtime
- Sandboxed terminal
Execution activity
No agent sessions. Git HEAD fb22adb on master.
Approval requests
None pending.