@mpowr/nexus-mcp 0.5.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/README.md +59 -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 +29 -0
- package/dist/nexus-api.d.ts.map +1 -0
- package/dist/nexus-api.js +76 -0
- package/dist/nexus-api.js.map +1 -0
- package/dist/server.d.ts +65 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +183 -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 +67 -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 +80 -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 +124 -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 +48 -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/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 +216 -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 +120 -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 +192 -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__/helpers.ts +58 -0
- package/src/__tests__/layer1-knowledge.test.ts +302 -0
- package/src/__tests__/layer2-coordination.test.ts +775 -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 +238 -0
- package/src/__tests__/setup.ts +15 -0
- package/src/auth.ts +81 -0
- package/src/nexus-api.ts +110 -0
- package/src/server.ts +499 -0
- package/src/tools/add-task-note.ts +50 -0
- package/src/tools/append-session-entry.ts +83 -0
- package/src/tools/create-task.ts +66 -0
- package/src/tools/decision-comments.ts +102 -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 +162 -0
- package/src/tools/ingest-document.ts +64 -0
- package/src/tools/letter-inbox.ts +157 -0
- package/src/tools/letters.ts +144 -0
- package/src/tools/project-list.ts +52 -0
- package/src/tools/reviews.ts +277 -0
- package/src/tools/search-knowledge.ts +68 -0
- package/src/tools/sessions.ts +154 -0
- package/src/tools/skill-assign.ts +142 -0
- package/src/tools/skills.ts +252 -0
- package/src/tools/update-task-status.ts +64 -0
- package/tsconfig.json +20 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-related-entities.d.ts","sourceRoot":"","sources":["../../src/tools/get-related-entities.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;CA0BpC,CAAA;AAED,KAAK,sBAAsB,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,sBAAsB;;;;;;;;;;;;GAyBpE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kb_related -- Layer 1 Knowledge Access
|
|
3
|
+
*
|
|
4
|
+
* Returns graph-neighbor entities related to a given entity.
|
|
5
|
+
* Delegates to POST /api/mcp/related.
|
|
6
|
+
*
|
|
7
|
+
* ADR-0001 spec: kb_related(entity_type, entity_id, relation_types[], limit)
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { nexusPost } from '../nexus-api.js';
|
|
11
|
+
export const getRelatedEntitiesSchema = {
|
|
12
|
+
entity_type: z
|
|
13
|
+
.enum([
|
|
14
|
+
'session',
|
|
15
|
+
'decision',
|
|
16
|
+
'letter',
|
|
17
|
+
'task',
|
|
18
|
+
'research_note',
|
|
19
|
+
'planning_item',
|
|
20
|
+
'ingest_item',
|
|
21
|
+
])
|
|
22
|
+
.describe('Type of the source entity'),
|
|
23
|
+
entity_id: z.string().uuid().describe('UUID of the source entity'),
|
|
24
|
+
relation_types: z
|
|
25
|
+
.array(z.string())
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Filter by specific relation types (e.g., "references", "created_in", "supersedes")'),
|
|
28
|
+
limit: z
|
|
29
|
+
.number()
|
|
30
|
+
.int()
|
|
31
|
+
.min(1)
|
|
32
|
+
.max(50)
|
|
33
|
+
.default(20)
|
|
34
|
+
.describe('Maximum related entities to return'),
|
|
35
|
+
};
|
|
36
|
+
export async function getRelatedEntities(args) {
|
|
37
|
+
const result = await nexusPost('/api/mcp/related', {
|
|
38
|
+
entity_type: args.entity_type,
|
|
39
|
+
entity_id: args.entity_id,
|
|
40
|
+
relation_types: args.relation_types,
|
|
41
|
+
limit: args.limit ?? 20,
|
|
42
|
+
});
|
|
43
|
+
if (!result.ok) {
|
|
44
|
+
return {
|
|
45
|
+
content: [
|
|
46
|
+
{
|
|
47
|
+
type: 'text',
|
|
48
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
isError: true,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
content: [
|
|
56
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=get-related-entities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-related-entities.js","sourceRoot":"","sources":["../../src/tools/get-related-entities.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,WAAW,EAAE,CAAC;SACX,IAAI,CAAC;QACJ,SAAS;QACT,UAAU;QACV,QAAQ;QACR,MAAM;QACN,eAAe;QACf,eAAe;QACf,aAAa;KACd,CAAC;SACD,QAAQ,CAAC,2BAA2B,CAAC;IACxC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAClE,cAAc,EAAE,CAAC;SACd,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,oFAAoF,CACrF;IACH,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,oCAAoC,CAAC;CAClD,CAAA;AASD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAA4B;IACnE,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,kBAAkB,EAAE;QACjD,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,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,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR Governance tools -- Layer 3
|
|
3
|
+
*
|
|
4
|
+
* Manages the ADR lifecycle:
|
|
5
|
+
* draft -> under_review -> accepted | rejected -> superseded -> archived
|
|
6
|
+
*
|
|
7
|
+
* Delegates to POST /api/mcp/governance.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
export declare const createAdrDraftSchema: {
|
|
11
|
+
project_id: z.ZodString;
|
|
12
|
+
title: z.ZodString;
|
|
13
|
+
context: z.ZodString;
|
|
14
|
+
decision: z.ZodString;
|
|
15
|
+
consequences: z.ZodOptional<z.ZodString>;
|
|
16
|
+
supersedes: z.ZodOptional<z.ZodString>;
|
|
17
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
18
|
+
};
|
|
19
|
+
type CreateAdrDraftArgs = {
|
|
20
|
+
project_id: string;
|
|
21
|
+
title: string;
|
|
22
|
+
context: string;
|
|
23
|
+
decision: string;
|
|
24
|
+
consequences?: string;
|
|
25
|
+
supersedes?: string;
|
|
26
|
+
user_id: string;
|
|
27
|
+
agent_id?: string;
|
|
28
|
+
};
|
|
29
|
+
export declare function createAdrDraft(args: CreateAdrDraftArgs): Promise<{
|
|
30
|
+
content: {
|
|
31
|
+
type: "text";
|
|
32
|
+
text: string;
|
|
33
|
+
}[];
|
|
34
|
+
isError: boolean;
|
|
35
|
+
} | {
|
|
36
|
+
content: {
|
|
37
|
+
type: "text";
|
|
38
|
+
text: string;
|
|
39
|
+
}[];
|
|
40
|
+
isError?: undefined;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const submitAdrReviewSchema: {
|
|
43
|
+
adr_id: z.ZodString;
|
|
44
|
+
};
|
|
45
|
+
type SubmitAdrReviewArgs = {
|
|
46
|
+
adr_id: string;
|
|
47
|
+
user_id: string;
|
|
48
|
+
};
|
|
49
|
+
export declare function submitAdrReview(args: SubmitAdrReviewArgs): Promise<{
|
|
50
|
+
content: {
|
|
51
|
+
type: "text";
|
|
52
|
+
text: string;
|
|
53
|
+
}[];
|
|
54
|
+
isError: boolean;
|
|
55
|
+
} | {
|
|
56
|
+
content: {
|
|
57
|
+
type: "text";
|
|
58
|
+
text: string;
|
|
59
|
+
}[];
|
|
60
|
+
isError?: undefined;
|
|
61
|
+
}>;
|
|
62
|
+
export declare const recordAdrDecisionSchema: {
|
|
63
|
+
adr_id: z.ZodString;
|
|
64
|
+
decision: z.ZodEnum<{
|
|
65
|
+
accepted: "accepted";
|
|
66
|
+
rejected: "rejected";
|
|
67
|
+
}>;
|
|
68
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
69
|
+
};
|
|
70
|
+
type RecordAdrDecisionArgs = {
|
|
71
|
+
adr_id: string;
|
|
72
|
+
decision: string;
|
|
73
|
+
rationale?: string;
|
|
74
|
+
user_id: string;
|
|
75
|
+
};
|
|
76
|
+
export declare function recordAdrDecision(args: RecordAdrDecisionArgs): Promise<{
|
|
77
|
+
content: {
|
|
78
|
+
type: "text";
|
|
79
|
+
text: string;
|
|
80
|
+
}[];
|
|
81
|
+
isError: boolean;
|
|
82
|
+
} | {
|
|
83
|
+
content: {
|
|
84
|
+
type: "text";
|
|
85
|
+
text: string;
|
|
86
|
+
}[];
|
|
87
|
+
isError?: undefined;
|
|
88
|
+
}>;
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=governance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance.d.ts","sourceRoot":"","sources":["../../src/tools/governance.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,eAAO,MAAM,oBAAoB;;;;;;;;CAiBhC,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,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;AAMD,eAAO,MAAM,qBAAqB;;CAEjC,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,mBAAmB;;;;;;;;;;;;GAuB9D;AAMD,eAAO,MAAM,uBAAuB;;;;;;;CASnC,CAAA;AAED,KAAK,qBAAqB,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,qBAAqB;;;;;;;;;;;;GAyBlE"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR Governance tools -- Layer 3
|
|
3
|
+
*
|
|
4
|
+
* Manages the ADR lifecycle:
|
|
5
|
+
* draft -> under_review -> accepted | rejected -> superseded -> archived
|
|
6
|
+
*
|
|
7
|
+
* Delegates to POST /api/mcp/governance.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { nexusPost } from '../nexus-api.js';
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// create_adr_draft -> adr_create
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
export const createAdrDraftSchema = {
|
|
15
|
+
project_id: z.string().uuid().describe('Project UUID'),
|
|
16
|
+
title: z.string().describe('ADR title'),
|
|
17
|
+
context: z
|
|
18
|
+
.string()
|
|
19
|
+
.describe('Context / motivation for the decision (markdown)'),
|
|
20
|
+
decision: z.string().describe('The decision content (markdown)'),
|
|
21
|
+
consequences: z
|
|
22
|
+
.string()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('Expected consequences of the decision (markdown)'),
|
|
25
|
+
supersedes: z
|
|
26
|
+
.string()
|
|
27
|
+
.uuid()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('UUID of the ADR this one supersedes'),
|
|
30
|
+
agent_id: z.string().optional().describe('Agent identifier if applicable'),
|
|
31
|
+
};
|
|
32
|
+
export async function createAdrDraft(args) {
|
|
33
|
+
const result = await nexusPost('/api/mcp/governance', {
|
|
34
|
+
action: 'adr_create',
|
|
35
|
+
project_id: args.project_id,
|
|
36
|
+
title: args.title,
|
|
37
|
+
context: args.context,
|
|
38
|
+
decision: args.decision,
|
|
39
|
+
consequences: args.consequences,
|
|
40
|
+
supersedes: args.supersedes,
|
|
41
|
+
});
|
|
42
|
+
if (!result.ok) {
|
|
43
|
+
return {
|
|
44
|
+
content: [
|
|
45
|
+
{
|
|
46
|
+
type: 'text',
|
|
47
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
isError: true,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
content: [
|
|
55
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
// submit_adr_review -> adr_submit
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
export const submitAdrReviewSchema = {
|
|
63
|
+
adr_id: z.string().uuid().describe('ADR UUID to submit for review'),
|
|
64
|
+
};
|
|
65
|
+
export async function submitAdrReview(args) {
|
|
66
|
+
const result = await nexusPost('/api/mcp/governance', {
|
|
67
|
+
action: 'adr_submit',
|
|
68
|
+
adr_id: args.adr_id,
|
|
69
|
+
});
|
|
70
|
+
if (!result.ok) {
|
|
71
|
+
return {
|
|
72
|
+
content: [
|
|
73
|
+
{
|
|
74
|
+
type: 'text',
|
|
75
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
isError: true,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
content: [
|
|
83
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
// record_adr_decision -> adr_decide
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
export const recordAdrDecisionSchema = {
|
|
91
|
+
adr_id: z.string().uuid().describe('ADR UUID'),
|
|
92
|
+
decision: z
|
|
93
|
+
.enum(['accepted', 'rejected'])
|
|
94
|
+
.describe('Decision outcome: accept or reject'),
|
|
95
|
+
rationale: z
|
|
96
|
+
.string()
|
|
97
|
+
.optional()
|
|
98
|
+
.describe('Optional rationale for the decision'),
|
|
99
|
+
};
|
|
100
|
+
export async function recordAdrDecision(args) {
|
|
101
|
+
const result = await nexusPost('/api/mcp/governance', {
|
|
102
|
+
action: 'adr_decide',
|
|
103
|
+
adr_id: args.adr_id,
|
|
104
|
+
decision: args.decision,
|
|
105
|
+
rationale: args.rationale,
|
|
106
|
+
});
|
|
107
|
+
if (!result.ok) {
|
|
108
|
+
return {
|
|
109
|
+
content: [
|
|
110
|
+
{
|
|
111
|
+
type: 'text',
|
|
112
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
isError: true,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
content: [
|
|
120
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
121
|
+
],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=governance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance.js","sourceRoot":"","sources":["../../src/tools/governance.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,8EAA8E;AAC9E,iCAAiC;AACjC,8EAA8E;AAE9E,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,QAAQ,CAAC,WAAW,CAAC;IACvC,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,CAAC,kDAAkD,CAAC;IAC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UAAU,iBAAiB,CAAC,IAA2B;IACjE,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,qBAAqB,EAAE;QACpD,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,SAAS,EAAE,IAAI,CAAC,SAAS;KAC1B,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,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;;;;;;;CAYhC,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,48 @@
|
|
|
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().describe('Document title'),
|
|
13
|
+
body: z.string().describe('Document content (text or markdown)'),
|
|
14
|
+
source: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Source identifier (e.g. "mcp-agent", "research", "session-extract")'),
|
|
18
|
+
source_url: z.string().url().optional().describe('Source URL if applicable'),
|
|
19
|
+
agent_id: z.string().optional().describe('Agent identifier if applicable'),
|
|
20
|
+
};
|
|
21
|
+
export async function ingestDocument(args) {
|
|
22
|
+
const result = await nexusPost('/api/mcp/documents', {
|
|
23
|
+
action: 'doc_ingest',
|
|
24
|
+
project_id: args.project_id,
|
|
25
|
+
title: args.title,
|
|
26
|
+
body: args.body,
|
|
27
|
+
source: args.source,
|
|
28
|
+
source_url: args.source_url,
|
|
29
|
+
agent_id: args.agent_id,
|
|
30
|
+
});
|
|
31
|
+
if (!result.ok) {
|
|
32
|
+
return {
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
type: 'text',
|
|
36
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
isError: true,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
content: [
|
|
44
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# 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,EAA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,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())
|
|
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())
|
|
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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