feat: add package scaffold and DictationController state machine

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 09:39:56 +02:00
co-authored by Claude Sonnet 5.5
parent aa20a5941f
commit 6ab94cfdd0
6 changed files with 282 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
import Foundation
@testable import SstCore
struct TestError: Error {}
final class FakeRecorder: AudioRecording {
var samples: [Float] = []
var startError: Error?
private(set) var startCount = 0
func start() throws {
startCount += 1
if let startError { throw startError }
}
func stop() -> [Float] { samples }
}
final class FakeTranscriber: Transcriber {
var result: Result<String, Error> = .success("hallo wereld")
private(set) var callCount = 0
func transcribe(_ samples: [Float]) async throws -> String {
callCount += 1
return try result.get()
}
}
final class FakeCleaner: Cleaner {
func clean(_ text: String, context: CleaningContext) async throws -> String {
"[\(text)]"
}
}
final class FakeInserter: TextInserting {
var error: Error?
private(set) var inserted: [String] = []
func insert(_ text: String) async throws {
if let error { throw error }
inserted.append(text)
}
}