@lattices/cli 0.4.1 → 0.4.5

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 (71) hide show
  1. package/README.md +3 -0
  2. package/app/Info.plist +2 -2
  3. package/app/Lattices.app/Contents/Info.plist +2 -2
  4. package/app/Lattices.app/Contents/MacOS/Lattices +0 -0
  5. package/app/Package.swift +6 -0
  6. package/app/Sources/ActionRow.swift +43 -26
  7. package/app/Sources/App.swift +10 -0
  8. package/app/Sources/AppDelegate.swift +91 -30
  9. package/app/Sources/AppShellView.swift +2 -0
  10. package/app/Sources/AppTypeClassifier.swift +36 -0
  11. package/app/Sources/AppUpdater.swift +92 -0
  12. package/app/Sources/CheatSheetHUD.swift +1 -0
  13. package/app/Sources/CliActionLauncher.swift +50 -0
  14. package/app/Sources/CommandModeView.swift +4 -24
  15. package/app/Sources/CompanionActivityLog.swift +70 -0
  16. package/app/Sources/CompanionKeyboardController.swift +141 -0
  17. package/app/Sources/DesktopModel.swift +4 -0
  18. package/app/Sources/HandsOffSession.swift +53 -16
  19. package/app/Sources/HomeDashboardView.swift +18 -10
  20. package/app/Sources/HotkeyStore.swift +8 -5
  21. package/app/Sources/IntentEngine.swift +7 -1
  22. package/app/Sources/LatticesApi.swift +125 -4
  23. package/app/Sources/LatticesCompanionBridgeServer.swift +438 -0
  24. package/app/Sources/LatticesCompanionCockpit.swift +555 -0
  25. package/app/Sources/LatticesCompanionSecurityCoordinator.swift +594 -0
  26. package/app/Sources/LatticesCompanionTrackpadController.swift +204 -0
  27. package/app/Sources/LatticesDeckHost.swift +1463 -0
  28. package/app/Sources/LatticesRuntime.swift +61 -0
  29. package/app/Sources/MainView.swift +398 -186
  30. package/app/Sources/MouseFinder.swift +335 -30
  31. package/app/Sources/MouseGestureConfig.swift +364 -0
  32. package/app/Sources/MouseGestureController.swift +1203 -0
  33. package/app/Sources/MouseInputDeviceStore.swift +98 -0
  34. package/app/Sources/MouseInputEventViewer.swift +272 -0
  35. package/app/Sources/MouseShortcutStore.swift +107 -0
  36. package/app/Sources/OmniSearchView.swift +136 -2
  37. package/app/Sources/OmniSearchWindow.swift +65 -5
  38. package/app/Sources/OnboardingView.swift +30 -16
  39. package/app/Sources/PaletteCommand.swift +26 -6
  40. package/app/Sources/PermissionChecker.swift +76 -2
  41. package/app/Sources/PiAuthNextStepCard.swift +148 -0
  42. package/app/Sources/PiAuthPromptCard.swift +90 -0
  43. package/app/Sources/PiChatDock.swift +137 -74
  44. package/app/Sources/PiChatSession.swift +608 -108
  45. package/app/Sources/PiInstallCallout.swift +86 -0
  46. package/app/Sources/PiProviderSetupCallout.swift +99 -0
  47. package/app/Sources/PiWorkspaceView.swift +174 -77
  48. package/app/Sources/Preferences.swift +78 -0
  49. package/app/Sources/ScreenMapState.swift +91 -31
  50. package/app/Sources/ScreenMapView.swift +510 -524
  51. package/app/Sources/ScreenMapWindowController.swift +12 -4
  52. package/app/Sources/SettingsView.swift +869 -152
  53. package/app/Sources/SystemTelemetryMonitor.swift +273 -0
  54. package/app/Sources/VoiceCommandWindow.swift +23 -2
  55. package/app/Sources/WindowDragSnapController.swift +628 -0
  56. package/app/Sources/WindowTiler.swift +328 -65
  57. package/app/Sources/WorkspaceManager.swift +288 -0
  58. package/bin/assistant-intelligence.ts +874 -0
  59. package/bin/handsoff-infer.ts +16 -209
  60. package/bin/handsoff-worker.ts +45 -258
  61. package/bin/lattices-app.ts +65 -1
  62. package/bin/lattices-dev +4 -0
  63. package/bin/lattices.ts +125 -14
  64. package/docs/agents.md +14 -0
  65. package/docs/api.md +55 -0
  66. package/docs/app.md +3 -0
  67. package/docs/companion-deck.md +180 -0
  68. package/docs/config.md +25 -0
  69. package/docs/tiling-reference.md +55 -0
  70. package/docs/voice-error-model.md +73 -0
  71. package/package.json +4 -2
@@ -0,0 +1,61 @@
1
+ import Foundation
2
+
3
+ enum LatticesRuntime {
4
+ static var cliRoot: String? {
5
+ if let idx = CommandLine.arguments.firstIndex(of: "--lattices-cli-root"),
6
+ CommandLine.arguments.indices.contains(idx + 1) {
7
+ let root = CommandLine.arguments[idx + 1]
8
+ if hasAppHelper(in: root) { return root }
9
+ }
10
+
11
+ let bundleDerivedRoot = Bundle.main.bundleURL
12
+ .deletingLastPathComponent()
13
+ .deletingLastPathComponent()
14
+ .path
15
+ if hasAppHelper(in: bundleDerivedRoot) {
16
+ return bundleDerivedRoot
17
+ }
18
+
19
+ let devRoot = NSHomeDirectory() + "/dev/lattices"
20
+ if hasAppHelper(in: devRoot) {
21
+ return devRoot
22
+ }
23
+
24
+ return nil
25
+ }
26
+
27
+ static var appHelperScriptPath: String? {
28
+ guard let cliRoot else { return nil }
29
+ let path = cliRoot + "/bin/lattices-app.ts"
30
+ return FileManager.default.fileExists(atPath: path) ? path : nil
31
+ }
32
+
33
+ static var bunPath: String? {
34
+ let candidates = [
35
+ NSHomeDirectory() + "/.bun/bin/bun",
36
+ "/usr/local/bin/bun",
37
+ "/opt/homebrew/bin/bun",
38
+ ]
39
+ if let path = candidates.first(where: { FileManager.default.isExecutableFile(atPath: $0) }) {
40
+ return path
41
+ }
42
+
43
+ let resolved = ProcessQuery.shell(["/bin/zsh", "-lc", "command -v bun 2>/dev/null"])
44
+ if !resolved.isEmpty, FileManager.default.isExecutableFile(atPath: resolved) {
45
+ return resolved
46
+ }
47
+
48
+ return nil
49
+ }
50
+
51
+ static var appVersion: String {
52
+ let info = Bundle.main.infoDictionary
53
+ return (info?["CFBundleShortVersionString"] as? String)
54
+ ?? (info?["CFBundleVersion"] as? String)
55
+ ?? "unknown"
56
+ }
57
+
58
+ private static func hasAppHelper(in root: String) -> Bool {
59
+ FileManager.default.fileExists(atPath: root + "/bin/lattices-app.ts")
60
+ }
61
+ }