@lattices/cli 0.4.14 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/README.md +5 -7
  2. package/apps/mac/Info.plist +4 -4
  3. package/apps/mac/Lattices.app/Contents/Info.plist +4 -12
  4. package/apps/mac/Lattices.app/Contents/MacOS/Lattices +0 -0
  5. package/bin/lattices-app.ts +110 -17
  6. package/bin/lattices-build +125 -0
  7. package/bin/lattices-dev +89 -16
  8. package/bin/lattices.ts +977 -16
  9. package/docs/agents.md +81 -4
  10. package/docs/ai-chat-ux-review.md +416 -0
  11. package/docs/api.md +135 -3
  12. package/docs/app.md +30 -8
  13. package/docs/config.md +4 -0
  14. package/docs/mouse-gestures.md +60 -1
  15. package/docs/proposals/LAT-004-interactive-overlay-actors.md +1 -1
  16. package/docs/proposals/LAT-005-action-runtime-product-spine.md +914 -0
  17. package/docs/proposals/LAT-006-mira-in-lattices.md +553 -0
  18. package/docs/proposals/LAT-007-unified-app-shell.md +128 -0
  19. package/docs/reference/dewey.config.ts +2 -2
  20. package/docs/release.md +171 -0
  21. package/docs/repo-structure.md +5 -5
  22. package/docs/voice.md +11 -27
  23. package/package.json +11 -10
  24. package/apps/mac/Package.swift +0 -27
  25. package/apps/mac/Sources/AppShell/App.swift +0 -26
  26. package/apps/mac/Sources/AppShell/AppActivationCoordinator.swift +0 -27
  27. package/apps/mac/Sources/AppShell/AppDelegate.swift +0 -189
  28. package/apps/mac/Sources/AppShell/AppServicesBootstrap.swift +0 -25
  29. package/apps/mac/Sources/AppShell/AppShellView.swift +0 -171
  30. package/apps/mac/Sources/AppShell/AppUpdater.swift +0 -305
  31. package/apps/mac/Sources/AppShell/CliActionLauncher.swift +0 -50
  32. package/apps/mac/Sources/AppShell/HomeDashboardView.swift +0 -133
  33. package/apps/mac/Sources/AppShell/HotkeyBootstrap.swift +0 -87
  34. package/apps/mac/Sources/AppShell/KeyRecorderView.swift +0 -210
  35. package/apps/mac/Sources/AppShell/LatticesRuntime.swift +0 -104
  36. package/apps/mac/Sources/AppShell/MainView.swift +0 -847
  37. package/apps/mac/Sources/AppShell/MainWindow.swift +0 -83
  38. package/apps/mac/Sources/AppShell/MenuBarController.swift +0 -177
  39. package/apps/mac/Sources/AppShell/OnboardingView.swift +0 -483
  40. package/apps/mac/Sources/AppShell/PermissionsAssistantView.swift +0 -366
  41. package/apps/mac/Sources/AppShell/PermissionsAssistantWindow.swift +0 -70
  42. package/apps/mac/Sources/AppShell/Preferences.swift +0 -297
  43. package/apps/mac/Sources/AppShell/SettingsView.swift +0 -3163
  44. package/apps/mac/Sources/AppShell/SettingsWindow.swift +0 -34
  45. package/apps/mac/Sources/AppShell/WorkspaceInspectorPresenter.swift +0 -13
  46. package/apps/mac/Sources/Core/Actions/HotkeyManager.swift +0 -256
  47. package/apps/mac/Sources/Core/Actions/HotkeyStore.swift +0 -399
  48. package/apps/mac/Sources/Core/Actions/IntentEngine.swift +0 -988
  49. package/apps/mac/Sources/Core/Actions/IntentSchema.swift +0 -94
  50. package/apps/mac/Sources/Core/Actions/Intents/CreateLayerIntent.swift +0 -54
  51. package/apps/mac/Sources/Core/Actions/Intents/DistributeIntent.swift +0 -56
  52. package/apps/mac/Sources/Core/Actions/Intents/FocusIntent.swift +0 -69
  53. package/apps/mac/Sources/Core/Actions/Intents/HelpIntent.swift +0 -41
  54. package/apps/mac/Sources/Core/Actions/Intents/KillIntent.swift +0 -47
  55. package/apps/mac/Sources/Core/Actions/Intents/LatticeIntent.swift +0 -53
  56. package/apps/mac/Sources/Core/Actions/Intents/LaunchIntent.swift +0 -67
  57. package/apps/mac/Sources/Core/Actions/Intents/ListSessionsIntent.swift +0 -32
  58. package/apps/mac/Sources/Core/Actions/Intents/ListWindowsIntent.swift +0 -30
  59. package/apps/mac/Sources/Core/Actions/Intents/ScanIntent.swift +0 -52
  60. package/apps/mac/Sources/Core/Actions/Intents/SearchIntent.swift +0 -190
  61. package/apps/mac/Sources/Core/Actions/Intents/SwitchLayerIntent.swift +0 -50
  62. package/apps/mac/Sources/Core/Actions/Intents/TileIntent.swift +0 -61
  63. package/apps/mac/Sources/Core/Actions/PaletteCommand.swift +0 -439
  64. package/apps/mac/Sources/Core/Actions/VoiceIntentResolver.swift +0 -713
  65. package/apps/mac/Sources/Core/Companion/CompanionActivityLog.swift +0 -70
  66. package/apps/mac/Sources/Core/Companion/CompanionKeyboardController.swift +0 -141
  67. package/apps/mac/Sources/Core/Companion/LatticesCompanionBridgeServer.swift +0 -454
  68. package/apps/mac/Sources/Core/Companion/LatticesCompanionCockpit.swift +0 -555
  69. package/apps/mac/Sources/Core/Companion/LatticesCompanionSecurityCoordinator.swift +0 -629
  70. package/apps/mac/Sources/Core/Companion/LatticesCompanionTrackpadController.swift +0 -204
  71. package/apps/mac/Sources/Core/Companion/LatticesDeckHost.swift +0 -1463
  72. package/apps/mac/Sources/Core/Daemon/DaemonProtocol.swift +0 -114
  73. package/apps/mac/Sources/Core/Daemon/DaemonServer.swift +0 -427
  74. package/apps/mac/Sources/Core/Daemon/LatticesApi.swift +0 -2965
  75. package/apps/mac/Sources/Core/Desktop/AccessibilityTextExtractor.swift +0 -111
  76. package/apps/mac/Sources/Core/Desktop/AppTypeClassifier.swift +0 -106
  77. package/apps/mac/Sources/Core/Desktop/DesktopModel.swift +0 -331
  78. package/apps/mac/Sources/Core/Desktop/DesktopModelTypes.swift +0 -73
  79. package/apps/mac/Sources/Core/Desktop/InventoryManager.swift +0 -35
  80. package/apps/mac/Sources/Core/Desktop/InventoryPath.swift +0 -43
  81. package/apps/mac/Sources/Core/Desktop/MouseFinder.swift +0 -527
  82. package/apps/mac/Sources/Core/Desktop/OcrModel.swift +0 -467
  83. package/apps/mac/Sources/Core/Desktop/OcrStore.swift +0 -329
  84. package/apps/mac/Sources/Core/Desktop/PlacementSpec.swift +0 -195
  85. package/apps/mac/Sources/Core/Desktop/SessionWindowLocator.swift +0 -139
  86. package/apps/mac/Sources/Core/Desktop/TilePickerView.swift +0 -209
  87. package/apps/mac/Sources/Core/Desktop/WindowCapture.swift +0 -33
  88. package/apps/mac/Sources/Core/Desktop/WindowDragSnapController.swift +0 -429
  89. package/apps/mac/Sources/Core/Desktop/WindowPreviewCard.swift +0 -100
  90. package/apps/mac/Sources/Core/Desktop/WindowPreviewStore.swift +0 -112
  91. package/apps/mac/Sources/Core/Desktop/WindowSelectionStore.swift +0 -76
  92. package/apps/mac/Sources/Core/Desktop/WindowTiler.swift +0 -2222
  93. package/apps/mac/Sources/Core/Input/EventTapBreaker.swift +0 -124
  94. package/apps/mac/Sources/Core/Input/EventTapThread.swift +0 -54
  95. package/apps/mac/Sources/Core/Input/InputCaptureResetCenter.swift +0 -20
  96. package/apps/mac/Sources/Core/Input/KeyboardRemapConfig.swift +0 -69
  97. package/apps/mac/Sources/Core/Input/KeyboardRemapController.swift +0 -346
  98. package/apps/mac/Sources/Core/Input/KeyboardRemapStore.swift +0 -141
  99. package/apps/mac/Sources/Core/Input/MouseGestureConfig.swift +0 -499
  100. package/apps/mac/Sources/Core/Input/MouseGestureController.swift +0 -2583
  101. package/apps/mac/Sources/Core/Input/MouseInputDeviceStore.swift +0 -98
  102. package/apps/mac/Sources/Core/Input/MouseInputEventViewer.swift +0 -272
  103. package/apps/mac/Sources/Core/Input/MouseShortcutStore.swift +0 -170
  104. package/apps/mac/Sources/Core/Input/SecureEventInputMonitor.swift +0 -39
  105. package/apps/mac/Sources/Core/Input/ShapeRecognizer.swift +0 -624
  106. package/apps/mac/Sources/Core/Input/TapBudgetMeter.swift +0 -56
  107. package/apps/mac/Sources/Core/Overlays/AppWindowShell.swift +0 -63
  108. package/apps/mac/Sources/Core/Overlays/CommandMode/CommandModeState.swift +0 -1566
  109. package/apps/mac/Sources/Core/Overlays/CommandMode/CommandModeView.swift +0 -1927
  110. package/apps/mac/Sources/Core/Overlays/CommandMode/CommandModeWindow.swift +0 -196
  111. package/apps/mac/Sources/Core/Overlays/CommandPalette/CommandPaletteView.swift +0 -307
  112. package/apps/mac/Sources/Core/Overlays/CommandPalette/CommandPaletteWindow.swift +0 -67
  113. package/apps/mac/Sources/Core/Overlays/HUD/CheatSheetHUD.swift +0 -576
  114. package/apps/mac/Sources/Core/Overlays/HUD/HUDBottomBar.swift +0 -279
  115. package/apps/mac/Sources/Core/Overlays/HUD/HUDController.swift +0 -1158
  116. package/apps/mac/Sources/Core/Overlays/HUD/HUDLeftBar.swift +0 -849
  117. package/apps/mac/Sources/Core/Overlays/HUD/HUDMinimap.swift +0 -179
  118. package/apps/mac/Sources/Core/Overlays/HUD/HUDRightBar.swift +0 -596
  119. package/apps/mac/Sources/Core/Overlays/HUD/HUDState.swift +0 -367
  120. package/apps/mac/Sources/Core/Overlays/HUD/HUDTopBar.swift +0 -243
  121. package/apps/mac/Sources/Core/Overlays/HUD/LauncherHUD.swift +0 -334
  122. package/apps/mac/Sources/Core/Overlays/HUD/LayerBezel.swift +0 -203
  123. package/apps/mac/Sources/Core/Overlays/OmniSearch/OmniSearchState.swift +0 -280
  124. package/apps/mac/Sources/Core/Overlays/OmniSearch/OmniSearchView.swift +0 -422
  125. package/apps/mac/Sources/Core/Overlays/OmniSearch/OmniSearchWindow.swift +0 -94
  126. package/apps/mac/Sources/Core/Overlays/OverlayPanelShell.swift +0 -241
  127. package/apps/mac/Sources/Core/Overlays/ScreenMap/ScreenMapState.swift +0 -3135
  128. package/apps/mac/Sources/Core/Overlays/ScreenMap/ScreenMapView.swift +0 -3977
  129. package/apps/mac/Sources/Core/Overlays/ScreenMap/ScreenMapWindowController.swift +0 -119
  130. package/apps/mac/Sources/Core/Overlays/ScreenOverlayCanvasController.swift +0 -1217
  131. package/apps/mac/Sources/Core/Overlays/Voice/VoiceCommandWindow.swift +0 -1575
  132. package/apps/mac/Sources/Core/Pi/PiAuthNextStepCard.swift +0 -148
  133. package/apps/mac/Sources/Core/Pi/PiAuthPromptCard.swift +0 -90
  134. package/apps/mac/Sources/Core/Pi/PiChatDock.swift +0 -564
  135. package/apps/mac/Sources/Core/Pi/PiChatSession.swift +0 -1948
  136. package/apps/mac/Sources/Core/Pi/PiInstallCallout.swift +0 -86
  137. package/apps/mac/Sources/Core/Pi/PiProviderSetupCallout.swift +0 -99
  138. package/apps/mac/Sources/Core/Pi/PiWorkspaceView.swift +0 -510
  139. package/apps/mac/Sources/Core/System/Capability.swift +0 -79
  140. package/apps/mac/Sources/Core/System/DiagnosticLog.swift +0 -373
  141. package/apps/mac/Sources/Core/System/EventBus.swift +0 -31
  142. package/apps/mac/Sources/Core/System/PermissionChecker.swift +0 -224
  143. package/apps/mac/Sources/Core/System/ProcessModel.swift +0 -199
  144. package/apps/mac/Sources/Core/System/ProcessQuery.swift +0 -151
  145. package/apps/mac/Sources/Core/System/SystemTelemetryMonitor.swift +0 -273
  146. package/apps/mac/Sources/Core/Voice/AdvisorLearningStore.swift +0 -90
  147. package/apps/mac/Sources/Core/Voice/AgentSession.swift +0 -377
  148. package/apps/mac/Sources/Core/Voice/AudioProvider.swift +0 -555
  149. package/apps/mac/Sources/Core/Voice/HandsOffSession.swift +0 -839
  150. package/apps/mac/Sources/Core/Voice/VoiceChatView.swift +0 -192
  151. package/apps/mac/Sources/Core/Voice/VoxClient.swift +0 -454
  152. package/apps/mac/Sources/Core/Workspace/Project.swift +0 -28
  153. package/apps/mac/Sources/Core/Workspace/ProjectScanner.swift +0 -141
  154. package/apps/mac/Sources/Core/Workspace/SessionLayerStore.swift +0 -285
  155. package/apps/mac/Sources/Core/Workspace/SessionManager.swift +0 -75
  156. package/apps/mac/Sources/Core/Workspace/Terminal/Terminal.swift +0 -259
  157. package/apps/mac/Sources/Core/Workspace/Terminal/TerminalQuery.swift +0 -156
  158. package/apps/mac/Sources/Core/Workspace/Terminal/TerminalSynthesizer.swift +0 -200
  159. package/apps/mac/Sources/Core/Workspace/Tmux/TmuxModel.swift +0 -60
  160. package/apps/mac/Sources/Core/Workspace/Tmux/TmuxQuery.swift +0 -105
  161. package/apps/mac/Sources/Core/Workspace/WorkspaceManager.swift +0 -1027
  162. package/apps/mac/Sources/UI/ActionRow.swift +0 -78
  163. package/apps/mac/Sources/UI/OrphanRow.swift +0 -129
  164. package/apps/mac/Sources/UI/ProjectRow.swift +0 -368
  165. package/apps/mac/Sources/UI/TabGroupRow.swift +0 -178
  166. package/apps/mac/Sources/UI/Theme.swift +0 -164
  167. package/apps/mac/Tests/StageDragTests.swift +0 -333
  168. package/apps/mac/Tests/StageJoinTests.swift +0 -313
  169. package/apps/mac/Tests/StageManagerTests.swift +0 -280
  170. package/apps/mac/Tests/StageTileTests.swift +0 -353
  171. package/swift/Package.swift +0 -20
  172. package/swift/Sources/DeckKit/DeckAction.swift +0 -51
  173. package/swift/Sources/DeckKit/DeckBridgeSecurity.swift +0 -152
  174. package/swift/Sources/DeckKit/DeckCockpit.swift +0 -82
  175. package/swift/Sources/DeckKit/DeckHost.swift +0 -7
  176. package/swift/Sources/DeckKit/DeckManifest.swift +0 -145
  177. package/swift/Sources/DeckKit/DeckRuntimeSnapshot.swift +0 -533
  178. package/swift/Sources/DeckKit/DeckTrackpad.swift +0 -63
  179. package/swift/Sources/DeckKit/DeckValue.swift +0 -93
  180. package/swift/Sources/DeckKit/DeckVoiceError.swift +0 -88
  181. package/swift/Tests/DeckKitTests/DeckKitTests.swift +0 -286
@@ -1,190 +0,0 @@
1
- import Foundation
2
-
3
- struct SearchIntent: LatticeIntent {
4
- static let name = "search"
5
- static let title = "Find windows by name, title, or content"
6
-
7
- static let phrases = [
8
- // Primary operator: find
9
- "find {query}",
10
- "find all {query}",
11
- "find all the {query}",
12
- // search
13
- "search {query}",
14
- "search for {query}",
15
- "search for all {query}",
16
- // look for
17
- "look for {query}",
18
- "look up {query}",
19
- // where
20
- "where is {query}",
21
- "where's {query}",
22
- "where does it say {query}",
23
- "where did i see {query}",
24
- // which / can you
25
- "which window has {query}",
26
- "which window shows {query}",
27
- "can you find {query}",
28
- "help me find {query}",
29
- // locate
30
- "locate {query}",
31
- "locate all {query}",
32
- // "open up all the X windows" = find, not launch
33
- "open up all the {query} windows",
34
- "open up all {query} windows",
35
- "open all the {query} windows",
36
- "open all {query} windows",
37
- "show me all the {query} windows",
38
- "show me all {query} windows",
39
- "show all the {query} windows",
40
- "show all {query} windows",
41
- // "pull up" = find/focus
42
- "pull up {query}",
43
- "pull up all {query}",
44
- "pull up everything with {query} in it",
45
- "bring up all the {query}",
46
- "bring up all {query}",
47
- // show me (without "windows" suffix)
48
- "show me all the {query}",
49
- "show me all {query}",
50
- "show me the {query}",
51
- "show me {query}",
52
- "show all the {query}",
53
- "show all {query}",
54
- // get
55
- "get {query}",
56
- "get all {query}",
57
- "get all the {query}",
58
- "get me {query}",
59
- "get me all the {query}",
60
- // give me
61
- "give me all the {query}",
62
- "give me all {query}",
63
- "give me {query}",
64
- // list
65
- "list {query}",
66
- "list all {query}",
67
- "list all the {query}",
68
- // Casual / natural
69
- "where'd my {query} go",
70
- "where'd {query} go",
71
- "i lost my {query}",
72
- "i lost {query}",
73
- "where the hell is {query}",
74
- "get {query} on screen",
75
- "{query} windows",
76
- ]
77
-
78
- static let slots = [
79
- SlotDef(name: "query", type: .string, required: true),
80
- ]
81
-
82
- /// Expand natural-language terms into search-friendly queries.
83
- /// e.g. "terminals" → ["terminals", "iterm", "terminal", "warp", "kitty", "alacritty"]
84
- private static let synonyms: [String: [String]] = [
85
- "terminals": ["iterm", "terminal", "warp", "kitty", "alacritty", "hyper"],
86
- "terminal": ["iterm", "terminal", "warp", "kitty", "alacritty", "hyper"],
87
- "browsers": ["safari", "chrome", "firefox", "arc", "brave", "edge"],
88
- "browser": ["safari", "chrome", "firefox", "arc", "brave", "edge"],
89
- "editors": ["code", "cursor", "xcode", "vim", "neovim", "zed", "sublime"],
90
- "editor": ["code", "cursor", "xcode", "vim", "neovim", "zed", "sublime"],
91
- "chat": ["slack", "discord", "messages", "telegram", "whatsapp"],
92
- "music": ["spotify", "music", "apple music"],
93
- "mail": ["mail", "gmail", "outlook", "spark"],
94
- "notes": ["notes", "obsidian", "notion", "bear"],
95
- ]
96
-
97
- /// Clean up a voice query: strip filler phrases, qualifiers, and noise.
98
- private static func cleanQuery(_ raw: String) -> String {
99
- var q = raw.lowercased().trimmingCharacters(in: .whitespaces)
100
-
101
- // Strip trailing qualifiers ("and sort by ...", "sorted by ...", "ordered by ...")
102
- for pattern in [" and sort", " and order", " sorted by", " ordered by",
103
- " and filter", " and group", " and show", " and list",
104
- " please", " for me"] {
105
- if let range = q.range(of: pattern) {
106
- q = String(q[q.startIndex..<range.lowerBound])
107
- }
108
- }
109
-
110
- // Strip trailing "windows"/"apps"
111
- for suffix in [" windows", " apps", " applications"] {
112
- if q.hasSuffix(suffix) {
113
- q = String(q.dropLast(suffix.count))
114
- break
115
- }
116
- }
117
-
118
- return q.trimmingCharacters(in: .whitespaces)
119
- }
120
-
121
- func perform(slots: [String: JSON]) throws -> JSON {
122
- guard let rawQuery = slots["query"]?.stringValue, !rawQuery.isEmpty else {
123
- throw IntentError.missingSlot("query")
124
- }
125
-
126
- let queryLower = Self.cleanQuery(rawQuery)
127
- guard !queryLower.isEmpty else {
128
- throw IntentError.missingSlot("query")
129
- }
130
-
131
- if queryLower != rawQuery.lowercased().trimmingCharacters(in: .whitespaces) {
132
- DiagnosticLog.shared.info("search: cleaned '\(rawQuery)' → '\(queryLower)'")
133
- }
134
-
135
- // Check for synonym expansion (e.g. "terminals" → ["iterm", "terminal", ...])
136
- if let expansions = Self.synonyms[queryLower] {
137
- DiagnosticLog.shared.info("search: query='\(rawQuery)' → expanding to \(expansions)")
138
- return try searchExpanded(queries: expansions)
139
- }
140
-
141
- DiagnosticLog.shared.info("search: query='\(queryLower)'")
142
- return try searchSingle(query: queryLower)
143
- }
144
-
145
- private func searchSingle(query: String) throws -> JSON {
146
- // Quick first — title, app, session, OCR (instant)
147
- let quick = try LatticesApi.shared.dispatch(
148
- method: "lattices.search",
149
- params: .object(["query": .string(query), "mode": .string("quick")])
150
- )
151
- if case .array(let items) = quick, !items.isEmpty {
152
- DiagnosticLog.shared.info("search: \(items.count) results for '\(query)' (quick)")
153
- return quick
154
- }
155
-
156
- // Escalate to complete — adds terminal cwd/processes + OCR
157
- let result = try LatticesApi.shared.dispatch(
158
- method: "lattices.search",
159
- params: .object(["query": .string(query)])
160
- )
161
- if case .array(let items) = result {
162
- DiagnosticLog.shared.info("search: \(items.count) results for '\(query)' (complete)")
163
- }
164
- return result
165
- }
166
-
167
- /// Search for multiple expanded queries and deduplicate by window ID.
168
- private func searchExpanded(queries: [String]) throws -> JSON {
169
- var seenWids: Set<Int> = []
170
- var merged: [JSON] = []
171
-
172
- for q in queries {
173
- let result = try LatticesApi.shared.dispatch(
174
- method: "lattices.search",
175
- params: .object(["query": .string(q), "mode": .string("quick")])
176
- )
177
- if case .array(let items) = result {
178
- for item in items {
179
- if let wid = item["wid"]?.intValue, !seenWids.contains(wid) {
180
- seenWids.insert(wid)
181
- merged.append(item)
182
- }
183
- }
184
- }
185
- }
186
-
187
- DiagnosticLog.shared.info("search: \(merged.count) results from expanded search")
188
- return .array(merged)
189
- }
190
- }
@@ -1,50 +0,0 @@
1
- import Foundation
2
-
3
- struct SwitchLayerIntent: LatticeIntent {
4
- static let name = "switch_layer"
5
- static let title = "Switch to a workspace layer"
6
-
7
- static let phrases = [
8
- // Primary: layer
9
- "layer {layer}",
10
- // switch to
11
- "switch to layer {layer}",
12
- "switch to the {layer} layer",
13
- "switch to {layer}",
14
- // go to
15
- "go to layer {layer}",
16
- "go to the {layer} layer",
17
- "go to {layer} layer",
18
- // activate / change
19
- "activate layer {layer}",
20
- "activate the {layer} layer",
21
- "change to layer {layer}",
22
- "change layer to {layer}",
23
- // numbered
24
- "layer one",
25
- "layer two",
26
- "layer three",
27
- "layer 1",
28
- "layer 2",
29
- "layer 3",
30
- "first layer",
31
- "second layer",
32
- "third layer",
33
- "next layer",
34
- "previous layer",
35
- ]
36
-
37
- static let slots = [
38
- SlotDef(name: "layer", type: .layer, required: true),
39
- ]
40
-
41
- func perform(slots: [String: JSON]) throws -> JSON {
42
- guard let layer = slots["layer"]?.stringValue else {
43
- throw IntentError.missingSlot("layer")
44
- }
45
- return try LatticesApi.shared.dispatch(
46
- method: "layer.switch",
47
- params: .object(["name": .string(layer)])
48
- )
49
- }
50
- }
@@ -1,61 +0,0 @@
1
- import Foundation
2
-
3
- struct TileIntent: LatticeIntent {
4
- static let name = "tile_window"
5
- static let title = "Tile a window to a screen position"
6
-
7
- static let phrases = [
8
- // Primary operator: tile
9
- "tile {position}",
10
- "tile it {position}",
11
- "tile this {position}",
12
- "tile the window {position}",
13
- // snap
14
- "snap {position}",
15
- "snap it {position}",
16
- "snap to the {position}",
17
- "snap to {position}",
18
- // move / put
19
- "move to the {position}",
20
- "move it to the {position}",
21
- "move it {position}",
22
- "move this to the {position}",
23
- "move this over to the {position}",
24
- "put it on the {position}",
25
- "put this on the {position}",
26
- "put it on the {position} side",
27
- "put this on the {position} side",
28
- "put it {position}",
29
- "throw it {position}",
30
- "throw it to the {position}",
31
- "just put it on the {position}",
32
- // Standalone position phrases
33
- "{position} half",
34
- "{position} side",
35
- // maximize variants (no slot needed — position is the whole phrase)
36
- "maximize",
37
- "maximize it",
38
- "make it full screen",
39
- "full screen",
40
- "go full screen",
41
- "make it big",
42
- "center it",
43
- "center the window",
44
- ]
45
-
46
- static let slots = [
47
- SlotDef(name: "position", type: .position, required: true, defaultValue: .string("center")),
48
- ]
49
-
50
- func perform(slots: [String: JSON]) throws -> JSON {
51
- let posName = slots["position"]?.stringValue ?? "center"
52
- guard let placement = PlacementSpec(string: posName) else {
53
- return .object(["ok": .bool(false), "reason": .string("Unknown position '\(posName)'")])
54
- }
55
-
56
- DispatchQueue.main.async {
57
- WindowTiler.tileFrontmostViaAX(to: placement)
58
- }
59
- return .object(["ok": .bool(true), "position": .string(posName)])
60
- }
61
- }