chat-agent-toolkit 1.2.32 → 1.2.34
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 +1 -1
- package/dist/research-agent.cjs.js.map +1 -1
- package/dist/research-agent.es.js +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/provider-logos/01-ai.png +0 -0
- package/src/provider-logos/anthropic.png +0 -0
- package/src/provider-logos/aws-bedrock.png +0 -0
- package/src/provider-logos/aws-sagemaker.png +0 -0
- package/src/provider-logos/azure-openai-service.png +0 -0
- package/src/provider-logos/chatglm.png +0 -0
- package/src/provider-logos/cohere.png +0 -0
- package/src/provider-logos/gemini.png +0 -0
- package/src/provider-logos/groqcloud.png +0 -0
- package/src/provider-logos/huggingface.png +0 -0
- package/src/provider-logos/jina.png +0 -0
- package/src/provider-logos/localai.png +0 -0
- package/src/provider-logos/mistral-ai.png +0 -0
- package/src/provider-logos/moonshot-ai.png +0 -0
- package/src/provider-logos/ollama.png +0 -0
- package/src/provider-logos/openai.png +0 -0
- package/src/provider-logos/openllm.png +0 -0
- package/src/provider-logos/openrouter.png +0 -0
- package/src/provider-logos/replicate.png +0 -0
- package/src/provider-logos/together-ai.png +0 -0
- package/src/provider-logos/tongyi.png +0 -0
- package/src/provider-logos/xorbits-inference.png +0 -0
- package/src/provider-logos/zhipu-ai.png +0 -0
- 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,193 +1,193 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions for working with AI models
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* List of model IDs that are free to use (no per-token cost)
|
|
7
|
-
* Updated regularly as providers change their pricing
|
|
8
|
-
*/
|
|
9
|
-
export const FREE_MODELS = new Set([
|
|
10
|
-
// OpenRouter free models
|
|
11
|
-
"meta-llama/llama-3.3-70b-instruct",
|
|
12
|
-
"nvidia/llama-3.1-nemotron-70b-instruct",
|
|
13
|
-
"qwen/qwen-2.5-72b-instruct",
|
|
14
|
-
"deepseek/deepseek-v3",
|
|
15
|
-
"deepseek/deepseek-r1",
|
|
16
|
-
"meta-llama/llama-4-scout-17b-16e-instruct",
|
|
17
|
-
|
|
18
|
-
// NVIDIA NIM free tier models
|
|
19
|
-
"moonshotai/kimi-k2.5",
|
|
20
|
-
"nvidia/nemotron-nano-12b-v2-vl",
|
|
21
|
-
"nvidia/llama-nemotron",
|
|
22
|
-
"qwen/qwen2.5",
|
|
23
|
-
"meta/llama-4",
|
|
24
|
-
|
|
25
|
-
// Groq free tier models
|
|
26
|
-
"deepseek-r1-distill-llama-70b",
|
|
27
|
-
"meta-llama/llama-4-maverick-17b-128e-instruct",
|
|
28
|
-
"meta-llama/llama-4-scout-17b-16e-instruct",
|
|
29
|
-
"llama-3.3-70b-versatile",
|
|
30
|
-
"llama-3.3-70b-specdec",
|
|
31
|
-
"llama-3.2-3b-preview",
|
|
32
|
-
"llama-3.2-11b-vision-preview",
|
|
33
|
-
"llama-3.2-90b-vision-preview",
|
|
34
|
-
"llama-3.1-70b-versatile",
|
|
35
|
-
"llama-3.1-8b-instant",
|
|
36
|
-
"mixtral-8x7b-32768",
|
|
37
|
-
|
|
38
|
-
// Cloudflare Workers AI (free tier)
|
|
39
|
-
"llama-4-scout-17b-16e-instruct",
|
|
40
|
-
"llama-3.3-70b-instruct-fp8-fast",
|
|
41
|
-
"llama-3.1-8b-instruct-fast",
|
|
42
|
-
"gemma-3-12b-it",
|
|
43
|
-
"mistral-small-3.1-24b-instruct",
|
|
44
|
-
"qwq-32b",
|
|
45
|
-
"qwen2.5-coder-32b-instruct",
|
|
46
|
-
"deepseek-r1-distill-qwen-32b",
|
|
47
|
-
]);
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Providers that offer free tiers with generous limits
|
|
51
|
-
*/
|
|
52
|
-
export const FREE_TIER_PROVIDERS = new Set([
|
|
53
|
-
"openrouter", // Free models available
|
|
54
|
-
"nvidia", // Free NIM tier
|
|
55
|
-
"groq", // Free tier with rate limits
|
|
56
|
-
]);
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Check if a model is free to use (no per-token cost)
|
|
60
|
-
* Note: Free models may have rate limits
|
|
61
|
-
*/
|
|
62
|
-
export function isModelFree(modelId: string): boolean {
|
|
63
|
-
return FREE_MODELS.has(modelId);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Check if a provider offers a free tier
|
|
68
|
-
*/
|
|
69
|
-
export function hasFreeTier(providerType: string): boolean {
|
|
70
|
-
return FREE_TIER_PROVIDERS.has(providerType.toLowerCase());
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Get a display name for a model with cost indicator
|
|
75
|
-
* Example: "Llama 3.3 70B (Free)" or "GPT-4o"
|
|
76
|
-
*/
|
|
77
|
-
export function getModelDisplayName(modelName: string, modelId: string): string {
|
|
78
|
-
const isFree = isModelFree(modelId);
|
|
79
|
-
|
|
80
|
-
// If already has "(Free)" in the name, return as-is
|
|
81
|
-
if (modelName.includes("(Free)")) {
|
|
82
|
-
return modelName;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return isFree ? `${modelName} (Free)` : modelName;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Get provider-specific information
|
|
90
|
-
*/
|
|
91
|
-
export function getProviderInfo(providerType: string): {
|
|
92
|
-
name: string;
|
|
93
|
-
hasFreeTier: boolean;
|
|
94
|
-
signupUrl: string;
|
|
95
|
-
docsUrl: string;
|
|
96
|
-
} {
|
|
97
|
-
const type = providerType.toLowerCase();
|
|
98
|
-
|
|
99
|
-
const providers: Record<string, any> = {
|
|
100
|
-
openrouter: {
|
|
101
|
-
name: "OpenRouter",
|
|
102
|
-
hasFreeTier: true,
|
|
103
|
-
signupUrl: "https://openrouter.ai",
|
|
104
|
-
docsUrl: "https://openrouter.ai/docs",
|
|
105
|
-
},
|
|
106
|
-
nvidia: {
|
|
107
|
-
name: "NVIDIA",
|
|
108
|
-
hasFreeTier: true,
|
|
109
|
-
signupUrl: "https://build.nvidia.com",
|
|
110
|
-
docsUrl: "https://docs.api.nvidia.com/nim/",
|
|
111
|
-
},
|
|
112
|
-
groq: {
|
|
113
|
-
name: "Groq",
|
|
114
|
-
hasFreeTier: true,
|
|
115
|
-
signupUrl: "https://console.groq.com",
|
|
116
|
-
docsUrl: "https://console.groq.com/docs",
|
|
117
|
-
},
|
|
118
|
-
anthropic: {
|
|
119
|
-
name: "Anthropic",
|
|
120
|
-
hasFreeTier: false,
|
|
121
|
-
signupUrl: "https://console.anthropic.com",
|
|
122
|
-
docsUrl: "https://docs.anthropic.com",
|
|
123
|
-
},
|
|
124
|
-
openai: {
|
|
125
|
-
name: "OpenAI",
|
|
126
|
-
hasFreeTier: false,
|
|
127
|
-
signupUrl: "https://platform.openai.com",
|
|
128
|
-
docsUrl: "https://platform.openai.com/docs",
|
|
129
|
-
},
|
|
130
|
-
google: {
|
|
131
|
-
name: "Google Gemini",
|
|
132
|
-
hasFreeTier: true,
|
|
133
|
-
signupUrl: "https://aistudio.google.com",
|
|
134
|
-
docsUrl: "https://ai.google.dev/docs",
|
|
135
|
-
},
|
|
136
|
-
gemini: {
|
|
137
|
-
name: "Google Gemini",
|
|
138
|
-
hasFreeTier: true,
|
|
139
|
-
signupUrl: "https://aistudio.google.com",
|
|
140
|
-
docsUrl: "https://ai.google.dev/docs",
|
|
141
|
-
},
|
|
142
|
-
deepseek: {
|
|
143
|
-
name: "DeepSeek",
|
|
144
|
-
hasFreeTier: false,
|
|
145
|
-
signupUrl: "https://platform.deepseek.com",
|
|
146
|
-
docsUrl: "https://platform.deepseek.com/docs",
|
|
147
|
-
},
|
|
148
|
-
cloudflare: {
|
|
149
|
-
name: "Cloudflare Workers AI",
|
|
150
|
-
hasFreeTier: true,
|
|
151
|
-
signupUrl: "https://dash.cloudflare.com",
|
|
152
|
-
docsUrl: "https://developers.cloudflare.com/workers-ai/",
|
|
153
|
-
},
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
return providers[type] || {
|
|
157
|
-
name: providerType,
|
|
158
|
-
hasFreeTier: false,
|
|
159
|
-
signupUrl: "",
|
|
160
|
-
docsUrl: "",
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Get recommended free providers for getting started
|
|
166
|
-
*/
|
|
167
|
-
export function getRecommendedFreeProviders(): Array<{
|
|
168
|
-
type: string;
|
|
169
|
-
name: string;
|
|
170
|
-
reason: string;
|
|
171
|
-
signupUrl: string;
|
|
172
|
-
}> {
|
|
173
|
-
return [
|
|
174
|
-
{
|
|
175
|
-
type: "openrouter",
|
|
176
|
-
name: "OpenRouter",
|
|
177
|
-
reason: "Access to Llama 3.3 70B, Nemotron, and other free models",
|
|
178
|
-
signupUrl: "https://openrouter.ai",
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
type: "groq",
|
|
182
|
-
name: "Groq",
|
|
183
|
-
reason: "Ultra-fast inference on Llama models, generous free tier",
|
|
184
|
-
signupUrl: "https://console.groq.com",
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
type: "nvidia",
|
|
188
|
-
name: "NVIDIA",
|
|
189
|
-
reason: "Free access to Nemotron and other powerful models",
|
|
190
|
-
signupUrl: "https://build.nvidia.com",
|
|
191
|
-
},
|
|
192
|
-
];
|
|
193
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for working with AI models
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* List of model IDs that are free to use (no per-token cost)
|
|
7
|
+
* Updated regularly as providers change their pricing
|
|
8
|
+
*/
|
|
9
|
+
export const FREE_MODELS = new Set([
|
|
10
|
+
// OpenRouter free models
|
|
11
|
+
"meta-llama/llama-3.3-70b-instruct",
|
|
12
|
+
"nvidia/llama-3.1-nemotron-70b-instruct",
|
|
13
|
+
"qwen/qwen-2.5-72b-instruct",
|
|
14
|
+
"deepseek/deepseek-v3",
|
|
15
|
+
"deepseek/deepseek-r1",
|
|
16
|
+
"meta-llama/llama-4-scout-17b-16e-instruct",
|
|
17
|
+
|
|
18
|
+
// NVIDIA NIM free tier models
|
|
19
|
+
"moonshotai/kimi-k2.5",
|
|
20
|
+
"nvidia/nemotron-nano-12b-v2-vl",
|
|
21
|
+
"nvidia/llama-nemotron",
|
|
22
|
+
"qwen/qwen2.5",
|
|
23
|
+
"meta/llama-4",
|
|
24
|
+
|
|
25
|
+
// Groq free tier models
|
|
26
|
+
"deepseek-r1-distill-llama-70b",
|
|
27
|
+
"meta-llama/llama-4-maverick-17b-128e-instruct",
|
|
28
|
+
"meta-llama/llama-4-scout-17b-16e-instruct",
|
|
29
|
+
"llama-3.3-70b-versatile",
|
|
30
|
+
"llama-3.3-70b-specdec",
|
|
31
|
+
"llama-3.2-3b-preview",
|
|
32
|
+
"llama-3.2-11b-vision-preview",
|
|
33
|
+
"llama-3.2-90b-vision-preview",
|
|
34
|
+
"llama-3.1-70b-versatile",
|
|
35
|
+
"llama-3.1-8b-instant",
|
|
36
|
+
"mixtral-8x7b-32768",
|
|
37
|
+
|
|
38
|
+
// Cloudflare Workers AI (free tier)
|
|
39
|
+
"llama-4-scout-17b-16e-instruct",
|
|
40
|
+
"llama-3.3-70b-instruct-fp8-fast",
|
|
41
|
+
"llama-3.1-8b-instruct-fast",
|
|
42
|
+
"gemma-3-12b-it",
|
|
43
|
+
"mistral-small-3.1-24b-instruct",
|
|
44
|
+
"qwq-32b",
|
|
45
|
+
"qwen2.5-coder-32b-instruct",
|
|
46
|
+
"deepseek-r1-distill-qwen-32b",
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Providers that offer free tiers with generous limits
|
|
51
|
+
*/
|
|
52
|
+
export const FREE_TIER_PROVIDERS = new Set([
|
|
53
|
+
"openrouter", // Free models available
|
|
54
|
+
"nvidia", // Free NIM tier
|
|
55
|
+
"groq", // Free tier with rate limits
|
|
56
|
+
]);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Check if a model is free to use (no per-token cost)
|
|
60
|
+
* Note: Free models may have rate limits
|
|
61
|
+
*/
|
|
62
|
+
export function isModelFree(modelId: string): boolean {
|
|
63
|
+
return FREE_MODELS.has(modelId);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Check if a provider offers a free tier
|
|
68
|
+
*/
|
|
69
|
+
export function hasFreeTier(providerType: string): boolean {
|
|
70
|
+
return FREE_TIER_PROVIDERS.has(providerType.toLowerCase());
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Get a display name for a model with cost indicator
|
|
75
|
+
* Example: "Llama 3.3 70B (Free)" or "GPT-4o"
|
|
76
|
+
*/
|
|
77
|
+
export function getModelDisplayName(modelName: string, modelId: string): string {
|
|
78
|
+
const isFree = isModelFree(modelId);
|
|
79
|
+
|
|
80
|
+
// If already has "(Free)" in the name, return as-is
|
|
81
|
+
if (modelName.includes("(Free)")) {
|
|
82
|
+
return modelName;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return isFree ? `${modelName} (Free)` : modelName;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Get provider-specific information
|
|
90
|
+
*/
|
|
91
|
+
export function getProviderInfo(providerType: string): {
|
|
92
|
+
name: string;
|
|
93
|
+
hasFreeTier: boolean;
|
|
94
|
+
signupUrl: string;
|
|
95
|
+
docsUrl: string;
|
|
96
|
+
} {
|
|
97
|
+
const type = providerType.toLowerCase();
|
|
98
|
+
|
|
99
|
+
const providers: Record<string, any> = {
|
|
100
|
+
openrouter: {
|
|
101
|
+
name: "OpenRouter",
|
|
102
|
+
hasFreeTier: true,
|
|
103
|
+
signupUrl: "https://openrouter.ai",
|
|
104
|
+
docsUrl: "https://openrouter.ai/docs",
|
|
105
|
+
},
|
|
106
|
+
nvidia: {
|
|
107
|
+
name: "NVIDIA",
|
|
108
|
+
hasFreeTier: true,
|
|
109
|
+
signupUrl: "https://build.nvidia.com",
|
|
110
|
+
docsUrl: "https://docs.api.nvidia.com/nim/",
|
|
111
|
+
},
|
|
112
|
+
groq: {
|
|
113
|
+
name: "Groq",
|
|
114
|
+
hasFreeTier: true,
|
|
115
|
+
signupUrl: "https://console.groq.com",
|
|
116
|
+
docsUrl: "https://console.groq.com/docs",
|
|
117
|
+
},
|
|
118
|
+
anthropic: {
|
|
119
|
+
name: "Anthropic",
|
|
120
|
+
hasFreeTier: false,
|
|
121
|
+
signupUrl: "https://console.anthropic.com",
|
|
122
|
+
docsUrl: "https://docs.anthropic.com",
|
|
123
|
+
},
|
|
124
|
+
openai: {
|
|
125
|
+
name: "OpenAI",
|
|
126
|
+
hasFreeTier: false,
|
|
127
|
+
signupUrl: "https://platform.openai.com",
|
|
128
|
+
docsUrl: "https://platform.openai.com/docs",
|
|
129
|
+
},
|
|
130
|
+
google: {
|
|
131
|
+
name: "Google Gemini",
|
|
132
|
+
hasFreeTier: true,
|
|
133
|
+
signupUrl: "https://aistudio.google.com",
|
|
134
|
+
docsUrl: "https://ai.google.dev/docs",
|
|
135
|
+
},
|
|
136
|
+
gemini: {
|
|
137
|
+
name: "Google Gemini",
|
|
138
|
+
hasFreeTier: true,
|
|
139
|
+
signupUrl: "https://aistudio.google.com",
|
|
140
|
+
docsUrl: "https://ai.google.dev/docs",
|
|
141
|
+
},
|
|
142
|
+
deepseek: {
|
|
143
|
+
name: "DeepSeek",
|
|
144
|
+
hasFreeTier: false,
|
|
145
|
+
signupUrl: "https://platform.deepseek.com",
|
|
146
|
+
docsUrl: "https://platform.deepseek.com/docs",
|
|
147
|
+
},
|
|
148
|
+
cloudflare: {
|
|
149
|
+
name: "Cloudflare Workers AI",
|
|
150
|
+
hasFreeTier: true,
|
|
151
|
+
signupUrl: "https://dash.cloudflare.com",
|
|
152
|
+
docsUrl: "https://developers.cloudflare.com/workers-ai/",
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
return providers[type] || {
|
|
157
|
+
name: providerType,
|
|
158
|
+
hasFreeTier: false,
|
|
159
|
+
signupUrl: "",
|
|
160
|
+
docsUrl: "",
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Get recommended free providers for getting started
|
|
166
|
+
*/
|
|
167
|
+
export function getRecommendedFreeProviders(): Array<{
|
|
168
|
+
type: string;
|
|
169
|
+
name: string;
|
|
170
|
+
reason: string;
|
|
171
|
+
signupUrl: string;
|
|
172
|
+
}> {
|
|
173
|
+
return [
|
|
174
|
+
{
|
|
175
|
+
type: "openrouter",
|
|
176
|
+
name: "OpenRouter",
|
|
177
|
+
reason: "Access to Llama 3.3 70B, Nemotron, and other free models",
|
|
178
|
+
signupUrl: "https://openrouter.ai",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: "groq",
|
|
182
|
+
name: "Groq",
|
|
183
|
+
reason: "Ultra-fast inference on Llama models, generous free tier",
|
|
184
|
+
signupUrl: "https://console.groq.com",
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
type: "nvidia",
|
|
188
|
+
name: "NVIDIA",
|
|
189
|
+
reason: "Free access to Nemotron and other powerful models",
|
|
190
|
+
signupUrl: "https://build.nvidia.com",
|
|
191
|
+
},
|
|
192
|
+
];
|
|
193
|
+
}
|