chat-agent-toolkit 1.2.33 → 1.2.35

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 (42) hide show
  1. package/dist/research-agent.cjs.js.map +1 -1
  2. package/dist/research-agent.es.js.map +1 -1
  3. package/package.json +1 -1
  4. package/src/config/config-manager.ts +295 -295
  5. package/src/config/config-types.ts +65 -65
  6. package/src/config/environment-variables.ts +16 -16
  7. package/src/config/index.ts +26 -26
  8. package/src/config/language-models-database.ts +1434 -1434
  9. package/src/config/mcp-server-registry.ts +24 -24
  10. package/src/config/model-registry.ts +271 -271
  11. package/src/config/model-tester.ts +211 -211
  12. package/src/config/model-utils.ts +193 -193
  13. package/src/config/provider-ui-config.ts +196 -196
  14. package/src/connectors/open-connector.json +130 -130
  15. package/src/index.ts +26 -26
  16. package/src/memory/ARCHITECTURE.md +302 -302
  17. package/src/memory/README.md +224 -224
  18. package/src/memory/agent-memory-manager.ts +416 -416
  19. package/src/memory/example.ts +343 -343
  20. package/src/memory/index.ts +47 -47
  21. package/src/memory/mastra-integration.ts +604 -604
  22. package/src/memory/storage/drizzle-storage.ts +236 -236
  23. package/src/memory/storage/in-memory-storage.ts +551 -551
  24. package/src/memory/storage/storage-interface.ts +68 -68
  25. package/src/memory/types.ts +125 -125
  26. package/src/models/types.ts +4 -4
  27. package/src/tools/index.ts +13 -13
  28. package/src/tools/open-connector-mastra.ts +270 -270
  29. package/src/tools/open-connector-mcp.ts +170 -170
  30. package/src/tools/qwksearch-api-tools.ts +326 -326
  31. package/src/tools/search/doc-utils.ts +139 -139
  32. package/src/tools/search/document.ts +47 -47
  33. package/src/tools/search/index.ts +14 -14
  34. package/src/tools/search/link-summarizer.ts +112 -112
  35. package/src/tools/search/meta-search-types.ts +62 -62
  36. package/src/tools/search/metaSearchAgent.ts +465 -465
  37. package/src/tools/search/search-handlers.ts +97 -97
  38. package/src/tools/search/suggestionGeneratorAgent.ts +56 -56
  39. package/src/types.d.ts +137 -137
  40. package/src/utils/index.ts +2 -2
  41. package/src/utils/markdown-to-html.ts +53 -53
  42. package/src/utils/outputParser.ts +73 -73
@@ -1,62 +1,62 @@
1
- /**
2
- * @module research/search/meta-search-types
3
- * @description Shared types for the MetaSearchAgent.
4
- */
5
- import type { LanguageModel } from "ai";
6
- import type EventEmitter from "events";
7
-
8
- /** A single conversation turn, matching the Vercel AI SDK message shape. */
9
- export interface ChatTurnMessage {
10
- role: "user" | "assistant" | "system";
11
- content: string;
12
- }
13
-
14
- /** A `[role, content]` tuple used for few-shot prompt examples. */
15
- export type FewShotExample = [role: "user" | "assistant", content: string];
16
-
17
- export interface MetaSearchAgentType {
18
- searchAndAnswer: (
19
- message: string,
20
- history: ChatTurnMessage[],
21
- llm: LanguageModel,
22
- optimizationMode: "speed" | "balanced" | "quality",
23
- fileIds: string[],
24
- systemInstructions: string,
25
- category?: string,
26
- sourceExtractionEnabled?: boolean,
27
- thinkingTimeLimit?: number,
28
- ) => Promise<EventEmitter>;
29
- }
30
-
31
- /** Emitted on the EventEmitter data channel to report live search progress. */
32
- export interface SearchingEvent {
33
- query: string;
34
- /** Display label shown in the UI (e.g. "Academic · max 10"). */
35
- category?: string;
36
- status: "running" | "done";
37
- }
38
-
39
- export interface Config {
40
- searchWeb: boolean;
41
- rerank: boolean;
42
- rerankThreshold: number;
43
- queryGeneratorPrompt: string;
44
- queryGeneratorFewShots: FewShotExample[];
45
- responsePrompt: string;
46
- activeEngines: string[];
47
- /** Optional: Function to fetch documents from URLs */
48
- getDocumentsFromLinks?: (options: { links: string[] }) => Promise<any[]>;
49
- /** Optional: Function to search via SearXNG */
50
- searchSearxng?: (query: string, options: any) => Promise<{ results: any[]; suggestions: string[] }>;
51
- /** Optional: Function to search via Tavily */
52
- searchTavily?: (query: string, options: any) => Promise<{ results: any[]; suggestions: string[] }>;
53
- /** Optional: Function to check if Tavily is configured */
54
- isTavilyConfigured?: () => boolean;
55
- /** Optional: Function to scrape a URL */
56
- scrapeURL?: (url: string, options: any) => Promise<string>;
57
- }
58
-
59
- export type BasicChainInput = {
60
- chat_history: ChatTurnMessage[];
61
- query: string;
62
- };
1
+ /**
2
+ * @module research/search/meta-search-types
3
+ * @description Shared types for the MetaSearchAgent.
4
+ */
5
+ import type { LanguageModel } from "ai";
6
+ import type EventEmitter from "events";
7
+
8
+ /** A single conversation turn, matching the Vercel AI SDK message shape. */
9
+ export interface ChatTurnMessage {
10
+ role: "user" | "assistant" | "system";
11
+ content: string;
12
+ }
13
+
14
+ /** A `[role, content]` tuple used for few-shot prompt examples. */
15
+ export type FewShotExample = [role: "user" | "assistant", content: string];
16
+
17
+ export interface MetaSearchAgentType {
18
+ searchAndAnswer: (
19
+ message: string,
20
+ history: ChatTurnMessage[],
21
+ llm: LanguageModel,
22
+ optimizationMode: "speed" | "balanced" | "quality",
23
+ fileIds: string[],
24
+ systemInstructions: string,
25
+ category?: string,
26
+ sourceExtractionEnabled?: boolean,
27
+ thinkingTimeLimit?: number,
28
+ ) => Promise<EventEmitter>;
29
+ }
30
+
31
+ /** Emitted on the EventEmitter data channel to report live search progress. */
32
+ export interface SearchingEvent {
33
+ query: string;
34
+ /** Display label shown in the UI (e.g. "Academic · max 10"). */
35
+ category?: string;
36
+ status: "running" | "done";
37
+ }
38
+
39
+ export interface Config {
40
+ searchWeb: boolean;
41
+ rerank: boolean;
42
+ rerankThreshold: number;
43
+ queryGeneratorPrompt: string;
44
+ queryGeneratorFewShots: FewShotExample[];
45
+ responsePrompt: string;
46
+ activeEngines: string[];
47
+ /** Optional: Function to fetch documents from URLs */
48
+ getDocumentsFromLinks?: (options: { links: string[] }) => Promise<any[]>;
49
+ /** Optional: Function to search via SearXNG */
50
+ searchSearxng?: (query: string, options: any) => Promise<{ results: any[]; suggestions: string[] }>;
51
+ /** Optional: Function to search via Tavily */
52
+ searchTavily?: (query: string, options: any) => Promise<{ results: any[]; suggestions: string[] }>;
53
+ /** Optional: Function to check if Tavily is configured */
54
+ isTavilyConfigured?: () => boolean;
55
+ /** Optional: Function to scrape a URL */
56
+ scrapeURL?: (url: string, options: any) => Promise<string>;
57
+ }
58
+
59
+ export type BasicChainInput = {
60
+ chat_history: ChatTurnMessage[];
61
+ query: string;
62
+ };