Skip to content

Commit 3e6593d

Browse files
committed
📝 Dewey-driven docs overhaul: fix drift, add missing endpoints, restructure
- Add exports map to package.json so @arach/lattices/daemon-client resolves - Fix all import paths from 'lattices/...' to '@arach/lattices/...' - Add 6 missing API endpoints: processes.list/tree, terminals.list/search, api.schema, layout.distribute - Fix event data shapes (windows.changed, tmux.changed) to match source - Add 4th event (processes.changed), correct counts to 26 methods / 4 events - Add left-third, center-third, right-third tile positions across all docs - Add API method index table and error handling example - Fix timeout default (3000ms not 5000ms) - Restructure Concepts glossary from 9 h3s to a single table - Remove duplicate h1 titles from all 7 doc pages - Update quickstart install to npm install -g @arach/lattices
1 parent 10f025c commit 3e6593d

8 files changed

Lines changed: 275 additions & 154 deletions

File tree

docs/api.md

Lines changed: 227 additions & 36 deletions
Large diffs are not rendered by default.

docs/app.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ description: Command palette, window tiling, and session management
44
order: 3
55
---
66

7-
# Menu Bar App
8-
97
The lattices menu bar app is a native macOS companion that lives in your
108
menu bar and gives you quick access to all your lattices sessions.
119

@@ -125,6 +123,9 @@ frontmost window.
125123
| Bottom Left | Bottom-left quarter |
126124
| Bottom Right | Bottom-right quarter |
127125
| Maximize | Full visible screen |
126+
| Left Third | Left third |
127+
| Center Third | Center third |
128+
| Right Third | Right third |
128129
| Center | 70% width, 80% height, centered |
129130

130131
## Space navigation
@@ -215,7 +216,7 @@ lattices daemon status
215216
Or programmatically:
216217

217218
```js
218-
import { isDaemonRunning, daemonCall } from 'lattices/daemon-client'
219+
import { isDaemonRunning, daemonCall } from '@arach/lattices/daemon-client'
219220

220221
if (await isDaemonRunning()) {
221222
const status = await daemonCall('daemon.status')
@@ -225,10 +226,10 @@ if (await isDaemonRunning()) {
225226

226227
### What it provides
227228

228-
- **20 RPC methods** — read windows, sessions, projects, spaces, layers;
229+
- **26 RPC methods** — read windows, sessions, projects, spaces, layers, processes, terminals;
229230
launch/kill/sync sessions; tile/focus/move windows; switch layers;
230231
manage tab groups
231-
- **3 real-time events**`windows.changed`, `tmux.changed`,
232+
- **4 real-time events**`windows.changed`, `tmux.changed`, `processes.changed`,
232233
`layer.switched` — broadcast to all connected clients
233234
- **Window tracking** — the daemon monitors the desktop window list
234235
and correlates windows to lattices sessions via title tags

docs/concepts.md

Lines changed: 19 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -4,84 +4,20 @@ description: Core ideas, glossary, and architecture of lattices
44
order: 1
55
---
66

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-
217
## Glossary
228

23-
### Daemon
24-
The lattices daemon is a WebSocket server (`ws://127.0.0.1:9399`) that
25-
runs inside the menu bar app. It exposes 20 RPC methods and 3 real-time
26-
events, giving scripts and AI agents full programmatic control over
27-
sessions, windows, layers, and projects. See the
28-
[API reference](/docs/api).
29-
30-
### Agent
31-
Any program that calls the daemon API to control the workspace
32-
autonomously — an AI coding agent, a shell script, a CI pipeline,
33-
or a custom tool. Agents can discover projects, launch sessions, tile
34-
windows, switch layers, and react to real-time events without human
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+
| **Session** | A persistent tmux workspace that lives in the background. Survives terminal crashes, disconnects, and closing your laptop. One session per project. |
12+
| **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. |
13+
| **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. |
14+
| **Daemon** | WebSocket server (`ws://127.0.0.1:9399`) inside the menu bar app. Exposes 26 RPC methods and 4 real-time events for programmatic control. See the [API reference](/docs/api). |
15+
| **Agent** | Any program that calls the daemon API autonomously — an AI coding agent, a shell script, a CI pipeline, or a custom tool. |
16+
| **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. |
17+
| **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`. |
18+
| **Command Palette** | The menu bar app's primary interface (**Cmd+Shift+M**). Searchable list of actions: launch, tile, sync, restart, settings. |
19+
| **Window Tiling** | Snap terminal windows to preset screen positions (halves, quarters, thirds, maximize, center). Works from the CLI (`lattices tile`) or the command palette. |
20+
| **tmux** | Terminal multiplexer — the engine behind lattices. Manages sessions, panes, and layouts. lattices configures it for you. |
8521

8622
## How it works
8723

@@ -98,7 +34,7 @@ Tiling uses AppleScript bounds and respects the menu bar and dock.
9834

9935
```
10036
┌─────────────────────────────┐
101-
│ AI Agents / Scripts │ ← daemon API: 20 RPC methods, real-time events
37+
│ AI Agents / Scripts │ ← daemon API: 26 RPC methods, real-time events
10238
├─────────────────────────────┤
10339
│ Menu bar app (Swift/AppKit)│ ← GUI: command palette, tiling, project list
10440
├─────────────────────────────┤
@@ -184,27 +120,16 @@ agents the same capabilities as a human using the menu bar app:
184120
- **Discover** — list projects, sessions, windows, and Spaces
185121
- **Launch** — start sessions for any scanned project
186122
- **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
123+
- **Monitor** — subscribe to `windows.changed`, `tmux.changed`,
124+
`layer.switched`, and `processes.changed` events for real-time
125+
workspace awareness
189126
- **Recover** — sync sessions back to their declared config, restart
190127
failed panes
191128

192129
An orchestrator agent can set up an entire multi-project workspace in
193-
a few calls:
194-
195-
```js
196-
import { daemonCall } from 'lattices/daemon-client'
197-
198-
await daemonCall('session.launch', { path: '/Users/you/dev/frontend' })
199-
await daemonCall('session.launch', { path: '/Users/you/dev/api' })
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-
```
205-
206-
See the [Daemon API reference](/docs/api) for the full method list,
207-
event shapes, and integration patterns.
130+
a few `daemonCall()` invocations — launching sessions, tiling windows,
131+
and switching layers. See the [Daemon API reference](/docs/api) for the
132+
full method list, code examples, and integration patterns.
208133

209134
## Key shortcuts (inside tmux)
210135

docs/config.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ description: CLI commands, .lattices.json format, and tile positions
44
order: 2
55
---
66

7-
# Configuration
8-
97
## .lattices.json
108

119
Place a `.lattices.json` file in your project root to define your
@@ -225,6 +223,9 @@ screen position. Available positions:
225223
| `bottom-left` | Bottom-left quarter |
226224
| `bottom-right` | Bottom-right quarter |
227225
| `maximize` | Full screen (visible area) |
226+
| `left-third` | Left third |
227+
| `center-third` | Center third |
228+
| `right-third` | Right third |
228229
| `center` | 70% width, 80% height, centered |
229230

230231
Aliases: `left-half`/`left`, `right-half`/`right`, `top-half`/`top`,

docs/layers.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ description: Group projects into switchable layers and tabbed groups
44
order: 4
55
---
66

7-
# Workspace Layers & Tab Groups
8-
97
Two ways to organize related projects in `~/.lattices/workspace.json`:
108

119
- **Layers** — switchable contexts that focus and tile windows
@@ -192,8 +190,9 @@ Each project entry must have either `path` or `group`, not both.
192190
### Tile values
193191

194192
Any tile position from the [config reference](/docs/config#tile-positions)
195-
works: `left`, `right`, `top-left`, `top-right`, `bottom-left`,
196-
`bottom-right`, `maximize`, `center`.
193+
works: `left`, `right`, `top`, `bottom`, `top-left`, `top-right`,
194+
`bottom-left`, `bottom-right`, `left-third`, `center-third`,
195+
`right-third`, `maximize`, `center`.
197196

198197
### Switching layers
199198

@@ -219,7 +218,7 @@ The app remembers which layer was last active across restarts.
219218
Agents and scripts can switch layers via the daemon API:
220219

221220
```js
222-
import { daemonCall } from 'lattices/daemon-client'
221+
import { daemonCall } from '@arach/lattices/daemon-client'
223222

224223
// List available layers
225224
const { layers, active } = await daemonCall('layers.list')

docs/overview.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ description: What lattices is and who it's for
44
order: 0
55
---
66

7-
# Overview
8-
97
lattices is a macOS developer workspace manager. It pairs tmux sessions
108
with a native menu bar app to give you — and your AI coding agents —
119
full control over terminal layouts, window tiling, and project navigation.
@@ -24,7 +22,7 @@ lattices solves both sides:
2422
- **For you** — run `lattices` in any project to get a pre-configured
2523
tmux session. Use the menu bar app to launch, tile, and navigate
2624
sessions with a command palette.
27-
- **For agents** — the daemon API exposes 20 RPC methods over WebSocket.
25+
- **For agents** — the daemon API exposes 26 RPC methods over WebSocket.
2826
Agents can discover projects, launch sessions, tile windows, and
2927
switch workspace layers programmatically.
3028

@@ -34,20 +32,20 @@ lattices solves both sides:
3432
|-----------|-------------|
3533
| **CLI** (`lattices`) | Create, manage, and tile tmux sessions from the terminal |
3634
| **Menu bar app** | Native macOS companion with command palette, tiling, and project discovery |
37-
| **Daemon API** | WebSocket server on `ws://127.0.0.1:9399`20 methods, 3 real-time events |
35+
| **Daemon API** | WebSocket server on `ws://127.0.0.1:9399`26 methods, 4 real-time events |
3836
| **Node.js client** | Zero-dependency `daemonCall()` helper for scripting |
3937

4038
## Quick taste
4139

4240
```bash
4341
# Launch a workspace (auto-detects your project)
4442
cd ~/my-project && lattices
45-
46-
# Or give agents programmatic control
4743
```
4844

45+
Agents get the same control programmatically:
46+
4947
```js
50-
import { daemonCall } from 'lattices/daemon-client'
48+
import { daemonCall } from '@arach/lattices/daemon-client'
5149

5250
await daemonCall('session.launch', { path: '/Users/you/dev/frontend' })
5351
await daemonCall('window.tile', { session: 'frontend-a1b2c3', position: 'left' })

docs/quickstart.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ description: Install lattices and launch your first workspace in 2 minutes
44
order: 0.5
55
---
66

7-
# Quickstart
8-
97
Get from zero to a running workspace in five steps.
108

119
## 1. Install tmux
@@ -19,10 +17,14 @@ Skip if you already have it (`tmux -V` to check).
1917
## 2. Install lattices
2018

2119
```bash
22-
# Clone and link
20+
npm install -g @arach/lattices
21+
```
22+
23+
Or install from source:
24+
25+
```bash
2326
git clone https://github.com/arach/lattices
24-
cd lattices
25-
bun link
27+
cd lattices && npm link
2628
```
2729

2830
Verify: `lattices help` should print usage info.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
"url": "https://github.com/arach/lattices"
2121
},
2222
"license": "MIT",
23+
"exports": {
24+
".": "./bin/lattices.js",
25+
"./daemon-client": "./bin/daemon-client.js"
26+
},
2327
"scripts": {
2428
"dev": "bun --cwd docs-site dev"
2529
},

0 commit comments

Comments
 (0)