sam-coder-cli 1.0.0 → 1.0.3

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/out/agentUtils.js DELETED
@@ -1,539 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.AgentUtils = void 0;
27
- const vscode = __importStar(require("vscode"));
28
- const fs = __importStar(require("fs"));
29
- const path = __importStar(require("path"));
30
- const util = __importStar(require("util"));
31
- const cp = __importStar(require("child_process"));
32
- const os = __importStar(require("os"));
33
- const fetch_polyfill_1 = require("./fetch-polyfill");
34
- // Promisified versions of functions
35
- const readFile = util.promisify(fs.readFile);
36
- const writeFile = util.promisify(fs.writeFile);
37
- const mkdir = util.promisify(fs.mkdir);
38
- const exec = util.promisify(cp.exec);
39
- class AgentUtils {
40
- constructor() {
41
- this._outputChannel = vscode.window.createOutputChannel('AI Assistant Agent');
42
- this._workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath;
43
- }
44
- // Log to output channel
45
- log(message) {
46
- this._outputChannel.appendLine(`[${new Date().toLocaleTimeString()}] ${message}`);
47
- }
48
- // Show the output channel
49
- showOutputChannel() {
50
- this._outputChannel.show();
51
- }
52
- // Read a file with optional path resolution
53
- async readFile(filePath, maxTokens) {
54
- try {
55
- // Check if we need to resolve from workspace root
56
- const resolvedPath = this._resolveFilePath(filePath);
57
- let content = await readFile(resolvedPath, 'utf8');
58
- // If maxTokens is specified, ensure the content is within limits
59
- if (maxTokens && maxTokens > 0) {
60
- // Estimate token count (roughly 4 chars per token)
61
- const estimatedTokens = Math.ceil(content.length / 4);
62
- if (estimatedTokens > maxTokens) {
63
- this.log(`File content exceeds token limit (est. ${estimatedTokens} tokens). Truncating to ~${maxTokens} tokens.`);
64
- // Calculate how much content to keep (roughly)
65
- const keepChars = maxTokens * 4;
66
- const halfKeep = Math.floor(keepChars / 2);
67
- // Keep beginning and ending portions for context, with a message in the middle
68
- const firstPart = content.substring(0, halfKeep);
69
- const lastPart = content.substring(content.length - halfKeep);
70
- content = `${firstPart}\n\n[...Content truncated to fit within ${maxTokens} token limit...]\n\n${lastPart}`;
71
- }
72
- }
73
- return content;
74
- }
75
- catch (error) {
76
- this.log(`Error reading file: ${error instanceof Error ? error.message : String(error)}`);
77
- throw error;
78
- }
79
- }
80
- // Write to a file with optional path resolution and directory creation
81
- async writeFile(filePath, content) {
82
- try {
83
- const resolvedPath = this._resolveFilePath(filePath);
84
- const dirPath = path.dirname(resolvedPath);
85
- // Ensure directory exists
86
- if (!fs.existsSync(dirPath)) {
87
- await mkdir(dirPath, { recursive: true });
88
- }
89
- await writeFile(resolvedPath, content);
90
- this.log(`File written: ${resolvedPath}`);
91
- }
92
- catch (error) {
93
- this.log(`Error writing file: ${error instanceof Error ? error.message : String(error)}`);
94
- throw error;
95
- }
96
- }
97
- // Run a command and get output
98
- async runCommand(command) {
99
- try {
100
- this.log(`Running command: ${command}`);
101
- const { stdout, stderr } = await exec(command, {
102
- cwd: this._workspaceRoot,
103
- maxBuffer: 1024 * 1024 * 5 // 5MB
104
- });
105
- if (stderr) {
106
- this.log(`Command stderr: ${stderr}`);
107
- }
108
- return stdout;
109
- }
110
- catch (error) {
111
- this.log(`Error running command: ${error instanceof Error ? error.message : String(error)}`);
112
- throw error;
113
- }
114
- }
115
- // Search files in workspace
116
- async searchFiles(pattern) {
117
- try {
118
- this.log(`Searching files with pattern: ${pattern}`);
119
- return await vscode.workspace.findFiles(pattern);
120
- }
121
- catch (error) {
122
- this.log(`Error searching files: ${error instanceof Error ? error.message : String(error)}`);
123
- throw error;
124
- }
125
- }
126
- // Search for text in files
127
- async searchText(searchText) {
128
- try {
129
- this.log(`Searching for text: ${searchText}`);
130
- // Use the built-in search API in VSCode
131
- const results = await vscode.commands.executeCommand('vscode.executeTextSearchCommand', {
132
- pattern: searchText
133
- });
134
- return results || [];
135
- }
136
- catch (error) {
137
- this.log(`Error searching text: ${error instanceof Error ? error.message : String(error)}`);
138
- throw error;
139
- }
140
- }
141
- // Execute a series of agent actions
142
- async executeActions(actions) {
143
- const results = [];
144
- // Get the max tokens from configuration
145
- const config = vscode.workspace.getConfiguration('aiAssistant');
146
- const maxTokens = config.get('maxTokens') || 120000;
147
- for (const action of actions) {
148
- try {
149
- let result;
150
- switch (action.type) {
151
- case 'read':
152
- result = await this.readFile(action.data.path, maxTokens);
153
- break;
154
- case 'write':
155
- await this.writeFile(action.data.path, action.data.content);
156
- result = { success: true };
157
- break;
158
- case 'search':
159
- if (action.data.type === 'files') {
160
- result = await this.searchFiles(action.data.pattern);
161
- }
162
- else if (action.data.type === 'text') {
163
- result = await this.searchText(action.data.text);
164
- }
165
- break;
166
- case 'command':
167
- result = await this.runCommand(action.data.command);
168
- break;
169
- case 'execute':
170
- result = await this.executeCode(action.data.language, action.data.code);
171
- break;
172
- case 'analyze':
173
- // This is for code analysis, we'll pass it to the AI
174
- result = action.data;
175
- break;
176
- case 'browse':
177
- result = await this.browseWeb(action.data.query, action.data.numResults);
178
- break;
179
- case 'edit':
180
- result = await this.editFile(action.data.path, action.data.edits);
181
- break;
182
- case 'stop':
183
- // Just a signal to stop, no actual execution needed
184
- result = { stopped: true };
185
- break;
186
- }
187
- results.push({
188
- ...action,
189
- result
190
- });
191
- }
192
- catch (error) {
193
- results.push({
194
- ...action,
195
- result: { error: error instanceof Error ? error.message : String(error) }
196
- });
197
- }
198
- }
199
- return results;
200
- }
201
- // Execute code in different languages
202
- async executeCode(language, code) {
203
- try {
204
- this.log(`Executing ${language} code`);
205
- // Create a temporary file to execute
206
- const extension = this._getFileExtension(language);
207
- if (!extension) {
208
- throw new Error(`Unsupported language: ${language}`);
209
- }
210
- const tempDir = path.join(this._workspaceRoot || os.tmpdir(), '.ai-assistant-temp');
211
- if (!fs.existsSync(tempDir)) {
212
- await mkdir(tempDir, { recursive: true });
213
- }
214
- const tempFile = path.join(tempDir, `code_${Date.now()}${extension}`);
215
- await writeFile(tempFile, code);
216
- // Execute the code based on language
217
- let command = '';
218
- switch (language.toLowerCase()) {
219
- case 'js':
220
- case 'javascript':
221
- command = `node "${tempFile}"`;
222
- break;
223
- case 'ts':
224
- case 'typescript':
225
- command = `npx ts-node "${tempFile}"`;
226
- break;
227
- case 'py':
228
- case 'python':
229
- command = `python "${tempFile}"`;
230
- break;
231
- case 'bash':
232
- case 'sh':
233
- // Make sure the file is executable on Unix systems
234
- if (process.platform !== 'win32') {
235
- await util.promisify(fs.chmod)(tempFile, '755');
236
- }
237
- command = process.platform === 'win32' ? `bash "${tempFile}"` : `"${tempFile}"`;
238
- break;
239
- default:
240
- throw new Error(`Execution of ${language} is not supported`);
241
- }
242
- // Execute and capture output
243
- const result = await this.runCommand(command);
244
- // Clean up the temp file
245
- try {
246
- fs.unlinkSync(tempFile);
247
- }
248
- catch (e) {
249
- // Ignore cleanup errors
250
- }
251
- return result;
252
- }
253
- catch (error) {
254
- this.log(`Error executing code: ${error instanceof Error ? error.message : String(error)}`);
255
- throw error;
256
- }
257
- }
258
- // Browse the web
259
- async browseWeb(query, numResults = 5) {
260
- try {
261
- this.log(`Searching the web for: ${query}`);
262
- // Using DuckDuckGo which doesn't require an API key
263
- return await this.duckDuckGoSearch(query, numResults);
264
- }
265
- catch (error) {
266
- this.log(`Error browsing web: ${error instanceof Error ? error.message : String(error)}`);
267
- // Return an error object
268
- return {
269
- query,
270
- error: `Search failed: ${error instanceof Error ? error.message : String(error)}`,
271
- results: []
272
- };
273
- }
274
- }
275
- // DuckDuckGo search (no API key required)
276
- async duckDuckGoSearch(query, numResults = 5) {
277
- try {
278
- this.log(`Performing DuckDuckGo search for: ${query}`);
279
- // Using DuckDuckGo HTML search which doesn't require API keys
280
- const searchUrl = `https://html.duckduckgo.com/html/?q=${encodeURIComponent(query)}`;
281
- const response = await (0, fetch_polyfill_1.fetch)(searchUrl, {
282
- headers: {
283
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
284
- }
285
- });
286
- if (!response.ok) {
287
- throw new Error(`Search request failed: ${response.statusText}`);
288
- }
289
- const html = await response.text();
290
- // Extract search results from HTML
291
- const results = [];
292
- const titleRegex = /<a class="result__a" href="(.*?)".*?>(.*?)<\/a>/g;
293
- const snippetRegex = /<a class="result__snippet".*?>(.*?)<\/a>/g;
294
- let match;
295
- let index = 0;
296
- // Extract titles and URLs
297
- const titles = [];
298
- while ((match = titleRegex.exec(html)) !== null && index < numResults) {
299
- titles.push({
300
- url: match[1],
301
- title: this._decodeHtmlEntities(match[2])
302
- });
303
- index++;
304
- }
305
- // Extract snippets
306
- const snippets = [];
307
- while ((match = snippetRegex.exec(html)) !== null && snippets.length < numResults) {
308
- snippets.push(this._decodeHtmlEntities(match[1]));
309
- }
310
- // Combine results
311
- for (let i = 0; i < Math.min(titles.length, snippets.length); i++) {
312
- results.push({
313
- title: titles[i].title,
314
- url: titles[i].url,
315
- snippet: snippets[i]
316
- });
317
- }
318
- return {
319
- query,
320
- results: results.slice(0, numResults)
321
- };
322
- }
323
- catch (error) {
324
- this.log(`Error in DuckDuckGo search: ${error instanceof Error ? error.message : String(error)}`);
325
- // Return a basic error result
326
- return {
327
- query,
328
- error: `Search failed: ${error instanceof Error ? error.message : String(error)}`,
329
- results: []
330
- };
331
- }
332
- }
333
- // Utility function to decode HTML entities in search results
334
- _decodeHtmlEntities(html) {
335
- return html
336
- .replace(/&lt;/g, '<')
337
- .replace(/&gt;/g, '>')
338
- .replace(/&quot;/g, '"')
339
- .replace(/&#39;/g, "'")
340
- .replace(/&amp;/g, '&')
341
- .replace(/<[^>]*>/g, ''); // Strip HTML tags
342
- }
343
- // Get recent terminal output
344
- async getTerminalOutput(maxLines = 20) {
345
- try {
346
- // Check if there are any terminals
347
- const terminals = vscode.window.terminals;
348
- if (terminals.length === 0) {
349
- return "No active terminals";
350
- }
351
- // Get the active terminal or the most recently created one
352
- const activeTerminal = vscode.window.activeTerminal || terminals[terminals.length - 1];
353
- // Create a new terminal that will execute a command to retrieve the history
354
- // We can't directly access terminal buffer, so we use a workaround
355
- let historyCommand = '';
356
- if (process.platform === 'win32') {
357
- // Windows
358
- historyCommand = 'doskey /history';
359
- }
360
- else {
361
- // Unix-like (Linux/macOS)
362
- historyCommand = 'cat ~/.bash_history | tail -n ' + maxLines;
363
- }
364
- // Execute command and capture output
365
- try {
366
- const output = await this.runCommand(historyCommand);
367
- return `Terminal "${activeTerminal.name}" recent history:\n${output}`;
368
- }
369
- catch (error) {
370
- // Fall back to just listing available terminals
371
- const terminalInfo = terminals.map(t => `- ${t.name}`).join('\n');
372
- return `Available terminals:\n${terminalInfo}\n(Unable to retrieve terminal history)`;
373
- }
374
- }
375
- catch (error) {
376
- this.log(`Error getting terminal output: ${error instanceof Error ? error.message : String(error)}`);
377
- return "Error retrieving terminal information";
378
- }
379
- }
380
- // Get file extension for a language
381
- _getFileExtension(language) {
382
- const langMap = {
383
- 'js': '.js',
384
- 'javascript': '.js',
385
- 'ts': '.ts',
386
- 'typescript': '.ts',
387
- 'py': '.py',
388
- 'python': '.py',
389
- 'bash': '.sh',
390
- 'sh': '.sh',
391
- 'rb': '.rb',
392
- 'ruby': '.rb',
393
- 'ps1': '.ps1',
394
- 'powershell': '.ps1'
395
- };
396
- return langMap[language.toLowerCase()] || null;
397
- }
398
- // Resolve a file path (relative to workspace root if needed)
399
- _resolveFilePath(filePath) {
400
- if (path.isAbsolute(filePath)) {
401
- return filePath;
402
- }
403
- else if (this._workspaceRoot) {
404
- return path.join(this._workspaceRoot, filePath);
405
- }
406
- // If no workspace root is available, use the current directory
407
- this.log('Warning: No workspace root available, using current directory');
408
- return path.join(process.cwd(), filePath);
409
- }
410
- // Edit a file at specific positions
411
- async editFile(filePath, edits) {
412
- try {
413
- this.log(`Editing file: ${filePath}`);
414
- const resolvedPath = this._resolveFilePath(filePath);
415
- // Check if file exists, if not create it with empty content
416
- if (!fs.existsSync(resolvedPath)) {
417
- this.log(`File does not exist: ${filePath}, creating it`);
418
- await writeFile(resolvedPath, '');
419
- }
420
- const originalContent = await readFile(resolvedPath, 'utf8');
421
- let newContent = originalContent;
422
- const editResults = [];
423
- // Apply edits (operations can be of different types)
424
- if (Array.isArray(edits.operations)) {
425
- for (const operation of edits.operations) {
426
- switch (operation.type) {
427
- case 'replace':
428
- // Replace content between specific lines or by pattern
429
- if (operation.startLine && operation.endLine) {
430
- // Line-based replacement
431
- const lines = newContent.split('\n');
432
- const startIdx = Math.max(0, operation.startLine - 1); // Convert to 0-based
433
- const endIdx = Math.min(lines.length, operation.endLine); // Convert to 0-based
434
- const beforeLines = lines.slice(0, startIdx);
435
- const afterLines = lines.slice(endIdx);
436
- // Replace the specified lines with new content
437
- newContent = [...beforeLines, operation.newText, ...afterLines].join('\n');
438
- editResults.push({
439
- operation: 'replace',
440
- startLine: operation.startLine,
441
- endLine: operation.endLine,
442
- success: true
443
- });
444
- }
445
- else if (operation.pattern) {
446
- // Pattern-based replacement
447
- const regex = new RegExp(operation.pattern, operation.flags || 'g');
448
- const oldContent = newContent;
449
- newContent = newContent.replace(regex, operation.replacement || '');
450
- editResults.push({
451
- operation: 'replace',
452
- pattern: operation.pattern,
453
- occurrences: (oldContent.match(regex) || []).length,
454
- success: true
455
- });
456
- }
457
- break;
458
- case 'insert':
459
- // Insert at specific line
460
- if (operation.line) {
461
- const lines = newContent.split('\n');
462
- const insertIdx = Math.min(lines.length, Math.max(0, operation.line - 1)); // Convert to 0-based
463
- lines.splice(insertIdx, 0, operation.text);
464
- newContent = lines.join('\n');
465
- editResults.push({
466
- operation: 'insert',
467
- line: operation.line,
468
- success: true
469
- });
470
- }
471
- else if (operation.position === 'start') {
472
- // Insert at start of file
473
- newContent = operation.text + newContent;
474
- editResults.push({
475
- operation: 'insert',
476
- position: 'start',
477
- success: true
478
- });
479
- }
480
- else if (operation.position === 'end') {
481
- // Insert at end of file
482
- newContent = newContent + operation.text;
483
- editResults.push({
484
- operation: 'insert',
485
- position: 'end',
486
- success: true
487
- });
488
- }
489
- break;
490
- case 'delete':
491
- // Delete specific lines
492
- if (operation.startLine && operation.endLine) {
493
- const lines = newContent.split('\n');
494
- const startIdx = Math.max(0, operation.startLine - 1); // Convert to 0-based
495
- const endIdx = Math.min(lines.length, operation.endLine); // Convert to 0-based
496
- const beforeLines = lines.slice(0, startIdx);
497
- const afterLines = lines.slice(endIdx);
498
- newContent = [...beforeLines, ...afterLines].join('\n');
499
- editResults.push({
500
- operation: 'delete',
501
- startLine: operation.startLine,
502
- endLine: operation.endLine,
503
- success: true
504
- });
505
- }
506
- break;
507
- }
508
- }
509
- }
510
- else if (typeof edits === 'string') {
511
- // Simple replacement of the entire file
512
- newContent = edits;
513
- editResults.push({
514
- operation: 'replace-all',
515
- success: true
516
- });
517
- }
518
- // Write the updated content back to the file
519
- await writeFile(resolvedPath, newContent);
520
- this.log(`File edited successfully: ${resolvedPath}`);
521
- return {
522
- success: true,
523
- path: filePath,
524
- operations: editResults,
525
- diff: {
526
- before: originalContent.length,
527
- after: newContent.length,
528
- changeSize: newContent.length - originalContent.length
529
- }
530
- };
531
- }
532
- catch (error) {
533
- this.log(`Error editing file: ${error instanceof Error ? error.message : String(error)}`);
534
- throw error;
535
- }
536
- }
537
- }
538
- exports.AgentUtils = AgentUtils;
539
- //# sourceMappingURL=agentUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agentUtils.js","sourceRoot":"","sources":["../src/agentUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,uCAAyB;AACzB,2CAA6B;AAC7B,2CAA6B;AAC7B,kDAAoC;AACpC,uCAAyB;AACzB,qDAAyC;AAEzC,oCAAoC;AACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;AAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AACvC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAQrC,MAAa,UAAU;IAItB;QACC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;IAC1E,CAAC;IAED,wBAAwB;IACjB,GAAG,CAAC,OAAe;QACzB,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,kBAAkB,EAAE,KAAK,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,0BAA0B;IACnB,iBAAiB;QACvB,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IA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,OAAO;oCAC1B,OAAO,EAAE,IAAI;iCACb,CAAC,CAAC;6BACH;4BACD,MAAM;qBACP;iBACD;aACD;iBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBACrC,wCAAwC;gBACxC,UAAU,GAAG,KAAK,CAAC;gBACnB,WAAW,CAAC,IAAI,CAAC;oBAChB,SAAS,EAAE,aAAa;oBACxB,OAAO,EAAE,IAAI;iBACb,CAAC,CAAC;aACH;YAED,6CAA6C;YAC7C,MAAM,SAAS,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;YAE1C,IAAI,CAAC,GAAG,CAAC,6BAA6B,YAAY,EAAE,CAAC,CAAC;YAEtD,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,WAAW;gBACvB,IAAI,EAAE;oBACL,MAAM,EAAE,eAAe,CAAC,MAAM;oBAC9B,KAAK,EAAE,UAAU,CAAC,MAAM;oBACxB,UAAU,EAAE,UAAU,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM;iBACtD;aACD,CAAC;SACF;QAAC,OAAO,KAAK,EAAE;YACf,IAAI,CAAC,GAAG,CAAC,uBAAuB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC1F,MAAM,KAAK,CAAC;SACZ;IACF,CAAC;CACD;AAljBD,gCAkjBC"}
@@ -1,58 +0,0 @@
1
- import * as vscode from 'vscode';
2
- import { AgentUtils } from './agentUtils';
3
- interface Message {
4
- role: 'user' | 'assistant' | 'system';
5
- content: string;
6
- timestamp: string;
7
- }
8
- interface Chat {
9
- id: string;
10
- title: string;
11
- messages: Message[];
12
- createdAt: string;
13
- updatedAt: string;
14
- }
15
- export declare class AIAssistantViewProvider implements vscode.WebviewViewProvider {
16
- private readonly _extensionUri;
17
- private _view?;
18
- private _chats;
19
- private _currentChatId;
20
- private _agentUtils;
21
- private _isProcessingAgentActions;
22
- private _lastEditedFile;
23
- private _lastEditTime;
24
- private _language;
25
- private _conversationHistory;
26
- private _trackedFiles;
27
- private _abortController;
28
- private _isGeneratingResponse;
29
- constructor(_extensionUri: vscode.Uri);
30
- private _ensureDefaultChat;
31
- private _createNewChat;
32
- private _getCurrentChat;
33
- private _getMessagesForDisplay;
34
- private _switchChat;
35
- private _renameChat;
36
- private _deleteChat;
37
- private _updateSystemMessage;
38
- gatherUserContext(): Promise<string>;
39
- ensureWebviewIsVisible(): void;
40
- resolveWebviewView(webviewView: vscode.WebviewView, _context: vscode.WebviewViewResolveContext, _token: vscode.CancellationToken): void;
41
- sendQueryToAI(query: string): Promise<void>;
42
- private _postMessageToWebview;
43
- private _getAIResponse;
44
- private _updateWebviewContent;
45
- _processAgentActions(message: string, chat: Chat): Promise<void>;
46
- private _processJsonActions;
47
- clearConversation(): void;
48
- private _getHtmlForWebview;
49
- getAgentUtils(): AgentUtils;
50
- toggleLanguage(): void;
51
- private _takeStateSnapshot;
52
- restoreToState(messageId: string): Promise<void>;
53
- private _deleteFiles;
54
- private _getConfiguration;
55
- private _saveConfiguration;
56
- }
57
- export {};
58
- //# sourceMappingURL=aiAssistantViewProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aiAssistantViewProvider.d.ts","sourceRoot":"","sources":["../src/aiAssistantViewProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAe,MAAM,cAAc,CAAC;AAEvD,UAAU,OAAO;IACb,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACrB;AA4CD,UAAU,IAAI;IACV,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,S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