@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,83 +0,0 @@
1
- import AppKit
2
- import SwiftUI
3
-
4
- /// Manages the main lattices window as a standalone NSWindow.
5
- /// Menu bar icon toggles this window open/closed.
6
- final class MainWindow {
7
- static let shared = MainWindow()
8
-
9
- private var window: NSWindow?
10
- private var keyMonitor: Any?
11
-
12
- var isVisible: Bool { window?.isVisible ?? false }
13
-
14
- func toggle() {
15
- if let w = window, w.isVisible {
16
- w.orderOut(nil)
17
- AppDelegate.updateActivationPolicy()
18
- } else {
19
- show()
20
- }
21
- }
22
-
23
- func show() {
24
- if let existing = window {
25
- existing.makeKeyAndOrderFront(nil)
26
- NSApp.activate(ignoringOtherApps: true)
27
- return
28
- }
29
-
30
- let view = MainView(scanner: ProjectScanner.shared)
31
- .preferredColorScheme(.dark)
32
-
33
- let hostingView = NSHostingView(rootView: view)
34
- hostingView.frame = NSRect(x: 0, y: 0, width: 380, height: 460)
35
-
36
- let w = NSWindow(
37
- contentRect: NSRect(x: 0, y: 0, width: 380, height: 460),
38
- styleMask: [.titled, .closable, .resizable, .miniaturizable],
39
- backing: .buffered,
40
- defer: false
41
- )
42
- w.contentView = hostingView
43
- w.title = "lattices"
44
- w.titlebarAppearsTransparent = true
45
- w.titleVisibility = .hidden
46
- w.isReleasedWhenClosed = false
47
- w.backgroundColor = NSColor(red: 0.11, green: 0.11, blue: 0.12, alpha: 1.0)
48
- w.appearance = NSAppearance(named: .darkAqua)
49
- w.minSize = NSSize(width: 340, height: 380)
50
- w.maxSize = NSSize(width: 600, height: 800)
51
-
52
- // Position near top-right of screen (close to menu bar area)
53
- if let screen = NSScreen.main {
54
- let visibleFrame = screen.visibleFrame
55
- let x = visibleFrame.maxX - 380 - 20
56
- let y = visibleFrame.maxY - 460 - 10
57
- w.setFrameOrigin(NSPoint(x: x, y: y))
58
- }
59
-
60
- w.makeKeyAndOrderFront(nil)
61
- NSApp.activate(ignoringOtherApps: true)
62
-
63
- window = w
64
- AppDelegate.updateActivationPolicy()
65
-
66
- // Escape key → close
67
- keyMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { [weak self] event in
68
- guard event.keyCode == 53,
69
- self?.window?.isKeyWindow == true else { return event }
70
- self?.close()
71
- return nil
72
- }
73
- }
74
-
75
- func close() {
76
- window?.orderOut(nil)
77
- if let monitor = keyMonitor {
78
- NSEvent.removeMonitor(monitor)
79
- keyMonitor = nil
80
- }
81
- AppDelegate.updateActivationPolicy()
82
- }
83
- }
@@ -1,177 +0,0 @@
1
- import AppKit
2
- import SwiftUI
3
-
4
- final class MenuBarController: NSObject, NSPopoverDelegate {
5
- static let shared = MenuBarController()
6
-
7
- private var statusItem: NSStatusItem?
8
- private var popover: NSPopover?
9
- private var contextMenu: NSMenu?
10
-
11
- var isPopoverShown: Bool {
12
- popover?.isShown == true
13
- }
14
-
15
- private override init() {
16
- super.init()
17
- }
18
-
19
- func start() {
20
- guard statusItem == nil else { return }
21
-
22
- statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength)
23
- if let button = statusItem?.button {
24
- button.image = Self.menuBarIcon
25
- button.action = #selector(statusItemClicked(_:))
26
- button.sendAction(on: [.leftMouseUp, .rightMouseUp])
27
- button.target = self
28
- }
29
-
30
- contextMenu = buildContextMenu()
31
- }
32
-
33
- func warmUpPopover() {
34
- let popover = makePopover()
35
- _ = popover.contentViewController?.view
36
- }
37
-
38
- func dismissPopover() {
39
- popover?.performClose(nil)
40
- }
41
-
42
- private func showProjectsPopover() {
43
- guard let button = statusItem?.button else { return }
44
- let popover = makePopover()
45
- popover.show(relativeTo: button.bounds, of: button, preferredEdge: .minY)
46
- popover.contentViewController?.view.window?.makeKey()
47
- }
48
-
49
- @objc private func statusItemClicked(_ sender: Any?) {
50
- guard let event = NSApp.currentEvent,
51
- let button = statusItem?.button else { return }
52
-
53
- if event.type == .rightMouseUp {
54
- contextMenu?.popUp(positioning: nil, at: NSPoint(x: 0, y: button.bounds.height + 4), in: button)
55
- } else if let shown = popover, shown.isShown {
56
- shown.performClose(sender)
57
- } else {
58
- showProjectsPopover()
59
- }
60
- }
61
-
62
- private func makePopover() -> NSPopover {
63
- if let popover { return popover }
64
- let timed = DiagnosticLog.shared.startTimed("makePopover")
65
- let popover = NSPopover()
66
- popover.contentViewController = NSHostingController(rootView: MainView(scanner: ProjectScanner.shared))
67
- popover.behavior = .transient
68
- popover.contentSize = NSSize(width: 380, height: 300)
69
- popover.appearance = NSAppearance(named: .darkAqua)
70
- popover.delegate = self
71
- self.popover = popover
72
- DiagnosticLog.shared.finish(timed)
73
- return popover
74
- }
75
-
76
- func popoverWillShow(_ notification: Notification) {
77
- AppActivationCoordinator.shared.refresh()
78
- NotificationCenter.default.post(name: .latticesPopoverWillShow, object: nil)
79
- }
80
-
81
- func popoverDidClose(_ notification: Notification) {
82
- AppActivationCoordinator.shared.refresh()
83
- }
84
-
85
- private func buildContextMenu() -> NSMenu {
86
- let menu = NSMenu()
87
-
88
- let actions: [(String, String, Selector)] = [
89
- ("Home", "", #selector(menuWorkspace)),
90
- ("Layout", "", #selector(menuLayout)),
91
- ("Search", "", #selector(menuSearch)),
92
- ("Command Palette", "⌘⇧M", #selector(menuCommandPalette)),
93
- ]
94
- for (title, shortcut, action) in actions {
95
- let item = NSMenuItem(title: title, action: action, keyEquivalent: "")
96
- item.target = self
97
- if !shortcut.isEmpty {
98
- // Display-only; the actual hotkey is global.
99
- }
100
- menu.addItem(item)
101
- }
102
-
103
- menu.addItem(.separator())
104
-
105
- let cliActions: [(String, Selector)] = [
106
- ("Projects…", #selector(menuProjects)),
107
- ("Initialize Project in Terminal…", #selector(menuInitializeProject)),
108
- ("Launch Project in Terminal…", #selector(menuLaunchProject)),
109
- ]
110
- for (title, action) in cliActions {
111
- let item = NSMenuItem(title: title, action: action, keyEquivalent: "")
112
- item.target = self
113
- menu.addItem(item)
114
- }
115
-
116
- menu.addItem(.separator())
117
-
118
- let update = NSMenuItem(title: "Update Lattices…", action: #selector(menuUpdate), keyEquivalent: "")
119
- update.target = self
120
- menu.addItem(update)
121
-
122
- menu.addItem(.separator())
123
-
124
- let settings = NSMenuItem(title: "Help & Settings…", action: #selector(menuSettings), keyEquivalent: ",")
125
- settings.target = self
126
- menu.addItem(settings)
127
-
128
- menu.addItem(.separator())
129
-
130
- let quit = NSMenuItem(title: "Quit Lattices", action: #selector(menuQuit), keyEquivalent: "q")
131
- quit.target = self
132
- menu.addItem(quit)
133
-
134
- return menu
135
- }
136
-
137
- @objc private func menuCommandPalette() { CommandPaletteWindow.shared.toggle() }
138
- @objc private func menuWorkspace() { ScreenMapWindowController.shared.showPage(.home) }
139
- @objc private func menuLayout() { ScreenMapWindowController.shared.showPage(.screenMap) }
140
- @objc private func menuSearch() { ScreenMapWindowController.shared.showPage(.desktopInventory) }
141
- @objc private func menuProjects() { DispatchQueue.main.async { self.showProjectsPopover() } }
142
- @objc private func menuInitializeProject() { CliActionLauncher.initializeProjectInTerminal() }
143
- @objc private func menuLaunchProject() { CliActionLauncher.launchProjectInTerminal() }
144
- @MainActor @objc private func menuUpdate() { AppUpdater.shared.promptForUpdate() }
145
- @objc private func menuSettings() { SettingsWindowController.shared.show() }
146
- @objc private func menuQuit() { NSApp.terminate(nil) }
147
-
148
- private static let menuBarIcon: NSImage = {
149
- let size: CGFloat = 18
150
- let image = NSImage(size: NSSize(width: size, height: size), flipped: true) { _ in
151
- let pad: CGFloat = 2
152
- let gap: CGFloat = 1.5
153
- let cellSize = (size - 2 * pad - 2 * gap) / 3
154
- let solidCells: Set<Int> = [0, 3, 6, 7, 8]
155
-
156
- for row in 0..<3 {
157
- for column in 0..<3 {
158
- let index = row * 3 + column
159
- let x = pad + CGFloat(column) * (cellSize + gap)
160
- let y = pad + CGFloat(row) * (cellSize + gap)
161
- let rect = NSRect(x: x, y: y, width: cellSize, height: cellSize)
162
-
163
- if solidCells.contains(index) {
164
- NSColor.black.setFill()
165
- } else {
166
- NSColor.black.withAlphaComponent(0.25).setFill()
167
- }
168
- let path = NSBezierPath(roundedRect: rect, xRadius: 0.8, yRadius: 0.8)
169
- path.fill()
170
- }
171
- }
172
- return true
173
- }
174
- image.isTemplate = true
175
- return image
176
- }()
177
- }