chore(ci): sync protocol + swiftformat
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import AppKit
|
||||
import ClawdisProtocol
|
||||
import ClawdisKit
|
||||
import ClawdisProtocol
|
||||
import Foundation
|
||||
import Network
|
||||
import OSLog
|
||||
@@ -174,6 +174,7 @@ actor BridgeServer {
|
||||
deliver: false,
|
||||
to: nil,
|
||||
channel: "last")
|
||||
|
||||
case "agent.request":
|
||||
guard let json = evt.payloadJSON, let data = json.data(using: .utf8) else {
|
||||
return
|
||||
@@ -199,6 +200,7 @@ actor BridgeServer {
|
||||
deliver: link.deliver,
|
||||
to: to,
|
||||
channel: channel ?? "last")
|
||||
|
||||
default:
|
||||
break
|
||||
}
|
||||
@@ -234,7 +236,7 @@ actor BridgeServer {
|
||||
}
|
||||
|
||||
do {
|
||||
let data = try await GatewayConnection.shared.request(method: req.method, params: params, timeoutMs: 30_000)
|
||||
let data = try await GatewayConnection.shared.request(method: req.method, params: params, timeoutMs: 30000)
|
||||
guard let json = String(data: data, encoding: .utf8) else {
|
||||
return BridgeRPCResponse(
|
||||
id: req.id,
|
||||
@@ -303,7 +305,8 @@ actor BridgeServer {
|
||||
let payloadJSON = payloadData.flatMap { String(data: $0, encoding: .utf8) }
|
||||
|
||||
struct MinimalChat: Codable { var sessionKey: String }
|
||||
let sessionKey = payloadData.flatMap { try? JSONDecoder().decode(MinimalChat.self, from: $0) }?.sessionKey
|
||||
let sessionKey = payloadData.flatMap { try? JSONDecoder().decode(MinimalChat.self, from: $0) }?
|
||||
.sessionKey
|
||||
if let sessionKey {
|
||||
for nodeId in subscribedNodes {
|
||||
guard self.chatSubscriptions[nodeId]?.contains(sessionKey) == true else { continue }
|
||||
|
||||
@@ -33,7 +33,7 @@ struct MacGatewayChatTransport: ClawdisChatTransport, Sendable {
|
||||
"message": AnyCodable(message),
|
||||
"thinking": AnyCodable(thinking),
|
||||
"idempotencyKey": AnyCodable(idempotencyKey),
|
||||
"timeoutMs": AnyCodable(30_000),
|
||||
"timeoutMs": AnyCodable(30000),
|
||||
]
|
||||
|
||||
if !attachments.isEmpty {
|
||||
|
||||
@@ -482,28 +482,35 @@ public struct NodePairVerifyParams: Codable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct NodeListParams: Codable {
|
||||
}
|
||||
|
||||
public struct NodeInvokeParams: Codable {
|
||||
public let nodeid: String
|
||||
public let command: String
|
||||
public let params: AnyCodable?
|
||||
public let timeoutms: Int?
|
||||
public let idempotencykey: String
|
||||
|
||||
public init(
|
||||
nodeid: String,
|
||||
command: String,
|
||||
params: AnyCodable?,
|
||||
timeoutms: Int?
|
||||
timeoutms: Int?,
|
||||
idempotencykey: String
|
||||
) {
|
||||
self.nodeid = nodeid
|
||||
self.command = command
|
||||
self.params = params
|
||||
self.timeoutms = timeoutms
|
||||
self.idempotencykey = idempotencykey
|
||||
}
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case nodeid = "nodeId"
|
||||
case command
|
||||
case params
|
||||
case timeoutms = "timeoutMs"
|
||||
case idempotencykey = "idempotencyKey"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
45
dist/protocol.schema.json
vendored
45
dist/protocol.schema.json
vendored
@@ -181,6 +181,10 @@
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"platform": {
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"mode": {
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
@@ -530,6 +534,10 @@
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"platform": {
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"mode": {
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
@@ -605,6 +613,10 @@
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"platform": {
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"mode": {
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
@@ -906,6 +918,39 @@
|
||||
"token"
|
||||
]
|
||||
},
|
||||
"NodeListParams": {
|
||||
"additionalProperties": false,
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
},
|
||||
"NodeInvokeParams": {
|
||||
"additionalProperties": false,
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"nodeId": {
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"command": {
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"params": {},
|
||||
"timeoutMs": {
|
||||
"minimum": 0,
|
||||
"type": "integer"
|
||||
},
|
||||
"idempotencyKey": {
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"nodeId",
|
||||
"command",
|
||||
"idempotencyKey"
|
||||
]
|
||||
},
|
||||
"SessionsListParams": {
|
||||
"additionalProperties": false,
|
||||
"type": "object",
|
||||
|
||||
Reference in New Issue
Block a user