-
Notifications
You must be signed in to change notification settings - Fork 45
Development Guide
McNabsys edited this page Mar 16, 2026
·
2 revisions
- Node.js 20+
- npm 10+
- Python 3.10+ (optional, for test runner)
-
ANTHROPIC_API_KEYenvironment variable
git clone https://github.com/zoidbergclawd/elisa.git
cd elisa
npm install # Installs root + backend + frontend deps
npm run dev:electron # Launches backend, frontend, and Electron window| Script | What It Does |
|---|---|
npm run dev |
Start backend + frontend (browser-only, no Electron) |
npm run dev:electron |
Start backend + frontend + Electron window |
npm run build:frontend |
Vite production build → frontend/dist/
|
npm run build:backend |
esbuild bundle → backend/dist/server-entry.js
|
npm run build:electron |
tsc compile electron/main.ts + preload.ts
|
npm run dist |
electron-builder → installer (NSIS/DMG) |
| Script | What It Does |
|---|---|
npm run dev |
Start with tsx watch (port 8000, auto-reload) |
npm run start |
Production start |
npm run test |
Vitest (single run) |
npm run test:watch |
Vitest (watch mode) |
| Script | What It Does |
|---|---|
npm run dev |
Dev server (port 5173, proxies /api and /ws to backend) |
npm run build |
Type-check + production build |
npm run lint |
ESLint |
npm run test |
Vitest (single run) |
npm run test:watch |
Vitest (watch mode) |
| Variable | Required | Default | Purpose |
|---|---|---|---|
ANTHROPIC_API_KEY |
Yes | — | Claude API/SDK access |
CLAUDE_MODEL |
No | claude-opus-4-6 |
Override agent model |
NARRATOR_MODEL |
No | claude-haiku-4-5-20251001 |
Override narrator model |
CORS_ORIGIN |
No | http://localhost:5173 |
Override CORS origin in dev |
PORT |
No | 8000 |
Backend port |
OPENAI_API_KEY |
No | — | Optional. Enables audio features (STT via Whisper, TTS via OpenAI TTS) |
elisa/
package.json Root: Electron deps, build/dev scripts
electron/ Electron main process, preload, settings
frontend/ React 19 + Vite 7 SPA
src/components/ UI component tree
src/hooks/ React hooks (session, health, WebSocket)
src/lib/ Utilities (nugget files, skill templates)
src/types/ TypeScript definitions
backend/ Express 5 + TypeScript server
src/routes/ REST endpoint handlers
src/services/ Core services (orchestrator, runners, hardware)
src/services/phases/ Pipeline stages (plan, execute, test, deploy)
src/prompts/ Agent role prompts + curriculum
src/utils/ DAG, validation, logging, tokens
src/tests/ Backend tests
hardware/ ESP32 templates + shared MicroPython library
scripts/ Build tooling (esbuild bundler)
docs/ Documentation
Both backend and frontend use Vitest.
-
Backend tests:
cd backend && npm test -
Frontend tests:
cd frontend && npm test - Test files are colocated with source (
.test.ts/.test.tsx) - Behavioral/integration tests live in
backend/src/tests/behavioral/
Every bug fix must include tests that:
- Reproduce the failure (the test would fail if the bug were reintroduced)
- Prove the fix works
- Add the route handler in the appropriate file under
backend/src/routes/. - Register it in
backend/src/server.ts. - If it emits WebSocket events, add the event type to the
WSEventunion in the types file. - Update the API Reference.
- Update
backend/CLAUDE.mdAPI table.
- Define the block in
frontend/src/components/BlockCanvas/blockDefinitions.tsfollowing existing patterns (colour, fields, connections). - Add it to the appropriate category in
frontend/src/components/BlockCanvas/toolbox.ts. - Add interpretation logic in
frontend/src/components/BlockCanvas/blockInterpreter.tsto map it into NuggetSpec. - Rebuild and test — the block appears in the palette automatically.
- Add the role to the
AgentRoletype in the backend types. - Create a new prompt template in
backend/src/prompts/. - Update
MetaPlannerprompt to understand the new role. - Configure any role-specific behavior in
AgentRunner. - Add a corresponding block type in the frontend if users should be able to select it.
- No database. Session state is in-memory with optional JSON persistence.
- Each agent task runs via the Claude Agent SDK's
query()API. - Frontend communicates via REST (commands) + WebSocket (events).
- Blockly workspace → NuggetSpec JSON (Zod-validated) → backend orchestration pipeline.
- Up to 3 tasks execute concurrently when DAG dependencies allow.
- Functional components only, Tailwind utility classes for all styling.
- Status colors: blue=working, green=done, red=error, yellow=warning.
Elisa — A kid-friendly IDE for orchestrating AI agent teams