@gwdn/nexus-mcp 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +38 -0
- package/.github/workflows/release.yml +57 -0
- package/README.md +89 -0
- package/dist/auth.d.ts +39 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +47 -0
- package/dist/auth.js.map +1 -0
- package/dist/nexus-api.d.ts +35 -0
- package/dist/nexus-api.d.ts.map +1 -0
- package/dist/nexus-api.js +90 -0
- package/dist/nexus-api.js.map +1 -0
- package/dist/server.d.ts +67 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +189 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/add-task-note.d.ts +34 -0
- package/dist/tools/add-task-note.d.ts.map +1 -0
- package/dist/tools/add-task-note.js +39 -0
- package/dist/tools/add-task-note.js.map +1 -0
- package/dist/tools/append-session-entry.d.ts +53 -0
- package/dist/tools/append-session-entry.d.ts.map +1 -0
- package/dist/tools/append-session-entry.js +68 -0
- package/dist/tools/append-session-entry.js.map +1 -0
- package/dist/tools/create-task.d.ts +52 -0
- package/dist/tools/create-task.d.ts.map +1 -0
- package/dist/tools/create-task.js +51 -0
- package/dist/tools/create-task.js.map +1 -0
- package/dist/tools/decision-comments.d.ts +54 -0
- package/dist/tools/decision-comments.d.ts.map +1 -0
- package/dist/tools/decision-comments.js +81 -0
- package/dist/tools/decision-comments.js.map +1 -0
- package/dist/tools/get-document.d.ts +47 -0
- package/dist/tools/get-document.d.ts.map +1 -0
- package/dist/tools/get-document.js +68 -0
- package/dist/tools/get-document.js.map +1 -0
- package/dist/tools/get-project-memory.d.ts +47 -0
- package/dist/tools/get-project-memory.d.ts.map +1 -0
- package/dist/tools/get-project-memory.js +53 -0
- package/dist/tools/get-project-memory.js.map +1 -0
- package/dist/tools/get-related-entities.d.ts +44 -0
- package/dist/tools/get-related-entities.d.ts.map +1 -0
- package/dist/tools/get-related-entities.js +60 -0
- package/dist/tools/get-related-entities.js.map +1 -0
- package/dist/tools/governance.d.ts +90 -0
- package/dist/tools/governance.d.ts.map +1 -0
- package/dist/tools/governance.js +127 -0
- package/dist/tools/governance.js.map +1 -0
- package/dist/tools/ingest-document.d.ts +40 -0
- package/dist/tools/ingest-document.d.ts.map +1 -0
- package/dist/tools/ingest-document.js +49 -0
- package/dist/tools/ingest-document.js.map +1 -0
- package/dist/tools/letter-inbox.d.ts +80 -0
- package/dist/tools/letter-inbox.d.ts.map +1 -0
- package/dist/tools/letter-inbox.js +118 -0
- package/dist/tools/letter-inbox.js.map +1 -0
- package/dist/tools/letters.d.ts +91 -0
- package/dist/tools/letters.d.ts.map +1 -0
- package/dist/tools/letters.js +112 -0
- package/dist/tools/letters.js.map +1 -0
- package/dist/tools/list-documents.d.ts +33 -0
- package/dist/tools/list-documents.d.ts.map +1 -0
- package/dist/tools/list-documents.js +47 -0
- package/dist/tools/list-documents.js.map +1 -0
- package/dist/tools/list-tasks.d.ts +39 -0
- package/dist/tools/list-tasks.d.ts.map +1 -0
- package/dist/tools/list-tasks.js +46 -0
- package/dist/tools/list-tasks.js.map +1 -0
- package/dist/tools/project-list.d.ts +28 -0
- package/dist/tools/project-list.d.ts.map +1 -0
- package/dist/tools/project-list.js +43 -0
- package/dist/tools/project-list.js.map +1 -0
- package/dist/tools/reviews.d.ts +145 -0
- package/dist/tools/reviews.d.ts.map +1 -0
- package/dist/tools/reviews.js +220 -0
- package/dist/tools/reviews.js.map +1 -0
- package/dist/tools/search-knowledge.d.ts +48 -0
- package/dist/tools/search-knowledge.d.ts.map +1 -0
- package/dist/tools/search-knowledge.js +54 -0
- package/dist/tools/search-knowledge.js.map +1 -0
- package/dist/tools/sessions.d.ts +81 -0
- package/dist/tools/sessions.d.ts.map +1 -0
- package/dist/tools/sessions.js +123 -0
- package/dist/tools/sessions.js.map +1 -0
- package/dist/tools/skill-assign.d.ts +77 -0
- package/dist/tools/skill-assign.d.ts.map +1 -0
- package/dist/tools/skill-assign.js +108 -0
- package/dist/tools/skill-assign.js.map +1 -0
- package/dist/tools/skills.d.ts +138 -0
- package/dist/tools/skills.d.ts.map +1 -0
- package/dist/tools/skills.js +195 -0
- package/dist/tools/skills.js.map +1 -0
- package/dist/tools/update-task-status.d.ts +48 -0
- package/dist/tools/update-task-status.d.ts.map +1 -0
- package/dist/tools/update-task-status.js +51 -0
- package/dist/tools/update-task-status.js.map +1 -0
- package/package.json +30 -0
- package/src/__tests__/auth.test.ts +162 -0
- package/src/__tests__/decision-comments.test.ts +173 -0
- package/src/__tests__/e2e-integration.test.ts +443 -0
- package/src/__tests__/helpers.ts +58 -0
- package/src/__tests__/layer1-knowledge.test.ts +302 -0
- package/src/__tests__/layer2-coordination.test.ts +842 -0
- package/src/__tests__/layer3-governance.test.ts +205 -0
- package/src/__tests__/project-list-and-skill-assign.test.ts +282 -0
- package/src/__tests__/reviews.test.ts +420 -0
- package/src/__tests__/server.test.ts +250 -0
- package/src/__tests__/setup.ts +15 -0
- package/src/__tests__/task-list-and-doc-list.test.ts +226 -0
- package/src/auth.ts +81 -0
- package/src/nexus-api.ts +127 -0
- package/src/server.ts +520 -0
- package/src/tools/add-task-note.ts +50 -0
- package/src/tools/append-session-entry.ts +84 -0
- package/src/tools/create-task.ts +66 -0
- package/src/tools/decision-comments.ts +103 -0
- package/src/tools/get-document.ts +80 -0
- package/src/tools/get-project-memory.ts +65 -0
- package/src/tools/get-related-entities.ts +73 -0
- package/src/tools/governance.ts +165 -0
- package/src/tools/ingest-document.ts +65 -0
- package/src/tools/letter-inbox.ts +157 -0
- package/src/tools/letters.ts +144 -0
- package/src/tools/list-documents.ts +58 -0
- package/src/tools/list-tasks.ts +57 -0
- package/src/tools/project-list.ts +52 -0
- package/src/tools/reviews.ts +281 -0
- package/src/tools/search-knowledge.ts +68 -0
- package/src/tools/sessions.ts +157 -0
- package/src/tools/skill-assign.ts +142 -0
- package/src/tools/skills.ts +255 -0
- package/src/tools/update-task-status.ts +64 -0
- package/tsconfig.json +20 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* doc_ingest -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Allows agents to push text/markdown content into a project's
|
|
5
|
+
* knowledge base via the ingest_items table.
|
|
6
|
+
* Delegates to POST /api/mcp/documents (action: doc_ingest).
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
export declare const ingestDocumentSchema: {
|
|
10
|
+
project_id: z.ZodString;
|
|
11
|
+
title: z.ZodString;
|
|
12
|
+
body: z.ZodString;
|
|
13
|
+
source: z.ZodOptional<z.ZodString>;
|
|
14
|
+
source_url: z.ZodOptional<z.ZodString>;
|
|
15
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
16
|
+
};
|
|
17
|
+
type IngestDocumentArgs = {
|
|
18
|
+
project_id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
body: string;
|
|
21
|
+
source?: string;
|
|
22
|
+
source_url?: string;
|
|
23
|
+
user_id: string;
|
|
24
|
+
agent_id?: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function ingestDocument(args: IngestDocumentArgs): Promise<{
|
|
27
|
+
content: {
|
|
28
|
+
type: "text";
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
isError: boolean;
|
|
32
|
+
} | {
|
|
33
|
+
content: {
|
|
34
|
+
type: "text";
|
|
35
|
+
text: string;
|
|
36
|
+
}[];
|
|
37
|
+
isError?: undefined;
|
|
38
|
+
}>;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=ingest-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ingest-document.d.ts","sourceRoot":"","sources":["../../src/tools/ingest-document.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,oBAAoB;;;;;;;CAahC,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,kBAAkB;;;;;;;;;;;;GA4B5D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* doc_ingest -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Allows agents to push text/markdown content into a project's
|
|
5
|
+
* knowledge base via the ingest_items table.
|
|
6
|
+
* Delegates to POST /api/mcp/documents (action: doc_ingest).
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { nexusPost } from '../nexus-api.js';
|
|
10
|
+
export const ingestDocumentSchema = {
|
|
11
|
+
project_id: z.string().uuid().describe('Project UUID'),
|
|
12
|
+
title: z.string().max(500).describe('Document title'),
|
|
13
|
+
body: z.string().max(100_000).describe('Document content (text or markdown)'),
|
|
14
|
+
source: z
|
|
15
|
+
.string()
|
|
16
|
+
.max(200)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Source identifier (e.g. "mcp-agent", "research", "session-extract")'),
|
|
19
|
+
source_url: z.string().url().optional().describe('Source URL if applicable'),
|
|
20
|
+
agent_id: z.string().max(200).optional().describe('Agent identifier if applicable'),
|
|
21
|
+
};
|
|
22
|
+
export async function ingestDocument(args) {
|
|
23
|
+
const result = await nexusPost('/api/mcp/documents', {
|
|
24
|
+
action: 'doc_ingest',
|
|
25
|
+
project_id: args.project_id,
|
|
26
|
+
title: args.title,
|
|
27
|
+
body: args.body,
|
|
28
|
+
source: args.source,
|
|
29
|
+
source_url: args.source_url,
|
|
30
|
+
agent_id: args.agent_id,
|
|
31
|
+
});
|
|
32
|
+
if (!result.ok) {
|
|
33
|
+
return {
|
|
34
|
+
content: [
|
|
35
|
+
{
|
|
36
|
+
type: 'text',
|
|
37
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
isError: true,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
content: [
|
|
45
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=ingest-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ingest-document.js","sourceRoot":"","sources":["../../src/tools/ingest-document.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;IACtD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACrD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAC7E,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,qEAAqE,CACtE;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IAC5E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;CACpF,CAAA;AAYD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAwB;IAC3D,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,oBAAoB,EAAE;QACnD,MAAM,EAAE,YAAY;QACpB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;KACxB,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,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vl_inbox + vl_outbox + vl_ack -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Inbox/outbox polling and acknowledgment for vault letters.
|
|
5
|
+
* Delegates to POST /api/mcp/letters (actions: vl_inbox, vl_outbox, vl_ack).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export declare const listInboxSchema: {
|
|
9
|
+
project_id: z.ZodString;
|
|
10
|
+
status_filter: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
};
|
|
13
|
+
type ListInboxArgs = {
|
|
14
|
+
project_id: string;
|
|
15
|
+
status_filter?: string[];
|
|
16
|
+
limit?: number;
|
|
17
|
+
user_id: string;
|
|
18
|
+
agent_id?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function listInbox(args: ListInboxArgs): Promise<{
|
|
21
|
+
content: {
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
isError: boolean;
|
|
26
|
+
} | {
|
|
27
|
+
content: {
|
|
28
|
+
type: "text";
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
isError?: undefined;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const listOutboxSchema: {
|
|
34
|
+
project_id: z.ZodString;
|
|
35
|
+
status_filter: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
37
|
+
};
|
|
38
|
+
type ListOutboxArgs = {
|
|
39
|
+
project_id: string;
|
|
40
|
+
status_filter?: string[];
|
|
41
|
+
limit?: number;
|
|
42
|
+
user_id: string;
|
|
43
|
+
agent_id?: string;
|
|
44
|
+
};
|
|
45
|
+
export declare function listOutbox(args: ListOutboxArgs): Promise<{
|
|
46
|
+
content: {
|
|
47
|
+
type: "text";
|
|
48
|
+
text: string;
|
|
49
|
+
}[];
|
|
50
|
+
isError: boolean;
|
|
51
|
+
} | {
|
|
52
|
+
content: {
|
|
53
|
+
type: "text";
|
|
54
|
+
text: string;
|
|
55
|
+
}[];
|
|
56
|
+
isError?: undefined;
|
|
57
|
+
}>;
|
|
58
|
+
export declare const acknowledgeLetterSchema: {
|
|
59
|
+
letter_id: z.ZodString;
|
|
60
|
+
};
|
|
61
|
+
type AcknowledgeLetterArgs = {
|
|
62
|
+
letter_id: string;
|
|
63
|
+
user_id: string;
|
|
64
|
+
agent_id?: string;
|
|
65
|
+
};
|
|
66
|
+
export declare function acknowledgeLetter(args: AcknowledgeLetterArgs): Promise<{
|
|
67
|
+
content: {
|
|
68
|
+
type: "text";
|
|
69
|
+
text: string;
|
|
70
|
+
}[];
|
|
71
|
+
isError: boolean;
|
|
72
|
+
} | {
|
|
73
|
+
content: {
|
|
74
|
+
type: "text";
|
|
75
|
+
text: string;
|
|
76
|
+
}[];
|
|
77
|
+
isError?: undefined;
|
|
78
|
+
}>;
|
|
79
|
+
export {};
|
|
80
|
+
//# sourceMappingURL=letter-inbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"letter-inbox.d.ts","sourceRoot":"","sources":["../../src/tools/letter-inbox.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,eAAO,MAAM,eAAe;;;;CAc3B,CAAA;AAED,KAAK,aAAa,GAAG;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,aAAa;;;;;;;;;;;;GAyBlD;AAMD,eAAO,MAAM,gBAAgB;;;;CAY5B,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,cAAc;;;;;;;;;;;;GAyBpD;AAMD,eAAO,MAAM,uBAAuB;;CAEnC,CAAA;AAED,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,qBAAqB;;;;;;;;;;;;GAwBlE"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vl_inbox + vl_outbox + vl_ack -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Inbox/outbox polling and acknowledgment for vault letters.
|
|
5
|
+
* Delegates to POST /api/mcp/letters (actions: vl_inbox, vl_outbox, vl_ack).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { nexusPost } from '../nexus-api.js';
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// list_inbox
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
export const listInboxSchema = {
|
|
13
|
+
project_id: z.string().uuid().describe('Project UUID'),
|
|
14
|
+
status_filter: z
|
|
15
|
+
.array(z.string().max(50))
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Filter by letter status (default: new, acknowledged, in_progress, blocked, needs_review)'),
|
|
18
|
+
limit: z
|
|
19
|
+
.number()
|
|
20
|
+
.min(1)
|
|
21
|
+
.max(50)
|
|
22
|
+
.default(20)
|
|
23
|
+
.describe('Max number of letters to return'),
|
|
24
|
+
};
|
|
25
|
+
export async function listInbox(args) {
|
|
26
|
+
const result = await nexusPost('/api/mcp/letters', {
|
|
27
|
+
action: 'vl_inbox',
|
|
28
|
+
project_id: args.project_id,
|
|
29
|
+
status_filter: args.status_filter,
|
|
30
|
+
limit: args.limit ?? 20,
|
|
31
|
+
});
|
|
32
|
+
if (!result.ok) {
|
|
33
|
+
return {
|
|
34
|
+
content: [
|
|
35
|
+
{
|
|
36
|
+
type: 'text',
|
|
37
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
isError: true,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
content: [
|
|
45
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
// list_outbox
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
export const listOutboxSchema = {
|
|
53
|
+
project_id: z.string().uuid().describe('Project UUID'),
|
|
54
|
+
status_filter: z
|
|
55
|
+
.array(z.string().max(50))
|
|
56
|
+
.optional()
|
|
57
|
+
.describe('Filter by letter status (default: all non-closed)'),
|
|
58
|
+
limit: z
|
|
59
|
+
.number()
|
|
60
|
+
.min(1)
|
|
61
|
+
.max(50)
|
|
62
|
+
.default(20)
|
|
63
|
+
.describe('Max number of letters to return'),
|
|
64
|
+
};
|
|
65
|
+
export async function listOutbox(args) {
|
|
66
|
+
const result = await nexusPost('/api/mcp/letters', {
|
|
67
|
+
action: 'vl_outbox',
|
|
68
|
+
project_id: args.project_id,
|
|
69
|
+
status_filter: args.status_filter,
|
|
70
|
+
limit: args.limit ?? 20,
|
|
71
|
+
});
|
|
72
|
+
if (!result.ok) {
|
|
73
|
+
return {
|
|
74
|
+
content: [
|
|
75
|
+
{
|
|
76
|
+
type: 'text',
|
|
77
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
isError: true,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
content: [
|
|
85
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
86
|
+
],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
// acknowledge_letter
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
export const acknowledgeLetterSchema = {
|
|
93
|
+
letter_id: z.string().uuid().describe('Letter UUID to acknowledge'),
|
|
94
|
+
};
|
|
95
|
+
export async function acknowledgeLetter(args) {
|
|
96
|
+
const result = await nexusPost('/api/mcp/letters', {
|
|
97
|
+
action: 'vl_ack',
|
|
98
|
+
letter_id: args.letter_id,
|
|
99
|
+
agent_id: args.agent_id,
|
|
100
|
+
});
|
|
101
|
+
if (!result.ok) {
|
|
102
|
+
return {
|
|
103
|
+
content: [
|
|
104
|
+
{
|
|
105
|
+
type: 'text',
|
|
106
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
isError: true,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
content: [
|
|
114
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=letter-inbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"letter-inbox.js","sourceRoot":"","sources":["../../src/tools/letter-inbox.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;IACtD,aAAa,EAAE,CAAC;SACb,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SACzB,QAAQ,EAAE;SACV,QAAQ,CACP,0FAA0F,CAC3F;IACH,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CA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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,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vl_create + vl_reply -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Vault letter management for agent coordination.
|
|
5
|
+
* Delegates to POST /api/mcp/letters (actions: vl_create, vl_reply).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export declare const createLetterSchema: {
|
|
9
|
+
project_id: z.ZodString;
|
|
10
|
+
from_actor: z.ZodString;
|
|
11
|
+
to_actor: z.ZodString;
|
|
12
|
+
subject: z.ZodString;
|
|
13
|
+
body: z.ZodString;
|
|
14
|
+
priority: z.ZodDefault<z.ZodEnum<{
|
|
15
|
+
low: "low";
|
|
16
|
+
normal: "normal";
|
|
17
|
+
high: "high";
|
|
18
|
+
urgent: "urgent";
|
|
19
|
+
}>>;
|
|
20
|
+
blocking: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
+
thread_id: z.ZodOptional<z.ZodString>;
|
|
22
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
23
|
+
};
|
|
24
|
+
type CreateLetterArgs = {
|
|
25
|
+
project_id: string;
|
|
26
|
+
from_actor: string;
|
|
27
|
+
to_actor: string;
|
|
28
|
+
subject: string;
|
|
29
|
+
body: string;
|
|
30
|
+
priority?: string;
|
|
31
|
+
blocking?: boolean;
|
|
32
|
+
thread_id?: string;
|
|
33
|
+
user_id: string;
|
|
34
|
+
agent_id?: string;
|
|
35
|
+
};
|
|
36
|
+
export declare function createLetter(args: CreateLetterArgs): Promise<{
|
|
37
|
+
content: {
|
|
38
|
+
type: "text";
|
|
39
|
+
text: string;
|
|
40
|
+
}[];
|
|
41
|
+
isError: boolean;
|
|
42
|
+
} | {
|
|
43
|
+
content: {
|
|
44
|
+
type: "text";
|
|
45
|
+
text: string;
|
|
46
|
+
}[];
|
|
47
|
+
isError?: undefined;
|
|
48
|
+
}>;
|
|
49
|
+
export declare const replyLetterSchema: {
|
|
50
|
+
letter_id: z.ZodString;
|
|
51
|
+
body: z.ZodString;
|
|
52
|
+
message_type: z.ZodDefault<z.ZodEnum<{
|
|
53
|
+
response: "response";
|
|
54
|
+
clarification: "clarification";
|
|
55
|
+
review_note: "review_note";
|
|
56
|
+
follow_up: "follow_up";
|
|
57
|
+
context: "context";
|
|
58
|
+
}>>;
|
|
59
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
60
|
+
new_status: z.ZodOptional<z.ZodEnum<{
|
|
61
|
+
in_progress: "in_progress";
|
|
62
|
+
blocked: "blocked";
|
|
63
|
+
acknowledged: "acknowledged";
|
|
64
|
+
answered: "answered";
|
|
65
|
+
needs_review: "needs_review";
|
|
66
|
+
closed: "closed";
|
|
67
|
+
}>>;
|
|
68
|
+
};
|
|
69
|
+
type ReplyLetterArgs = {
|
|
70
|
+
letter_id: string;
|
|
71
|
+
body: string;
|
|
72
|
+
message_type?: string;
|
|
73
|
+
user_id: string;
|
|
74
|
+
agent_id?: string;
|
|
75
|
+
new_status?: string;
|
|
76
|
+
};
|
|
77
|
+
export declare function replyLetter(args: ReplyLetterArgs): Promise<{
|
|
78
|
+
content: {
|
|
79
|
+
type: "text";
|
|
80
|
+
text: string;
|
|
81
|
+
}[];
|
|
82
|
+
isError: boolean;
|
|
83
|
+
} | {
|
|
84
|
+
content: {
|
|
85
|
+
type: "text";
|
|
86
|
+
text: string;
|
|
87
|
+
}[];
|
|
88
|
+
isError?: undefined;
|
|
89
|
+
}>;
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=letters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"letters.d.ts","sourceRoot":"","sources":["../../src/tools/letters.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;CAoB9B,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,gBAAgB;;;;;;;;;;;;GA+BxD;AAMD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;CAmB7B,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe;;;;;;;;;;;;GA2BtD"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vl_create + vl_reply -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Vault letter management for agent coordination.
|
|
5
|
+
* Delegates to POST /api/mcp/letters (actions: vl_create, vl_reply).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { nexusPost } from '../nexus-api.js';
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// create_letter
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
export const createLetterSchema = {
|
|
13
|
+
project_id: z.string().uuid().describe('Project UUID'),
|
|
14
|
+
from_actor: z.string().max(200).describe('Sender identifier (agent name or user)'),
|
|
15
|
+
to_actor: z.string().max(200).describe('Recipient identifier (agent name or user)'),
|
|
16
|
+
subject: z.string().max(500).describe('Letter subject'),
|
|
17
|
+
body: z.string().max(100_000).describe('Initial message body'),
|
|
18
|
+
priority: z
|
|
19
|
+
.enum(['low', 'normal', 'high', 'urgent'])
|
|
20
|
+
.default('normal')
|
|
21
|
+
.describe('Letter priority'),
|
|
22
|
+
blocking: z
|
|
23
|
+
.boolean()
|
|
24
|
+
.default(false)
|
|
25
|
+
.describe('Whether this letter blocks the sender'),
|
|
26
|
+
thread_id: z
|
|
27
|
+
.string()
|
|
28
|
+
.uuid()
|
|
29
|
+
.optional()
|
|
30
|
+
.describe('Optional thread UUID to group related letters'),
|
|
31
|
+
agent_id: z.string().max(200).optional().describe('Agent identifier if applicable'),
|
|
32
|
+
};
|
|
33
|
+
export async function createLetter(args) {
|
|
34
|
+
const result = await nexusPost('/api/mcp/letters', {
|
|
35
|
+
action: 'vl_create',
|
|
36
|
+
project_id: args.project_id,
|
|
37
|
+
from_actor: args.from_actor,
|
|
38
|
+
to_actor: args.to_actor,
|
|
39
|
+
subject: args.subject,
|
|
40
|
+
body: args.body,
|
|
41
|
+
priority: args.priority ?? 'normal',
|
|
42
|
+
blocking: args.blocking ?? false,
|
|
43
|
+
thread_id: args.thread_id,
|
|
44
|
+
agent_id: args.agent_id,
|
|
45
|
+
});
|
|
46
|
+
if (!result.ok) {
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: 'text',
|
|
51
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
isError: true,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
content: [
|
|
59
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// reply_letter
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
export const replyLetterSchema = {
|
|
67
|
+
letter_id: z.string().uuid().describe('Letter UUID to reply to'),
|
|
68
|
+
body: z.string().max(100_000).describe('Reply message body'),
|
|
69
|
+
message_type: z
|
|
70
|
+
.enum(['response', 'clarification', 'review_note', 'follow_up', 'context'])
|
|
71
|
+
.default('response')
|
|
72
|
+
.describe('Type of reply message'),
|
|
73
|
+
agent_id: z.string().max(200).optional().describe('Agent identifier if applicable'),
|
|
74
|
+
new_status: z
|
|
75
|
+
.enum([
|
|
76
|
+
'acknowledged',
|
|
77
|
+
'in_progress',
|
|
78
|
+
'answered',
|
|
79
|
+
'blocked',
|
|
80
|
+
'needs_review',
|
|
81
|
+
'closed',
|
|
82
|
+
])
|
|
83
|
+
.optional()
|
|
84
|
+
.describe('Optionally update the letter status'),
|
|
85
|
+
};
|
|
86
|
+
export async function replyLetter(args) {
|
|
87
|
+
const result = await nexusPost('/api/mcp/letters', {
|
|
88
|
+
action: 'vl_reply',
|
|
89
|
+
letter_id: args.letter_id,
|
|
90
|
+
body: args.body,
|
|
91
|
+
message_type: args.message_type ?? 'response',
|
|
92
|
+
agent_id: args.agent_id,
|
|
93
|
+
new_status: args.new_status,
|
|
94
|
+
});
|
|
95
|
+
if (!result.ok) {
|
|
96
|
+
return {
|
|
97
|
+
content: [
|
|
98
|
+
{
|
|
99
|
+
type: 'text',
|
|
100
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
isError: true,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
content: [
|
|
108
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=letters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"letters.js","sourceRoot":"","sources":["../../src/tools/letters.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAE9E,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;IACtD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,wCAAwC,CAAC;IAClF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IACnF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACvD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IAC9D,QAAQ,EAAE,CAAC;SACR,IAAI,CAAC,CAAC,KAAK,EA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,EAAE,IAAI,CAAC,QAAQ;QACvB,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,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,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* doc_list -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* List ingested documents for a project with optional source filtering.
|
|
5
|
+
* Delegates to POST /api/mcp/documents (action: doc_list).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export declare const listDocumentsSchema: {
|
|
9
|
+
project_id: z.ZodString;
|
|
10
|
+
source: z.ZodOptional<z.ZodString>;
|
|
11
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
};
|
|
13
|
+
type ListDocumentsArgs = {
|
|
14
|
+
project_id: string;
|
|
15
|
+
source?: string;
|
|
16
|
+
limit?: number;
|
|
17
|
+
user_id: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function listDocuments(args: ListDocumentsArgs): Promise<{
|
|
20
|
+
content: {
|
|
21
|
+
type: "text";
|
|
22
|
+
text: string;
|
|
23
|
+
}[];
|
|
24
|
+
isError: boolean;
|
|
25
|
+
} | {
|
|
26
|
+
content: {
|
|
27
|
+
type: "text";
|
|
28
|
+
text: string;
|
|
29
|
+
}[];
|
|
30
|
+
isError?: undefined;
|
|
31
|
+
}>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=list-documents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-documents.d.ts","sourceRoot":"","sources":["../../src/tools/list-documents.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,mBAAmB;;;;CAa/B,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;GAyB1D"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* doc_list -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* List ingested documents for a project with optional source filtering.
|
|
5
|
+
* Delegates to POST /api/mcp/documents (action: doc_list).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { nexusPost } from '../nexus-api.js';
|
|
9
|
+
export const listDocumentsSchema = {
|
|
10
|
+
project_id: z.string().uuid().describe('Project UUID'),
|
|
11
|
+
source: z
|
|
12
|
+
.string()
|
|
13
|
+
.max(200)
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Filter by source (e.g., "mcp-agent", "research", "session-extract")'),
|
|
16
|
+
limit: z
|
|
17
|
+
.number()
|
|
18
|
+
.min(1)
|
|
19
|
+
.max(100)
|
|
20
|
+
.default(50)
|
|
21
|
+
.describe('Maximum number of documents to return (default 50)'),
|
|
22
|
+
};
|
|
23
|
+
export async function listDocuments(args) {
|
|
24
|
+
const result = await nexusPost('/api/mcp/documents', {
|
|
25
|
+
action: 'doc_list',
|
|
26
|
+
project_id: args.project_id,
|
|
27
|
+
source: args.source,
|
|
28
|
+
limit: args.limit ?? 50,
|
|
29
|
+
});
|
|
30
|
+
if (!result.ok) {
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: 'text',
|
|
35
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
isError: true,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=list-documents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-documents.js","sourceRoot":"","sources":["../../src/tools/list-documents.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,mBAAmB,GAAG;IACjC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;IACtD,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,qEAAqE,CAAC;IAClF,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,oDAAoD,CAAC;CAClE,CAAA;AASD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAuB;IACzD,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,oBAAoB,EAAE;QACnD,MAAM,EAAE,UAAU;QAClB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE;KACxB,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,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* task_list -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* List tasks for a project with optional status filtering.
|
|
5
|
+
* Delegates to POST /api/mcp/tasks (action: task_list).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export declare const listTasksSchema: {
|
|
9
|
+
project_id: z.ZodString;
|
|
10
|
+
status_filter: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
11
|
+
open: "open";
|
|
12
|
+
in_progress: "in_progress";
|
|
13
|
+
blocked: "blocked";
|
|
14
|
+
done: "done";
|
|
15
|
+
cancelled: "cancelled";
|
|
16
|
+
}>>>;
|
|
17
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
18
|
+
};
|
|
19
|
+
type ListTasksArgs = {
|
|
20
|
+
project_id: string;
|
|
21
|
+
status_filter?: string[];
|
|
22
|
+
limit?: number;
|
|
23
|
+
user_id: string;
|
|
24
|
+
};
|
|
25
|
+
export declare function listTasks(args: ListTasksArgs): Promise<{
|
|
26
|
+
content: {
|
|
27
|
+
type: "text";
|
|
28
|
+
text: string;
|
|
29
|
+
}[];
|
|
30
|
+
isError: boolean;
|
|
31
|
+
} | {
|
|
32
|
+
content: {
|
|
33
|
+
type: "text";
|
|
34
|
+
text: string;
|
|
35
|
+
}[];
|
|
36
|
+
isError?: undefined;
|
|
37
|
+
}>;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=list-tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-tasks.d.ts","sourceRoot":"","sources":["../../src/tools/list-tasks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,eAAe;;;;;;;;;;CAY3B,CAAA;AAED,KAAK,aAAa,GAAG;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,aAAa;;;;;;;;;;;;GAyBlD"}
|