@wundr.io/cli 1.0.1 → 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.
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 +735 -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 +440 -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 +23 -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 +42 -13
  202. package/src/commands/ai.ts +59 -57
  203. package/src/commands/alignment.ts +1212 -0
  204. package/src/commands/analyze-optimized.ts +70 -62
  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 +474 -4
  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
@@ -1,7 +1,10 @@
1
- import fs from 'fs-extra';
2
1
  import path from 'path';
2
+
3
+ import fs from 'fs-extra';
4
+
3
5
  import { logger } from '../utils/logger';
4
- import { ConversationContext } from '../ai/ai-service';
6
+
7
+ import type { ConversationContext } from '../ai/ai-service';
5
8
 
6
9
  /**
7
10
  * Project context information
@@ -136,7 +139,7 @@ export class ContextManager {
136
139
  success: boolean,
137
140
  duration: number,
138
141
  output?: string,
139
- error?: string
142
+ error?: string,
140
143
  ): Promise<void> {
141
144
  if (!this.currentSession) {
142
145
  throw new Error('No active session');
@@ -180,7 +183,7 @@ export class ContextManager {
180
183
  * Update user preferences
181
184
  */
182
185
  async updatePreferences(
183
- preferences: Partial<UserPreferences>
186
+ preferences: Partial<UserPreferences>,
184
187
  ): Promise<void> {
185
188
  if (!this.currentSession) {
186
189
  throw new Error('No active session');
@@ -225,7 +228,7 @@ export class ContextManager {
225
228
  * Detect project context
226
229
  */
227
230
  async detectProjectContext(
228
- projectPath?: string
231
+ projectPath?: string,
229
232
  ): Promise<ProjectContext | undefined> {
230
233
  const targetPath = projectPath || process.cwd();
231
234
 
@@ -245,10 +248,10 @@ export class ContextManager {
245
248
  if (await fs.pathExists(packageJsonPath)) {
246
249
  context.packageJson = await fs.readJson(packageJsonPath);
247
250
  context.dependencies = Object.keys(
248
- context.packageJson.dependencies || {}
251
+ context.packageJson.dependencies || {},
249
252
  );
250
253
  context.devDependencies = Object.keys(
251
- context.packageJson.devDependencies || {}
254
+ context.packageJson.devDependencies || {},
252
255
  );
253
256
  context.scripts = context.packageJson.scripts || {};
254
257
  context.type = this.detectProjectType(context.packageJson);
@@ -281,7 +284,7 @@ export class ContextManager {
281
284
  quality: number,
282
285
  duplicates: number,
283
286
  dependencies: number,
284
- recommendations: string[]
287
+ recommendations: string[],
285
288
  ): Promise<void> {
286
289
  if (!this.currentSession?.projectContext) {
287
290
  return;
@@ -353,7 +356,7 @@ export class ContextManager {
353
356
  if (file.endsWith('.json')) {
354
357
  try {
355
358
  const sessionData = await fs.readJson(
356
- path.join(this.sessionsDir, file)
359
+ path.join(this.sessionsDir, file),
357
360
  );
358
361
  sessions.push({
359
362
  id: sessionData.sessionId,
@@ -368,7 +371,7 @@ export class ContextManager {
368
371
  }
369
372
 
370
373
  return sessions.sort(
371
- (a, b) => b.lastActivity.getTime() - a.lastActivity.getTime()
374
+ (a, b) => b.lastActivity.getTime() - a.lastActivity.getTime(),
372
375
  );
373
376
  } catch (error) {
374
377
  logger.debug('Failed to list sessions:', error);
@@ -396,7 +399,7 @@ export class ContextManager {
396
399
 
397
400
  if (data.projectContext?.lastAnalysis) {
398
401
  data.projectContext.lastAnalysis.timestamp = new Date(
399
- data.projectContext.lastAnalysis.timestamp
402
+ data.projectContext.lastAnalysis.timestamp,
400
403
  );
401
404
  }
402
405
 
@@ -416,7 +419,7 @@ export class ContextManager {
416
419
  try {
417
420
  const sessionPath = path.join(
418
421
  this.sessionsDir,
419
- `${session.sessionId}.json`
422
+ `${session.sessionId}.json`,
420
423
  );
421
424
  await fs.writeJson(sessionPath, session, { spaces: 2 });
422
425
  } catch (error) {
@@ -1,9 +1,12 @@
1
1
  import { EventEmitter } from 'events';
2
- import fs from 'fs-extra';
3
2
  import path from 'path';
3
+
4
+ import fs from 'fs-extra';
5
+
4
6
  import { logger } from '../utils/logger';
5
- import { ConversationManager } from '../ai/conversation-manager';
6
- import { CommandMapper } from '../nlp/command-mapper';
7
+
8
+ import type { ConversationManager } from '../ai/conversation-manager';
9
+ import type { CommandMapper } from '../nlp/command-mapper';
7
10
 
8
11
  /**
9
12
  * User preferences for personalized experience
@@ -124,7 +127,7 @@ export class SessionManager extends EventEmitter {
124
127
  constructor(
125
128
  conversationManager: ConversationManager,
126
129
  commandMapper: CommandMapper,
127
- config: Partial<SessionManagerConfig> = {}
130
+ config: Partial<SessionManagerConfig> = {},
128
131
  ) {
129
132
  super();
130
133
 
@@ -152,7 +155,7 @@ export class SessionManager extends EventEmitter {
152
155
  async createSession(
153
156
  userId: string,
154
157
  workspacePath?: string,
155
- sessionId?: string
158
+ sessionId?: string,
156
159
  ): Promise<string> {
157
160
  const id =
158
161
  sessionId ||
@@ -219,7 +222,7 @@ export class SessionManager extends EventEmitter {
219
222
  // Refresh project context
220
223
  if (session.projectContext) {
221
224
  session.projectContext = await this.detectProjectContext(
222
- session.currentWorkspace
225
+ session.currentWorkspace,
223
226
  );
224
227
  }
225
228
 
@@ -235,7 +238,9 @@ export class SessionManager extends EventEmitter {
235
238
  * Get current session
236
239
  */
237
240
  getCurrentSession(): SessionState | null {
238
- if (!this.currentSessionId) return null;
241
+ if (!this.currentSessionId) {
242
+ return null;
243
+ }
239
244
  return this.activeSessions.get(this.currentSessionId) || null;
240
245
  }
241
246
 
@@ -252,7 +257,7 @@ export class SessionManager extends EventEmitter {
252
257
  async updateSessionContext(
253
258
  sessionId: string,
254
259
  contextType: 'project' | 'command' | 'conversation',
255
- contextData: any
260
+ contextData: any,
256
261
  ): Promise<void> {
257
262
  const session = this.activeSessions.get(sessionId);
258
263
  if (!session) {
@@ -294,7 +299,7 @@ export class SessionManager extends EventEmitter {
294
299
  sessionId: string,
295
300
  command: string,
296
301
  success: boolean,
297
- duration: number
302
+ duration: number,
298
303
  ): Promise<void> {
299
304
  const session = this.activeSessions.get(sessionId);
300
305
  if (!session) {
@@ -330,7 +335,7 @@ export class SessionManager extends EventEmitter {
330
335
  */
331
336
  async updateUserPreferences(
332
337
  userId: string,
333
- preferences: Partial<UserPreferences>
338
+ preferences: Partial<UserPreferences>,
334
339
  ): Promise<void> {
335
340
  const defaultPreferences = this.getDefaultPreferences();
336
341
  const currentPreferences = await this.loadUserPreferences(userId);
@@ -358,7 +363,7 @@ export class SessionManager extends EventEmitter {
358
363
  */
359
364
  async registerWorkspace(
360
365
  workspacePath: string,
361
- config: Partial<WorkspaceConfig>
366
+ config: Partial<WorkspaceConfig>,
362
367
  ): Promise<void> {
363
368
  const workspace: WorkspaceConfig = {
364
369
  name: config.name || path.basename(workspacePath),
@@ -381,7 +386,7 @@ export class SessionManager extends EventEmitter {
381
386
  */
382
387
  getWorkspaceSuggestions(limit: number = 5): WorkspaceConfig[] {
383
388
  const workspaces = Array.from(this.workspaces.values()).sort(
384
- (a, b) => b.lastAccessed.getTime() - a.lastAccessed.getTime()
389
+ (a, b) => b.lastAccessed.getTime() - a.lastAccessed.getTime(),
385
390
  );
386
391
 
387
392
  return workspaces.slice(0, limit);
@@ -397,7 +402,7 @@ export class SessionManager extends EventEmitter {
397
402
  timeRange?: { from: Date; to: Date };
398
403
  successOnly?: boolean;
399
404
  limit?: number;
400
- }
405
+ },
401
406
  ): Array<{
402
407
  command: string;
403
408
  timestamp: Date;
@@ -405,14 +410,16 @@ export class SessionManager extends EventEmitter {
405
410
  duration: number;
406
411
  }> {
407
412
  const session = this.activeSessions.get(sessionId);
408
- if (!session) return [];
413
+ if (!session) {
414
+ return [];
415
+ }
409
416
 
410
417
  let history = session.recentCommands;
411
418
 
412
419
  if (query.command) {
413
420
  const searchTerm = query.command.toLowerCase();
414
421
  history = history.filter(cmd =>
415
- cmd.command.toLowerCase().includes(searchTerm)
422
+ cmd.command.toLowerCase().includes(searchTerm),
416
423
  );
417
424
  }
418
425
 
@@ -420,7 +427,7 @@ export class SessionManager extends EventEmitter {
420
427
  history = history.filter(
421
428
  cmd =>
422
429
  cmd.timestamp >= query.timeRange!.from &&
423
- cmd.timestamp <= query.timeRange!.to
430
+ cmd.timestamp <= query.timeRange!.to,
424
431
  );
425
432
  }
426
433
 
@@ -440,7 +447,7 @@ export class SessionManager extends EventEmitter {
440
447
  */
441
448
  async getContextualSuggestions(
442
449
  sessionId: string,
443
- limit: number = 5
450
+ limit: number = 5,
444
451
  ): Promise<
445
452
  Array<{
446
453
  type: 'command' | 'workspace' | 'conversation';
@@ -450,7 +457,9 @@ export class SessionManager extends EventEmitter {
450
457
  }>
451
458
  > {
452
459
  const session = this.activeSessions.get(sessionId);
453
- if (!session) return [];
460
+ if (!session) {
461
+ return [];
462
+ }
454
463
 
455
464
  const suggestions: Array<{
456
465
  type: 'command' | 'workspace' | 'conversation';
@@ -470,7 +479,7 @@ export class SessionManager extends EventEmitter {
470
479
  if (baseCommand) {
471
480
  commandFrequency.set(
472
481
  baseCommand,
473
- (commandFrequency.get(baseCommand) || 0) + 1
482
+ (commandFrequency.get(baseCommand) || 0) + 1,
474
483
  );
475
484
  }
476
485
  }
@@ -507,7 +516,7 @@ export class SessionManager extends EventEmitter {
507
516
  */
508
517
  async exportSession(
509
518
  sessionId: string,
510
- format: 'json' | 'csv'
519
+ format: 'json' | 'csv',
511
520
  ): Promise<string> {
512
521
  const session = this.activeSessions.get(sessionId);
513
522
  if (!session) {
@@ -553,7 +562,7 @@ export class SessionManager extends EventEmitter {
553
562
  // Limit active sessions
554
563
  if (this.activeSessions.size > this.config.maxSessions) {
555
564
  const sessionsByAccess = Array.from(this.activeSessions.entries()).sort(
556
- ([, a], [, b]) => a.lastAccessed.getTime() - b.lastAccessed.getTime()
565
+ ([, a], [, b]) => a.lastAccessed.getTime() - b.lastAccessed.getTime(),
557
566
  );
558
567
 
559
568
  const excessCount = this.activeSessions.size - this.config.maxSessions;
@@ -584,11 +593,11 @@ export class SessionManager extends EventEmitter {
584
593
  const activeSessions = this.activeSessions.size;
585
594
  const totalCommands = Array.from(this.activeSessions.values()).reduce(
586
595
  (sum, session) => sum + session.recentCommands.length,
587
- 0
596
+ 0,
588
597
  );
589
598
 
590
599
  const sessionDurations = Array.from(this.activeSessions.values()).map(
591
- session => session.lastAccessed.getTime() - session.created.getTime()
600
+ session => session.lastAccessed.getTime() - session.created.getTime(),
592
601
  );
593
602
  const averageSessionDuration =
594
603
  sessionDurations.length > 0
@@ -604,7 +613,7 @@ export class SessionManager extends EventEmitter {
604
613
  if (baseCommand) {
605
614
  commandCounts.set(
606
615
  baseCommand,
607
- (commandCounts.get(baseCommand) || 0) + 1
616
+ (commandCounts.get(baseCommand) || 0) + 1,
608
617
  );
609
618
  }
610
619
  }
@@ -651,7 +660,7 @@ export class SessionManager extends EventEmitter {
651
660
  logger.error('Session backup failed:', error);
652
661
  }
653
662
  },
654
- this.config.backupInterval * 60 * 1000
663
+ this.config.backupInterval * 60 * 1000,
655
664
  );
656
665
 
657
666
  // Periodic cleanup
@@ -663,14 +672,16 @@ export class SessionManager extends EventEmitter {
663
672
  logger.error('Session cleanup failed:', error);
664
673
  }
665
674
  },
666
- 30 * 60 * 1000
675
+ 30 * 60 * 1000,
667
676
  ); // Every 30 minutes
668
677
  }
669
678
 
670
679
  private async detectProjectContext(
671
- workspacePath: string
680
+ workspacePath: string,
672
681
  ): Promise<ProjectContext | undefined> {
673
- if (!this.config.autoDetectProjects) return undefined;
682
+ if (!this.config.autoDetectProjects) {
683
+ return undefined;
684
+ }
674
685
 
675
686
  try {
676
687
  const context: ProjectContext = {
@@ -688,7 +699,7 @@ export class SessionManager extends EventEmitter {
688
699
  const packageJson = await fs.readJson(packageJsonPath);
689
700
  context.dependencies = Object.keys(packageJson.dependencies || {});
690
701
  context.devDependencies = Object.keys(
691
- packageJson.devDependencies || {}
702
+ packageJson.devDependencies || {},
692
703
  );
693
704
  context.scripts = packageJson.scripts || {};
694
705
 
@@ -743,7 +754,7 @@ export class SessionManager extends EventEmitter {
743
754
  }
744
755
 
745
756
  private async getGitInfo(
746
- workspacePath: string
757
+ workspacePath: string,
747
758
  ): Promise<ProjectContext['gitRepository']> {
748
759
  // Simplified git info extraction
749
760
  return {
@@ -774,7 +785,7 @@ export class SessionManager extends EventEmitter {
774
785
  const prefsPath = path.join(
775
786
  this.config.persistencePath,
776
787
  'users',
777
- `${userId}.json`
788
+ `${userId}.json`,
778
789
  );
779
790
 
780
791
  if (await fs.pathExists(prefsPath)) {
@@ -791,12 +802,12 @@ export class SessionManager extends EventEmitter {
791
802
 
792
803
  private async saveUserPreferences(
793
804
  userId: string,
794
- preferences: UserPreferences
805
+ preferences: UserPreferences,
795
806
  ): Promise<void> {
796
807
  const prefsPath = path.join(
797
808
  this.config.persistencePath,
798
809
  'users',
799
- `${userId}.json`
810
+ `${userId}.json`,
800
811
  );
801
812
  await fs.ensureDir(path.dirname(prefsPath));
802
813
  await fs.writeJson(prefsPath, preferences, { spaces: 2 });
@@ -805,7 +816,7 @@ export class SessionManager extends EventEmitter {
805
816
  private async persistSession(session: SessionState): Promise<void> {
806
817
  const sessionPath = path.join(
807
818
  this.config.persistencePath,
808
- `${session.id}.json`
819
+ `${session.id}.json`,
809
820
  );
810
821
  const serialized = this.serializeSession(session);
811
822
  await fs.writeJson(sessionPath, serialized, { spaces: 2 });
@@ -814,7 +825,7 @@ export class SessionManager extends EventEmitter {
814
825
  private async loadSession(sessionId: string): Promise<SessionState | null> {
815
826
  const sessionPath = path.join(
816
827
  this.config.persistencePath,
817
- `${sessionId}.json`
828
+ `${sessionId}.json`,
818
829
  );
819
830
 
820
831
  if (await fs.pathExists(sessionPath)) {
@@ -877,7 +888,7 @@ export class SessionManager extends EventEmitter {
877
888
  ? {
878
889
  ...data.projectContext.lastAnalysis,
879
890
  timestamp: new Date(
880
- data.projectContext.lastAnalysis.timestamp
891
+ data.projectContext.lastAnalysis.timestamp,
881
892
  ),
882
893
  }
883
894
  : undefined,
@@ -887,12 +898,12 @@ export class SessionManager extends EventEmitter {
887
898
  }
888
899
 
889
900
  private async loadWorkspace(
890
- workspacePath: string
901
+ workspacePath: string,
891
902
  ): Promise<WorkspaceConfig | null> {
892
903
  const workspacesDir = path.join(this.config.persistencePath, 'workspaces');
893
904
  const workspaceFile = path.join(
894
905
  workspacesDir,
895
- `${Buffer.from(workspacePath).toString('base64')}.json`
906
+ `${Buffer.from(workspacePath).toString('base64')}.json`,
896
907
  );
897
908
 
898
909
  if (await fs.pathExists(workspaceFile)) {
@@ -912,7 +923,7 @@ export class SessionManager extends EventEmitter {
912
923
  const workspacesDir = path.join(this.config.persistencePath, 'workspaces');
913
924
  const workspaceFile = path.join(
914
925
  workspacesDir,
915
- `${Buffer.from(workspace.path).toString('base64')}.json`
926
+ `${Buffer.from(workspace.path).toString('base64')}.json`,
916
927
  );
917
928
 
918
929
  await fs.ensureDir(workspacesDir);
@@ -922,7 +933,7 @@ export class SessionManager extends EventEmitter {
922
933
  ...workspace,
923
934
  lastAccessed: workspace.lastAccessed.toISOString(),
924
935
  },
925
- { spaces: 2 }
936
+ { spaces: 2 },
926
937
  );
927
938
  }
928
939
 
package/src/index.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { Command } from 'commander';
4
3
  import chalk from 'chalk';
4
+ import { Command } from 'commander';
5
5
  import figlet from 'figlet';
6
+
6
7
  import { version } from '../package.json';
7
8
  import { WundrCLI } from './cli';
8
- import { logger } from './utils/logger';
9
9
  import { errorHandler } from './utils/error-handler';
10
+ import { logger } from './utils/logger';
10
11
 
11
12
  /**
12
13
  * Main CLI entry point
@@ -21,14 +22,14 @@ async function main() {
21
22
  font: 'ANSI Shadow',
22
23
  horizontalLayout: 'fitted',
23
24
  verticalLayout: 'fitted',
24
- })
25
- )
25
+ }),
26
+ ),
26
27
  );
27
28
 
28
29
  console.log(
29
30
  chalk.gray(
30
- `The Intelligent CLI-Based Coding Agents Orchestrator v${version}\n`
31
- )
31
+ `The Intelligent CLI-Based Coding Agents Orchestrator v${version}\n`,
32
+ ),
32
33
  );
33
34
 
34
35
  // Initialize CLI
@@ -1,11 +1,14 @@
1
- import inquirer from 'inquirer';
2
1
  import blessed from 'blessed';
3
2
  import chalk from 'chalk';
4
- import { ConfigManager } from '../utils/config-manager';
5
- import { PluginManager } from '../plugins/plugin-manager';
6
- import { logger } from '../utils/logger';
3
+ import inquirer from 'inquirer';
4
+
5
+ import { TUILayout, ChatSession } from '../types';
7
6
  import { errorHandler } from '../utils/error-handler';
8
- import { InteractiveSession, TUILayout, ChatSession } from '../types';
7
+ import { logger } from '../utils/logger';
8
+
9
+ import type { PluginManager } from '../plugins/plugin-manager';
10
+ import type { InteractiveSession} from '../types';
11
+ import type { ConfigManager } from '../utils/config-manager';
9
12
 
10
13
  /**
11
14
  * Interactive mode manager for wizard, TUI, and chat interfaces
@@ -15,7 +18,7 @@ export class InteractiveMode {
15
18
 
16
19
  constructor(
17
20
  private configManager: ConfigManager,
18
- private pluginManager: PluginManager
21
+ private pluginManager: PluginManager,
19
22
  ) {}
20
23
 
21
24
  /**
@@ -55,7 +58,7 @@ export class InteractiveMode {
55
58
  'WUNDR_WIZARD_FAILED',
56
59
  'Failed to launch wizard',
57
60
  { mode },
58
- true
61
+ true,
59
62
  );
60
63
  }
61
64
  }
@@ -71,8 +74,12 @@ export class InteractiveMode {
71
74
  const { spawn } = await import('child_process');
72
75
  const chatArgs = ['chat', 'start'];
73
76
 
74
- if (options.model) chatArgs.push('--model', options.model);
75
- if (options.context) chatArgs.push('--context', options.context);
77
+ if (options.model) {
78
+ chatArgs.push('--model', options.model);
79
+ }
80
+ if (options.context) {
81
+ chatArgs.push('--context', options.context);
82
+ }
76
83
 
77
84
  const child = spawn('wundr', chatArgs, {
78
85
  stdio: 'inherit',
@@ -89,7 +96,7 @@ export class InteractiveMode {
89
96
  'WUNDR_CHAT_LAUNCH_FAILED',
90
97
  'Failed to launch chat interface',
91
98
  { options },
92
- true
99
+ true,
93
100
  );
94
101
  }
95
102
  }
@@ -119,7 +126,7 @@ export class InteractiveMode {
119
126
  'WUNDR_TUI_LAUNCH_FAILED',
120
127
  'Failed to launch TUI',
121
128
  { layout },
122
- true
129
+ true,
123
130
  );
124
131
  }
125
132
  }
@@ -205,15 +212,15 @@ export class InteractiveMode {
205
212
  }
206
213
 
207
214
  console.log(
208
- chalk.green('\nšŸŽ‰ Setup complete! Your Wundr project is ready.')
215
+ chalk.green('\nšŸŽ‰ Setup complete! Your Wundr project is ready.'),
209
216
  );
210
217
  console.log(chalk.gray('\nNext steps:'));
211
218
  console.log(chalk.gray(' • Run "wundr analyze" to analyze your code'));
212
219
  console.log(
213
- chalk.gray(' • Run "wundr dashboard start" to launch the dashboard')
220
+ chalk.gray(' • Run "wundr dashboard start" to launch the dashboard'),
214
221
  );
215
222
  console.log(
216
- chalk.gray(' • Run "wundr --help" to see all available commands')
223
+ chalk.gray(' • Run "wundr --help" to see all available commands'),
217
224
  );
218
225
  }
219
226
 
@@ -319,7 +326,7 @@ export class InteractiveMode {
319
326
  }
320
327
 
321
328
  console.log(
322
- chalk.green(`\nšŸ—ļø Creating ${answers.createType}: ${answers.name}\n`)
329
+ chalk.green(`\nšŸ—ļø Creating ${answers.createType}: ${answers.name}\n`),
323
330
  );
324
331
 
325
332
  let command = `wundr create ${answers.createType} ${answers.name}`;
@@ -337,7 +344,7 @@ export class InteractiveMode {
337
344
  await this.simulateCommand(command);
338
345
 
339
346
  console.log(
340
- chalk.green(`\nšŸŽ‰ ${answers.createType} created successfully!`)
347
+ chalk.green(`\nšŸŽ‰ ${answers.createType} created successfully!`),
341
348
  );
342
349
  }
343
350
 
@@ -407,8 +414,8 @@ export class InteractiveMode {
407
414
  console.log(chalk.green('\nāœ… Governance setup complete!'));
408
415
  console.log(
409
416
  chalk.gray(
410
- '\nRun "wundr govern check" to validate your code against the rules.'
411
- )
417
+ '\nRun "wundr govern check" to validate your code against the rules.',
418
+ ),
412
419
  );
413
420
  }
414
421
 
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Conflict Resolution - Stub implementation
3
+ * TODO: Implement full conflict resolution system
4
+ */
5
+
6
+ export interface ConflictResolver {
7
+ resolve(conflict: UpdateConflict): Promise<ConflictResolutionResult>;
8
+ }
9
+
10
+ export interface UpdateConflict {
11
+ type: string;
12
+ description: string;
13
+ localValue: unknown;
14
+ remoteValue: unknown;
15
+ }
16
+
17
+ export interface ConflictResolutionResult {
18
+ resolved: boolean;
19
+ value: unknown;
20
+ }
21
+
22
+ export function createConflictResolver(): ConflictResolver {
23
+ return {
24
+ async resolve(_conflict: UpdateConflict): Promise<ConflictResolutionResult> {
25
+ throw new Error('Conflict resolution not yet implemented');
26
+ },
27
+ };
28
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Merge Strategy - Stub implementation
3
+ * TODO: Implement full merge strategy system
4
+ */
5
+
6
+ export interface MergeResult {
7
+ success: boolean;
8
+ content: string;
9
+ conflicts: Array<{ line: number; description: string }>;
10
+ }
11
+
12
+ export class MergeStrategyManager {
13
+ merge(_local: string, _remote: string, _base: string): MergeResult {
14
+ throw new Error('Merge strategy not yet implemented');
15
+ }
16
+ }
17
+
18
+ export function threeWayMerge(
19
+ _local: string,
20
+ _remote: string,
21
+ _base: string
22
+ ): MergeResult {
23
+ throw new Error('Three-way merge not yet implemented');
24
+ }
25
+
26
+ export function detectFileType(_filePath: string): string {
27
+ return 'unknown';
28
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Safety Mechanisms - Stub implementation
3
+ * TODO: Implement full safety system
4
+ */
5
+
6
+ export interface SafetyManager {
7
+ createBackup(description?: string): Promise<UpdateBackup>;
8
+ beginTransaction(): UpdateTransaction;
9
+ listBackups(): Promise<UpdateBackup[]>;
10
+ getLatestBackup(): Promise<UpdateBackup | null>;
11
+ restoreFromBackup(backupId: string): Promise<void>;
12
+ deleteBackup(backupId: string): Promise<void>;
13
+ }
14
+
15
+ export interface UpdateBackup {
16
+ id: string;
17
+ timestamp: Date;
18
+ restore(): Promise<void>;
19
+ }
20
+
21
+ export interface UpdateTransaction {
22
+ commit(): Promise<void>;
23
+ rollback(): Promise<void>;
24
+ }
25
+
26
+ export function createSafetyManager(): SafetyManager {
27
+ return {
28
+ async createBackup(_description?: string): Promise<UpdateBackup> {
29
+ throw new Error('Safety mechanisms not yet implemented');
30
+ },
31
+ beginTransaction(): UpdateTransaction {
32
+ throw new Error('Safety mechanisms not yet implemented');
33
+ },
34
+ async listBackups(): Promise<UpdateBackup[]> {
35
+ throw new Error('Safety mechanisms not yet implemented');
36
+ },
37
+ async getLatestBackup(): Promise<UpdateBackup | null> {
38
+ throw new Error('Safety mechanisms not yet implemented');
39
+ },
40
+ async restoreFromBackup(_backupId: string): Promise<void> {
41
+ throw new Error('Safety mechanisms not yet implemented');
42
+ },
43
+ async deleteBackup(_backupId: string): Promise<void> {
44
+ throw new Error('Safety mechanisms not yet implemented');
45
+ },
46
+ };
47
+ }