From cbd9395082cc31acff3242398aa7f78c31aa196c Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 15 Feb 2026 07:07:55 +0000 Subject: [PATCH] ci(protocol): regenerate swift protocol models --- .../OpenClawProtocol/GatewayModels.swift | 559 ++++++++---------- .../OpenClawProtocol/GatewayModels.swift | 4 + 2 files changed, 240 insertions(+), 323 deletions(-) diff --git a/apps/macos/Sources/OpenClawProtocol/GatewayModels.swift b/apps/macos/Sources/OpenClawProtocol/GatewayModels.swift index d8692f5c0f..29a4059b33 100644 --- a/apps/macos/Sources/OpenClawProtocol/GatewayModels.swift +++ b/apps/macos/Sources/OpenClawProtocol/GatewayModels.swift @@ -40,8 +40,8 @@ public struct ConnectParams: Codable, Sendable { device: [String: AnyCodable]?, auth: [String: AnyCodable]?, locale: String?, - useragent: String?) - { + useragent: String? + ) { self.minprotocol = minprotocol self.maxprotocol = maxprotocol self.client = client @@ -56,7 +56,6 @@ public struct ConnectParams: Codable, Sendable { self.locale = locale self.useragent = useragent } - private enum CodingKeys: String, CodingKey { case minprotocol = "minProtocol" case maxprotocol = "maxProtocol" @@ -92,8 +91,8 @@ public struct HelloOk: Codable, Sendable { snapshot: Snapshot, canvashosturl: String?, auth: [String: AnyCodable]?, - policy: [String: AnyCodable]) - { + policy: [String: AnyCodable] + ) { self.type = type self._protocol = _protocol self.server = server @@ -103,7 +102,6 @@ public struct HelloOk: Codable, Sendable { self.auth = auth self.policy = policy } - private enum CodingKeys: String, CodingKey { case type case _protocol = "protocol" @@ -126,14 +124,13 @@ public struct RequestFrame: Codable, Sendable { type: String, id: String, method: String, - params: AnyCodable?) - { + params: AnyCodable? + ) { self.type = type self.id = id self.method = method self.params = params } - private enum CodingKeys: String, CodingKey { case type case id @@ -154,15 +151,14 @@ public struct ResponseFrame: Codable, Sendable { id: String, ok: Bool, payload: AnyCodable?, - error: [String: AnyCodable]?) - { + error: [String: AnyCodable]? + ) { self.type = type self.id = id self.ok = ok self.payload = payload self.error = error } - private enum CodingKeys: String, CodingKey { case type case id @@ -184,15 +180,14 @@ public struct EventFrame: Codable, Sendable { event: String, payload: AnyCodable?, seq: Int?, - stateversion: [String: AnyCodable]?) - { + stateversion: [String: AnyCodable]? + ) { self.type = type self.event = event self.payload = payload self.seq = seq self.stateversion = stateversion } - private enum CodingKeys: String, CodingKey { case type case event @@ -236,8 +231,8 @@ public struct PresenceEntry: Codable, Sendable { deviceid: String?, roles: [String]?, scopes: [String]?, - instanceid: String?) - { + instanceid: String? + ) { self.host = host self.ip = ip self.version = version @@ -255,7 +250,6 @@ public struct PresenceEntry: Codable, Sendable { self.scopes = scopes self.instanceid = instanceid } - private enum CodingKeys: String, CodingKey { case host case ip @@ -282,12 +276,11 @@ public struct StateVersion: Codable, Sendable { public init( presence: Int, - health: Int) - { + health: Int + ) { self.presence = presence self.health = health } - private enum CodingKeys: String, CodingKey { case presence case health @@ -312,8 +305,8 @@ public struct Snapshot: Codable, Sendable { configpath: String?, statedir: String?, sessiondefaults: [String: AnyCodable]?, - authmode: AnyCodable?) - { + authmode: AnyCodable? + ) { self.presence = presence self.health = health self.stateversion = stateversion @@ -323,7 +316,6 @@ public struct Snapshot: Codable, Sendable { self.sessiondefaults = sessiondefaults self.authmode = authmode } - private enum CodingKeys: String, CodingKey { case presence case health @@ -348,15 +340,14 @@ public struct ErrorShape: Codable, Sendable { message: String, details: AnyCodable?, retryable: Bool?, - retryafterms: Int?) - { + retryafterms: Int? + ) { self.code = code self.message = message self.details = details self.retryable = retryable self.retryafterms = retryafterms } - private enum CodingKeys: String, CodingKey { case code case message @@ -378,15 +369,14 @@ public struct AgentEvent: Codable, Sendable { seq: Int, stream: String, ts: Int, - data: [String: AnyCodable]) - { + data: [String: AnyCodable] + ) { self.runid = runid self.seq = seq self.stream = stream self.ts = ts self.data = data } - private enum CodingKeys: String, CodingKey { case runid = "runId" case seq @@ -416,8 +406,8 @@ public struct SendParams: Codable, Sendable { channel: String?, accountid: String?, sessionkey: String?, - idempotencykey: String) - { + idempotencykey: String + ) { self.to = to self.message = message self.mediaurl = mediaurl @@ -428,7 +418,6 @@ public struct SendParams: Codable, Sendable { self.sessionkey = sessionkey self.idempotencykey = idempotencykey } - private enum CodingKeys: String, CodingKey { case to case message @@ -468,8 +457,8 @@ public struct PollParams: Codable, Sendable { threadid: String?, channel: String?, accountid: String?, - idempotencykey: String) - { + idempotencykey: String + ) { self.to = to self.question = question self.options = options @@ -483,7 +472,6 @@ public struct PollParams: Codable, Sendable { self.accountid = accountid self.idempotencykey = idempotencykey } - private enum CodingKeys: String, CodingKey { case to case question @@ -550,8 +538,8 @@ public struct AgentParams: Codable, Sendable { inputprovenance: [String: AnyCodable]?, idempotencykey: String, label: String?, - spawnedby: String?) - { + spawnedby: String? + ) { self.message = message self.agentid = agentid self.to = to @@ -577,7 +565,6 @@ public struct AgentParams: Codable, Sendable { self.label = label self.spawnedby = spawnedby } - private enum CodingKeys: String, CodingKey { case message case agentid = "agentId" @@ -612,12 +599,11 @@ public struct AgentIdentityParams: Codable, Sendable { public init( agentid: String?, - sessionkey: String?) - { + sessionkey: String? + ) { self.agentid = agentid self.sessionkey = sessionkey } - private enum CodingKeys: String, CodingKey { case agentid = "agentId" case sessionkey = "sessionKey" @@ -634,14 +620,13 @@ public struct AgentIdentityResult: Codable, Sendable { agentid: String, name: String?, avatar: String?, - emoji: String?) - { + emoji: String? + ) { self.agentid = agentid self.name = name self.avatar = avatar self.emoji = emoji } - private enum CodingKeys: String, CodingKey { case agentid = "agentId" case name @@ -656,12 +641,11 @@ public struct AgentWaitParams: Codable, Sendable { public init( runid: String, - timeoutms: Int?) - { + timeoutms: Int? + ) { self.runid = runid self.timeoutms = timeoutms } - private enum CodingKeys: String, CodingKey { case runid = "runId" case timeoutms = "timeoutMs" @@ -674,12 +658,11 @@ public struct WakeParams: Codable, Sendable { public init( mode: AnyCodable, - text: String) - { + text: String + ) { self.mode = mode self.text = text } - private enum CodingKeys: String, CodingKey { case mode case text @@ -712,8 +695,8 @@ public struct NodePairRequestParams: Codable, Sendable { caps: [String]?, commands: [String]?, remoteip: String?, - silent: Bool?) - { + silent: Bool? + ) { self.nodeid = nodeid self.displayname = displayname self.platform = platform @@ -727,7 +710,6 @@ public struct NodePairRequestParams: Codable, Sendable { self.remoteip = remoteip self.silent = silent } - private enum CodingKeys: String, CodingKey { case nodeid = "nodeId" case displayname = "displayName" @@ -744,17 +726,17 @@ public struct NodePairRequestParams: Codable, Sendable { } } -public struct NodePairListParams: Codable, Sendable {} +public struct NodePairListParams: Codable, Sendable { +} public struct NodePairApproveParams: Codable, Sendable { public let requestid: String public init( - requestid: String) - { + requestid: String + ) { self.requestid = requestid } - private enum CodingKeys: String, CodingKey { case requestid = "requestId" } @@ -764,11 +746,10 @@ public struct NodePairRejectParams: Codable, Sendable { public let requestid: String public init( - requestid: String) - { + requestid: String + ) { self.requestid = requestid } - private enum CodingKeys: String, CodingKey { case requestid = "requestId" } @@ -780,12 +761,11 @@ public struct NodePairVerifyParams: Codable, Sendable { public init( nodeid: String, - token: String) - { + token: String + ) { self.nodeid = nodeid self.token = token } - private enum CodingKeys: String, CodingKey { case nodeid = "nodeId" case token @@ -798,29 +778,28 @@ public struct NodeRenameParams: Codable, Sendable { public init( nodeid: String, - displayname: String) - { + displayname: String + ) { self.nodeid = nodeid self.displayname = displayname } - private enum CodingKeys: String, CodingKey { case nodeid = "nodeId" case displayname = "displayName" } } -public struct NodeListParams: Codable, Sendable {} +public struct NodeListParams: Codable, Sendable { +} public struct NodeDescribeParams: Codable, Sendable { public let nodeid: String public init( - nodeid: String) - { + nodeid: String + ) { self.nodeid = nodeid } - private enum CodingKeys: String, CodingKey { case nodeid = "nodeId" } @@ -838,15 +817,14 @@ public struct NodeInvokeParams: Codable, Sendable { command: String, params: AnyCodable?, timeoutms: Int?, - idempotencykey: String) - { + 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 @@ -870,8 +848,8 @@ public struct NodeInvokeResultParams: Codable, Sendable { ok: Bool, payload: AnyCodable?, payloadjson: String?, - error: [String: AnyCodable]?) - { + error: [String: AnyCodable]? + ) { self.id = id self.nodeid = nodeid self.ok = ok @@ -879,7 +857,6 @@ public struct NodeInvokeResultParams: Codable, Sendable { self.payloadjson = payloadjson self.error = error } - private enum CodingKeys: String, CodingKey { case id case nodeid = "nodeId" @@ -898,13 +875,12 @@ public struct NodeEventParams: Codable, Sendable { public init( event: String, payload: AnyCodable?, - payloadjson: String?) - { + payloadjson: String? + ) { self.event = event self.payload = payload self.payloadjson = payloadjson } - private enum CodingKeys: String, CodingKey { case event case payload @@ -926,8 +902,8 @@ public struct NodeInvokeRequestEvent: Codable, Sendable { command: String, paramsjson: String?, timeoutms: Int?, - idempotencykey: String?) - { + idempotencykey: String? + ) { self.id = id self.nodeid = nodeid self.command = command @@ -935,7 +911,6 @@ public struct NodeInvokeRequestEvent: Codable, Sendable { self.timeoutms = timeoutms self.idempotencykey = idempotencykey } - private enum CodingKeys: String, CodingKey { case id case nodeid = "nodeId" @@ -968,8 +943,8 @@ public struct SessionsListParams: Codable, Sendable { label: String?, spawnedby: String?, agentid: String?, - search: String?) - { + search: String? + ) { self.limit = limit self.activeminutes = activeminutes self.includeglobal = includeglobal @@ -981,7 +956,6 @@ public struct SessionsListParams: Codable, Sendable { self.agentid = agentid self.search = search } - private enum CodingKeys: String, CodingKey { case limit case activeminutes = "activeMinutes" @@ -1004,13 +978,12 @@ public struct SessionsPreviewParams: Codable, Sendable { public init( keys: [String], limit: Int?, - maxchars: Int?) - { + maxchars: Int? + ) { self.keys = keys self.limit = limit self.maxchars = maxchars } - private enum CodingKeys: String, CodingKey { case keys case limit @@ -1034,8 +1007,8 @@ public struct SessionsResolveParams: Codable, Sendable { agentid: String?, spawnedby: String?, includeglobal: Bool?, - includeunknown: Bool?) - { + includeunknown: Bool? + ) { self.key = key self.sessionid = sessionid self.label = label @@ -1044,7 +1017,6 @@ public struct SessionsResolveParams: Codable, Sendable { self.includeglobal = includeglobal self.includeunknown = includeunknown } - private enum CodingKeys: String, CodingKey { case key case sessionid = "sessionId" @@ -1070,6 +1042,7 @@ public struct SessionsPatchParams: Codable, Sendable { public let execnode: AnyCodable? public let model: AnyCodable? public let spawnedby: AnyCodable? + public let spawndepth: AnyCodable? public let sendpolicy: AnyCodable? public let groupactivation: AnyCodable? @@ -1087,9 +1060,10 @@ public struct SessionsPatchParams: Codable, Sendable { execnode: AnyCodable?, model: AnyCodable?, spawnedby: AnyCodable?, + spawndepth: AnyCodable?, sendpolicy: AnyCodable?, - groupactivation: AnyCodable?) - { + groupactivation: AnyCodable? + ) { self.key = key self.label = label self.thinkinglevel = thinkinglevel @@ -1103,10 +1077,10 @@ public struct SessionsPatchParams: Codable, Sendable { self.execnode = execnode self.model = model self.spawnedby = spawnedby + self.spawndepth = spawndepth self.sendpolicy = sendpolicy self.groupactivation = groupactivation } - private enum CodingKeys: String, CodingKey { case key case label @@ -1121,6 +1095,7 @@ public struct SessionsPatchParams: Codable, Sendable { case execnode = "execNode" case model case spawnedby = "spawnedBy" + case spawndepth = "spawnDepth" case sendpolicy = "sendPolicy" case groupactivation = "groupActivation" } @@ -1132,12 +1107,11 @@ public struct SessionsResetParams: Codable, Sendable { public init( key: String, - reason: AnyCodable?) - { + reason: AnyCodable? + ) { self.key = key self.reason = reason } - private enum CodingKeys: String, CodingKey { case key case reason @@ -1150,12 +1124,11 @@ public struct SessionsDeleteParams: Codable, Sendable { public init( key: String, - deletetranscript: Bool?) - { + deletetranscript: Bool? + ) { self.key = key self.deletetranscript = deletetranscript } - private enum CodingKeys: String, CodingKey { case key case deletetranscript = "deleteTranscript" @@ -1168,12 +1141,11 @@ public struct SessionsCompactParams: Codable, Sendable { public init( key: String, - maxlines: Int?) - { + maxlines: Int? + ) { self.key = key self.maxlines = maxlines } - private enum CodingKeys: String, CodingKey { case key case maxlines = "maxLines" @@ -1192,15 +1164,14 @@ public struct SessionsUsageParams: Codable, Sendable { startdate: String?, enddate: String?, limit: Int?, - includecontextweight: Bool?) - { + includecontextweight: Bool? + ) { self.key = key self.startdate = startdate self.enddate = enddate self.limit = limit self.includecontextweight = includecontextweight } - private enum CodingKeys: String, CodingKey { case key case startdate = "startDate" @@ -1210,7 +1181,8 @@ public struct SessionsUsageParams: Codable, Sendable { } } -public struct ConfigGetParams: Codable, Sendable {} +public struct ConfigGetParams: Codable, Sendable { +} public struct ConfigSetParams: Codable, Sendable { public let raw: String @@ -1218,12 +1190,11 @@ public struct ConfigSetParams: Codable, Sendable { public init( raw: String, - basehash: String?) - { + basehash: String? + ) { self.raw = raw self.basehash = basehash } - private enum CodingKeys: String, CodingKey { case raw case basehash = "baseHash" @@ -1242,15 +1213,14 @@ public struct ConfigApplyParams: Codable, Sendable { basehash: String?, sessionkey: String?, note: String?, - restartdelayms: Int?) - { + restartdelayms: Int? + ) { self.raw = raw self.basehash = basehash self.sessionkey = sessionkey self.note = note self.restartdelayms = restartdelayms } - private enum CodingKeys: String, CodingKey { case raw case basehash = "baseHash" @@ -1272,15 +1242,14 @@ public struct ConfigPatchParams: Codable, Sendable { basehash: String?, sessionkey: String?, note: String?, - restartdelayms: Int?) - { + restartdelayms: Int? + ) { self.raw = raw self.basehash = basehash self.sessionkey = sessionkey self.note = note self.restartdelayms = restartdelayms } - private enum CodingKeys: String, CodingKey { case raw case basehash = "baseHash" @@ -1290,7 +1259,8 @@ public struct ConfigPatchParams: Codable, Sendable { } } -public struct ConfigSchemaParams: Codable, Sendable {} +public struct ConfigSchemaParams: Codable, Sendable { +} public struct ConfigSchemaResponse: Codable, Sendable { public let schema: AnyCodable @@ -1302,14 +1272,13 @@ public struct ConfigSchemaResponse: Codable, Sendable { schema: AnyCodable, uihints: [String: AnyCodable], version: String, - generatedat: String) - { + generatedat: String + ) { self.schema = schema self.uihints = uihints self.version = version self.generatedat = generatedat } - private enum CodingKeys: String, CodingKey { case schema case uihints = "uiHints" @@ -1324,12 +1293,11 @@ public struct WizardStartParams: Codable, Sendable { public init( mode: AnyCodable?, - workspace: String?) - { + workspace: String? + ) { self.mode = mode self.workspace = workspace } - private enum CodingKeys: String, CodingKey { case mode case workspace @@ -1342,12 +1310,11 @@ public struct WizardNextParams: Codable, Sendable { public init( sessionid: String, - answer: [String: AnyCodable]?) - { + answer: [String: AnyCodable]? + ) { self.sessionid = sessionid self.answer = answer } - private enum CodingKeys: String, CodingKey { case sessionid = "sessionId" case answer @@ -1358,11 +1325,10 @@ public struct WizardCancelParams: Codable, Sendable { public let sessionid: String public init( - sessionid: String) - { + sessionid: String + ) { self.sessionid = sessionid } - private enum CodingKeys: String, CodingKey { case sessionid = "sessionId" } @@ -1372,11 +1338,10 @@ public struct WizardStatusParams: Codable, Sendable { public let sessionid: String public init( - sessionid: String) - { + sessionid: String + ) { self.sessionid = sessionid } - private enum CodingKeys: String, CodingKey { case sessionid = "sessionId" } @@ -1402,8 +1367,8 @@ public struct WizardStep: Codable, Sendable { initialvalue: AnyCodable?, placeholder: String?, sensitive: Bool?, - executor: AnyCodable?) - { + executor: AnyCodable? + ) { self.id = id self.type = type self.title = title @@ -1414,7 +1379,6 @@ public struct WizardStep: Codable, Sendable { self.sensitive = sensitive self.executor = executor } - private enum CodingKeys: String, CodingKey { case id case type @@ -1438,14 +1402,13 @@ public struct WizardNextResult: Codable, Sendable { done: Bool, step: [String: AnyCodable]?, status: AnyCodable?, - error: String?) - { + error: String? + ) { self.done = done self.step = step self.status = status self.error = error } - private enum CodingKeys: String, CodingKey { case done case step @@ -1466,15 +1429,14 @@ public struct WizardStartResult: Codable, Sendable { done: Bool, step: [String: AnyCodable]?, status: AnyCodable?, - error: String?) - { + error: String? + ) { self.sessionid = sessionid self.done = done self.step = step self.status = status self.error = error } - private enum CodingKeys: String, CodingKey { case sessionid = "sessionId" case done @@ -1490,12 +1452,11 @@ public struct WizardStatusResult: Codable, Sendable { public init( status: AnyCodable, - error: String?) - { + error: String? + ) { self.status = status self.error = error } - private enum CodingKeys: String, CodingKey { case status case error @@ -1508,12 +1469,11 @@ public struct TalkModeParams: Codable, Sendable { public init( enabled: Bool, - phase: String?) - { + phase: String? + ) { self.enabled = enabled self.phase = phase } - private enum CodingKeys: String, CodingKey { case enabled case phase @@ -1524,11 +1484,10 @@ public struct TalkConfigParams: Codable, Sendable { public let includesecrets: Bool? public init( - includesecrets: Bool?) - { + includesecrets: Bool? + ) { self.includesecrets = includesecrets } - private enum CodingKeys: String, CodingKey { case includesecrets = "includeSecrets" } @@ -1538,11 +1497,10 @@ public struct TalkConfigResult: Codable, Sendable { public let config: [String: AnyCodable] public init( - config: [String: AnyCodable]) - { + config: [String: AnyCodable] + ) { self.config = config } - private enum CodingKeys: String, CodingKey { case config } @@ -1554,12 +1512,11 @@ public struct ChannelsStatusParams: Codable, Sendable { public init( probe: Bool?, - timeoutms: Int?) - { + timeoutms: Int? + ) { self.probe = probe self.timeoutms = timeoutms } - private enum CodingKeys: String, CodingKey { case probe case timeoutms = "timeoutMs" @@ -1586,8 +1543,8 @@ public struct ChannelsStatusResult: Codable, Sendable { channelmeta: [[String: AnyCodable]]?, channels: [String: AnyCodable], channelaccounts: [String: AnyCodable], - channeldefaultaccountid: [String: AnyCodable]) - { + channeldefaultaccountid: [String: AnyCodable] + ) { self.ts = ts self.channelorder = channelorder self.channellabels = channellabels @@ -1598,7 +1555,6 @@ public struct ChannelsStatusResult: Codable, Sendable { self.channelaccounts = channelaccounts self.channeldefaultaccountid = channeldefaultaccountid } - private enum CodingKeys: String, CodingKey { case ts case channelorder = "channelOrder" @@ -1618,12 +1574,11 @@ public struct ChannelsLogoutParams: Codable, Sendable { public init( channel: String, - accountid: String?) - { + accountid: String? + ) { self.channel = channel self.accountid = accountid } - private enum CodingKeys: String, CodingKey { case channel case accountid = "accountId" @@ -1640,14 +1595,13 @@ public struct WebLoginStartParams: Codable, Sendable { force: Bool?, timeoutms: Int?, verbose: Bool?, - accountid: String?) - { + accountid: String? + ) { self.force = force self.timeoutms = timeoutms self.verbose = verbose self.accountid = accountid } - private enum CodingKeys: String, CodingKey { case force case timeoutms = "timeoutMs" @@ -1662,12 +1616,11 @@ public struct WebLoginWaitParams: Codable, Sendable { public init( timeoutms: Int?, - accountid: String?) - { + accountid: String? + ) { self.timeoutms = timeoutms self.accountid = accountid } - private enum CodingKeys: String, CodingKey { case timeoutms = "timeoutMs" case accountid = "accountId" @@ -1682,13 +1635,12 @@ public struct AgentSummary: Codable, Sendable { public init( id: String, name: String?, - identity: [String: AnyCodable]?) - { + identity: [String: AnyCodable]? + ) { self.id = id self.name = name self.identity = identity } - private enum CodingKeys: String, CodingKey { case id case name @@ -1706,14 +1658,13 @@ public struct AgentsCreateParams: Codable, Sendable { name: String, workspace: String, emoji: String?, - avatar: String?) - { + avatar: String? + ) { self.name = name self.workspace = workspace self.emoji = emoji self.avatar = avatar } - private enum CodingKeys: String, CodingKey { case name case workspace @@ -1732,14 +1683,13 @@ public struct AgentsCreateResult: Codable, Sendable { ok: Bool, agentid: String, name: String, - workspace: String) - { + workspace: String + ) { self.ok = ok self.agentid = agentid self.name = name self.workspace = workspace } - private enum CodingKeys: String, CodingKey { case ok case agentid = "agentId" @@ -1760,15 +1710,14 @@ public struct AgentsUpdateParams: Codable, Sendable { name: String?, workspace: String?, model: String?, - avatar: String?) - { + avatar: String? + ) { self.agentid = agentid self.name = name self.workspace = workspace self.model = model self.avatar = avatar } - private enum CodingKeys: String, CodingKey { case agentid = "agentId" case name @@ -1784,12 +1733,11 @@ public struct AgentsUpdateResult: Codable, Sendable { public init( ok: Bool, - agentid: String) - { + agentid: String + ) { self.ok = ok self.agentid = agentid } - private enum CodingKeys: String, CodingKey { case ok case agentid = "agentId" @@ -1802,12 +1750,11 @@ public struct AgentsDeleteParams: Codable, Sendable { public init( agentid: String, - deletefiles: Bool?) - { + deletefiles: Bool? + ) { self.agentid = agentid self.deletefiles = deletefiles } - private enum CodingKeys: String, CodingKey { case agentid = "agentId" case deletefiles = "deleteFiles" @@ -1822,13 +1769,12 @@ public struct AgentsDeleteResult: Codable, Sendable { public init( ok: Bool, agentid: String, - removedbindings: Int) - { + removedbindings: Int + ) { self.ok = ok self.agentid = agentid self.removedbindings = removedbindings } - private enum CodingKeys: String, CodingKey { case ok case agentid = "agentId" @@ -1850,8 +1796,8 @@ public struct AgentsFileEntry: Codable, Sendable { missing: Bool, size: Int?, updatedatms: Int?, - content: String?) - { + content: String? + ) { self.name = name self.path = path self.missing = missing @@ -1859,7 +1805,6 @@ public struct AgentsFileEntry: Codable, Sendable { self.updatedatms = updatedatms self.content = content } - private enum CodingKeys: String, CodingKey { case name case path @@ -1874,11 +1819,10 @@ public struct AgentsFilesListParams: Codable, Sendable { public let agentid: String public init( - agentid: String) - { + agentid: String + ) { self.agentid = agentid } - private enum CodingKeys: String, CodingKey { case agentid = "agentId" } @@ -1892,13 +1836,12 @@ public struct AgentsFilesListResult: Codable, Sendable { public init( agentid: String, workspace: String, - files: [AgentsFileEntry]) - { + files: [AgentsFileEntry] + ) { self.agentid = agentid self.workspace = workspace self.files = files } - private enum CodingKeys: String, CodingKey { case agentid = "agentId" case workspace @@ -1912,12 +1855,11 @@ public struct AgentsFilesGetParams: Codable, Sendable { public init( agentid: String, - name: String) - { + name: String + ) { self.agentid = agentid self.name = name } - private enum CodingKeys: String, CodingKey { case agentid = "agentId" case name @@ -1932,13 +1874,12 @@ public struct AgentsFilesGetResult: Codable, Sendable { public init( agentid: String, workspace: String, - file: AgentsFileEntry) - { + file: AgentsFileEntry + ) { self.agentid = agentid self.workspace = workspace self.file = file } - private enum CodingKeys: String, CodingKey { case agentid = "agentId" case workspace @@ -1954,13 +1895,12 @@ public struct AgentsFilesSetParams: Codable, Sendable { public init( agentid: String, name: String, - content: String) - { + content: String + ) { self.agentid = agentid self.name = name self.content = content } - private enum CodingKeys: String, CodingKey { case agentid = "agentId" case name @@ -1978,14 +1918,13 @@ public struct AgentsFilesSetResult: Codable, Sendable { ok: Bool, agentid: String, workspace: String, - file: AgentsFileEntry) - { + file: AgentsFileEntry + ) { self.ok = ok self.agentid = agentid self.workspace = workspace self.file = file } - private enum CodingKeys: String, CodingKey { case ok case agentid = "agentId" @@ -1994,7 +1933,8 @@ public struct AgentsFilesSetResult: Codable, Sendable { } } -public struct AgentsListParams: Codable, Sendable {} +public struct AgentsListParams: Codable, Sendable { +} public struct AgentsListResult: Codable, Sendable { public let defaultid: String @@ -2006,14 +1946,13 @@ public struct AgentsListResult: Codable, Sendable { defaultid: String, mainkey: String, scope: AnyCodable, - agents: [AgentSummary]) - { + agents: [AgentSummary] + ) { self.defaultid = defaultid self.mainkey = mainkey self.scope = scope self.agents = agents } - private enum CodingKeys: String, CodingKey { case defaultid = "defaultId" case mainkey = "mainKey" @@ -2034,15 +1973,14 @@ public struct ModelChoice: Codable, Sendable { name: String, provider: String, contextwindow: Int?, - reasoning: Bool?) - { + reasoning: Bool? + ) { self.id = id self.name = name self.provider = provider self.contextwindow = contextwindow self.reasoning = reasoning } - private enum CodingKeys: String, CodingKey { case id case name @@ -2052,17 +1990,17 @@ public struct ModelChoice: Codable, Sendable { } } -public struct ModelsListParams: Codable, Sendable {} +public struct ModelsListParams: Codable, Sendable { +} public struct ModelsListResult: Codable, Sendable { public let models: [ModelChoice] public init( - models: [ModelChoice]) - { + models: [ModelChoice] + ) { self.models = models } - private enum CodingKeys: String, CodingKey { case models } @@ -2072,27 +2010,26 @@ public struct SkillsStatusParams: Codable, Sendable { public let agentid: String? public init( - agentid: String?) - { + agentid: String? + ) { self.agentid = agentid } - private enum CodingKeys: String, CodingKey { case agentid = "agentId" } } -public struct SkillsBinsParams: Codable, Sendable {} +public struct SkillsBinsParams: Codable, Sendable { +} public struct SkillsBinsResult: Codable, Sendable { public let bins: [String] public init( - bins: [String]) - { + bins: [String] + ) { self.bins = bins } - private enum CodingKeys: String, CodingKey { case bins } @@ -2106,13 +2043,12 @@ public struct SkillsInstallParams: Codable, Sendable { public init( name: String, installid: String, - timeoutms: Int?) - { + timeoutms: Int? + ) { self.name = name self.installid = installid self.timeoutms = timeoutms } - private enum CodingKeys: String, CodingKey { case name case installid = "installId" @@ -2130,14 +2066,13 @@ public struct SkillsUpdateParams: Codable, Sendable { skillkey: String, enabled: Bool?, apikey: String?, - env: [String: AnyCodable]?) - { + env: [String: AnyCodable]? + ) { self.skillkey = skillkey self.enabled = enabled self.apikey = apikey self.env = env } - private enum CodingKeys: String, CodingKey { case skillkey = "skillKey" case enabled @@ -2176,8 +2111,8 @@ public struct CronJob: Codable, Sendable { wakemode: AnyCodable, payload: AnyCodable, delivery: [String: AnyCodable]?, - state: [String: AnyCodable]) - { + state: [String: AnyCodable] + ) { self.id = id self.agentid = agentid self.name = name @@ -2193,7 +2128,6 @@ public struct CronJob: Codable, Sendable { self.delivery = delivery self.state = state } - private enum CodingKeys: String, CodingKey { case id case agentid = "agentId" @@ -2216,17 +2150,17 @@ public struct CronListParams: Codable, Sendable { public let includedisabled: Bool? public init( - includedisabled: Bool?) - { + includedisabled: Bool? + ) { self.includedisabled = includedisabled } - private enum CodingKeys: String, CodingKey { case includedisabled = "includeDisabled" } } -public struct CronStatusParams: Codable, Sendable {} +public struct CronStatusParams: Codable, Sendable { +} public struct CronAddParams: Codable, Sendable { public let name: String @@ -2250,8 +2184,8 @@ public struct CronAddParams: Codable, Sendable { sessiontarget: AnyCodable, wakemode: AnyCodable, payload: AnyCodable, - delivery: [String: AnyCodable]?) - { + delivery: [String: AnyCodable]? + ) { self.name = name self.agentid = agentid self.description = description @@ -2263,7 +2197,6 @@ public struct CronAddParams: Codable, Sendable { self.payload = payload self.delivery = delivery } - private enum CodingKeys: String, CodingKey { case name case agentid = "agentId" @@ -2302,8 +2235,8 @@ public struct CronRunLogEntry: Codable, Sendable { sessionkey: String?, runatms: Int?, durationms: Int?, - nextrunatms: Int?) - { + nextrunatms: Int? + ) { self.ts = ts self.jobid = jobid self.action = action @@ -2316,7 +2249,6 @@ public struct CronRunLogEntry: Codable, Sendable { self.durationms = durationms self.nextrunatms = nextrunatms } - private enum CodingKeys: String, CodingKey { case ts case jobid = "jobId" @@ -2340,13 +2272,12 @@ public struct LogsTailParams: Codable, Sendable { public init( cursor: Int?, limit: Int?, - maxbytes: Int?) - { + maxbytes: Int? + ) { self.cursor = cursor self.limit = limit self.maxbytes = maxbytes } - private enum CodingKeys: String, CodingKey { case cursor case limit @@ -2368,8 +2299,8 @@ public struct LogsTailResult: Codable, Sendable { size: Int, lines: [String], truncated: Bool?, - reset: Bool?) - { + reset: Bool? + ) { self.file = file self.cursor = cursor self.size = size @@ -2377,7 +2308,6 @@ public struct LogsTailResult: Codable, Sendable { self.truncated = truncated self.reset = reset } - private enum CodingKeys: String, CodingKey { case file case cursor @@ -2388,7 +2318,8 @@ public struct LogsTailResult: Codable, Sendable { } } -public struct ExecApprovalsGetParams: Codable, Sendable {} +public struct ExecApprovalsGetParams: Codable, Sendable { +} public struct ExecApprovalsSetParams: Codable, Sendable { public let file: [String: AnyCodable] @@ -2396,12 +2327,11 @@ public struct ExecApprovalsSetParams: Codable, Sendable { public init( file: [String: AnyCodable], - basehash: String?) - { + basehash: String? + ) { self.file = file self.basehash = basehash } - private enum CodingKeys: String, CodingKey { case file case basehash = "baseHash" @@ -2412,11 +2342,10 @@ public struct ExecApprovalsNodeGetParams: Codable, Sendable { public let nodeid: String public init( - nodeid: String) - { + nodeid: String + ) { self.nodeid = nodeid } - private enum CodingKeys: String, CodingKey { case nodeid = "nodeId" } @@ -2430,13 +2359,12 @@ public struct ExecApprovalsNodeSetParams: Codable, Sendable { public init( nodeid: String, file: [String: AnyCodable], - basehash: String?) - { + basehash: String? + ) { self.nodeid = nodeid self.file = file self.basehash = basehash } - private enum CodingKeys: String, CodingKey { case nodeid = "nodeId" case file @@ -2454,14 +2382,13 @@ public struct ExecApprovalsSnapshot: Codable, Sendable { path: String, exists: Bool, hash: String, - file: [String: AnyCodable]) - { + file: [String: AnyCodable] + ) { self.path = path self.exists = exists self.hash = hash self.file = file } - private enum CodingKeys: String, CodingKey { case path case exists @@ -2494,8 +2421,8 @@ public struct ExecApprovalRequestParams: Codable, Sendable { resolvedpath: AnyCodable?, sessionkey: AnyCodable?, timeoutms: Int?, - twophase: Bool?) - { + twophase: Bool? + ) { self.id = id self.command = command self.cwd = cwd @@ -2508,7 +2435,6 @@ public struct ExecApprovalRequestParams: Codable, Sendable { self.timeoutms = timeoutms self.twophase = twophase } - private enum CodingKeys: String, CodingKey { case id case command @@ -2530,29 +2456,28 @@ public struct ExecApprovalResolveParams: Codable, Sendable { public init( id: String, - decision: String) - { + decision: String + ) { self.id = id self.decision = decision } - private enum CodingKeys: String, CodingKey { case id case decision } } -public struct DevicePairListParams: Codable, Sendable {} +public struct DevicePairListParams: Codable, Sendable { +} public struct DevicePairApproveParams: Codable, Sendable { public let requestid: String public init( - requestid: String) - { + requestid: String + ) { self.requestid = requestid } - private enum CodingKeys: String, CodingKey { case requestid = "requestId" } @@ -2562,11 +2487,10 @@ public struct DevicePairRejectParams: Codable, Sendable { public let requestid: String public init( - requestid: String) - { + requestid: String + ) { self.requestid = requestid } - private enum CodingKeys: String, CodingKey { case requestid = "requestId" } @@ -2580,13 +2504,12 @@ public struct DeviceTokenRotateParams: Codable, Sendable { public init( deviceid: String, role: String, - scopes: [String]?) - { + scopes: [String]? + ) { self.deviceid = deviceid self.role = role self.scopes = scopes } - private enum CodingKeys: String, CodingKey { case deviceid = "deviceId" case role @@ -2600,12 +2523,11 @@ public struct DeviceTokenRevokeParams: Codable, Sendable { public init( deviceid: String, - role: String) - { + role: String + ) { self.deviceid = deviceid self.role = role } - private enum CodingKeys: String, CodingKey { case deviceid = "deviceId" case role @@ -2642,8 +2564,8 @@ public struct DevicePairRequestedEvent: Codable, Sendable { remoteip: String?, silent: Bool?, isrepair: Bool?, - ts: Int) - { + ts: Int + ) { self.requestid = requestid self.deviceid = deviceid self.publickey = publickey @@ -2659,7 +2581,6 @@ public struct DevicePairRequestedEvent: Codable, Sendable { self.isrepair = isrepair self.ts = ts } - private enum CodingKeys: String, CodingKey { case requestid = "requestId" case deviceid = "deviceId" @@ -2688,14 +2609,13 @@ public struct DevicePairResolvedEvent: Codable, Sendable { requestid: String, deviceid: String, decision: String, - ts: Int) - { + ts: Int + ) { self.requestid = requestid self.deviceid = deviceid self.decision = decision self.ts = ts } - private enum CodingKeys: String, CodingKey { case requestid = "requestId" case deviceid = "deviceId" @@ -2710,12 +2630,11 @@ public struct ChatHistoryParams: Codable, Sendable { public init( sessionkey: String, - limit: Int?) - { + limit: Int? + ) { self.sessionkey = sessionkey self.limit = limit } - private enum CodingKeys: String, CodingKey { case sessionkey = "sessionKey" case limit @@ -2738,8 +2657,8 @@ public struct ChatSendParams: Codable, Sendable { deliver: Bool?, attachments: [AnyCodable]?, timeoutms: Int?, - idempotencykey: String) - { + idempotencykey: String + ) { self.sessionkey = sessionkey self.message = message self.thinking = thinking @@ -2748,7 +2667,6 @@ public struct ChatSendParams: Codable, Sendable { self.timeoutms = timeoutms self.idempotencykey = idempotencykey } - private enum CodingKeys: String, CodingKey { case sessionkey = "sessionKey" case message @@ -2766,12 +2684,11 @@ public struct ChatAbortParams: Codable, Sendable { public init( sessionkey: String, - runid: String?) - { + runid: String? + ) { self.sessionkey = sessionkey self.runid = runid } - private enum CodingKeys: String, CodingKey { case sessionkey = "sessionKey" case runid = "runId" @@ -2786,13 +2703,12 @@ public struct ChatInjectParams: Codable, Sendable { public init( sessionkey: String, message: String, - label: String?) - { + label: String? + ) { self.sessionkey = sessionkey self.message = message self.label = label } - private enum CodingKeys: String, CodingKey { case sessionkey = "sessionKey" case message @@ -2818,8 +2734,8 @@ public struct ChatEvent: Codable, Sendable { message: AnyCodable?, errormessage: String?, usage: AnyCodable?, - stopreason: String?) - { + stopreason: String? + ) { self.runid = runid self.sessionkey = sessionkey self.seq = seq @@ -2829,7 +2745,6 @@ public struct ChatEvent: Codable, Sendable { self.usage = usage self.stopreason = stopreason } - private enum CodingKeys: String, CodingKey { case runid = "runId" case sessionkey = "sessionKey" @@ -2852,14 +2767,13 @@ public struct UpdateRunParams: Codable, Sendable { sessionkey: String?, note: String?, restartdelayms: Int?, - timeoutms: Int?) - { + timeoutms: Int? + ) { self.sessionkey = sessionkey self.note = note self.restartdelayms = restartdelayms self.timeoutms = timeoutms } - private enum CodingKeys: String, CodingKey { case sessionkey = "sessionKey" case note @@ -2872,11 +2786,10 @@ public struct TickEvent: Codable, Sendable { public let ts: Int public init( - ts: Int) - { + ts: Int + ) { self.ts = ts } - private enum CodingKeys: String, CodingKey { case ts } @@ -2888,12 +2801,11 @@ public struct ShutdownEvent: Codable, Sendable { public init( reason: String, - restartexpectedms: Int?) - { + restartexpectedms: Int? + ) { self.reason = reason self.restartexpectedms = restartexpectedms } - private enum CodingKeys: String, CodingKey { case reason case restartexpectedms = "restartExpectedMs" @@ -2915,11 +2827,11 @@ public enum GatewayFrame: Codable, Sendable { let type = try typeContainer.decode(String.self, forKey: .type) switch type { case "req": - self = try .req(RequestFrame(from: decoder)) + self = .req(try RequestFrame(from: decoder)) case "res": - self = try .res(ResponseFrame(from: decoder)) + self = .res(try ResponseFrame(from: decoder)) case "event": - self = try .event(EventFrame(from: decoder)) + self = .event(try EventFrame(from: decoder)) default: let container = try decoder.singleValueContainer() let raw = try container.decode([String: AnyCodable].self) @@ -2929,12 +2841,13 @@ public enum GatewayFrame: Codable, Sendable { public func encode(to encoder: Encoder) throws { switch self { - case let .req(v): try v.encode(to: encoder) - case let .res(v): try v.encode(to: encoder) - case let .event(v): try v.encode(to: encoder) - case let .unknown(_, raw): + case .req(let v): try v.encode(to: encoder) + case .res(let v): try v.encode(to: encoder) + case .event(let v): try v.encode(to: encoder) + case .unknown(_, let raw): var container = encoder.singleValueContainer() try container.encode(raw) } } + } diff --git a/apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift b/apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift index 80293f0d1a..29a4059b33 100644 --- a/apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift +++ b/apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift @@ -1042,6 +1042,7 @@ public struct SessionsPatchParams: Codable, Sendable { public let execnode: AnyCodable? public let model: AnyCodable? public let spawnedby: AnyCodable? + public let spawndepth: AnyCodable? public let sendpolicy: AnyCodable? public let groupactivation: AnyCodable? @@ -1059,6 +1060,7 @@ public struct SessionsPatchParams: Codable, Sendable { execnode: AnyCodable?, model: AnyCodable?, spawnedby: AnyCodable?, + spawndepth: AnyCodable?, sendpolicy: AnyCodable?, groupactivation: AnyCodable? ) { @@ -1075,6 +1077,7 @@ public struct SessionsPatchParams: Codable, Sendable { self.execnode = execnode self.model = model self.spawnedby = spawnedby + self.spawndepth = spawndepth self.sendpolicy = sendpolicy self.groupactivation = groupactivation } @@ -1092,6 +1095,7 @@ public struct SessionsPatchParams: Codable, Sendable { case execnode = "execNode" case model case spawnedby = "spawnedBy" + case spawndepth = "spawnDepth" case sendpolicy = "sendPolicy" case groupactivation = "groupActivation" }