LLM-Prompt (message.post + sos-stream):
- LANG_INSTRUCTIONS Map raus, ersetzt durch dynamische Instruktion
'Reply in {detectedFromUser} ... fallback: {appLang}'
- Lyra matcht jetzt die Sprache der letzten User-Message (per
detectLang Unicode-Detection); App-Locale ist nur noch Fallback
- Instruktion doppelt eingehängt (Anfang + Ende des System-Prompts)
gegen recency bias bei langen deutschen Prompts
TTS (speak dispatcher + speak-cartesia + speak-elevenlabs):
- Kein 'de'-Default mehr für language. detectLang(text, locale) leitet
Sprache primär aus dem Antwort-Text ab (Arabic/Cyrillic/CJK/Turkish-
Letters), Locale als Fallback
- Cartesia + ElevenLabs: language/language_code nur senden wenn
ableitbar, sonst Provider auto-detect statt erzwungenem 'de'
- speak-cartesia: sonic-2 → sonic-3 (Multi-Lang, war beim Dispatcher-
Fix gestern vergessen worden)
- Google: en-US neutraler Fallback statt de-DE-Bias
Neu: server/utils/detect-lang.ts
86 lines
2.8 KiB
Swift
86 lines
2.8 KiB
Swift
import AppKit
|
|
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@Environment(WizardModel.self) private var model
|
|
|
|
var body: some View {
|
|
VStack(spacing: 0) {
|
|
VStack(spacing: 8) {
|
|
HStack {
|
|
appBadge
|
|
|
|
VStack(alignment: .leading, spacing: 1) {
|
|
Text("ReBreak Binder")
|
|
.font(.headline)
|
|
Text("macOS supervision tool")
|
|
.font(.caption)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
Spacer()
|
|
if model.step != .done {
|
|
Text("Schritt \(model.step.stepNumber) von \(WizardStep.total)")
|
|
.font(.caption)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
}
|
|
.padding(.horizontal, 20)
|
|
.padding(.top, 16)
|
|
|
|
StepIndicator(current: model.step)
|
|
}
|
|
.background(Color(NSColor.windowBackgroundColor))
|
|
|
|
Divider()
|
|
|
|
// Main content
|
|
Group {
|
|
switch model.step {
|
|
case .welcome: WelcomeView()
|
|
case .preflight: PreflightView()
|
|
case .supervise: SuperviseView()
|
|
case .enroll: EnrollView()
|
|
case .configure: ConfigureView()
|
|
case .done: DoneView()
|
|
}
|
|
}
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
}
|
|
}
|
|
|
|
@ViewBuilder
|
|
private var appBadge: some View {
|
|
if let icon = resolvedAppIcon {
|
|
Image(nsImage: icon)
|
|
.resizable()
|
|
.frame(width: 28, height: 28)
|
|
.clipShape(RoundedRectangle(cornerRadius: 7, style: .continuous))
|
|
.overlay(
|
|
RoundedRectangle(cornerRadius: 7, style: .continuous)
|
|
.strokeBorder(.white.opacity(0.25), lineWidth: 1)
|
|
)
|
|
} else {
|
|
ZStack {
|
|
RoundedRectangle(cornerRadius: 7, style: .continuous)
|
|
.fill(Color.accentColor.opacity(0.15))
|
|
Image(systemName: "shield.lefthalf.filled")
|
|
.foregroundStyle(.tint)
|
|
}
|
|
.frame(width: 28, height: 28)
|
|
}
|
|
}
|
|
|
|
private var resolvedAppIcon: NSImage? {
|
|
if let icon = NSApplication.shared.applicationIconImage,
|
|
icon.size.width > 2,
|
|
icon.size.height > 2 {
|
|
return icon
|
|
}
|
|
let bundleIcon = NSWorkspace.shared.icon(forFile: Bundle.main.bundlePath)
|
|
if bundleIcon.size.width > 2, bundleIcon.size.height > 2 {
|
|
return bundleIcon
|
|
}
|
|
return nil
|
|
}
|
|
}
|