Commit Graph

275 Commits

Author SHA1 Message Date
itsrubberduck
14d06a67d4 copilot ui improvements 2026-05-10 17:15:41 +02:00
Emanuel Leube
5f2502bed7 Merge pull request #263 from OpenSquawk/feature/pm-python-backend-integration
Wire /pm to Python backend for stateful ATC training sessions
2026-05-09 17:50:38 +02:00
leubeem
d6df3a3ce3 Wire /pm to Python backend for stateful ATC training sessions
Replace the LLM-per-request flow in /pm with a stateful Python backend
(OpenSquawk-LiveATC-api). The backend owns session state, does regex-first
routing with readback evaluation, and returns the next state + ATC speech.
The frontend keeps its local cursor (communicationsEngine) for TTS and
monitoring UI, but no longer calls /api/llm/decide.

Changes:

app/composables/useRadioBackend.ts (new)
  Typed Nuxt composable wrapping the Python REST API:
  createSession, transmit, deleteSession, fetchFlows.
  Base URL read from NUXT_PUBLIC_RADIO_BACKEND_URL (default 127.0.0.1:8000).

nuxt.config.ts
  Expose radioBackendUrl as a public runtime config key so the composable
  and communicationsEngine can both reach the Python backend.

shared/utils/communicationsEngine.ts
  - fetchRuntimeTree now accepts an optional baseUrl so it fetches from the
    Python backend instead of the Nuxt server when a URL is provided.
  - renderTpl handles both {var} (old MongoDB schema) and {{var}} (new YAML
    schema) — double-brace matched first to avoid partial matches.
  - stateSayTpl / stateUtteranceTpl helpers unify say_tpl|say_template and
    utterance_tpl|expected_pilot_template across both schema versions.
  - auto_transitions from the new YAML schema are included when collecting
    eligible transitions in collectAtcStatesUntilPilotTurn.

shared/types/decision.ts
  RuntimeDecisionState extended with say_template and expected_pilot_template
  fields (new YAML schema field names alongside the existing legacy names).

app/pages/pm.vue
  - startMonitoring: loads tree from Python backend, then creates a backend
    session (backendSessionId). Cursor synced to session.current_state.
  - handlePilotTransmission: calls radioBackend.transmit instead of
    /api/llm/decide. Applies auto_advanced_states via moveToSilent, then
    the final state. Speaks controller_say_template via TTS.
  - Both fetchRuntimeTree calls now pass radioBackendUrl so they hit the
    Python backend, not the Nuxt flow-from-MongoDB path.

AGENTS.md (new)
  Project guide updated to document the new two-backend architecture,
  the Python backend session lifecycle, and the dual template schema.

docs/plans/2026-05-06-pm-python-runtime-contract.md (new)
  Implementation plan and API contract written before the work started.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 17:49:28 +02:00
itsrubberduck
d2db4741d2 Wochenreport 2026-05-06 17:38:36 +02:00
itsrubberduck
779f0606b1 fix popover 2026-05-06 16:08:45 +02:00
itsrubberduck
2457c9ef9c komplette 320 sops 2026-05-06 15:51:58 +02:00
itsrubberduck
190e44087a simbrief gefixt 2026-05-06 15:43:05 +02:00
itsrubberduck
962837926f final fixes for copilot 2026-05-06 15:37:50 +02:00
itsrubberduck
88e0b49f19 sehr gute design fixes 2026-05-06 15:35:38 +02:00
itsrubberduck
aac95b64e9 ui fixes 2026-05-06 15:28:55 +02:00
itsrubberduck
28c92cb668 bessers ui aber mit fehlern 2026-05-06 14:57:25 +02:00
itsrubberduck
78c51a6884 clenaeres design verbesserte views 2026-04-26 09:59:34 +02:00
itsrubberduck
a2f3f32115 redeisng to match osq 2026-04-25 20:52:25 +02:00
itsrubberduck
ab89a65ea0 first version looks ok 2026-04-25 20:29:09 +02:00
itsrubberduck
f5283acf24 fix: refine classroom tts popups 2026-04-23 10:20:06 +02:00
itsrubberduck
10fc40e5be feat: warn when classroom speech server is unavailable 2026-04-23 09:21:23 +02:00
itsrubberduck
1809ebd644 feat: update classroom feedback round 2 content 2026-02-27 13:03:04 +01:00
itsrubberduck
337398d243 feat(flightlab): add moving cloud field for speed heading and altitude cues 2026-02-21 00:13:47 +01:00
itsrubberduck
0e2277daa8 feat(learn-pfd): add pitch-based speed hold step and target speed zones 2026-02-21 00:08:16 +01:00
itsrubberduck
0f2dac33f2 feat(flightlab): add custom airplane glb asset 2026-02-21 00:01:01 +01:00
itsrubberduck
27188c1e33 einfache verison 2026-02-20 23:47:48 +01:00
itsrubberduck
0aad99b34a feat(types): add LearnPfdPhase, PFD element types, and stick-input WS event
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:29:01 +01:00
itsrubberduck
24137229a3 chore: add three.js dependency for 3D aircraft model
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:28:32 +01:00
itsrubberduck
40dca9d8f6 Bridge dome light mode mapping and flightlab seat belt flow 2026-02-18 22:43:56 +01:00
itsrubberduck
ad1e85f0e8 add the lidl dome light temporarily 2026-02-18 21:49:03 +01:00
itsrubberduck
e818f6001e change default settings 2026-02-18 18:05:12 +01:00
itsrubberduck
3705340b47 besser error message 2026-02-17 19:10:50 +01:00
itsrubberduck
9287642dab test: expand coverage for core backend features 2026-02-17 18:36:13 +01:00
itsrubberduck
be3a3887fc smoketests 2026-02-17 18:26:20 +01:00
itsrubberduck
de02dc4f9e typescript 2026-02-17 18:19:55 +01:00
itsrubberduck
54c1b47dc2 fix typescript errors and update dependencies 2026-02-17 18:13:04 +01:00
itsrubberduck
59bede6ad4 add server log 2026-02-17 15:31:32 +01:00
itsrubberduck
1e69c52b70 Fix bridge connect UI states for unauthenticated users 2026-02-16 17:32:13 +01:00
itsrubberduck
ba2233d842 Redesign bridge connect flow and simplify linking UX 2026-02-16 17:25:53 +01:00
itsrubberduck
4787a06906 feat(bridge): add unlink flow for linked tokens 2026-02-16 16:39:18 +01:00
itsrubberduck
7eef56e3fd fix: add CORS middleware for bridge endpoints 2026-02-16 16:21:30 +01:00
itsrubberduck
86de549adb use 6 digit codes for bridge 2026-02-16 15:47:12 +01:00
itsrubberduck
8e01936abb Fix bridge telemetry boolean coercion for auto-advance conditions
SimConnect sends boolean fields (on_ground, parking_brake, etc.) as 0/1
numbers. The condition evaluator uses strict equality (===), so
0 === false was returning false even when the condition was semantically
met. Cast boolean telemetry fields with !! to ensure proper type matching.
Also reduce solo-mode telemetry polling from 500ms to 2000ms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 16:26:50 +01:00
itsrubberduck
4ac07d9352 Connect bridge telemetry to FlightLab with auto-advance triggers
Map raw bridge fields (ias_kt, on_ground, etc.) to FlightLabTelemetryState
format, add direct telemetry polling endpoint for solo mode, and show
sim condition panel in sidebar regardless of auto-advance toggle state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 16:16:42 +01:00
itsrubberduck
f742722e9c Unify bridge auth header and add live telemetry panel 2026-02-15 16:04:07 +01:00
itsrubberduck
f7efaf1d7b Fix local sharp setup for Nuxt image processing 2026-02-15 15:47:06 +01:00
itsrubberduck
4df6aef1ef Unify bridge connect login flow with explicit login button 2026-02-15 15:34:30 +01:00
itsrubberduck
346579676e fix(classroom): audio speed slider now actually changes playback speed with pitch correction
- Fix client: playbackRate was set to 1 for non-native-speed providers (Speaches/Piper),
  making the speed slider ineffective in the main Pizzicato audio path
- Fix server: pass speed parameter to Speaches TTS API
- Add pitch-preserving playback via MediaElementSourceNode when rate != 1,
  routing through the same Web Audio effects chain (radio filters, distortion, etc.)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 01:01:02 +01:00
itsrubberduck
f42dbbcd18 feat(classroom): integrate user feedback — audio speed, METAR TTS, phonetics, UI fixes
- Lower default audio speed to 0.85x, extend slider range to 0.5-1.3x
- Add METAR normalization for intelligible TTS (wind, vis, clouds, temp, QNH)
- Expand SID/STAR suffix regex to handle spaces (SUGOL 2S)
- Add approach suffix phonetic expansion (ILS 08R Y → Yankee)
- Fix "Soll:" → "Expected:" in readback feedback
- Accept numeric values for pushback delay field
- Add news article documenting the changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 14:21:35 +01:00
itsrubberduck
fe50f9d21a Add classroom feedback integration design doc
Documents all user feedback issues and planned fixes for audio speed,
METAR normalization, phonetics, and UI text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 14:06:44 +01:00
itsrubberduck
acb79cdb2b feat(flightlab): sidebar, progress bars, skip speech, SimBridge telemetry & auth
- Add collapsible sidebar with phase stepper (jump between phases)
- Add SimBridge conditions panel in sidebar (live values, progress bars, targets)
- Add global progress bar (top edge, glowing) + phase-local TTS progress bar
- Add skip button to skip TTS speech while ATC is speaking
- Add skipSpeech() to audio composable (stops current Pizzicato sound)
- Wire up bridge data.post.ts with user auth (JWT) + example payload
- Add server-side telemetry store with pub/sub for Bridge→WS relay
- Extend WS handler with subscribe-telemetry message + userId tracking
- Extend sync composable with subscribeTelemetry() + onTelemetry() callback
- Add require-auth middleware to all flightlab pages
- Fix instructor station ECONNREFUSED via import.meta.client guard
- Add animations: phase transitions, button lists, fade-scale, check-pop, pulse

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 10:14:33 +01:00
itsrubberduck
af2eed2d6e dont log users id on transmission 2026-02-13 18:44:34 +01:00
itsrubberduck
4837e2ea1f feat(flightlab): add audio directory with README for cockpit sound effects
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:49:15 +01:00
itsrubberduck
962827f138 feat(flightlab): add WebSocket handler for instructor-participant session sync
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:45:18 +01:00
itsrubberduck
f6444c31a5 feat(flightlab): add type definitions for FlightLab scenario engine
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:20:26 +01:00