@datafrog-io/n2n-nexus 0.1.7 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datafrog-io/n2n-nexus",
3
- "version": "0.1.7",
3
+ "version": "0.2.0",
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",
@@ -10,6 +10,8 @@
10
10
  "files": [
11
11
  "build",
12
12
  "README.md",
13
+ "README_zh.md",
14
+ "docs",
13
15
  "LICENSE"
14
16
  ],
15
17
  "keywords": [
@@ -43,14 +45,17 @@
43
45
  "prepublishOnly": "npm run build"
44
46
  },
45
47
  "dependencies": {
46
- "@modelcontextprotocol/sdk": "1.25.1"
48
+ "@modelcontextprotocol/sdk": "1.25.1",
49
+ "better-sqlite3": "^12.5.0",
50
+ "zod": "^4.3.2"
47
51
  },
48
52
  "devDependencies": {
49
- "@eslint/js": "^9.16.0",
50
- "@types/node": "^22.0.0",
51
- "eslint": "^9.16.0",
52
- "typescript": "^5.7.2",
53
- "typescript-eslint": "^8.18.0",
54
- "vitest": "^2.1.8"
53
+ "@eslint/js": "^9.39.2",
54
+ "@types/better-sqlite3": "^7.6.13",
55
+ "@types/node": "^25.0.3",
56
+ "eslint": "^9.39.2",
57
+ "typescript": "^5.9.3",
58
+ "typescript-eslint": "^8.51.0",
59
+ "vitest": "^4.0.16"
55
60
  }
56
- }
61
+ }
@@ -1,228 +0,0 @@
1
- /**
2
- * Tool definitions for MCP ListToolsRequestSchema
3
- */
4
- export const TOOL_DEFINITIONS = [
5
- {
6
- name: "register_session_context",
7
- description: "[IDENTITY] Declare the PROJECT identity. Format: [prefix]_[technical-identifier]. (e.g., 'web_datafrog.io', 'mcp_nexus-core').",
8
- inputSchema: {
9
- type: "object",
10
- properties: {
11
- projectId: {
12
- type: "string",
13
- description: "Strict flat identifier. MUST start with a type-prefix (web_, api_, chrome_, vscode_, mcp_, android_, ios_, flutter_, desktop_, lib_, bot_, infra_, doc_) followed by an underscore and a technical name (Domain for websites, Repo name/Slug for code). Use kebab-case. No hierarchy dots except in domains."
14
- }
15
- },
16
- required: ["projectId"]
17
- }
18
- },
19
- {
20
- name: "sync_project_assets",
21
- description: "CRITICAL: [PREREQUISITE: register_session_context] Sync full project state. Both manifest and documentation are MANDATORY.",
22
- inputSchema: {
23
- type: "object",
24
- properties: {
25
- manifest: {
26
- type: "object",
27
- description: "Full ProjectManifest metadata.",
28
- properties: {
29
- id: { type: "string", description: "Project ID. MUST follow '[prefix]_[technical-name]' format and match active session." },
30
- name: { type: "string" },
31
- description: { type: "string" },
32
- techStack: { type: "array", items: { type: "string" } },
33
- relations: {
34
- type: "array",
35
- items: {
36
- type: "object",
37
- properties: {
38
- targetId: { type: "string", description: "ID of the target project (e.g., 'acme.auth-service')." },
39
- type: { type: "string", enum: ["dependency", "parent", "child", "related"] }
40
- },
41
- required: ["targetId", "type"]
42
- }
43
- },
44
- lastUpdated: { type: "string", description: "ISO timestamp (e.g., 2025-12-29T...)." },
45
- repositoryUrl: { type: "string", description: "GitHub repository URL." },
46
- endpoints: {
47
- type: "array",
48
- items: {
49
- type: "object",
50
- properties: {
51
- name: { type: "string" },
52
- url: { type: "string" },
53
- description: { type: "string" }
54
- },
55
- required: ["name", "url", "description"]
56
- }
57
- },
58
- localPath: { type: "string", description: "Physical disk path of the project." },
59
- apiSpec: {
60
- type: "array",
61
- items: {
62
- type: "object",
63
- properties: {
64
- method: { type: "string" },
65
- path: { type: "string" },
66
- summary: { type: "string" }
67
- },
68
- required: ["method", "path", "summary"]
69
- }
70
- }
71
- },
72
- required: ["id", "name", "description", "techStack", "relations", "lastUpdated", "repositoryUrl", "localPath", "endpoints", "apiSpec"]
73
- },
74
- internalDocs: { type: "string", description: "Mandatory technical implementation guide (Markdown)." }
75
- },
76
- required: ["manifest", "internalDocs"]
77
- }
78
- },
79
- {
80
- name: "upload_project_asset",
81
- description: "Upload a file. Both fileName and base64Content are MANDATORY.",
82
- inputSchema: {
83
- type: "object",
84
- properties: {
85
- fileName: { type: "string" },
86
- base64Content: { type: "string" }
87
- },
88
- required: ["fileName", "base64Content"]
89
- }
90
- },
91
- {
92
- name: "get_global_topology",
93
- description: "Retrieve complete project relationship graph. Use this to understand current IDs and their connections.",
94
- inputSchema: { type: "object", properties: {} }
95
- },
96
- {
97
- name: "list_projects",
98
- description: "List all existing projects registered in the Nexus Hub. Use this to find correct IDs before performing project-specific operations.",
99
- inputSchema: { type: "object", properties: {} }
100
- },
101
- {
102
- name: "read_project",
103
- description: "Read project data by ID. Returns specific data slices without exposing internal paths.",
104
- inputSchema: {
105
- type: "object",
106
- properties: {
107
- projectId: { type: "string", description: "Project ID (e.g., 'web_datafrog.io', 'mcp_nexus-hub')." },
108
- include: {
109
- type: "string",
110
- enum: ["manifest", "docs", "repo", "endpoints", "api", "relations", "summary", "all"],
111
- description: "Data slice: manifest, docs, repo (git URL), endpoints, api (spec), relations, summary (brief), or all."
112
- }
113
- },
114
- required: ["projectId"]
115
- }
116
- },
117
- {
118
- name: "post_global_discussion",
119
- description: "Join the 'Nexus Meeting Room' to collaborate with other AI agents. Use this for initiating meetings, making cross-project proposals, or announcing key decisions. Every message is shared across all assistants in real-time.",
120
- inputSchema: {
121
- type: "object",
122
- properties: {
123
- message: { type: "string", description: "The core content of your speech, proposal, or announcement." },
124
- category: {
125
- type: "string",
126
- enum: ["MEETING_START", "PROPOSAL", "DECISION", "UPDATE", "CHAT"],
127
- description: "The nature of this message. Use MEETING_START to call for a synchronous discussion."
128
- }
129
- },
130
- required: ["message"]
131
- }
132
- },
133
- {
134
- name: "read_recent_discussion",
135
- description: "Quickly 'listen' to the last few messages in the Nexus Room to catch up on the context of the current meeting or collaboration.",
136
- inputSchema: {
137
- type: "object",
138
- properties: {
139
- count: { type: "number", description: "Number of recent messages to retrieve (defaults to 10).", default: 10 }
140
- }
141
- }
142
- },
143
- {
144
- name: "update_global_strategy",
145
- description: "Overwrite master strategy. Content is MANDATORY.",
146
- inputSchema: { type: "object", properties: { content: { type: "string" } }, required: ["content"] }
147
- },
148
- {
149
- name: "sync_global_doc",
150
- description: "Create or update a global document. Returns the document ID.",
151
- inputSchema: {
152
- type: "object",
153
- properties: {
154
- docId: { type: "string", description: "Unique document identifier (e.g., 'roadmap-2025', 'coding-standards')" },
155
- title: { type: "string", description: "Human-readable document title" },
156
- content: { type: "string", description: "Markdown content of the document" }
157
- },
158
- required: ["docId", "title", "content"]
159
- }
160
- },
161
- {
162
- name: "list_global_docs",
163
- description: "List all global documents with their metadata (title, lastUpdated, updatedBy).",
164
- inputSchema: { type: "object", properties: {} }
165
- },
166
- {
167
- name: "read_global_doc",
168
- description: "Read the content of a specific global document.",
169
- inputSchema: {
170
- type: "object",
171
- properties: {
172
- docId: { type: "string", description: "Document identifier" }
173
- },
174
- required: ["docId"]
175
- }
176
- },
177
- {
178
- name: "update_project",
179
- description: "Partially update a project's manifest. Only provided fields will be updated.",
180
- inputSchema: {
181
- type: "object",
182
- properties: {
183
- projectId: { type: "string", description: "Project ID to update (e.g., 'web_datafrog.io')." },
184
- patch: {
185
- type: "object",
186
- description: "Fields to update (e.g., description, techStack, endpoints, apiSpec, relations)",
187
- additionalProperties: true
188
- }
189
- },
190
- required: ["projectId", "patch"]
191
- }
192
- },
193
- {
194
- name: "rename_project",
195
- description: "Rename a project ID with automatic cascading updates to all relation references.",
196
- inputSchema: {
197
- type: "object",
198
- properties: {
199
- oldId: { type: "string", description: "Current project ID (e.g., 'web_oldname.com')." },
200
- newId: { type: "string", description: "New project ID following the '[prefix]_[name]' standard." }
201
- },
202
- required: ["oldId", "newId"]
203
- }
204
- },
205
- {
206
- name: "moderator_maintenance",
207
- description: "[ADMIN ONLY] Prune or clear logs. Both action and count are MANDATORY.",
208
- inputSchema: {
209
- type: "object",
210
- properties: {
211
- action: { type: "string", enum: ["prune", "clear"] },
212
- count: { type: "number", description: "Number of items (use 0 for 'clear')." }
213
- },
214
- required: ["action", "count"]
215
- }
216
- },
217
- {
218
- name: "delete_project",
219
- description: "[ADMIN ONLY] Completely remove a project, its manifest, and all its assets from Nexus.",
220
- inputSchema: {
221
- type: "object",
222
- properties: {
223
- projectId: { type: "string", description: "The ID of the project to destroy." }
224
- },
225
- required: ["projectId"]
226
- }
227
- }
228
- ];