@arach/lattices 0.1.0 → 0.2.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.
- package/README.md +101 -90
- package/app/Sources/ActionRow.swift +61 -0
- package/app/Sources/App.swift +1 -40
- package/app/Sources/AppDelegate.swift +154 -24
- package/app/Sources/CheatSheetHUD.swift +1 -0
- package/app/Sources/CommandModeState.swift +40 -19
- package/app/Sources/CommandModeView.swift +27 -2
- package/app/Sources/DaemonServer.swift +8 -0
- package/app/Sources/DiagnosticLog.swift +19 -1
- package/app/Sources/EventBus.swift +1 -0
- package/app/Sources/HotkeyManager.swift +1 -0
- package/app/Sources/HotkeyStore.swift +9 -1
- package/app/Sources/LatticesApi.swift +210 -0
- package/app/Sources/MainView.swift +46 -86
- package/app/Sources/MainWindow.swift +13 -0
- package/app/Sources/OcrModel.swift +309 -0
- package/app/Sources/OcrStore.swift +295 -0
- package/app/Sources/OmniSearchState.swift +283 -0
- package/app/Sources/OmniSearchView.swift +288 -0
- package/app/Sources/OmniSearchWindow.swift +105 -0
- package/app/Sources/PaletteCommand.swift +11 -1
- package/app/Sources/PermissionChecker.swift +12 -2
- package/app/Sources/Preferences.swift +44 -0
- package/app/Sources/ScreenMapState.swift +7 -17
- package/app/Sources/ScreenMapView.swift +3 -0
- package/app/Sources/SettingsView.swift +534 -122
- package/app/Sources/Theme.swift +39 -0
- package/app/Sources/WindowTiler.swift +59 -56
- package/bin/lattices-app.js +23 -7
- package/bin/lattices.js +123 -0
- package/docs/api.md +390 -249
- package/docs/app.md +75 -28
- package/docs/concepts.md +45 -136
- package/docs/config.md +8 -7
- package/docs/layers.md +16 -18
- package/docs/ocr.md +185 -0
- package/docs/overview.md +39 -34
- package/docs/quickstart.md +34 -35
- package/package.json +6 -2
package/docs/app.md
CHANGED
|
@@ -4,10 +4,8 @@ description: Command palette, window tiling, and session management
|
|
|
4
4
|
order: 3
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
The lattices menu bar app is a native macOS companion that lives in your
|
|
10
|
-
menu bar and gives you quick access to all your lattices sessions.
|
|
7
|
+
The lattices menu bar app sits in your menu bar and controls your
|
|
8
|
+
workspace from there.
|
|
11
9
|
|
|
12
10
|
## Installation
|
|
13
11
|
|
|
@@ -94,15 +92,11 @@ For each project found, the app reads:
|
|
|
94
92
|
|
|
95
93
|
## Session management
|
|
96
94
|
|
|
97
|
-
The app calls the lattices CLI for session operations
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
- **Restart** — runs `lattices restart <pane>` to kill and re-run a
|
|
103
|
-
specific pane's process
|
|
104
|
-
- **Detach** — calls `tmux detach-client` directly
|
|
105
|
-
- **Kill** — calls `tmux kill-session` directly
|
|
95
|
+
The app calls the lattices CLI for session operations. Launch runs
|
|
96
|
+
`lattices` in the project directory, Sync runs `lattices sync` to
|
|
97
|
+
reconcile panes, and Restart runs `lattices restart <pane>` to kill
|
|
98
|
+
and re-run a pane's process. Detach and Kill call `tmux detach-client`
|
|
99
|
+
and `tmux kill-session` directly.
|
|
106
100
|
|
|
107
101
|
## Window tiling
|
|
108
102
|
|
|
@@ -125,6 +119,9 @@ frontmost window.
|
|
|
125
119
|
| Bottom Left | Bottom-left quarter |
|
|
126
120
|
| Bottom Right | Bottom-right quarter |
|
|
127
121
|
| Maximize | Full visible screen |
|
|
122
|
+
| Left Third | Left third |
|
|
123
|
+
| Center Third | Center third |
|
|
124
|
+
| Right Third | Right third |
|
|
128
125
|
| Center | 70% width, 80% height, centered |
|
|
129
126
|
|
|
130
127
|
## Space navigation
|
|
@@ -144,7 +141,7 @@ When a window is found and focused, the app flashes a green border
|
|
|
144
141
|
highlight around it for ~1 second so you can spot it immediately.
|
|
145
142
|
|
|
146
143
|
Grant Screen Recording and Accessibility permissions in System
|
|
147
|
-
Settings > Privacy & Security for
|
|
144
|
+
Settings > Privacy & Security for all three paths to work.
|
|
148
145
|
|
|
149
146
|
## Settings
|
|
150
147
|
|
|
@@ -200,6 +197,57 @@ links to open the full `config.md` and `concepts.md` docs.
|
|
|
200
197
|
can't be targeted. "frontmost" means tiling applies to whatever
|
|
201
198
|
window is in front.
|
|
202
199
|
|
|
200
|
+
## Screen OCR
|
|
201
|
+
|
|
202
|
+
> See [Screen OCR](/docs/ocr) for full details on configuration, scanning,
|
|
203
|
+
> search, and agent usage.
|
|
204
|
+
|
|
205
|
+
The app reads text from visible windows using Apple's Vision framework
|
|
206
|
+
and stores results in a local SQLite database with FTS5 full-text search.
|
|
207
|
+
Agents can use this to "see" what's on screen.
|
|
208
|
+
|
|
209
|
+
### How it works
|
|
210
|
+
|
|
211
|
+
1. Every 60 seconds, the app captures the top visible windows as images
|
|
212
|
+
2. A SHA256 hash detects whether the window content has changed
|
|
213
|
+
3. Changed windows are processed through `VNRecognizeTextRequest` (fast mode)
|
|
214
|
+
4. Results are stored in `~/.lattices/ocr.db` with full-text indexing
|
|
215
|
+
5. Entries older than 3 days are automatically purged
|
|
216
|
+
|
|
217
|
+
### Desktop Inventory integration
|
|
218
|
+
|
|
219
|
+
The Desktop Inventory view (Hyper+4) uses OCR to make windows searchable
|
|
220
|
+
by their content — not just by title or app name. When you type a search
|
|
221
|
+
query, windows matching by OCR content show contextual snippets.
|
|
222
|
+
|
|
223
|
+
### API access
|
|
224
|
+
|
|
225
|
+
Agents can query OCR data through four daemon endpoints:
|
|
226
|
+
|
|
227
|
+
| Method | Description |
|
|
228
|
+
|----------------|------------------------------------------------|
|
|
229
|
+
| `ocr.snapshot` | Current OCR results for all visible windows |
|
|
230
|
+
| `ocr.search` | Full-text search across history (FTS5 syntax) |
|
|
231
|
+
| `ocr.history` | Timeline of OCR results for a specific window |
|
|
232
|
+
| `ocr.scan` | Trigger an immediate scan (bypasses timer) |
|
|
233
|
+
|
|
234
|
+
```js
|
|
235
|
+
import { daemonCall } from '@arach/lattices/daemon-client'
|
|
236
|
+
|
|
237
|
+
// Find windows showing error messages
|
|
238
|
+
const errors = await daemonCall('ocr.search', { query: 'error OR failed' })
|
|
239
|
+
|
|
240
|
+
// Read what's currently on screen
|
|
241
|
+
const snapshot = await daemonCall('ocr.snapshot')
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
More in the [Daemon API reference](/docs/api#ocrsnapshot).
|
|
245
|
+
|
|
246
|
+
### Requirements
|
|
247
|
+
|
|
248
|
+
- **Screen Recording** permission — required to capture window images
|
|
249
|
+
- Granted via System Settings > Privacy & Security > Screen Recording
|
|
250
|
+
|
|
203
251
|
## Daemon
|
|
204
252
|
|
|
205
253
|
The menu bar app runs a WebSocket daemon on `ws://127.0.0.1:9399`.
|
|
@@ -215,7 +263,7 @@ lattices daemon status
|
|
|
215
263
|
Or programmatically:
|
|
216
264
|
|
|
217
265
|
```js
|
|
218
|
-
import { isDaemonRunning, daemonCall } from 'lattices/daemon-client'
|
|
266
|
+
import { isDaemonRunning, daemonCall } from '@arach/lattices/daemon-client'
|
|
219
267
|
|
|
220
268
|
if (await isDaemonRunning()) {
|
|
221
269
|
const status = await daemonCall('daemon.status')
|
|
@@ -225,23 +273,22 @@ if (await isDaemonRunning()) {
|
|
|
225
273
|
|
|
226
274
|
### What it provides
|
|
227
275
|
|
|
228
|
-
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
-
|
|
232
|
-
`layer.switched`
|
|
233
|
-
-
|
|
234
|
-
|
|
235
|
-
-
|
|
276
|
+
- 30 RPC methods for reading windows, sessions, projects, spaces, layers,
|
|
277
|
+
processes, terminals, and OCR. Also launching/killing sessions, tiling
|
|
278
|
+
windows, switching layers, and managing tab groups.
|
|
279
|
+
- 5 real-time events (`windows.changed`, `tmux.changed`, `processes.changed`,
|
|
280
|
+
`layer.switched`, `ocr.scanComplete`) broadcast to all connected clients.
|
|
281
|
+
- Window tracking that monitors the desktop window list and correlates
|
|
282
|
+
windows to lattices sessions via title tags.
|
|
283
|
+
- Space awareness, so it knows which macOS Space each window is on.
|
|
236
284
|
|
|
237
285
|
### Security
|
|
238
286
|
|
|
239
|
-
The daemon binds to
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
designed for local automation, not remote access.
|
|
287
|
+
The daemon binds to localhost only (`127.0.0.1:9399`). Not accessible
|
|
288
|
+
from the network. No authentication, so any local process can connect.
|
|
289
|
+
This is intentional. It's for local automation, not remote access.
|
|
243
290
|
|
|
244
|
-
|
|
291
|
+
Full method list in the [Daemon API reference](/docs/api).
|
|
245
292
|
|
|
246
293
|
## Diagnostics
|
|
247
294
|
|
package/docs/concepts.md
CHANGED
|
@@ -1,124 +1,51 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Concepts
|
|
3
3
|
description: Core ideas, glossary, and architecture of lattices
|
|
4
|
-
order:
|
|
4
|
+
order: 6
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Concepts
|
|
8
|
-
|
|
9
|
-
## What is lattices?
|
|
10
|
-
|
|
11
|
-
lattices is a developer workspace launcher. It creates pre-configured
|
|
12
|
-
terminal layouts for your projects using tmux, so you can go from
|
|
13
|
-
"I want to work on X" to a full development environment in one click.
|
|
14
|
-
|
|
15
|
-
It has two parts:
|
|
16
|
-
|
|
17
|
-
1. **CLI** (`lattices`) — creates and manages tmux sessions from the terminal
|
|
18
|
-
2. **Menu bar app** — a native macOS companion for launching, tiling,
|
|
19
|
-
and navigating sessions with a command palette
|
|
20
|
-
|
|
21
7
|
## Glossary
|
|
22
8
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
interaction.
|
|
36
|
-
|
|
37
|
-
### Session
|
|
38
|
-
A tmux session is a persistent workspace that lives in the background.
|
|
39
|
-
It survives terminal crashes, disconnects, and even closing your laptop.
|
|
40
|
-
Think of it as a virtual desktop for a single project.
|
|
41
|
-
|
|
42
|
-
### Pane
|
|
43
|
-
A pane is a single terminal view inside a session. A typical lattices
|
|
44
|
-
setup has two panes side by side — one running Claude Code and one
|
|
45
|
-
running your dev server. You can have up to four or more.
|
|
46
|
-
|
|
47
|
-
### Attach / Detach
|
|
48
|
-
Attaching connects your terminal window to an existing session.
|
|
49
|
-
Detaching disconnects your terminal but keeps the session alive.
|
|
50
|
-
Your dev server keeps running, Claude keeps thinking — nothing is lost.
|
|
51
|
-
|
|
52
|
-
### tmux
|
|
53
|
-
tmux (terminal multiplexer) is the engine behind lattices. It manages
|
|
54
|
-
sessions, panes, and layouts. lattices configures tmux for you so you
|
|
55
|
-
don't need to learn tmux commands — but knowing a few shortcuts helps.
|
|
56
|
-
|
|
57
|
-
### Multiplexer
|
|
58
|
-
A program that lets you run multiple terminal sessions inside a single
|
|
59
|
-
window and switch between them. tmux is the most popular one.
|
|
60
|
-
|
|
61
|
-
### Sync / Reconcile
|
|
62
|
-
Sync (`lattices sync`) brings a running session back in line with its
|
|
63
|
-
declared config. It recreates missing panes, re-applies the layout,
|
|
64
|
-
restores labels, and re-runs commands in idle panes. Useful when a pane
|
|
65
|
-
was accidentally killed but you don't want to restart the whole session.
|
|
66
|
-
|
|
67
|
-
### Ensure / Prefill
|
|
68
|
-
Two modes for restoring exited commands when you reattach to a session:
|
|
69
|
-
|
|
70
|
-
- **Ensure** — automatically re-runs the command (hands-free recovery)
|
|
71
|
-
- **Prefill** — types the command into the pane but waits for you to
|
|
72
|
-
press Enter (manual confirmation)
|
|
73
|
-
|
|
74
|
-
Set via `"ensure": true` or `"prefill": true` in `.lattices.json`.
|
|
75
|
-
|
|
76
|
-
### Command Palette
|
|
77
|
-
The menu bar app's primary interface, opened with **Cmd+Shift+M**.
|
|
78
|
-
A searchable list of actions: launch/attach projects, tile windows,
|
|
79
|
-
sync sessions, restart panes, open settings.
|
|
80
|
-
|
|
81
|
-
### Window Tiling
|
|
82
|
-
Both the CLI (`lattices tile`) and the menu bar app can snap terminal
|
|
83
|
-
windows to preset screen positions (halves, quarters, maximize, center).
|
|
84
|
-
Tiling uses AppleScript bounds and respects the menu bar and dock.
|
|
9
|
+
| Term | Definition |
|
|
10
|
+
|------|------------|
|
|
11
|
+
| **Command Palette** | The menu bar app's primary interface (**Cmd+Shift+M**). Searchable list of actions: launch, tile, sync, restart, settings. |
|
|
12
|
+
| **Window Tiling** | Snap terminal windows to preset screen positions (halves, quarters, thirds, maximize, center). Works from the CLI (`lattices tile`) or the command palette. |
|
|
13
|
+
| **Daemon** | WebSocket server (`ws://127.0.0.1:9399`) inside the menu bar app. Exposes 30 RPC methods and 5 real-time events for programmatic control. See the [API reference](/docs/api). |
|
|
14
|
+
| **Agent** | Any program that calls the daemon API autonomously — an AI coding agent, a shell script, a CI pipeline, or a custom tool. |
|
|
15
|
+
| **Session** | A persistent tmux workspace that lives in the background. Survives terminal crashes, disconnects, and closing your laptop. One session per project. Requires tmux. |
|
|
16
|
+
| **Pane** | A single terminal view inside a session. A typical setup has two panes side by side — Claude Code on the left, dev server on the right. Requires tmux. |
|
|
17
|
+
| **Attach / Detach** | Attaching connects your terminal to an existing session. Detaching disconnects but keeps the session alive — your dev server keeps running, Claude keeps thinking. Requires tmux. |
|
|
18
|
+
| **Sync / Reconcile** | `lattices sync` brings a running session back in line with its declared config — recreates missing panes, re-applies layout, restores labels, re-runs commands in idle panes. Requires tmux. |
|
|
19
|
+
| **Ensure / Prefill** | Two modes for restoring exited commands on reattach. **Ensure** auto-reruns the command. **Prefill** types it but waits for you to press Enter. Set via `.lattices.json`. Requires tmux. |
|
|
20
|
+
| **tmux** | Terminal multiplexer (optional). Provides persistent sessions, pane layouts, and command restoration. Install with `brew install tmux` if you want session management. |
|
|
85
21
|
|
|
86
22
|
## How it works
|
|
87
23
|
|
|
88
24
|
1. You create a `.lattices.json` file in your project root (or run `lattices init`)
|
|
89
|
-
2.
|
|
90
|
-
3.
|
|
91
|
-
4.
|
|
92
|
-
|
|
93
|
-
|
|
25
|
+
2. The menu bar app discovers the project and adds it to the command palette
|
|
26
|
+
3. You can tile windows, switch layers, search via OCR, and use the daemon API
|
|
27
|
+
4. With tmux installed, `lattices` also creates persistent terminal sessions:
|
|
28
|
+
- Each pane gets its command (claude, dev server, tests, etc.)
|
|
29
|
+
- The session persists in the background until you kill it
|
|
30
|
+
- You can attach/detach from any terminal at any time
|
|
31
|
+
- If `ensure` is enabled, exited commands auto-restart on reattach
|
|
94
32
|
|
|
95
33
|
## Architecture
|
|
96
34
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
- The **CLI** talks to tmux directly via `tmux` shell commands.
|
|
112
|
-
- The **menu bar app** calls the CLI binary for session operations
|
|
113
|
-
(launch, sync, restart) and uses tmux directly for status checks
|
|
114
|
-
(has-session, list-panes). It also runs the **daemon** — a WebSocket
|
|
115
|
-
server on `ws://127.0.0.1:9399`.
|
|
116
|
-
- **Agents and scripts** connect to the daemon over WebSocket and can
|
|
117
|
-
do everything the app and CLI can do: discover projects, launch
|
|
118
|
-
sessions, tile windows, switch layers, and subscribe to real-time
|
|
119
|
-
events.
|
|
120
|
-
- All layers share the same session naming convention so they always
|
|
121
|
-
agree on which session belongs to which project.
|
|
35
|
+
<img src="/architecture.svg" alt="lattices architecture diagram" style="margin: 2rem 0; max-width: 100%;" />
|
|
36
|
+
|
|
37
|
+
- The menu bar app is the core. It provides the command palette,
|
|
38
|
+
window tiling, OCR, project discovery, and the daemon (a WebSocket
|
|
39
|
+
server on `ws://127.0.0.1:9399`). It works with or without tmux.
|
|
40
|
+
- The CLI handles tiling, OCR queries, and (when tmux is installed)
|
|
41
|
+
session management via `tmux` shell commands.
|
|
42
|
+
- Agents and scripts connect to the daemon over WebSocket. They can
|
|
43
|
+
do everything the app and CLI can do: discover projects, tile windows,
|
|
44
|
+
switch layers, read on-screen text, and subscribe to real-time events.
|
|
45
|
+
- When tmux is installed, the app and CLI can also launch, sync, and
|
|
46
|
+
manage persistent terminal sessions. All layers share the same session
|
|
47
|
+
naming convention so they always agree on which session belongs to
|
|
48
|
+
which project.
|
|
122
49
|
|
|
123
50
|
### Session naming
|
|
124
51
|
|
|
@@ -135,7 +62,7 @@ Both the CLI (Node.js `crypto.createHash`) and the app (Swift
|
|
|
135
62
|
|
|
136
63
|
### Window discovery via title tags
|
|
137
64
|
|
|
138
|
-
When lattices creates a session, it sets the tmux option:
|
|
65
|
+
When lattices creates a tmux session, it sets the tmux option:
|
|
139
66
|
|
|
140
67
|
```
|
|
141
68
|
set-titles-string "[lattices:<session-name>] #{pane_title}"
|
|
@@ -164,7 +91,7 @@ It uses private SkyLight framework APIs loaded at runtime via `dlopen`:
|
|
|
164
91
|
This is the same approach used by [Loop](https://github.com/MrKai77/Loop)
|
|
165
92
|
and other macOS window managers.
|
|
166
93
|
|
|
167
|
-
### Ensure/prefill restoration
|
|
94
|
+
### Ensure/prefill restoration (requires tmux)
|
|
168
95
|
|
|
169
96
|
When you run `lattices` (no arguments) and a session already exists:
|
|
170
97
|
|
|
@@ -176,35 +103,17 @@ When you run `lattices` (no arguments) and a session already exists:
|
|
|
176
103
|
- **prefill**: sends the command without Enter (manual restart)
|
|
177
104
|
4. Then it attaches to the session as normal
|
|
178
105
|
|
|
179
|
-
##
|
|
180
|
-
|
|
181
|
-
lattices is designed for programmatic control. The daemon API gives
|
|
182
|
-
agents the same capabilities as a human using the menu bar app:
|
|
183
|
-
|
|
184
|
-
- **Discover** — list projects, sessions, windows, and Spaces
|
|
185
|
-
- **Launch** — start sessions for any scanned project
|
|
186
|
-
- **Arrange** — tile windows to screen positions, move between Spaces
|
|
187
|
-
- **Monitor** — subscribe to `windows.changed`, `tmux.changed`, and
|
|
188
|
-
`layer.switched` events for real-time workspace awareness
|
|
189
|
-
- **Recover** — sync sessions back to their declared config, restart
|
|
190
|
-
failed panes
|
|
191
|
-
|
|
192
|
-
An orchestrator agent can set up an entire multi-project workspace in
|
|
193
|
-
a few calls:
|
|
106
|
+
## Agent control
|
|
194
107
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const sessions = await daemonCall('tmux.sessions')
|
|
202
|
-
await daemonCall('window.tile', { session: sessions[0].name, position: 'left' })
|
|
203
|
-
await daemonCall('window.tile', { session: sessions[1].name, position: 'right' })
|
|
204
|
-
```
|
|
108
|
+
The daemon API gives agents the same control as a human using the
|
|
109
|
+
menu bar app. An agent can list projects and windows, launch sessions,
|
|
110
|
+
tile windows to screen positions, subscribe to real-time events
|
|
111
|
+
(`windows.changed`, `tmux.changed`, `layer.switched`), and sync
|
|
112
|
+
sessions back to their declared config.
|
|
205
113
|
|
|
206
|
-
|
|
207
|
-
|
|
114
|
+
A typical orchestrator sets up a multi-project workspace in a few
|
|
115
|
+
`daemonCall()` invocations. See the [Daemon API reference](/docs/api)
|
|
116
|
+
for the full method list and code examples.
|
|
208
117
|
|
|
209
118
|
## Key shortcuts (inside tmux)
|
|
210
119
|
|
package/docs/config.md
CHANGED
|
@@ -4,8 +4,6 @@ description: CLI commands, .lattices.json format, and tile positions
|
|
|
4
4
|
order: 2
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Configuration
|
|
8
|
-
|
|
9
7
|
## .lattices.json
|
|
10
8
|
|
|
11
9
|
Place a `.lattices.json` file in your project root to define your
|
|
@@ -128,7 +126,7 @@ Run `lattices init` in your project directory to generate a starter
|
|
|
128
126
|
|----------------------------|--------------------------------------------------|
|
|
129
127
|
| `lattices` | Create or attach to session for current project |
|
|
130
128
|
| `lattices init` | Generate .lattices.json config for this project |
|
|
131
|
-
| `lattices ls` | List active tmux
|
|
129
|
+
| `lattices ls` | List active sessions (requires tmux) |
|
|
132
130
|
| `lattices kill [name]` | Kill a session (defaults to current project) |
|
|
133
131
|
| `lattices sync` | Reconcile session to match declared config |
|
|
134
132
|
| `lattices restart [pane]` | Restart a pane's process (by name or index) |
|
|
@@ -156,14 +154,14 @@ output:
|
|
|
156
154
|
lattices windows --json
|
|
157
155
|
```
|
|
158
156
|
|
|
159
|
-
Returns a JSON array of window objects to stdout
|
|
157
|
+
Returns a JSON array of window objects to stdout, useful for piping
|
|
160
158
|
into `jq` or consuming from scripts.
|
|
161
159
|
|
|
162
160
|
### Daemon responses
|
|
163
161
|
|
|
164
162
|
All daemon API calls return JSON natively. If you need structured data
|
|
165
|
-
from lattices, the daemon is
|
|
166
|
-
|
|
163
|
+
from lattices, the daemon is easier than parsing stdout. See the
|
|
164
|
+
[API reference](/docs/api).
|
|
167
165
|
|
|
168
166
|
### Exit codes
|
|
169
167
|
|
|
@@ -225,10 +223,13 @@ screen position. Available positions:
|
|
|
225
223
|
| `bottom-left` | Bottom-left quarter |
|
|
226
224
|
| `bottom-right` | Bottom-right quarter |
|
|
227
225
|
| `maximize` | Full screen (visible area) |
|
|
226
|
+
| `left-third` | Left third |
|
|
227
|
+
| `center-third` | Center third |
|
|
228
|
+
| `right-third` | Right third |
|
|
228
229
|
| `center` | 70% width, 80% height, centered |
|
|
229
230
|
|
|
230
231
|
Aliases: `left-half`/`left`, `right-half`/`right`, `top-half`/`top`,
|
|
231
232
|
`bottom-half`/`bottom`, `max`/`maximize`.
|
|
232
233
|
|
|
233
|
-
Tiling respects the menu bar and dock
|
|
234
|
+
Tiling respects the menu bar and dock. It uses the visible desktop
|
|
234
235
|
area, not the full screen.
|
package/docs/layers.md
CHANGED
|
@@ -4,8 +4,6 @@ description: Group projects into switchable layers and tabbed groups
|
|
|
4
4
|
order: 4
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Workspace Layers & Tab Groups
|
|
8
|
-
|
|
9
7
|
Two ways to organize related projects in `~/.lattices/workspace.json`:
|
|
10
8
|
|
|
11
9
|
- **Layers** — switchable contexts that focus and tile windows
|
|
@@ -16,8 +14,8 @@ work together.
|
|
|
16
14
|
|
|
17
15
|
## Tab Groups
|
|
18
16
|
|
|
19
|
-
Tab groups let you bundle related projects as tabs
|
|
20
|
-
|
|
17
|
+
Tab groups let you bundle related projects as tabs within a single
|
|
18
|
+
terminal session (requires tmux). This is useful when you have a family
|
|
21
19
|
of projects — like an iOS app, macOS app, website, and API — that
|
|
22
20
|
you think of as one logical unit.
|
|
23
21
|
|
|
@@ -48,11 +46,11 @@ to per-project configs.
|
|
|
48
46
|
|
|
49
47
|
### How it works
|
|
50
48
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
its own standalone session as before
|
|
49
|
+
- Session name follows the pattern `lattices-group-<id>` (e.g. `lattices-group-talkie`)
|
|
50
|
+
- 1 group = 1 tmux session. Each tab is a tmux window, and each window
|
|
51
|
+
gets its own panes from that project's `.lattices.json`
|
|
52
|
+
- You can still launch projects independently: `cd talkie-ios && lattices`
|
|
53
|
+
creates its own standalone session as before
|
|
56
54
|
|
|
57
55
|
### Tab group fields
|
|
58
56
|
|
|
@@ -102,14 +100,13 @@ The command palette also includes group commands:
|
|
|
102
100
|
|
|
103
101
|
## Layers
|
|
104
102
|
|
|
105
|
-
Layers let you group projects into switchable contexts.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
front and tile into position, while the previous layer's windows fall
|
|
103
|
+
Layers let you group projects into switchable contexts. Define two or
|
|
104
|
+
three layers and switch between them. The target layer's windows come
|
|
105
|
+
to the front and tile into position; the previous layer's windows fall
|
|
109
106
|
behind.
|
|
110
107
|
|
|
111
108
|
All tmux sessions stay alive across switches. Nothing is detached or
|
|
112
|
-
killed
|
|
109
|
+
killed. Layers only control which windows are focused.
|
|
113
110
|
|
|
114
111
|
### Configuration
|
|
115
112
|
|
|
@@ -192,8 +189,9 @@ Each project entry must have either `path` or `group`, not both.
|
|
|
192
189
|
### Tile values
|
|
193
190
|
|
|
194
191
|
Any tile position from the [config reference](/docs/config#tile-positions)
|
|
195
|
-
works: `left`, `right`, `top
|
|
196
|
-
`bottom-right`, `
|
|
192
|
+
works: `left`, `right`, `top`, `bottom`, `top-left`, `top-right`,
|
|
193
|
+
`bottom-left`, `bottom-right`, `left-third`, `center-third`,
|
|
194
|
+
`right-third`, `maximize`, `center`.
|
|
197
195
|
|
|
198
196
|
### Switching layers
|
|
199
197
|
|
|
@@ -219,7 +217,7 @@ The app remembers which layer was last active across restarts.
|
|
|
219
217
|
Agents and scripts can switch layers via the daemon API:
|
|
220
218
|
|
|
221
219
|
```js
|
|
222
|
-
import { daemonCall } from 'lattices/daemon-client'
|
|
220
|
+
import { daemonCall } from '@arach/lattices/daemon-client'
|
|
223
221
|
|
|
224
222
|
// List available layers
|
|
225
223
|
const { layers, active } = await daemonCall('layers.list')
|
|
@@ -233,7 +231,7 @@ The `layer.switch` call focuses and tiles all windows in the target
|
|
|
233
231
|
layer, just like the hotkey or command palette. A `layer.switched`
|
|
234
232
|
event is broadcast to all connected clients.
|
|
235
233
|
|
|
236
|
-
|
|
234
|
+
More methods in the [Daemon API reference](/docs/api).
|
|
237
235
|
|
|
238
236
|
### Layer bar
|
|
239
237
|
|