omniwire 2.6.1 → 3.0.0
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/.github/workflows/ci.yml +32 -0
- package/README.md +165 -12
- package/assets/banner-dark.svg +1 -1
- package/assets/banner-light.svg +1 -1
- package/assets/footer-dark.svg +32 -0
- package/assets/footer-light.svg +32 -0
- package/completions/omniwire.bash +7 -0
- package/completions/omniwire.fish +8 -0
- package/completions/omniwire.zsh +11 -0
- package/dist/mcp/index.js +13 -4
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/server.js +1563 -20
- package/dist/mcp/server.js.map +1 -1
- package/dist/nodes/manager.d.ts +17 -0
- package/dist/nodes/manager.js +187 -3
- package/dist/nodes/manager.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [master]
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [master]
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: actions/setup-node@v4
|
|
13
|
+
with:
|
|
14
|
+
node-version: 20
|
|
15
|
+
registry-url: https://registry.npmjs.org
|
|
16
|
+
- run: npm ci
|
|
17
|
+
- run: npm run build
|
|
18
|
+
publish:
|
|
19
|
+
needs: build
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
if: github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, 'release:')
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
- uses: actions/setup-node@v4
|
|
25
|
+
with:
|
|
26
|
+
node-version: 20
|
|
27
|
+
registry-url: https://registry.npmjs.org
|
|
28
|
+
- run: npm ci
|
|
29
|
+
- run: npm run build
|
|
30
|
+
- run: npm publish
|
|
31
|
+
env:
|
|
32
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
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=0D1117" alt="npm" /></a>
|
|
11
|
-
<img src="https://img.shields.io/badge/MCP_Tools-
|
|
11
|
+
<img src="https://img.shields.io/badge/MCP_Tools-56-59C2FF?style=for-the-badge&labelColor=0D1117" alt="tools" />
|
|
12
12
|
<img src="https://img.shields.io/badge/A2A-Protocol-00C853?style=for-the-badge&labelColor=0D1117" alt="A2A" />
|
|
13
13
|
<img src="https://img.shields.io/badge/Latency-~80ms-FF6D00?style=for-the-badge&labelColor=0D1117" alt="latency" />
|
|
14
14
|
<img src="https://img.shields.io/badge/Background-Dispatch-CC93E6?style=for-the-badge&labelColor=0D1117" alt="background" />
|
|
@@ -50,6 +50,147 @@ Add to your AI agent (Claude Code, Cursor, OpenCode, etc.):
|
|
|
50
50
|
|
|
51
51
|
---
|
|
52
52
|
|
|
53
|
+
## Use Cases
|
|
54
|
+
|
|
55
|
+
<table>
|
|
56
|
+
<tr>
|
|
57
|
+
<td width="50%">
|
|
58
|
+
|
|
59
|
+
### DevOps & Infrastructure
|
|
60
|
+
```bash
|
|
61
|
+
# Deploy to all nodes in one call
|
|
62
|
+
omniwire_deploy(src="contabo:/app/v2.tar.gz", dst="/opt/app/")
|
|
63
|
+
|
|
64
|
+
# Rolling service restart
|
|
65
|
+
omniwire_batch([
|
|
66
|
+
{node: "node1", command: "systemctl restart app"},
|
|
67
|
+
{node: "node2", command: "systemctl restart app"}
|
|
68
|
+
], parallel=false)
|
|
69
|
+
|
|
70
|
+
# Monitor disk across fleet
|
|
71
|
+
omniwire_disk_usage()
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
</td>
|
|
75
|
+
<td width="50%">
|
|
76
|
+
|
|
77
|
+
### Security & Pentesting
|
|
78
|
+
```bash
|
|
79
|
+
# Anonymous nmap through Mullvad VPN
|
|
80
|
+
omniwire_exec(
|
|
81
|
+
node="contabo",
|
|
82
|
+
command="nmap -sV -T4 target.com",
|
|
83
|
+
via_vpn="mullvad:se",
|
|
84
|
+
background=true
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
# Rotate exit IP between scans
|
|
88
|
+
omniwire_vpn(action="rotate", node="contabo")
|
|
89
|
+
|
|
90
|
+
# Run nuclei through VPN namespace
|
|
91
|
+
omniwire_exec(command="nuclei -u target.com",
|
|
92
|
+
via_vpn="mullvad", store_as="nuclei_results")
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
</td>
|
|
96
|
+
</tr>
|
|
97
|
+
<tr>
|
|
98
|
+
<td>
|
|
99
|
+
|
|
100
|
+
### Multi-Agent Coordination
|
|
101
|
+
```bash
|
|
102
|
+
# Agent A dispatches work
|
|
103
|
+
omniwire_task_queue(action="enqueue",
|
|
104
|
+
queue="recon", task="subfinder -d target.com")
|
|
105
|
+
|
|
106
|
+
# Agent B picks it up
|
|
107
|
+
omniwire_task_queue(action="dequeue", queue="recon")
|
|
108
|
+
|
|
109
|
+
# Share findings on blackboard
|
|
110
|
+
omniwire_blackboard(action="post",
|
|
111
|
+
topic="subdomains", data="api.target.com")
|
|
112
|
+
|
|
113
|
+
# A2A messaging between agents
|
|
114
|
+
omniwire_a2a_message(action="send",
|
|
115
|
+
channel="results", message="scan complete")
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
</td>
|
|
119
|
+
<td>
|
|
120
|
+
|
|
121
|
+
### Background & Async Workflows
|
|
122
|
+
```bash
|
|
123
|
+
# Long build in background
|
|
124
|
+
omniwire_exec(
|
|
125
|
+
command="docker build -t app .",
|
|
126
|
+
node="contabo", background=true
|
|
127
|
+
)
|
|
128
|
+
# Returns: "BACKGROUND bg-abc123"
|
|
129
|
+
|
|
130
|
+
# Check progress
|
|
131
|
+
omniwire_bg(action="poll", task_id="bg-abc123")
|
|
132
|
+
# Returns: "RUNNING (45.2s)"
|
|
133
|
+
|
|
134
|
+
# Get result when done
|
|
135
|
+
omniwire_bg(action="result", task_id="bg-abc123")
|
|
136
|
+
|
|
137
|
+
# Pipeline: build → test → deploy
|
|
138
|
+
omniwire_pipeline(steps=[
|
|
139
|
+
{node: "contabo", command: "make build"},
|
|
140
|
+
{node: "contabo", command: "make test"},
|
|
141
|
+
{command: "deploy.sh", store_as: "version"}
|
|
142
|
+
])
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
</td>
|
|
146
|
+
</tr>
|
|
147
|
+
<tr>
|
|
148
|
+
<td>
|
|
149
|
+
|
|
150
|
+
### File Operations
|
|
151
|
+
```bash
|
|
152
|
+
# Transfer large dataset between nodes
|
|
153
|
+
omniwire_transfer_file(
|
|
154
|
+
src="contabo:/data/model.bin",
|
|
155
|
+
dst="hostinger:/ml/model.bin"
|
|
156
|
+
)
|
|
157
|
+
# Auto-selects: aria2c (16-conn parallel)
|
|
158
|
+
|
|
159
|
+
# Sync config to all nodes
|
|
160
|
+
omniwire_deploy(
|
|
161
|
+
src_node="contabo",
|
|
162
|
+
src_path="/etc/nginx/nginx.conf",
|
|
163
|
+
dst_path="/etc/nginx/nginx.conf"
|
|
164
|
+
)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
</td>
|
|
168
|
+
<td>
|
|
169
|
+
|
|
170
|
+
### VPN & Anonymous Operations
|
|
171
|
+
```bash
|
|
172
|
+
# Full Mullvad setup for a node
|
|
173
|
+
omniwire_vpn(action="connect", server="se",
|
|
174
|
+
node="contabo")
|
|
175
|
+
omniwire_vpn(action="quantum", config="on")
|
|
176
|
+
omniwire_vpn(action="daita", config="on")
|
|
177
|
+
omniwire_vpn(action="multihop", config="se:us")
|
|
178
|
+
omniwire_vpn(action="dns", config="adblock")
|
|
179
|
+
omniwire_vpn(action="killswitch", config="on")
|
|
180
|
+
|
|
181
|
+
# Verify anonymous IP
|
|
182
|
+
omniwire_vpn(action="ip", node="contabo")
|
|
183
|
+
|
|
184
|
+
# Node-wide VPN (mesh stays connected)
|
|
185
|
+
omniwire_vpn(action="full-on", server="de")
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
</td>
|
|
189
|
+
</tr>
|
|
190
|
+
</table>
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
53
194
|
## Architecture
|
|
54
195
|
|
|
55
196
|
```mermaid
|
|
@@ -65,7 +206,7 @@ graph TB
|
|
|
65
206
|
direction TB
|
|
66
207
|
MCP["MCP Protocol Layer<br/>stdio | SSE | REST"]
|
|
67
208
|
|
|
68
|
-
subgraph tools["
|
|
209
|
+
subgraph tools["56 Tools"]
|
|
69
210
|
direction LR
|
|
70
211
|
EXEC["Execution<br/>exec run batch<br/>broadcast pipeline bg"]
|
|
71
212
|
AGENT["Agentic<br/>store watch task<br/>a2a events locks"]
|
|
@@ -199,7 +340,7 @@ watch(assert="ready") poll until
|
|
|
199
340
|
|
|
200
341
|
---
|
|
201
342
|
|
|
202
|
-
## All
|
|
343
|
+
## All 56 Tools
|
|
203
344
|
|
|
204
345
|
> **Every tool** supports `background: true` -- returns a task ID immediately. Poll with `omniwire_bg`.
|
|
205
346
|
|
|
@@ -267,10 +408,11 @@ watch(assert="ready") poll until
|
|
|
267
408
|
| `omniwire_git` | Git commands on repos on any node |
|
|
268
409
|
| `omniwire_syslog` | Query journalctl with filters |
|
|
269
410
|
|
|
270
|
-
### Network &
|
|
411
|
+
### Network, VPN & Firewall (7)
|
|
271
412
|
|
|
272
413
|
| Tool | Description |
|
|
273
414
|
|------|-------------|
|
|
415
|
+
| `omniwire_firewall` | nftables firewall engine. Presets (server/paranoid/pentest), rate-limit, geo-block, port-knock, ban/unban, audit. Mesh always whitelisted. |
|
|
274
416
|
| `omniwire_vpn` | Manage VPN (Mullvad/OpenVPN/WireGuard/Tailscale). Split-tunnel + full-node modes. Mesh stays connected. |
|
|
275
417
|
| `omniwire_port_forward` | Create/list/close SSH tunnels |
|
|
276
418
|
| `omniwire_open_browser` | Open URL in browser on a node |
|
|
@@ -374,6 +516,15 @@ Create `~/.omniwire/mesh.json`:
|
|
|
374
516
|
|
|
375
517
|
## Changelog
|
|
376
518
|
|
|
519
|
+
<details>
|
|
520
|
+
<summary><b>v2.7.0 -- Firewall Engine</b></summary>
|
|
521
|
+
|
|
522
|
+
**`omniwire_firewall`**: nftables-based firewall engine with 17 actions. Presets (server, paranoid, minimal, pentest), rate-limiting, geo-blocking by country, port-knocking sequences, IP ban/unban, whitelist/blacklist, rule management, audit log, save/restore.
|
|
523
|
+
|
|
524
|
+
**Zero mesh impact**: wg0, wg1, tailscale0, and all mesh CIDRs (10.10.0.0/24, 10.20.0.0/24, 100.64.0.0/10) are always whitelisted before any hardening rules. nftables runs in kernel space — zero latency overhead.
|
|
525
|
+
|
|
526
|
+
</details>
|
|
527
|
+
|
|
377
528
|
<details>
|
|
378
529
|
<summary><b>v2.6.0 -- VPN Integration, Mesh-Safe Anonymous Scanning</b></summary>
|
|
379
530
|
|
|
@@ -388,7 +539,7 @@ Create `~/.omniwire/mesh.json`:
|
|
|
388
539
|
<details>
|
|
389
540
|
<summary><b>v2.5.1 -- Universal Background Dispatch</b></summary>
|
|
390
541
|
|
|
391
|
-
**`background: true`** auto-injected into all
|
|
542
|
+
**`background: true`** auto-injected into all 56 tools via server-level wrapper. Returns task ID, poll with `omniwire_bg`. New `omniwire_bg` tool for list/poll/result.
|
|
392
543
|
|
|
393
544
|
</details>
|
|
394
545
|
|
|
@@ -427,7 +578,7 @@ Security fixes, multi-path SSH failover, CyberBase integration, VaultBridge Obsi
|
|
|
427
578
|
```
|
|
428
579
|
omniwire/
|
|
429
580
|
src/
|
|
430
|
-
mcp/ MCP server (
|
|
581
|
+
mcp/ MCP server (56 tools, 3 transports)
|
|
431
582
|
nodes/ SSH2 pool, transfer engine, PTY, tunnels
|
|
432
583
|
sync/ CyberSync + CyberBase (PostgreSQL, Obsidian, encryption)
|
|
433
584
|
protocol/ Mesh config, types, path parsing
|
|
@@ -441,14 +592,16 @@ omniwire/
|
|
|
441
592
|
|
|
442
593
|
<br/>
|
|
443
594
|
|
|
444
|
-
<
|
|
445
|
-
<
|
|
446
|
-
|
|
595
|
+
<p align="center">
|
|
596
|
+
<a href="https://www.npmjs.com/package/omniwire"><img src="https://img.shields.io/npm/dm/omniwire?style=flat-square&color=59C2FF&labelColor=0D1117&label=downloads" alt="downloads" /></a>
|
|
597
|
+
<a href="https://github.com/VoidChecksum/omniwire/stargazers"><img src="https://img.shields.io/github/stars/VoidChecksum/omniwire?style=flat-square&color=E6B450&labelColor=0D1117" alt="stars" /></a>
|
|
598
|
+
<a href="https://github.com/VoidChecksum/omniwire/issues"><img src="https://img.shields.io/github/issues/VoidChecksum/omniwire?style=flat-square&color=FF6D00&labelColor=0D1117" alt="issues" /></a>
|
|
599
|
+
</p>
|
|
447
600
|
|
|
448
601
|
<p align="center">
|
|
449
602
|
<picture>
|
|
450
|
-
<source media="(prefers-color-scheme: dark)" srcset="
|
|
451
|
-
<source media="(prefers-color-scheme: light)" srcset="
|
|
452
|
-
<img alt="
|
|
603
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/footer-dark.svg" />
|
|
604
|
+
<source media="(prefers-color-scheme: light)" srcset="assets/footer-light.svg" />
|
|
605
|
+
<img alt="Built for the machines that build for us." src="assets/footer-dark.svg" width="900" />
|
|
453
606
|
</picture>
|
|
454
607
|
</p>
|
package/assets/banner-dark.svg
CHANGED
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
<!-- Stats bar -->
|
|
63
63
|
<g font-family="'Segoe UI Mono', 'SF Mono', monospace" font-size="13" fill="#59C2FF" opacity="0.7">
|
|
64
|
-
<text x="175" y="175" text-anchor="middle">
|
|
64
|
+
<text x="175" y="175" text-anchor="middle">56 MCP Tools</text>
|
|
65
65
|
<text x="325" y="175" text-anchor="middle">A2A Protocol</text>
|
|
66
66
|
<text x="450" y="175" text-anchor="middle">~80ms Latency</text>
|
|
67
67
|
<text x="575" y="175" text-anchor="middle">LZ4 Transfer</text>
|
package/assets/banner-light.svg
CHANGED
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
<!-- Stats bar -->
|
|
56
56
|
<g font-family="'Segoe UI Mono', 'SF Mono', monospace" font-size="13" fill="#1A3A5C" opacity="0.6">
|
|
57
|
-
<text x="175" y="175" text-anchor="middle">
|
|
57
|
+
<text x="175" y="175" text-anchor="middle">56 MCP Tools</text>
|
|
58
58
|
<text x="325" y="175" text-anchor="middle">A2A Protocol</text>
|
|
59
59
|
<text x="450" y="175" text-anchor="middle">~80ms Latency</text>
|
|
60
60
|
<text x="575" y="175" text-anchor="middle">LZ4 Transfer</text>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<svg width="900" height="120" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" style="stop-color:#0D1117"/>
|
|
5
|
+
<stop offset="40%" style="stop-color:#0D1B2A"/>
|
|
6
|
+
<stop offset="70%" style="stop-color:#162B44"/>
|
|
7
|
+
<stop offset="100%" style="stop-color:#1A3A5C"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
</defs>
|
|
10
|
+
|
|
11
|
+
<!-- Top wave -->
|
|
12
|
+
<path d="M0,0 L0,20 Q150,45 300,20 Q450,-5 600,20 Q750,45 900,20 L900,0 Z" fill="#59C2FF" opacity="0.08"/>
|
|
13
|
+
<path d="M0,0 L0,15 Q200,40 400,15 Q600,-10 900,15 L900,0 Z" fill="#59C2FF" opacity="0.05"/>
|
|
14
|
+
|
|
15
|
+
<!-- Background -->
|
|
16
|
+
<rect y="20" width="900" height="100" fill="url(#bg)"/>
|
|
17
|
+
|
|
18
|
+
<!-- Tagline -->
|
|
19
|
+
<text x="450" y="62" font-family="'Segoe UI', system-ui, -apple-system, sans-serif" font-size="13" font-weight="400" fill="#8B949E" text-anchor="middle">Built for the machines that build for us.</text>
|
|
20
|
+
|
|
21
|
+
<!-- Bottom accent dots -->
|
|
22
|
+
<g fill="#59C2FF" opacity="0.12">
|
|
23
|
+
<circle cx="380" cy="85" r="1.5"/>
|
|
24
|
+
<circle cx="420" cy="85" r="1.5"/>
|
|
25
|
+
<circle cx="450" cy="85" r="2"/>
|
|
26
|
+
<circle cx="480" cy="85" r="1.5"/>
|
|
27
|
+
<circle cx="520" cy="85" r="1.5"/>
|
|
28
|
+
</g>
|
|
29
|
+
|
|
30
|
+
<!-- Subtle bottom line -->
|
|
31
|
+
<line x1="350" y1="95" x2="550" y2="95" stroke="#59C2FF" stroke-width="0.5" opacity="0.1"/>
|
|
32
|
+
</svg>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<svg width="900" height="120" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" style="stop-color:#FFFFFF"/>
|
|
5
|
+
<stop offset="40%" style="stop-color:#F0F4F8"/>
|
|
6
|
+
<stop offset="70%" style="stop-color:#D8E2EE"/>
|
|
7
|
+
<stop offset="100%" style="stop-color:#B8CCE0"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
</defs>
|
|
10
|
+
|
|
11
|
+
<!-- Top wave -->
|
|
12
|
+
<path d="M0,0 L0,20 Q150,45 300,20 Q450,-5 600,20 Q750,45 900,20 L900,0 Z" fill="#59C2FF" opacity="0.12"/>
|
|
13
|
+
<path d="M0,0 L0,15 Q200,40 400,15 Q600,-10 900,15 L900,0 Z" fill="#59C2FF" opacity="0.08"/>
|
|
14
|
+
|
|
15
|
+
<!-- Background -->
|
|
16
|
+
<rect y="20" width="900" height="100" fill="url(#bg)"/>
|
|
17
|
+
|
|
18
|
+
<!-- Tagline -->
|
|
19
|
+
<text x="450" y="62" font-family="'Segoe UI', system-ui, -apple-system, sans-serif" font-size="13" font-weight="400" fill="#586069" text-anchor="middle">Built for the machines that build for us.</text>
|
|
20
|
+
|
|
21
|
+
<!-- Bottom accent dots -->
|
|
22
|
+
<g fill="#1A3A5C" opacity="0.15">
|
|
23
|
+
<circle cx="380" cy="85" r="1.5"/>
|
|
24
|
+
<circle cx="420" cy="85" r="1.5"/>
|
|
25
|
+
<circle cx="450" cy="85" r="2"/>
|
|
26
|
+
<circle cx="480" cy="85" r="1.5"/>
|
|
27
|
+
<circle cx="520" cy="85" r="1.5"/>
|
|
28
|
+
</g>
|
|
29
|
+
|
|
30
|
+
<!-- Subtle bottom line -->
|
|
31
|
+
<line x1="350" y1="95" x2="550" y2="95" stroke="#1A3A5C" stroke-width="0.5" opacity="0.1"/>
|
|
32
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
complete -c omniwire -l stdio -d 'MCP stdio transport'
|
|
2
|
+
complete -c omniwire -l sse-port -d 'SSE transport port' -x
|
|
3
|
+
complete -c omniwire -l rest-port -d 'REST transport port' -x
|
|
4
|
+
complete -c omniwire -l no-sync -d 'Disable CyberSync'
|
|
5
|
+
complete -c omniwire -l version -d 'Show version'
|
|
6
|
+
complete -c omniwire -l help -d 'Show help'
|
|
7
|
+
# Alias
|
|
8
|
+
complete -c ow -w omniwire
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#compdef omniwire ow
|
|
2
|
+
_omniwire() {
|
|
3
|
+
_arguments \
|
|
4
|
+
'--stdio[MCP stdio transport]' \
|
|
5
|
+
'--sse-port=[SSE transport port]:port:' \
|
|
6
|
+
'--rest-port=[REST transport port]:port:' \
|
|
7
|
+
'--no-sync[Disable CyberSync]' \
|
|
8
|
+
'--version[Show version]' \
|
|
9
|
+
'--help[Show help]'
|
|
10
|
+
}
|
|
11
|
+
_omniwire "$@"
|
package/dist/mcp/index.js
CHANGED
|
@@ -16,9 +16,18 @@ import { allNodes } from '../protocol/config.js';
|
|
|
16
16
|
import { DEFAULT_SYNC_CONFIG } from '../sync/types.js';
|
|
17
17
|
const args = process.argv.slice(2);
|
|
18
18
|
const useStdio = args.includes('--stdio');
|
|
19
|
+
const useJson = args.includes('--json');
|
|
19
20
|
const ssePort = parseInt(args.find((a) => a.startsWith('--sse-port='))?.split('=')[1] ?? '3200');
|
|
20
21
|
const restPort = parseInt(args.find((a) => a.startsWith('--rest-port='))?.split('=')[1] ?? '3201');
|
|
21
22
|
const noSync = args.includes('--no-sync');
|
|
23
|
+
function log(msg, data) {
|
|
24
|
+
if (useJson) {
|
|
25
|
+
process.stderr.write(JSON.stringify({ msg, ...data }) + '\n');
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
process.stderr.write(msg + '\n');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
22
31
|
function detectNodeId() {
|
|
23
32
|
if (process.platform === 'win32')
|
|
24
33
|
return 'windows';
|
|
@@ -49,10 +58,10 @@ async function main() {
|
|
|
49
58
|
const manifests = getManifests(os);
|
|
50
59
|
const engine = new SyncEngine(syncDb, config, manager, transfer);
|
|
51
60
|
registerSyncTools(server, syncDb, engine, manifests, nodeId, manager, transfer);
|
|
52
|
-
|
|
61
|
+
log('CyberSync: 12 tools registered', { tools: 12, node: nodeId });
|
|
53
62
|
}
|
|
54
63
|
catch (err) {
|
|
55
|
-
|
|
64
|
+
log(`CyberSync init failed (continuing without sync): ${err.message}`, { error: err.message });
|
|
56
65
|
}
|
|
57
66
|
}
|
|
58
67
|
if (useStdio) {
|
|
@@ -62,7 +71,7 @@ async function main() {
|
|
|
62
71
|
else {
|
|
63
72
|
startSSEServer(server, ssePort);
|
|
64
73
|
startRESTServer(manager, transfer, restPort);
|
|
65
|
-
|
|
74
|
+
log(`OmniWire MCP: SSE on :${ssePort}, REST on :${restPort}`, { ssePort, restPort });
|
|
66
75
|
}
|
|
67
76
|
process.on('SIGINT', async () => {
|
|
68
77
|
if (syncDb)
|
|
@@ -72,7 +81,7 @@ async function main() {
|
|
|
72
81
|
});
|
|
73
82
|
}
|
|
74
83
|
main().catch((err) => {
|
|
75
|
-
|
|
84
|
+
log(`Fatal: ${err.message}`, { fatal: true, error: err.message });
|
|
76
85
|
process.exit(1);
|
|
77
86
|
});
|
|
78
87
|
//# sourceMappingURL=index.js.map
|
package/dist/mcp/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AAEA,wDAAwD;AACxD,6CAA6C;AAC7C,sEAAsE;AAEtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAC1C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAA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