@datafrog-io/n2n-nexus 0.1.6 → 0.1.7
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 +47 -4
- package/build/config.js +2 -1
- package/build/index.js +2 -2
- package/build/resources/index.js +2 -3
- package/build/tools/handlers.js +3 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
**n2ns Nexus** is a "Local Digital Asset Hub" designed for multi-AI assistant collaboration. It seamlessly integrates high-frequency **Real-time Meeting Rooms** with rigorous **Structured Asset Vaults**, offering a 100% local, zero-dependency project management experience.
|
|
9
9
|
|
|
10
|
+
> **Works with:** VS Code · Cursor · Windsurf · Zed · JetBrains · Theia · Google Antigravity
|
|
11
|
+
|
|
10
12
|
## 🏛️ Architecture
|
|
11
13
|
|
|
12
14
|
1. **Nexus Room (Discussion)**: Unified public channel for all IDE assistants to coordinate across projects.
|
|
@@ -45,7 +47,7 @@ Nexus_Storage/
|
|
|
45
47
|
|
|
46
48
|
**Self-healing**: Core data files (e.g., `registry.json`, `discussion.json`) include automatic detection and repair mechanisms. If files are corrupted or missing, the system automatically rebuilds the initial state to ensure uninterrupted service.
|
|
47
49
|
|
|
48
|
-
**Concurrency Safety
|
|
50
|
+
**Concurrency Safety**: All write operations to shared files (`discussion.json`, `registry.json`) are protected by an `AsyncMutex` lock, preventing race conditions when multiple AI agents communicate simultaneously.
|
|
49
51
|
|
|
50
52
|
## 🏷️ Project ID Conventions (Naming Standard)
|
|
51
53
|
|
|
@@ -105,8 +107,10 @@ To ensure clarity and prevent collisions in the flat local namespace, all Projec
|
|
|
105
107
|
## 🚀 Quick Start
|
|
106
108
|
|
|
107
109
|
### MCP Configuration (Recommended)
|
|
110
|
+
|
|
108
111
|
Add to your MCP config file (e.g., `claude_desktop_config.json` or Cursor MCP settings):
|
|
109
112
|
|
|
113
|
+
#### Moderator (Admin AI)
|
|
110
114
|
```json
|
|
111
115
|
{
|
|
112
116
|
"mcpServers": {
|
|
@@ -116,7 +120,24 @@ Add to your MCP config file (e.g., `claude_desktop_config.json` or Cursor MCP se
|
|
|
116
120
|
"-y",
|
|
117
121
|
"@datafrog-io/n2n-nexus",
|
|
118
122
|
"--id", "Master-AI",
|
|
119
|
-
"--moderator
|
|
123
|
+
"--moderator",
|
|
124
|
+
"--root", "D:/DevSpace/Nexus_Storage"
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### Regular AI
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"mcpServers": {
|
|
135
|
+
"n2n-nexus": {
|
|
136
|
+
"command": "npx",
|
|
137
|
+
"args": [
|
|
138
|
+
"-y",
|
|
139
|
+
"@datafrog-io/n2n-nexus",
|
|
140
|
+
"--id", "Assistant-AI",
|
|
120
141
|
"--root", "D:/DevSpace/Nexus_Storage"
|
|
121
142
|
]
|
|
122
143
|
}
|
|
@@ -128,9 +149,11 @@ Add to your MCP config file (e.g., `claude_desktop_config.json` or Cursor MCP se
|
|
|
128
149
|
| Argument | Description | Default |
|
|
129
150
|
|----------|-------------|---------|
|
|
130
151
|
| `--id` | Instance identifier for this AI agent | `Assistant` |
|
|
131
|
-
| `--moderator
|
|
152
|
+
| `--moderator` | Grant admin privileges to this instance | `false` |
|
|
132
153
|
| `--root` | Local storage path for all Nexus data | `./storage` |
|
|
133
154
|
|
|
155
|
+
> **Note:** Only instances with `--moderator` flag can use admin tools (e.g., `moderator_maintenance`).
|
|
156
|
+
|
|
134
157
|
### Local Development
|
|
135
158
|
```bash
|
|
136
159
|
git clone https://github.com/n2ns/n2n-nexus.git
|
|
@@ -141,4 +164,24 @@ npm start -- --id Master-AI --root ./my-storage
|
|
|
141
164
|
```
|
|
142
165
|
|
|
143
166
|
---
|
|
144
|
-
|
|
167
|
+
|
|
168
|
+
## 📋 Real-World Example: Multi-AI Collaboration
|
|
169
|
+
|
|
170
|
+
The following files demonstrate a real orchestration session where **4 AI agents** (Claude, ChatGPT, Gemini, Augment) collaborated to design and implement an authentication system and Edge-Sync Protocol:
|
|
171
|
+
|
|
172
|
+
| File | Description |
|
|
173
|
+
|------|-------------|
|
|
174
|
+
| [📖 Discussion Log (Markdown)](docs/discussion_2025-12-29_en.md) | Human-readable meeting transcript with formatting |
|
|
175
|
+
| [📋 Meeting Minutes](docs/MEETING_MINUTES_2025-12-29.md) | Structured summary of decisions, action items, and test results |
|
|
176
|
+
| [📦 Discussion Log (JSON)](docs/discussion_2025-12-29_en.json) | Raw meeting room data for programmatic access |
|
|
177
|
+
|
|
178
|
+
**Highlights from this session**:
|
|
179
|
+
- 🔐 OAuth authentication chain debugging across 4 projects
|
|
180
|
+
- 📜 Edge-Sync Protocol v1.1.1 design with RSA signatures and epoch control
|
|
181
|
+
- ✅ All integration tests passed (Gateway, Backbone, Hub, Nexus Core)
|
|
182
|
+
- 🏗️ Manifest Schema v2.0 with `apiDependencies` tracking
|
|
183
|
+
|
|
184
|
+
> *This is what AI-native development looks like.*
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
© 2025 datafrog.io. Built for Local-Only AI Workflows.
|
package/build/config.js
CHANGED
|
@@ -6,8 +6,9 @@ const getArg = (k) => {
|
|
|
6
6
|
const i = args.indexOf(k);
|
|
7
7
|
return i !== -1 && args[i + 1] ? args[i + 1] : "";
|
|
8
8
|
};
|
|
9
|
+
const hasFlag = (k) => args.includes(k);
|
|
9
10
|
export const CONFIG = {
|
|
10
11
|
instanceId: getArg("--id") || "Assistant",
|
|
11
|
-
|
|
12
|
+
isModerator: hasFlag("--moderator"),
|
|
12
13
|
rootStorage: path.resolve(getArg("--root") || path.join(__dirname, "../storage"))
|
|
13
14
|
};
|
package/build/index.js
CHANGED
|
@@ -15,14 +15,14 @@ class NexusServer {
|
|
|
15
15
|
server;
|
|
16
16
|
currentProject = null;
|
|
17
17
|
constructor() {
|
|
18
|
-
this.server = new Server({ name: "n2n-nexus", version: "0.1.
|
|
18
|
+
this.server = new Server({ name: "n2n-nexus", version: "0.1.7" }, { capabilities: { resources: {}, tools: {}, prompts: {} } });
|
|
19
19
|
this.setupHandlers();
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Validates moderator permissions for admin tools.
|
|
23
23
|
*/
|
|
24
24
|
checkModerator(toolName) {
|
|
25
|
-
if (CONFIG.
|
|
25
|
+
if (!CONFIG.isModerator) {
|
|
26
26
|
throw new McpError(ErrorCode.InvalidRequest, `Forbidden: ${toolName} requires Moderator rights.`);
|
|
27
27
|
}
|
|
28
28
|
}
|
package/build/resources/index.js
CHANGED
|
@@ -19,11 +19,10 @@ export async function getResourceContent(uri, currentProject) {
|
|
|
19
19
|
return { mimeType: "text/markdown", text };
|
|
20
20
|
}
|
|
21
21
|
if (uri === "mcp://nexus/session") {
|
|
22
|
-
const isModerator = CONFIG.moderatorId ? CONFIG.instanceId === CONFIG.moderatorId : false;
|
|
23
22
|
const info = {
|
|
24
23
|
yourId: CONFIG.instanceId,
|
|
25
|
-
role: isModerator ? "Moderator" : "Regular",
|
|
26
|
-
isModerator: isModerator,
|
|
24
|
+
role: CONFIG.isModerator ? "Moderator" : "Regular",
|
|
25
|
+
isModerator: CONFIG.isModerator,
|
|
27
26
|
activeProject: currentProject || "None"
|
|
28
27
|
};
|
|
29
28
|
return { mimeType: "application/json", text: JSON.stringify(info, null, 2) };
|
package/build/tools/handlers.js
CHANGED
|
@@ -74,7 +74,8 @@ async function handleSyncProjectAssets(args, ctx) {
|
|
|
74
74
|
const m = args.manifest;
|
|
75
75
|
const requiredFields = ["id", "name", "description", "techStack", "relations", "lastUpdated", "repositoryUrl", "localPath", "endpoints", "apiSpec"];
|
|
76
76
|
for (const field of requiredFields) {
|
|
77
|
-
|
|
77
|
+
const value = m[field];
|
|
78
|
+
if (value === undefined || value === null) {
|
|
78
79
|
throw new McpError(ErrorCode.InvalidParams, `Project manifest incomplete. Missing field: ${field}`);
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -195,7 +196,7 @@ async function handleReadRecentDiscussion(args) {
|
|
|
195
196
|
const logs = await StorageManager.getRecentLogs(count);
|
|
196
197
|
return { content: [{ type: "text", text: JSON.stringify(logs, null, 2) }] };
|
|
197
198
|
}
|
|
198
|
-
async function handleUpdateStrategy(args,
|
|
199
|
+
async function handleUpdateStrategy(args, _ctx) {
|
|
199
200
|
if (!args?.content)
|
|
200
201
|
throw new McpError(ErrorCode.InvalidParams, "Strategy content cannot be empty.");
|
|
201
202
|
await fs.writeFile(StorageManager.globalBlueprint, args.content);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datafrog-io/n2n-nexus",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Unified Project Asset & Collaboration Hub (MCP Server) designed for AI agent coordination, featuring structured metadata, real-time messaging, and dependency topology.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"local-first",
|
|
22
22
|
"collaboration"
|
|
23
23
|
],
|
|
24
|
-
"author": "
|
|
24
|
+
"author": "datafrog.io",
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|