xibecode 0.0.5 → 0.0.8

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 (52) hide show
  1. package/README.md +22 -22
  2. package/dist/commands/chat.d.ts +2 -0
  3. package/dist/commands/chat.d.ts.map +1 -1
  4. package/dist/commands/chat.js +362 -80
  5. package/dist/commands/chat.js.map +1 -1
  6. package/dist/commands/config.d.ts.map +1 -1
  7. package/dist/commands/config.js +21 -59
  8. package/dist/commands/config.js.map +1 -1
  9. package/dist/commands/mcp.d.ts.map +1 -1
  10. package/dist/commands/mcp.js +12 -11
  11. package/dist/commands/mcp.js.map +1 -1
  12. package/dist/commands/run.d.ts.map +1 -1
  13. package/dist/commands/run.js +10 -8
  14. package/dist/commands/run.js.map +1 -1
  15. package/dist/core/agent.d.ts +5 -0
  16. package/dist/core/agent.d.ts.map +1 -1
  17. package/dist/core/agent.js +7 -0
  18. package/dist/core/agent.js.map +1 -1
  19. package/dist/core/export.d.ts +11 -0
  20. package/dist/core/export.d.ts.map +1 -0
  21. package/dist/core/export.js +54 -0
  22. package/dist/core/export.js.map +1 -0
  23. package/dist/core/mcp-client.d.ts +2 -8
  24. package/dist/core/mcp-client.d.ts.map +1 -1
  25. package/dist/core/mcp-client.js +8 -11
  26. package/dist/core/mcp-client.js.map +1 -1
  27. package/dist/core/session-manager.d.ts +78 -0
  28. package/dist/core/session-manager.d.ts.map +1 -0
  29. package/dist/core/session-manager.js +161 -0
  30. package/dist/core/session-manager.js.map +1 -0
  31. package/dist/core/tools.d.ts.map +1 -1
  32. package/dist/core/tools.js +6 -7
  33. package/dist/core/tools.js.map +1 -1
  34. package/dist/index.js +3 -1
  35. package/dist/index.js.map +1 -1
  36. package/dist/ui/enhanced-tui.d.ts +22 -1
  37. package/dist/ui/enhanced-tui.d.ts.map +1 -1
  38. package/dist/ui/enhanced-tui.js +157 -128
  39. package/dist/ui/enhanced-tui.js.map +1 -1
  40. package/dist/ui/themes.d.ts +25 -0
  41. package/dist/ui/themes.d.ts.map +1 -0
  42. package/dist/ui/themes.js +176 -0
  43. package/dist/ui/themes.js.map +1 -0
  44. package/dist/utils/config.d.ts +37 -5
  45. package/dist/utils/config.d.ts.map +1 -1
  46. package/dist/utils/config.js +58 -15
  47. package/dist/utils/config.js.map +1 -1
  48. package/dist/utils/mcp-servers-file.d.ts +11 -4
  49. package/dist/utils/mcp-servers-file.d.ts.map +1 -1
  50. package/dist/utils/mcp-servers-file.js +101 -49
  51. package/dist/utils/mcp-servers-file.js.map +1 -1
  52. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ const program = new Command();
11
11
  program
12
12
  .name('xibecode')
13
13
  .description('XibeCode - AI-powered autonomous coding assistant')
14
- .version('0.0.5');
14
+ .version('0.0.8');
15
15
  // Main run command
16
16
  program
17
17
  .command('run')
@@ -33,6 +33,8 @@ program
33
33
  .option('-m, --model <model>', 'AI model to use')
34
34
  .option('-b, --base-url <url>', 'Custom API base URL')
35
35
  .option('-k, --api-key <key>', 'API key (overrides config)')
36
+ .option('--theme <theme>', 'UI theme to use')
37
+ .option('--session <id>', 'Resume a specific chat session by id')
36
38
  .action(chatCommand);
37
39
  // Configuration
38
40
  program
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MA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;IAChB,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,gDAAgD,CAAC,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,kDAAkD,CAAC,CAAC,CAAC;IAC1E,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,gDAAgD,CAAC,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,gDAAgD,CAAC,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -1,11 +1,32 @@
1
+ import { type ThemeName } from './themes.js';
1
2
  export declare class EnhancedUI {
2
3
  private spinner;
3
4
  private verbose;
5
+ private showDetails;
6
+ private showThinking;
7
+ private themeName;
8
+ private T;
4
9
  private startTime;
5
10
  private isStreaming;
6
11
  private streamLineLen;
7
12
  private toolCount;
8
- constructor(verbose?: boolean);
13
+ constructor(verbose?: boolean, themeName?: ThemeName);
14
+ setTheme(themeName: ThemeName): void;
15
+ getThemeName(): ThemeName;
16
+ setShowDetails(show: boolean): void;
17
+ getShowDetails(): boolean;
18
+ setShowThinking(show: boolean): void;
19
+ getShowThinking(): boolean;
20
+ renderStatusBar(info: {
21
+ model: string;
22
+ sessionTitle?: string;
23
+ tokensLabel?: string;
24
+ cwd?: string;
25
+ toolsEnabled?: boolean;
26
+ themeName?: string;
27
+ }): void;
28
+ private line;
29
+ private thinLine;
9
30
  header(_version?: string): void;
10
31
  modelInfo(model: string, endpoint?: string): void;
11
32
  chatBanner(cwd: string, model: string, endpoint?: string): void;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AAO,EAAE,IAAI,CAAC,EAAE,MAAM;IAU5C,OAAO;IAIP,KAAK;IAKL,OAAO,CAAC,WAAW;IAoBnB,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,eAAe;IAyBvB,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,QAAQ;CAejB"}
@@ -1,53 +1,78 @@
1
1
  import chalk from 'chalk';
2
2
  import ora from 'ora';
3
+ import { getTheme } from './themes.js';
3
4
  // ─── Version ────────────────────────────────────────────────────
4
- const VERSION = '0.0.5';
5
- // ─── Theme (Gemini CLI / OpenCode inspired) ─────────────────────
6
- const T = {
7
- // Brand
8
- brand: chalk.hex('#00D4FF').bold, // bright cyan brand
9
- brandDim: chalk.hex('#0099BB'),
10
- // UI chrome
11
- border: chalk.hex('#3A3A4A'), // subtle dark border
12
- panel: chalk.hex('#555577'), // panel accents
13
- // Content
14
- text: chalk.white,
15
- dim: chalk.hex('#6B6B7B'),
16
- dimBold: chalk.hex('#8888AA').bold,
17
- muted: chalk.hex('#4A4A5A'),
18
- // Semantic
19
- success: chalk.hex('#00E676'), // vivid green
20
- error: chalk.hex('#FF5252'), // vivid red
21
- warn: chalk.hex('#FFD740'), // amber
22
- info: chalk.hex('#40C4FF'), // light blue
23
- // Roles
24
- tool: chalk.hex('#BB86FC'), // purple (material)
25
- toolDim: chalk.hex('#7B5EA7'),
26
- user: chalk.hex('#00E676').bold,
27
- assistant: chalk.hex('#00D4FF').bold,
28
- // Emphasis
29
- bold: chalk.bold.white,
30
- code: chalk.hex('#CE93D8'), // light purple for paths
31
- };
5
+ const VERSION = '0.0.8';
32
6
  const W = 62; // box width
33
7
  // ─── Helpers ────────────────────────────────────────────────────
34
8
  function pad(str, len) {
35
9
  const raw = str.replace(/\u001b\[[0-9;]*m/g, ''); // strip ANSI
36
10
  return str + ' '.repeat(Math.max(0, len - raw.length));
37
11
  }
38
- function line(ch = '─') { return T.border(ch.repeat(W)); }
39
- function thinLine() { return T.muted('·'.repeat(W)); }
40
12
  // ─── UI Class ───────────────────────────────────────────────────
41
13
  export class EnhancedUI {
42
14
  spinner = null;
43
15
  verbose;
16
+ showDetails;
17
+ showThinking;
18
+ themeName;
19
+ T;
44
20
  startTime = 0;
45
21
  isStreaming = false;
46
22
  streamLineLen = 0;
47
23
  toolCount = 0;
48
- constructor(verbose = false) {
24
+ constructor(verbose = false, themeName = 'default') {
49
25
  this.verbose = verbose;
26
+ this.showDetails = verbose;
27
+ this.showThinking = true;
28
+ this.themeName = themeName;
29
+ this.T = getTheme(themeName);
30
+ }
31
+ setTheme(themeName) {
32
+ this.themeName = themeName;
33
+ this.T = getTheme(themeName);
34
+ }
35
+ getThemeName() {
36
+ return this.themeName;
37
+ }
38
+ setShowDetails(show) {
39
+ this.showDetails = show;
40
+ }
41
+ getShowDetails() {
42
+ return this.showDetails;
43
+ }
44
+ setShowThinking(show) {
45
+ this.showThinking = show;
46
+ if (!show)
47
+ this.stopSpinner();
48
+ }
49
+ getShowThinking() {
50
+ return this.showThinking;
51
+ }
52
+ // ─── Status bar ─────────────────────────────────────────
53
+ renderStatusBar(info) {
54
+ const left = info.cwd ? this.T.muted(info.cwd) : '';
55
+ const session = info.sessionTitle ? `session: ${info.sessionTitle}` : '';
56
+ const model = `model: ${info.model}`;
57
+ const tokens = info.tokensLabel ? `tokens: ${info.tokensLabel}` : '';
58
+ const tools = info.toolsEnabled === undefined ? '' : `tools: ${info.toolsEnabled ? 'on' : 'off'}`;
59
+ const theme = info.themeName ? `theme: ${info.themeName}` : '';
60
+ const line1Parts = [model, session].filter(Boolean);
61
+ const line2Parts = [tokens, tools, theme].filter(Boolean);
62
+ console.log(' ' + this.line('─'));
63
+ if (left) {
64
+ console.log(' ' + left);
65
+ }
66
+ if (line1Parts.length) {
67
+ console.log(' ' + this.T.dim(line1Parts.join(' | ')));
68
+ }
69
+ if (line2Parts.length) {
70
+ console.log(' ' + this.T.dim(line2Parts.join(' | ')));
71
+ }
72
+ console.log('');
50
73
  }
74
+ line(ch = '─') { return this.T.border(ch.repeat(W)); }
75
+ thinLine() { return this.T.muted('·'.repeat(W)); }
51
76
  // ─── Header (XibeCode hero) ───────────────────────────
52
77
  header(_version = VERSION) {
53
78
  const v = VERSION;
@@ -81,36 +106,36 @@ export class EnhancedUI {
81
106
  printGradient(logoLines);
82
107
  console.log('');
83
108
  console.log(' ' + chalk.hex('#00D4FF').bold('XibeCode'));
84
- console.log(' ' + T.dim('AI-powered autonomous coding assistant') + T.muted(` · v${v}`));
109
+ console.log(' ' + this.T.dim('AI-powered autonomous coding assistant') + this.T.muted(` · v${v}`));
85
110
  console.log('');
86
111
  }
87
112
  // ─── Model / endpoint info ────────────────────────────
88
113
  modelInfo(model, endpoint) {
89
114
  const host = endpoint ? endpoint.replace(/^https?:\/\//, '') : 'api.anthropic.com';
90
- console.log(' ' + T.dim(' model') + ' ' + T.text(model));
91
- console.log(' ' + T.dim(' endpoint') + ' ' + T.text(host));
92
- console.log(' ' + T.dim(' version') + ' ' + T.muted(`v${VERSION}`));
115
+ console.log(' ' + this.T.dim(' model') + ' ' + this.T.text(model));
116
+ console.log(' ' + this.T.dim(' endpoint') + ' ' + this.T.text(host));
117
+ console.log(' ' + this.T.dim(' version') + ' ' + this.T.muted(`v${VERSION}`));
93
118
  console.log('');
94
119
  }
95
120
  // ─── Chat banner (tips + input bar + status) ─────────
96
121
  chatBanner(cwd, model, endpoint) {
97
- console.log(' ' + T.bold('Tips for getting started:'));
98
- console.log(' ' + T.text('1. Ask questions, edit files, or run commands.'));
99
- console.log(' ' + T.text('2. Be specific for the best results.'));
100
- console.log(' ' + T.text('3. Use ') + T.code('@path/to/file') + T.text(' to send files.'));
101
- console.log(' ' + T.text('4. Type ') + T.code('/help') + T.text(' for more information.'));
122
+ console.log(' ' + this.T.bold('Tips for getting started:'));
123
+ console.log(' ' + this.T.text('1. Ask questions, edit files, or run commands.'));
124
+ console.log(' ' + this.T.text('2. Be specific for the best results.'));
125
+ console.log(' ' + this.T.text('3. Use ') + this.T.code('@path/to/file') + this.T.text(' to send files.'));
126
+ console.log(' ' + this.T.text('4. Type ') + this.T.code('/help') + this.T.text(' for more information.'));
102
127
  console.log('');
103
128
  const label = '> Type your message or @path/to/file';
104
129
  const boxWidth = Math.max(label.length + 2, 56);
105
130
  const innerPad = boxWidth - label.length - 1;
106
- console.log(' ' + T.border('┌' + '─'.repeat(boxWidth) + '┐'));
107
- console.log(' ' + T.border('│') + ' ' + T.text(label) + ' '.repeat(innerPad) + T.border('│'));
108
- console.log(' ' + T.border('└' + '─'.repeat(boxWidth) + '┘'));
131
+ console.log(' ' + this.T.border('┌' + '─'.repeat(boxWidth) + '┐'));
132
+ console.log(' ' + this.T.border('│') + ' ' + this.T.text(label) + ' '.repeat(innerPad) + this.T.border('│'));
133
+ console.log(' ' + this.T.border('└' + '─'.repeat(boxWidth) + '┘'));
109
134
  console.log('');
110
135
  const host = endpoint ? endpoint.replace(/^https?:\/\//, '') : 'no sandbox (see /docs)';
111
- const left = T.muted(cwd || '~');
112
- const mid = T.muted('no sandbox (see /docs)');
113
- const right = T.muted(model);
136
+ const left = this.T.muted(cwd || '~');
137
+ const mid = this.T.muted('no sandbox (see /docs)');
138
+ const right = this.T.muted(model);
114
139
  console.log(' ' + left);
115
140
  console.log(' ' + mid + ' ' + right);
116
141
  console.log('');
@@ -118,20 +143,20 @@ export class EnhancedUI {
118
143
  // ─── Session info (run mode) ──────────────────────────
119
144
  startSession(task, config) {
120
145
  this.startTime = Date.now();
121
- console.log(' ' + T.dimBold('TASK'));
146
+ console.log(' ' + this.T.dimBold('TASK'));
122
147
  const taskLines = this.wrapText(task, W - 6);
123
- taskLines.forEach(l => console.log(' ' + T.text(' ' + l)));
148
+ taskLines.forEach(l => console.log(' ' + this.T.text(' ' + l)));
124
149
  console.log('');
125
- console.log(' ' + T.dim(' model') + ' ' + T.text(config.model));
126
- console.log(' ' + T.dim(' iterations') + ' ' + T.text(isFinite(config.maxIterations) ? String(config.maxIterations) : 'unlimited'));
150
+ console.log(' ' + this.T.dim(' model') + ' ' + this.T.text(config.model));
151
+ console.log(' ' + this.T.dim(' iterations') + ' ' + this.T.text(isFinite(config.maxIterations) ? String(config.maxIterations) : 'unlimited'));
127
152
  if (config.dryRun) {
128
- console.log(' ' + T.dim(' mode') + ' ' + T.info('DRY RUN (no changes will be made)'));
153
+ console.log(' ' + this.T.dim(' mode') + ' ' + this.T.info('DRY RUN (no changes will be made)'));
129
154
  }
130
155
  if (config.gitStatus && config.gitStatus.isGitRepo) {
131
156
  this.gitStatus(config.gitStatus);
132
157
  }
133
158
  console.log('');
134
- console.log(' ' + line());
159
+ console.log(' ' + this.line());
135
160
  console.log('');
136
161
  }
137
162
  // ─── Iteration ────────────────────────────────────────
@@ -142,30 +167,34 @@ export class EnhancedUI {
142
167
  ? `step ${current}/${total}`
143
168
  : `step ${current}`;
144
169
  console.log('');
145
- console.log(' ' + T.muted(`── ${label} · ${elapsed} ──`));
170
+ console.log(' ' + this.T.muted(`── ${label} · ${elapsed} ──`));
146
171
  }
147
172
  }
148
173
  // ─── Thinking spinner ────────────────────────────────
149
174
  thinking(message) {
175
+ if (!this.showThinking)
176
+ return;
150
177
  if (this.spinner)
151
178
  this.spinner.stop();
152
179
  this.spinner = ora({
153
- text: T.brandDim(message || 'Thinking...'),
180
+ text: this.T.brandDim(message || 'Thinking...'),
154
181
  color: 'cyan',
155
182
  spinner: 'dots12',
156
183
  prefixText: ' ',
157
184
  }).start();
158
185
  }
159
186
  updateThinking(message) {
187
+ if (!this.showThinking)
188
+ return;
160
189
  if (this.spinner)
161
- this.spinner.text = T.brandDim(message);
190
+ this.spinner.text = this.T.brandDim(message);
162
191
  }
163
192
  // ─── Streaming ────────────────────────────────────────
164
193
  startAssistantResponse() {
165
194
  this.stopSpinner();
166
195
  this.isStreaming = true;
167
196
  this.streamLineLen = 0;
168
- console.log(' ' + T.assistant('◆ XibeCode'));
197
+ console.log(' ' + this.T.assistant('◆ XibeCode'));
169
198
  }
170
199
  streamText(text) {
171
200
  if (this.streamLineLen === 0) {
@@ -177,7 +206,7 @@ export class EnhancedUI {
177
206
  process.stdout.write('\n ');
178
207
  this.streamLineLen = 0;
179
208
  }
180
- process.stdout.write(T.text(lines[i]));
209
+ process.stdout.write(this.T.text(lines[i]));
181
210
  this.streamLineLen += lines[i].length;
182
211
  }
183
212
  }
@@ -191,10 +220,10 @@ export class EnhancedUI {
191
220
  // ─── Non-streaming response ───────────────────────────
192
221
  response(text) {
193
222
  this.stopSpinner();
194
- console.log(' ' + T.assistant('◆ XibeCode'));
223
+ console.log(' ' + this.T.assistant('◆ XibeCode'));
195
224
  const lines = text.split('\n');
196
225
  lines.forEach(line => {
197
- console.log(' ' + T.text(line));
226
+ console.log(' ' + this.T.text(line));
198
227
  });
199
228
  }
200
229
  // ─── Tool call ────────────────────────────────────────
@@ -203,109 +232,109 @@ export class EnhancedUI {
203
232
  this.toolCount++;
204
233
  const icon = this.getToolIcon(toolName);
205
234
  const summary = this.summarizeInput(toolName, input);
206
- const label = T.tool(toolName);
207
- const detail = summary ? ' ' + T.code(summary) : '';
208
- console.log(' ' + T.border('╭─') + ' ' + icon + ' ' + label + detail);
209
- if (this.verbose && input) {
235
+ const label = this.T.tool(toolName);
236
+ const detail = summary ? ' ' + this.T.code(summary) : '';
237
+ console.log(' ' + this.T.border('╭─') + ' ' + icon + ' ' + label + detail);
238
+ if (this.showDetails && input) {
210
239
  const inputStr = JSON.stringify(input, null, 2);
211
240
  const lines = inputStr.split('\n').slice(0, 20);
212
241
  lines.forEach(line => {
213
- console.log(' ' + T.border('│') + ' ' + T.dim(line));
242
+ console.log(' ' + this.T.border('│') + ' ' + this.T.dim(line));
214
243
  });
215
244
  }
216
245
  }
217
246
  // ─── Tool result ──────────────────────────────────────
218
247
  toolResult(toolName, result, success = true) {
219
- const icon = success ? T.success('✔') : T.error('✘');
248
+ const icon = success ? this.T.success('✔') : this.T.error('✘');
220
249
  const summary = this.summarizeResult(toolName, result);
221
- const summaryStr = summary ? ' ' + T.dim(summary) : '';
250
+ const summaryStr = summary ? ' ' + this.T.dim(summary) : '';
222
251
  const elapsed = this.getElapsed();
223
- console.log(' ' + T.border('╰─') + ' ' + icon + summaryStr + T.muted(' ' + elapsed));
252
+ console.log(' ' + this.T.border('╰─') + ' ' + icon + summaryStr + this.T.muted(' ' + elapsed));
224
253
  if (!success && result) {
225
254
  const msg = typeof result === 'string' ? result : (result.message || JSON.stringify(result));
226
255
  const lines = msg.split('\n').slice(0, 5);
227
256
  lines.forEach((line) => {
228
- console.log(' ' + T.error(line));
257
+ console.log(' ' + this.T.error(line));
229
258
  });
230
259
  }
231
- if (this.verbose && success && result) {
260
+ if (this.showDetails && success && result) {
232
261
  const resultStr = typeof result === 'string' ? result : JSON.stringify(result, null, 2);
233
262
  const lines = resultStr.split('\n');
234
263
  const maxLines = 30;
235
264
  const display = lines.slice(0, maxLines);
236
265
  display.forEach(line => {
237
- console.log(' ' + T.dim(line));
266
+ console.log(' ' + this.T.dim(line));
238
267
  });
239
268
  if (lines.length > maxLines) {
240
- console.log(' ' + T.dim(`... ${lines.length - maxLines} more lines`));
269
+ console.log(' ' + this.T.dim(`... ${lines.length - maxLines} more lines`));
241
270
  }
242
271
  }
243
272
  }
244
273
  // ─── Diff ─────────────────────────────────────────────
245
274
  showDiff(diff, file) {
246
- if (!this.verbose)
275
+ if (!this.showDetails)
247
276
  return;
248
- console.log(' ' + T.bold(`changes: ${file}`));
277
+ console.log(' ' + this.T.bold(`changes: ${file}`));
249
278
  const lines = diff.split('\n').slice(0, 40);
250
279
  lines.forEach(line => {
251
280
  if (line.startsWith('+') && !line.startsWith('+++')) {
252
- console.log(' ' + T.success(line));
281
+ console.log(' ' + this.T.success(line));
253
282
  }
254
283
  else if (line.startsWith('-') && !line.startsWith('---')) {
255
- console.log(' ' + T.error(line));
284
+ console.log(' ' + this.T.error(line));
256
285
  }
257
286
  else if (line.startsWith('@@')) {
258
- console.log(' ' + T.info(line));
287
+ console.log(' ' + this.T.info(line));
259
288
  }
260
289
  else {
261
- console.log(' ' + T.dim(line));
290
+ console.log(' ' + this.T.dim(line));
262
291
  }
263
292
  });
264
293
  }
265
294
  // ─── File change ──────────────────────────────────────
266
295
  fileChanged(action, filePath, details) {
267
- const icons = { created: T.success('+ new'), modified: T.warn('~ mod'), deleted: T.error('- del') };
268
- const colors = { created: T.success, modified: T.warn, deleted: T.error };
269
- console.log(' ' + icons[action] + ' ' + colors[action](filePath) + (details ? T.dim(` (${details})`) : ''));
296
+ const icons = { created: this.T.success('+ new'), modified: this.T.warn('~ mod'), deleted: this.T.error('- del') };
297
+ const colors = { created: this.T.success, modified: this.T.warn, deleted: this.T.error };
298
+ console.log(' ' + icons[action] + ' ' + colors[action](filePath) + (details ? this.T.dim(` (${details})`) : ''));
270
299
  }
271
300
  // ─── Status messages ─────────────────────────────────
272
301
  error(message, error) {
273
302
  this.stopSpinner();
274
- console.log(' ' + T.error(' ✘ ') + T.error.bold('Error: ') + T.text(message));
275
- if (error && this.verbose) {
276
- console.log(' ' + T.dim(error.stack || error.message || error));
303
+ console.log(' ' + this.T.error(' ✘ ') + chalk.redBright.bold('Error: ') + this.T.text(message));
304
+ if (error && this.showDetails) {
305
+ console.log(' ' + this.T.dim(error.stack || error.message || error));
277
306
  }
278
307
  }
279
308
  warning(message) {
280
- console.log(' ' + T.warn(' ⚠ ') + T.text(message));
309
+ console.log(' ' + this.T.warn(' ⚠ ') + this.T.text(message));
281
310
  }
282
311
  info(message) {
283
- console.log(' ' + T.info(' ℹ ') + T.text(message));
312
+ console.log(' ' + this.T.info(' ℹ ') + this.T.text(message));
284
313
  }
285
314
  success(message) {
286
- console.log(' ' + T.success(' ✔ ') + T.text(message));
315
+ console.log(' ' + this.T.success(' ✔ ') + this.T.text(message));
287
316
  }
288
317
  // ─── Safety & Risk ────────────────────────────────────
289
318
  safetyWarning(level, message, warnings = []) {
290
319
  const icons = {
291
- low: T.info(' ℹ '),
292
- medium: T.warn(' ⚠ '),
293
- high: T.error(' ⚠ '),
320
+ low: this.T.info(' ℹ '),
321
+ medium: this.T.warn(' ⚠ '),
322
+ high: this.T.error(' ⚠ '),
294
323
  };
295
324
  const labels = {
296
- low: T.info('Low Risk'),
297
- medium: T.warn('Medium Risk'),
298
- high: T.error('HIGH RISK'),
325
+ low: this.T.info('Low Risk'),
326
+ medium: this.T.warn('Medium Risk'),
327
+ high: this.T.error('HIGH RISK'),
299
328
  };
300
- console.log(' ' + icons[level] + labels[level] + ': ' + T.text(message));
329
+ console.log(' ' + icons[level] + labels[level] + ': ' + this.T.text(message));
301
330
  if (warnings.length > 0) {
302
331
  warnings.forEach(w => {
303
- console.log(' ' + T.dim('• ' + w));
332
+ console.log(' ' + this.T.dim('• ' + w));
304
333
  });
305
334
  }
306
335
  }
307
336
  dryRunIndicator(message) {
308
- console.log(' ' + T.info('[DRY RUN]') + ' ' + T.dim(message));
337
+ console.log(' ' + this.T.info('[DRY RUN]') + ' ' + this.T.dim(message));
309
338
  }
310
339
  // ─── Improved Diff Summary ────────────────────────────
311
340
  diffSummary(files) {
@@ -313,15 +342,15 @@ export class EnhancedUI {
313
342
  return;
314
343
  const totalInsertions = files.reduce((sum, f) => sum + f.insertions, 0);
315
344
  const totalDeletions = files.reduce((sum, f) => sum + f.deletions, 0);
316
- console.log(' ' + T.bold(`Changes: ${files.length} file(s)`));
317
- console.log(' ' + T.success(`+${totalInsertions}`) + ' ' + T.error(`-${totalDeletions}`));
318
- if (this.verbose) {
345
+ console.log(' ' + this.T.bold(`Changes: ${files.length} file(s)`));
346
+ console.log(' ' + this.T.success(`+${totalInsertions}`) + ' ' + this.T.error(`-${totalDeletions}`));
347
+ if (this.showDetails) {
319
348
  files.slice(0, 10).forEach(f => {
320
- const stats = T.success(`+${f.insertions}`) + ' ' + T.error(`-${f.deletions}`);
321
- console.log(' ' + stats + ' ' + T.text(f.path));
349
+ const stats = this.T.success(`+${f.insertions}`) + ' ' + this.T.error(`-${f.deletions}`);
350
+ console.log(' ' + stats + ' ' + this.T.text(f.path));
322
351
  });
323
352
  if (files.length > 10) {
324
- console.log(' ' + T.dim(`... and ${files.length - 10} more files`));
353
+ console.log(' ' + this.T.dim(`... and ${files.length - 10} more files`));
325
354
  }
326
355
  }
327
356
  }
@@ -329,70 +358,70 @@ export class EnhancedUI {
329
358
  gitStatus(status) {
330
359
  const parts = [];
331
360
  if (status.branch) {
332
- parts.push(T.info(`branch: ${status.branch}`));
361
+ parts.push(this.T.info(`branch: ${status.branch}`));
333
362
  }
334
363
  if (status.isClean) {
335
- parts.push(T.success('clean'));
364
+ parts.push(this.T.success('clean'));
336
365
  }
337
366
  else {
338
367
  const counts = [];
339
368
  if (status.staged && status.staged.length > 0) {
340
- counts.push(T.success(`${status.staged.length} staged`));
369
+ counts.push(this.T.success(`${status.staged.length} staged`));
341
370
  }
342
371
  if (status.unstaged && status.unstaged.length > 0) {
343
- counts.push(T.warn(`${status.unstaged.length} unstaged`));
372
+ counts.push(this.T.warn(`${status.unstaged.length} unstaged`));
344
373
  }
345
374
  if (status.untracked && status.untracked.length > 0) {
346
- counts.push(T.dim(`${status.untracked.length} untracked`));
375
+ counts.push(this.T.dim(`${status.untracked.length} untracked`));
347
376
  }
348
377
  if (counts.length > 0) {
349
378
  parts.push(counts.join(', '));
350
379
  }
351
380
  }
352
381
  if (parts.length > 0) {
353
- console.log(' ' + T.dim('git: ') + parts.join(' | '));
382
+ console.log(' ' + this.T.dim('git: ') + parts.join(' | '));
354
383
  }
355
384
  }
356
385
  // ─── Test Results ─────────────────────────────────────
357
386
  testResults(results) {
358
- const icon = results.success ? T.success('✔') : T.error('✘');
359
- const status = results.success ? T.success('PASS') : T.error('FAIL');
387
+ const icon = results.success ? this.T.success('✔') : this.T.error('✘');
388
+ const status = results.success ? this.T.success('PASS') : this.T.error('FAIL');
360
389
  console.log(' ' + icon + ' ' + status);
361
390
  if (results.runner) {
362
- console.log(' ' + T.dim(`runner: ${results.runner}`));
391
+ console.log(' ' + this.T.dim(`runner: ${results.runner}`));
363
392
  }
364
393
  if (results.testsRun !== undefined) {
365
394
  const passed = results.testsPassed || 0;
366
395
  const failed = results.testsFailed || 0;
367
- console.log(' ' + T.success(`${passed} passed`) + ' ' + (failed > 0 ? T.error(`${failed} failed`) : ''));
396
+ console.log(' ' + this.T.success(`${passed} passed`) + ' ' + (failed > 0 ? this.T.error(`${failed} failed`) : ''));
368
397
  }
369
398
  if (results.duration) {
370
399
  const seconds = (results.duration / 1000).toFixed(2);
371
- console.log(' ' + T.dim(`duration: ${seconds}s`));
400
+ console.log(' ' + this.T.dim(`duration: ${seconds}s`));
372
401
  }
373
402
  }
374
403
  // ─── Completion summary ───────────────────────────────
375
404
  completionSummary(stats) {
376
405
  this.stopSpinner();
377
406
  const elapsed = this.formatDuration(stats.duration);
378
- console.log(' ' + T.border('╭' + '─'.repeat(W) + '╮'));
379
- console.log(' ' + T.border('│') + pad(' ' + T.success.bold('✔ Task Complete'), W) + T.border('│'));
380
- console.log(' ' + T.border('│') + ' ' + T.border('│'));
381
- console.log(' ' + T.border('│') + pad(' ' + T.dim('iterations ') + T.text(String(stats.iterations)) +
382
- T.dim(' · tools ') + T.text(String(stats.toolCalls)) +
383
- T.dim(' · files ') + T.text(String(stats.filesChanged)) +
384
- T.dim(' · ') + T.text(elapsed), W) + T.border('│'));
385
- console.log(' ' + T.border('│') + ' ' + T.border('│'));
386
- console.log(' ' + T.border('╰' + '─'.repeat(W) + '╯'));
407
+ console.log(' ' + this.T.border('╭' + '─'.repeat(W) + '╮'));
408
+ console.log(' ' + this.T.border('│') + pad(' ' + chalk.greenBright.bold('✔ Task Complete'), W) + this.T.border('│'));
409
+ console.log(' ' + this.T.border('│') + ' ' + this.T.border('│'));
410
+ console.log(' ' + this.T.border('│') + pad(' ' + this.T.dim('iterations ') + this.T.text(String(stats.iterations)) +
411
+ this.T.dim(' · tools ') + this.T.text(String(stats.toolCalls)) +
412
+ this.T.dim(' · files ') + this.T.text(String(stats.filesChanged)) +
413
+ this.T.dim(' · ') + this.T.text(elapsed), W) + this.T.border('│'));
414
+ console.log(' ' + this.T.border('│') + ' ' + this.T.border('│'));
415
+ console.log(' ' + this.T.border('╰' + '─'.repeat(W) + '╯'));
387
416
  }
388
417
  failureSummary(errorMsg, stats) {
389
418
  this.stopSpinner();
390
- console.log(' ' + T.border('╭' + '─'.repeat(W) + '╮'));
391
- console.log(' ' + T.border('│') + pad(' ' + T.error.bold('✘ Task Failed'), W) + T.border('│'));
392
- console.log(' ' + T.border('│') + pad(' ' + T.dim(errorMsg.slice(0, W - 4)), W) + T.border('│'));
393
- console.log(' ' + T.border('│') + pad(' ' + T.dim('iterations ') + T.text(String(stats.iterations)) +
394
- T.dim(' · ') + T.text(this.formatDuration(stats.duration)), W) + T.border('│'));
395
- console.log(' ' + T.border('╰' + '─'.repeat(W) + '╯'));
419
+ console.log(' ' + this.T.border('╭' + '─'.repeat(W) + '╮'));
420
+ console.log(' ' + this.T.border('│') + pad(' ' + chalk.redBright.bold('✘ Task Failed'), W) + this.T.border('│'));
421
+ console.log(' ' + this.T.border('│') + pad(' ' + this.T.dim(errorMsg.slice(0, W - 4)), W) + this.T.border('│'));
422
+ console.log(' ' + this.T.border('│') + pad(' ' + this.T.dim('iterations ') + this.T.text(String(stats.iterations)) +
423
+ this.T.dim(' · ') + this.T.text(this.formatDuration(stats.duration)), W) + this.T.border('│'));
424
+ console.log(' ' + this.T.border('╰' + '─'.repeat(W) + '╯'));
396
425
  }
397
426
  // ─── Utilities ────────────────────────────────────────
398
427
  stopSpinner(success, text) {
@@ -407,7 +436,7 @@ export class EnhancedUI {
407
436
  this.spinner = null;
408
437
  }
409
438
  divider() {
410
- console.log(' ' + line());
439
+ console.log(' ' + this.line());
411
440
  }
412
441
  clear() {
413
442
  console.clear();