VoiceWake: pipe transcript to ssh forwarder

This commit is contained in:
Peter Steinberger
2025-12-07 16:59:22 +01:00
parent fec49e1e28
commit 12f74de9b3

View File

@@ -138,8 +138,14 @@ enum VoiceWakeForwarder {
}
args.append(userHost)
let rendered = self.renderedCommand(template: config.commandTemplate, transcript: transcript)
args.append(contentsOf: ["sh", "-c", self.commandWithCliPath(rendered, target: destination)])
let cmdTemplate: String
if config.commandTemplate.contains("${text}") {
cmdTemplate = config.commandTemplate.replacingOccurrences(of: "${text}", with: "$CLAW_TEXT")
} else {
cmdTemplate = config.commandTemplate
}
let shellCommand = "CLAW_TEXT=$(cat); \(self.commandWithCliPath(cmdTemplate, target: destination))"
args.append(contentsOf: ["sh", "-c", shellCommand])
let debugCmd = (["/usr/bin/ssh"] + args).joined(separator: " ")
self.logger.info("voice wake ssh cmd=\(debugCmd, privacy: .public)")