noverload-mcp 0.6.0 → 0.7.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 (125) hide show
  1. package/dist/client.d.ts +8 -0
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +77 -0
  4. package/dist/client.js.map +1 -1
  5. package/dist/llm-instructions.d.ts +87 -0
  6. package/dist/llm-instructions.d.ts.map +1 -0
  7. package/dist/llm-instructions.js +257 -0
  8. package/dist/llm-instructions.js.map +1 -0
  9. package/dist/tools/helpers/connections.d.ts +7 -0
  10. package/dist/tools/helpers/connections.d.ts.map +1 -0
  11. package/dist/tools/helpers/connections.js +85 -0
  12. package/dist/tools/helpers/connections.js.map +1 -0
  13. package/dist/tools/helpers/content-processing.d.ts +7 -0
  14. package/dist/tools/helpers/content-processing.d.ts.map +1 -0
  15. package/dist/tools/helpers/content-processing.js +136 -0
  16. package/dist/tools/helpers/content-processing.js.map +1 -0
  17. package/dist/tools/helpers/insights.d.ts +2 -0
  18. package/dist/tools/helpers/insights.d.ts.map +1 -0
  19. package/dist/tools/helpers/insights.js +62 -0
  20. package/dist/tools/helpers/insights.js.map +1 -0
  21. package/dist/tools/implementations/actions.d.ts +4 -0
  22. package/dist/tools/implementations/actions.d.ts.map +1 -0
  23. package/dist/tools/implementations/actions.js +73 -0
  24. package/dist/tools/implementations/actions.js.map +1 -0
  25. package/dist/tools/implementations/batch-get.d.ts +3 -0
  26. package/dist/tools/implementations/batch-get.d.ts.map +1 -0
  27. package/dist/tools/implementations/batch-get.js +102 -0
  28. package/dist/tools/implementations/batch-get.js.map +1 -0
  29. package/dist/tools/implementations/build-narrative.d.ts +3 -0
  30. package/dist/tools/implementations/build-narrative.d.ts.map +1 -0
  31. package/dist/tools/implementations/build-narrative.js +352 -0
  32. package/dist/tools/implementations/build-narrative.js.map +1 -0
  33. package/dist/tools/implementations/estimate-tokens.d.ts +3 -0
  34. package/dist/tools/implementations/estimate-tokens.d.ts.map +1 -0
  35. package/dist/tools/implementations/estimate-tokens.js +54 -0
  36. package/dist/tools/implementations/estimate-tokens.js.map +1 -0
  37. package/dist/tools/implementations/expand-search.d.ts +3 -0
  38. package/dist/tools/implementations/expand-search.d.ts.map +1 -0
  39. package/dist/tools/implementations/expand-search.js +223 -0
  40. package/dist/tools/implementations/expand-search.js.map +1 -0
  41. package/dist/tools/implementations/explore-topic.d.ts +3 -0
  42. package/dist/tools/implementations/explore-topic.d.ts.map +1 -0
  43. package/dist/tools/implementations/explore-topic.js +137 -0
  44. package/dist/tools/implementations/explore-topic.js.map +1 -0
  45. package/dist/tools/implementations/extract-frameworks.d.ts +3 -0
  46. package/dist/tools/implementations/extract-frameworks.d.ts.map +1 -0
  47. package/dist/tools/implementations/extract-frameworks.js +192 -0
  48. package/dist/tools/implementations/extract-frameworks.js.map +1 -0
  49. package/dist/tools/implementations/extract-insights.d.ts +3 -0
  50. package/dist/tools/implementations/extract-insights.d.ts.map +1 -0
  51. package/dist/tools/implementations/extract-insights.js +130 -0
  52. package/dist/tools/implementations/extract-insights.js.map +1 -0
  53. package/dist/tools/implementations/find-connections.d.ts +3 -0
  54. package/dist/tools/implementations/find-connections.d.ts.map +1 -0
  55. package/dist/tools/implementations/find-connections.js +106 -0
  56. package/dist/tools/implementations/find-connections.js.map +1 -0
  57. package/dist/tools/implementations/find-examples.d.ts +3 -0
  58. package/dist/tools/implementations/find-examples.d.ts.map +1 -0
  59. package/dist/tools/implementations/find-examples.js +242 -0
  60. package/dist/tools/implementations/find-examples.js.map +1 -0
  61. package/dist/tools/implementations/get-content.d.ts +3 -0
  62. package/dist/tools/implementations/get-content.d.ts.map +1 -0
  63. package/dist/tools/implementations/get-content.js +96 -0
  64. package/dist/tools/implementations/get-content.js.map +1 -0
  65. package/dist/tools/implementations/goals.d.ts +3 -0
  66. package/dist/tools/implementations/goals.d.ts.map +1 -0
  67. package/dist/tools/implementations/goals.js +22 -0
  68. package/dist/tools/implementations/goals.js.map +1 -0
  69. package/dist/tools/implementations/instructions.d.ts +3 -0
  70. package/dist/tools/implementations/instructions.d.ts.map +1 -0
  71. package/dist/tools/implementations/instructions.js +88 -0
  72. package/dist/tools/implementations/instructions.js.map +1 -0
  73. package/dist/tools/implementations/knowledge-graph.d.ts +3 -0
  74. package/dist/tools/implementations/knowledge-graph.d.ts.map +1 -0
  75. package/dist/tools/implementations/knowledge-graph.js +278 -0
  76. package/dist/tools/implementations/knowledge-graph.js.map +1 -0
  77. package/dist/tools/implementations/list-content.d.ts +3 -0
  78. package/dist/tools/implementations/list-content.d.ts.map +1 -0
  79. package/dist/tools/implementations/list-content.js +87 -0
  80. package/dist/tools/implementations/list-content.js.map +1 -0
  81. package/dist/tools/implementations/plan-query.d.ts +3 -0
  82. package/dist/tools/implementations/plan-query.d.ts.map +1 -0
  83. package/dist/tools/implementations/plan-query.js +63 -0
  84. package/dist/tools/implementations/plan-query.js.map +1 -0
  85. package/dist/tools/implementations/raw-content.d.ts +3 -0
  86. package/dist/tools/implementations/raw-content.d.ts.map +1 -0
  87. package/dist/tools/implementations/raw-content.js +208 -0
  88. package/dist/tools/implementations/raw-content.js.map +1 -0
  89. package/dist/tools/implementations/save-content.d.ts +3 -0
  90. package/dist/tools/implementations/save-content.d.ts.map +1 -0
  91. package/dist/tools/implementations/save-content.js +33 -0
  92. package/dist/tools/implementations/save-content.js.map +1 -0
  93. package/dist/tools/implementations/search.d.ts +3 -0
  94. package/dist/tools/implementations/search.d.ts.map +1 -0
  95. package/dist/tools/implementations/search.js +245 -0
  96. package/dist/tools/implementations/search.js.map +1 -0
  97. package/dist/tools/implementations/similar-content.d.ts +3 -0
  98. package/dist/tools/implementations/similar-content.d.ts.map +1 -0
  99. package/dist/tools/implementations/similar-content.js +64 -0
  100. package/dist/tools/implementations/similar-content.js.map +1 -0
  101. package/dist/tools/implementations/smart-sections.d.ts +3 -0
  102. package/dist/tools/implementations/smart-sections.d.ts.map +1 -0
  103. package/dist/tools/implementations/smart-sections.js +347 -0
  104. package/dist/tools/implementations/smart-sections.js.map +1 -0
  105. package/dist/tools/implementations/synthesize.d.ts +3 -0
  106. package/dist/tools/implementations/synthesize.d.ts.map +1 -0
  107. package/dist/tools/implementations/synthesize.js +148 -0
  108. package/dist/tools/implementations/synthesize.js.map +1 -0
  109. package/dist/tools/implementations/timeline.d.ts +3 -0
  110. package/dist/tools/implementations/timeline.d.ts.map +1 -0
  111. package/dist/tools/implementations/timeline.js +191 -0
  112. package/dist/tools/implementations/timeline.js.map +1 -0
  113. package/dist/tools/index-old.d.ts +16 -0
  114. package/dist/tools/index-old.d.ts.map +1 -0
  115. package/dist/tools/index-old.js +2176 -0
  116. package/dist/tools/index-old.js.map +1 -0
  117. package/dist/tools/index.d.ts +25 -14
  118. package/dist/tools/index.d.ts.map +1 -1
  119. package/dist/tools/index.js +57 -1079
  120. package/dist/tools/index.js.map +1 -1
  121. package/dist/tools/types.d.ts +22 -0
  122. package/dist/tools/types.d.ts.map +1 -0
  123. package/dist/tools/types.js +2 -0
  124. package/dist/tools/types.js.map +1 -0
  125. package/package.json +5 -5
@@ -0,0 +1,347 @@
1
+ import { z } from "zod";
2
+ const inputSchema = z.object({
3
+ contentId: z.string().describe("ID of the content to section"),
4
+ query: z.string().optional().describe("Optional: Extract specific section matching this query"),
5
+ maxSections: z.number().optional().default(10).describe("Maximum number of sections to return"),
6
+ sectionType: z.enum(["all", "introduction", "methods", "results", "examples", "conclusion", "code", "steps"])
7
+ .optional()
8
+ .default("all")
9
+ .describe("Type of sections to extract"),
10
+ });
11
+ // Pattern definitions for different section types
12
+ const SECTION_PATTERNS = {
13
+ introduction: {
14
+ patterns: [
15
+ /^#+\s*(introduction|intro|overview|background|abstract)/im,
16
+ /^(In this (article|post|guide|tutorial|video|document))/im,
17
+ /^(This (article|post|guide|tutorial) (covers|explains|discusses))/im,
18
+ ],
19
+ keywords: ["introduction", "overview", "background", "summary", "abstract", "preface"]
20
+ },
21
+ methods: {
22
+ patterns: [
23
+ /^#+\s*(method|methodology|approach|implementation|how to|steps)/im,
24
+ /^(Step \d+[:.])/im,
25
+ /^(\d+\.\s+)/m,
26
+ ],
27
+ keywords: ["method", "approach", "process", "procedure", "technique", "algorithm"]
28
+ },
29
+ results: {
30
+ patterns: [
31
+ /^#+\s*(results?|findings?|outcomes?|performance|metrics)/im,
32
+ /(achieved|reached|resulted in|showed|demonstrated)/i,
33
+ ],
34
+ keywords: ["results", "findings", "outcomes", "performance", "metrics", "data"]
35
+ },
36
+ examples: {
37
+ patterns: [
38
+ /^#+\s*(examples?|case stud|use cases?|scenarios?|demonstrations?)/im,
39
+ /(for example|for instance|such as|consider|let's say)/i,
40
+ ],
41
+ keywords: ["example", "case", "instance", "scenario", "demonstration", "illustration"]
42
+ },
43
+ conclusion: {
44
+ patterns: [
45
+ /^#+\s*(conclusion|summary|final thoughts|takeaways?|wrap.?up)/im,
46
+ /^(In conclusion|To conclude|In summary|To sum up)/im,
47
+ ],
48
+ keywords: ["conclusion", "summary", "takeaway", "final", "closing", "recap"]
49
+ },
50
+ code: {
51
+ patterns: [
52
+ /```[\s\S]*?```/g,
53
+ /^```(\w+)?\n([\s\S]*?)^```/gm,
54
+ ],
55
+ keywords: ["code", "snippet", "implementation", "function", "class", "script"]
56
+ },
57
+ steps: {
58
+ patterns: [
59
+ /^(Step \d+[:.])/im,
60
+ /^(\d+\.\s+)/m,
61
+ /^(First|Second|Third|Next|Then|Finally|Lastly)/im,
62
+ ],
63
+ keywords: ["step", "phase", "stage", "instruction", "direction", "procedure"]
64
+ }
65
+ };
66
+ function detectSections(content, sectionType) {
67
+ const sections = [];
68
+ const lines = content.split('\n');
69
+ // Try to detect natural boundaries
70
+ let currentSection = null;
71
+ let sectionId = 0;
72
+ for (let i = 0; i < lines.length; i++) {
73
+ const line = lines[i];
74
+ const linePosition = lines.slice(0, i).join('\n').length;
75
+ // Check for headers (markdown style)
76
+ const headerMatch = line.match(/^(#{1,6})\s+(.+)/);
77
+ if (headerMatch) {
78
+ // Save previous section if exists
79
+ if (currentSection && currentSection.content) {
80
+ sections.push(currentSection);
81
+ }
82
+ // Start new section
83
+ currentSection = {
84
+ id: `section-${++sectionId}`,
85
+ type: detectSectionType(headerMatch[2]),
86
+ title: headerMatch[2],
87
+ content: "",
88
+ startPosition: linePosition,
89
+ endPosition: linePosition,
90
+ tokenCount: 0,
91
+ metadata: {}
92
+ };
93
+ continue;
94
+ }
95
+ // Check for numbered lists as potential steps
96
+ const numberedMatch = line.match(/^(\d+)\.\s+(.+)/);
97
+ if (numberedMatch && (sectionType === "all" || sectionType === "steps")) {
98
+ if (!currentSection || currentSection.type !== "steps") {
99
+ if (currentSection && currentSection.content) {
100
+ sections.push(currentSection);
101
+ }
102
+ currentSection = {
103
+ id: `section-${++sectionId}`,
104
+ type: "steps",
105
+ title: "Steps",
106
+ content: "",
107
+ startPosition: linePosition,
108
+ endPosition: linePosition,
109
+ tokenCount: 0,
110
+ metadata: { hasSteps: true }
111
+ };
112
+ }
113
+ }
114
+ // Add content to current section
115
+ if (currentSection) {
116
+ currentSection.content += line + '\n';
117
+ currentSection.endPosition = linePosition + line.length;
118
+ }
119
+ else if (sections.length === 0) {
120
+ // Create initial section if no headers found yet
121
+ currentSection = {
122
+ id: `section-${++sectionId}`,
123
+ type: "introduction",
124
+ title: "Content",
125
+ content: line + '\n',
126
+ startPosition: 0,
127
+ endPosition: line.length,
128
+ tokenCount: 0,
129
+ metadata: {}
130
+ };
131
+ }
132
+ }
133
+ // Don't forget the last section
134
+ if (currentSection && currentSection.content) {
135
+ sections.push(currentSection);
136
+ }
137
+ // Calculate token counts and detect metadata
138
+ for (const section of sections) {
139
+ section.tokenCount = Math.ceil(section.content.length / 4); // Rough estimate
140
+ // Detect metadata
141
+ section.metadata = {
142
+ hasCode: /```[\s\S]*?```/.test(section.content),
143
+ hasSteps: /^(\d+\.\s+|Step \d+)/m.test(section.content),
144
+ hasExamples: /(example|instance|such as|for instance)/i.test(section.content),
145
+ keyTopics: extractKeyTopics(section.content)
146
+ };
147
+ }
148
+ return sections;
149
+ }
150
+ function detectSectionType(title) {
151
+ const titleLower = title.toLowerCase();
152
+ for (const [type, config] of Object.entries(SECTION_PATTERNS)) {
153
+ for (const keyword of config.keywords) {
154
+ if (titleLower.includes(keyword)) {
155
+ return type;
156
+ }
157
+ }
158
+ }
159
+ return "content";
160
+ }
161
+ function extractKeyTopics(content) {
162
+ // Simple topic extraction based on capitalized phrases and repeated terms
163
+ const topics = new Set();
164
+ // Find capitalized phrases (potential topics)
165
+ const capitalizedPhrases = content.match(/[A-Z][a-z]+(?:\s+[A-Z][a-z]+)*/g);
166
+ if (capitalizedPhrases) {
167
+ capitalizedPhrases.forEach(phrase => {
168
+ if (phrase.length > 3 && !phrase.match(/^(The|This|That|These|Those|A|An)$/)) {
169
+ topics.add(phrase);
170
+ }
171
+ });
172
+ }
173
+ return Array.from(topics).slice(0, 5);
174
+ }
175
+ function findSectionByQuery(sections, query) {
176
+ const queryLower = query.toLowerCase();
177
+ const queryWords = queryLower.split(/\s+/);
178
+ // Score each section based on query relevance
179
+ const scoredSections = sections.map(section => {
180
+ let score = 0;
181
+ const sectionLower = (section.title + ' ' + section.content).toLowerCase();
182
+ // Check for exact phrase match
183
+ if (sectionLower.includes(queryLower)) {
184
+ score += 10;
185
+ }
186
+ // Check for individual word matches
187
+ for (const word of queryWords) {
188
+ if (sectionLower.includes(word)) {
189
+ score += 2;
190
+ }
191
+ }
192
+ // Bonus for title matches
193
+ if (section.title.toLowerCase().includes(queryLower)) {
194
+ score += 5;
195
+ }
196
+ return { section, score };
197
+ });
198
+ // Sort by score and return top matches
199
+ return scoredSections
200
+ .filter(s => s.score > 0)
201
+ .sort((a, b) => b.score - a.score)
202
+ .map(s => ({ ...s.section, relevance: s.score }));
203
+ }
204
+ export const smartSectionsTool = {
205
+ name: "noverload_smart_sections",
206
+ description: "Extract and navigate specific sections from large documents. Finds natural content boundaries, identifies section types, and retrieves specific parts by semantic meaning.",
207
+ inputSchema: inputSchema.strict(),
208
+ modifies: false,
209
+ handler: async (client, args) => {
210
+ const input = inputSchema.parse(args);
211
+ try {
212
+ // Get the content
213
+ const content = await client.getContent(input.contentId);
214
+ if (!content) {
215
+ return {
216
+ content: [
217
+ {
218
+ type: "text",
219
+ text: `❌ Content not found with ID: ${input.contentId}`
220
+ }
221
+ ],
222
+ error: true
223
+ };
224
+ }
225
+ // Get the raw text for sectioning
226
+ const rawText = content.rawText || "";
227
+ if (!rawText) {
228
+ return {
229
+ content: [
230
+ {
231
+ type: "text",
232
+ text: `⚠️ No text content available for sectioning in this item.`
233
+ }
234
+ ],
235
+ data: {
236
+ contentId: input.contentId,
237
+ sections: []
238
+ }
239
+ };
240
+ }
241
+ // Detect sections
242
+ let sections = detectSections(rawText, input.sectionType);
243
+ // Filter by type if specified
244
+ if (input.sectionType !== "all") {
245
+ sections = sections.filter(s => s.type === input.sectionType);
246
+ }
247
+ // Find specific sections by query if provided
248
+ if (input.query) {
249
+ sections = findSectionByQuery(sections, input.query);
250
+ }
251
+ // Limit sections
252
+ sections = sections.slice(0, input.maxSections);
253
+ // Format response
254
+ let responseText = `📑 **Content Sections**\n\n`;
255
+ responseText += `*${content.title || "Untitled"}*\n`;
256
+ const icon = content.contentType === 'youtube' ? '📺' :
257
+ content.contentType === 'x_twitter' ? '𝕏' :
258
+ content.contentType === 'reddit' ? '🟠' :
259
+ content.contentType === 'pdf' ? '📄' : '📖';
260
+ responseText += `${icon} [View Original](${content.url})\n\n`;
261
+ if (input.query) {
262
+ responseText += `🔍 Searching for: "${input.query}"\n\n`;
263
+ }
264
+ responseText += `Found ${sections.length} section${sections.length !== 1 ? 's' : ''}:\n\n`;
265
+ // Display sections
266
+ for (const section of sections) {
267
+ const sectionIcon = section.type === 'introduction' ? '📝' :
268
+ section.type === 'methods' ? '⚙️' :
269
+ section.type === 'results' ? '📊' :
270
+ section.type === 'examples' ? '💡' :
271
+ section.type === 'conclusion' ? '🎯' :
272
+ section.type === 'code' ? '💻' :
273
+ section.type === 'steps' ? '📋' : '📄';
274
+ responseText += `## ${sectionIcon} ${section.title}\n`;
275
+ responseText += `*Type: ${section.type} | ~${section.tokenCount} tokens*\n`;
276
+ if (section.relevance) {
277
+ responseText += `*Relevance: ${section.relevance}/20*\n`;
278
+ }
279
+ // Add metadata badges
280
+ if (section.metadata) {
281
+ const badges = [];
282
+ if (section.metadata.hasCode)
283
+ badges.push("Has Code");
284
+ if (section.metadata.hasSteps)
285
+ badges.push("Has Steps");
286
+ if (section.metadata.hasExamples)
287
+ badges.push("Has Examples");
288
+ if (badges.length > 0) {
289
+ responseText += `*Features: ${badges.join(" | ")}*\n`;
290
+ }
291
+ if (section.metadata.keyTopics && section.metadata.keyTopics.length > 0) {
292
+ responseText += `*Topics: ${section.metadata.keyTopics.join(", ")}*\n`;
293
+ }
294
+ }
295
+ responseText += `\n`;
296
+ // Show content preview (first 500 chars)
297
+ const preview = section.content.substring(0, 500);
298
+ responseText += `${preview}${section.content.length > 500 ? '...' : ''}\n\n`;
299
+ responseText += `---\n\n`;
300
+ }
301
+ // Add summary
302
+ responseText += `**📊 Summary:**\n`;
303
+ responseText += `- Total sections: ${sections.length}\n`;
304
+ responseText += `- Total tokens: ~${sections.reduce((sum, s) => sum + s.tokenCount, 0)}\n`;
305
+ const sectionTypes = [...new Set(sections.map(s => s.type))];
306
+ responseText += `- Section types: ${sectionTypes.join(", ")}\n`;
307
+ if (sections.length === 0 && input.query) {
308
+ responseText += `\n💡 **Tip:** Try a broader search term or browse all sections without a query.`;
309
+ }
310
+ return {
311
+ content: [
312
+ {
313
+ type: "text",
314
+ text: responseText
315
+ }
316
+ ],
317
+ data: {
318
+ contentId: input.contentId,
319
+ contentTitle: content.title,
320
+ sections: sections.map(s => ({
321
+ id: s.id,
322
+ type: s.type,
323
+ title: s.title,
324
+ tokenCount: s.tokenCount,
325
+ relevance: s.relevance,
326
+ metadata: s.metadata
327
+ })),
328
+ totalSections: sections.length,
329
+ query: input.query
330
+ }
331
+ };
332
+ }
333
+ catch (error) {
334
+ console.error("Smart sections error:", error);
335
+ return {
336
+ content: [
337
+ {
338
+ type: "text",
339
+ text: `❌ Error extracting sections: ${error instanceof Error ? error.message : 'Unknown error'}`
340
+ }
341
+ ],
342
+ error: true
343
+ };
344
+ }
345
+ }
346
+ };
347
+ //# sourceMappingURL=smart-sections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smart-sections.js","sourceRoot":"","sources":["../../../src/tools/implementations/smart-sections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC9D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;IAC/F,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IAC/F,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;SAC1G,QAAQ,EAAE;SACV,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CAAC,6BAA6B,CAAC;CAC3C,CAAC,CAAC;AAmBH,kDAAkD;AAClD,MAAM,gBAAgB,GAAG;IACvB,YAAY,EAAE;QACZ,QAAQ,EAAE;YACR,2DAA2D;YAC3D,2DAA2D;YAC3D,qEAAqE;SACtE;QACD,QAAQ,EAAE,CAAC,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC;KACvF;IACD,OAAO,EAAE;QACP,QAAQ,EAAE;YACR,mEAAmE;YACnE,mB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iFAAiF,CAAC;YACpG,CAAC;YAED,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,YAAY;qBACnB;iBACF;gBACD,IAAI,EAAE;oBACJ,SAAS,EAAE,KAAK,CAAC,SAAS;oBAC1B,YAAY,EAAE,OAAO,CAAC,KAAK;oBAC3B,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;wBAC3B,EAAE,EAAE,CAAC,CAAC,EAAE;wBACR,IAAI,EAAE,CAAC,CAAC,IAAI;wBACZ,KAAK,EAAE,CAAC,CAAC,KAAK;wBACd,UAAU,EAAE,CAAC,CAAC,UAAU;wBACxB,SAAS,EAAE,CAAC,CAAC,SAAS;wBACtB,QAAQ,EAAE,CAAC,CAAC,QAAQ;qBACrB,CAAC,CAAC;oBACH,aAAa,EAAE,QAAQ,CAAC,MAAM;oBAC9B,KAAK,EAAE,KAAK,CAAC,KAAK;iBACnB;aACF,CAAC;QAEJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;YAE9C,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,gCAAgC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE;qBACjG;iBACF;gBACD,KAAK,EAAE,IAAI;aACZ,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tool } from "../types.js";
2
+ export declare const synthesizeContentTool: Tool;
3
+ //# sourceMappingURL=synthesize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../../../src/tools/implementations/synthesize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,eAAO,MAAM,qBAAqB,EAAE,IA6JnC,CAAC"}
@@ -0,0 +1,148 @@
1
+ import { z } from "zod";
2
+ export const synthesizeContentTool = {
3
+ name: "synthesize_content",
4
+ description: "Analyze multiple content sources to generate actionable insights, find patterns, connections, and contradictions. Creates structured synthesis with timeline, next steps, and confidence scores.",
5
+ inputSchema: {
6
+ type: "object",
7
+ properties: {
8
+ query: {
9
+ type: "string",
10
+ description: "Topic or question to synthesize insights about",
11
+ },
12
+ contentIds: {
13
+ type: "array",
14
+ items: {
15
+ type: "string",
16
+ },
17
+ description: "Specific content IDs to analyze (optional, otherwise uses search)",
18
+ },
19
+ synthesisMode: {
20
+ type: "string",
21
+ enum: ["overview", "deep", "actionable", "comparison"],
22
+ description: "Type of synthesis to perform (default: actionable)",
23
+ default: "actionable",
24
+ },
25
+ findContradictions: {
26
+ type: "boolean",
27
+ description: "Look for contradictions between sources",
28
+ default: false,
29
+ },
30
+ findConnections: {
31
+ type: "boolean",
32
+ description: "Find connections and patterns across sources",
33
+ default: true,
34
+ },
35
+ maxSources: {
36
+ type: "number",
37
+ description: "Maximum number of sources to analyze",
38
+ default: 10,
39
+ },
40
+ },
41
+ required: ["query"],
42
+ },
43
+ modifies: false,
44
+ handler: async (client, args) => {
45
+ const schema = z.object({
46
+ query: z.string(),
47
+ contentIds: z.array(z.string()).optional(),
48
+ synthesisMode: z.enum(["overview", "deep", "actionable", "comparison"]).optional().default("actionable"),
49
+ findContradictions: z.boolean().optional().default(false),
50
+ findConnections: z.boolean().optional().default(true),
51
+ maxSources: z.number().optional().default(10),
52
+ });
53
+ const params = schema.parse(args);
54
+ const result = await client.synthesizeContent(params);
55
+ // Handle the API v2 response format
56
+ const synthesis = result.synthesis || result;
57
+ const metadata = result.metadata || {};
58
+ const sources = result.sources || [];
59
+ let responseText = `# 🎯 Synthesis: "${params.query}"\n`;
60
+ responseText += `**Mode:** ${synthesis.mode || params.synthesisMode} | **Sources:** ${metadata.sourceCount || sources.length}`;
61
+ // Add confidence indicator if available
62
+ if (metadata.confidence) {
63
+ const confidenceIcon = metadata.confidence >= 80 ? "🟢" : metadata.confidence >= 60 ? "🟡" : "🔴";
64
+ responseText += ` | **Confidence:** ${confidenceIcon} ${metadata.confidence}%`;
65
+ }
66
+ responseText += `\n\n`;
67
+ // Summary Section
68
+ if (synthesis.summary) {
69
+ responseText += `## 📋 Summary\n${synthesis.summary}\n\n`;
70
+ }
71
+ // Insights Section (most important)
72
+ if (synthesis.insights && synthesis.insights.length > 0) {
73
+ responseText += `## 💡 Key Insights\n`;
74
+ synthesis.insights.forEach((insight, idx) => {
75
+ // Handle both string and object insights
76
+ if (typeof insight === 'string') {
77
+ responseText += `${idx + 1}. ${insight}\n`;
78
+ }
79
+ else if (insight.text) {
80
+ responseText += `${idx + 1}. **${insight.text}**`;
81
+ if (insight.sourceTitle) {
82
+ responseText += ` *(from: ${insight.sourceTitle})*`;
83
+ }
84
+ responseText += `\n`;
85
+ }
86
+ });
87
+ responseText += `\n`;
88
+ }
89
+ // Action Plan (for actionable mode)
90
+ if (synthesis.actionPlan) {
91
+ responseText += `## 🚀 Action Plan\n`;
92
+ if (synthesis.actionPlan.summary) {
93
+ responseText += `${synthesis.actionPlan.summary}\n\n`;
94
+ }
95
+ if (synthesis.actionPlan.nextAction) {
96
+ responseText += `**🎯 Next Action:** ${synthesis.actionPlan.nextAction.action || synthesis.actionPlan.nextAction}\n\n`;
97
+ }
98
+ if (synthesis.actionPlan.steps && synthesis.actionPlan.steps.length > 0) {
99
+ responseText += `### Steps\n`;
100
+ synthesis.actionPlan.steps.forEach((step, idx) => {
101
+ const priorityIcon = step.priority === "high" ? "🔴" : step.priority === "medium" ? "🟡" : "🟢";
102
+ responseText += `${idx + 1}. ${priorityIcon} **${step.action}**`;
103
+ if (step.timeframe) {
104
+ responseText += ` *(${step.timeframe})*`;
105
+ }
106
+ if (step.reasoning) {
107
+ responseText += `\n - Reasoning: ${step.reasoning}`;
108
+ }
109
+ responseText += `\n`;
110
+ });
111
+ }
112
+ responseText += `\n`;
113
+ }
114
+ // Source Information
115
+ if (sources && sources.length > 0) {
116
+ responseText += `## 📚 Sources Analyzed\n`;
117
+ sources.forEach((source, idx) => {
118
+ const typeIcons = {
119
+ youtube: "📺",
120
+ x_twitter: "𝕏",
121
+ reddit: "🔗",
122
+ article: "📄",
123
+ pdf: "📑"
124
+ };
125
+ const typeIcon = typeIcons[source.type] || "📄";
126
+ responseText += `${idx + 1}. ${typeIcon} [${source.title}](${source.url})\n`;
127
+ });
128
+ responseText += `\n`;
129
+ }
130
+ // Metadata Footer
131
+ responseText += `---\n`;
132
+ responseText += `*Analysis completed in ${metadata.executionTime ? `${metadata.executionTime}ms` : 'N/A'}`;
133
+ if (metadata.totalTokens) {
134
+ responseText += ` | Processed ${metadata.totalTokens.toLocaleString()} tokens`;
135
+ }
136
+ responseText += `*\n`;
137
+ return {
138
+ content: [
139
+ {
140
+ type: "text",
141
+ text: responseText,
142
+ },
143
+ ],
144
+ data: result,
145
+ };
146
+ },
147
+ };
148
+ //# sourceMappingURL=synthesize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"synthesize.js","sourceRoot":"","sources":["../../../src/tools/implementations/synthesize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,qBAAqB,GAAS;IACzC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,kMAAkM;IAC/M,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gDAAgD;aAC9D;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,WAAW,EAAE,mEAAmE;aACjF;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,IAAI,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AAC;QAC3G,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC;YACzB,YAAY,IAAI,gBAAgB,QAAQ,CAAC,WAAW,CAAC,cAAc,EAAE,SAAS,CAAC;QACjF,CAAC;QACD,YAAY,IAAI,KAAK,CAAC;QAEtB,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,YAAY;iBACnB;aACF;YACD,IAAI,EAAE,MAAM;SACb,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tool } from "../types.js";
2
+ export declare const getTimelineTool: Tool;
3
+ //# sourceMappingURL=timeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../src/tools/implementations/timeline.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,eAAO,MAAM,eAAe,EAAE,IAuN7B,CAAC"}