polydev-ai 1.4.5 → 1.5.0
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/README.md +2 -0
- package/lib/cliManager.js +138 -1
- package/lib/statusReporter.js +516 -0
- package/mcp/manifest.json +92 -0
- package/mcp/server.js +184 -0
- package/package.json +3 -3
- package/lib/cliManager.ts +0 -755
- package/lib/smartCliCache.ts +0 -189
- package/lib/universalMemoryExtractor.js +0 -607
- package/lib/zeroKnowledgeEncryption.js +0 -289
- package/mcp/cliManager.js +0 -715
- package/mcp/package.json +0 -47
package/mcp/manifest.json
CHANGED
|
@@ -442,6 +442,98 @@
|
|
|
442
442
|
}
|
|
443
443
|
]
|
|
444
444
|
},
|
|
445
|
+
{
|
|
446
|
+
"name": "enable_status_reporting",
|
|
447
|
+
"description": "Enable automatic CLI status reporting to polydev.ai server. Reports are sent when CLI detection runs and via periodic heartbeat. Requires a Polydev user token.",
|
|
448
|
+
"inputSchema": {
|
|
449
|
+
"type": "object",
|
|
450
|
+
"properties": {
|
|
451
|
+
"user_token": {
|
|
452
|
+
"type": "string",
|
|
453
|
+
"description": "Polydev user token (pd_xxx or polydev_xxx). Can also be set via POLYDEV_USER_TOKEN env var.",
|
|
454
|
+
"minLength": 1
|
|
455
|
+
},
|
|
456
|
+
"heartbeat_interval_minutes": {
|
|
457
|
+
"type": "integer",
|
|
458
|
+
"description": "How often to send status updates (in minutes)",
|
|
459
|
+
"minimum": 5,
|
|
460
|
+
"maximum": 1440,
|
|
461
|
+
"default": 15
|
|
462
|
+
},
|
|
463
|
+
"start_heartbeat": {
|
|
464
|
+
"type": "boolean",
|
|
465
|
+
"description": "Whether to start automatic heartbeat immediately",
|
|
466
|
+
"default": true
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
"outputSchema": {
|
|
471
|
+
"type": "object",
|
|
472
|
+
"properties": {
|
|
473
|
+
"success": { "type": "boolean" },
|
|
474
|
+
"message": { "type": "string" },
|
|
475
|
+
"heartbeat_enabled": { "type": "boolean" },
|
|
476
|
+
"heartbeat_interval_minutes": { "type": "integer" },
|
|
477
|
+
"initial_status": { "type": "object" },
|
|
478
|
+
"timestamp": { "type": "string" }
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"name": "disable_status_reporting",
|
|
484
|
+
"description": "Disable automatic CLI status reporting to polydev.ai server. Stops heartbeat and disables reporting.",
|
|
485
|
+
"inputSchema": {
|
|
486
|
+
"type": "object",
|
|
487
|
+
"properties": {}
|
|
488
|
+
},
|
|
489
|
+
"outputSchema": {
|
|
490
|
+
"type": "object",
|
|
491
|
+
"properties": {
|
|
492
|
+
"success": { "type": "boolean" },
|
|
493
|
+
"message": { "type": "string" },
|
|
494
|
+
"timestamp": { "type": "string" }
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"name": "get_status_reporting_info",
|
|
500
|
+
"description": "Get current status reporting configuration and history. Shows whether reporting is enabled, heartbeat status, and recent report history.",
|
|
501
|
+
"inputSchema": {
|
|
502
|
+
"type": "object",
|
|
503
|
+
"properties": {}
|
|
504
|
+
},
|
|
505
|
+
"outputSchema": {
|
|
506
|
+
"type": "object",
|
|
507
|
+
"properties": {
|
|
508
|
+
"success": { "type": "boolean" },
|
|
509
|
+
"available": { "type": "boolean" },
|
|
510
|
+
"config": {
|
|
511
|
+
"type": "object",
|
|
512
|
+
"properties": {
|
|
513
|
+
"serverUrl": { "type": "string" },
|
|
514
|
+
"reportingEnabled": { "type": "boolean" },
|
|
515
|
+
"heartbeatRunning": { "type": "boolean" },
|
|
516
|
+
"heartbeatIntervalMs": { "type": "integer" },
|
|
517
|
+
"isOnline": { "type": "boolean" },
|
|
518
|
+
"pendingReportsCount": { "type": "integer" }
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
"history": {
|
|
522
|
+
"type": "array",
|
|
523
|
+
"items": {
|
|
524
|
+
"type": "object",
|
|
525
|
+
"properties": {
|
|
526
|
+
"provider": { "type": "string" },
|
|
527
|
+
"status": { "type": "string" },
|
|
528
|
+
"success": { "type": "boolean" },
|
|
529
|
+
"timestamp": { "type": "string" }
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
"timestamp": { "type": "string" }
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
},
|
|
445
537
|
{
|
|
446
538
|
"name": "detect_memory_sources",
|
|
447
539
|
"description": "Detect all available memory sources across CLI tools (Claude Code, Cline, Codex, Cursor, Continue, Aider). Returns file paths for global memory, project memory, and recent conversations.",
|
package/mcp/server.js
CHANGED
|
@@ -161,6 +161,18 @@ class MCPServer {
|
|
|
161
161
|
result = await this.sendCliPrompt(args);
|
|
162
162
|
break;
|
|
163
163
|
|
|
164
|
+
case 'enable_status_reporting':
|
|
165
|
+
result = await this.enableStatusReporting(args);
|
|
166
|
+
break;
|
|
167
|
+
|
|
168
|
+
case 'disable_status_reporting':
|
|
169
|
+
result = await this.disableStatusReporting(args);
|
|
170
|
+
break;
|
|
171
|
+
|
|
172
|
+
case 'get_status_reporting_info':
|
|
173
|
+
result = await this.getStatusReportingInfo(args);
|
|
174
|
+
break;
|
|
175
|
+
|
|
164
176
|
case 'detect_memory_sources':
|
|
165
177
|
result = await this.detectMemorySources(args);
|
|
166
178
|
break;
|
|
@@ -330,6 +342,11 @@ class MCPServer {
|
|
|
330
342
|
case 'send_cli_prompt':
|
|
331
343
|
return this.formatCliPromptResponse(result);
|
|
332
344
|
|
|
345
|
+
case 'enable_status_reporting':
|
|
346
|
+
case 'disable_status_reporting':
|
|
347
|
+
case 'get_status_reporting_info':
|
|
348
|
+
return this.formatStatusReportingResponse(result);
|
|
349
|
+
|
|
333
350
|
case 'detect_memory_sources':
|
|
334
351
|
case 'extract_memory':
|
|
335
352
|
case 'get_recent_conversations':
|
|
@@ -622,6 +639,173 @@ class MCPServer {
|
|
|
622
639
|
}
|
|
623
640
|
}
|
|
624
641
|
|
|
642
|
+
// ============================================
|
|
643
|
+
// Status Reporting Methods
|
|
644
|
+
// ============================================
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Enable status reporting to polydev.ai server
|
|
648
|
+
*/
|
|
649
|
+
async enableStatusReporting(args) {
|
|
650
|
+
console.log('[MCP Server] Enable status reporting requested');
|
|
651
|
+
|
|
652
|
+
try {
|
|
653
|
+
const { user_token, heartbeat_interval_minutes = 15, start_heartbeat = true } = args;
|
|
654
|
+
|
|
655
|
+
const token = user_token || process.env.POLYDEV_USER_TOKEN;
|
|
656
|
+
|
|
657
|
+
if (!token) {
|
|
658
|
+
return {
|
|
659
|
+
success: false,
|
|
660
|
+
error: 'user_token is required. Either pass it as an argument or set POLYDEV_USER_TOKEN environment variable.',
|
|
661
|
+
timestamp: new Date().toISOString()
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
// Enable status reporting on CLI manager
|
|
666
|
+
const enabled = this.cliManager.enableStatusReporting(token, {
|
|
667
|
+
heartbeatIntervalMs: heartbeat_interval_minutes * 60 * 1000
|
|
668
|
+
});
|
|
669
|
+
|
|
670
|
+
if (!enabled) {
|
|
671
|
+
return {
|
|
672
|
+
success: false,
|
|
673
|
+
error: 'StatusReporter is not available. Make sure the polydev-ai package is up to date.',
|
|
674
|
+
timestamp: new Date().toISOString()
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// Start heartbeat if requested
|
|
679
|
+
if (start_heartbeat) {
|
|
680
|
+
this.cliManager.startStatusHeartbeat();
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
// Trigger initial status report
|
|
684
|
+
const statuses = await this.cliManager.forceCliDetection();
|
|
685
|
+
|
|
686
|
+
return {
|
|
687
|
+
success: true,
|
|
688
|
+
message: 'Status reporting enabled successfully',
|
|
689
|
+
heartbeat_enabled: start_heartbeat,
|
|
690
|
+
heartbeat_interval_minutes,
|
|
691
|
+
initial_status: statuses,
|
|
692
|
+
timestamp: new Date().toISOString()
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
} catch (error) {
|
|
696
|
+
console.error('[MCP Server] Enable status reporting error:', error);
|
|
697
|
+
return {
|
|
698
|
+
success: false,
|
|
699
|
+
error: error.message,
|
|
700
|
+
timestamp: new Date().toISOString()
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Disable status reporting
|
|
707
|
+
*/
|
|
708
|
+
async disableStatusReporting(args) {
|
|
709
|
+
console.log('[MCP Server] Disable status reporting requested');
|
|
710
|
+
|
|
711
|
+
try {
|
|
712
|
+
this.cliManager.disableStatusReporting();
|
|
713
|
+
|
|
714
|
+
return {
|
|
715
|
+
success: true,
|
|
716
|
+
message: 'Status reporting disabled',
|
|
717
|
+
timestamp: new Date().toISOString()
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
} catch (error) {
|
|
721
|
+
console.error('[MCP Server] Disable status reporting error:', error);
|
|
722
|
+
return {
|
|
723
|
+
success: false,
|
|
724
|
+
error: error.message,
|
|
725
|
+
timestamp: new Date().toISOString()
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* Get status reporting configuration and history
|
|
732
|
+
*/
|
|
733
|
+
async getStatusReportingInfo(args) {
|
|
734
|
+
console.log('[MCP Server] Get status reporting info requested');
|
|
735
|
+
|
|
736
|
+
try {
|
|
737
|
+
const info = this.cliManager.getStatusReportingInfo();
|
|
738
|
+
|
|
739
|
+
return {
|
|
740
|
+
success: true,
|
|
741
|
+
...info,
|
|
742
|
+
timestamp: new Date().toISOString()
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
} catch (error) {
|
|
746
|
+
console.error('[MCP Server] Get status reporting info error:', error);
|
|
747
|
+
return {
|
|
748
|
+
success: false,
|
|
749
|
+
error: error.message,
|
|
750
|
+
timestamp: new Date().toISOString()
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Format status reporting responses
|
|
757
|
+
*/
|
|
758
|
+
formatStatusReportingResponse(result) {
|
|
759
|
+
if (!result.success) {
|
|
760
|
+
return `❌ Status Reporting Error: ${result.error}`;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
let formatted = `# Status Reporting\n\n`;
|
|
764
|
+
formatted += `✅ ${result.message || 'Operation completed'}\n`;
|
|
765
|
+
formatted += `⏰ ${result.timestamp}\n\n`;
|
|
766
|
+
|
|
767
|
+
if (result.config) {
|
|
768
|
+
formatted += `## Configuration\n`;
|
|
769
|
+
formatted += `- **Server URL**: ${result.config.serverUrl}\n`;
|
|
770
|
+
formatted += `- **Reporting Enabled**: ${result.config.reportingEnabled ? '✅' : '❌'}\n`;
|
|
771
|
+
formatted += `- **Heartbeat Running**: ${result.config.heartbeatRunning ? '✅' : '❌'}\n`;
|
|
772
|
+
formatted += `- **Heartbeat Interval**: ${Math.round(result.config.heartbeatIntervalMs / 60000)} minutes\n`;
|
|
773
|
+
formatted += `- **Online**: ${result.config.isOnline ? '✅' : '❌'}\n`;
|
|
774
|
+
formatted += `- **Pending Reports**: ${result.config.pendingReportsCount}\n\n`;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
if (result.initial_status) {
|
|
778
|
+
formatted += `## Initial CLI Status\n`;
|
|
779
|
+
Object.entries(result.initial_status).forEach(([provider, status]) => {
|
|
780
|
+
const icon = status.available && status.authenticated ? '🟢' :
|
|
781
|
+
status.available ? '🟡' : '🔴';
|
|
782
|
+
formatted += `${icon} **${provider}**: ${status.available ? 'Available' : 'Not Available'}`;
|
|
783
|
+
if (status.authenticated) formatted += ' (Authenticated)';
|
|
784
|
+
formatted += `\n`;
|
|
785
|
+
});
|
|
786
|
+
formatted += `\n`;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
if (result.history && result.history.length > 0) {
|
|
790
|
+
formatted += `## Recent Report History\n`;
|
|
791
|
+
const recentHistory = result.history.slice(-5);
|
|
792
|
+
recentHistory.forEach(entry => {
|
|
793
|
+
const icon = entry.success ? '✅' : '❌';
|
|
794
|
+
formatted += `${icon} ${entry.provider}: ${entry.status} at ${entry.timestamp}\n`;
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
if (result.heartbeat_enabled !== undefined) {
|
|
799
|
+
formatted += `\n## Heartbeat\n`;
|
|
800
|
+
formatted += `- **Enabled**: ${result.heartbeat_enabled ? '✅' : '❌'}\n`;
|
|
801
|
+
if (result.heartbeat_interval_minutes) {
|
|
802
|
+
formatted += `- **Interval**: Every ${result.heartbeat_interval_minutes} minutes\n`;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
return formatted;
|
|
807
|
+
}
|
|
808
|
+
|
|
625
809
|
/**
|
|
626
810
|
* Detect available memory sources across CLI tools
|
|
627
811
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polydev-ai",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Agentic workflow assistant with CLI integration - get diverse perspectives from multiple LLMs when stuck or need enhanced reasoning",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"LICENSE"
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
|
-
"dev": "
|
|
30
|
+
"dev": "next dev",
|
|
31
31
|
"build": "next build",
|
|
32
|
-
"start": "
|
|
32
|
+
"start": "next start",
|
|
33
33
|
"lint": "next lint",
|
|
34
34
|
"test": "jest",
|
|
35
35
|
"test:watch": "jest --watch",
|