mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:50:45 +00:00
feat(gateway): add SDK environment discovery RPCs (#74867) thanks @ai-hpc
Co-authored-by: ai-hpc <183861985+ai-hpc@users.noreply.github.com> Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
This commit is contained in:
@@ -13,6 +13,14 @@ public enum ErrorCode: String, Codable, Sendable {
|
||||
case unavailable = "UNAVAILABLE"
|
||||
}
|
||||
|
||||
public enum EnvironmentStatus: String, Codable, Sendable {
|
||||
case available = "available"
|
||||
case unavailable = "unavailable"
|
||||
case starting = "starting"
|
||||
case stopping = "stopping"
|
||||
case error = "error"
|
||||
}
|
||||
|
||||
public enum NodePresenceAliveReason: String, Codable, Sendable {
|
||||
case background = "background"
|
||||
case silentPush = "silent_push"
|
||||
@@ -380,6 +388,96 @@ public struct ErrorShape: Codable, Sendable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct EnvironmentSummary: Codable, Sendable {
|
||||
public let id: String
|
||||
public let type: String
|
||||
public let label: String?
|
||||
public let status: EnvironmentStatus
|
||||
public let capabilities: [String]?
|
||||
|
||||
public init(
|
||||
id: String,
|
||||
type: String,
|
||||
label: String?,
|
||||
status: EnvironmentStatus,
|
||||
capabilities: [String]?)
|
||||
{
|
||||
self.id = id
|
||||
self.type = type
|
||||
self.label = label
|
||||
self.status = status
|
||||
self.capabilities = capabilities
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case id
|
||||
case type
|
||||
case label
|
||||
case status
|
||||
case capabilities
|
||||
}
|
||||
}
|
||||
|
||||
public struct EnvironmentsListParams: Codable, Sendable {}
|
||||
|
||||
public struct EnvironmentsListResult: Codable, Sendable {
|
||||
public let environments: [EnvironmentSummary]
|
||||
|
||||
public init(
|
||||
environments: [EnvironmentSummary])
|
||||
{
|
||||
self.environments = environments
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case environments
|
||||
}
|
||||
}
|
||||
|
||||
public struct EnvironmentsStatusParams: Codable, Sendable {
|
||||
public let environmentid: String
|
||||
|
||||
public init(
|
||||
environmentid: String)
|
||||
{
|
||||
self.environmentid = environmentid
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case environmentid = "environmentId"
|
||||
}
|
||||
}
|
||||
|
||||
public struct EnvironmentsStatusResult: Codable, Sendable {
|
||||
public let id: String
|
||||
public let type: String
|
||||
public let label: String?
|
||||
public let status: EnvironmentStatus
|
||||
public let capabilities: [String]?
|
||||
|
||||
public init(
|
||||
id: String,
|
||||
type: String,
|
||||
label: String?,
|
||||
status: EnvironmentStatus,
|
||||
capabilities: [String]?)
|
||||
{
|
||||
self.id = id
|
||||
self.type = type
|
||||
self.label = label
|
||||
self.status = status
|
||||
self.capabilities = capabilities
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case id
|
||||
case type
|
||||
case label
|
||||
case status
|
||||
case capabilities
|
||||
}
|
||||
}
|
||||
|
||||
public struct AgentEvent: Codable, Sendable {
|
||||
public let runid: String
|
||||
public let seq: Int
|
||||
|
||||
Reference in New Issue
Block a user