@wolpertingerlabs/drawlatch 1.0.0-alpha.9.0 → 1.0.0-alpha.9.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.
Files changed (2) hide show
  1. package/README.md +28 -39
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -108,11 +108,11 @@ For custom setups (different aliases, multiple callers, different machines), you
108
108
  **1. Generate keys:**
109
109
 
110
110
  ```bash
111
- drawlatch generate-keys local my-laptop
112
- drawlatch generate-keys remote
111
+ drawlatch generate-keys caller my-laptop
112
+ drawlatch generate-keys server
113
113
  ```
114
114
 
115
- **2. Exchange public keys** — copy `*.pub.pem` files into the appropriate `keys/peers/` subdirectories. See [Key Exchange](#key-exchange) for details.
115
+ **2. Exchange public keys** — on separate machines, copy `*.pub.pem` files to the matching `keys/callers/<alias>/` or `keys/server/` directory on the other machine. See [Key Exchange](#key-exchange) for details.
116
116
 
117
117
  **3. Create configs** — copy the example files and edit:
118
118
 
@@ -165,7 +165,6 @@ Once connected, agents get these tools:
165
165
  {
166
166
  "host": "0.0.0.0",
167
167
  "port": 9999,
168
- "localKeysDir": "~/.drawlatch/keys/remote",
169
168
  "connectors": [],
170
169
  "callers": {},
171
170
  "rateLimitPerMinute": 60
@@ -176,11 +175,12 @@ Once connected, agents get these tools:
176
175
  |-------|-------------|---------|
177
176
  | `host` | Network interface to bind | `127.0.0.1` |
178
177
  | `port` | Listen port | `9999` |
179
- | `localKeysDir` | Path to server's own keypair | `~/.drawlatch/keys/remote` |
180
178
  | `connectors` | Custom connector definitions (see below) | `[]` |
181
179
  | `callers` | Per-caller access control (see below) | `{}` |
182
180
  | `rateLimitPerMinute` | Max requests per minute per session | `60` |
183
181
 
182
+ Server keys are always loaded from `keys/server/` inside the config directory.
183
+
184
184
  ### Callers
185
185
 
186
186
  Each caller is identified by their public key and declares which connections they can access:
@@ -190,7 +190,6 @@ Each caller is identified by their public key and declares which connections the
190
190
  "callers": {
191
191
  "alice": {
192
192
  "name": "Alice (senior engineer)",
193
- "peerKeyDir": "~/.drawlatch/keys/peers/alice",
194
193
  "connections": ["github", "stripe", "internal-api"],
195
194
  "env": {
196
195
  "GITHUB_TOKEN": "${ALICE_GITHUB_TOKEN}"
@@ -198,16 +197,16 @@ Each caller is identified by their public key and declares which connections the
198
197
  },
199
198
  "ci-server": {
200
199
  "name": "GitHub Actions CI",
201
- "peerKeyDir": "~/.drawlatch/keys/peers/ci-server",
202
200
  "connections": ["github"]
203
201
  }
204
202
  }
205
203
  }
206
204
  ```
207
205
 
206
+ Caller public keys are loaded automatically from `keys/callers/<alias>/` — no path configuration needed.
207
+
208
208
  | Field | Required | Description |
209
209
  |-------|----------|-------------|
210
- | `peerKeyDir` | Yes | Path to this caller's public key files |
211
210
  | `connections` | Yes | Array of connection names (built-in or custom connector aliases) |
212
211
  | `name` | No | Human-readable name for audit logs |
213
212
  | `env` | No | Per-caller env var overrides — redirect secret resolution per caller |
@@ -216,7 +215,9 @@ Each caller is identified by their public key and declares which connections the
216
215
  The `env` map lets multiple callers share the same connection with different credentials:
217
216
  - Keys are the env var names connectors reference (e.g., `GITHUB_TOKEN`)
218
217
  - Values are `"${REAL_ENV_VAR}"` (redirect) or literal strings (direct injection)
219
- - Checked before `process.env` during secret resolution
218
+ - Checked before prefixed env vars during secret resolution
219
+
220
+ Without an explicit `env` mapping, secrets resolve via prefixed env vars (e.g., caller "alice" + `GITHUB_TOKEN` → `ALICE_GITHUB_TOKEN`).
220
221
 
221
222
  ### Custom Connectors
222
223
 
@@ -256,8 +257,6 @@ Used by the local MCP proxy to connect to the remote server:
256
257
  ```json
257
258
  {
258
259
  "remoteUrl": "http://127.0.0.1:9999",
259
- "localKeyAlias": "my-laptop",
260
- "remotePublicKeysDir": "~/.drawlatch/keys/peers/remote-server",
261
260
  "connectTimeout": 10000,
262
261
  "requestTimeout": 30000
263
262
  }
@@ -266,13 +265,12 @@ Used by the local MCP proxy to connect to the remote server:
266
265
  | Field | Description | Default |
267
266
  |-------|-------------|---------|
268
267
  | `remoteUrl` | URL of the remote server | `http://localhost:9999` |
269
- | `localKeyAlias` | Key alias — resolved to `keys/local/<alias>/` | _(none)_ |
270
- | `localKeysDir` | Explicit path to proxy's keypair (ignored when `localKeyAlias` is set) | `~/.drawlatch/keys/local/default` |
271
- | `remotePublicKeysDir` | Path to remote server's public keys | `~/.drawlatch/keys/peers/remote-server` |
272
268
  | `connectTimeout` | Handshake timeout (ms) | `10000` |
273
269
  | `requestTimeout` | Request timeout (ms) | `30000` |
274
270
 
275
- Key alias resolution order: `MCP_KEY_ALIAS` env var > `localKeyAlias` > `localKeysDir` > `keys/local/default`.
271
+ Key paths are derived automatically no configuration needed:
272
+ - Caller keys: `keys/callers/{MCP_KEY_ALIAS || "default"}/`
273
+ - Server public keys: `keys/server/`
276
274
 
277
275
  ### Advanced Configuration
278
276
 
@@ -337,40 +335,27 @@ See **[INGESTORS.md](INGESTORS.md)** for full configuration reference.
337
335
 
338
336
  Remote mode requires mutual authentication via Ed25519/X25519 keypairs. Each identity gets four PEM files (signing + exchange, public + private). The `drawlatch init` command handles this automatically for single-machine setups.
339
337
 
340
- For multi-machine setups, exchange public keys manually:
341
-
342
338
  **Directory structure:**
343
339
 
344
340
  ```
345
341
  ~/.drawlatch/keys/
346
- ├── local/my-laptop/ # MCP proxy keypair
347
- ├── remote/ # Remote server keypair
348
- └── peers/
349
- ├── my-laptop/ # Proxy's public keys (on the server)
350
- └── remote-server/ # Server's public keys (on the proxy)
342
+ ├── callers/
343
+ ├── default/ # Default caller keypair
344
+ └── alice/ # Additional caller keypair
345
+ └── server/ # Server keypair
351
346
  ```
352
347
 
353
- **Exchange public keys** (`.pub.pem` only never share private keys):
348
+ Both sides (caller and server) store their keys in the same directory tree. On a single machine, `drawlatch init` generates both and they can authenticate immediately. On separate machines, copy the `*.pub.pem` files to the corresponding directory on the other machine.
354
349
 
355
- ```bash
356
- # Proxy's public keys → server's peers directory
357
- cp keys/local/my-laptop/signing.pub.pem keys/peers/my-laptop/signing.pub.pem
358
- cp keys/local/my-laptop/exchange.pub.pem keys/peers/my-laptop/exchange.pub.pem
359
-
360
- # Server's public keys → proxy's peers directory
361
- cp keys/remote/signing.pub.pem keys/peers/remote-server/signing.pub.pem
362
- cp keys/remote/exchange.pub.pem keys/peers/remote-server/exchange.pub.pem
363
- ```
364
-
365
- If the proxy and server are on different machines, transfer only `*.pub.pem` files via `scp` or similar.
350
+ **Using [Callboard](https://github.com/WolpertingerLabs/callboard)?** Use `drawlatch sync` to exchange keys automatically via a double-code approval flow — no manual file copying needed.
366
351
 
367
352
  ### Multiple Agent Identities
368
353
 
369
354
  Generate a keypair per agent and set `MCP_KEY_ALIAS` at spawn time:
370
355
 
371
356
  ```bash
372
- drawlatch generate-keys local alice
373
- drawlatch generate-keys local bob
357
+ drawlatch generate-keys caller alice
358
+ drawlatch generate-keys caller bob
374
359
  ```
375
360
 
376
361
  ```json
@@ -385,7 +370,7 @@ drawlatch generate-keys local bob
385
370
  }
386
371
  ```
387
372
 
388
- Register each agent as a separate caller on the remote server with matching peer key directories.
373
+ Register each agent as a separate caller in `remote.config.json`.
389
374
 
390
375
  ## CLI Reference
391
376
 
@@ -402,6 +387,7 @@ Commands:
402
387
  config Show effective configuration and secret status
403
388
  doctor Validate setup and diagnose issues
404
389
  generate-keys Generate Ed25519 + X25519 keypairs
390
+ sync Exchange keys with a callboard instance
405
391
 
406
392
  Options:
407
393
  -h, --help Show help
@@ -422,10 +408,13 @@ Logs options:
422
408
  --follow Tail the log output
423
409
 
424
410
  Generate-keys subcommands:
425
- local [alias] Generate local proxy keypair (default alias: "default")
426
- remote Generate remote server keypair
411
+ caller [alias] Generate caller keypair (default alias: "default")
412
+ server Generate server keypair
427
413
  show <path> Show fingerprint of existing keypair
428
414
  --dir <path> Generate to custom directory
415
+
416
+ Sync options:
417
+ --ttl <seconds> Session timeout (default: 300)
429
418
  ```
430
419
 
431
420
  ## Library Usage (Local Mode)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wolpertingerlabs/drawlatch",
3
- "version": "1.0.0-alpha.9.0",
3
+ "version": "1.0.0-alpha.9.1",
4
4
  "description": "Encrypted MCP proxy with mutual authentication. Local MCP server forwards requests through an encrypted channel to a remote secrets-holding server.",
5
5
  "type": "module",
6
6
  "main": "./dist/mcp/server.js",