@wundr.io/cli 1.0.11 → 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
|
@@ -127,7 +127,7 @@ export class SessionManager extends EventEmitter {
|
|
|
127
127
|
constructor(
|
|
128
128
|
conversationManager: ConversationManager,
|
|
129
129
|
commandMapper: CommandMapper,
|
|
130
|
-
config: Partial<SessionManagerConfig> = {}
|
|
130
|
+
config: Partial<SessionManagerConfig> = {}
|
|
131
131
|
) {
|
|
132
132
|
super();
|
|
133
133
|
|
|
@@ -155,7 +155,7 @@ export class SessionManager extends EventEmitter {
|
|
|
155
155
|
async createSession(
|
|
156
156
|
userId: string,
|
|
157
157
|
workspacePath?: string,
|
|
158
|
-
sessionId?: string
|
|
158
|
+
sessionId?: string
|
|
159
159
|
): Promise<string> {
|
|
160
160
|
const id =
|
|
161
161
|
sessionId ||
|
|
@@ -222,7 +222,7 @@ export class SessionManager extends EventEmitter {
|
|
|
222
222
|
// Refresh project context
|
|
223
223
|
if (session.projectContext) {
|
|
224
224
|
session.projectContext = await this.detectProjectContext(
|
|
225
|
-
session.currentWorkspace
|
|
225
|
+
session.currentWorkspace
|
|
226
226
|
);
|
|
227
227
|
}
|
|
228
228
|
|
|
@@ -239,8 +239,8 @@ export class SessionManager extends EventEmitter {
|
|
|
239
239
|
*/
|
|
240
240
|
getCurrentSession(): SessionState | null {
|
|
241
241
|
if (!this.currentSessionId) {
|
|
242
|
-
return null;
|
|
243
|
-
}
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
244
|
return this.activeSessions.get(this.currentSessionId) || null;
|
|
245
245
|
}
|
|
246
246
|
|
|
@@ -257,7 +257,7 @@ return null;
|
|
|
257
257
|
async updateSessionContext(
|
|
258
258
|
sessionId: string,
|
|
259
259
|
contextType: 'project' | 'command' | 'conversation',
|
|
260
|
-
contextData: any
|
|
260
|
+
contextData: any
|
|
261
261
|
): Promise<void> {
|
|
262
262
|
const session = this.activeSessions.get(sessionId);
|
|
263
263
|
if (!session) {
|
|
@@ -299,7 +299,7 @@ return null;
|
|
|
299
299
|
sessionId: string,
|
|
300
300
|
command: string,
|
|
301
301
|
success: boolean,
|
|
302
|
-
duration: number
|
|
302
|
+
duration: number
|
|
303
303
|
): Promise<void> {
|
|
304
304
|
const session = this.activeSessions.get(sessionId);
|
|
305
305
|
if (!session) {
|
|
@@ -335,7 +335,7 @@ return null;
|
|
|
335
335
|
*/
|
|
336
336
|
async updateUserPreferences(
|
|
337
337
|
userId: string,
|
|
338
|
-
preferences: Partial<UserPreferences
|
|
338
|
+
preferences: Partial<UserPreferences>
|
|
339
339
|
): Promise<void> {
|
|
340
340
|
const defaultPreferences = this.getDefaultPreferences();
|
|
341
341
|
const currentPreferences = await this.loadUserPreferences(userId);
|
|
@@ -363,7 +363,7 @@ return null;
|
|
|
363
363
|
*/
|
|
364
364
|
async registerWorkspace(
|
|
365
365
|
workspacePath: string,
|
|
366
|
-
config: Partial<WorkspaceConfig
|
|
366
|
+
config: Partial<WorkspaceConfig>
|
|
367
367
|
): Promise<void> {
|
|
368
368
|
const workspace: WorkspaceConfig = {
|
|
369
369
|
name: config.name || path.basename(workspacePath),
|
|
@@ -386,7 +386,7 @@ return null;
|
|
|
386
386
|
*/
|
|
387
387
|
getWorkspaceSuggestions(limit: number = 5): WorkspaceConfig[] {
|
|
388
388
|
const workspaces = Array.from(this.workspaces.values()).sort(
|
|
389
|
-
(a, b) => b.lastAccessed.getTime() - a.lastAccessed.getTime()
|
|
389
|
+
(a, b) => b.lastAccessed.getTime() - a.lastAccessed.getTime()
|
|
390
390
|
);
|
|
391
391
|
|
|
392
392
|
return workspaces.slice(0, limit);
|
|
@@ -402,7 +402,7 @@ return null;
|
|
|
402
402
|
timeRange?: { from: Date; to: Date };
|
|
403
403
|
successOnly?: boolean;
|
|
404
404
|
limit?: number;
|
|
405
|
-
}
|
|
405
|
+
}
|
|
406
406
|
): Array<{
|
|
407
407
|
command: string;
|
|
408
408
|
timestamp: Date;
|
|
@@ -411,15 +411,15 @@ return null;
|
|
|
411
411
|
}> {
|
|
412
412
|
const session = this.activeSessions.get(sessionId);
|
|
413
413
|
if (!session) {
|
|
414
|
-
return [];
|
|
415
|
-
}
|
|
414
|
+
return [];
|
|
415
|
+
}
|
|
416
416
|
|
|
417
417
|
let history = session.recentCommands;
|
|
418
418
|
|
|
419
419
|
if (query.command) {
|
|
420
420
|
const searchTerm = query.command.toLowerCase();
|
|
421
421
|
history = history.filter(cmd =>
|
|
422
|
-
cmd.command.toLowerCase().includes(searchTerm)
|
|
422
|
+
cmd.command.toLowerCase().includes(searchTerm)
|
|
423
423
|
);
|
|
424
424
|
}
|
|
425
425
|
|
|
@@ -427,7 +427,7 @@ return [];
|
|
|
427
427
|
history = history.filter(
|
|
428
428
|
cmd =>
|
|
429
429
|
cmd.timestamp >= query.timeRange!.from &&
|
|
430
|
-
cmd.timestamp <= query.timeRange!.to
|
|
430
|
+
cmd.timestamp <= query.timeRange!.to
|
|
431
431
|
);
|
|
432
432
|
}
|
|
433
433
|
|
|
@@ -447,7 +447,7 @@ return [];
|
|
|
447
447
|
*/
|
|
448
448
|
async getContextualSuggestions(
|
|
449
449
|
sessionId: string,
|
|
450
|
-
limit: number = 5
|
|
450
|
+
limit: number = 5
|
|
451
451
|
): Promise<
|
|
452
452
|
Array<{
|
|
453
453
|
type: 'command' | 'workspace' | 'conversation';
|
|
@@ -458,8 +458,8 @@ return [];
|
|
|
458
458
|
> {
|
|
459
459
|
const session = this.activeSessions.get(sessionId);
|
|
460
460
|
if (!session) {
|
|
461
|
-
return [];
|
|
462
|
-
}
|
|
461
|
+
return [];
|
|
462
|
+
}
|
|
463
463
|
|
|
464
464
|
const suggestions: Array<{
|
|
465
465
|
type: 'command' | 'workspace' | 'conversation';
|
|
@@ -479,7 +479,7 @@ return [];
|
|
|
479
479
|
if (baseCommand) {
|
|
480
480
|
commandFrequency.set(
|
|
481
481
|
baseCommand,
|
|
482
|
-
(commandFrequency.get(baseCommand) || 0) + 1
|
|
482
|
+
(commandFrequency.get(baseCommand) || 0) + 1
|
|
483
483
|
);
|
|
484
484
|
}
|
|
485
485
|
}
|
|
@@ -516,7 +516,7 @@ return [];
|
|
|
516
516
|
*/
|
|
517
517
|
async exportSession(
|
|
518
518
|
sessionId: string,
|
|
519
|
-
format: 'json' | 'csv'
|
|
519
|
+
format: 'json' | 'csv'
|
|
520
520
|
): Promise<string> {
|
|
521
521
|
const session = this.activeSessions.get(sessionId);
|
|
522
522
|
if (!session) {
|
|
@@ -562,7 +562,7 @@ return [];
|
|
|
562
562
|
// Limit active sessions
|
|
563
563
|
if (this.activeSessions.size > this.config.maxSessions) {
|
|
564
564
|
const sessionsByAccess = Array.from(this.activeSessions.entries()).sort(
|
|
565
|
-
([, a], [, b]) => a.lastAccessed.getTime() - b.lastAccessed.getTime()
|
|
565
|
+
([, a], [, b]) => a.lastAccessed.getTime() - b.lastAccessed.getTime()
|
|
566
566
|
);
|
|
567
567
|
|
|
568
568
|
const excessCount = this.activeSessions.size - this.config.maxSessions;
|
|
@@ -593,11 +593,11 @@ return [];
|
|
|
593
593
|
const activeSessions = this.activeSessions.size;
|
|
594
594
|
const totalCommands = Array.from(this.activeSessions.values()).reduce(
|
|
595
595
|
(sum, session) => sum + session.recentCommands.length,
|
|
596
|
-
0
|
|
596
|
+
0
|
|
597
597
|
);
|
|
598
598
|
|
|
599
599
|
const sessionDurations = Array.from(this.activeSessions.values()).map(
|
|
600
|
-
session => session.lastAccessed.getTime() - session.created.getTime()
|
|
600
|
+
session => session.lastAccessed.getTime() - session.created.getTime()
|
|
601
601
|
);
|
|
602
602
|
const averageSessionDuration =
|
|
603
603
|
sessionDurations.length > 0
|
|
@@ -613,7 +613,7 @@ return [];
|
|
|
613
613
|
if (baseCommand) {
|
|
614
614
|
commandCounts.set(
|
|
615
615
|
baseCommand,
|
|
616
|
-
(commandCounts.get(baseCommand) || 0) + 1
|
|
616
|
+
(commandCounts.get(baseCommand) || 0) + 1
|
|
617
617
|
);
|
|
618
618
|
}
|
|
619
619
|
}
|
|
@@ -660,7 +660,7 @@ return [];
|
|
|
660
660
|
logger.error('Session backup failed:', error);
|
|
661
661
|
}
|
|
662
662
|
},
|
|
663
|
-
this.config.backupInterval * 60 * 1000
|
|
663
|
+
this.config.backupInterval * 60 * 1000
|
|
664
664
|
);
|
|
665
665
|
|
|
666
666
|
// Periodic cleanup
|
|
@@ -672,16 +672,16 @@ return [];
|
|
|
672
672
|
logger.error('Session cleanup failed:', error);
|
|
673
673
|
}
|
|
674
674
|
},
|
|
675
|
-
30 * 60 * 1000
|
|
675
|
+
30 * 60 * 1000
|
|
676
676
|
); // Every 30 minutes
|
|
677
677
|
}
|
|
678
678
|
|
|
679
679
|
private async detectProjectContext(
|
|
680
|
-
workspacePath: string
|
|
680
|
+
workspacePath: string
|
|
681
681
|
): Promise<ProjectContext | undefined> {
|
|
682
682
|
if (!this.config.autoDetectProjects) {
|
|
683
|
-
return undefined;
|
|
684
|
-
}
|
|
683
|
+
return undefined;
|
|
684
|
+
}
|
|
685
685
|
|
|
686
686
|
try {
|
|
687
687
|
const context: ProjectContext = {
|
|
@@ -699,7 +699,7 @@ return undefined;
|
|
|
699
699
|
const packageJson = await fs.readJson(packageJsonPath);
|
|
700
700
|
context.dependencies = Object.keys(packageJson.dependencies || {});
|
|
701
701
|
context.devDependencies = Object.keys(
|
|
702
|
-
packageJson.devDependencies || {}
|
|
702
|
+
packageJson.devDependencies || {}
|
|
703
703
|
);
|
|
704
704
|
context.scripts = packageJson.scripts || {};
|
|
705
705
|
|
|
@@ -754,7 +754,7 @@ return undefined;
|
|
|
754
754
|
}
|
|
755
755
|
|
|
756
756
|
private async getGitInfo(
|
|
757
|
-
workspacePath: string
|
|
757
|
+
workspacePath: string
|
|
758
758
|
): Promise<ProjectContext['gitRepository']> {
|
|
759
759
|
// Simplified git info extraction
|
|
760
760
|
return {
|
|
@@ -785,7 +785,7 @@ return undefined;
|
|
|
785
785
|
const prefsPath = path.join(
|
|
786
786
|
this.config.persistencePath,
|
|
787
787
|
'users',
|
|
788
|
-
`${userId}.json
|
|
788
|
+
`${userId}.json`
|
|
789
789
|
);
|
|
790
790
|
|
|
791
791
|
if (await fs.pathExists(prefsPath)) {
|
|
@@ -802,12 +802,12 @@ return undefined;
|
|
|
802
802
|
|
|
803
803
|
private async saveUserPreferences(
|
|
804
804
|
userId: string,
|
|
805
|
-
preferences: UserPreferences
|
|
805
|
+
preferences: UserPreferences
|
|
806
806
|
): Promise<void> {
|
|
807
807
|
const prefsPath = path.join(
|
|
808
808
|
this.config.persistencePath,
|
|
809
809
|
'users',
|
|
810
|
-
`${userId}.json
|
|
810
|
+
`${userId}.json`
|
|
811
811
|
);
|
|
812
812
|
await fs.ensureDir(path.dirname(prefsPath));
|
|
813
813
|
await fs.writeJson(prefsPath, preferences, { spaces: 2 });
|
|
@@ -816,7 +816,7 @@ return undefined;
|
|
|
816
816
|
private async persistSession(session: SessionState): Promise<void> {
|
|
817
817
|
const sessionPath = path.join(
|
|
818
818
|
this.config.persistencePath,
|
|
819
|
-
`${session.id}.json
|
|
819
|
+
`${session.id}.json`
|
|
820
820
|
);
|
|
821
821
|
const serialized = this.serializeSession(session);
|
|
822
822
|
await fs.writeJson(sessionPath, serialized, { spaces: 2 });
|
|
@@ -825,7 +825,7 @@ return undefined;
|
|
|
825
825
|
private async loadSession(sessionId: string): Promise<SessionState | null> {
|
|
826
826
|
const sessionPath = path.join(
|
|
827
827
|
this.config.persistencePath,
|
|
828
|
-
`${sessionId}.json
|
|
828
|
+
`${sessionId}.json`
|
|
829
829
|
);
|
|
830
830
|
|
|
831
831
|
if (await fs.pathExists(sessionPath)) {
|
|
@@ -888,7 +888,7 @@ return undefined;
|
|
|
888
888
|
? {
|
|
889
889
|
...data.projectContext.lastAnalysis,
|
|
890
890
|
timestamp: new Date(
|
|
891
|
-
data.projectContext.lastAnalysis.timestamp
|
|
891
|
+
data.projectContext.lastAnalysis.timestamp
|
|
892
892
|
),
|
|
893
893
|
}
|
|
894
894
|
: undefined,
|
|
@@ -898,12 +898,12 @@ return undefined;
|
|
|
898
898
|
}
|
|
899
899
|
|
|
900
900
|
private async loadWorkspace(
|
|
901
|
-
workspacePath: string
|
|
901
|
+
workspacePath: string
|
|
902
902
|
): Promise<WorkspaceConfig | null> {
|
|
903
903
|
const workspacesDir = path.join(this.config.persistencePath, 'workspaces');
|
|
904
904
|
const workspaceFile = path.join(
|
|
905
905
|
workspacesDir,
|
|
906
|
-
`${Buffer.from(workspacePath).toString('base64')}.json
|
|
906
|
+
`${Buffer.from(workspacePath).toString('base64')}.json`
|
|
907
907
|
);
|
|
908
908
|
|
|
909
909
|
if (await fs.pathExists(workspaceFile)) {
|
|
@@ -923,7 +923,7 @@ return undefined;
|
|
|
923
923
|
const workspacesDir = path.join(this.config.persistencePath, 'workspaces');
|
|
924
924
|
const workspaceFile = path.join(
|
|
925
925
|
workspacesDir,
|
|
926
|
-
`${Buffer.from(workspace.path).toString('base64')}.json
|
|
926
|
+
`${Buffer.from(workspace.path).toString('base64')}.json`
|
|
927
927
|
);
|
|
928
928
|
|
|
929
929
|
await fs.ensureDir(workspacesDir);
|
|
@@ -933,7 +933,7 @@ return undefined;
|
|
|
933
933
|
...workspace,
|
|
934
934
|
lastAccessed: workspace.lastAccessed.toISOString(),
|
|
935
935
|
},
|
|
936
|
-
{ spaces: 2 }
|
|
936
|
+
{ spaces: 2 }
|
|
937
937
|
);
|
|
938
938
|
}
|
|
939
939
|
|