Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
fix(spaces-sdk-swift): typed Space.networkLog() for the network_log tool (#6454)
injaneity3060518ec733
diff --git a/libs/spaces-sdk-swift/Sources/CuaSpaces/MCPSurface.swift b/libs/spaces-sdk-swift/Sources/CuaSpaces/MCPSurface.swiftindex fa6ef1abb6..f041f5d284 100644--- a/libs/spaces-sdk-swift/Sources/CuaSpaces/MCPSurface.swift+++ b/libs/spaces-sdk-swift/Sources/CuaSpaces/MCPSurface.swift@@ -571,6 +571,14 @@ extension Space {try await connection.object("network_show", ["space": .string(id.rawValue)])}+ /// What the Space tried to reach and its network blocked, most recent+ /// first (`network_log`). Each entry carries `reason`, `dst` and `count`,+ /// and `proto` and `last_unix` when known.+ public func networkLog() async throws -> [[String: JSONValue]] {+ try await connection.array("network_log", ["space": .string(id.rawValue)])+ .compactMap { $0.objectValue }+ }+/// Tightens the Space's network to `internet`, `none` or `custom` with/// `allow` / `deny` lists (`network_set`). Opening more is refused: the/// user does that.diff --git a/libs/spaces-sdk-swift/Tests/CuaSpacesTests/FakeSpace.swift b/libs/spaces-sdk-swift/Tests/CuaSpacesTests/FakeSpace.swiftindex 5423c56ccc..2f4af37996 100644--- a/libs/spaces-sdk-swift/Tests/CuaSpacesTests/FakeSpace.swift+++ b/libs/spaces-sdk-swift/Tests/CuaSpacesTests/FakeSpace.swift@@ -326,6 +326,10 @@ actor FakeSpacesBackend: SpacesTransport {case "network_show":return .object(["settings": .object(["preset": "internet"]), "enforcement": "enforced"])+ case "network_log":+ return .array([.object(["reason": "platform:metadata", "dst": "169.254.169.254:80",+ "proto": "tcp", "count": 2, "last_unix": 1])])+case "network_set":return .object(["applied": "now","network": .object(["settings": .object(["preset": arguments["network"] ?? "internet"])])])diff --git a/libs/spaces-sdk-swift/Tests/CuaSpacesTests/ToolCoverageTests.swift b/libs/spaces-sdk-swift/Tests/CuaSpacesTests/ToolCoverageTests.swiftindex ec1411059a..e638909f55 100644--- a/libs/spaces-sdk-swift/Tests/CuaSpacesTests/ToolCoverageTests.swift+++ b/libs/spaces-sdk-swift/Tests/CuaSpacesTests/ToolCoverageTests.swift@@ -41,7 +41,7 @@ import Testing]@Test func testTheContractIsCompleteTools() {- XCTAssertEqual(Self.advertisedTools.count, 118)+ XCTAssertEqual(Self.advertisedTools.count, 119)// The Python server's `local_rcdp` is gone; `stream_endpoint` mints a// media ticket for any provider, and `send_file` is new.XCTAssertFalse(Self.advertisedTools.contains("local_rcdp"))@@ -106,6 +106,8 @@ import Testing// --- The Space's network ---------------------------------------------let net = try await space.network() // network_showXCTAssertEqual(net["settings"]?.objectValue?["preset"]?.stringValue, "internet")+ let blocked = try await space.networkLog() // network_log+ XCTAssertEqual(blocked.first?["reason"]?.stringValue, "platform:metadata")let tightened = try await space.setNetwork("none") // network_setXCTAssertEqual(tightened["applied"]?.stringValue, "now")