@arach/lattices 0.2.0 → 0.6.1

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 (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +172 -86
  3. package/apps/mac/Info.plist +43 -0
  4. package/apps/mac/Lattices.app/Contents/Info.plist +43 -0
  5. package/apps/mac/Lattices.app/Contents/MacOS/Lattices +0 -0
  6. package/apps/mac/Lattices.app/Contents/Resources/AppIcon.icns +0 -0
  7. package/apps/mac/Lattices.app/Contents/Resources/docs/assistant-knowledge.md +130 -0
  8. package/apps/mac/Lattices.app/Contents/Resources/tap.wav +0 -0
  9. package/apps/mac/Lattices.app/Contents/_CodeSignature/CodeResources +150 -0
  10. package/apps/mac/Lattices.entitlements +21 -0
  11. package/apps/mac/Resources/Pets/assistant-spark/pet.json +62 -0
  12. package/apps/mac/Resources/Pets/assistant-spark/spritesheet.webp +0 -0
  13. package/apps/mac/Resources/Pets/scout-ranger/pet.json +6 -0
  14. package/apps/mac/Resources/Pets/scout-ranger/spritesheet.webp +0 -0
  15. package/apps/mac/Resources/tap.wav +0 -0
  16. package/assets/AppIcon.icns +0 -0
  17. package/bin/assistant-intelligence.ts +912 -0
  18. package/bin/cli/capture.ts +252 -0
  19. package/bin/cli/daemon.ts +22 -0
  20. package/bin/cli/helpers.ts +105 -0
  21. package/bin/cli/layer.ts +178 -0
  22. package/bin/cli/runs.ts +43 -0
  23. package/bin/cli/search.ts +141 -0
  24. package/bin/cli/session.ts +32 -0
  25. package/bin/client.ts +17 -0
  26. package/bin/cua.ts +26 -0
  27. package/bin/{daemon-client.js → daemon-client.ts} +49 -30
  28. package/bin/handsoff-infer.ts +96 -0
  29. package/bin/handsoff-worker.ts +531 -0
  30. package/bin/infer.ts +424 -0
  31. package/bin/keychain.ts +75 -0
  32. package/bin/lattices-app.ts +655 -0
  33. package/bin/lattices-build +125 -0
  34. package/bin/lattices-build-env.ts +77 -0
  35. package/bin/lattices-dev +362 -0
  36. package/bin/lattices.ts +3260 -0
  37. package/bin/project-twin.ts +645 -0
  38. package/docs/agent-execution-plan.md +562 -0
  39. package/docs/agent-layer-guide.md +207 -0
  40. package/docs/agents.md +233 -0
  41. package/docs/ai-chat-ux-review.md +416 -0
  42. package/docs/api.md +1041 -47
  43. package/docs/app.md +96 -13
  44. package/docs/assistant-knowledge.md +130 -0
  45. package/docs/companion-deck.md +209 -0
  46. package/docs/component-extraction-roadmap.md +392 -0
  47. package/docs/concepts.md +13 -12
  48. package/docs/config.md +83 -10
  49. package/docs/gesture-customization-proposal.md +520 -0
  50. package/docs/handsoff-test-scenarios.md +84 -0
  51. package/docs/hyperspace-grid-snappiness.md +210 -0
  52. package/docs/layers.md +176 -28
  53. package/docs/mouse-gestures.md +244 -0
  54. package/docs/ocr.md +21 -9
  55. package/docs/overview.md +42 -23
  56. package/docs/presentation-execution-review.md +491 -0
  57. package/docs/prompts/hands-off-system.md +382 -0
  58. package/docs/prompts/hands-off-turn.md +30 -0
  59. package/docs/prompts/voice-advisor.md +31 -0
  60. package/docs/prompts/voice-fallback.md +23 -0
  61. package/docs/proposals/LAT-001-gesture-visual-customization.md +522 -0
  62. package/docs/proposals/LAT-002-shared-overlay-canvas.md +353 -0
  63. package/docs/proposals/LAT-003-menu-bar-controller-architecture.md +291 -0
  64. package/docs/proposals/LAT-004-interactive-overlay-actors.md +534 -0
  65. package/docs/proposals/LAT-005-action-runtime-product-spine.md +914 -0
  66. package/docs/proposals/LAT-006-followup-gaps.md +103 -0
  67. package/docs/proposals/LAT-006-runs-and-capture-in-lattices.md +566 -0
  68. package/docs/proposals/LAT-007-unified-app-shell.md +128 -0
  69. package/docs/quickstart.md +8 -12
  70. package/docs/reference/dewey.config.ts +74 -0
  71. package/docs/reference/install-agent.md +79 -0
  72. package/docs/release.md +172 -0
  73. package/docs/repo-structure.md +100 -0
  74. package/docs/terminal-kit.md +87 -0
  75. package/docs/tiling-reference.md +224 -0
  76. package/docs/twins.md +138 -0
  77. package/docs/voice-command-protocol.md +278 -0
  78. package/docs/voice-error-model.md +73 -0
  79. package/docs/voice.md +221 -0
  80. package/package.json +69 -16
  81. package/packages/npm/sdk/cua.d.mts +1 -0
  82. package/packages/npm/sdk/cua.d.ts +188 -0
  83. package/packages/npm/sdk/cua.mjs +376 -0
  84. package/app/Lattices.app/Contents/Info.plist +0 -24
  85. package/app/Package.swift +0 -13
  86. package/app/Sources/ActionRow.swift +0 -61
  87. package/app/Sources/App.swift +0 -10
  88. package/app/Sources/AppDelegate.swift +0 -234
  89. package/app/Sources/AppShellView.swift +0 -62
  90. package/app/Sources/AppTypeClassifier.swift +0 -70
  91. package/app/Sources/AppWindowShell.swift +0 -63
  92. package/app/Sources/CheatSheetHUD.swift +0 -332
  93. package/app/Sources/CommandModeState.swift +0 -1362
  94. package/app/Sources/CommandModeView.swift +0 -1405
  95. package/app/Sources/CommandModeWindow.swift +0 -192
  96. package/app/Sources/CommandPaletteView.swift +0 -307
  97. package/app/Sources/CommandPaletteWindow.swift +0 -134
  98. package/app/Sources/DaemonProtocol.swift +0 -101
  99. package/app/Sources/DaemonServer.swift +0 -414
  100. package/app/Sources/DesktopModel.swift +0 -121
  101. package/app/Sources/DesktopModelTypes.swift +0 -71
  102. package/app/Sources/DiagnosticLog.swift +0 -271
  103. package/app/Sources/EventBus.swift +0 -30
  104. package/app/Sources/HotkeyManager.swift +0 -250
  105. package/app/Sources/HotkeyStore.swift +0 -338
  106. package/app/Sources/InventoryManager.swift +0 -35
  107. package/app/Sources/InventoryPath.swift +0 -43
  108. package/app/Sources/KeyRecorderView.swift +0 -210
  109. package/app/Sources/LatticesApi.swift +0 -1125
  110. package/app/Sources/MainView.swift +0 -467
  111. package/app/Sources/MainWindow.swift +0 -83
  112. package/app/Sources/OcrModel.swift +0 -309
  113. package/app/Sources/OcrStore.swift +0 -295
  114. package/app/Sources/OmniSearchState.swift +0 -283
  115. package/app/Sources/OmniSearchView.swift +0 -288
  116. package/app/Sources/OmniSearchWindow.swift +0 -105
  117. package/app/Sources/OrphanRow.swift +0 -129
  118. package/app/Sources/PaletteCommand.swift +0 -419
  119. package/app/Sources/PermissionChecker.swift +0 -125
  120. package/app/Sources/Preferences.swift +0 -92
  121. package/app/Sources/ProcessModel.swift +0 -199
  122. package/app/Sources/ProcessQuery.swift +0 -151
  123. package/app/Sources/Project.swift +0 -28
  124. package/app/Sources/ProjectRow.swift +0 -368
  125. package/app/Sources/ProjectScanner.swift +0 -121
  126. package/app/Sources/ScreenMapState.swift +0 -2387
  127. package/app/Sources/ScreenMapView.swift +0 -2820
  128. package/app/Sources/ScreenMapWindowController.swift +0 -89
  129. package/app/Sources/SessionManager.swift +0 -72
  130. package/app/Sources/SettingsView.swift +0 -1053
  131. package/app/Sources/SettingsWindow.swift +0 -20
  132. package/app/Sources/TabGroupRow.swift +0 -178
  133. package/app/Sources/Terminal.swift +0 -259
  134. package/app/Sources/TerminalQuery.swift +0 -156
  135. package/app/Sources/TerminalSynthesizer.swift +0 -200
  136. package/app/Sources/Theme.swift +0 -163
  137. package/app/Sources/TilePickerView.swift +0 -209
  138. package/app/Sources/TmuxModel.swift +0 -53
  139. package/app/Sources/TmuxQuery.swift +0 -81
  140. package/app/Sources/WindowTiler.swift +0 -1755
  141. package/app/Sources/WorkspaceManager.swift +0 -434
  142. package/bin/lattices-app.js +0 -221
  143. package/bin/lattices.js +0 -1418
@@ -1,89 +0,0 @@
1
- import AppKit
2
- import SwiftUI
3
-
4
- /// Manages the unified app window (Screen Map + Settings).
5
- /// Singleton with show/close/toggle, plus showPage() for navigation.
6
- final class ScreenMapWindowController: ObservableObject {
7
- static let shared = ScreenMapWindowController()
8
-
9
- private var window: NSWindow?
10
- private var controller: ScreenMapController?
11
- @Published var activePage: AppPage = .screenMap
12
-
13
- var isVisible: Bool { window?.isVisible ?? false }
14
-
15
- /// Exposed for event monitor filtering
16
- var nsWindow: NSWindow? { window }
17
-
18
- func toggle() {
19
- if let w = window, w.isVisible {
20
- close()
21
- } else {
22
- show()
23
- }
24
- }
25
-
26
- /// Show the window on the current page (defaults to Screen Map).
27
- func show() {
28
- if let existing = window {
29
- if activePage == .screenMap {
30
- controller?.enter()
31
- }
32
- existing.makeKeyAndOrderFront(nil)
33
- NSApp.activate(ignoringOtherApps: true)
34
- return
35
- }
36
-
37
- let ctrl = ScreenMapController()
38
- ctrl.onDismiss = { [weak self] in
39
- self?.close()
40
- }
41
- if activePage == .screenMap {
42
- ctrl.enter()
43
- }
44
-
45
- let screens = NSScreen.screens
46
- let primaryHeight = screens.first?.frame.height ?? 0
47
- var bbox = CGRect.zero
48
- for (i, screen) in screens.enumerated() {
49
- let cgY = primaryHeight - screen.frame.maxY
50
- let cgRect = CGRect(x: screen.frame.origin.x, y: cgY,
51
- width: screen.frame.width, height: screen.frame.height)
52
- bbox = i == 0 ? cgRect : bbox.union(cgRect)
53
- }
54
- let aspectRatio = bbox.width / max(bbox.height, 1)
55
- let windowWidth = max(860, CGFloat(620) * aspectRatio + 100)
56
-
57
- let view = AppShellView(controller: ctrl)
58
-
59
- let w = AppWindowShell.makeWindow(
60
- config: .init(
61
- title: "Lattices",
62
- initialSize: NSSize(width: windowWidth, height: 620),
63
- minSize: NSSize(width: 600, height: 400),
64
- maxSize: NSSize(width: 2400, height: 1600)
65
- ),
66
- rootView: view
67
- )
68
- AppWindowShell.positionCentered(w)
69
- AppWindowShell.present(w)
70
-
71
- self.window = w
72
- self.controller = ctrl
73
- }
74
-
75
- /// Navigate to a specific page, opening the window if needed.
76
- func showPage(_ page: AppPage) {
77
- activePage = page
78
- show()
79
- }
80
-
81
- func close() {
82
- controller?.endPreview()
83
- window?.orderOut(nil)
84
- window = nil
85
- controller = nil
86
- activePage = .screenMap
87
- AppDelegate.updateActivationPolicy()
88
- }
89
- }
@@ -1,72 +0,0 @@
1
- import AppKit
2
-
3
- enum SessionManager {
4
- private static let latticesPath = "/opt/homebrew/bin/lattices"
5
- private static let tmuxPath = "/opt/homebrew/bin/tmux"
6
-
7
- /// Launch or reattach — if session is running, find and focus the existing window
8
- static func launch(project: Project) {
9
- let terminal = Preferences.shared.terminal
10
- if project.isRunning {
11
- terminal.focusOrAttach(session: project.sessionName)
12
- } else {
13
- terminal.launch(command: latticesPath, in: project.path)
14
- }
15
- }
16
-
17
- /// Detach all clients from a tmux session (keeps it running)
18
- static func detach(project: Project) {
19
- detachByName(project.sessionName)
20
- }
21
-
22
- /// Detach all clients by session name string (for layer switching without a Project object)
23
- static func detachByName(_ sessionName: String) {
24
- let task = Process()
25
- task.executableURL = URL(fileURLWithPath: tmuxPath)
26
- task.arguments = ["detach-client", "-s", sessionName]
27
- task.standardOutput = FileHandle.nullDevice
28
- task.standardError = FileHandle.nullDevice
29
- try? task.run()
30
- task.waitUntilExit()
31
- }
32
-
33
- /// Kill a tmux session
34
- static func kill(project: Project) {
35
- killByName(project.sessionName)
36
- }
37
-
38
- /// Kill a tmux session by name string (for orphan sessions without a Project object)
39
- static func killByName(_ sessionName: String) {
40
- let task = Process()
41
- task.executableURL = URL(fileURLWithPath: tmuxPath)
42
- task.arguments = ["kill-session", "-t", sessionName]
43
- task.standardOutput = FileHandle.nullDevice
44
- task.standardError = FileHandle.nullDevice
45
- try? task.run()
46
- task.waitUntilExit()
47
- }
48
-
49
- /// Reconcile session state to match declared config (recreate missing panes)
50
- static func sync(project: Project) {
51
- let task = Process()
52
- task.executableURL = URL(fileURLWithPath: latticesPath)
53
- task.arguments = ["sync"]
54
- task.currentDirectoryURL = URL(fileURLWithPath: project.path)
55
- task.standardOutput = FileHandle.nullDevice
56
- task.standardError = FileHandle.nullDevice
57
- try? task.run()
58
- task.waitUntilExit()
59
- }
60
-
61
- /// Restart a specific pane's process (kill + re-run declared command)
62
- static func restart(project: Project, paneName: String? = nil) {
63
- let task = Process()
64
- task.executableURL = URL(fileURLWithPath: latticesPath)
65
- task.arguments = paneName != nil ? ["restart", paneName!] : ["restart"]
66
- task.currentDirectoryURL = URL(fileURLWithPath: project.path)
67
- task.standardOutput = FileHandle.nullDevice
68
- task.standardError = FileHandle.nullDevice
69
- try? task.run()
70
- task.waitUntilExit()
71
- }
72
- }