diff options
| author | gigagamerchaddhruv-spec <gigagamerchaddhruv-spec@users.noreply.github.com> | 2026-10-14 20:18:20 +0530 |
|---|---|---|
| committer | gigagamerchaddhruv-spec <gigagamerchaddhruv-spec@users.noreply.github.com> | 2026-10-14 20:18:20 +0530 |
| commit | aceca8b5dfc8edd378ee9ff891bccb0f94c69f31 (patch) | |
| tree | 08401ce8d050afbbe77514f479601a8e9535f4ec /Sources/BubombCore/Models/SequenceStep.swift | |
Diffstat (limited to 'Sources/BubombCore/Models/SequenceStep.swift')
| -rw-r--r-- | Sources/BubombCore/Models/SequenceStep.swift | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Sources/BubombCore/Models/SequenceStep.swift b/Sources/BubombCore/Models/SequenceStep.swift new file mode 100644 index 0000000..f1d075d --- /dev/null +++ b/Sources/BubombCore/Models/SequenceStep.swift @@ -0,0 +1,43 @@ +import Foundation + +/// Individual step within a Multi-step Sequence payload. +public struct SequenceStep: Identifiable, Codable, Equatable, Hashable, Sendable { + public var id: UUID + public var name: String + public var action: StepAction + + public init(id: UUID = UUID(), name: String, action: StepAction) { + self.id = id + self.name = name + self.action = action + } + + public enum StepAction: Codable, Equatable, Hashable, Sendable { + case openApplication(applicationPath: String) + case openURL(urlString: String) + case runCommand(command: String, workingDirectory: String?, timeoutSeconds: TimeInterval?) + case runScript(scriptPath: String, arguments: [String], workingDirectory: String?, timeoutSeconds: TimeInterval?) + } + + public var actionTypeTitle: String { + switch action { + case .openApplication: return "Open App" + case .openURL: return "Open URL" + case .runCommand: return "Shell Command" + case .runScript: return "Run Script" + } + } + + public var summary: String { + switch action { + case .openApplication(let path): + return (path as NSString).lastPathComponent + case .openURL(let url): + return url + case .runCommand(let cmd, _, _): + return cmd + case .runScript(let path, _, _, _): + return (path as NSString).lastPathComponent + } + } +} |
