@grackle-ai/plugin-knowledge 0.99.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 +40 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/knowledge-handlers.d.ts +12 -0
- package/dist/knowledge-handlers.d.ts.map +1 -0
- package/dist/knowledge-handlers.js +140 -0
- package/dist/knowledge-handlers.js.map +1 -0
- package/dist/knowledge-health.d.ts +60 -0
- package/dist/knowledge-health.d.ts.map +1 -0
- package/dist/knowledge-health.js +102 -0
- package/dist/knowledge-health.js.map +1 -0
- package/dist/knowledge-init.d.ts +32 -0
- package/dist/knowledge-init.d.ts.map +1 -0
- package/dist/knowledge-init.js +225 -0
- package/dist/knowledge-init.js.map +1 -0
- package/dist/knowledge-plugin.d.ts +25 -0
- package/dist/knowledge-plugin.d.ts.map +1 -0
- package/dist/knowledge-plugin.js +66 -0
- package/dist/knowledge-plugin.js.map +1 -0
- package/dist/logger.d.ts +4 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +4 -0
- package/dist/logger.js.map +1 -0
- package/dist/mcp-tools.d.ts +12 -0
- package/dist/mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools.js +342 -0
- package/dist/mcp-tools.js.map +1 -0
- package/dist/proto-converters.d.ts +12 -0
- package/dist/proto-converters.d.ts.map +1 -0
- package/dist/proto-converters.js +35 -0
- package/dist/proto-converters.js.map +1 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/package.json +55 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-init.js","sourceRoot":"","sources":["../src/knowledge-init.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,IAAI,gBAAgB,EAC/B,mBAAmB,EACnB,iBAAiB,EACjB,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AAyC,CAAC,CAAC;YAC3D,iBAAiB,GAAG,SAAS,CAAC;YAC9B,MAAM,UAAU,EAAE,CAAC;YACnB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,uCAAuC;QACvC,iBAAiB,GAAG,SAAS,CAAC;QAC9B,MAAM,UAAU,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACnC,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,GAAkB;IAC3D,MAAM,QAAQ,GAAyB,iBAAiB,CAAC;IACzD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC;IAC/B,CAAC;IAED,MAAM,WAAW,GAAe,GAAG,CAAC,SAAS,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEjF,OAAO;QACL,OAAO,EAAE,GAAS,EAAE;YAClB,WAAW,EAAE,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge plugin factory.
|
|
3
|
+
*
|
|
4
|
+
* Wires Neo4j, embeddings, gRPC handlers, entity sync, and MCP tools
|
|
5
|
+
* into the Grackle plugin system.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type { GracklePlugin } from "@grackle-ai/plugin-sdk";
|
|
10
|
+
/**
|
|
11
|
+
* Create the knowledge plugin that contributes Neo4j-backed knowledge graph
|
|
12
|
+
* capabilities to the Grackle server.
|
|
13
|
+
*
|
|
14
|
+
* - **gRPC handlers**: searchKnowledge, getKnowledgeNode, expandKnowledgeNode,
|
|
15
|
+
* listRecentKnowledgeNodes, createKnowledgeNode
|
|
16
|
+
* - **Reconciliation phases**: knowledge-health (Neo4j connectivity check)
|
|
17
|
+
* - **Event subscribers**: entity sync (task/finding → knowledge graph)
|
|
18
|
+
* - **MCP tools**: knowledge_search, knowledge_get_node, knowledge_create_node
|
|
19
|
+
*
|
|
20
|
+
* Depends on the "core" plugin.
|
|
21
|
+
*
|
|
22
|
+
* @returns A GracklePlugin ready to pass to `loadPlugins()`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function createKnowledgePlugin(): GracklePlugin;
|
|
25
|
+
//# sourceMappingURL=knowledge-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-plugin.d.ts","sourceRoot":"","sources":["../src/knowledge-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,wBAAwB,CAAC;AAkB3E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,IAAI,aAAa,CA0CrD"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge plugin factory.
|
|
3
|
+
*
|
|
4
|
+
* Wires Neo4j, embeddings, gRPC handlers, entity sync, and MCP tools
|
|
5
|
+
* into the Grackle plugin system.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { grackle } from "@grackle-ai/common";
|
|
10
|
+
import { logger } from "./logger.js";
|
|
11
|
+
import { initKnowledge, createEntitySyncSubscriber, neo4jHealthCheck, } from "./knowledge-init.js";
|
|
12
|
+
import { createKnowledgeHealthPhase, markKnowledgeInitFailed } from "./knowledge-health.js";
|
|
13
|
+
import { searchKnowledge, getKnowledgeNode, expandKnowledgeNode, listRecentKnowledgeNodes, createKnowledgeNode, } from "./knowledge-handlers.js";
|
|
14
|
+
import { knowledgeMcpTools } from "./mcp-tools.js";
|
|
15
|
+
/**
|
|
16
|
+
* Create the knowledge plugin that contributes Neo4j-backed knowledge graph
|
|
17
|
+
* capabilities to the Grackle server.
|
|
18
|
+
*
|
|
19
|
+
* - **gRPC handlers**: searchKnowledge, getKnowledgeNode, expandKnowledgeNode,
|
|
20
|
+
* listRecentKnowledgeNodes, createKnowledgeNode
|
|
21
|
+
* - **Reconciliation phases**: knowledge-health (Neo4j connectivity check)
|
|
22
|
+
* - **Event subscribers**: entity sync (task/finding → knowledge graph)
|
|
23
|
+
* - **MCP tools**: knowledge_search, knowledge_get_node, knowledge_create_node
|
|
24
|
+
*
|
|
25
|
+
* Depends on the "core" plugin.
|
|
26
|
+
*
|
|
27
|
+
* @returns A GracklePlugin ready to pass to `loadPlugins()`.
|
|
28
|
+
*/
|
|
29
|
+
export function createKnowledgePlugin() {
|
|
30
|
+
let cleanup;
|
|
31
|
+
return {
|
|
32
|
+
name: "knowledge",
|
|
33
|
+
dependencies: ["core"],
|
|
34
|
+
initialize: async (ctx) => {
|
|
35
|
+
try {
|
|
36
|
+
cleanup = await initKnowledge(ctx);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
// Knowledge init failure (e.g. Neo4j unreachable) is non-fatal.
|
|
40
|
+
// Mark health as failed immediately so /readyz reflects accurate status.
|
|
41
|
+
markKnowledgeInitFailed();
|
|
42
|
+
logger.error({ err }, "Knowledge plugin initialization failed — running degraded");
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
shutdown: async () => {
|
|
46
|
+
await cleanup?.();
|
|
47
|
+
cleanup = undefined;
|
|
48
|
+
},
|
|
49
|
+
grpcHandlers: () => [{
|
|
50
|
+
service: grackle.Grackle,
|
|
51
|
+
handlers: {
|
|
52
|
+
searchKnowledge,
|
|
53
|
+
getKnowledgeNode,
|
|
54
|
+
expandKnowledgeNode,
|
|
55
|
+
listRecentKnowledgeNodes,
|
|
56
|
+
createKnowledgeNode,
|
|
57
|
+
},
|
|
58
|
+
}],
|
|
59
|
+
reconciliationPhases: () => [
|
|
60
|
+
createKnowledgeHealthPhase({ healthCheck: neo4jHealthCheck }),
|
|
61
|
+
],
|
|
62
|
+
eventSubscribers: (ctx) => [createEntitySyncSubscriber(ctx)],
|
|
63
|
+
mcpTools: () => knowledgeMcpTools,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=knowledge-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-plugin.js","sourceRoot":"","sources":["../src/knowledge-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,qBAAqB;IACnC,IAAI,OAA0C,CAAC;IAE/C,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,YAAY,EAAE,CAAC,MAAM,CAAC;QAEtB,UAAU,EAAE,KAAK,EAAE,GAAkB,EAAiB,EAAE;YACtD,IAAI,CAAC;gBACH,OAAO,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC;YACrC,CAAC;YAAC,OAAO,GAAY,EAAE,CAAC;gBACtB,gEAAgE;gBAChE,yEAAyE;gBACzE,uBAAuB,EAAE,CAAC;gBAC1B,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,2DAA2D,CAAC,CAAC;YACrF,CAAC;QACH,CAAC;QAED,QAAQ,EAAE,KAAK,IAAmB,EAAE;YAClC,MAAM,OAAO,EAAE,EAAE,CAAC;YAClB,OAAO,GAAG,SAAS,CAAC;QACtB,CAAC;QAED,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC;gBACnB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,QAAQ,EAAE;oBACR,eAAe;oBACf,gBAAgB;oBAChB,mBAAmB;oBACnB,wBAAwB;oBACxB,mBAAmB;iBACpB;aACF,CAAC;QAEF,oBAAoB,EAAE,GAAG,EAAE,CAAC;YAC1B,0BAA0B,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;SAC9D;QAED,gBAAgB,EAAE,CAAC,GAAkB,EAAE,EAAE,CAAC,CAAC,0BAA0B,CAAC,GAAG,CAAC,CAAC;QAE3E,QAAQ,EAAE,GAAG,EAAE,CAAC,iBAAiB;KAClC,CAAC;AACJ,CAAC"}
|
package/dist/logger.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,6EAA6E;AAC7E,eAAO,MAAM,MAAM,EAAE,MAA+D,CAAC"}
|
package/dist/logger.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAExD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,MAAM,GAAW,UAAU,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tools for the Grackle knowledge graph.
|
|
3
|
+
*
|
|
4
|
+
* Exposes high-level operations (search, retrieve, create) to agents.
|
|
5
|
+
* All calls go through gRPC to the Grackle server.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type { PluginToolDefinition } from "@grackle-ai/plugin-sdk";
|
|
10
|
+
/** Knowledge graph MCP tools contributed by the plugin. */
|
|
11
|
+
export declare const knowledgeMcpTools: PluginToolDefinition[];
|
|
12
|
+
//# sourceMappingURL=mcp-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-tools.d.ts","sourceRoot":"","sources":["../src/mcp-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AA8FnE,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,EAAE,oBAAoB,EA+UnD,CAAC"}
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tools for the Grackle knowledge graph.
|
|
3
|
+
*
|
|
4
|
+
* Exposes high-level operations (search, retrieve, create) to agents.
|
|
5
|
+
* All calls go through gRPC to the Grackle server.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// Constants
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
/** Maximum allowed search results. */
|
|
14
|
+
const MAX_SEARCH_LIMIT = 50;
|
|
15
|
+
/** Maximum allowed expansion depth. */
|
|
16
|
+
const MAX_EXPAND_DEPTH = 5;
|
|
17
|
+
/** Valid edge type values. */
|
|
18
|
+
const EDGE_TYPES = [
|
|
19
|
+
"RELATES_TO",
|
|
20
|
+
"DEPENDS_ON",
|
|
21
|
+
"DERIVED_FROM",
|
|
22
|
+
"MENTIONS",
|
|
23
|
+
"PART_OF",
|
|
24
|
+
];
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// Response formatting — hide internal details from agents
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
/** Format a proto node for agent consumption. */
|
|
29
|
+
function formatNode(node) {
|
|
30
|
+
const base = {
|
|
31
|
+
id: node.id,
|
|
32
|
+
kind: node.kind,
|
|
33
|
+
workspaceId: node.workspaceId,
|
|
34
|
+
createdAt: node.createdAt,
|
|
35
|
+
updatedAt: node.updatedAt,
|
|
36
|
+
};
|
|
37
|
+
if (node.kind === "reference") {
|
|
38
|
+
base.sourceType = node.sourceType;
|
|
39
|
+
base.sourceId = node.sourceId;
|
|
40
|
+
base.label = node.label;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
base.category = node.category;
|
|
44
|
+
base.title = node.title;
|
|
45
|
+
base.content = node.content;
|
|
46
|
+
base.tags = [...node.tags];
|
|
47
|
+
}
|
|
48
|
+
return base;
|
|
49
|
+
}
|
|
50
|
+
/** Format a proto edge for agent consumption. */
|
|
51
|
+
function formatEdge(edge) {
|
|
52
|
+
const result = {
|
|
53
|
+
fromId: edge.fromId,
|
|
54
|
+
toId: edge.toId,
|
|
55
|
+
type: edge.type,
|
|
56
|
+
};
|
|
57
|
+
if (edge.metadataJson) {
|
|
58
|
+
try {
|
|
59
|
+
result.metadata = JSON.parse(edge.metadataJson);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// ignore malformed metadata
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
/** Format a search result for agent consumption. */
|
|
68
|
+
function formatSearchResult(result) {
|
|
69
|
+
return {
|
|
70
|
+
score: Math.round(result.score * 1000) / 1000,
|
|
71
|
+
node: result.node ? formatNode(result.node) : {},
|
|
72
|
+
edges: result.edges.map(formatEdge),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** Clamp a numeric input to a safe integer range. */
|
|
76
|
+
function clampInt(value, min, max, defaultValue) {
|
|
77
|
+
if (value === undefined) {
|
|
78
|
+
return defaultValue;
|
|
79
|
+
}
|
|
80
|
+
return Math.max(min, Math.min(max, Math.floor(value)));
|
|
81
|
+
}
|
|
82
|
+
/** Return a JSON text content block. */
|
|
83
|
+
function jsonResult(data) {
|
|
84
|
+
return {
|
|
85
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
// Tool definitions
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
/** Knowledge graph MCP tools contributed by the plugin. */
|
|
92
|
+
export const knowledgeMcpTools = [
|
|
93
|
+
{
|
|
94
|
+
name: "knowledge_search",
|
|
95
|
+
group: "knowledge",
|
|
96
|
+
description: "Search the knowledge graph using natural language. Returns relevant nodes " +
|
|
97
|
+
"(decisions, insights, task references, findings) ranked by semantic similarity.",
|
|
98
|
+
inputSchema: z.object({
|
|
99
|
+
query: z.string().describe("Natural language search query"),
|
|
100
|
+
limit: z
|
|
101
|
+
.number()
|
|
102
|
+
.int()
|
|
103
|
+
.min(1)
|
|
104
|
+
.max(MAX_SEARCH_LIMIT)
|
|
105
|
+
.optional()
|
|
106
|
+
.describe(`Maximum number of results to return (default 10, max ${MAX_SEARCH_LIMIT})`),
|
|
107
|
+
workspaceId: z
|
|
108
|
+
.string()
|
|
109
|
+
.optional()
|
|
110
|
+
.describe("Filter results to a specific workspace"),
|
|
111
|
+
expand: z
|
|
112
|
+
.boolean()
|
|
113
|
+
.optional()
|
|
114
|
+
.describe("If true, also return nodes connected to the search results (default false)"),
|
|
115
|
+
expandDepth: z
|
|
116
|
+
.number()
|
|
117
|
+
.int()
|
|
118
|
+
.min(1)
|
|
119
|
+
.max(MAX_EXPAND_DEPTH)
|
|
120
|
+
.optional()
|
|
121
|
+
.describe(`How many hops to traverse when expanding (default 1, max ${MAX_EXPAND_DEPTH})`),
|
|
122
|
+
}),
|
|
123
|
+
rpcMethod: "knowledgeSearch",
|
|
124
|
+
mutating: false,
|
|
125
|
+
annotations: {
|
|
126
|
+
readOnlyHint: true,
|
|
127
|
+
destructiveHint: false,
|
|
128
|
+
idempotentHint: true,
|
|
129
|
+
openWorldHint: false,
|
|
130
|
+
},
|
|
131
|
+
async handler(args, client, authContext) {
|
|
132
|
+
const typedClient = client;
|
|
133
|
+
const typedAuth = authContext;
|
|
134
|
+
const { query, limit, workspaceId, expand, expandDepth, } = args;
|
|
135
|
+
// For scoped callers, always use the auth context workspace.
|
|
136
|
+
const resolvedWorkspaceId = typedAuth?.type === "scoped"
|
|
137
|
+
? typedAuth.workspaceId ?? ""
|
|
138
|
+
: workspaceId ?? "";
|
|
139
|
+
const safeLimit = clampInt(limit, 1, MAX_SEARCH_LIMIT, 10);
|
|
140
|
+
const response = await typedClient.searchKnowledge({
|
|
141
|
+
query,
|
|
142
|
+
limit: safeLimit,
|
|
143
|
+
workspaceId: resolvedWorkspaceId,
|
|
144
|
+
});
|
|
145
|
+
const formattedResults = response.results.map(formatSearchResult);
|
|
146
|
+
let neighbors;
|
|
147
|
+
let neighborEdges;
|
|
148
|
+
if (expand && response.results.length > 0) {
|
|
149
|
+
const safeDepth = clampInt(expandDepth, 1, MAX_EXPAND_DEPTH, 1);
|
|
150
|
+
const allNeighbors = new Map();
|
|
151
|
+
const allEdges = [];
|
|
152
|
+
const startIds = new Set(response.results.map((r) => r.node?.id ?? "").filter(Boolean));
|
|
153
|
+
for (const result of response.results) {
|
|
154
|
+
if (!result.node) {
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
const expansion = await typedClient.expandKnowledgeNode({
|
|
158
|
+
id: result.node.id,
|
|
159
|
+
depth: safeDepth,
|
|
160
|
+
});
|
|
161
|
+
for (const node of expansion.nodes) {
|
|
162
|
+
if (!startIds.has(node.id)) {
|
|
163
|
+
allNeighbors.set(node.id, formatNode(node));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
for (const edge of expansion.edges) {
|
|
167
|
+
allEdges.push(formatEdge(edge));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
neighbors = [...allNeighbors.values()];
|
|
171
|
+
neighborEdges = allEdges;
|
|
172
|
+
if (typedAuth?.type === "scoped") {
|
|
173
|
+
const allowedWorkspaceId = typedAuth.workspaceId ?? "";
|
|
174
|
+
const allowedIds = new Set();
|
|
175
|
+
neighbors = neighbors.filter((n) => {
|
|
176
|
+
const allowed = n.workspaceId === allowedWorkspaceId;
|
|
177
|
+
if (allowed) {
|
|
178
|
+
allowedIds.add(n.id);
|
|
179
|
+
}
|
|
180
|
+
return allowed;
|
|
181
|
+
});
|
|
182
|
+
const allowedEdgeNodeIds = new Set([
|
|
183
|
+
...startIds,
|
|
184
|
+
...allowedIds,
|
|
185
|
+
]);
|
|
186
|
+
neighborEdges = neighborEdges.filter((e) => allowedEdgeNodeIds.has(e.fromId) && allowedEdgeNodeIds.has(e.toId));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return jsonResult({
|
|
190
|
+
results: formattedResults,
|
|
191
|
+
...(neighbors !== undefined ? { neighbors, neighborEdges } : {}),
|
|
192
|
+
});
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "knowledge_get_node",
|
|
197
|
+
group: "knowledge",
|
|
198
|
+
description: "Retrieve a specific node from the knowledge graph by its ID, " +
|
|
199
|
+
"including all edges connecting it to other nodes.",
|
|
200
|
+
inputSchema: z.object({
|
|
201
|
+
id: z.string().describe("The node ID to retrieve"),
|
|
202
|
+
expand: z
|
|
203
|
+
.boolean()
|
|
204
|
+
.optional()
|
|
205
|
+
.describe("If true, also return neighbor nodes within expandDepth hops (default false)"),
|
|
206
|
+
expandDepth: z
|
|
207
|
+
.number()
|
|
208
|
+
.int()
|
|
209
|
+
.min(1)
|
|
210
|
+
.max(MAX_EXPAND_DEPTH)
|
|
211
|
+
.optional()
|
|
212
|
+
.describe(`How many hops to traverse when expanding (default 1, max ${MAX_EXPAND_DEPTH})`),
|
|
213
|
+
}),
|
|
214
|
+
rpcMethod: "knowledgeGetNode",
|
|
215
|
+
mutating: false,
|
|
216
|
+
annotations: {
|
|
217
|
+
readOnlyHint: true,
|
|
218
|
+
destructiveHint: false,
|
|
219
|
+
idempotentHint: true,
|
|
220
|
+
openWorldHint: false,
|
|
221
|
+
},
|
|
222
|
+
async handler(args, client, authContext) {
|
|
223
|
+
const typedClient = client;
|
|
224
|
+
const typedAuth = authContext;
|
|
225
|
+
const { id, expand, expandDepth } = args;
|
|
226
|
+
const response = await typedClient.getKnowledgeNode({ id });
|
|
227
|
+
if (!response.node) {
|
|
228
|
+
return {
|
|
229
|
+
content: [
|
|
230
|
+
{
|
|
231
|
+
type: "text",
|
|
232
|
+
text: JSON.stringify({ error: `Node not found: ${id}` }, null, 2),
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
isError: true,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
if (typedAuth?.type === "scoped") {
|
|
239
|
+
if (response.node.workspaceId !== (typedAuth.workspaceId ?? "")) {
|
|
240
|
+
return {
|
|
241
|
+
content: [
|
|
242
|
+
{
|
|
243
|
+
type: "text",
|
|
244
|
+
text: JSON.stringify({ error: `Node not found: ${id}` }, null, 2),
|
|
245
|
+
},
|
|
246
|
+
],
|
|
247
|
+
isError: true,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const result = {
|
|
252
|
+
node: formatNode(response.node),
|
|
253
|
+
edges: response.edges.map(formatEdge),
|
|
254
|
+
};
|
|
255
|
+
if (expand) {
|
|
256
|
+
const safeDepth = clampInt(expandDepth, 1, MAX_EXPAND_DEPTH, 1);
|
|
257
|
+
const expansion = await typedClient.expandKnowledgeNode({ id, depth: safeDepth });
|
|
258
|
+
let expandedNodes = expansion.nodes.map(formatNode);
|
|
259
|
+
let expandedEdges = expansion.edges.map(formatEdge);
|
|
260
|
+
if (typedAuth?.type === "scoped") {
|
|
261
|
+
const allowedWorkspaceId = typedAuth.workspaceId ?? "";
|
|
262
|
+
const allowedIds = new Set([id]);
|
|
263
|
+
expandedNodes = expandedNodes.filter((n) => {
|
|
264
|
+
const allowed = n.workspaceId === allowedWorkspaceId;
|
|
265
|
+
if (allowed) {
|
|
266
|
+
allowedIds.add(n.id);
|
|
267
|
+
}
|
|
268
|
+
return allowed;
|
|
269
|
+
});
|
|
270
|
+
expandedEdges = expandedEdges.filter((e) => allowedIds.has(e.fromId) && allowedIds.has(e.toId));
|
|
271
|
+
}
|
|
272
|
+
result.neighbors = expandedNodes;
|
|
273
|
+
result.neighborEdges = expandedEdges;
|
|
274
|
+
}
|
|
275
|
+
return jsonResult(result);
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: "knowledge_create_node",
|
|
280
|
+
group: "knowledge",
|
|
281
|
+
description: "Create a new knowledge entry (decision, insight, concept, or snippet). " +
|
|
282
|
+
"The content is automatically embedded for future semantic search. " +
|
|
283
|
+
"Optionally link it to existing nodes.",
|
|
284
|
+
inputSchema: z.object({
|
|
285
|
+
title: z.string().describe("Title or summary of the knowledge entry"),
|
|
286
|
+
content: z
|
|
287
|
+
.string()
|
|
288
|
+
.describe("Full content to store and embed for search"),
|
|
289
|
+
category: z
|
|
290
|
+
.string()
|
|
291
|
+
.optional()
|
|
292
|
+
.describe("Category: decision, insight, concept, snippet (default: insight)"),
|
|
293
|
+
tags: z
|
|
294
|
+
.array(z.string())
|
|
295
|
+
.optional()
|
|
296
|
+
.describe("Tags for categorization"),
|
|
297
|
+
workspaceId: z
|
|
298
|
+
.string()
|
|
299
|
+
.optional()
|
|
300
|
+
.describe("Workspace to scope this entry to"),
|
|
301
|
+
edges: z
|
|
302
|
+
.array(z.object({
|
|
303
|
+
toId: z.string().describe("ID of the node to link to"),
|
|
304
|
+
type: z
|
|
305
|
+
.enum(EDGE_TYPES)
|
|
306
|
+
.describe("Relationship type: RELATES_TO, DEPENDS_ON, DERIVED_FROM, MENTIONS, PART_OF"),
|
|
307
|
+
}))
|
|
308
|
+
.optional()
|
|
309
|
+
.describe("Edges to create from this node to existing nodes"),
|
|
310
|
+
}),
|
|
311
|
+
rpcMethod: "knowledgeCreateNode",
|
|
312
|
+
mutating: true,
|
|
313
|
+
annotations: {
|
|
314
|
+
readOnlyHint: false,
|
|
315
|
+
destructiveHint: false,
|
|
316
|
+
idempotentHint: false,
|
|
317
|
+
openWorldHint: false,
|
|
318
|
+
},
|
|
319
|
+
async handler(args, client, authContext) {
|
|
320
|
+
const typedClient = client;
|
|
321
|
+
const typedAuth = authContext;
|
|
322
|
+
const { title, content, category, tags, workspaceId, } = args;
|
|
323
|
+
// For scoped callers, always use the auth context workspace.
|
|
324
|
+
const resolvedWorkspaceId = typedAuth?.type === "scoped"
|
|
325
|
+
? typedAuth.workspaceId ?? ""
|
|
326
|
+
: workspaceId ?? "";
|
|
327
|
+
const response = await typedClient.createKnowledgeNode({
|
|
328
|
+
title,
|
|
329
|
+
content,
|
|
330
|
+
category: category ?? "insight",
|
|
331
|
+
tags: tags ?? [],
|
|
332
|
+
workspaceId: resolvedWorkspaceId,
|
|
333
|
+
});
|
|
334
|
+
return jsonResult({
|
|
335
|
+
id: response.id,
|
|
336
|
+
title,
|
|
337
|
+
category: category ?? "insight",
|
|
338
|
+
});
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
];
|
|
342
|
+
//# sourceMappingURL=mcp-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-tools.js","sourceRoot":"","sources":["../src/mcp-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,sCAAsC;AACtC,MAAM,gBAAgB,GAAW,EAAE,CAAC;AAEpC,uCAAuC;AACvC,MAAM,gBAAgB,GAAW,CAAC,CAAC;AAEnC,8BAA8B;AAC9B,MAAM,UAAU,GAAG;IACjB,YAAY;IACZ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,UAAU,CAAC;gBAChB,EAAE,EAAE,QAAQ,CAAC,EAAE;gBACf,KAAK;gBACL,QAAQ,EAAE,QAAQ,IAAI,SAAS;aAChC,CAAC,CAAC;QACL,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proto converters for knowledge graph types.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { grackle } from "@grackle-ai/common";
|
|
7
|
+
import type { KnowledgeNode, KnowledgeEdge } from "@grackle-ai/knowledge";
|
|
8
|
+
/** Convert a KnowledgeNode to its proto representation. */
|
|
9
|
+
export declare function knowledgeNodeToProto(node: KnowledgeNode): grackle.KnowledgeNodeProto;
|
|
10
|
+
/** Convert a KnowledgeEdge to its proto representation. */
|
|
11
|
+
export declare function knowledgeEdgeToProto(edge: KnowledgeEdge): grackle.KnowledgeEdgeProto;
|
|
12
|
+
//# sourceMappingURL=proto-converters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proto-converters.d.ts","sourceRoot":"","sources":["../src/proto-converters.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE1E,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAepF;AAED,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAQpF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proto converters for knowledge graph types.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { create } from "@bufbuild/protobuf";
|
|
7
|
+
import { grackle } from "@grackle-ai/common";
|
|
8
|
+
/** Convert a KnowledgeNode to its proto representation. */
|
|
9
|
+
export function knowledgeNodeToProto(node) {
|
|
10
|
+
return create(grackle.KnowledgeNodeProtoSchema, {
|
|
11
|
+
id: node.id,
|
|
12
|
+
kind: node.kind,
|
|
13
|
+
workspaceId: node.workspaceId,
|
|
14
|
+
createdAt: node.createdAt,
|
|
15
|
+
updatedAt: node.updatedAt,
|
|
16
|
+
sourceType: node.kind === "reference" ? node.sourceType : "",
|
|
17
|
+
sourceId: node.kind === "reference" ? node.sourceId : "",
|
|
18
|
+
label: node.kind === "reference" ? node.label : "",
|
|
19
|
+
category: node.kind === "native" ? node.category : "",
|
|
20
|
+
title: node.kind === "native" ? node.title : "",
|
|
21
|
+
content: node.kind === "native" ? node.content : "",
|
|
22
|
+
tags: node.kind === "native" ? node.tags : [],
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** Convert a KnowledgeEdge to its proto representation. */
|
|
26
|
+
export function knowledgeEdgeToProto(edge) {
|
|
27
|
+
return create(grackle.KnowledgeEdgeProtoSchema, {
|
|
28
|
+
fromId: edge.fromId,
|
|
29
|
+
toId: edge.toId,
|
|
30
|
+
type: edge.type,
|
|
31
|
+
metadataJson: edge.metadata ? JSON.stringify(edge.metadata) : "",
|
|
32
|
+
createdAt: edge.createdAt,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=proto-converters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proto-converters.js","sourceRoot":"","sources":["../src/proto-converters.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7C,2DAA2D;AAC3D,MAAM,UAAU,oBAAoB,CAAC,IAAmB;IACtD,OAAO,MAAM,CAAC,OAAO,CAAC,wBAAwB,EAAE;QAC9C,EAAE,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C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;QAChE,SAAS,EAAE,IAAI,CAAC,SAAS;KAC1B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.57.7"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@grackle-ai/plugin-knowledge",
|
|
3
|
+
"version": "0.99.0",
|
|
4
|
+
"description": "Knowledge graph plugin for Grackle — Neo4j, embeddings, and knowledge MCP tools",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/nick-pape/grackle.git",
|
|
9
|
+
"directory": "packages/plugin-knowledge"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"grackle",
|
|
13
|
+
"plugin",
|
|
14
|
+
"knowledge",
|
|
15
|
+
"neo4j"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://github.com/nick-pape/grackle#readme",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/nick-pape/grackle/issues"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=22.0.0 <24.0.0"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "dist/index.js",
|
|
26
|
+
"types": "dist/index.d.ts",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist/"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@bufbuild/protobuf": "^2.5.0",
|
|
32
|
+
"@connectrpc/connect": "^2.0.0",
|
|
33
|
+
"pino": "^10.3.1",
|
|
34
|
+
"zod": "^4.0.0",
|
|
35
|
+
"@grackle-ai/auth": "0.99.0",
|
|
36
|
+
"@grackle-ai/common": "0.99.0",
|
|
37
|
+
"@grackle-ai/database": "0.99.0",
|
|
38
|
+
"@grackle-ai/core": "0.99.0",
|
|
39
|
+
"@grackle-ai/knowledge": "0.99.0",
|
|
40
|
+
"@grackle-ai/plugin-sdk": "0.99.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@rushstack/heft": "1.2.7",
|
|
44
|
+
"@types/node": "^22.0.0",
|
|
45
|
+
"vitest": "^3.2.1",
|
|
46
|
+
"@grackle-ai/heft-rig": "0.0.1"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "heft build --clean",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"clean": "heft clean",
|
|
52
|
+
"_phase:build": "heft run --only build -- --clean",
|
|
53
|
+
"_phase:test": "vitest run"
|
|
54
|
+
}
|
|
55
|
+
}
|