@involvex/super-agent-cli 0.0.45 → 0.0.47
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/bunfig.toml +43 -0
- package/dist/index.js +9 -15
- package/dist/super-agent-cli.exe +0 -0
- package/package.json +4 -1
- package/.grok/settings.json +0 -3
- package/.super-agent/settings.json +0 -23
- package/dist/agent/grok-agent.d.ts +0 -54
- package/dist/agent/grok-agent.js +0 -638
- package/dist/agent/grok-agent.js.map +0 -1
- package/dist/agent/index.d.ts +0 -14
- package/dist/agent/index.js +0 -139
- package/dist/agent/index.js.map +0 -1
- package/dist/agent/super-agent.d.ts +0 -54
- package/dist/agent/super-agent.js +0 -638
- package/dist/agent/super-agent.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -2
- package/dist/commands/mcp.js +0 -247
- package/dist/commands/mcp.js.map +0 -1
- package/dist/core/client.d.ts +0 -49
- package/dist/core/client.js +0 -81
- package/dist/core/client.js.map +0 -1
- package/dist/core/tools.d.ts +0 -8
- package/dist/core/tools.js +0 -351
- package/dist/core/tools.js.map +0 -1
- package/dist/grok/client.d.ts +0 -49
- package/dist/grok/client.js +0 -81
- package/dist/grok/client.js.map +0 -1
- package/dist/grok/tools.d.ts +0 -8
- package/dist/grok/tools.js +0 -351
- package/dist/grok/tools.js.map +0 -1
- package/dist/hooks/use-enhanced-input.d.ts +0 -37
- package/dist/hooks/use-enhanced-input.js +0 -228
- package/dist/hooks/use-enhanced-input.js.map +0 -1
- package/dist/hooks/use-input-handler.d.ts +0 -34
- package/dist/hooks/use-input-handler.js +0 -607
- package/dist/hooks/use-input-handler.js.map +0 -1
- package/dist/hooks/use-input-history.d.ts +0 -9
- package/dist/hooks/use-input-history.js +0 -62
- package/dist/hooks/use-input-history.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js.map +0 -1
- package/dist/mcp/client.d.ts +0 -29
- package/dist/mcp/client.js +0 -127
- package/dist/mcp/client.js.map +0 -1
- package/dist/mcp/config.d.ts +0 -13
- package/dist/mcp/config.js +0 -45
- package/dist/mcp/config.js.map +0 -1
- package/dist/mcp/transports.d.ts +0 -51
- package/dist/mcp/transports.js +0 -229
- package/dist/mcp/transports.js.map +0 -1
- package/dist/tools/bash.d.ts +0 -10
- package/dist/tools/bash.js +0 -76
- package/dist/tools/bash.js.map +0 -1
- package/dist/tools/confirmation-tool.d.ts +0 -16
- package/dist/tools/confirmation-tool.js +0 -77
- package/dist/tools/confirmation-tool.js.map +0 -1
- package/dist/tools/index.d.ts +0 -6
- package/dist/tools/index.js +0 -7
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/morph-editor.d.ts +0 -36
- package/dist/tools/morph-editor.js +0 -324
- package/dist/tools/morph-editor.js.map +0 -1
- package/dist/tools/search.d.ts +0 -69
- package/dist/tools/search.js +0 -307
- package/dist/tools/search.js.map +0 -1
- package/dist/tools/text-editor.d.ts +0 -26
- package/dist/tools/text-editor.js +0 -583
- package/dist/tools/text-editor.js.map +0 -1
- package/dist/tools/todo-tool.d.ts +0 -20
- package/dist/tools/todo-tool.js +0 -134
- package/dist/tools/todo-tool.js.map +0 -1
- package/dist/types/index.d.ts +0 -30
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/ui/app.d.ts +0 -6
- package/dist/ui/app.js +0 -76
- package/dist/ui/app.js.map +0 -1
- package/dist/ui/components/api-key-input.d.ts +0 -6
- package/dist/ui/components/api-key-input.js +0 -70
- package/dist/ui/components/api-key-input.js.map +0 -1
- package/dist/ui/components/chat-history.d.ts +0 -7
- package/dist/ui/components/chat-history.js +0 -136
- package/dist/ui/components/chat-history.js.map +0 -1
- package/dist/ui/components/chat-input.d.ts +0 -8
- package/dist/ui/components/chat-input.js +0 -47
- package/dist/ui/components/chat-input.js.map +0 -1
- package/dist/ui/components/chat-interface.d.ts +0 -7
- package/dist/ui/components/chat-interface.js +0 -213
- package/dist/ui/components/chat-interface.js.map +0 -1
- package/dist/ui/components/command-suggestions.d.ts +0 -16
- package/dist/ui/components/command-suggestions.js +0 -18
- package/dist/ui/components/command-suggestions.js.map +0 -1
- package/dist/ui/components/confirmation-dialog.d.ts +0 -10
- package/dist/ui/components/confirmation-dialog.js +0 -70
- package/dist/ui/components/confirmation-dialog.js.map +0 -1
- package/dist/ui/components/diff-renderer.d.ts +0 -13
- package/dist/ui/components/diff-renderer.js +0 -200
- package/dist/ui/components/diff-renderer.js.map +0 -1
- package/dist/ui/components/loading-spinner.d.ts +0 -7
- package/dist/ui/components/loading-spinner.js +0 -52
- package/dist/ui/components/loading-spinner.js.map +0 -1
- package/dist/ui/components/mcp-status.d.ts +0 -4
- package/dist/ui/components/mcp-status.js +0 -37
- package/dist/ui/components/mcp-status.js.map +0 -1
- package/dist/ui/components/model-selection.d.ts +0 -11
- package/dist/ui/components/model-selection.js +0 -9
- package/dist/ui/components/model-selection.js.map +0 -1
- package/dist/ui/shared/max-sized-box.d.ts +0 -8
- package/dist/ui/shared/max-sized-box.js +0 -6
- package/dist/ui/shared/max-sized-box.js.map +0 -1
- package/dist/ui/utils/code-colorizer.d.ts +0 -2
- package/dist/ui/utils/code-colorizer.js +0 -7
- package/dist/ui/utils/code-colorizer.js.map +0 -1
- package/dist/ui/utils/colors.d.ts +0 -14
- package/dist/ui/utils/colors.js +0 -15
- package/dist/ui/utils/colors.js.map +0 -1
- package/dist/ui/utils/markdown-renderer.d.ts +0 -3
- package/dist/ui/utils/markdown-renderer.js +0 -23
- package/dist/ui/utils/markdown-renderer.js.map +0 -1
- package/dist/utils/confirmation-service.d.ts +0 -33
- package/dist/utils/confirmation-service.js +0 -110
- package/dist/utils/confirmation-service.js.map +0 -1
- package/dist/utils/custom-instructions.d.ts +0 -1
- package/dist/utils/custom-instructions.js +0 -23
- package/dist/utils/custom-instructions.js.map +0 -1
- package/dist/utils/model-config.d.ts +0 -28
- package/dist/utils/model-config.js +0 -42
- package/dist/utils/model-config.js.map +0 -1
- package/dist/utils/settings-manager.d.ts +0 -99
- package/dist/utils/settings-manager.js +0 -286
- package/dist/utils/settings-manager.js.map +0 -1
- package/dist/utils/settings.d.ts +0 -1
- package/dist/utils/settings.js +0 -4
- package/dist/utils/settings.js.map +0 -1
- package/dist/utils/text-utils.d.ts +0 -80
- package/dist/utils/text-utils.js +0 -191
- package/dist/utils/text-utils.js.map +0 -1
- package/dist/utils/token-counter.d.ts +0 -33
- package/dist/utils/token-counter.js +0 -79
- package/dist/utils/token-counter.js.map +0 -1
package/dist/core/tools.js
DELETED
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
import { MCPManager } from "../mcp/client";
|
|
2
|
-
import { loadMCPConfig } from "../mcp/config";
|
|
3
|
-
const BASE_SUPER_AGENT_TOOLS = [
|
|
4
|
-
{
|
|
5
|
-
type: "function",
|
|
6
|
-
function: {
|
|
7
|
-
name: "view_file",
|
|
8
|
-
description: "View contents of a file or list directory contents",
|
|
9
|
-
parameters: {
|
|
10
|
-
type: "object",
|
|
11
|
-
properties: {
|
|
12
|
-
path: {
|
|
13
|
-
type: "string",
|
|
14
|
-
description: "Path to file or directory to view",
|
|
15
|
-
},
|
|
16
|
-
start_line: {
|
|
17
|
-
type: "number",
|
|
18
|
-
description: "Starting line number for partial file view (optional)",
|
|
19
|
-
},
|
|
20
|
-
end_line: {
|
|
21
|
-
type: "number",
|
|
22
|
-
description: "Ending line number for partial file view (optional)",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
required: ["path"],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
type: "function",
|
|
31
|
-
function: {
|
|
32
|
-
name: "create_file",
|
|
33
|
-
description: "Create a new file with specified content",
|
|
34
|
-
parameters: {
|
|
35
|
-
type: "object",
|
|
36
|
-
properties: {
|
|
37
|
-
path: {
|
|
38
|
-
type: "string",
|
|
39
|
-
description: "Path where the file should be created",
|
|
40
|
-
},
|
|
41
|
-
content: {
|
|
42
|
-
type: "string",
|
|
43
|
-
description: "Content to write to the file",
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
required: ["path", "content"],
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
type: "function",
|
|
52
|
-
function: {
|
|
53
|
-
name: "str_replace_editor",
|
|
54
|
-
description: "Replace specific text in a file. Use this for single line edits only",
|
|
55
|
-
parameters: {
|
|
56
|
-
type: "object",
|
|
57
|
-
properties: {
|
|
58
|
-
path: {
|
|
59
|
-
type: "string",
|
|
60
|
-
description: "Path to the file to edit",
|
|
61
|
-
},
|
|
62
|
-
old_str: {
|
|
63
|
-
type: "string",
|
|
64
|
-
description: "Text to replace (must match exactly, or will use fuzzy matching for multi-line strings)",
|
|
65
|
-
},
|
|
66
|
-
new_str: {
|
|
67
|
-
type: "string",
|
|
68
|
-
description: "Text to replace with",
|
|
69
|
-
},
|
|
70
|
-
replace_all: {
|
|
71
|
-
type: "boolean",
|
|
72
|
-
description: "Replace all occurrences (default: false, only replaces first occurrence)",
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
required: ["path", "old_str", "new_str"],
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
type: "function",
|
|
81
|
-
function: {
|
|
82
|
-
name: "bash",
|
|
83
|
-
description: "Execute a bash command",
|
|
84
|
-
parameters: {
|
|
85
|
-
type: "object",
|
|
86
|
-
properties: {
|
|
87
|
-
command: {
|
|
88
|
-
type: "string",
|
|
89
|
-
description: "The bash command to execute",
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
required: ["command"],
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
type: "function",
|
|
98
|
-
function: {
|
|
99
|
-
name: "search",
|
|
100
|
-
description: "Unified search tool for finding text content or files (similar to Cursor's search)",
|
|
101
|
-
parameters: {
|
|
102
|
-
type: "object",
|
|
103
|
-
properties: {
|
|
104
|
-
query: {
|
|
105
|
-
type: "string",
|
|
106
|
-
description: "Text to search for or file name/path pattern",
|
|
107
|
-
},
|
|
108
|
-
search_type: {
|
|
109
|
-
type: "string",
|
|
110
|
-
enum: ["text", "files", "both"],
|
|
111
|
-
description: "Type of search: 'text' for content search, 'files' for file names, 'both' for both (default: 'both')",
|
|
112
|
-
},
|
|
113
|
-
include_pattern: {
|
|
114
|
-
type: "string",
|
|
115
|
-
description: "Glob pattern for files to include (e.g. '*.ts', '*.js')",
|
|
116
|
-
},
|
|
117
|
-
exclude_pattern: {
|
|
118
|
-
type: "string",
|
|
119
|
-
description: "Glob pattern for files to exclude (e.g. '*.log', 'node_modules')",
|
|
120
|
-
},
|
|
121
|
-
case_sensitive: {
|
|
122
|
-
type: "boolean",
|
|
123
|
-
description: "Whether search should be case sensitive (default: false)",
|
|
124
|
-
},
|
|
125
|
-
whole_word: {
|
|
126
|
-
type: "boolean",
|
|
127
|
-
description: "Whether to match whole words only (default: false)",
|
|
128
|
-
},
|
|
129
|
-
regex: {
|
|
130
|
-
type: "boolean",
|
|
131
|
-
description: "Whether query is a regex pattern (default: false)",
|
|
132
|
-
},
|
|
133
|
-
max_results: {
|
|
134
|
-
type: "number",
|
|
135
|
-
description: "Maximum number of results to return (default: 50)",
|
|
136
|
-
},
|
|
137
|
-
file_types: {
|
|
138
|
-
type: "array",
|
|
139
|
-
items: { type: "string" },
|
|
140
|
-
description: "File types to search (e.g. ['js', 'ts', 'py'])",
|
|
141
|
-
},
|
|
142
|
-
include_hidden: {
|
|
143
|
-
type: "boolean",
|
|
144
|
-
description: "Whether to include hidden files (default: false)",
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
required: ["query"],
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
type: "function",
|
|
153
|
-
function: {
|
|
154
|
-
name: "create_todo_list",
|
|
155
|
-
description: "Create a new todo list for planning and tracking tasks",
|
|
156
|
-
parameters: {
|
|
157
|
-
type: "object",
|
|
158
|
-
properties: {
|
|
159
|
-
todos: {
|
|
160
|
-
type: "array",
|
|
161
|
-
description: "Array of todo items",
|
|
162
|
-
items: {
|
|
163
|
-
type: "object",
|
|
164
|
-
properties: {
|
|
165
|
-
id: {
|
|
166
|
-
type: "string",
|
|
167
|
-
description: "Unique identifier for the todo item",
|
|
168
|
-
},
|
|
169
|
-
content: {
|
|
170
|
-
type: "string",
|
|
171
|
-
description: "Description of the todo item",
|
|
172
|
-
},
|
|
173
|
-
status: {
|
|
174
|
-
type: "string",
|
|
175
|
-
enum: ["pending", "in_progress", "completed"],
|
|
176
|
-
description: "Current status of the todo item",
|
|
177
|
-
},
|
|
178
|
-
priority: {
|
|
179
|
-
type: "string",
|
|
180
|
-
enum: ["high", "medium", "low"],
|
|
181
|
-
description: "Priority level of the todo item",
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
required: ["id", "content", "status", "priority"],
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
required: ["todos"],
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
type: "function",
|
|
194
|
-
function: {
|
|
195
|
-
name: "update_todo_list",
|
|
196
|
-
description: "Update existing todos in the todo list",
|
|
197
|
-
parameters: {
|
|
198
|
-
type: "object",
|
|
199
|
-
properties: {
|
|
200
|
-
updates: {
|
|
201
|
-
type: "array",
|
|
202
|
-
description: "Array of todo updates",
|
|
203
|
-
items: {
|
|
204
|
-
type: "object",
|
|
205
|
-
properties: {
|
|
206
|
-
id: {
|
|
207
|
-
type: "string",
|
|
208
|
-
description: "ID of the todo item to update",
|
|
209
|
-
},
|
|
210
|
-
status: {
|
|
211
|
-
type: "string",
|
|
212
|
-
enum: ["pending", "in_progress", "completed"],
|
|
213
|
-
description: "New status for the todo item",
|
|
214
|
-
},
|
|
215
|
-
content: {
|
|
216
|
-
type: "string",
|
|
217
|
-
description: "New content for the todo item",
|
|
218
|
-
},
|
|
219
|
-
priority: {
|
|
220
|
-
type: "string",
|
|
221
|
-
enum: ["high", "medium", "low"],
|
|
222
|
-
description: "New priority for the todo item",
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
required: ["id"],
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
required: ["updates"],
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
];
|
|
234
|
-
// Morph Fast Apply tool (conditional)
|
|
235
|
-
const MORPH_EDIT_TOOL = {
|
|
236
|
-
type: "function",
|
|
237
|
-
function: {
|
|
238
|
-
name: "edit_file",
|
|
239
|
-
description: "Use this tool to make an edit to an existing file.\n\nThis will be read by a less intelligent model, which will quickly apply the edit. You should make it clear what the edit is, while also minimizing the unchanged code you write.\nWhen writing the edit, you should specify each edit in sequence, with the special comment // ... existing code ... to represent unchanged code in between edited lines.\n\nFor example:\n\n// ... existing code ...\nFIRST_EDIT\n// ... existing code ...\nSECOND_EDIT\n// ... existing code ...\nTHIRD_EDIT\n// ... existing code ...\n\nYou should still bias towards repeating as few lines of the original file as possible to convey the change.\nBut, each edit should contain sufficient context of unchanged lines around the code you're editing to resolve ambiguity.\nDO NOT omit spans of pre-existing code (or comments) without using the // ... existing code ... comment to indicate its absence. If you omit the existing code comment, the model may inadvertently delete these lines.\nIf you plan on deleting a section, you must provide context before and after to delete it. If the initial code is ```code \\n Block 1 \\n Block 2 \\n Block 3 \\n code```, and you want to remove Block 2, you would output ```// ... existing code ... \\n Block 1 \\n Block 3 \\n // ... existing code ...```.\nMake sure it is clear what the edit should be, and where it should be applied.\nMake edits to a file in a single edit_file call instead of multiple edit_file calls to the same file. The apply model can handle many distinct edits at once.",
|
|
240
|
-
parameters: {
|
|
241
|
-
type: "object",
|
|
242
|
-
properties: {
|
|
243
|
-
target_file: {
|
|
244
|
-
type: "string",
|
|
245
|
-
description: "The target file to modify.",
|
|
246
|
-
},
|
|
247
|
-
instructions: {
|
|
248
|
-
type: "string",
|
|
249
|
-
description: "A single sentence instruction describing what you are going to do for the sketched edit. This is used to assist the less intelligent model in applying the edit. Use the first person to describe what you are going to do. Use it to disambiguate uncertainty in the edit.",
|
|
250
|
-
},
|
|
251
|
-
code_edit: {
|
|
252
|
-
type: "string",
|
|
253
|
-
description: "Specify ONLY the precise lines of code that you wish to edit. NEVER specify or write out unchanged code. Instead, represent all unchanged code using the comment of the language you're editing in - example: // ... existing code ...",
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
required: ["target_file", "instructions", "code_edit"],
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
};
|
|
260
|
-
// Function to build tools array conditionally
|
|
261
|
-
function buildSuperAgentTools() {
|
|
262
|
-
const tools = [...BASE_SUPER_AGENT_TOOLS];
|
|
263
|
-
// Add Morph Fast Apply tool if API key is available
|
|
264
|
-
if (process.env.MORPH_API_KEY) {
|
|
265
|
-
tools.splice(3, 0, MORPH_EDIT_TOOL); // Insert after str_replace_editor
|
|
266
|
-
}
|
|
267
|
-
return tools;
|
|
268
|
-
}
|
|
269
|
-
// Export dynamic tools array
|
|
270
|
-
export const SUPER_AGENT_TOOLS = buildSuperAgentTools();
|
|
271
|
-
// Global MCP manager instance
|
|
272
|
-
let mcpManager = null;
|
|
273
|
-
export function getMCPManager() {
|
|
274
|
-
if (!mcpManager) {
|
|
275
|
-
mcpManager = new MCPManager();
|
|
276
|
-
}
|
|
277
|
-
return mcpManager;
|
|
278
|
-
}
|
|
279
|
-
export async function initializeMCPServers() {
|
|
280
|
-
const manager = getMCPManager();
|
|
281
|
-
const config = loadMCPConfig();
|
|
282
|
-
// Store original stderr.write
|
|
283
|
-
const originalStderrWrite = process.stderr.write;
|
|
284
|
-
// Temporarily suppress stderr to hide verbose MCP connection logs
|
|
285
|
-
process.stderr.write = function (chunk, encoding, callback) {
|
|
286
|
-
// Filter out mcp-remote verbose logs
|
|
287
|
-
const chunkStr = chunk.toString();
|
|
288
|
-
if (chunkStr.includes("[") &&
|
|
289
|
-
(chunkStr.includes("Using existing client port") ||
|
|
290
|
-
chunkStr.includes("Connecting to remote server") ||
|
|
291
|
-
chunkStr.includes("Using transport strategy") ||
|
|
292
|
-
chunkStr.includes("Connected to remote server") ||
|
|
293
|
-
chunkStr.includes("Local STDIO server running") ||
|
|
294
|
-
chunkStr.includes("Proxy established successfully") ||
|
|
295
|
-
chunkStr.includes("Local→Remote") ||
|
|
296
|
-
chunkStr.includes("Remote→Local"))) {
|
|
297
|
-
// Suppress these verbose logs
|
|
298
|
-
if (callback) {
|
|
299
|
-
callback();
|
|
300
|
-
}
|
|
301
|
-
return true;
|
|
302
|
-
}
|
|
303
|
-
// Allow other stderr output
|
|
304
|
-
return originalStderrWrite.call(this, chunk, encoding, callback);
|
|
305
|
-
};
|
|
306
|
-
try {
|
|
307
|
-
for (const serverConfig of config.servers) {
|
|
308
|
-
try {
|
|
309
|
-
await manager.addServer(serverConfig);
|
|
310
|
-
}
|
|
311
|
-
catch (error) {
|
|
312
|
-
console.warn(`Failed to initialize MCP server ${serverConfig.name}:`, error);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
finally {
|
|
317
|
-
// Restore original stderr.write
|
|
318
|
-
process.stderr.write = originalStderrWrite;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
export function convertMCPToolToSuperAgentTool(mcpTool) {
|
|
322
|
-
return {
|
|
323
|
-
type: "function",
|
|
324
|
-
function: {
|
|
325
|
-
name: mcpTool.name,
|
|
326
|
-
description: mcpTool.description,
|
|
327
|
-
parameters: mcpTool.inputSchema || {
|
|
328
|
-
type: "object",
|
|
329
|
-
properties: {},
|
|
330
|
-
required: [],
|
|
331
|
-
},
|
|
332
|
-
},
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
export function addMCPToolsToSuperAgentTools(baseTools) {
|
|
336
|
-
if (!mcpManager) {
|
|
337
|
-
return baseTools;
|
|
338
|
-
}
|
|
339
|
-
const mcpTools = mcpManager.getTools();
|
|
340
|
-
const grokMCPTools = mcpTools.map(convertMCPToolToSuperAgentTool);
|
|
341
|
-
return [...baseTools, ...grokMCPTools];
|
|
342
|
-
}
|
|
343
|
-
export async function getAllSuperAgentTools() {
|
|
344
|
-
const manager = getMCPManager();
|
|
345
|
-
// Try to initialize servers if not already done, but don't block
|
|
346
|
-
manager.ensureServersInitialized().catch(() => {
|
|
347
|
-
// Ignore initialization errors to avoid blocking
|
|
348
|
-
});
|
|
349
|
-
return addMCPToolsToSuperAgentTools(SUPER_AGENT_TOOLS);
|
|
350
|
-
}
|
|
351
|
-
//# sourceMappingURL=tools.js.map
|
package/dist/core/tools.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/core/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG9C,MAAM,sBAAsB,GAAqB;IAC/C;QACE,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,oDAAoD;YACjE,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,mCAAmC;qBACjD;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,WAAW,EACT,uDAAuD;qBAC1D;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,qDAAqD;qBACnE;iBACF;gBACD,QAAQ,EAAE,CAAC,MAAM,CAAC;aACnB;SACF;KACF;IACD;QACE,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,0CAA0C;YACvD,UAAU,EAAE;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D,CAAC"}
|
package/dist/grok/client.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ChatCompletionMessageParam } from "openai/resources/chat";
|
|
2
|
-
export type GrokMessage = ChatCompletionMessageParam;
|
|
3
|
-
export interface GrokTool {
|
|
4
|
-
type: "function";
|
|
5
|
-
function: {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
parameters: {
|
|
9
|
-
type: "object";
|
|
10
|
-
properties: Record<string, any>;
|
|
11
|
-
required: string[];
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export interface GrokToolCall {
|
|
16
|
-
id: string;
|
|
17
|
-
type: "function";
|
|
18
|
-
function: {
|
|
19
|
-
name: string;
|
|
20
|
-
arguments: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface SearchParameters {
|
|
24
|
-
mode?: "auto" | "on" | "off";
|
|
25
|
-
}
|
|
26
|
-
export interface SearchOptions {
|
|
27
|
-
search_parameters?: SearchParameters;
|
|
28
|
-
}
|
|
29
|
-
export interface GrokResponse {
|
|
30
|
-
choices: Array<{
|
|
31
|
-
message: {
|
|
32
|
-
role: string;
|
|
33
|
-
content: string | null;
|
|
34
|
-
tool_calls?: GrokToolCall[];
|
|
35
|
-
};
|
|
36
|
-
finish_reason: string;
|
|
37
|
-
}>;
|
|
38
|
-
}
|
|
39
|
-
export declare class GrokClient {
|
|
40
|
-
private client;
|
|
41
|
-
private currentModel;
|
|
42
|
-
private defaultMaxTokens;
|
|
43
|
-
constructor(apiKey: string, model?: string, baseURL?: string);
|
|
44
|
-
setModel(model: string): void;
|
|
45
|
-
getCurrentModel(): string;
|
|
46
|
-
chat(messages: GrokMessage[], tools?: GrokTool[], model?: string, searchOptions?: SearchOptions): Promise<GrokResponse>;
|
|
47
|
-
chatStream(messages: GrokMessage[], tools?: GrokTool[], model?: string, searchOptions?: SearchOptions): AsyncGenerator<any, void, unknown>;
|
|
48
|
-
search(query: string, searchParameters?: SearchParameters): Promise<GrokResponse>;
|
|
49
|
-
}
|
package/dist/grok/client.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import OpenAI from "openai";
|
|
2
|
-
export class GrokClient {
|
|
3
|
-
client;
|
|
4
|
-
currentModel = "grok-code-fast-1";
|
|
5
|
-
defaultMaxTokens;
|
|
6
|
-
constructor(apiKey, model, baseURL) {
|
|
7
|
-
this.client = new OpenAI({
|
|
8
|
-
apiKey,
|
|
9
|
-
baseURL: baseURL || process.env.GROK_BASE_URL || "https://api.x.ai/v1",
|
|
10
|
-
timeout: 360000,
|
|
11
|
-
});
|
|
12
|
-
const envMax = Number(process.env.GROK_MAX_TOKENS);
|
|
13
|
-
this.defaultMaxTokens =
|
|
14
|
-
Number.isFinite(envMax) && envMax > 0 ? envMax : 1536;
|
|
15
|
-
if (model) {
|
|
16
|
-
this.currentModel = model;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
setModel(model) {
|
|
20
|
-
this.currentModel = model;
|
|
21
|
-
}
|
|
22
|
-
getCurrentModel() {
|
|
23
|
-
return this.currentModel;
|
|
24
|
-
}
|
|
25
|
-
async chat(messages, tools, model, searchOptions) {
|
|
26
|
-
try {
|
|
27
|
-
const requestPayload = {
|
|
28
|
-
model: model || this.currentModel,
|
|
29
|
-
messages,
|
|
30
|
-
tools: tools || [],
|
|
31
|
-
tool_choice: tools && tools.length > 0 ? "auto" : undefined,
|
|
32
|
-
temperature: 0.7,
|
|
33
|
-
max_tokens: this.defaultMaxTokens,
|
|
34
|
-
};
|
|
35
|
-
// Add search parameters if specified
|
|
36
|
-
if (searchOptions?.search_parameters) {
|
|
37
|
-
requestPayload.search_parameters = searchOptions.search_parameters;
|
|
38
|
-
}
|
|
39
|
-
const response = await this.client.chat.completions.create(requestPayload);
|
|
40
|
-
return response;
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
throw new Error(`Grok API error: ${error.message}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
async *chatStream(messages, tools, model, searchOptions) {
|
|
47
|
-
try {
|
|
48
|
-
const requestPayload = {
|
|
49
|
-
model: model || this.currentModel,
|
|
50
|
-
messages,
|
|
51
|
-
tools: tools || [],
|
|
52
|
-
tool_choice: tools && tools.length > 0 ? "auto" : undefined,
|
|
53
|
-
temperature: 0.7,
|
|
54
|
-
max_tokens: this.defaultMaxTokens,
|
|
55
|
-
stream: true,
|
|
56
|
-
};
|
|
57
|
-
// Add search parameters if specified
|
|
58
|
-
if (searchOptions?.search_parameters) {
|
|
59
|
-
requestPayload.search_parameters = searchOptions.search_parameters;
|
|
60
|
-
}
|
|
61
|
-
const stream = (await this.client.chat.completions.create(requestPayload));
|
|
62
|
-
for await (const chunk of stream) {
|
|
63
|
-
yield chunk;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
throw new Error(`Grok API error: ${error.message}`);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
async search(query, searchParameters) {
|
|
71
|
-
const searchMessage = {
|
|
72
|
-
role: "user",
|
|
73
|
-
content: query,
|
|
74
|
-
};
|
|
75
|
-
const searchOptions = {
|
|
76
|
-
search_parameters: searchParameters || { mode: "on" },
|
|
77
|
-
};
|
|
78
|
-
return this.chat([searchMessage], [], undefined, searchOptions);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=client.js.map
|
package/dist/grok/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/grok/client.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,QAAQ,CAAC;AA8C5B,MAAM,OAAO,UAAU;IACb,MAAM,CAAS;IACf,YAAY,GAAW,kBAAkB,CAAC;IAC1C,gBAAgB,CAAS;IAEjC,YAAY,MAAc,EAAE,KAAc,EAAE,OAAgB;QAC1D,IAAI,CAAC,MAAM,GAAG,IAA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EF,MAAM,aAAa,GAAkB;YACnC,iBAAiB,EAAE,gBAAgB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;SACtD,CAAC;QAEF,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IAClE,CAAC;CACF"}
|
package/dist/grok/tools.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MCPManager, MCPTool } from "../mcp/client";
|
|
2
|
-
import { GrokTool } from "./client";
|
|
3
|
-
export declare const GROK_TOOLS: GrokTool[];
|
|
4
|
-
export declare function getMCPManager(): MCPManager;
|
|
5
|
-
export declare function initializeMCPServers(): Promise<void>;
|
|
6
|
-
export declare function convertMCPToolToGrokTool(mcpTool: MCPTool): GrokTool;
|
|
7
|
-
export declare function addMCPToolsToGrokTools(baseTools: GrokTool[]): GrokTool[];
|
|
8
|
-
export declare function getAllGrokTools(): Promise<GrokTool[]>;
|