claude-flow-novice 2.2.4 → 2.2.5
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 +9 -8
- package/scripts/.claude-flow/metrics/agent-metrics.json +1 -0
- package/scripts/.claude-flow/metrics/performance.json +9 -0
- package/scripts/.claude-flow/metrics/task-metrics.json +10 -0
- package/scripts/CLEANUP_OPTIMIZATION_REPORT.json +312 -0
- package/scripts/CLEANUP_PERFORMANCE_OPTIMIZATION.md +387 -0
- package/scripts/CLEANUP_QUICK_START.md +268 -0
- package/scripts/CLEANUP_TEST_RESULTS.md +205 -0
- package/scripts/README.md +339 -0
- package/scripts/ace-query.sh +384 -0
- package/scripts/agent-token-analysis.js +430 -0
- package/scripts/auto-setup.js +332 -0
- package/scripts/build/README.md +167 -0
- package/scripts/build/build-config.js +27 -0
- package/scripts/build/build-prompt-copier.sh +30 -0
- package/scripts/build/performance-monitor.js +869 -0
- package/scripts/build/prepare-publish.js +150 -0
- package/scripts/build/typescript-fixer.js +621 -0
- package/scripts/build/unified-builder.sh +428 -0
- package/scripts/build/update-bin-version.js +32 -0
- package/scripts/build/validate-agents.js +238 -0
- package/scripts/build-index.js +43 -0
- package/scripts/build-orchestrator.js +320 -0
- package/scripts/check-routing-stats.cjs +122 -0
- package/scripts/ci-validation.js +375 -0
- package/scripts/cleanup-blocking-coordination.sh +420 -0
- package/scripts/cleanup-idle-sessions.sh +59 -0
- package/scripts/collect-build-metrics.js +65 -0
- package/scripts/demo/README.md +79 -0
- package/scripts/demo/autoscaling-demo-simplified.js +963 -0
- package/scripts/demo/comprehensive-dashboard-test.js +693 -0
- package/scripts/demo/confidence-log.js +87 -0
- package/scripts/demo/confidence-report.js +82 -0
- package/scripts/demo/demo-multi-swarm-coordination.js +325 -0
- package/scripts/demo/demo-production-deployment.js +399 -0
- package/scripts/demo/demo-visualization-system.js +149 -0
- package/scripts/demo/performance-analysis.cjs +71 -0
- package/scripts/demo/performance-analysis.js +71 -0
- package/scripts/demo/test-autoscaling-demo.js +314 -0
- package/scripts/dependency-optimizer.js +349 -0
- package/scripts/dependency-security-assessment.js +331 -0
- package/scripts/deploy-sdk.sh +176 -0
- package/scripts/deployment-readiness-report.json +179 -0
- package/scripts/dev/README.md +264 -0
- package/scripts/dev/claude-flow-wrapper.sh +35 -0
- package/scripts/dev/claude-monitor.py +419 -0
- package/scripts/dev/claude-sparc.sh +562 -0
- package/scripts/dev/claude-wrapper.sh +17 -0
- package/scripts/dev/demo-phase3-compliance.js +172 -0
- package/scripts/dev/demo-task-system.ts +224 -0
- package/scripts/dev/deployment-validator.js +315 -0
- package/scripts/dev/spawn-claude-terminal.sh +32 -0
- package/scripts/dev/start-portal.sh +506 -0
- package/scripts/dev/start-web-ui.js +15 -0
- package/scripts/dev/stop-portal.sh +311 -0
- package/scripts/dev/validate-examples.ts +288 -0
- package/scripts/dev/validate-phase2.cjs +451 -0
- package/scripts/dev/validate-phase2.js +785 -0
- package/scripts/dev/validate-phase3.cjs +208 -0
- package/scripts/dev/validate-security-remediation.js +1 -0
- package/scripts/ecosystem.config.cjs +90 -0
- package/scripts/fix-js-extensions.js +167 -0
- package/scripts/generate-basic-types.js +73 -0
- package/scripts/generate-changelog.js +318 -0
- package/scripts/git-hooks/pre-commit.sh +143 -0
- package/scripts/health-checks.js +634 -0
- package/scripts/hook-wrapper.sh +54 -0
- package/scripts/install/README.md +375 -0
- package/scripts/install/REDIS_SETUP_VALIDATION.json +245 -0
- package/scripts/install/check-prerequisites.js +303 -0
- package/scripts/install/config-wizard.js +606 -0
- package/scripts/install/dependency-checker.js +385 -0
- package/scripts/install/health-check.js +765 -0
- package/scripts/install/install.js +256 -0
- package/scripts/install/installation-benchmark.js +461 -0
- package/scripts/install/quick-install.js +720 -0
- package/scripts/install/quick-start-wizard.js +295 -0
- package/scripts/install/redis-cli.js +289 -0
- package/scripts/install/redis-install-guides.md +407 -0
- package/scripts/install/redis-setup.js +559 -0
- package/scripts/install/redis-test.js +278 -0
- package/scripts/install/service-manager.js +672 -0
- package/scripts/install/setup.js +832 -0
- package/scripts/install/uninstall.js +526 -0
- package/scripts/install/update.js +461 -0
- package/scripts/install-pre-commit-hook.sh +127 -0
- package/scripts/legacy/README.md +272 -0
- package/scripts/legacy/batch-fix-ts.sh +54 -0
- package/scripts/legacy/build-migration.sh +105 -0
- package/scripts/legacy/build-monitor.js +209 -0
- package/scripts/legacy/build-with-filter.sh +84 -0
- package/scripts/legacy/build-workaround.sh +71 -0
- package/scripts/legacy/fix-ts-advanced.js +358 -0
- package/scripts/legacy/fix-ts-final.sh +50 -0
- package/scripts/legacy/fix-ts-targeted.sh +49 -0
- package/scripts/legacy/fix-typescript-errors.js +305 -0
- package/scripts/legacy/force-build.sh +63 -0
- package/scripts/legacy/optimize-performance.js +400 -0
- package/scripts/legacy/performance-monitor.js +263 -0
- package/scripts/legacy/performance-monitoring.js +532 -0
- package/scripts/legacy/performance-test-runner.js +645 -0
- package/scripts/legacy/quick-fix-ts.js +281 -0
- package/scripts/legacy/safe-build.sh +63 -0
- package/scripts/memory-monitor-coordinator.js +322 -0
- package/scripts/migrate-to-sdk.sh +520 -0
- package/scripts/migration/QUICK-START.md +189 -0
- package/scripts/migration/QUICK-START.md.backup-1760135091363 +189 -0
- package/scripts/migration/README.md +464 -0
- package/scripts/migration/TASK-1.3.2-COMPLETION-REPORT.md +500 -0
- package/scripts/migration/TASK-1.3.2-COMPLETION-REPORT.md.backup-1760135091348 +500 -0
- package/scripts/migration/UPDATE-PATHS-README.md +464 -0
- package/scripts/migration/UPDATE-PATHS-README.md.backup-1760135091337 +464 -0
- package/scripts/migration/example-patterns.json +19 -0
- package/scripts/migration/install-arm64.js +78 -0
- package/scripts/migration/install.js +83 -0
- package/scripts/migration/migrate-hooks.js +173 -0
- package/scripts/migration/migration-examples.ts +318 -0
- package/scripts/migration/reorganize-workspace.js +504 -0
- package/scripts/migration/test-update-paths.js +359 -0
- package/scripts/migration/update-paths.js +664 -0
- package/scripts/migration/validate-migration.js +647 -0
- package/scripts/monitor-loop.sh +65 -0
- package/scripts/monitor-memory.sh +47 -0
- package/scripts/monitor-migration.js +339 -0
- package/scripts/monitor.py +43 -0
- package/scripts/monitoring/README.md +178 -0
- package/scripts/monitoring/alert-monitor.sh +220 -0
- package/scripts/monitoring/analyze-resources.sh +199 -0
- package/scripts/monitoring/dashboards/rate-limiting-dashboard.json +211 -0
- package/scripts/monitoring/dynamic-monitor.sh +85 -0
- package/scripts/monitoring/launch-stability-test.sh +184 -0
- package/scripts/monitoring/monitor-test.sh +93 -0
- package/scripts/monitoring/pre-test-validation.sh +208 -0
- package/scripts/monitoring/quick-test-alerting.sh +118 -0
- package/scripts/monitoring/quick-test-rate-limiting.sh +206 -0
- package/scripts/monitoring/rate-limiting-monitor.sh +380 -0
- package/scripts/monitoring/resource-monitor.sh +126 -0
- package/scripts/monitoring/stability-monitor.js +429 -0
- package/scripts/monitoring/test-monitor-quick.sh +54 -0
- package/scripts/monitoring/view-alerts.sh +307 -0
- package/scripts/npm-metrics-collector.js +482 -0
- package/scripts/npm-package-validation.cjs +299 -0
- package/scripts/optimization/build-optimizer.js +438 -0
- package/scripts/optimization/config-validator.js +761 -0
- package/scripts/optimization/test-optimization.js +432 -0
- package/scripts/optimization/unified-activation.js +839 -0
- package/scripts/optimize-package-swarm.js +54 -0
- package/scripts/performance/ACTIVATION_COMMANDS.md +292 -0
- package/scripts/performance/sqlite-enhanced-activation.sh +583 -0
- package/scripts/performance/test-enhanced-backend.sh +504 -0
- package/scripts/performance-monitor.js +644 -0
- package/scripts/performance-test-runner.js +698 -0
- package/scripts/post-deployment-monitoring.js +350 -0
- package/scripts/post-edit-pipeline.js +2091 -0
- package/scripts/post-install-claude-md.js +78 -0
- package/scripts/postinstall.js +79 -0
- package/scripts/pre-publish-validation.cjs +212 -0
- package/scripts/pre-publish-validation.js +429 -0
- package/scripts/redis-lua/cleanup-blocking-coordination.lua +198 -0
- package/scripts/release-announcement.js +425 -0
- package/scripts/release-notification.js +248 -0
- package/scripts/release-rollback.js +376 -0
- package/scripts/release-validation.js +460 -0
- package/scripts/rollback-sdk.sh +66 -0
- package/scripts/run-production-validation.ts +590 -0
- package/scripts/run-stability-validation.sh +687 -0
- package/scripts/security/README.md +339 -0
- package/scripts/security/deployment-validation.cjs +279 -0
- package/scripts/security/envelope-encryption-confidence-report.cjs +422 -0
- package/scripts/security/install-git-hooks.sh +132 -0
- package/scripts/security/install-git-secrets.sh +295 -0
- package/scripts/security/rotate-api-keys.js +469 -0
- package/scripts/security/ruv-swarm-safe.js +74 -0
- package/scripts/security/security-audit.cjs +538 -0
- package/scripts/security/setup-redis-auth.sh +397 -0
- package/scripts/security/validate-envelope-encryption.cjs +340 -0
- package/scripts/security-scan.js +492 -0
- package/scripts/src/web/frontend/.claude-flow/metrics/agent-metrics.json +1 -0
- package/scripts/src/web/frontend/.claude-flow/metrics/performance.json +9 -0
- package/scripts/src/web/frontend/.claude-flow/metrics/task-metrics.json +10 -0
- package/scripts/switch-api.sh +158 -0
- package/scripts/sync-agents.js +290 -0
- package/scripts/test/50-agent-test.js +625 -0
- package/scripts/test/NEW_STABILITY_TEST_GUIDE.md +407 -0
- package/scripts/test/README.md +236 -0
- package/scripts/test/STABILITY_TEST_EXAMPLE.md +347 -0
- package/scripts/test/STABILITY_TEST_README.md +480 -0
- package/scripts/test/agent-worker.js +309 -0
- package/scripts/test/ai-coordination-test.js +650 -0
- package/scripts/test/ai-mesh-coordination-test.js +416 -0
- package/scripts/test/check-links.ts +274 -0
- package/scripts/test/check-performance-regression.ts +168 -0
- package/scripts/test/cli-agent-coordination-test.js +313 -0
- package/scripts/test/coordinator-multilingual-test.js +396 -0
- package/scripts/test/coordinator-transparency-demo.js +585 -0
- package/scripts/test/coverage-report.ts +692 -0
- package/scripts/test/generate-swarm-tests.js +633 -0
- package/scripts/test/integration-test-validation.cjs +253 -0
- package/scripts/test/load-test-swarm.js +576 -0
- package/scripts/test/mesh-coordination-zero-overlap-test.js +740 -0
- package/scripts/test/multilingual-hello-world-test.js +390 -0
- package/scripts/test/quick-multilingual-demo.js +464 -0
- package/scripts/test/real-agent-test.js +312 -0
- package/scripts/test/run-phase3-compliance-tests.js +427 -0
- package/scripts/test/run-stability-test-examples.sh +292 -0
- package/scripts/test/stability-results/stability-metrics.jsonl +83 -0
- package/scripts/test/stability-results/stability-test-report.json +128 -0
- package/scripts/test/stability-results/stability-test.log +1827 -0
- package/scripts/test/stability-test-50-agents.js +734 -0
- package/scripts/test/test-batch-tasks.ts +29 -0
- package/scripts/test/test-byzantine-resolution.js +246 -0
- package/scripts/test/test-claude-spawn-options.sh +63 -0
- package/scripts/test/test-cli-wizard.js +331 -0
- package/scripts/test/test-comprehensive.js +401 -0
- package/scripts/test/test-coordination-features.ts +238 -0
- package/scripts/test/test-fallback-systems.js +276 -0
- package/scripts/test/test-init-command.ts +302 -0
- package/scripts/test/test-mcp.ts +251 -0
- package/scripts/test/test-runner.ts +568 -0
- package/scripts/test/test-swarm-integration.sh +92 -0
- package/scripts/test/test-swarm.ts +142 -0
- package/scripts/test/validation-summary.ts +408 -0
- package/scripts/test-cleanup-performance.sh +416 -0
- package/scripts/test-dashboard-auth.cjs +203 -0
- package/scripts/test-docker-deployment.sh +207 -0
- package/scripts/test-npm-package.cjs +167 -0
- package/scripts/test-provider-routing.cjs +226 -0
- package/scripts/test-routing-telemetry.cjs +147 -0
- package/scripts/test-runner.cjs +154 -0
- package/scripts/test-zai-10k.cjs +81 -0
- package/scripts/test-zai-api.cjs +191 -0
- package/scripts/test-zai-diagnostic.cjs +151 -0
- package/scripts/test-zai-final.cjs +128 -0
- package/scripts/test-zai-with-env.cjs +85 -0
- package/scripts/utils/README.md +261 -0
- package/scripts/utils/clean-build-artifacts.sh +94 -0
- package/scripts/utils/cleanup-root.sh +69 -0
- package/scripts/utils/fix-cliffy-imports.js +307 -0
- package/scripts/utils/fix-duplicate-imports.js +114 -0
- package/scripts/utils/fix-error-handling.cjs +70 -0
- package/scripts/utils/fix-import-paths.js +104 -0
- package/scripts/utils/fix-imports.js +116 -0
- package/scripts/utils/fix-shebang.js +78 -0
- package/scripts/utils/fix-test-modules.js +27 -0
- package/scripts/utils/fix-timezone-issue-246.js +200 -0
- package/scripts/utils/fix-ts-comprehensive.py +182 -0
- package/scripts/utils/fix-ts-targeted-batch.js +250 -0
- package/scripts/utils/remove-benchmark-conflicts.sh +140 -0
- package/scripts/utils/simple-test-fixer.js +190 -0
- package/scripts/utils/validate-metrics-structure.cjs +144 -0
- package/scripts/validate-agent-hooks.js +506 -0
- package/scripts/validate-changelog.js +241 -0
- package/scripts/validate-coordination-cli.js +69 -0
- package/scripts/validate-coordination-toggle-integration.cjs +501 -0
- package/scripts/validate-docker-infrastructure.sh +502 -0
- package/scripts/validate-entry-points.js +300 -0
- package/scripts/validate-stage3-performance.ts +377 -0
- package/scripts/validate-template-bundling.js +180 -0
- package/scripts/validation/README.md +33 -0
- package/scripts/validation/acl-security-validation.cjs +214 -0
- package/scripts/validation/acl-security-validation.js +402 -0
- package/scripts/validation/byzantine-verification.js +407 -0
- package/scripts/validation/final-phase-2-consensus.cjs +219 -0
- package/scripts/validation/final-security-validation.js +791 -0
- package/scripts/validation/final-wasm-validation.cjs +840 -0
- package/scripts/validation/integration-test-analysis.js +105 -0
- package/scripts/validation/phase-0-comprehensive-validation.js +474 -0
- package/scripts/validation/phase-0-consensus-report.js +139 -0
- package/scripts/validation/phase-0-final-report.js +112 -0
- package/scripts/validation/phase-0-redis-consensus-report.js +129 -0
- package/scripts/validation/phase-0-validation-improved.js +490 -0
- package/scripts/validation/phase-0-validation-test.js +65 -0
- package/scripts/validation/phase-1-consensus-report.cjs +342 -0
- package/scripts/validation/phase-1-consensus-validation.cjs +551 -0
- package/scripts/validation/phase-1-consensus-validation.js +551 -0
- package/scripts/validation/phase-2-consensus-report.cjs +186 -0
- package/scripts/validation/phase-2-validation.cjs +171 -0
- package/scripts/validation/phase-2-validation.js +171 -0
- package/scripts/validation/phase-4-consensus-report.js +181 -0
- package/scripts/validation/phase-4-final-validation.js +351 -0
- package/scripts/validation/phase-5-consensus-report.cjs +113 -0
- package/scripts/validation/phase-5-consensus-report.js +113 -0
- package/scripts/validation/security-analysis.js +49 -0
- package/scripts/validation/security-validation.js +492 -0
- package/scripts/validation/simple-security-validation.js +464 -0
- package/scripts/verify-installation.js +112 -0
- package/scripts/verify-mcp-server.js +86 -0
- package/scripts/verify-sdk-phase1.cjs +293 -0
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Multilingual Hello World Test with 50 Real CLI Agents
|
|
5
|
+
*
|
|
6
|
+
* Each agent writes a "Hello World" function in a different programming language
|
|
7
|
+
* and incorporates greetings from different languages around the world
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { spawn } from 'child_process';
|
|
11
|
+
import fs from 'fs/promises';
|
|
12
|
+
import path from 'path';
|
|
13
|
+
import { fileURLToPath } from 'url';
|
|
14
|
+
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = path.dirname(__filename);
|
|
17
|
+
|
|
18
|
+
class MultilingualHelloWorldTest {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.outputDir = './multilingual-hello-world-results';
|
|
21
|
+
this.testStartTime = Date.now();
|
|
22
|
+
this.agentResults = new Map();
|
|
23
|
+
this.completedAgents = 0;
|
|
24
|
+
this.totalAgents = 50;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Define 50 programming languages and world languages combinations
|
|
28
|
+
getLanguageCombinations() {
|
|
29
|
+
return [
|
|
30
|
+
{ progLang: 'Python', worldLang: 'Spanish', greeting: '¡Hola Mundo!', fileName: 'hola_mundo.py' },
|
|
31
|
+
{ progLang: 'JavaScript', worldLang: 'French', greeting: 'Bonjour le Monde!', fileName: 'bonjour_monde.js' },
|
|
32
|
+
{ progLang: 'Java', worldLang: 'German', greeting: 'Hallo Welt!', fileName: 'hallo_welt.java' },
|
|
33
|
+
{ progLang: 'C++', worldLang: 'Italian', greeting: 'Ciao Mondo!', fileName: 'ciao_mondo.cpp' },
|
|
34
|
+
{ progLang: 'Ruby', worldLang: 'Portuguese', greeting: 'Olá Mundo!', fileName: 'ola_mundo.rb' },
|
|
35
|
+
{ progLang: 'Go', worldLang: 'Japanese', greeting: 'こんにちは世界!', fileName: 'konnichiwa_sekai.go' },
|
|
36
|
+
{ progLang: 'Rust', worldLang: 'Russian', greeting: 'Привет мир!', fileName: 'privet_mir.rs' },
|
|
37
|
+
{ progLang: 'TypeScript', worldLang: 'Chinese', greeting: '你好,世界!', fileName: 'ni_hao_shijie.ts' },
|
|
38
|
+
{ progLang: 'PHP', worldLang: 'Arabic', greeting: 'مرحبا بالعالم!', fileName: 'marhaban_bialalam.php' },
|
|
39
|
+
{ progLang: 'Swift', worldLang: 'Hindi', greeting: 'नमस्ते दुनिया!', fileName: 'namaste_duniya.swift' },
|
|
40
|
+
{ progLang: 'Kotlin', worldLang: 'Korean', greeting: '안녕하세요 세계!', fileName: 'annyeonghaseyo_segye.kt' },
|
|
41
|
+
{ progLang: 'C#', worldLang: 'Dutch', greeting: 'Hallo Wereld!', fileName: 'hallo_wereld.cs' },
|
|
42
|
+
{ progLang: 'Perl', worldLang: 'Turkish', greeting: 'Merhaba Dünya!', fileName: 'merhaba_dunya.pl' },
|
|
43
|
+
{ progLang: 'R', worldLang: 'Polish', greeting: 'Witaj świecie!', fileName: 'witaj_swiecie.R' },
|
|
44
|
+
{ progLang: 'Scala', worldLang: 'Swedish', greeting: 'Hej Världen!', fileName: 'hej_varlden.scala' },
|
|
45
|
+
{ progLang: 'Lua', worldLang: 'Norwegian', greeting: 'Hei Verden!', fileName: 'hei_verden.lua' },
|
|
46
|
+
{ progLang: 'Haskell', worldLang: 'Finnish', greeting: 'Hei Maailma!', fileName: 'hei_maailma.hs' },
|
|
47
|
+
{ progLang: 'Dart', worldLang: 'Greek', greeting: 'Γειά σου Κόσμε!', fileName: 'geia_sou_kosme.dart' },
|
|
48
|
+
{ progLang: 'Elixir', worldLang: 'Hebrew', greeting: 'שלום עולם!', fileName: 'shalom_olam.ex' },
|
|
49
|
+
{ progLang: 'Julia', worldLang: 'Thai', greeting: 'สวัสดีชาวโลก!', fileName: 'sawasdi_chawlok.jl' },
|
|
50
|
+
{ progLang: 'Crystal', worldLang: 'Vietnamese', greeting: 'Xin chào thế giới!', fileName: 'xin_chao_the_gioi.cr' },
|
|
51
|
+
{ progLang: 'Nim', worldLang: 'Czech', greeting: 'Ahoj světe!', fileName: 'ahoj_svete.nim' },
|
|
52
|
+
{ progLang: 'Zig', worldLang: 'Hungarian', greeting: 'Helló Világ!', fileName: 'hello_vilag.zig' },
|
|
53
|
+
{ progLang: 'Odin', worldLang: 'Romanian', greeting: 'Salut Lume!', fileName: 'salut_lume.odin' },
|
|
54
|
+
{ progLang: 'V', worldLang: 'Danish', greeting: 'Hej Verden!', fileName: 'hej_verden.v' },
|
|
55
|
+
{ progLang: 'Wren', worldLang: 'Indonesian', greeting: 'Halo Dunia!', fileName: 'halo_dunia.wren' },
|
|
56
|
+
{ progLang: 'Clojure', worldLang: 'Malay', greeting: 'Hai dunia!', fileName: 'hai_dunia.clj' },
|
|
57
|
+
{ progLang: 'F#', worldLang: 'Filipino', greeting: 'Kamusta Mundo!', fileName: 'kamusta_mundo.fs' },
|
|
58
|
+
{ progLang: 'Erlang', worldLang: 'Ukrainian', greeting: 'Привіт Світ!', fileName: 'privit_svit.erl' },
|
|
59
|
+
{ progLang: 'Elm', worldLang: 'Bengali', greeting: 'হ্যালো বিশ্ব!', fileName: 'halo_bishvo.elm' },
|
|
60
|
+
{ progLang: 'Purescript', worldLang: 'Tamil', greeting: 'வணக்கம் உலகம்!', fileName: 'vanakkam_ulagam.purs' },
|
|
61
|
+
{ progLang: 'Reason', worldLang: 'Urdu', greeting: 'ہیلو ورلڈ!', fileName: 'hello_world.re' },
|
|
62
|
+
{ progLang: 'OCaml', worldLang: 'Persian', greeting: 'سلام دنیا!', fileName: 'salam_donya.ml' },
|
|
63
|
+
{ progLang: 'Common Lisp', worldLang: 'Swahili', greeting: 'Habari Dunia!', fileName: 'habari_dunia.lisp' },
|
|
64
|
+
{ progLang: 'Scheme', worldLang: 'Irish', greeting: 'Dia duit a dhomhain!', fileName: 'dia_duit_adhomain.scm' },
|
|
65
|
+
{ progLang: 'Smalltalk', worldLang: 'Icelandic', greeting: 'Halló heimur!', fileName: 'hallo_heimur.st' },
|
|
66
|
+
{ progLang: 'Fortran', worldLang: 'Latvian', greeting: 'Sveika pasauli!', fileName: 'sveika_pasauli.f90' },
|
|
67
|
+
{ progLang: 'COBOL', worldLang: 'Lithuanian', greeting: 'Sveikas, pasauli!', fileName: 'sveikas_pasauli.cob' },
|
|
68
|
+
{ progLang: 'Ada', worldLang: 'Estonian', greeting: 'Tere maailm!', fileName: 'tere_maailm.ada' },
|
|
69
|
+
{ progLang: 'Bash', worldLang: 'Croatian', greeting: 'Pozdrav svijete!', fileName: 'pozdrav_svijete.sh' },
|
|
70
|
+
{ progLang: 'PowerShell', worldLang: 'Serbian', greeting: 'Здраво свете!', fileName: 'zdravo_svete.ps1' },
|
|
71
|
+
{ progLang: 'SQL', worldLang: 'Slovenian', greeting: 'Pozdravljen svet!', fileName: 'pozdravljen_svet.sql' },
|
|
72
|
+
{ progLang: 'HTML', worldLang: 'Estonian', greeting: 'Tere maailm!', fileName: 'tere_maailm.html' },
|
|
73
|
+
{ progLang: 'CSS', worldLang: 'Albanian', greeting: 'Përshëndetje Botë!', fileName: 'pershendetje_bote.css' },
|
|
74
|
+
{ progLang: 'LaTeX', worldLang: 'Macedonian', greeting: 'Здраво свету!', fileName: 'zdravo_svetu.tex' },
|
|
75
|
+
{ progLang: 'Matlab', worldLang: 'Bulgarian', greeting: 'Здравей, свят!', fileName: 'zdravei_svyat.m' },
|
|
76
|
+
{ progLang: 'Assembly', worldLang: 'Georgian', greeting: 'გამარჯობა მსოფლიო!', fileName: 'gamarjoba_msoplio.asm' },
|
|
77
|
+
{ progLang: 'Brainfuck', worldLang: 'Armenian', greeting: 'Բարև աշխարհ!', fileName: 'barev_ashkharh.bf' }
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async start() {
|
|
82
|
+
console.log('🌍 Starting Multilingual Hello World Test with 50 Real CLI Agents');
|
|
83
|
+
console.log(' Each agent will write a Hello World function in a different programming language');
|
|
84
|
+
console.log(' Each will incorporate greetings from different languages around the world\n');
|
|
85
|
+
|
|
86
|
+
await fs.mkdir(this.outputDir, { recursive: true });
|
|
87
|
+
|
|
88
|
+
// Step 1: Initialize swarm
|
|
89
|
+
await this.initializeSwarm();
|
|
90
|
+
|
|
91
|
+
// Step 2: Spawn 50 real agents with different language combinations
|
|
92
|
+
await this.spawnMultilingualAgents();
|
|
93
|
+
|
|
94
|
+
// Step 3: Monitor progress and collect results
|
|
95
|
+
await this.monitorAgentProgress();
|
|
96
|
+
|
|
97
|
+
// Step 4: Generate comprehensive report
|
|
98
|
+
await this.generateMultilingualReport();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async initializeSwarm() {
|
|
102
|
+
console.log('📋 Step 1: Initializing swarm for multilingual test...');
|
|
103
|
+
|
|
104
|
+
return new Promise((resolve) => {
|
|
105
|
+
const swarmInit = spawn('claude-flow-novice', ['swarm', 'init', 'mesh', '50', 'balanced'], {
|
|
106
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
107
|
+
cwd: __dirname
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
swarmInit.stdout.on('data', (data) => {
|
|
111
|
+
console.log(` ${data.toString().trim()}`);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
swarmInit.stderr.on('data', (data) => {
|
|
115
|
+
console.error(` ERROR: ${data.toString().trim()}`);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
swarmInit.on('close', (code) => {
|
|
119
|
+
console.log(`✅ Swarm initialization completed\n`);
|
|
120
|
+
resolve();
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
setTimeout(() => {
|
|
124
|
+
swarmInit.kill();
|
|
125
|
+
resolve();
|
|
126
|
+
}, 10000);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async spawnMultilingualAgents() {
|
|
131
|
+
console.log('🤖 Step 2: Spawning 50 multilingual agents...');
|
|
132
|
+
|
|
133
|
+
const combinations = this.getLanguageCombinations();
|
|
134
|
+
|
|
135
|
+
for (let i = 0; i < combinations.length; i++) {
|
|
136
|
+
const { progLang, worldLang, greeting, fileName } = combinations[i];
|
|
137
|
+
const agentName = `${progLang}-${worldLang}-Agent-${i + 1}`;
|
|
138
|
+
|
|
139
|
+
console.log(` [${i + 1}/50] Spawning ${agentName}`);
|
|
140
|
+
console.log(` Programming: ${progLang}, World Language: ${worldLang}`);
|
|
141
|
+
console.log(` Greeting: ${greeting}`);
|
|
142
|
+
|
|
143
|
+
await this.spawnAgentWithTask(i + 1, agentName, progLang, worldLang, greeting, fileName);
|
|
144
|
+
|
|
145
|
+
// Small delay between spawns to avoid overwhelming the system
|
|
146
|
+
if (i % 5 === 0) {
|
|
147
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
console.log(`✅ Spawned ${combinations.length} multilingual agents\n`);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
async spawnAgentWithTask(agentId, agentName, progLang, worldLang, greeting, fileName) {
|
|
155
|
+
const task = `
|
|
156
|
+
Create a Hello World function in ${progLang} that incorporates the ${worldLang} greeting "${greeting}".
|
|
157
|
+
|
|
158
|
+
Requirements:
|
|
159
|
+
1. Write a complete, working ${progLang} program/function
|
|
160
|
+
2. Include the ${worldLang} greeting "${greeting}" prominently
|
|
161
|
+
3. Add comments explaining both the programming language and the world language
|
|
162
|
+
4. Ensure the code is syntactically correct and follows best practices
|
|
163
|
+
5. Include a brief explanation of the cultural context of the greeting
|
|
164
|
+
6. Save the code to a file named "${fileName}"
|
|
165
|
+
|
|
166
|
+
The function should demonstrate both programming diversity and cultural diversity.
|
|
167
|
+
`;
|
|
168
|
+
|
|
169
|
+
return new Promise((resolve) => {
|
|
170
|
+
const agentProcess = spawn('claude-flow-novice', ['swarm', 'spawn', 'coder', agentName], {
|
|
171
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
172
|
+
cwd: this.outputDir
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
let output = '';
|
|
176
|
+
let hasResponded = false;
|
|
177
|
+
|
|
178
|
+
agentProcess.stdout.on('data', (data) => {
|
|
179
|
+
const text = data.toString();
|
|
180
|
+
output += text;
|
|
181
|
+
|
|
182
|
+
// Check if agent has produced meaningful output
|
|
183
|
+
if (text.includes('function') || text.includes('def') || text.includes('class') || text.includes(fileName)) {
|
|
184
|
+
hasResponded = true;
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
agentProcess.stderr.on('data', (data) => {
|
|
189
|
+
console.error(` [${agentName}] ERROR: ${data.toString().trim()}`);
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
agentProcess.on('close', (code) => {
|
|
193
|
+
this.agentResults.set(agentId, {
|
|
194
|
+
agentName,
|
|
195
|
+
progLang,
|
|
196
|
+
worldLang,
|
|
197
|
+
greeting,
|
|
198
|
+
fileName,
|
|
199
|
+
output: output,
|
|
200
|
+
success: hasResponded || code === 0,
|
|
201
|
+
exitCode: code,
|
|
202
|
+
timestamp: Date.now()
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
if (hasResponded || code === 0) {
|
|
206
|
+
this.completedAgents++;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
resolve();
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// Send the task to the agent
|
|
213
|
+
agentProcess.stdin.write(task + '\n');
|
|
214
|
+
|
|
215
|
+
// Timeout after 30 seconds
|
|
216
|
+
setTimeout(() => {
|
|
217
|
+
if (!hasResponded) {
|
|
218
|
+
agentProcess.kill();
|
|
219
|
+
}
|
|
220
|
+
resolve();
|
|
221
|
+
}, 30000);
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
async monitorAgentProgress() {
|
|
226
|
+
console.log('📊 Step 3: Monitoring agent progress...');
|
|
227
|
+
|
|
228
|
+
let progress = 0;
|
|
229
|
+
const monitorInterval = setInterval(() => {
|
|
230
|
+
progress = this.completedAgents;
|
|
231
|
+
const percentage = (progress / this.totalAgents * 100).toFixed(1);
|
|
232
|
+
|
|
233
|
+
console.log(` Progress: ${progress}/${this.totalAgents} agents (${percentage}%) completed`);
|
|
234
|
+
|
|
235
|
+
if (progress >= this.totalAgents) {
|
|
236
|
+
clearInterval(monitorInterval);
|
|
237
|
+
console.log('✅ All agents completed their tasks\n');
|
|
238
|
+
}
|
|
239
|
+
}, 5000);
|
|
240
|
+
|
|
241
|
+
// Wait for all agents to complete (max 5 minutes)
|
|
242
|
+
return new Promise((resolve) => {
|
|
243
|
+
const checkCompletion = () => {
|
|
244
|
+
if (this.completedAgents >= this.totalAgents) {
|
|
245
|
+
clearInterval(monitorInterval);
|
|
246
|
+
resolve();
|
|
247
|
+
} else if (Date.now() - this.testStartTime > 300000) { // 5 minute timeout
|
|
248
|
+
console.log('⚠️ Test timeout reached\n');
|
|
249
|
+
clearInterval(monitorInterval);
|
|
250
|
+
resolve();
|
|
251
|
+
} else {
|
|
252
|
+
setTimeout(checkCompletion, 2000);
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
checkCompletion();
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
async generateMultilingualReport() {
|
|
260
|
+
console.log('📋 Step 4: Generating multilingual test report...');
|
|
261
|
+
|
|
262
|
+
const testDuration = Date.now() - this.testStartTime;
|
|
263
|
+
const successfulAgents = Array.from(this.agentResults.values()).filter(a => a.success).length;
|
|
264
|
+
const programmingLanguages = new Set(Array.from(this.agentResults.values()).map(a => a.progLang));
|
|
265
|
+
const worldLanguages = new Set(Array.from(this.agentResults.values()).map(a => a.worldLang));
|
|
266
|
+
|
|
267
|
+
const report = {
|
|
268
|
+
test: {
|
|
269
|
+
type: 'multilingual-hello-world-test',
|
|
270
|
+
duration: testDuration,
|
|
271
|
+
startTime: new Date(this.testStartTime).toISOString(),
|
|
272
|
+
endTime: new Date().toISOString(),
|
|
273
|
+
totalAgents: this.totalAgents
|
|
274
|
+
},
|
|
275
|
+
results: {
|
|
276
|
+
completedAgents: this.completedAgents,
|
|
277
|
+
successfulAgents: successfulAgents,
|
|
278
|
+
successRate: (successfulAgents / this.totalAgents * 100).toFixed(2) + '%',
|
|
279
|
+
programmingLanguagesCount: programmingLanguages.size,
|
|
280
|
+
worldLanguagesCount: worldLanguages.size
|
|
281
|
+
},
|
|
282
|
+
diversity: {
|
|
283
|
+
programmingLanguages: Array.from(programmingLanguages).sort(),
|
|
284
|
+
worldLanguages: Array.from(worldLanguages).sort(),
|
|
285
|
+
uniqueGreetings: Array.from(this.agentResults.values()).map(a => a.greeting)
|
|
286
|
+
},
|
|
287
|
+
agentDetails: Array.from(this.agentResults.entries()).map(([id, agent]) => ({
|
|
288
|
+
id,
|
|
289
|
+
name: agent.agentName,
|
|
290
|
+
programmingLanguage: agent.progLang,
|
|
291
|
+
worldLanguage: agent.worldLang,
|
|
292
|
+
greeting: agent.greeting,
|
|
293
|
+
fileName: agent.fileName,
|
|
294
|
+
success: agent.success,
|
|
295
|
+
outputLength: agent.output.length
|
|
296
|
+
}))
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
const reportFile = path.join(this.outputDir, `multilingual-test-report-${Date.now()}.json`);
|
|
300
|
+
await fs.writeFile(reportFile, JSON.stringify(report, null, 2));
|
|
301
|
+
|
|
302
|
+
// Generate a summary text file
|
|
303
|
+
const summaryFile = path.join(this.outputDir, `multilingual-summary-${Date.now()}.txt`);
|
|
304
|
+
const summary = this.generateTextSummary(report);
|
|
305
|
+
await fs.writeFile(summaryFile, summary);
|
|
306
|
+
|
|
307
|
+
console.log('\n🌍 MULTILINGUAL HELLO WORLD TEST RESULTS:');
|
|
308
|
+
console.log(` Test Duration: ${(testDuration / 1000).toFixed(2)} seconds`);
|
|
309
|
+
console.log(` Total Agents: ${this.totalAgents}`);
|
|
310
|
+
console.log(` Completed Agents: ${this.completedAgents}`);
|
|
311
|
+
console.log(` Successful Agents: ${successfulAgents} (${report.results.successRate})`);
|
|
312
|
+
console.log(` Programming Languages: ${programmingLanguages.size}`);
|
|
313
|
+
console.log(` World Languages: ${worldLanguages.size}`);
|
|
314
|
+
console.log(` Report saved to: ${reportFile}`);
|
|
315
|
+
console.log(` Summary saved to: ${summaryFile}`);
|
|
316
|
+
|
|
317
|
+
console.log('\n🌐 LANGUAGE DIVERSITY SHOWCASE:');
|
|
318
|
+
this.showLanguageSamples();
|
|
319
|
+
|
|
320
|
+
console.log('\n🎯 SUMMARY:');
|
|
321
|
+
if (report.results.successRate === '100.00%') {
|
|
322
|
+
console.log(' ✅ Perfect success! All 50 agents created Hello World functions in different languages!');
|
|
323
|
+
console.log(' 🌍 Demonstrated both programming diversity and cultural diversity!');
|
|
324
|
+
} else {
|
|
325
|
+
console.log(` ⚠️ ${report.results.successRate} success rate. Some agents may need more time.`);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
generateTextSummary(report) {
|
|
330
|
+
let summary = 'MULTILINGUAL HELLO WORLD TEST SUMMARY\n';
|
|
331
|
+
summary += '=' .repeat(50) + '\n\n';
|
|
332
|
+
summary += `Test Duration: ${(report.test.duration / 1000).toFixed(2)} seconds\n`;
|
|
333
|
+
summary += `Success Rate: ${report.results.successRate}\n`;
|
|
334
|
+
summary += `Programming Languages: ${report.diversity.programmingLanguages.join(', ')}\n`;
|
|
335
|
+
summary += `World Languages: ${report.diversity.worldLanguages.join(', ')}\n\n`;
|
|
336
|
+
|
|
337
|
+
summary += 'AGENT RESULTS:\n';
|
|
338
|
+
summary += '-'.repeat(50) + '\n';
|
|
339
|
+
|
|
340
|
+
for (const agent of report.agentDetails) {
|
|
341
|
+
summary += `${agent.id}. ${agent.programmingLanguage} + ${agent.worldLanguage}\n`;
|
|
342
|
+
summary += ` Greeting: ${agent.greeting}\n`;
|
|
343
|
+
summary += ` File: ${agent.fileName}\n`;
|
|
344
|
+
summary += ` Status: ${agent.success ? '✅ Success' : '❌ Failed'}\n\n`;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
return summary;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
showLanguageSamples() {
|
|
351
|
+
const samples = Array.from(this.agentResults.values()).slice(0, 10);
|
|
352
|
+
for (const agent of samples) {
|
|
353
|
+
console.log(` ${agent.progLang} + ${agent.worldLang}: "${agent.greeting}"`);
|
|
354
|
+
}
|
|
355
|
+
if (this.agentResults.size > 10) {
|
|
356
|
+
console.log(` ... and ${this.agentResults.size - 10} more language combinations!`);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// CLI interface
|
|
362
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
363
|
+
if (process.argv.includes('--help')) {
|
|
364
|
+
console.log(`
|
|
365
|
+
Multilingual Hello World Test with 50 Real CLI Agents
|
|
366
|
+
|
|
367
|
+
Usage: node multilingual-hello-world-test.js
|
|
368
|
+
|
|
369
|
+
This test:
|
|
370
|
+
1. Spawns 50 real Claude Code agents via CLI
|
|
371
|
+
2. Each agent writes a Hello World function in a different programming language
|
|
372
|
+
3. Each incorporates greetings from different languages around the world
|
|
373
|
+
4. Demonstrates both programming diversity and cultural diversity
|
|
374
|
+
5. Generates a comprehensive report of all language combinations
|
|
375
|
+
|
|
376
|
+
The agents will create Hello World functions in 50+ programming languages
|
|
377
|
+
with greetings from 50+ world languages.
|
|
378
|
+
`);
|
|
379
|
+
process.exit(0);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const test = new MultilingualHelloWorldTest();
|
|
383
|
+
|
|
384
|
+
test.start().catch(error => {
|
|
385
|
+
console.error('Test failed:', error);
|
|
386
|
+
process.exit(1);
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export default MultilingualHelloWorldTest;
|