keywordgraph-mcp-server 1.6.1

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 (228) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +629 -0
  3. package/bin/infranodus-mcp-server.js +8 -0
  4. package/bin/keywordgraph-mcp-server.js +8 -0
  5. package/bin/mcp-server.js +56 -0
  6. package/dist/api/client.d.ts +3 -0
  7. package/dist/api/client.d.ts.map +1 -0
  8. package/dist/api/client.js +30 -0
  9. package/dist/api/client.js.map +1 -0
  10. package/dist/api/config-store.d.ts +4 -0
  11. package/dist/api/config-store.d.ts.map +1 -0
  12. package/dist/api/config-store.js +12 -0
  13. package/dist/api/config-store.js.map +1 -0
  14. package/dist/auth/oauth-provider.d.ts +56 -0
  15. package/dist/auth/oauth-provider.d.ts.map +1 -0
  16. package/dist/auth/oauth-provider.js +295 -0
  17. package/dist/auth/oauth-provider.js.map +1 -0
  18. package/dist/auth/types.d.ts +93 -0
  19. package/dist/auth/types.d.ts.map +1 -0
  20. package/dist/auth/types.js +5 -0
  21. package/dist/auth/types.js.map +1 -0
  22. package/dist/config/brand.d.ts +58 -0
  23. package/dist/config/brand.d.ts.map +1 -0
  24. package/dist/config/brand.js +97 -0
  25. package/dist/config/brand.js.map +1 -0
  26. package/dist/config/index.d.ts +26 -0
  27. package/dist/config/index.d.ts.map +1 -0
  28. package/dist/config/index.js +20 -0
  29. package/dist/config/index.js.map +1 -0
  30. package/dist/http-server.d.ts +6 -0
  31. package/dist/http-server.d.ts.map +1 -0
  32. package/dist/http-server.js +907 -0
  33. package/dist/http-server.js.map +1 -0
  34. package/dist/index.d.ts +29 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +136 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/instructions.d.ts +11 -0
  39. package/dist/instructions.d.ts.map +1 -0
  40. package/dist/instructions.js +38 -0
  41. package/dist/instructions.js.map +1 -0
  42. package/dist/prompts/index.d.ts +24 -0
  43. package/dist/prompts/index.d.ts.map +1 -0
  44. package/dist/prompts/index.js +394 -0
  45. package/dist/prompts/index.js.map +1 -0
  46. package/dist/resources/about.d.ts +17 -0
  47. package/dist/resources/about.d.ts.map +1 -0
  48. package/dist/resources/about.js +64 -0
  49. package/dist/resources/about.js.map +1 -0
  50. package/dist/resources/llms-txt.d.ts +33 -0
  51. package/dist/resources/llms-txt.d.ts.map +1 -0
  52. package/dist/resources/llms-txt.js +65 -0
  53. package/dist/resources/llms-txt.js.map +1 -0
  54. package/dist/schemas/index.d.ts +1178 -0
  55. package/dist/schemas/index.d.ts.map +1 -0
  56. package/dist/schemas/index.js +1121 -0
  57. package/dist/schemas/index.js.map +1 -0
  58. package/dist/tools/addMemory.d.ts +36 -0
  59. package/dist/tools/addMemory.d.ts.map +1 -0
  60. package/dist/tools/addMemory.js +82 -0
  61. package/dist/tools/addMemory.js.map +1 -0
  62. package/dist/tools/analyzeExistingGraph.d.ts +37 -0
  63. package/dist/tools/analyzeExistingGraph.d.ts.map +1 -0
  64. package/dist/tools/analyzeExistingGraph.js +85 -0
  65. package/dist/tools/analyzeExistingGraph.js.map +1 -0
  66. package/dist/tools/analyzeLlmResults.d.ts +37 -0
  67. package/dist/tools/analyzeLlmResults.d.ts.map +1 -0
  68. package/dist/tools/analyzeLlmResults.js +165 -0
  69. package/dist/tools/analyzeLlmResults.js.map +1 -0
  70. package/dist/tools/analyzeText.d.ts +36 -0
  71. package/dist/tools/analyzeText.d.ts.map +1 -0
  72. package/dist/tools/analyzeText.js +97 -0
  73. package/dist/tools/analyzeText.js.map +1 -0
  74. package/dist/tools/createKnowledgeGraph.d.ts +36 -0
  75. package/dist/tools/createKnowledgeGraph.d.ts.map +1 -0
  76. package/dist/tools/createKnowledgeGraph.js +105 -0
  77. package/dist/tools/createKnowledgeGraph.js.map +1 -0
  78. package/dist/tools/developConceptualBridges.d.ts +34 -0
  79. package/dist/tools/developConceptualBridges.d.ts.map +1 -0
  80. package/dist/tools/developConceptualBridges.js +107 -0
  81. package/dist/tools/developConceptualBridges.js.map +1 -0
  82. package/dist/tools/developLatentConcepts copy.d.ts +27 -0
  83. package/dist/tools/developLatentConcepts copy.d.ts.map +1 -0
  84. package/dist/tools/developLatentConcepts copy.js +68 -0
  85. package/dist/tools/developLatentConcepts copy.js.map +1 -0
  86. package/dist/tools/developLatentConcepts.d.ts +27 -0
  87. package/dist/tools/developLatentConcepts.d.ts.map +1 -0
  88. package/dist/tools/developLatentConcepts.js +68 -0
  89. package/dist/tools/developLatentConcepts.js.map +1 -0
  90. package/dist/tools/developLatentTopics.d.ts +34 -0
  91. package/dist/tools/developLatentTopics.d.ts.map +1 -0
  92. package/dist/tools/developLatentTopics.js +107 -0
  93. package/dist/tools/developLatentTopics.js.map +1 -0
  94. package/dist/tools/developTextTool.d.ts +39 -0
  95. package/dist/tools/developTextTool.d.ts.map +1 -0
  96. package/dist/tools/developTextTool.js +210 -0
  97. package/dist/tools/developTextTool.js.map +1 -0
  98. package/dist/tools/generateContentGaps.d.ts +32 -0
  99. package/dist/tools/generateContentGaps.d.ts.map +1 -0
  100. package/dist/tools/generateContentGaps.js +96 -0
  101. package/dist/tools/generateContentGaps.js.map +1 -0
  102. package/dist/tools/generateContextualHint.d.ts +33 -0
  103. package/dist/tools/generateContextualHint.d.ts.map +1 -0
  104. package/dist/tools/generateContextualHint.js +99 -0
  105. package/dist/tools/generateContextualHint.js.map +1 -0
  106. package/dist/tools/generateDifferenceGraphFromTexts.d.ts +52 -0
  107. package/dist/tools/generateDifferenceGraphFromTexts.d.ts.map +1 -0
  108. package/dist/tools/generateDifferenceGraphFromTexts.js +160 -0
  109. package/dist/tools/generateDifferenceGraphFromTexts.js.map +1 -0
  110. package/dist/tools/generateGoogleResultsVsQueriesGraph.d.ts +37 -0
  111. package/dist/tools/generateGoogleResultsVsQueriesGraph.d.ts.map +1 -0
  112. package/dist/tools/generateGoogleResultsVsQueriesGraph.js +84 -0
  113. package/dist/tools/generateGoogleResultsVsQueriesGraph.js.map +1 -0
  114. package/dist/tools/generateGoogleSearchQueriesGraph.d.ts +39 -0
  115. package/dist/tools/generateGoogleSearchQueriesGraph.d.ts.map +1 -0
  116. package/dist/tools/generateGoogleSearchQueriesGraph.js +88 -0
  117. package/dist/tools/generateGoogleSearchQueriesGraph.js.map +1 -0
  118. package/dist/tools/generateGoogleSearchResultsGraph.d.ts +38 -0
  119. package/dist/tools/generateGoogleSearchResultsGraph.d.ts.map +1 -0
  120. package/dist/tools/generateGoogleSearchResultsGraph.js +88 -0
  121. package/dist/tools/generateGoogleSearchResultsGraph.js.map +1 -0
  122. package/dist/tools/generateKnowledgeGraph.d.ts +35 -0
  123. package/dist/tools/generateKnowledgeGraph.d.ts.map +1 -0
  124. package/dist/tools/generateKnowledgeGraph.js +105 -0
  125. package/dist/tools/generateKnowledgeGraph.js.map +1 -0
  126. package/dist/tools/generateMergedGraphFromTexts.d.ts +52 -0
  127. package/dist/tools/generateMergedGraphFromTexts.d.ts.map +1 -0
  128. package/dist/tools/generateMergedGraphFromTexts.js +160 -0
  129. package/dist/tools/generateMergedGraphFromTexts.js.map +1 -0
  130. package/dist/tools/generateOntologyGraph.d.ts +36 -0
  131. package/dist/tools/generateOntologyGraph.d.ts.map +1 -0
  132. package/dist/tools/generateOntologyGraph.js +171 -0
  133. package/dist/tools/generateOntologyGraph.js.map +1 -0
  134. package/dist/tools/generateOverlapGraphFromTexts.d.ts +52 -0
  135. package/dist/tools/generateOverlapGraphFromTexts.d.ts.map +1 -0
  136. package/dist/tools/generateOverlapGraphFromTexts.js +159 -0
  137. package/dist/tools/generateOverlapGraphFromTexts.js.map +1 -0
  138. package/dist/tools/generateResearchIdeas.d.ts +39 -0
  139. package/dist/tools/generateResearchIdeas.d.ts.map +1 -0
  140. package/dist/tools/generateResearchIdeas.js +117 -0
  141. package/dist/tools/generateResearchIdeas.js.map +1 -0
  142. package/dist/tools/generateResearchQuestions.d.ts +37 -0
  143. package/dist/tools/generateResearchQuestions.d.ts.map +1 -0
  144. package/dist/tools/generateResearchQuestions.js +111 -0
  145. package/dist/tools/generateResearchQuestions.js.map +1 -0
  146. package/dist/tools/generateResearchQuestionsFromGraph.d.ts +34 -0
  147. package/dist/tools/generateResearchQuestionsFromGraph.d.ts.map +1 -0
  148. package/dist/tools/generateResearchQuestionsFromGraph.js +75 -0
  149. package/dist/tools/generateResearchQuestionsFromGraph.js.map +1 -0
  150. package/dist/tools/generateResponses.d.ts +35 -0
  151. package/dist/tools/generateResponses.d.ts.map +1 -0
  152. package/dist/tools/generateResponses.js +112 -0
  153. package/dist/tools/generateResponses.js.map +1 -0
  154. package/dist/tools/generateResponsesFromGraph.d.ts +33 -0
  155. package/dist/tools/generateResponsesFromGraph.d.ts.map +1 -0
  156. package/dist/tools/generateResponsesFromGraph.js +74 -0
  157. package/dist/tools/generateResponsesFromGraph.js.map +1 -0
  158. package/dist/tools/generateSEOGraphTool.d.ts +39 -0
  159. package/dist/tools/generateSEOGraphTool.d.ts.map +1 -0
  160. package/dist/tools/generateSEOGraphTool.js +235 -0
  161. package/dist/tools/generateSEOGraphTool.js.map +1 -0
  162. package/dist/tools/generateTextOverview.d.ts +31 -0
  163. package/dist/tools/generateTextOverview.d.ts.map +1 -0
  164. package/dist/tools/generateTextOverview.js +68 -0
  165. package/dist/tools/generateTextOverview.js.map +1 -0
  166. package/dist/tools/generateTopicalClusters.d.ts +34 -0
  167. package/dist/tools/generateTopicalClusters.d.ts.map +1 -0
  168. package/dist/tools/generateTopicalClusters.js +134 -0
  169. package/dist/tools/generateTopicalClusters.js.map +1 -0
  170. package/dist/tools/getMemory.d.ts +32 -0
  171. package/dist/tools/getMemory.d.ts.map +1 -0
  172. package/dist/tools/getMemory.js +121 -0
  173. package/dist/tools/getMemory.js.map +1 -0
  174. package/dist/tools/index.d.ts +30 -0
  175. package/dist/tools/index.d.ts.map +1 -0
  176. package/dist/tools/index.js +30 -0
  177. package/dist/tools/index.js.map +1 -0
  178. package/dist/tools/listGraphs.d.ts +37 -0
  179. package/dist/tools/listGraphs.d.ts.map +1 -0
  180. package/dist/tools/listGraphs.js +127 -0
  181. package/dist/tools/listGraphs.js.map +1 -0
  182. package/dist/tools/optimizeTextStructure.d.ts +34 -0
  183. package/dist/tools/optimizeTextStructure.d.ts.map +1 -0
  184. package/dist/tools/optimizeTextStructure.js +108 -0
  185. package/dist/tools/optimizeTextStructure.js.map +1 -0
  186. package/dist/tools/retrieveContextForPromptFromGraph.d.ts +37 -0
  187. package/dist/tools/retrieveContextForPromptFromGraph.d.ts.map +1 -0
  188. package/dist/tools/retrieveContextForPromptFromGraph.js +80 -0
  189. package/dist/tools/retrieveContextForPromptFromGraph.js.map +1 -0
  190. package/dist/tools/searchGraph.d.ts +27 -0
  191. package/dist/tools/searchGraph.d.ts.map +1 -0
  192. package/dist/tools/searchGraph.js +57 -0
  193. package/dist/tools/searchGraph.js.map +1 -0
  194. package/dist/tools/searchGraphs.d.ts +33 -0
  195. package/dist/tools/searchGraphs.d.ts.map +1 -0
  196. package/dist/tools/searchGraphs.js +67 -0
  197. package/dist/tools/searchGraphs.js.map +1 -0
  198. package/dist/tools/searchGraphsFetch.d.ts +31 -0
  199. package/dist/tools/searchGraphsFetch.d.ts.map +1 -0
  200. package/dist/tools/searchGraphsFetch.js +78 -0
  201. package/dist/tools/searchGraphsFetch.js.map +1 -0
  202. package/dist/tools/sequentialThinking.d.ts +71 -0
  203. package/dist/tools/sequentialThinking.d.ts.map +1 -0
  204. package/dist/tools/sequentialThinking.js +218 -0
  205. package/dist/tools/sequentialThinking.js.map +1 -0
  206. package/dist/types/index.d.ts +378 -0
  207. package/dist/types/index.d.ts.map +1 -0
  208. package/dist/types/index.js +2 -0
  209. package/dist/types/index.js.map +1 -0
  210. package/dist/utils/progress.d.ts +21 -0
  211. package/dist/utils/progress.d.ts.map +1 -0
  212. package/dist/utils/progress.js +50 -0
  213. package/dist/utils/progress.js.map +1 -0
  214. package/dist/utils/transformers.d.ts +31 -0
  215. package/dist/utils/transformers.d.ts.map +1 -0
  216. package/dist/utils/transformers.js +484 -0
  217. package/dist/utils/transformers.js.map +1 -0
  218. package/dist/utils/urlContent.d.ts +35 -0
  219. package/dist/utils/urlContent.d.ts.map +1 -0
  220. package/dist/utils/urlContent.js +87 -0
  221. package/dist/utils/urlContent.js.map +1 -0
  222. package/llms-full.infranodus.txt +469 -0
  223. package/llms-full.keywordgraph.txt +469 -0
  224. package/llms-full.txt +469 -0
  225. package/llms.infranodus.txt +64 -0
  226. package/llms.keywordgraph.txt +64 -0
  227. package/llms.txt +64 -0
  228. package/package.json +78 -0
@@ -0,0 +1,97 @@
1
+ import { brand } from "../config/brand.js";
2
+ import { AnalyzeTextSchemaBase } from "../schemas/index.js";
3
+ import { makeInfraNodusRequest } from "../api/client.js";
4
+ import { fetchUrlContentAsText } from "../utils/urlContent.js";
5
+ import { transformToStructuredOutput } from "../utils/transformers.js";
6
+ function errorContent(message) {
7
+ return {
8
+ content: [
9
+ { type: "text", text: JSON.stringify({ error: message }) },
10
+ ],
11
+ isError: true,
12
+ };
13
+ }
14
+ export const analyzeTextTool = {
15
+ name: "analyze_text",
16
+ definition: {
17
+ title: "Analyze a Text, URL, or YouTube transcript",
18
+ description: `Extract and analyze a graph from text, URL, YouTube video transcript, or an existing ${brand.name} graph.`,
19
+ inputSchema: AnalyzeTextSchemaBase.shape,
20
+ annotations: {
21
+ readOnlyHint: true,
22
+ idempotentHint: true,
23
+ destructiveHint: false,
24
+ },
25
+ },
26
+ handler: async (params) => {
27
+ try {
28
+ const includeNodesAndEdges = params.addNodesAndEdges;
29
+ const includeGraph = params.includeGraph;
30
+ const buildingEntitiesGraph = params.modifyAnalyzedText == "extractEntitiesOnly" ? true : false;
31
+ const queryParams = new URLSearchParams({
32
+ doNotSave: "true",
33
+ addStats: "true",
34
+ includeStatements: params.includeStatements ? "true" : "false",
35
+ includeGraphSummary: params.includeGraphSummary ? "true" : "false",
36
+ extendedGraphSummary: "true",
37
+ includeGraph: includeGraph || buildingEntitiesGraph ? "true" : "false",
38
+ compactGraph: includeGraph || buildingEntitiesGraph ? "true" : "false",
39
+ compactStatements: params.includeStatements ? "true" : "false",
40
+ aiTopics: "true",
41
+ optimize: "develop",
42
+ });
43
+ const endpoint = `/graphAndStatements?${queryParams.toString()}`;
44
+ let contentText;
45
+ if (params.url) {
46
+ const result = await fetchUrlContentAsText(params.url);
47
+ if (!result.ok)
48
+ return errorContent(result.error);
49
+ contentText = result.contentText;
50
+ if (!contentText?.trim())
51
+ return errorContent("URL did not return any text content");
52
+ }
53
+ else if (params.text?.trim()) {
54
+ contentText = params.text;
55
+ }
56
+ else {
57
+ return errorContent("Provide either text or url for analysis");
58
+ }
59
+ const requestBody = { text: contentText, aiTopics: "true" };
60
+ const response = await makeInfraNodusRequest(endpoint, requestBody);
61
+ if (response.error) {
62
+ return {
63
+ content: [
64
+ {
65
+ type: "text",
66
+ text: JSON.stringify({ error: response.error }),
67
+ },
68
+ ],
69
+ isError: true,
70
+ };
71
+ }
72
+ const structuredOutput = transformToStructuredOutput(response, includeGraph, includeNodesAndEdges, buildingEntitiesGraph);
73
+ return {
74
+ content: [
75
+ {
76
+ type: "text",
77
+ text: JSON.stringify(structuredOutput, null, 2),
78
+ },
79
+ ],
80
+ };
81
+ }
82
+ catch (error) {
83
+ return {
84
+ content: [
85
+ {
86
+ type: "text",
87
+ text: JSON.stringify({
88
+ error: error instanceof Error ? error.message : String(error),
89
+ }),
90
+ },
91
+ ],
92
+ isError: true,
93
+ };
94
+ }
95
+ },
96
+ };
97
+ //# sourceMappingURL=analyzeText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyzeText.js","sourceRoot":"","sources":["../../src/tools/analyzeText.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAqB,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAA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,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;yBAC/C;qBACD;oBACD,OAAO,EAAE,IAAI;iBACb,CAAC;YACH,CAAC;YAED,MAAM,gBAAgB,GAAG,2BAA2B,CACnD,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,CACrB,CAAC;YAEF,OAAO;gBACN,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;qBAC/C;iBACD;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO;gBACN,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACpB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;yBAC7D,CAAC;qBACF;iBACD;gBACD,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { z } from "zod";
2
+ import { CreateGraphSchema } from "../schemas/index.js";
3
+ export declare const createKnowledgeGraphTool: {
4
+ name: string;
5
+ definition: {
6
+ title: string;
7
+ description: string;
8
+ inputSchema: {
9
+ graphName: z.ZodString;
10
+ text: z.ZodOptional<z.ZodString>;
11
+ url: z.ZodOptional<z.ZodString>;
12
+ includeStatements: z.ZodDefault<z.ZodBoolean>;
13
+ includeGraph: z.ZodDefault<z.ZodBoolean>;
14
+ addNodesAndEdges: z.ZodDefault<z.ZodBoolean>;
15
+ modifyAnalyzedText: z.ZodDefault<z.ZodEnum<["none", "detectEntities", "extractEntitiesOnly"]>>;
16
+ };
17
+ annotations: {
18
+ readOnlyHint: boolean;
19
+ idempotentHint: boolean;
20
+ destructiveHint: boolean;
21
+ };
22
+ };
23
+ handler: (params: z.infer<typeof CreateGraphSchema>) => Promise<{
24
+ content: {
25
+ type: "text";
26
+ text: string;
27
+ }[];
28
+ isError: boolean;
29
+ } | {
30
+ content: {
31
+ type: "text";
32
+ text: string;
33
+ }[];
34
+ }>;
35
+ };
36
+ //# sourceMappingURL=createKnowledgeGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createKnowledgeGraph.d.ts","sourceRoot":"","sources":["../../src/tools/createKnowledgeGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAcxD,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;sBAaZ,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC;;;;;;;;;;;;CAwFzD,CAAC"}
@@ -0,0 +1,105 @@
1
+ import { brand } from "../config/brand.js";
2
+ import { CreateGraphSchema } from "../schemas/index.js";
3
+ import { makeInfraNodusRequest } from "../api/client.js";
4
+ import { fetchUrlContentAsText } from "../utils/urlContent.js";
5
+ import { transformToStructuredOutput } from "../utils/transformers.js";
6
+ function errorContent(message) {
7
+ return {
8
+ content: [
9
+ { type: "text", text: JSON.stringify({ error: message }) },
10
+ ],
11
+ isError: true,
12
+ };
13
+ }
14
+ export const createKnowledgeGraphTool = {
15
+ name: "create_knowledge_graph",
16
+ definition: {
17
+ title: `Create a Knowledge Graph in ${brand.name} from Text`,
18
+ description: `Create a knowledge graph in ${brand.name} from text or from a URL, save it, and provide its name and a link to it for future use. `,
19
+ inputSchema: CreateGraphSchema.shape,
20
+ annotations: {
21
+ readOnlyHint: false,
22
+ idempotentHint: false,
23
+ destructiveHint: false,
24
+ },
25
+ },
26
+ handler: async (params) => {
27
+ try {
28
+ let contentText;
29
+ if (params.url) {
30
+ const result = await fetchUrlContentAsText(params.url);
31
+ if (!result.ok)
32
+ return errorContent(result.error);
33
+ contentText = result.contentText;
34
+ if (!contentText?.trim())
35
+ return errorContent("URL did not return any text content");
36
+ }
37
+ else if (params.text?.trim()) {
38
+ contentText = params.text;
39
+ }
40
+ else {
41
+ return errorContent("Provide either url or text for analysis");
42
+ }
43
+ const includeNodesAndEdges = params.addNodesAndEdges;
44
+ const includeGraph = params.includeGraph;
45
+ const buildingEntitiesGraph = params.modifyAnalyzedText == "extractEntitiesOnly" ? true : false;
46
+ // Build query parameters
47
+ const queryParams = new URLSearchParams({
48
+ doNotSave: "false",
49
+ addStats: "true",
50
+ includeStatements: params.includeStatements ? "true" : "false",
51
+ includeGraphSummary: "false",
52
+ extendedGraphSummary: "true",
53
+ includeGraph: includeGraph || buildingEntitiesGraph ? "true" : "false",
54
+ compactGraph: includeGraph || buildingEntitiesGraph ? "true" : "false",
55
+ compactStatements: params.includeStatements ? "true" : "false",
56
+ aiTopics: "true",
57
+ optimize: "develop",
58
+ });
59
+ const endpoint = `/graphAndStatements?${queryParams.toString()}`;
60
+ const requestBody = {
61
+ name: params.graphName,
62
+ text: contentText,
63
+ aiTopics: "true",
64
+ };
65
+ if (params.modifyAnalyzedText && params.modifyAnalyzedText !== "none") {
66
+ requestBody.modifyAnalyzedText = params.modifyAnalyzedText;
67
+ }
68
+ const response = await makeInfraNodusRequest(endpoint, requestBody);
69
+ if (response.error) {
70
+ return {
71
+ content: [
72
+ {
73
+ type: "text",
74
+ text: `Error: ${response.error}`,
75
+ },
76
+ ],
77
+ isError: true,
78
+ };
79
+ }
80
+ const structuredOutput = transformToStructuredOutput(response, includeGraph, includeNodesAndEdges, buildingEntitiesGraph);
81
+ return {
82
+ content: [
83
+ {
84
+ type: "text",
85
+ text: JSON.stringify(structuredOutput, null, 2),
86
+ },
87
+ ],
88
+ };
89
+ }
90
+ catch (error) {
91
+ return {
92
+ content: [
93
+ {
94
+ type: "text",
95
+ text: JSON.stringify({
96
+ error: error instanceof Error ? error.message : String(error),
97
+ }),
98
+ },
99
+ ],
100
+ isError: true,
101
+ };
102
+ }
103
+ },
104
+ };
105
+ //# sourceMappingURL=createKnowledgeGraph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createKnowledgeGraph.js","sourceRoot":"","sources":["../../src/tools/createKnowledgeGraph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEvE,SAAS,YAAY,CAAC,OAAe;IACpC,OAAO;QACN,OAAO,EAAE;YACR,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE;SACnE;QACD,OAAO,EAAE,IAAI;KACb,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACvC,IAAI,EAAE,wBAAwB;IAC9B,UAAU,EAAE;QACX,KAAK,EAAE,+BAA+B,KAAK,CAAC,IAAI,YAAY;QAC5D,WAAW,EACV,+BAA+B,KAAK,CAAC,IAAI,2FAA2F;QACrI,WAAW,EAAE,iBAAiB,CAAC,KAAK;QACpC,WAAW,EAAE;YACZ,YAAY,EAAE,KAAK;YACnB,cAAc,EAAE,KAAK;YACrB,eAAe,EAAE,KAAK;SACtB;KACD;IACD,OAAO,EAAE,KAAK,EAAE,MAAyC,EAAE,EAAE;QAC5D,IAAI,CAAC;YACJ,IAAI,WAAmB,CAAC;YACxB,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;gBAChB,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gB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CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ import { DevelopLatentConceptsSchema } from "../schemas/index.js";
3
+ export declare const developConceptualBridgesTool: {
4
+ name: string;
5
+ definition: {
6
+ title: string;
7
+ description: string;
8
+ inputSchema: {
9
+ text: z.ZodOptional<z.ZodString>;
10
+ url: z.ZodOptional<z.ZodString>;
11
+ graphName: z.ZodOptional<z.ZodString>;
12
+ requestMode: z.ZodDefault<z.ZodEnum<["question", "transcend"]>>;
13
+ modelToUse: z.ZodDefault<z.ZodEnum<["claude-opus-4.6", "claude-sonnet-4.6", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "grok-4.1-fast-non-reasoning", "grok-4.1-fast-reasoning", "gpt-4o", "gpt-4o-mini", "gpt-5.4", "gpt-5.4-mini"]>>;
14
+ };
15
+ annotations: {
16
+ readOnlyHint: boolean;
17
+ idempotentHint: boolean;
18
+ destructiveHint: boolean;
19
+ };
20
+ };
21
+ handler: (params: z.infer<typeof DevelopLatentConceptsSchema>) => Promise<{
22
+ content: {
23
+ type: "text";
24
+ text: string;
25
+ }[];
26
+ isError: boolean;
27
+ } | {
28
+ content: {
29
+ type: "text";
30
+ text: string;
31
+ }[];
32
+ }>;
33
+ };
34
+ //# sourceMappingURL=developConceptualBridges.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"developConceptualBridges.d.ts","sourceRoot":"","sources":["../../src/tools/developConceptualBridges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACN,2BAA2B,EAE3B,MAAM,qBAAqB,CAAC;AAc7B,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;sBAahB,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC;;;;;;;;;;;;CA0FnE,CAAC"}
@@ -0,0 +1,107 @@
1
+ import { DevelopLatentConceptsSchemaBase, } from "../schemas/index.js";
2
+ import { makeInfraNodusRequest } from "../api/client.js";
3
+ import { fetchUrlContentAsText } from "../utils/urlContent.js";
4
+ import { extractLatentConceptsIdeas } from "../utils/transformers.js";
5
+ function errorContent(message) {
6
+ return {
7
+ content: [
8
+ { type: "text", text: JSON.stringify({ error: message }) },
9
+ ],
10
+ isError: true,
11
+ };
12
+ }
13
+ export const developConceptualBridgesTool = {
14
+ name: "develop_conceptual_bridges",
15
+ definition: {
16
+ title: "Develop Conceptual Bridges in Text or Graph",
17
+ description: "Analyze text or an existing graph and get ideas on how to develop conceptual bridges in this text to link it to a broader discourse. Provide either text, url, or graphName.",
18
+ inputSchema: DevelopLatentConceptsSchemaBase.shape,
19
+ annotations: {
20
+ readOnlyHint: true,
21
+ idempotentHint: true,
22
+ destructiveHint: false,
23
+ },
24
+ },
25
+ handler: async (params) => {
26
+ try {
27
+ const queryParams = new URLSearchParams({
28
+ doNotSave: "true",
29
+ addStats: "true",
30
+ optimize: "imagine",
31
+ includeStatements: "false",
32
+ includeGraphSummary: "false",
33
+ extendedGraphSummary: "true",
34
+ includeGraph: "false",
35
+ aiTopics: "true",
36
+ });
37
+ const endpoint = `/graphAndAdvice?${queryParams.toString()}`;
38
+ let requestBody;
39
+ if (params.graphName?.trim()) {
40
+ requestBody = {
41
+ name: params.graphName,
42
+ aiTopics: "true",
43
+ requestMode: params.requestMode ?? "transcend",
44
+ modelToUse: params.modelToUse ?? "gpt-4o",
45
+ };
46
+ }
47
+ else {
48
+ let contentText;
49
+ if (params.url) {
50
+ const result = await fetchUrlContentAsText(params.url);
51
+ if (!result.ok)
52
+ return errorContent(result.error);
53
+ contentText = result.contentText;
54
+ if (!contentText?.trim())
55
+ return errorContent("URL did not return any text content");
56
+ }
57
+ else if (params.text?.trim()) {
58
+ contentText = params.text;
59
+ }
60
+ else {
61
+ return errorContent("Provide either text, url, or graphName for analysis");
62
+ }
63
+ requestBody = {
64
+ text: contentText,
65
+ aiTopics: "true",
66
+ requestMode: params.requestMode ?? "transcend",
67
+ modelToUse: params.modelToUse ?? "gpt-4o",
68
+ };
69
+ }
70
+ const response = await makeInfraNodusRequest(endpoint, requestBody);
71
+ const latentConceptsIdeas = extractLatentConceptsIdeas(response);
72
+ if (response.error) {
73
+ return {
74
+ content: [
75
+ {
76
+ type: "text",
77
+ text: `Error: ${response.error}`,
78
+ },
79
+ ],
80
+ isError: true,
81
+ };
82
+ }
83
+ return {
84
+ content: [
85
+ {
86
+ type: "text",
87
+ text: JSON.stringify(latentConceptsIdeas, null, 2),
88
+ },
89
+ ],
90
+ };
91
+ }
92
+ catch (error) {
93
+ return {
94
+ content: [
95
+ {
96
+ type: "text",
97
+ text: JSON.stringify({
98
+ error: error instanceof Error ? error.message : String(error),
99
+ }),
100
+ },
101
+ ],
102
+ isError: true,
103
+ };
104
+ }
105
+ },
106
+ };
107
+ //# sourceMappingURL=developConceptualBridges.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"developConceptualBridges.js","sourceRoot":"","sources":["../../src/tools/developConceptualBridges.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,+BAA+B,GAC/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,SAAS,YAAY,CAAC,OAAe;IACpC,OAAO;QACN,OAAO,EAAE;YACR,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE;SACnE;QACD,OAAO,EAAE,IAAI;KACb,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC3C,IAAI,EAAE,4BAA4B;IAClC,UAAU,EAAE;QACX,KAAK,EAAE,6CAA6C;QACpD,WAAW,EACV,8KAA8K;QA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QACH,CAAC;IACF,CAAC;CACD,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ import { DevelopLatentConceptsSchema } from "../schemas/index.js";
3
+ export declare const developLatentTopicsTool: {
4
+ name: string;
5
+ definition: {
6
+ title: string;
7
+ description: string;
8
+ inputSchema: {
9
+ text: z.ZodString;
10
+ modelToUse: z.ZodDefault<z.ZodEnum<["claude-opus-4.1", "claude-sonnet-4", "gemini-2.5-flash", "gemini-2.5-flash-lite", "gpt-4o", "gpt-4o-mini", "gpt-5", "gpt-5-mini"]>>;
11
+ };
12
+ };
13
+ handler: (params: z.infer<typeof DevelopLatentConceptsSchema>) => Promise<{
14
+ content: {
15
+ type: "text";
16
+ text: string;
17
+ }[];
18
+ isError: boolean;
19
+ } | {
20
+ content: {
21
+ type: "text";
22
+ text: string;
23
+ }[];
24
+ isError?: undefined;
25
+ }>;
26
+ };
27
+ //# sourceMappingURL=developLatentConcepts%20copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"developLatentConcepts copy.d.ts","sourceRoot":"","sources":["../../src/tools/developLatentConcepts copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAIlE,eAAO,MAAM,uBAAuB;;;;;;;;;;sBAQX,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC;;;;;;;;;;;;;CA6DnE,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { DevelopLatentConceptsSchema } from "../schemas/index.js";
2
+ import { makeInfraNodusRequest } from "../api/client.js";
3
+ import { extractLatentConceptsIdeas } from "../utils/transformers.js";
4
+ export const developLatentTopicsTool = {
5
+ name: "develop_latent_topics",
6
+ definition: {
7
+ title: "Develop Latent Topics in Text",
8
+ description: "Analyze text, extract underdeveloped topics and get an idea on how to develop them",
9
+ inputSchema: DevelopLatentConceptsSchema.shape,
10
+ },
11
+ handler: async (params) => {
12
+ try {
13
+ // Build query parameters
14
+ const queryParams = new URLSearchParams({
15
+ doNotSave: "true",
16
+ addStats: "true",
17
+ optimize: "latent",
18
+ includeStatements: "false",
19
+ includeGraphSummary: "false",
20
+ extendedGraphSummary: "true",
21
+ includeGraph: "false",
22
+ aiTopics: "true",
23
+ });
24
+ const endpoint = `/graphAndAdvice?${queryParams.toString()}`;
25
+ const requestBody = {
26
+ text: params.text,
27
+ aiTopics: "true",
28
+ requestMode: "question",
29
+ modelToUse: params.modelToUse ? params.modelToUse : "gpt-4o",
30
+ };
31
+ const response = await makeInfraNodusRequest(endpoint, requestBody);
32
+ const latentConceptsIdeas = extractLatentConceptsIdeas(response);
33
+ if (response.error) {
34
+ return {
35
+ content: [
36
+ {
37
+ type: "text",
38
+ text: `Error: ${response.error}`,
39
+ },
40
+ ],
41
+ isError: true,
42
+ };
43
+ }
44
+ return {
45
+ content: [
46
+ {
47
+ type: "text",
48
+ text: JSON.stringify(latentConceptsIdeas, null, 2),
49
+ },
50
+ ],
51
+ };
52
+ }
53
+ catch (error) {
54
+ return {
55
+ content: [
56
+ {
57
+ type: "text",
58
+ text: JSON.stringify({
59
+ error: error instanceof Error ? error.message : String(error),
60
+ }),
61
+ },
62
+ ],
63
+ isError: true,
64
+ };
65
+ }
66
+ },
67
+ };
68
+ //# sourceMappingURL=developLatentConcepts%20copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"developLatentConcepts copy.js","sourceRoot":"","sources":["../../src/tools/developLatentConcepts copy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,IAAI,EAAE,uBAAuB;IAC7B,UAAU,EAAE;QACX,KAAK,EAAE,+BAA+B;QAC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D;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO;gBACN,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACpB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;yBAC7D,CAAC;qBACF;iBACD;gBACD,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ import { DevelopLatentConceptsSchema } from "../schemas/index.js";
3
+ export declare const developLatentConceptsTool: {
4
+ name: string;
5
+ definition: {
6
+ title: string;
7
+ description: string;
8
+ inputSchema: {
9
+ text: z.ZodString;
10
+ modelToUse: z.ZodDefault<z.ZodEnum<["claude-opus-4.1", "claude-sonnet-4", "gemini-2.5-flash", "gemini-2.5-flash-lite", "gpt-4o", "gpt-4o-mini", "gpt-5", "gpt-5-mini"]>>;
11
+ };
12
+ };
13
+ handler: (params: z.infer<typeof DevelopLatentConceptsSchema>) => Promise<{
14
+ content: {
15
+ type: "text";
16
+ text: string;
17
+ }[];
18
+ isError: boolean;
19
+ } | {
20
+ content: {
21
+ type: "text";
22
+ text: string;
23
+ }[];
24
+ isError?: undefined;
25
+ }>;
26
+ };
27
+ //# sourceMappingURL=developLatentConcepts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"developLatentConcepts.d.ts","sourceRoot":"","sources":["../../src/tools/developLatentConcepts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAIlE,eAAO,MAAM,yBAAyB;;;;;;;;;;sBAQb,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC;;;;;;;;;;;;;CA6DnE,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { DevelopLatentConceptsSchema } from "../schemas/index.js";
2
+ import { makeInfraNodusRequest } from "../api/client.js";
3
+ import { extractLatentConceptsIdeas } from "../utils/transformers.js";
4
+ export const developLatentConceptsTool = {
5
+ name: "develop_latent_concepts",
6
+ definition: {
7
+ title: "Develop Latent Concepts from Text",
8
+ description: "Analyze text and get ideas on how to develop latent concepts in this text to connect it to a broader discourse",
9
+ inputSchema: DevelopLatentConceptsSchema.shape,
10
+ },
11
+ handler: async (params) => {
12
+ try {
13
+ // Build query parameters
14
+ const queryParams = new URLSearchParams({
15
+ doNotSave: "true",
16
+ addStats: "true",
17
+ optimize: "latent",
18
+ includeStatements: "false",
19
+ includeGraphSummary: "false",
20
+ extendedGraphSummary: "true",
21
+ includeGraph: "false",
22
+ aiTopics: "true",
23
+ });
24
+ const endpoint = `/graphAndAdvice?${queryParams.toString()}`;
25
+ const requestBody = {
26
+ text: params.text,
27
+ aiTopics: "true",
28
+ requestMode: "question",
29
+ modelToUse: params.modelToUse ? params.modelToUse : "gpt-4o",
30
+ };
31
+ const response = await makeInfraNodusRequest(endpoint, requestBody);
32
+ const latentConceptsIdeas = extractLatentConceptsIdeas(response);
33
+ if (response.error) {
34
+ return {
35
+ content: [
36
+ {
37
+ type: "text",
38
+ text: `Error: ${response.error}`,
39
+ },
40
+ ],
41
+ isError: true,
42
+ };
43
+ }
44
+ return {
45
+ content: [
46
+ {
47
+ type: "text",
48
+ text: JSON.stringify(latentConceptsIdeas, null, 2),
49
+ },
50
+ ],
51
+ };
52
+ }
53
+ catch (error) {
54
+ return {
55
+ content: [
56
+ {
57
+ type: "text",
58
+ text: JSON.stringify({
59
+ error: error instanceof Error ? error.message : String(error),
60
+ }),
61
+ },
62
+ ],
63
+ isError: true,
64
+ };
65
+ }
66
+ },
67
+ };
68
+ //# sourceMappingURL=developLatentConcepts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"developLatentConcepts.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AC;gBACpB,OAAO;oBACN,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,UAAU,QAAQ,CAAC,KAAK,EAAE;yBAChC;qBACD;oBACD,OAAO,EAAE,IAAI;iBACb,CAAC;YACH,CAAC;YAED,OAAO;gBACN,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC;qBAClD;iBACD;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO;gBACN,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;4BACpB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;yBAC7D,CAAC;qBACF;iBACD;gBACD,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ import { DevelopLatentConceptsSchema } from "../schemas/index.js";
3
+ export declare const developLatentTopicsTool: {
4
+ name: string;
5
+ definition: {
6
+ title: string;
7
+ description: string;
8
+ inputSchema: {
9
+ text: z.ZodOptional<z.ZodString>;
10
+ url: z.ZodOptional<z.ZodString>;
11
+ graphName: z.ZodOptional<z.ZodString>;
12
+ requestMode: z.ZodDefault<z.ZodEnum<["question", "transcend"]>>;
13
+ modelToUse: z.ZodDefault<z.ZodEnum<["claude-opus-4.6", "claude-sonnet-4.6", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "grok-4.1-fast-non-reasoning", "grok-4.1-fast-reasoning", "gpt-4o", "gpt-4o-mini", "gpt-5.4", "gpt-5.4-mini"]>>;
14
+ };
15
+ annotations: {
16
+ readOnlyHint: boolean;
17
+ idempotentHint: boolean;
18
+ destructiveHint: boolean;
19
+ };
20
+ };
21
+ handler: (params: z.infer<typeof DevelopLatentConceptsSchema>) => Promise<{
22
+ content: {
23
+ type: "text";
24
+ text: string;
25
+ }[];
26
+ isError: boolean;
27
+ } | {
28
+ content: {
29
+ type: "text";
30
+ text: string;
31
+ }[];
32
+ }>;
33
+ };
34
+ //# sourceMappingURL=developLatentTopics.d.ts.map