Files
openclaw/apps/shared/OpenClawKit/Sources/OpenClawKit/SystemCommands.swift

89 lines
2.4 KiB
Swift
Raw Normal View History

import Foundation
2026-01-30 03:15:10 +01:00
public enum OpenClawSystemCommand: String, Codable, Sendable {
case run = "system.run"
2026-01-16 07:31:26 +00:00
case which = "system.which"
case notify = "system.notify"
case execApprovalsGet = "system.execApprovals.get"
case execApprovalsSet = "system.execApprovals.set"
}
2026-01-30 03:15:10 +01:00
public enum OpenClawNotificationPriority: String, Codable, Sendable {
case passive
case active
case timeSensitive
}
2026-01-30 03:15:10 +01:00
public enum OpenClawNotificationDelivery: String, Codable, Sendable {
case system
case overlay
case auto
}
2026-01-30 03:15:10 +01:00
public struct OpenClawSystemRunParams: Codable, Sendable, Equatable {
public var command: [String]
public var rawCommand: String?
public var cwd: String?
public var env: [String: String]?
public var timeoutMs: Int?
public var needsScreenRecording: Bool?
2026-01-18 01:33:52 +00:00
public var agentId: String?
2026-01-18 04:27:33 +00:00
public var sessionKey: String?
2026-01-19 04:50:07 +00:00
public var approved: Bool?
public var approvalDecision: String?
public init(
command: [String],
rawCommand: String? = nil,
cwd: String? = nil,
env: [String: String]? = nil,
timeoutMs: Int? = nil,
2026-01-18 01:33:52 +00:00
needsScreenRecording: Bool? = nil,
2026-01-18 04:27:33 +00:00
agentId: String? = nil,
2026-01-19 04:50:07 +00:00
sessionKey: String? = nil,
approved: Bool? = nil,
approvalDecision: String? = nil)
{
self.command = command
self.rawCommand = rawCommand
self.cwd = cwd
self.env = env
self.timeoutMs = timeoutMs
self.needsScreenRecording = needsScreenRecording
2026-01-18 01:33:52 +00:00
self.agentId = agentId
2026-01-18 04:27:33 +00:00
self.sessionKey = sessionKey
2026-01-19 04:50:07 +00:00
self.approved = approved
self.approvalDecision = approvalDecision
}
}
2026-01-30 03:15:10 +01:00
public struct OpenClawSystemWhichParams: Codable, Sendable, Equatable {
2026-01-16 07:31:26 +00:00
public var bins: [String]
public init(bins: [String]) {
self.bins = bins
}
}
2026-01-30 03:15:10 +01:00
public struct OpenClawSystemNotifyParams: Codable, Sendable, Equatable {
public var title: String
public var body: String
public var sound: String?
2026-01-30 03:15:10 +01:00
public var priority: OpenClawNotificationPriority?
public var delivery: OpenClawNotificationDelivery?
public init(
title: String,
body: String,
sound: String? = nil,
2026-01-30 03:15:10 +01:00
priority: OpenClawNotificationPriority? = nil,
delivery: OpenClawNotificationDelivery? = nil)
{
self.title = title
self.body = body
self.sound = sound
self.priority = priority
self.delivery = delivery
}
}