@grafema/mcp 0.3.28 → 0.3.31

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.
Files changed (46) hide show
  1. package/dist/definitions/enox-tools.d.ts +10 -0
  2. package/dist/definitions/enox-tools.d.ts.map +1 -0
  3. package/dist/definitions/enox-tools.js +451 -0
  4. package/dist/definitions/enox-tools.js.map +1 -0
  5. package/dist/definitions/index.js +2 -2
  6. package/dist/definitions/index.js.map +1 -1
  7. package/dist/handlers/coverage-handlers.d.ts.map +1 -1
  8. package/dist/handlers/coverage-handlers.js +9 -0
  9. package/dist/handlers/coverage-handlers.js.map +1 -1
  10. package/dist/handlers/documentation-handlers.d.ts.map +1 -1
  11. package/dist/handlers/documentation-handlers.js +26 -5
  12. package/dist/handlers/documentation-handlers.js.map +1 -1
  13. package/dist/handlers/enox-handlers.d.ts +113 -0
  14. package/dist/handlers/enox-handlers.d.ts.map +1 -0
  15. package/dist/handlers/enox-handlers.js +877 -0
  16. package/dist/handlers/enox-handlers.js.map +1 -0
  17. package/dist/handlers/index.d.ts +1 -1
  18. package/dist/handlers/index.d.ts.map +1 -1
  19. package/dist/handlers/index.js +1 -1
  20. package/dist/handlers/index.js.map +1 -1
  21. package/dist/handlers/query-handlers.d.ts +7 -0
  22. package/dist/handlers/query-handlers.d.ts.map +1 -1
  23. package/dist/handlers/query-handlers.js +28 -14
  24. package/dist/handlers/query-handlers.js.map +1 -1
  25. package/dist/server.js +45 -17
  26. package/dist/server.js.map +1 -1
  27. package/dist/types.d.ts +64 -0
  28. package/dist/types.d.ts.map +1 -1
  29. package/package.json +12 -12
  30. package/src/definitions/enox-tools.ts +454 -0
  31. package/src/definitions/index.ts +2 -2
  32. package/src/handlers/coverage-handlers.ts +10 -0
  33. package/src/handlers/documentation-handlers.ts +26 -5
  34. package/src/handlers/enox-handlers.ts +1125 -0
  35. package/src/handlers/index.ts +1 -1
  36. package/src/handlers/query-handlers.ts +25 -12
  37. package/src/server.ts +86 -29
  38. package/src/types.ts +78 -0
  39. package/dist/definitions.d.ts +0 -23
  40. package/dist/definitions.d.ts.map +0 -1
  41. package/dist/definitions.js +0 -644
  42. package/dist/definitions.js.map +0 -1
  43. package/dist/handlers.d.ts +0 -61
  44. package/dist/handlers.d.ts.map +0 -1
  45. package/dist/handlers.js +0 -1310
  46. package/dist/handlers.js.map +0 -1
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Enox Handlers — RFDB-backed knowledge graph for Grafema MCP server.
3
+ *
4
+ * Replaces the file-based knowledge-handlers.ts with a proper graph database.
5
+ * All knowledge lives in a separate RFDB database called "knowledge",
6
+ * sharing the same server socket as the code graph.
7
+ */
8
+ import { RFDBClient } from '@grafema/util';
9
+ import type { ToolResult } from '../types.js';
10
+ export interface RememberArgs {
11
+ subject: string;
12
+ fact: string;
13
+ domain?: string;
14
+ confidence?: number;
15
+ relation?: string;
16
+ }
17
+ export declare function handleRemember(args: RememberArgs): Promise<ToolResult>;
18
+ export interface RecallArgs {
19
+ query: string;
20
+ depth?: number;
21
+ }
22
+ export declare function handleRecall(args: RecallArgs): Promise<ToolResult>;
23
+ export interface SemanticSearchArgs {
24
+ query: string;
25
+ top_k?: number;
26
+ domain?: string;
27
+ }
28
+ /**
29
+ * Handle the `semantic_search` MCP tool.
30
+ *
31
+ * @param args - tool input. `top_k` (matching the published schema) caps the
32
+ * number of results; defaults to 10 per the schema's documented default.
33
+ * @param clientOverride - optional RFDB client, injected by tests; production
34
+ * callers omit it and the shared knowledge client is used.
35
+ */
36
+ export declare function handleSemanticSearch(args: SemanticSearchArgs, clientOverride?: RFDBClient): Promise<ToolResult>;
37
+ export interface ExploreEntityArgs {
38
+ name: string;
39
+ depth?: number;
40
+ }
41
+ export declare function handleExploreEntity(args: ExploreEntityArgs): Promise<ToolResult>;
42
+ export interface AddAssertionArgs {
43
+ from: string;
44
+ relation: string;
45
+ to: string;
46
+ context?: string;
47
+ confidence?: number;
48
+ domain?: string;
49
+ note?: string;
50
+ condition?: string;
51
+ }
52
+ export declare function handleAddAssertion(args: AddAssertionArgs): Promise<ToolResult>;
53
+ export interface UpdateAssertionArgs {
54
+ fact_id: string;
55
+ confidence?: number;
56
+ context?: string;
57
+ note?: string;
58
+ condition?: string;
59
+ domain?: string;
60
+ }
61
+ export declare function handleUpdateAssertion(args: UpdateAssertionArgs): Promise<ToolResult>;
62
+ export interface DeleteAssertionArgs {
63
+ fact_id: string;
64
+ }
65
+ export declare function handleDeleteAssertion(args: DeleteAssertionArgs): Promise<ToolResult>;
66
+ export interface QueryGraphKnowledgeArgs {
67
+ type?: string;
68
+ domain?: string;
69
+ name?: string;
70
+ limit?: number;
71
+ }
72
+ export declare function handleEnoxQuery(args: QueryGraphKnowledgeArgs): Promise<ToolResult>;
73
+ export interface TraverseArgs {
74
+ entity: string;
75
+ direction?: 'outgoing' | 'incoming' | 'both';
76
+ max_depth?: number;
77
+ edge_types?: string[];
78
+ }
79
+ export declare function handleEnoxTraverse(args: TraverseArgs): Promise<ToolResult>;
80
+ export declare function handleEnoxStats(): Promise<ToolResult>;
81
+ export interface RecentActivityArgs {
82
+ since?: string;
83
+ limit?: number;
84
+ }
85
+ export declare function handleRecentActivity(args: RecentActivityArgs): Promise<ToolResult>;
86
+ export interface UpdateNodeArgs {
87
+ id: string;
88
+ name?: string;
89
+ domain?: string;
90
+ description?: string;
91
+ nodeType?: string;
92
+ }
93
+ export declare function handleUpdateNode(args: UpdateNodeArgs): Promise<ToolResult>;
94
+ export interface CrawlEntityArgs {
95
+ entity: string;
96
+ context?: string;
97
+ depth?: number;
98
+ }
99
+ /**
100
+ * Lightweight ontological crawl: query the code graph for an entity,
101
+ * generate graph-derived facts, and record them in the knowledge DB.
102
+ *
103
+ * No LLM, no child processes — pure graph introspection.
104
+ */
105
+ export declare function handleCrawlEntity(args: CrawlEntityArgs): Promise<ToolResult>;
106
+ export interface SaveDocumentArgs {
107
+ title: string;
108
+ content: string;
109
+ domain?: string;
110
+ relates_to?: string[];
111
+ }
112
+ export declare function handleSaveDocument(args: SaveDocumentArgs): Promise<ToolResult>;
113
+ //# sourceMappingURL=enox-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enox-handlers.d.ts","sourceRoot":"","sources":["../../src/handlers/enox-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAwL9C,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAkD5E;AAMD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CA0ExE;AAMD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,kBAAkB,EACxB,cAAc,CAAC,EAAE,UAAU,GAC1B,OAAO,CAAC,UAAU,CAAC,CAuCrB;AAMD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAgEtF;AAMD,MA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