chore: drop runner shim and add committer helper

This commit is contained in:
Peter Steinberger
2025-12-09 17:24:25 +00:00
parent d04f7fc6e9
commit 1f19ca1665
25 changed files with 139 additions and 51 deletions

View File

@@ -10,7 +10,7 @@ public struct HookJob: Sendable {
}
}
public actor HookRunner {
public actor HookExecutor {
private let config: SwabbleConfig
private var lastRun: Date?
private let hostname: String

View File

@@ -46,8 +46,8 @@ struct ServeCommand: ParsableCommand {
}
let stripped = Self.stripWake(text: seg.text, cfg: cfg)
let job = HookJob(text: stripped, timestamp: Date())
let runner = HookRunner(config: cfg)
try await runner.run(job: job)
let executor = HookExecutor(config: cfg)
try await executor.run(job: job)
if cfg.transcripts.enabled {
await TranscriptsStore.shared.append(text: stripped)
}

View File

@@ -21,8 +21,8 @@ struct TestHookCommand: ParsableCommand {
mutating func run() async throws {
let cfg = try ConfigLoader.load(at: configURL)
let runner = HookRunner(config: cfg)
try await runner.run(job: HookJob(text: text, timestamp: Date()))
let executor = HookExecutor(config: cfg)
try await executor.run(job: HookJob(text: text, timestamp: Date()))
print("hook invoked")
}