@lattices/cli 0.4.2 → 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 (70) 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/App.swift +10 -0
  7. package/app/Sources/AppDelegate.swift +90 -34
  8. package/app/Sources/AppShellView.swift +2 -0
  9. package/app/Sources/AppTypeClassifier.swift +36 -0
  10. package/app/Sources/AppUpdater.swift +92 -0
  11. package/app/Sources/CheatSheetHUD.swift +1 -0
  12. package/app/Sources/CliActionLauncher.swift +50 -0
  13. package/app/Sources/CommandModeView.swift +4 -24
  14. package/app/Sources/CompanionActivityLog.swift +70 -0
  15. package/app/Sources/CompanionKeyboardController.swift +141 -0
  16. package/app/Sources/DesktopModel.swift +4 -0
  17. package/app/Sources/HandsOffSession.swift +15 -4
  18. package/app/Sources/HomeDashboardView.swift +18 -10
  19. package/app/Sources/HotkeyStore.swift +8 -5
  20. package/app/Sources/IntentEngine.swift +7 -1
  21. package/app/Sources/LatticesApi.swift +125 -4
  22. package/app/Sources/LatticesCompanionBridgeServer.swift +438 -0
  23. package/app/Sources/LatticesCompanionCockpit.swift +555 -0
  24. package/app/Sources/LatticesCompanionSecurityCoordinator.swift +594 -0
  25. package/app/Sources/LatticesCompanionTrackpadController.swift +204 -0
  26. package/app/Sources/LatticesDeckHost.swift +1463 -0
  27. package/app/Sources/LatticesRuntime.swift +61 -0
  28. package/app/Sources/MainView.swift +351 -191
  29. package/app/Sources/MouseFinder.swift +335 -30
  30. package/app/Sources/MouseGestureConfig.swift +364 -0
  31. package/app/Sources/MouseGestureController.swift +1203 -0
  32. package/app/Sources/MouseInputDeviceStore.swift +98 -0
  33. package/app/Sources/MouseInputEventViewer.swift +272 -0
  34. package/app/Sources/MouseShortcutStore.swift +107 -0
  35. package/app/Sources/OmniSearchView.swift +136 -2
  36. package/app/Sources/OmniSearchWindow.swift +65 -5
  37. package/app/Sources/OnboardingView.swift +30 -16
  38. package/app/Sources/PaletteCommand.swift +26 -6
  39. package/app/Sources/PermissionChecker.swift +76 -2
  40. package/app/Sources/PiAuthNextStepCard.swift +148 -0
  41. package/app/Sources/PiAuthPromptCard.swift +90 -0
  42. package/app/Sources/PiChatDock.swift +137 -74
  43. package/app/Sources/PiChatSession.swift +608 -108
  44. package/app/Sources/PiInstallCallout.swift +86 -0
  45. package/app/Sources/PiProviderSetupCallout.swift +99 -0
  46. package/app/Sources/PiWorkspaceView.swift +174 -77
  47. package/app/Sources/Preferences.swift +78 -0
  48. package/app/Sources/ScreenMapState.swift +91 -31
  49. package/app/Sources/ScreenMapView.swift +510 -524
  50. package/app/Sources/ScreenMapWindowController.swift +12 -4
  51. package/app/Sources/SettingsView.swift +869 -152
  52. package/app/Sources/SystemTelemetryMonitor.swift +273 -0
  53. package/app/Sources/VoiceCommandWindow.swift +23 -2
  54. package/app/Sources/WindowDragSnapController.swift +628 -0
  55. package/app/Sources/WindowTiler.swift +328 -65
  56. package/app/Sources/WorkspaceManager.swift +288 -0
  57. package/bin/assistant-intelligence.ts +874 -0
  58. package/bin/handsoff-infer.ts +16 -209
  59. package/bin/handsoff-worker.ts +45 -258
  60. package/bin/lattices-app.ts +62 -0
  61. package/bin/lattices-dev +4 -0
  62. package/bin/lattices.ts +125 -14
  63. package/docs/agents.md +14 -0
  64. package/docs/api.md +55 -0
  65. package/docs/app.md +3 -0
  66. package/docs/companion-deck.md +180 -0
  67. package/docs/config.md +25 -0
  68. package/docs/tiling-reference.md +55 -0
  69. package/docs/voice-error-model.md +73 -0
  70. package/package.json +2 -1
@@ -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
+ }