Pivots from a SwiftPM executable to a real macOS .app bundle so we
get an NSApplication run loop on the main thread (required for
NSEvent global key monitors, AVSpeech delegate callbacks, and SwiftUI
windowing — none of which work cleanly in a CLI binary on Swift 6).
App structure (mirrors MetalPOC):
- Sources/App/main.swift — NSApplication.shared.run() entry
- Sources/App/AppDelegate.swift — @MainActor owner of all subsystems
- project.yml — XcodeGen, references local SwiftPM
package (renamed VoicePOC →
VoicePOCKit to avoid name collision
between library product + app)
- scripts/run-app.sh — xcodegen + xcodebuild + launch
Reactive JARVIS HUD (Max-Headroom-style):
- Sources/VoicePOC/HUD/JarvisHUDState.swift — @Observable state
- Sources/VoicePOC/HUD/JarvisHUDView.swift — SwiftUI orb + captions
- Sources/VoicePOC/HUD/JarvisHUDWindow.swift — borderless always-on-top
translucent window in bottom-right of primary screen
- Color codes state: cyan (listening) / amber (thinking) / magenta
(speaking) / dim gray (idle)
- Orb pulses in size + glow with TTS word boundaries
- Two caption rows show last user utterance + last JARVIS reply
- 30 Hz decay timer pulls intensity back down between word pulses
AVSpeechTTS pulse callbacks:
- onSpeakingStart → bumps HUD intensity to 0.9
- onSpeakingPulse → fires per-word boundary, bumps intensity +0.55
- onSpeakingEnd → drops intensity to 0
ConversationCoordinator now stores most recent transcript + response
strings (`lastTexts()`) so the HUD can show captions.
Package.swift: VoicePOC library renamed to VoicePOCKit to avoid an
Xcode build conflict where the app target and the library product
both wanted to write VoicePOC.swiftmodule to the same path. All
test imports updated.
Run:
./scripts/run-app.sh
The script regenerates the xcodeproj, builds Debug, and launches the
.app's executable directly so you see stdout in the launching terminal.
Build verified: ** BUILD SUCCEEDED **
20 tests, 5 skipped (live-mode), 0 failures.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
33 lines
773 B
Bash
Executable File
33 lines
773 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
# Regenerate the Xcode project (idempotent — does nothing if up to date).
|
|
echo "==> xcodegen generate"
|
|
xcodegen generate
|
|
|
|
# Build the .app (Debug).
|
|
echo "==> xcodebuild VoicePOCApp Debug"
|
|
xcodebuild \
|
|
-project VoicePOC.xcodeproj \
|
|
-scheme VoicePOCApp \
|
|
-configuration Debug \
|
|
-derivedDataPath build/derived \
|
|
build \
|
|
| tail -20
|
|
|
|
APP="build/derived/Build/Products/Debug/VoicePOC.app"
|
|
if [[ ! -d "$APP" ]]; then
|
|
echo "ERROR: .app not found at $APP" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo
|
|
echo "Launching $APP …"
|
|
echo " (this terminal will receive the app's stdout — Ctrl-C to terminate)"
|
|
echo
|
|
|
|
# Run the binary directly so we see stdout in this terminal.
|
|
exec "$APP/Contents/MacOS/VoicePOC"
|