Skip to content

Commit 93ad914

Browse files
committed
fix(gateway): align artifact RPC protocol checks
1 parent 2a51066 commit 93ad914

6 files changed

Lines changed: 407 additions & 45 deletions

File tree

apps/macos/Sources/OpenClawProtocol/GatewayModels.swift

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3208,6 +3208,188 @@ public struct AgentsFilesSetResult: Codable, Sendable {
32083208
}
32093209
}
32103210

3211+
public struct ArtifactSummary: Codable, Sendable {
3212+
public let id: String
3213+
public let type: String
3214+
public let title: String
3215+
public let mimetype: String?
3216+
public let sizebytes: Int?
3217+
public let sessionkey: String?
3218+
public let runid: String?
3219+
public let taskid: String?
3220+
public let messageseq: Int?
3221+
public let source: String?
3222+
public let download: [String: AnyCodable]
3223+
3224+
public init(
3225+
id: String,
3226+
type: String,
3227+
title: String,
3228+
mimetype: String?,
3229+
sizebytes: Int?,
3230+
sessionkey: String?,
3231+
runid: String?,
3232+
taskid: String?,
3233+
messageseq: Int?,
3234+
source: String?,
3235+
download: [String: AnyCodable])
3236+
{
3237+
self.id = id
3238+
self.type = type
3239+
self.title = title
3240+
self.mimetype = mimetype
3241+
self.sizebytes = sizebytes
3242+
self.sessionkey = sessionkey
3243+
self.runid = runid
3244+
self.taskid = taskid
3245+
self.messageseq = messageseq
3246+
self.source = source
3247+
self.download = download
3248+
}
3249+
3250+
private enum CodingKeys: String, CodingKey {
3251+
case id
3252+
case type
3253+
case title
3254+
case mimetype = "mimeType"
3255+
case sizebytes = "sizeBytes"
3256+
case sessionkey = "sessionKey"
3257+
case runid = "runId"
3258+
case taskid = "taskId"
3259+
case messageseq = "messageSeq"
3260+
case source
3261+
case download
3262+
}
3263+
}
3264+
3265+
public struct ArtifactsListParams: Codable, Sendable {
3266+
public let sessionkey: String?
3267+
public let runid: String?
3268+
public let taskid: String?
3269+
3270+
public init(
3271+
sessionkey: String?,
3272+
runid: String?,
3273+
taskid: String?)
3274+
{
3275+
self.sessionkey = sessionkey
3276+
self.runid = runid
3277+
self.taskid = taskid
3278+
}
3279+
3280+
private enum CodingKeys: String, CodingKey {
3281+
case sessionkey = "sessionKey"
3282+
case runid = "runId"
3283+
case taskid = "taskId"
3284+
}
3285+
}
3286+
3287+
public struct ArtifactsListResult: Codable, Sendable {
3288+
public let artifacts: [ArtifactSummary]
3289+
3290+
public init(
3291+
artifacts: [ArtifactSummary])
3292+
{
3293+
self.artifacts = artifacts
3294+
}
3295+
3296+
private enum CodingKeys: String, CodingKey {
3297+
case artifacts
3298+
}
3299+
}
3300+
3301+
public struct ArtifactsGetParams: Codable, Sendable {
3302+
public let sessionkey: String?
3303+
public let runid: String?
3304+
public let taskid: String?
3305+
public let artifactid: String
3306+
3307+
public init(
3308+
sessionkey: String?,
3309+
runid: String?,
3310+
taskid: String?,
3311+
artifactid: String)
3312+
{
3313+
self.sessionkey = sessionkey
3314+
self.runid = runid
3315+
self.taskid = taskid
3316+
self.artifactid = artifactid
3317+
}
3318+
3319+
private enum CodingKeys: String, CodingKey {
3320+
case sessionkey = "sessionKey"
3321+
case runid = "runId"
3322+
case taskid = "taskId"
3323+
case artifactid = "artifactId"
3324+
}
3325+
}
3326+
3327+
public struct ArtifactsGetResult: Codable, Sendable {
3328+
public let artifact: ArtifactSummary
3329+
3330+
public init(
3331+
artifact: ArtifactSummary)
3332+
{
3333+
self.artifact = artifact
3334+
}
3335+
3336+
private enum CodingKeys: String, CodingKey {
3337+
case artifact
3338+
}
3339+
}
3340+
3341+
public struct ArtifactsDownloadParams: Codable, Sendable {
3342+
public let sessionkey: String?
3343+
public let runid: String?
3344+
public let taskid: String?
3345+
public let artifactid: String
3346+
3347+
public init(
3348+
sessionkey: String?,
3349+
runid: String?,
3350+
taskid: String?,
3351+
artifactid: String)
3352+
{
3353+
self.sessionkey = sessionkey
3354+
self.runid = runid
3355+
self.taskid = taskid
3356+
self.artifactid = artifactid
3357+
}
3358+
3359+
private enum CodingKeys: String, CodingKey {
3360+
case sessionkey = "sessionKey"
3361+
case runid = "runId"
3362+
case taskid = "taskId"
3363+
case artifactid = "artifactId"
3364+
}
3365+
}
3366+
3367+
public struct ArtifactsDownloadResult: Codable, Sendable {
3368+
public let artifact: ArtifactSummary
3369+
public let encoding: String?
3370+
public let data: String?
3371+
public let url: String?
3372+
3373+
public init(
3374+
artifact: ArtifactSummary,
3375+
encoding: String?,
3376+
data: String?,
3377+
url: String?)
3378+
{
3379+
self.artifact = artifact
3380+
self.encoding = encoding
3381+
self.data = data
3382+
self.url = url
3383+
}
3384+
3385+
private enum CodingKeys: String, CodingKey {
3386+
case artifact
3387+
case encoding
3388+
case data
3389+
case url
3390+
}
3391+
}
3392+
32113393
public struct AgentsListParams: Codable, Sendable {}
32123394

32133395
public struct AgentsListResult: Codable, Sendable {

apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3208,6 +3208,188 @@ public struct AgentsFilesSetResult: Codable, Sendable {
32083208
}
32093209
}
32103210

3211+
public struct ArtifactSummary: Codable, Sendable {
3212+
public let id: String
3213+
public let type: String
3214+
public let title: String
3215+
public let mimetype: String?
3216+
public let sizebytes: Int?
3217+
public let sessionkey: String?
3218+
public let runid: String?
3219+
public let taskid: String?
3220+
public let messageseq: Int?
3221+
public let source: String?
3222+
public let download: [String: AnyCodable]
3223+
3224+
public init(
3225+
id: String,
3226+
type: String,
3227+
title: String,
3228+
mimetype: String?,
3229+
sizebytes: Int?,
3230+
sessionkey: String?,
3231+
runid: String?,
3232+
taskid: String?,
3233+
messageseq: Int?,
3234+
source: String?,
3235+
download: [String: AnyCodable])
3236+
{
3237+
self.id = id
3238+
self.type = type
3239+
self.title = title
3240+
self.mimetype = mimetype
3241+
self.sizebytes = sizebytes
3242+
self.sessionkey = sessionkey
3243+
self.runid = runid
3244+
self.taskid = taskid
3245+
self.messageseq = messageseq
3246+
self.source = source
3247+
self.download = download
3248+
}
3249+
3250+
private enum CodingKeys: String, CodingKey {
3251+
case id
3252+
case type
3253+
case title
3254+
case mimetype = "mimeType"
3255+
case sizebytes = "sizeBytes"
3256+
case sessionkey = "sessionKey"
3257+
case runid = "runId"
3258+
case taskid = "taskId"
3259+
case messageseq = "messageSeq"
3260+
case source
3261+
case download
3262+
}
3263+
}
3264+
3265+
public struct ArtifactsListParams: Codable, Sendable {
3266+
public let sessionkey: String?
3267+
public let runid: String?
3268+
public let taskid: String?
3269+
3270+
public init(
3271+
sessionkey: String?,
3272+
runid: String?,
3273+
taskid: String?)
3274+
{
3275+
self.sessionkey = sessionkey
3276+
self.runid = runid
3277+
self.taskid = taskid
3278+
}
3279+
3280+
private enum CodingKeys: String, CodingKey {
3281+
case sessionkey = "sessionKey"
3282+
case runid = "runId"
3283+
case taskid = "taskId"
3284+
}
3285+
}
3286+
3287+
public struct ArtifactsListResult: Codable, Sendable {
3288+
public let artifacts: [ArtifactSummary]
3289+
3290+
public init(
3291+
artifacts: [ArtifactSummary])
3292+
{
3293+
self.artifacts = artifacts
3294+
}
3295+
3296+
private enum CodingKeys: String, CodingKey {
3297+
case artifacts
3298+
}
3299+
}
3300+
3301+
public struct ArtifactsGetParams: Codable, Sendable {
3302+
public let sessionkey: String?
3303+
public let runid: String?
3304+
public let taskid: String?
3305+
public let artifactid: String
3306+
3307+
public init(
3308+
sessionkey: String?,
3309+
runid: String?,
3310+
taskid: String?,
3311+
artifactid: String)
3312+
{
3313+
self.sessionkey = sessionkey
3314+
self.runid = runid
3315+
self.taskid = taskid
3316+
self.artifactid = artifactid
3317+
}
3318+
3319+
private enum CodingKeys: String, CodingKey {
3320+
case sessionkey = "sessionKey"
3321+
case runid = "runId"
3322+
case taskid = "taskId"
3323+
case artifactid = "artifactId"
3324+
}
3325+
}
3326+
3327+
public struct ArtifactsGetResult: Codable, Sendable {
3328+
public let artifact: ArtifactSummary
3329+
3330+
public init(
3331+
artifact: ArtifactSummary)
3332+
{
3333+
self.artifact = artifact
3334+
}
3335+
3336+
private enum CodingKeys: String, CodingKey {
3337+
case artifact
3338+
}
3339+
}
3340+
3341+
public struct ArtifactsDownloadParams: Codable, Sendable {
3342+
public let sessionkey: String?
3343+
public let runid: String?
3344+
public let taskid: String?
3345+
public let artifactid: String
3346+
3347+
public init(
3348+
sessionkey: String?,
3349+
runid: String?,
3350+
taskid: String?,
3351+
artifactid: String)
3352+
{
3353+
self.sessionkey = sessionkey
3354+
self.runid = runid
3355+
self.taskid = taskid
3356+
self.artifactid = artifactid
3357+
}
3358+
3359+
private enum CodingKeys: String, CodingKey {
3360+
case sessionkey = "sessionKey"
3361+
case runid = "runId"
3362+
case taskid = "taskId"
3363+
case artifactid = "artifactId"
3364+
}
3365+
}
3366+
3367+
public struct ArtifactsDownloadResult: Codable, Sendable {
3368+
public let artifact: ArtifactSummary
3369+
public let encoding: String?
3370+
public let data: String?
3371+
public let url: String?
3372+
3373+
public init(
3374+
artifact: ArtifactSummary,
3375+
encoding: String?,
3376+
data: String?,
3377+
url: String?)
3378+
{
3379+
self.artifact = artifact
3380+
self.encoding = encoding
3381+
self.data = data
3382+
self.url = url
3383+
}
3384+
3385+
private enum CodingKeys: String, CodingKey {
3386+
case artifact
3387+
case encoding
3388+
case data
3389+
case url
3390+
}
3391+
}
3392+
32113393
public struct AgentsListParams: Codable, Sendable {}
32123394

32133395
public struct AgentsListResult: Codable, Sendable {

src/gateway/protocol/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,10 @@ export {
701701
SessionsDeleteParamsSchema,
702702
SessionsCompactParamsSchema,
703703
SessionsUsageParamsSchema,
704+
ArtifactSummarySchema,
705+
ArtifactsListParamsSchema,
706+
ArtifactsGetParamsSchema,
707+
ArtifactsDownloadParamsSchema,
704708
ConfigGetParamsSchema,
705709
ConfigSetParamsSchema,
706710
ConfigApplyParamsSchema,

0 commit comments

Comments
 (0)