iOS: wire node commands and incremental TTS

This commit is contained in:
Mariano Belinky
2026-02-01 12:21:10 +01:00
committed by Mariano Belinky
parent b7aac92ac4
commit 532b9653be
12 changed files with 1002 additions and 67 deletions
@@ -0,0 +1,25 @@
import Foundation
import OpenClawKit
@MainActor
final class NodeCapabilityRouter {
enum RouterError: Error {
case unknownCommand
case handlerUnavailable
}
typealias Handler = (BridgeInvokeRequest) async throws -> BridgeInvokeResponse
private let handlers: [String: Handler]
init(handlers: [String: Handler]) {
self.handlers = handlers
}
func handle(_ request: BridgeInvokeRequest) async throws -> BridgeInvokeResponse {
guard let handler = handlers[request.command] else {
throw RouterError.unknownCommand
}
return try await handler(request)
}
}