stigmergy 1.3.2-beta.4 → 1.3.2-beta.6
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/package.json
CHANGED
package/src/core/cli_tools.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const os = require('os');
|
|
3
|
+
const { spawnSync } = require('child_process');
|
|
3
4
|
const { errorHandler, ERROR_TYPES } = require('./error_handler');
|
|
4
5
|
const CLIPathDetector = require('./cli_path_detector');
|
|
5
|
-
const StigmergyInstaller = require('./installer');
|
|
6
6
|
|
|
7
7
|
// AI CLI Tools Configuration
|
|
8
8
|
const CLI_TOOLS = {
|
|
@@ -341,21 +341,33 @@ async function setupCLIPaths() {
|
|
|
341
341
|
// 3. Check and update PATH if needed
|
|
342
342
|
const pathStatus = await detector.updatePATHIfMissing();
|
|
343
343
|
|
|
344
|
-
// 4. Create an enhanced report
|
|
345
|
-
const installer = new StigmergyInstaller();
|
|
346
|
-
const scanResult = await installer.scanCLI();
|
|
347
|
-
|
|
344
|
+
// 4. Create an enhanced report that checks if tools are actually executable
|
|
348
345
|
const enhancedReport = {
|
|
349
346
|
platform: detector.platform,
|
|
350
347
|
npmGlobalPaths: detector.npmGlobalPaths,
|
|
351
348
|
detectedPaths: detector.detectedPaths,
|
|
352
349
|
summary: {
|
|
353
350
|
total: Object.keys(detector.cliNameMap).length,
|
|
354
|
-
found:
|
|
355
|
-
missing:
|
|
351
|
+
found: 0, // Will be calculated below
|
|
352
|
+
missing: 0 // Will be calculated below
|
|
356
353
|
}
|
|
357
354
|
};
|
|
358
355
|
|
|
356
|
+
// Count actually executable tools
|
|
357
|
+
let executableCount = 0;
|
|
358
|
+
for (const [toolName, toolPath] of Object.entries(detectedPaths)) {
|
|
359
|
+
if (toolPath) {
|
|
360
|
+
// Check if the CLI is actually executable
|
|
361
|
+
const isExecutable = await checkIfCLIExecutable(toolName);
|
|
362
|
+
if (isExecutable) {
|
|
363
|
+
executableCount++;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
enhancedReport.summary.found = executableCount;
|
|
369
|
+
enhancedReport.summary.missing = Object.keys(detector.cliNameMap).length - executableCount;
|
|
370
|
+
|
|
359
371
|
return {
|
|
360
372
|
detectedPaths,
|
|
361
373
|
pathStatus,
|
|
@@ -554,26 +566,35 @@ async function checkIfCLIExecutable(toolName) {
|
|
|
554
566
|
* @returns {Promise<Object>} Scan results
|
|
555
567
|
*/
|
|
556
568
|
async function scanForTools(options = {}) {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
569
|
+
const detector = getPathDetector();
|
|
570
|
+
|
|
571
|
+
// Load cached paths first
|
|
572
|
+
await detector.loadDetectedPaths();
|
|
573
|
+
|
|
574
|
+
// Detect all CLI paths
|
|
575
|
+
const detectedPaths = await detector.detectAllCLIPaths();
|
|
560
576
|
|
|
561
577
|
const found = [];
|
|
562
578
|
const missing = [];
|
|
563
579
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
580
|
+
for (const [toolName, toolPath] of Object.entries(detectedPaths)) {
|
|
581
|
+
if (toolPath) {
|
|
582
|
+
// Additional check: verify the CLI is actually executable
|
|
583
|
+
const isExecutable = await checkIfCLIExecutable(toolName);
|
|
584
|
+
if (isExecutable) {
|
|
585
|
+
found.push({
|
|
586
|
+
name: toolName,
|
|
587
|
+
path: toolPath,
|
|
588
|
+
type: 'cli',
|
|
589
|
+
status: 'installed',
|
|
590
|
+
description: CLI_TOOLS[toolName]?.name || toolName
|
|
591
|
+
});
|
|
592
|
+
} else {
|
|
593
|
+
missing.push(toolName);
|
|
594
|
+
}
|
|
595
|
+
} else {
|
|
596
|
+
missing.push(toolName);
|
|
597
|
+
}
|
|
577
598
|
}
|
|
578
599
|
|
|
579
600
|
return {
|
|
@@ -591,25 +612,21 @@ async function scanForTools(options = {}) {
|
|
|
591
612
|
async function checkInstallation(toolName) {
|
|
592
613
|
validateCLITool(toolName);
|
|
593
614
|
|
|
594
|
-
//
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
// If the tool is available, try to get its path and version
|
|
599
|
-
let toolPath = null;
|
|
600
|
-
let version = null;
|
|
615
|
+
// Get path using the detector
|
|
616
|
+
const detector = getPathDetector();
|
|
617
|
+
await detector.loadDetectedPaths();
|
|
618
|
+
let toolPath = detector.getDetectedPath(toolName);
|
|
601
619
|
|
|
602
|
-
if (
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
await detector.loadDetectedPaths();
|
|
606
|
-
toolPath = detector.getDetectedPath(toolName);
|
|
620
|
+
if (!toolPath) {
|
|
621
|
+
toolPath = await detector.detectCLIPath(toolName);
|
|
622
|
+
}
|
|
607
623
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
624
|
+
// Check if the tool is actually executable, not just if the path exists
|
|
625
|
+
const isExecutable = await checkIfCLIExecutable(toolName);
|
|
626
|
+
const installed = !!toolPath && isExecutable;
|
|
611
627
|
|
|
612
|
-
|
|
628
|
+
let version = null;
|
|
629
|
+
if (installed) {
|
|
613
630
|
try {
|
|
614
631
|
const { spawnSync } = require('child_process');
|
|
615
632
|
const toolConfig = CLI_TOOLS[toolName];
|
|
@@ -630,7 +647,7 @@ async function checkInstallation(toolName) {
|
|
|
630
647
|
}
|
|
631
648
|
|
|
632
649
|
return {
|
|
633
|
-
installed
|
|
650
|
+
installed,
|
|
634
651
|
path: toolPath,
|
|
635
652
|
version,
|
|
636
653
|
lastChecked: new Date().toISOString()
|
|
@@ -20,7 +20,8 @@ class HookDeploymentManager {
|
|
|
20
20
|
'codebuddy',
|
|
21
21
|
'codex',
|
|
22
22
|
'copilot',
|
|
23
|
-
'kode'
|
|
23
|
+
'kode'
|
|
24
|
+
// Note: 'resumesession' is handled separately as a session recovery tool, not a regular CLI
|
|
24
25
|
];
|
|
25
26
|
|
|
26
27
|
// Initialize generators
|
|
@@ -46,6 +47,12 @@ class HookDeploymentManager {
|
|
|
46
47
|
async deployHooksForCLI(cliName, options = {}) {
|
|
47
48
|
console.log(`[HOOK_DEPLOYMENT] Deploying hooks for ${cliName}...`);
|
|
48
49
|
|
|
50
|
+
// Skip resumesession as it's a session recovery tool, not a regular CLI tool
|
|
51
|
+
if (cliName.toLowerCase() === 'resumesession') {
|
|
52
|
+
console.log(`[HOOK_DEPLOYMENT] Skipping hooks deployment for ${cliName} (session recovery tool)`);
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
|
|
49
56
|
if (!this.supportedCLIs.includes(cliName.toLowerCase())) {
|
|
50
57
|
throw new Error(`Unsupported CLI: ${cliName}`);
|
|
51
58
|
}
|
|
@@ -7,7 +7,7 @@ class ResumeSessionGenerator {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
this.supportedCLIs = [
|
|
9
9
|
'claude', 'gemini', 'qwen', 'codebuddy', 'codex',
|
|
10
|
-
'iflow', 'qodercli', 'copilot', 'kode'
|
|
10
|
+
'iflow', 'qodercli', 'copilot', 'kode', 'resumesession'
|
|
11
11
|
];
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -691,6 +691,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
|
691
691
|
case 'codebuddy':
|
|
692
692
|
case 'codex':
|
|
693
693
|
case 'kode':
|
|
694
|
+
case 'resumesession':
|
|
694
695
|
return 'resumesession-history.js';
|
|
695
696
|
case 'qodercli':
|
|
696
697
|
return 'history.js';
|