@codemieai/code 0.0.1

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 (159) hide show
  1. package/.claude/agents/README.md +298 -0
  2. package/.claude/agents/release-manager.md +857 -0
  3. package/CLAUDE.md +856 -0
  4. package/LICENSE +201 -0
  5. package/README.md +917 -0
  6. package/bin/codemie-code.js +23 -0
  7. package/bin/codemie.js +8 -0
  8. package/dist/agents/adapters/aider.d.ts +12 -0
  9. package/dist/agents/adapters/aider.d.ts.map +1 -0
  10. package/dist/agents/adapters/aider.js +80 -0
  11. package/dist/agents/adapters/aider.js.map +1 -0
  12. package/dist/agents/adapters/claude-code.d.ts +12 -0
  13. package/dist/agents/adapters/claude-code.d.ts.map +1 -0
  14. package/dist/agents/adapters/claude-code.js +98 -0
  15. package/dist/agents/adapters/claude-code.js.map +1 -0
  16. package/dist/agents/adapters/codemie-code.d.ts +12 -0
  17. package/dist/agents/adapters/codemie-code.d.ts.map +1 -0
  18. package/dist/agents/adapters/codemie-code.js +42 -0
  19. package/dist/agents/adapters/codemie-code.js.map +1 -0
  20. package/dist/agents/adapters/codex.d.ts +12 -0
  21. package/dist/agents/adapters/codex.d.ts.map +1 -0
  22. package/dist/agents/adapters/codex.js +80 -0
  23. package/dist/agents/adapters/codex.js.map +1 -0
  24. package/dist/agents/registry.d.ts +18 -0
  25. package/dist/agents/registry.d.ts.map +1 -0
  26. package/dist/agents/registry.js +35 -0
  27. package/dist/agents/registry.js.map +1 -0
  28. package/dist/cli/cli.d.ts +4 -0
  29. package/dist/cli/cli.d.ts.map +1 -0
  30. package/dist/cli/cli.js +107 -0
  31. package/dist/cli/cli.js.map +1 -0
  32. package/dist/cli/commands/doctor.d.ts +3 -0
  33. package/dist/cli/commands/doctor.d.ts.map +1 -0
  34. package/dist/cli/commands/doctor.js +128 -0
  35. package/dist/cli/commands/doctor.js.map +1 -0
  36. package/dist/cli/commands/install.d.ts +3 -0
  37. package/dist/cli/commands/install.d.ts.map +1 -0
  38. package/dist/cli/commands/install.js +76 -0
  39. package/dist/cli/commands/install.js.map +1 -0
  40. package/dist/cli/commands/list.d.ts +3 -0
  41. package/dist/cli/commands/list.d.ts.map +1 -0
  42. package/dist/cli/commands/list.js +50 -0
  43. package/dist/cli/commands/list.js.map +1 -0
  44. package/dist/cli/commands/mcp.d.ts +3 -0
  45. package/dist/cli/commands/mcp.d.ts.map +1 -0
  46. package/dist/cli/commands/mcp.js +459 -0
  47. package/dist/cli/commands/mcp.js.map +1 -0
  48. package/dist/cli/commands/run.d.ts +3 -0
  49. package/dist/cli/commands/run.d.ts.map +1 -0
  50. package/dist/cli/commands/run.js +41 -0
  51. package/dist/cli/commands/run.js.map +1 -0
  52. package/dist/cli/commands/uninstall.d.ts +3 -0
  53. package/dist/cli/commands/uninstall.d.ts.map +1 -0
  54. package/dist/cli/commands/uninstall.js +71 -0
  55. package/dist/cli/commands/uninstall.js.map +1 -0
  56. package/dist/cli/commands/version.d.ts +3 -0
  57. package/dist/cli/commands/version.d.ts.map +1 -0
  58. package/dist/cli/commands/version.js +28 -0
  59. package/dist/cli/commands/version.js.map +1 -0
  60. package/dist/cli/index.d.ts +3 -0
  61. package/dist/cli/index.d.ts.map +1 -0
  62. package/dist/cli/index.js +50 -0
  63. package/dist/cli/index.js.map +1 -0
  64. package/dist/code/agent-events.d.ts +39 -0
  65. package/dist/code/agent-events.d.ts.map +1 -0
  66. package/dist/code/agent-events.js +4 -0
  67. package/dist/code/agent-events.js.map +1 -0
  68. package/dist/code/agent.d.ts +19 -0
  69. package/dist/code/agent.d.ts.map +1 -0
  70. package/dist/code/agent.js +144 -0
  71. package/dist/code/agent.js.map +1 -0
  72. package/dist/code/config.d.ts +13 -0
  73. package/dist/code/config.d.ts.map +1 -0
  74. package/dist/code/config.js +41 -0
  75. package/dist/code/config.js.map +1 -0
  76. package/dist/code/index.d.ts +19 -0
  77. package/dist/code/index.d.ts.map +1 -0
  78. package/dist/code/index.js +400 -0
  79. package/dist/code/index.js.map +1 -0
  80. package/dist/code/prompts.d.ts +2 -0
  81. package/dist/code/prompts.d.ts.map +1 -0
  82. package/dist/code/prompts.js +45 -0
  83. package/dist/code/prompts.js.map +1 -0
  84. package/dist/code/tools/command.d.ts +8 -0
  85. package/dist/code/tools/command.d.ts.map +1 -0
  86. package/dist/code/tools/command.js +83 -0
  87. package/dist/code/tools/command.js.map +1 -0
  88. package/dist/code/tools/diff-utils.d.ts +2 -0
  89. package/dist/code/tools/diff-utils.d.ts.map +1 -0
  90. package/dist/code/tools/diff-utils.js +45 -0
  91. package/dist/code/tools/diff-utils.js.map +1 -0
  92. package/dist/code/tools/filesystem.d.ts +11 -0
  93. package/dist/code/tools/filesystem.d.ts.map +1 -0
  94. package/dist/code/tools/filesystem.js +442 -0
  95. package/dist/code/tools/filesystem.js.map +1 -0
  96. package/dist/code/tools/git.d.ts +7 -0
  97. package/dist/code/tools/git.d.ts.map +1 -0
  98. package/dist/code/tools/git.js +111 -0
  99. package/dist/code/tools/git.js.map +1 -0
  100. package/dist/code/tools/mcp.d.ts +13 -0
  101. package/dist/code/tools/mcp.d.ts.map +1 -0
  102. package/dist/code/tools/mcp.js +230 -0
  103. package/dist/code/tools/mcp.js.map +1 -0
  104. package/dist/data/tips.json +118 -0
  105. package/dist/env/manager.d.ts +14 -0
  106. package/dist/env/manager.d.ts.map +1 -0
  107. package/dist/env/manager.js +99 -0
  108. package/dist/env/manager.js.map +1 -0
  109. package/dist/index.d.ts +14 -0
  110. package/dist/index.d.ts.map +1 -0
  111. package/dist/index.js +47 -0
  112. package/dist/index.js.map +1 -0
  113. package/dist/ui/terminal-ui.d.ts +73 -0
  114. package/dist/ui/terminal-ui.d.ts.map +1 -0
  115. package/dist/ui/terminal-ui.js +900 -0
  116. package/dist/ui/terminal-ui.js.map +1 -0
  117. package/dist/utils/async-tips.d.ts +64 -0
  118. package/dist/utils/async-tips.d.ts.map +1 -0
  119. package/dist/utils/async-tips.js +242 -0
  120. package/dist/utils/async-tips.js.map +1 -0
  121. package/dist/utils/env-mapper.d.ts +40 -0
  122. package/dist/utils/env-mapper.d.ts.map +1 -0
  123. package/dist/utils/env-mapper.js +122 -0
  124. package/dist/utils/env-mapper.js.map +1 -0
  125. package/dist/utils/errors.d.ts +25 -0
  126. package/dist/utils/errors.d.ts.map +1 -0
  127. package/dist/utils/errors.js +58 -0
  128. package/dist/utils/errors.js.map +1 -0
  129. package/dist/utils/exec.d.ts +12 -0
  130. package/dist/utils/exec.d.ts.map +1 -0
  131. package/dist/utils/exec.js +49 -0
  132. package/dist/utils/exec.js.map +1 -0
  133. package/dist/utils/logger.d.ts +19 -0
  134. package/dist/utils/logger.d.ts.map +1 -0
  135. package/dist/utils/logger.js +53 -0
  136. package/dist/utils/logger.js.map +1 -0
  137. package/dist/utils/tips.d.ts +35 -0
  138. package/dist/utils/tips.d.ts.map +1 -0
  139. package/dist/utils/tips.js +132 -0
  140. package/dist/utils/tips.js.map +1 -0
  141. package/docs/USER_GUIDE.md +573 -0
  142. package/eslint.config.mjs +43 -0
  143. package/package.json +66 -0
  144. package/tests/agent-direct.test.mjs +45 -0
  145. package/tests/agent-output.test.mjs +64 -0
  146. package/tests/codemie-code.test.mjs +42 -0
  147. package/tests/context7-only.test.mjs +42 -0
  148. package/tests/conversation-flow.test.mjs +63 -0
  149. package/tests/interactive-simulation.test.mjs +60 -0
  150. package/tests/live-output.test.mjs +53 -0
  151. package/tests/mcp-context7.test.mjs +105 -0
  152. package/tests/mcp-e2e.test.mjs +109 -0
  153. package/tests/mcp-time-server.test.mjs +58 -0
  154. package/tests/streaming.test.mjs +57 -0
  155. package/tests/test-helpers.mjs +94 -0
  156. package/tests/text-wrapping.test.mjs +33 -0
  157. package/tests/tool-count.test.mjs +81 -0
  158. package/tests/ui-format.test.mjs +39 -0
  159. package/tests/ui-state.test.mjs +72 -0
@@ -0,0 +1,400 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.CodeMieCode = void 0;
40
+ const filesystem_js_1 = require("./tools/filesystem.js");
41
+ const command_js_1 = require("./tools/command.js");
42
+ const git_js_1 = require("./tools/git.js");
43
+ const mcp_js_1 = require("./tools/mcp.js");
44
+ const agent_js_1 = require("./agent.js");
45
+ const config_js_1 = require("./config.js");
46
+ const logger_js_1 = require("../utils/logger.js");
47
+ const async_tips_js_1 = require("../utils/async-tips.js");
48
+ const terminal_ui_js_1 = require("../ui/terminal-ui.js");
49
+ const errors_js_1 = require("../utils/errors.js");
50
+ const chalk_1 = __importDefault(require("chalk"));
51
+ const fs = __importStar(require("fs"));
52
+ const path = __importStar(require("path"));
53
+ const child_process_1 = require("child_process");
54
+ class CodeMieCode {
55
+ agent = null;
56
+ config;
57
+ mcpTools = null;
58
+ constructor(workingDir) {
59
+ this.config = (0, config_js_1.loadConfig)(workingDir);
60
+ if (this.config.debug) {
61
+ logger_js_1.logger.setDebugEnabled(true);
62
+ }
63
+ }
64
+ async initialize(options = {}) {
65
+ const { showTips = true } = options;
66
+ logger_js_1.logger.info('Initializing CodeMie Code...');
67
+ // Show tips during initialization only if requested
68
+ const initPromise = this.performInitialization();
69
+ if (showTips) {
70
+ async_tips_js_1.asyncTipDisplay.showDuring(initPromise);
71
+ }
72
+ await initPromise;
73
+ logger_js_1.logger.success('CodeMie Code initialized');
74
+ logger_js_1.logger.info(`Working directory: ${this.config.workingDirectory}`);
75
+ logger_js_1.logger.info(`Model: ${this.config.model} (${this.config.provider})`);
76
+ }
77
+ async performInitialization() {
78
+ // Collect all tools
79
+ const tools = [];
80
+ // Filesystem tools
81
+ const filesystemTools = new filesystem_js_1.FilesystemTools({
82
+ allowedDirectories: [this.config.workingDirectory]
83
+ });
84
+ tools.push(...filesystemTools.getTools());
85
+ logger_js_1.logger.debug(`Added ${filesystemTools.getTools().length} filesystem tools`);
86
+ // Command tools
87
+ const commandTools = new command_js_1.CommandTools({
88
+ allowedDirectories: [this.config.workingDirectory]
89
+ });
90
+ tools.push(...commandTools.getTools());
91
+ logger_js_1.logger.debug(`Added ${commandTools.getTools().length} command tools`);
92
+ // Git tools
93
+ const gitTools = new git_js_1.GitTools(this.config.workingDirectory);
94
+ tools.push(...gitTools.getTools());
95
+ logger_js_1.logger.debug(`Added ${gitTools.getTools().length} git tools`);
96
+ // MCP tools - always try to initialize to check for configured servers
97
+ // If mcpServers is undefined, MCPTools will load all available servers from config
98
+ // If mcpServers is an empty array, no servers will be loaded
99
+ // If mcpServers has values, only those specific servers will be loaded
100
+ try {
101
+ this.mcpTools = new mcp_js_1.MCPTools(this.config.workingDirectory);
102
+ await this.mcpTools.initialize(this.config.mcpServers);
103
+ const mcpToolsList = await this.mcpTools.getTools();
104
+ if (mcpToolsList.length > 0) {
105
+ tools.push(...mcpToolsList);
106
+ logger_js_1.logger.info(`Added ${mcpToolsList.length} MCP tools`);
107
+ }
108
+ }
109
+ catch (error) {
110
+ logger_js_1.logger.warn(`Failed to initialize MCP tools: ${(0, errors_js_1.getErrorMessage)(error)}`);
111
+ }
112
+ // Create agent
113
+ this.agent = new agent_js_1.CodeMieAgent(this.config, tools);
114
+ logger_js_1.logger.info(`Total tools: ${tools.length}`);
115
+ }
116
+ async startInteractive() {
117
+ if (!this.agent) {
118
+ throw new Error('Agent not initialized. Call initialize() first.');
119
+ }
120
+ // Load tips from file
121
+ const tips = this.loadTips();
122
+ // Create terminal UI
123
+ const ui = new terminal_ui_js_1.TerminalUI({
124
+ onSubmit: async (message) => {
125
+ try {
126
+ const response = await this.agent.chat(message);
127
+ ui.showAssistantResponse(response);
128
+ }
129
+ catch (error) {
130
+ logger_js_1.logger.error('Error during conversation:', error);
131
+ ui.showError((0, errors_js_1.getErrorMessage)(error));
132
+ }
133
+ },
134
+ onSubmitStream: async (message, onEvent, abortSignal) => {
135
+ try {
136
+ await this.agent.chatStream(message, onEvent, abortSignal);
137
+ }
138
+ catch (error) {
139
+ // Check if error is from cancellation
140
+ const errorMsg = (0, errors_js_1.getErrorMessage)(error);
141
+ if (errorMsg === 'Execution cancelled by user') {
142
+ // Cancellation is already handled via event, no need to log as error
143
+ return;
144
+ }
145
+ logger_js_1.logger.error('Error during streaming conversation:', error);
146
+ onEvent({ type: 'error', error: errorMsg });
147
+ }
148
+ },
149
+ onSlashCommand: async (command, args) => {
150
+ return this.handleSlashCommand(command, args);
151
+ },
152
+ onClear: () => {
153
+ // Clear the agent's conversation history
154
+ this.agent.clearHistory();
155
+ },
156
+ onExit: async () => {
157
+ // Suppress stderr during cleanup to avoid terminfo errors
158
+ const originalStderr = process.stderr.write;
159
+ process.stderr.write = () => true;
160
+ try {
161
+ await this.dispose();
162
+ }
163
+ finally {
164
+ // Restore stderr
165
+ process.stderr.write = originalStderr;
166
+ }
167
+ process.exit(0);
168
+ },
169
+ workingDirectory: this.config.workingDirectory,
170
+ model: this.config.model,
171
+ provider: this.config.provider
172
+ });
173
+ // Set tips for rotation
174
+ ui.setTips(tips);
175
+ // Keep the process running
176
+ return new Promise(() => {
177
+ // This promise never resolves, keeping the UI active
178
+ // The UI will handle exit via onExit callback
179
+ });
180
+ }
181
+ async handleSlashCommand(command, args) {
182
+ try {
183
+ // Build the codemie command
184
+ const fullCommand = `codemie ${command} ${args.join(' ')}`;
185
+ // Execute the command synchronously and capture output
186
+ const output = (0, child_process_1.execSync)(fullCommand, {
187
+ cwd: this.config.workingDirectory,
188
+ encoding: 'utf-8',
189
+ maxBuffer: 10 * 1024 * 1024, // 10MB buffer
190
+ stdio: ['pipe', 'pipe', 'pipe'],
191
+ env: {
192
+ ...process.env,
193
+ CODEMIE_IN_ASSISTANT: 'true' // Flag to suppress tips in assistant context
194
+ }
195
+ });
196
+ return output;
197
+ }
198
+ catch (error) {
199
+ // If command fails, return the error output (stderr contains the actual error message)
200
+ if (error && typeof error === 'object' && ('stderr' in error || 'stdout' in error)) {
201
+ const stderr = ('stderr' in error && typeof error.stderr === 'string' ? error.stderr : '').trim();
202
+ const stdout = ('stdout' in error && typeof error.stdout === 'string' ? error.stdout : '').trim();
203
+ const combined = [stdout, stderr].filter(Boolean).join('\n');
204
+ throw new Error(combined || (0, errors_js_1.getErrorMessage)(error));
205
+ }
206
+ throw new Error(`Command failed: ${(0, errors_js_1.getErrorMessage)(error)}`);
207
+ }
208
+ }
209
+ loadTips() {
210
+ try {
211
+ const tipsPath = path.join(__dirname, '../data/tips.json');
212
+ const tipsData = fs.readFileSync(tipsPath, 'utf-8');
213
+ return JSON.parse(tipsData);
214
+ }
215
+ catch {
216
+ return [
217
+ { message: 'Run codemie list to see available agents', command: 'codemie list' },
218
+ { message: 'Use codemie doctor to check your setup', command: 'codemie doctor' }
219
+ ];
220
+ }
221
+ }
222
+ async chat(message) {
223
+ if (!this.agent) {
224
+ throw new Error('Agent not initialized. Call initialize() first.');
225
+ }
226
+ return await this.agent.chat(message);
227
+ }
228
+ async executeNonInteractive(task) {
229
+ if (!this.agent) {
230
+ throw new Error('Agent not initialized. Call initialize() first.');
231
+ }
232
+ // Check if task is a slash command (proxy command)
233
+ if (task.startsWith('/')) {
234
+ const parts = task.slice(1).split(/\s+/);
235
+ const command = parts[0];
236
+ const args = parts.slice(1);
237
+ console.log(chalk_1.default.yellow(`Executing command: /${command} ${args.join(' ')}`));
238
+ console.log();
239
+ try {
240
+ const result = await this.executeSlashCommand(command, args);
241
+ console.log(result);
242
+ process.exit(0);
243
+ }
244
+ catch (error) {
245
+ console.error(chalk_1.default.red('Error:'), (0, errors_js_1.getErrorMessage)(error));
246
+ process.exit(1);
247
+ }
248
+ return;
249
+ }
250
+ // Execute as agent task with streaming output
251
+ console.log(chalk_1.default.cyan('Task:'), task);
252
+ console.log();
253
+ let hasOutput = false;
254
+ let hasError = false;
255
+ let isThinking = false;
256
+ // Create AbortController for cancellation (Ctrl+C in non-interactive mode)
257
+ const abortController = new AbortController();
258
+ const abortHandler = () => {
259
+ console.log(chalk_1.default.yellow('\nCancelling execution...'));
260
+ abortController.abort();
261
+ };
262
+ process.once('SIGINT', abortHandler);
263
+ try {
264
+ await this.agent.chatStream(task, (event) => {
265
+ switch (event.type) {
266
+ case 'thinking_start':
267
+ if (!isThinking) {
268
+ process.stderr.write(chalk_1.default.gray('(thinking...)'));
269
+ isThinking = true;
270
+ }
271
+ break;
272
+ case 'thinking_end':
273
+ // Clear the thinking line
274
+ if (isThinking) {
275
+ process.stderr.write('\r\x1b[K'); // Clear line
276
+ isThinking = false;
277
+ }
278
+ break;
279
+ case 'content_chunk':
280
+ // Clear thinking indicator if still showing
281
+ if (isThinking) {
282
+ process.stderr.write('\r\x1b[K');
283
+ isThinking = false;
284
+ }
285
+ if (!hasOutput) {
286
+ hasOutput = true;
287
+ }
288
+ process.stdout.write(event.content);
289
+ break;
290
+ case 'tool_call_start':
291
+ // Clear thinking indicator if still showing
292
+ if (isThinking) {
293
+ process.stderr.write('\r\x1b[K');
294
+ isThinking = false;
295
+ }
296
+ console.log();
297
+ console.log(chalk_1.default.green('⏺'), chalk_1.default.white(`${event.toolName}(${Object.values(event.toolArgs || {}).join(', ')})`));
298
+ break;
299
+ case 'tool_call_result': {
300
+ // Truncate long results
301
+ const lines = event.result?.split('\n') || [];
302
+ const maxLines = 5;
303
+ const displayLines = lines.slice(0, maxLines);
304
+ console.log(chalk_1.default.gray(' ⎿'), displayLines[0] || '');
305
+ for (let i = 1; i < displayLines.length; i++) {
306
+ console.log(' ', displayLines[i]);
307
+ }
308
+ if (lines.length > maxLines) {
309
+ console.log(chalk_1.default.gray(` … +${lines.length - maxLines} lines`));
310
+ }
311
+ console.log();
312
+ break;
313
+ }
314
+ case 'tool_call_error':
315
+ console.log(chalk_1.default.red('⏺ Error:'), event.error);
316
+ console.log();
317
+ break;
318
+ case 'complete':
319
+ // Clear thinking indicator if still showing
320
+ if (isThinking) {
321
+ process.stderr.write('\r\x1b[K');
322
+ isThinking = false;
323
+ }
324
+ if (hasOutput) {
325
+ console.log(); // Add newline after final output
326
+ }
327
+ break;
328
+ case 'error':
329
+ hasError = true;
330
+ // Clear thinking indicator if still showing
331
+ if (isThinking) {
332
+ process.stderr.write('\r\x1b[K');
333
+ isThinking = false;
334
+ }
335
+ console.error(chalk_1.default.red('Error:'), event.error);
336
+ break;
337
+ case 'cancelled':
338
+ // Clear thinking indicator if still showing
339
+ if (isThinking) {
340
+ process.stderr.write('\r\x1b[K');
341
+ isThinking = false;
342
+ }
343
+ console.log();
344
+ console.log(chalk_1.default.yellow('Execution cancelled.'));
345
+ break;
346
+ }
347
+ }, abortController.signal);
348
+ process.removeListener('SIGINT', abortHandler);
349
+ process.exit(hasError ? 1 : 0);
350
+ }
351
+ catch (error) {
352
+ process.removeListener('SIGINT', abortHandler);
353
+ // Clear thinking indicator if still showing
354
+ if (isThinking) {
355
+ process.stderr.write('\r\x1b[K');
356
+ }
357
+ // Check if error is from cancellation
358
+ const errorMsg = (0, errors_js_1.getErrorMessage)(error);
359
+ if (errorMsg === 'Execution cancelled by user') {
360
+ process.exit(130); // Standard exit code for SIGINT
361
+ }
362
+ console.error(chalk_1.default.red('Error:'), errorMsg);
363
+ process.exit(1);
364
+ }
365
+ }
366
+ async executeSlashCommand(command, args) {
367
+ // Build the codemie command
368
+ const fullCommand = `codemie ${command} ${args.join(' ')}`;
369
+ // Execute the command synchronously and capture output
370
+ const output = (0, child_process_1.execSync)(fullCommand, {
371
+ cwd: this.config.workingDirectory,
372
+ encoding: 'utf-8',
373
+ maxBuffer: 10 * 1024 * 1024, // 10MB buffer
374
+ stdio: ['pipe', 'pipe', 'pipe']
375
+ });
376
+ return output;
377
+ }
378
+ async dispose() {
379
+ if (this.mcpTools) {
380
+ await this.mcpTools.dispose();
381
+ }
382
+ }
383
+ static async testConnection() {
384
+ try {
385
+ const config = (0, config_js_1.loadConfig)();
386
+ logger_js_1.logger.info(`Testing ${config.provider} connection...`);
387
+ logger_js_1.logger.info(`Base URL: ${config.baseUrl}`);
388
+ logger_js_1.logger.info(`Model: ${config.model}`);
389
+ // Simple test to verify credentials
390
+ const _testAgent = new agent_js_1.CodeMieAgent(config, []);
391
+ logger_js_1.logger.success('Connection test successful!');
392
+ }
393
+ catch (error) {
394
+ logger_js_1.logger.error('Connection test failed:', error);
395
+ throw error;
396
+ }
397
+ }
398
+ }
399
+ exports.CodeMieCode = CodeMieCode;
400
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/code/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yDAAwD;AACxD,mDAAkD;AAClD,2CAA0C;AAC1C,2CAA0C;AAC1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,QAAQ,EAAE,CAAC;YAClB,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,cAAc;QACzB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAA,sBAAU,GAAE,CAAC;YAC5B,kBAAM,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,QAAQ,gBAAgB,CAAC,CAAC;YACxD,kBAAM,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;YAC3C,kBAAM,CAAC,IAAI,CAAC,UAAU,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAEtC,oCAAoC;YACpC,MAAM,UAAU,GAAG,IAAI,uBAAY,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAChD,kBAAM,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;QAChD,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,kBAAM,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;YAC/C,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAlYD,kCAkYC"}
@@ -0,0 +1,2 @@
1
+ export declare const SYSTEM_PROMPT = "You are CodeMie Code, an AI coding assistant powered by LiteLLM.\n\nYou have access to filesystem tools that allow you to:\n- Read and write files\n- Edit files with diff-based updates\n- Navigate directory structures\n- Search for files and content\n- Execute commands safely\n- Perform git operations\n\nYour role is to:\n1. Help users write, review, and debug code\n2. Suggest improvements and best practices\n3. Explain complex concepts clearly\n4. Execute tasks safely and securely\n5. Provide clear reasoning for your decisions\n\nSecurity Guidelines:\n- All filesystem operations are restricted to allowed directories\n- Dangerous commands are blocked automatically\n- Path validation prevents directory traversal attacks\n- Symlinks are validated to prevent escaping allowed directories\n\nBest Practices:\n- Always read files before editing them\n- Use edit_file with diff-based updates for precision\n- Provide clear explanations of changes\n- Test your suggestions when possible\n- Ask for clarification when requirements are ambiguous\n\nAvailable Tools:\n- Filesystem: read_file, write_file, edit_file, list_directory, project_tree, search_files, etc.\n- Command Execution: execute_command (with safety checks)\n- Git: git_status, git_diff, git_log, git_command\n- MCP: Additional tools from configured MCP servers (if enabled)\n\nRemember:\n- Be helpful, clear, and concise\n- Prioritize code quality and security\n- Explain your reasoning\n- Always validate assumptions";
2
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/code/prompts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,i9CAwCI,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SYSTEM_PROMPT = void 0;
4
+ exports.SYSTEM_PROMPT = `You are CodeMie Code, an AI coding assistant powered by LiteLLM.
5
+
6
+ You have access to filesystem tools that allow you to:
7
+ - Read and write files
8
+ - Edit files with diff-based updates
9
+ - Navigate directory structures
10
+ - Search for files and content
11
+ - Execute commands safely
12
+ - Perform git operations
13
+
14
+ Your role is to:
15
+ 1. Help users write, review, and debug code
16
+ 2. Suggest improvements and best practices
17
+ 3. Explain complex concepts clearly
18
+ 4. Execute tasks safely and securely
19
+ 5. Provide clear reasoning for your decisions
20
+
21
+ Security Guidelines:
22
+ - All filesystem operations are restricted to allowed directories
23
+ - Dangerous commands are blocked automatically
24
+ - Path validation prevents directory traversal attacks
25
+ - Symlinks are validated to prevent escaping allowed directories
26
+
27
+ Best Practices:
28
+ - Always read files before editing them
29
+ - Use edit_file with diff-based updates for precision
30
+ - Provide clear explanations of changes
31
+ - Test your suggestions when possible
32
+ - Ask for clarification when requirements are ambiguous
33
+
34
+ Available Tools:
35
+ - Filesystem: read_file, write_file, edit_file, list_directory, project_tree, search_files, etc.
36
+ - Command Execution: execute_command (with safety checks)
37
+ - Git: git_status, git_diff, git_log, git_command
38
+ - MCP: Additional tools from configured MCP servers (if enabled)
39
+
40
+ Remember:
41
+ - Be helpful, clear, and concise
42
+ - Prioritize code quality and security
43
+ - Explain your reasoning
44
+ - Always validate assumptions`;
45
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/code/prompts.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAwCC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { StructuredTool } from '@langchain/core/tools';
2
+ import { FilesystemConfig } from './filesystem.js';
3
+ export declare class CommandTools {
4
+ private config;
5
+ constructor(config: FilesystemConfig);
6
+ getTools(): StructuredTool[];
7
+ }
8
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/code/tools/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,qBAAa,YAAY;IACX,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,gBAAgB;IAE5C,QAAQ,IAAI,cAAc,EAAE;CAG7B"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommandTools = void 0;
4
+ const tools_1 = require("@langchain/core/tools");
5
+ const zod_1 = require("zod");
6
+ const exec_js_1 = require("../../utils/exec.js");
7
+ const errors_js_1 = require("../../utils/errors.js");
8
+ class CommandTools {
9
+ config;
10
+ constructor(config) {
11
+ this.config = config;
12
+ }
13
+ getTools() {
14
+ return [new ExecuteCommandTool(this.config)];
15
+ }
16
+ }
17
+ exports.CommandTools = CommandTools;
18
+ class ExecuteCommandTool extends tools_1.StructuredTool {
19
+ config;
20
+ name = 'execute_command';
21
+ description = `Execute a shell command in a working directory.
22
+
23
+ Returns:
24
+ - Working directory
25
+ - Command executed
26
+ - Exit code
27
+ - Standard output
28
+ - Standard error (if failed)
29
+
30
+ Security: Blocks dangerous patterns like rm -rf /, mkfs, sudo, etc.`;
31
+ schema = zod_1.z.object({
32
+ command: zod_1.z.string().describe('Command to execute'),
33
+ working_directory: zod_1.z.string().nullable().optional().describe('Working directory (default: first allowed dir)')
34
+ });
35
+ // Dangerous command patterns from cli/coding
36
+ dangerousPatterns = [
37
+ { regex: /rm\s+-rf\s+\//, message: 'Dangerous: recursive delete on root' },
38
+ { regex: /mkfs/, message: 'Dangerous: filesystem formatting' },
39
+ { regex: /dd\s+if=/, message: 'Dangerous: disk operations' },
40
+ { regex: /wget.*\|.*sh/, message: 'Dangerous: download and execute' },
41
+ { regex: /curl.*\|.*sh/, message: 'Dangerous: download and execute' },
42
+ { regex: /sudo/, message: 'Dangerous: privilege escalation' },
43
+ { regex: /chmod\s+777/, message: 'Dangerous: unsafe permissions' },
44
+ { regex: />\s*\/etc\//, message: 'Dangerous: writing to system config' },
45
+ { regex: />\s*\/dev\//, message: 'Dangerous: writing to devices' },
46
+ { regex: /:\(\)\{\s*:\|:&\s*\};:/, message: 'Dangerous: fork bomb' }
47
+ ];
48
+ constructor(config) {
49
+ super();
50
+ this.config = config;
51
+ }
52
+ async _call({ command, working_directory }) {
53
+ // Security check
54
+ for (const { regex, message } of this.dangerousPatterns) {
55
+ if (regex.test(command)) {
56
+ return `Error: ${message}`;
57
+ }
58
+ }
59
+ // Determine working directory
60
+ const workDir = working_directory || this.config.allowedDirectories[0];
61
+ try {
62
+ const result = await (0, exec_js_1.exec)('sh', ['-c', command], {
63
+ cwd: workDir
64
+ });
65
+ const output = [
66
+ `Working directory: ${workDir}`,
67
+ `Command: ${command}`,
68
+ `Exit code: ${result.code}`
69
+ ];
70
+ if (result.stdout) {
71
+ output.push('\nStandard output:', result.stdout);
72
+ }
73
+ if (result.code !== 0 && result.stderr) {
74
+ output.push('\nStandard error:', result.stderr);
75
+ }
76
+ return output.join('\n');
77
+ }
78
+ catch (error) {
79
+ return `Error executing command: ${(0, errors_js_1.getErrorMessage)(error)}`;
80
+ }
81
+ }
82
+ }
83
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/code/tools/command.ts"],"names":[],"mappings":";;;AAAA,iDAAuD;AACvD,6BAAwB;AACxB,iDAA2C;AAE3C,qDAAwD;AAExD,MAAa,YAAY;IACH;IAApB,YAAoB,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;IAAG,CAAC;IAEhD,QAAQ;QACN,OAAO,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/C,CAAC;CACF;AAND,oCAMC;AAED,MAAM,kBAAmB,SAAQ,sBAAc;IAgCzB;IA/BpB,IAAI,GAAG,iBAAiB,CAAC;IACzB,WAAW,GAAG;;;;;;;;;sEASsD,CAAC;IAErE,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC;QAChB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAClD,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;KAC/G,CAAC,CAAC;IAEH,6CAA6C;IACrC,iBAAiB,GAAG;QAC1B,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,qCAAqC,EAAE;QAC1E,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,kCAAkC,EAAE;QAC9D,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,4BAA4B,EAAE;QAC5D,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,iCAAiC,EAAE;QACrE,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,iCAAiC,EAAE;QACrE,EAAE,KAAK,EAAE,MAAM,EAAE,OA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MAAM,CAAC,MAAM,EAAE,CAAC;gBACvC,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;YAClD,CAAC;YAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,OAAO,4BAA4B,IAAA,2BAAe,EAAC,KAAK,CAAC,EAAE,CAAC;QAC9D,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export declare function createUnifiedDiff(oldContent: string, newContent: string, filePath: string): string;
2
+ //# sourceMappingURL=diff-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-utils.d.ts","sourceRoot":"","sources":["../../../src/code/tools/diff-utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,CAcR"}
@@ -0,0 +1,45 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.createUnifiedDiff = createUnifiedDiff;
37
+ const diff = __importStar(require("diff"));
38
+ function createUnifiedDiff(oldContent, newContent, filePath) {
39
+ const patch = diff.createPatch(filePath, oldContent, newContent, 'original', 'modified');
40
+ // Format with code fence
41
+ const numBackticks = Math.max(3, (patch.match(/`+/g) || []).reduce((max, m) => Math.max(max, m.length), 0) + 1);
42
+ const fence = '`'.repeat(numBackticks);
43
+ return `${fence}diff\n${patch}${fence}\n\n`;
44
+ }
45
+ //# sourceMappingURL=diff-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-utils.js","sourceRoot":"","sources":["../../../src/code/tools/diff-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,8CAkBC;AApBD,2CAA6B;AAE7B,SAAgB,iBAAiB,CAC/B,UAAkB,EAClB,UAAkB,EAClB,QAAgB;IAEhB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAC5B,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,CACX,CAAC;IAEF,yBAAyB;IACzB,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAChH,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAEvC,OAAO,GAAG,KAAK,SAAS,KAAK,GAAG,KAAK,MAAM,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { StructuredTool } from '@langchain/core/tools';
2
+ export interface FilesystemConfig {
3
+ allowedDirectories: string[];
4
+ ignorePatterns?: string[];
5
+ }
6
+ export declare class FilesystemTools {
7
+ private config;
8
+ constructor(config: FilesystemConfig);
9
+ getTools(): StructuredTool[];
10
+ }
11
+ //# sourceMappingURL=filesystem.d.ts.map