@carlonicora/nestjs-neo4jsonapi 1.110.3 → 1.112.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.
Files changed (156) hide show
  1. package/dist/agents/graph/tools/describe-entity.tool.d.ts +1 -1
  2. package/dist/agents/graph/tools/describe-entity.tool.d.ts.map +1 -1
  3. package/dist/agents/graph/tools/describe-entity.tool.js +2 -1
  4. package/dist/agents/graph/tools/describe-entity.tool.js.map +1 -1
  5. package/dist/agents/graph/tools/read-entity.tool.d.ts +1 -1
  6. package/dist/agents/graph/tools/read-entity.tool.d.ts.map +1 -1
  7. package/dist/agents/graph/tools/read-entity.tool.js +2 -1
  8. package/dist/agents/graph/tools/read-entity.tool.js.map +1 -1
  9. package/dist/agents/graph/tools/resolve-entity.tool.d.ts +1 -1
  10. package/dist/agents/graph/tools/resolve-entity.tool.d.ts.map +1 -1
  11. package/dist/agents/graph/tools/resolve-entity.tool.js +2 -1
  12. package/dist/agents/graph/tools/resolve-entity.tool.js.map +1 -1
  13. package/dist/agents/graph/tools/search-entities.tool.d.ts +1 -1
  14. package/dist/agents/graph/tools/search-entities.tool.d.ts.map +1 -1
  15. package/dist/agents/graph/tools/search-entities.tool.js +2 -1
  16. package/dist/agents/graph/tools/search-entities.tool.js.map +1 -1
  17. package/dist/agents/graph/tools/traverse.tool.d.ts +1 -1
  18. package/dist/agents/graph/tools/traverse.tool.d.ts.map +1 -1
  19. package/dist/agents/graph/tools/traverse.tool.js +2 -1
  20. package/dist/agents/graph/tools/traverse.tool.js.map +1 -1
  21. package/dist/agents/operator/tools/search-documents.tool.d.ts +1 -1
  22. package/dist/agents/operator/tools/search-documents.tool.d.ts.map +1 -1
  23. package/dist/agents/operator/tools/search-documents.tool.js +2 -1
  24. package/dist/agents/operator/tools/search-documents.tool.js.map +1 -1
  25. package/dist/bootstrap/app.module.factory.d.ts.map +1 -1
  26. package/dist/bootstrap/app.module.factory.js +3 -0
  27. package/dist/bootstrap/app.module.factory.js.map +1 -1
  28. package/dist/bootstrap/bootstrap.options.d.ts +2 -0
  29. package/dist/bootstrap/bootstrap.options.d.ts.map +1 -1
  30. package/dist/config/base.config.d.ts.map +1 -1
  31. package/dist/config/base.config.js +15 -0
  32. package/dist/config/base.config.js.map +1 -1
  33. package/dist/config/interfaces/base.config.interface.d.ts +2 -0
  34. package/dist/config/interfaces/base.config.interface.d.ts.map +1 -1
  35. package/dist/config/interfaces/config.ai.interface.d.ts +29 -0
  36. package/dist/config/interfaces/config.ai.interface.d.ts.map +1 -1
  37. package/dist/config/interfaces/config.mcp.interface.d.ts +34 -0
  38. package/dist/config/interfaces/config.mcp.interface.d.ts.map +1 -0
  39. package/dist/config/interfaces/config.mcp.interface.js +3 -0
  40. package/dist/config/interfaces/config.mcp.interface.js.map +1 -0
  41. package/dist/config/interfaces/index.d.ts +1 -0
  42. package/dist/config/interfaces/index.d.ts.map +1 -1
  43. package/dist/config/interfaces/index.js +1 -0
  44. package/dist/config/interfaces/index.js.map +1 -1
  45. package/dist/core/llm/services/llm.service.d.ts +52 -0
  46. package/dist/core/llm/services/llm.service.d.ts.map +1 -1
  47. package/dist/core/llm/services/llm.service.js +163 -10
  48. package/dist/core/llm/services/llm.service.js.map +1 -1
  49. package/dist/core/llm/services/model.service.d.ts +2 -0
  50. package/dist/core/llm/services/model.service.d.ts.map +1 -1
  51. package/dist/core/llm/services/model.service.js +7 -0
  52. package/dist/core/llm/services/model.service.js.map +1 -1
  53. package/dist/foundations/oauth/constants/oauth.scopes.d.ts +2 -0
  54. package/dist/foundations/oauth/constants/oauth.scopes.d.ts.map +1 -1
  55. package/dist/foundations/oauth/constants/oauth.scopes.js +4 -0
  56. package/dist/foundations/oauth/constants/oauth.scopes.js.map +1 -1
  57. package/dist/foundations/oauth/controllers/index.d.ts +2 -0
  58. package/dist/foundations/oauth/controllers/index.d.ts.map +1 -1
  59. package/dist/foundations/oauth/controllers/index.js +2 -0
  60. package/dist/foundations/oauth/controllers/index.js.map +1 -1
  61. package/dist/foundations/oauth/controllers/oauth.discovery.controller.d.ts +46 -0
  62. package/dist/foundations/oauth/controllers/oauth.discovery.controller.d.ts.map +1 -0
  63. package/dist/foundations/oauth/controllers/oauth.discovery.controller.js +102 -0
  64. package/dist/foundations/oauth/controllers/oauth.discovery.controller.js.map +1 -0
  65. package/dist/foundations/oauth/controllers/oauth.registration.controller.d.ts +36 -0
  66. package/dist/foundations/oauth/controllers/oauth.registration.controller.d.ts.map +1 -0
  67. package/dist/foundations/oauth/controllers/oauth.registration.controller.js +81 -0
  68. package/dist/foundations/oauth/controllers/oauth.registration.controller.js.map +1 -0
  69. package/dist/foundations/oauth/dtos/index.d.ts +1 -0
  70. package/dist/foundations/oauth/dtos/index.d.ts.map +1 -1
  71. package/dist/foundations/oauth/dtos/index.js +1 -0
  72. package/dist/foundations/oauth/dtos/index.js.map +1 -1
  73. package/dist/foundations/oauth/dtos/oauth.register.dto.d.ts +14 -0
  74. package/dist/foundations/oauth/dtos/oauth.register.dto.d.ts.map +1 -0
  75. package/dist/foundations/oauth/dtos/oauth.register.dto.js +49 -0
  76. package/dist/foundations/oauth/dtos/oauth.register.dto.js.map +1 -0
  77. package/dist/foundations/oauth/index.d.ts +1 -0
  78. package/dist/foundations/oauth/index.d.ts.map +1 -1
  79. package/dist/foundations/oauth/index.js +3 -1
  80. package/dist/foundations/oauth/index.js.map +1 -1
  81. package/dist/foundations/oauth/oauth.module.d.ts +3 -1
  82. package/dist/foundations/oauth/oauth.module.d.ts.map +1 -1
  83. package/dist/foundations/oauth/oauth.module.js +12 -2
  84. package/dist/foundations/oauth/oauth.module.js.map +1 -1
  85. package/dist/foundations/oauth/repositories/oauth.repository.d.ts +2 -1
  86. package/dist/foundations/oauth/repositories/oauth.repository.d.ts.map +1 -1
  87. package/dist/foundations/oauth/repositories/oauth.repository.js +16 -34
  88. package/dist/foundations/oauth/repositories/oauth.repository.js.map +1 -1
  89. package/dist/foundations/oauth/services/oauth.client.service.d.ts +2 -1
  90. package/dist/foundations/oauth/services/oauth.client.service.d.ts.map +1 -1
  91. package/dist/foundations/oauth/services/oauth.client.service.js.map +1 -1
  92. package/dist/foundations/rbac/index.d.ts +4 -0
  93. package/dist/foundations/rbac/index.d.ts.map +1 -1
  94. package/dist/foundations/rbac/index.js +7 -1
  95. package/dist/foundations/rbac/index.js.map +1 -1
  96. package/dist/foundations/rbac/rbac-permission.module.d.ts +14 -0
  97. package/dist/foundations/rbac/rbac-permission.module.d.ts.map +1 -0
  98. package/dist/foundations/rbac/rbac-permission.module.js +33 -0
  99. package/dist/foundations/rbac/rbac-permission.module.js.map +1 -0
  100. package/dist/foundations/rbac/repositories/rbac-permission.repository.d.ts +31 -0
  101. package/dist/foundations/rbac/repositories/rbac-permission.repository.d.ts.map +1 -0
  102. package/dist/foundations/rbac/repositories/rbac-permission.repository.js +80 -0
  103. package/dist/foundations/rbac/repositories/rbac-permission.repository.js.map +1 -0
  104. package/dist/foundations/rbac/services/rbac-permission.service.d.ts +31 -0
  105. package/dist/foundations/rbac/services/rbac-permission.service.d.ts.map +1 -0
  106. package/dist/foundations/rbac/services/rbac-permission.service.js +41 -0
  107. package/dist/foundations/rbac/services/rbac-permission.service.js.map +1 -0
  108. package/dist/index.d.ts +1 -0
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +2 -0
  111. package/dist/index.js.map +1 -1
  112. package/dist/mcp/controllers/mcp.controller.d.ts +34 -0
  113. package/dist/mcp/controllers/mcp.controller.d.ts.map +1 -0
  114. package/dist/mcp/controllers/mcp.controller.js +108 -0
  115. package/dist/mcp/controllers/mcp.controller.js.map +1 -0
  116. package/dist/mcp/filters/mcp.auth.filter.d.ts +21 -0
  117. package/dist/mcp/filters/mcp.auth.filter.d.ts.map +1 -0
  118. package/dist/mcp/filters/mcp.auth.filter.js +52 -0
  119. package/dist/mcp/filters/mcp.auth.filter.js.map +1 -0
  120. package/dist/mcp/index.d.ts +4 -0
  121. package/dist/mcp/index.d.ts.map +1 -0
  122. package/dist/mcp/index.js +11 -0
  123. package/dist/mcp/index.js.map +1 -0
  124. package/dist/mcp/interfaces/mcp.tool.interface.d.ts +37 -0
  125. package/dist/mcp/interfaces/mcp.tool.interface.d.ts.map +1 -0
  126. package/dist/mcp/interfaces/mcp.tool.interface.js +6 -0
  127. package/dist/mcp/interfaces/mcp.tool.interface.js.map +1 -0
  128. package/dist/mcp/mcp.module.d.ts +23 -0
  129. package/dist/mcp/mcp.module.d.ts.map +1 -0
  130. package/dist/mcp/mcp.module.js +59 -0
  131. package/dist/mcp/mcp.module.js.map +1 -0
  132. package/dist/mcp/services/mcp.entity.write.service.d.ts +79 -0
  133. package/dist/mcp/services/mcp.entity.write.service.d.ts.map +1 -0
  134. package/dist/mcp/services/mcp.entity.write.service.js +270 -0
  135. package/dist/mcp/services/mcp.entity.write.service.js.map +1 -0
  136. package/dist/mcp/services/mcp.errors.d.ts +24 -0
  137. package/dist/mcp/services/mcp.errors.d.ts.map +1 -0
  138. package/dist/mcp/services/mcp.errors.js +50 -0
  139. package/dist/mcp/services/mcp.errors.js.map +1 -0
  140. package/dist/mcp/services/mcp.generic.tools.service.d.ts +26 -0
  141. package/dist/mcp/services/mcp.generic.tools.service.d.ts.map +1 -0
  142. package/dist/mcp/services/mcp.generic.tools.service.js +108 -0
  143. package/dist/mcp/services/mcp.generic.tools.service.js.map +1 -0
  144. package/dist/mcp/services/mcp.promoted.tools.factory.d.ts +58 -0
  145. package/dist/mcp/services/mcp.promoted.tools.factory.d.ts.map +1 -0
  146. package/dist/mcp/services/mcp.promoted.tools.factory.js +260 -0
  147. package/dist/mcp/services/mcp.promoted.tools.factory.js.map +1 -0
  148. package/dist/mcp/services/mcp.server.factory.d.ts +24 -0
  149. package/dist/mcp/services/mcp.server.factory.d.ts.map +1 -0
  150. package/dist/mcp/services/mcp.server.factory.js +60 -0
  151. package/dist/mcp/services/mcp.server.factory.js.map +1 -0
  152. package/dist/mcp/services/mcp.tool.registry.d.ts +21 -0
  153. package/dist/mcp/services/mcp.tool.registry.d.ts.map +1 -0
  154. package/dist/mcp/services/mcp.tool.registry.js +72 -0
  155. package/dist/mcp/services/mcp.tool.registry.js.map +1 -0
  156. package/package.json +17 -12
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.McpGenericToolsService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const zod_1 = require("zod");
15
+ const describe_entity_tool_1 = require("../../agents/graph/tools/describe-entity.tool");
16
+ const read_entity_tool_1 = require("../../agents/graph/tools/read-entity.tool");
17
+ const resolve_entity_tool_1 = require("../../agents/graph/tools/resolve-entity.tool");
18
+ const search_entities_tool_1 = require("../../agents/graph/tools/search-entities.tool");
19
+ const traverse_tool_1 = require("../../agents/graph/tools/traverse.tool");
20
+ const search_documents_tool_1 = require("../../agents/operator/tools/search-documents.tool");
21
+ const mcp_errors_1 = require("./mcp.errors");
22
+ const mcp_entity_write_service_1 = require("./mcp.entity.write.service");
23
+ // Descriptions copied verbatim from each tool's build() (single source is the
24
+ // DynamicStructuredTool literal in the tool file; not exportable without
25
+ // restructuring those files beyond the schema-export-only change).
26
+ const DESCRIBE_DESCRIPTION = "Returns the described fields and relationships for an entity type.";
27
+ const RESOLVE_DESCRIPTION = "Resolve a user-named entity across every visible type. Returns ranked candidates from the highest-confidence tier that yielded any match anywhere. Use this before search_entities / read_entity / traverse whenever the user refers to a named record.";
28
+ const SEARCH_DESCRIPTION = "Find records of a known type by filter and sort. Use this when you already have the type (from resolve_entity or because the user referred to a kind of record without identifying a specific one). To look up a specific record by its label, call resolve_entity first.";
29
+ const READ_DESCRIPTION = "Fetches one record by id, optionally pulling related records across described relationships.";
30
+ const TRAVERSE_DESCRIPTION = "Walks a relationship from a known record to related records, optionally filtered and sorted.";
31
+ const SEARCH_DOCS_DESCRIPTION = "Search the company's documents (GraphRAG) for information relevant to a question. Returns the retrieved passages, each prefixed by its chunkId.";
32
+ /**
33
+ * Builds the generic MCP tool set for one authenticated request:
34
+ * the five graph read tools, the document-retrieval tool, and the four
35
+ * entity write tools contributed by McpEntityWriteService.
36
+ */
37
+ let McpGenericToolsService = class McpGenericToolsService {
38
+ constructor(resolveEntityTool, describeEntityTool, searchEntitiesTool, readEntityTool, traverseTool, searchDocumentsTool, writeService) {
39
+ this.resolveEntityTool = resolveEntityTool;
40
+ this.describeEntityTool = describeEntityTool;
41
+ this.searchEntitiesTool = searchEntitiesTool;
42
+ this.readEntityTool = readEntityTool;
43
+ this.traverseTool = traverseTool;
44
+ this.searchDocumentsTool = searchDocumentsTool;
45
+ this.writeService = writeService;
46
+ }
47
+ /** Builds the per-request generic tool definitions (read tools + write tools). */
48
+ build(ctx) {
49
+ const recorder = [];
50
+ // The graph tools enforce a describe-first contract via the recorder. That
51
+ // works in the operator, where one recorder spans a whole LangGraph turn —
52
+ // but MCP is stateless: every tools/call gets a fresh recorder, so a prior
53
+ // describe_entity call can never be seen and the contract would loop
54
+ // forever. Seed the recorder with the requested type instead (same
55
+ // approach as McpPromotedToolsFactory); the schema stays discoverable
56
+ // through the describe_entity MCP tool itself.
57
+ const seedDescribe = (type) => {
58
+ if (typeof type === "string" && type.length > 0) {
59
+ recorder.push({ tool: "describe_entity", input: { type }, durationMs: 0 });
60
+ }
61
+ };
62
+ const read = (name, description, schema, invoke, seedType) => ({
63
+ name,
64
+ description,
65
+ inputSchema: zod_1.z.toJSONSchema(schema),
66
+ readOnly: true,
67
+ execute: async (input) => {
68
+ try {
69
+ const parsed = schema.parse(input);
70
+ if (seedType)
71
+ seedDescribe(seedType(parsed));
72
+ const result = await invoke(parsed);
73
+ return {
74
+ content: [{ type: "text", text: typeof result === "string" ? result : JSON.stringify(result) }],
75
+ };
76
+ }
77
+ catch (e) {
78
+ return (0, mcp_errors_1.mcpError)(e);
79
+ }
80
+ },
81
+ });
82
+ return [
83
+ read("describe_entity", DESCRIBE_DESCRIPTION, describe_entity_tool_1.describeEntityInputSchema, (i) => this.describeEntityTool.invoke(i, ctx, recorder)),
84
+ read("resolve_entity", RESOLVE_DESCRIPTION, resolve_entity_tool_1.resolveEntityInputSchema, (i) => this.resolveEntityTool.invoke(i, ctx, recorder)),
85
+ read("search_entities", SEARCH_DESCRIPTION, search_entities_tool_1.searchEntitiesInputSchema, (i) => this.searchEntitiesTool.invoke(i, ctx, recorder), (parsed) => parsed.type),
86
+ read("read_entity", READ_DESCRIPTION, read_entity_tool_1.readEntityInputSchema, (i) => this.readEntityTool.invoke(i, ctx, recorder), (parsed) => parsed.type),
87
+ read("traverse", TRAVERSE_DESCRIPTION, traverse_tool_1.traverseInputSchema, (i) => this.traverseTool.invoke(i, ctx, recorder), (parsed) => parsed.fromType),
88
+ read("search_documents", SEARCH_DOCS_DESCRIPTION, search_documents_tool_1.searchDocumentsInputSchema, (i) =>
89
+ // SearchDocumentsTool needs an OperatorRetrievalContext; MCP has no
90
+ // conversation, so dataLimits defaults to {} (all fields optional)
91
+ // and messages to [] — the documented fallback.
92
+ this.searchDocumentsTool.invoke(i, { ...ctx, dataLimits: {}, messages: [] }, recorder)),
93
+ ...this.writeService.buildTools(ctx),
94
+ ];
95
+ }
96
+ };
97
+ exports.McpGenericToolsService = McpGenericToolsService;
98
+ exports.McpGenericToolsService = McpGenericToolsService = __decorate([
99
+ (0, common_1.Injectable)(),
100
+ __metadata("design:paramtypes", [resolve_entity_tool_1.ResolveEntityTool,
101
+ describe_entity_tool_1.DescribeEntityTool,
102
+ search_entities_tool_1.SearchEntitiesTool,
103
+ read_entity_tool_1.ReadEntityTool,
104
+ traverse_tool_1.TraverseTool,
105
+ search_documents_tool_1.SearchDocumentsTool,
106
+ mcp_entity_write_service_1.McpEntityWriteService])
107
+ ], McpGenericToolsService);
108
+ //# sourceMappingURL=mcp.generic.tools.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.generic.tools.service.js","sourceRoot":"","sources":["../../../src/mcp/services/mcp.generic.tools.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6BAAwB;AACxB,wFAA8G;AAC9G,gFAAkG;AAClG,sFAA2G;AAC3G,wFAA8G;AAE9G,0EAA2F;AAC3F,6FAAoH;AAEpH,6CAAwC;AACxC,yEAAmE;AAEnE,8EAA8E;AAC9E,yEAAyE;AACzE,mEAAmE;AACnE,MAAM,oBAAoB,GAAG,oEAAoE,CAAC;AAClG,MAAM,mBAAmB,GACvB,yPAAyP,CAAC;AAC5P,MAAM,kBAAkB,GACtB,2QAA2Q,CAAC;AAC9Q,MAAM,gBAAgB,GAAG,8FAA8F,CAAC;AACxH,MAAM,oBAAoB,GACxB,8FAA8F,CAAC;AACjG,MAAM,uBAAuB,GAC3B,iJAAiJ,CAAC;AAEpJ;;;;GAIG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YACmB,iBAAoC,EACpC,kBAAsC,EACtC,kBAAsC,EACtC,cAA8B,EAC9B,YAA0B,EAC1B,mBAAwC,EACxC,YAAmC;QANnC,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,wBAAmB,GAAnB,mBA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AAC,CAAC,EAAE,EAAE;YAClF,oEAAoE;YACpE,mEAAmE;YACnE,gDAAgD;YAChD,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,CACvF;YACD,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC;SACrC,CAAC;IACJ,CAAC;CACF,CAAA;AAvFY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;qCAG2B,uCAAiB;QAChB,yCAAkB;QAClB,yCAAkB;QACtB,iCAAc;QAChB,4BAAY;QACL,2CAAmB;QAC1B,gDAAqB;GAR3C,sBAAsB,CAuFlC"}
@@ -0,0 +1,58 @@
1
+ import { ConfigService } from "@nestjs/config";
2
+ import { GraphCatalogService } from "../../agents/graph/services/graph.catalog.service";
3
+ import { ReadEntityTool } from "../../agents/graph/tools/read-entity.tool";
4
+ import { SearchEntitiesTool } from "../../agents/graph/tools/search-entities.tool";
5
+ import type { McpToolDefinition, McpUserContext } from "../interfaces/mcp.tool.interface";
6
+ import { McpEntityWriteService } from "./mcp.entity.write.service";
7
+ /**
8
+ * Maps an entity-descriptor field (as exposed by the graph catalog) to a JSON
9
+ * Schema property for MCP tool input schemas.
10
+ *
11
+ * Date and datetime fields are advertised as ISO strings on the wire
12
+ * (`format: "date"` / `format: "date-time"`); storage stays native Neo4j
13
+ * `Date`/`DateTime` because writes flow through the standard
14
+ * `AbstractService.createFromDTO`/`putFromDTO` path, which auto-casts —
15
+ * no custom Cypher is involved.
16
+ *
17
+ * Unknown descriptor types fall back to `{ type: "string" }`. The field's
18
+ * catalog description is carried through when present.
19
+ */
20
+ export declare function descriptorFieldToJsonSchema(field: {
21
+ type: string;
22
+ description?: string;
23
+ }): Record<string, unknown>;
24
+ /**
25
+ * Generates dedicated per-entity MCP tools (`search_<type>`, `get_<type>`,
26
+ * `create_<type>`, `update_<type>`) for every JSON:API type listed in
27
+ * `ConfigMcpInterface.promotedEntities`.
28
+ *
29
+ * Types the user cannot access (unknown type or module not granted) are
30
+ * skipped: `GraphCatalogService.getEntityDetail` returns `null` for both
31
+ * cases. Read tools delegate straight to the graph tool classes with the
32
+ * `type` pre-bound; write tools delegate to {@link McpEntityWriteService},
33
+ * which enforces RBAC and attribute validation.
34
+ */
35
+ export declare class McpPromotedToolsFactory {
36
+ private readonly config;
37
+ private readonly catalog;
38
+ private readonly searchTool;
39
+ private readonly readTool;
40
+ private readonly writeService;
41
+ constructor(config: ConfigService, catalog: GraphCatalogService, searchTool: SearchEntitiesTool, readTool: ReadEntityTool, writeService: McpEntityWriteService);
42
+ /**
43
+ * Builds the promoted per-entity tool definitions for the given user
44
+ * context. Returns an empty array when no promoted entities are configured
45
+ * or none are accessible.
46
+ */
47
+ build(ctx: McpUserContext): McpToolDefinition[];
48
+ private buildSearchTool;
49
+ private buildGetTool;
50
+ private buildCreateTool;
51
+ private buildUpdateTool;
52
+ private buildAttributesSchema;
53
+ private buildRelationshipsSchema;
54
+ private entityBlurb;
55
+ private textResult;
56
+ private internalError;
57
+ }
58
+ //# sourceMappingURL=mcp.promoted.tools.factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.promoted.tools.factory.d.ts","sourceRoot":"","sources":["../../../src/mcp/services/mcp.promoted.tools.factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAGnF,OAAO,KAAK,EAAE,iBAAiB,EAAiB,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACzG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuBlH;AAED;;;;;;;;;;GAUG;AACH,qBACa,uBAAuB;IAEhC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAJZ,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,kBAAkB,EAC9B,QAAQ,EAAE,cAAc,EACxB,YAAY,EAAE,qBAAqB;IAGtD;;;;OAIG;IACH,KAAK,CAAC,GAAG,EAAE,cAAc,GAAG,iBAAiB,EAAE;IAyB/C,OAAO,CAAC,eAAe;IAkCvB,OAAO,CAAC,YAAY;IA8BpB,OAAO,CAAC,eAAe;IAyBvB,OAAO,CAAC,eAAe;IAwBvB,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,wBAAwB;IAqBhC,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,aAAa;CAItB"}
@@ -0,0 +1,260 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.McpPromotedToolsFactory = void 0;
13
+ exports.descriptorFieldToJsonSchema = descriptorFieldToJsonSchema;
14
+ const common_1 = require("@nestjs/common");
15
+ const config_1 = require("@nestjs/config");
16
+ const graph_catalog_service_1 = require("../../agents/graph/services/graph.catalog.service");
17
+ const read_entity_tool_1 = require("../../agents/graph/tools/read-entity.tool");
18
+ const search_entities_tool_1 = require("../../agents/graph/tools/search-entities.tool");
19
+ const mcp_entity_write_service_1 = require("./mcp.entity.write.service");
20
+ /**
21
+ * Maps an entity-descriptor field (as exposed by the graph catalog) to a JSON
22
+ * Schema property for MCP tool input schemas.
23
+ *
24
+ * Date and datetime fields are advertised as ISO strings on the wire
25
+ * (`format: "date"` / `format: "date-time"`); storage stays native Neo4j
26
+ * `Date`/`DateTime` because writes flow through the standard
27
+ * `AbstractService.createFromDTO`/`putFromDTO` path, which auto-casts —
28
+ * no custom Cypher is involved.
29
+ *
30
+ * Unknown descriptor types fall back to `{ type: "string" }`. The field's
31
+ * catalog description is carried through when present.
32
+ */
33
+ function descriptorFieldToJsonSchema(field) {
34
+ let base;
35
+ switch (field.type) {
36
+ case "string":
37
+ base = { type: "string" };
38
+ break;
39
+ case "number":
40
+ base = { type: "number" };
41
+ break;
42
+ case "boolean":
43
+ base = { type: "boolean" };
44
+ break;
45
+ case "date":
46
+ base = { type: "string", format: "date" };
47
+ break;
48
+ case "datetime":
49
+ base = { type: "string", format: "date-time" };
50
+ break;
51
+ default:
52
+ base = { type: "string" };
53
+ break;
54
+ }
55
+ return field.description ? { ...base, description: field.description } : base;
56
+ }
57
+ /**
58
+ * Generates dedicated per-entity MCP tools (`search_<type>`, `get_<type>`,
59
+ * `create_<type>`, `update_<type>`) for every JSON:API type listed in
60
+ * `ConfigMcpInterface.promotedEntities`.
61
+ *
62
+ * Types the user cannot access (unknown type or module not granted) are
63
+ * skipped: `GraphCatalogService.getEntityDetail` returns `null` for both
64
+ * cases. Read tools delegate straight to the graph tool classes with the
65
+ * `type` pre-bound; write tools delegate to {@link McpEntityWriteService},
66
+ * which enforces RBAC and attribute validation.
67
+ */
68
+ let McpPromotedToolsFactory = class McpPromotedToolsFactory {
69
+ constructor(config, catalog, searchTool, readTool, writeService) {
70
+ this.config = config;
71
+ this.catalog = catalog;
72
+ this.searchTool = searchTool;
73
+ this.readTool = readTool;
74
+ this.writeService = writeService;
75
+ }
76
+ /**
77
+ * Builds the promoted per-entity tool definitions for the given user
78
+ * context. Returns an empty array when no promoted entities are configured
79
+ * or none are accessible.
80
+ */
81
+ build(ctx) {
82
+ const promotedEntities = this.config.get("mcp")?.promotedEntities ?? [];
83
+ if (!promotedEntities.length)
84
+ return [];
85
+ // Shared per-build recorder, pre-seeded with a describe_entity record per
86
+ // promoted type: the graph tools refuse to run before describe_entity has
87
+ // been called, but promoted tools embed the schema in their own
88
+ // inputSchema, so the describe requirement is satisfied by construction.
89
+ const recorder = [];
90
+ const tools = [];
91
+ for (const type of promotedEntities) {
92
+ const entity = this.catalog.getEntityDetail(type, ctx.userModuleIds);
93
+ if (!entity)
94
+ continue;
95
+ recorder.push({ tool: "describe_entity", input: { type: entity.type }, durationMs: 0 });
96
+ tools.push(this.buildSearchTool(entity, ctx, recorder), this.buildGetTool(entity, ctx, recorder), this.buildCreateTool(entity, ctx), this.buildUpdateTool(entity, ctx));
97
+ }
98
+ return tools;
99
+ }
100
+ buildSearchTool(entity, ctx, recorder) {
101
+ const filterableFields = entity.fields.filter((f) => f.filterable).map((f) => f.name);
102
+ const sortableFields = entity.fields.filter((f) => f.sortable).map((f) => f.name);
103
+ return {
104
+ name: `search_${entity.type}`,
105
+ description: `Find ${entity.type} records by filter and sort.${this.entityBlurb(entity)}`,
106
+ inputSchema: {
107
+ type: "object",
108
+ properties: {
109
+ filters: {
110
+ description: `Optional filter array: [{ field, op, value }]. Filterable fields: [${filterableFields.join(", ")}]. Operators: eq, ne, in, like (strings), gt, gte, lt, lte (numbers/dates), isNull, isNotNull.`,
111
+ },
112
+ sort: {
113
+ description: `Optional sort array: [{ field, direction: "asc" | "desc" }]. Sortable fields: [${sortableFields.join(", ")}].`,
114
+ },
115
+ limit: {
116
+ type: "integer",
117
+ description: "Maximum number of records to return (default 10, max 50).",
118
+ },
119
+ },
120
+ additionalProperties: false,
121
+ },
122
+ readOnly: true,
123
+ execute: async (input) => {
124
+ try {
125
+ const result = await this.searchTool.invoke({ ...input, type: entity.type }, ctx, recorder);
126
+ return this.textResult(result);
127
+ }
128
+ catch (e) {
129
+ return this.internalError(e);
130
+ }
131
+ },
132
+ };
133
+ }
134
+ buildGetTool(entity, ctx, recorder) {
135
+ const relationshipNames = entity.relationships.map((r) => r.name);
136
+ return {
137
+ name: `get_${entity.type}`,
138
+ description: `Fetch one ${entity.type} record by id, optionally pulling one-hop related records.${this.entityBlurb(entity)}`,
139
+ inputSchema: {
140
+ type: "object",
141
+ properties: {
142
+ id: { type: "string", description: `The id of the ${entity.type} record.` },
143
+ include: {
144
+ type: "array",
145
+ items: { type: "string" },
146
+ description: `Relationship names to pull one-hop related records. Available: [${relationshipNames.join(", ")}].`,
147
+ },
148
+ },
149
+ required: ["id"],
150
+ additionalProperties: false,
151
+ },
152
+ readOnly: true,
153
+ execute: async (input) => {
154
+ try {
155
+ const result = await this.readTool.invoke({ ...input, type: entity.type }, ctx, recorder);
156
+ return this.textResult(result);
157
+ }
158
+ catch (e) {
159
+ return this.internalError(e);
160
+ }
161
+ },
162
+ };
163
+ }
164
+ buildCreateTool(entity, ctx) {
165
+ const relationshipNames = entity.relationships.map((r) => r.name);
166
+ return {
167
+ name: `create_${entity.type}`,
168
+ description: `Create a new ${entity.type} record.${this.entityBlurb(entity)} All attributes are optional in the schema; call describe_entity("${entity.type}") for field semantics.`,
169
+ inputSchema: {
170
+ type: "object",
171
+ properties: {
172
+ attributes: this.buildAttributesSchema(entity),
173
+ relationships: this.buildRelationshipsSchema(relationshipNames),
174
+ },
175
+ required: ["attributes"],
176
+ additionalProperties: false,
177
+ },
178
+ readOnly: false,
179
+ execute: async (input) => {
180
+ try {
181
+ return await this.writeService.createEntity({ ...input, type: entity.type }, ctx);
182
+ }
183
+ catch (e) {
184
+ return this.internalError(e);
185
+ }
186
+ },
187
+ };
188
+ }
189
+ buildUpdateTool(entity, ctx) {
190
+ return {
191
+ name: `update_${entity.type}`,
192
+ description: `Update a ${entity.type} record by id.${this.entityBlurb(entity)} PUT semantics: replaces all attributes. Read the record first and send every field back.`,
193
+ inputSchema: {
194
+ type: "object",
195
+ properties: {
196
+ id: { type: "string", description: `The id of the ${entity.type} record to update.` },
197
+ attributes: this.buildAttributesSchema(entity),
198
+ },
199
+ required: ["id", "attributes"],
200
+ additionalProperties: false,
201
+ },
202
+ readOnly: false,
203
+ execute: async (input) => {
204
+ try {
205
+ return await this.writeService.updateEntity({ ...input, type: entity.type }, ctx);
206
+ }
207
+ catch (e) {
208
+ return this.internalError(e);
209
+ }
210
+ },
211
+ };
212
+ }
213
+ buildAttributesSchema(entity) {
214
+ const properties = {};
215
+ for (const field of entity.fields) {
216
+ properties[field.name] = descriptorFieldToJsonSchema(field);
217
+ }
218
+ return { type: "object", properties, additionalProperties: false };
219
+ }
220
+ buildRelationshipsSchema(relationshipNames) {
221
+ return {
222
+ type: "object",
223
+ description: `Optional relationships keyed by name. Available: [${relationshipNames.join(", ")}]. Each value is { data: [{ type, id }] }.`,
224
+ additionalProperties: {
225
+ type: "object",
226
+ properties: {
227
+ data: {
228
+ type: "array",
229
+ items: {
230
+ type: "object",
231
+ properties: { type: { type: "string" }, id: { type: "string" } },
232
+ required: ["type", "id"],
233
+ },
234
+ },
235
+ },
236
+ required: ["data"],
237
+ },
238
+ };
239
+ }
240
+ entityBlurb(entity) {
241
+ return entity.description ? ` ${entity.description}.` : "";
242
+ }
243
+ textResult(result) {
244
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
245
+ }
246
+ internalError(e) {
247
+ const message = e instanceof Error ? e.message : "Unexpected error";
248
+ return { isError: true, content: [{ type: "text", text: JSON.stringify({ code: "internal", message }) }] };
249
+ }
250
+ };
251
+ exports.McpPromotedToolsFactory = McpPromotedToolsFactory;
252
+ exports.McpPromotedToolsFactory = McpPromotedToolsFactory = __decorate([
253
+ (0, common_1.Injectable)(),
254
+ __metadata("design:paramtypes", [config_1.ConfigService,
255
+ graph_catalog_service_1.GraphCatalogService,
256
+ search_entities_tool_1.SearchEntitiesTool,
257
+ read_entity_tool_1.ReadEntityTool,
258
+ mcp_entity_write_service_1.McpEntityWriteService])
259
+ ], McpPromotedToolsFactory);
260
+ //# sourceMappingURL=mcp.promoted.tools.factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.promoted.tools.factory.js","sourceRoot":"","sources":["../../../src/mcp/services/mcp.promoted.tools.factory.ts"],"names":[],"mappings":";;;;;;;;;;;;AAwBA,kEAuBC;AA/CD,2CAA4C;AAC5C,2CAA+C;AAE/C,6FAAwF;AACxF,gFAA2E;AAC3E,wFAAmF;AAInF,yEAAmE;AAEnE;;;;;;;;;;;;GAYG;AACH,SAAgB,2BAA2B,CAAC,KAA6C;IACvF,IAAI,IAA6B,CAAC;IAClC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,QAAQ;YACX,IAAI,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;YAC1B,MAAM;QACR,KAAK,QAAQ;YACX,IAAI,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;YAC1B,MAAM;QACR,KAAK,SAAS;YACZ,IAAI,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;YAC3B,MAAM;QACR,KAAK,MAAM;YACT,IAAI,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;YAC1C,MAAM;QACR,KAAK,UAAU;YACb,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AY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC;QACpE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAC7G,CAAC;CACF,CAAA;AAjMY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;qCAGgB,sBAAa;QACZ,2CAAmB;QAChB,yCAAkB;QACpB,iCAAc;QACV,gDAAqB;GAN3C,uBAAuB,CAiMnC"}
@@ -0,0 +1,24 @@
1
+ import { ConfigService } from "@nestjs/config";
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { McpUserContext } from "../interfaces/mcp.tool.interface";
4
+ import { McpToolRegistry } from "./mcp.tool.registry";
5
+ /**
6
+ * Builds a per-request, stateless MCP protocol server.
7
+ *
8
+ * Uses the SDK's low-level `Server` (NOT `McpServer`) so tool input schemas
9
+ * stay plain JSON Schema objects produced by the tool layer. Each authenticated
10
+ * request gets its own Server instance bound to that user's context, so
11
+ * tools/list and tools/call are always RBAC-filtered through McpToolRegistry.
12
+ */
13
+ export declare class McpServerFactory {
14
+ private readonly configService;
15
+ private readonly registry;
16
+ constructor(configService: ConfigService, registry: McpToolRegistry);
17
+ /**
18
+ * Creates a stateless MCP Server for one authenticated request.
19
+ * Registers tools/list (with `annotations.readOnlyHint` derived from each
20
+ * tool's `readOnly` flag) and tools/call (dispatched through the registry).
21
+ */
22
+ create(ctx: McpUserContext): Server;
23
+ }
24
+ //# sourceMappingURL=mcp.server.factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.server.factory.d.ts","sourceRoot":"","sources":["../../../src/mcp/services/mcp.server.factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGnE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;;;;;GAOG;AACH,qBACa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADR,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,eAAe;IAG5C;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM;CA2BpC"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.McpServerFactory = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const config_1 = require("@nestjs/config");
15
+ const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
16
+ const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
17
+ const mcp_tool_registry_1 = require("./mcp.tool.registry");
18
+ /**
19
+ * Builds a per-request, stateless MCP protocol server.
20
+ *
21
+ * Uses the SDK's low-level `Server` (NOT `McpServer`) so tool input schemas
22
+ * stay plain JSON Schema objects produced by the tool layer. Each authenticated
23
+ * request gets its own Server instance bound to that user's context, so
24
+ * tools/list and tools/call are always RBAC-filtered through McpToolRegistry.
25
+ */
26
+ let McpServerFactory = class McpServerFactory {
27
+ constructor(configService, registry) {
28
+ this.configService = configService;
29
+ this.registry = registry;
30
+ }
31
+ /**
32
+ * Creates a stateless MCP Server for one authenticated request.
33
+ * Registers tools/list (with `annotations.readOnlyHint` derived from each
34
+ * tool's `readOnly` flag) and tools/call (dispatched through the registry).
35
+ */
36
+ create(ctx) {
37
+ const mcp = this.configService.get("mcp");
38
+ const server = new index_js_1.Server({ name: mcp?.serverName ?? "neural-erp", version: "1.0.0" }, { capabilities: { tools: {} }, instructions: mcp?.instructions });
39
+ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
40
+ tools: this.registry.build(ctx).map((tool) => ({
41
+ name: tool.name,
42
+ description: tool.description,
43
+ inputSchema: tool.inputSchema,
44
+ annotations: { readOnlyHint: tool.readOnly },
45
+ })),
46
+ }));
47
+ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
48
+ const result = await this.registry.call(request.params.name, (request.params.arguments ?? {}), ctx);
49
+ return { content: result.content, ...(result.isError !== undefined ? { isError: result.isError } : {}) };
50
+ });
51
+ return server;
52
+ }
53
+ };
54
+ exports.McpServerFactory = McpServerFactory;
55
+ exports.McpServerFactory = McpServerFactory = __decorate([
56
+ (0, common_1.Injectable)(),
57
+ __metadata("design:paramtypes", [config_1.ConfigService,
58
+ mcp_tool_registry_1.McpToolRegistry])
59
+ ], McpServerFactory);
60
+ //# sourceMappingURL=mcp.server.factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.server.factory.js","sourceRoot":"","sources":["../../../src/mcp/services/mcp.server.factory.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,2CAA+C;AAC/C,wEAAmE;AACnE,iEAAmH;AAGnH,2DAAsD;AAEtD;;;;;;;GAOG;AAEI,IAAM,gBAAgB,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AAC,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC3G,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;AAtCY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAGuB,sBAAa;QAClB,mCAAe;GAHjC,gBAAgB,CAsC5B"}
@@ -0,0 +1,21 @@
1
+ import { McpToolContribution, McpToolDefinition, McpToolResult, McpUserContext } from "../interfaces/mcp.tool.interface";
2
+ import { McpGenericToolsService } from "./mcp.generic.tools.service";
3
+ import { McpPromotedToolsFactory } from "./mcp.promoted.tools.factory";
4
+ /**
5
+ * Composes the MCP tool set for a single authenticated request:
6
+ * - the generic tools (graph reads, document retrieval, entity writes)
7
+ * - the config-promoted per-entity tools
8
+ * - any app-contributed factories registered under the MCP_TOOLS token,
9
+ * built per request with the same user context as the built-ins
10
+ */
11
+ export declare class McpToolRegistry {
12
+ private readonly generic;
13
+ private readonly promoted;
14
+ private readonly contributed?;
15
+ constructor(generic: McpGenericToolsService, promoted: McpPromotedToolsFactory, contributed?: McpToolContribution[]);
16
+ /** RBAC-filtered tool list for this user; throws on duplicate tool names. */
17
+ build(ctx: McpUserContext): McpToolDefinition[];
18
+ /** Routes a tools/call to the named tool; unknown names return a flat error payload. */
19
+ call(name: string, input: Record<string, unknown>, ctx: McpUserContext): Promise<McpToolResult>;
20
+ }
21
+ //# sourceMappingURL=mcp.tool.registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.tool.registry.d.ts","sourceRoot":"","sources":["../../../src/mcp/services/mcp.tool.registry.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE;;;;;;GAMG;AACH,qBACa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACM,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAF3C,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,uBAAuB,EACF,WAAW,CAAC,EAAE,mBAAmB,EAAE;IAGrF,6EAA6E;IAC7E,KAAK,CAAC,GAAG,EAAE,cAAc,GAAG,iBAAiB,EAAE;IAsB/C,wFAAwF;IAClF,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAUtG"}