snow-flow 4.2.4 ā 4.3.1
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/CLAUDE.md +918 -0
- package/dist/cli.js +2 -63
- package/package.json +1 -1
- package/check-mcp-resources.sh +0 -85
- package/cloudbuild-npm.yaml +0 -132
- package/cloudbuild-website.yaml +0 -92
- package/cloudbuild.yaml +0 -141
- package/empty-test.json +0 -3
- package/fix-console-logs.sh +0 -32
- package/fix-mcp-responses.sh +0 -31
- package/simple-test.json +0 -9
- package/test-mcp.json +0 -11
- package/test.txt +0 -1
- package/website/cloudbuild.yaml +0 -70
package/dist/cli.js
CHANGED
|
@@ -53,9 +53,7 @@ const agent_detector_js_1 = require("./utils/agent-detector.js");
|
|
|
53
53
|
const version_js_1 = require("./version.js");
|
|
54
54
|
const logger_js_1 = require("./utils/logger.js");
|
|
55
55
|
const chalk_1 = __importDefault(require("chalk"));
|
|
56
|
-
//
|
|
57
|
-
const llm_config_loader_js_1 = require("./config/llm-config-loader.js");
|
|
58
|
-
const interactive_js_1 = require("./agent/interactive.js");
|
|
56
|
+
// Removed provider-agnostic imports - using Claude Code directly
|
|
59
57
|
const auth_js_1 = require("./cli/auth.js");
|
|
60
58
|
const session_js_1 = require("./cli/session.js");
|
|
61
59
|
// Load environment variables
|
|
@@ -287,66 +285,7 @@ program
|
|
|
287
285
|
cliLogger.info(`š¤ Autonomous Systems: ā All Disabled`);
|
|
288
286
|
}
|
|
289
287
|
}
|
|
290
|
-
//
|
|
291
|
-
const shouldUseAgent = (() => {
|
|
292
|
-
if (options.engine === 'agent')
|
|
293
|
-
return true;
|
|
294
|
-
if (options.engine === 'claude')
|
|
295
|
-
return false;
|
|
296
|
-
// auto: use agent when config file is present and valid
|
|
297
|
-
const cfg = (0, llm_config_loader_js_1.loadSnowFlowConfig)({
|
|
298
|
-
configPath: options.config,
|
|
299
|
-
overrides: {
|
|
300
|
-
llm: {
|
|
301
|
-
provider: options.provider || undefined,
|
|
302
|
-
model: options.model || undefined,
|
|
303
|
-
baseURL: options.baseUrl || options.baseURL || undefined,
|
|
304
|
-
apiKeyEnv: options.apiKeyEnv || undefined,
|
|
305
|
-
},
|
|
306
|
-
},
|
|
307
|
-
});
|
|
308
|
-
return Boolean(cfg && cfg.llm && cfg.llm.provider && cfg.llm.model);
|
|
309
|
-
})();
|
|
310
|
-
if (shouldUseAgent) {
|
|
311
|
-
const cfg = (0, llm_config_loader_js_1.loadSnowFlowConfig)({
|
|
312
|
-
configPath: options.config,
|
|
313
|
-
overrides: {
|
|
314
|
-
llm: {
|
|
315
|
-
provider: options.provider || undefined,
|
|
316
|
-
model: options.model || undefined,
|
|
317
|
-
baseURL: options.baseUrl || options.baseURL || undefined,
|
|
318
|
-
apiKeyEnv: options.apiKeyEnv || undefined,
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
});
|
|
322
|
-
if (!cfg) {
|
|
323
|
-
cliLogger.error('ā Geen snowflow.config.(json|js|cjs) gevonden. Voeg config toe of gebruik --engine claude.');
|
|
324
|
-
process.exit(1);
|
|
325
|
-
}
|
|
326
|
-
// Basic validation for MVP
|
|
327
|
-
if (!cfg.llm?.provider || !cfg.llm?.model) {
|
|
328
|
-
cliLogger.error('ā Config mist llm.provider of llm.model');
|
|
329
|
-
process.exit(1);
|
|
330
|
-
}
|
|
331
|
-
cliLogger.info('\nš¤ Using provider-agnostic Snow-Flow agent (interactive)');
|
|
332
|
-
try {
|
|
333
|
-
await (0, interactive_js_1.runInteractive)({
|
|
334
|
-
provider: cfg.llm.provider,
|
|
335
|
-
model: String(cfg.llm.model),
|
|
336
|
-
baseURL: cfg.llm.baseURL,
|
|
337
|
-
apiKeyEnv: cfg.llm.apiKeyEnv,
|
|
338
|
-
mcp: cfg.mcp,
|
|
339
|
-
system: cfg.agent?.system,
|
|
340
|
-
maxSteps: cfg.agent?.maxSteps ?? 40,
|
|
341
|
-
showReasoning: options.showReasoning !== false,
|
|
342
|
-
resumeId: options.resume || undefined,
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
catch (e) {
|
|
346
|
-
cliLogger.error('ā Interactive agent error:', e instanceof Error ? e.message : String(e));
|
|
347
|
-
}
|
|
348
|
-
return; // end here; skip legacy Claude path
|
|
349
|
-
}
|
|
288
|
+
// Snow-Flow uses Claude Code directly - no provider-agnostic layer needed
|
|
350
289
|
// Analyze the objective using intelligent agent detection
|
|
351
290
|
const taskAnalysis = analyzeObjective(objective, parseInt(options.maxAgents));
|
|
352
291
|
// Debug logging to understand task type detection
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.1",
|
|
4
4
|
"description": "Conversational ServiceNow development platform using Claude Code. Multi-agent orchestration with 20+ MCP servers providing 200+ ServiceNow tools for comprehensive platform development.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|
package/check-mcp-resources.sh
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
echo "š Checking MCP Server Resources"
|
|
4
|
-
echo "================================="
|
|
5
|
-
echo ""
|
|
6
|
-
|
|
7
|
-
# Count MCP processes
|
|
8
|
-
echo "š MCP Process Count:"
|
|
9
|
-
MCP_COUNT=$(ps aux | grep -E "mcp|servicenow.*mcp" | grep -v grep | wc -l)
|
|
10
|
-
echo " Active MCP processes: $MCP_COUNT"
|
|
11
|
-
echo ""
|
|
12
|
-
|
|
13
|
-
# Show MCP processes with memory usage
|
|
14
|
-
echo "š¾ MCP Process Memory Usage:"
|
|
15
|
-
ps aux | grep -E "mcp|servicenow.*mcp" | grep -v grep | awk '{printf " PID: %5s | Memory: %6s MB | CPU: %5s%% | Process: %s\n", $2, int($6/1024), $3, substr($0, index($0,$11))}'
|
|
16
|
-
echo ""
|
|
17
|
-
|
|
18
|
-
# Total memory used by MCP
|
|
19
|
-
echo "š Total Memory Statistics:"
|
|
20
|
-
TOTAL_MEM=$(ps aux | grep -E "mcp|servicenow.*mcp" | grep -v grep | awk '{sum += $6} END {print int(sum/1024)}')
|
|
21
|
-
echo " Total MCP memory usage: ${TOTAL_MEM:-0} MB"
|
|
22
|
-
|
|
23
|
-
# System memory
|
|
24
|
-
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
25
|
-
# macOS
|
|
26
|
-
TOTAL_SYSTEM_MEM=$(sysctl -n hw.memsize | awk '{print int($1/1024/1024)}')
|
|
27
|
-
echo " Total system memory: $TOTAL_SYSTEM_MEM MB"
|
|
28
|
-
else
|
|
29
|
-
# Linux
|
|
30
|
-
TOTAL_SYSTEM_MEM=$(free -m | awk '/^Mem:/{print $2}')
|
|
31
|
-
echo " Total system memory: $TOTAL_SYSTEM_MEM MB"
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
echo ""
|
|
35
|
-
echo "ā ļø Warning Thresholds:"
|
|
36
|
-
if [ "$MCP_COUNT" -gt 10 ]; then
|
|
37
|
-
echo " ā Too many MCP processes ($MCP_COUNT > 10) - This will cause timeouts!"
|
|
38
|
-
echo " š” Run: pkill -f mcp"
|
|
39
|
-
else
|
|
40
|
-
echo " ā
MCP process count OK ($MCP_COUNT <= 10)"
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
if [ "${TOTAL_MEM:-0}" -gt 1500 ]; then
|
|
44
|
-
echo " ā High memory usage (${TOTAL_MEM}MB > 1500MB) - This will cause timeouts!"
|
|
45
|
-
echo " š” Run: npm run cleanup-mcp"
|
|
46
|
-
else
|
|
47
|
-
echo " ā
Memory usage OK (${TOTAL_MEM:-0}MB <= 1500MB)"
|
|
48
|
-
fi
|
|
49
|
-
|
|
50
|
-
echo ""
|
|
51
|
-
echo "š§ Node.js Processes:"
|
|
52
|
-
NODE_COUNT=$(ps aux | grep -E "node.*snow|node.*servicenow" | grep -v grep | wc -l)
|
|
53
|
-
echo " Active Node processes: $NODE_COUNT"
|
|
54
|
-
|
|
55
|
-
# Check for zombie processes
|
|
56
|
-
echo ""
|
|
57
|
-
echo "š» Zombie/Defunct Processes:"
|
|
58
|
-
ZOMBIE_COUNT=$(ps aux | grep defunct | grep -v grep | wc -l)
|
|
59
|
-
if [ "$ZOMBIE_COUNT" -gt 0 ]; then
|
|
60
|
-
echo " ā ļø Found $ZOMBIE_COUNT zombie processes"
|
|
61
|
-
ps aux | grep defunct | grep -v grep
|
|
62
|
-
else
|
|
63
|
-
echo " ā
No zombie processes found"
|
|
64
|
-
fi
|
|
65
|
-
|
|
66
|
-
echo ""
|
|
67
|
-
echo "š Recommendations:"
|
|
68
|
-
echo ""
|
|
69
|
-
|
|
70
|
-
if [ "$MCP_COUNT" -gt 10 ] || [ "${TOTAL_MEM:-0}" -gt 1500 ]; then
|
|
71
|
-
echo " šØ RESOURCE ISSUES DETECTED!"
|
|
72
|
-
echo ""
|
|
73
|
-
echo " Quick fix:"
|
|
74
|
-
echo " 1. pkill -f mcp"
|
|
75
|
-
echo " 2. npm run cleanup-mcp"
|
|
76
|
-
echo " 3. npm run mcp:start"
|
|
77
|
-
echo ""
|
|
78
|
-
echo " Permanent fix:"
|
|
79
|
-
echo " 1. Add to .env:"
|
|
80
|
-
echo " SNOW_MAX_MCP_SERVERS=5"
|
|
81
|
-
echo " SNOW_MCP_MEMORY_LIMIT=200"
|
|
82
|
-
echo " 2. Restart snow-flow"
|
|
83
|
-
else
|
|
84
|
-
echo " ā
Resources look healthy"
|
|
85
|
-
fi
|
package/cloudbuild-npm.yaml
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# Snow-Flow v4.2.0 ENTERPRISE - NPM Release Pipeline
|
|
2
|
-
# Automated npm publishing for enterprise releases
|
|
3
|
-
|
|
4
|
-
steps:
|
|
5
|
-
# Install dependencies
|
|
6
|
-
- name: 'node:20'
|
|
7
|
-
entrypoint: 'npm'
|
|
8
|
-
args: ['ci', '--production=false']
|
|
9
|
-
id: 'install'
|
|
10
|
-
env:
|
|
11
|
-
- 'NPM_CONFIG_CACHE=/tmp/.npm'
|
|
12
|
-
|
|
13
|
-
# Build enterprise edition
|
|
14
|
-
- name: 'node:20'
|
|
15
|
-
entrypoint: 'npm'
|
|
16
|
-
args: ['run', 'build']
|
|
17
|
-
id: 'build'
|
|
18
|
-
waitFor: ['install']
|
|
19
|
-
|
|
20
|
-
# Version validation
|
|
21
|
-
- name: 'node:20'
|
|
22
|
-
entrypoint: 'node'
|
|
23
|
-
args: ['-e', 'const pkg=require("./package.json"); console.log(`Building v${pkg.version}`); if(!pkg.version.match(/^4\\.\\d+\\.\\d+$/)) process.exit(1);']
|
|
24
|
-
id: 'validate-version'
|
|
25
|
-
waitFor: ['build']
|
|
26
|
-
|
|
27
|
-
# Enterprise feature verification
|
|
28
|
-
- name: 'node:20'
|
|
29
|
-
entrypoint: 'bash'
|
|
30
|
-
args:
|
|
31
|
-
- '-c'
|
|
32
|
-
- |
|
|
33
|
-
echo "š Verifying enterprise features..."
|
|
34
|
-
|
|
35
|
-
# Check MCP servers count
|
|
36
|
-
MCP_COUNT=$(find src/mcp/ -name "*-mcp.ts" | wc -l)
|
|
37
|
-
echo "š MCP Servers found: $MCP_COUNT"
|
|
38
|
-
if [ "$MCP_COUNT" -lt 20 ]; then
|
|
39
|
-
echo "ā ERROR: Expected 20+ MCP servers, found $MCP_COUNT"
|
|
40
|
-
exit 1
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
# Check for enterprise servers
|
|
44
|
-
if [ ! -f "src/mcp/servicenow-itam-mcp.ts" ]; then
|
|
45
|
-
echo "ā ERROR: ITAM MCP server missing"
|
|
46
|
-
exit 1
|
|
47
|
-
fi
|
|
48
|
-
|
|
49
|
-
if [ ! -f "src/mcp/servicenow-secops-mcp.ts" ]; then
|
|
50
|
-
echo "ā ERROR: SecOps MCP server missing"
|
|
51
|
-
exit 1
|
|
52
|
-
fi
|
|
53
|
-
|
|
54
|
-
if [ ! -f "src/mcp/servicenow-notifications-mcp.ts" ]; then
|
|
55
|
-
echo "ā ERROR: Notifications MCP server missing"
|
|
56
|
-
exit 1
|
|
57
|
-
fi
|
|
58
|
-
|
|
59
|
-
# Check for memory optimization
|
|
60
|
-
if [ ! -f "src/utils/memory-pool.ts" ]; then
|
|
61
|
-
echo "ā ERROR: MemoryPoolManager missing"
|
|
62
|
-
exit 1
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
echo "ā
All enterprise features verified!"
|
|
66
|
-
echo "š¢ ITAM: Asset lifecycle management ā
"
|
|
67
|
-
echo "š”ļø SecOps: Security operations ā
"
|
|
68
|
-
echo "šØ Notifications: Multi-channel messaging ā
"
|
|
69
|
-
echo "š§ MemoryPoolManager: Performance optimization ā
"
|
|
70
|
-
id: 'verify-enterprise'
|
|
71
|
-
waitFor: ['validate-version']
|
|
72
|
-
|
|
73
|
-
# Publish to npm (only on tags)
|
|
74
|
-
- name: 'node:20'
|
|
75
|
-
entrypoint: 'bash'
|
|
76
|
-
args:
|
|
77
|
-
- '-c'
|
|
78
|
-
- |
|
|
79
|
-
# Only publish on version tags
|
|
80
|
-
if [[ "$TAG_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
81
|
-
echo "š Publishing Snow-Flow Enterprise Edition to npm..."
|
|
82
|
-
echo "//registry.npmjs.org/:_authToken=$_NPM_TOKEN" > ~/.npmrc
|
|
83
|
-
npm publish --tag latest
|
|
84
|
-
echo "ā
Published Snow-Flow v$TAG_NAME to npm registry"
|
|
85
|
-
echo "š¦ Enterprise features now available worldwide!"
|
|
86
|
-
else
|
|
87
|
-
echo "ā¹ļø Not a version tag, skipping npm publish"
|
|
88
|
-
fi
|
|
89
|
-
id: 'npm-publish'
|
|
90
|
-
waitFor: ['verify-enterprise']
|
|
91
|
-
secretEnv: ['NPM_TOKEN']
|
|
92
|
-
|
|
93
|
-
# Success notification
|
|
94
|
-
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
|
|
95
|
-
entrypoint: 'bash'
|
|
96
|
-
args:
|
|
97
|
-
- '-c'
|
|
98
|
-
- |
|
|
99
|
-
echo "š Snow-Flow Enterprise Build Complete!"
|
|
100
|
-
echo "Version: $(node -p 'require("./package.json").version')"
|
|
101
|
-
echo "MCP Servers: 23"
|
|
102
|
-
echo "Tools: 355+"
|
|
103
|
-
echo "Enterprise Features: ITAM + SecOps + Notifications"
|
|
104
|
-
echo "Memory Optimizations: Active"
|
|
105
|
-
echo "Ready for enterprise deployment! š"
|
|
106
|
-
id: 'success-notification'
|
|
107
|
-
waitFor: ['npm-publish']
|
|
108
|
-
|
|
109
|
-
# Secret manager configuration for NPM token
|
|
110
|
-
availableSecrets:
|
|
111
|
-
secretManager:
|
|
112
|
-
- versionName: projects/$PROJECT_ID/secrets/npm-token/versions/latest
|
|
113
|
-
env: 'NPM_TOKEN'
|
|
114
|
-
|
|
115
|
-
# Build options for enterprise scale
|
|
116
|
-
options:
|
|
117
|
-
logging: CLOUD_LOGGING_ONLY
|
|
118
|
-
machineType: 'E2_HIGHCPU_8'
|
|
119
|
-
diskSizeGb: 100
|
|
120
|
-
env:
|
|
121
|
-
- 'NODE_ENV=production'
|
|
122
|
-
- 'SNOW_FLOW_ENTERPRISE=true'
|
|
123
|
-
|
|
124
|
-
# Substitutions
|
|
125
|
-
substitutions:
|
|
126
|
-
_NPM_TOKEN: '' # Set via secret manager
|
|
127
|
-
|
|
128
|
-
# Build timeout
|
|
129
|
-
timeout: '2400s' # 40 minutes for enterprise builds
|
|
130
|
-
|
|
131
|
-
# Tags
|
|
132
|
-
tags: ['snow-flow', 'enterprise', 'npm-release', 'v4-2-0']
|
package/cloudbuild-website.yaml
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# Snow-Flow Website v4.2.0 ENTERPRISE - Cloud Run Deployment
|
|
2
|
-
# Builds and deploys the enterprise website with updated hero fixes
|
|
3
|
-
|
|
4
|
-
steps:
|
|
5
|
-
# Build the Docker image from website directory
|
|
6
|
-
- name: 'gcr.io/cloud-builders/docker'
|
|
7
|
-
args: [
|
|
8
|
-
'build',
|
|
9
|
-
'-t', 'gcr.io/$PROJECT_ID/snow-flow-website:$COMMIT_SHA',
|
|
10
|
-
'-t', 'gcr.io/$PROJECT_ID/snow-flow-website:latest',
|
|
11
|
-
'-f', 'website/Dockerfile', # Specify Dockerfile location
|
|
12
|
-
'website/' # Build context is website directory
|
|
13
|
-
]
|
|
14
|
-
id: 'build-website'
|
|
15
|
-
|
|
16
|
-
# Push the Docker image to Container Registry
|
|
17
|
-
- name: 'gcr.io/cloud-builders/docker'
|
|
18
|
-
args: ['push', 'gcr.io/$PROJECT_ID/snow-flow-website:$COMMIT_SHA']
|
|
19
|
-
id: 'push-latest'
|
|
20
|
-
waitFor: ['build-website']
|
|
21
|
-
|
|
22
|
-
- name: 'gcr.io/cloud-builders/docker'
|
|
23
|
-
args: ['push', 'gcr.io/$PROJECT_ID/snow-flow-website:latest']
|
|
24
|
-
id: 'push-sha'
|
|
25
|
-
waitFor: ['build-website']
|
|
26
|
-
|
|
27
|
-
# Deploy to Cloud Run with enterprise configuration
|
|
28
|
-
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
|
|
29
|
-
entrypoint: gcloud
|
|
30
|
-
args: [
|
|
31
|
-
'run', 'deploy', 'snow-flow-website',
|
|
32
|
-
'--image', 'gcr.io/$PROJECT_ID/snow-flow-website:$COMMIT_SHA',
|
|
33
|
-
'--region', 'europe-west1',
|
|
34
|
-
'--platform', 'managed',
|
|
35
|
-
'--allow-unauthenticated',
|
|
36
|
-
'--port', '80',
|
|
37
|
-
'--memory', '1Gi', # Increased for enterprise website
|
|
38
|
-
'--cpu', '2', # Increased for better performance
|
|
39
|
-
'--concurrency', '100',
|
|
40
|
-
'--max-instances', '20', # Increased for enterprise scale
|
|
41
|
-
'--min-instances', '1',
|
|
42
|
-
'--set-env-vars', 'NODE_ENV=production,ENTERPRISE_MODE=true',
|
|
43
|
-
'--timeout', '300',
|
|
44
|
-
'--service-account', 'cloud-run-sa@$PROJECT_ID.iam.gserviceaccount.com'
|
|
45
|
-
]
|
|
46
|
-
id: 'deploy-cloud-run'
|
|
47
|
-
waitFor: ['push-latest', 'push-sha']
|
|
48
|
-
|
|
49
|
-
# Verify deployment
|
|
50
|
-
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
|
|
51
|
-
entrypoint: bash
|
|
52
|
-
args:
|
|
53
|
-
- '-c'
|
|
54
|
-
- |
|
|
55
|
-
echo "š Snow-Flow Enterprise Website Deployed!"
|
|
56
|
-
|
|
57
|
-
# Get service URL
|
|
58
|
-
SERVICE_URL=$(gcloud run services describe snow-flow-website \
|
|
59
|
-
--region=europe-west1 \
|
|
60
|
-
--format='value(status.url)')
|
|
61
|
-
|
|
62
|
-
echo "š Website URL: $SERVICE_URL"
|
|
63
|
-
echo "ā
Features: 23 MCP Servers, 355+ Tools"
|
|
64
|
-
echo "ā
Enterprise: ITAM, SecOps, Notifications"
|
|
65
|
-
echo "ā
Hero fixes: Contrast, centering, counter animations"
|
|
66
|
-
|
|
67
|
-
# Test website is responding
|
|
68
|
-
curl -f "$SERVICE_URL" -o /dev/null || echo "ā ļø Website not responding yet (may take a moment)"
|
|
69
|
-
id: 'verify-deployment'
|
|
70
|
-
waitFor: ['deploy-cloud-run']
|
|
71
|
-
|
|
72
|
-
# Build options optimized for website deployment
|
|
73
|
-
options:
|
|
74
|
-
logging: CLOUD_LOGGING_ONLY
|
|
75
|
-
machineType: 'E2_STANDARD_4' # Standard for Docker builds
|
|
76
|
-
diskSizeGb: 50
|
|
77
|
-
|
|
78
|
-
# Substitutions
|
|
79
|
-
substitutions:
|
|
80
|
-
_REGION: 'europe-west1'
|
|
81
|
-
_SERVICE_NAME: 'snow-flow-website'
|
|
82
|
-
|
|
83
|
-
# Images to be pushed
|
|
84
|
-
images:
|
|
85
|
-
- 'gcr.io/$PROJECT_ID/snow-flow-website:$COMMIT_SHA'
|
|
86
|
-
- 'gcr.io/$PROJECT_ID/snow-flow-website:latest'
|
|
87
|
-
|
|
88
|
-
# Build timeout
|
|
89
|
-
timeout: '1200s'
|
|
90
|
-
|
|
91
|
-
# Tags
|
|
92
|
-
tags: ['snow-flow', 'website', 'cloud-run', 'v4-2-0', 'enterprise']
|
package/cloudbuild.yaml
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
# Snow-Flow v4.2.0 ENTERPRISE - Google Cloud Build Configuration
|
|
2
|
-
# Builds and tests the complete Snow-Flow platform with 23 MCP servers and 355+ tools
|
|
3
|
-
|
|
4
|
-
steps:
|
|
5
|
-
# Install Node.js dependencies
|
|
6
|
-
- name: 'node:20'
|
|
7
|
-
entrypoint: 'npm'
|
|
8
|
-
args: ['ci']
|
|
9
|
-
id: 'install-deps'
|
|
10
|
-
env:
|
|
11
|
-
- 'NODE_ENV=production'
|
|
12
|
-
- 'NPM_CONFIG_CACHE=/tmp/.npm'
|
|
13
|
-
|
|
14
|
-
# Build Snow-Flow with optimized settings for enterprise
|
|
15
|
-
- name: 'node:20'
|
|
16
|
-
entrypoint: 'npm'
|
|
17
|
-
args: ['run', 'build']
|
|
18
|
-
id: 'build-snow-flow'
|
|
19
|
-
waitFor: ['install-deps']
|
|
20
|
-
env:
|
|
21
|
-
- 'NODE_ENV=production'
|
|
22
|
-
- 'SNOW_FLOW_ENTERPRISE=true'
|
|
23
|
-
- 'MEMORY_OPTIMIZATION=enabled'
|
|
24
|
-
|
|
25
|
-
# Run enterprise test suite
|
|
26
|
-
- name: 'node:20'
|
|
27
|
-
entrypoint: 'npm'
|
|
28
|
-
args: ['test']
|
|
29
|
-
id: 'test-enterprise'
|
|
30
|
-
waitFor: ['build-snow-flow']
|
|
31
|
-
env:
|
|
32
|
-
- 'NODE_ENV=test'
|
|
33
|
-
- 'JEST_TIMEOUT=30000'
|
|
34
|
-
|
|
35
|
-
# Verify CLI functionality
|
|
36
|
-
- name: 'node:20'
|
|
37
|
-
entrypoint: 'node'
|
|
38
|
-
args: ['dist/cli.js', '--version']
|
|
39
|
-
id: 'verify-cli'
|
|
40
|
-
waitFor: ['build-snow-flow']
|
|
41
|
-
|
|
42
|
-
# Test MCP server connectivity
|
|
43
|
-
- name: 'node:20'
|
|
44
|
-
entrypoint: 'node'
|
|
45
|
-
args: ['-e', 'console.log("Testing MCP servers..."); process.exit(0);']
|
|
46
|
-
id: 'test-mcp-servers'
|
|
47
|
-
waitFor: ['build-snow-flow']
|
|
48
|
-
|
|
49
|
-
# Package for npm (for enterprise distribution)
|
|
50
|
-
- name: 'node:20'
|
|
51
|
-
entrypoint: 'npm'
|
|
52
|
-
args: ['pack', '--pack-destination=/workspace/artifacts']
|
|
53
|
-
id: 'package-npm'
|
|
54
|
-
waitFor: ['test-enterprise', 'verify-cli']
|
|
55
|
-
|
|
56
|
-
# Create enterprise deployment artifact
|
|
57
|
-
- name: 'gcr.io/cloud-builders/gcloud'
|
|
58
|
-
entrypoint: 'bash'
|
|
59
|
-
args:
|
|
60
|
-
- '-c'
|
|
61
|
-
- |
|
|
62
|
-
echo "Snow-Flow v4.2.0 ENTERPRISE Build Complete"
|
|
63
|
-
echo "ā
23 MCP Servers compiled successfully"
|
|
64
|
-
echo "ā
355+ Tools ready for deployment"
|
|
65
|
-
echo "ā
Enterprise features: ITAM, SecOps, Notifications"
|
|
66
|
-
echo "ā
Memory optimizations: MemoryPoolManager active"
|
|
67
|
-
echo "ā
Performance improvements: 85% memory reduction"
|
|
68
|
-
echo "š¦ Artifact ready for enterprise distribution"
|
|
69
|
-
|
|
70
|
-
# Create build metadata
|
|
71
|
-
cat > /workspace/artifacts/build-metadata.json << EOF
|
|
72
|
-
{
|
|
73
|
-
"version": "4.2.0",
|
|
74
|
-
"build_time": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
|
|
75
|
-
"commit_sha": "$COMMIT_SHA",
|
|
76
|
-
"mcp_servers": 23,
|
|
77
|
-
"tools_count": "355+",
|
|
78
|
-
"enterprise_features": ["ITAM", "SecOps", "Notifications"],
|
|
79
|
-
"optimizations": ["MemoryPoolManager", "10k+ lines removed", "5MB+ widget support"],
|
|
80
|
-
"platform": "enterprise",
|
|
81
|
-
"nodejs_version": "20.x",
|
|
82
|
-
"build_machine": "$_MACHINE_TYPE"
|
|
83
|
-
}
|
|
84
|
-
EOF
|
|
85
|
-
id: 'create-metadata'
|
|
86
|
-
waitFor: ['package-npm']
|
|
87
|
-
|
|
88
|
-
# Lint and security check (optional for enterprise)
|
|
89
|
-
- name: 'node:20'
|
|
90
|
-
entrypoint: 'npm'
|
|
91
|
-
args: ['run', 'lint']
|
|
92
|
-
id: 'lint-check'
|
|
93
|
-
waitFor: ['install-deps']
|
|
94
|
-
allowFailure: true # Don't fail build on lint warnings
|
|
95
|
-
|
|
96
|
-
# Artifacts to store
|
|
97
|
-
artifacts:
|
|
98
|
-
objects:
|
|
99
|
-
location: 'gs://$PROJECT_ID-snow-flow-artifacts'
|
|
100
|
-
paths:
|
|
101
|
-
- '/workspace/artifacts/*'
|
|
102
|
-
- '/workspace/dist/**/*'
|
|
103
|
-
- '/workspace/package.json'
|
|
104
|
-
|
|
105
|
-
# Build options optimized for enterprise
|
|
106
|
-
options:
|
|
107
|
-
logging: CLOUD_LOGGING_ONLY
|
|
108
|
-
machineType: 'E2_HIGHCPU_8' # High CPU for TypeScript compilation and 355 tools
|
|
109
|
-
diskSizeGb: 100
|
|
110
|
-
substitutionOption: 'ALLOW_LOOSE' # For enterprise environment variables
|
|
111
|
-
env:
|
|
112
|
-
- 'CLOUDSDK_COMPUTE_ZONE=europe-west1-b'
|
|
113
|
-
- 'CLOUDSDK_CORE_PROJECT=$PROJECT_ID'
|
|
114
|
-
|
|
115
|
-
# Environment substitutions for enterprise deployment
|
|
116
|
-
substitutions:
|
|
117
|
-
_MACHINE_TYPE: 'E2_HIGHCPU_8'
|
|
118
|
-
_NODE_VERSION: '20'
|
|
119
|
-
_SNOW_FLOW_VERSION: '4.2.0'
|
|
120
|
-
_ENTERPRISE_MODE: 'true'
|
|
121
|
-
_MEMORY_OPTIMIZATION: 'enabled'
|
|
122
|
-
|
|
123
|
-
# Build timeout (increased for enterprise scale)
|
|
124
|
-
timeout: '1800s' # 30 minutes for enterprise builds
|
|
125
|
-
|
|
126
|
-
# Tags for organization and filtering
|
|
127
|
-
tags:
|
|
128
|
-
- 'snow-flow'
|
|
129
|
-
- 'enterprise'
|
|
130
|
-
- 'v4-2-0'
|
|
131
|
-
- 'mcp-servers'
|
|
132
|
-
- 'servicenow'
|
|
133
|
-
- 'automation'
|
|
134
|
-
|
|
135
|
-
# Service account for enterprise permissions (configure in GCP if needed)
|
|
136
|
-
# serviceAccount: 'projects/$PROJECT_ID/serviceAccounts/snow-flow-enterprise@$PROJECT_ID.iam.gserviceaccount.com'
|
|
137
|
-
|
|
138
|
-
# Build triggers (configure in GCP Console)
|
|
139
|
-
# - Push to main branch
|
|
140
|
-
# - Tag push matching v*.*.*
|
|
141
|
-
# - Manual trigger for enterprise releases
|
package/empty-test.json
DELETED
package/fix-console-logs.sh
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Fix console.log statements in MCP servers to use console.error instead
|
|
4
|
-
# This prevents stdout pollution which breaks JSON-RPC protocol
|
|
5
|
-
|
|
6
|
-
echo "š§ Fixing console.log statements in MCP servers..."
|
|
7
|
-
|
|
8
|
-
# List of files to fix
|
|
9
|
-
files=(
|
|
10
|
-
"src/mcp/service-discovery-client.ts"
|
|
11
|
-
"src/mcp/servicenow-deployment-mcp.ts"
|
|
12
|
-
"src/mcp/servicenow-mcp-server.ts"
|
|
13
|
-
"src/mcp/servicenow-update-set-mcp.ts"
|
|
14
|
-
"src/mcp/start-all-mcp-servers.ts"
|
|
15
|
-
"src/mcp/start-servicenow-mcp.ts"
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
for file in "${files[@]}"; do
|
|
19
|
-
if [ -f "$file" ]; then
|
|
20
|
-
echo " Fixing $file..."
|
|
21
|
-
# Replace console.log with console.error
|
|
22
|
-
sed -i.bak 's/console\.log(/console.error(/g' "$file"
|
|
23
|
-
# Remove backup file
|
|
24
|
-
rm -f "${file}.bak"
|
|
25
|
-
else
|
|
26
|
-
echo " ā ļø File not found: $file"
|
|
27
|
-
fi
|
|
28
|
-
done
|
|
29
|
-
|
|
30
|
-
echo "ā
Console.log statements fixed!"
|
|
31
|
-
echo ""
|
|
32
|
-
echo "Note: console.error is used for logging in MCP servers to keep stdout clean for JSON-RPC protocol."
|
package/fix-mcp-responses.sh
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
echo "š§ Fixing MCP response patterns to include _meta field..."
|
|
4
|
-
|
|
5
|
-
# Find all TypeScript files with operationComplete
|
|
6
|
-
files=$(grep -l "operationComplete" src/mcp/*.ts)
|
|
7
|
-
count=$(echo "$files" | wc -l)
|
|
8
|
-
|
|
9
|
-
echo "š Found $count files to fix"
|
|
10
|
-
|
|
11
|
-
for file in $files; do
|
|
12
|
-
echo " š Fixing $(basename $file)..."
|
|
13
|
-
|
|
14
|
-
# Replace the pattern where operationComplete is followed by return result
|
|
15
|
-
# Add the addTokenUsageToResponse call before returning
|
|
16
|
-
sed -i '' 's/this\.logger\.operationComplete(name, result);/result = this.logger.addTokenUsageToResponse(result);\
|
|
17
|
-
this.logger.operationComplete(name, result);/g' "$file"
|
|
18
|
-
|
|
19
|
-
# Also handle cases with different spacing
|
|
20
|
-
sed -i '' 's/this\.logger\.operationComplete(name, result);[[:space:]]*$/result = this.logger.addTokenUsageToResponse(result);\
|
|
21
|
-
this.logger.operationComplete(name, result);/g' "$file"
|
|
22
|
-
done
|
|
23
|
-
|
|
24
|
-
echo "ā
Fixed all MCP files!"
|
|
25
|
-
echo ""
|
|
26
|
-
echo "š Verifying changes..."
|
|
27
|
-
echo "Files now using addTokenUsageToResponse:"
|
|
28
|
-
grep -l "addTokenUsageToResponse" src/mcp/*.ts | wc -l
|
|
29
|
-
|
|
30
|
-
echo ""
|
|
31
|
-
echo "š¦ Now run: npm run build"
|
package/simple-test.json
DELETED
package/test-mcp.json
DELETED
package/test.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
test file content
|