@wundr.io/cli 1.0.1 → 1.0.4

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 (249) hide show
  1. package/dist/ai/ai-service.d.ts +152 -0
  2. package/dist/ai/ai-service.d.ts.map +1 -0
  3. package/dist/ai/ai-service.js +430 -0
  4. package/dist/ai/ai-service.js.map +1 -0
  5. package/dist/ai/claude-client.d.ts +130 -0
  6. package/dist/ai/claude-client.d.ts.map +1 -0
  7. package/dist/ai/claude-client.js +340 -0
  8. package/dist/ai/claude-client.js.map +1 -0
  9. package/dist/ai/conversation-manager.d.ts +164 -0
  10. package/dist/ai/conversation-manager.d.ts.map +1 -0
  11. package/dist/ai/conversation-manager.js +614 -0
  12. package/dist/ai/conversation-manager.js.map +1 -0
  13. package/dist/ai/index.d.ts +5 -0
  14. package/dist/ai/index.d.ts.map +1 -0
  15. package/dist/ai/index.js +8 -0
  16. package/dist/ai/index.js.map +1 -0
  17. package/dist/cli.d.ts +36 -0
  18. package/dist/cli.d.ts.map +1 -0
  19. package/dist/cli.js +192 -0
  20. package/dist/cli.js.map +1 -0
  21. package/dist/commands/ai.d.ts +89 -0
  22. package/dist/commands/ai.d.ts.map +1 -0
  23. package/dist/commands/ai.js +799 -0
  24. package/dist/commands/ai.js.map +1 -0
  25. package/dist/commands/alignment.d.ts +78 -0
  26. package/dist/commands/alignment.d.ts.map +1 -0
  27. package/dist/commands/alignment.js +817 -0
  28. package/dist/commands/alignment.js.map +1 -0
  29. package/dist/commands/analyze-optimized.d.ts +14 -0
  30. package/dist/commands/analyze-optimized.d.ts.map +1 -0
  31. package/dist/commands/analyze-optimized.js +600 -0
  32. package/dist/commands/analyze-optimized.js.map +1 -0
  33. package/dist/commands/analyze.d.ts +65 -0
  34. package/dist/commands/analyze.d.ts.map +1 -0
  35. package/dist/commands/analyze.js +435 -0
  36. package/dist/commands/analyze.js.map +1 -0
  37. package/dist/commands/batch.d.ts +71 -0
  38. package/dist/commands/batch.d.ts.map +1 -0
  39. package/dist/commands/batch.js +738 -0
  40. package/dist/commands/batch.js.map +1 -0
  41. package/dist/commands/chat.d.ts +71 -0
  42. package/dist/commands/chat.d.ts.map +1 -0
  43. package/dist/commands/chat.js +674 -0
  44. package/dist/commands/chat.js.map +1 -0
  45. package/dist/commands/claude-init.d.ts +28 -0
  46. package/dist/commands/claude-init.d.ts.map +1 -0
  47. package/dist/commands/claude-init.js +591 -0
  48. package/dist/commands/claude-init.js.map +1 -0
  49. package/dist/commands/claude-setup.d.ts +119 -0
  50. package/dist/commands/claude-setup.d.ts.map +1 -0
  51. package/dist/commands/claude-setup.js +1073 -0
  52. package/dist/commands/claude-setup.js.map +1 -0
  53. package/dist/commands/computer-setup-commands.d.ts +53 -0
  54. package/dist/commands/computer-setup-commands.d.ts.map +1 -0
  55. package/dist/commands/computer-setup-commands.js +705 -0
  56. package/dist/commands/computer-setup-commands.js.map +1 -0
  57. package/dist/commands/computer-setup.d.ts +7 -0
  58. package/dist/commands/computer-setup.d.ts.map +1 -0
  59. package/dist/commands/computer-setup.js +849 -0
  60. package/dist/commands/computer-setup.js.map +1 -0
  61. package/dist/commands/create-command.d.ts +7 -0
  62. package/dist/commands/create-command.d.ts.map +1 -0
  63. package/dist/commands/create-command.js +158 -0
  64. package/dist/commands/create-command.js.map +1 -0
  65. package/dist/commands/create.d.ts +74 -0
  66. package/dist/commands/create.d.ts.map +1 -0
  67. package/dist/commands/create.js +556 -0
  68. package/dist/commands/create.js.map +1 -0
  69. package/dist/commands/dashboard.d.ts +91 -0
  70. package/dist/commands/dashboard.d.ts.map +1 -0
  71. package/dist/commands/dashboard.js +538 -0
  72. package/dist/commands/dashboard.js.map +1 -0
  73. package/dist/commands/govern.d.ts +70 -0
  74. package/dist/commands/govern.d.ts.map +1 -0
  75. package/dist/commands/govern.js +481 -0
  76. package/dist/commands/govern.js.map +1 -0
  77. package/dist/commands/governance.d.ts +17 -0
  78. package/dist/commands/governance.d.ts.map +1 -0
  79. package/dist/commands/governance.js +703 -0
  80. package/dist/commands/governance.js.map +1 -0
  81. package/dist/commands/guardian.d.ts +20 -0
  82. package/dist/commands/guardian.d.ts.map +1 -0
  83. package/dist/commands/guardian.js +597 -0
  84. package/dist/commands/guardian.js.map +1 -0
  85. package/dist/commands/init.d.ts +59 -0
  86. package/dist/commands/init.d.ts.map +1 -0
  87. package/dist/commands/init.js +650 -0
  88. package/dist/commands/init.js.map +1 -0
  89. package/dist/commands/performance-optimizer.d.ts +30 -0
  90. package/dist/commands/performance-optimizer.d.ts.map +1 -0
  91. package/dist/commands/performance-optimizer.js +650 -0
  92. package/dist/commands/performance-optimizer.js.map +1 -0
  93. package/dist/commands/plugins.d.ts +87 -0
  94. package/dist/commands/plugins.d.ts.map +1 -0
  95. package/dist/commands/plugins.js +685 -0
  96. package/dist/commands/plugins.js.map +1 -0
  97. package/dist/commands/rag.d.ts +7 -0
  98. package/dist/commands/rag.d.ts.map +1 -0
  99. package/dist/commands/rag.js +748 -0
  100. package/dist/commands/rag.js.map +1 -0
  101. package/dist/commands/session.d.ts +41 -0
  102. package/dist/commands/session.d.ts.map +1 -0
  103. package/dist/commands/session.js +441 -0
  104. package/dist/commands/session.js.map +1 -0
  105. package/dist/commands/setup.d.ts +29 -0
  106. package/dist/commands/setup.d.ts.map +1 -0
  107. package/dist/commands/setup.js +397 -0
  108. package/dist/commands/setup.js.map +1 -0
  109. package/dist/commands/test-init.d.ts +9 -0
  110. package/dist/commands/test-init.d.ts.map +1 -0
  111. package/dist/commands/test-init.js +222 -0
  112. package/dist/commands/test-init.js.map +1 -0
  113. package/dist/commands/test.d.ts +25 -0
  114. package/dist/commands/test.d.ts.map +1 -0
  115. package/dist/commands/test.js +217 -0
  116. package/dist/commands/test.js.map +1 -0
  117. package/dist/commands/vp.d.ts +7 -0
  118. package/dist/commands/vp.d.ts.map +1 -0
  119. package/dist/commands/vp.js +571 -0
  120. package/dist/commands/vp.js.map +1 -0
  121. package/dist/commands/watch.d.ts +76 -0
  122. package/dist/commands/watch.d.ts.map +1 -0
  123. package/dist/commands/watch.js +613 -0
  124. package/dist/commands/watch.js.map +1 -0
  125. package/dist/commands/worktree.d.ts +63 -0
  126. package/dist/commands/worktree.d.ts.map +1 -0
  127. package/dist/commands/worktree.js +774 -0
  128. package/dist/commands/worktree.js.map +1 -0
  129. package/dist/context/context-manager.d.ts +155 -0
  130. package/dist/context/context-manager.d.ts.map +1 -0
  131. package/dist/context/context-manager.js +383 -0
  132. package/dist/context/context-manager.js.map +1 -0
  133. package/dist/context/index.d.ts +3 -0
  134. package/dist/context/index.d.ts.map +1 -0
  135. package/dist/context/index.js +6 -0
  136. package/dist/context/index.js.map +1 -0
  137. package/dist/context/session-manager.d.ts +207 -0
  138. package/dist/context/session-manager.d.ts.map +1 -0
  139. package/dist/context/session-manager.js +686 -0
  140. package/dist/context/session-manager.js.map +1 -0
  141. package/dist/index.d.ts +8 -0
  142. package/dist/index.d.ts.map +1 -0
  143. package/dist/index.js +51 -0
  144. package/dist/index.js.map +1 -0
  145. package/dist/interactive/interactive-mode.d.ts +76 -0
  146. package/dist/interactive/interactive-mode.d.ts.map +1 -0
  147. package/dist/interactive/interactive-mode.js +732 -0
  148. package/dist/interactive/interactive-mode.js.map +1 -0
  149. package/dist/nlp/command-mapper.d.ts +174 -0
  150. package/dist/nlp/command-mapper.d.ts.map +1 -0
  151. package/dist/nlp/command-mapper.js +624 -0
  152. package/dist/nlp/command-mapper.js.map +1 -0
  153. package/dist/nlp/command-parser.d.ts +106 -0
  154. package/dist/nlp/command-parser.d.ts.map +1 -0
  155. package/dist/nlp/command-parser.js +417 -0
  156. package/dist/nlp/command-parser.js.map +1 -0
  157. package/dist/nlp/index.d.ts +5 -0
  158. package/dist/nlp/index.d.ts.map +1 -0
  159. package/dist/nlp/index.js +8 -0
  160. package/dist/nlp/index.js.map +1 -0
  161. package/dist/nlp/intent-classifier.d.ts +59 -0
  162. package/dist/nlp/intent-classifier.d.ts.map +1 -0
  163. package/dist/nlp/intent-classifier.js +384 -0
  164. package/dist/nlp/intent-classifier.js.map +1 -0
  165. package/dist/nlp/intent-parser.d.ts +152 -0
  166. package/dist/nlp/intent-parser.d.ts.map +1 -0
  167. package/dist/nlp/intent-parser.js +744 -0
  168. package/dist/nlp/intent-parser.js.map +1 -0
  169. package/dist/plugins/plugin-manager.d.ts +120 -0
  170. package/dist/plugins/plugin-manager.d.ts.map +1 -0
  171. package/dist/plugins/plugin-manager.js +595 -0
  172. package/dist/plugins/plugin-manager.js.map +1 -0
  173. package/dist/types/index.d.ts +224 -0
  174. package/dist/types/index.d.ts.map +1 -0
  175. package/dist/types/index.js +3 -0
  176. package/dist/types/index.js.map +1 -0
  177. package/dist/utils/backup-rollback-manager.d.ts +72 -0
  178. package/dist/utils/backup-rollback-manager.d.ts.map +1 -0
  179. package/dist/utils/backup-rollback-manager.js +289 -0
  180. package/dist/utils/backup-rollback-manager.js.map +1 -0
  181. package/dist/utils/claude-config-installer.d.ts +94 -0
  182. package/dist/utils/claude-config-installer.d.ts.map +1 -0
  183. package/dist/utils/claude-config-installer.js +628 -0
  184. package/dist/utils/claude-config-installer.js.map +1 -0
  185. package/dist/utils/config-manager.d.ts +73 -0
  186. package/dist/utils/config-manager.d.ts.map +1 -0
  187. package/dist/utils/config-manager.js +339 -0
  188. package/dist/utils/config-manager.js.map +1 -0
  189. package/dist/utils/error-handler.d.ts +46 -0
  190. package/dist/utils/error-handler.d.ts.map +1 -0
  191. package/dist/utils/error-handler.js +169 -0
  192. package/dist/utils/error-handler.js.map +1 -0
  193. package/dist/utils/logger.d.ts +25 -0
  194. package/dist/utils/logger.d.ts.map +1 -0
  195. package/dist/utils/logger.js +105 -0
  196. package/dist/utils/logger.js.map +1 -0
  197. package/package.json +6 -4
  198. package/src/ai/ai-service.ts +22 -19
  199. package/src/ai/claude-client.ts +20 -16
  200. package/src/ai/conversation-manager.ts +37 -30
  201. package/src/cli.ts +46 -17
  202. package/src/commands/ai.ts +196 -88
  203. package/src/commands/alignment.ts +1212 -0
  204. package/src/commands/analyze-optimized.ts +394 -89
  205. package/src/commands/analyze.ts +22 -20
  206. package/src/commands/batch.ts +41 -38
  207. package/src/commands/chat.ts +37 -34
  208. package/src/commands/claude-init.ts +38 -30
  209. package/src/commands/claude-setup.ts +692 -97
  210. package/src/commands/computer-setup-commands.ts +45 -39
  211. package/src/commands/computer-setup.ts +490 -20
  212. package/src/commands/create-command.ts +7 -7
  213. package/src/commands/create.ts +36 -33
  214. package/src/commands/dashboard.ts +33 -28
  215. package/src/commands/govern.ts +34 -29
  216. package/src/commands/governance.ts +1005 -0
  217. package/src/commands/guardian.ts +887 -0
  218. package/src/commands/init.ts +112 -22
  219. package/src/commands/performance-optimizer.ts +48 -42
  220. package/src/commands/plugins.ts +35 -32
  221. package/src/commands/project-update.ts +1053 -0
  222. package/src/commands/rag.ts +904 -0
  223. package/src/commands/session.ts +631 -0
  224. package/src/commands/setup.ts +35 -31
  225. package/src/commands/test-init.ts +6 -5
  226. package/src/commands/test.ts +7 -6
  227. package/src/commands/vp.ts +762 -0
  228. package/src/commands/watch.ts +44 -33
  229. package/src/commands/worktree.ts +1057 -0
  230. package/src/context/context-manager.ts +15 -12
  231. package/src/context/session-manager.ts +51 -40
  232. package/src/index.ts +7 -6
  233. package/src/interactive/interactive-mode.ts +25 -18
  234. package/src/lib/conflict-resolution.ts +28 -0
  235. package/src/lib/merge-strategy.ts +28 -0
  236. package/src/lib/safety-mechanisms.ts +47 -0
  237. package/src/lib/state-detection.ts +28 -0
  238. package/src/nlp/command-mapper.ts +35 -30
  239. package/src/nlp/command-parser.ts +20 -17
  240. package/src/nlp/intent-classifier.ts +7 -7
  241. package/src/nlp/intent-parser.ts +61 -49
  242. package/src/plugins/plugin-manager.ts +27 -23
  243. package/src/types/index.ts +1 -1
  244. package/src/types/modules.d.ts +1 -0
  245. package/src/utils/backup-rollback-manager.ts +13 -11
  246. package/src/utils/claude-config-installer.ts +18 -16
  247. package/src/utils/config-manager.ts +12 -9
  248. package/src/utils/error-handler.ts +5 -3
  249. package/src/utils/logger.ts +35 -12
@@ -3,13 +3,15 @@
3
3
  * Handles installation of CLAUDE.md, hooks, conventions, and agent templates
4
4
  */
5
5
 
6
+ import { existsSync } from 'fs';
6
7
  import * as fs from 'fs/promises';
7
8
  import * as path from 'path';
8
- import { existsSync } from 'fs';
9
+
9
10
  import chalk from 'chalk';
10
11
  import ora from 'ora';
11
- import { logger } from './logger';
12
+
12
13
  import { BackupRollbackManager } from './backup-rollback-manager';
14
+ import { logger } from './logger';
13
15
 
14
16
  export interface ClaudeConfigOptions {
15
17
  claudeDir?: string;
@@ -74,7 +76,7 @@ export class ClaudeConfigInstaller {
74
76
  const spinner = ora('Creating backup of existing configurations...').start();
75
77
  const backup = await this.backupManager.createBackup(
76
78
  existingFiles,
77
- 'Pre-installation backup'
79
+ 'Pre-installation backup',
78
80
  );
79
81
  result.backupId = backup.backupId;
80
82
  spinner.succeed(`Backup created: ${backup.backupId}`);
@@ -109,7 +111,7 @@ export class ClaudeConfigInstaller {
109
111
  logger.error('Installation failed', error);
110
112
  result.errors.push({
111
113
  file: 'general',
112
- error: error instanceof Error ? error.message : String(error)
114
+ error: error instanceof Error ? error.message : String(error),
113
115
  });
114
116
  return result;
115
117
  }
@@ -120,7 +122,7 @@ export class ClaudeConfigInstaller {
120
122
  */
121
123
  private async installClaudeMd(
122
124
  result: InstallResult,
123
- options: { dryRun: boolean; overwrite: boolean; verbose: boolean }
125
+ options: { dryRun: boolean; overwrite: boolean; verbose: boolean },
124
126
  ): Promise<void> {
125
127
  const spinner = ora('Installing CLAUDE.md...').start();
126
128
 
@@ -157,7 +159,7 @@ export class ClaudeConfigInstaller {
157
159
  spinner.fail('Failed to install CLAUDE.md');
158
160
  result.errors.push({
159
161
  file: 'CLAUDE.md',
160
- error: error instanceof Error ? error.message : String(error)
162
+ error: error instanceof Error ? error.message : String(error),
161
163
  });
162
164
  logger.error('CLAUDE.md installation failed', error);
163
165
  }
@@ -168,7 +170,7 @@ export class ClaudeConfigInstaller {
168
170
  */
169
171
  private async installHooks(
170
172
  result: InstallResult,
171
- options: { dryRun: boolean; overwrite: boolean; verbose: boolean }
173
+ options: { dryRun: boolean; overwrite: boolean; verbose: boolean },
172
174
  ): Promise<void> {
173
175
  const spinner = ora('Installing hooks...').start();
174
176
 
@@ -202,7 +204,7 @@ export class ClaudeConfigInstaller {
202
204
  spinner.fail('Failed to install hooks');
203
205
  result.errors.push({
204
206
  file: 'hooks',
205
- error: error instanceof Error ? error.message : String(error)
207
+ error: error instanceof Error ? error.message : String(error),
206
208
  });
207
209
  logger.error('Hooks installation failed', error);
208
210
  }
@@ -213,7 +215,7 @@ export class ClaudeConfigInstaller {
213
215
  */
214
216
  private async installConventions(
215
217
  result: InstallResult,
216
- options: { dryRun: boolean; overwrite: boolean; verbose: boolean }
218
+ options: { dryRun: boolean; overwrite: boolean; verbose: boolean },
217
219
  ): Promise<void> {
218
220
  const spinner = ora('Installing conventions...').start();
219
221
 
@@ -242,7 +244,7 @@ export class ClaudeConfigInstaller {
242
244
  spinner.fail('Failed to install conventions');
243
245
  result.errors.push({
244
246
  file: 'conventions.json',
245
- error: error instanceof Error ? error.message : String(error)
247
+ error: error instanceof Error ? error.message : String(error),
246
248
  });
247
249
  logger.error('Conventions installation failed', error);
248
250
  }
@@ -253,7 +255,7 @@ export class ClaudeConfigInstaller {
253
255
  */
254
256
  private async installAgentTemplates(
255
257
  result: InstallResult,
256
- options: { dryRun: boolean; overwrite: boolean; verbose: boolean }
258
+ options: { dryRun: boolean; overwrite: boolean; verbose: boolean },
257
259
  ): Promise<void> {
258
260
  const spinner = ora('Installing agent templates...').start();
259
261
 
@@ -286,7 +288,7 @@ export class ClaudeConfigInstaller {
286
288
  spinner.fail('Failed to install agent templates');
287
289
  result.errors.push({
288
290
  file: 'agent-templates',
289
- error: error instanceof Error ? error.message : String(error)
291
+ error: error instanceof Error ? error.message : String(error),
290
292
  });
291
293
  logger.error('Agent templates installation failed', error);
292
294
  }
@@ -297,7 +299,7 @@ export class ClaudeConfigInstaller {
297
299
  */
298
300
  private async installGitWorktreeWorkflows(
299
301
  result: InstallResult,
300
- options: { dryRun: boolean; overwrite: boolean; verbose: boolean }
302
+ options: { dryRun: boolean; overwrite: boolean; verbose: boolean },
301
303
  ): Promise<void> {
302
304
  const spinner = ora('Installing git-worktree workflows...').start();
303
305
 
@@ -330,7 +332,7 @@ export class ClaudeConfigInstaller {
330
332
  spinner.fail('Failed to install git-worktree workflows');
331
333
  result.errors.push({
332
334
  file: 'git-worktree-workflows',
333
- error: error instanceof Error ? error.message : String(error)
335
+ error: error instanceof Error ? error.message : String(error),
334
336
  });
335
337
  logger.error('Git-worktree workflows installation failed', error);
336
338
  }
@@ -341,7 +343,7 @@ export class ClaudeConfigInstaller {
341
343
  */
342
344
  private async installValidationScripts(
343
345
  result: InstallResult,
344
- options: { dryRun: boolean; overwrite: boolean; verbose: boolean }
346
+ options: { dryRun: boolean; overwrite: boolean; verbose: boolean },
345
347
  ): Promise<void> {
346
348
  const spinner = ora('Installing validation scripts...').start();
347
349
 
@@ -375,7 +377,7 @@ export class ClaudeConfigInstaller {
375
377
  spinner.fail('Failed to install validation scripts');
376
378
  result.errors.push({
377
379
  file: 'validation-scripts',
378
- error: error instanceof Error ? error.message : String(error)
380
+ error: error instanceof Error ? error.message : String(error),
379
381
  });
380
382
  logger.error('Validation scripts installation failed', error);
381
383
  }
@@ -1,10 +1,13 @@
1
- import fs from 'fs-extra';
2
- import path from 'path';
3
1
  import os from 'os';
2
+ import path from 'path';
3
+
4
+ import fs from 'fs-extra';
4
5
  import { z } from 'zod';
5
- import { WundrConfig } from '../types';
6
- import { logger } from './logger';
6
+
7
7
  import { errorHandler } from './error-handler';
8
+ import { logger } from './logger';
9
+
10
+ import type { WundrConfig } from '../types';
8
11
 
9
12
  // Zod schema for configuration validation
10
13
  const WundrConfigSchema = z.object({
@@ -101,7 +104,7 @@ export class ConfigManager {
101
104
  'WUNDR_CONFIG_INVALID',
102
105
  'Failed to load or parse configuration file',
103
106
  { configPath: configFile },
104
- true
107
+ true,
105
108
  );
106
109
  }
107
110
  }
@@ -126,7 +129,7 @@ export class ConfigManager {
126
129
  'WUNDR_CONFIG_INVALID',
127
130
  'Failed to save configuration file',
128
131
  { configPath: configFile },
129
- false
132
+ false,
130
133
  );
131
134
  }
132
135
  }
@@ -166,7 +169,7 @@ export class ConfigManager {
166
169
  return {
167
170
  valid: false,
168
171
  errors: error.issues.map(
169
- issue => `${issue.path.join('.')}: ${issue.message}`
172
+ issue => `${issue.path.join('.')}: ${issue.message}`,
170
173
  ),
171
174
  };
172
175
  }
@@ -213,7 +216,7 @@ export class ConfigManager {
213
216
  throw new Error(`Invalid path: empty key at position ${i}`);
214
217
  }
215
218
  if (!current || typeof current !== 'object') {
216
- throw new Error(`Invalid path: cannot set property on non-object`);
219
+ throw new Error('Invalid path: cannot set property on non-object');
217
220
  }
218
221
  if (!current[key] || typeof current[key] !== 'object') {
219
222
  current[key] = {};
@@ -226,7 +229,7 @@ export class ConfigManager {
226
229
  throw new Error('Invalid path: empty final key');
227
230
  }
228
231
  if (!finalKey || !current || typeof current !== 'object') {
229
- throw new Error(`Invalid path: cannot set property`);
232
+ throw new Error('Invalid path: cannot set property');
230
233
  }
231
234
  current[finalKey] = value;
232
235
  }
@@ -1,7 +1,9 @@
1
1
  import chalk from 'chalk';
2
- import { WundrError } from '../types';
2
+
3
3
  import { logger } from './logger';
4
4
 
5
+ import type { WundrError } from '../types';
6
+
5
7
  /**
6
8
  * Centralized error handling system
7
9
  */
@@ -114,7 +116,7 @@ class ErrorHandler {
114
116
 
115
117
  console.error(chalk.yellow('\nšŸ’” This appears to be an unexpected error.'));
116
118
  console.error(
117
- chalk.yellow(' Please report this issue with the above details.')
119
+ chalk.yellow(' Please report this issue with the above details.'),
118
120
  );
119
121
  }
120
122
 
@@ -165,7 +167,7 @@ class ErrorHandler {
165
167
  code: string,
166
168
  message: string,
167
169
  context?: Record<string, any>,
168
- recoverable = false
170
+ recoverable = false,
169
171
  ): WundrError {
170
172
  const error = new Error(message) as WundrError;
171
173
  error.code = code;
@@ -1,5 +1,6 @@
1
1
  import chalk from 'chalk';
2
- import { Logger } from '../types';
2
+
3
+ import type { Logger } from '../types';
3
4
 
4
5
  /**
5
6
  * Enhanced logger with multiple levels and colored output
@@ -17,7 +18,9 @@ class WundrLogger implements Logger {
17
18
  }
18
19
 
19
20
  private shouldLog(level: string): boolean {
20
- if (this.silent) return false;
21
+ if (this.silent) {
22
+ return false;
23
+ }
21
24
 
22
25
  const levels = { debug: 0, info: 1, warn: 2, error: 3 };
23
26
  return levels[level as keyof typeof levels] >= levels[this.level];
@@ -36,54 +39,74 @@ class WundrLogger implements Logger {
36
39
  }
37
40
 
38
41
  debug(message: string, ...args: any[]): void {
39
- if (!this.shouldLog('debug')) return;
42
+ if (!this.shouldLog('debug')) {
43
+ return;
44
+ }
40
45
  console.log(chalk.gray(this.formatMessage('debug', message, ...args)));
41
46
  }
42
47
 
43
48
  info(message: string, ...args: any[]): void {
44
- if (!this.shouldLog('info')) return;
49
+ if (!this.shouldLog('info')) {
50
+ return;
51
+ }
45
52
  console.log(chalk.blue(this.formatMessage('info', message, ...args)));
46
53
  }
47
54
 
48
55
  warn(message: string, ...args: any[]): void {
49
- if (!this.shouldLog('warn')) return;
56
+ if (!this.shouldLog('warn')) {
57
+ return;
58
+ }
50
59
  console.warn(chalk.yellow(this.formatMessage('warn', message, ...args)));
51
60
  }
52
61
 
53
62
  error(message: string, ...args: any[]): void {
54
- if (!this.shouldLog('error')) return;
63
+ if (!this.shouldLog('error')) {
64
+ return;
65
+ }
55
66
  console.error(chalk.red(this.formatMessage('error', message, ...args)));
56
67
  }
57
68
 
58
69
  success(message: string, ...args: any[]): void {
59
- if (!this.shouldLog('info')) return;
70
+ if (!this.shouldLog('info')) {
71
+ return;
72
+ }
60
73
  console.log(chalk.green(this.formatMessage('success', message, ...args)));
61
74
  }
62
75
 
63
76
  // Utility methods for structured logging
64
77
  table(data: any[]): void {
65
- if (this.silent) return;
78
+ if (this.silent) {
79
+ return;
80
+ }
66
81
  console.table(data);
67
82
  }
68
83
 
69
84
  json(data: any): void {
70
- if (this.silent) return;
85
+ if (this.silent) {
86
+ return;
87
+ }
71
88
  console.log(JSON.stringify(data, null, 2));
72
89
  }
73
90
 
74
91
  group(label: string): void {
75
- if (this.silent) return;
92
+ if (this.silent) {
93
+ return;
94
+ }
76
95
  console.group(chalk.cyan(label));
77
96
  }
78
97
 
79
98
  groupEnd(): void {
80
- if (this.silent) return;
99
+ if (this.silent) {
100
+ return;
101
+ }
81
102
  console.groupEnd();
82
103
  }
83
104
 
84
105
  // Progress logging
85
106
  progress(current: number, total: number, message?: string): void {
86
- if (this.silent) return;
107
+ if (this.silent) {
108
+ return;
109
+ }
87
110
  const percentage = Math.round((current / total) * 100);
88
111
  const bar = 'ā–ˆ'.repeat(Math.round(percentage / 2));
89
112
  const empty = 'ā–‘'.repeat(50 - Math.round(percentage / 2));