omniwire 2.0.0 → 2.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.
Files changed (68) hide show
  1. package/.mcp.json.disabled +8 -0
  2. package/LICENSE +21 -21
  3. package/README.md +438 -316
  4. package/clawhub-skill/SKILL.md +354 -0
  5. package/dist/claude/integration.js +15 -18
  6. package/dist/claude/integration.js.map +1 -1
  7. package/dist/commands/browser.js +1 -1
  8. package/dist/commands/browser.js.map +1 -1
  9. package/dist/commands/builtins.js +6 -6
  10. package/dist/commands/builtins.js.map +1 -1
  11. package/dist/mcp/index.js +10 -3
  12. package/dist/mcp/index.js.map +1 -1
  13. package/dist/mcp/rest.js +9 -1
  14. package/dist/mcp/rest.js.map +1 -1
  15. package/dist/mcp/server.js +133 -32
  16. package/dist/mcp/server.js.map +1 -1
  17. package/dist/mcp/sync-tools.d.ts +3 -1
  18. package/dist/mcp/sync-tools.js +134 -1
  19. package/dist/mcp/sync-tools.js.map +1 -1
  20. package/dist/nodes/manager.d.ts +4 -0
  21. package/dist/nodes/manager.js +55 -18
  22. package/dist/nodes/manager.js.map +1 -1
  23. package/dist/nodes/transfer.js +8 -3
  24. package/dist/nodes/transfer.js.map +1 -1
  25. package/dist/protocol/config.d.ts +7 -1
  26. package/dist/protocol/config.js +73 -102
  27. package/dist/protocol/config.js.map +1 -1
  28. package/dist/sync/cookies.d.ts +52 -0
  29. package/dist/sync/cookies.js +259 -0
  30. package/dist/sync/cookies.js.map +1 -0
  31. package/dist/sync/crypto.d.ts +11 -0
  32. package/dist/sync/crypto.js +95 -0
  33. package/dist/sync/crypto.js.map +1 -0
  34. package/dist/sync/db.d.ts +3 -0
  35. package/dist/sync/db.js +21 -4
  36. package/dist/sync/db.js.map +1 -1
  37. package/dist/sync/engine.d.ts +3 -1
  38. package/dist/sync/engine.js +59 -8
  39. package/dist/sync/engine.js.map +1 -1
  40. package/dist/sync/index.d.ts +2 -0
  41. package/dist/sync/index.js +44 -9
  42. package/dist/sync/index.js.map +1 -1
  43. package/dist/sync/manifest.js +5 -5
  44. package/dist/sync/manifest.js.map +1 -1
  45. package/dist/sync/openclaw-bridge.d.ts +9 -0
  46. package/dist/sync/openclaw-bridge.js +206 -0
  47. package/dist/sync/openclaw-bridge.js.map +1 -0
  48. package/dist/sync/paths.js +6 -7
  49. package/dist/sync/paths.js.map +1 -1
  50. package/dist/sync/schema.js +2 -0
  51. package/dist/sync/schema.js.map +1 -1
  52. package/dist/sync/secrets.d.ts +32 -0
  53. package/dist/sync/secrets.js +221 -0
  54. package/dist/sync/secrets.js.map +1 -0
  55. package/dist/sync/types.d.ts +2 -0
  56. package/dist/sync/types.js +7 -7
  57. package/dist/sync/types.js.map +1 -1
  58. package/dist/sync/vault-bridge.d.ts +12 -0
  59. package/dist/sync/vault-bridge.js +152 -0
  60. package/dist/sync/vault-bridge.js.map +1 -0
  61. package/dist/ui/format.js +15 -14
  62. package/dist/ui/format.js.map +1 -1
  63. package/dist/update.d.ts +17 -0
  64. package/dist/update.js +108 -0
  65. package/dist/update.js.map +1 -0
  66. package/mesh.example.json +39 -0
  67. package/motd/00-cybernord +410 -0
  68. package/package.json +3 -36
package/README.md CHANGED
@@ -1,316 +1,438 @@
1
- <p align="center">
2
- <img src="https://img.shields.io/npm/v/omniwire?style=flat-square&color=0A0E14&labelColor=0A0E14&label=npm" alt="npm version" />
3
- <img src="https://img.shields.io/badge/MCP-30_tools-59C2FF?style=flat-square&labelColor=0A0E14" alt="MCP tools" />
4
- <img src="https://img.shields.io/badge/transport-stdio_%7C_SSE_%7C_REST-91B362?style=flat-square&labelColor=0A0E14" alt="transports" />
5
- <img src="https://img.shields.io/badge/license-MIT-E6B450?style=flat-square&labelColor=0A0E14" alt="license" />
6
- <img src="https://img.shields.io/badge/node-%3E%3D20-CC93E6?style=flat-square&labelColor=0A0E14" alt="node" />
7
- </p>
8
-
9
- <h1 align="center">OmniWire</h1>
10
-
11
- <p align="center">
12
- <strong>Unified mesh control layer for distributed infrastructure</strong><br/>
13
- <sub>30-tool MCP server &bull; SSH2 connection pooling &bull; adaptive file transfers &bull; cross-node config sync</sub>
14
- </p>
15
-
16
- ---
17
-
18
- OmniWire connects all your machines into a single control plane. It exposes **30 MCP tools** that any AI agent (Claude Code, OpenCode, Cursor, etc.) can use to execute commands, transfer files, manage Docker containers, and sync configurations across your entire infrastructure — through one unified interface.
19
-
20
- ```
21
- ┌──────────────────────────────────────────────────────────────┐
22
- │ AI Agent (MCP Client) │
23
- │ Claude Code / OpenCode / Cursor │
24
- └──────────────────────┬───────────────────────────────────────┘
25
- │ MCP Protocol (stdio / SSE / REST)
26
-
27
- ┌──────────────────────────────────────────────────────────────┐
28
- │ OmniWire MCP Server │
29
- │ 22 Core Tools │ 8 CyberSync Tools │ 3 Transports │
30
- └──────┬──────────┴──────────┬──────────┴──────────────────────┘
31
- │ SSH2 (compressed, pooled) │ PostgreSQL
32
- ▼ ▼
33
- ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌────────────┐
34
- Node A │ │ Node B │ │ Node C │ │ CyberSync │
35
- storage │ │ compute │ │ GPU │ │ Database │
36
- └─────────┘ └─────────┘ └─────────┘ └────────────┘
37
- ```
38
-
39
- ## Features
40
-
41
- ### MCP Server — 30 Tools
42
-
43
- | Category | Tools | Description |
44
- |----------|-------|-------------|
45
- | **Execution** | `omniwire_exec`, `omniwire_broadcast` | Run commands on one or all nodes |
46
- | **Monitoring** | `omniwire_mesh_status`, `omniwire_node_info`, `omniwire_live_monitor` | Health, latency, CPU/mem/disk |
47
- | **Files** | `omniwire_read_file`, `omniwire_write_file`, `omniwire_list_files`, `omniwire_find_files` | Full remote filesystem access |
48
- | **Transfer** | `omniwire_transfer_file`, `omniwire_deploy` | 3-mode adaptive transfer engine |
49
- | **System** | `omniwire_process_list`, `omniwire_disk_usage`, `omniwire_tail_log`, `omniwire_install_package` | System administration |
50
- | **Services** | `omniwire_service_control`, `omniwire_docker` | systemd + Docker management |
51
- | **Network** | `omniwire_port_forward`, `omniwire_open_browser` | SSH tunnels, remote browsers |
52
- | **Advanced** | `omniwire_kernel`, `omniwire_shell`, `omniwire_stream` | Kernel ops, persistent PTY, streaming |
53
- | **CyberSync** | `cybersync_status`, `cybersync_sync_now`, `cybersync_diff`, `cybersync_history`, `cybersync_search_knowledge`, `cybersync_get_memory`, `cybersync_manifest`, `cybersync_force_push` | Cross-node config synchronization |
54
-
55
- ### SSH2 Connection Layer
56
-
57
- - **Persistent connection pooling** — one SSH2 connection per node, reused for all operations
58
- - **Zlib compression** — ~60% less data over the wire for text-heavy outputs
59
- - **Exponential backoff reconnect** — 1s → 2s → 4s → ... → 30s cap with jitter
60
- - **Circuit breaker** — 3 consecutive failures → 60s cooldown, auto-recovers
61
- - **2MB output guard** — prevents memory exhaustion from runaway commands
62
- - **Health pings** — 30s interval, detects degraded connections (>3s response)
63
- - **Status caching** — 5s TTL eliminates redundant probes
64
-
65
- ### Adaptive File Transfer Engine
66
-
67
- OmniWire automatically selects the fastest transfer mode based on file size:
68
-
69
- | Mode | Size Range | Method | Speed |
70
- |------|-----------|--------|-------|
71
- | **SFTP** | < 10 MB | SSH2 native SFTP subsystem | Zero overhead, binary-safe |
72
- | **netcat+tar+gzip** | 10 MB – 1 GB | Compressed TCP stream | ~70% smaller for text |
73
- | **aria2c** | > 1 GB | 16-connection parallel HTTP download | Saturates bandwidth |
74
-
75
- ### CyberSync — Config Synchronization
76
-
77
- Keeps AI tool configurations (Claude Code, OpenCode, Codex, etc.) synchronized across all your machines:
78
-
79
- - **6 tools tracked** — claude-code, opencode, openclaw, codex, gemini, paperclip
80
- - **File watching** — single chokidar instance with batch debounce
81
- - **Parallel sync** — pushes to all nodes simultaneously via `Promise.allSettled`
82
- - **Parallel hashing** SHA-256 in 50-file batches with streaming for large files
83
- - **Conflict resolution** — node-ownership model with detailed conflict logging
84
- - **Memory bridge** — ingests Claude's `memory.db` (SQLite → PostgreSQL)
85
- - **Auto-reconciliation** — every 5 minutes, with event log pruning
86
-
87
- ---
88
-
89
- ## Quick Start
90
-
91
- ### 1. Install
92
-
93
- ```bash
94
- npm install -g omniwire
95
- ```
96
-
97
- ### 2. Configure Your Mesh
98
-
99
- Create `~/.omniwire/mesh.json`:
100
-
101
- ```json
102
- {
103
- "nodes": [
104
- {
105
- "id": "server1",
106
- "host": "10.0.0.1",
107
- "user": "root",
108
- "identityFile": "id_ed25519",
109
- "role": "storage",
110
- "tags": ["vps", "docker"]
111
- },
112
- {
113
- "id": "server2",
114
- "host": "10.0.0.2",
115
- "user": "root",
116
- "identityFile": "id_ed25519",
117
- "role": "compute"
118
- }
119
- ],
120
- "meshSubnet": "10.0.0.0/24"
121
- }
122
- ```
123
-
124
- SSH identity files are resolved relative to `~/.ssh/`. Full paths also work.
125
-
126
- ### 3. Use as MCP Server
127
-
128
- Add to your AI tool's MCP config (`.mcp.json`, Claude Code settings, etc.):
129
-
130
- ```json
131
- {
132
- "mcpServers": {
133
- "omniwire": {
134
- "command": "node",
135
- "args": ["/path/to/omniwire/dist/mcp/index.js", "--stdio"]
136
- }
137
- }
138
- }
139
- ```
140
-
141
- Or if installed globally:
142
-
143
- ```json
144
- {
145
- "mcpServers": {
146
- "omniwire": {
147
- "command": "omniwire",
148
- "args": ["--stdio"]
149
- }
150
- }
151
- }
152
- ```
153
-
154
- ### 4. Use as Interactive Terminal
155
-
156
- ```bash
157
- omniwire
158
- # or
159
- ow
160
- ```
161
-
162
- ---
163
-
164
- ## Transport Modes
165
-
166
- | Mode | Port | Use Case |
167
- |------|------|----------|
168
- | **stdio** | | Claude Code, Cursor, any MCP subprocess client |
169
- | **SSE** | 3200 | OpenCode, remote HTTP-based MCP clients |
170
- | **REST** | 3201 | Non-MCP integrations, scripts, dashboards |
171
-
172
- ```bash
173
- # stdio (default for MCP)
174
- omniwire --stdio
175
-
176
- # SSE + REST (for remote/HTTP clients)
177
- omniwire --sse-port=3200 --rest-port=3201
178
-
179
- # Disable CyberSync (MCP-only, no PostgreSQL needed)
180
- omniwire --stdio --no-sync
181
- ```
182
-
183
- ---
184
-
185
- ## CyberSync Setup
186
-
187
- CyberSync requires PostgreSQL for the sync database. Set via environment variables:
188
-
189
- ```bash
190
- export CYBERSYNC_PG_HOST=10.0.0.1
191
- export CYBERSYNC_PG_PORT=5432
192
- export CYBERSYNC_PG_DATABASE=cybersync
193
- export CYBERSYNC_PG_USER=cybersync
194
- export CYBERSYNC_PG_PASSWORD=your_password
195
- ```
196
-
197
- Run the sync daemon:
198
-
199
- ```bash
200
- # Continuous daemon (watch + reconcile every 5 min)
201
- omniwire sync
202
-
203
- # Single reconciliation pass
204
- omniwire sync:once
205
-
206
- # Ingest Claude memory.db only
207
- omniwire sync:ingest
208
- ```
209
-
210
- If you don't need CyberSync, pass `--no-sync` to the MCP server — it works fine without PostgreSQL.
211
-
212
- ---
213
-
214
- ## Configuration Reference
215
-
216
- ### Mesh Config (`~/.omniwire/mesh.json`)
217
-
218
- ```typescript
219
- interface MeshConfig {
220
- nodes: Array<{
221
- id: string; // Unique node identifier
222
- alias?: string; // Short alias (e.g., "s1")
223
- host: string; // IP or hostname
224
- port?: number; // SSH port (default: 22)
225
- user?: string; // SSH user (default: "root")
226
- identityFile?: string; // SSH key filename or full path
227
- os?: "windows" | "linux"; // OS type (default: "linux")
228
- role?: "controller" | "storage" | "compute" | "gpu+browser";
229
- tags?: string[]; // Custom tags for filtering
230
- }>;
231
- meshSubnet?: string; // Subnet notation (informational)
232
- defaultNode?: string; // Default target node
233
- }
234
- ```
235
-
236
- ### Environment Variables
237
-
238
- | Variable | Description | Default |
239
- |----------|-------------|---------|
240
- | `OMNIWIRE_CONFIG` | JSON mesh config (alternative to file) | — |
241
- | `OMNIWIRE_NODE_ID` | Override local node ID detection | auto-detected |
242
- | `OMNIWIRE_LINUX_HOME` | Linux home directory for path mapping | `/root` |
243
- | `CYBERSYNC_PG_HOST` | PostgreSQL host | `localhost` |
244
- | `CYBERSYNC_PG_PORT` | PostgreSQL port | `5432` |
245
- | `CYBERSYNC_PG_DATABASE` | Database name | `cybersync` |
246
- | `CYBERSYNC_PG_USER` | Database user | `cybersync` |
247
- | `CYBERSYNC_PG_PASSWORD` | Database password | |
248
-
249
- ---
250
-
251
- ## Architecture
252
-
253
- ```
254
- omniwire/
255
- ├── src/
256
- │ ├── mcp/
257
- │ │ ├── index.ts # Entrypoint — dual transport (stdio + SSE)
258
- │ │ ├── server.ts # 22 core MCP tools
259
- │ │ ├── sync-tools.ts # 8 CyberSync MCP tools
260
- │ │ ├── sse.ts # SSE transport
261
- │ │ └── rest.ts # REST API
262
- │ ├── nodes/
263
- │ │ ├── manager.ts # SSH2 connection pooling + circuit breaker
264
- │ │ ├── transfer.ts # 3-mode adaptive file transfer
265
- │ │ ├── shell.ts # Persistent PTY sessions
266
- │ │ ├── tunnel.ts # SSH port forwarding
267
- │ │ └── realtime.ts # Streaming command dispatch
268
- │ ├── sync/
269
- │ │ ├── engine.ts # Push/pull/reconcile with parallel ops
270
- │ │ ├── db.ts # PostgreSQL pool (8 connections, FTS)
271
- │ │ ├── watcher.ts # Single chokidar, batch debounce
272
- │ │ ├── hasher.ts # SHA-256 (streaming for large files)
273
- │ │ ├── manifest.ts # Tool sync definitions
274
- │ │ ├── memory-bridge.ts # SQLite → PostgreSQL ingestion
275
- │ │ └── paths.ts # Windows/Linux path adaptation
276
- │ ├── protocol/
277
- │ │ ├── config.ts # Mesh topology loader
278
- │ │ ├── types.ts # Shared type definitions
279
- │ │ └── paths.ts # node:/path format parser
280
- │ ├── commands/ # Interactive REPL commands
281
- │ ├── claude/ # Claude Code AI integration
282
- │ └── ui/ # Terminal formatting
283
- ├── mesh.example.json # Example mesh configuration
284
- ├── package.json
285
- └── tsconfig.json
286
- ```
287
-
288
- ---
289
-
290
- ## Performance
291
-
292
- Benchmarked on a 3-node WireGuard mesh (EU region):
293
-
294
- | Operation | Latency | Notes |
295
- |-----------|---------|-------|
296
- | Single command exec | ~120ms | SSH2 + command + return |
297
- | Mesh status (all nodes) | ~150ms | Parallel probes, 5s cache |
298
- | File read (< 1MB) | ~80ms | SFTP, no encoding overhead |
299
- | File transfer (10MB) | ~200ms | gzip netcat over WireGuard |
300
- | Config sync (push) | ~200ms | Parallel to all nodes |
301
- | Reconcile (500 files) | ~2s | 50-file parallel hash batches |
302
-
303
- ---
304
-
305
- ## Requirements
306
-
307
- - **Node.js** >= 20
308
- - **SSH access** to remote nodes (key-based auth)
309
- - **PostgreSQL** (only if using CyberSync)
310
- - **WireGuard / VPN** recommended for mesh connectivity
311
-
312
- ---
313
-
314
- ## License
315
-
316
- MIT
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://capsule-render.vercel.app/api?type=waving&color=0:0A0E14,50:1A1F2E,100:59C2FF&height=200&section=header&text=OmniWire&fontSize=72&fontColor=59C2FF&animation=fadeIn&fontAlignY=35&desc=Unified%20Mesh%20Control%20Layer&descSize=18&descColor=8B949E&descAlignY=55" />
4
+ <source media="(prefers-color-scheme: light)" srcset="https://capsule-render.vercel.app/api?type=waving&color=0:E8EAED,50:D4D8DE,100:59C2FF&height=200&section=header&text=OmniWire&fontSize=72&fontColor=0A0E14&animation=fadeIn&fontAlignY=35&desc=Unified%20Mesh%20Control%20Layer&descSize=18&descColor=586069&descAlignY=55" />
5
+ <img alt="OmniWire" src="https://capsule-render.vercel.app/api?type=waving&color=0:0A0E14,50:1A1F2E,100:59C2FF&height=200&section=header&text=OmniWire&fontSize=72&fontColor=59C2FF&animation=fadeIn&fontAlignY=35&desc=Unified%20Mesh%20Control%20Layer&descSize=18&descColor=8B949E&descAlignY=55" />
6
+ </picture>
7
+ </p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/omniwire"><img src="https://img.shields.io/npm/v/omniwire?style=for-the-badge&logo=npm&color=CB3837&labelColor=0A0E14" alt="npm" /></a>
11
+ <img src="https://img.shields.io/badge/MCP-34_tools-59C2FF?style=for-the-badge&labelColor=0A0E14" alt="tools" />
12
+ <img src="https://img.shields.io/badge/transport-stdio_%7C_SSE_%7C_REST-91B362?style=for-the-badge&labelColor=0A0E14" alt="transports" />
13
+ <img src="https://img.shields.io/badge/node-%E2%89%A520-CC93E6?style=for-the-badge&logo=node.js&labelColor=0A0E14" alt="node" />
14
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-E6B450?style=for-the-badge&labelColor=0A0E14" alt="license" /></a>
15
+ </p>
16
+
17
+ <p align="center">
18
+ <sub>One MCP server to control all your machines. Multi-path SSH2 failover, adaptive file transfers, encrypted cross-node config sync.</sub>
19
+ </p>
20
+
21
+ ---
22
+
23
+ ## How It Works
24
+
25
+ ```mermaid
26
+ graph TB
27
+ subgraph clients["AI Agents"]
28
+ CC["Claude Code"]
29
+ OC["OpenCode"]
30
+ CU["Cursor / Any MCP Client"]
31
+ end
32
+
33
+ subgraph omniwire["OmniWire MCP Server"]
34
+ direction TB
35
+ MCP["MCP Protocol Layer\nstdio | SSE | REST"]
36
+
37
+ subgraph tools["34 Tools"]
38
+ direction LR
39
+ EXEC["Execution\nexec run batch\nbroadcast"]
40
+ FILES["Files\nread write\ntransfer deploy"]
41
+ MON["Monitoring\nstatus metrics\nlogs"]
42
+ SYS["System\ndocker services\nkernel"]
43
+ SYNC["CyberSync\nsync diff\nsearch secrets"]
44
+ end
45
+
46
+ subgraph engine["Core Engine"]
47
+ direction LR
48
+ POOL["SSH2 Pool\npersistent compressed\ncircuit breaker"]
49
+ XFER["Transfer Engine\nSFTP netcat+gzip\naria2c 16-conn"]
50
+ CSYNC["Sync Engine\nPostgreSQL XChaCha20\nparallel reconcile"]
51
+ end
52
+ end
53
+
54
+ subgraph mesh["Infrastructure Mesh"]
55
+ direction LR
56
+ N1["Node A\nstorage\n10.0.0.1"]
57
+ N2["Node B\ncompute\n10.0.0.2"]
58
+ N3["Node C\nGPU\n10.0.0.3"]
59
+ N4["Node D\nlocal"]
60
+ end
61
+
62
+ DB[("PostgreSQL\nCyberSync DB")]
63
+
64
+ CC & OC & CU -->|MCP| MCP
65
+ MCP --> tools
66
+ tools --> engine
67
+ POOL -->|"SSH2 multi-path"| N1 & N2 & N3
68
+ POOL -->|"local exec"| N4
69
+ CSYNC --> DB
70
+
71
+ style omniwire fill:#0A0E14,stroke:#59C2FF,stroke-width:2px,color:#C6D0E1
72
+ style clients fill:#1A1F2E,stroke:#91B362,stroke-width:1px,color:#C6D0E1
73
+ style mesh fill:#1A1F2E,stroke:#E6B450,stroke-width:1px,color:#C6D0E1
74
+ style tools fill:#141922,stroke:#59C2FF,stroke-width:1px,color:#C6D0E1
75
+ style engine fill:#141922,stroke:#CC93E6,stroke-width:1px,color:#C6D0E1
76
+ style MCP fill:#1A1F2E,stroke:#59C2FF,color:#59C2FF
77
+ style DB fill:#1A1F2E,stroke:#CC93E6,color:#CC93E6
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Features at a Glance
83
+
84
+ <table>
85
+ <tr>
86
+ <td width="50%">
87
+
88
+ ### Remote Execution
89
+ ```
90
+ omniwire_exec single command, any node
91
+ omniwire_run multi-line script (compact UI)
92
+ omniwire_batch N commands in 1 tool call
93
+ omniwire_broadcast parallel across all nodes
94
+ ```
95
+
96
+ </td>
97
+ <td width="50%">
98
+
99
+ ### Adaptive File Transfer
100
+ ```
101
+ < 10 MB SFTP native, 80ms
102
+ 10M-1GB netcat+gzip compressed, 200ms
103
+ > 1 GB aria2c 16-parallel, max speed
104
+ ```
105
+
106
+ </td>
107
+ </tr>
108
+ <tr>
109
+ <td>
110
+
111
+ ### Connection Resilience
112
+ ```
113
+ Connected --> Health Ping (45s)
114
+ | |
115
+ | > 5s? --> Degraded warning
116
+ |
117
+ Failure --> Multi-path Failover
118
+ | WireGuard --> Tailscale --> Public IP
119
+ |
120
+ +--> Retry (exp. backoff)
121
+ | 500ms -> 1s -> 2s -> ... -> 15s
122
+ |
123
+ 3 fails --> Circuit OPEN (30s)
124
+ --> Auto-recover
125
+ ```
126
+
127
+ </td>
128
+ <td>
129
+
130
+ ### CyberSync + CyberBase
131
+ ```
132
+ Node A --push--> PostgreSQL (cyberbase)
133
+ | |
134
+ | XChaCha20-Poly1305
135
+ | encrypted at rest
136
+ |
137
+ +--mirror--> Obsidian Vault
138
+ |
139
+ Obsidian Sync (cloud)
140
+
141
+ 6 AI tools synced automatically:
142
+ Claude OpenCode Codex Gemini ...
143
+ ```
144
+
145
+ </td>
146
+ </tr>
147
+ </table>
148
+
149
+ ---
150
+
151
+ ## All 34 Tools
152
+
153
+ <details>
154
+ <summary><b>Execution (4 tools)</b></summary>
155
+
156
+ | Tool | Description |
157
+ |------|-------------|
158
+ | `omniwire_exec` | Run a command on any node. Supports `label` for compact display. |
159
+ | `omniwire_run` | Execute multi-line scripts via temp file. Keeps tool call UI clean. |
160
+ | `omniwire_batch` | Run N commands across nodes in a single tool call. Parallel by default. |
161
+ | `omniwire_broadcast` | Execute on all online nodes simultaneously. |
162
+
163
+ </details>
164
+
165
+ <details>
166
+ <summary><b>Monitoring (3 tools)</b></summary>
167
+
168
+ | Tool | Description |
169
+ |------|-------------|
170
+ | `omniwire_mesh_status` | Health, latency, CPU/mem/disk for all nodes |
171
+ | `omniwire_node_info` | Detailed info for a specific node |
172
+ | `omniwire_live_monitor` | Snapshot metrics: cpu, memory, disk, network |
173
+
174
+ </details>
175
+
176
+ <details>
177
+ <summary><b>Files (4 tools)</b></summary>
178
+
179
+ | Tool | Description |
180
+ |------|-------------|
181
+ | `omniwire_read_file` | Read file from any node. Supports `node:/path` format. |
182
+ | `omniwire_write_file` | Write/create file on any node |
183
+ | `omniwire_list_files` | List directory contents |
184
+ | `omniwire_find_files` | Search by glob pattern across all nodes |
185
+
186
+ </details>
187
+
188
+ <details>
189
+ <summary><b>Transfer & Deploy (2 tools)</b></summary>
190
+
191
+ | Tool | Description |
192
+ |------|-------------|
193
+ | `omniwire_transfer_file` | Copy between nodes. Auto-selects SFTP/netcat/aria2c. |
194
+ | `omniwire_deploy` | Deploy file from one node to all others in parallel |
195
+
196
+ </details>
197
+
198
+ <details>
199
+ <summary><b>System (6 tools)</b></summary>
200
+
201
+ | Tool | Description |
202
+ |------|-------------|
203
+ | `omniwire_process_list` | List/filter processes across nodes |
204
+ | `omniwire_disk_usage` | Disk usage for all nodes |
205
+ | `omniwire_tail_log` | Last N lines of a log file |
206
+ | `omniwire_install_package` | Install via apt/npm/pip |
207
+ | `omniwire_service_control` | systemd start/stop/restart/status |
208
+ | `omniwire_docker` | Run docker commands on any node |
209
+
210
+ </details>
211
+
212
+ <details>
213
+ <summary><b>Network (2 tools)</b></summary>
214
+
215
+ | Tool | Description |
216
+ |------|-------------|
217
+ | `omniwire_port_forward` | Create/list/close SSH tunnels |
218
+ | `omniwire_open_browser` | Open URL in browser on a node |
219
+
220
+ </details>
221
+
222
+ <details>
223
+ <summary><b>Advanced (4 tools)</b></summary>
224
+
225
+ | Tool | Description |
226
+ |------|-------------|
227
+ | `omniwire_kernel` | dmesg, sysctl, modprobe, lsmod, strace, perf |
228
+ | `omniwire_shell` | Persistent PTY session (preserves cwd/env) |
229
+ | `omniwire_stream` | Capture streaming output (tail -f, watch) |
230
+ | `omniwire_update` | Self-update OmniWire |
231
+
232
+ </details>
233
+
234
+ <details>
235
+ <summary><b>CyberSync (9 tools)</b></summary>
236
+
237
+ | Tool | Description |
238
+ |------|-------------|
239
+ | `cybersync_status` | Sync status, item counts, pending syncs |
240
+ | `cybersync_sync_now` | Trigger immediate reconciliation |
241
+ | `cybersync_diff` | Show local vs database differences |
242
+ | `cybersync_history` | Query sync event log |
243
+ | `cybersync_search_knowledge` | Full-text search unified knowledge base |
244
+ | `cybersync_get_memory` | Retrieve Claude memory from PostgreSQL |
245
+ | `cybersync_manifest` | Show tracked files per tool |
246
+ | `cybersync_force_push` | Force push file to all nodes |
247
+ | `omniwire_secrets` | Get/set/delete/list/sync secrets (1Password, file, env) |
248
+
249
+ </details>
250
+
251
+ ---
252
+
253
+ ## Quick Start
254
+
255
+ ### Install
256
+
257
+ ```bash
258
+ npm install -g omniwire
259
+ ```
260
+
261
+ ### Configure Mesh
262
+
263
+ Create `~/.omniwire/mesh.json`:
264
+
265
+ ```json
266
+ {
267
+ "nodes": [
268
+ {
269
+ "id": "server1",
270
+ "host": "10.0.0.1",
271
+ "user": "root",
272
+ "identityFile": "id_ed25519",
273
+ "role": "storage"
274
+ },
275
+ {
276
+ "id": "server2",
277
+ "host": "10.0.0.2",
278
+ "user": "root",
279
+ "identityFile": "id_ed25519",
280
+ "role": "compute"
281
+ }
282
+ ]
283
+ }
284
+ ```
285
+
286
+ ### Add to Claude Code
287
+
288
+ ```json
289
+ {
290
+ "mcpServers": {
291
+ "omniwire": {
292
+ "command": "omniwire",
293
+ "args": ["--stdio"]
294
+ }
295
+ }
296
+ }
297
+ ```
298
+
299
+ ### Interactive Mode
300
+
301
+ ```bash
302
+ omniwire # or: ow
303
+ ```
304
+
305
+ ---
306
+
307
+ ## Performance
308
+
309
+ | Operation | Latency | Details |
310
+ |-----------|---------|---------|
311
+ | **Command exec** | `~120ms` | SSH2 + command + return |
312
+ | **Mesh status** | `~150ms` | Parallel probes, 8s cache |
313
+ | **File read (<1MB)** | `~80ms` | SFTP, binary-safe |
314
+ | **Transfer (10MB)** | `~200ms` | gzip netcat over WireGuard |
315
+ | **Config push** | `~200ms` | Parallel to all nodes + Obsidian mirror |
316
+ | **Reconcile (500 files)** | `~1.2s` | 100-file hash batches, parallel walkDir |
317
+
318
+ ---
319
+
320
+ ## Security
321
+
322
+ All remote execution uses `ssh2.Client.exec()`, never `child_process.exec()`. Key-based auth only, no passwords stored. Multi-path failover (WireGuard → Tailscale → Public IP) with SSH key caching. CyberBase: single PostgreSQL DB for all projects. XChaCha20-Poly1305 at-rest encryption for synced configs. 2MB output guard prevents memory exhaustion. Circuit breaker with 30s auto-recovery isolates failing nodes.
323
+
324
+ ---
325
+
326
+ ## Transport Modes
327
+
328
+ | Mode | Default Port | Use Case |
329
+ |------|-------------|----------|
330
+ | `--stdio` | -- | Claude Code, Cursor, MCP subprocess clients |
331
+ | `--sse-port=N` | 3200 | OpenCode, remote HTTP-based MCP clients |
332
+ | `--rest-port=N` | 3201 | Scripts, dashboards, non-MCP integrations |
333
+
334
+ ```bash
335
+ omniwire --stdio # MCP mode
336
+ omniwire --sse-port=3200 --rest-port=3201 # HTTP mode
337
+ omniwire --stdio --no-sync # MCP without CyberSync
338
+ ```
339
+
340
+ ---
341
+
342
+ ## Changelog
343
+
344
+ ### v2.2.1 — Security & Bug Fixes
345
+
346
+ **omniwire_exec**
347
+ - `command` is now optional when `script` is provided — previously rejected valid script-only calls
348
+ - Scripts now respect the `timeout` parameter — previously scripts could run indefinitely
349
+ - Removed unused `escaped` variable (dead code cleanup)
350
+ - Output now uses the compact `ok()` helper with label support
351
+
352
+ **omniwire_shell**
353
+ - Fixed race condition: close listener is now registered before writing commands, preventing spurious 15s timeouts on fast-completing commands
354
+
355
+ **transfer**
356
+ - Added size guard on base64 fallback — files >1MB no longer silently fail with `ARG_MAX` overflow
357
+
358
+ **REST API**
359
+ - CORS restricted from `*` to `http://localhost` — prevents cross-origin command execution from browser tabs
360
+ - Added input validation on `/api/exec` and `/api/transfer` endpoints
361
+
362
+ **Reconnect backoff**
363
+ - Fixed misleading comment: actual cap is 15s (comment previously said 30s)
364
+
365
+ ---
366
+
367
+ ### v2.1.0 — Multi-Path Failover & Performance
368
+
369
+ **Connectivity**
370
+ - Multi-path host resolution: WireGuard → Tailscale → Public IP per node
371
+ - Auto-reconnect tries all paths before marking node offline
372
+ - `exec()` attempts immediate reconnect on offline nodes before failing
373
+
374
+ **Performance**
375
+ - SSH key caching (no repeated disk reads)
376
+ - Compression disabled for small commands (faster round-trips)
377
+ - Reconnect backoff: 500ms start, 15s cap (was 1s/30s)
378
+ - Health ping interval: 45s (was 30s) with lighter `true` command
379
+ - Status cache: 8s TTL (was 5s)
380
+ - Circuit breaker recovery: 30s (was 60s)
381
+
382
+ **CyberSync**
383
+ - Parallel `walkDir` with 8 concurrent subdirectory scans
384
+ - Hash batch size doubled (50 → 100)
385
+ - Reconcile interval: 2min (was 5min)
386
+ - Timing in reconcile logs
387
+
388
+ **Output**
389
+ - Compact `ok()` / `fail()` helpers for cleaner Claude Code results
390
+ - `mesh_status` outputs aligned table with column headers
391
+ - `node_info` shows which host path is active (WG/Tailscale/Public)
392
+ - `exec` and `run` use `label` field as display tag
393
+
394
+ **CyberBase Integration**
395
+ - Renamed PostgreSQL database from `cybersync` to `cyberbase` (single DB for everything)
396
+ - VaultBridge: mirrors all sync items, knowledge, and memory to Obsidian-compatible markdown
397
+ - Obsidian vault at `~/Documents/BuisnessProjects/CyberBase` with Obsidian Sync for cloud backup
398
+ - Daily event logs in `vault/logs/`
399
+ - `obsidian-mcp` deployed on all mesh nodes for AI vault access
400
+
401
+ ---
402
+
403
+ ## Architecture
404
+
405
+ ```
406
+ omniwire/
407
+ src/
408
+ mcp/ MCP server (34 tools, 3 transports)
409
+ nodes/ SSH2 pool, transfer engine, PTY, tunnels
410
+ sync/ CyberSync + CyberBase (PostgreSQL, Obsidian vault, encryption)
411
+ protocol/ Mesh config, types, path parsing
412
+ commands/ Interactive REPL
413
+ ui/ Terminal formatting
414
+ ```
415
+
416
+ ---
417
+
418
+ ## Requirements
419
+
420
+ - **Node.js** >= 20
421
+ - **SSH access** to remote nodes (key-based auth)
422
+ - **PostgreSQL** (only for CyberSync)
423
+ - **WireGuard + Tailscale** recommended (multi-path failover uses both)
424
+ - **Obsidian** (optional) for CyberBase vault browsing + Obsidian Sync cloud backup
425
+
426
+ ---
427
+
428
+ <p align="center">
429
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-E6B450?style=flat-square&labelColor=0A0E14" alt="MIT License" /></a>
430
+ </p>
431
+
432
+ <p align="center">
433
+ <picture>
434
+ <source media="(prefers-color-scheme: dark)" srcset="https://capsule-render.vercel.app/api?type=waving&color=0:0A0E14,50:1A1F2E,100:59C2FF&height=100&section=footer" />
435
+ <source media="(prefers-color-scheme: light)" srcset="https://capsule-render.vercel.app/api?type=waving&color=0:E8EAED,50:D4D8DE,100:59C2FF&height=100&section=footer" />
436
+ <img alt="footer" src="https://capsule-render.vercel.app/api?type=waving&color=0:0A0E14,50:1A1F2E,100:59C2FF&height=100&section=footer" />
437
+ </picture>
438
+ </p>