@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,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* session_append -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Appends an entry to an existing session.
|
|
5
|
+
* Enforces append-only semantics and session write isolation.
|
|
6
|
+
* Delegates to POST /api/mcp/sessions (action: session_append).
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
export declare const appendSessionEntrySchema: {
|
|
10
|
+
session_id: z.ZodString;
|
|
11
|
+
entry_type: z.ZodEnum<{
|
|
12
|
+
decision_referenced: "decision_referenced";
|
|
13
|
+
task_created: "task_created";
|
|
14
|
+
task_updated: "task_updated";
|
|
15
|
+
letter_sent: "letter_sent";
|
|
16
|
+
letter_replied: "letter_replied";
|
|
17
|
+
research_added: "research_added";
|
|
18
|
+
conflict_detected: "conflict_detected";
|
|
19
|
+
adr_drafted: "adr_drafted";
|
|
20
|
+
adr_accepted: "adr_accepted";
|
|
21
|
+
handoff_recorded: "handoff_recorded";
|
|
22
|
+
note: "note";
|
|
23
|
+
correction: "correction";
|
|
24
|
+
}>;
|
|
25
|
+
summary: z.ZodString;
|
|
26
|
+
linked_entity_type: z.ZodOptional<z.ZodString>;
|
|
27
|
+
linked_entity_id: z.ZodOptional<z.ZodString>;
|
|
28
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
29
|
+
};
|
|
30
|
+
type AppendSessionEntryArgs = {
|
|
31
|
+
session_id: string;
|
|
32
|
+
entry_type: string;
|
|
33
|
+
summary: string;
|
|
34
|
+
linked_entity_type?: string;
|
|
35
|
+
linked_entity_id?: string;
|
|
36
|
+
user_id: string;
|
|
37
|
+
agent_id?: string;
|
|
38
|
+
};
|
|
39
|
+
export declare function appendSessionEntry(args: AppendSessionEntryArgs): Promise<{
|
|
40
|
+
content: {
|
|
41
|
+
type: "text";
|
|
42
|
+
text: string;
|
|
43
|
+
}[];
|
|
44
|
+
isError: boolean;
|
|
45
|
+
} | {
|
|
46
|
+
content: {
|
|
47
|
+
type: "text";
|
|
48
|
+
text: string;
|
|
49
|
+
}[];
|
|
50
|
+
isError?: undefined;
|
|
51
|
+
}>;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=append-session-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"append-session-entry.d.ts","sourceRoot":"","sources":["../../src/tools/append-session-entry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;CA+BpC,CAAA;AAED,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,sBAAsB;;;;;;;;;;;;GA4BpE"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* session_append -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Appends an entry to an existing session.
|
|
5
|
+
* Enforces append-only semantics and session write isolation.
|
|
6
|
+
* Delegates to POST /api/mcp/sessions (action: session_append).
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { nexusPost } from '../nexus-api.js';
|
|
10
|
+
export const appendSessionEntrySchema = {
|
|
11
|
+
session_id: z.string().uuid().describe('Session UUID to append to'),
|
|
12
|
+
entry_type: z
|
|
13
|
+
.enum([
|
|
14
|
+
'decision_referenced',
|
|
15
|
+
'task_created',
|
|
16
|
+
'task_updated',
|
|
17
|
+
'letter_sent',
|
|
18
|
+
'letter_replied',
|
|
19
|
+
'research_added',
|
|
20
|
+
'conflict_detected',
|
|
21
|
+
'adr_drafted',
|
|
22
|
+
'adr_accepted',
|
|
23
|
+
'handoff_recorded',
|
|
24
|
+
'note',
|
|
25
|
+
'correction',
|
|
26
|
+
])
|
|
27
|
+
.describe('Type of session entry'),
|
|
28
|
+
summary: z.string().describe('Entry content / summary text'),
|
|
29
|
+
linked_entity_type: z
|
|
30
|
+
.string()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('Type of linked entity (e.g., "task", "decision", "letter", "research_link")'),
|
|
33
|
+
linked_entity_id: z
|
|
34
|
+
.string()
|
|
35
|
+
.uuid()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('UUID of the linked entity'),
|
|
38
|
+
agent_id: z.string().optional().describe('Agent identifier if applicable'),
|
|
39
|
+
};
|
|
40
|
+
export async function appendSessionEntry(args) {
|
|
41
|
+
const result = await nexusPost('/api/mcp/sessions', {
|
|
42
|
+
action: 'session_append',
|
|
43
|
+
session_id: args.session_id,
|
|
44
|
+
entry_type: args.entry_type,
|
|
45
|
+
summary: args.summary,
|
|
46
|
+
agent_id: args.agent_id,
|
|
47
|
+
linked_entity_type: args.linked_entity_type,
|
|
48
|
+
linked_entity_id: args.linked_entity_id,
|
|
49
|
+
});
|
|
50
|
+
if (!result.ok) {
|
|
51
|
+
return {
|
|
52
|
+
content: [
|
|
53
|
+
{
|
|
54
|
+
type: 'text',
|
|
55
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
isError: true,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
content: [
|
|
63
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=append-session-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"append-session-entry.js","sourceRoot":"","sources":["../../src/tools/append-session-entry.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,wBAAwB,GAAG;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IACnE,UAAU,EAAE,CAAC;SACV,IAAI,CAAC;QACJ,qBAAqB;QACrB,cAAc;QACd,cAAc;QACd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E;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,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* task_create -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Creates a new task within a project scope.
|
|
5
|
+
* Delegates to POST /api/mcp/tasks (action: task_create).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export declare const createTaskSchema: {
|
|
9
|
+
project_id: z.ZodString;
|
|
10
|
+
title: z.ZodString;
|
|
11
|
+
description: z.ZodOptional<z.ZodString>;
|
|
12
|
+
priority: z.ZodDefault<z.ZodEnum<{
|
|
13
|
+
low: "low";
|
|
14
|
+
normal: "normal";
|
|
15
|
+
high: "high";
|
|
16
|
+
urgent: "urgent";
|
|
17
|
+
}>>;
|
|
18
|
+
assignee: z.ZodOptional<z.ZodString>;
|
|
19
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
20
|
+
open: "open";
|
|
21
|
+
in_progress: "in_progress";
|
|
22
|
+
blocked: "blocked";
|
|
23
|
+
done: "done";
|
|
24
|
+
cancelled: "cancelled";
|
|
25
|
+
}>>;
|
|
26
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
27
|
+
};
|
|
28
|
+
type CreateTaskArgs = {
|
|
29
|
+
project_id: string;
|
|
30
|
+
title: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
priority?: string;
|
|
33
|
+
assignee?: string;
|
|
34
|
+
status?: string;
|
|
35
|
+
user_id: string;
|
|
36
|
+
agent_id?: string;
|
|
37
|
+
};
|
|
38
|
+
export declare function createTask(args: CreateTaskArgs): Promise<{
|
|
39
|
+
content: {
|
|
40
|
+
type: "text";
|
|
41
|
+
text: string;
|
|
42
|
+
}[];
|
|
43
|
+
isError: boolean;
|
|
44
|
+
} | {
|
|
45
|
+
content: {
|
|
46
|
+
type: "text";
|
|
47
|
+
text: string;
|
|
48
|
+
}[];
|
|
49
|
+
isError?: undefined;
|
|
50
|
+
}>;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=create-task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-task.d.ts","sourceRoot":"","sources":["../../src/tools/create-task.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;CAc5B,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,cAAc;;;;;;;;;;;;GA4BpD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* task_create -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Creates a new task within a project scope.
|
|
5
|
+
* Delegates to POST /api/mcp/tasks (action: task_create).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { nexusPost } from '../nexus-api.js';
|
|
9
|
+
export const createTaskSchema = {
|
|
10
|
+
project_id: z.string().uuid().describe('Project UUID'),
|
|
11
|
+
title: z.string().describe('Task title'),
|
|
12
|
+
description: z.string().optional().describe('Task description'),
|
|
13
|
+
priority: z
|
|
14
|
+
.enum(['low', 'normal', 'high', 'urgent'])
|
|
15
|
+
.default('normal')
|
|
16
|
+
.describe('Task priority'),
|
|
17
|
+
assignee: z.string().uuid().optional().describe('UUID of the assigned user'),
|
|
18
|
+
status: z
|
|
19
|
+
.enum(['open', 'in_progress', 'blocked', 'done', 'cancelled'])
|
|
20
|
+
.default('open')
|
|
21
|
+
.describe('Initial task status'),
|
|
22
|
+
agent_id: z.string().optional().describe('Agent identifier if applicable'),
|
|
23
|
+
};
|
|
24
|
+
export async function createTask(args) {
|
|
25
|
+
const result = await nexusPost('/api/mcp/tasks', {
|
|
26
|
+
action: 'task_create',
|
|
27
|
+
project_id: args.project_id,
|
|
28
|
+
title: args.title,
|
|
29
|
+
description: args.description,
|
|
30
|
+
priority: args.priority ?? 'normal',
|
|
31
|
+
assignee: args.assignee,
|
|
32
|
+
status: args.status ?? 'open',
|
|
33
|
+
});
|
|
34
|
+
if (!result.ok) {
|
|
35
|
+
return {
|
|
36
|
+
content: [
|
|
37
|
+
{
|
|
38
|
+
type: 'text',
|
|
39
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
isError: true,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
content: [
|
|
47
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=create-task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-task.js","sourceRoot":"","sources":["../../src/tools/create-task.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,gBAAgB,GAAG;IAC9B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;IACtD,KAAK,EAAE,C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,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,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decision comment tools -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Provides append-only comment threads for ADR decisions.
|
|
5
|
+
* Delegates to POST /api/mcp/governance (actions: dc_add, dc_list).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export declare const addDecisionCommentSchema: {
|
|
9
|
+
decision_id: z.ZodString;
|
|
10
|
+
body: z.ZodString;
|
|
11
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
12
|
+
};
|
|
13
|
+
type AddDecisionCommentArgs = {
|
|
14
|
+
decision_id: string;
|
|
15
|
+
body: string;
|
|
16
|
+
agent_id?: string;
|
|
17
|
+
user_id: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function addDecisionComment(args: AddDecisionCommentArgs): 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 declare const listDecisionCommentsSchema: {
|
|
33
|
+
decision_id: z.ZodString;
|
|
34
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
35
|
+
};
|
|
36
|
+
type ListDecisionCommentsArgs = {
|
|
37
|
+
decision_id: string;
|
|
38
|
+
limit?: number;
|
|
39
|
+
};
|
|
40
|
+
export declare function listDecisionComments(args: ListDecisionCommentsArgs): Promise<{
|
|
41
|
+
content: {
|
|
42
|
+
type: "text";
|
|
43
|
+
text: string;
|
|
44
|
+
}[];
|
|
45
|
+
isError: boolean;
|
|
46
|
+
} | {
|
|
47
|
+
content: {
|
|
48
|
+
type: "text";
|
|
49
|
+
text: string;
|
|
50
|
+
}[];
|
|
51
|
+
isError?: undefined;
|
|
52
|
+
}>;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=decision-comments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-comments.d.ts","sourceRoot":"","sources":["../../src/tools/decision-comments.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,eAAO,MAAM,wBAAwB;;;;CAOpC,CAAA;AAED,KAAK,sBAAsB,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,sBAAsB;;;;;;;;;;;;GAyBpE;AAMD,eAAO,MAAM,0BAA0B;;;CAStC,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,wBAAwB;;;;;;;;;;;;GAwBxE"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decision comment tools -- Layer 2 Coordination
|
|
3
|
+
*
|
|
4
|
+
* Provides append-only comment threads for ADR decisions.
|
|
5
|
+
* Delegates to POST /api/mcp/governance (actions: dc_add, dc_list).
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { nexusPost } from '../nexus-api.js';
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// add_decision_comment -> dc_add
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
export const addDecisionCommentSchema = {
|
|
13
|
+
decision_id: z.string().uuid().describe('Decision UUID to comment on'),
|
|
14
|
+
body: z.string().describe('Comment body (markdown supported)'),
|
|
15
|
+
agent_id: z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Agent identifier if comment is posted by an agent'),
|
|
19
|
+
};
|
|
20
|
+
export async function addDecisionComment(args) {
|
|
21
|
+
const result = await nexusPost('/api/mcp/governance', {
|
|
22
|
+
action: 'dc_add',
|
|
23
|
+
decision_id: args.decision_id,
|
|
24
|
+
body: args.body,
|
|
25
|
+
agent_id: args.agent_id,
|
|
26
|
+
});
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: 'text',
|
|
32
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
isError: true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
content: [
|
|
40
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
// list_decision_comments -> dc_list
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
export const listDecisionCommentsSchema = {
|
|
48
|
+
decision_id: z.string().uuid().describe('Decision UUID'),
|
|
49
|
+
limit: z
|
|
50
|
+
.number()
|
|
51
|
+
.int()
|
|
52
|
+
.min(1)
|
|
53
|
+
.max(100)
|
|
54
|
+
.default(50)
|
|
55
|
+
.describe('Maximum comments to return'),
|
|
56
|
+
};
|
|
57
|
+
export async function listDecisionComments(args) {
|
|
58
|
+
const result = await nexusPost('/api/mcp/governance', {
|
|
59
|
+
action: 'dc_list',
|
|
60
|
+
decision_id: args.decision_id,
|
|
61
|
+
limit: args.limit ?? 50,
|
|
62
|
+
});
|
|
63
|
+
if (!result.ok) {
|
|
64
|
+
return {
|
|
65
|
+
content: [
|
|
66
|
+
{
|
|
67
|
+
type: 'text',
|
|
68
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
isError: true,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
content: [
|
|
76
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
77
|
+
],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=decision-comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-comments.js","sourceRoot":"","sources":["../../src/tools/decision-comments.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;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,wBAAwB,GAAG;IACtC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IACtE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAC9D,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,mDAAmD,CAAC;CACjE,CAAA;AASD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAA4B;IACnE,MAAM,MAAM,GAAG,MAA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AC,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,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kb_get -- Layer 1 Knowledge Access
|
|
3
|
+
*
|
|
4
|
+
* Fetches a single knowledge object in canonical form.
|
|
5
|
+
* Returns metadata, current version, body, and linked references.
|
|
6
|
+
* Delegates to POST /api/mcp/documents (action: kb_get).
|
|
7
|
+
*
|
|
8
|
+
* ADR-0001 spec: kb_get(entity_type, entity_id, render_mode)
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
export declare const getDocumentSchema: {
|
|
12
|
+
entity_type: z.ZodEnum<{
|
|
13
|
+
session: "session";
|
|
14
|
+
decision: "decision";
|
|
15
|
+
letter: "letter";
|
|
16
|
+
task: "task";
|
|
17
|
+
research_note: "research_note";
|
|
18
|
+
planning_item: "planning_item";
|
|
19
|
+
ingest_item: "ingest_item";
|
|
20
|
+
}>;
|
|
21
|
+
entity_id: z.ZodString;
|
|
22
|
+
render_mode: z.ZodDefault<z.ZodEnum<{
|
|
23
|
+
structured: "structured";
|
|
24
|
+
markdown: "markdown";
|
|
25
|
+
summary: "summary";
|
|
26
|
+
}>>;
|
|
27
|
+
};
|
|
28
|
+
type GetDocumentArgs = {
|
|
29
|
+
entity_type: string;
|
|
30
|
+
entity_id: string;
|
|
31
|
+
render_mode?: string;
|
|
32
|
+
};
|
|
33
|
+
export declare function getDocument(args: GetDocumentArgs): Promise<{
|
|
34
|
+
content: {
|
|
35
|
+
type: "text";
|
|
36
|
+
text: string;
|
|
37
|
+
}[];
|
|
38
|
+
isError: boolean;
|
|
39
|
+
} | {
|
|
40
|
+
content: {
|
|
41
|
+
type: "text";
|
|
42
|
+
text: string;
|
|
43
|
+
}[];
|
|
44
|
+
isError?: undefined;
|
|
45
|
+
}>;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=get-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-document.d.ts","sourceRoot":"","sources":["../../src/tools/get-document.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;CAiB7B,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe;;;;;;;;;;;;GAyCtD"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kb_get -- Layer 1 Knowledge Access
|
|
3
|
+
*
|
|
4
|
+
* Fetches a single knowledge object in canonical form.
|
|
5
|
+
* Returns metadata, current version, body, and linked references.
|
|
6
|
+
* Delegates to POST /api/mcp/documents (action: kb_get).
|
|
7
|
+
*
|
|
8
|
+
* ADR-0001 spec: kb_get(entity_type, entity_id, render_mode)
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
import { nexusPost } from '../nexus-api.js';
|
|
12
|
+
export const getDocumentSchema = {
|
|
13
|
+
entity_type: z
|
|
14
|
+
.enum([
|
|
15
|
+
'session',
|
|
16
|
+
'decision',
|
|
17
|
+
'letter',
|
|
18
|
+
'task',
|
|
19
|
+
'research_note',
|
|
20
|
+
'planning_item',
|
|
21
|
+
'ingest_item',
|
|
22
|
+
])
|
|
23
|
+
.describe('Type of the knowledge object'),
|
|
24
|
+
entity_id: z.string().uuid().describe('UUID of the entity'),
|
|
25
|
+
render_mode: z
|
|
26
|
+
.enum(['structured', 'markdown', 'summary'])
|
|
27
|
+
.default('structured')
|
|
28
|
+
.describe('Output format: structured JSON, markdown, or summary'),
|
|
29
|
+
};
|
|
30
|
+
export async function getDocument(args) {
|
|
31
|
+
const result = await nexusPost('/api/mcp/documents', {
|
|
32
|
+
action: 'kb_get',
|
|
33
|
+
entity_type: args.entity_type,
|
|
34
|
+
entity_id: args.entity_id,
|
|
35
|
+
render_mode: args.render_mode ?? 'structured',
|
|
36
|
+
});
|
|
37
|
+
if (!result.ok) {
|
|
38
|
+
return {
|
|
39
|
+
content: [
|
|
40
|
+
{
|
|
41
|
+
type: 'text',
|
|
42
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
isError: true,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
// For markdown and summary modes, the API returns { content: "..." }
|
|
49
|
+
// For structured mode, the API returns the full object
|
|
50
|
+
const data = result.data;
|
|
51
|
+
const renderMode = args.render_mode ?? 'structured';
|
|
52
|
+
if (renderMode === 'markdown' || renderMode === 'summary') {
|
|
53
|
+
return {
|
|
54
|
+
content: [
|
|
55
|
+
{
|
|
56
|
+
type: 'text',
|
|
57
|
+
text: data.content ?? JSON.stringify(data, null, 2),
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
content: [
|
|
64
|
+
{ type: 'text', text: JSON.stringify(data, null, 2) },
|
|
65
|
+
],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=get-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-document.js","sourceRoot":"","sources":["../../src/tools/get-document.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,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,8BAA8B,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAC3D,WAAW,EAAE,CAAC;SACX,IAAI,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;SAC3C,OAAO,CAAC,YAAY,CAAC;SACrB,QAAQ,CAAC,sDAAsD,CAAC;CACpE,CAAA;AAQD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAqB;IACrD,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,oBAAoB,EAAE;QACnD,MAAM,EAAE,QAAQ;QAChB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,YAAY;KAC9C,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,qEAAqE;IACrE,uDAAuD;IACvD,MAAM,IAAI,GAAG,MAAM,CAAC,IAA+B,CAAA;IACnD,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,IAAI,YAAY,CAAA;IAEnD,IAAI,UAAU,KAAK,UAAU,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC1D,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAG,IAAI,CAAC,OAAkB,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;iBAChE;aACF;SACF,CAAA;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;SAC/D;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kb_memory -- Layer 1 Knowledge Access
|
|
3
|
+
*
|
|
4
|
+
* Returns curated project context for agent bootstrapping.
|
|
5
|
+
* Includes ADRs, active tasks, recent sessions, open letters, etc.
|
|
6
|
+
* Delegates to POST /api/mcp/memory.
|
|
7
|
+
*
|
|
8
|
+
* ADR-0001 spec: kb_memory(project_id, include[], depth)
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
export declare const getProjectMemorySchema: {
|
|
12
|
+
project_id: z.ZodString;
|
|
13
|
+
include: z.ZodArray<z.ZodEnum<{
|
|
14
|
+
adrs: "adrs";
|
|
15
|
+
rules: "rules";
|
|
16
|
+
active_tasks: "active_tasks";
|
|
17
|
+
recent_sessions: "recent_sessions";
|
|
18
|
+
open_letters: "open_letters";
|
|
19
|
+
planning: "planning";
|
|
20
|
+
research: "research";
|
|
21
|
+
}>>;
|
|
22
|
+
depth: z.ZodDefault<z.ZodEnum<{
|
|
23
|
+
light: "light";
|
|
24
|
+
standard: "standard";
|
|
25
|
+
deep: "deep";
|
|
26
|
+
}>>;
|
|
27
|
+
};
|
|
28
|
+
type GetProjectMemoryArgs = {
|
|
29
|
+
project_id: string;
|
|
30
|
+
include: string[];
|
|
31
|
+
depth?: string;
|
|
32
|
+
};
|
|
33
|
+
export declare function getProjectMemory(args: GetProjectMemoryArgs): Promise<{
|
|
34
|
+
content: {
|
|
35
|
+
type: "text";
|
|
36
|
+
text: string;
|
|
37
|
+
}[];
|
|
38
|
+
isError: boolean;
|
|
39
|
+
} | {
|
|
40
|
+
content: {
|
|
41
|
+
type: "text";
|
|
42
|
+
text: string;
|
|
43
|
+
}[];
|
|
44
|
+
isError?: undefined;
|
|
45
|
+
}>;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=get-project-memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-project-memory.d.ts","sourceRoot":"","sources":["../../src/tools/get-project-memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;CAmBlC,CAAA;AAED,KAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB;;;;;;;;;;;;GAwBhE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kb_memory -- Layer 1 Knowledge Access
|
|
3
|
+
*
|
|
4
|
+
* Returns curated project context for agent bootstrapping.
|
|
5
|
+
* Includes ADRs, active tasks, recent sessions, open letters, etc.
|
|
6
|
+
* Delegates to POST /api/mcp/memory.
|
|
7
|
+
*
|
|
8
|
+
* ADR-0001 spec: kb_memory(project_id, include[], depth)
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
import { nexusPost } from '../nexus-api.js';
|
|
12
|
+
export const getProjectMemorySchema = {
|
|
13
|
+
project_id: z.string().uuid().describe('Project UUID'),
|
|
14
|
+
include: z
|
|
15
|
+
.array(z.enum([
|
|
16
|
+
'adrs',
|
|
17
|
+
'rules',
|
|
18
|
+
'active_tasks',
|
|
19
|
+
'recent_sessions',
|
|
20
|
+
'open_letters',
|
|
21
|
+
'planning',
|
|
22
|
+
'research',
|
|
23
|
+
]))
|
|
24
|
+
.describe('Categories of knowledge to include'),
|
|
25
|
+
depth: z
|
|
26
|
+
.enum(['light', 'standard', 'deep'])
|
|
27
|
+
.default('standard')
|
|
28
|
+
.describe('Detail level: light (summaries), standard, deep (full bodies)'),
|
|
29
|
+
};
|
|
30
|
+
export async function getProjectMemory(args) {
|
|
31
|
+
const result = await nexusPost('/api/mcp/memory', {
|
|
32
|
+
project_id: args.project_id,
|
|
33
|
+
include: args.include,
|
|
34
|
+
depth: args.depth ?? 'standard',
|
|
35
|
+
});
|
|
36
|
+
if (!result.ok) {
|
|
37
|
+
return {
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: 'text',
|
|
41
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
isError: true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{ type: 'text', text: JSON.stringify(result.data, null, 2) },
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=get-project-memory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-project-memory.js","sourceRoot":"","sources":["../../src/tools/get-project-memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,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EAAE;SACtE;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
export declare const getRelatedEntitiesSchema: {
|
|
11
|
+
entity_type: z.ZodEnum<{
|
|
12
|
+
session: "session";
|
|
13
|
+
decision: "decision";
|
|
14
|
+
letter: "letter";
|
|
15
|
+
task: "task";
|
|
16
|
+
research_note: "research_note";
|
|
17
|
+
planning_item: "planning_item";
|
|
18
|
+
ingest_item: "ingest_item";
|
|
19
|
+
}>;
|
|
20
|
+
entity_id: z.ZodString;
|
|
21
|
+
relation_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
23
|
+
};
|
|
24
|
+
type GetRelatedEntitiesArgs = {
|
|
25
|
+
entity_type: string;
|
|
26
|
+
entity_id: string;
|
|
27
|
+
relation_types?: string[];
|
|
28
|
+
limit?: number;
|
|
29
|
+
};
|
|
30
|
+
export declare function getRelatedEntities(args: GetRelatedEntitiesArgs): Promise<{
|
|
31
|
+
content: {
|
|
32
|
+
type: "text";
|
|
33
|
+
text: string;
|
|
34
|
+
}[];
|
|
35
|
+
isError: boolean;
|
|
36
|
+
} | {
|
|
37
|
+
content: {
|
|
38
|
+
type: "text";
|
|
39
|
+
text: string;
|
|
40
|
+
}[];
|
|
41
|
+
isError?: undefined;
|
|
42
|
+
}>;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=get-related-entities.d.ts.map
|