summaryrefslogtreecommitdiff
path: root/Sources/BubombCore/Models/SequenceStep.swift
diff options
context:
space:
mode:
authorgigagamerchaddhruv-spec <gigagamerchaddhruv-spec@users.noreply.github.com>2026-10-14 20:18:20 +0530
committergigagamerchaddhruv-spec <gigagamerchaddhruv-spec@users.noreply.github.com>2026-10-14 20:18:20 +0530
commitaceca8b5dfc8edd378ee9ff891bccb0f94c69f31 (patch)
tree08401ce8d050afbbe77514f479601a8e9535f4ec /Sources/BubombCore/Models/SequenceStep.swift
feat: launch Bubomb - native macOS menu bar utility ('Configure the boom')HEADmain
Diffstat (limited to 'Sources/BubombCore/Models/SequenceStep.swift')
-rw-r--r--Sources/BubombCore/Models/SequenceStep.swift43
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
+ }
+ }
+}