macOS: fold agent control into GatewayConnection

This commit is contained in:
Peter Steinberger
2025-12-17 17:10:30 +01:00
parent 557ffdbe35
commit 17a27fd312
19 changed files with 443 additions and 201 deletions

View File

@@ -0,0 +1,22 @@
import Testing
@testable import Clawdis
@testable import ClawdisIPC
@Suite(.serialized) struct GatewayConnectionControlTests {
@Test func statusFailsWhenProcessMissing() async {
let result = await GatewayConnection.shared.status()
// We don't assert ok because the worker may not be available in CI.
// Instead, ensure the call returns without throwing and provides a message.
#expect(result.ok == true || result.error != nil)
}
@Test func rejectEmptyMessage() async {
let result = await GatewayConnection.shared.sendAgent(
message: "",
thinking: nil,
sessionKey: "main",
deliver: false,
to: nil)
#expect(result.ok == false)
}
}