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.
- package/dist/research-agent.cjs.js.map +1 -1
- package/dist/research-agent.es.js.map +1 -1
- package/package.json +1 -1
- package/src/config/config-manager.ts +295 -295
- package/src/config/config-types.ts +65 -65
- package/src/config/environment-variables.ts +16 -16
- package/src/config/index.ts +26 -26
- package/src/config/language-models-database.ts +1434 -1434
- package/src/config/mcp-server-registry.ts +24 -24
- package/src/config/model-registry.ts +271 -271
- package/src/config/model-tester.ts +211 -211
- package/src/config/model-utils.ts +193 -193
- package/src/config/provider-ui-config.ts +196 -196
- package/src/connectors/open-connector.json +130 -130
- package/src/index.ts +26 -26
- package/src/memory/ARCHITECTURE.md +302 -302
- package/src/memory/README.md +224 -224
- package/src/memory/agent-memory-manager.ts +416 -416
- package/src/memory/example.ts +343 -343
- package/src/memory/index.ts +47 -47
- package/src/memory/mastra-integration.ts +604 -604
- package/src/memory/storage/drizzle-storage.ts +236 -236
- package/src/memory/storage/in-memory-storage.ts +551 -551
- package/src/memory/storage/storage-interface.ts +68 -68
- package/src/memory/types.ts +125 -125
- package/src/models/types.ts +4 -4
- package/src/tools/index.ts +13 -13
- package/src/tools/open-connector-mastra.ts +270 -270
- package/src/tools/open-connector-mcp.ts +170 -170
- package/src/tools/qwksearch-api-tools.ts +326 -326
- package/src/tools/search/doc-utils.ts +139 -139
- package/src/tools/search/document.ts +47 -47
- package/src/tools/search/index.ts +14 -14
- package/src/tools/search/link-summarizer.ts +112 -112
- package/src/tools/search/meta-search-types.ts +62 -62
- package/src/tools/search/metaSearchAgent.ts +465 -465
- package/src/tools/search/search-handlers.ts +97 -97
- package/src/tools/search/suggestionGeneratorAgent.ts +56 -56
- package/src/types.d.ts +137 -137
- package/src/utils/index.ts +2 -2
- package/src/utils/markdown-to-html.ts +53 -53
- 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
|
+
};
|