noverload-mcp 0.6.0-beta.1 → 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 +33 -21
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +327 -101
  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 -921
  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
package/dist/client.d.ts CHANGED
@@ -6,55 +6,55 @@ export interface ClientConfig {
6
6
  }
7
7
  export declare const ContentSchema: z.ZodObject<{
8
8
  id: z.ZodString;
9
- userId: z.ZodString;
9
+ userId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
10
10
  url: z.ZodString;
11
- title: z.ZodNullable<z.ZodString>;
12
- description: z.ZodNullable<z.ZodString>;
13
- contentType: z.ZodEnum<["youtube", "x_twitter", "reddit", "article", "pdf"]>;
14
- status: z.ZodEnum<["pending", "processing", "completed", "failed"]>;
15
- summary: z.ZodNullable<z.ZodAny>;
16
- keyInsights: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
11
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
+ contentType: z.ZodDefault<z.ZodOptional<z.ZodEnum<["youtube", "x_twitter", "reddit", "article", "pdf"]>>>;
14
+ status: z.ZodDefault<z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed"]>>>;
15
+ summary: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
16
+ keyInsights: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>>;
17
17
  rawText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
18
18
  tokenCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
19
19
  ogImage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
20
  processingMetadata: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
21
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
22
- createdAt: z.ZodString;
23
- updatedAt: z.ZodString;
21
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
22
+ createdAt: z.ZodDefault<z.ZodOptional<z.ZodString>>;
23
+ updatedAt: z.ZodDefault<z.ZodOptional<z.ZodString>>;
24
24
  }, "strip", z.ZodTypeAny, {
25
25
  id: string;
26
26
  userId: string;
27
27
  url: string;
28
- title: string | null;
29
- description: string | null;
30
28
  contentType: "youtube" | "x_twitter" | "reddit" | "article" | "pdf";
31
29
  status: "pending" | "processing" | "completed" | "failed";
32
30
  keyInsights: string[] | null;
31
+ tags: string[];
33
32
  createdAt: string;
34
33
  updatedAt: string;
34
+ title?: string | null | undefined;
35
+ description?: string | null | undefined;
35
36
  summary?: any;
36
37
  rawText?: string | null | undefined;
37
38
  tokenCount?: number | null | undefined;
38
39
  ogImage?: string | null | undefined;
39
40
  processingMetadata?: any;
40
- tags?: string[] | undefined;
41
41
  }, {
42
42
  id: string;
43
- userId: string;
44
43
  url: string;
45
- title: string | null;
46
- description: string | null;
47
- contentType: "youtube" | "x_twitter" | "reddit" | "article" | "pdf";
48
- status: "pending" | "processing" | "completed" | "failed";
49
- keyInsights: string[] | null;
50
- createdAt: string;
51
- updatedAt: string;
44
+ userId?: string | undefined;
45
+ title?: string | null | undefined;
46
+ description?: string | null | undefined;
47
+ contentType?: "youtube" | "x_twitter" | "reddit" | "article" | "pdf" | undefined;
48
+ status?: "pending" | "processing" | "completed" | "failed" | undefined;
52
49
  summary?: any;
50
+ keyInsights?: string[] | null | undefined;
53
51
  rawText?: string | null | undefined;
54
52
  tokenCount?: number | null | undefined;
55
53
  ogImage?: string | null | undefined;
56
54
  processingMetadata?: any;
57
55
  tags?: string[] | undefined;
56
+ createdAt?: string | undefined;
57
+ updatedAt?: string | undefined;
58
58
  }>;
59
59
  export declare const ActionSchema: z.ZodObject<{
60
60
  id: z.ZodString;
@@ -145,6 +145,16 @@ export declare class NoverloadClient {
145
145
  dateTo?: string;
146
146
  excludeDomains?: string[];
147
147
  enableConceptExpansion?: boolean;
148
+ searchMode?: "any" | "all" | "phrase";
149
+ fuzzyMatch?: boolean;
150
+ }): Promise<any>;
151
+ private searchContentV1;
152
+ searchContentV2(params: {
153
+ query: string;
154
+ mode?: "smart" | "semantic" | "fulltext" | "any" | "all" | "phrase";
155
+ limit?: number;
156
+ contentTypes?: string[];
157
+ includeContent?: boolean;
148
158
  }): Promise<any>;
149
159
  estimateSearchTokens(query: string, limit?: number): Promise<any>;
150
160
  synthesizeContent(params: {
@@ -155,10 +165,12 @@ export declare class NoverloadClient {
155
165
  findConnections?: boolean;
156
166
  maxSources?: number;
157
167
  }): Promise<any>;
168
+ private synthesizeContentV1;
158
169
  findSimilarContent(contentId: string, options?: {
159
170
  limit?: number;
160
171
  minSimilarity?: number;
161
172
  }): Promise<any>;
162
173
  batchGetContent(ids: string[], includeFullContent?: boolean): Promise<any>;
174
+ getEnrichedContent(ids: string[], includeFullContent?: boolean): Promise<any>;
163
175
  }
164
176
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW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E,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,GAAG,CAAC;IAqBrE,iBAAiB,CAAC,MAAM,EAAE;QAC9B,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,aAAa,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,YAAY,CAAC;QAClE,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,GAAG,OAAO,CAAC,GAAG,CAAC;YAgEF,mBAAmB;IAmD3B,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QACpD,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC,GAAG,CAAC;IAeV,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,kBAAkB,GAAE,OAAe,GAAG,OAAO,CAAC,GAAG,CAAC;IAoBjF,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,kBAAkB,GAAE,OAAe,GAAG,OAAO,CAAC,GAAG,CAAC;CAuC3F"}
package/dist/client.js CHANGED
@@ -1,22 +1,23 @@
1
1
  import { z } from "zod";
2
2
  // Schema definitions matching your Noverload database
3
+ // Made more flexible to handle API variations
3
4
  export const ContentSchema = z.object({
4
5
  id: z.string(),
5
- userId: z.string(),
6
+ userId: z.string().optional().default(""), // Made optional with default
6
7
  url: z.string(),
7
- title: z.string().nullable(),
8
- description: z.string().nullable(),
9
- contentType: z.enum(["youtube", "x_twitter", "reddit", "article", "pdf"]),
10
- status: z.enum(["pending", "processing", "completed", "failed"]),
11
- summary: z.any().nullable(), // Can be string or object
12
- keyInsights: z.array(z.string()).nullable(),
8
+ title: z.string().nullable().optional(),
9
+ description: z.string().nullable().optional(),
10
+ contentType: z.enum(["youtube", "x_twitter", "reddit", "article", "pdf"]).optional().default("article"),
11
+ status: z.enum(["pending", "processing", "completed", "failed"]).optional().default("completed"),
12
+ summary: z.any().nullable().optional(), // Can be string or object
13
+ keyInsights: z.array(z.string()).nullable().optional().default(null),
13
14
  rawText: z.string().nullable().optional(), // Full content text
14
15
  tokenCount: z.number().nullable().optional(), // Estimated token count for raw_text
15
16
  ogImage: z.string().nullable().optional(),
16
17
  processingMetadata: z.any().nullable().optional(),
17
- tags: z.array(z.string()).optional(), // Associated tags
18
- createdAt: z.string(),
19
- updatedAt: z.string(),
18
+ tags: z.array(z.string()).optional().default([]), // Associated tags with default
19
+ createdAt: z.string().optional().default(() => new Date().toISOString()),
20
+ updatedAt: z.string().optional().default(() => new Date().toISOString()),
20
21
  });
21
22
  export const ActionSchema = z.object({
22
23
  id: z.string(),
@@ -109,8 +110,27 @@ export class NoverloadClient {
109
110
  }
110
111
  const data = await response.json();
111
112
  // v2 returns { success, contents, pagination }
112
- const contents = data.contents || data;
113
- return z.array(ContentSchema).parse(contents);
113
+ const rawContents = data.contents || data;
114
+ // Transform and validate each item with defaults for missing fields
115
+ const transformedContents = Array.isArray(rawContents) ? rawContents.map((item) => ({
116
+ id: item.id || item._id || "",
117
+ userId: item.userId || item.user_id || "",
118
+ url: item.url || "",
119
+ title: item.title || null,
120
+ description: item.description || null,
121
+ contentType: item.contentType || item.content_type || "article",
122
+ status: item.status || "completed",
123
+ summary: item.summary || null,
124
+ keyInsights: item.keyInsights || item.key_insights || null,
125
+ rawText: item.rawText || item.raw_text || null,
126
+ tokenCount: item.tokenCount || item.token_count || null,
127
+ ogImage: item.ogImage || item.og_image || null,
128
+ processingMetadata: item.processingMetadata || item.processing_metadata || null,
129
+ tags: item.tags || [],
130
+ createdAt: item.createdAt || item.created_at || new Date().toISOString(),
131
+ updatedAt: item.updatedAt || item.updated_at || new Date().toISOString(),
132
+ })) : [];
133
+ return z.array(ContentSchema).parse(transformedContents);
114
134
  }
115
135
  async getContent(id) {
116
136
  const response = await this.request(`/api/mcp/v2/content?id=${id}`);
@@ -136,8 +156,27 @@ export class NoverloadClient {
136
156
  }
137
157
  const data = await response.json();
138
158
  // v2 returns { success, content }
139
- const content = data.content || data;
140
- return ContentSchema.parse(content);
159
+ const rawContent = data.content || data;
160
+ // Transform with defaults for missing fields
161
+ const transformedContent = {
162
+ id: rawContent.id || rawContent._id || "",
163
+ userId: rawContent.userId || rawContent.user_id || "",
164
+ url: rawContent.url || "",
165
+ title: rawContent.title || null,
166
+ description: rawContent.description || null,
167
+ contentType: rawContent.contentType || rawContent.content_type || "article",
168
+ status: rawContent.status || "completed",
169
+ summary: rawContent.summary || null,
170
+ keyInsights: rawContent.keyInsights || rawContent.key_insights || null,
171
+ rawText: rawContent.rawText || rawContent.raw_text || null,
172
+ tokenCount: rawContent.tokenCount || rawContent.token_count || null,
173
+ ogImage: rawContent.ogImage || rawContent.og_image || null,
174
+ processingMetadata: rawContent.processingMetadata || rawContent.processing_metadata || null,
175
+ tags: rawContent.tags || [],
176
+ createdAt: rawContent.createdAt || rawContent.created_at || new Date().toISOString(),
177
+ updatedAt: rawContent.updatedAt || rawContent.updated_at || new Date().toISOString(),
178
+ };
179
+ return ContentSchema.parse(transformedContent);
141
180
  }
142
181
  async saveContent(url) {
143
182
  if (this.config.readOnly) {
@@ -211,83 +250,162 @@ export class NoverloadClient {
211
250
  return z.array(GoalSchema).parse(data);
212
251
  }
213
252
  async searchContent(query, options) {
214
- // Use the enhanced search endpoint
215
- const params = new URLSearchParams({
216
- q: query,
217
- limit: (options?.limit || 10).toString(),
218
- });
219
- if (options?.includeFullContent)
220
- params.append("includeFullContent", "true");
221
- if (options?.contentTypes)
222
- params.append("contentTypes", options.contentTypes.join(","));
223
- if (options?.dateFrom)
224
- params.append("dateFrom", options.dateFrom);
225
- if (options?.dateTo)
226
- params.append("dateTo", options.dateTo);
227
- if (options?.tags)
228
- params.append("tags", options.tags.join(","));
229
- if (options?.excludeDomains)
230
- params.append("excludeDomains", options.excludeDomains.join(","));
231
- if (options?.enableConceptExpansion)
232
- params.append("enableConceptExpansion", "true");
233
- // Convert to v2 search format
234
- const v2Body = {
235
- query,
236
- mode: "smart",
237
- filters: {
238
- contentTypes: options?.contentTypes,
239
- dateRange: {
240
- from: options?.dateFrom,
241
- to: options?.dateTo,
253
+ // Try v2 search first with better configuration
254
+ try {
255
+ const v2Body = {
256
+ query,
257
+ mode: "smart", // Use smart mode for better results
258
+ filters: options?.contentTypes || options?.tags || options?.dateFrom ? {
259
+ contentTypes: options?.contentTypes,
260
+ dateRange: (options?.dateFrom || options?.dateTo) ? {
261
+ from: options?.dateFrom,
262
+ to: options?.dateTo,
263
+ } : undefined,
264
+ tags: options?.tags,
265
+ domains: options?.excludeDomains ? {
266
+ exclude: options.excludeDomains,
267
+ } : undefined,
268
+ } : undefined,
269
+ options: {
270
+ limit: options?.limit || 10,
271
+ includeContent: options?.includeFullContent || false,
272
+ fuzzy: options?.fuzzyMatch !== false, // Default to true for broader matches
242
273
  },
243
- tags: options?.tags,
244
- domains: {
245
- exclude: options?.excludeDomains,
274
+ features: {
275
+ expandConcepts: options?.enableConceptExpansion !== false, // Default to true
276
+ semanticSearch: true, // Enable semantic search by default
246
277
  },
247
- },
278
+ };
279
+ const response = await this.request(`/api/mcp/v2/search`, {
280
+ method: "POST",
281
+ body: JSON.stringify(v2Body),
282
+ });
283
+ if (!response.ok) {
284
+ // Fall back to v1 search if v2 fails
285
+ console.warn(`v2 search failed with status ${response.status}, trying v1 fallback`);
286
+ return this.searchContentV1(query, options);
287
+ }
288
+ const data = await response.json();
289
+ // v2 returns { success, query, results, pagination, metadata }
290
+ const results = data?.results || [];
291
+ if (Array.isArray(results) && results.length > 0) {
292
+ return results.map((item) => ({
293
+ id: item.id || item._id || "",
294
+ userId: item.userId || item.user_id || "",
295
+ url: item.url || "",
296
+ title: item.title || "Untitled",
297
+ description: item.description || (typeof item.summary === 'string' ? item.summary.slice(0, 500) : ""),
298
+ contentType: item.contentType || item.content_type || "article",
299
+ status: item.status || item.metadata?.processingStatus || "completed",
300
+ summary: item.summary || null,
301
+ keyInsights: item.keyInsights || item.key_insights || [],
302
+ rawText: item.rawText || item.raw_text || item.fullContent || null,
303
+ tokenCount: item.tokenCount || item.token_count || null,
304
+ ogImage: item.ogImage || item.og_image || null,
305
+ processingMetadata: item.processingMetadata || item.processing_metadata || null,
306
+ tags: item.tags || [],
307
+ createdAt: item.createdAt || item.created_at || item.metadata?.createdAt || new Date().toISOString(),
308
+ updatedAt: item.updatedAt || item.updated_at || item.metadata?.updatedAt || new Date().toISOString(),
309
+ relevanceScore: item.relevanceScore || item.score || 0,
310
+ }));
311
+ }
312
+ // If no results, try a fallback search with looser parameters
313
+ if (results.length === 0 && !options?.includeFullContent) {
314
+ console.log("No results found, trying broader search...");
315
+ return this.searchContentV1(query, options);
316
+ }
317
+ return [];
318
+ }
319
+ catch (error) {
320
+ console.error("v2 search error:", error);
321
+ // Fall back to v1 search
322
+ return this.searchContentV1(query, options);
323
+ }
324
+ }
325
+ // Fallback v1 search method for compatibility
326
+ async searchContentV1(query, options) {
327
+ try {
328
+ const params = new URLSearchParams({
329
+ q: query,
330
+ limit: (options?.limit || 10).toString(),
331
+ });
332
+ if (options?.includeFullContent)
333
+ params.append("includeFullContent", "true");
334
+ if (options?.contentTypes)
335
+ params.append("contentTypes", options.contentTypes.join(","));
336
+ if (options?.tags)
337
+ params.append("tags", options.tags.join(","));
338
+ const response = await this.request(`/api/mcp/search?${params}`);
339
+ if (!response.ok) {
340
+ console.error(`v1 search also failed: ${response.status}`);
341
+ return [];
342
+ }
343
+ const data = await response.json();
344
+ const results = Array.isArray(data) ? data : (data.results || []);
345
+ return results.map((item) => ({
346
+ id: item.id || item._id || "",
347
+ userId: item.userId || item.user_id || "",
348
+ url: item.url || "",
349
+ title: item.title || "Untitled",
350
+ description: item.description || "",
351
+ contentType: item.contentType || item.content_type || "article",
352
+ status: item.status || "completed",
353
+ summary: item.summary || null,
354
+ keyInsights: item.keyInsights || item.key_insights || [],
355
+ rawText: item.rawText || item.raw_text || null,
356
+ tokenCount: item.tokenCount || item.token_count || null,
357
+ ogImage: item.ogImage || item.og_image || null,
358
+ processingMetadata: item.processingMetadata || item.processing_metadata || null,
359
+ tags: item.tags || [],
360
+ createdAt: item.createdAt || item.created_at || new Date().toISOString(),
361
+ updatedAt: item.updatedAt || item.updated_at || new Date().toISOString(),
362
+ }));
363
+ }
364
+ catch (error) {
365
+ console.error("v1 search error:", error);
366
+ return [];
367
+ }
368
+ }
369
+ // New v2 search method with enhanced features
370
+ async searchContentV2(params) {
371
+ const body = {
372
+ query: params.query,
373
+ mode: params.mode || "smart",
374
+ filters: params.contentTypes ? {
375
+ contentTypes: params.contentTypes,
376
+ } : undefined,
248
377
  options: {
249
- limit: options?.limit || 10,
250
- includeContent: options?.includeFullContent || false,
378
+ limit: params.limit || 10,
379
+ includeContent: params.includeContent || false,
380
+ fuzzy: true,
251
381
  },
252
382
  features: {
253
- expandConcepts: options?.enableConceptExpansion || false,
383
+ expandConcepts: true,
384
+ semanticSearch: true,
254
385
  },
255
386
  };
256
387
  const response = await this.request(`/api/mcp/v2/search`, {
257
388
  method: "POST",
258
- body: JSON.stringify(v2Body),
389
+ body: JSON.stringify(body),
259
390
  });
260
391
  if (!response.ok) {
261
- const errorText = await response.text().catch(() => "Unknown error");
262
- console.error(`Search failed: ${response.status} - ${errorText}`);
263
- throw new Error("Search failed");
392
+ // Fall back to v1 search if v2 fails
393
+ console.warn(`v2 search failed with status ${response.status}, trying v1 fallback`);
394
+ return this.searchContentV1(params.query, {
395
+ limit: params.limit,
396
+ contentTypes: params.contentTypes,
397
+ includeFullContent: params.includeContent,
398
+ });
264
399
  }
265
400
  const data = await response.json();
266
- // v2 returns { success, query, results, pagination, metadata }
267
- const results = data?.results || [];
268
- if (Array.isArray(results)) {
269
- return results.map((item) => ({
270
- id: item.id,
271
- userId: item.userId || "",
272
- url: item.url || "",
273
- title: item.title,
274
- description: item.description || (typeof item.summary === 'string' ? item.summary.slice(0, 500) : ""),
275
- contentType: item.contentType || "article",
276
- status: item.metadata?.processingStatus || "completed",
277
- summary: item.summary, // Keep the full summary object
278
- keyInsights: item.keyInsights || [],
279
- rawText: item.rawText || item.fullContent || null, // Check both fields
280
- ogImage: item.ogImage || null,
281
- processingMetadata: item.processingMetadata || null,
282
- tags: item.tags || [], // Include tags
283
- createdAt: item.metadata?.createdAt || item.createdAt || new Date().toISOString(),
284
- updatedAt: item.metadata?.updatedAt || item.updatedAt || new Date().toISOString(),
285
- // Include relevance score for better sorting
286
- relevanceScore: item.relevanceScore,
401
+ // Map results to include aiInsights field
402
+ if (data.results) {
403
+ data.results = data.results.map((item) => ({
404
+ ...item,
405
+ aiInsights: item.ai_insights || item.aiInsights || item.processingMetadata?.ai_insights || {},
287
406
  }));
288
407
  }
289
- console.warn("No results found in search response");
290
- return [];
408
+ return data;
291
409
  }
292
410
  // New methods for enhanced endpoints
293
411
  async estimateSearchTokens(query, limit = 10) {
@@ -308,32 +426,104 @@ export class NoverloadClient {
308
426
  return data.estimate || data;
309
427
  }
310
428
  async synthesizeContent(params) {
311
- // Convert to v2 synthesis format
312
- const v2Body = {
313
- sources: {
314
- contentIds: params.contentIds,
315
- query: params.contentIds ? undefined : params.query,
316
- limit: params.maxSources,
317
- },
318
- synthesis: {
319
- mode: params.synthesisMode || "actionable",
320
- depth: "standard",
321
- },
322
- output: {
323
- includeContradictions: params.findContradictions,
324
- includeConnections: params.findConnections,
325
- includeQuotes: true,
326
- includeActionPlan: params.synthesisMode === "actionable",
327
- },
328
- };
329
- const response = await this.request("/api/mcp/v2/synthesis", {
330
- method: "POST",
331
- body: JSON.stringify(v2Body),
332
- });
333
- if (!response.ok) {
334
- throw new Error("Failed to synthesize content");
429
+ try {
430
+ // If no content IDs provided, search for relevant content first
431
+ let sourceIds = params.contentIds;
432
+ if (!sourceIds || sourceIds.length === 0) {
433
+ // Search for content related to the query
434
+ const searchResults = await this.searchContent(params.query, {
435
+ limit: params.maxSources || 5,
436
+ enableConceptExpansion: true,
437
+ });
438
+ if (searchResults && searchResults.length > 0) {
439
+ sourceIds = searchResults.map((item) => item.id).filter((id) => id);
440
+ }
441
+ if (!sourceIds || sourceIds.length === 0) {
442
+ return {
443
+ success: false,
444
+ error: "No content found to synthesize. Please save some content first or provide specific content IDs.",
445
+ synthesis: null,
446
+ };
447
+ }
448
+ }
449
+ // Try v2 synthesis endpoint
450
+ const v2Body = {
451
+ sources: {
452
+ contentIds: sourceIds,
453
+ limit: params.maxSources || 5,
454
+ },
455
+ synthesis: {
456
+ mode: params.synthesisMode || "actionable",
457
+ depth: "standard",
458
+ },
459
+ output: {
460
+ includeContradictions: params.findContradictions || false,
461
+ includeConnections: params.findConnections !== false, // Default true
462
+ includeQuotes: true,
463
+ includeActionPlan: params.synthesisMode === "actionable",
464
+ },
465
+ };
466
+ const response = await this.request("/api/mcp/v2/synthesis", {
467
+ method: "POST",
468
+ body: JSON.stringify(v2Body),
469
+ });
470
+ if (!response.ok) {
471
+ // Try fallback v1 synthesis
472
+ console.warn(`v2 synthesis failed with status ${response.status}, trying v1 fallback`);
473
+ return this.synthesizeContentV1(params, sourceIds);
474
+ }
475
+ const data = await response.json();
476
+ return data;
477
+ }
478
+ catch (error) {
479
+ console.error("Synthesis error:", error);
480
+ // Try v1 fallback
481
+ return this.synthesizeContentV1(params, params.contentIds);
482
+ }
483
+ }
484
+ // Fallback v1 synthesis method
485
+ async synthesizeContentV1(params, contentIds) {
486
+ try {
487
+ // If we don't have content IDs, we need to search first
488
+ if (!contentIds || contentIds.length === 0) {
489
+ const searchResults = await this.searchContent(params.query, {
490
+ limit: params.maxSources || 5,
491
+ });
492
+ if (!searchResults || searchResults.length === 0) {
493
+ return {
494
+ success: false,
495
+ error: "No content found to synthesize",
496
+ synthesis: null,
497
+ };
498
+ }
499
+ contentIds = searchResults.map((item) => item.id).filter((id) => id);
500
+ }
501
+ // Try a simpler synthesis approach
502
+ const response = await this.request("/api/mcp/synthesis", {
503
+ method: "POST",
504
+ body: JSON.stringify({
505
+ query: params.query,
506
+ contentIds: contentIds,
507
+ mode: params.synthesisMode || "actionable",
508
+ }),
509
+ });
510
+ if (!response.ok) {
511
+ const errorText = await response.text().catch(() => "Unknown error");
512
+ return {
513
+ success: false,
514
+ error: `Synthesis failed: ${errorText}`,
515
+ synthesis: null,
516
+ };
517
+ }
518
+ return response.json();
519
+ }
520
+ catch (error) {
521
+ return {
522
+ success: false,
523
+ error: `Synthesis error: ${error}`,
524
+ synthesis: null,
525
+ };
335
526
  }
336
- return response.json();
337
527
  }
338
528
  async findSimilarContent(contentId, options) {
339
529
  const params = new URLSearchParams();
@@ -365,5 +555,41 @@ export class NoverloadClient {
365
555
  }
366
556
  return response.json();
367
557
  }
558
+ async getEnrichedContent(ids, includeFullContent = false) {
559
+ try {
560
+ const response = await this.request("/api/mcp/v2/content", {
561
+ method: "POST",
562
+ body: JSON.stringify({
563
+ operation: "get",
564
+ contentIds: ids,
565
+ enrich: {
566
+ includeContent: includeFullContent,
567
+ includeActions: false,
568
+ includeConcepts: false,
569
+ includeRelated: false,
570
+ },
571
+ tokenOptions: {
572
+ requireConfirmation: false, // We handle confirmation in the tool
573
+ },
574
+ }),
575
+ });
576
+ if (!response.ok) {
577
+ console.error(`Get enriched content failed: ${response.status}`);
578
+ return [];
579
+ }
580
+ const data = await response.json();
581
+ // Handle confirmation requirement
582
+ if (data.requiresConfirmation) {
583
+ // For now, return empty - the tool will handle the warning
584
+ console.log("Content requires confirmation:", data.message);
585
+ return [];
586
+ }
587
+ return data.contents || [];
588
+ }
589
+ catch (error) {
590
+ console.error("Get enriched content error:", error);
591
+ return [];
592
+ }
593
+ }
368
594
  }
369
595
  //# sourceMappingURL=client.js.map