build: add Sendable to protocol swift gen

This commit is contained in:
Peter Steinberger
2026-01-04 06:46:09 +00:00
parent c62fd2379a
commit 16cd9a4189
2 changed files with 62 additions and 62 deletions

View File

@@ -10,7 +10,7 @@ public enum ErrorCode: String, Codable {
case unavailable = "UNAVAILABLE"
}
public struct ConnectParams: Codable {
public struct ConnectParams: Codable, Sendable {
public let minprotocol: Int
public let maxprotocol: Int
public let client: [String: AnyCodable]
@@ -47,7 +47,7 @@ public struct ConnectParams: Codable {
}
}
public struct HelloOk: Codable {
public struct HelloOk: Codable, Sendable {
public let type: String
public let _protocol: Int
public let server: [String: AnyCodable]
@@ -84,7 +84,7 @@ public struct HelloOk: Codable {
}
}
public struct RequestFrame: Codable {
public struct RequestFrame: Codable, Sendable {
public let type: String
public let id: String
public let method: String
@@ -109,7 +109,7 @@ public struct RequestFrame: Codable {
}
}
public struct ResponseFrame: Codable {
public struct ResponseFrame: Codable, Sendable {
public let type: String
public let id: String
public let ok: Bool
@@ -138,7 +138,7 @@ public struct ResponseFrame: Codable {
}
}
public struct EventFrame: Codable {
public struct EventFrame: Codable, Sendable {
public let type: String
public let event: String
public let payload: AnyCodable?
@@ -167,7 +167,7 @@ public struct EventFrame: Codable {
}
}
public struct PresenceEntry: Codable {
public struct PresenceEntry: Codable, Sendable {
public let host: String?
public let ip: String?
public let version: String?
@@ -228,7 +228,7 @@ public struct PresenceEntry: Codable {
}
}
public struct StateVersion: Codable {
public struct StateVersion: Codable, Sendable {
public let presence: Int
public let health: Int
@@ -245,7 +245,7 @@ public struct StateVersion: Codable {
}
}
public struct Snapshot: Codable {
public struct Snapshot: Codable, Sendable {
public let presence: [PresenceEntry]
public let health: AnyCodable
public let stateversion: StateVersion
@@ -278,7 +278,7 @@ public struct Snapshot: Codable {
}
}
public struct ErrorShape: Codable {
public struct ErrorShape: Codable, Sendable {
public let code: String
public let message: String
public let details: AnyCodable?
@@ -307,7 +307,7 @@ public struct ErrorShape: Codable {
}
}
public struct AgentEvent: Codable {
public struct AgentEvent: Codable, Sendable {
public let runid: String
public let seq: Int
public let stream: String
@@ -336,7 +336,7 @@ public struct AgentEvent: Codable {
}
}
public struct SendParams: Codable {
public struct SendParams: Codable, Sendable {
public let to: String
public let message: String
public let mediaurl: String?
@@ -369,7 +369,7 @@ public struct SendParams: Codable {
}
}
public struct AgentParams: Codable {
public struct AgentParams: Codable, Sendable {
public let message: String
public let to: String?
public let sessionid: String?
@@ -422,7 +422,7 @@ public struct AgentParams: Codable {
}
}
public struct AgentWaitParams: Codable {
public struct AgentWaitParams: Codable, Sendable {
public let runid: String
public let afterms: Int?
public let timeoutms: Int?
@@ -443,7 +443,7 @@ public struct AgentWaitParams: Codable {
}
}
public struct WakeParams: Codable {
public struct WakeParams: Codable, Sendable {
public let mode: AnyCodable
public let text: String
@@ -460,7 +460,7 @@ public struct WakeParams: Codable {
}
}
public struct NodePairRequestParams: Codable {
public struct NodePairRequestParams: Codable, Sendable {
public let nodeid: String
public let displayname: String?
public let platform: String?
@@ -509,10 +509,10 @@ public struct NodePairRequestParams: Codable {
}
}
public struct NodePairListParams: Codable {
public struct NodePairListParams: Codable, Sendable {
}
public struct NodePairApproveParams: Codable {
public struct NodePairApproveParams: Codable, Sendable {
public let requestid: String
public init(
@@ -525,7 +525,7 @@ public struct NodePairApproveParams: Codable {
}
}
public struct NodePairRejectParams: Codable {
public struct NodePairRejectParams: Codable, Sendable {
public let requestid: String
public init(
@@ -538,7 +538,7 @@ public struct NodePairRejectParams: Codable {
}
}
public struct NodePairVerifyParams: Codable {
public struct NodePairVerifyParams: Codable, Sendable {
public let nodeid: String
public let token: String
@@ -555,7 +555,7 @@ public struct NodePairVerifyParams: Codable {
}
}
public struct NodeRenameParams: Codable {
public struct NodeRenameParams: Codable, Sendable {
public let nodeid: String
public let displayname: String
@@ -572,10 +572,10 @@ public struct NodeRenameParams: Codable {
}
}
public struct NodeListParams: Codable {
public struct NodeListParams: Codable, Sendable {
}
public struct NodeDescribeParams: Codable {
public struct NodeDescribeParams: Codable, Sendable {
public let nodeid: String
public init(
@@ -588,7 +588,7 @@ public struct NodeDescribeParams: Codable {
}
}
public struct NodeInvokeParams: Codable {
public struct NodeInvokeParams: Codable, Sendable {
public let nodeid: String
public let command: String
public let params: AnyCodable?
@@ -617,7 +617,7 @@ public struct NodeInvokeParams: Codable {
}
}
public struct SessionsListParams: Codable {
public struct SessionsListParams: Codable, Sendable {
public let limit: Int?
public let activeminutes: Int?
public let includeglobal: Bool?
@@ -642,7 +642,7 @@ public struct SessionsListParams: Codable {
}
}
public struct SessionsPatchParams: Codable {
public struct SessionsPatchParams: Codable, Sendable {
public let key: String
public let thinkinglevel: AnyCodable?
public let verboselevel: AnyCodable?
@@ -675,7 +675,7 @@ public struct SessionsPatchParams: Codable {
}
}
public struct SessionsResetParams: Codable {
public struct SessionsResetParams: Codable, Sendable {
public let key: String
public init(
@@ -688,7 +688,7 @@ public struct SessionsResetParams: Codable {
}
}
public struct SessionsDeleteParams: Codable {
public struct SessionsDeleteParams: Codable, Sendable {
public let key: String
public let deletetranscript: Bool?
@@ -705,7 +705,7 @@ public struct SessionsDeleteParams: Codable {
}
}
public struct SessionsCompactParams: Codable {
public struct SessionsCompactParams: Codable, Sendable {
public let key: String
public let maxlines: Int?
@@ -722,10 +722,10 @@ public struct SessionsCompactParams: Codable {
}
}
public struct ConfigGetParams: Codable {
public struct ConfigGetParams: Codable, Sendable {
}
public struct ConfigSetParams: Codable {
public struct ConfigSetParams: Codable, Sendable {
public let raw: String
public init(
@@ -738,10 +738,10 @@ public struct ConfigSetParams: Codable {
}
}
public struct ConfigSchemaParams: Codable {
public struct ConfigSchemaParams: Codable, Sendable {
}
public struct ConfigSchemaResponse: Codable {
public struct ConfigSchemaResponse: Codable, Sendable {
public let schema: AnyCodable
public let uihints: [String: AnyCodable]
public let version: String
@@ -766,7 +766,7 @@ public struct ConfigSchemaResponse: Codable {
}
}
public struct WizardStartParams: Codable {
public struct WizardStartParams: Codable, Sendable {
public let mode: AnyCodable?
public let workspace: String?
@@ -783,7 +783,7 @@ public struct WizardStartParams: Codable {
}
}
public struct WizardNextParams: Codable {
public struct WizardNextParams: Codable, Sendable {
public let sessionid: String
public let answer: [String: AnyCodable]?
@@ -800,7 +800,7 @@ public struct WizardNextParams: Codable {
}
}
public struct WizardCancelParams: Codable {
public struct WizardCancelParams: Codable, Sendable {
public let sessionid: String
public init(
@@ -813,7 +813,7 @@ public struct WizardCancelParams: Codable {
}
}
public struct WizardStatusParams: Codable {
public struct WizardStatusParams: Codable, Sendable {
public let sessionid: String
public init(
@@ -942,7 +942,7 @@ public struct WizardStatusResult: Codable, Sendable {
}
}
public struct TalkModeParams: Codable {
public struct TalkModeParams: Codable, Sendable {
public let enabled: Bool
public let phase: String?
@@ -959,7 +959,7 @@ public struct TalkModeParams: Codable {
}
}
public struct ProvidersStatusParams: Codable {
public struct ProvidersStatusParams: Codable, Sendable {
public let probe: Bool?
public let timeoutms: Int?
@@ -976,7 +976,7 @@ public struct ProvidersStatusParams: Codable {
}
}
public struct WebLoginStartParams: Codable {
public struct WebLoginStartParams: Codable, Sendable {
public let force: Bool?
public let timeoutms: Int?
public let verbose: Bool?
@@ -997,7 +997,7 @@ public struct WebLoginStartParams: Codable {
}
}
public struct WebLoginWaitParams: Codable {
public struct WebLoginWaitParams: Codable, Sendable {
public let timeoutms: Int?
public init(
@@ -1010,7 +1010,7 @@ public struct WebLoginWaitParams: Codable {
}
}
public struct ModelChoice: Codable {
public struct ModelChoice: Codable, Sendable {
public let id: String
public let name: String
public let provider: String
@@ -1039,10 +1039,10 @@ public struct ModelChoice: Codable {
}
}
public struct ModelsListParams: Codable {
public struct ModelsListParams: Codable, Sendable {
}
public struct ModelsListResult: Codable {
public struct ModelsListResult: Codable, Sendable {
public let models: [ModelChoice]
public init(
@@ -1055,10 +1055,10 @@ public struct ModelsListResult: Codable {
}
}
public struct SkillsStatusParams: Codable {
public struct SkillsStatusParams: Codable, Sendable {
}
public struct SkillsInstallParams: Codable {
public struct SkillsInstallParams: Codable, Sendable {
public let name: String
public let installid: String
public let timeoutms: Int?
@@ -1079,7 +1079,7 @@ public struct SkillsInstallParams: Codable {
}
}
public struct SkillsUpdateParams: Codable {
public struct SkillsUpdateParams: Codable, Sendable {
public let skillkey: String
public let enabled: Bool?
public let apikey: String?
@@ -1104,7 +1104,7 @@ public struct SkillsUpdateParams: Codable {
}
}
public struct CronJob: Codable {
public struct CronJob: Codable, Sendable {
public let id: String
public let name: String
public let description: String?
@@ -1161,7 +1161,7 @@ public struct CronJob: Codable {
}
}
public struct CronListParams: Codable {
public struct CronListParams: Codable, Sendable {
public let includedisabled: Bool?
public init(
@@ -1174,10 +1174,10 @@ public struct CronListParams: Codable {
}
}
public struct CronStatusParams: Codable {
public struct CronStatusParams: Codable, Sendable {
}
public struct CronAddParams: Codable {
public struct CronAddParams: Codable, Sendable {
public let name: String
public let description: String?
public let enabled: Bool?
@@ -1218,7 +1218,7 @@ public struct CronAddParams: Codable {
}
}
public struct CronUpdateParams: Codable {
public struct CronUpdateParams: Codable, Sendable {
public let id: String
public let patch: [String: AnyCodable]
@@ -1235,7 +1235,7 @@ public struct CronUpdateParams: Codable {
}
}
public struct CronRemoveParams: Codable {
public struct CronRemoveParams: Codable, Sendable {
public let id: String
public init(
@@ -1248,7 +1248,7 @@ public struct CronRemoveParams: Codable {
}
}
public struct CronRunParams: Codable {
public struct CronRunParams: Codable, Sendable {
public let id: String
public let mode: AnyCodable?
@@ -1265,7 +1265,7 @@ public struct CronRunParams: Codable {
}
}
public struct CronRunsParams: Codable {
public struct CronRunsParams: Codable, Sendable {
public let id: String
public let limit: Int?
@@ -1282,7 +1282,7 @@ public struct CronRunsParams: Codable {
}
}
public struct CronRunLogEntry: Codable {
public struct CronRunLogEntry: Codable, Sendable {
public let ts: Int
public let jobid: String
public let action: String
@@ -1327,7 +1327,7 @@ public struct CronRunLogEntry: Codable {
}
}
public struct ChatHistoryParams: Codable {
public struct ChatHistoryParams: Codable, Sendable {
public let sessionkey: String
public let limit: Int?
@@ -1344,7 +1344,7 @@ public struct ChatHistoryParams: Codable {
}
}
public struct ChatSendParams: Codable {
public struct ChatSendParams: Codable, Sendable {
public let sessionkey: String
public let message: String
public let thinking: String?
@@ -1381,7 +1381,7 @@ public struct ChatSendParams: Codable {
}
}
public struct ChatAbortParams: Codable {
public struct ChatAbortParams: Codable, Sendable {
public let sessionkey: String
public let runid: String
@@ -1398,7 +1398,7 @@ public struct ChatAbortParams: Codable {
}
}
public struct ChatEvent: Codable {
public struct ChatEvent: Codable, Sendable {
public let runid: String
public let sessionkey: String
public let seq: Int
@@ -1439,7 +1439,7 @@ public struct ChatEvent: Codable {
}
}
public struct TickEvent: Codable {
public struct TickEvent: Codable, Sendable {
public let ts: Int
public init(
@@ -1452,7 +1452,7 @@ public struct TickEvent: Codable {
}
}
public struct ShutdownEvent: Codable {
public struct ShutdownEvent: Codable, Sendable {
public let reason: String
public let restartexpectedms: Int?

View File

@@ -106,7 +106,7 @@ function emitStruct(name: string, schema: JsonSchema): string {
const props = schema.properties ?? {};
const required = new Set(schema.required ?? []);
const lines: string[] = [];
lines.push(`public struct ${name}: Codable {`);
lines.push(`public struct ${name}: Codable, Sendable {`);
if (Object.keys(props).length === 0) {
lines.push("}\n");
return lines.join("\n");