@gwdn/nexus-mcp 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.d.ts +7 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +25 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/classify-document.d.ts +38 -0
- package/dist/tools/classify-document.d.ts.map +1 -0
- package/dist/tools/classify-document.js +45 -0
- package/dist/tools/classify-document.js.map +1 -0
- package/dist/tools/delete-document.d.ts +29 -0
- package/dist/tools/delete-document.d.ts.map +1 -0
- package/dist/tools/delete-document.js +34 -0
- package/dist/tools/delete-document.js.map +1 -0
- package/dist/tools/directives.d.ts +135 -0
- package/dist/tools/directives.d.ts.map +1 -0
- package/dist/tools/directives.js +231 -0
- package/dist/tools/directives.js.map +1 -0
- package/dist/tools/reviews.d.ts +1 -1
- package/dist/tools/update-document.d.ts +38 -0
- package/dist/tools/update-document.d.ts.map +1 -0
- package/dist/tools/update-document.js +51 -0
- package/dist/tools/update-document.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/server.test.ts +2 -2
- package/src/server.ts +110 -1
- package/src/tools/classify-document.ts +55 -0
- package/src/tools/delete-document.ts +43 -0
- package/src/tools/directives.ts +303 -0
- package/src/tools/update-document.ts +66 -0
package/dist/server.d.ts
CHANGED
|
@@ -38,6 +38,13 @@
|
|
|
38
38
|
* - sk_assign: Assign a skill to a project
|
|
39
39
|
* - sk_unassign: Remove a skill assignment from a project
|
|
40
40
|
* - sk_export: Export all skill assignments for a project
|
|
41
|
+
* - pd_list: List project directives
|
|
42
|
+
* - pd_get: Get a specific directive
|
|
43
|
+
* - pd_create: Create a new directive
|
|
44
|
+
* - pd_update: Update an existing directive
|
|
45
|
+
* - pd_delete: Delete a directive
|
|
46
|
+
* - pd_toggle: Toggle directive enabled/disabled
|
|
47
|
+
* - directive_export: Export enabled directives (CLI format)
|
|
41
48
|
* - doc_ingest: Push text/markdown content into project knowledge base
|
|
42
49
|
* - doc_list: List ingested documents for a project
|
|
43
50
|
* - session_append: Append to a session (write-isolated)
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG"}
|
package/dist/server.js
CHANGED
|
@@ -38,6 +38,13 @@
|
|
|
38
38
|
* - sk_assign: Assign a skill to a project
|
|
39
39
|
* - sk_unassign: Remove a skill assignment from a project
|
|
40
40
|
* - sk_export: Export all skill assignments for a project
|
|
41
|
+
* - pd_list: List project directives
|
|
42
|
+
* - pd_get: Get a specific directive
|
|
43
|
+
* - pd_create: Create a new directive
|
|
44
|
+
* - pd_update: Update an existing directive
|
|
45
|
+
* - pd_delete: Delete a directive
|
|
46
|
+
* - pd_toggle: Toggle directive enabled/disabled
|
|
47
|
+
* - directive_export: Export enabled directives (CLI format)
|
|
41
48
|
* - doc_ingest: Push text/markdown content into project knowledge base
|
|
42
49
|
* - doc_list: List ingested documents for a project
|
|
43
50
|
* - session_append: Append to a session (write-isolated)
|
|
@@ -78,6 +85,9 @@ import { appendSessionEntry, appendSessionEntrySchema, } from './tools/append-se
|
|
|
78
85
|
import { createTask, createTaskSchema } from './tools/create-task.js';
|
|
79
86
|
import { addDecisionComment, addDecisionCommentSchema, listDecisionComments, listDecisionCommentsSchema, } from './tools/decision-comments.js';
|
|
80
87
|
import { ingestDocument, ingestDocumentSchema, } from './tools/ingest-document.js';
|
|
88
|
+
import { classifyDocument, classifyDocumentSchema, } from './tools/classify-document.js';
|
|
89
|
+
import { updateDocument, updateDocumentSchema, } from './tools/update-document.js';
|
|
90
|
+
import { deleteDocument, deleteDocumentSchema, } from './tools/delete-document.js';
|
|
81
91
|
import { acknowledgeLetter, acknowledgeLetterSchema, listInbox, listInboxSchema, listOutbox, listOutboxSchema, } from './tools/letter-inbox.js';
|
|
82
92
|
import { createLetter, createLetterSchema, replyLetter, replyLetterSchema, } from './tools/letters.js';
|
|
83
93
|
import { listDocuments, listDocumentsSchema, } from './tools/list-documents.js';
|
|
@@ -85,6 +95,7 @@ import { listTasks, listTasksSchema } from './tools/list-tasks.js';
|
|
|
85
95
|
import { closeSession, closeSessionSchema, createSession, createSessionSchema, listOpenSessions, listOpenSessionsSchema, } from './tools/sessions.js';
|
|
86
96
|
import { skActivate, skActivateSchema, skCreate, skCreateSchema, skGet, skGetSchema, skList, skListSchema, skUpdate, skUpdateSchema, } from './tools/skills.js';
|
|
87
97
|
import { skAssign, skAssignSchema, skExport, skExportSchema, skUnassign, skUnassignSchema, } from './tools/skill-assign.js';
|
|
98
|
+
import { pdList, pdListSchema, pdGet, pdGetSchema, pdCreate, pdCreateSchema, pdUpdate, pdUpdateSchema, pdDelete, pdDeleteSchema, pdToggle, pdToggleSchema, directiveExport, directiveExportSchema, } from './tools/directives.js';
|
|
88
99
|
import { updateTaskStatus, updateTaskStatusSchema, } from './tools/update-task-status.js';
|
|
89
100
|
// Layer 3: Governance
|
|
90
101
|
import { createAdrDraft, createAdrDraftSchema, recordAdrDecision, recordAdrDecisionSchema, submitAdrReview, submitAdrReviewSchema, } from './tools/governance.js';
|
|
@@ -110,7 +121,7 @@ function withIdentity(handler) {
|
|
|
110
121
|
// ---------------------------------------------------------------------------
|
|
111
122
|
const server = new McpServer({
|
|
112
123
|
name: 'nexus-mcp',
|
|
113
|
-
version: '0.
|
|
124
|
+
version: '0.8.0',
|
|
114
125
|
}, {
|
|
115
126
|
capabilities: {
|
|
116
127
|
tools: {},
|
|
@@ -138,6 +149,9 @@ server.tool('task_note', 'Append a note to an existing task. Notes are append-on
|
|
|
138
149
|
server.tool('task_list', 'List tasks for a project with optional status filtering. Returns tasks ordered by creation date (newest first).', listTasksSchema, withIdentity(listTasks));
|
|
139
150
|
server.tool('doc_ingest', 'Push text or markdown content into a project knowledge base. Creates an ingest item that can later be classified. Useful for agents to persist research results, generated documents, or extracted knowledge.', ingestDocumentSchema, withIdentity(ingestDocument));
|
|
140
151
|
server.tool('doc_list', 'List ingested documents for a project with optional source filtering. Returns documents ordered by creation date (newest first).', listDocumentsSchema, withIdentity(listDocuments));
|
|
152
|
+
server.tool('doc_classify', 'Update the classification of an ingest item. Valid classifications: unclassified, research_note, planning_item, decision_input, reference, archive.', classifyDocumentSchema, withIdentity(classifyDocument));
|
|
153
|
+
server.tool('doc_update', 'Update title, body, or source_url of an ingest item. Supports full body replacement or append mode via append_body. At least one field must be provided.', updateDocumentSchema, withIdentity(updateDocument));
|
|
154
|
+
server.tool('doc_delete', 'Delete an ingest item from a project knowledge base. This action is irreversible.', deleteDocumentSchema, withIdentity(deleteDocument));
|
|
141
155
|
server.tool('session_append', 'Append an entry to an existing session. Enforces session write isolation: only the session creator can append entries.', appendSessionEntrySchema, withIdentity(appendSessionEntry));
|
|
142
156
|
server.tool('session_create', 'Create a new work session for a project. Returns the session ID. The session starts in open status and must be closed explicitly via session_close.', createSessionSchema, withIdentity(createSession));
|
|
143
157
|
server.tool('session_close', 'Close an open session. Sets status to closed, optionally records a summary and next entry point. Only the session creator can close it.', closeSessionSchema, withIdentity(closeSession));
|
|
@@ -159,6 +173,16 @@ server.tool('sk_assign', 'Assign a skill to a project. Optionally pin to a speci
|
|
|
159
173
|
server.tool('sk_unassign', 'Remove a skill assignment from a project.', skUnassignSchema, withIdentity(skUnassign));
|
|
160
174
|
server.tool('sk_export', 'Export all skill assignments for a project. Returns the full assignment list with pinned versions and enabled states.', skExportSchema, withIdentity(skExport));
|
|
161
175
|
// ---------------------------------------------------------------------------
|
|
176
|
+
// Layer 2 (continued): Project Directives tools
|
|
177
|
+
// ---------------------------------------------------------------------------
|
|
178
|
+
server.tool('pd_list', 'List project directives with optional enabled filter. Returns directives ordered by priority and creation date.', pdListSchema, withIdentity(pdList));
|
|
179
|
+
server.tool('pd_get', 'Get a specific project directive by UUID. Returns full directive details.', pdGetSchema, withIdentity(pdGet));
|
|
180
|
+
server.tool('pd_create', 'Create a new project directive. Directives are project-scoped rules/policies that guide agent behavior.', pdCreateSchema, withIdentity(pdCreate));
|
|
181
|
+
server.tool('pd_update', 'Update an existing project directive. Supports partial updates for title, body, category, priority, and enabled state.', pdUpdateSchema, withIdentity(pdUpdate));
|
|
182
|
+
server.tool('pd_delete', 'Delete a project directive by UUID.', pdDeleteSchema, withIdentity(pdDelete));
|
|
183
|
+
server.tool('pd_toggle', 'Toggle a project directive enabled/disabled. Omit enabled parameter to invert current state.', pdToggleSchema, withIdentity(pdToggle));
|
|
184
|
+
server.tool('directive_export', 'Export all enabled directives for a project in CLI-compatible format.', directiveExportSchema, withIdentity(directiveExport));
|
|
185
|
+
// ---------------------------------------------------------------------------
|
|
162
186
|
// Layer 3: Governance tools
|
|
163
187
|
// ---------------------------------------------------------------------------
|
|
164
188
|
server.tool('adr_create', 'Create a new ADR (Architecture Decision Record) in draft state. Auto-assigns the next ADR number for the project. Optionally links to a superseded ADR.', createAdrDraftSchema, withIdentity(createAdrDraft));
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAEhF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAErD,4BAA4B;AAC5B,OAAO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IACnB,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAA;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* doc_classify -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Update the classification of an ingest item.
|
|
5
|
+
* Delegates to POST /api/mcp/documents (action: doc_classify).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export declare const classifyDocumentSchema: {
|
|
9
|
+
document_id: z.ZodString;
|
|
10
|
+
classification: z.ZodEnum<{
|
|
11
|
+
research_note: "research_note";
|
|
12
|
+
planning_item: "planning_item";
|
|
13
|
+
unclassified: "unclassified";
|
|
14
|
+
decision_input: "decision_input";
|
|
15
|
+
reference: "reference";
|
|
16
|
+
archive: "archive";
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
type ClassifyDocumentArgs = {
|
|
20
|
+
document_id: string;
|
|
21
|
+
classification: string;
|
|
22
|
+
user_id: string;
|
|
23
|
+
};
|
|
24
|
+
export declare function classifyDocument(args: ClassifyDocumentArgs): Promise<{
|
|
25
|
+
content: {
|
|
26
|
+
type: "text";
|
|
27
|
+
text: string;
|
|
28
|
+
}[];
|
|
29
|
+
isError: boolean;
|
|
30
|
+
} | {
|
|
31
|
+
content: {
|
|
32
|
+
type: "text";
|
|
33
|
+
text: string;
|
|
34
|
+
}[];
|
|
35
|
+
isError?: undefined;
|
|
36
|
+
}>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=classify-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify-document.d.ts","sourceRoot":"","sources":["../../src/tools/classify-document.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,sBAAsB;;;;;;;;;;CAYlC,CAAA;AAED,KAAK,oBAAoB,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB;;;;;;;;;;;;GAwBhE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* doc_classify -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Update the classification of an ingest item.
|
|
5
|
+
* Delegates to POST /api/mcp/documents (action: doc_classify).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { nexusPost } from '../nexus-api.js';
|
|
9
|
+
export const classifyDocumentSchema = {
|
|
10
|
+
document_id: z.string().uuid().describe('Document UUID to classify'),
|
|
11
|
+
classification: z
|
|
12
|
+
.enum([
|
|
13
|
+
'unclassified',
|
|
14
|
+
'research_note',
|
|
15
|
+
'planning_item',
|
|
16
|
+
'decision_input',
|
|
17
|
+
'reference',
|
|
18
|
+
'archive',
|
|
19
|
+
])
|
|
20
|
+
.describe('New classification for the document'),
|
|
21
|
+
};
|
|
22
|
+
export async function classifyDocument(args) {
|
|
23
|
+
const result = await nexusPost('/api/mcp/documents', {
|
|
24
|
+
action: 'doc_classify',
|
|
25
|
+
document_id: args.document_id,
|
|
26
|
+
classification: args.classification,
|
|
27
|
+
});
|
|
28
|
+
if (!result.ok) {
|
|
29
|
+
return {
|
|
30
|
+
content: [
|
|
31
|
+
{
|
|
32
|
+
type: 'text',
|
|
33
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
isError: true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
content: [
|
|
41
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=classify-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify-document.js","sourceRoot":"","sources":["../../src/tools/classify-document.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IACpE,cAAc,EAAE,CAAC;SACd,IAAI,CAAC;QACJ,cAAc;QACd,eAAe;QACf,eAAe;QACf,gBAAgB;QAChB,WAAW;QACX,SAAS;KACV,CAAC;SACD,QAAQ,CAAC,qCAAqC,CAAC;CACnD,CAAA;AAQD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAA0B;IAC/D,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,oBAAoB,EAAE;QACnD,MAAM,EAAE,cAAc;QACtB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,cAAc,EAAE,IAAI,CAAC,cAAc;KACpC,CAAC,CAAA;IAEF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACvD;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAA;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;SACtE;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* doc_delete -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Delete an ingest item from a project's knowledge base.
|
|
5
|
+
* Delegates to POST /api/mcp/documents (action: doc_delete).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export declare const deleteDocumentSchema: {
|
|
9
|
+
document_id: z.ZodString;
|
|
10
|
+
};
|
|
11
|
+
type DeleteDocumentArgs = {
|
|
12
|
+
document_id: string;
|
|
13
|
+
user_id: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function deleteDocument(args: DeleteDocumentArgs): Promise<{
|
|
16
|
+
content: {
|
|
17
|
+
type: "text";
|
|
18
|
+
text: string;
|
|
19
|
+
}[];
|
|
20
|
+
isError: boolean;
|
|
21
|
+
} | {
|
|
22
|
+
content: {
|
|
23
|
+
type: "text";
|
|
24
|
+
text: string;
|
|
25
|
+
}[];
|
|
26
|
+
isError?: undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=delete-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-document.d.ts","sourceRoot":"","sources":["../../src/tools/delete-document.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,oBAAoB;;CAEhC,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,kBAAkB;;;;;;;;;;;;GAuB5D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* doc_delete -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Delete an ingest item from a project's knowledge base.
|
|
5
|
+
* Delegates to POST /api/mcp/documents (action: doc_delete).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { nexusPost } from '../nexus-api.js';
|
|
9
|
+
export const deleteDocumentSchema = {
|
|
10
|
+
document_id: z.string().uuid().describe('Document UUID to delete'),
|
|
11
|
+
};
|
|
12
|
+
export async function deleteDocument(args) {
|
|
13
|
+
const result = await nexusPost('/api/mcp/documents', {
|
|
14
|
+
action: 'doc_delete',
|
|
15
|
+
document_id: args.document_id,
|
|
16
|
+
});
|
|
17
|
+
if (!result.ok) {
|
|
18
|
+
return {
|
|
19
|
+
content: [
|
|
20
|
+
{
|
|
21
|
+
type: 'text',
|
|
22
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
isError: true,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=delete-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-document.js","sourceRoot":"","sources":["../../src/tools/delete-document.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;CACnE,CAAA;AAOD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAwB;IAC3D,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,oBAAoB,EAAE;QACnD,MAAM,EAAE,YAAY;QACpB,WAAW,EAAE,IAAI,CAAC,WAAW;KAC9B,CAAC,CAAA;IAEF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACvD;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAA;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;SACtE;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pd_list + pd_get + pd_create + pd_update + pd_delete + pd_toggle + directive_export
|
|
3
|
+
*
|
|
4
|
+
* Project Directives management tools for the Nexus platform.
|
|
5
|
+
* Directives are project-scoped rules/policies that guide agent behavior.
|
|
6
|
+
* Delegates to POST /api/mcp/directives.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
export declare const pdListSchema: {
|
|
10
|
+
project_id: z.ZodString;
|
|
11
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
};
|
|
14
|
+
type PdListArgs = {
|
|
15
|
+
project_id: string;
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
limit?: number;
|
|
18
|
+
user_id: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function pdList(args: PdListArgs): Promise<{
|
|
21
|
+
content: {
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
}>;
|
|
26
|
+
export declare const pdGetSchema: {
|
|
27
|
+
directive_id: z.ZodString;
|
|
28
|
+
};
|
|
29
|
+
type PdGetArgs = {
|
|
30
|
+
directive_id: string;
|
|
31
|
+
user_id: string;
|
|
32
|
+
};
|
|
33
|
+
export declare function pdGet(args: PdGetArgs): Promise<{
|
|
34
|
+
content: {
|
|
35
|
+
type: "text";
|
|
36
|
+
text: string;
|
|
37
|
+
}[];
|
|
38
|
+
}>;
|
|
39
|
+
export declare const pdCreateSchema: {
|
|
40
|
+
project_id: z.ZodString;
|
|
41
|
+
title: z.ZodString;
|
|
42
|
+
body: z.ZodOptional<z.ZodString>;
|
|
43
|
+
category: z.ZodDefault<z.ZodString>;
|
|
44
|
+
priority: z.ZodDefault<z.ZodEnum<{
|
|
45
|
+
low: "low";
|
|
46
|
+
high: "high";
|
|
47
|
+
medium: "medium";
|
|
48
|
+
}>>;
|
|
49
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
50
|
+
};
|
|
51
|
+
type PdCreateArgs = {
|
|
52
|
+
project_id: string;
|
|
53
|
+
title: string;
|
|
54
|
+
body?: string;
|
|
55
|
+
category?: string;
|
|
56
|
+
priority?: string;
|
|
57
|
+
enabled?: boolean;
|
|
58
|
+
user_id: string;
|
|
59
|
+
};
|
|
60
|
+
export declare function pdCreate(args: PdCreateArgs): Promise<{
|
|
61
|
+
content: {
|
|
62
|
+
type: "text";
|
|
63
|
+
text: string;
|
|
64
|
+
}[];
|
|
65
|
+
}>;
|
|
66
|
+
export declare const pdUpdateSchema: {
|
|
67
|
+
directive_id: z.ZodString;
|
|
68
|
+
title: z.ZodOptional<z.ZodString>;
|
|
69
|
+
body: z.ZodOptional<z.ZodString>;
|
|
70
|
+
category: z.ZodOptional<z.ZodString>;
|
|
71
|
+
priority: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
low: "low";
|
|
73
|
+
high: "high";
|
|
74
|
+
medium: "medium";
|
|
75
|
+
}>>;
|
|
76
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
};
|
|
78
|
+
type PdUpdateArgs = {
|
|
79
|
+
directive_id: string;
|
|
80
|
+
title?: string;
|
|
81
|
+
body?: string;
|
|
82
|
+
category?: string;
|
|
83
|
+
priority?: string;
|
|
84
|
+
enabled?: boolean;
|
|
85
|
+
user_id: string;
|
|
86
|
+
};
|
|
87
|
+
export declare function pdUpdate(args: PdUpdateArgs): Promise<{
|
|
88
|
+
content: {
|
|
89
|
+
type: "text";
|
|
90
|
+
text: string;
|
|
91
|
+
}[];
|
|
92
|
+
}>;
|
|
93
|
+
export declare const pdDeleteSchema: {
|
|
94
|
+
directive_id: z.ZodString;
|
|
95
|
+
};
|
|
96
|
+
type PdDeleteArgs = {
|
|
97
|
+
directive_id: string;
|
|
98
|
+
user_id: string;
|
|
99
|
+
};
|
|
100
|
+
export declare function pdDelete(args: PdDeleteArgs): Promise<{
|
|
101
|
+
content: {
|
|
102
|
+
type: "text";
|
|
103
|
+
text: string;
|
|
104
|
+
}[];
|
|
105
|
+
}>;
|
|
106
|
+
export declare const pdToggleSchema: {
|
|
107
|
+
directive_id: z.ZodString;
|
|
108
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
};
|
|
110
|
+
type PdToggleArgs = {
|
|
111
|
+
directive_id: string;
|
|
112
|
+
enabled?: boolean;
|
|
113
|
+
user_id: string;
|
|
114
|
+
};
|
|
115
|
+
export declare function pdToggle(args: PdToggleArgs): Promise<{
|
|
116
|
+
content: {
|
|
117
|
+
type: "text";
|
|
118
|
+
text: string;
|
|
119
|
+
}[];
|
|
120
|
+
}>;
|
|
121
|
+
export declare const directiveExportSchema: {
|
|
122
|
+
project_id: z.ZodString;
|
|
123
|
+
};
|
|
124
|
+
type DirectiveExportArgs = {
|
|
125
|
+
project_id: string;
|
|
126
|
+
user_id: string;
|
|
127
|
+
};
|
|
128
|
+
export declare function directiveExport(args: DirectiveExportArgs): Promise<{
|
|
129
|
+
content: {
|
|
130
|
+
type: "text";
|
|
131
|
+
text: string;
|
|
132
|
+
}[];
|
|
133
|
+
}>;
|
|
134
|
+
export {};
|
|
135
|
+
//# sourceMappingURL=directives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../../src/tools/directives.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAiCvB,eAAO,MAAM,YAAY;;;;CAexB,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,UAAU;;;;;GAU5C;AAMD,eAAO,MAAM,WAAW;;CAKvB,CAAA;AAED,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,KAAK,CAAC,IAAI,EAAE,SAAS;;;;;GAQ1C;AAMD,eAAO,MAAM,cAAc;;;;;;;;;;;CA2B1B,CAAA;AAED,KAAK,YAAY,GAAG;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,YAAY;;;;;GAahD;AAMD,eAAO,MAAM,cAAc;;;;;;;;;;;CA4B1B,CAAA;AAED,KAAK,YAAY,GAAG;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,YAAY;;;;;GAahD;AAMD,eAAO,MAAM,cAAc;;CAK1B,CAAA;AAED,KAAK,YAAY,GAAG;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,YAAY;;;;;GAQhD;AAMD,eAAO,MAAM,cAAc;;;CAS1B,CAAA;AAED,KAAK,YAAY,GAAG;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,YAAY;;;;;GAShD;AAMD,eAAO,MAAM,qBAAqB;;CAKjC,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,mBAAmB;;;;;GAQ9D"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pd_list + pd_get + pd_create + pd_update + pd_delete + pd_toggle + directive_export
|
|
3
|
+
*
|
|
4
|
+
* Project Directives management tools for the Nexus platform.
|
|
5
|
+
* Directives are project-scoped rules/policies that guide agent behavior.
|
|
6
|
+
* Delegates to POST /api/mcp/directives.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { nexusPost } from '../nexus-api.js';
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// Shared helpers
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
+
function errorResult(result) {
|
|
15
|
+
return {
|
|
16
|
+
content: [
|
|
17
|
+
{
|
|
18
|
+
type: 'text',
|
|
19
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
isError: true,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
+
function okResult(data) {
|
|
27
|
+
return {
|
|
28
|
+
content: [
|
|
29
|
+
{ type: 'text', text: JSON.stringify(data, null, 2) },
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// pd_list
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
export const pdListSchema = {
|
|
37
|
+
project_id: z
|
|
38
|
+
.string()
|
|
39
|
+
.uuid()
|
|
40
|
+
.describe('Project UUID'),
|
|
41
|
+
enabled: z
|
|
42
|
+
.boolean()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('Filter by enabled status'),
|
|
45
|
+
limit: z
|
|
46
|
+
.number()
|
|
47
|
+
.min(1)
|
|
48
|
+
.max(100)
|
|
49
|
+
.default(50)
|
|
50
|
+
.describe('Maximum results to return'),
|
|
51
|
+
};
|
|
52
|
+
export async function pdList(args) {
|
|
53
|
+
const result = await nexusPost('/api/mcp/directives', {
|
|
54
|
+
action: 'pd_list',
|
|
55
|
+
project_id: args.project_id,
|
|
56
|
+
enabled: args.enabled,
|
|
57
|
+
limit: args.limit ?? 50,
|
|
58
|
+
});
|
|
59
|
+
if (!result.ok)
|
|
60
|
+
return errorResult(result);
|
|
61
|
+
return okResult(result.data);
|
|
62
|
+
}
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// pd_get
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
export const pdGetSchema = {
|
|
67
|
+
directive_id: z
|
|
68
|
+
.string()
|
|
69
|
+
.uuid()
|
|
70
|
+
.describe('Directive UUID'),
|
|
71
|
+
};
|
|
72
|
+
export async function pdGet(args) {
|
|
73
|
+
const result = await nexusPost('/api/mcp/directives', {
|
|
74
|
+
action: 'pd_get',
|
|
75
|
+
directive_id: args.directive_id,
|
|
76
|
+
});
|
|
77
|
+
if (!result.ok)
|
|
78
|
+
return errorResult(result);
|
|
79
|
+
return okResult(result.data);
|
|
80
|
+
}
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
// pd_create
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
export const pdCreateSchema = {
|
|
85
|
+
project_id: z
|
|
86
|
+
.string()
|
|
87
|
+
.uuid()
|
|
88
|
+
.describe('Project UUID'),
|
|
89
|
+
title: z
|
|
90
|
+
.string()
|
|
91
|
+
.max(500)
|
|
92
|
+
.describe('Directive title'),
|
|
93
|
+
body: z
|
|
94
|
+
.string()
|
|
95
|
+
.max(10000)
|
|
96
|
+
.optional()
|
|
97
|
+
.describe('Directive body (markdown)'),
|
|
98
|
+
category: z
|
|
99
|
+
.string()
|
|
100
|
+
.max(100)
|
|
101
|
+
.default('general')
|
|
102
|
+
.describe('Directive category (e.g. general, security, deployment)'),
|
|
103
|
+
priority: z
|
|
104
|
+
.enum(['low', 'medium', 'high'])
|
|
105
|
+
.default('medium')
|
|
106
|
+
.describe('Directive priority'),
|
|
107
|
+
enabled: z
|
|
108
|
+
.boolean()
|
|
109
|
+
.default(true)
|
|
110
|
+
.describe('Whether the directive is enabled'),
|
|
111
|
+
};
|
|
112
|
+
export async function pdCreate(args) {
|
|
113
|
+
const result = await nexusPost('/api/mcp/directives', {
|
|
114
|
+
action: 'pd_create',
|
|
115
|
+
project_id: args.project_id,
|
|
116
|
+
title: args.title,
|
|
117
|
+
body: args.body,
|
|
118
|
+
category: args.category ?? 'general',
|
|
119
|
+
priority: args.priority ?? 'medium',
|
|
120
|
+
enabled: args.enabled !== false,
|
|
121
|
+
});
|
|
122
|
+
if (!result.ok)
|
|
123
|
+
return errorResult(result);
|
|
124
|
+
return okResult(result.data);
|
|
125
|
+
}
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
// pd_update
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
export const pdUpdateSchema = {
|
|
130
|
+
directive_id: z
|
|
131
|
+
.string()
|
|
132
|
+
.uuid()
|
|
133
|
+
.describe('Directive UUID'),
|
|
134
|
+
title: z
|
|
135
|
+
.string()
|
|
136
|
+
.max(500)
|
|
137
|
+
.optional()
|
|
138
|
+
.describe('Updated title'),
|
|
139
|
+
body: z
|
|
140
|
+
.string()
|
|
141
|
+
.max(10000)
|
|
142
|
+
.optional()
|
|
143
|
+
.describe('Updated body (markdown)'),
|
|
144
|
+
category: z
|
|
145
|
+
.string()
|
|
146
|
+
.max(100)
|
|
147
|
+
.optional()
|
|
148
|
+
.describe('Updated category'),
|
|
149
|
+
priority: z
|
|
150
|
+
.enum(['low', 'medium', 'high'])
|
|
151
|
+
.optional()
|
|
152
|
+
.describe('Updated priority'),
|
|
153
|
+
enabled: z
|
|
154
|
+
.boolean()
|
|
155
|
+
.optional()
|
|
156
|
+
.describe('Updated enabled state'),
|
|
157
|
+
};
|
|
158
|
+
export async function pdUpdate(args) {
|
|
159
|
+
const result = await nexusPost('/api/mcp/directives', {
|
|
160
|
+
action: 'pd_update',
|
|
161
|
+
directive_id: args.directive_id,
|
|
162
|
+
title: args.title,
|
|
163
|
+
body: args.body,
|
|
164
|
+
category: args.category,
|
|
165
|
+
priority: args.priority,
|
|
166
|
+
enabled: args.enabled,
|
|
167
|
+
});
|
|
168
|
+
if (!result.ok)
|
|
169
|
+
return errorResult(result);
|
|
170
|
+
return okResult(result.data);
|
|
171
|
+
}
|
|
172
|
+
// ---------------------------------------------------------------------------
|
|
173
|
+
// pd_delete
|
|
174
|
+
// ---------------------------------------------------------------------------
|
|
175
|
+
export const pdDeleteSchema = {
|
|
176
|
+
directive_id: z
|
|
177
|
+
.string()
|
|
178
|
+
.uuid()
|
|
179
|
+
.describe('Directive UUID to delete'),
|
|
180
|
+
};
|
|
181
|
+
export async function pdDelete(args) {
|
|
182
|
+
const result = await nexusPost('/api/mcp/directives', {
|
|
183
|
+
action: 'pd_delete',
|
|
184
|
+
directive_id: args.directive_id,
|
|
185
|
+
});
|
|
186
|
+
if (!result.ok)
|
|
187
|
+
return errorResult(result);
|
|
188
|
+
return okResult(result.data);
|
|
189
|
+
}
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
// pd_toggle
|
|
192
|
+
// ---------------------------------------------------------------------------
|
|
193
|
+
export const pdToggleSchema = {
|
|
194
|
+
directive_id: z
|
|
195
|
+
.string()
|
|
196
|
+
.uuid()
|
|
197
|
+
.describe('Directive UUID to toggle'),
|
|
198
|
+
enabled: z
|
|
199
|
+
.boolean()
|
|
200
|
+
.optional()
|
|
201
|
+
.describe('Explicit enabled state (omit to invert current)'),
|
|
202
|
+
};
|
|
203
|
+
export async function pdToggle(args) {
|
|
204
|
+
const result = await nexusPost('/api/mcp/directives', {
|
|
205
|
+
action: 'pd_toggle',
|
|
206
|
+
directive_id: args.directive_id,
|
|
207
|
+
enabled: args.enabled,
|
|
208
|
+
});
|
|
209
|
+
if (!result.ok)
|
|
210
|
+
return errorResult(result);
|
|
211
|
+
return okResult(result.data);
|
|
212
|
+
}
|
|
213
|
+
// ---------------------------------------------------------------------------
|
|
214
|
+
// directive_export
|
|
215
|
+
// ---------------------------------------------------------------------------
|
|
216
|
+
export const directiveExportSchema = {
|
|
217
|
+
project_id: z
|
|
218
|
+
.string()
|
|
219
|
+
.uuid()
|
|
220
|
+
.describe('Project UUID'),
|
|
221
|
+
};
|
|
222
|
+
export async function directiveExport(args) {
|
|
223
|
+
const result = await nexusPost('/api/mcp/directives', {
|
|
224
|
+
action: 'directive_export',
|
|
225
|
+
project_id: args.project_id,
|
|
226
|
+
});
|
|
227
|
+
if (!result.ok)
|
|
228
|
+
return errorResult(result);
|
|
229
|
+
return okResult(result.data);
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=directives.js.map
|