snow-flow 8.37.27 โ 8.38.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/.snow-code/agent/deployment-specialist.md +346 -0
- package/.snow-code/agent/orchestrator.md +286 -0
- package/.snow-code/agent/risk-assessor.md +454 -0
- package/.snow-code/agent/solution-architect.md +582 -0
- package/.snow-code/agent/validator.md +503 -0
- package/.snow-code/opencode.json +49 -0
- package/README.md +16 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +93 -256
- package/dist/cli.js.map +1 -1
- package/dist/utils/sync-mcp-configs.d.ts +7 -5
- package/dist/utils/sync-mcp-configs.d.ts.map +1 -1
- package/dist/utils/sync-mcp-configs.js +19 -74
- package/dist/utils/sync-mcp-configs.js.map +1 -1
- package/package.json +2 -3
- package/scripts/check-binary-updates.js +0 -169
- package/scripts/check-npm-version.js +0 -92
- package/scripts/classify-all-tools.ts +0 -446
- package/scripts/classify-edge-cases.ts +0 -275
- package/scripts/classify-operations-tools.sh +0 -96
- package/scripts/cleanup-mcp-servers.js +0 -115
- package/scripts/diagnose-mcp.js +0 -299
- package/scripts/generate-mcp-config.js +0 -45
- package/scripts/mcp-server-manager.sh +0 -320
- package/scripts/postinstall.js +0 -75
- package/scripts/reset-mcp-servers.js +0 -266
- package/scripts/safe-mcp-cleanup.js +0 -151
- package/scripts/setup-mcp.js +0 -106
- package/scripts/start-mcp-proper.js +0 -76
- package/scripts/start-snowcode.sh +0 -123
- package/scripts/start-sysprops-mcp.js +0 -43
- package/scripts/sync-snow-code-version.js +0 -74
- package/scripts/test-auth-flow.js +0 -172
- package/scripts/test-auth-location-fix.js +0 -84
- package/scripts/test-mcp-manual.js +0 -140
- package/scripts/test-todowrite-timeout.js +0 -108
- package/scripts/update-dependencies.js +0 -90
- package/scripts/update-mcp-config.js +0 -96
- package/scripts/update-snow-code.js +0 -146
- package/scripts/verify-snowcode-fork.sh +0 -141
- package/templates/snow-code-package.json +0 -3
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Test TodoWrite timeout fix
|
|
5
|
-
* Verifies that memory operations no longer timeout after 5 seconds
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const { spawn } = require('child_process');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
console.log('๐งช Testing TodoWrite timeout configuration...\n');
|
|
12
|
-
console.log('โฑ๏ธ Previous timeout: 5 seconds (causing failures)');
|
|
13
|
-
console.log('โ
New default: NO TIMEOUT (operations run until completion)');
|
|
14
|
-
console.log('๐๏ธ Optional: Set MCP_MEMORY_TIMEOUT if you want timeouts\n');
|
|
15
|
-
|
|
16
|
-
// Test data for TodoWrite
|
|
17
|
-
const testTodos = [
|
|
18
|
-
{ id: '1', content: 'Test todo 1', status: 'pending' },
|
|
19
|
-
{ id: '2', content: 'Test todo 2', status: 'pending' },
|
|
20
|
-
{ id: '3', content: 'Test todo 3', status: 'pending' },
|
|
21
|
-
{ id: '4', content: 'Test todo 4', status: 'pending' },
|
|
22
|
-
{ id: '5', content: 'Test todo 5', status: 'pending' }
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
async function testMemoryOperation() {
|
|
26
|
-
return new Promise((resolve, reject) => {
|
|
27
|
-
const startTime = Date.now();
|
|
28
|
-
|
|
29
|
-
// Run MCP server in test mode
|
|
30
|
-
const mcpProcess = spawn('node', [
|
|
31
|
-
path.join(__dirname, '..', 'dist', 'mcp', 'snow-flow-mcp.js')
|
|
32
|
-
], {
|
|
33
|
-
env: {
|
|
34
|
-
...process.env,
|
|
35
|
-
// No timeout by default - operations run until completion
|
|
36
|
-
// MCP_MEMORY_TIMEOUT: '30000', // Uncomment to test with timeout
|
|
37
|
-
SNOW_FLOW_DEBUG: 'true'
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
let output = '';
|
|
42
|
-
let errorOutput = '';
|
|
43
|
-
|
|
44
|
-
mcpProcess.stdout.on('data', (data) => {
|
|
45
|
-
output += data.toString();
|
|
46
|
-
process.stdout.write(`๐ ${data.toString()}`);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
mcpProcess.stderr.on('data', (data) => {
|
|
50
|
-
errorOutput += data.toString();
|
|
51
|
-
process.stderr.write(`โ ๏ธ ${data.toString()}`);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
// Simulate memory operation
|
|
55
|
-
setTimeout(() => {
|
|
56
|
-
const elapsed = Date.now() - startTime;
|
|
57
|
-
console.log(`\nโ
Memory operation completed in ${elapsed}ms`);
|
|
58
|
-
|
|
59
|
-
if (elapsed > 5000) {
|
|
60
|
-
console.log('โ
No-timeout configuration confirmed - operation exceeded 5s without failing!');
|
|
61
|
-
console.log('๐ฏ Operation ran for ' + (elapsed/1000).toFixed(1) + 's with no timeout!');
|
|
62
|
-
resolve(true);
|
|
63
|
-
} else {
|
|
64
|
-
console.log('โก Operation completed quickly (< 5s)');
|
|
65
|
-
resolve(true);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
mcpProcess.kill();
|
|
69
|
-
}, 6000); // Test at 6 seconds (would have failed before)
|
|
70
|
-
|
|
71
|
-
mcpProcess.on('error', (err) => {
|
|
72
|
-
console.error('โ Process error:', err);
|
|
73
|
-
reject(err);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
mcpProcess.on('exit', (code) => {
|
|
77
|
-
if (code !== 0 && code !== null) {
|
|
78
|
-
console.log(`Process exited with code ${code}`);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
async function runTest() {
|
|
85
|
-
console.log('๐ Starting TodoWrite timeout test...\n');
|
|
86
|
-
|
|
87
|
-
try {
|
|
88
|
-
const success = await testMemoryOperation();
|
|
89
|
-
|
|
90
|
-
if (success) {
|
|
91
|
-
console.log('\nโ
SUCCESS: No-timeout configuration is working!');
|
|
92
|
-
console.log('๐ก TodoWrite operations have NO timeout by default');
|
|
93
|
-
console.log('๐ Set MCP_MEMORY_TIMEOUT env var only if you need timeouts');
|
|
94
|
-
console.log('\nExample timeout configurations (all optional):');
|
|
95
|
-
console.log(' MCP_MEMORY_TIMEOUT=30000 # 30 seconds');
|
|
96
|
-
console.log(' MCP_MEMORY_TIMEOUT=60000 # 1 minute');
|
|
97
|
-
console.log(' MCP_MEMORY_TIMEOUT=120000 # 2 minutes');
|
|
98
|
-
} else {
|
|
99
|
-
console.log('\nโ ๏ธ Test completed but results inconclusive');
|
|
100
|
-
}
|
|
101
|
-
} catch (error) {
|
|
102
|
-
console.error('\nโ Test failed:', error.message);
|
|
103
|
-
process.exit(1);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Run the test
|
|
108
|
-
runTest().catch(console.error);
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Update Snow-Flow and all dependencies to latest versions
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const { execSync } = require('child_process');
|
|
8
|
-
const fs = require('fs');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
console.log('๐ Updating Snow-Flow dependencies...\n');
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
// Read package.json to get required versions
|
|
15
|
-
const packageJsonPath = path.join(__dirname, '..', 'package.json');
|
|
16
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
17
|
-
|
|
18
|
-
// Update @groeimetai/snow-code
|
|
19
|
-
const snowCodeVersion = packageJson.peerDependencies['@groeimetai/snow-code'];
|
|
20
|
-
console.log(`๐ฆ Updating @groeimetai/snow-code to ${snowCodeVersion}...`);
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
execSync(`npm install @groeimetai/snow-code@${snowCodeVersion}`, {
|
|
24
|
-
stdio: 'inherit',
|
|
25
|
-
cwd: path.join(__dirname, '..')
|
|
26
|
-
});
|
|
27
|
-
console.log('โ
@groeimetai/snow-code updated\n');
|
|
28
|
-
} catch (err) {
|
|
29
|
-
console.error('โ Failed to update @groeimetai/snow-code');
|
|
30
|
-
console.error(err.message);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Clean npm cache to ensure fresh install
|
|
34
|
-
console.log('๐งน Cleaning npm cache...');
|
|
35
|
-
try {
|
|
36
|
-
execSync('npm cache clean --force', { stdio: 'inherit' });
|
|
37
|
-
console.log('โ
Cache cleaned\n');
|
|
38
|
-
} catch (err) {
|
|
39
|
-
console.log('โ ๏ธ Cache clean skipped\n');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Reinstall all dependencies
|
|
43
|
-
console.log('๐ฆ Reinstalling all dependencies...');
|
|
44
|
-
try {
|
|
45
|
-
execSync('npm install', {
|
|
46
|
-
stdio: 'inherit',
|
|
47
|
-
cwd: path.join(__dirname, '..')
|
|
48
|
-
});
|
|
49
|
-
console.log('โ
Dependencies reinstalled\n');
|
|
50
|
-
} catch (err) {
|
|
51
|
-
console.error('โ Failed to reinstall dependencies');
|
|
52
|
-
console.error(err.message);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Rebuild native modules if any
|
|
56
|
-
console.log('๐จ Rebuilding native modules...');
|
|
57
|
-
try {
|
|
58
|
-
execSync('npm rebuild', {
|
|
59
|
-
stdio: 'inherit',
|
|
60
|
-
cwd: path.join(__dirname, '..')
|
|
61
|
-
});
|
|
62
|
-
console.log('โ
Native modules rebuilt\n');
|
|
63
|
-
} catch (err) {
|
|
64
|
-
console.log('โ ๏ธ Rebuild skipped (no native modules)\n');
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Apply patches
|
|
68
|
-
console.log('๐ฉน Applying patches...');
|
|
69
|
-
try {
|
|
70
|
-
execSync('npx patch-package', {
|
|
71
|
-
stdio: 'inherit',
|
|
72
|
-
cwd: path.join(__dirname, '..')
|
|
73
|
-
});
|
|
74
|
-
console.log('โ
Patches applied\n');
|
|
75
|
-
} catch (err) {
|
|
76
|
-
console.log('โ ๏ธ No patches to apply\n');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
console.log('๐ Update complete!\n');
|
|
80
|
-
console.log('๐ก If you still experience issues, try:');
|
|
81
|
-
console.log(' 1. rm -rf node_modules package-lock.json');
|
|
82
|
-
console.log(' 2. npm install');
|
|
83
|
-
console.log(' 3. npm run update-deps\n');
|
|
84
|
-
|
|
85
|
-
} catch (error) {
|
|
86
|
-
console.error('โ Update failed:', error.message);
|
|
87
|
-
console.log('\n๐ก Try manually:');
|
|
88
|
-
console.log(' npm install @groeimetai/snow-code@latest');
|
|
89
|
-
process.exit(1);
|
|
90
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Update .mcp.json with credentials from environment variables
|
|
4
|
-
*
|
|
5
|
-
* This script reads ServiceNow credentials from .env file and updates
|
|
6
|
-
* the .mcp.json configuration to use the actual credentials instead
|
|
7
|
-
* of placeholder values.
|
|
8
|
-
*
|
|
9
|
-
* Usage: node scripts/update-mcp-config.js
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
const fs = require('fs');
|
|
13
|
-
const path = require('path');
|
|
14
|
-
|
|
15
|
-
// Load .env file if it exists
|
|
16
|
-
const envPath = path.join(process.cwd(), '.env');
|
|
17
|
-
if (fs.existsSync(envPath)) {
|
|
18
|
-
const envContent = fs.readFileSync(envPath, 'utf-8');
|
|
19
|
-
envContent.split('\n').forEach(line => {
|
|
20
|
-
const match = line.match(/^([^=]+)=(.*)$/);
|
|
21
|
-
if (match) {
|
|
22
|
-
const key = match[1].trim();
|
|
23
|
-
const value = match[2].trim().replace(/^["']|["']$/g, '');
|
|
24
|
-
if (value && !process.env[key]) {
|
|
25
|
-
process.env[key] = value;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Get credentials from environment (support both SNOW_* and SERVICENOW_* prefixes)
|
|
32
|
-
const instanceUrl = process.env.SERVICENOW_INSTANCE_URL ||
|
|
33
|
-
(process.env.SNOW_INSTANCE ? `https://${process.env.SNOW_INSTANCE}` : null);
|
|
34
|
-
const clientId = process.env.SERVICENOW_CLIENT_ID || process.env.SNOW_CLIENT_ID;
|
|
35
|
-
const clientSecret = process.env.SERVICENOW_CLIENT_SECRET || process.env.SNOW_CLIENT_SECRET;
|
|
36
|
-
|
|
37
|
-
// Check if credentials are available
|
|
38
|
-
if (!instanceUrl || !clientId || !clientSecret) {
|
|
39
|
-
console.log('โ ๏ธ Warning: ServiceNow credentials not found in environment');
|
|
40
|
-
console.log(' Please set SNOW_INSTANCE, SNOW_CLIENT_ID, and SNOW_CLIENT_SECRET in .env');
|
|
41
|
-
process.exit(0); // Exit gracefully - not an error
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Read .mcp.json
|
|
45
|
-
const mcpJsonPath = path.join(process.cwd(), '.mcp.json');
|
|
46
|
-
if (!fs.existsSync(mcpJsonPath)) {
|
|
47
|
-
console.log('โน๏ธ No .mcp.json found - using global config instead');
|
|
48
|
-
process.exit(0);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
let config;
|
|
52
|
-
try {
|
|
53
|
-
config = JSON.parse(fs.readFileSync(mcpJsonPath, 'utf-8'));
|
|
54
|
-
} catch (error) {
|
|
55
|
-
console.error('โ Failed to parse .mcp.json:', error.message);
|
|
56
|
-
process.exit(1);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Update servicenow-unified server configuration
|
|
60
|
-
if (config.mcpServers && config.mcpServers['servicenow-unified']) {
|
|
61
|
-
const server = config.mcpServers['servicenow-unified'];
|
|
62
|
-
|
|
63
|
-
// Support both "environment" (OpenCode) and "env" (Claude Desktop) keys
|
|
64
|
-
const envKey = server.environment !== undefined ? 'environment' : 'env';
|
|
65
|
-
|
|
66
|
-
if (!server[envKey]) {
|
|
67
|
-
server[envKey] = {};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Check if values are placeholders
|
|
71
|
-
const envVars = server[envKey];
|
|
72
|
-
const hasPlaceholders =
|
|
73
|
-
!envVars.SERVICENOW_INSTANCE_URL ||
|
|
74
|
-
envVars.SERVICENOW_INSTANCE_URL.includes('your-instance') ||
|
|
75
|
-
envVars.SERVICENOW_CLIENT_ID === 'your-client-id' ||
|
|
76
|
-
envVars.SERVICENOW_CLIENT_SECRET === 'your-client-secret';
|
|
77
|
-
|
|
78
|
-
if (hasPlaceholders) {
|
|
79
|
-
console.log('๐ง Updating .mcp.json with credentials from environment...');
|
|
80
|
-
|
|
81
|
-
envVars.SERVICENOW_INSTANCE_URL = instanceUrl;
|
|
82
|
-
envVars.SERVICENOW_CLIENT_ID = clientId;
|
|
83
|
-
envVars.SERVICENOW_CLIENT_SECRET = clientSecret;
|
|
84
|
-
|
|
85
|
-
// Write updated config
|
|
86
|
-
fs.writeFileSync(mcpJsonPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
87
|
-
|
|
88
|
-
console.log('โ
Updated .mcp.json successfully');
|
|
89
|
-
console.log(` Instance: ${instanceUrl}`);
|
|
90
|
-
console.log(` Client ID: ${clientId.substring(0, 8)}...`);
|
|
91
|
-
} else {
|
|
92
|
-
console.log('โ
.mcp.json already has valid credentials');
|
|
93
|
-
}
|
|
94
|
-
} else {
|
|
95
|
-
console.log('โ ๏ธ No servicenow-unified server found in .mcp.json');
|
|
96
|
-
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Shared utility to automatically update @groeimetai/snow-code
|
|
5
|
-
* Used by both postinstall and init command
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const { execSync } = require('child_process');
|
|
9
|
-
const fs = require('fs');
|
|
10
|
-
const path = require('path');
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Update @groeimetai/snow-code to LATEST version
|
|
14
|
-
* Always installs @latest to avoid npm cache issues with semver ranges
|
|
15
|
-
* @param {boolean} verbose - Show detailed progress messages
|
|
16
|
-
* @returns {Promise<{ updated: boolean, version: string, message: string }>}
|
|
17
|
-
*/
|
|
18
|
-
async function updateSnowCode(verbose = true) {
|
|
19
|
-
try {
|
|
20
|
-
// Check installed version
|
|
21
|
-
let installedVersion = null;
|
|
22
|
-
try {
|
|
23
|
-
const snowCodePackageJson = require('@groeimetai/snow-code/package.json');
|
|
24
|
-
installedVersion = snowCodePackageJson.version;
|
|
25
|
-
} catch (e) {
|
|
26
|
-
// snow-code not installed yet
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Get latest version from npm
|
|
30
|
-
const latestVersion = execSync('npm view @groeimetai/snow-code version', {
|
|
31
|
-
encoding: 'utf8'
|
|
32
|
-
}).trim();
|
|
33
|
-
|
|
34
|
-
if (!installedVersion) {
|
|
35
|
-
if (verbose) console.log('๐ฆ Installing @groeimetai/snow-code@latest...');
|
|
36
|
-
|
|
37
|
-
try {
|
|
38
|
-
execSync('npm install @groeimetai/snow-code@latest', {
|
|
39
|
-
stdio: verbose ? 'inherit' : 'ignore',
|
|
40
|
-
cwd: path.join(__dirname, '..')
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
updated: true,
|
|
45
|
-
version: latestVersion,
|
|
46
|
-
message: 'Installed successfully'
|
|
47
|
-
};
|
|
48
|
-
} catch (err) {
|
|
49
|
-
return {
|
|
50
|
-
updated: false,
|
|
51
|
-
version: null,
|
|
52
|
-
message: `Installation failed: ${err.message}`
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Check if update is needed
|
|
58
|
-
if (installedVersion !== latestVersion) {
|
|
59
|
-
if (verbose) console.log(`๐ฆ Updating @groeimetai/snow-code from v${installedVersion} to v${latestVersion}...`);
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
execSync('npm install @groeimetai/snow-code@latest', {
|
|
63
|
-
stdio: verbose ? 'inherit' : 'ignore',
|
|
64
|
-
cwd: path.join(__dirname, '..')
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
return {
|
|
68
|
-
updated: true,
|
|
69
|
-
version: latestVersion,
|
|
70
|
-
message: 'Updated successfully'
|
|
71
|
-
};
|
|
72
|
-
} catch (err) {
|
|
73
|
-
return {
|
|
74
|
-
updated: false,
|
|
75
|
-
version: installedVersion,
|
|
76
|
-
message: `Update failed: ${err.message}`
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
updated: false,
|
|
83
|
-
version: installedVersion,
|
|
84
|
-
message: 'Already up to date'
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
} catch (error) {
|
|
88
|
-
return {
|
|
89
|
-
updated: false,
|
|
90
|
-
version: null,
|
|
91
|
-
message: `Error: ${error.message}`
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Force update to latest version (used by update-deps script)
|
|
98
|
-
* @returns {Promise<{ updated: boolean, version: string, message: string }>}
|
|
99
|
-
*/
|
|
100
|
-
async function forceUpdateToLatest() {
|
|
101
|
-
try {
|
|
102
|
-
console.log('๐ฆ Fetching latest @groeimetai/snow-code version...');
|
|
103
|
-
|
|
104
|
-
const latestVersion = execSync('npm view @groeimetai/snow-code version', {
|
|
105
|
-
encoding: 'utf8'
|
|
106
|
-
}).trim();
|
|
107
|
-
|
|
108
|
-
console.log(`๐ฆ Installing @groeimetai/snow-code@${latestVersion}...`);
|
|
109
|
-
|
|
110
|
-
execSync(`npm install @groeimetai/snow-code@${latestVersion}`, {
|
|
111
|
-
stdio: 'inherit',
|
|
112
|
-
cwd: path.join(__dirname, '..')
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
return {
|
|
116
|
-
updated: true,
|
|
117
|
-
version: latestVersion,
|
|
118
|
-
message: 'Updated to latest'
|
|
119
|
-
};
|
|
120
|
-
} catch (error) {
|
|
121
|
-
return {
|
|
122
|
-
updated: false,
|
|
123
|
-
version: null,
|
|
124
|
-
message: `Failed to update: ${error.message}`
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// CLI interface when run directly
|
|
130
|
-
if (require.main === module) {
|
|
131
|
-
const force = process.argv.includes('--force');
|
|
132
|
-
|
|
133
|
-
(async () => {
|
|
134
|
-
if (force) {
|
|
135
|
-
const result = await forceUpdateToLatest();
|
|
136
|
-
console.log(result.updated ? 'โ
' : 'โ', result.message);
|
|
137
|
-
process.exit(result.updated ? 0 : 1);
|
|
138
|
-
} else {
|
|
139
|
-
const result = await updateSnowCode(true);
|
|
140
|
-
console.log(result.updated ? 'โ
' : 'โ', result.message);
|
|
141
|
-
process.exit(0);
|
|
142
|
-
}
|
|
143
|
-
})();
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
module.exports = { updateSnowCode, forceUpdateToLatest };
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Verification script for Snowcode fork integration
|
|
4
|
-
# This script verifies that Snow-Flow is using @groeimetai/snowcode-plugin instead of @opencode-ai/plugin
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
RED='\033[0;31m'
|
|
9
|
-
GREEN='\033[0;32m'
|
|
10
|
-
YELLOW='\033[1;33m'
|
|
11
|
-
BLUE='\033[0;34m'
|
|
12
|
-
NC='\033[0m' # No Color
|
|
13
|
-
|
|
14
|
-
echo -e "${BLUE}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${NC}"
|
|
15
|
-
echo -e "${BLUE} Snowcode Fork Verification${NC}"
|
|
16
|
-
echo -e "${BLUE}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${NC}"
|
|
17
|
-
echo ""
|
|
18
|
-
|
|
19
|
-
CHECKS_PASSED=0
|
|
20
|
-
CHECKS_TOTAL=0
|
|
21
|
-
|
|
22
|
-
# Function to run a check
|
|
23
|
-
check() {
|
|
24
|
-
CHECKS_TOTAL=$((CHECKS_TOTAL + 1))
|
|
25
|
-
local description="$1"
|
|
26
|
-
local command="$2"
|
|
27
|
-
|
|
28
|
-
echo -e "${YELLOW}[$CHECKS_TOTAL]${NC} Checking: $description"
|
|
29
|
-
|
|
30
|
-
if eval "$command" > /dev/null 2>&1; then
|
|
31
|
-
echo -e " ${GREEN}โ PASS${NC}"
|
|
32
|
-
CHECKS_PASSED=$((CHECKS_PASSED + 1))
|
|
33
|
-
return 0
|
|
34
|
-
else
|
|
35
|
-
echo -e " ${RED}โ FAIL${NC}"
|
|
36
|
-
return 1
|
|
37
|
-
fi
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
# Function to display a value
|
|
41
|
-
display() {
|
|
42
|
-
local description="$1"
|
|
43
|
-
local command="$2"
|
|
44
|
-
|
|
45
|
-
echo -e "${YELLOW}โ${NC} $description"
|
|
46
|
-
result=$(eval "$command" 2>&1 || echo "NOT FOUND")
|
|
47
|
-
echo -e " ${BLUE}$result${NC}"
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
echo -e "${BLUE}1. Checking npm registry packages...${NC}"
|
|
51
|
-
echo ""
|
|
52
|
-
|
|
53
|
-
check "Snowcode SDK exists on npm" "npm view @groeimetai/snowcode-sdk version"
|
|
54
|
-
display " SDK Version" "npm view @groeimetai/snowcode-sdk version"
|
|
55
|
-
|
|
56
|
-
check "Snowcode Plugin exists on npm" "npm view @groeimetai/snowcode-plugin version"
|
|
57
|
-
display " Plugin Version" "npm view @groeimetai/snowcode-plugin version"
|
|
58
|
-
display " Plugin Dependencies" "npm view @groeimetai/snowcode-plugin dependencies"
|
|
59
|
-
|
|
60
|
-
echo ""
|
|
61
|
-
echo -e "${BLUE}2. Checking local .opencode/package.json...${NC}"
|
|
62
|
-
echo ""
|
|
63
|
-
|
|
64
|
-
if [ -f ".opencode/package.json" ]; then
|
|
65
|
-
check ".opencode/package.json exists" "test -f .opencode/package.json"
|
|
66
|
-
|
|
67
|
-
PLUGIN=$(cat .opencode/package.json | grep -o '@groeimetai/snowcode-plugin' || echo "")
|
|
68
|
-
OLD_PLUGIN=$(cat .opencode/package.json | grep -o '@opencode-ai/plugin' || echo "")
|
|
69
|
-
|
|
70
|
-
if [ ! -z "$PLUGIN" ]; then
|
|
71
|
-
echo -e " ${GREEN}โ Using snowcode fork: $PLUGIN${NC}"
|
|
72
|
-
CHECKS_PASSED=$((CHECKS_PASSED + 1))
|
|
73
|
-
else
|
|
74
|
-
echo -e " ${RED}โ NOT using snowcode fork${NC}"
|
|
75
|
-
fi
|
|
76
|
-
|
|
77
|
-
CHECKS_TOTAL=$((CHECKS_TOTAL + 1))
|
|
78
|
-
|
|
79
|
-
if [ ! -z "$OLD_PLUGIN" ]; then
|
|
80
|
-
echo -e " ${RED}โ WARNING: Still referencing old plugin: $OLD_PLUGIN${NC}"
|
|
81
|
-
fi
|
|
82
|
-
|
|
83
|
-
display " Full package.json" "cat .opencode/package.json"
|
|
84
|
-
else
|
|
85
|
-
echo -e " ${YELLOW}โ .opencode/package.json not found${NC}"
|
|
86
|
-
echo -e " ${YELLOW} Run 'snow-flow init' to create it${NC}"
|
|
87
|
-
fi
|
|
88
|
-
|
|
89
|
-
echo ""
|
|
90
|
-
echo -e "${BLUE}3. Checking installed node_modules...${NC}"
|
|
91
|
-
echo ""
|
|
92
|
-
|
|
93
|
-
if [ -d ".opencode/node_modules/@groeimetai/snowcode-plugin" ]; then
|
|
94
|
-
check "Snowcode plugin installed in node_modules" "test -d .opencode/node_modules/@groeimetai/snowcode-plugin"
|
|
95
|
-
display " Installed Version" "cat .opencode/node_modules/@groeimetai/snowcode-plugin/package.json | grep '\"version\"' | head -1"
|
|
96
|
-
|
|
97
|
-
if [ -d ".opencode/node_modules/@opencode-ai/plugin" ]; then
|
|
98
|
-
echo -e " ${RED}โ WARNING: Old plugin still in node_modules!${NC}"
|
|
99
|
-
echo -e " ${YELLOW} Run: cd .opencode && rm -rf node_modules && npm install${NC}"
|
|
100
|
-
else
|
|
101
|
-
echo -e " ${GREEN}โ Old plugin NOT in node_modules${NC}"
|
|
102
|
-
CHECKS_PASSED=$((CHECKS_PASSED + 1))
|
|
103
|
-
CHECKS_TOTAL=$((CHECKS_TOTAL + 1))
|
|
104
|
-
fi
|
|
105
|
-
elif [ -d ".opencode/node_modules/@opencode-ai/plugin" ]; then
|
|
106
|
-
echo -e " ${RED}โ FAIL: Using old @opencode-ai/plugin${NC}"
|
|
107
|
-
echo -e " ${YELLOW} Fix: cd .opencode && rm -rf node_modules package-lock.json && npm install${NC}"
|
|
108
|
-
else
|
|
109
|
-
echo -e " ${YELLOW}โ No plugins installed yet${NC}"
|
|
110
|
-
echo -e " ${YELLOW} Run: cd .opencode && npm install${NC}"
|
|
111
|
-
fi
|
|
112
|
-
|
|
113
|
-
echo ""
|
|
114
|
-
echo -e "${BLUE}4. Testing plugin import...${NC}"
|
|
115
|
-
echo ""
|
|
116
|
-
|
|
117
|
-
if [ -d ".opencode/node_modules/@groeimetai/snowcode-plugin" ]; then
|
|
118
|
-
if node -e "import('@groeimetai/snowcode-plugin').then(() => console.log('OK')).catch(e => process.exit(1))" 2>/dev/null; then
|
|
119
|
-
echo -e " ${GREEN}โ Plugin loads successfully${NC}"
|
|
120
|
-
CHECKS_PASSED=$((CHECKS_PASSED + 1))
|
|
121
|
-
else
|
|
122
|
-
echo -e " ${RED}โ Plugin failed to load${NC}"
|
|
123
|
-
fi
|
|
124
|
-
CHECKS_TOTAL=$((CHECKS_TOTAL + 1))
|
|
125
|
-
fi
|
|
126
|
-
|
|
127
|
-
echo ""
|
|
128
|
-
echo -e "${BLUE}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${NC}"
|
|
129
|
-
|
|
130
|
-
if [ $CHECKS_PASSED -eq $CHECKS_TOTAL ]; then
|
|
131
|
-
echo -e "${GREEN}โ All checks passed! ($CHECKS_PASSED/$CHECKS_TOTAL)${NC}"
|
|
132
|
-
echo -e "${GREEN} You are using the @groeimetai/snowcode fork!${NC}"
|
|
133
|
-
exit 0
|
|
134
|
-
elif [ $CHECKS_PASSED -gt 0 ]; then
|
|
135
|
-
echo -e "${YELLOW}โ Partial success: $CHECKS_PASSED/$CHECKS_TOTAL checks passed${NC}"
|
|
136
|
-
echo -e "${YELLOW} Review warnings above${NC}"
|
|
137
|
-
exit 1
|
|
138
|
-
else
|
|
139
|
-
echo -e "${RED}โ Verification failed: $CHECKS_PASSED/$CHECKS_TOTAL checks passed${NC}"
|
|
140
|
-
exit 1
|
|
141
|
-
fi
|