@crowdlisten/harness 1.0.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/AGENTS.md +167 -0
- package/LICENSE +21 -0
- package/README.md +153 -0
- package/dist/agent-proxy.d.ts +24 -0
- package/dist/agent-proxy.js +140 -0
- package/dist/agent-tools.d.ts +736 -0
- package/dist/agent-tools.js +409 -0
- package/dist/context/api.d.ts +5 -0
- package/dist/context/api.js +164 -0
- package/dist/context/cli.d.ts +19 -0
- package/dist/context/cli.js +108 -0
- package/dist/context/extractor.d.ts +12 -0
- package/dist/context/extractor.js +43 -0
- package/dist/context/index.d.ts +12 -0
- package/dist/context/index.js +11 -0
- package/dist/context/matcher.d.ts +39 -0
- package/dist/context/matcher.js +246 -0
- package/dist/context/parser.d.ts +28 -0
- package/dist/context/parser.js +157 -0
- package/dist/context/pipeline.d.ts +26 -0
- package/dist/context/pipeline.js +56 -0
- package/dist/context/prompts.d.ts +6 -0
- package/dist/context/prompts.js +60 -0
- package/dist/context/providers.d.ts +6 -0
- package/dist/context/providers.js +106 -0
- package/dist/context/redactor.d.ts +10 -0
- package/dist/context/redactor.js +68 -0
- package/dist/context/server.d.ts +5 -0
- package/dist/context/server.js +134 -0
- package/dist/context/store.d.ts +12 -0
- package/dist/context/store.js +82 -0
- package/dist/context/types.d.ts +79 -0
- package/dist/context/types.js +4 -0
- package/dist/context/user-state.d.ts +40 -0
- package/dist/context/user-state.js +144 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +385 -0
- package/dist/insights/browser/BrowserPool.d.ts +87 -0
- package/dist/insights/browser/BrowserPool.js +266 -0
- package/dist/insights/browser/RequestInterceptor.d.ts +46 -0
- package/dist/insights/browser/RequestInterceptor.js +115 -0
- package/dist/insights/cli.d.ts +8 -0
- package/dist/insights/cli.js +206 -0
- package/dist/insights/core/base/BaseAdapter.d.ts +37 -0
- package/dist/insights/core/base/BaseAdapter.js +123 -0
- package/dist/insights/core/health/HealthMonitor.d.ts +75 -0
- package/dist/insights/core/health/HealthMonitor.js +171 -0
- package/dist/insights/core/interfaces/SocialMediaPlatform.d.ts +125 -0
- package/dist/insights/core/interfaces/SocialMediaPlatform.js +42 -0
- package/dist/insights/core/utils/DataNormalizer.d.ts +53 -0
- package/dist/insights/core/utils/DataNormalizer.js +349 -0
- package/dist/insights/core/utils/InstagramUrlUtils.d.ts +11 -0
- package/dist/insights/core/utils/InstagramUrlUtils.js +60 -0
- package/dist/insights/core/utils/TikTokUrlUtils.d.ts +10 -0
- package/dist/insights/core/utils/TikTokUrlUtils.js +57 -0
- package/dist/insights/handlers.d.ts +157 -0
- package/dist/insights/handlers.js +246 -0
- package/dist/insights/index.d.ts +437 -0
- package/dist/insights/index.js +426 -0
- package/dist/insights/platforms/instagram/InstagramAdapter.d.ts +34 -0
- package/dist/insights/platforms/instagram/InstagramAdapter.js +342 -0
- package/dist/insights/platforms/moltbook/MoltbookAdapter.d.ts +31 -0
- package/dist/insights/platforms/moltbook/MoltbookAdapter.js +227 -0
- package/dist/insights/platforms/reddit/RedditAdapter.d.ts +21 -0
- package/dist/insights/platforms/reddit/RedditAdapter.js +212 -0
- package/dist/insights/platforms/tiktok/TikTokAdapter.d.ts +34 -0
- package/dist/insights/platforms/tiktok/TikTokAdapter.js +269 -0
- package/dist/insights/platforms/twitter/TwitterAdapter.d.ts +23 -0
- package/dist/insights/platforms/twitter/TwitterAdapter.js +211 -0
- package/dist/insights/platforms/xiaohongshu/XiaohongshuAdapter.d.ts +35 -0
- package/dist/insights/platforms/xiaohongshu/XiaohongshuAdapter.js +258 -0
- package/dist/insights/platforms/youtube/YouTubeAdapter.d.ts +22 -0
- package/dist/insights/platforms/youtube/YouTubeAdapter.js +254 -0
- package/dist/insights/service-config.d.ts +7 -0
- package/dist/insights/service-config.js +60 -0
- package/dist/insights/services/UnifiedSocialMediaService.d.ts +94 -0
- package/dist/insights/services/UnifiedSocialMediaService.js +259 -0
- package/dist/insights/vision/VisionExtractor.d.ts +46 -0
- package/dist/insights/vision/VisionExtractor.js +236 -0
- package/dist/learnings.d.ts +50 -0
- package/dist/learnings.js +130 -0
- package/dist/openapi.d.ts +29 -0
- package/dist/openapi.js +169 -0
- package/dist/server-factory.d.ts +20 -0
- package/dist/server-factory.js +41 -0
- package/dist/suggestions.d.ts +16 -0
- package/dist/suggestions.js +72 -0
- package/dist/telemetry.d.ts +44 -0
- package/dist/telemetry.js +93 -0
- package/dist/tools/registry.d.ts +65 -0
- package/dist/tools/registry.js +256 -0
- package/dist/tools.d.ts +2433 -0
- package/dist/tools.js +2294 -0
- package/dist/transport/http.d.ts +15 -0
- package/dist/transport/http.js +154 -0
- package/package.json +76 -0
- package/skills/catalog.json +272 -0
- package/skills/community-catalog.json +4202 -0
- package/skills/competitive-analysis/SKILL.md +174 -0
- package/skills/content-creator/SKILL.md +256 -0
- package/skills/content-strategy/SKILL.md +222 -0
- package/skills/data-storytelling/SKILL.md +248 -0
- package/skills/heuristic-evaluation/SKILL.md +201 -0
- package/skills/market-research-reports/SKILL.md +184 -0
- package/skills/user-stories/SKILL.md +178 -0
- package/skills/ux-researcher/SKILL.md +239 -0
- package/web-dist/assets/index-B1b25lNd.css +1 -0
- package/web-dist/assets/index-CDWHwHbl.js +64 -0
- package/web-dist/index.html +16 -0
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CrowdListen Shared Handlers
|
|
3
|
+
* Pure functions that return plain objects — used by CLI and MCP server.
|
|
4
|
+
*
|
|
5
|
+
* Retrieval handlers (free, local): search, comments, trending, user content, vision
|
|
6
|
+
* Analysis handlers (paid, API): analyze, cluster, enrich, deep_analyze, insights, research
|
|
7
|
+
*/
|
|
8
|
+
import { TikTokUrlUtils } from './core/utils/TikTokUrlUtils.js';
|
|
9
|
+
import { InstagramUrlUtils } from './core/utils/InstagramUrlUtils.js';
|
|
10
|
+
import { VisionExtractor } from './vision/VisionExtractor.js';
|
|
11
|
+
// ---------- Vision Extraction Handler ----------
|
|
12
|
+
export async function extractWithVision(args) {
|
|
13
|
+
const { url, mode = 'posts', limit = 10 } = args;
|
|
14
|
+
const vision = new VisionExtractor();
|
|
15
|
+
if (!vision.isAvailable()) {
|
|
16
|
+
throw new Error('Vision extraction requires at least one LLM API key.\n' +
|
|
17
|
+
'Set ANTHROPIC_API_KEY, GEMINI_API_KEY, or OPENAI_API_KEY.');
|
|
18
|
+
}
|
|
19
|
+
const result = await vision.extract(url, { mode, limit });
|
|
20
|
+
return {
|
|
21
|
+
url,
|
|
22
|
+
mode,
|
|
23
|
+
provider: result.provider,
|
|
24
|
+
extractionMethod: 'vision',
|
|
25
|
+
...(result.posts && { count: result.posts.length, posts: result.posts }),
|
|
26
|
+
...(result.comments && { count: result.comments.length, comments: result.comments }),
|
|
27
|
+
...(result.raw && { raw: result.raw }),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
// ---------- Free Retrieval Handlers ----------
|
|
31
|
+
export async function getTrendingContent(service, args) {
|
|
32
|
+
const { platform, limit = 10 } = args;
|
|
33
|
+
if (platform === 'all') {
|
|
34
|
+
const allTrending = await service.getCombinedTrendingContent(limit);
|
|
35
|
+
return { platform: 'combined', count: allTrending.length, posts: allTrending };
|
|
36
|
+
}
|
|
37
|
+
const posts = await service.getTrendingContent(platform, limit);
|
|
38
|
+
return { platform, count: posts.length, posts };
|
|
39
|
+
}
|
|
40
|
+
export async function getUserContent(service, args) {
|
|
41
|
+
const { platform, userId, limit = 10 } = args;
|
|
42
|
+
const posts = await service.getUserContent(platform, userId, limit);
|
|
43
|
+
return { platform, userId, count: posts.length, posts };
|
|
44
|
+
}
|
|
45
|
+
export async function searchContent(service, args) {
|
|
46
|
+
const { platform, query, limit = 10, useVision } = args;
|
|
47
|
+
// Vision mode override
|
|
48
|
+
if (useVision) {
|
|
49
|
+
return extractWithVision({ url: query, mode: 'posts', limit });
|
|
50
|
+
}
|
|
51
|
+
if (platform === 'all') {
|
|
52
|
+
const allResults = await service.getCombinedSearchResults(query, limit);
|
|
53
|
+
return { platform: 'combined', query, count: allResults.length, posts: allResults };
|
|
54
|
+
}
|
|
55
|
+
const posts = await service.searchContent(platform, query, limit);
|
|
56
|
+
return { platform, query, count: posts.length, posts };
|
|
57
|
+
}
|
|
58
|
+
export async function getContentComments(service, args) {
|
|
59
|
+
const { platform, contentId, limit = 20, useVision } = args;
|
|
60
|
+
// Vision mode override
|
|
61
|
+
if (useVision) {
|
|
62
|
+
return extractWithVision({ url: contentId, mode: 'comments', limit });
|
|
63
|
+
}
|
|
64
|
+
let normalizedContentId = contentId;
|
|
65
|
+
if (platform === 'tiktok' && typeof contentId === 'string' && TikTokUrlUtils.isTikTokUrl(contentId)) {
|
|
66
|
+
const resolvedUrl = await TikTokUrlUtils.resolveUrl(contentId);
|
|
67
|
+
const extractedId = TikTokUrlUtils.extractVideoId(resolvedUrl);
|
|
68
|
+
if (!extractedId) {
|
|
69
|
+
throw new Error(`Unable to extract TikTok video ID from URL: ${contentId}`);
|
|
70
|
+
}
|
|
71
|
+
normalizedContentId = extractedId;
|
|
72
|
+
}
|
|
73
|
+
else if (platform === 'instagram' && typeof contentId === 'string' && InstagramUrlUtils.isInstagramUrl(contentId)) {
|
|
74
|
+
const resolvedUrl = await InstagramUrlUtils.resolveUrl(contentId);
|
|
75
|
+
const extractedId = InstagramUrlUtils.extractShortcode(resolvedUrl);
|
|
76
|
+
if (!extractedId) {
|
|
77
|
+
throw new Error(`Unable to extract Instagram shortcode from URL: ${contentId}`);
|
|
78
|
+
}
|
|
79
|
+
normalizedContentId = extractedId;
|
|
80
|
+
}
|
|
81
|
+
const comments = await service.getContentComments(platform, normalizedContentId, limit);
|
|
82
|
+
return { platform, contentId: normalizedContentId, count: comments.length, comments };
|
|
83
|
+
}
|
|
84
|
+
export function getPlatformStatus(service) {
|
|
85
|
+
const platforms = service.getAvailablePlatforms();
|
|
86
|
+
return { availablePlatforms: platforms, totalPlatforms: Object.keys(platforms).length };
|
|
87
|
+
}
|
|
88
|
+
export async function healthCheck(service, monitor) {
|
|
89
|
+
// If the monitor has recent data (< 5 minutes), return the cached summary
|
|
90
|
+
// instead of running a live probe. This is faster and non-blocking.
|
|
91
|
+
if (monitor && monitor.hasRecentData(5 * 60 * 1000)) {
|
|
92
|
+
const summary = monitor.getSummary();
|
|
93
|
+
const healthStatus = {};
|
|
94
|
+
for (const [platform, state] of Object.entries(summary.platforms)) {
|
|
95
|
+
healthStatus[platform] = {
|
|
96
|
+
status: state.status,
|
|
97
|
+
responseTimeMs: state.responseTimeMs,
|
|
98
|
+
lastChecked: state.lastChecked.toISOString(),
|
|
99
|
+
lastHealthy: state.lastHealthy?.toISOString() ?? null,
|
|
100
|
+
consecutiveFailures: state.consecutiveFailures,
|
|
101
|
+
...(state.error && { error: state.error }),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
overall: summary.overall,
|
|
106
|
+
healthStatus,
|
|
107
|
+
source: 'cached',
|
|
108
|
+
lastFullCheck: summary.lastFullCheck?.toISOString() ?? null,
|
|
109
|
+
timestamp: new Date().toISOString(),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
// No cached data available -- trigger a fresh check via the monitor if
|
|
113
|
+
// present, otherwise fall back to the service's built-in health check.
|
|
114
|
+
if (monitor) {
|
|
115
|
+
const summary = await monitor.checkAll();
|
|
116
|
+
const healthStatus = {};
|
|
117
|
+
for (const [platform, state] of Object.entries(summary.platforms)) {
|
|
118
|
+
healthStatus[platform] = {
|
|
119
|
+
status: state.status,
|
|
120
|
+
responseTimeMs: state.responseTimeMs,
|
|
121
|
+
lastChecked: state.lastChecked.toISOString(),
|
|
122
|
+
lastHealthy: state.lastHealthy?.toISOString() ?? null,
|
|
123
|
+
consecutiveFailures: state.consecutiveFailures,
|
|
124
|
+
...(state.error && { error: state.error }),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
overall: summary.overall,
|
|
129
|
+
healthStatus,
|
|
130
|
+
source: 'live',
|
|
131
|
+
lastFullCheck: summary.lastFullCheck?.toISOString() ?? null,
|
|
132
|
+
timestamp: new Date().toISOString(),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
// Fallback: no monitor (e.g. CLI usage) -- use legacy service.healthCheck()
|
|
136
|
+
const health = await service.healthCheck();
|
|
137
|
+
return { healthStatus: health, timestamp: new Date().toISOString() };
|
|
138
|
+
}
|
|
139
|
+
// ---------- Paid Agent API Proxy ----------
|
|
140
|
+
const AGENT_API_BASE = process.env.CROWDLISTEN_AGENT_URL || 'https://agent.crowdlisten.com';
|
|
141
|
+
function requireApiKey() {
|
|
142
|
+
const apiKey = process.env.CROWDLISTEN_API_KEY;
|
|
143
|
+
if (!apiKey) {
|
|
144
|
+
throw new Error('CROWDLISTEN_API_KEY required for this feature.\n' +
|
|
145
|
+
'Get one at https://crowdlisten.com/api\n\n' +
|
|
146
|
+
'Free features (no key): search, comments, trending, user content, vision\n' +
|
|
147
|
+
'Paid features (key required): analyze, cluster, enrich, deep analysis, insights, research');
|
|
148
|
+
}
|
|
149
|
+
return apiKey;
|
|
150
|
+
}
|
|
151
|
+
async function agentPost(path, body) {
|
|
152
|
+
const apiKey = requireApiKey();
|
|
153
|
+
const url = `${AGENT_API_BASE}${path}`;
|
|
154
|
+
const response = await fetch(url, {
|
|
155
|
+
method: 'POST',
|
|
156
|
+
headers: {
|
|
157
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
158
|
+
'Content-Type': 'application/json',
|
|
159
|
+
},
|
|
160
|
+
body: JSON.stringify(body),
|
|
161
|
+
});
|
|
162
|
+
if (!response.ok) {
|
|
163
|
+
const errorBody = await response.text();
|
|
164
|
+
throw new Error(`Agent API error (${response.status}): ${errorBody}`);
|
|
165
|
+
}
|
|
166
|
+
return response.json();
|
|
167
|
+
}
|
|
168
|
+
// ---------- Analysis Handlers (all delegate to API) ----------
|
|
169
|
+
export async function analyzeContent(service, args) {
|
|
170
|
+
const { platform, contentId, analysisDepth = 'standard' } = args;
|
|
171
|
+
return agentPost('/api/v1/analyze', {
|
|
172
|
+
platform,
|
|
173
|
+
content_id: contentId,
|
|
174
|
+
depth: analysisDepth,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
export async function clusterOpinions(service, args) {
|
|
178
|
+
const { platform, contentId, clusterCount = 5 } = args;
|
|
179
|
+
const comments = await service.getContentComments(platform, contentId, 500);
|
|
180
|
+
if (comments.length === 0) {
|
|
181
|
+
return {
|
|
182
|
+
platform,
|
|
183
|
+
contentId,
|
|
184
|
+
analysisType: 'opinion_clustering',
|
|
185
|
+
totalComments: 0,
|
|
186
|
+
clusterCount: 0,
|
|
187
|
+
clusters: [],
|
|
188
|
+
message: 'No comments found for clustering',
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
const commentPayload = comments.map(c => ({
|
|
192
|
+
text: c.text,
|
|
193
|
+
author: c.author?.username || 'anonymous',
|
|
194
|
+
likes: c.likes || 0,
|
|
195
|
+
replies: c.replies?.length || 0,
|
|
196
|
+
}));
|
|
197
|
+
return agentPost('/api/v1/cluster', {
|
|
198
|
+
comments: commentPayload,
|
|
199
|
+
question: `Analyze comments for ${platform} content ${contentId}`,
|
|
200
|
+
max_comments: Math.min(comments.length, 150),
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
export async function enrichContent(service, args) {
|
|
204
|
+
const { platform, contentId, question = '' } = args;
|
|
205
|
+
const comments = await service.getContentComments(platform, contentId, 200);
|
|
206
|
+
if (comments.length === 0) {
|
|
207
|
+
return {
|
|
208
|
+
platform,
|
|
209
|
+
contentId,
|
|
210
|
+
totalComments: 0,
|
|
211
|
+
enrichedComments: [],
|
|
212
|
+
message: 'No comments found for enrichment',
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
const commentPayload = comments.map(c => ({
|
|
216
|
+
text: c.text,
|
|
217
|
+
author: c.author?.username || 'anonymous',
|
|
218
|
+
likes: c.likes || 0,
|
|
219
|
+
replies: c.replies?.length || 0,
|
|
220
|
+
}));
|
|
221
|
+
return agentPost('/api/v1/enrich', {
|
|
222
|
+
comments: commentPayload,
|
|
223
|
+
question: question || `Enrich comments for ${platform} content ${contentId}`,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
export async function deepAnalyze(args) {
|
|
227
|
+
return agentPost('/api/v1/analyze', {
|
|
228
|
+
platform: args.platform,
|
|
229
|
+
content_id: args.contentId,
|
|
230
|
+
depth: args.analysisDepth,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
export async function extractInsights(args) {
|
|
234
|
+
return agentPost('/api/v1/insights', {
|
|
235
|
+
platform: args.platform,
|
|
236
|
+
content_id: args.contentId,
|
|
237
|
+
categories: args.categories,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
export async function researchSynthesis(args) {
|
|
241
|
+
return agentPost('/api/v1/research', {
|
|
242
|
+
query: args.query,
|
|
243
|
+
platforms: args.platforms || ['reddit', 'twitter', 'youtube'],
|
|
244
|
+
depth: args.depth || 'standard',
|
|
245
|
+
});
|
|
246
|
+
}
|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CrowdListen Insights — Social Platform Tools
|
|
3
|
+
*
|
|
4
|
+
* Tool definitions and handler dispatcher for social listening capabilities.
|
|
5
|
+
* Merged from crowdlisten_sources into the unified MCP server.
|
|
6
|
+
*
|
|
7
|
+
* Free tools (no key): search, comments, trending, user content, platform status, health, vision
|
|
8
|
+
* Paid tools (CROWDLISTEN_API_KEY): analyze, cluster, enrich, deep_analyze, insights, research
|
|
9
|
+
*/
|
|
10
|
+
export { HealthMonitor } from './core/health/HealthMonitor.js';
|
|
11
|
+
export type { HealthStatus, HealthSummary, PlatformHealthState, HealthCheckFn, } from './core/health/HealthMonitor.js';
|
|
12
|
+
export declare const INSIGHTS_TOOLS: ({
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: string;
|
|
17
|
+
properties: {
|
|
18
|
+
platform: {
|
|
19
|
+
type: string;
|
|
20
|
+
enum: string[];
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
query: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
limit: {
|
|
28
|
+
type: string;
|
|
29
|
+
minimum: number;
|
|
30
|
+
maximum: number;
|
|
31
|
+
default: number;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
useVision: {
|
|
35
|
+
type: string;
|
|
36
|
+
default: boolean;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
contentId?: undefined;
|
|
40
|
+
userId?: undefined;
|
|
41
|
+
url?: undefined;
|
|
42
|
+
mode?: undefined;
|
|
43
|
+
analysisDepth?: undefined;
|
|
44
|
+
clusterCount?: undefined;
|
|
45
|
+
includeExamples?: undefined;
|
|
46
|
+
weightByEngagement?: undefined;
|
|
47
|
+
question?: undefined;
|
|
48
|
+
categories?: undefined;
|
|
49
|
+
platforms?: undefined;
|
|
50
|
+
depth?: undefined;
|
|
51
|
+
};
|
|
52
|
+
required: string[];
|
|
53
|
+
};
|
|
54
|
+
} | {
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
inputSchema: {
|
|
58
|
+
type: string;
|
|
59
|
+
properties: {
|
|
60
|
+
platform: {
|
|
61
|
+
type: string;
|
|
62
|
+
enum: string[];
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
contentId: {
|
|
66
|
+
type: string;
|
|
67
|
+
description: string;
|
|
68
|
+
};
|
|
69
|
+
limit: {
|
|
70
|
+
type: string;
|
|
71
|
+
minimum: number;
|
|
72
|
+
maximum: number;
|
|
73
|
+
default: number;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
useVision: {
|
|
77
|
+
type: string;
|
|
78
|
+
default: boolean;
|
|
79
|
+
description: string;
|
|
80
|
+
};
|
|
81
|
+
query?: undefined;
|
|
82
|
+
userId?: undefined;
|
|
83
|
+
url?: undefined;
|
|
84
|
+
mode?: undefined;
|
|
85
|
+
analysisDepth?: undefined;
|
|
86
|
+
clusterCount?: undefined;
|
|
87
|
+
includeExamples?: undefined;
|
|
88
|
+
weightByEngagement?: undefined;
|
|
89
|
+
question?: undefined;
|
|
90
|
+
categories?: undefined;
|
|
91
|
+
platforms?: undefined;
|
|
92
|
+
depth?: undefined;
|
|
93
|
+
};
|
|
94
|
+
required: string[];
|
|
95
|
+
};
|
|
96
|
+
} | {
|
|
97
|
+
name: string;
|
|
98
|
+
description: string;
|
|
99
|
+
inputSchema: {
|
|
100
|
+
type: string;
|
|
101
|
+
properties: {
|
|
102
|
+
platform: {
|
|
103
|
+
type: string;
|
|
104
|
+
enum: string[];
|
|
105
|
+
description: string;
|
|
106
|
+
};
|
|
107
|
+
limit: {
|
|
108
|
+
type: string;
|
|
109
|
+
minimum: number;
|
|
110
|
+
maximum: number;
|
|
111
|
+
default: number;
|
|
112
|
+
description: string;
|
|
113
|
+
};
|
|
114
|
+
query?: undefined;
|
|
115
|
+
useVision?: undefined;
|
|
116
|
+
contentId?: undefined;
|
|
117
|
+
userId?: undefined;
|
|
118
|
+
url?: undefined;
|
|
119
|
+
mode?: undefined;
|
|
120
|
+
analysisDepth?: undefined;
|
|
121
|
+
clusterCount?: undefined;
|
|
122
|
+
includeExamples?: undefined;
|
|
123
|
+
weightByEngagement?: undefined;
|
|
124
|
+
question?: undefined;
|
|
125
|
+
categories?: undefined;
|
|
126
|
+
platforms?: undefined;
|
|
127
|
+
depth?: undefined;
|
|
128
|
+
};
|
|
129
|
+
required: string[];
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
name: string;
|
|
133
|
+
description: string;
|
|
134
|
+
inputSchema: {
|
|
135
|
+
type: string;
|
|
136
|
+
properties: {
|
|
137
|
+
platform: {
|
|
138
|
+
type: string;
|
|
139
|
+
enum: string[];
|
|
140
|
+
description: string;
|
|
141
|
+
};
|
|
142
|
+
userId: {
|
|
143
|
+
type: string;
|
|
144
|
+
description: string;
|
|
145
|
+
};
|
|
146
|
+
limit: {
|
|
147
|
+
type: string;
|
|
148
|
+
minimum: number;
|
|
149
|
+
maximum: number;
|
|
150
|
+
default: number;
|
|
151
|
+
description: string;
|
|
152
|
+
};
|
|
153
|
+
query?: undefined;
|
|
154
|
+
useVision?: undefined;
|
|
155
|
+
contentId?: undefined;
|
|
156
|
+
url?: undefined;
|
|
157
|
+
mode?: undefined;
|
|
158
|
+
analysisDepth?: undefined;
|
|
159
|
+
clusterCount?: undefined;
|
|
160
|
+
includeExamples?: undefined;
|
|
161
|
+
weightByEngagement?: undefined;
|
|
162
|
+
question?: undefined;
|
|
163
|
+
categories?: undefined;
|
|
164
|
+
platforms?: undefined;
|
|
165
|
+
depth?: undefined;
|
|
166
|
+
};
|
|
167
|
+
required: string[];
|
|
168
|
+
};
|
|
169
|
+
} | {
|
|
170
|
+
name: string;
|
|
171
|
+
description: string;
|
|
172
|
+
inputSchema: {
|
|
173
|
+
type: string;
|
|
174
|
+
properties: {
|
|
175
|
+
platform?: undefined;
|
|
176
|
+
query?: undefined;
|
|
177
|
+
limit?: undefined;
|
|
178
|
+
useVision?: undefined;
|
|
179
|
+
contentId?: undefined;
|
|
180
|
+
userId?: undefined;
|
|
181
|
+
url?: undefined;
|
|
182
|
+
mode?: undefined;
|
|
183
|
+
analysisDepth?: undefined;
|
|
184
|
+
clusterCount?: undefined;
|
|
185
|
+
includeExamples?: undefined;
|
|
186
|
+
weightByEngagement?: undefined;
|
|
187
|
+
question?: undefined;
|
|
188
|
+
categories?: undefined;
|
|
189
|
+
platforms?: undefined;
|
|
190
|
+
depth?: undefined;
|
|
191
|
+
};
|
|
192
|
+
required?: undefined;
|
|
193
|
+
};
|
|
194
|
+
} | {
|
|
195
|
+
name: string;
|
|
196
|
+
description: string;
|
|
197
|
+
inputSchema: {
|
|
198
|
+
type: string;
|
|
199
|
+
properties: {
|
|
200
|
+
url: {
|
|
201
|
+
type: string;
|
|
202
|
+
description: string;
|
|
203
|
+
};
|
|
204
|
+
mode: {
|
|
205
|
+
type: string;
|
|
206
|
+
enum: string[];
|
|
207
|
+
default: string;
|
|
208
|
+
description: string;
|
|
209
|
+
};
|
|
210
|
+
limit: {
|
|
211
|
+
type: string;
|
|
212
|
+
minimum: number;
|
|
213
|
+
maximum: number;
|
|
214
|
+
default: number;
|
|
215
|
+
description: string;
|
|
216
|
+
};
|
|
217
|
+
platform?: undefined;
|
|
218
|
+
query?: undefined;
|
|
219
|
+
useVision?: undefined;
|
|
220
|
+
contentId?: undefined;
|
|
221
|
+
userId?: undefined;
|
|
222
|
+
analysisDepth?: undefined;
|
|
223
|
+
clusterCount?: undefined;
|
|
224
|
+
includeExamples?: undefined;
|
|
225
|
+
weightByEngagement?: undefined;
|
|
226
|
+
question?: undefined;
|
|
227
|
+
categories?: undefined;
|
|
228
|
+
platforms?: undefined;
|
|
229
|
+
depth?: undefined;
|
|
230
|
+
};
|
|
231
|
+
required: string[];
|
|
232
|
+
};
|
|
233
|
+
} | {
|
|
234
|
+
name: string;
|
|
235
|
+
description: string;
|
|
236
|
+
inputSchema: {
|
|
237
|
+
type: string;
|
|
238
|
+
properties: {
|
|
239
|
+
platform: {
|
|
240
|
+
type: string;
|
|
241
|
+
enum: string[];
|
|
242
|
+
description: string;
|
|
243
|
+
};
|
|
244
|
+
contentId: {
|
|
245
|
+
type: string;
|
|
246
|
+
description: string;
|
|
247
|
+
};
|
|
248
|
+
analysisDepth: {
|
|
249
|
+
type: string;
|
|
250
|
+
enum: string[];
|
|
251
|
+
default: string;
|
|
252
|
+
description: string;
|
|
253
|
+
};
|
|
254
|
+
query?: undefined;
|
|
255
|
+
limit?: undefined;
|
|
256
|
+
useVision?: undefined;
|
|
257
|
+
userId?: undefined;
|
|
258
|
+
url?: undefined;
|
|
259
|
+
mode?: undefined;
|
|
260
|
+
clusterCount?: undefined;
|
|
261
|
+
includeExamples?: undefined;
|
|
262
|
+
weightByEngagement?: undefined;
|
|
263
|
+
question?: undefined;
|
|
264
|
+
categories?: undefined;
|
|
265
|
+
platforms?: undefined;
|
|
266
|
+
depth?: undefined;
|
|
267
|
+
};
|
|
268
|
+
required: string[];
|
|
269
|
+
};
|
|
270
|
+
} | {
|
|
271
|
+
name: string;
|
|
272
|
+
description: string;
|
|
273
|
+
inputSchema: {
|
|
274
|
+
type: string;
|
|
275
|
+
properties: {
|
|
276
|
+
platform: {
|
|
277
|
+
type: string;
|
|
278
|
+
enum: string[];
|
|
279
|
+
description: string;
|
|
280
|
+
};
|
|
281
|
+
contentId: {
|
|
282
|
+
type: string;
|
|
283
|
+
description: string;
|
|
284
|
+
};
|
|
285
|
+
clusterCount: {
|
|
286
|
+
type: string;
|
|
287
|
+
default: number;
|
|
288
|
+
minimum: number;
|
|
289
|
+
maximum: number;
|
|
290
|
+
description: string;
|
|
291
|
+
};
|
|
292
|
+
includeExamples: {
|
|
293
|
+
type: string;
|
|
294
|
+
default: boolean;
|
|
295
|
+
description: string;
|
|
296
|
+
};
|
|
297
|
+
weightByEngagement: {
|
|
298
|
+
type: string;
|
|
299
|
+
default: boolean;
|
|
300
|
+
description: string;
|
|
301
|
+
};
|
|
302
|
+
query?: undefined;
|
|
303
|
+
limit?: undefined;
|
|
304
|
+
useVision?: undefined;
|
|
305
|
+
userId?: undefined;
|
|
306
|
+
url?: undefined;
|
|
307
|
+
mode?: undefined;
|
|
308
|
+
analysisDepth?: undefined;
|
|
309
|
+
question?: undefined;
|
|
310
|
+
categories?: undefined;
|
|
311
|
+
platforms?: undefined;
|
|
312
|
+
depth?: undefined;
|
|
313
|
+
};
|
|
314
|
+
required: string[];
|
|
315
|
+
};
|
|
316
|
+
} | {
|
|
317
|
+
name: string;
|
|
318
|
+
description: string;
|
|
319
|
+
inputSchema: {
|
|
320
|
+
type: string;
|
|
321
|
+
properties: {
|
|
322
|
+
platform: {
|
|
323
|
+
type: string;
|
|
324
|
+
enum: string[];
|
|
325
|
+
description: string;
|
|
326
|
+
};
|
|
327
|
+
contentId: {
|
|
328
|
+
type: string;
|
|
329
|
+
description: string;
|
|
330
|
+
};
|
|
331
|
+
question: {
|
|
332
|
+
type: string;
|
|
333
|
+
description: string;
|
|
334
|
+
};
|
|
335
|
+
query?: undefined;
|
|
336
|
+
limit?: undefined;
|
|
337
|
+
useVision?: undefined;
|
|
338
|
+
userId?: undefined;
|
|
339
|
+
url?: undefined;
|
|
340
|
+
mode?: undefined;
|
|
341
|
+
analysisDepth?: undefined;
|
|
342
|
+
clusterCount?: undefined;
|
|
343
|
+
includeExamples?: undefined;
|
|
344
|
+
weightByEngagement?: undefined;
|
|
345
|
+
categories?: undefined;
|
|
346
|
+
platforms?: undefined;
|
|
347
|
+
depth?: undefined;
|
|
348
|
+
};
|
|
349
|
+
required: string[];
|
|
350
|
+
};
|
|
351
|
+
} | {
|
|
352
|
+
name: string;
|
|
353
|
+
description: string;
|
|
354
|
+
inputSchema: {
|
|
355
|
+
type: string;
|
|
356
|
+
properties: {
|
|
357
|
+
platform: {
|
|
358
|
+
type: string;
|
|
359
|
+
enum: string[];
|
|
360
|
+
description: string;
|
|
361
|
+
};
|
|
362
|
+
contentId: {
|
|
363
|
+
type: string;
|
|
364
|
+
description: string;
|
|
365
|
+
};
|
|
366
|
+
categories: {
|
|
367
|
+
type: string;
|
|
368
|
+
items: {
|
|
369
|
+
type: string;
|
|
370
|
+
};
|
|
371
|
+
description: string;
|
|
372
|
+
};
|
|
373
|
+
query?: undefined;
|
|
374
|
+
limit?: undefined;
|
|
375
|
+
useVision?: undefined;
|
|
376
|
+
userId?: undefined;
|
|
377
|
+
url?: undefined;
|
|
378
|
+
mode?: undefined;
|
|
379
|
+
analysisDepth?: undefined;
|
|
380
|
+
clusterCount?: undefined;
|
|
381
|
+
includeExamples?: undefined;
|
|
382
|
+
weightByEngagement?: undefined;
|
|
383
|
+
question?: undefined;
|
|
384
|
+
platforms?: undefined;
|
|
385
|
+
depth?: undefined;
|
|
386
|
+
};
|
|
387
|
+
required: string[];
|
|
388
|
+
};
|
|
389
|
+
} | {
|
|
390
|
+
name: string;
|
|
391
|
+
description: string;
|
|
392
|
+
inputSchema: {
|
|
393
|
+
type: string;
|
|
394
|
+
properties: {
|
|
395
|
+
query: {
|
|
396
|
+
type: string;
|
|
397
|
+
description: string;
|
|
398
|
+
};
|
|
399
|
+
platforms: {
|
|
400
|
+
type: string;
|
|
401
|
+
items: {
|
|
402
|
+
type: string;
|
|
403
|
+
};
|
|
404
|
+
description: string;
|
|
405
|
+
};
|
|
406
|
+
depth: {
|
|
407
|
+
type: string;
|
|
408
|
+
enum: string[];
|
|
409
|
+
default: string;
|
|
410
|
+
description: string;
|
|
411
|
+
};
|
|
412
|
+
platform?: undefined;
|
|
413
|
+
limit?: undefined;
|
|
414
|
+
useVision?: undefined;
|
|
415
|
+
contentId?: undefined;
|
|
416
|
+
userId?: undefined;
|
|
417
|
+
url?: undefined;
|
|
418
|
+
mode?: undefined;
|
|
419
|
+
analysisDepth?: undefined;
|
|
420
|
+
clusterCount?: undefined;
|
|
421
|
+
includeExamples?: undefined;
|
|
422
|
+
weightByEngagement?: undefined;
|
|
423
|
+
question?: undefined;
|
|
424
|
+
categories?: undefined;
|
|
425
|
+
};
|
|
426
|
+
required: string[];
|
|
427
|
+
};
|
|
428
|
+
})[];
|
|
429
|
+
/**
|
|
430
|
+
* Handle an insights tool call. Returns a JSON string result.
|
|
431
|
+
* Lazily initializes the social media service on first call.
|
|
432
|
+
*/
|
|
433
|
+
export declare function handleInsightsTool(name: string, args: Record<string, unknown>): Promise<string>;
|
|
434
|
+
/** Tool name set for quick lookup */
|
|
435
|
+
export declare const INSIGHTS_TOOL_NAMES: Set<string>;
|
|
436
|
+
/** Clean up resources on shutdown */
|
|
437
|
+
export declare function cleanupInsights(): Promise<void>;
|