Commit Graph

54 Commits

Author SHA1 Message Date
itsrubberduck
5531da0e9a fix(onboarding): also ask OS for X-Plane, not just 'other'
X-Plane runs on Windows/Mac/Linux same as any non-MSFS sim, so it
should trigger the OS follow-up too.
2026-07-09 17:26:11 +02:00
itsrubberduck
43f8f7d092 feat(onboarding): add sanitization and callsign computation helpers 2026-07-09 16:25:29 +02:00
leubeem
1d09a9fc2f feat(pm): LLM routing endpoint, usage capture, and admin review view
Backend counterpart to the Python engine's semantic router.

- POST /api/decision/route: service-secret-guarded endpoint the Python
  backend calls on regex-miss. Calls gpt-5-mini (ROUTER_LLM_MODEL),
  validates the chosen id against the candidate set, and writes both a
  UsageEvent (central cost ledger) and a routing-review record — including
  timeouts, with timeoutMs + actual latencyMs — so the budget can be tuned
- LlmRoutingDecision model + GET /api/admin/llm-routing (paginated,
  status-filtered, per-status counts)
- admin "LLM Routing" tab: transcript vs expected phrase, candidate chips
  with the chosen one highlighted, latency/budget chip, model reason
- serviceAuth util (mirrors CRON_SECRET pattern)
- .env.example: ROUTER_LLM_MODEL, SERVICE_SECRET

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 10:27:57 +02:00
itsrubberduck
7ee9392109 hotkey support 2026-06-20 03:17:53 +02:00
leubeem
7367f7cdb7 feat(server): per-user AI usage tracking, cost alerting, and endpoint hardening
Usage tracking:
- new UsageEvent collection records every STT/TTS/LLM call per user with
  provider, model, volume (audio seconds, characters, tokens) and an
  estimated USD cost; self-hosted providers (Speaches/Piper) and cache
  hits record at $0
- pricing table for whisper-1, tts-1, gpt-5-nano & co. in server/utils/usage.ts
- weekly KPI mail gains an "AI-Nutzung & Kosten" section: weekly and
  rolling 30-day cost, per-kind breakdown, top 5 users by cost
- quota alert mail when rolling 30-day cost exceeds USAGE_ALERT_USD
  (default $5), at most once per calendar month (UsageAlertDelivery)

Hardening:
- /api/atc/say now requires an authenticated session (middleware
  exemption removed); useFlightLabAudio sends the bearer token
- /api/service/tools/latency requires auth (was a public LLM endpoint)
- per-user rate limits: PTT 20/min, say 60/min, latency 5/min
- cron endpoints (waitlist-drip, weekly-kpi-report) require a shared
  secret via ?secret= or x-cron-secret (CRON_SECRET, falls back to
  KPI_CRON_SECRET); allowed with a warning while unset so existing
  deployments keep working
- PTT records the actual transcribed audio duration for billing accuracy

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 23:17:03 +02:00
leubeem
ea4b1e0b24 Cleanup old unused code and add id sessionId to /api/atc/ptt 2026-05-20 14:13:26 +02: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
86de549adb use 6 digit codes for bridge 2026-02-16 15:47:12 +01:00
itsrubberduck
f742722e9c Unify bridge auth header and add live telemetry panel 2026-02-15 16:04:07 +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
6f060d0ddd fix pm 2026-02-13 08:50:02 +01:00
Remi
663001a7af Normalize taxi routes for clearer speech 2025-10-18 21:29:56 +02:00
Remi
de67a4ac4a Add reply-to support for admin notifications 2025-10-18 16:33:06 +02:00
Remi
d0f3d07200 feat: surface pilot intent from llm decisions 2025-10-16 21:07:21 +02:00
Remi
649cae11bc feat: integrate llm-backed routing with fallback 2025-10-16 19:55:13 +02:00
Remi
18f25998f5 Allow configuring OpenAI base URL 2025-10-16 11:15:31 +02:00
itsrubberduck
651a41106f merge 2025-10-12 15:42:18 +02:00
Remi
fc7d5f59e2 Add waitlist invitation sending from admin 2025-10-07 12:34:02 +02:00
Remi
79c2cd4870 Simplify decision routing to avoid unnecessary LLM calls 2025-09-25 23:47:05 +02:00
Remi
fd2ac100ce Align regex auto selection trace with LLM decisions 2025-09-25 23:35:23 +02:00
Remi
60d7d2d89e Refactor route decision selection 2025-09-25 23:00:31 +02:00
Remi
b756bf2ea6 Point bridge download to GitHub 2025-09-24 00:01:00 +02:00
Remi
7f2585c211 Improve flow activation handling and expose active nodes 2025-09-23 23:12:02 +02:00
Remi
fbec5c4830 Add session timeline logging and admin sessions view 2025-09-21 23:08:10 +02:00
Remi
6c9f467b94 Enable flow-aware decision routing 2025-09-21 21:16:33 +02:00
Remi
e31b2d9289 Extend access token lifetime 2025-09-20 20:53:06 +02:00
itsrubberduck
137bc84276 stash 2025-09-20 16:36:35 +02:00
itsrubberduck
409f9d5c20 merge 2025-09-20 09:50:20 +02:00
Remi
440aef2f62 Fix remaining German comment 2025-09-20 09:46:34 +02:00
Remi
341a39e7d8 refactor: share llm decision types 2025-09-20 09:27:45 +02:00
Remi
df68719374 refactor: centralize radio speech normalization 2025-09-19 09:20:04 +02:00
Remi
43f2f42238 Add waitlist admin view and log OpenAI decision traces 2025-09-18 23:30:56 +02:00
Remi
b6785e9f05 Fix admin notifications formatting 2025-09-18 19:54:04 +02:00
Remi
74da40cc87 Add readback correction states and improve validation 2025-09-18 19:54:04 +02:00
Remi
8020a4a285 Refine ATC decision routing and ATIS handling 2025-09-18 19:41:32 +02:00
itsrubberduck
8ea2ae28d2 log llm call body 2025-09-18 18:21:01 +02:00
Remi
03b86ae637 Add ATIS quick actions and airport frequency data 2025-09-18 18:16:40 +02:00
itsrubberduck
abd158700c add other flights 2025-09-18 18:08:28 +02:00
Remi
3dcc6479a8 Finalize admin tools and transmission fault flow 2025-09-18 14:03:26 +02:00
Remi
7a44d67844 Harden runtime config and input validation 2025-09-18 14:03:25 +02:00
Remi
e355d0ba18 Align public messaging and add news banners 2025-09-17 19:22:56 +02:00
itsrubberduck
1e3d942fd5 merge 2025-09-17 17:27:38 +02:00
Remi
5ad52adc8e Update contact email to info@opensquawk.de 2025-09-17 17:21:12 +02:00
Remi
48c3b6689a Add password reset flow 2025-09-17 16:21:11 +02:00
Remi
79d5ac76c0 Revise landing messaging and add news feed 2025-09-17 15:44:41 +02:00
Remi
19f253f53e Implement authentication, waitlist, and logging upgrades 2025-09-16 17:28:34 +02:00
itsrubberduck
a7eebf0baf refactor: update OpenAI TTS integration and cleanup imports
- index.vue: comment out cockpit simulator image
- learn.vue: remove unused imports (useRadioTTS, learnModules)
- atc/say.post.ts & utils/normalize.ts: rename openaiOld → normalize, adjust TTS calls, skip ensureDir/writeFile
- communicationsEngine.ts: fix atcDecisionTree import path
2025-09-16 16:14:12 +02:00
itsrubberduck
5ee970e173 even more reduced llm costs but with variables 2025-09-16 13:36:34 +02:00
itsrubberduck
e84feefbe2 feat(openai): Drastically reduce LLM Tokens
chore: Optimize the input data sent to the OpenAI API to reduce token usage and improve decision quality. Add quick responses for common pilot utterances like radio checks and emergencies to avoid unnecessary LLM calls.

The key changes are:

- Use a smaller LLM model (`gpt-5-nano`) to reduce token usage
- Optimize the input data by only sending relevant candidate and context information
- Implement quick responses for common pilot utterances like radio checks and emergencies
- Ensure ATC responses are only included when necessary to reduce token usage
2025-09-16 13:18:57 +02:00