@lattices/cli 0.4.13 → 0.5.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 (180) hide show
  1. package/README.md +5 -7
  2. package/apps/mac/Info.plist +2 -2
  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 +191 -63
  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/reference/dewey.config.ts +2 -2
  19. package/docs/release.md +171 -0
  20. package/docs/repo-structure.md +4 -5
  21. package/docs/voice.md +11 -27
  22. package/package.json +9 -10
  23. package/apps/mac/Package.swift +0 -27
  24. package/apps/mac/Sources/AppShell/App.swift +0 -26
  25. package/apps/mac/Sources/AppShell/AppActivationCoordinator.swift +0 -27
  26. package/apps/mac/Sources/AppShell/AppDelegate.swift +0 -189
  27. package/apps/mac/Sources/AppShell/AppServicesBootstrap.swift +0 -25
  28. package/apps/mac/Sources/AppShell/AppShellView.swift +0 -171
  29. package/apps/mac/Sources/AppShell/AppUpdater.swift +0 -305
  30. package/apps/mac/Sources/AppShell/CliActionLauncher.swift +0 -50
  31. package/apps/mac/Sources/AppShell/HomeDashboardView.swift +0 -133
  32. package/apps/mac/Sources/AppShell/HotkeyBootstrap.swift +0 -87
  33. package/apps/mac/Sources/AppShell/KeyRecorderView.swift +0 -210
  34. package/apps/mac/Sources/AppShell/LatticesRuntime.swift +0 -104
  35. package/apps/mac/Sources/AppShell/MainView.swift +0 -847
  36. package/apps/mac/Sources/AppShell/MainWindow.swift +0 -83
  37. package/apps/mac/Sources/AppShell/MenuBarController.swift +0 -177
  38. package/apps/mac/Sources/AppShell/OnboardingView.swift +0 -483
  39. package/apps/mac/Sources/AppShell/PermissionsAssistantView.swift +0 -366
  40. package/apps/mac/Sources/AppShell/PermissionsAssistantWindow.swift +0 -70
  41. package/apps/mac/Sources/AppShell/Preferences.swift +0 -297
  42. package/apps/mac/Sources/AppShell/SettingsView.swift +0 -3163
  43. package/apps/mac/Sources/AppShell/SettingsWindow.swift +0 -34
  44. package/apps/mac/Sources/AppShell/WorkspaceInspectorPresenter.swift +0 -13
  45. package/apps/mac/Sources/Core/Actions/HotkeyManager.swift +0 -256
  46. package/apps/mac/Sources/Core/Actions/HotkeyStore.swift +0 -399
  47. package/apps/mac/Sources/Core/Actions/IntentEngine.swift +0 -988
  48. package/apps/mac/Sources/Core/Actions/IntentSchema.swift +0 -94
  49. package/apps/mac/Sources/Core/Actions/Intents/CreateLayerIntent.swift +0 -54
  50. package/apps/mac/Sources/Core/Actions/Intents/DistributeIntent.swift +0 -56
  51. package/apps/mac/Sources/Core/Actions/Intents/FocusIntent.swift +0 -69
  52. package/apps/mac/Sources/Core/Actions/Intents/HelpIntent.swift +0 -41
  53. package/apps/mac/Sources/Core/Actions/Intents/KillIntent.swift +0 -47
  54. package/apps/mac/Sources/Core/Actions/Intents/LatticeIntent.swift +0 -53
  55. package/apps/mac/Sources/Core/Actions/Intents/LaunchIntent.swift +0 -67
  56. package/apps/mac/Sources/Core/Actions/Intents/ListSessionsIntent.swift +0 -32
  57. package/apps/mac/Sources/Core/Actions/Intents/ListWindowsIntent.swift +0 -30
  58. package/apps/mac/Sources/Core/Actions/Intents/ScanIntent.swift +0 -52
  59. package/apps/mac/Sources/Core/Actions/Intents/SearchIntent.swift +0 -190
  60. package/apps/mac/Sources/Core/Actions/Intents/SwitchLayerIntent.swift +0 -50
  61. package/apps/mac/Sources/Core/Actions/Intents/TileIntent.swift +0 -61
  62. package/apps/mac/Sources/Core/Actions/PaletteCommand.swift +0 -439
  63. package/apps/mac/Sources/Core/Actions/VoiceIntentResolver.swift +0 -713
  64. package/apps/mac/Sources/Core/Companion/CompanionActivityLog.swift +0 -70
  65. package/apps/mac/Sources/Core/Companion/CompanionKeyboardController.swift +0 -141
  66. package/apps/mac/Sources/Core/Companion/LatticesCompanionBridgeServer.swift +0 -454
  67. package/apps/mac/Sources/Core/Companion/LatticesCompanionCockpit.swift +0 -555
  68. package/apps/mac/Sources/Core/Companion/LatticesCompanionSecurityCoordinator.swift +0 -629
  69. package/apps/mac/Sources/Core/Companion/LatticesCompanionTrackpadController.swift +0 -204
  70. package/apps/mac/Sources/Core/Companion/LatticesDeckHost.swift +0 -1463
  71. package/apps/mac/Sources/Core/Daemon/DaemonProtocol.swift +0 -114
  72. package/apps/mac/Sources/Core/Daemon/DaemonServer.swift +0 -427
  73. package/apps/mac/Sources/Core/Daemon/LatticesApi.swift +0 -2965
  74. package/apps/mac/Sources/Core/Desktop/AccessibilityTextExtractor.swift +0 -111
  75. package/apps/mac/Sources/Core/Desktop/AppTypeClassifier.swift +0 -106
  76. package/apps/mac/Sources/Core/Desktop/DesktopModel.swift +0 -331
  77. package/apps/mac/Sources/Core/Desktop/DesktopModelTypes.swift +0 -73
  78. package/apps/mac/Sources/Core/Desktop/InventoryManager.swift +0 -35
  79. package/apps/mac/Sources/Core/Desktop/InventoryPath.swift +0 -43
  80. package/apps/mac/Sources/Core/Desktop/MouseFinder.swift +0 -527
  81. package/apps/mac/Sources/Core/Desktop/OcrModel.swift +0 -467
  82. package/apps/mac/Sources/Core/Desktop/OcrStore.swift +0 -329
  83. package/apps/mac/Sources/Core/Desktop/PlacementSpec.swift +0 -195
  84. package/apps/mac/Sources/Core/Desktop/SessionWindowLocator.swift +0 -139
  85. package/apps/mac/Sources/Core/Desktop/TilePickerView.swift +0 -209
  86. package/apps/mac/Sources/Core/Desktop/WindowCapture.swift +0 -33
  87. package/apps/mac/Sources/Core/Desktop/WindowDragSnapController.swift +0 -429
  88. package/apps/mac/Sources/Core/Desktop/WindowPreviewCard.swift +0 -100
  89. package/apps/mac/Sources/Core/Desktop/WindowPreviewStore.swift +0 -112
  90. package/apps/mac/Sources/Core/Desktop/WindowSelectionStore.swift +0 -76
  91. package/apps/mac/Sources/Core/Desktop/WindowTiler.swift +0 -2222
  92. package/apps/mac/Sources/Core/Input/EventTapBreaker.swift +0 -124
  93. package/apps/mac/Sources/Core/Input/EventTapThread.swift +0 -54
  94. package/apps/mac/Sources/Core/Input/InputCaptureResetCenter.swift +0 -20
  95. package/apps/mac/Sources/Core/Input/KeyboardRemapConfig.swift +0 -69
  96. package/apps/mac/Sources/Core/Input/KeyboardRemapController.swift +0 -346
  97. package/apps/mac/Sources/Core/Input/KeyboardRemapStore.swift +0 -141
  98. package/apps/mac/Sources/Core/Input/MouseGestureConfig.swift +0 -499
  99. package/apps/mac/Sources/Core/Input/MouseGestureController.swift +0 -2271
  100. package/apps/mac/Sources/Core/Input/MouseInputDeviceStore.swift +0 -98
  101. package/apps/mac/Sources/Core/Input/MouseInputEventViewer.swift +0 -272
  102. package/apps/mac/Sources/Core/Input/MouseShortcutStore.swift +0 -170
  103. package/apps/mac/Sources/Core/Input/SecureEventInputMonitor.swift +0 -39
  104. package/apps/mac/Sources/Core/Input/ShapeRecognizer.swift +0 -624
  105. package/apps/mac/Sources/Core/Input/TapBudgetMeter.swift +0 -56
  106. package/apps/mac/Sources/Core/Overlays/AppWindowShell.swift +0 -63
  107. package/apps/mac/Sources/Core/Overlays/CommandMode/CommandModeState.swift +0 -1566
  108. package/apps/mac/Sources/Core/Overlays/CommandMode/CommandModeView.swift +0 -1927
  109. package/apps/mac/Sources/Core/Overlays/CommandMode/CommandModeWindow.swift +0 -196
  110. package/apps/mac/Sources/Core/Overlays/CommandPalette/CommandPaletteView.swift +0 -307
  111. package/apps/mac/Sources/Core/Overlays/CommandPalette/CommandPaletteWindow.swift +0 -67
  112. package/apps/mac/Sources/Core/Overlays/HUD/CheatSheetHUD.swift +0 -576
  113. package/apps/mac/Sources/Core/Overlays/HUD/HUDBottomBar.swift +0 -279
  114. package/apps/mac/Sources/Core/Overlays/HUD/HUDController.swift +0 -1158
  115. package/apps/mac/Sources/Core/Overlays/HUD/HUDLeftBar.swift +0 -849
  116. package/apps/mac/Sources/Core/Overlays/HUD/HUDMinimap.swift +0 -179
  117. package/apps/mac/Sources/Core/Overlays/HUD/HUDRightBar.swift +0 -596
  118. package/apps/mac/Sources/Core/Overlays/HUD/HUDState.swift +0 -367
  119. package/apps/mac/Sources/Core/Overlays/HUD/HUDTopBar.swift +0 -243
  120. package/apps/mac/Sources/Core/Overlays/HUD/LauncherHUD.swift +0 -334
  121. package/apps/mac/Sources/Core/Overlays/HUD/LayerBezel.swift +0 -203
  122. package/apps/mac/Sources/Core/Overlays/OmniSearch/OmniSearchState.swift +0 -280
  123. package/apps/mac/Sources/Core/Overlays/OmniSearch/OmniSearchView.swift +0 -422
  124. package/apps/mac/Sources/Core/Overlays/OmniSearch/OmniSearchWindow.swift +0 -94
  125. package/apps/mac/Sources/Core/Overlays/OverlayPanelShell.swift +0 -241
  126. package/apps/mac/Sources/Core/Overlays/ScreenMap/ScreenMapState.swift +0 -3135
  127. package/apps/mac/Sources/Core/Overlays/ScreenMap/ScreenMapView.swift +0 -3977
  128. package/apps/mac/Sources/Core/Overlays/ScreenMap/ScreenMapWindowController.swift +0 -119
  129. package/apps/mac/Sources/Core/Overlays/ScreenOverlayCanvasController.swift +0 -1217
  130. package/apps/mac/Sources/Core/Overlays/Voice/VoiceCommandWindow.swift +0 -1575
  131. package/apps/mac/Sources/Core/Pi/PiAuthNextStepCard.swift +0 -148
  132. package/apps/mac/Sources/Core/Pi/PiAuthPromptCard.swift +0 -90
  133. package/apps/mac/Sources/Core/Pi/PiChatDock.swift +0 -564
  134. package/apps/mac/Sources/Core/Pi/PiChatSession.swift +0 -1948
  135. package/apps/mac/Sources/Core/Pi/PiInstallCallout.swift +0 -86
  136. package/apps/mac/Sources/Core/Pi/PiProviderSetupCallout.swift +0 -99
  137. package/apps/mac/Sources/Core/Pi/PiWorkspaceView.swift +0 -510
  138. package/apps/mac/Sources/Core/System/Capability.swift +0 -79
  139. package/apps/mac/Sources/Core/System/DiagnosticLog.swift +0 -373
  140. package/apps/mac/Sources/Core/System/EventBus.swift +0 -31
  141. package/apps/mac/Sources/Core/System/PermissionChecker.swift +0 -224
  142. package/apps/mac/Sources/Core/System/ProcessModel.swift +0 -199
  143. package/apps/mac/Sources/Core/System/ProcessQuery.swift +0 -151
  144. package/apps/mac/Sources/Core/System/SystemTelemetryMonitor.swift +0 -273
  145. package/apps/mac/Sources/Core/Voice/AdvisorLearningStore.swift +0 -90
  146. package/apps/mac/Sources/Core/Voice/AgentSession.swift +0 -377
  147. package/apps/mac/Sources/Core/Voice/AudioProvider.swift +0 -555
  148. package/apps/mac/Sources/Core/Voice/HandsOffSession.swift +0 -839
  149. package/apps/mac/Sources/Core/Voice/VoiceChatView.swift +0 -192
  150. package/apps/mac/Sources/Core/Voice/VoxClient.swift +0 -454
  151. package/apps/mac/Sources/Core/Workspace/Project.swift +0 -28
  152. package/apps/mac/Sources/Core/Workspace/ProjectScanner.swift +0 -141
  153. package/apps/mac/Sources/Core/Workspace/SessionLayerStore.swift +0 -285
  154. package/apps/mac/Sources/Core/Workspace/SessionManager.swift +0 -75
  155. package/apps/mac/Sources/Core/Workspace/Terminal/Terminal.swift +0 -259
  156. package/apps/mac/Sources/Core/Workspace/Terminal/TerminalQuery.swift +0 -156
  157. package/apps/mac/Sources/Core/Workspace/Terminal/TerminalSynthesizer.swift +0 -200
  158. package/apps/mac/Sources/Core/Workspace/Tmux/TmuxModel.swift +0 -60
  159. package/apps/mac/Sources/Core/Workspace/Tmux/TmuxQuery.swift +0 -105
  160. package/apps/mac/Sources/Core/Workspace/WorkspaceManager.swift +0 -1027
  161. package/apps/mac/Sources/UI/ActionRow.swift +0 -78
  162. package/apps/mac/Sources/UI/OrphanRow.swift +0 -129
  163. package/apps/mac/Sources/UI/ProjectRow.swift +0 -368
  164. package/apps/mac/Sources/UI/TabGroupRow.swift +0 -178
  165. package/apps/mac/Sources/UI/Theme.swift +0 -164
  166. package/apps/mac/Tests/StageDragTests.swift +0 -333
  167. package/apps/mac/Tests/StageJoinTests.swift +0 -313
  168. package/apps/mac/Tests/StageManagerTests.swift +0 -280
  169. package/apps/mac/Tests/StageTileTests.swift +0 -353
  170. package/swift/Package.swift +0 -20
  171. package/swift/Sources/DeckKit/DeckAction.swift +0 -51
  172. package/swift/Sources/DeckKit/DeckBridgeSecurity.swift +0 -152
  173. package/swift/Sources/DeckKit/DeckCockpit.swift +0 -82
  174. package/swift/Sources/DeckKit/DeckHost.swift +0 -7
  175. package/swift/Sources/DeckKit/DeckManifest.swift +0 -145
  176. package/swift/Sources/DeckKit/DeckRuntimeSnapshot.swift +0 -533
  177. package/swift/Sources/DeckKit/DeckTrackpad.swift +0 -63
  178. package/swift/Sources/DeckKit/DeckValue.swift +0 -93
  179. package/swift/Sources/DeckKit/DeckVoiceError.swift +0 -88
  180. package/swift/Tests/DeckKitTests/DeckKitTests.swift +0 -286
@@ -1,94 +0,0 @@
1
- import Foundation
2
-
3
- struct IntentDef {
4
- let name: String
5
- let description: String
6
- let examples: [String]
7
- let slots: [IntentSlot]
8
- let handler: (IntentRequest) throws -> JSON
9
- }
10
-
11
- struct IntentSlot {
12
- let name: String
13
- let type: String
14
- let required: Bool
15
- let description: String
16
- let enumValues: [String]?
17
- let defaultValue: JSON?
18
-
19
- init(
20
- name: String,
21
- type: String,
22
- required: Bool,
23
- description: String,
24
- enumValues: [String]? = nil,
25
- defaultValue: JSON? = nil
26
- ) {
27
- self.name = name
28
- self.type = type
29
- self.required = required
30
- self.description = description
31
- self.enumValues = enumValues
32
- self.defaultValue = defaultValue
33
- }
34
- }
35
-
36
- struct IntentRequest {
37
- let intent: String
38
- let slots: [String: JSON]
39
- let rawText: String?
40
- let confidence: Double?
41
- let source: String?
42
- }
43
-
44
- enum SlotType {
45
- case string
46
- case int
47
- case bool
48
- case position
49
- case query
50
- case app
51
- case session
52
- case layer
53
- case enumerated([String])
54
-
55
- var typeLabel: String {
56
- switch self {
57
- case .string: return "string"
58
- case .int: return "int"
59
- case .bool: return "bool"
60
- case .position: return "position"
61
- case .query: return "query"
62
- case .app: return "app"
63
- case .session: return "session"
64
- case .layer: return "layer"
65
- case .enumerated: return "string"
66
- }
67
- }
68
-
69
- var enumValues: [String]? {
70
- guard case .enumerated(let values) = self else { return nil }
71
- return values
72
- }
73
- }
74
-
75
- typealias SlotDef = IntentSlot
76
-
77
- extension IntentSlot {
78
- init(
79
- name: String,
80
- type: SlotType,
81
- required: Bool = true,
82
- description: String = "",
83
- defaultValue: JSON? = nil
84
- ) {
85
- self.init(
86
- name: name,
87
- type: type.typeLabel,
88
- required: required,
89
- description: description,
90
- enumValues: type.enumValues,
91
- defaultValue: defaultValue
92
- )
93
- }
94
- }
@@ -1,54 +0,0 @@
1
- import Foundation
2
-
3
- struct CreateLayerIntent: LatticeIntent {
4
- static let name = "create_layer"
5
- static let title = "Save the current layout as a named layer"
6
-
7
- static let phrases = [
8
- // create
9
- "create a layer called {name}",
10
- "create layer called {name}",
11
- "create a layer {name}",
12
- "create layer {name}",
13
- "create new layer {name}",
14
- // make
15
- "make a layer called {name}",
16
- "make layer called {name}",
17
- "make a layer {name}",
18
- "make layer {name}",
19
- "make a new layer {name}",
20
- // save
21
- "save this layout as {name}",
22
- "save layout as {name}",
23
- "save as layer {name}",
24
- "save as {name}",
25
- // name / snapshot
26
- "name this layer {name}",
27
- "new layer called {name}",
28
- "new layer {name}",
29
- // No-arg variants
30
- "create a layer",
31
- "create layer",
32
- "save this layout",
33
- "save layout",
34
- "snapshot",
35
- "snapshot this",
36
- "remember this layout",
37
- "save this workspace",
38
- ]
39
-
40
- static let slots = [
41
- SlotDef(name: "name", type: .string, required: false),
42
- ]
43
-
44
- func perform(slots: [String: JSON]) throws -> JSON {
45
- var params: [String: JSON] = [:]
46
- if let name = slots["name"]?.stringValue {
47
- params["name"] = .string(name)
48
- }
49
- return try LatticesApi.shared.dispatch(
50
- method: "layer.create",
51
- params: .object(params)
52
- )
53
- }
54
- }
@@ -1,56 +0,0 @@
1
- import Foundation
2
-
3
- struct DistributeIntent: LatticeIntent {
4
- static let name = "distribute"
5
- static let title = "Distribute windows evenly across the screen"
6
-
7
- static let phrases = [
8
- // Primary: spread / distribute
9
- "distribute",
10
- "distribute windows",
11
- "distribute everything",
12
- "spread",
13
- "spread out",
14
- "spread out the windows",
15
- "spread them out",
16
- // organize / arrange
17
- "organize",
18
- "organize windows",
19
- "organize my windows",
20
- "organize everything",
21
- "arrange",
22
- "arrange windows",
23
- "arrange my windows",
24
- "arrange everything",
25
- "arrange them evenly",
26
- // tidy / clean
27
- "tidy",
28
- "tidy up",
29
- "tidy up the desktop",
30
- "tidy up my windows",
31
- "clean up",
32
- "clean up the layout",
33
- "clean up my desktop",
34
- // other
35
- "even out",
36
- "even out the windows",
37
- "fix the layout",
38
- "reset the layout",
39
- "make a grid",
40
- "grid layout",
41
- "line them up",
42
- "line everything up",
43
- "get everything organized",
44
- "clean up the windows",
45
- "clean up windows",
46
- ]
47
-
48
- static let slots: [SlotDef] = []
49
-
50
- func perform(slots: [String: JSON]) throws -> JSON {
51
- DispatchQueue.main.async {
52
- WindowTiler.distributeVisible()
53
- }
54
- return .object(["ok": .bool(true)])
55
- }
56
- }
@@ -1,69 +0,0 @@
1
- import Foundation
2
-
3
- struct FocusIntent: LatticeIntent {
4
- static let name = "focus"
5
- static let title = "Focus and raise a window"
6
-
7
- static let phrases = [
8
- // Primary operator: show
9
- "show {app}",
10
- "show me {app}",
11
- "show me the {app}",
12
- // focus
13
- "focus {app}",
14
- "focus on {app}",
15
- "focus the {app}",
16
- // switch / go
17
- "switch to {app}",
18
- "switch over to {app}",
19
- "go to {app}",
20
- "go back to {app}",
21
- // bring / raise / pull
22
- "bring up {app}",
23
- "bring up the {app}",
24
- "bring forward {app}",
25
- "raise {app}",
26
- "raise the {app}",
27
- "pull up {app}",
28
- "pull up the {app}",
29
- // natural
30
- "i want to see {app}",
31
- "let me see {app}",
32
- "take me to {app}",
33
- "give me {app}",
34
- "give me the {app}",
35
- // activate / jump
36
- "activate {app}",
37
- "activate the {app}",
38
- "jump to {app}",
39
- ]
40
-
41
- static let slots = [
42
- SlotDef(name: "app", type: .app, required: true),
43
- ]
44
-
45
- func perform(slots: [String: JSON]) throws -> JSON {
46
- guard let app = slots["app"]?.stringValue else {
47
- throw IntentError.missingSlot("app")
48
- }
49
-
50
- // Use unified search — single source of truth
51
- let result = try LatticesApi.shared.dispatch(
52
- method: "lattices.search",
53
- params: .object([
54
- "query": .string(app),
55
- "sources": .array([.string("titles"), .string("apps"), .string("sessions"), .string("cwd"), .string("tmux")]),
56
- ])
57
- )
58
- if case .array(let items) = result, let first = items.first,
59
- let wid = first["wid"]?.uint32Value {
60
- let pid = first["pid"]?.intValue ?? Int(DesktopModel.shared.windows[wid]?.pid ?? 0)
61
- DispatchQueue.main.async {
62
- WindowTiler.focusWindow(wid: wid, pid: Int32(pid))
63
- }
64
- return .object(["ok": .bool(true), "focused": .string(app), "wid": .int(Int(wid))])
65
- }
66
-
67
- return .object(["ok": .bool(false), "reason": .string("No window found for '\(app)'")])
68
- }
69
- }
@@ -1,41 +0,0 @@
1
- import Foundation
2
-
3
- struct HelpIntent: LatticeIntent {
4
- static let name = "help"
5
- static let title = "Show available commands and usage"
6
-
7
- static let phrases = [
8
- "help",
9
- "help me",
10
- "what can i do",
11
- "what can you do",
12
- "what commands are there",
13
- "what are the commands",
14
- "how does this work",
15
- "how do i use this",
16
- "show me the commands",
17
- "what can i say",
18
- "what are my options",
19
- ]
20
-
21
- static let slots: [SlotDef] = []
22
-
23
- func perform(slots: [String: JSON]) throws -> JSON {
24
- let commands = [
25
- "find <query> — search windows by name, title, or content",
26
- "show <app> — focus an app window",
27
- "open <project> — launch a project or app",
28
- "tile <position> — tile the current window (left, right, top-left, etc.)",
29
- "maximize — make the current window full screen",
30
- "distribute — arrange all visible windows in a grid",
31
- "scan — OCR all visible windows",
32
- "kill <session> — stop a tmux session",
33
- "list windows — show all open windows",
34
- "list sessions — show running tmux sessions",
35
- ]
36
- return .object([
37
- "commands": .array(commands.map { .string($0) }),
38
- "hint": .string("You can also say things naturally — 'where's my Slack?' or 'tidy up the windows'"),
39
- ])
40
- }
41
- }
@@ -1,47 +0,0 @@
1
- import Foundation
2
-
3
- struct KillIntent: LatticeIntent {
4
- static let name = "kill"
5
- static let title = "Stop a running session"
6
-
7
- static let phrases = [
8
- // Primary operator: kill
9
- "kill {session}",
10
- "kill the {session}",
11
- "kill the {session} session",
12
- "kill that",
13
- // stop
14
- "stop {session}",
15
- "stop the {session}",
16
- "stop the {session} session",
17
- // shut down
18
- "shut down {session}",
19
- "shut down the {session}",
20
- "shut it down",
21
- // close
22
- "close {session}",
23
- "close the {session}",
24
- "close the {session} session",
25
- // terminate
26
- "terminate {session}",
27
- "terminate the {session}",
28
- // end
29
- "end {session}",
30
- "end the {session}",
31
- "end the {session} session",
32
- ]
33
-
34
- static let slots = [
35
- SlotDef(name: "session", type: .session, required: true),
36
- ]
37
-
38
- func perform(slots: [String: JSON]) throws -> JSON {
39
- guard let session = slots["session"]?.stringValue else {
40
- throw IntentError.missingSlot("session")
41
- }
42
- return try LatticesApi.shared.dispatch(
43
- method: "session.kill",
44
- params: .object(["name": .string(session)])
45
- )
46
- }
47
- }
@@ -1,53 +0,0 @@
1
- import Foundation
2
-
3
- // MARK: - Core Protocol
4
-
5
- /// A self-contained voice intent. Each intent declares its phrases, slots, and execution.
6
- protocol LatticeIntent {
7
- static var name: String { get }
8
- static var title: String { get }
9
- static var phrases: [String] { get } // e.g. "find {query}", "search for {query}"
10
- static var slots: [SlotDef] { get }
11
-
12
- func perform(slots: [String: JSON]) throws -> JSON
13
- }
14
-
15
- // MARK: - Compiled Phrase Template
16
-
17
- struct CompiledPhrase {
18
- let original: String // "find {query}"
19
- let regex: NSRegularExpression // ^find (.+)$
20
- let slotNames: [String] // ["query"] in capture-group order
21
- let intentName: String
22
- }
23
-
24
- // MARK: - Match Result
25
-
26
- struct IntentMatch {
27
- let intentName: String
28
- let slots: [String: JSON]
29
- let confidence: Double
30
- let matchedPhrase: String
31
- }
32
-
33
- // MARK: - Phrase Matcher
34
-
35
- final class PhraseMatcher {
36
- static let shared = PhraseMatcher()
37
-
38
- private init() {
39
- DiagnosticLog.shared.info("PhraseMatcher: semantic resolver active (\(IntentEngine.shared.definitions().count) intents)")
40
- }
41
-
42
- func match(text: String) -> IntentMatch? {
43
- VoiceIntentResolver.shared.match(text: text)
44
- }
45
-
46
- func execute(_ match: IntentMatch) throws -> JSON {
47
- try VoiceIntentResolver.shared.execute(match)
48
- }
49
-
50
- func catalog() -> JSON {
51
- VoiceIntentResolver.shared.catalog()
52
- }
53
- }
@@ -1,67 +0,0 @@
1
- import AppKit
2
- import Foundation
3
-
4
- struct LaunchIntent: LatticeIntent {
5
- static let name = "launch"
6
- static let title = "Launch a project or app"
7
-
8
- static let phrases = [
9
- // Primary operator: open
10
- "open {project}",
11
- "open up {project}",
12
- "open my {project}",
13
- "open the {project}",
14
- // launch
15
- "launch {project}",
16
- "launch the {project}",
17
- "launch my {project}",
18
- // start
19
- "start {project}",
20
- "start up {project}",
21
- "start the {project}",
22
- "start my {project}",
23
- "start working on {project}",
24
- // work on
25
- "work on {project}",
26
- "work on the {project}",
27
- "begin {project}",
28
- "begin working on {project}",
29
- // fire / spin / boot
30
- "fire up {project}",
31
- "spin up {project}",
32
- "boot up {project}",
33
- // load / run
34
- "load {project}",
35
- "load up {project}",
36
- "run {project}",
37
- "run the {project}",
38
- ]
39
-
40
- static let slots = [
41
- SlotDef(name: "project", type: .string, required: true),
42
- ]
43
-
44
- func perform(slots: [String: JSON]) throws -> JSON {
45
- guard let project = slots["project"]?.stringValue else {
46
- throw IntentError.missingSlot("project")
47
- }
48
-
49
- // Try to find the project by scanning known project paths
50
- let scanner = ProjectScanner.shared
51
- if let found = scanner.projects.first(where: {
52
- $0.name.lowercased().contains(project.lowercased())
53
- }) {
54
- // Launch via session manager
55
- let result = try LatticesApi.shared.dispatch(
56
- method: "session.launch",
57
- params: .object(["path": .string(found.path)])
58
- )
59
- return result
60
- }
61
-
62
- // Fallback: try as an app name
63
- let app = project.prefix(1).uppercased() + project.dropFirst()
64
- NSWorkspace.shared.launchApplication(app)
65
- return .object(["ok": .bool(true), "launched": .string(app)])
66
- }
67
- }
@@ -1,32 +0,0 @@
1
- import Foundation
2
-
3
- struct ListSessionsIntent: LatticeIntent {
4
- static let name = "list_sessions"
5
- static let title = "List running tmux sessions"
6
-
7
- static let phrases = [
8
- "list sessions",
9
- "list all sessions",
10
- "list my sessions",
11
- "what sessions",
12
- "what sessions are running",
13
- "what's running",
14
- "whats running",
15
- "what is running",
16
- "which projects",
17
- "which projects are active",
18
- "show sessions",
19
- "show my sessions",
20
- "show my projects",
21
- "show me what's running",
22
- "show me whats running",
23
- "how many sessions",
24
- "any sessions running",
25
- ]
26
-
27
- static let slots: [SlotDef] = []
28
-
29
- func perform(slots: [String: JSON]) throws -> JSON {
30
- try LatticesApi.shared.dispatch(method: "sessions.list", params: nil)
31
- }
32
- }
@@ -1,30 +0,0 @@
1
- import Foundation
2
-
3
- struct ListWindowsIntent: LatticeIntent {
4
- static let name = "list_windows"
5
- static let title = "List all open windows"
6
-
7
- static let phrases = [
8
- "list windows",
9
- "list all windows",
10
- "list my windows",
11
- "what windows",
12
- "what windows are open",
13
- "what's open",
14
- "which windows",
15
- "which windows are visible",
16
- "show all windows",
17
- "show me all windows",
18
- "show me all the windows",
19
- "how many windows",
20
- "count windows",
21
- "what do i have open",
22
- "what's visible",
23
- ]
24
-
25
- static let slots: [SlotDef] = []
26
-
27
- func perform(slots: [String: JSON]) throws -> JSON {
28
- try LatticesApi.shared.dispatch(method: "windows.list", params: nil)
29
- }
30
- }
@@ -1,52 +0,0 @@
1
- import Foundation
2
-
3
- struct ScanIntent: LatticeIntent {
4
- static let name = "scan"
5
- static let title = "Rescan screen text (OCR)"
6
-
7
- static let phrases = [
8
- // Primary operator: scan
9
- "scan",
10
- "scan the screen",
11
- "scan everything",
12
- "scan all",
13
- "scan my screen",
14
- "scan my windows",
15
- "scan all windows",
16
- // rescan
17
- "rescan",
18
- "rescan the screen",
19
- "rescan everything",
20
- // read
21
- "read the screen",
22
- "read my screen",
23
- "read all windows",
24
- // ocr
25
- "ocr",
26
- "ocr scan",
27
- "run ocr",
28
- // update / refresh / capture
29
- "update screen text",
30
- "refresh screen text",
31
- "capture screen text",
32
- "capture text",
33
- // natural
34
- "what's on my screen",
35
- "what's on screen",
36
- "what is on my screen",
37
- "show me what's on the screen",
38
- "show me what is on the screen",
39
- "index the screen",
40
- "do a scan",
41
- "give me a scan",
42
- "give me a fresh scan",
43
- "quick scan",
44
- "a fresh scan",
45
- ]
46
-
47
- static let slots: [SlotDef] = []
48
-
49
- func perform(slots: [String: JSON]) throws -> JSON {
50
- try LatticesApi.shared.dispatch(method: "ocr.scan", params: nil)
51
- }
52
- }