mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-01 01:11:44 +00:00
iOS/watch: add actionable watch approvals and quick replies (#21996)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 3c2a01f903
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
This commit is contained in:
@@ -5,6 +5,24 @@ public enum OpenClawWatchCommand: String, Codable, Sendable {
|
||||
case notify = "watch.notify"
|
||||
}
|
||||
|
||||
public enum OpenClawWatchRisk: String, Codable, Sendable, Equatable {
|
||||
case low
|
||||
case medium
|
||||
case high
|
||||
}
|
||||
|
||||
public struct OpenClawWatchAction: Codable, Sendable, Equatable {
|
||||
public var id: String
|
||||
public var label: String
|
||||
public var style: String?
|
||||
|
||||
public init(id: String, label: String, style: String? = nil) {
|
||||
self.id = id
|
||||
self.label = label
|
||||
self.style = style
|
||||
}
|
||||
}
|
||||
|
||||
public struct OpenClawWatchStatusPayload: Codable, Sendable, Equatable {
|
||||
public var supported: Bool
|
||||
public var paired: Bool
|
||||
@@ -31,11 +49,36 @@ public struct OpenClawWatchNotifyParams: Codable, Sendable, Equatable {
|
||||
public var title: String
|
||||
public var body: String
|
||||
public var priority: OpenClawNotificationPriority?
|
||||
public var promptId: String?
|
||||
public var sessionKey: String?
|
||||
public var kind: String?
|
||||
public var details: String?
|
||||
public var expiresAtMs: Int?
|
||||
public var risk: OpenClawWatchRisk?
|
||||
public var actions: [OpenClawWatchAction]?
|
||||
|
||||
public init(title: String, body: String, priority: OpenClawNotificationPriority? = nil) {
|
||||
public init(
|
||||
title: String,
|
||||
body: String,
|
||||
priority: OpenClawNotificationPriority? = nil,
|
||||
promptId: String? = nil,
|
||||
sessionKey: String? = nil,
|
||||
kind: String? = nil,
|
||||
details: String? = nil,
|
||||
expiresAtMs: Int? = nil,
|
||||
risk: OpenClawWatchRisk? = nil,
|
||||
actions: [OpenClawWatchAction]? = nil)
|
||||
{
|
||||
self.title = title
|
||||
self.body = body
|
||||
self.priority = priority
|
||||
self.promptId = promptId
|
||||
self.sessionKey = sessionKey
|
||||
self.kind = kind
|
||||
self.details = details
|
||||
self.expiresAtMs = expiresAtMs
|
||||
self.risk = risk
|
||||
self.actions = actions
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user