mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-05-13 01:46:08 +08:00
1.5 KiB
1.5 KiB
OpenSquawk - Project Guide
Architecture
- Nuxt 4 (Vue 3 SFC) frontend in
/app - H3 server handlers in
/server - Shared types/utils in
/shared - MongoDB models in
/server/models
Key Files
/shared/utils/communicationsEngine.ts— Core state machine composable (used by/pmlive ATC)/server/utils/openai.ts— LLM decision router (routeDecision())/server/services/decisionFlowService.ts— Builds runtime decision trees from MongoDB/app/pages/pm.vue— Live ATC page (speech-to-text, PTT, text input)/app/pages/classroom.vue— Classroom learning mode (separate system, does NOT use communicationsEngine)
Live ATC Flow (/pm)
- User inputs (PTT or text) →
handlePilotTransmission() processPilotTransmission()logs the pilot messagebuildLLMContext()builds candidates fromnextCandidates- POST
/api/llm/decide→routeDecision()selects next state applyLLMDecision()moves to next state, updates vars/flagscollectAtcStatesUntilPilotTurn()advances through ATC/system states- Each ATC
say_tplis spoken via TTS (scheduleControllerSpeech)
Decision Tree States
States have role: 'pilot' | 'atc' | 'system'. ATC states have say_tpl (what controller says). Pilot states have utterance_tpl (expected pilot response). Transitions: next, ok_next, bad_next, timer_next.
Commands
bun run dev— dev server- Decision trees are stored in MongoDB and fetched via
/api/decision-flows/runtime