diff --git a/apps/macos/Sources/OpenClawProtocol/GatewayModels.swift b/apps/macos/Sources/OpenClawProtocol/GatewayModels.swift index 6d138c70525..a4d91cced6d 100644 --- a/apps/macos/Sources/OpenClawProtocol/GatewayModels.swift +++ b/apps/macos/Sources/OpenClawProtocol/GatewayModels.swift @@ -1460,6 +1460,20 @@ public struct ConfigPatchParams: Codable, Sendable { public struct ConfigSchemaParams: Codable, Sendable {} +public struct ConfigSchemaLookupParams: Codable, Sendable { + public let path: String + + public init( + path: String) + { + self.path = path + } + + private enum CodingKeys: String, CodingKey { + case path + } +} + public struct ConfigSchemaResponse: Codable, Sendable { public let schema: AnyCodable public let uihints: [String: AnyCodable] @@ -1486,6 +1500,36 @@ public struct ConfigSchemaResponse: Codable, Sendable { } } +public struct ConfigSchemaLookupResult: Codable, Sendable { + public let path: String + public let schema: AnyCodable + public let hint: [String: AnyCodable]? + public let hintpath: String? + public let children: [[String: AnyCodable]] + + public init( + path: String, + schema: AnyCodable, + hint: [String: AnyCodable]?, + hintpath: String?, + children: [[String: AnyCodable]]) + { + self.path = path + self.schema = schema + self.hint = hint + self.hintpath = hintpath + self.children = children + } + + private enum CodingKeys: String, CodingKey { + case path + case schema + case hint + case hintpath = "hintPath" + case children + } +} + public struct WizardStartParams: Codable, Sendable { public let mode: AnyCodable? public let workspace: String? diff --git a/apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift b/apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift index 6d138c70525..a4d91cced6d 100644 --- a/apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift +++ b/apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift @@ -1460,6 +1460,20 @@ public struct ConfigPatchParams: Codable, Sendable { public struct ConfigSchemaParams: Codable, Sendable {} +public struct ConfigSchemaLookupParams: Codable, Sendable { + public let path: String + + public init( + path: String) + { + self.path = path + } + + private enum CodingKeys: String, CodingKey { + case path + } +} + public struct ConfigSchemaResponse: Codable, Sendable { public let schema: AnyCodable public let uihints: [String: AnyCodable] @@ -1486,6 +1500,36 @@ public struct ConfigSchemaResponse: Codable, Sendable { } } +public struct ConfigSchemaLookupResult: Codable, Sendable { + public let path: String + public let schema: AnyCodable + public let hint: [String: AnyCodable]? + public let hintpath: String? + public let children: [[String: AnyCodable]] + + public init( + path: String, + schema: AnyCodable, + hint: [String: AnyCodable]?, + hintpath: String?, + children: [[String: AnyCodable]]) + { + self.path = path + self.schema = schema + self.hint = hint + self.hintpath = hintpath + self.children = children + } + + private enum CodingKeys: String, CodingKey { + case path + case schema + case hint + case hintpath = "hintPath" + case children + } +} + public struct WizardStartParams: Codable, Sendable { public let mode: AnyCodable? public let workspace: String? diff --git a/src/config/schema.test.ts b/src/config/schema.test.ts index 2d420efd868..bce33bad7b9 100644 --- a/src/config/schema.test.ts +++ b/src/config/schema.test.ts @@ -272,7 +272,9 @@ describe("config schema", () => { }); it("rejects overly deep lookup paths", () => { - const buildNestedObjectSchema = (segments: string[]) => { + const buildNestedObjectSchema = ( + segments: string[], + ): { type: string; properties?: Record } => { const [head, ...rest] = segments; if (!head) { return { type: "string" };