stigmergy 1.3.16-beta.2 ā 1.3.17-beta.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/package.json +1 -1
- package/src/cli/commands/autoinstall.js +43 -10
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
const chalk = require('chalk');
|
|
7
7
|
const { handleInstallCommand } = require('./install');
|
|
8
|
+
const { handleDeployCommand } = require('./project');
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Handle auto-install command - Automated installation for npm postinstall
|
|
@@ -20,7 +21,7 @@ async function handleAutoInstallCommand(options = {}) {
|
|
|
20
21
|
|
|
21
22
|
criticalLog(chalk.cyan('š STIGMERGY CLI AUTO-INSTALL STARTING'));
|
|
22
23
|
criticalLog('='.repeat(60));
|
|
23
|
-
criticalLog('Installing
|
|
24
|
+
criticalLog('Installing CLI tools and deploying hooks (including ResumeSession)...');
|
|
24
25
|
criticalLog('='.repeat(60));
|
|
25
26
|
|
|
26
27
|
console.log(chalk.blue('[AUTO-INSTALL] Stigmergy CLI automated setup'));
|
|
@@ -29,7 +30,7 @@ async function handleAutoInstallCommand(options = {}) {
|
|
|
29
30
|
// Check if we're in npm postinstall environment
|
|
30
31
|
if (isNpmPostinstall) {
|
|
31
32
|
console.log(chalk.yellow('š¦ Detected npm postinstall environment'));
|
|
32
|
-
console.log(chalk.gray('Setting up CLI integrations automatically...'));
|
|
33
|
+
console.log(chalk.gray('Setting up CLI integrations and hooks automatically...'));
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
// Auto-install options - non-interactive mode
|
|
@@ -44,17 +45,16 @@ async function handleAutoInstallCommand(options = {}) {
|
|
|
44
45
|
|
|
45
46
|
console.log(chalk.blue('š Scanning for available CLI tools...'));
|
|
46
47
|
|
|
47
|
-
//
|
|
48
|
-
console.log(chalk.blue('š ļø
|
|
48
|
+
// Step 1: Install CLI tools
|
|
49
|
+
console.log(chalk.blue('š ļø Step 1/2: Installing CLI tools...'));
|
|
49
50
|
|
|
50
51
|
const installResult = await handleInstallCommand(autoInstallOptions);
|
|
51
52
|
|
|
52
53
|
if (installResult.success) {
|
|
53
|
-
console.log(chalk.green('\nā
|
|
54
|
+
console.log(chalk.green('\nā
CLI tools installed successfully!'));
|
|
54
55
|
|
|
55
56
|
if (isNpmPostinstall) {
|
|
56
|
-
criticalLog(chalk.green('ā
|
|
57
|
-
criticalLog(chalk.gray('You can now use: stigmergy <tool> <command>'));
|
|
57
|
+
criticalLog(chalk.green('ā
CLI TOOLS INSTALLED'));
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// Show summary of what was installed
|
|
@@ -79,12 +79,37 @@ async function handleAutoInstallCommand(options = {}) {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
// Step 2: Deploy hooks and ResumeSession
|
|
83
|
+
console.log(chalk.blue('\nš Step 2/2: Deploying hooks and ResumeSession integration...'));
|
|
84
|
+
|
|
85
|
+
try {
|
|
86
|
+
const deployResult = await handleDeployCommand({
|
|
87
|
+
verbose: options.verbose || process.env.DEBUG === 'true',
|
|
88
|
+
force: options.force || false
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
if (deployResult.success) {
|
|
92
|
+
console.log(chalk.green('\nā
Hooks and ResumeSession deployed successfully!'));
|
|
93
|
+
|
|
94
|
+
if (isNpmPostinstall) {
|
|
95
|
+
criticalLog(chalk.green('ā
HOOKS AND RESUMESESSION DEPLOYED'));
|
|
96
|
+
criticalLog(chalk.green('ā
/stigmergy-resume command is now available in all CLIs'));
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
console.log(chalk.yellow('\nā ļø Hook deployment encountered issues'));
|
|
100
|
+
console.log(chalk.yellow('Run: stigmergy deploy --verbose for details'));
|
|
101
|
+
}
|
|
102
|
+
} catch (deployError) {
|
|
103
|
+
console.log(chalk.red(`\nā Hook deployment failed: ${deployError.message}`));
|
|
104
|
+
console.log(chalk.yellow('Run: stigmergy deploy manually to complete setup'));
|
|
105
|
+
}
|
|
106
|
+
|
|
82
107
|
} else {
|
|
83
108
|
console.log(chalk.red('\nā Auto-install encountered issues'));
|
|
84
109
|
|
|
85
110
|
if (isNpmPostinstall) {
|
|
86
111
|
criticalLog(chalk.red('ā STIGMERGY CLI SETUP INCOMPLETE'));
|
|
87
|
-
criticalLog(chalk.yellow('Run: stigmergy install to complete setup manually'));
|
|
112
|
+
criticalLog(chalk.yellow('Run: stigmergy install && stigmergy deploy to complete setup manually'));
|
|
88
113
|
}
|
|
89
114
|
|
|
90
115
|
if (installResult.error) {
|
|
@@ -99,7 +124,9 @@ async function handleAutoInstallCommand(options = {}) {
|
|
|
99
124
|
const verificationChecks = [
|
|
100
125
|
{ name: 'Core modules accessible', check: () => require('../utils/formatters') && require('../utils/environment') },
|
|
101
126
|
{ name: 'Error handler available', check: () => require('../../core/error_handler') },
|
|
102
|
-
{ name: 'Smart router available', check: () => require('../../core/smart_router') }
|
|
127
|
+
{ name: 'Smart router available', check: () => require('../../core/smart_router') },
|
|
128
|
+
{ name: 'Hook deployment manager', check: () => require('../../core/coordination/nodejs/HookDeploymentManager') },
|
|
129
|
+
{ name: 'ResumeSession generator', check: () => require('../../core/coordination/nodejs/generators/ResumeSessionGenerator') }
|
|
103
130
|
];
|
|
104
131
|
|
|
105
132
|
let verificationPassed = 0;
|
|
@@ -118,6 +145,7 @@ async function handleAutoInstallCommand(options = {}) {
|
|
|
118
145
|
|
|
119
146
|
if (isNpmPostinstall) {
|
|
120
147
|
criticalLog(chalk.green('š STIGMERGY CLI IS READY TO USE!'));
|
|
148
|
+
criticalLog(chalk.green('šÆ All CLI tools configured with ResumeSession support'));
|
|
121
149
|
}
|
|
122
150
|
} else {
|
|
123
151
|
console.log(chalk.yellow('\nā ļø Some verification checks failed'));
|
|
@@ -129,6 +157,11 @@ async function handleAutoInstallCommand(options = {}) {
|
|
|
129
157
|
criticalLog('='.repeat(60));
|
|
130
158
|
criticalLog(chalk.cyan('šÆ STIGMERGY CLI AUTO-INSTALL FINISHED'));
|
|
131
159
|
criticalLog('='.repeat(60));
|
|
160
|
+
criticalLog(chalk.green('ā
All CLI tools installed and configured'));
|
|
161
|
+
criticalLog(chalk.green('ā
Hooks deployed for all CLIs'));
|
|
162
|
+
criticalLog(chalk.green('ā
ResumeSession integration enabled'));
|
|
163
|
+
criticalLog(chalk.cyan('š Usage: /stigmergy-resume in any CLI'));
|
|
164
|
+
criticalLog('='.repeat(60));
|
|
132
165
|
}
|
|
133
166
|
|
|
134
167
|
return {
|
|
@@ -146,7 +179,7 @@ async function handleAutoInstallCommand(options = {}) {
|
|
|
146
179
|
|
|
147
180
|
if (isNpmPostinstall) {
|
|
148
181
|
criticalLog(chalk.red('š„ AUTO-INSTALL FAILED'));
|
|
149
|
-
criticalLog(chalk.yellow('Run: stigmergy install --verbose
|
|
182
|
+
criticalLog(chalk.yellow('Run: stigmergy install --verbose && stigmergy deploy --verbose'));
|
|
150
183
|
}
|
|
151
184
|
|
|
152
185
|
return { success: false, error: error.message };
|