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.
- package/dist/client.d.ts +8 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +77 -0
- package/dist/client.js.map +1 -1
- package/dist/llm-instructions.d.ts +87 -0
- package/dist/llm-instructions.d.ts.map +1 -0
- package/dist/llm-instructions.js +257 -0
- package/dist/llm-instructions.js.map +1 -0
- package/dist/tools/helpers/connections.d.ts +7 -0
- package/dist/tools/helpers/connections.d.ts.map +1 -0
- package/dist/tools/helpers/connections.js +85 -0
- package/dist/tools/helpers/connections.js.map +1 -0
- package/dist/tools/helpers/content-processing.d.ts +7 -0
- package/dist/tools/helpers/content-processing.d.ts.map +1 -0
- package/dist/tools/helpers/content-processing.js +136 -0
- package/dist/tools/helpers/content-processing.js.map +1 -0
- package/dist/tools/helpers/insights.d.ts +2 -0
- package/dist/tools/helpers/insights.d.ts.map +1 -0
- package/dist/tools/helpers/insights.js +62 -0
- package/dist/tools/helpers/insights.js.map +1 -0
- package/dist/tools/implementations/actions.d.ts +4 -0
- package/dist/tools/implementations/actions.d.ts.map +1 -0
- package/dist/tools/implementations/actions.js +73 -0
- package/dist/tools/implementations/actions.js.map +1 -0
- package/dist/tools/implementations/batch-get.d.ts +3 -0
- package/dist/tools/implementations/batch-get.d.ts.map +1 -0
- package/dist/tools/implementations/batch-get.js +102 -0
- package/dist/tools/implementations/batch-get.js.map +1 -0
- package/dist/tools/implementations/build-narrative.d.ts +3 -0
- package/dist/tools/implementations/build-narrative.d.ts.map +1 -0
- package/dist/tools/implementations/build-narrative.js +352 -0
- package/dist/tools/implementations/build-narrative.js.map +1 -0
- package/dist/tools/implementations/estimate-tokens.d.ts +3 -0
- package/dist/tools/implementations/estimate-tokens.d.ts.map +1 -0
- package/dist/tools/implementations/estimate-tokens.js +54 -0
- package/dist/tools/implementations/estimate-tokens.js.map +1 -0
- package/dist/tools/implementations/expand-search.d.ts +3 -0
- package/dist/tools/implementations/expand-search.d.ts.map +1 -0
- package/dist/tools/implementations/expand-search.js +223 -0
- package/dist/tools/implementations/expand-search.js.map +1 -0
- package/dist/tools/implementations/explore-topic.d.ts +3 -0
- package/dist/tools/implementations/explore-topic.d.ts.map +1 -0
- package/dist/tools/implementations/explore-topic.js +137 -0
- package/dist/tools/implementations/explore-topic.js.map +1 -0
- package/dist/tools/implementations/extract-frameworks.d.ts +3 -0
- package/dist/tools/implementations/extract-frameworks.d.ts.map +1 -0
- package/dist/tools/implementations/extract-frameworks.js +192 -0
- package/dist/tools/implementations/extract-frameworks.js.map +1 -0
- package/dist/tools/implementations/extract-insights.d.ts +3 -0
- package/dist/tools/implementations/extract-insights.d.ts.map +1 -0
- package/dist/tools/implementations/extract-insights.js +130 -0
- package/dist/tools/implementations/extract-insights.js.map +1 -0
- package/dist/tools/implementations/find-connections.d.ts +3 -0
- package/dist/tools/implementations/find-connections.d.ts.map +1 -0
- package/dist/tools/implementations/find-connections.js +106 -0
- package/dist/tools/implementations/find-connections.js.map +1 -0
- package/dist/tools/implementations/find-examples.d.ts +3 -0
- package/dist/tools/implementations/find-examples.d.ts.map +1 -0
- package/dist/tools/implementations/find-examples.js +242 -0
- package/dist/tools/implementations/find-examples.js.map +1 -0
- package/dist/tools/implementations/get-content.d.ts +3 -0
- package/dist/tools/implementations/get-content.d.ts.map +1 -0
- package/dist/tools/implementations/get-content.js +96 -0
- package/dist/tools/implementations/get-content.js.map +1 -0
- package/dist/tools/implementations/goals.d.ts +3 -0
- package/dist/tools/implementations/goals.d.ts.map +1 -0
- package/dist/tools/implementations/goals.js +22 -0
- package/dist/tools/implementations/goals.js.map +1 -0
- package/dist/tools/implementations/instructions.d.ts +3 -0
- package/dist/tools/implementations/instructions.d.ts.map +1 -0
- package/dist/tools/implementations/instructions.js +88 -0
- package/dist/tools/implementations/instructions.js.map +1 -0
- package/dist/tools/implementations/knowledge-graph.d.ts +3 -0
- package/dist/tools/implementations/knowledge-graph.d.ts.map +1 -0
- package/dist/tools/implementations/knowledge-graph.js +278 -0
- package/dist/tools/implementations/knowledge-graph.js.map +1 -0
- package/dist/tools/implementations/list-content.d.ts +3 -0
- package/dist/tools/implementations/list-content.d.ts.map +1 -0
- package/dist/tools/implementations/list-content.js +87 -0
- package/dist/tools/implementations/list-content.js.map +1 -0
- package/dist/tools/implementations/plan-query.d.ts +3 -0
- package/dist/tools/implementations/plan-query.d.ts.map +1 -0
- package/dist/tools/implementations/plan-query.js +63 -0
- package/dist/tools/implementations/plan-query.js.map +1 -0
- package/dist/tools/implementations/raw-content.d.ts +3 -0
- package/dist/tools/implementations/raw-content.d.ts.map +1 -0
- package/dist/tools/implementations/raw-content.js +208 -0
- package/dist/tools/implementations/raw-content.js.map +1 -0
- package/dist/tools/implementations/save-content.d.ts +3 -0
- package/dist/tools/implementations/save-content.d.ts.map +1 -0
- package/dist/tools/implementations/save-content.js +33 -0
- package/dist/tools/implementations/save-content.js.map +1 -0
- package/dist/tools/implementations/search.d.ts +3 -0
- package/dist/tools/implementations/search.d.ts.map +1 -0
- package/dist/tools/implementations/search.js +245 -0
- package/dist/tools/implementations/search.js.map +1 -0
- package/dist/tools/implementations/similar-content.d.ts +3 -0
- package/dist/tools/implementations/similar-content.d.ts.map +1 -0
- package/dist/tools/implementations/similar-content.js +64 -0
- package/dist/tools/implementations/similar-content.js.map +1 -0
- package/dist/tools/implementations/smart-sections.d.ts +3 -0
- package/dist/tools/implementations/smart-sections.d.ts.map +1 -0
- package/dist/tools/implementations/smart-sections.js +347 -0
- package/dist/tools/implementations/smart-sections.js.map +1 -0
- package/dist/tools/implementations/synthesize.d.ts +3 -0
- package/dist/tools/implementations/synthesize.d.ts.map +1 -0
- package/dist/tools/implementations/synthesize.js +148 -0
- package/dist/tools/implementations/synthesize.js.map +1 -0
- package/dist/tools/implementations/timeline.d.ts +3 -0
- package/dist/tools/implementations/timeline.d.ts.map +1 -0
- package/dist/tools/implementations/timeline.js +191 -0
- package/dist/tools/implementations/timeline.js.map +1 -0
- package/dist/tools/index-old.d.ts +16 -0
- package/dist/tools/index-old.d.ts.map +1 -0
- package/dist/tools/index-old.js +2176 -0
- package/dist/tools/index-old.js.map +1 -0
- package/dist/tools/index.d.ts +25 -14
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +57 -1079
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/types.d.ts +22 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const inputSchema = z.object({
|
|
3
|
+
originalQuery: z.string().describe("The original search query that returned few/no results"),
|
|
4
|
+
noResultsFound: z.boolean().optional().default(false).describe("Whether the original search returned no results"),
|
|
5
|
+
context: z.string().optional().describe("Additional context about what the user is looking for"),
|
|
6
|
+
limit: z.number().optional().default(5).describe("Maximum number of expanded queries to return"),
|
|
7
|
+
});
|
|
8
|
+
// Concept mapping for semantic expansion
|
|
9
|
+
const CONCEPT_MAP = {
|
|
10
|
+
// Business & Growth
|
|
11
|
+
"storytelling": ["narrative", "pitch", "story", "presentation", "messaging", "communication", "branding"],
|
|
12
|
+
"growth": ["scaling", "expansion", "increase", "development", "progress", "evolution", "traction"],
|
|
13
|
+
"marketing": ["promotion", "advertising", "branding", "outreach", "campaign", "content", "social media"],
|
|
14
|
+
"sales": ["selling", "revenue", "conversion", "closing", "pipeline", "deals", "customers"],
|
|
15
|
+
"startup": ["founder", "entrepreneur", "venture", "bootstrap", "launch", "MVP", "product-market fit"],
|
|
16
|
+
// Technology
|
|
17
|
+
"ai": ["artificial intelligence", "machine learning", "ML", "deep learning", "neural network", "LLM", "GPT"],
|
|
18
|
+
"framework": ["methodology", "system", "process", "structure", "approach", "model", "pattern"],
|
|
19
|
+
"api": ["interface", "endpoint", "integration", "webhook", "REST", "GraphQL", "service"],
|
|
20
|
+
"database": ["DB", "SQL", "NoSQL", "data storage", "postgres", "mongodb", "schema"],
|
|
21
|
+
// Content & Learning
|
|
22
|
+
"tutorial": ["guide", "how-to", "walkthrough", "instruction", "lesson", "course", "training"],
|
|
23
|
+
"example": ["case study", "instance", "sample", "demonstration", "illustration", "use case", "scenario"],
|
|
24
|
+
"best practices": ["guidelines", "standards", "recommendations", "tips", "advice", "patterns", "conventions"],
|
|
25
|
+
// Strategy & Planning
|
|
26
|
+
"strategy": ["plan", "approach", "tactics", "roadmap", "blueprint", "methodology", "framework"],
|
|
27
|
+
"metrics": ["KPIs", "analytics", "measurements", "data", "statistics", "tracking", "performance"],
|
|
28
|
+
"optimization": ["improvement", "enhancement", "efficiency", "performance", "refinement", "tuning"],
|
|
29
|
+
// Product & Development
|
|
30
|
+
"feature": ["functionality", "capability", "component", "module", "tool", "service", "option"],
|
|
31
|
+
"bug": ["issue", "problem", "error", "defect", "glitch", "fault", "failure"],
|
|
32
|
+
"design": ["UX", "UI", "interface", "layout", "architecture", "structure", "pattern"],
|
|
33
|
+
};
|
|
34
|
+
// Reverse mapping for bidirectional expansion
|
|
35
|
+
const REVERSE_MAP = new Map();
|
|
36
|
+
for (const [key, values] of Object.entries(CONCEPT_MAP)) {
|
|
37
|
+
for (const value of values) {
|
|
38
|
+
if (!REVERSE_MAP.has(value)) {
|
|
39
|
+
REVERSE_MAP.set(value, []);
|
|
40
|
+
}
|
|
41
|
+
REVERSE_MAP.get(value).push(key);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function expandConcepts(query) {
|
|
45
|
+
const queryLower = query.toLowerCase();
|
|
46
|
+
const words = queryLower.split(/\s+/);
|
|
47
|
+
const expandedTerms = new Set();
|
|
48
|
+
// For each word in the query
|
|
49
|
+
for (const word of words) {
|
|
50
|
+
// Check direct mappings
|
|
51
|
+
if (CONCEPT_MAP[word]) {
|
|
52
|
+
CONCEPT_MAP[word].forEach(term => expandedTerms.add(term));
|
|
53
|
+
}
|
|
54
|
+
// Check reverse mappings
|
|
55
|
+
if (REVERSE_MAP.has(word)) {
|
|
56
|
+
REVERSE_MAP.get(word).forEach(term => expandedTerms.add(term));
|
|
57
|
+
}
|
|
58
|
+
// Check if word is part of any concept
|
|
59
|
+
for (const [concept, related] of Object.entries(CONCEPT_MAP)) {
|
|
60
|
+
if (concept.includes(word) || word.includes(concept)) {
|
|
61
|
+
related.forEach(term => expandedTerms.add(term));
|
|
62
|
+
}
|
|
63
|
+
for (const rel of related) {
|
|
64
|
+
if (rel.includes(word) || word.includes(rel)) {
|
|
65
|
+
expandedTerms.add(concept);
|
|
66
|
+
related.forEach(term => expandedTerms.add(term));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Remove original words and return unique expansions
|
|
72
|
+
words.forEach(w => expandedTerms.delete(w));
|
|
73
|
+
return Array.from(expandedTerms);
|
|
74
|
+
}
|
|
75
|
+
function generateRelatedQueries(originalQuery, expansions) {
|
|
76
|
+
const queries = [];
|
|
77
|
+
const words = originalQuery.toLowerCase().split(/\s+/);
|
|
78
|
+
// Replace each word with its expansions
|
|
79
|
+
for (let i = 0; i < words.length; i++) {
|
|
80
|
+
for (const expansion of expansions.slice(0, 3)) { // Limit to top 3 expansions per word
|
|
81
|
+
const newWords = [...words];
|
|
82
|
+
newWords[i] = expansion;
|
|
83
|
+
queries.push(newWords.join(' '));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// Add queries with appended expansions
|
|
87
|
+
for (const expansion of expansions.slice(0, 3)) {
|
|
88
|
+
queries.push(`${originalQuery} ${expansion}`);
|
|
89
|
+
queries.push(`${expansion} ${originalQuery}`);
|
|
90
|
+
}
|
|
91
|
+
// Remove duplicates and original
|
|
92
|
+
return [...new Set(queries)].filter(q => q.toLowerCase() !== originalQuery.toLowerCase());
|
|
93
|
+
}
|
|
94
|
+
export const expandSearchTool = {
|
|
95
|
+
name: "noverload_expand_search",
|
|
96
|
+
description: "Intelligently expand search queries to find related content when original searches return few results. Uses concept mapping and semantic expansion.",
|
|
97
|
+
inputSchema: inputSchema.strict(),
|
|
98
|
+
modifies: false,
|
|
99
|
+
handler: async (client, args) => {
|
|
100
|
+
const input = inputSchema.parse(args);
|
|
101
|
+
try {
|
|
102
|
+
// Step 1: Expand concepts from the original query
|
|
103
|
+
const conceptExpansions = expandConcepts(input.originalQuery);
|
|
104
|
+
// Step 2: Generate related queries
|
|
105
|
+
const expandedQueries = generateRelatedQueries(input.originalQuery, conceptExpansions);
|
|
106
|
+
// Step 3: Determine search strategies based on context
|
|
107
|
+
const strategies = [];
|
|
108
|
+
if (input.noResultsFound) {
|
|
109
|
+
strategies.push("Try broader terms");
|
|
110
|
+
strategies.push("Check for typos or alternative spellings");
|
|
111
|
+
strategies.push("Use category searches instead of specific terms");
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
strategies.push("Add more specific terms");
|
|
115
|
+
strategies.push("Try related concepts");
|
|
116
|
+
strategies.push("Search by content type");
|
|
117
|
+
}
|
|
118
|
+
// Step 4: Generate smart suggestions
|
|
119
|
+
const suggestions = [];
|
|
120
|
+
// Add top expanded queries with rationale
|
|
121
|
+
for (const query of expandedQueries.slice(0, input.limit)) {
|
|
122
|
+
// Determine why this expansion might help
|
|
123
|
+
let rationale = "Related concept that might have relevant content";
|
|
124
|
+
let confidence = "medium";
|
|
125
|
+
// Check if this expansion is a direct concept mapping
|
|
126
|
+
const queryWords = query.toLowerCase().split(/\s+/);
|
|
127
|
+
for (const word of queryWords) {
|
|
128
|
+
if (CONCEPT_MAP[word]) {
|
|
129
|
+
rationale = `Expands to related ${word} concepts`;
|
|
130
|
+
confidence = "high";
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
suggestions.push({ query, rationale, confidence });
|
|
135
|
+
}
|
|
136
|
+
// Step 5: Try to understand intent and add specific suggestions
|
|
137
|
+
const queryLower = input.originalQuery.toLowerCase();
|
|
138
|
+
if (queryLower.includes("how") || queryLower.includes("guide") || queryLower.includes("tutorial")) {
|
|
139
|
+
suggestions.push({
|
|
140
|
+
query: `${input.originalQuery} step by step`,
|
|
141
|
+
rationale: "Looking for instructional content",
|
|
142
|
+
confidence: "high"
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
if (queryLower.includes("example") || queryLower.includes("case")) {
|
|
146
|
+
suggestions.push({
|
|
147
|
+
query: `${input.originalQuery} case study success story`,
|
|
148
|
+
rationale: "Looking for real-world examples",
|
|
149
|
+
confidence: "high"
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
if (queryLower.includes("best") || queryLower.includes("top")) {
|
|
153
|
+
suggestions.push({
|
|
154
|
+
query: `${input.originalQuery} recommendations tips`,
|
|
155
|
+
rationale: "Looking for curated advice",
|
|
156
|
+
confidence: "medium"
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
// Format response
|
|
160
|
+
let responseText = `š **Search Expansion for: "${input.originalQuery}"**\n\n`;
|
|
161
|
+
if (input.noResultsFound) {
|
|
162
|
+
responseText += `ā ļø Original search returned no results. Here are alternative searches:\n\n`;
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
responseText += `š” Expanding your search to find more relevant content:\n\n`;
|
|
166
|
+
}
|
|
167
|
+
// Add expanded concepts
|
|
168
|
+
if (conceptExpansions.length > 0) {
|
|
169
|
+
responseText += `**Related Concepts Found:**\n`;
|
|
170
|
+
responseText += `${conceptExpansions.slice(0, 10).join(', ')}\n\n`;
|
|
171
|
+
}
|
|
172
|
+
// Add suggested queries
|
|
173
|
+
responseText += `**Suggested Searches:**\n\n`;
|
|
174
|
+
for (const suggestion of suggestions.slice(0, input.limit)) {
|
|
175
|
+
const icon = suggestion.confidence === "high" ? "šÆ" :
|
|
176
|
+
suggestion.confidence === "medium" ? "š¹" : "ā½";
|
|
177
|
+
responseText += `${icon} **"${suggestion.query}"**\n`;
|
|
178
|
+
responseText += ` *${suggestion.rationale}*\n\n`;
|
|
179
|
+
}
|
|
180
|
+
// Add search strategies
|
|
181
|
+
responseText += `**Search Strategies:**\n`;
|
|
182
|
+
for (const strategy of strategies) {
|
|
183
|
+
responseText += `- ${strategy}\n`;
|
|
184
|
+
}
|
|
185
|
+
// Add tips
|
|
186
|
+
responseText += `\n**š” Pro Tips:**\n`;
|
|
187
|
+
responseText += `- Use quotes for exact phrases: "${input.originalQuery}"\n`;
|
|
188
|
+
responseText += `- Try content type filters: YouTube, Articles, Reddit\n`;
|
|
189
|
+
responseText += `- Search by tags or categories instead of keywords\n`;
|
|
190
|
+
if (input.context) {
|
|
191
|
+
responseText += `\n**Context considered:** ${input.context}\n`;
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
content: [
|
|
195
|
+
{
|
|
196
|
+
type: "text",
|
|
197
|
+
text: responseText
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
data: {
|
|
201
|
+
originalQuery: input.originalQuery,
|
|
202
|
+
expandedConcepts: conceptExpansions,
|
|
203
|
+
suggestedQueries: suggestions,
|
|
204
|
+
totalExpansions: expandedQueries.length,
|
|
205
|
+
strategies: strategies
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
console.error("Search expansion error:", error);
|
|
211
|
+
return {
|
|
212
|
+
content: [
|
|
213
|
+
{
|
|
214
|
+
type: "text",
|
|
215
|
+
text: `ā Error expanding search: ${error instanceof Error ? error.message : 'Unknown error'}`
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
error: true
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=expand-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expand-search.js","sourceRoot":"","sources":["../../../src/tools/implementations/expand-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,WAA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OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;YAEhD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,6BAA6B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE;qBAC9F;iBACF;gBACD,KAAK,EAAE,IAAI;aACZ,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explore-topic.d.ts","sourceRoot":"","sources":["../../../src/tools/implementations/explore-topic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,eAAO,MAAM,gBAAgB,EAAE,IA6I9B,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const exploreTopicTool = {
|
|
3
|
+
name: "explore_topic",
|
|
4
|
+
description: "Deep exploration of a topic across all saved content. Provides comprehensive understanding with multiple perspectives, evolution over time, and key concepts.",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
topic: {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "The topic to explore comprehensively",
|
|
11
|
+
},
|
|
12
|
+
depth: {
|
|
13
|
+
type: "string",
|
|
14
|
+
enum: ["surface", "comprehensive", "expert"],
|
|
15
|
+
description: "Depth of exploration",
|
|
16
|
+
default: "comprehensive",
|
|
17
|
+
},
|
|
18
|
+
includeTimeline: {
|
|
19
|
+
type: "boolean",
|
|
20
|
+
description: "Include chronological evolution of the topic",
|
|
21
|
+
default: true,
|
|
22
|
+
},
|
|
23
|
+
includeConnections: {
|
|
24
|
+
type: "boolean",
|
|
25
|
+
description: "Find connections to related topics",
|
|
26
|
+
default: true,
|
|
27
|
+
},
|
|
28
|
+
maxSources: {
|
|
29
|
+
type: "number",
|
|
30
|
+
description: "Maximum number of sources to analyze",
|
|
31
|
+
default: 20,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
required: ["topic"],
|
|
35
|
+
},
|
|
36
|
+
modifies: false,
|
|
37
|
+
handler: async (client, args) => {
|
|
38
|
+
const schema = z.object({
|
|
39
|
+
topic: z.string(),
|
|
40
|
+
depth: z.enum(["surface", "comprehensive", "expert"]).optional().default("comprehensive"),
|
|
41
|
+
includeTimeline: z.boolean().optional().default(true),
|
|
42
|
+
includeConnections: z.boolean().optional().default(true),
|
|
43
|
+
maxSources: z.number().optional().default(20),
|
|
44
|
+
});
|
|
45
|
+
const params = schema.parse(args);
|
|
46
|
+
// Search for all content related to the topic
|
|
47
|
+
const searchResults = await client.searchContent(params.topic, {
|
|
48
|
+
limit: params.maxSources,
|
|
49
|
+
enableConceptExpansion: true,
|
|
50
|
+
fuzzyMatch: true,
|
|
51
|
+
});
|
|
52
|
+
if (!searchResults || searchResults.length === 0) {
|
|
53
|
+
return {
|
|
54
|
+
content: [
|
|
55
|
+
{
|
|
56
|
+
type: "text",
|
|
57
|
+
text: `No content found for topic: "${params.topic}". Try saving relevant content first or use a different search term.`,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
data: null,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
// Synthesize the content for deep understanding
|
|
64
|
+
const synthesis = await client.synthesizeContent({
|
|
65
|
+
query: `Comprehensive exploration of ${params.topic}`,
|
|
66
|
+
contentIds: searchResults.slice(0, params.maxSources).map((r) => r.id),
|
|
67
|
+
synthesisMode: params.depth === "expert" ? "deep" : params.depth === "surface" ? "overview" : "actionable",
|
|
68
|
+
findConnections: params.includeConnections,
|
|
69
|
+
findContradictions: true,
|
|
70
|
+
});
|
|
71
|
+
let responseText = `# š Topic Exploration: "${params.topic}"\n`;
|
|
72
|
+
responseText += `**Depth:** ${params.depth} | **Sources Analyzed:** ${searchResults.length}\n\n`;
|
|
73
|
+
// Overview Section
|
|
74
|
+
responseText += `## š Overview\n`;
|
|
75
|
+
if (synthesis.synthesis?.summary) {
|
|
76
|
+
responseText += `${synthesis.synthesis.summary}\n\n`;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
responseText += `Analysis of ${searchResults.length} pieces of content about ${params.topic}.\n\n`;
|
|
80
|
+
}
|
|
81
|
+
// Key Insights
|
|
82
|
+
if (synthesis.synthesis?.insights && synthesis.synthesis.insights.length > 0) {
|
|
83
|
+
responseText += `## š” Key Insights\n`;
|
|
84
|
+
synthesis.synthesis.insights.slice(0, 10).forEach((insight, idx) => {
|
|
85
|
+
const text = typeof insight === 'string' ? insight : insight.text;
|
|
86
|
+
responseText += `${idx + 1}. ${text}\n`;
|
|
87
|
+
});
|
|
88
|
+
responseText += `\n`;
|
|
89
|
+
}
|
|
90
|
+
// Connections (if found)
|
|
91
|
+
if (params.includeConnections && synthesis.synthesis?.connections) {
|
|
92
|
+
responseText += `## š Related Topics & Connections\n`;
|
|
93
|
+
synthesis.synthesis.connections.slice(0, 8).forEach((conn) => {
|
|
94
|
+
if (typeof conn === 'string') {
|
|
95
|
+
responseText += `- ${conn}\n`;
|
|
96
|
+
}
|
|
97
|
+
else if (conn.concept) {
|
|
98
|
+
responseText += `- **${conn.concept}**`;
|
|
99
|
+
if (conn.strength) {
|
|
100
|
+
responseText += ` (strength: ${conn.strength})`;
|
|
101
|
+
}
|
|
102
|
+
responseText += `\n`;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
responseText += `\n`;
|
|
106
|
+
}
|
|
107
|
+
// Sources
|
|
108
|
+
responseText += `## š Top Sources\n`;
|
|
109
|
+
searchResults.slice(0, 5).forEach((source, idx) => {
|
|
110
|
+
const typeIcons = {
|
|
111
|
+
youtube: "šŗ",
|
|
112
|
+
x_twitter: "š",
|
|
113
|
+
reddit: "š",
|
|
114
|
+
article: "š",
|
|
115
|
+
pdf: "š"
|
|
116
|
+
};
|
|
117
|
+
const icon = typeIcons[source.contentType] || "š";
|
|
118
|
+
responseText += `${idx + 1}. ${icon} [${source.title || "Untitled"}](${source.url})\n`;
|
|
119
|
+
});
|
|
120
|
+
return {
|
|
121
|
+
content: [
|
|
122
|
+
{
|
|
123
|
+
type: "text",
|
|
124
|
+
text: responseText,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
data: {
|
|
128
|
+
topic: params.topic,
|
|
129
|
+
depth: params.depth,
|
|
130
|
+
sourcesAnalyzed: searchResults.length,
|
|
131
|
+
synthesis: synthesis.synthesis,
|
|
132
|
+
sources: searchResults,
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=explore-topic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explore-topic.js","sourceRoot":"","sources":["../../../src/tools/implementations/explore-topic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,+JAA+J;IAC5K,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sCAAsC;aACpD;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE,QAAQ,CAAC;gBAC5C,WAAW,EAAE,sBAAsB;gBACnC,OAAO,EAAE,eAAe;aACzB;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,8CAA8C;gBAC3D,OAAO,EAAE,IAAI;aACd;YACD,kBAAkB,EAAE;gBAClB,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,oCAAoC;gBACjD,OAAO,EAAE,IAAI;aACd;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gBACZ,OAAO,EAAE,IAAI;gBACb,GAAG,EAAE,IAAI;aACV,CAAC;YACF,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC;YACnD,YAAY,IAAI,GAAG,GAAG,GAAG,CAAC,KAAK,IAAI,KAAK,MAAM,CAAC,KAAK,IAAI,UAAU,KAAK,MAAM,CAAC,GAAG,KAAK,CAAC;QACzF,CAAC,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,YAAY;iBACnB;aACF;YACD,IAAI,EAAE;gBACJ,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,eAAe,EAAE,aAAa,CAAC,MAAM;gBACrC,SAAS,EAAE,SAAS,CAAC,SAAS;gBAC9B,OAAO,EAAE,aAAa;aACvB;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-frameworks.d.ts","sourceRoot":"","sources":["../../../src/tools/implementations/extract-frameworks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AA0CnC,eAAO,MAAM,qBAAqB,EAAE,IA+MnC,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const inputSchema = z.object({
|
|
3
|
+
query: z.string().optional().describe("Optional: specific framework type to find"),
|
|
4
|
+
contentTypes: z.array(z.enum(["youtube", "x_twitter", "reddit", "article", "pdf"]))
|
|
5
|
+
.optional()
|
|
6
|
+
.describe("Filter by content types"),
|
|
7
|
+
minConfidence: z.number().min(0).max(1).optional().default(0.7)
|
|
8
|
+
.describe("Minimum confidence score for frameworks (0-1)"),
|
|
9
|
+
limit: z.number().optional().default(20)
|
|
10
|
+
.describe("Maximum number of frameworks to return"),
|
|
11
|
+
});
|
|
12
|
+
export const extractFrameworksTool = {
|
|
13
|
+
name: "noverload_extract_frameworks",
|
|
14
|
+
description: "Extract methodologies, frameworks, and step-by-step processes from your saved content. Finds structured approaches, patterns, and repeatable techniques.",
|
|
15
|
+
inputSchema: inputSchema.strict(),
|
|
16
|
+
modifies: false,
|
|
17
|
+
handler: async (client, args) => {
|
|
18
|
+
const input = inputSchema.parse(args);
|
|
19
|
+
try {
|
|
20
|
+
// First, get content that might contain frameworks
|
|
21
|
+
const searchQuery = input.query || "framework methodology process steps guide how to tutorial";
|
|
22
|
+
// Search for relevant content
|
|
23
|
+
const searchResults = await client.searchContentV2({
|
|
24
|
+
query: searchQuery,
|
|
25
|
+
mode: "any",
|
|
26
|
+
limit: 30, // Get more results to find frameworks
|
|
27
|
+
contentTypes: input.contentTypes,
|
|
28
|
+
});
|
|
29
|
+
if (!searchResults.results || searchResults.results.length === 0) {
|
|
30
|
+
return {
|
|
31
|
+
content: [
|
|
32
|
+
{
|
|
33
|
+
type: "text",
|
|
34
|
+
text: "š No content found that might contain frameworks. Try saving content about methodologies, tutorials, or how-to guides first."
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
data: {
|
|
38
|
+
frameworks: [],
|
|
39
|
+
totalFound: 0,
|
|
40
|
+
searchQuery: searchQuery
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
// Collect all frameworks from content with ai_insights
|
|
45
|
+
const allFrameworks = [];
|
|
46
|
+
const contentWithFrameworks = [];
|
|
47
|
+
for (const result of searchResults.results) {
|
|
48
|
+
// Check if this content has ai_insights with frameworks
|
|
49
|
+
if (result.aiInsights?.frameworks) {
|
|
50
|
+
const frameworks = result.aiInsights.frameworks;
|
|
51
|
+
for (const fw of frameworks) {
|
|
52
|
+
if (fw.confidence >= input.minConfidence) {
|
|
53
|
+
allFrameworks.push({
|
|
54
|
+
...fw,
|
|
55
|
+
sourceContent: {
|
|
56
|
+
id: result.id,
|
|
57
|
+
title: result.title || "Untitled",
|
|
58
|
+
url: result.url,
|
|
59
|
+
type: result.contentType
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (frameworks.length > 0) {
|
|
65
|
+
contentWithFrameworks.push(result.id);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// If no frameworks found in ai_insights, trigger extraction for top results
|
|
70
|
+
if (allFrameworks.length === 0) {
|
|
71
|
+
// Extract frameworks from top 5 most relevant results
|
|
72
|
+
const topResults = searchResults.results.slice(0, 5);
|
|
73
|
+
let extractionMessage = "š No pre-extracted frameworks found. Analyzing content for frameworks...\n\n";
|
|
74
|
+
for (const content of topResults) {
|
|
75
|
+
if (!content.rawText && !content.summary) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
// Note: In production, this would call the extract-frameworks Edge Function
|
|
79
|
+
// For now, we'll indicate that extraction is needed
|
|
80
|
+
extractionMessage += `š ${content.title} - Needs framework extraction\n`;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
content: [
|
|
84
|
+
{
|
|
85
|
+
type: "text",
|
|
86
|
+
text: extractionMessage + "\nš” Tip: Content processing will extract frameworks automatically. Try again in a few moments, or use the 'noverload_process_content' tool to trigger processing."
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
data: {
|
|
90
|
+
frameworks: [],
|
|
91
|
+
totalFound: 0,
|
|
92
|
+
contentNeedingExtraction: topResults.map((r) => r.id),
|
|
93
|
+
searchQuery: searchQuery
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
// Sort frameworks by confidence and limit
|
|
98
|
+
allFrameworks.sort((a, b) => b.confidence - a.confidence);
|
|
99
|
+
const limitedFrameworks = allFrameworks.slice(0, input.limit);
|
|
100
|
+
// Format response
|
|
101
|
+
let responseText = `šÆ **Found ${allFrameworks.length} frameworks**\n\n`;
|
|
102
|
+
if (input.query) {
|
|
103
|
+
responseText += `Search: "${input.query}"\n`;
|
|
104
|
+
}
|
|
105
|
+
responseText += `Minimum confidence: ${input.minConfidence}\n\n`;
|
|
106
|
+
// Group frameworks by type
|
|
107
|
+
const byType = limitedFrameworks.reduce((acc, fw) => {
|
|
108
|
+
if (!acc[fw.type])
|
|
109
|
+
acc[fw.type] = [];
|
|
110
|
+
acc[fw.type].push(fw);
|
|
111
|
+
return acc;
|
|
112
|
+
}, {});
|
|
113
|
+
for (const [type, frameworks] of Object.entries(byType)) {
|
|
114
|
+
responseText += `\n## ${type.charAt(0).toUpperCase() + type.slice(1)}s\n\n`;
|
|
115
|
+
for (const fw of frameworks) {
|
|
116
|
+
responseText += `### š ${fw.name}\n`;
|
|
117
|
+
responseText += `*Confidence: ${(fw.confidence * 100).toFixed(0)}%*\n`;
|
|
118
|
+
responseText += `${fw.description}\n\n`;
|
|
119
|
+
// Add steps if available
|
|
120
|
+
if (fw.steps && fw.steps.length > 0) {
|
|
121
|
+
responseText += `**Steps:**\n`;
|
|
122
|
+
for (const step of fw.steps) {
|
|
123
|
+
responseText += `${step.order}. **${step.title}**: ${step.description}\n`;
|
|
124
|
+
if (step.example) {
|
|
125
|
+
responseText += ` *Example: ${step.example}*\n`;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
responseText += `\n`;
|
|
129
|
+
}
|
|
130
|
+
// Add components if available
|
|
131
|
+
if (fw.components && fw.components.length > 0) {
|
|
132
|
+
responseText += `**Components:**\n`;
|
|
133
|
+
for (const comp of fw.components) {
|
|
134
|
+
const importance = comp.importance === 'critical' ? 'š“' :
|
|
135
|
+
comp.importance === 'important' ? 'š”' : 'āŖ';
|
|
136
|
+
responseText += `- ${importance} **${comp.name}**: ${comp.description}\n`;
|
|
137
|
+
}
|
|
138
|
+
responseText += `\n`;
|
|
139
|
+
}
|
|
140
|
+
// Add use cases
|
|
141
|
+
if (fw.useCases && fw.useCases.length > 0) {
|
|
142
|
+
responseText += `**Use Cases:** ${fw.useCases.join(', ')}\n`;
|
|
143
|
+
}
|
|
144
|
+
// Add source
|
|
145
|
+
if (fw.sourceContent) {
|
|
146
|
+
const icon = fw.sourceContent.type === 'youtube' ? 'šŗ' :
|
|
147
|
+
fw.sourceContent.type === 'x_twitter' ? 'š' :
|
|
148
|
+
fw.sourceContent.type === 'reddit' ? 'š ' :
|
|
149
|
+
fw.sourceContent.type === 'pdf' ? 'š' : 'š';
|
|
150
|
+
responseText += `*Source: ${icon} [${fw.sourceContent.title}](${fw.sourceContent.url})*\n\n`;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// Add summary statistics
|
|
155
|
+
responseText += `\n---\nš **Summary:**\n`;
|
|
156
|
+
responseText += `- Total frameworks found: ${allFrameworks.length}\n`;
|
|
157
|
+
responseText += `- High confidence (>90%): ${allFrameworks.filter(f => f.confidence > 0.9).length}\n`;
|
|
158
|
+
responseText += `- Content sources analyzed: ${contentWithFrameworks.length}\n`;
|
|
159
|
+
if (allFrameworks.length > input.limit) {
|
|
160
|
+
responseText += `\n*Showing top ${input.limit} frameworks. Increase limit to see more.*`;
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
content: [
|
|
164
|
+
{
|
|
165
|
+
type: "text",
|
|
166
|
+
text: responseText
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
data: {
|
|
170
|
+
frameworks: limitedFrameworks,
|
|
171
|
+
totalFound: allFrameworks.length,
|
|
172
|
+
byType: Object.fromEntries(Object.entries(byType).map(([type, fws]) => [type, fws.length])),
|
|
173
|
+
contentSources: contentWithFrameworks,
|
|
174
|
+
searchQuery: searchQuery
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
console.error("Framework extraction error:", error);
|
|
180
|
+
return {
|
|
181
|
+
content: [
|
|
182
|
+
{
|
|
183
|
+
type: "text",
|
|
184
|
+
text: `ā Error extracting frameworks: ${error instanceof Error ? error.message : 'Unknown error'}`
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
error: true
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=extract-frameworks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-frameworks.js","sourceRoot":"","sources":["../../../src/tools/implementations/extract-frameworks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IAClF,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;SAChF,QAAQ,EAAE;SACV,QAAQ,CAAC,yBAAyB,CAAC;IACtC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;SAC5D,QAAQ,CAAC,+CAA+C,CAAC;IAC5D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;SACrC,QAAQ,CAAC,wCAAwC,CAAC;CACtD,CAAC,CAAC;AA+BH,MAAM,CAAC,MAAM,qBAAqB,GAAS;IACzC,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,0JAA0J;IACvK,WAAW,EAAE,WAAW,CAAC,MAAM,EAAwC;IACvE,QAAQ,EAAE,KAAK;IAEf,OAAO,EAAE,KAAK,EAAE,MAAuB,EAAE,IAAa,EAAE,EAAE;QACxD,MAAM,KAAK,GA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ACxB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAChE;oBACD,cAAc,EAAE,qBAAqB;oBACrC,WAAW,EAAE,WAAW;iBACzB;aACF,CAAC;QAEJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;YAEpD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,kCAAkC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE;qBACnG;iBACF;gBACD,KAAK,EAAE,IAAI;aACZ,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-insights.d.ts","sourceRoot":"","sources":["../../../src/tools/implementations/extract-insights.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC,eAAO,MAAM,mBAAmB,EAAE,IAsIjC,CAAC"}
|