read text aloud
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import HelderServices
|
||||
|
||||
/// Records what would have been read aloud; `finish()` plays the voice reaching the end.
|
||||
@MainActor
|
||||
final class FakeSpeech: SpeechServicing {
|
||||
var onFinish: (() -> Void)?
|
||||
private(set) var spoken: [String] = []
|
||||
private(set) var stops = 0
|
||||
|
||||
func speak(_ text: String) { spoken.append(text) }
|
||||
func stop() { stops += 1 }
|
||||
func finish() { onFinish?() }
|
||||
}
|
||||
@@ -18,6 +18,7 @@ struct WorkspaceHarness {
|
||||
let session: FakeSession
|
||||
let layouts: FakeLayouts
|
||||
let system: FakeSystem
|
||||
let speech: FakeSpeech
|
||||
let watchers: WatcherBox
|
||||
let agent = FakeTerminal()
|
||||
|
||||
@@ -38,9 +39,10 @@ struct WorkspaceHarness {
|
||||
let recentStore = FakeRecentProjects(recents)
|
||||
let layouts = FakeLayouts()
|
||||
let system = FakeSystem()
|
||||
let speech = FakeSpeech()
|
||||
let watchers = WatcherBox()
|
||||
let app = AppServices(
|
||||
recentProjects: recentStore, session: session, layouts: layouts, system: system,
|
||||
recentProjects: recentStore, session: session, layouts: layouts, system: system, speech: speech,
|
||||
makeWorkspace: { _ in
|
||||
WorkspaceServices(git: git, files: files, search: FakeSearch(), symbols: symbols,
|
||||
config: config, notes: notes, recentFiles: recentFiles)
|
||||
@@ -63,6 +65,7 @@ struct WorkspaceHarness {
|
||||
self.session = session
|
||||
self.layouts = layouts
|
||||
self.system = system
|
||||
self.speech = speech
|
||||
self.watchers = watchers
|
||||
model.terminal.attach(agent, as: .agent)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user