lattice-talk 0.1.2 → 0.1.3

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 CHANGED
@@ -1,327 +1,134 @@
1
1
  # Lattice Talk
2
2
 
3
- ## Let your AI coding agents work together
3
+ **Let your AI coding agents talk to each other.**
4
4
 
5
- Lattice Talk is a shared communication space for AI coding agents.
5
+ Lattice Talk is a shared communication bus for AI coding agents. It connects agents running in Claude Code, Codex, Cursor, Gemini CLI, Windsurf, and any other MCP-compatible harness — so a frontend agent, a backend agent, and a reviewer can coordinate in real time instead of you copying messages between windows.
6
6
 
7
- It connects agents running in Claude Code, Codex, Cursor, Gemini CLI, Windsurf, and other MCP-compatible tools. Agents can discover one another, send direct messages, talk in named rooms, and share project memory without copying context between windows.
7
+ Everything runs on your own Redis instance. There is no hosted Lattice service and no account to create.
8
8
 
9
- Lattice Talk runs locally and uses your Redis instance as the shared communication layer. It does not require a hosted Lattice account or a central Lattice service.
9
+ ## Quick start
10
10
 
11
- ## Why use Lattice Talk?
11
+ 1. **Open the dashboard** — run `npx -y lattice-talk` in a terminal.
12
+ 2. **Guided setup** — enter your Redis URL, pick a namespace and workspace name, optionally set a join token. The connection is tested before anything is saved.
13
+ 3. **Install into your harnesses** — run `npx -y lattice-talk mcp add claude` (or `codex`, `gemini`, `cursor`, `windsurf`, or `all`).
14
+ 4. **Restart your harness**, then create a room in the dashboard and press `p` to copy the agent prompt — paste it into an agent session and it joins the room and starts talking.
12
15
 
13
- Modern coding workflows often use several agents at the same time:
16
+ That's it. Agents in the same workspace can now DM each other, talk in rooms, and share memory.
14
17
 
15
- - One agent works on the frontend.
16
- - Another agent builds the backend.
17
- - A third agent reviews changes.
18
- - A fourth agent investigates tests or documentation.
18
+ ## What agents can do
19
19
 
20
- Without a shared bus, you must manually copy updates between them. Lattice Talk gives those agents a common workspace where they can coordinate naturally.
20
+ Once connected, each agent gets MCP tools to:
21
21
 
22
- With Lattice Talk, agents can:
22
+ - Join and leave workspaces, and see who else is online
23
+ - Send direct messages to a specific agent
24
+ - Post to and read named rooms
25
+ - **Receive messages instantly** — agents can wait on `pull_messages` and get woken the moment a message is published, rather than polling on a timer
26
+ - Create and join rooms
27
+ - Read and write shared memory and append-only notes
28
+ - Inspect session info and OpenTelemetry trace context
23
29
 
24
- - Find other agents working in the same workspace.
25
- - Send private messages to a specific agent.
26
- - Talk in rooms dedicated to a feature, task, or team.
27
- - Share persistent project memory and notes.
28
- - Coordinate work across processes and machines.
29
- - Keep optional OpenTelemetry traces for debugging and observability.
30
+ ## The dashboard
30
31
 
31
- ## What you get
32
-
33
- ### A friendly terminal dashboard
34
-
35
- The Lattice Talk dashboard lets you:
36
-
37
- - Create named workspaces.
38
- - Create, open, and delete rooms.
39
- - Watch live agent conversations.
40
- - See which agents are currently online.
41
- - Move between rooms without restarting anything.
42
- - Copy a ready-to-use connection prompt for an agent.
43
- - Reconfigure the Redis connection when needed.
44
-
45
- The dashboard is view-only. It observes the bus without joining as an agent, so it does not appear as a participant in your agent list.
46
-
47
- ### MCP tools for agents
48
-
49
- Connected agents receive tools for:
50
-
51
- - Joining and leaving workspaces.
52
- - Discovering peers.
53
- - Sending direct messages.
54
- - Posting and reading room messages.
55
- - Creating and joining rooms.
56
- - Saving and reading shared memory.
57
- - Adding and reading shared notes.
58
- - Reading session and trace information.
59
-
60
- ## Installation
61
-
62
- Lattice Talk supports Windows, macOS, and Linux.
63
-
64
- ### Requirements
65
-
66
- | Requirement | Purpose |
67
- | --- | --- |
68
- | Node.js 20 or newer | Runs the MCP server used by agent harnesses |
69
- | Redis | Shares messages between separate agent processes |
70
- | Bun, or Node.js 26.4 or newer | Runs the interactive terminal dashboard |
71
-
72
- The MCP server works with regular Node.js 20+. The dashboard uses OpenTUI, which currently requires Bun or Node.js 26.4 or newer.
73
-
74
- Redis can run locally, in Docker, on another machine, or through a managed Redis provider. Every agent must be able to reach the same Redis instance.
75
-
76
- ### Recommended user flow
77
-
78
- 1. Install or launch the `lattice-talk` npm package.
79
- 2. Open the guided setup dashboard.
80
- 3. Enter the Redis connection details and choose a workspace.
81
- 4. Add Lattice Talk to one or more agent harnesses.
82
- 5. Open the dashboard to create rooms and monitor conversations.
83
- 6. Use the room prompt when you want another agent to join.
84
-
85
- The setup screen stores user-level settings in the Lattice configuration directory. Environment variables always take priority over saved settings.
86
-
87
- ## Installation options
88
-
89
- ### npm and npx
90
-
91
- For a published npm release, users can launch Lattice Talk through npm or npx without manually cloning the repository. The MCP harness installer generates the correct command for the operating system automatically.
92
-
93
- ### Install from the repository
94
-
95
- For development, testing, or an unreleased version, clone the repository, install dependencies, and build the package locally. The generated MCP configuration can then point to the local package build.
96
-
97
- ## First-time setup
98
-
99
- Start the guided setup from a terminal. It asks for four values:
100
-
101
- ### Redis URL
102
-
103
- The address of the Redis server used by all agents.
104
-
105
- Examples include local Redis, a TLS Redis connection, or a remote Redis provider. If your organization uses separate Redis environment variables instead of a URL, those are also supported.
106
-
107
- ### Namespace
108
-
109
- A namespace separates independent Lattice environments that use the same Redis server.
110
-
111
- For example, you can use one namespace for development, another for staging, and another for a personal workspace. The default namespace is `dev`.
112
-
113
- ### Workspace
114
-
115
- A workspace is the shared session where agents meet. Rooms are created inside the workspace.
116
-
117
- The dashboard lets you switch workspaces or create a new one at any time. Agents should use the same workspace name when joining.
118
-
119
- ### Join token
120
-
121
- A join token is optional. Use one when you want only authorized processes to join or inspect a workspace.
122
-
123
- The token is never accepted through an MCP tool. It must be provided through the local process environment or the saved local configuration.
124
-
125
- ## Adding Lattice Talk to agent harnesses
126
-
127
- Use the MCP installer from the terminal.
128
-
129
- | Command | Purpose |
130
- | --- | --- |
131
- | `mcp add claude` | Add Lattice Talk to Claude Code |
132
- | `mcp add codex` | Add Lattice Talk to Codex |
133
- | `mcp add gemini` | Add Lattice Talk to Gemini CLI |
134
- | `mcp add cursor` | Add Lattice Talk to Cursor |
135
- | `mcp add windsurf` | Add Lattice Talk to Windsurf |
136
- | `mcp add all` | Add Lattice Talk to every supported harness |
137
- | `mcp list` | Show installation status |
138
- | `mcp remove <harness>` | Remove Lattice Talk from one harness |
139
-
140
- The full command prefix is `lattice-talk mcp`.
141
-
142
- The installer updates each harness's existing configuration instead of replacing it. Existing MCP servers and unrelated settings are preserved.
143
-
144
- After installation, restart the affected harness so it reloads its MCP configuration.
145
-
146
- ### Existing credentials are reused
147
-
148
- When you run the installer, it automatically uses the credentials already available from:
149
-
150
- - Your current environment variables.
151
- - Your saved Lattice configuration.
152
- - Your existing Redis host and authentication variables.
153
-
154
- You should not need to enter the Redis password or join token again for every harness. The generated harness configuration receives the resolved values needed by its local Lattice Talk process.
155
-
156
- Credentials are kept out of MCP tool arguments. Treat local harness configuration files as sensitive because they may contain connection credentials.
157
-
158
- ## Using the dashboard
159
-
160
- The dashboard opens in three main areas.
161
-
162
- ### Setup screen
163
-
164
- Use the setup screen to enter or update Redis, namespace, workspace, and join-token settings. Lattice Talk checks the Redis connection before saving the configuration.
32
+ Running `lattice-talk` with no arguments opens the dashboard. It is **view-only** — it watches the bus without joining as an agent, so it never appears in your agent list.
165
33
 
166
34
  ### Rooms screen
167
35
 
168
- The rooms screen shows the rooms in the active workspace and the number of members in each room.
169
-
170
- Available actions include:
171
-
172
36
  | Key | Action |
173
37
  | --- | --- |
174
- | Up / Down or J / K | Move through rooms |
175
- | Enter | Open the selected room |
176
- | N | Create a room |
177
- | D | Delete the selected room |
178
- | P | Show the agent connection prompt |
179
- | W | Switch or create a workspace |
180
- | S | Return to setup |
181
- | Q | Quit the dashboard |
38
+ | `↑` `↓` or `j` `k` | Move through rooms |
39
+ | `Enter` | Open the selected room |
40
+ | `n` | Create a room |
41
+ | `d` | Delete the selected room |
42
+ | `p` | Show the agent connection prompt |
43
+ | `w` | Switch or create a workspace |
44
+ | `s` | Return to setup |
45
+ | `q` | Quit |
182
46
 
183
- Room deletion removes the room's message history, membership list, and room read cursors. It does not delete the workspace or other rooms.
184
-
185
- ### Room screen
186
-
187
- The room screen shows a live feed of messages and an online agent list.
47
+ ### Room screen (live feed)
188
48
 
189
49
  | Key | Action |
190
50
  | --- | --- |
191
- | Left / Right | Move between rooms |
192
- | Up / Down | Scroll the message feed |
193
- | F | Follow the newest messages |
194
- | P | Show the room connection prompt |
195
- | B or Escape | Return to the rooms screen |
51
+ | `←` `→` | Switch between rooms |
52
+ | `↑` `↓` | Scroll the message feed |
53
+ | `f` | Follow the newest messages |
54
+ | `p` | Show the room connection prompt |
55
+ | `b` / `Esc` | Back to rooms |
196
56
 
197
- The dashboard refreshes the live feed automatically. Agents continue working normally while the dashboard is open or closed.
57
+ The feed updates the instant a message is published it subscribes to Redis notifications rather than polling — and shows every agent's online status live.
198
58
 
199
59
  ### Connection prompts
200
60
 
201
- Each room can generate a prompt that explains how an agent should connect to the workspace and room.
61
+ Every room can generate a ready-to-paste prompt telling an agent exactly how to join the workspace and room. The prompt never contains your Redis password or join token — for protected workspaces it just tells the agent its process needs the matching `LATTICE_JOIN_TOKEN`.
202
62
 
203
- The prompt does not contain your Redis password or join token. If the workspace is protected, it tells the agent that its MCP process needs the matching local join-token environment variable.
63
+ ## Commands
204
64
 
205
- ## Configuration
65
+ | Command | What it does |
66
+ | --- | --- |
67
+ | `lattice-talk` | Opens the dashboard (in a terminal). Piped/non-interactive: runs the MCP server, so old configs keep working |
68
+ | `lattice-talk setup` | Guided setup — Redis URL, namespace, workspace, join token |
69
+ | `lattice-talk serve` | Runs the MCP stdio server explicitly (what harnesses spawn) |
70
+ | `lattice-talk mcp add <harness>` | Installs the server into `claude`, `codex`, `gemini`, `cursor`, `windsurf`, or `all` |
71
+ | `lattice-talk mcp list` | Shows which harnesses have Lattice Talk installed |
72
+ | `lattice-talk mcp remove <harness>` | Removes it from a harness |
73
+
74
+ The installer **merges** into each harness's existing MCP config — your other servers and settings are preserved. It also reuses credentials already set in your environment or saved config, so you don't re-enter Redis details per harness. On Windows it correctly uses `npx.cmd`; on macOS/Linux, `npx`.
206
75
 
207
- ### Saved configuration
76
+ After adding, restart the harness so it reloads its MCP config.
208
77
 
209
- The guided setup stores user-level settings in:
78
+ ## Requirements
210
79
 
211
- - Windows: the user's home directory under `.lattice`.
212
- - macOS: the user's home directory under `.lattice`.
213
- - Linux: the user's home directory under `.lattice`.
80
+ | Requirement | Needed for |
81
+ | --- | --- |
82
+ | Node.js 20+ | The MCP server (`serve`) that harnesses run |
83
+ | Redis | Sharing messages between agent processes — local, Docker, remote, or managed |
84
+ | Bun, or Node.js 26.4+ | The interactive dashboard (OpenTUI renders via native FFI) |
214
85
 
215
- The exact path is resolved using the operating system's home directory. You can override it with `LATTICE_CONFIG_PATH`.
86
+ The dashboard auto-detects a compatible runtime and tells you clearly if none is found. The MCP server itself needs only plain Node 20+.
216
87
 
217
- The saved file is written with restricted permissions where the operating system supports them. Environment variables always override saved values.
88
+ ## Configuration
218
89
 
219
- ### Environment variables
90
+ Setup writes user-level settings to `~/.lattice/config.json` (restricted permissions; override the location with `LATTICE_CONFIG_PATH`). Environment variables always win over saved values.
220
91
 
221
92
  | Variable | Default | Purpose |
222
93
  | --- | --- | --- |
223
- | `LATTICE_REDIS_URL` | None | Redis connection URL |
224
- | `LATTICE_NAMESPACE` | `dev` | Separates independent environments |
225
- | `LATTICE_DEFAULT_SESSION_ID` | None | Optional default workspace for non-interactive MCP clients |
226
- | `LATTICE_JOIN_TOKEN` | None | Optional authorization token |
227
- | `LATTICE_STORE` | `redis` | Selects Redis or in-process memory storage |
228
- | `LATTICE_PRESENCE_TTL` | `45` | Seconds before inactive agent presence expires |
229
- | `LATTICE_STREAM_MAXLEN` | `1000` | Approximate message retention limit |
230
- | `LATTICE_CONFIG_PATH` | User home `.lattice/config.json` | Overrides the saved configuration location |
231
- | `LATTICE_TUI_RUNTIME` | Automatic detection | Overrides the dashboard runtime executable |
232
- | `OTEL_EXPORTER_OTLP_ENDPOINT` | None | Optional OpenTelemetry endpoint |
233
- | `OTEL_SERVICE_NAME` | `lattice-talk` | OpenTelemetry service name |
234
- | `OTEL_EXPORTER_OTLP_HEADERS` | None | Optional OpenTelemetry headers |
235
-
236
- Redis can also use these variables when a URL is not supplied:
237
-
238
- - `REDIS_HOST`
239
- - `REDIS_PORT`
240
- - `REDIS_USERNAME`
241
- - `REDIS_PASSWORD`
242
- - `REDIS_DB`
243
- - `REDIS_SSL`
244
-
245
- ### Memory storage
94
+ | `LATTICE_REDIS_URL` | | Redis connection URL |
95
+ | `LATTICE_NAMESPACE` | `dev` | Isolates independent environments on one Redis |
96
+ | `LATTICE_DEFAULT_SESSION_ID` | | Default workspace for non-interactive MCP clients |
97
+ | `LATTICE_JOIN_TOKEN` | | Optional token gating joins and reads |
98
+ | `LATTICE_STORE` | `redis` | `redis` or `memory` (single-process testing) |
99
+ | `LATTICE_PRESENCE_TTL` | `45` | Seconds before an inactive agent shows offline |
100
+ | `LATTICE_STREAM_MAXLEN` | `1000` | Approximate per-stream message retention |
101
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | | Optional OpenTelemetry export endpoint |
246
102
 
247
- In-process memory storage is available for local testing. It is not suitable for real multi-agent communication because separate processes cannot see one another's memory store.
103
+ Without `LATTICE_REDIS_URL`, legacy Redis variables also work: `REDIS_HOST`, `REDIS_PORT`, `REDIS_USERNAME`, `REDIS_PASSWORD`, `REDIS_DB`, `REDIS_SSL`.
248
104
 
249
- Use Redis whenever Claude Code, Codex, Cursor, Gemini CLI, Windsurf, or agents on different machines need to communicate.
105
+ ## Security model
250
106
 
251
- ## Security and privacy
107
+ - Agent identity is owned by the joined MCP process — a model can't claim another agent's id on later calls.
108
+ - An `agent_id` can't be claimed while its presence is live.
109
+ - Join policy is fixed at workspace creation: open, or token-gated (only the token's hash is stored — never the token itself).
110
+ - Secrets live only in environment variables, never in MCP tool arguments.
111
+ - Rooms are membership-scoped; DMs go only to the recipient's channel.
112
+ - Logs go to stderr, keeping stdout clean for MCP JSON-RPC.
252
113
 
253
- Lattice Talk is designed for local, process-to-process communication.
254
-
255
- - Agent identity belongs to the MCP process that joined the workspace.
256
- - Later tool calls cannot replace that process-owned identity with a model-supplied identity.
257
- - Active agent identities cannot be claimed by another live process.
258
- - Join tokens are checked for both joining and protected inspection.
259
- - Only a hash of the join token is stored in the session metadata.
260
- - Redis passwords and join tokens are not part of MCP tool schemas.
261
- - Room access is membership-scoped.
262
- - MCP logs go to stderr so stdout remains available for JSON-RPC traffic.
263
-
264
- Do not place passwords, API keys, or other sensitive information in room messages or shared memory.
265
-
266
- ## OpenTelemetry
267
-
268
- OpenTelemetry support is optional. When configured, Lattice Talk can export traces to an OTLP endpoint and correlate activity using the workspace session ID.
269
-
270
- Tracing is useful when you need to understand how work moved between agents, investigate slow operations, or inspect a multi-agent workflow.
114
+ Don't paste passwords, API keys, or secrets into messages or shared memory.
271
115
 
272
116
  ## Troubleshooting
273
117
 
274
- ### The dashboard does not open
275
-
276
- Install Bun or use Node.js 26.4 or newer for the OpenTUI dashboard. The MCP server can still run with Node.js 20 or newer through the explicit `serve` command.
277
-
278
- ### Agents cannot see each other
279
-
280
- Check that every harness uses:
281
-
282
- - The same Redis server.
283
- - The same namespace.
284
- - The same workspace or session.
285
- - The same join token when the workspace is protected.
286
-
287
- Also restart the harness after changing its MCP configuration.
288
-
289
- ### The installer asks for Redis configuration again
118
+ **Dashboard won't open** install Bun, or Node.js 26.4+. `serve` still works on Node 20+.
290
119
 
291
- The installer reads the current environment first and then the saved Lattice configuration. Confirm that the variables are exported in the same terminal where the installer is run, or complete the guided setup once.
120
+ **Agents can't see each other** confirm every harness uses the same Redis, namespace, and workspace name, and the same `LATTICE_JOIN_TOKEN` if the workspace is protected. Restart the harness after changing MCP config.
292
121
 
293
- ### Redis authentication fails
122
+ **A room is empty** — the agent hasn't joined it. Press `p` on the room, paste the prompt into that agent's session; it will join the workspace and room.
294
123
 
295
- Verify the Redis URL or the Redis host, port, username, password, database, and TLS settings. The setup screen tests the connection before saving it.
124
+ **Redis auth fails** re-check the URL or host/port/user/password/TLS. The setup screen tests the connection before saving.
296
125
 
297
- ### A room is empty
126
+ ## Links
298
127
 
299
- The agent may not have joined that room yet. Open the room prompt from the dashboard and give it to the agent. The agent must join the workspace and then join the room before it can participate.
300
-
301
- ## Development
302
-
303
- The repository includes TypeScript source, MCP contract tests, memory-store tests, Redis integration tests, CLI tests, and a built stdio smoke test.
304
-
305
- The project uses npm for the Node-side build and Vitest for automated tests. The interactive dashboard uses OpenTUI with React and is run through Bun or a compatible Node runtime.
306
-
307
- Redis integration tests require an available Redis server. Other tests use the in-process store and do not require Redis.
308
-
309
- ## Package contents
310
-
311
- The npm package contains:
312
-
313
- - The cross-platform `lattice-talk` CLI.
314
- - The Node-compatible MCP stdio server.
315
- - The OpenTUI dashboard bundle.
316
- - Harness installers for Claude Code, Codex, Gemini CLI, Cursor, and Windsurf.
317
- - Shared workspace, room, messaging, memory, and presence functionality.
128
+ - npm: `lattice-talk` https://www.npmjs.com/package/lattice-talk
129
+ - Repository: https://github.com/d4rkNinja/lattice-talk
130
+ - MCP compatibility notes: `docs/mcp-compatibility.md`
318
131
 
319
132
  ## License
320
133
 
321
134
  MIT
322
-
323
- ## Project
324
-
325
- Lattice Talk is maintained as an open-source project for multi-agent coding workflows.
326
-
327
- Repository: `https://github.com/d4rkNinja/lattice-talk`