mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-08 06:54:24 +00:00
fix(ci): restore protocol and schema checks (#37470)
This commit is contained in:
@@ -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?
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -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<string, unknown> } => {
|
||||
const [head, ...rest] = segments;
|
||||
if (!head) {
|
||||
return { type: "string" };
|
||||
|
||||
Reference in New Issue
Block a user