@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
package/docs/api.md CHANGED
@@ -167,9 +167,10 @@ agent-visible UI. Use `overlay.publish` for transient passive visuals,
167
167
  and `overlay.actor.*` for persistent, movable actor surfaces.
168
168
 
169
169
  Persistent actors are useful for representing agents or processes on the
170
- desktop. Each actor has a stable `id`, can be moved independently, can be
171
- dragged by the user, and can be hidden/restored with **Hyper+8**. Right-click
172
- an actor to close that specific actor.
170
+ desktop. Each actor has a stable `id`, can be moved independently through the
171
+ API, dragged by the user, hidden/restored with **Hyper+B**, and closed with
172
+ right-click. Click event callbacks and action surfaces are planned follow-on
173
+ capabilities.
173
174
 
174
175
  | Method | Type | Description |
175
176
  |--------|------|-------------|
@@ -177,6 +178,8 @@ an actor to close that specific actor.
177
178
  | `overlay.clear` | write | Clear one overlay layer by id, or clear an owner namespace |
178
179
  | `overlay.actor.publish` | write | Create or update a persistent generative overlay actor |
179
180
  | `overlay.actor.moveTo` | write | Move an actor with app-owned easing |
181
+ | `overlay.actor.hud` | write | Attach, update, or clear a hover web HUD for an actor |
182
+ | `overlay.actor.visibility` | write | Show, hide, toggle, or inspect the sticky actor layer |
180
183
 
181
184
  #### `overlay.publish`
182
185
 
@@ -229,11 +232,29 @@ omit `ttlMs` or pass `0`, and `dismissible` defaults to `false`.
229
232
  | `state` | string | no | Actor state or animation name |
230
233
  | `name` | string | no | Actor display name |
231
234
  | `message` | string | no | Attached message text |
235
+ | `targetApp` | string | no | App name to activate when the actor is clicked |
236
+ | `targetBundleId` | string | no | Bundle identifier to activate when the actor is clicked |
237
+ | `targetAppPath` | string | no | `.app` bundle path to open when the actor is clicked |
238
+ | `scale` | double | no | Actor scale multiplier |
239
+ | `labelHidden` | bool | no | Hide the actor label/message |
240
+ | `closeOnActivate` | bool | no | Remove the actor after activating its target app |
241
+ | `hudUrl` | string | no | URL to render in a transparent hover HUD web view |
242
+ | `hudHTML` | string | no | Inline HTML to render in a transparent hover HUD web view |
243
+ | `hudWidth` | double | no | Hover HUD width |
244
+ | `hudHeight` | double | no | Hover HUD height |
245
+ | `hudReadAccess` | string | no | Local folder a file-backed HUD may read |
232
246
  | `placement` | string | no | `top`, `bottom`, `center`, `cursor`, or `point` |
233
247
  | `x`, `y` | double | no | Screen-local point for `point` placement |
234
248
  | `ttlMs` | int | no | Time to live; `0` means persistent |
235
249
  | `dismissible` | bool | no | Whether click-away dismissal removes the actor |
236
250
 
251
+ Bundled sprite assets:
252
+
253
+ | Asset | Notes |
254
+ |-------|-------|
255
+ | `assistant-spark` | Animated states include `idle`, `run_right`, `run_left`, `waving`, `jumping`, `failed`, `waiting`, `running`, and `review` |
256
+ | `scout-ranger` | Bundled sprite asset with default frame fallback |
257
+
237
258
  Example:
238
259
 
239
260
  ```js
@@ -277,6 +298,117 @@ await daemonCall('overlay.actor.moveTo', {
277
298
  })
278
299
  ```
279
300
 
301
+ #### `overlay.actor.hud`
302
+
303
+ Attach a transparent, blurred hover HUD to an actor. The HUD is backed by a
304
+ native `WKWebView`, so apps can point it at a local static HTML dashboard or,
305
+ in development, a local URL.
306
+
307
+ **Params**:
308
+
309
+ | Field | Type | Required | Description |
310
+ |-------|------|----------|-------------|
311
+ | `id` | string | yes | Actor id |
312
+ | `hudUrl` | string | no | URL or file path to render |
313
+ | `hudHTML` | string | no | Inline HTML to render instead of a URL |
314
+ | `hudTitle` | string | no | HUD title metadata |
315
+ | `hudWidth` | double | no | HUD width |
316
+ | `hudHeight` | double | no | HUD height |
317
+ | `hudReadAccess` | string | no | Local folder a file-backed HUD may read |
318
+ | `clear` | bool | no | Remove the actor HUD |
319
+
320
+ Example:
321
+
322
+ ```js
323
+ await daemonCall('overlay.actor.hud', {
324
+ id: 'switch-talkie',
325
+ hudUrl: '/Users/you/dev/talkie/.lattices/hud/index.html',
326
+ hudReadAccess: '/Users/you/Library/Application Support/Talkie/HUD',
327
+ hudWidth: 380,
328
+ hudHeight: 260
329
+ })
330
+ ```
331
+
332
+ #### `overlay.actor.visibility`
333
+
334
+ Show, hide, toggle, or inspect the persistent actor layer without destroying
335
+ the actors. This is the daemon equivalent of the app's **Hyper+B** shortcut.
336
+
337
+ **Params**:
338
+
339
+ | Field | Type | Required | Description |
340
+ |-------|------|----------|-------------|
341
+ | `action` | string | no | `show`, `hide`, `toggle`, or `status` |
342
+ | `visible` | bool | no | Set layer visibility directly |
343
+ | `hidden` | bool | no | Set layer hidden state directly |
344
+ | `feedback` | bool | no | Show a short desktop feedback toast |
345
+
346
+ Example:
347
+
348
+ ```js
349
+ await daemonCall('overlay.actor.visibility', { action: 'toggle' })
350
+ ```
351
+
352
+ ### Static HUD Manifests
353
+
354
+ Apps and projects can expose a local hover dashboard without running a web
355
+ server by publishing a static bundle at:
356
+
357
+ ```txt
358
+ .lattices/hud/
359
+ manifest.json
360
+ index.html
361
+ assets/
362
+ ```
363
+
364
+ Minimal manifest:
365
+
366
+ ```json
367
+ {
368
+ "version": 1,
369
+ "id": "talkie",
370
+ "name": "Talkie",
371
+ "bundleId": "com.usabletalkie.Talkie",
372
+ "icon": "./assets/icon.png",
373
+ "entry": "./index.html",
374
+ "readAccess": "~/Library/Application Support/Talkie/HUD",
375
+ "surface": { "width": 380, "height": 260 },
376
+ "actor": {
377
+ "labelHidden": true,
378
+ "click": "activateApp"
379
+ },
380
+ "sources": [
381
+ {
382
+ "path": "~/Library/Application Support/Talkie/HUD/activity.jsonl",
383
+ "format": "jsonl",
384
+ "schema": "talkie.activity.v1",
385
+ "presentation": "timeline"
386
+ }
387
+ ]
388
+ }
389
+ ```
390
+
391
+ The CLI resolves this manifest into `overlay.actor.publish` with a file-backed
392
+ HUD URL. The macOS app loads `entry` through `WKWebView.loadFileURL`, allowing
393
+ read access to the HUD folder by default, or to the manifest's `readAccess`
394
+ folder when one is declared.
395
+
396
+ `sources` is descriptive metadata for app-owned state, logs, or event streams.
397
+ Lattices does not append to those logs. The app writes them in its normal
398
+ runtime location, and the custom HUD renderer decides how to present them.
399
+
400
+ Useful commands:
401
+
402
+ ```bash
403
+ lattices hud register .lattices/hud/manifest.json --publish
404
+ lattices hud publish talkie
405
+ lattices hud sync
406
+ lattices hud discover ~/dev --register
407
+ ```
408
+
409
+ For packaged apps, keep the renderer files in the app bundle and point mutable
410
+ sources at an app-owned folder such as `~/Library/Application Support/...`.
411
+
280
412
  ---
281
413
 
282
414
  ## System
package/docs/app.md CHANGED
@@ -79,6 +79,27 @@ Available when `layers` are configured in `~/.lattices/workspace.json`
79
79
  | Refresh Projects | Re-scan for .lattices.json configs |
80
80
  | Quit Lattices | Exit the menu bar app |
81
81
 
82
+ ## Overlay actors and HUDs
83
+
84
+ Persistent overlay actors can be hidden or restored with **Hyper+B**. Apps can
85
+ publish a static hover dashboard by exposing:
86
+
87
+ ```txt
88
+ .lattices/hud/manifest.json
89
+ ```
90
+
91
+ Register and publish one:
92
+
93
+ ```bash
94
+ lattices hud register .lattices/hud/manifest.json --publish
95
+ ```
96
+
97
+ The manifest points to a local `index.html`, optional icon, app activation
98
+ target, HUD dimensions, and optional app-owned `sources` metadata for logs or
99
+ state files. Lattices hosts the actor and loads the dashboard through a
100
+ transparent `WKWebView`; the app owns the renderer and writes its own logs in
101
+ the places it already uses.
102
+
82
103
  ## Project discovery
83
104
 
84
105
  The app scans a configurable root directory (up to 3 levels deep)
@@ -153,8 +174,9 @@ Press **Hyper+3** to open the voice command window. Hold **Option** to
153
174
  speak, release to stop. Lattices transcribes via Vox, matches to an
154
175
  intent, and executes. Built-in commands: find, show, open, tile, kill, scan.
155
176
 
156
- A Claude Haiku advisor runs in parallel, offering follow-up suggestions
157
- in the AI corner. Configure the model and budget in Settings > AI.
177
+ The provider-backed assistant can run in parallel, offering follow-up
178
+ suggestions in the AI corner. Configure the provider and credentials in
179
+ Settings > AI.
158
180
 
159
181
  ## Settings
160
182
 
@@ -208,12 +230,12 @@ The trackpad proxy toggle lives here. Paired devices still need the
208
230
 
209
231
  | Setting | Default | Description |
210
232
  |----------------------|----------------|------------------------------------------|
211
- | Claude CLI path | Auto-detected | Path to `claude` binary |
212
- | Advisor model | Haiku | `haiku` (fast) or `sonnet` (smarter) |
213
- | Budget per session | $0.50 | Max spend per Claude CLI invocation |
233
+ | Assistant provider | OpenAI Codex | Provider used by in-app chat and provider-backed voice advice |
234
+ | Pi runtime | Auto-detected | Runtime install/refresh controls for provider chat |
235
+ | Provider credentials | Not set | OAuth sign-in or local API-key storage for the selected provider |
214
236
 
215
- Shows live session stats: context usage %, session cost, and learned
216
- pattern count.
237
+ Shows assistant readiness, runtime availability, and selected-provider
238
+ authentication state.
217
239
 
218
240
  ### Shortcuts
219
241
 
@@ -228,7 +250,7 @@ Shows keyboard shortcut reference:
228
250
  | Hyper+4 | Desktop inventory |
229
251
  | Hyper+5 | Omni search |
230
252
  | Hyper+6 | Cheat sheet |
231
- | Hyper+8 | Hide/show persistent overlay actors |
253
+ | Hyper+B | Hide/show persistent overlay actors |
232
254
  | Cmd+Option+1/2/3 | Switch workspace layer |
233
255
  | Ctrl+B D | Detach from session |
234
256
  | Ctrl+B X | Kill current pane |
package/docs/config.md CHANGED
@@ -146,6 +146,10 @@ Run `lattices init` in your project directory to generate a starter
146
146
  | `lattices windows [--json]` | List all visible windows |
147
147
  | `lattices window assign <wid> <layer>` | Tag a window to a layer |
148
148
  | `lattices window map [--json]` | Show all window→layer assignments |
149
+ | `lattices actor toggle` | Hide/show persistent overlay actors |
150
+ | `lattices hud register [manifest]` | Register a `.lattices/hud/manifest.json` |
151
+ | `lattices hud publish [id\|manifest]` | Publish a static HUD actor to the desktop |
152
+ | `lattices hud sync` | Publish all registered HUD actors |
149
153
  | `lattices search <query>` | Search windows by title, app, session, OCR |
150
154
  | `lattices search <q> --deep` | Deep search: index + live terminal inspection |
151
155
  | `lattices search <q> --wid` | Print matching window IDs only (pipeable) |
@@ -1,79 +1,207 @@
1
+ ---
2
+ title: Mouse Gestures
3
+ description: Hold a mouse button, draw a shape or direction, release — runs matched actions like a window manager power-user shortcut system.
4
+ order: 4.2
5
+ ---
6
+
1
7
  # Mouse Gestures
2
8
 
3
9
  ## Concept
4
10
 
5
- Hold a mouse button drag in a direction release to execute an action.
6
- The MX Master 3S back-side button (button 3) triggers grid layouts.
7
-
8
- ## Button Mapping
9
-
10
- Defaults — remap by editing `~/.lattices/mouse-shortcuts.json`:
11
-
12
- - **Button 3 (Back)** — grid layouts (Maximize / 2×2 / 3×3 / 4×4)
11
+ Mouse gestures are a user-level shortcut system for the macOS app. Hold a
12
+ configured mouse button, draw a direction or shape, then release to run the
13
+ matched action.
13
14
 
14
- ## Gesture Detection
15
+ The app code owns the recognizer, action dispatcher, and JSON schema. Your
16
+ actual gesture mappings live in:
15
17
 
16
- 1. Button held → start tracking mouse movement
17
- 2. After 30px of movement, commit to a direction (↑ ← → ↓)
18
- 3. Show HUD feedback badge: current direction + predicted action
19
- 4. Release → execute the action
20
-
21
- If released before 30px threshold no action (treated as a normal click).
18
+ ```bash
19
+ ~/.lattices/mouse-shortcuts.json
20
+ ```
21
+
22
+ That file is machine-local preference data. It is not project config, and it
23
+ should not be committed to this repository unless you are intentionally adding
24
+ an example fixture or changing the schema.
25
+
26
+ ## Config Ownership
27
+
28
+ There are two layers:
29
+
30
+ - **Code defaults** in `MouseGestureConfig.swift` provide a minimal starter
31
+ config when no user file exists.
32
+ - **User rules** in `~/.lattices/mouse-shortcuts.json` are the source of truth
33
+ after the file has been created.
34
+
35
+ Do not add personal shortcuts by changing `MouseGestureConfig.swift`. Add them
36
+ to the user JSON file instead. The Settings UI can open that file from
37
+ **Settings -> Shortcuts -> Mouse Gestures -> Configure...**.
38
+
39
+ ## Lightweight History
40
+
41
+ Lattices keeps local snapshots of your mouse shortcut config before risky
42
+ changes:
43
+
44
+ ```bash
45
+ ~/.lattices/mouse-shortcuts.history/
46
+ ```
47
+
48
+ Snapshots are written before external edits are reloaded and before Settings
49
+ restores defaults or restores a previous snapshot. The newest 40 snapshots are
50
+ kept. Use **History** in Settings to open the folder, or **Undo Last** to
51
+ restore the latest snapshot.
52
+
53
+ ## Button Names
54
+
55
+ The config accepts these common button names:
56
+
57
+ | Config value | Meaning |
58
+ |---|---|
59
+ | `middle` | Middle button / wheel click |
60
+ | `back` | Back side button, often mouse button 4 |
61
+ | `forward` | Forward side button, often mouse button 5 |
62
+ | `right` | Right mouse button |
63
+ | `buttonN` | Explicit numbered button fallback |
64
+
65
+ Normal clicks pass through when a configured button is only being watched for
66
+ drag or shape gestures. Once movement crosses the gesture threshold and matches
67
+ a real gesture, Lattices claims the interaction.
68
+
69
+ Browser frontmost apps are bypassed so native middle-click, Back, and Forward
70
+ button behavior stays intact. This avoids half-claimed side-button gestures
71
+ accidentally navigating while you are drawing a shape.
72
+
73
+ ## Trigger Kinds
74
+
75
+ Rules match one of three trigger kinds:
76
+
77
+ | Kind | Required fields | Example |
78
+ |---|---|---|
79
+ | `click` | `button` | Middle click sends paste |
80
+ | `drag` | `button`, `direction` | Middle drag left switches Space |
81
+ | `shape` | `button`, `shape` | Back-button L shape activates iTerm |
82
+
83
+ Directions are `up`, `down`, `left`, and `right`.
84
+
85
+ Useful shapes include:
86
+
87
+ | Shape | Motion |
88
+ |---|---|
89
+ | `l-shape-down-right` | Down, then right |
90
+ | `l-shape-down-left` | Down, then left |
91
+ | `l-shape-up-right` | Up, then right |
92
+ | `l-shape-up-left` | Up, then left |
93
+ | `reverse-l-right-down` | Right, then down |
94
+ | `reverse-l-left-down` | Left, then down |
95
+ | `v-shape` | Down, then up |
96
+ | `reverse-v` | Up, then down |
97
+ | `circle` | A loose closed loop |
98
+
99
+ The circle recognizer is intentionally generous: it looks for broad circular
100
+ motion, a reasonably closed path, and enough turn coverage rather than a
101
+ geometrically perfect circle.
102
+
103
+ ## Default: Screenshot Area Gesture
104
+
105
+ New default configs include a back-button circle gesture for the macOS
106
+ screenshot area picker (`Command` + `Shift` + `4`):
107
+
108
+ ```json
109
+ {
110
+ "id": "back-circle-screenshot-area",
111
+ "enabled": true,
112
+ "device": "any",
113
+ "trigger": {
114
+ "button": "back",
115
+ "kind": "shape",
116
+ "shape": "circle"
117
+ },
118
+ "action": {
119
+ "type": "shortcut.send",
120
+ "shortcut": {
121
+ "key": "4",
122
+ "keyCode": 21,
123
+ "modifiers": ["command", "shift"]
124
+ }
125
+ },
126
+ "visual": {
127
+ "renderer": "matrix",
128
+ "theme": "lattices"
129
+ }
130
+ }
131
+ ```
22
132
 
23
133
  ## Actions
24
134
 
25
- ### Button 3 — Grid / Tile
26
-
27
- | Direction | Action | Result |
28
- |-----------|--------|--------|
29
- | Up | Maximize | Frontmost window fills the screen |
30
- | Left | 2×2 grid | Distribute frontmost 4 windows |
31
- | Right | 3×3 grid | Distribute frontmost 9 windows |
32
- | Down | 4×4 grid | Distribute frontmost 16 windows |
135
+ Supported action types include:
136
+
137
+ | Type | Purpose |
138
+ |---|---|
139
+ | `space.previous` | Switch to the previous macOS Space |
140
+ | `space.next` | Switch to the next macOS Space |
141
+ | `screenmap.toggle` | Open the Screen Map overview |
142
+ | `dictation.start` | Start dictation |
143
+ | `shortcut.send` | Send a keyboard shortcut |
144
+ | `app.activate` | Activate an app by name |
145
+
146
+ ## Example: Enter Gesture
147
+
148
+ This is a user-level rule, not a code default. Add it to
149
+ `~/.lattices/mouse-shortcuts.json` if you want the back button plus a quick
150
+ down-then-left shape to press Enter:
151
+
152
+ ```json
153
+ {
154
+ "id": "back-down-left-enter",
155
+ "enabled": true,
156
+ "device": "any",
157
+ "trigger": {
158
+ "button": "back",
159
+ "kind": "shape",
160
+ "shape": "l-shape-down-left"
161
+ },
162
+ "action": {
163
+ "type": "shortcut.send",
164
+ "shortcut": {
165
+ "key": "enter",
166
+ "keyCode": 36,
167
+ "modifiers": []
168
+ }
169
+ }
170
+ }
171
+ ```
172
+
173
+ ## Visuals
174
+
175
+ Rules may include an optional `visual` block for feedback. Visuals are
176
+ decorative: they must never decide whether a gesture matches or whether an
177
+ action runs. If a visual asset is missing or slow, the gesture should still
178
+ execute through the native action path.
179
+
180
+ Shape gestures can opt into native matrix completion feedback with
181
+ `"visual": { "renderer": "matrix" }`. When enabled, Lattices smooths the
182
+ captured path, replays it briefly inside a small 3x3 rounded-cell matrix, then
183
+ snaps into a compact confirmation glyph and action label. This is feedback
184
+ only; the matched rule has already dispatched.
33
185
 
34
- Grid distributes the visible non-Lattices windows to fill the grid cells on
35
- the screen the cursor is on.
36
-
37
- ## HUD Feedback
186
+ ## Implementation
38
187
 
39
- While dragging:
40
- - Small floating badge near the cursor: direction arrow + action name
41
- - Floats above all windows, fades out on release
188
+ - `apps/mac/Sources/Core/Input/MouseGestureController.swift` owns the CGEvent
189
+ tap, gesture session state, passthrough behavior, and action dispatch.
190
+ - `apps/mac/Sources/Core/Input/MouseGestureConfig.swift` defines the Codable
191
+ schema and initial fallback defaults.
192
+ - `apps/mac/Sources/Core/Input/MouseShortcutStore.swift` loads the user-level
193
+ JSON file and provides thread-safe snapshots to the event tap.
194
+ - `apps/mac/Sources/Core/Input/ShapeRecognizer.swift` converts raw gesture
195
+ paths into direction and shape labels.
42
196
 
43
- ## Safety: self-healing event tap
197
+ ## Safety
44
198
 
45
199
  The controller installs a session-wide CGEvent tap. To avoid blocking the
46
200
  system input pipeline:
47
201
 
48
- - The tap callback never blocks actions dispatch async to the main queue.
49
- - A circuit breaker trips on (a) OS `tapDisabledByTimeout` events, or
50
- (b) any single action that exceeds 500ms.
51
- - Cooldowns escalate inside a 10-minute rolling window: **30s 2min
52
- permanent** (until config reload or app restart).
53
- - A center-screen badge surfaces "Mouse gestures paused resuming in Ns"
54
- on trip and "Mouse gestures resumed" on auto-recover. All trips log to
55
- `~/.lattices/lattices.log`.
56
-
57
- ## Implementation
58
-
59
- - `apps/mac/Sources/MouseGestureController.swift` — CGEvent tap, gesture
60
- state machine, breaker.
61
- - Tile actions go through `WindowTiler.tileFrontmostViaAX(...)`.
62
- - Grid actions enumerate visible windows via `DesktopModel.shared.allWindows()`
63
- and batch-move them with `WindowTiler.batchMoveAndRaiseWindows(...)`.
64
-
65
- ## Settings UI
66
-
67
- **Settings → Shortcuts → Mouse Gestures**:
68
-
69
- - Button 3 grid card showing the active mapping
70
- - Hint to edit `~/.lattices/mouse-shortcuts.json` for remapping
71
-
72
- ## Edge Cases
73
-
74
- - Multiple monitors: gesture executes on the screen the cursor starts on
75
- - Button held + cursor leaves the screen: still tracks; action applies
76
- to the starting screen
77
- - Short press (< 30px movement): ignored, treated as a normal click
78
- - Slow action / OS tap timeout: breaker trips, gestures pause briefly,
79
- then auto-recover
202
+ - The tap callback does only cheap work and dispatches heavier work async.
203
+ - A circuit breaker handles OS tap timeout events and pauses gestures when
204
+ needed.
205
+ - Short, unmatched clicks are replayed or passed through so native app behavior
206
+ remains intact.
207
+ - The emergency reset chord clears stuck input capture state.
@@ -192,7 +192,7 @@ Expected interactions:
192
192
 
193
193
  Dismissal should normally dismiss the current message/surface, not delete the actor.
194
194
  Persistent actors can be parked globally with the overlay actor hotkey
195
- without clearing their ids or state. The initial shortcut is **Hyper+8**.
195
+ without clearing their ids or state. The initial shortcut is **Hyper+B**.
196
196
 
197
197
  ## Motion
198
198