@adverant/nexus-cowork-plugin 1.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/dist/client.d.ts +95 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +277 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +112 -0
- package/dist/index.js.map +1 -0
- package/dist/sync.d.ts +18 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +113 -0
- package/dist/sync.js.map +1 -0
- package/dist/tools.d.ts +11 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +463 -0
- package/dist/tools.js.map +1 -0
- package/package.json +36 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Nexus API Client
|
|
3
|
+
*
|
|
4
|
+
* Merged from:
|
|
5
|
+
* - nexus-skills-mcp/src/index.ts (Skills Engine client)
|
|
6
|
+
* - nexus-desktop-extension/src/client.ts (GraphRAG/MageAgent client)
|
|
7
|
+
*
|
|
8
|
+
* Single axios instance, single Bearer token, all Nexus endpoints.
|
|
9
|
+
*/
|
|
10
|
+
export interface NexusConfig {
|
|
11
|
+
apiUrl: string;
|
|
12
|
+
apiKey: string;
|
|
13
|
+
userId?: string;
|
|
14
|
+
timeout?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface NexusResponse<T = any> {
|
|
17
|
+
success: boolean;
|
|
18
|
+
data?: T;
|
|
19
|
+
error?: {
|
|
20
|
+
code: string;
|
|
21
|
+
message: string;
|
|
22
|
+
details?: any;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare class NexusClient {
|
|
26
|
+
private http;
|
|
27
|
+
private skillsHttp;
|
|
28
|
+
private config;
|
|
29
|
+
constructor(config: NexusConfig);
|
|
30
|
+
private formatError;
|
|
31
|
+
listSkills(params?: {
|
|
32
|
+
limit?: number;
|
|
33
|
+
offset?: number;
|
|
34
|
+
status?: string;
|
|
35
|
+
category?: string;
|
|
36
|
+
search?: string;
|
|
37
|
+
}): Promise<any>;
|
|
38
|
+
getSkill(skillId: string): Promise<any>;
|
|
39
|
+
matchPrompt(prompt: string, limit?: number): Promise<any>;
|
|
40
|
+
discoverSkills(query: string, categories?: string[], minRelevance?: number, limit?: number): Promise<any>;
|
|
41
|
+
invokeSkill(skillId: string, input?: Record<string, unknown>): Promise<any>;
|
|
42
|
+
getQualityScore(skillId: string): Promise<any>;
|
|
43
|
+
getTopSkills(limit?: number): Promise<any>;
|
|
44
|
+
recordExecution(record: {
|
|
45
|
+
skillId: string;
|
|
46
|
+
skillName: string;
|
|
47
|
+
status: string;
|
|
48
|
+
duration?: number;
|
|
49
|
+
input?: string;
|
|
50
|
+
output?: string;
|
|
51
|
+
error?: string;
|
|
52
|
+
}): Promise<any>;
|
|
53
|
+
getRelatedSkills(skillId: string): Promise<any>;
|
|
54
|
+
synthesizeSkills(params: {
|
|
55
|
+
sourceSkillIds: string[];
|
|
56
|
+
strategy: string;
|
|
57
|
+
targetName: string;
|
|
58
|
+
prompt?: string;
|
|
59
|
+
focusAreas?: string[];
|
|
60
|
+
visibility?: string;
|
|
61
|
+
}): Promise<any>;
|
|
62
|
+
storeMemory(content: string, tags?: string[], metadata?: any): Promise<NexusResponse>;
|
|
63
|
+
recallMemory(query: string, limit?: number, scoreThreshold?: number): Promise<NexusResponse>;
|
|
64
|
+
storeEpisode(content: string, type?: string, metadata?: any): Promise<NexusResponse>;
|
|
65
|
+
recallEpisodes(query: string, limit?: number): Promise<NexusResponse>;
|
|
66
|
+
storeDocument(content: string, title?: string, metadata?: any): Promise<NexusResponse>;
|
|
67
|
+
getDocument(documentId: string, includeChunks?: boolean): Promise<NexusResponse>;
|
|
68
|
+
listDocuments(limit?: number, offset?: number): Promise<NexusResponse>;
|
|
69
|
+
ingestUrl(url: string, options?: any): Promise<NexusResponse>;
|
|
70
|
+
validateUrl(url: string): Promise<NexusResponse>;
|
|
71
|
+
checkIngestionJob(jobId: string): Promise<NexusResponse>;
|
|
72
|
+
storeEntity(domain: string, entityType: string, textContent: string, tags?: string[], metadata?: any): Promise<NexusResponse>;
|
|
73
|
+
queryEntities(domain?: string, entityType?: string, searchText?: string, limit?: number): Promise<NexusResponse>;
|
|
74
|
+
getEntity(entityId: string): Promise<NexusResponse>;
|
|
75
|
+
getEntityHistory(entityId: string): Promise<NexusResponse>;
|
|
76
|
+
getEntityHierarchy(entityId: string): Promise<NexusResponse>;
|
|
77
|
+
getFacts(subject: string): Promise<NexusResponse>;
|
|
78
|
+
crossDomainQuery(domains: string[], query: string, maxResults?: number): Promise<NexusResponse>;
|
|
79
|
+
search(query: string, filters?: any, limit?: number): Promise<NexusResponse>;
|
|
80
|
+
retrieve(query: string, strategy?: string, limit?: number): Promise<NexusResponse>;
|
|
81
|
+
enhancedRetrieve(query: string, includeDocuments?: boolean, includeEpisodic?: boolean, maxTokens?: number): Promise<NexusResponse>;
|
|
82
|
+
orchestrate(task: string, maxAgents?: number, timeout?: number): Promise<NexusResponse>;
|
|
83
|
+
collaborate(objective: string, agents?: any[], iterations?: number): Promise<NexusResponse>;
|
|
84
|
+
competition(challenge: string, competitorCount?: number, criteria?: string[]): Promise<NexusResponse>;
|
|
85
|
+
analyze(topic: string, depth?: string, includeMemory?: boolean): Promise<NexusResponse>;
|
|
86
|
+
synthesizeInfo(sources: string[], objective?: string, format?: string): Promise<NexusResponse>;
|
|
87
|
+
getTaskStatus(taskId: string): Promise<NexusResponse>;
|
|
88
|
+
listAgents(): Promise<NexusResponse>;
|
|
89
|
+
getAgentDetails(agentId: string): Promise<NexusResponse>;
|
|
90
|
+
getHealth(detailed?: boolean): Promise<NexusResponse>;
|
|
91
|
+
getStats(includeHealth?: boolean): Promise<NexusResponse>;
|
|
92
|
+
getModelStats(): Promise<NexusResponse>;
|
|
93
|
+
selectModel(complexity: number, taskType: string): Promise<NexusResponse>;
|
|
94
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AE,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;IAKvF,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAK9F,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAKrD,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC;IAKpC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IASxD,SAAS,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;IAKrD,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;IAKzD,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC;IAKvC,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAIhF"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Nexus API Client
|
|
3
|
+
*
|
|
4
|
+
* Merged from:
|
|
5
|
+
* - nexus-skills-mcp/src/index.ts (Skills Engine client)
|
|
6
|
+
* - nexus-desktop-extension/src/client.ts (GraphRAG/MageAgent client)
|
|
7
|
+
*
|
|
8
|
+
* Single axios instance, single Bearer token, all Nexus endpoints.
|
|
9
|
+
*/
|
|
10
|
+
import axios from 'axios';
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Client
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
export class NexusClient {
|
|
15
|
+
http;
|
|
16
|
+
skillsHttp;
|
|
17
|
+
config;
|
|
18
|
+
constructor(config) {
|
|
19
|
+
this.config = config;
|
|
20
|
+
// Main API client (GraphRAG, MageAgent, documents, entities, etc.)
|
|
21
|
+
this.http = axios.create({
|
|
22
|
+
baseURL: config.apiUrl,
|
|
23
|
+
timeout: config.timeout || 30000,
|
|
24
|
+
headers: {
|
|
25
|
+
'Content-Type': 'application/json',
|
|
26
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
// Skills Engine client (skills-specific endpoints under /api/skills)
|
|
30
|
+
this.skillsHttp = axios.create({
|
|
31
|
+
baseURL: `${config.apiUrl}/api/skills`,
|
|
32
|
+
timeout: config.timeout || 15000,
|
|
33
|
+
headers: {
|
|
34
|
+
'Content-Type': 'application/json',
|
|
35
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
36
|
+
'X-User-ID': config.userId || process.env.USER || 'anonymous',
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
this.http.interceptors.response.use((response) => response, (error) => Promise.reject(this.formatError(error)));
|
|
40
|
+
this.skillsHttp.interceptors.response.use((response) => response, (error) => Promise.reject(this.formatError(error)));
|
|
41
|
+
}
|
|
42
|
+
formatError(error) {
|
|
43
|
+
if (error.response) {
|
|
44
|
+
const data = error.response.data;
|
|
45
|
+
return new Error(`Nexus API Error (${error.response.status}): ${data?.error?.message || data?.message || error.message}`);
|
|
46
|
+
}
|
|
47
|
+
if (error.request) {
|
|
48
|
+
return new Error(`Network Error: Unable to reach ${this.config.apiUrl}`);
|
|
49
|
+
}
|
|
50
|
+
return new Error(`Request Error: ${error.message}`);
|
|
51
|
+
}
|
|
52
|
+
// =========================================================================
|
|
53
|
+
// Skills Engine Operations
|
|
54
|
+
// =========================================================================
|
|
55
|
+
async listSkills(params) {
|
|
56
|
+
const { data } = await this.skillsHttp.get('', { params });
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
59
|
+
async getSkill(skillId) {
|
|
60
|
+
const { data } = await this.skillsHttp.get(`/${skillId}`);
|
|
61
|
+
return data;
|
|
62
|
+
}
|
|
63
|
+
async matchPrompt(prompt, limit) {
|
|
64
|
+
const { data } = await this.skillsHttp.post('/match', { prompt, limit: limit || 5 });
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
async discoverSkills(query, categories, minRelevance, limit) {
|
|
68
|
+
const { data } = await this.skillsHttp.post('/discover', {
|
|
69
|
+
query,
|
|
70
|
+
categories,
|
|
71
|
+
minRelevance,
|
|
72
|
+
limit,
|
|
73
|
+
});
|
|
74
|
+
return data;
|
|
75
|
+
}
|
|
76
|
+
async invokeSkill(skillId, input) {
|
|
77
|
+
const { data } = await this.skillsHttp.post(`/${skillId}/invoke`, { input: input || {} });
|
|
78
|
+
return data;
|
|
79
|
+
}
|
|
80
|
+
async getQualityScore(skillId) {
|
|
81
|
+
const { data } = await this.skillsHttp.get(`/${skillId}/quality`);
|
|
82
|
+
return data;
|
|
83
|
+
}
|
|
84
|
+
async getTopSkills(limit) {
|
|
85
|
+
const { data } = await this.skillsHttp.get('/quality/top', { params: { limit: limit || 20 } });
|
|
86
|
+
return data;
|
|
87
|
+
}
|
|
88
|
+
async recordExecution(record) {
|
|
89
|
+
const { data } = await this.skillsHttp.post('/execution', record);
|
|
90
|
+
return data;
|
|
91
|
+
}
|
|
92
|
+
async getRelatedSkills(skillId) {
|
|
93
|
+
const { data } = await this.skillsHttp.get(`/${skillId}/related`);
|
|
94
|
+
return data;
|
|
95
|
+
}
|
|
96
|
+
async synthesizeSkills(params) {
|
|
97
|
+
const { data } = await this.skillsHttp.post('/synthesize', {
|
|
98
|
+
source_skill_ids: params.sourceSkillIds,
|
|
99
|
+
strategy: params.strategy,
|
|
100
|
+
name: params.targetName,
|
|
101
|
+
prompt: params.prompt,
|
|
102
|
+
focus_areas: params.focusAreas,
|
|
103
|
+
visibility: params.visibility || 'private',
|
|
104
|
+
});
|
|
105
|
+
return data;
|
|
106
|
+
}
|
|
107
|
+
// =========================================================================
|
|
108
|
+
// Memory Operations
|
|
109
|
+
// =========================================================================
|
|
110
|
+
async storeMemory(content, tags, metadata) {
|
|
111
|
+
const { data } = await this.http.post('/api/v2/memory', { content, tags, metadata });
|
|
112
|
+
return data;
|
|
113
|
+
}
|
|
114
|
+
async recallMemory(query, limit, scoreThreshold) {
|
|
115
|
+
const { data } = await this.http.post('/api/retrieve/enhanced', {
|
|
116
|
+
query,
|
|
117
|
+
limit,
|
|
118
|
+
score_threshold: scoreThreshold,
|
|
119
|
+
includeEpisodic: true,
|
|
120
|
+
includeDocuments: true,
|
|
121
|
+
});
|
|
122
|
+
return data;
|
|
123
|
+
}
|
|
124
|
+
async storeEpisode(content, type, metadata) {
|
|
125
|
+
const { data } = await this.http.post('/api/v2/memory', {
|
|
126
|
+
content,
|
|
127
|
+
episodeType: type,
|
|
128
|
+
metadata,
|
|
129
|
+
forceEpisodicStorage: true,
|
|
130
|
+
});
|
|
131
|
+
return data;
|
|
132
|
+
}
|
|
133
|
+
async recallEpisodes(query, limit) {
|
|
134
|
+
const { data } = await this.http.post('/api/retrieve/enhanced', {
|
|
135
|
+
query,
|
|
136
|
+
limit,
|
|
137
|
+
includeEpisodic: true,
|
|
138
|
+
includeDocuments: false,
|
|
139
|
+
});
|
|
140
|
+
return data;
|
|
141
|
+
}
|
|
142
|
+
// =========================================================================
|
|
143
|
+
// Document Operations
|
|
144
|
+
// =========================================================================
|
|
145
|
+
async storeDocument(content, title, metadata) {
|
|
146
|
+
const { data } = await this.http.post('/api/documents', { content, title, metadata });
|
|
147
|
+
return data;
|
|
148
|
+
}
|
|
149
|
+
async getDocument(documentId, includeChunks) {
|
|
150
|
+
const { data } = await this.http.get(`/api/documents/${documentId}`, {
|
|
151
|
+
params: { include_chunks: includeChunks },
|
|
152
|
+
});
|
|
153
|
+
return data;
|
|
154
|
+
}
|
|
155
|
+
async listDocuments(limit, offset) {
|
|
156
|
+
const { data } = await this.http.get('/api/documents', { params: { limit, offset } });
|
|
157
|
+
return data;
|
|
158
|
+
}
|
|
159
|
+
async ingestUrl(url, options) {
|
|
160
|
+
const { data } = await this.http.post('/api/ingestion/url', { url, ...options });
|
|
161
|
+
return data;
|
|
162
|
+
}
|
|
163
|
+
async validateUrl(url) {
|
|
164
|
+
const { data } = await this.http.post('/api/ingestion/url/validate', { url });
|
|
165
|
+
return data;
|
|
166
|
+
}
|
|
167
|
+
async checkIngestionJob(jobId) {
|
|
168
|
+
const { data } = await this.http.get(`/api/ingestion/jobs/${jobId}`);
|
|
169
|
+
return data;
|
|
170
|
+
}
|
|
171
|
+
// =========================================================================
|
|
172
|
+
// Entity Operations
|
|
173
|
+
// =========================================================================
|
|
174
|
+
async storeEntity(domain, entityType, textContent, tags, metadata) {
|
|
175
|
+
const { data } = await this.http.post('/api/entities', { domain, entityType, textContent, tags, metadata });
|
|
176
|
+
return data;
|
|
177
|
+
}
|
|
178
|
+
async queryEntities(domain, entityType, searchText, limit) {
|
|
179
|
+
const { data } = await this.http.post('/api/entities/query', { domain, entityType, searchText, limit });
|
|
180
|
+
return data;
|
|
181
|
+
}
|
|
182
|
+
async getEntity(entityId) {
|
|
183
|
+
const { data } = await this.http.get(`/api/entities/${entityId}`);
|
|
184
|
+
return data;
|
|
185
|
+
}
|
|
186
|
+
async getEntityHistory(entityId) {
|
|
187
|
+
const { data } = await this.http.get(`/api/entities/${entityId}/history`);
|
|
188
|
+
return data;
|
|
189
|
+
}
|
|
190
|
+
async getEntityHierarchy(entityId) {
|
|
191
|
+
const { data } = await this.http.get(`/api/entities/${entityId}/hierarchy`);
|
|
192
|
+
return data;
|
|
193
|
+
}
|
|
194
|
+
async getFacts(subject) {
|
|
195
|
+
const { data } = await this.http.get(`/api/facts/${encodeURIComponent(subject)}`);
|
|
196
|
+
return data;
|
|
197
|
+
}
|
|
198
|
+
async crossDomainQuery(domains, query, maxResults) {
|
|
199
|
+
const { data } = await this.http.post('/api/query/cross-domain', { domains, query, max_results: maxResults });
|
|
200
|
+
return data;
|
|
201
|
+
}
|
|
202
|
+
// =========================================================================
|
|
203
|
+
// Search & Retrieval
|
|
204
|
+
// =========================================================================
|
|
205
|
+
async search(query, filters, limit) {
|
|
206
|
+
const { data } = await this.http.post('/api/search', { query, filters, limit });
|
|
207
|
+
return data;
|
|
208
|
+
}
|
|
209
|
+
async retrieve(query, strategy, limit) {
|
|
210
|
+
const { data } = await this.http.post('/api/retrieve', { query, strategy, limit });
|
|
211
|
+
return data;
|
|
212
|
+
}
|
|
213
|
+
async enhancedRetrieve(query, includeDocuments, includeEpisodic, maxTokens) {
|
|
214
|
+
const { data } = await this.http.post('/api/retrieve/enhanced', {
|
|
215
|
+
query,
|
|
216
|
+
include_documents: includeDocuments,
|
|
217
|
+
include_episodic: includeEpisodic,
|
|
218
|
+
max_tokens: maxTokens,
|
|
219
|
+
});
|
|
220
|
+
return data;
|
|
221
|
+
}
|
|
222
|
+
// =========================================================================
|
|
223
|
+
// Agent Orchestration (MageAgent)
|
|
224
|
+
// =========================================================================
|
|
225
|
+
async orchestrate(task, maxAgents, timeout) {
|
|
226
|
+
const { data } = await this.http.post('/api/orchestrate', { task, max_agents: maxAgents, timeout });
|
|
227
|
+
return data;
|
|
228
|
+
}
|
|
229
|
+
async collaborate(objective, agents, iterations) {
|
|
230
|
+
const { data } = await this.http.post('/api/collaborate', { objective, agents, iterations });
|
|
231
|
+
return data;
|
|
232
|
+
}
|
|
233
|
+
async competition(challenge, competitorCount, criteria) {
|
|
234
|
+
const { data } = await this.http.post('/api/compete', { challenge, competitor_count: competitorCount, evaluation_criteria: criteria });
|
|
235
|
+
return data;
|
|
236
|
+
}
|
|
237
|
+
async analyze(topic, depth, includeMemory) {
|
|
238
|
+
const { data } = await this.http.post('/api/analyze', { topic, depth, include_memory: includeMemory });
|
|
239
|
+
return data;
|
|
240
|
+
}
|
|
241
|
+
async synthesizeInfo(sources, objective, format) {
|
|
242
|
+
const { data } = await this.http.post('/api/synthesize', { sources, objective, format });
|
|
243
|
+
return data;
|
|
244
|
+
}
|
|
245
|
+
async getTaskStatus(taskId) {
|
|
246
|
+
const { data } = await this.http.get(`/api/tasks/${taskId}`);
|
|
247
|
+
return data;
|
|
248
|
+
}
|
|
249
|
+
async listAgents() {
|
|
250
|
+
const { data } = await this.http.get('/api/agents');
|
|
251
|
+
return data;
|
|
252
|
+
}
|
|
253
|
+
async getAgentDetails(agentId) {
|
|
254
|
+
const { data } = await this.http.get(`/api/agents/${agentId}`);
|
|
255
|
+
return data;
|
|
256
|
+
}
|
|
257
|
+
// =========================================================================
|
|
258
|
+
// System & Health
|
|
259
|
+
// =========================================================================
|
|
260
|
+
async getHealth(detailed) {
|
|
261
|
+
const { data } = await this.http.get('/api/health', { params: { detailed } });
|
|
262
|
+
return data;
|
|
263
|
+
}
|
|
264
|
+
async getStats(includeHealth) {
|
|
265
|
+
const { data } = await this.http.get('/api/stats', { params: { include_health: includeHealth } });
|
|
266
|
+
return data;
|
|
267
|
+
}
|
|
268
|
+
async getModelStats() {
|
|
269
|
+
const { data } = await this.http.get('/api/models/stats');
|
|
270
|
+
return data;
|
|
271
|
+
}
|
|
272
|
+
async selectModel(complexity, taskType) {
|
|
273
|
+
const { data } = await this.http.post('/api/models/select', { complexity, task_type: taskType });
|
|
274
|
+
return data;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAoC,MAAM,OAAO,CAAC;AAuBzD,8EAA8E;AAC9E,SAAS;AACT,8EAA8E;AAE9E,MAAM,OAAO,WAAW;IACd,IAAI,CAAgB;IACpB,UAAU,CAAgB;IAC1B,MAAM,CAAc;IAE5B,YAAY,MAAmB;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,mEAAmE;QACnE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC,MAAM;YACtB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,KAAK;YAChC,OAAO,EAAE;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,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,UAAkB,EAAE,QAAgB;QACpD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;QACjG,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Adverant Nexus — Unified Cowork Plugin MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Entry point for the MCP server that provides 8 consolidated gateway
|
|
6
|
+
* tools covering the entire Nexus platform:
|
|
7
|
+
* - Skills Engine (discover, invoke, synthesize, sync)
|
|
8
|
+
* - GraphRAG Memory (store, recall, episodes)
|
|
9
|
+
* - Documents (store, ingest, retrieve)
|
|
10
|
+
* - Knowledge Graph (entities, facts, cross-domain)
|
|
11
|
+
* - Search & Retrieval (semantic, graph, hybrid)
|
|
12
|
+
* - Agent Orchestration (MageAgent)
|
|
13
|
+
* - System Health & Model Management
|
|
14
|
+
*
|
|
15
|
+
* Authentication: Requires NEXUS_API_KEY environment variable.
|
|
16
|
+
* Transport: STDIO (default for Claude Desktop/Cowork plugins).
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Adverant Nexus — Unified Cowork Plugin MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Entry point for the MCP server that provides 8 consolidated gateway
|
|
6
|
+
* tools covering the entire Nexus platform:
|
|
7
|
+
* - Skills Engine (discover, invoke, synthesize, sync)
|
|
8
|
+
* - GraphRAG Memory (store, recall, episodes)
|
|
9
|
+
* - Documents (store, ingest, retrieve)
|
|
10
|
+
* - Knowledge Graph (entities, facts, cross-domain)
|
|
11
|
+
* - Search & Retrieval (semantic, graph, hybrid)
|
|
12
|
+
* - Agent Orchestration (MageAgent)
|
|
13
|
+
* - System Health & Model Management
|
|
14
|
+
*
|
|
15
|
+
* Authentication: Requires NEXUS_API_KEY environment variable.
|
|
16
|
+
* Transport: STDIO (default for Claude Desktop/Cowork plugins).
|
|
17
|
+
*/
|
|
18
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
19
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
20
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
21
|
+
import { NexusClient } from './client.js';
|
|
22
|
+
import { NEXUS_TOOLS, handleToolCall } from './tools.js';
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Configuration
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
const config = {
|
|
27
|
+
apiUrl: process.env.NEXUS_API_URL || 'https://api.adverant.ai',
|
|
28
|
+
apiKey: process.env.NEXUS_API_KEY || '',
|
|
29
|
+
userId: process.env.NEXUS_USER_ID || process.env.USER || 'anonymous',
|
|
30
|
+
timeout: parseInt(process.env.NEXUS_TIMEOUT || '30000', 10),
|
|
31
|
+
};
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
// Validate
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
if (!config.apiKey) {
|
|
36
|
+
console.error('ERROR: NEXUS_API_KEY environment variable is required.');
|
|
37
|
+
console.error('');
|
|
38
|
+
console.error('To get an API key:');
|
|
39
|
+
console.error(' 1. Go to https://dashboard.adverant.ai');
|
|
40
|
+
console.error(' 2. Navigate to Settings > API Keys');
|
|
41
|
+
console.error(' 3. Create a new API key');
|
|
42
|
+
console.error(' 4. Set NEXUS_API_KEY in your environment or Claude Desktop config');
|
|
43
|
+
console.error('');
|
|
44
|
+
console.error('Example (shell profile):');
|
|
45
|
+
console.error(' export NEXUS_API_KEY="your_key_here"');
|
|
46
|
+
console.error('');
|
|
47
|
+
console.error('Example (Claude Desktop claude_desktop_config.json):');
|
|
48
|
+
console.error(' { "mcpServers": { "nexus": { "env": { "NEXUS_API_KEY": "your_key" } } } }');
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
// Initialize
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
const nexusClient = new NexusClient(config);
|
|
55
|
+
const server = new Server({
|
|
56
|
+
name: 'adverant-nexus',
|
|
57
|
+
version: '1.0.0',
|
|
58
|
+
}, {
|
|
59
|
+
capabilities: {
|
|
60
|
+
tools: {},
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// Handlers
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
// List tools
|
|
67
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
68
|
+
return { tools: NEXUS_TOOLS };
|
|
69
|
+
});
|
|
70
|
+
// Handle tool calls
|
|
71
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
72
|
+
const { name, arguments: args } = request.params;
|
|
73
|
+
try {
|
|
74
|
+
const result = await handleToolCall(nexusClient, name, args || {});
|
|
75
|
+
return {
|
|
76
|
+
content: [
|
|
77
|
+
{
|
|
78
|
+
type: 'text',
|
|
79
|
+
text: typeof result === 'string' ? result : JSON.stringify(result, null, 2),
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
86
|
+
return {
|
|
87
|
+
content: [
|
|
88
|
+
{
|
|
89
|
+
type: 'text',
|
|
90
|
+
text: JSON.stringify({ success: false, error: errorMessage }, null, 2),
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
isError: true,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
// Start
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
async function main() {
|
|
101
|
+
const transport = new StdioServerTransport();
|
|
102
|
+
await server.connect(transport);
|
|
103
|
+
console.error(`Adverant Nexus MCP server started`);
|
|
104
|
+
console.error(` API: ${config.apiUrl}`);
|
|
105
|
+
console.error(` Tools: ${NEXUS_TOOLS.length}`);
|
|
106
|
+
console.error(` User: ${config.userId}`);
|
|
107
|
+
}
|
|
108
|
+
main().catch((err) => {
|
|
109
|
+
console.error('Fatal error starting Nexus MCP server:', err);
|
|
110
|
+
process.exit(1);
|
|
111
|
+
});
|
|
112
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEzD,8EAA8E;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,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACvE;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACnD,OAAO,CAAC,KAAK,CAAC,UAAU,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,KAAK,CAAC,YAAY,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IAChD,OAAO,CAAC,KAAK,CAAC,WAAW,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,GAAG,CAAC,CAAC;IAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/sync.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Filesystem Sync
|
|
3
|
+
*
|
|
4
|
+
* Syncs published skills from the Nexus Skills Engine to the local
|
|
5
|
+
* filesystem at ~/.claude/skills/, making them available as native
|
|
6
|
+
* slash commands in Claude Code and Cowork.
|
|
7
|
+
*
|
|
8
|
+
* Ported from nexus-skills-mcp/src/index.ts (lines 396-488).
|
|
9
|
+
*/
|
|
10
|
+
import { NexusClient } from './client.js';
|
|
11
|
+
export declare function syncSkillsToFilesystem(client: NexusClient, force: boolean): Promise<{
|
|
12
|
+
synced: number;
|
|
13
|
+
skipped: number;
|
|
14
|
+
failed: number;
|
|
15
|
+
total: number;
|
|
16
|
+
details: string[];
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA6C1C,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,OAAO,GACb,OAAO,CAAC;IACT,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC,CAkFD"}
|
package/dist/sync.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Filesystem Sync
|
|
3
|
+
*
|
|
4
|
+
* Syncs published skills from the Nexus Skills Engine to the local
|
|
5
|
+
* filesystem at ~/.claude/skills/, making them available as native
|
|
6
|
+
* slash commands in Claude Code and Cowork.
|
|
7
|
+
*
|
|
8
|
+
* Ported from nexus-skills-mcp/src/index.ts (lines 396-488).
|
|
9
|
+
*/
|
|
10
|
+
import { writeFileSync, readFileSync, mkdirSync, existsSync } from 'fs';
|
|
11
|
+
import { join } from 'path';
|
|
12
|
+
import { homedir } from 'os';
|
|
13
|
+
const SKILLS_DIR = join(homedir(), '.claude', 'skills');
|
|
14
|
+
// Skills that should never be overwritten by sync (locally managed)
|
|
15
|
+
const PROTECTED_SKILLS = new Set([
|
|
16
|
+
'nexus-skill-sync',
|
|
17
|
+
'build-deploy',
|
|
18
|
+
'code-review',
|
|
19
|
+
'commit',
|
|
20
|
+
'web-debug',
|
|
21
|
+
'screenshot-skill',
|
|
22
|
+
'nexus-memory',
|
|
23
|
+
'agent-browser',
|
|
24
|
+
'pr-automation',
|
|
25
|
+
'plugin-maker',
|
|
26
|
+
'marketing-psychology',
|
|
27
|
+
'award-winning-website-design',
|
|
28
|
+
'documentation-sync',
|
|
29
|
+
'hbr-article',
|
|
30
|
+
'patent-creator',
|
|
31
|
+
'patent-creator-skill',
|
|
32
|
+
'pcb-layout-skill',
|
|
33
|
+
'web-validation',
|
|
34
|
+
'website-copy-creator',
|
|
35
|
+
'youtube-video-creation',
|
|
36
|
+
'video-render',
|
|
37
|
+
'research-paper',
|
|
38
|
+
'seo-optimizer',
|
|
39
|
+
]);
|
|
40
|
+
function normalizeSkillName(skill) {
|
|
41
|
+
const raw = skill.name || skill.structuredData?.name || skill.id;
|
|
42
|
+
return raw
|
|
43
|
+
.toLowerCase()
|
|
44
|
+
.replace(/\s+/g, '-')
|
|
45
|
+
.replace(/[^a-z0-9-]/g, '');
|
|
46
|
+
}
|
|
47
|
+
export async function syncSkillsToFilesystem(client, force) {
|
|
48
|
+
const details = [];
|
|
49
|
+
let synced = 0;
|
|
50
|
+
let skipped = 0;
|
|
51
|
+
let failed = 0;
|
|
52
|
+
// Fetch published skills
|
|
53
|
+
const response = (await client.listSkills({
|
|
54
|
+
limit: 100,
|
|
55
|
+
status: 'published',
|
|
56
|
+
}));
|
|
57
|
+
const skills = response?.data?.skills || response?.skills || [];
|
|
58
|
+
const total = skills.length;
|
|
59
|
+
for (const skill of skills) {
|
|
60
|
+
const skillName = normalizeSkillName(skill);
|
|
61
|
+
// Skip protected skills
|
|
62
|
+
if (PROTECTED_SKILLS.has(skillName)) {
|
|
63
|
+
skipped++;
|
|
64
|
+
details.push(`SKIP (protected): ${skillName}`);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
// Fetch full skill detail for textContent
|
|
68
|
+
let fullSkill;
|
|
69
|
+
try {
|
|
70
|
+
fullSkill = (await client.getSkill(skill.id));
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
failed++;
|
|
74
|
+
details.push(`FAIL (fetch): ${skillName} — ${err instanceof Error ? err.message : String(err)}`);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const textContent = fullSkill?.data?.textContent || fullSkill?.textContent;
|
|
78
|
+
if (!textContent) {
|
|
79
|
+
failed++;
|
|
80
|
+
details.push(`FAIL (no textContent): ${skillName}`);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
// Check if content changed (skip if identical)
|
|
84
|
+
const targetDir = join(SKILLS_DIR, skillName);
|
|
85
|
+
const targetFile = join(targetDir, 'SKILL.md');
|
|
86
|
+
if (!force && existsSync(targetFile)) {
|
|
87
|
+
try {
|
|
88
|
+
const existing = readFileSync(targetFile, 'utf-8');
|
|
89
|
+
if (existing === textContent) {
|
|
90
|
+
skipped++;
|
|
91
|
+
details.push(`SKIP (unchanged): ${skillName}`);
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// File exists but can't be read — overwrite
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Write SKILL.md
|
|
100
|
+
try {
|
|
101
|
+
mkdirSync(targetDir, { recursive: true });
|
|
102
|
+
writeFileSync(targetFile, textContent, 'utf-8');
|
|
103
|
+
synced++;
|
|
104
|
+
details.push(`SYNCED: ${skillName} → ${targetFile}`);
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
failed++;
|
|
108
|
+
details.push(`FAIL (write): ${skillName} — ${err instanceof Error ? err.message : String(err)}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return { synced, skipped, failed, total, details };
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=sync.js.map
|
package/dist/sync.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,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,CAAC,UAAU,CAAC,EAAE,CAAC;YACrC,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;gBACnD,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;oBAC7B,OAAO,EAAE,CAAC;oBACV,OAAO,CAAC,IAAI,CAAC,qBAAqB,SAAS,EAAE,CAAC,CAAC;oBAC/C,SAAS;gBACX,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,4CAA4C;YAC9C,CAAC;QACH,CAAC;QAED,iBAAiB;QACjB,IAAI,CAAC;YACH,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1C,aAAa,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;YAChD,MAAM,EAAE,CAAC;YACT,OAAO,CAAC,IAAI,CAAC,WAAW,SAAS,MAAM,UAAU,EAAE,CAAC,CAAC;QACvD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,EAAE,CAAC;YACT,OAAO,CAAC,IAAI,CACV,iBAAiB,SAAS,MAAM,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CACnF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AACrD,CAAC"}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 8 Consolidated Gateway Tools
|
|
3
|
+
*
|
|
4
|
+
* Reduces 52 individual tools to 8 gateway tools with action routing.
|
|
5
|
+
* ~85% token reduction in system prompt (2,400 vs 15,600 tokens).
|
|
6
|
+
*/
|
|
7
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
8
|
+
import { NexusClient } from './client.js';
|
|
9
|
+
export declare const NEXUS_TOOLS: Tool[];
|
|
10
|
+
export declare function handleToolCall(client: NexusClient, toolName: string, args: Record<string, any>): Promise<any>;
|
|
11
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO1C,eAAO,MAAM,WAAW,EAAE,IAAI,EAgO7B,CAAC;AAMF,wBAAsB,cAAc,CAClC,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,GAAG,CAAC,CA2Nd"}
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 8 Consolidated Gateway Tools
|
|
3
|
+
*
|
|
4
|
+
* Reduces 52 individual tools to 8 gateway tools with action routing.
|
|
5
|
+
* ~85% token reduction in system prompt (2,400 vs 15,600 tokens).
|
|
6
|
+
*/
|
|
7
|
+
import { syncSkillsToFilesystem } from './sync.js';
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Tool Definitions
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
export const NEXUS_TOOLS = [
|
|
12
|
+
// 1. Skills Engine
|
|
13
|
+
{
|
|
14
|
+
name: 'nexus_skills',
|
|
15
|
+
description: 'Interact with the Nexus Skills Engine. Actions: list (browse skills), get (full details + SKILL.md), discover (semantic search), match (match prompt to skills), invoke (run a skill), quality (quality score breakdown), related (find similar), top (top-ranked), record (log execution), sync (sync to local ~/.claude/skills/).',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
action: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
enum: ['list', 'get', 'discover', 'match', 'invoke', 'quality', 'related', 'top', 'record', 'sync'],
|
|
22
|
+
description: 'The operation to perform',
|
|
23
|
+
},
|
|
24
|
+
skill_id: { type: 'string', description: 'Skill ID (for get, invoke, quality, related)' },
|
|
25
|
+
query: { type: 'string', description: 'Search query (for discover)' },
|
|
26
|
+
prompt: { type: 'string', description: 'User prompt to match (for match)' },
|
|
27
|
+
input: { type: 'object', description: 'Input parameters (for invoke)' },
|
|
28
|
+
search: { type: 'string', description: 'Search term (for list)' },
|
|
29
|
+
status: { type: 'string', enum: ['draft', 'testing', 'published', 'deprecated'], description: 'Filter by status (for list)' },
|
|
30
|
+
category: { type: 'string', enum: ['development', 'engineering', 'content', 'platform', 'automation', 'uncategorized'], description: 'Filter by category (for list, discover)' },
|
|
31
|
+
categories: { type: 'array', items: { type: 'string' }, description: 'Filter categories (for discover)' },
|
|
32
|
+
min_relevance: { type: 'number', description: 'Minimum relevance 0-1 (for discover)' },
|
|
33
|
+
limit: { type: 'number', description: 'Max results (default varies by action)' },
|
|
34
|
+
offset: { type: 'number', description: 'Pagination offset (for list)' },
|
|
35
|
+
force: { type: 'boolean', description: 'Force overwrite (for sync)' },
|
|
36
|
+
skill_name: { type: 'string', description: 'Skill name (for record)' },
|
|
37
|
+
execution_status: { type: 'string', enum: ['success', 'failure', 'partial'], description: 'Execution result (for record)' },
|
|
38
|
+
duration: { type: 'number', description: 'Execution time ms (for record)' },
|
|
39
|
+
error: { type: 'string', description: 'Error message (for record)' },
|
|
40
|
+
},
|
|
41
|
+
required: ['action'],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
// 2. Skill Synthesis
|
|
45
|
+
{
|
|
46
|
+
name: 'nexus_skill_synth',
|
|
47
|
+
description: 'Synthesize new skills from existing ones. Strategies: combine (merge capabilities), chain (sequential workflow), specialize (focused subset), generalize (abstract patterns), adapt (different domain).',
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: 'object',
|
|
50
|
+
properties: {
|
|
51
|
+
source_skill_ids: {
|
|
52
|
+
type: 'array',
|
|
53
|
+
items: { type: 'string' },
|
|
54
|
+
description: 'IDs of source skills to synthesize from',
|
|
55
|
+
},
|
|
56
|
+
strategy: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
enum: ['combine', 'chain', 'specialize', 'generalize', 'adapt'],
|
|
59
|
+
description: 'Synthesis strategy',
|
|
60
|
+
},
|
|
61
|
+
target_name: { type: 'string', description: 'Name for the new skill' },
|
|
62
|
+
prompt: { type: 'string', description: 'Additional guidance for synthesis' },
|
|
63
|
+
focus_areas: { type: 'array', items: { type: 'string' }, description: 'Focus areas (for specialize/adapt)' },
|
|
64
|
+
visibility: { type: 'string', enum: ['private', 'team', 'public'], description: 'Visibility (default: private)' },
|
|
65
|
+
},
|
|
66
|
+
required: ['source_skill_ids', 'strategy', 'target_name'],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
// 3. Memory
|
|
70
|
+
{
|
|
71
|
+
name: 'nexus_memory',
|
|
72
|
+
description: 'Store and recall memories using Nexus GraphRAG. Actions: store (save memory), recall (semantic search), store_episode (temporal event), recall_episodes (search episodes).',
|
|
73
|
+
inputSchema: {
|
|
74
|
+
type: 'object',
|
|
75
|
+
properties: {
|
|
76
|
+
action: {
|
|
77
|
+
type: 'string',
|
|
78
|
+
enum: ['store', 'recall', 'store_episode', 'recall_episodes'],
|
|
79
|
+
description: 'The operation to perform',
|
|
80
|
+
},
|
|
81
|
+
content: { type: 'string', description: 'Memory/episode content (for store, store_episode)' },
|
|
82
|
+
query: { type: 'string', description: 'Search query (for recall, recall_episodes)' },
|
|
83
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Tags (for store)' },
|
|
84
|
+
metadata: { type: 'object', description: 'Additional metadata (for store, store_episode)' },
|
|
85
|
+
type: { type: 'string', enum: ['user_query', 'system_response', 'event', 'observation', 'insight'], description: 'Episode type (for store_episode)' },
|
|
86
|
+
limit: { type: 'number', description: 'Max results (for recall)' },
|
|
87
|
+
score_threshold: { type: 'number', description: 'Min similarity 0-1 (for recall)' },
|
|
88
|
+
},
|
|
89
|
+
required: ['action'],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
// 4. Documents
|
|
93
|
+
{
|
|
94
|
+
name: 'nexus_documents',
|
|
95
|
+
description: 'Manage documents with intelligent chunking and embeddings. Actions: store (save document), get (retrieve by ID), list (browse), ingest (from URL), validate_url (check URL), check_job (ingestion status).',
|
|
96
|
+
inputSchema: {
|
|
97
|
+
type: 'object',
|
|
98
|
+
properties: {
|
|
99
|
+
action: {
|
|
100
|
+
type: 'string',
|
|
101
|
+
enum: ['store', 'get', 'list', 'ingest', 'validate_url', 'check_job'],
|
|
102
|
+
description: 'The operation to perform',
|
|
103
|
+
},
|
|
104
|
+
content: { type: 'string', description: 'Document content (for store)' },
|
|
105
|
+
title: { type: 'string', description: 'Document title (for store)' },
|
|
106
|
+
document_id: { type: 'string', description: 'Document ID (for get)' },
|
|
107
|
+
include_chunks: { type: 'boolean', description: 'Include chunks (for get)' },
|
|
108
|
+
url: { type: 'string', description: 'URL to ingest/validate (for ingest, validate_url)' },
|
|
109
|
+
job_id: { type: 'string', description: 'Job ID (for check_job)' },
|
|
110
|
+
metadata: { type: 'object', description: 'Document metadata (for store)' },
|
|
111
|
+
limit: { type: 'number', description: 'Max results (for list)' },
|
|
112
|
+
offset: { type: 'number', description: 'Pagination offset (for list)' },
|
|
113
|
+
},
|
|
114
|
+
required: ['action'],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
// 5. Entities (Knowledge Graph)
|
|
118
|
+
{
|
|
119
|
+
name: 'nexus_entities',
|
|
120
|
+
description: 'Manage knowledge graph entities and relationships. Actions: store (create entity), query (search entities), get (by ID), history (entity evolution), hierarchy (entity tree), facts (about subject), cross_domain (search across domains).',
|
|
121
|
+
inputSchema: {
|
|
122
|
+
type: 'object',
|
|
123
|
+
properties: {
|
|
124
|
+
action: {
|
|
125
|
+
type: 'string',
|
|
126
|
+
enum: ['store', 'query', 'get', 'history', 'hierarchy', 'facts', 'cross_domain'],
|
|
127
|
+
description: 'The operation to perform',
|
|
128
|
+
},
|
|
129
|
+
entity_id: { type: 'string', description: 'Entity ID (for get, history, hierarchy)' },
|
|
130
|
+
domain: { type: 'string', description: 'Domain: creative_writing, code, medical, legal, research, general' },
|
|
131
|
+
entity_type: { type: 'string', description: 'Entity type (for store, query)' },
|
|
132
|
+
text_content: { type: 'string', description: 'Entity content (for store)' },
|
|
133
|
+
search_text: { type: 'string', description: 'Search within content (for query)' },
|
|
134
|
+
subject: { type: 'string', description: 'Subject to get facts about (for facts)' },
|
|
135
|
+
domains: { type: 'array', items: { type: 'string' }, description: 'Domains to search (for cross_domain)' },
|
|
136
|
+
query: { type: 'string', description: 'Search query (for cross_domain)' },
|
|
137
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Tags (for store)' },
|
|
138
|
+
metadata: { type: 'object', description: 'Metadata (for store)' },
|
|
139
|
+
limit: { type: 'number', description: 'Max results' },
|
|
140
|
+
max_results: { type: 'number', description: 'Max results per domain (for cross_domain)' },
|
|
141
|
+
},
|
|
142
|
+
required: ['action'],
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
// 6. Search & Retrieval
|
|
146
|
+
{
|
|
147
|
+
name: 'nexus_search',
|
|
148
|
+
description: 'Search across all memory types. Actions: search (unified search), retrieve (with strategy selection), enhanced (multi-source with reranking).',
|
|
149
|
+
inputSchema: {
|
|
150
|
+
type: 'object',
|
|
151
|
+
properties: {
|
|
152
|
+
action: {
|
|
153
|
+
type: 'string',
|
|
154
|
+
enum: ['search', 'retrieve', 'enhanced'],
|
|
155
|
+
description: 'The operation to perform',
|
|
156
|
+
},
|
|
157
|
+
query: { type: 'string', description: 'Search query' },
|
|
158
|
+
strategy: { type: 'string', enum: ['semantic_chunks', 'graph_traversal', 'hybrid', 'adaptive'], description: 'Retrieval strategy (for retrieve)' },
|
|
159
|
+
filters: { type: 'object', description: 'Optional filters (for search)' },
|
|
160
|
+
include_documents: { type: 'boolean', description: 'Include documents (for enhanced)' },
|
|
161
|
+
include_episodic: { type: 'boolean', description: 'Include episodes (for enhanced)' },
|
|
162
|
+
max_tokens: { type: 'number', description: 'Max context tokens (for enhanced)' },
|
|
163
|
+
limit: { type: 'number', description: 'Max results' },
|
|
164
|
+
},
|
|
165
|
+
required: ['action', 'query'],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
// 7. Agent Orchestration
|
|
169
|
+
{
|
|
170
|
+
name: 'nexus_agents',
|
|
171
|
+
description: 'Coordinate AI agents via MageAgent. Actions: orchestrate (auto-assign agents), collaborate (shared context), compete (ranked solutions), analyze (deep analysis), synthesize (combine sources), list (active agents), details (agent info), task_status (check task).',
|
|
172
|
+
inputSchema: {
|
|
173
|
+
type: 'object',
|
|
174
|
+
properties: {
|
|
175
|
+
action: {
|
|
176
|
+
type: 'string',
|
|
177
|
+
enum: ['orchestrate', 'collaborate', 'compete', 'analyze', 'synthesize', 'list', 'details', 'task_status'],
|
|
178
|
+
description: 'The operation to perform',
|
|
179
|
+
},
|
|
180
|
+
task: { type: 'string', description: 'Task objective (for orchestrate)' },
|
|
181
|
+
objective: { type: 'string', description: 'Collaboration/synthesis objective' },
|
|
182
|
+
challenge: { type: 'string', description: 'Competition challenge (for compete)' },
|
|
183
|
+
topic: { type: 'string', description: 'Analysis topic (for analyze)' },
|
|
184
|
+
sources: { type: 'array', items: { type: 'string' }, description: 'Sources to synthesize (for synthesize)' },
|
|
185
|
+
agents: { type: 'array', items: { type: 'object' }, description: 'Agent config (for collaborate)' },
|
|
186
|
+
max_agents: { type: 'number', description: 'Max agents (for orchestrate)' },
|
|
187
|
+
competitor_count: { type: 'number', description: 'Competitors 2-10 (for compete)' },
|
|
188
|
+
evaluation_criteria: { type: 'array', items: { type: 'string' }, description: 'Criteria (for compete)' },
|
|
189
|
+
depth: { type: 'string', enum: ['quick', 'standard', 'deep'], description: 'Depth (for analyze)' },
|
|
190
|
+
include_memory: { type: 'boolean', description: 'Include memory context (for analyze)' },
|
|
191
|
+
format: { type: 'string', enum: ['summary', 'report', 'analysis', 'recommendations'], description: 'Output format (for synthesize)' },
|
|
192
|
+
iterations: { type: 'number', description: 'Collaboration iterations 1-5 (for collaborate)' },
|
|
193
|
+
timeout: { type: 'number', description: 'Timeout ms (for orchestrate)' },
|
|
194
|
+
task_id: { type: 'string', description: 'Task ID (for task_status)' },
|
|
195
|
+
agent_id: { type: 'string', description: 'Agent ID (for details)' },
|
|
196
|
+
},
|
|
197
|
+
required: ['action'],
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
// 8. System
|
|
201
|
+
{
|
|
202
|
+
name: 'nexus_system',
|
|
203
|
+
description: 'System health and model management. Actions: health (service status), stats (memory statistics), model_stats (model usage), model_select (choose best model for task).',
|
|
204
|
+
inputSchema: {
|
|
205
|
+
type: 'object',
|
|
206
|
+
properties: {
|
|
207
|
+
action: {
|
|
208
|
+
type: 'string',
|
|
209
|
+
enum: ['health', 'stats', 'model_stats', 'model_select'],
|
|
210
|
+
description: 'The operation to perform',
|
|
211
|
+
},
|
|
212
|
+
detailed: { type: 'boolean', description: 'Detailed health (for health)' },
|
|
213
|
+
include_health: { type: 'boolean', description: 'Include health in stats (for stats)' },
|
|
214
|
+
complexity: { type: 'number', description: 'Task complexity 0-1 (for model_select)' },
|
|
215
|
+
task_type: { type: 'string', description: 'Task type (for model_select)' },
|
|
216
|
+
},
|
|
217
|
+
required: ['action'],
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
];
|
|
221
|
+
// ---------------------------------------------------------------------------
|
|
222
|
+
// Tool Handler
|
|
223
|
+
// ---------------------------------------------------------------------------
|
|
224
|
+
export async function handleToolCall(client, toolName, args) {
|
|
225
|
+
switch (toolName) {
|
|
226
|
+
// -----------------------------------------------------------------------
|
|
227
|
+
// nexus_skills
|
|
228
|
+
// -----------------------------------------------------------------------
|
|
229
|
+
case 'nexus_skills': {
|
|
230
|
+
switch (args.action) {
|
|
231
|
+
case 'list':
|
|
232
|
+
return client.listSkills({
|
|
233
|
+
limit: args.limit || 20,
|
|
234
|
+
offset: args.offset || 0,
|
|
235
|
+
status: args.status || 'published',
|
|
236
|
+
category: args.category,
|
|
237
|
+
search: args.search,
|
|
238
|
+
});
|
|
239
|
+
case 'get':
|
|
240
|
+
if (!args.skill_id)
|
|
241
|
+
throw new Error('skill_id is required for get action');
|
|
242
|
+
return client.getSkill(args.skill_id);
|
|
243
|
+
case 'discover':
|
|
244
|
+
if (!args.query)
|
|
245
|
+
throw new Error('query is required for discover action');
|
|
246
|
+
return client.discoverSkills(args.query, args.categories, args.min_relevance, args.limit);
|
|
247
|
+
case 'match':
|
|
248
|
+
if (!args.prompt)
|
|
249
|
+
throw new Error('prompt is required for match action');
|
|
250
|
+
return client.matchPrompt(args.prompt, args.limit);
|
|
251
|
+
case 'invoke':
|
|
252
|
+
if (!args.skill_id)
|
|
253
|
+
throw new Error('skill_id is required for invoke action');
|
|
254
|
+
return client.invokeSkill(args.skill_id, args.input);
|
|
255
|
+
case 'quality':
|
|
256
|
+
if (!args.skill_id)
|
|
257
|
+
throw new Error('skill_id is required for quality action');
|
|
258
|
+
return client.getQualityScore(args.skill_id);
|
|
259
|
+
case 'related':
|
|
260
|
+
if (!args.skill_id)
|
|
261
|
+
throw new Error('skill_id is required for related action');
|
|
262
|
+
return client.getRelatedSkills(args.skill_id);
|
|
263
|
+
case 'top':
|
|
264
|
+
return client.getTopSkills(args.limit);
|
|
265
|
+
case 'record':
|
|
266
|
+
if (!args.skill_id || !args.skill_name || !args.execution_status)
|
|
267
|
+
throw new Error('skill_id, skill_name, and execution_status are required for record action');
|
|
268
|
+
return client.recordExecution({
|
|
269
|
+
skillId: args.skill_id,
|
|
270
|
+
skillName: args.skill_name,
|
|
271
|
+
status: args.execution_status,
|
|
272
|
+
duration: args.duration,
|
|
273
|
+
input: args.input_summary,
|
|
274
|
+
output: args.output_summary,
|
|
275
|
+
error: args.error,
|
|
276
|
+
});
|
|
277
|
+
case 'sync':
|
|
278
|
+
return syncSkillsToFilesystem(client, args.force || false);
|
|
279
|
+
default:
|
|
280
|
+
throw new Error(`Unknown nexus_skills action: ${args.action}`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
// -----------------------------------------------------------------------
|
|
284
|
+
// nexus_skill_synth
|
|
285
|
+
// -----------------------------------------------------------------------
|
|
286
|
+
case 'nexus_skill_synth':
|
|
287
|
+
return client.synthesizeSkills({
|
|
288
|
+
sourceSkillIds: args.source_skill_ids,
|
|
289
|
+
strategy: args.strategy,
|
|
290
|
+
targetName: args.target_name,
|
|
291
|
+
prompt: args.prompt,
|
|
292
|
+
focusAreas: args.focus_areas,
|
|
293
|
+
visibility: args.visibility,
|
|
294
|
+
});
|
|
295
|
+
// -----------------------------------------------------------------------
|
|
296
|
+
// nexus_memory
|
|
297
|
+
// -----------------------------------------------------------------------
|
|
298
|
+
case 'nexus_memory': {
|
|
299
|
+
switch (args.action) {
|
|
300
|
+
case 'store':
|
|
301
|
+
if (!args.content)
|
|
302
|
+
throw new Error('content is required for store action');
|
|
303
|
+
return client.storeMemory(args.content, args.tags, args.metadata);
|
|
304
|
+
case 'recall':
|
|
305
|
+
if (!args.query)
|
|
306
|
+
throw new Error('query is required for recall action');
|
|
307
|
+
return client.recallMemory(args.query, args.limit, args.score_threshold);
|
|
308
|
+
case 'store_episode':
|
|
309
|
+
if (!args.content)
|
|
310
|
+
throw new Error('content is required for store_episode action');
|
|
311
|
+
return client.storeEpisode(args.content, args.type, args.metadata);
|
|
312
|
+
case 'recall_episodes':
|
|
313
|
+
if (!args.query)
|
|
314
|
+
throw new Error('query is required for recall_episodes action');
|
|
315
|
+
return client.recallEpisodes(args.query, args.limit);
|
|
316
|
+
default:
|
|
317
|
+
throw new Error(`Unknown nexus_memory action: ${args.action}`);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
// -----------------------------------------------------------------------
|
|
321
|
+
// nexus_documents
|
|
322
|
+
// -----------------------------------------------------------------------
|
|
323
|
+
case 'nexus_documents': {
|
|
324
|
+
switch (args.action) {
|
|
325
|
+
case 'store':
|
|
326
|
+
if (!args.content)
|
|
327
|
+
throw new Error('content is required for store action');
|
|
328
|
+
return client.storeDocument(args.content, args.title, args.metadata);
|
|
329
|
+
case 'get':
|
|
330
|
+
if (!args.document_id)
|
|
331
|
+
throw new Error('document_id is required for get action');
|
|
332
|
+
return client.getDocument(args.document_id, args.include_chunks);
|
|
333
|
+
case 'list':
|
|
334
|
+
return client.listDocuments(args.limit, args.offset);
|
|
335
|
+
case 'ingest':
|
|
336
|
+
if (!args.url)
|
|
337
|
+
throw new Error('url is required for ingest action');
|
|
338
|
+
return client.ingestUrl(args.url, { skip_confirmation: args.skip_confirmation });
|
|
339
|
+
case 'validate_url':
|
|
340
|
+
if (!args.url)
|
|
341
|
+
throw new Error('url is required for validate_url action');
|
|
342
|
+
return client.validateUrl(args.url);
|
|
343
|
+
case 'check_job':
|
|
344
|
+
if (!args.job_id)
|
|
345
|
+
throw new Error('job_id is required for check_job action');
|
|
346
|
+
return client.checkIngestionJob(args.job_id);
|
|
347
|
+
default:
|
|
348
|
+
throw new Error(`Unknown nexus_documents action: ${args.action}`);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
// -----------------------------------------------------------------------
|
|
352
|
+
// nexus_entities
|
|
353
|
+
// -----------------------------------------------------------------------
|
|
354
|
+
case 'nexus_entities': {
|
|
355
|
+
switch (args.action) {
|
|
356
|
+
case 'store':
|
|
357
|
+
if (!args.domain || !args.entity_type || !args.text_content)
|
|
358
|
+
throw new Error('domain, entity_type, and text_content are required for store action');
|
|
359
|
+
return client.storeEntity(args.domain, args.entity_type, args.text_content, args.tags, args.metadata);
|
|
360
|
+
case 'query':
|
|
361
|
+
return client.queryEntities(args.domain, args.entity_type, args.search_text, args.limit);
|
|
362
|
+
case 'get':
|
|
363
|
+
if (!args.entity_id)
|
|
364
|
+
throw new Error('entity_id is required for get action');
|
|
365
|
+
return client.getEntity(args.entity_id);
|
|
366
|
+
case 'history':
|
|
367
|
+
if (!args.entity_id)
|
|
368
|
+
throw new Error('entity_id is required for history action');
|
|
369
|
+
return client.getEntityHistory(args.entity_id);
|
|
370
|
+
case 'hierarchy':
|
|
371
|
+
if (!args.entity_id)
|
|
372
|
+
throw new Error('entity_id is required for hierarchy action');
|
|
373
|
+
return client.getEntityHierarchy(args.entity_id);
|
|
374
|
+
case 'facts':
|
|
375
|
+
if (!args.subject)
|
|
376
|
+
throw new Error('subject is required for facts action');
|
|
377
|
+
return client.getFacts(args.subject);
|
|
378
|
+
case 'cross_domain':
|
|
379
|
+
if (!args.domains || !args.query)
|
|
380
|
+
throw new Error('domains and query are required for cross_domain action');
|
|
381
|
+
return client.crossDomainQuery(args.domains, args.query, args.max_results);
|
|
382
|
+
default:
|
|
383
|
+
throw new Error(`Unknown nexus_entities action: ${args.action}`);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
// -----------------------------------------------------------------------
|
|
387
|
+
// nexus_search
|
|
388
|
+
// -----------------------------------------------------------------------
|
|
389
|
+
case 'nexus_search': {
|
|
390
|
+
switch (args.action) {
|
|
391
|
+
case 'search':
|
|
392
|
+
return client.search(args.query, args.filters, args.limit);
|
|
393
|
+
case 'retrieve':
|
|
394
|
+
return client.retrieve(args.query, args.strategy, args.limit);
|
|
395
|
+
case 'enhanced':
|
|
396
|
+
return client.enhancedRetrieve(args.query, args.include_documents, args.include_episodic, args.max_tokens);
|
|
397
|
+
default:
|
|
398
|
+
throw new Error(`Unknown nexus_search action: ${args.action}`);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
// -----------------------------------------------------------------------
|
|
402
|
+
// nexus_agents
|
|
403
|
+
// -----------------------------------------------------------------------
|
|
404
|
+
case 'nexus_agents': {
|
|
405
|
+
switch (args.action) {
|
|
406
|
+
case 'orchestrate':
|
|
407
|
+
if (!args.task)
|
|
408
|
+
throw new Error('task is required for orchestrate action');
|
|
409
|
+
return client.orchestrate(args.task, args.max_agents, args.timeout);
|
|
410
|
+
case 'collaborate':
|
|
411
|
+
if (!args.objective)
|
|
412
|
+
throw new Error('objective is required for collaborate action');
|
|
413
|
+
return client.collaborate(args.objective, args.agents, args.iterations);
|
|
414
|
+
case 'compete':
|
|
415
|
+
if (!args.challenge)
|
|
416
|
+
throw new Error('challenge is required for compete action');
|
|
417
|
+
return client.competition(args.challenge, args.competitor_count, args.evaluation_criteria);
|
|
418
|
+
case 'analyze':
|
|
419
|
+
if (!args.topic)
|
|
420
|
+
throw new Error('topic is required for analyze action');
|
|
421
|
+
return client.analyze(args.topic, args.depth, args.include_memory);
|
|
422
|
+
case 'synthesize':
|
|
423
|
+
if (!args.sources)
|
|
424
|
+
throw new Error('sources is required for synthesize action');
|
|
425
|
+
return client.synthesizeInfo(args.sources, args.objective, args.format);
|
|
426
|
+
case 'list':
|
|
427
|
+
return client.listAgents();
|
|
428
|
+
case 'details':
|
|
429
|
+
if (!args.agent_id)
|
|
430
|
+
throw new Error('agent_id is required for details action');
|
|
431
|
+
return client.getAgentDetails(args.agent_id);
|
|
432
|
+
case 'task_status':
|
|
433
|
+
if (!args.task_id)
|
|
434
|
+
throw new Error('task_id is required for task_status action');
|
|
435
|
+
return client.getTaskStatus(args.task_id);
|
|
436
|
+
default:
|
|
437
|
+
throw new Error(`Unknown nexus_agents action: ${args.action}`);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
// -----------------------------------------------------------------------
|
|
441
|
+
// nexus_system
|
|
442
|
+
// -----------------------------------------------------------------------
|
|
443
|
+
case 'nexus_system': {
|
|
444
|
+
switch (args.action) {
|
|
445
|
+
case 'health':
|
|
446
|
+
return client.getHealth(args.detailed);
|
|
447
|
+
case 'stats':
|
|
448
|
+
return client.getStats(args.include_health);
|
|
449
|
+
case 'model_stats':
|
|
450
|
+
return client.getModelStats();
|
|
451
|
+
case 'model_select':
|
|
452
|
+
if (args.complexity === undefined || !args.task_type)
|
|
453
|
+
throw new Error('complexity and task_type are required for model_select action');
|
|
454
|
+
return client.selectModel(args.complexity, args.task_type);
|
|
455
|
+
default:
|
|
456
|
+
throw new Error(`Unknown nexus_system action: ${args.action}`);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
default:
|
|
460
|
+
throw new Error(`Unknown tool: ${toolName}`);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAEnD,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,MAAM,CAAC,MAAM,WAAW,GAAW;IACjC,mBAAmB;IACnB;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,qUAAqU;QACvU,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC;oBACnG,WAAW,EAAE,0BAA0B;iBACxC;gBACD,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8CAA8C,EAAE;gBACzF,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE;gBACrE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,EAAE;gBAC3E,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,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MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC5C;oBACE,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YACnE,CAAC;QACH,CAAC;QAED,0EAA0E;QAC1E,eAAe;QACf,0EAA0E;QAC1E,KAAK,cAAc,CAAC,CAAC,CAAC;YACpB,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;gBACpB,KAAK,QAAQ;oBACX,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACzC,KAAK,OAAO;oBACV,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;gBAC9C,KAAK,aAAa;oBAChB,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC;gBAChC,KAAK,cAAc;oBACjB,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS;wBAClD,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;oBACnF,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;gBAC7D;oBACE,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YACnE,CAAC;QACH,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@adverant/nexus-cowork-plugin",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Adverant Nexus MCP server for Claude Cowork — Skills Engine, GraphRAG memory, knowledge graphs, and multi-agent orchestration",
|
|
5
|
+
"author": "Adverant <support@adverant.ai>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"bin": {
|
|
10
|
+
"nexus-mcp": "dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"dev": "tsc --watch",
|
|
15
|
+
"start": "node dist/index.js",
|
|
16
|
+
"clean": "rm -rf dist"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
20
|
+
"axios": "^1.7.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^22.0.0",
|
|
24
|
+
"typescript": "^5.6.0"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18.0.0"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"package.json"
|
|
35
|
+
]
|
|
36
|
+
}
|