@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
@@ -0,0 +1,553 @@
1
+ # LAT-006: Mira Inside Lattices
2
+
3
+ ## Status
4
+
5
+ Proposed.
6
+
7
+ ## Summary
8
+
9
+ Mira should stop being a separate product the user has to remember.
10
+
11
+ The useful parts of Mira should become a named capability inside Lattices:
12
+
13
+ ```text
14
+ Lattices = workspace control plane
15
+ Mira = run, capture, review, and proof mode
16
+ ```
17
+
18
+ This is a stronger integration than keeping Mira as a nearby helper. The
19
+ desired user experience is one macOS app, one daemon surface, one permission
20
+ assistant, one command palette, and one place to find runs and artifacts.
21
+
22
+ Internally, Lattices can still keep specialized helper processes. The important
23
+ distinction is that helpers are implementation details. The product the user
24
+ grants permissions to, launches, trusts, and remembers should be Lattices.
25
+
26
+ ## Why This Belongs Here
27
+
28
+ Lattices and Mira are converging on the same operating model from opposite
29
+ directions:
30
+
31
+ - Lattices already knows about workspaces, projects, windows, Spaces, layers,
32
+ overlays, command surfaces, and local daemon control.
33
+ - Mira already knows about observing surfaces, resolving targets, running
34
+ deterministic actions, recording what happened, and saving reviewable
35
+ artifacts.
36
+
37
+ LAT-005 proposes the shared action loop:
38
+
39
+ ```text
40
+ input -> canonical action -> plan -> execute -> verify -> receipt -> history
41
+ ```
42
+
43
+ Mira supplies the missing proof loop:
44
+
45
+ ```text
46
+ run -> observe -> act -> capture -> trace -> artifact -> review
47
+ ```
48
+
49
+ Together, they make one product: a local macOS workspace runtime that can both
50
+ control the desktop and prove what happened.
51
+
52
+ ## Problem
53
+
54
+ Keeping Mira as a separate project creates exactly the kind of operational
55
+ friction Lattices is supposed to remove:
56
+
57
+ - another repo to remember
58
+ - another app name in the user's head
59
+ - another daemon port
60
+ - another CLI
61
+ - another permission story
62
+ - another place where recordings, traces, and review artifacts live
63
+ - another set of product concepts that overlap with Lattices actions,
64
+ overlays, diagnostics, and permissions
65
+
66
+ The permissions problem is especially important. Accessibility, Screen
67
+ Recording, Automation, and future capture-related capabilities are high-trust
68
+ macOS permissions. Asking the user to manage those separately for Lattices and
69
+ Action/Mira makes the system feel fragmented even when the architecture is
70
+ sound.
71
+
72
+ ## Product Decision
73
+
74
+ Mira should become a Lattices feature area, not a second app.
75
+
76
+ Recommended naming:
77
+
78
+ | Concept | Product Name |
79
+ | --- | --- |
80
+ | Capture/review mode | Mira |
81
+ | Individual execution | Run |
82
+ | Saved output | Artifact |
83
+ | Machine-readable event log | Trace |
84
+ | Human-facing result | Review |
85
+ | Visual desktop presence | Mira actor |
86
+
87
+ Examples of user-facing commands:
88
+
89
+ - `Record Current Window`
90
+ - `Capture Frontmost App`
91
+ - `Start Mira Run`
92
+ - `Review Last Run`
93
+ - `Show Run Artifacts`
94
+ - `Rerun Scenario`
95
+
96
+ The user should not need to know whether a given operation used ScreenCaptureKit,
97
+ Accessibility, a browser adapter, a recording probe, or an embedded helper.
98
+ Those details belong in diagnostics and receipts.
99
+
100
+ ## Goals
101
+
102
+ 1. Make Lattices the single user-facing app for workspace control and Mira
103
+ capture/review flows.
104
+ 2. Consolidate permission guidance into the existing Lattices Permissions
105
+ Assistant.
106
+ 3. Preserve Mira's important native runtime lesson: AppKit-dependent work must
107
+ run inside a real app lifecycle.
108
+ 4. Add a first-class run/artifact model that extends LAT-005 receipts and
109
+ history.
110
+ 5. Route Mira activity through the Lattices daemon instead of requiring users
111
+ or agents to remember a second public control plane.
112
+ 6. Bundle the Mira actor as a normal Lattices overlay actor.
113
+ 7. Migrate the useful protocol/runtime ideas without importing every demo,
114
+ composer, or release workflow at once.
115
+
116
+ ## Non-Goals
117
+
118
+ - Do not ship two visible apps as the normal experience.
119
+ - Do not push ScreenCaptureKit recording into a headless-only lifecycle.
120
+ - Do not make Lattices a general cross-platform automation product.
121
+ - Do not absorb Mira's composer/export stack before the run/capture/review loop
122
+ is integrated.
123
+ - Do not remove the existing Mira/Action repo until Lattices can own the
124
+ important runtime paths.
125
+ - Do not ask users to manage Action.app permissions as part of normal Lattices
126
+ usage.
127
+
128
+ ## Target User Experience
129
+
130
+ The desired experience is:
131
+
132
+ 1. User launches Lattices.
133
+ 2. Lattices shows one permission checklist.
134
+ 3. User opens the palette and chooses `Record Current Window`.
135
+ 4. Lattices starts a Mira run.
136
+ 5. Mira's overlay actor indicates recording or inspection state.
137
+ 6. The run writes media, screenshots, trace events, and receipts into the
138
+ Lattices run store.
139
+ 7. User opens `Review Last Run` from the same app.
140
+ 8. Agents can read the same run through daemon methods.
141
+
142
+ The user should not need to open a second project, remember the `action-dev`
143
+ CLI, or reason about `Action.app` unless they are intentionally working on the
144
+ old Mira codebase.
145
+
146
+ ## Permission Model
147
+
148
+ Permissions should be owned by Lattices wherever possible.
149
+
150
+ Lattices already has a real permission assistant for:
151
+
152
+ - Accessibility
153
+ - Screen Recording
154
+ - Automation
155
+ - Input Monitoring
156
+
157
+ Mira should extend that assistant with capture/review-specific explanations
158
+ instead of introducing a second prompt path.
159
+
160
+ ### TCC Identity
161
+
162
+ macOS privacy permissions are tied to process and bundle identity. That makes
163
+ the integration strategy important:
164
+
165
+ - Long-term recording should run through `Lattices.app` or a clearly bundled
166
+ Lattices helper identity.
167
+ - The old `Action.app` should not be required for normal user-facing capture.
168
+ - If a helper needs separate TCC visibility, the Permissions Assistant must say
169
+ exactly which binary appears in System Settings and why.
170
+ - Diagnostics should log bundle id, executable path, and permission state for
171
+ the component that actually needs access.
172
+
173
+ ### AppKit Lifecycle Boundary
174
+
175
+ Mira's recording work found an important constraint: ScreenCaptureKit recording
176
+ is more reliable when the actual recording path runs inside a real AppKit app
177
+ lifecycle.
178
+
179
+ Preserve that constraint by moving the probe pattern, not by flattening it.
180
+
181
+ Recommended shape:
182
+
183
+ ```text
184
+ Lattices.app
185
+ normal mode
186
+ --mira-recording-probe mode
187
+
188
+ Lattices daemon
189
+ accepts run/capture requests
190
+ records plans, receipts, and artifacts
191
+ launches probe mode for recording work when needed
192
+ ```
193
+
194
+ This keeps the lifecycle lesson without requiring a separate visible
195
+ `Action.app`.
196
+
197
+ ## Architecture
198
+
199
+ ### Current Shape
200
+
201
+ ```text
202
+ Lattices.app
203
+ daemon: ws://127.0.0.1:9399
204
+ permissions assistant
205
+ window/session/layer/overlay control
206
+
207
+ Action.app / Mira
208
+ agent: ws://127.0.0.1:4319
209
+ capture, recording probe, review loop
210
+ runtime/session/protocol packages
211
+ ```
212
+
213
+ ### Target Shape
214
+
215
+ ```text
216
+ Lattices.app
217
+ daemon: ws://127.0.0.1:9399
218
+ action runtime
219
+ permission assistant
220
+ Mira run/capture/review UI
221
+ Mira recording probe mode
222
+ overlay actor renderer
223
+
224
+ Optional internal helpers
225
+ capture helper
226
+ browser adapter
227
+ scenario/compiler tools
228
+ ```
229
+
230
+ The public API surface should be Lattices. Internal helpers can exist, but they
231
+ should not become another product for the user to operate.
232
+
233
+ ## Data Model
234
+
235
+ Add a run model that complements LAT-005 receipts.
236
+
237
+ ### `RunSession`
238
+
239
+ ```json
240
+ {
241
+ "id": "run_123",
242
+ "title": "Record current window",
243
+ "source": "palette",
244
+ "workspace": {
245
+ "projectPath": "/Users/art/dev/lattices",
246
+ "session": "lattices-abc123"
247
+ },
248
+ "state": "running",
249
+ "startedAt": "2026-05-30T12:00:00Z",
250
+ "completedAt": null,
251
+ "surfaces": [
252
+ {
253
+ "kind": "window",
254
+ "wid": 12345,
255
+ "app": "Lattices"
256
+ }
257
+ ],
258
+ "artifacts": [],
259
+ "receipts": []
260
+ }
261
+ ```
262
+
263
+ ### `RunArtifact`
264
+
265
+ ```json
266
+ {
267
+ "id": "art_123",
268
+ "runId": "run_123",
269
+ "kind": "recording",
270
+ "path": "~/Library/Application Support/Lattices/Runs/run_123/window.mov",
271
+ "mimeType": "video/quicktime",
272
+ "createdAt": "2026-05-30T12:01:00Z",
273
+ "metadata": {
274
+ "width": 1440,
275
+ "height": 900,
276
+ "durationMs": 12000
277
+ }
278
+ }
279
+ ```
280
+
281
+ ### `TraceEvent`
282
+
283
+ ```json
284
+ {
285
+ "id": "trace_123",
286
+ "runId": "run_123",
287
+ "time": "2026-05-30T12:00:03Z",
288
+ "kind": "capture.started",
289
+ "summary": "Started recording current window",
290
+ "data": {
291
+ "wid": 12345,
292
+ "probe": "Lattices.app --mira-recording-probe"
293
+ }
294
+ }
295
+ ```
296
+
297
+ Run receipts should reference LAT-005 execution receipts when actions mutate
298
+ workspace state. For example, a run may include a `window.place` receipt before
299
+ recording begins.
300
+
301
+ ## Daemon API
302
+
303
+ Keep `ws://127.0.0.1:9399` as the user and agent-facing API.
304
+
305
+ Initial additions:
306
+
307
+ | Method | Purpose |
308
+ | --- | --- |
309
+ | `runs.create` | Create a run record and artifact directory |
310
+ | `runs.start` | Start a run from a scenario or direct capture request |
311
+ | `runs.stop` | Stop a running capture or scenario |
312
+ | `runs.list` | List recent runs |
313
+ | `runs.get` | Inspect one run, including receipts and artifacts |
314
+ | `runs.artifacts` | List artifacts for a run |
315
+ | `capture.screenshotWindow` | Capture a window as a run artifact |
316
+ | `capture.screenshotRegion` | Capture a region as a run artifact |
317
+ | `capture.recordWindow` | Record a window through probe mode |
318
+ | `capture.recordRegion` | Record a region through probe mode |
319
+
320
+ Development-only bridge methods may exist while migrating:
321
+
322
+ | Method | Purpose |
323
+ | --- | --- |
324
+ | `mira.bridge.status` | Check whether the old Action/Mira agent is running |
325
+ | `mira.bridge.call` | Proxy a small allowlist of old agent methods |
326
+
327
+ Those bridge methods should be treated as scaffolding, not the destination.
328
+
329
+ ## UI Integration
330
+
331
+ ### Home
332
+
333
+ Add a compact Mira status area only when relevant:
334
+
335
+ - last run
336
+ - active recording
337
+ - missing permissions
338
+ - recent artifact
339
+
340
+ This should not become a marketing panel. It is operational state.
341
+
342
+ ### Palette
343
+
344
+ Add commands over the same run API:
345
+
346
+ - `Record Current Window`
347
+ - `Screenshot Current Window`
348
+ - `Review Last Run`
349
+ - `Stop Mira Run`
350
+ - `Show Mira`
351
+ - `Hide Mira`
352
+
353
+ ### Permissions Assistant
354
+
355
+ Add a Mira capability section that explains why capture/review uses:
356
+
357
+ - Screen Recording for screenshots and recordings
358
+ - Accessibility for target resolution and window interaction
359
+ - Automation for app-specific control paths
360
+ - Input Monitoring only when a feature truly requires it
361
+
362
+ The assistant should report which exact component is missing permission.
363
+
364
+ ### Overlay Actor
365
+
366
+ Bundle the Mira actor as a normal Lattices overlay actor.
367
+
368
+ Mira states should map onto LAT-004 actor states:
369
+
370
+ | Mira State | Overlay State |
371
+ | --- | --- |
372
+ | idle | `idle` |
373
+ | observing | `active` |
374
+ | resolving | `thinking` |
375
+ | recording | `active` |
376
+ | waiting for permission | `warning` |
377
+ | failed | `failed` |
378
+ | completed | `success` |
379
+ | reviewing | `review` |
380
+
381
+ The actor should be optional and dismissible. The run/capture contract must not
382
+ depend on a decorative surface being visible.
383
+
384
+ ## Code Migration
385
+
386
+ Move concepts before moving everything.
387
+
388
+ ### Bring Into Lattices Early
389
+
390
+ - Mira actor metadata and assets
391
+ - run/session lifecycle concepts
392
+ - artifact and trace event types
393
+ - capture request/response contracts
394
+ - screenshot capture path
395
+ - recording probe pattern
396
+ - review UI ideas
397
+
398
+ ### Bring Later
399
+
400
+ - scenario compiler
401
+ - browser companion
402
+ - composer packages
403
+ - demo rendering scripts
404
+ - release site assets
405
+ - MCP adapter
406
+
407
+ ### Rework Instead Of Copying Directly
408
+
409
+ - `Action.app` shell becomes Lattices Mira mode
410
+ - old Action agent protocol becomes internal migration scaffolding
411
+ - old CLI commands become Lattices palette, CLI, or daemon commands
412
+ - old docs become migration references, not another documentation tree
413
+
414
+ ## File Ownership
415
+
416
+ Suggested Lattices locations:
417
+
418
+ ```text
419
+ apps/mac/Sources/Core/Mira/
420
+ MiraRunStore.swift
421
+ MiraCaptureController.swift
422
+ MiraRecordingProbe.swift
423
+ MiraArtifact.swift
424
+ MiraTraceEvent.swift
425
+ MiraDaemonMethods.swift
426
+
427
+ apps/mac/Sources/Core/Overlays/Actors/Mira/
428
+ actor metadata and bundled assets
429
+
430
+ docs/proposals/
431
+ LAT-006-mira-in-lattices.md
432
+
433
+ docs/mira.md
434
+ user-facing capture/review docs once implemented
435
+ ```
436
+
437
+ If TypeScript protocol packages remain useful, add them under a Lattices-owned
438
+ package namespace rather than keeping `action` as the product name.
439
+
440
+ ## Migration Plan
441
+
442
+ ### Phase 1: Product Decision And Bridge
443
+
444
+ - Add this proposal.
445
+ - Cross-link LAT-005 and LAT-006.
446
+ - Define `RunSession`, `RunArtifact`, and `TraceEvent`.
447
+ - Add a dev-only bridge to the old Mira agent if useful for experiments.
448
+ - Do not present the bridge as the final user experience.
449
+
450
+ ### Phase 2: One-Permission Screenshot Slice
451
+
452
+ Implement the first real Mira feature entirely inside Lattices:
453
+
454
+ ```text
455
+ Screenshot Current Window -> RunSession -> Artifact -> Review
456
+ ```
457
+
458
+ This proves the most important integration point: the user grants Lattices
459
+ permission and receives a Mira artifact without opening Action.app.
460
+
461
+ ### Phase 3: Recording Probe In Lattices
462
+
463
+ - Port the recording probe pattern.
464
+ - Launch `Lattices.app --mira-recording-probe` for actual recording work.
465
+ - Preserve stop-file, finished-file, and debug-log behavior.
466
+ - Store outputs in the Lattices run directory.
467
+
468
+ ### Phase 4: Review UI
469
+
470
+ - Add a lightweight run library.
471
+ - Show screenshots, recordings, trace events, and action receipts.
472
+ - Link each artifact back to the workspace/window/session context.
473
+
474
+ ### Phase 5: Surface Adapters
475
+
476
+ - Bring over AX/browser/native surface adapter concepts.
477
+ - Let `actions.plan` and `runs.start` share target resolution confidence.
478
+ - Keep coordinate fallback visible in receipts.
479
+
480
+ ### Phase 6: Scenarios And Composer
481
+
482
+ - Bring scenario compilation only after manual capture and review feel solid.
483
+ - Keep composition/export optional and downstream from the run store.
484
+
485
+ ## Immediate Slice
486
+
487
+ The smallest meaningful integration is:
488
+
489
+ ```text
490
+ Record a screenshot of the current window as a Mira run inside Lattices.
491
+ ```
492
+
493
+ Required pieces:
494
+
495
+ - `RunSession` model
496
+ - artifact directory under Lattices application support
497
+ - `capture.screenshotWindow`
498
+ - palette command
499
+ - permission receipt
500
+ - recent-run review surface
501
+ - optional Mira actor state change
502
+
503
+ This avoids the two-app permission problem from the start and gives the product
504
+ a concrete user-facing Mira feature before the heavier recording probe is
505
+ ported.
506
+
507
+ ## Open Questions
508
+
509
+ ### Should The Name Stay Mira?
510
+
511
+ Recommendation: yes. "Mira" is useful as the named capture/review personality,
512
+ but it should live inside Lattices.
513
+
514
+ ### Should The Old Action Agent Port Stay?
515
+
516
+ Recommendation: temporarily. It can accelerate migration, but the stable public
517
+ surface should be the Lattices daemon on `9399`.
518
+
519
+ ### Should Lattices Ship A Separate Helper App?
520
+
521
+ Recommendation: avoid this unless needed. Prefer `Lattices.app` probe mode so
522
+ the user's permission story stays simple.
523
+
524
+ ### Where Should Runs Live?
525
+
526
+ Recommendation:
527
+
528
+ ```text
529
+ ~/Library/Application Support/Lattices/Runs/
530
+ ```
531
+
532
+ This keeps artifacts out of project repos unless the user explicitly exports
533
+ them.
534
+
535
+ ### Should Recording Be First?
536
+
537
+ Recommendation: no. Start with screenshots and run artifacts. Then port
538
+ recording once the run store and review loop exist.
539
+
540
+ ## Success Criteria
541
+
542
+ This proposal is successful when:
543
+
544
+ - the user sees Mira as part of Lattices, not as another app to remember
545
+ - the normal capture path asks for Lattices permissions, not Action.app
546
+ - a palette command can create a run artifact from the current window
547
+ - run artifacts are reviewable inside Lattices
548
+ - action receipts and run traces can reference each other
549
+ - the Mira actor can reflect run state without owning the run contract
550
+ - recording uses a real AppKit lifecycle without requiring a separate visible
551
+ product
552
+ - the old Mira repo can eventually become a migration source, not an active
553
+ parallel product
@@ -0,0 +1,128 @@
1
+ # LAT-007: Unified App Shell
2
+
3
+ ## Summary
4
+
5
+ Lattices should feel like one structured app, not a collection of useful
6
+ windows added one feature at a time. The native app already has a strong
7
+ starting point in the unified shell managed by `ScreenMapWindowController`.
8
+ Future feature work should treat that shell as the durable product surface.
9
+
10
+ Transient surfaces such as the command palette, voice command window, HUD,
11
+ and menu bar popover should become launchers, inspectors, or fast overlays
12
+ that route back into the shell for persistent workflows.
13
+
14
+ ## Product Shape
15
+
16
+ The main Lattices window should own the primary information architecture:
17
+
18
+ | Area | Purpose |
19
+ |------|---------|
20
+ | Home | Workspace status, desktop control, agent/search entry points, and discoverable project launch |
21
+ | Assistant | Chat and agent-oriented workspace help |
22
+ | Layout | Visual desktop map and window arrangement |
23
+ | Desktop Inventory | Window/search/OCR inventory |
24
+ | Activity | Logs, diagnostics, event history, and operational feedback |
25
+ | Settings | Preferences, permissions, shortcuts, mouse, AI, OCR, companion |
26
+ | Docs | Reference and onboarding material |
27
+
28
+ The menu bar popover should stay lightweight: quick project launch plus
29
+ buttons into the main shell. The command palette should stay global and
30
+ action-oriented. The HUD and voice UI should stay transient and contextual.
31
+
32
+ ## First User Experience
33
+
34
+ The friendliest starting point is Home, not Settings and not a floating
35
+ utility panel.
36
+
37
+ On first launch:
38
+
39
+ 1. The onboarding window introduces the product briefly.
40
+ 2. Onboarding presents optional capabilities only; it does not require project
41
+ setup or terminal-session setup.
42
+ 3. Completing onboarding opens the unified Home page.
43
+ 4. Home starts with desktop control, search/context, and assistant entry points;
44
+ project launch remains discoverable inside the app.
45
+ 5. Missing setup is explained in place. Settings remains available, but the app
46
+ should not throw the user into Settings just because a scan root is missing.
47
+
48
+ This keeps the first mental model simple:
49
+
50
+ > Lattices sees your workspace, helps arrange it, and gives agents local context.
51
+ > Project and terminal workflows are useful depth, not the first required step.
52
+
53
+ ## Surface Rules
54
+
55
+ 1. Durable state belongs in the unified app shell.
56
+ 2. Popovers and overlays should not become alternate versions of the app.
57
+ 3. Feature entry points should navigate to an app page when the user needs
58
+ to read, configure, inspect, or continue a workflow.
59
+ 4. Floating panels are appropriate for short-lived interactions: search,
60
+ command execution, voice capture, HUD previews, and permission helpers.
61
+ 5. Settings, diagnostics, docs, assistant setup, and inventory views should
62
+ avoid standalone windows unless there is an explicit debugging reason.
63
+ 6. Page changes inside the shell should preserve the user's window size and
64
+ position. Pick a good initial size, then let the window feel stable.
65
+
66
+ ## Migration Plan
67
+
68
+ ### Phase 1: Route Existing Entry Points
69
+
70
+ - Add missing primary pages to the unified shell.
71
+ - Redirect menu, palette, hotkey, and footer links into shell pages.
72
+ - Keep legacy utility windows available internally where useful, but stop
73
+ presenting them from normal app navigation.
74
+
75
+ ### Phase 2: Normalize Page Responsibilities
76
+
77
+ - Make Home the status and launch surface.
78
+ - Make Layout the only visual arrangement surface.
79
+ - Make Desktop Inventory the only persistent search/inventory surface.
80
+ - Make Activity the only persistent diagnostics surface.
81
+ - Keep Settings and Docs under the shell instead of separate windows.
82
+
83
+ ### Phase 3: Reduce Duplicate UI
84
+
85
+ - Convert repeated panel headers, footers, and shell chrome into reusable
86
+ components.
87
+ - Move preview rendering and diagnostic log rendering into shared views.
88
+ - Keep command palette rows and menu items as bindings to canonical actions.
89
+
90
+ ### Phase 4: Product-Level Navigation
91
+
92
+ - Add a route helper for app pages so callers express intent like
93
+ `showActivity()` or `showSettings(.shortcuts)` instead of manually choosing
94
+ windows.
95
+ - Add page-specific deep links for companion, docs, and diagnostics.
96
+ - Record navigation in diagnostics so support sessions can reconstruct how a
97
+ user reached a feature.
98
+
99
+ ## First Slice
100
+
101
+ The first implemented slice is Activity consolidation:
102
+
103
+ - `Activity` is now a primary app-shell page.
104
+ - Home links to Activity.
105
+ - menu bar, command palette, hotkey, settings/docs footers, launch flag, voice,
106
+ and Layout log links route to the Activity page.
107
+ - The legacy floating `DiagnosticWindow` remains for internal/debug use.
108
+
109
+ The second implemented slice is first-run Home consolidation:
110
+
111
+ - Completing onboarding opens Home.
112
+ - Missing scan-root setup is handled inside Home instead of auto-opening
113
+ Settings.
114
+ - Onboarding no longer introduces project-root or tmux setup.
115
+ - Home shows a desktop-first getting-started path when no projects are
116
+ discovered: layout, search/context, and assistant.
117
+ - Project scanning is skipped when the scan root is empty.
118
+ - App-shell tab navigation preserves the current window frame instead of
119
+ resizing per page.
120
+
121
+ ## Open Questions
122
+
123
+ - Should the menu bar click open Home in the unified shell by default, leaving
124
+ the project popover as an explicit quick-launch mode?
125
+ - Should Command Mode become the embedded Desktop Inventory page only, with the
126
+ standalone panel reserved for a hotkey overlay?
127
+ - Should Settings expose direct subroutes such as `settings.shortcuts` and
128
+ `settings.permissions`?
@@ -4,7 +4,7 @@ export default {
4
4
  name: 'lattices',
5
5
  tagline: 'macOS developer workspace manager — tmux sessions with a native menu bar app for tiling, navigation, and project management',
6
6
  type: 'cli-tool',
7
- version: '0.4.14',
7
+ version: '0.5.0',
8
8
  },
9
9
 
10
10
  agent: {
@@ -22,7 +22,7 @@ export default {
22
22
  'app-helper': 'bin/lattices-app.ts',
23
23
  'menu-bar-app': 'apps/mac/Sources/',
24
24
  'docs': 'docs/',
25
- 'docs-site': 'apps/docs-site/',
25
+ 'site': 'apps/site/',
26
26
  'marketing-site': 'apps/site/',
27
27
  },
28
28