@wundr.io/cli 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/wundr.js +8 -4
- package/package.json +23 -23
- package/src/ai/ai-service.ts +16 -17
- package/src/ai/claude-client.ts +16 -16
- package/src/ai/conversation-manager.ts +29 -29
- package/src/cli.ts +4 -4
- package/src/commands/ai.ts +246 -78
- package/src/commands/alignment.ts +74 -74
- package/src/commands/analyze-optimized.ts +111 -78
- package/src/commands/analyze.ts +14 -14
- package/src/commands/batch.ts +179 -42
- package/src/commands/chat.ts +37 -30
- package/src/commands/claude-init.ts +41 -45
- package/src/commands/claude-setup.ts +204 -119
- package/src/commands/computer-setup.ts +85 -43
- package/src/commands/create-command.ts +4 -4
- package/src/commands/create.ts +27 -27
- package/src/commands/dashboard.ts +24 -24
- package/src/commands/govern.ts +25 -25
- package/src/commands/governance.ts +34 -34
- package/src/commands/guardian.ts +56 -56
- package/src/commands/init.ts +25 -22
- package/src/commands/orchestrator.ts +68 -41
- package/src/commands/performance-optimizer.ts +34 -35
- package/src/commands/plugins.ts +27 -27
- package/src/commands/project-update.ts +175 -72
- package/src/commands/rag.ts +185 -78
- package/src/commands/session.ts +35 -35
- package/src/commands/setup.ts +40 -344
- package/src/commands/test-init.ts +3 -3
- package/src/commands/test.ts +4 -4
- package/src/commands/watch.ts +28 -29
- package/src/commands/worktree.ts +49 -49
- package/src/context/context-manager.ts +10 -10
- package/src/context/session-manager.ts +41 -41
- package/src/framework/command-interface.ts +520 -0
- package/src/framework/command-registry.ts +942 -0
- package/src/framework/completion-exporter.ts +383 -0
- package/src/framework/debug-logger.ts +519 -0
- package/src/framework/error-handler.ts +867 -0
- package/src/framework/help-generator.ts +540 -0
- package/src/framework/index.ts +169 -0
- package/src/framework/interactive-repl.ts +703 -0
- package/src/framework/output-formatter.ts +834 -0
- package/src/framework/progress-manager.ts +539 -0
- package/src/index.ts +4 -4
- package/src/interactive/interactive-mode.ts +16 -16
- package/src/lib/conflict-resolution.ts +799 -9
- package/src/lib/merge-strategy.ts +529 -7
- package/src/lib/safety-mechanisms.ts +422 -18
- package/src/lib/state-detection.ts +1015 -13
- package/src/nlp/command-mapper.ts +29 -29
- package/src/nlp/command-parser.ts +17 -17
- package/src/nlp/intent-classifier.ts +7 -7
- package/src/nlp/intent-parser.ts +54 -52
- package/src/plugins/plugin-manager.ts +61 -39
- package/src/tests/computer-setup-integration.test.ts +46 -15
- package/src/types/modules.d.ts +424 -1
- package/src/utils/backup-rollback-manager.ts +11 -8
- package/src/utils/config-manager.ts +3 -3
- package/src/utils/error-handler.ts +2 -2
- package/src/utils/logger.ts +22 -22
- package/templates/batch/ci-cd.yaml +7 -7
- package/test-suites/api/health.spec.ts +20 -23
- package/test-suites/helpers/test-config.ts +14 -13
- package/test-suites/ui/accessibility.spec.ts +27 -22
- package/test-suites/ui/smoke.spec.ts +26 -21
- package/LICENSE +0 -21
- package/dist/ai/ai-service.d.ts +0 -152
- package/dist/ai/ai-service.d.ts.map +0 -1
- package/dist/ai/ai-service.js +0 -430
- package/dist/ai/ai-service.js.map +0 -1
- package/dist/ai/claude-client.d.ts +0 -130
- package/dist/ai/claude-client.d.ts.map +0 -1
- package/dist/ai/claude-client.js +0 -340
- package/dist/ai/claude-client.js.map +0 -1
- package/dist/ai/conversation-manager.d.ts +0 -164
- package/dist/ai/conversation-manager.d.ts.map +0 -1
- package/dist/ai/conversation-manager.js +0 -614
- package/dist/ai/conversation-manager.js.map +0 -1
- package/dist/ai/index.d.ts +0 -5
- package/dist/ai/index.d.ts.map +0 -1
- package/dist/ai/index.js +0 -8
- package/dist/ai/index.js.map +0 -1
- package/dist/cli.d.ts +0 -36
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -192
- package/dist/cli.js.map +0 -1
- package/dist/commands/ai.d.ts +0 -89
- package/dist/commands/ai.d.ts.map +0 -1
- package/dist/commands/ai.js +0 -799
- package/dist/commands/ai.js.map +0 -1
- package/dist/commands/alignment.d.ts +0 -78
- package/dist/commands/alignment.d.ts.map +0 -1
- package/dist/commands/alignment.js +0 -817
- package/dist/commands/alignment.js.map +0 -1
- package/dist/commands/analyze-optimized.d.ts +0 -14
- package/dist/commands/analyze-optimized.d.ts.map +0 -1
- package/dist/commands/analyze-optimized.js +0 -600
- package/dist/commands/analyze-optimized.js.map +0 -1
- package/dist/commands/analyze.d.ts +0 -65
- package/dist/commands/analyze.d.ts.map +0 -1
- package/dist/commands/analyze.js +0 -435
- package/dist/commands/analyze.js.map +0 -1
- package/dist/commands/batch.d.ts +0 -71
- package/dist/commands/batch.d.ts.map +0 -1
- package/dist/commands/batch.js +0 -738
- package/dist/commands/batch.js.map +0 -1
- package/dist/commands/chat.d.ts +0 -71
- package/dist/commands/chat.d.ts.map +0 -1
- package/dist/commands/chat.js +0 -674
- package/dist/commands/chat.js.map +0 -1
- package/dist/commands/claude-init.d.ts +0 -28
- package/dist/commands/claude-init.d.ts.map +0 -1
- package/dist/commands/claude-init.js +0 -591
- package/dist/commands/claude-init.js.map +0 -1
- package/dist/commands/claude-setup.d.ts +0 -119
- package/dist/commands/claude-setup.d.ts.map +0 -1
- package/dist/commands/claude-setup.js +0 -1073
- package/dist/commands/claude-setup.js.map +0 -1
- package/dist/commands/computer-setup-commands.d.ts +0 -53
- package/dist/commands/computer-setup-commands.d.ts.map +0 -1
- package/dist/commands/computer-setup-commands.js +0 -705
- package/dist/commands/computer-setup-commands.js.map +0 -1
- package/dist/commands/computer-setup.d.ts +0 -7
- package/dist/commands/computer-setup.d.ts.map +0 -1
- package/dist/commands/computer-setup.js +0 -849
- package/dist/commands/computer-setup.js.map +0 -1
- package/dist/commands/create-command.d.ts +0 -7
- package/dist/commands/create-command.d.ts.map +0 -1
- package/dist/commands/create-command.js +0 -158
- package/dist/commands/create-command.js.map +0 -1
- package/dist/commands/create.d.ts +0 -74
- package/dist/commands/create.d.ts.map +0 -1
- package/dist/commands/create.js +0 -556
- package/dist/commands/create.js.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -91
- package/dist/commands/dashboard.d.ts.map +0 -1
- package/dist/commands/dashboard.js +0 -538
- package/dist/commands/dashboard.js.map +0 -1
- package/dist/commands/govern.d.ts +0 -70
- package/dist/commands/govern.d.ts.map +0 -1
- package/dist/commands/govern.js +0 -481
- package/dist/commands/govern.js.map +0 -1
- package/dist/commands/governance.d.ts +0 -17
- package/dist/commands/governance.d.ts.map +0 -1
- package/dist/commands/governance.js +0 -703
- package/dist/commands/governance.js.map +0 -1
- package/dist/commands/guardian.d.ts +0 -20
- package/dist/commands/guardian.d.ts.map +0 -1
- package/dist/commands/guardian.js +0 -597
- package/dist/commands/guardian.js.map +0 -1
- package/dist/commands/init.d.ts +0 -59
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -650
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/orchestrator.d.ts +0 -7
- package/dist/commands/orchestrator.d.ts.map +0 -1
- package/dist/commands/orchestrator.js +0 -571
- package/dist/commands/orchestrator.js.map +0 -1
- package/dist/commands/performance-optimizer.d.ts +0 -30
- package/dist/commands/performance-optimizer.d.ts.map +0 -1
- package/dist/commands/performance-optimizer.js +0 -650
- package/dist/commands/performance-optimizer.js.map +0 -1
- package/dist/commands/plugins.d.ts +0 -87
- package/dist/commands/plugins.d.ts.map +0 -1
- package/dist/commands/plugins.js +0 -685
- package/dist/commands/plugins.js.map +0 -1
- package/dist/commands/rag.d.ts +0 -7
- package/dist/commands/rag.d.ts.map +0 -1
- package/dist/commands/rag.js +0 -748
- package/dist/commands/rag.js.map +0 -1
- package/dist/commands/session.d.ts +0 -41
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js +0 -441
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -29
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js +0 -397
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/test-init.d.ts +0 -9
- package/dist/commands/test-init.d.ts.map +0 -1
- package/dist/commands/test-init.js +0 -222
- package/dist/commands/test-init.js.map +0 -1
- package/dist/commands/test.d.ts +0 -25
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/test.js +0 -217
- package/dist/commands/test.js.map +0 -1
- package/dist/commands/vp.d.ts +0 -7
- package/dist/commands/vp.d.ts.map +0 -1
- package/dist/commands/vp.js +0 -571
- package/dist/commands/vp.js.map +0 -1
- package/dist/commands/watch.d.ts +0 -76
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/watch.js +0 -613
- package/dist/commands/watch.js.map +0 -1
- package/dist/commands/worktree.d.ts +0 -63
- package/dist/commands/worktree.d.ts.map +0 -1
- package/dist/commands/worktree.js +0 -774
- package/dist/commands/worktree.js.map +0 -1
- package/dist/context/context-manager.d.ts +0 -155
- package/dist/context/context-manager.d.ts.map +0 -1
- package/dist/context/context-manager.js +0 -383
- package/dist/context/context-manager.js.map +0 -1
- package/dist/context/index.d.ts +0 -3
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -6
- package/dist/context/index.js.map +0 -1
- package/dist/context/session-manager.d.ts +0 -207
- package/dist/context/session-manager.d.ts.map +0 -1
- package/dist/context/session-manager.js +0 -686
- package/dist/context/session-manager.js.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -51
- package/dist/index.js.map +0 -1
- package/dist/interactive/interactive-mode.d.ts +0 -76
- package/dist/interactive/interactive-mode.d.ts.map +0 -1
- package/dist/interactive/interactive-mode.js +0 -732
- package/dist/interactive/interactive-mode.js.map +0 -1
- package/dist/nlp/command-mapper.d.ts +0 -174
- package/dist/nlp/command-mapper.d.ts.map +0 -1
- package/dist/nlp/command-mapper.js +0 -624
- package/dist/nlp/command-mapper.js.map +0 -1
- package/dist/nlp/command-parser.d.ts +0 -106
- package/dist/nlp/command-parser.d.ts.map +0 -1
- package/dist/nlp/command-parser.js +0 -417
- package/dist/nlp/command-parser.js.map +0 -1
- package/dist/nlp/index.d.ts +0 -5
- package/dist/nlp/index.d.ts.map +0 -1
- package/dist/nlp/index.js +0 -8
- package/dist/nlp/index.js.map +0 -1
- package/dist/nlp/intent-classifier.d.ts +0 -59
- package/dist/nlp/intent-classifier.d.ts.map +0 -1
- package/dist/nlp/intent-classifier.js +0 -384
- package/dist/nlp/intent-classifier.js.map +0 -1
- package/dist/nlp/intent-parser.d.ts +0 -152
- package/dist/nlp/intent-parser.d.ts.map +0 -1
- package/dist/nlp/intent-parser.js +0 -744
- package/dist/nlp/intent-parser.js.map +0 -1
- package/dist/plugins/plugin-manager.d.ts +0 -120
- package/dist/plugins/plugin-manager.d.ts.map +0 -1
- package/dist/plugins/plugin-manager.js +0 -595
- package/dist/plugins/plugin-manager.js.map +0 -1
- package/dist/types/index.d.ts +0 -224
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +0 -1
- package/dist/utils/backup-rollback-manager.d.ts +0 -72
- package/dist/utils/backup-rollback-manager.d.ts.map +0 -1
- package/dist/utils/backup-rollback-manager.js +0 -289
- package/dist/utils/backup-rollback-manager.js.map +0 -1
- package/dist/utils/claude-config-installer.d.ts +0 -98
- package/dist/utils/claude-config-installer.d.ts.map +0 -1
- package/dist/utils/claude-config-installer.js +0 -678
- package/dist/utils/claude-config-installer.js.map +0 -1
- package/dist/utils/config-manager.d.ts +0 -73
- package/dist/utils/config-manager.d.ts.map +0 -1
- package/dist/utils/config-manager.js +0 -339
- package/dist/utils/config-manager.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -46
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -169
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -25
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -105
- package/dist/utils/logger.js.map +0 -1
- package/src/commands/computer-setup-commands.ts +0 -872
package/src/commands/watch.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import path from 'path';
|
|
3
2
|
|
|
4
3
|
import chalk from 'chalk';
|
|
@@ -25,7 +24,7 @@ export class WatchCommands {
|
|
|
25
24
|
constructor(
|
|
26
25
|
private program: Command,
|
|
27
26
|
private configManager: ConfigManager,
|
|
28
|
-
private pluginManager: PluginManager
|
|
27
|
+
private pluginManager: PluginManager
|
|
29
28
|
) {
|
|
30
29
|
this.registerCommands();
|
|
31
30
|
}
|
|
@@ -107,7 +106,7 @@ export class WatchCommands {
|
|
|
107
106
|
.option(
|
|
108
107
|
'--framework <framework>',
|
|
109
108
|
'test framework (jest, mocha, vitest)',
|
|
110
|
-
'jest'
|
|
109
|
+
'jest'
|
|
111
110
|
)
|
|
112
111
|
.option('--coverage', 'run with coverage')
|
|
113
112
|
.option('--changed-only', 'run tests for changed files only')
|
|
@@ -142,7 +141,7 @@ export class WatchCommands {
|
|
|
142
141
|
.option(
|
|
143
142
|
'--type <type>',
|
|
144
143
|
'analysis type (quality, deps, security)',
|
|
145
|
-
'quality'
|
|
144
|
+
'quality'
|
|
146
145
|
)
|
|
147
146
|
.option('--threshold <threshold>', 'quality threshold')
|
|
148
147
|
.action(async options => {
|
|
@@ -190,7 +189,7 @@ export class WatchCommands {
|
|
|
190
189
|
'WUNDR_WATCH_START_FAILED',
|
|
191
190
|
'Failed to start watching',
|
|
192
191
|
{ patterns, options },
|
|
193
|
-
true
|
|
192
|
+
true
|
|
194
193
|
);
|
|
195
194
|
}
|
|
196
195
|
}
|
|
@@ -225,7 +224,7 @@ export class WatchCommands {
|
|
|
225
224
|
'WUNDR_WATCH_STOP_FAILED',
|
|
226
225
|
'Failed to stop watching',
|
|
227
226
|
{ name },
|
|
228
|
-
true
|
|
227
|
+
true
|
|
229
228
|
);
|
|
230
229
|
}
|
|
231
230
|
}
|
|
@@ -248,7 +247,7 @@ export class WatchCommands {
|
|
|
248
247
|
Patterns: config.patterns.join(', '),
|
|
249
248
|
Commands: config.commands.length,
|
|
250
249
|
Debounce: `${config.debounce || 300}ms`,
|
|
251
|
-
})
|
|
250
|
+
})
|
|
252
251
|
);
|
|
253
252
|
|
|
254
253
|
console.table(watchData);
|
|
@@ -257,7 +256,7 @@ export class WatchCommands {
|
|
|
257
256
|
'WUNDR_WATCH_LIST_FAILED',
|
|
258
257
|
'Failed to list watches',
|
|
259
258
|
{},
|
|
260
|
-
true
|
|
259
|
+
true
|
|
261
260
|
);
|
|
262
261
|
}
|
|
263
262
|
}
|
|
@@ -281,7 +280,7 @@ export class WatchCommands {
|
|
|
281
280
|
console.log(`Commands: ${config.commands.length}`);
|
|
282
281
|
console.log(`Debounce: ${config.debounce || 300}ms`);
|
|
283
282
|
console.log(
|
|
284
|
-
`Watched Paths: ${Object.keys(watcher.getWatched()).length}
|
|
283
|
+
`Watched Paths: ${Object.keys(watcher.getWatched()).length}`
|
|
285
284
|
);
|
|
286
285
|
} else {
|
|
287
286
|
console.log(chalk.blue('\nAll Watches Status:'));
|
|
@@ -297,7 +296,7 @@ export class WatchCommands {
|
|
|
297
296
|
'WUNDR_WATCH_STATUS_FAILED',
|
|
298
297
|
'Failed to show watch status',
|
|
299
298
|
{ name },
|
|
300
|
-
true
|
|
299
|
+
true
|
|
301
300
|
);
|
|
302
301
|
}
|
|
303
302
|
}
|
|
@@ -326,7 +325,7 @@ export class WatchCommands {
|
|
|
326
325
|
process.cwd(),
|
|
327
326
|
'.wundr',
|
|
328
327
|
'watch',
|
|
329
|
-
`${name}.yaml
|
|
328
|
+
`${name}.yaml`
|
|
330
329
|
);
|
|
331
330
|
await fs.ensureDir(path.dirname(configPath));
|
|
332
331
|
await fs.writeFile(configPath, YAML.stringify(config));
|
|
@@ -337,7 +336,7 @@ export class WatchCommands {
|
|
|
337
336
|
'WUNDR_WATCH_CONFIG_CREATE_FAILED',
|
|
338
337
|
'Failed to create watch configuration',
|
|
339
338
|
{ name, options },
|
|
340
|
-
true
|
|
339
|
+
true
|
|
341
340
|
);
|
|
342
341
|
}
|
|
343
342
|
}
|
|
@@ -357,7 +356,7 @@ export class WatchCommands {
|
|
|
357
356
|
'WUNDR_WATCH_CONFIG_LOAD_FAILED',
|
|
358
357
|
'Failed to load watch configuration',
|
|
359
358
|
{ file },
|
|
360
|
-
true
|
|
359
|
+
true
|
|
361
360
|
);
|
|
362
361
|
}
|
|
363
362
|
}
|
|
@@ -383,7 +382,7 @@ export class WatchCommands {
|
|
|
383
382
|
'WUNDR_WATCH_CONFIG_SAVE_FAILED',
|
|
384
383
|
'Failed to save watch configuration',
|
|
385
384
|
{ name, file },
|
|
386
|
-
true
|
|
385
|
+
true
|
|
387
386
|
);
|
|
388
387
|
}
|
|
389
388
|
}
|
|
@@ -414,7 +413,7 @@ export class WatchCommands {
|
|
|
414
413
|
'WUNDR_WATCH_TEST_FAILED',
|
|
415
414
|
'Failed to start test watcher',
|
|
416
415
|
{ options },
|
|
417
|
-
true
|
|
416
|
+
true
|
|
418
417
|
);
|
|
419
418
|
}
|
|
420
419
|
}
|
|
@@ -445,7 +444,7 @@ export class WatchCommands {
|
|
|
445
444
|
'WUNDR_WATCH_BUILD_FAILED',
|
|
446
445
|
'Failed to start build watcher',
|
|
447
446
|
{ options },
|
|
448
|
-
true
|
|
447
|
+
true
|
|
449
448
|
);
|
|
450
449
|
}
|
|
451
450
|
}
|
|
@@ -476,7 +475,7 @@ export class WatchCommands {
|
|
|
476
475
|
'WUNDR_WATCH_LINT_FAILED',
|
|
477
476
|
'Failed to start lint watcher',
|
|
478
477
|
{ options },
|
|
479
|
-
true
|
|
478
|
+
true
|
|
480
479
|
);
|
|
481
480
|
}
|
|
482
481
|
}
|
|
@@ -507,7 +506,7 @@ export class WatchCommands {
|
|
|
507
506
|
'WUNDR_WATCH_ANALYSIS_FAILED',
|
|
508
507
|
'Failed to start analysis watcher',
|
|
509
508
|
{ options },
|
|
510
|
-
true
|
|
509
|
+
true
|
|
511
510
|
);
|
|
512
511
|
}
|
|
513
512
|
}
|
|
@@ -518,11 +517,11 @@ export class WatchCommands {
|
|
|
518
517
|
private setupWatchHandlers(
|
|
519
518
|
watcher: FSWatcher,
|
|
520
519
|
config: WatchConfig,
|
|
521
|
-
name: string
|
|
520
|
+
name: string
|
|
522
521
|
): void {
|
|
523
522
|
const executeCommands = async (eventType: string, filePath: string) => {
|
|
524
523
|
const relevantCommands = config.commands.filter(
|
|
525
|
-
cmd => cmd.trigger === eventType || cmd.trigger === 'change'
|
|
524
|
+
cmd => cmd.trigger === eventType || cmd.trigger === 'change'
|
|
526
525
|
);
|
|
527
526
|
|
|
528
527
|
for (const cmd of relevantCommands) {
|
|
@@ -558,8 +557,8 @@ export class WatchCommands {
|
|
|
558
557
|
|
|
559
558
|
private shouldExecuteCommand(cmd: WatchCommand, filePath: string): boolean {
|
|
560
559
|
if (!cmd.condition) {
|
|
561
|
-
return true;
|
|
562
|
-
}
|
|
560
|
+
return true;
|
|
561
|
+
}
|
|
563
562
|
|
|
564
563
|
// Implement condition checking logic
|
|
565
564
|
switch (cmd.condition) {
|
|
@@ -578,7 +577,7 @@ return true;
|
|
|
578
577
|
|
|
579
578
|
private async executeWatchCommand(
|
|
580
579
|
cmd: WatchCommand,
|
|
581
|
-
filePath: string
|
|
580
|
+
filePath: string
|
|
582
581
|
): Promise<void> {
|
|
583
582
|
try {
|
|
584
583
|
logger.info(`Executing: ${cmd.command}`);
|
|
@@ -614,7 +613,7 @@ return true;
|
|
|
614
613
|
|
|
615
614
|
private createWatchConfigFromOptions(
|
|
616
615
|
patterns: string[],
|
|
617
|
-
options: any
|
|
616
|
+
options: any
|
|
618
617
|
): WatchConfig {
|
|
619
618
|
return {
|
|
620
619
|
patterns: patterns.length > 0 ? patterns : ['**/*'],
|
|
@@ -651,7 +650,7 @@ return true;
|
|
|
651
650
|
|
|
652
651
|
private async startWatchingWithConfig(
|
|
653
652
|
name: string,
|
|
654
|
-
config: WatchConfig
|
|
653
|
+
config: WatchConfig
|
|
655
654
|
): Promise<void> {
|
|
656
655
|
const watcher = watch(config.patterns, {
|
|
657
656
|
ignored: config.ignore || [],
|
|
@@ -739,11 +738,11 @@ return true;
|
|
|
739
738
|
const flags: string[] = [];
|
|
740
739
|
|
|
741
740
|
if (options.coverage) {
|
|
742
|
-
flags.push('--coverage');
|
|
743
|
-
}
|
|
741
|
+
flags.push('--coverage');
|
|
742
|
+
}
|
|
744
743
|
if (options.changedOnly) {
|
|
745
|
-
flags.push('--changedSince=HEAD');
|
|
746
|
-
}
|
|
744
|
+
flags.push('--changedSince=HEAD');
|
|
745
|
+
}
|
|
747
746
|
|
|
748
747
|
return `${baseCmd} ${flags.join(' ')}`;
|
|
749
748
|
}
|
package/src/commands/worktree.ts
CHANGED
|
@@ -176,7 +176,7 @@ async function getGitRepoRoot(): Promise<string> {
|
|
|
176
176
|
async function executeGitCommand(
|
|
177
177
|
command: string,
|
|
178
178
|
args: string[],
|
|
179
|
-
cwd: string
|
|
179
|
+
cwd: string
|
|
180
180
|
): Promise<string> {
|
|
181
181
|
const fullCommand = `git ${command} ${args.join(' ')}`;
|
|
182
182
|
try {
|
|
@@ -195,7 +195,7 @@ async function listGitWorktrees(repoPath: string): Promise<GitWorktreeInfo[]> {
|
|
|
195
195
|
const output = await executeGitCommand(
|
|
196
196
|
'worktree',
|
|
197
197
|
['list', '--porcelain'],
|
|
198
|
-
repoPath
|
|
198
|
+
repoPath
|
|
199
199
|
);
|
|
200
200
|
const entries = output.split('\n\n').filter(Boolean);
|
|
201
201
|
|
|
@@ -323,7 +323,7 @@ Examples:
|
|
|
323
323
|
${chalk.green('wundr worktree cleanup --dry-run')} Preview what would be cleaned up
|
|
324
324
|
${chalk.green('wundr worktree sync')} Sync all worktrees from remote
|
|
325
325
|
${chalk.green('wundr worktree sync <taskId>')} Sync specific worktree
|
|
326
|
-
`)
|
|
326
|
+
`)
|
|
327
327
|
);
|
|
328
328
|
|
|
329
329
|
// List command (default)
|
|
@@ -333,7 +333,7 @@ Examples:
|
|
|
333
333
|
.option('-s, --session <id>', 'Filter by session ID')
|
|
334
334
|
.option(
|
|
335
335
|
'--status <status>',
|
|
336
|
-
'Filter by status (active, paused, syncing, error, etc.)'
|
|
336
|
+
'Filter by status (active, paused, syncing, error, etc.)'
|
|
337
337
|
)
|
|
338
338
|
.option('-f, --format <format>', 'Output format (table, json)', 'table')
|
|
339
339
|
.action(async options => {
|
|
@@ -363,7 +363,7 @@ Examples:
|
|
|
363
363
|
.description('Clean up stale worktrees')
|
|
364
364
|
.option(
|
|
365
365
|
'--dry-run',
|
|
366
|
-
'Preview what would be cleaned up without making changes'
|
|
366
|
+
'Preview what would be cleaned up without making changes'
|
|
367
367
|
)
|
|
368
368
|
.option('--force', 'Force cleanup even with uncommitted changes')
|
|
369
369
|
.option('--age <days>', 'Clean up worktrees older than specified days', '7')
|
|
@@ -417,8 +417,8 @@ async function listWorktrees(options: {
|
|
|
417
417
|
worktrees: worktrees,
|
|
418
418
|
},
|
|
419
419
|
null,
|
|
420
|
-
2
|
|
421
|
-
)
|
|
420
|
+
2
|
|
421
|
+
)
|
|
422
422
|
);
|
|
423
423
|
return;
|
|
424
424
|
}
|
|
@@ -442,8 +442,8 @@ async function listWorktrees(options: {
|
|
|
442
442
|
padRight('Branch', 25) +
|
|
443
443
|
padRight('Status', 12) +
|
|
444
444
|
padRight('Created', 12) +
|
|
445
|
-
padRight('Path', 40)
|
|
446
|
-
)
|
|
445
|
+
padRight('Path', 40)
|
|
446
|
+
)
|
|
447
447
|
);
|
|
448
448
|
console.log(chalk.gray('-'.repeat(110)));
|
|
449
449
|
|
|
@@ -459,7 +459,7 @@ async function listWorktrees(options: {
|
|
|
459
459
|
chalk.blue(padRight(branchName, 25)) +
|
|
460
460
|
statusColor(padRight(getStatusIcon(wt.status), 12)) +
|
|
461
461
|
padRight(createdAge, 12) +
|
|
462
|
-
chalk.gray(padRight(worktreePath, 40))
|
|
462
|
+
chalk.gray(padRight(worktreePath, 40))
|
|
463
463
|
);
|
|
464
464
|
}
|
|
465
465
|
|
|
@@ -469,14 +469,14 @@ async function listWorktrees(options: {
|
|
|
469
469
|
} catch (error) {
|
|
470
470
|
spinner.fail('Failed to load worktrees');
|
|
471
471
|
console.error(
|
|
472
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
472
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
473
473
|
);
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
476
|
|
|
477
477
|
async function createWorktree(
|
|
478
478
|
taskId: string,
|
|
479
|
-
options: { base?: string }
|
|
479
|
+
options: { base?: string }
|
|
480
480
|
): Promise<void> {
|
|
481
481
|
const spinner = ora(`Creating worktree for task: ${taskId}...`).start();
|
|
482
482
|
|
|
@@ -490,7 +490,7 @@ async function createWorktree(
|
|
|
490
490
|
if (existing) {
|
|
491
491
|
spinner.fail(`Worktree already exists for task: ${taskId}`);
|
|
492
492
|
console.log(
|
|
493
|
-
chalk.yellow(`Use "wundr worktree switch ${taskId}" to switch to it.`)
|
|
493
|
+
chalk.yellow(`Use "wundr worktree switch ${taskId}" to switch to it.`)
|
|
494
494
|
);
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
@@ -515,7 +515,7 @@ async function createWorktree(
|
|
|
515
515
|
await executeGitCommand(
|
|
516
516
|
'worktree',
|
|
517
517
|
['add', '-b', branchName, worktreePath, `origin/${baseBranch}`],
|
|
518
|
-
repoPath
|
|
518
|
+
repoPath
|
|
519
519
|
);
|
|
520
520
|
|
|
521
521
|
// Save to state
|
|
@@ -539,13 +539,13 @@ async function createWorktree(
|
|
|
539
539
|
console.log(chalk.white(' Path: ') + chalk.gray(worktreePath));
|
|
540
540
|
console.log('');
|
|
541
541
|
console.log(
|
|
542
|
-
chalk.gray(`Use "wundr worktree switch ${taskId}" to start working.`)
|
|
542
|
+
chalk.gray(`Use "wundr worktree switch ${taskId}" to start working.`)
|
|
543
543
|
);
|
|
544
544
|
console.log('');
|
|
545
545
|
} catch (error) {
|
|
546
546
|
spinner.fail('Failed to create worktree');
|
|
547
547
|
console.error(
|
|
548
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
548
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
549
549
|
);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
@@ -561,7 +561,7 @@ async function switchWorktree(taskId: string): Promise<void> {
|
|
|
561
561
|
if (!worktree) {
|
|
562
562
|
spinner.fail(`Worktree not found: ${taskId}`);
|
|
563
563
|
console.log(
|
|
564
|
-
chalk.yellow(`Use "wundr worktree create ${taskId}" to create it.`)
|
|
564
|
+
chalk.yellow(`Use "wundr worktree create ${taskId}" to create it.`)
|
|
565
565
|
);
|
|
566
566
|
return;
|
|
567
567
|
}
|
|
@@ -573,8 +573,8 @@ async function switchWorktree(taskId: string): Promise<void> {
|
|
|
573
573
|
spinner.fail(`Worktree directory not found: ${worktree.worktreePath}`);
|
|
574
574
|
console.log(
|
|
575
575
|
chalk.yellow(
|
|
576
|
-
'The worktree may have been deleted. Consider running cleanup.'
|
|
577
|
-
)
|
|
576
|
+
'The worktree may have been deleted. Consider running cleanup.'
|
|
577
|
+
)
|
|
578
578
|
);
|
|
579
579
|
return;
|
|
580
580
|
}
|
|
@@ -588,10 +588,10 @@ async function switchWorktree(taskId: string): Promise<void> {
|
|
|
588
588
|
console.log('');
|
|
589
589
|
console.log(chalk.white(' Task ID: ') + chalk.green(taskId));
|
|
590
590
|
console.log(
|
|
591
|
-
chalk.white(' Branch: ') + chalk.blue(worktree.branchName)
|
|
591
|
+
chalk.white(' Branch: ') + chalk.blue(worktree.branchName)
|
|
592
592
|
);
|
|
593
593
|
console.log(
|
|
594
|
-
chalk.white(' Path: ') + chalk.gray(worktree.worktreePath)
|
|
594
|
+
chalk.white(' Path: ') + chalk.gray(worktree.worktreePath)
|
|
595
595
|
);
|
|
596
596
|
console.log('');
|
|
597
597
|
console.log(chalk.cyan('To navigate to this worktree, run:'));
|
|
@@ -600,7 +600,7 @@ async function switchWorktree(taskId: string): Promise<void> {
|
|
|
600
600
|
} catch (error) {
|
|
601
601
|
spinner.fail('Failed to switch worktree');
|
|
602
602
|
console.error(
|
|
603
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
603
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
604
604
|
);
|
|
605
605
|
}
|
|
606
606
|
}
|
|
@@ -613,7 +613,7 @@ async function cleanupWorktrees(options: {
|
|
|
613
613
|
const maxAgeDays = parseInt(options.age || '7', 10);
|
|
614
614
|
const maxAgeMs = maxAgeDays * 24 * 60 * 60 * 1000;
|
|
615
615
|
const spinner = ora(
|
|
616
|
-
options.dryRun ? 'Analyzing worktrees...' : 'Cleaning up worktrees...'
|
|
616
|
+
options.dryRun ? 'Analyzing worktrees...' : 'Cleaning up worktrees...'
|
|
617
617
|
).start();
|
|
618
618
|
|
|
619
619
|
try {
|
|
@@ -687,7 +687,7 @@ async function cleanupWorktrees(options: {
|
|
|
687
687
|
}
|
|
688
688
|
|
|
689
689
|
console.log(
|
|
690
|
-
chalk.yellow(`\nWorktrees to be removed: ${toRemove.length}`)
|
|
690
|
+
chalk.yellow(`\nWorktrees to be removed: ${toRemove.length}`)
|
|
691
691
|
);
|
|
692
692
|
console.log(chalk.gray('-'.repeat(80)));
|
|
693
693
|
|
|
@@ -695,10 +695,10 @@ async function cleanupWorktrees(options: {
|
|
|
695
695
|
if (entry) {
|
|
696
696
|
console.log(chalk.white(' Task ID: ') + chalk.green(entry.taskId));
|
|
697
697
|
console.log(
|
|
698
|
-
chalk.white(' Path: ') + chalk.gray(entry.worktreePath)
|
|
698
|
+
chalk.white(' Path: ') + chalk.gray(entry.worktreePath)
|
|
699
699
|
);
|
|
700
700
|
console.log(
|
|
701
|
-
chalk.white(' Branch: ') + chalk.blue(entry.branchName)
|
|
701
|
+
chalk.white(' Branch: ') + chalk.blue(entry.branchName)
|
|
702
702
|
);
|
|
703
703
|
console.log(chalk.white(' Reason: ') + chalk.yellow(reason));
|
|
704
704
|
console.log('');
|
|
@@ -707,7 +707,7 @@ async function cleanupWorktrees(options: {
|
|
|
707
707
|
|
|
708
708
|
if (toSkip.length > 0) {
|
|
709
709
|
console.log(
|
|
710
|
-
chalk.yellow(`\nWorktrees to be skipped: ${toSkip.length}`)
|
|
710
|
+
chalk.yellow(`\nWorktrees to be skipped: ${toSkip.length}`)
|
|
711
711
|
);
|
|
712
712
|
console.log(chalk.gray('-'.repeat(80)));
|
|
713
713
|
|
|
@@ -715,7 +715,7 @@ async function cleanupWorktrees(options: {
|
|
|
715
715
|
if (entry) {
|
|
716
716
|
console.log(chalk.white(' Task ID: ') + chalk.green(entry.taskId));
|
|
717
717
|
console.log(
|
|
718
|
-
chalk.white(' Path: ') + chalk.gray(entry.worktreePath)
|
|
718
|
+
chalk.white(' Path: ') + chalk.gray(entry.worktreePath)
|
|
719
719
|
);
|
|
720
720
|
console.log(chalk.white(' Reason: ') + chalk.gray(reason));
|
|
721
721
|
console.log('');
|
|
@@ -725,7 +725,7 @@ async function cleanupWorktrees(options: {
|
|
|
725
725
|
|
|
726
726
|
console.log(chalk.gray('-'.repeat(80)));
|
|
727
727
|
console.log(
|
|
728
|
-
chalk.gray('Run without --dry-run to perform actual cleanup.')
|
|
728
|
+
chalk.gray('Run without --dry-run to perform actual cleanup.')
|
|
729
729
|
);
|
|
730
730
|
console.log('');
|
|
731
731
|
} else {
|
|
@@ -750,7 +750,7 @@ async function cleanupWorktrees(options: {
|
|
|
750
750
|
await executeGitCommand(
|
|
751
751
|
'worktree',
|
|
752
752
|
['remove', forceFlag, entry.worktreePath].filter(Boolean),
|
|
753
|
-
repoPath
|
|
753
|
+
repoPath
|
|
754
754
|
);
|
|
755
755
|
|
|
756
756
|
result.removedCount++;
|
|
@@ -789,7 +789,7 @@ async function cleanupWorktrees(options: {
|
|
|
789
789
|
// Update state file to remove cleaned worktrees
|
|
790
790
|
const removedPaths = new Set(result.removedPaths);
|
|
791
791
|
state.worktrees = state.worktrees.filter(
|
|
792
|
-
wt => !removedPaths.has(wt.worktreePath)
|
|
792
|
+
wt => !removedPaths.has(wt.worktreePath)
|
|
793
793
|
);
|
|
794
794
|
await saveWorktreeState(state);
|
|
795
795
|
|
|
@@ -805,7 +805,7 @@ async function cleanupWorktrees(options: {
|
|
|
805
805
|
|
|
806
806
|
if (result.removedCount > 0) {
|
|
807
807
|
console.log(
|
|
808
|
-
chalk.green(`\nRemoved ${result.removedCount} worktree(s):`)
|
|
808
|
+
chalk.green(`\nRemoved ${result.removedCount} worktree(s):`)
|
|
809
809
|
);
|
|
810
810
|
for (const removedPath of result.removedPaths) {
|
|
811
811
|
console.log(chalk.gray(` - ${removedPath}`));
|
|
@@ -814,7 +814,7 @@ async function cleanupWorktrees(options: {
|
|
|
814
814
|
|
|
815
815
|
if (result.skippedPaths.length > 0) {
|
|
816
816
|
console.log(
|
|
817
|
-
chalk.yellow(`\nSkipped ${result.skippedPaths.length} worktree(s):`)
|
|
817
|
+
chalk.yellow(`\nSkipped ${result.skippedPaths.length} worktree(s):`)
|
|
818
818
|
);
|
|
819
819
|
for (const skippedPath of result.skippedPaths) {
|
|
820
820
|
const reason = result.skipReasons.get(skippedPath) || 'unknown';
|
|
@@ -834,17 +834,17 @@ async function cleanupWorktrees(options: {
|
|
|
834
834
|
} catch (error) {
|
|
835
835
|
spinner.fail('Failed to cleanup worktrees');
|
|
836
836
|
console.error(
|
|
837
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
837
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
838
838
|
);
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
841
|
|
|
842
842
|
async function syncWorktrees(
|
|
843
843
|
taskId: string | undefined,
|
|
844
|
-
options: { all?: boolean }
|
|
844
|
+
options: { all?: boolean }
|
|
845
845
|
): Promise<void> {
|
|
846
846
|
const spinner = ora(
|
|
847
|
-
taskId ? `Syncing worktree: ${taskId}...` : 'Syncing worktrees...'
|
|
847
|
+
taskId ? `Syncing worktree: ${taskId}...` : 'Syncing worktrees...'
|
|
848
848
|
).start();
|
|
849
849
|
|
|
850
850
|
try {
|
|
@@ -852,7 +852,7 @@ async function syncWorktrees(
|
|
|
852
852
|
const repoPath = state.repoPath || (await getGitRepoRoot());
|
|
853
853
|
|
|
854
854
|
const syncSingleWorktree = async (
|
|
855
|
-
worktree: WorktreeEntry
|
|
855
|
+
worktree: WorktreeEntry
|
|
856
856
|
): Promise<SyncResult> => {
|
|
857
857
|
const timestamp = new Date();
|
|
858
858
|
let stashedChanges = false;
|
|
@@ -866,7 +866,7 @@ async function syncWorktrees(
|
|
|
866
866
|
await executeGitCommand(
|
|
867
867
|
'stash',
|
|
868
868
|
['push', '-m', 'auto-stash before sync'],
|
|
869
|
-
worktree.worktreePath
|
|
869
|
+
worktree.worktreePath
|
|
870
870
|
);
|
|
871
871
|
stashedChanges = true;
|
|
872
872
|
}
|
|
@@ -878,7 +878,7 @@ async function syncWorktrees(
|
|
|
878
878
|
const branchName = await executeGitCommand(
|
|
879
879
|
'rev-parse',
|
|
880
880
|
['--abbrev-ref', 'HEAD'],
|
|
881
|
-
worktree.worktreePath
|
|
881
|
+
worktree.worktreePath
|
|
882
882
|
);
|
|
883
883
|
|
|
884
884
|
// Try fast-forward pull
|
|
@@ -886,14 +886,14 @@ async function syncWorktrees(
|
|
|
886
886
|
await executeGitCommand(
|
|
887
887
|
'pull',
|
|
888
888
|
['--ff-only', 'origin', branchName],
|
|
889
|
-
worktree.worktreePath
|
|
889
|
+
worktree.worktreePath
|
|
890
890
|
);
|
|
891
891
|
} catch {
|
|
892
892
|
// Fast-forward not possible, try rebase
|
|
893
893
|
await executeGitCommand(
|
|
894
894
|
'rebase',
|
|
895
895
|
[`origin/${branchName}`],
|
|
896
|
-
worktree.worktreePath
|
|
896
|
+
worktree.worktreePath
|
|
897
897
|
);
|
|
898
898
|
}
|
|
899
899
|
|
|
@@ -902,7 +902,7 @@ async function syncWorktrees(
|
|
|
902
902
|
try {
|
|
903
903
|
const { stdout } = await execAsync(
|
|
904
904
|
`git rev-list --count origin/${branchName}..HEAD`,
|
|
905
|
-
{ cwd: worktree.worktreePath, timeout: 10000 }
|
|
905
|
+
{ cwd: worktree.worktreePath, timeout: 10000 }
|
|
906
906
|
);
|
|
907
907
|
commitsUpdated = parseInt(stdout.trim(), 10) || 0;
|
|
908
908
|
} catch {
|
|
@@ -973,15 +973,15 @@ async function syncWorktrees(
|
|
|
973
973
|
console.log(chalk.green(`\nSuccessfully synced worktree: ${taskId}`));
|
|
974
974
|
console.log(
|
|
975
975
|
chalk.white(' Branch: ') +
|
|
976
|
-
chalk.blue(result.branchName || 'unknown')
|
|
976
|
+
chalk.blue(result.branchName || 'unknown')
|
|
977
977
|
);
|
|
978
978
|
console.log(
|
|
979
979
|
chalk.white(' Commits: ') +
|
|
980
|
-
chalk.cyan(`${result.commitsUpdated || 0} updated`)
|
|
980
|
+
chalk.cyan(`${result.commitsUpdated || 0} updated`)
|
|
981
981
|
);
|
|
982
982
|
if (result.stashedChanges) {
|
|
983
983
|
console.log(
|
|
984
|
-
chalk.yellow(' Note: Local changes were stashed and restored.')
|
|
984
|
+
chalk.yellow(' Note: Local changes were stashed and restored.')
|
|
985
985
|
);
|
|
986
986
|
}
|
|
987
987
|
} else {
|
|
@@ -992,7 +992,7 @@ async function syncWorktrees(
|
|
|
992
992
|
} else if (options.all || !taskId) {
|
|
993
993
|
// Sync all active worktrees
|
|
994
994
|
const activeWorktrees = state.worktrees.filter(
|
|
995
|
-
wt => wt.status === 'active' || wt.status === 'paused'
|
|
995
|
+
wt => wt.status === 'active' || wt.status === 'paused'
|
|
996
996
|
);
|
|
997
997
|
|
|
998
998
|
if (activeWorktrees.length === 0) {
|
|
@@ -1030,8 +1030,8 @@ async function syncWorktrees(
|
|
|
1030
1030
|
for (const { taskId: tid, result } of successful) {
|
|
1031
1031
|
console.log(
|
|
1032
1032
|
chalk.gray(
|
|
1033
|
-
` - ${tid}: ${result.commitsUpdated || 0} commit(s) updated
|
|
1034
|
-
)
|
|
1033
|
+
` - ${tid}: ${result.commitsUpdated || 0} commit(s) updated`
|
|
1034
|
+
)
|
|
1035
1035
|
);
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
@@ -1048,7 +1048,7 @@ async function syncWorktrees(
|
|
|
1048
1048
|
} catch (error) {
|
|
1049
1049
|
spinner.fail('Failed to sync worktrees');
|
|
1050
1050
|
console.error(
|
|
1051
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
1051
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
1052
1052
|
);
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
@@ -139,7 +139,7 @@ export class ContextManager {
|
|
|
139
139
|
success: boolean,
|
|
140
140
|
duration: number,
|
|
141
141
|
output?: string,
|
|
142
|
-
error?: string
|
|
142
|
+
error?: string
|
|
143
143
|
): Promise<void> {
|
|
144
144
|
if (!this.currentSession) {
|
|
145
145
|
throw new Error('No active session');
|
|
@@ -183,7 +183,7 @@ export class ContextManager {
|
|
|
183
183
|
* Update user preferences
|
|
184
184
|
*/
|
|
185
185
|
async updatePreferences(
|
|
186
|
-
preferences: Partial<UserPreferences
|
|
186
|
+
preferences: Partial<UserPreferences>
|
|
187
187
|
): Promise<void> {
|
|
188
188
|
if (!this.currentSession) {
|
|
189
189
|
throw new Error('No active session');
|
|
@@ -228,7 +228,7 @@ export class ContextManager {
|
|
|
228
228
|
* Detect project context
|
|
229
229
|
*/
|
|
230
230
|
async detectProjectContext(
|
|
231
|
-
projectPath?: string
|
|
231
|
+
projectPath?: string
|
|
232
232
|
): Promise<ProjectContext | undefined> {
|
|
233
233
|
const targetPath = projectPath || process.cwd();
|
|
234
234
|
|
|
@@ -248,10 +248,10 @@ export class ContextManager {
|
|
|
248
248
|
if (await fs.pathExists(packageJsonPath)) {
|
|
249
249
|
context.packageJson = await fs.readJson(packageJsonPath);
|
|
250
250
|
context.dependencies = Object.keys(
|
|
251
|
-
context.packageJson.dependencies || {}
|
|
251
|
+
context.packageJson.dependencies || {}
|
|
252
252
|
);
|
|
253
253
|
context.devDependencies = Object.keys(
|
|
254
|
-
context.packageJson.devDependencies || {}
|
|
254
|
+
context.packageJson.devDependencies || {}
|
|
255
255
|
);
|
|
256
256
|
context.scripts = context.packageJson.scripts || {};
|
|
257
257
|
context.type = this.detectProjectType(context.packageJson);
|
|
@@ -284,7 +284,7 @@ export class ContextManager {
|
|
|
284
284
|
quality: number,
|
|
285
285
|
duplicates: number,
|
|
286
286
|
dependencies: number,
|
|
287
|
-
recommendations: string[]
|
|
287
|
+
recommendations: string[]
|
|
288
288
|
): Promise<void> {
|
|
289
289
|
if (!this.currentSession?.projectContext) {
|
|
290
290
|
return;
|
|
@@ -356,7 +356,7 @@ export class ContextManager {
|
|
|
356
356
|
if (file.endsWith('.json')) {
|
|
357
357
|
try {
|
|
358
358
|
const sessionData = await fs.readJson(
|
|
359
|
-
path.join(this.sessionsDir, file)
|
|
359
|
+
path.join(this.sessionsDir, file)
|
|
360
360
|
);
|
|
361
361
|
sessions.push({
|
|
362
362
|
id: sessionData.sessionId,
|
|
@@ -371,7 +371,7 @@ export class ContextManager {
|
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
return sessions.sort(
|
|
374
|
-
(a, b) => b.lastActivity.getTime() - a.lastActivity.getTime()
|
|
374
|
+
(a, b) => b.lastActivity.getTime() - a.lastActivity.getTime()
|
|
375
375
|
);
|
|
376
376
|
} catch (error) {
|
|
377
377
|
logger.debug('Failed to list sessions:', error);
|
|
@@ -399,7 +399,7 @@ export class ContextManager {
|
|
|
399
399
|
|
|
400
400
|
if (data.projectContext?.lastAnalysis) {
|
|
401
401
|
data.projectContext.lastAnalysis.timestamp = new Date(
|
|
402
|
-
data.projectContext.lastAnalysis.timestamp
|
|
402
|
+
data.projectContext.lastAnalysis.timestamp
|
|
403
403
|
);
|
|
404
404
|
}
|
|
405
405
|
|
|
@@ -419,7 +419,7 @@ export class ContextManager {
|
|
|
419
419
|
try {
|
|
420
420
|
const sessionPath = path.join(
|
|
421
421
|
this.sessionsDir,
|
|
422
|
-
`${session.sessionId}.json
|
|
422
|
+
`${session.sessionId}.json`
|
|
423
423
|
);
|
|
424
424
|
await fs.writeJson(sessionPath, session, { spaces: 2 });
|
|
425
425
|
} catch (error) {
|