@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.
Files changed (140) hide show
  1. package/bunfig.toml +43 -0
  2. package/dist/index.js +9 -15
  3. package/dist/super-agent-cli.exe +0 -0
  4. package/package.json +4 -1
  5. package/.grok/settings.json +0 -3
  6. package/.super-agent/settings.json +0 -23
  7. package/dist/agent/grok-agent.d.ts +0 -54
  8. package/dist/agent/grok-agent.js +0 -638
  9. package/dist/agent/grok-agent.js.map +0 -1
  10. package/dist/agent/index.d.ts +0 -14
  11. package/dist/agent/index.js +0 -139
  12. package/dist/agent/index.js.map +0 -1
  13. package/dist/agent/super-agent.d.ts +0 -54
  14. package/dist/agent/super-agent.js +0 -638
  15. package/dist/agent/super-agent.js.map +0 -1
  16. package/dist/commands/mcp.d.ts +0 -2
  17. package/dist/commands/mcp.js +0 -247
  18. package/dist/commands/mcp.js.map +0 -1
  19. package/dist/core/client.d.ts +0 -49
  20. package/dist/core/client.js +0 -81
  21. package/dist/core/client.js.map +0 -1
  22. package/dist/core/tools.d.ts +0 -8
  23. package/dist/core/tools.js +0 -351
  24. package/dist/core/tools.js.map +0 -1
  25. package/dist/grok/client.d.ts +0 -49
  26. package/dist/grok/client.js +0 -81
  27. package/dist/grok/client.js.map +0 -1
  28. package/dist/grok/tools.d.ts +0 -8
  29. package/dist/grok/tools.js +0 -351
  30. package/dist/grok/tools.js.map +0 -1
  31. package/dist/hooks/use-enhanced-input.d.ts +0 -37
  32. package/dist/hooks/use-enhanced-input.js +0 -228
  33. package/dist/hooks/use-enhanced-input.js.map +0 -1
  34. package/dist/hooks/use-input-handler.d.ts +0 -34
  35. package/dist/hooks/use-input-handler.js +0 -607
  36. package/dist/hooks/use-input-handler.js.map +0 -1
  37. package/dist/hooks/use-input-history.d.ts +0 -9
  38. package/dist/hooks/use-input-history.js +0 -62
  39. package/dist/hooks/use-input-history.js.map +0 -1
  40. package/dist/index.d.ts +0 -2
  41. package/dist/index.js.map +0 -1
  42. package/dist/mcp/client.d.ts +0 -29
  43. package/dist/mcp/client.js +0 -127
  44. package/dist/mcp/client.js.map +0 -1
  45. package/dist/mcp/config.d.ts +0 -13
  46. package/dist/mcp/config.js +0 -45
  47. package/dist/mcp/config.js.map +0 -1
  48. package/dist/mcp/transports.d.ts +0 -51
  49. package/dist/mcp/transports.js +0 -229
  50. package/dist/mcp/transports.js.map +0 -1
  51. package/dist/tools/bash.d.ts +0 -10
  52. package/dist/tools/bash.js +0 -76
  53. package/dist/tools/bash.js.map +0 -1
  54. package/dist/tools/confirmation-tool.d.ts +0 -16
  55. package/dist/tools/confirmation-tool.js +0 -77
  56. package/dist/tools/confirmation-tool.js.map +0 -1
  57. package/dist/tools/index.d.ts +0 -6
  58. package/dist/tools/index.js +0 -7
  59. package/dist/tools/index.js.map +0 -1
  60. package/dist/tools/morph-editor.d.ts +0 -36
  61. package/dist/tools/morph-editor.js +0 -324
  62. package/dist/tools/morph-editor.js.map +0 -1
  63. package/dist/tools/search.d.ts +0 -69
  64. package/dist/tools/search.js +0 -307
  65. package/dist/tools/search.js.map +0 -1
  66. package/dist/tools/text-editor.d.ts +0 -26
  67. package/dist/tools/text-editor.js +0 -583
  68. package/dist/tools/text-editor.js.map +0 -1
  69. package/dist/tools/todo-tool.d.ts +0 -20
  70. package/dist/tools/todo-tool.js +0 -134
  71. package/dist/tools/todo-tool.js.map +0 -1
  72. package/dist/types/index.d.ts +0 -30
  73. package/dist/types/index.js +0 -2
  74. package/dist/types/index.js.map +0 -1
  75. package/dist/ui/app.d.ts +0 -6
  76. package/dist/ui/app.js +0 -76
  77. package/dist/ui/app.js.map +0 -1
  78. package/dist/ui/components/api-key-input.d.ts +0 -6
  79. package/dist/ui/components/api-key-input.js +0 -70
  80. package/dist/ui/components/api-key-input.js.map +0 -1
  81. package/dist/ui/components/chat-history.d.ts +0 -7
  82. package/dist/ui/components/chat-history.js +0 -136
  83. package/dist/ui/components/chat-history.js.map +0 -1
  84. package/dist/ui/components/chat-input.d.ts +0 -8
  85. package/dist/ui/components/chat-input.js +0 -47
  86. package/dist/ui/components/chat-input.js.map +0 -1
  87. package/dist/ui/components/chat-interface.d.ts +0 -7
  88. package/dist/ui/components/chat-interface.js +0 -213
  89. package/dist/ui/components/chat-interface.js.map +0 -1
  90. package/dist/ui/components/command-suggestions.d.ts +0 -16
  91. package/dist/ui/components/command-suggestions.js +0 -18
  92. package/dist/ui/components/command-suggestions.js.map +0 -1
  93. package/dist/ui/components/confirmation-dialog.d.ts +0 -10
  94. package/dist/ui/components/confirmation-dialog.js +0 -70
  95. package/dist/ui/components/confirmation-dialog.js.map +0 -1
  96. package/dist/ui/components/diff-renderer.d.ts +0 -13
  97. package/dist/ui/components/diff-renderer.js +0 -200
  98. package/dist/ui/components/diff-renderer.js.map +0 -1
  99. package/dist/ui/components/loading-spinner.d.ts +0 -7
  100. package/dist/ui/components/loading-spinner.js +0 -52
  101. package/dist/ui/components/loading-spinner.js.map +0 -1
  102. package/dist/ui/components/mcp-status.d.ts +0 -4
  103. package/dist/ui/components/mcp-status.js +0 -37
  104. package/dist/ui/components/mcp-status.js.map +0 -1
  105. package/dist/ui/components/model-selection.d.ts +0 -11
  106. package/dist/ui/components/model-selection.js +0 -9
  107. package/dist/ui/components/model-selection.js.map +0 -1
  108. package/dist/ui/shared/max-sized-box.d.ts +0 -8
  109. package/dist/ui/shared/max-sized-box.js +0 -6
  110. package/dist/ui/shared/max-sized-box.js.map +0 -1
  111. package/dist/ui/utils/code-colorizer.d.ts +0 -2
  112. package/dist/ui/utils/code-colorizer.js +0 -7
  113. package/dist/ui/utils/code-colorizer.js.map +0 -1
  114. package/dist/ui/utils/colors.d.ts +0 -14
  115. package/dist/ui/utils/colors.js +0 -15
  116. package/dist/ui/utils/colors.js.map +0 -1
  117. package/dist/ui/utils/markdown-renderer.d.ts +0 -3
  118. package/dist/ui/utils/markdown-renderer.js +0 -23
  119. package/dist/ui/utils/markdown-renderer.js.map +0 -1
  120. package/dist/utils/confirmation-service.d.ts +0 -33
  121. package/dist/utils/confirmation-service.js +0 -110
  122. package/dist/utils/confirmation-service.js.map +0 -1
  123. package/dist/utils/custom-instructions.d.ts +0 -1
  124. package/dist/utils/custom-instructions.js +0 -23
  125. package/dist/utils/custom-instructions.js.map +0 -1
  126. package/dist/utils/model-config.d.ts +0 -28
  127. package/dist/utils/model-config.js +0 -42
  128. package/dist/utils/model-config.js.map +0 -1
  129. package/dist/utils/settings-manager.d.ts +0 -99
  130. package/dist/utils/settings-manager.js +0 -286
  131. package/dist/utils/settings-manager.js.map +0 -1
  132. package/dist/utils/settings.d.ts +0 -1
  133. package/dist/utils/settings.js +0 -4
  134. package/dist/utils/settings.js.map +0 -1
  135. package/dist/utils/text-utils.d.ts +0 -80
  136. package/dist/utils/text-utils.js +0 -191
  137. package/dist/utils/text-utils.js.map +0 -1
  138. package/dist/utils/token-counter.d.ts +0 -33
  139. package/dist/utils/token-counter.js +0 -79
  140. package/dist/utils/token-counter.js.map +0 -1
@@ -1,638 +0,0 @@
1
- import { getAllGrokTools, getMCPManager, initializeMCPServers, } from "../grok/tools";
2
- import { TextEditorTool, MorphEditorTool, BashTool, TodoTool, ConfirmationTool, SearchTool, } from "../tools/index";
3
- import { createTokenCounter } from "../utils/token-counter";
4
- import { GrokClient } from "../grok/client";
5
- import { loadCustomInstructions } from "../utils/custom-instructions";
6
- import { getSettingsManager } from "../utils/settings-manager";
7
- import { loadMCPConfig } from "../mcp/config";
8
- import { EventEmitter } from "events";
9
- export class GrokAgent extends EventEmitter {
10
- grokClient;
11
- textEditor;
12
- morphEditor;
13
- bash;
14
- todoTool;
15
- confirmationTool;
16
- search;
17
- chatHistory = [];
18
- messages = [];
19
- tokenCounter;
20
- abortController = null;
21
- mcpInitialized = false;
22
- maxToolRounds;
23
- constructor(apiKey, baseURL, model, maxToolRounds) {
24
- super();
25
- const manager = getSettingsManager();
26
- const savedModel = manager.getCurrentModel();
27
- const modelToUse = model || savedModel || "grok-code-fast-1";
28
- this.maxToolRounds = maxToolRounds || 400;
29
- this.grokClient = new GrokClient(apiKey, modelToUse, baseURL);
30
- this.textEditor = new TextEditorTool();
31
- this.morphEditor = process.env.MORPH_API_KEY ? new MorphEditorTool() : null;
32
- this.bash = new BashTool();
33
- this.todoTool = new TodoTool();
34
- this.confirmationTool = new ConfirmationTool();
35
- this.search = new SearchTool();
36
- this.tokenCounter = createTokenCounter(modelToUse);
37
- // Initialize MCP servers if configured
38
- this.initializeMCP();
39
- // Load custom instructions
40
- const customInstructions = loadCustomInstructions();
41
- const customInstructionsSection = customInstructions
42
- ? `\n\nCUSTOM INSTRUCTIONS:\n${customInstructions}\n\nThe above custom instructions should be followed alongside the standard instructions below.`
43
- : "";
44
- // Initialize with system message
45
- this.messages.push({
46
- role: "system",
47
- content: `You are Grok CLI, an AI assistant that helps with file editing, coding tasks, and system operations.${customInstructionsSection}
48
-
49
- You have access to these tools:
50
- - view_file: View file contents or directory listings
51
- - create_file: Create new files with content (ONLY use this for files that don't exist yet)
52
- - str_replace_editor: Replace text in existing files (ALWAYS use this to edit or update existing files)${this.morphEditor
53
- ? "\n- edit_file: High-speed file editing with Morph Fast Apply (4,500+ tokens/sec with 98% accuracy)"
54
- : ""}
55
- - bash: Execute bash commands (use for searching, file discovery, navigation, and system operations)
56
- - search: Unified search tool for finding text content or files (similar to Cursor's search functionality)
57
- - create_todo_list: Create a visual todo list for planning and tracking tasks
58
- - update_todo_list: Update existing todos in your todo list
59
-
60
- REAL-TIME INFORMATION:
61
- You have access to real-time web search and X (Twitter) data. When users ask for current information, latest news, or recent events, you automatically have access to up-to-date information from the web and social media.
62
-
63
- IMPORTANT TOOL USAGE RULES:
64
- - NEVER use create_file on files that already exist - this will overwrite them completely
65
- - ALWAYS use str_replace_editor to modify existing files, even for small changes
66
- - Before editing a file, use view_file to see its current contents
67
- - Use create_file ONLY when creating entirely new files that don't exist
68
-
69
- SEARCHING AND EXPLORATION:
70
- - Use search for fast, powerful text search across files or finding files by name (unified search tool)
71
- - Examples: search for text content like "import.*react", search for files like "component.tsx"
72
- - Use bash with commands like 'find', 'grep', 'rg', 'ls' for complex file operations and navigation
73
- - view_file is best for reading specific files you already know exist
74
-
75
- When a user asks you to edit, update, modify, or change an existing file:
76
- 1. First use view_file to see the current contents
77
- 2. Then use str_replace_editor to make the specific changes
78
- 3. Never use create_file for existing files
79
-
80
- When a user asks you to create a new file that doesn't exist:
81
- 1. Use create_file with the full content
82
-
83
- TASK PLANNING WITH TODO LISTS:
84
- - For complex requests with multiple steps, ALWAYS create a todo list first to plan your approach
85
- - Use create_todo_list to break down tasks into manageable items with priorities
86
- - Mark tasks as 'in_progress' when you start working on them (only one at a time)
87
- - Mark tasks as 'completed' immediately when finished
88
- - Use update_todo_list to track your progress throughout the task
89
- - Todo lists provide visual feedback with colors: ✅ Green (completed), 🔄 Cyan (in progress), ⏳ Yellow (pending)
90
- - Always create todos with priorities: 'high' (🔴), 'medium' (🟡), 'low' (🟢)
91
-
92
- USER CONFIRMATION SYSTEM:
93
- File operations (create_file, str_replace_editor) and bash commands will automatically request user confirmation before execution. The confirmation system will show users the actual content or command before they decide. Users can choose to approve individual operations or approve all operations of that type for the session.
94
-
95
- If a user rejects an operation, the tool will return an error and you should not proceed with that specific operation.
96
-
97
- Be helpful, direct, and efficient. Always explain what you're doing and show the results.
98
-
99
- IMPORTANT RESPONSE GUIDELINES:
100
- - After using tools, do NOT respond with pleasantries like "Thanks for..." or "Great!"
101
- - Only provide necessary explanations or next steps if relevant to the task
102
- - Keep responses concise and focused on the actual work being done
103
- - If a tool execution completes the user's request, you can remain silent or give a brief confirmation
104
-
105
- Current working directory: ${process.cwd()}`,
106
- });
107
- }
108
- async initializeMCP() {
109
- // Initialize MCP in the background without blocking
110
- Promise.resolve().then(async () => {
111
- try {
112
- const config = loadMCPConfig();
113
- if (config.servers.length > 0) {
114
- await initializeMCPServers();
115
- }
116
- }
117
- catch (error) {
118
- console.warn("MCP initialization failed:", error);
119
- }
120
- finally {
121
- this.mcpInitialized = true;
122
- }
123
- });
124
- }
125
- isGrokModel() {
126
- const currentModel = this.grokClient.getCurrentModel();
127
- return currentModel.toLowerCase().includes("grok");
128
- }
129
- // Heuristic: enable web search only when likely needed
130
- shouldUseSearchFor(message) {
131
- const q = message.toLowerCase();
132
- const keywords = [
133
- "today",
134
- "latest",
135
- "news",
136
- "trending",
137
- "breaking",
138
- "current",
139
- "now",
140
- "recent",
141
- "x.com",
142
- "twitter",
143
- "tweet",
144
- "what happened",
145
- "as of",
146
- "update on",
147
- "release notes",
148
- "changelog",
149
- "price",
150
- ];
151
- if (keywords.some(k => q.includes(k))) {
152
- return true;
153
- }
154
- // crude date pattern (e.g., 2024/2025) may imply recency
155
- if (/(20\d{2})/.test(q)) {
156
- return true;
157
- }
158
- return false;
159
- }
160
- async processUserMessage(message) {
161
- // Add user message to conversation
162
- const userEntry = {
163
- type: "user",
164
- content: message,
165
- timestamp: new Date(),
166
- };
167
- this.chatHistory.push(userEntry);
168
- this.messages.push({ role: "user", content: message });
169
- const newEntries = [userEntry];
170
- const maxToolRounds = this.maxToolRounds; // Prevent infinite loops
171
- let toolRounds = 0;
172
- try {
173
- const tools = await getAllGrokTools();
174
- let currentResponse = await this.grokClient.chat(this.messages, tools, undefined, this.isGrokModel() && this.shouldUseSearchFor(message)
175
- ? { search_parameters: { mode: "auto" } }
176
- : { search_parameters: { mode: "off" } });
177
- // Agent loop - continue until no more tool calls or max rounds reached
178
- while (toolRounds < maxToolRounds) {
179
- const assistantMessage = currentResponse.choices[0]?.message;
180
- if (!assistantMessage) {
181
- throw new Error("No response from Grok");
182
- }
183
- // Handle tool calls
184
- if (assistantMessage.tool_calls &&
185
- assistantMessage.tool_calls.length > 0) {
186
- toolRounds++;
187
- // Add assistant message with tool calls
188
- const assistantEntry = {
189
- type: "assistant",
190
- content: assistantMessage.content || "Using tools to help you...",
191
- timestamp: new Date(),
192
- toolCalls: assistantMessage.tool_calls,
193
- };
194
- this.chatHistory.push(assistantEntry);
195
- newEntries.push(assistantEntry);
196
- // Add assistant message to conversation
197
- this.messages.push({
198
- role: "assistant",
199
- content: assistantMessage.content || "",
200
- tool_calls: assistantMessage.tool_calls,
201
- });
202
- // Create initial tool call entries to show tools are being executed
203
- assistantMessage.tool_calls.forEach(toolCall => {
204
- const toolCallEntry = {
205
- type: "tool_call",
206
- content: "Executing...",
207
- timestamp: new Date(),
208
- toolCall: toolCall,
209
- };
210
- this.chatHistory.push(toolCallEntry);
211
- newEntries.push(toolCallEntry);
212
- });
213
- // Execute tool calls and update the entries
214
- for (const toolCall of assistantMessage.tool_calls) {
215
- const result = await this.executeTool(toolCall);
216
- // Update the existing tool_call entry with the result
217
- const entryIndex = this.chatHistory.findIndex(entry => entry.type === "tool_call" &&
218
- entry.toolCall?.id === toolCall.id);
219
- if (entryIndex !== -1) {
220
- const updatedEntry = {
221
- ...this.chatHistory[entryIndex],
222
- type: "tool_result",
223
- content: result.success
224
- ? result.output || "Success"
225
- : result.error || "Error occurred",
226
- toolResult: result,
227
- };
228
- this.chatHistory[entryIndex] = updatedEntry;
229
- // Also update in newEntries for return value
230
- const newEntryIndex = newEntries.findIndex(entry => entry.type === "tool_call" &&
231
- entry.toolCall?.id === toolCall.id);
232
- if (newEntryIndex !== -1) {
233
- newEntries[newEntryIndex] = updatedEntry;
234
- }
235
- }
236
- // Add tool result to messages with proper format (needed for AI context)
237
- this.messages.push({
238
- role: "tool",
239
- content: result.success
240
- ? result.output || "Success"
241
- : result.error || "Error",
242
- tool_call_id: toolCall.id,
243
- });
244
- }
245
- // Get next response - this might contain more tool calls
246
- currentResponse = await this.grokClient.chat(this.messages, tools, undefined, this.isGrokModel() && this.shouldUseSearchFor(message)
247
- ? { search_parameters: { mode: "auto" } }
248
- : { search_parameters: { mode: "off" } });
249
- }
250
- else {
251
- // No more tool calls, add final response
252
- const finalEntry = {
253
- type: "assistant",
254
- content: assistantMessage.content ||
255
- "I understand, but I don't have a specific response.",
256
- timestamp: new Date(),
257
- };
258
- this.chatHistory.push(finalEntry);
259
- this.messages.push({
260
- role: "assistant",
261
- content: assistantMessage.content || "",
262
- });
263
- newEntries.push(finalEntry);
264
- break; // Exit the loop
265
- }
266
- }
267
- if (toolRounds >= maxToolRounds) {
268
- const warningEntry = {
269
- type: "assistant",
270
- content: "Maximum tool execution rounds reached. Stopping to prevent infinite loops.",
271
- timestamp: new Date(),
272
- };
273
- this.chatHistory.push(warningEntry);
274
- newEntries.push(warningEntry);
275
- }
276
- return newEntries;
277
- }
278
- catch (error) {
279
- const errorEntry = {
280
- type: "assistant",
281
- content: `Sorry, I encountered an error: ${error.message}`,
282
- timestamp: new Date(),
283
- };
284
- this.chatHistory.push(errorEntry);
285
- return [userEntry, errorEntry];
286
- }
287
- }
288
- messageReducer(previous, item) {
289
- const reduce = (acc, delta) => {
290
- acc = { ...acc };
291
- for (const [key, value] of Object.entries(delta)) {
292
- if (acc[key] === undefined || acc[key] === null) {
293
- acc[key] = value;
294
- // Clean up index properties from tool calls
295
- if (Array.isArray(acc[key])) {
296
- for (const arr of acc[key]) {
297
- delete arr.index;
298
- }
299
- }
300
- }
301
- else if (typeof acc[key] === "string" && typeof value === "string") {
302
- acc[key] += value;
303
- }
304
- else if (Array.isArray(acc[key]) && Array.isArray(value)) {
305
- const accArray = acc[key];
306
- for (let i = 0; i < value.length; i++) {
307
- if (!accArray[i]) {
308
- accArray[i] = {};
309
- }
310
- accArray[i] = reduce(accArray[i], value[i]);
311
- }
312
- }
313
- else if (typeof acc[key] === "object" && typeof value === "object") {
314
- acc[key] = reduce(acc[key], value);
315
- }
316
- }
317
- return acc;
318
- };
319
- return reduce(previous, item.choices[0]?.delta || {});
320
- }
321
- async *processUserMessageStream(message) {
322
- // Create new abort controller for this request
323
- this.abortController = new AbortController();
324
- // Add user message to conversation
325
- const userEntry = {
326
- type: "user",
327
- content: message,
328
- timestamp: new Date(),
329
- };
330
- this.chatHistory.push(userEntry);
331
- this.messages.push({ role: "user", content: message });
332
- // Calculate input tokens
333
- let inputTokens = this.tokenCounter.countMessageTokens(this.messages);
334
- yield {
335
- type: "token_count",
336
- tokenCount: inputTokens,
337
- };
338
- const maxToolRounds = this.maxToolRounds; // Prevent infinite loops
339
- let toolRounds = 0;
340
- let totalOutputTokens = 0;
341
- let lastTokenUpdate = 0;
342
- try {
343
- // Agent loop - continue until no more tool calls or max rounds reached
344
- while (toolRounds < maxToolRounds) {
345
- // Check if operation was cancelled
346
- if (this.abortController?.signal.aborted) {
347
- yield {
348
- type: "content",
349
- content: "\n\n[Operation cancelled by user]",
350
- };
351
- yield { type: "done" };
352
- return;
353
- }
354
- // Stream response and accumulate
355
- const tools = await getAllGrokTools();
356
- const stream = this.grokClient.chatStream(this.messages, tools, undefined, this.isGrokModel() && this.shouldUseSearchFor(message)
357
- ? { search_parameters: { mode: "auto" } }
358
- : { search_parameters: { mode: "off" } });
359
- let accumulatedMessage = {};
360
- let accumulatedContent = "";
361
- let toolCallsYielded = false;
362
- for await (const chunk of stream) {
363
- // Check for cancellation in the streaming loop
364
- if (this.abortController?.signal.aborted) {
365
- yield {
366
- type: "content",
367
- content: "\n\n[Operation cancelled by user]",
368
- };
369
- yield { type: "done" };
370
- return;
371
- }
372
- if (!chunk.choices?.[0]) {
373
- continue;
374
- }
375
- // Accumulate the message using reducer
376
- accumulatedMessage = this.messageReducer(accumulatedMessage, chunk);
377
- // Check for tool calls - yield when we have complete tool calls with function names
378
- if (!toolCallsYielded && accumulatedMessage.tool_calls?.length > 0) {
379
- // Check if we have at least one complete tool call with a function name
380
- const hasCompleteTool = accumulatedMessage.tool_calls.some((tc) => tc.function?.name);
381
- if (hasCompleteTool) {
382
- yield {
383
- type: "tool_calls",
384
- toolCalls: accumulatedMessage.tool_calls,
385
- };
386
- toolCallsYielded = true;
387
- }
388
- }
389
- // Stream content as it comes
390
- if (chunk.choices[0].delta?.content) {
391
- accumulatedContent += chunk.choices[0].delta.content;
392
- // Update token count in real-time including accumulated content and any tool calls
393
- const currentOutputTokens = this.tokenCounter.estimateStreamingTokens(accumulatedContent) +
394
- (accumulatedMessage.tool_calls
395
- ? this.tokenCounter.countTokens(JSON.stringify(accumulatedMessage.tool_calls))
396
- : 0);
397
- totalOutputTokens = currentOutputTokens;
398
- yield {
399
- type: "content",
400
- content: chunk.choices[0].delta.content,
401
- };
402
- // Emit token count update
403
- const now = Date.now();
404
- if (now - lastTokenUpdate > 250) {
405
- lastTokenUpdate = now;
406
- yield {
407
- type: "token_count",
408
- tokenCount: inputTokens + totalOutputTokens,
409
- };
410
- }
411
- }
412
- }
413
- // Add assistant entry to history
414
- const assistantEntry = {
415
- type: "assistant",
416
- content: accumulatedMessage.content || "Using tools to help you...",
417
- timestamp: new Date(),
418
- toolCalls: accumulatedMessage.tool_calls || undefined,
419
- };
420
- this.chatHistory.push(assistantEntry);
421
- // Add accumulated message to conversation
422
- this.messages.push({
423
- role: "assistant",
424
- content: accumulatedMessage.content || "",
425
- tool_calls: accumulatedMessage.tool_calls,
426
- });
427
- // Handle tool calls if present
428
- if (accumulatedMessage.tool_calls?.length > 0) {
429
- toolRounds++;
430
- // Only yield tool_calls if we haven't already yielded them during streaming
431
- if (!toolCallsYielded) {
432
- yield {
433
- type: "tool_calls",
434
- toolCalls: accumulatedMessage.tool_calls,
435
- };
436
- }
437
- // Execute tools
438
- for (const toolCall of accumulatedMessage.tool_calls) {
439
- // Check for cancellation before executing each tool
440
- if (this.abortController?.signal.aborted) {
441
- yield {
442
- type: "content",
443
- content: "\n\n[Operation cancelled by user]",
444
- };
445
- yield { type: "done" };
446
- return;
447
- }
448
- const result = await this.executeTool(toolCall);
449
- const toolResultEntry = {
450
- type: "tool_result",
451
- content: result.success
452
- ? result.output || "Success"
453
- : result.error || "Error occurred",
454
- timestamp: new Date(),
455
- toolCall: toolCall,
456
- toolResult: result,
457
- };
458
- this.chatHistory.push(toolResultEntry);
459
- yield {
460
- type: "tool_result",
461
- toolCall,
462
- toolResult: result,
463
- };
464
- // Add tool result with proper format (needed for AI context)
465
- this.messages.push({
466
- role: "tool",
467
- content: result.success
468
- ? result.output || "Success"
469
- : result.error || "Error",
470
- tool_call_id: toolCall.id,
471
- });
472
- }
473
- // Update token count after processing all tool calls to include tool results
474
- inputTokens = this.tokenCounter.countMessageTokens(this.messages);
475
- // Final token update after tools processed
476
- yield {
477
- type: "token_count",
478
- tokenCount: inputTokens + totalOutputTokens,
479
- };
480
- // Continue the loop to get the next response (which might have more tool calls)
481
- }
482
- else {
483
- // No tool calls, we're done
484
- break;
485
- }
486
- }
487
- if (toolRounds >= maxToolRounds) {
488
- yield {
489
- type: "content",
490
- content: "\n\nMaximum tool execution rounds reached. Stopping to prevent infinite loops.",
491
- };
492
- }
493
- yield { type: "done" };
494
- }
495
- catch (error) {
496
- // Check if this was a cancellation
497
- if (this.abortController?.signal.aborted) {
498
- yield {
499
- type: "content",
500
- content: "\n\n[Operation cancelled by user]",
501
- };
502
- yield { type: "done" };
503
- return;
504
- }
505
- const errorEntry = {
506
- type: "assistant",
507
- content: `Sorry, I encountered an error: ${error.message}`,
508
- timestamp: new Date(),
509
- };
510
- this.chatHistory.push(errorEntry);
511
- yield {
512
- type: "content",
513
- content: errorEntry.content,
514
- };
515
- yield { type: "done" };
516
- }
517
- finally {
518
- // Clean up abort controller
519
- this.abortController = null;
520
- }
521
- }
522
- async executeTool(toolCall) {
523
- try {
524
- const args = JSON.parse(toolCall.function.arguments);
525
- switch (toolCall.function.name) {
526
- case "view_file":
527
- const range = args.start_line && args.end_line
528
- ? [args.start_line, args.end_line]
529
- : undefined;
530
- return await this.textEditor.view(args.path, range);
531
- case "create_file":
532
- return await this.textEditor.create(args.path, args.content);
533
- case "str_replace_editor":
534
- return await this.textEditor.strReplace(args.path, args.old_str, args.new_str, args.replace_all);
535
- case "edit_file":
536
- if (!this.morphEditor) {
537
- return {
538
- success: false,
539
- error: "Morph Fast Apply not available. Please set MORPH_API_KEY environment variable to use this feature.",
540
- };
541
- }
542
- return await this.morphEditor.editFile(args.target_file, args.instructions, args.code_edit);
543
- case "bash":
544
- return await this.bash.execute(args.command);
545
- case "create_todo_list":
546
- return await this.todoTool.createTodoList(args.todos);
547
- case "update_todo_list":
548
- return await this.todoTool.updateTodoList(args.updates);
549
- case "search":
550
- return await this.search.search(args.query, {
551
- searchType: args.search_type,
552
- includePattern: args.include_pattern,
553
- excludePattern: args.exclude_pattern,
554
- caseSensitive: args.case_sensitive,
555
- wholeWord: args.whole_word,
556
- regex: args.regex,
557
- maxResults: args.max_results,
558
- fileTypes: args.file_types,
559
- includeHidden: args.include_hidden,
560
- });
561
- default:
562
- // Check if this is an MCP tool
563
- if (toolCall.function.name.startsWith("mcp__")) {
564
- return await this.executeMCPTool(toolCall);
565
- }
566
- return {
567
- success: false,
568
- error: `Unknown tool: ${toolCall.function.name}`,
569
- };
570
- }
571
- }
572
- catch (error) {
573
- return {
574
- success: false,
575
- error: `Tool execution error: ${error.message}`,
576
- };
577
- }
578
- }
579
- async executeMCPTool(toolCall) {
580
- try {
581
- const args = JSON.parse(toolCall.function.arguments);
582
- const mcpManager = getMCPManager();
583
- const result = await mcpManager.callTool(toolCall.function.name, args);
584
- if (result.isError) {
585
- return {
586
- success: false,
587
- error: result.content[0]?.text || "MCP tool error",
588
- };
589
- }
590
- // Extract content from result
591
- const output = result.content
592
- .map(item => {
593
- if (item.type === "text") {
594
- return item.text;
595
- }
596
- else if (item.type === "resource") {
597
- return `Resource: ${item.resource?.uri || "Unknown"}`;
598
- }
599
- return String(item);
600
- })
601
- .join("\n");
602
- return {
603
- success: true,
604
- output: output || "Success",
605
- };
606
- }
607
- catch (error) {
608
- return {
609
- success: false,
610
- error: `MCP tool execution error: ${error.message}`,
611
- };
612
- }
613
- }
614
- getChatHistory() {
615
- return [...this.chatHistory];
616
- }
617
- getCurrentDirectory() {
618
- return this.bash.getCurrentDirectory();
619
- }
620
- async executeBashCommand(command) {
621
- return await this.bash.execute(command);
622
- }
623
- getCurrentModel() {
624
- return this.grokClient.getCurrentModel();
625
- }
626
- setModel(model) {
627
- this.grokClient.setModel(model);
628
- // Update token counter for new model
629
- this.tokenCounter.dispose();
630
- this.tokenCounter = createTokenCounter(model);
631
- }
632
- abortCurrentOperation() {
633
- if (this.abortController) {
634
- this.abortController.abort();
635
- }
636
- }
637
- }
638
- //# sourceMappingURL=grok-agent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grok-agent.js","sourceRoot":"","sources":["../../src/agent/grok-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAgB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAA6B,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAqBtC,MAAM,OAAO,SAAU,SAAQ,YAAY;IACjC,UAAU,CAAa;IACvB,UAAU,CAAiB;IAC3B,WAAW,CAAyB;IACpC,IAAI,CAAW;IACf,QAAQ,CAAW;IACnB,gBAAgB,CAAmB;IACnC,MAAM,CAAa;IACnB,WAAW,GAAgB,EAAE,CAAC;IAC9B,QAAQ,GAAkB,EAAE,CAAC;IAC7B,YAAY,CAAe;IAC3B,eAAe,GAA2B,IAAI,CAAC;IAC/C,cAAc,GAAY,KAAK,CAAC;IAChC,aAAa,CAAS;IAE9B,YACE,MAAc,EACd,OAAgB,EAChB,KAAc,EACd,aAAsB;QAEtB,KAAK,EAAE,CAAC;QACR,MAAM,OAAO,GAAG,kBAAk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