Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ final class AppControlConnectionTests: XCTestCase {
XCTAssertEqual(payload.type, "host_app_control_request")
XCTAssertEqual(payload.requestId, "req-app-1")
XCTAssertEqual(payload.conversationId, "conv-1")
XCTAssertEqual(payload.toolName, "app_control_press")
guard case .press(let app, let key, let modifiers, let durationMs) = payload.input else {
XCTFail("Expected .press input variant, got \(payload.input)")
return
Expand Down Expand Up @@ -107,7 +106,6 @@ final class AppControlConnectionTests: XCTestCase {
}
XCTAssertEqual(payload.type, "host_app_control_cancel")
XCTAssertEqual(payload.requestId, "req-app-1")
XCTAssertEqual(payload.conversationId, "conv-1")
}

// MARK: - Existing host_cu_* still decode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ final class AppControlExecutorTests: XCTestCase {
type: "host_app_control_request",
requestId: "req-start-missing",
conversationId: "conv-test",
toolName: "app_control_start",
input: .start(app: "com.example.does-not-exist", args: nil)
)

Expand All @@ -37,7 +36,6 @@ final class AppControlExecutorTests: XCTestCase {
type: "host_app_control_request",
requestId: "req-stop-1",
conversationId: "conv-test",
toolName: "app_control_stop",
input: .stop(app: "com.example.does-not-exist", reason: "test")
)

Expand All @@ -54,7 +52,6 @@ final class AppControlExecutorTests: XCTestCase {
type: "host_app_control_request",
requestId: "req-stop-2",
conversationId: "conv-test",
toolName: "app_control_stop",
input: .stop(app: nil, reason: nil)
)

Expand All @@ -75,7 +72,6 @@ final class AppControlExecutorTests: XCTestCase {
type: "host_app_control_request",
requestId: "req-observe-missing",
conversationId: "conv-test",
toolName: "app_control_observe",
input: .observe(app: "com.example.does-not-exist")
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ final class HostAppControlTypesTests: XCTestCase {
type: "host_app_control_request",
requestId: "req-1",
conversationId: "conv-1",
toolName: "host_app_control_click",
input: .click(app: "com.apple.Safari", x: 50, y: 75, button: "left", double: false)
)
XCTAssertEqual(try roundTrip(request), request)
Expand All @@ -143,8 +142,7 @@ final class HostAppControlTypesTests: XCTestCase {
func test_cancel_roundTrips() throws {
let cancel = HostAppControlCancel(
type: "host_app_control_cancel",
requestId: "req-1",
conversationId: "conv-1"
requestId: "req-1"
)
XCTAssertEqual(try roundTrip(cancel), cancel)
}
Expand Down
8 changes: 1 addition & 7 deletions clients/shared/Network/MessageTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1684,28 +1684,24 @@ public struct HostAppControlRequest: Codable, Equatable, Sendable {
public let type: String
public let requestId: String
public let conversationId: String
public let toolName: String
public let input: HostAppControlInput

public init(
type: String,
requestId: String,
conversationId: String,
toolName: String,
input: HostAppControlInput
) {
self.type = type
self.requestId = requestId
self.conversationId = conversationId
self.toolName = toolName
self.input = input
}

private enum CodingKeys: String, CodingKey {
case type
case requestId
case conversationId
case toolName
case input
}
}
Expand Down Expand Up @@ -1850,12 +1846,10 @@ public enum HostAppControlInput: Codable, Equatable, Sendable {
public struct HostAppControlCancel: Codable, Equatable, Sendable {
public let type: String
public let requestId: String
public let conversationId: String

public init(type: String, requestId: String, conversationId: String) {
public init(type: String, requestId: String) {
self.type = type
self.requestId = requestId
self.conversationId = conversationId
}
}

Expand Down