Skip to content

Commit a102f4d

Browse files
authored
fix(gateway): harden artifact RPCs
Add Gateway artifact RPCs and SDK helpers for list/get/download, with transcript provenance checks, safer download source handling, task/run/session coverage, generated protocol models, docs, and the refreshed generated config schema baseline. Closes #74706. Refs #74898, #74769, #74804, #74786.
1 parent e47a744 commit a102f4d

21 files changed

Lines changed: 1470 additions & 27 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Docs: https://docs.openclaw.ai
5757
### Changes
5858

5959
- Security/tools: configured tool sections (`tools.exec`, `tools.fs`) no longer implicitly widen restrictive profiles (`messaging`, `minimal`). Users who need those tools under a restricted profile must add explicit `alsoAllow` entries; a startup warning identifies affected configs. Fixes #47487. Thanks @amknight.
60+
- Gateway/SDK: add SDK-facing artifact list/get/download RPCs and App SDK helpers with transcript provenance and download-source guardrails. Refs #74706. Thanks @tmimmanuel.
6061
- Agents/commitments: add opt-in inferred follow-up commitments with hidden batched extraction, per-agent/per-channel scoping, heartbeat delivery, CLI management, a simple `commitments.enabled`/`commitments.maxPerDay` config, and heartbeat-interval due-time clamping so magical check-ins do not echo immediately. (#74189) Thanks @vignesh07.
6162
- Messages/queue: make `steer` drain all pending Pi steering messages at the next model boundary, keep legacy one-at-a-time steering as `queue`, and add a dedicated steering queue docs page. Thanks @vincentkoc.
6263
- Messages/queue: default active-run queueing to `steer` with a 500ms followup fallback debounce, and document the queue modes, precedence, and drop policies on the command queue page. Thanks @vincentkoc.

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 {

0 commit comments

Comments
 (0)