claude-flow-novice 2.3.4 ā 2.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/booster/performance-benchmark.js +1 -1
- package/dist/src/booster/wasm-demo.js +1 -1
- package/dist/src/cli/command-registry.js +2 -2
- package/dist/src/cli/help-formatter.js +137 -109
- package/dist/src/cli/simple-cli.js +2528 -2121
- package/dist/src/cli/simple-commands/sparc/refinement.js +3 -3
- package/dist/src/cli/validation-helper.js +98 -49
- package/dist/src/commands/suggest-templates.js +4 -4
- package/dist/src/core/version.js +23 -15
- package/dist/src/memory/swarm-memory.js +603 -470
- package/dist/src/slash-commands/fullstack.js +2 -2
- package/dist/src/slash-commands/parse-epic.js +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +41 -31
- package/dist/scripts/.claude-flow/metrics/agent-metrics.json +0 -1
- package/dist/scripts/.claude-flow/metrics/performance.json +0 -9
- package/dist/scripts/.claude-flow/metrics/task-metrics.json +0 -10
- package/dist/scripts/CLEANUP_OPTIMIZATION_REPORT.json +0 -312
- package/dist/scripts/CLEANUP_PERFORMANCE_OPTIMIZATION.md +0 -387
- package/dist/scripts/CLEANUP_QUICK_START.md +0 -268
- package/dist/scripts/CLEANUP_TEST_RESULTS.md +0 -205
- package/dist/scripts/README.md +0 -339
- package/dist/scripts/ace-query.sh +0 -384
- package/dist/scripts/agent-token-analysis.js +0 -430
- package/dist/scripts/auto-setup.js +0 -332
- package/dist/scripts/build/README.md +0 -167
- package/dist/scripts/build/build-config.js +0 -27
- package/dist/scripts/build/build-prompt-copier.sh +0 -30
- package/dist/scripts/build/performance-monitor.js +0 -869
- package/dist/scripts/build/prepare-publish.js +0 -150
- package/dist/scripts/build/typescript-fixer.js +0 -621
- package/dist/scripts/build/unified-builder.sh +0 -428
- package/dist/scripts/build/update-bin-version.js +0 -32
- package/dist/scripts/build/validate-agents.js +0 -238
- package/dist/scripts/build-index.js +0 -43
- package/dist/scripts/build-orchestrator.js +0 -320
- package/dist/scripts/check-routing-stats.cjs +0 -122
- package/dist/scripts/ci-validation.js +0 -375
- package/dist/scripts/cleanup-blocking-coordination.sh +0 -420
- package/dist/scripts/cleanup-idle-sessions.sh +0 -118
- package/dist/scripts/collect-build-metrics.js +0 -65
- package/dist/scripts/demo/README.md +0 -79
- package/dist/scripts/demo/autoscaling-demo-simplified.js +0 -963
- package/dist/scripts/demo/comprehensive-dashboard-test.js +0 -693
- package/dist/scripts/demo/confidence-log.js +0 -87
- package/dist/scripts/demo/confidence-report.js +0 -82
- package/dist/scripts/demo/demo-multi-swarm-coordination.js +0 -325
- package/dist/scripts/demo/demo-production-deployment.js +0 -399
- package/dist/scripts/demo/demo-visualization-system.js +0 -149
- package/dist/scripts/demo/performance-analysis.cjs +0 -71
- package/dist/scripts/demo/performance-analysis.js +0 -71
- package/dist/scripts/demo/test-autoscaling-demo.js +0 -314
- package/dist/scripts/dependency-optimizer.js +0 -349
- package/dist/scripts/dependency-security-assessment.js +0 -331
- package/dist/scripts/deploy-sdk.sh +0 -176
- package/dist/scripts/deployment-readiness-report.json +0 -179
- package/dist/scripts/dev/README.md +0 -264
- package/dist/scripts/dev/claude-flow-wrapper.sh +0 -35
- package/dist/scripts/dev/claude-monitor.py +0 -419
- package/dist/scripts/dev/claude-sparc.sh +0 -562
- package/dist/scripts/dev/claude-wrapper.sh +0 -17
- package/dist/scripts/dev/demo-phase3-compliance.js +0 -172
- package/dist/scripts/dev/demo-task-system.ts +0 -224
- package/dist/scripts/dev/deployment-validator.js +0 -315
- package/dist/scripts/dev/spawn-claude-terminal.sh +0 -32
- package/dist/scripts/dev/start-portal.sh +0 -506
- package/dist/scripts/dev/start-web-ui.js +0 -15
- package/dist/scripts/dev/stop-portal.sh +0 -311
- package/dist/scripts/dev/validate-examples.ts +0 -288
- package/dist/scripts/dev/validate-phase2.cjs +0 -451
- package/dist/scripts/dev/validate-phase2.js +0 -785
- package/dist/scripts/dev/validate-phase3.cjs +0 -208
- package/dist/scripts/dev/validate-security-remediation.js +0 -1
- package/dist/scripts/ecosystem.config.cjs +0 -90
- package/dist/scripts/enhanced-memory-spiral-killer.sh +0 -221
- package/dist/scripts/fix-js-extensions.js +0 -167
- package/dist/scripts/generate-basic-types.js +0 -73
- package/dist/scripts/generate-changelog.js +0 -318
- package/dist/scripts/git-hooks/pre-commit.sh +0 -143
- package/dist/scripts/health-checks.js +0 -634
- package/dist/scripts/hook-wrapper.sh +0 -54
- package/dist/scripts/install/README.md +0 -375
- package/dist/scripts/install/REDIS_SETUP_VALIDATION.json +0 -245
- package/dist/scripts/install/check-prerequisites.js +0 -303
- package/dist/scripts/install/config-wizard.js +0 -606
- package/dist/scripts/install/dependency-checker.js +0 -385
- package/dist/scripts/install/health-check.js +0 -765
- package/dist/scripts/install/install.js +0 -256
- package/dist/scripts/install/installation-benchmark.js +0 -461
- package/dist/scripts/install/quick-install.js +0 -720
- package/dist/scripts/install/quick-start-wizard.js +0 -295
- package/dist/scripts/install/redis-cli.js +0 -289
- package/dist/scripts/install/redis-install-guides.md +0 -407
- package/dist/scripts/install/redis-setup.js +0 -559
- package/dist/scripts/install/redis-test.js +0 -278
- package/dist/scripts/install/service-manager.js +0 -672
- package/dist/scripts/install/setup.js +0 -832
- package/dist/scripts/install/uninstall.js +0 -526
- package/dist/scripts/install/update.js +0 -461
- package/dist/scripts/install-pre-commit-hook.sh +0 -127
- package/dist/scripts/legacy/README.md +0 -272
- package/dist/scripts/legacy/batch-fix-ts.sh +0 -54
- package/dist/scripts/legacy/build-migration.sh +0 -105
- package/dist/scripts/legacy/build-monitor.js +0 -209
- package/dist/scripts/legacy/build-with-filter.sh +0 -84
- package/dist/scripts/legacy/build-workaround.sh +0 -71
- package/dist/scripts/legacy/fix-ts-advanced.js +0 -358
- package/dist/scripts/legacy/fix-ts-final.sh +0 -50
- package/dist/scripts/legacy/fix-ts-targeted.sh +0 -49
- package/dist/scripts/legacy/fix-typescript-errors.js +0 -305
- package/dist/scripts/legacy/force-build.sh +0 -63
- package/dist/scripts/legacy/optimize-performance.js +0 -400
- package/dist/scripts/legacy/performance-monitor.js +0 -263
- package/dist/scripts/legacy/performance-monitoring.js +0 -532
- package/dist/scripts/legacy/performance-test-runner.js +0 -645
- package/dist/scripts/legacy/quick-fix-ts.js +0 -281
- package/dist/scripts/legacy/safe-build.sh +0 -63
- package/dist/scripts/memory-monitor-coordinator.js +0 -451
- package/dist/scripts/migrate-to-sdk.sh +0 -520
- package/dist/scripts/migration/QUICK-START.md +0 -189
- package/dist/scripts/migration/QUICK-START.md.backup-1760135091363 +0 -189
- package/dist/scripts/migration/README.md +0 -464
- package/dist/scripts/migration/TASK-1.3.2-COMPLETION-REPORT.md +0 -500
- package/dist/scripts/migration/TASK-1.3.2-COMPLETION-REPORT.md.backup-1760135091348 +0 -500
- package/dist/scripts/migration/UPDATE-PATHS-README.md +0 -464
- package/dist/scripts/migration/UPDATE-PATHS-README.md.backup-1760135091337 +0 -464
- package/dist/scripts/migration/example-patterns.json +0 -19
- package/dist/scripts/migration/install-arm64.js +0 -78
- package/dist/scripts/migration/install.js +0 -83
- package/dist/scripts/migration/migrate-hooks.js +0 -173
- package/dist/scripts/migration/migration-examples.ts +0 -318
- package/dist/scripts/migration/reorganize-workspace.js +0 -504
- package/dist/scripts/migration/test-update-paths.js +0 -359
- package/dist/scripts/migration/update-paths.js +0 -664
- package/dist/scripts/migration/validate-migration.js +0 -647
- package/dist/scripts/monitor-loop.sh +0 -65
- package/dist/scripts/monitor-memory.sh +0 -47
- package/dist/scripts/monitor-migration.js +0 -339
- package/dist/scripts/monitor.py +0 -43
- package/dist/scripts/monitoring/README.md +0 -178
- package/dist/scripts/monitoring/alert-monitor.sh +0 -220
- package/dist/scripts/monitoring/analyze-resources.sh +0 -199
- package/dist/scripts/monitoring/dashboards/rate-limiting-dashboard.json +0 -211
- package/dist/scripts/monitoring/dynamic-monitor.sh +0 -85
- package/dist/scripts/monitoring/launch-stability-test.sh +0 -184
- package/dist/scripts/monitoring/monitor-test.sh +0 -93
- package/dist/scripts/monitoring/pre-test-validation.sh +0 -208
- package/dist/scripts/monitoring/quick-test-alerting.sh +0 -118
- package/dist/scripts/monitoring/quick-test-rate-limiting.sh +0 -206
- package/dist/scripts/monitoring/rate-limiting-monitor.sh +0 -380
- package/dist/scripts/monitoring/resource-monitor.sh +0 -126
- package/dist/scripts/monitoring/stability-monitor.js +0 -429
- package/dist/scripts/monitoring/test-monitor-quick.sh +0 -54
- package/dist/scripts/monitoring/view-alerts.sh +0 -307
- package/dist/scripts/npm-metrics-collector.js +0 -482
- package/dist/scripts/npm-package-validation.cjs +0 -299
- package/dist/scripts/optimization/build-optimizer.js +0 -438
- package/dist/scripts/optimization/config-validator.js +0 -761
- package/dist/scripts/optimization/test-optimization.js +0 -432
- package/dist/scripts/optimization/unified-activation.js +0 -839
- package/dist/scripts/optimize-package-swarm.js +0 -54
- package/dist/scripts/performance/ACTIVATION_COMMANDS.md +0 -292
- package/dist/scripts/performance/sqlite-enhanced-activation.sh +0 -583
- package/dist/scripts/performance/test-enhanced-backend.sh +0 -504
- package/dist/scripts/performance-monitor.js +0 -644
- package/dist/scripts/performance-test-runner.js +0 -698
- package/dist/scripts/post-deployment-monitoring.js +0 -350
- package/dist/scripts/post-edit-pipeline.js +0 -2091
- package/dist/scripts/post-install-claude-md.js +0 -78
- package/dist/scripts/postinstall.js +0 -84
- package/dist/scripts/pre-publish-validation.cjs +0 -212
- package/dist/scripts/pre-publish-validation.js +0 -429
- package/dist/scripts/redis-lua/cleanup-blocking-coordination.lua +0 -198
- package/dist/scripts/release-announcement.js +0 -425
- package/dist/scripts/release-notification.js +0 -248
- package/dist/scripts/release-rollback.js +0 -376
- package/dist/scripts/release-validation.js +0 -460
- package/dist/scripts/rollback-sdk.sh +0 -66
- package/dist/scripts/run-production-validation.ts +0 -590
- package/dist/scripts/run-stability-validation.sh +0 -687
- package/dist/scripts/security/README.md +0 -339
- package/dist/scripts/security/deployment-validation.cjs +0 -279
- package/dist/scripts/security/envelope-encryption-confidence-report.cjs +0 -422
- package/dist/scripts/security/install-git-hooks.sh +0 -132
- package/dist/scripts/security/install-git-secrets.sh +0 -295
- package/dist/scripts/security/rotate-api-keys.js +0 -469
- package/dist/scripts/security/ruv-swarm-safe.js +0 -74
- package/dist/scripts/security/security-audit.cjs +0 -538
- package/dist/scripts/security/setup-redis-auth.sh +0 -397
- package/dist/scripts/security/validate-envelope-encryption.cjs +0 -340
- package/dist/scripts/security-scan.js +0 -492
- package/dist/scripts/src/web/frontend/.claude-flow/metrics/agent-metrics.json +0 -1
- package/dist/scripts/src/web/frontend/.claude-flow/metrics/performance.json +0 -9
- package/dist/scripts/src/web/frontend/.claude-flow/metrics/task-metrics.json +0 -10
- package/dist/scripts/switch-api.sh +0 -159
- package/dist/scripts/sync-agents.js +0 -290
- package/dist/scripts/test/50-agent-test.js +0 -625
- package/dist/scripts/test/NEW_STABILITY_TEST_GUIDE.md +0 -407
- package/dist/scripts/test/README.md +0 -236
- package/dist/scripts/test/STABILITY_TEST_EXAMPLE.md +0 -347
- package/dist/scripts/test/STABILITY_TEST_README.md +0 -480
- package/dist/scripts/test/agent-worker.js +0 -309
- package/dist/scripts/test/ai-coordination-test.js +0 -650
- package/dist/scripts/test/ai-mesh-coordination-test.js +0 -416
- package/dist/scripts/test/check-links.ts +0 -274
- package/dist/scripts/test/check-performance-regression.ts +0 -168
- package/dist/scripts/test/cli-agent-coordination-test.js +0 -313
- package/dist/scripts/test/coordinator-multilingual-test.js +0 -396
- package/dist/scripts/test/coordinator-transparency-demo.js +0 -585
- package/dist/scripts/test/coverage-report.ts +0 -692
- package/dist/scripts/test/generate-swarm-tests.js +0 -633
- package/dist/scripts/test/integration-test-validation.cjs +0 -253
- package/dist/scripts/test/load-test-swarm.js +0 -576
- package/dist/scripts/test/mesh-coordination-zero-overlap-test.js +0 -740
- package/dist/scripts/test/multilingual-hello-world-test.js +0 -390
- package/dist/scripts/test/quick-multilingual-demo.js +0 -464
- package/dist/scripts/test/real-agent-test.js +0 -312
- package/dist/scripts/test/run-phase3-compliance-tests.js +0 -427
- package/dist/scripts/test/run-stability-test-examples.sh +0 -292
- package/dist/scripts/test/stability-results/stability-metrics.jsonl +0 -83
- package/dist/scripts/test/stability-results/stability-test-report.json +0 -128
- package/dist/scripts/test/stability-results/stability-test.log +0 -1827
- package/dist/scripts/test/stability-test-50-agents.js +0 -734
- package/dist/scripts/test/test-batch-tasks.ts +0 -29
- package/dist/scripts/test/test-byzantine-resolution.js +0 -246
- package/dist/scripts/test/test-claude-spawn-options.sh +0 -63
- package/dist/scripts/test/test-cli-wizard.js +0 -331
- package/dist/scripts/test/test-comprehensive.js +0 -401
- package/dist/scripts/test/test-coordination-features.ts +0 -238
- package/dist/scripts/test/test-fallback-systems.js +0 -276
- package/dist/scripts/test/test-init-command.ts +0 -302
- package/dist/scripts/test/test-mcp.ts +0 -251
- package/dist/scripts/test/test-runner.ts +0 -568
- package/dist/scripts/test/test-swarm-integration.sh +0 -92
- package/dist/scripts/test/test-swarm.ts +0 -142
- package/dist/scripts/test/validation-summary.ts +0 -408
- package/dist/scripts/test-cleanup-performance.sh +0 -416
- package/dist/scripts/test-dashboard-auth.cjs +0 -203
- package/dist/scripts/test-docker-deployment.sh +0 -207
- package/dist/scripts/test-npm-package.cjs +0 -167
- package/dist/scripts/test-provider-routing.cjs +0 -226
- package/dist/scripts/test-routing-telemetry.cjs +0 -147
- package/dist/scripts/test-runner.cjs +0 -154
- package/dist/scripts/test-zai-10k.cjs +0 -81
- package/dist/scripts/test-zai-api.cjs +0 -191
- package/dist/scripts/test-zai-diagnostic.cjs +0 -151
- package/dist/scripts/test-zai-final.cjs +0 -128
- package/dist/scripts/test-zai-with-env.cjs +0 -85
- package/dist/scripts/toggle-cost-savings.cjs +0 -302
- package/dist/scripts/unified-memory-monitor.js +0 -526
- package/dist/scripts/utils/README.md +0 -261
- package/dist/scripts/utils/clean-build-artifacts.sh +0 -94
- package/dist/scripts/utils/cleanup-root.sh +0 -69
- package/dist/scripts/utils/fix-cliffy-imports.js +0 -307
- package/dist/scripts/utils/fix-duplicate-imports.js +0 -114
- package/dist/scripts/utils/fix-error-handling.cjs +0 -70
- package/dist/scripts/utils/fix-import-paths.js +0 -104
- package/dist/scripts/utils/fix-imports.js +0 -116
- package/dist/scripts/utils/fix-shebang.js +0 -78
- package/dist/scripts/utils/fix-test-modules.js +0 -27
- package/dist/scripts/utils/fix-timezone-issue-246.js +0 -200
- package/dist/scripts/utils/fix-ts-comprehensive.py +0 -182
- package/dist/scripts/utils/fix-ts-targeted-batch.js +0 -250
- package/dist/scripts/utils/remove-benchmark-conflicts.sh +0 -140
- package/dist/scripts/utils/simple-test-fixer.js +0 -190
- package/dist/scripts/utils/validate-metrics-structure.cjs +0 -144
- package/dist/scripts/validate-agent-hooks.js +0 -506
- package/dist/scripts/validate-changelog.js +0 -241
- package/dist/scripts/validate-coordination-cli.js +0 -69
- package/dist/scripts/validate-coordination-toggle-integration.cjs +0 -501
- package/dist/scripts/validate-docker-infrastructure.sh +0 -502
- package/dist/scripts/validate-entry-points.js +0 -300
- package/dist/scripts/validate-memory-monitoring.sh +0 -225
- package/dist/scripts/validate-stage3-performance.ts +0 -377
- package/dist/scripts/validate-template-bundling.js +0 -180
- package/dist/scripts/validation/README.md +0 -33
- package/dist/scripts/validation/acl-security-validation.cjs +0 -214
- package/dist/scripts/validation/acl-security-validation.js +0 -402
- package/dist/scripts/validation/byzantine-verification.js +0 -407
- package/dist/scripts/validation/final-phase-2-consensus.cjs +0 -219
- package/dist/scripts/validation/final-security-validation.js +0 -791
- package/dist/scripts/validation/final-wasm-validation.cjs +0 -840
- package/dist/scripts/validation/integration-test-analysis.js +0 -105
- package/dist/scripts/validation/phase-0-comprehensive-validation.js +0 -474
- package/dist/scripts/validation/phase-0-consensus-report.js +0 -139
- package/dist/scripts/validation/phase-0-final-report.js +0 -112
- package/dist/scripts/validation/phase-0-redis-consensus-report.js +0 -129
- package/dist/scripts/validation/phase-0-validation-improved.js +0 -490
- package/dist/scripts/validation/phase-0-validation-test.js +0 -65
- package/dist/scripts/validation/phase-1-consensus-report.cjs +0 -342
- package/dist/scripts/validation/phase-1-consensus-validation.cjs +0 -551
- package/dist/scripts/validation/phase-1-consensus-validation.js +0 -551
- package/dist/scripts/validation/phase-2-consensus-report.cjs +0 -186
- package/dist/scripts/validation/phase-2-validation.cjs +0 -171
- package/dist/scripts/validation/phase-2-validation.js +0 -171
- package/dist/scripts/validation/phase-4-consensus-report.js +0 -181
- package/dist/scripts/validation/phase-4-final-validation.js +0 -351
- package/dist/scripts/validation/phase-5-consensus-report.cjs +0 -113
- package/dist/scripts/validation/phase-5-consensus-report.js +0 -113
- package/dist/scripts/validation/security-analysis.js +0 -49
- package/dist/scripts/validation/security-validation.js +0 -492
- package/dist/scripts/validation/simple-security-validation.js +0 -464
- package/dist/scripts/verify-installation.js +0 -112
- package/dist/scripts/verify-mcp-server.js +0 -86
- package/dist/scripts/verify-sdk-phase1.cjs +0 -293
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/accessibility/browser/accessibilityService.js +0 -88
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/accessibility/common/accessibility.js +0 -9
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/action/common/action.js +0 -7
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/action/common/actionCommonCategories.js +0 -13
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/browser/actionList.js +0 -276
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/browser/actionWidget.js +0 -248
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/common/actionWidget.js +0 -5
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actions/common/actions.js +0 -409
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/audioCues/browser/audioCueService.js +0 -176
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/clipboard/browser/clipboardService.js +0 -141
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/clipboard/common/clipboardService.js +0 -6
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/commands/common/commands.js +0 -80
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configuration.js +0 -86
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurationModels.js +0 -554
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurationRegistry.js +0 -317
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurations.js +0 -41
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/browser/contextKeyService.js +0 -432
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/common/contextkey.js +0 -1547
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/common/contextkeys.js +0 -18
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextMenuHandler.js +0 -124
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextMenuService.js +0 -101
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextView.js +0 -7
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextViewService.js +0 -72
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/dialogs/common/dialogs.js +0 -2
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/dnd/browser/dnd.js +0 -36
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/editor/common/editor.js +0 -17
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/environment/common/environment.js +0 -2
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/extensions/common/extensions.js +0 -47
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/files/common/files.js +0 -9
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +0 -105
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/instantiation/common/descriptors.js +0 -11
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/instantiation/common/extensions.js +0 -15
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/keybinding/common/abstractKeybindingService.js +0 -277
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/keybinding/common/baseResolvedKeybinding.js +0 -53
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +0 -354
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/theme/browser/defaultStyles.js +0 -162
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/theme/common/colorRegistry.js +0 -482
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/abap/abap.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/apex/apex.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/azcli/azcli.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/bat/bat.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/bicep/bicep.js +0 -11
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Z.ai API Diagnostic Test
|
|
5
|
-
* Tests multiple endpoint variations
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const https = require('https');
|
|
9
|
-
const fs = require('fs');
|
|
10
|
-
const path = require('path');
|
|
11
|
-
|
|
12
|
-
// Load .env
|
|
13
|
-
function loadEnv() {
|
|
14
|
-
const envPath = path.join(process.cwd(), '.env');
|
|
15
|
-
if (!fs.existsSync(envPath)) return false;
|
|
16
|
-
|
|
17
|
-
const envContent = fs.readFileSync(envPath, 'utf8');
|
|
18
|
-
envContent.split('\n').forEach(line => {
|
|
19
|
-
const trimmed = line.trim();
|
|
20
|
-
if (!trimmed || trimmed.startsWith('#')) return;
|
|
21
|
-
|
|
22
|
-
const match = trimmed.match(/^([^=]+)=(.*)$/);
|
|
23
|
-
if (match) {
|
|
24
|
-
const key = match[1].trim();
|
|
25
|
-
let value = match[2].trim();
|
|
26
|
-
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
27
|
-
(value.startsWith("'") && value.endsWith("'"))) {
|
|
28
|
-
value = value.slice(1, -1);
|
|
29
|
-
}
|
|
30
|
-
process.env[key] = value;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
loadEnv();
|
|
37
|
-
|
|
38
|
-
const API_KEY = process.env.ZAI_API_KEY || process.env.Z_AI_API_KEY;
|
|
39
|
-
|
|
40
|
-
if (!API_KEY) {
|
|
41
|
-
console.error('ā No API key found');
|
|
42
|
-
process.exit(1);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
console.log('\nš Z.ai API Diagnostic Test\n');
|
|
46
|
-
console.log('='.repeat(80));
|
|
47
|
-
console.log('\nā API Key:', API_KEY.substring(0, 15) + '...' + API_KEY.substring(API_KEY.length - 4));
|
|
48
|
-
|
|
49
|
-
// Test different endpoints and models
|
|
50
|
-
const tests = [
|
|
51
|
-
{
|
|
52
|
-
name: 'GLM-4.6 via /v1/chat/completions',
|
|
53
|
-
url: 'https://api.z.ai/v1/chat/completions',
|
|
54
|
-
model: 'glm-4.6'
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: 'GLM-4-Flash via /v1/chat/completions',
|
|
58
|
-
url: 'https://api.z.ai/v1/chat/completions',
|
|
59
|
-
model: 'glm-4-flash'
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'Claude via /v1/chat/completions',
|
|
63
|
-
url: 'https://api.z.ai/v1/chat/completions',
|
|
64
|
-
model: 'haiku'
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'Check /v1/models endpoint',
|
|
68
|
-
url: 'https://api.z.ai/v1/models',
|
|
69
|
-
method: 'GET'
|
|
70
|
-
}
|
|
71
|
-
];
|
|
72
|
-
|
|
73
|
-
function testEndpoint(test) {
|
|
74
|
-
return new Promise((resolve) => {
|
|
75
|
-
const url = new URL(test.url);
|
|
76
|
-
|
|
77
|
-
const options = {
|
|
78
|
-
hostname: url.hostname,
|
|
79
|
-
port: 443,
|
|
80
|
-
path: url.pathname,
|
|
81
|
-
method: test.method || 'POST',
|
|
82
|
-
headers: {
|
|
83
|
-
'Authorization': `Bearer ${API_KEY}`,
|
|
84
|
-
'Content-Type': 'application/json'
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
let data = null;
|
|
89
|
-
if (test.method !== 'GET') {
|
|
90
|
-
data = JSON.stringify({
|
|
91
|
-
model: test.model,
|
|
92
|
-
messages: [{ role: 'user', content: 'Hi' }],
|
|
93
|
-
max_tokens: 10
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const req = https.request(options, (res) => {
|
|
98
|
-
let body = '';
|
|
99
|
-
res.on('data', chunk => body += chunk);
|
|
100
|
-
res.on('end', () => {
|
|
101
|
-
resolve({
|
|
102
|
-
status: res.statusCode,
|
|
103
|
-
body: body.substring(0, 500)
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
req.on('error', (error) => {
|
|
109
|
-
resolve({ status: 'ERROR', error: error.message });
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
req.setTimeout(15000, () => {
|
|
113
|
-
req.destroy();
|
|
114
|
-
resolve({ status: 'TIMEOUT' });
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
if (data) req.write(data);
|
|
118
|
-
req.end();
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
async function runDiagnostics() {
|
|
123
|
-
for (const test of tests) {
|
|
124
|
-
console.log(`\n${'ā'.repeat(80)}`);
|
|
125
|
-
console.log(`\nš ${test.name}`);
|
|
126
|
-
console.log(` URL: ${test.url}`);
|
|
127
|
-
if (test.model) console.log(` Model: ${test.model}`);
|
|
128
|
-
|
|
129
|
-
const result = await testEndpoint(test);
|
|
130
|
-
|
|
131
|
-
if (result.status === 'ERROR') {
|
|
132
|
-
console.log(` ā Error: ${result.error}`);
|
|
133
|
-
} else if (result.status === 'TIMEOUT') {
|
|
134
|
-
console.log(` ā±ļø Timeout`);
|
|
135
|
-
} else if (result.status === 200 || result.status === 201) {
|
|
136
|
-
console.log(` ā
Success (${result.status})`);
|
|
137
|
-
console.log(` Response: ${result.body.substring(0, 200)}...`);
|
|
138
|
-
} else {
|
|
139
|
-
console.log(` ā ļø Status: ${result.status}`);
|
|
140
|
-
console.log(` Response: ${result.body.substring(0, 200)}`);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
console.log('\n' + '='.repeat(80));
|
|
145
|
-
console.log('\nš” Recommendations:');
|
|
146
|
-
console.log(' - Check Z.ai documentation for correct endpoint structure');
|
|
147
|
-
console.log(' - Verify API key permissions');
|
|
148
|
-
console.log(' - Confirm supported models list\n');
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
runDiagnostics().catch(console.error);
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Final Z.ai API Verification Test
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const https = require('https');
|
|
8
|
-
const fs = require('fs');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
// Load .env
|
|
12
|
-
function loadEnv() {
|
|
13
|
-
const envPath = path.join(process.cwd(), '.env');
|
|
14
|
-
if (!fs.existsSync(envPath)) return false;
|
|
15
|
-
|
|
16
|
-
const envContent = fs.readFileSync(envPath, 'utf8');
|
|
17
|
-
envContent.split('\n').forEach(line => {
|
|
18
|
-
const trimmed = line.trim();
|
|
19
|
-
if (!trimmed || trimmed.startsWith('#')) return;
|
|
20
|
-
|
|
21
|
-
const match = trimmed.match(/^([^=]+)=(.*)$/);
|
|
22
|
-
if (match) {
|
|
23
|
-
const key = match[1].trim();
|
|
24
|
-
let value = match[2].trim();
|
|
25
|
-
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
26
|
-
(value.startsWith("'") && value.endsWith("'"))) {
|
|
27
|
-
value = value.slice(1, -1);
|
|
28
|
-
}
|
|
29
|
-
process.env[key] = value;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
loadEnv();
|
|
36
|
-
|
|
37
|
-
const API_KEY = process.env.ZAI_API_KEY || process.env.ANTHROPIC_AUTH_TOKEN;
|
|
38
|
-
|
|
39
|
-
function makeRequest(url, payload) {
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
const urlObj = new URL(url);
|
|
42
|
-
|
|
43
|
-
const options = {
|
|
44
|
-
hostname: urlObj.hostname,
|
|
45
|
-
port: 443,
|
|
46
|
-
path: urlObj.pathname,
|
|
47
|
-
method: 'POST',
|
|
48
|
-
headers: {
|
|
49
|
-
'Content-Type': 'application/json',
|
|
50
|
-
'x-api-key': API_KEY,
|
|
51
|
-
'anthropic-version': '2023-06-01'
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const req = https.request(options, (res) => {
|
|
56
|
-
let body = '';
|
|
57
|
-
res.on('data', chunk => body += chunk);
|
|
58
|
-
res.on('end', () => {
|
|
59
|
-
try {
|
|
60
|
-
resolve({ status: res.statusCode, body: JSON.parse(body) });
|
|
61
|
-
} catch (e) {
|
|
62
|
-
resolve({ status: res.statusCode, body });
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
req.on('error', reject);
|
|
68
|
-
req.setTimeout(30000, () => {
|
|
69
|
-
req.destroy();
|
|
70
|
-
reject(new Error('Timeout'));
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
req.write(JSON.stringify(payload));
|
|
74
|
-
req.end();
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
async function test() {
|
|
79
|
-
console.log('\nšÆ Z.ai API Final Verification\n');
|
|
80
|
-
console.log('='.repeat(80) + '\n');
|
|
81
|
-
|
|
82
|
-
const tests = [
|
|
83
|
-
{
|
|
84
|
-
name: 'Test 1: Simple greeting (10K tokens)',
|
|
85
|
-
payload: {
|
|
86
|
-
model: 'haiku',
|
|
87
|
-
max_tokens: 10000,
|
|
88
|
-
messages: [{ role: 'user', content: 'Reply with exactly: "Hello from Z.ai GLM-4.6!"' }]
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: 'Test 2: Code generation (10K tokens)',
|
|
93
|
-
payload: {
|
|
94
|
-
model: 'haiku',
|
|
95
|
-
max_tokens: 10000,
|
|
96
|
-
messages: [{ role: 'user', content: 'Write a complete JavaScript class for managing a todo list with add, remove, and list methods. Include comments.' }]
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
];
|
|
100
|
-
|
|
101
|
-
for (const test of tests) {
|
|
102
|
-
console.log(`š ${test.name}`);
|
|
103
|
-
console.log('-'.repeat(80));
|
|
104
|
-
|
|
105
|
-
try {
|
|
106
|
-
const result = await makeRequest('https://api.z.ai/api/anthropic/v1/messages', test.payload);
|
|
107
|
-
|
|
108
|
-
if (result.status === 200) {
|
|
109
|
-
console.log('ā
Success!');
|
|
110
|
-
console.log('Response:', result.body.content?.[0]?.text || result.body.content || 'Empty response');
|
|
111
|
-
console.log('Model:', result.body.model);
|
|
112
|
-
console.log('Tokens:', `${result.body.usage?.input_tokens || 0} in, ${result.body.usage?.output_tokens || 0} out`);
|
|
113
|
-
} else {
|
|
114
|
-
console.log('ā ļø Status:', result.status);
|
|
115
|
-
console.log('Body:', JSON.stringify(result.body, null, 2).substring(0, 200));
|
|
116
|
-
}
|
|
117
|
-
} catch (error) {
|
|
118
|
-
console.log('ā Error:', error.message);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
console.log('');
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
console.log('='.repeat(80));
|
|
125
|
-
console.log('\nā
Z.ai API verification complete!\n');
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
test();
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Z.ai API Test with .env loading
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const fs = require('fs');
|
|
8
|
-
const path = require('path');
|
|
9
|
-
|
|
10
|
-
// Load .env file
|
|
11
|
-
function loadEnv() {
|
|
12
|
-
const envPath = path.join(process.cwd(), '.env');
|
|
13
|
-
|
|
14
|
-
if (!fs.existsSync(envPath)) {
|
|
15
|
-
console.error('ā .env file not found in:', process.cwd());
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
const envContent = fs.readFileSync(envPath, 'utf8');
|
|
21
|
-
const lines = envContent.split('\n');
|
|
22
|
-
|
|
23
|
-
for (const line of lines) {
|
|
24
|
-
const trimmed = line.trim();
|
|
25
|
-
|
|
26
|
-
// Skip comments and empty lines
|
|
27
|
-
if (!trimmed || trimmed.startsWith('#')) continue;
|
|
28
|
-
|
|
29
|
-
// Parse KEY=VALUE
|
|
30
|
-
const match = trimmed.match(/^([^=]+)=(.*)$/);
|
|
31
|
-
if (match) {
|
|
32
|
-
const key = match[1].trim();
|
|
33
|
-
let value = match[2].trim();
|
|
34
|
-
|
|
35
|
-
// Remove quotes if present
|
|
36
|
-
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
37
|
-
(value.startsWith("'") && value.endsWith("'"))) {
|
|
38
|
-
value = value.slice(1, -1);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
process.env[key] = value;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return true;
|
|
46
|
-
} catch (error) {
|
|
47
|
-
console.error('ā Error loading .env:', error.message);
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Load environment
|
|
53
|
-
console.log('š Loading .env file...');
|
|
54
|
-
if (!loadEnv()) {
|
|
55
|
-
process.exit(1);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Check for Z_AI_API_KEY or ZAI_API_KEY
|
|
59
|
-
if (process.env.Z_AI_API_KEY || process.env.ZAI_API_KEY) {
|
|
60
|
-
const key = process.env.Z_AI_API_KEY || process.env.ZAI_API_KEY;
|
|
61
|
-
const keyName = process.env.Z_AI_API_KEY ? 'Z_AI_API_KEY' : 'ZAI_API_KEY';
|
|
62
|
-
console.log(`ā ${keyName} loaded from .env`);
|
|
63
|
-
console.log(' Key preview:', key.substring(0, 10) + '...\n');
|
|
64
|
-
} else {
|
|
65
|
-
console.error('ā Z_AI_API_KEY or ZAI_API_KEY not found in .env file');
|
|
66
|
-
console.log('\nSearching for Z.ai related keys in .env...');
|
|
67
|
-
|
|
68
|
-
const envPath = path.join(process.cwd(), '.env');
|
|
69
|
-
const envContent = fs.readFileSync(envPath, 'utf8');
|
|
70
|
-
const zaiKeys = envContent.split('\n').filter(line =>
|
|
71
|
-
line.toLowerCase().includes('z_ai') || line.toLowerCase().includes('zai')
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
if (zaiKeys.length > 0) {
|
|
75
|
-
console.log('Found:', zaiKeys.join('\n'));
|
|
76
|
-
} else {
|
|
77
|
-
console.log('No Z.ai related keys found');
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
process.exit(1);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Now run the actual test
|
|
84
|
-
console.log('š Starting Z.ai API test...\n');
|
|
85
|
-
require('./test-zai-api.cjs');
|
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Cost-Savings Mode Toggle Script
|
|
4
|
-
* Switches between CLI-based (cost-savings) and Task-tool coordination
|
|
5
|
-
* Usage: node scripts/toggle-cost-savings.js [on|off|status]
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const fs = require('fs');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
const CONFIG_FILE = path.join(__dirname, '..', '.claude-flow', 'cost-savings-mode.json');
|
|
12
|
-
const CLAUDE_MD_PATH = path.join(__dirname, '..', 'CLAUDE.md');
|
|
13
|
-
const CLI_COORDINATORS_MARKER = '<!-- CLI_COORDINATORS_START -->';
|
|
14
|
-
const CLI_COORDINATORS_END = '<!-- CLI_COORDINATORS_END -->';
|
|
15
|
-
const TASK_COORDINATORS_MARKER = '<!-- TASK_COORDINATORS_START -->';
|
|
16
|
-
const TASK_COORDINATORS_END = '<!-- TASK_COORDINATORS_END -->';
|
|
17
|
-
|
|
18
|
-
// Ensure config directory exists
|
|
19
|
-
const configDir = path.dirname(CONFIG_FILE);
|
|
20
|
-
if (!fs.existsSync(configDir)) {
|
|
21
|
-
fs.mkdirSync(configDir, { recursive: true });
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// CLI Coordinators Section
|
|
25
|
-
const CLI_COORDINATORS_SECTION = `
|
|
26
|
-
### CLI-Based Coordinators (Cost-Savings Mode ACTIVE)
|
|
27
|
-
|
|
28
|
-
**When cost-savings mode is enabled, use these CLI spawning patterns:**
|
|
29
|
-
|
|
30
|
-
#### coordinator-hybrid (PRIMARY)
|
|
31
|
-
\`\`\`bash
|
|
32
|
-
# Coordinator spawns workers via CLI
|
|
33
|
-
node src/cli/hybrid-routing/spawn-workers.js \\
|
|
34
|
-
"Task description" \\
|
|
35
|
-
--agents=analyst,coder,tester \\
|
|
36
|
-
--provider zai \\
|
|
37
|
-
--redis-channel swarm:task
|
|
38
|
-
\`\`\`
|
|
39
|
-
|
|
40
|
-
#### cfn-coordinator-mvp
|
|
41
|
-
\`\`\`bash
|
|
42
|
-
node src/cli/hybrid-routing/spawn-workers.js \\
|
|
43
|
-
"MVP phase implementation" \\
|
|
44
|
-
--agents=coder,coder \\
|
|
45
|
-
--provider zai \\
|
|
46
|
-
--redis-channel swarm:mvp-phase \\
|
|
47
|
-
--timeout 900000 \\
|
|
48
|
-
--budget 0.50
|
|
49
|
-
\`\`\`
|
|
50
|
-
|
|
51
|
-
#### cfn-coordinator-standard
|
|
52
|
-
\`\`\`bash
|
|
53
|
-
node src/cli/hybrid-routing/spawn-workers.js \\
|
|
54
|
-
"Standard phase implementation" \\
|
|
55
|
-
--agents=analyst,coder,coder,tester \\
|
|
56
|
-
--provider zai \\
|
|
57
|
-
--redis-channel swarm:std-phase \\
|
|
58
|
-
--timeout 1800000
|
|
59
|
-
\`\`\`
|
|
60
|
-
|
|
61
|
-
#### cfn-coordinator-enterprise
|
|
62
|
-
\`\`\`bash
|
|
63
|
-
node src/cli/hybrid-routing/spawn-workers.js \\
|
|
64
|
-
"Enterprise phase implementation" \\
|
|
65
|
-
--agents=analyst,architect,coder,coder,security-specialist,tester \\
|
|
66
|
-
--provider zai \\
|
|
67
|
-
--redis-channel swarm:ent-phase \\
|
|
68
|
-
--timeout 3600000
|
|
69
|
-
\`\`\`
|
|
70
|
-
|
|
71
|
-
#### adaptive-coordinator
|
|
72
|
-
\`\`\`bash
|
|
73
|
-
node src/cli/hybrid-routing/spawn-workers.js \\
|
|
74
|
-
"Adaptive coordination task" \\
|
|
75
|
-
--agents=analyst,architect,coder,coder,coder,tester,reviewer \\
|
|
76
|
-
--provider zai \\
|
|
77
|
-
--redis-channel swarm:adaptive \\
|
|
78
|
-
--max-agents 8
|
|
79
|
-
\`\`\`
|
|
80
|
-
|
|
81
|
-
**Cost Structure (CLI Mode):**
|
|
82
|
-
- Coordinator: $0 (runs in main chat, uses subscription)
|
|
83
|
-
- Workers: ~$0.50/1M tokens (z.ai provider)
|
|
84
|
-
- **Savings: ~97% vs pure Claude**
|
|
85
|
-
`;
|
|
86
|
-
|
|
87
|
-
// Task-Tool Coordinators Section
|
|
88
|
-
const TASK_COORDINATORS_SECTION = `
|
|
89
|
-
### Task-Tool Coordinators (Cost-Savings Mode DISABLED)
|
|
90
|
-
|
|
91
|
-
**When cost-savings mode is disabled, use these Task spawning patterns:**
|
|
92
|
-
|
|
93
|
-
#### coordinator-hybrid (PRIMARY)
|
|
94
|
-
\`\`\`javascript
|
|
95
|
-
Task("coordinator-hybrid",
|
|
96
|
-
\`Coordinate task: [description]
|
|
97
|
-
|
|
98
|
-
Spawn workers via Task tool:
|
|
99
|
-
- Task("analyst", "Analyze requirements", "analyst")
|
|
100
|
-
- Task("coder", "Implement solution", "coder")
|
|
101
|
-
- Task("tester", "Validate tests", "tester")
|
|
102
|
-
|
|
103
|
-
Coordinate via Redis pub/sub on swarm:task channel\`,
|
|
104
|
-
"coordinator"
|
|
105
|
-
)
|
|
106
|
-
\`\`\`
|
|
107
|
-
|
|
108
|
-
#### cfn-coordinator-mvp
|
|
109
|
-
\`\`\`javascript
|
|
110
|
-
Task("cfn-coordinator-mvp",
|
|
111
|
-
\`Execute MVP phase: [description]
|
|
112
|
-
|
|
113
|
-
MVP Parameters:
|
|
114
|
-
- Gate threshold: 0.70
|
|
115
|
-
- Consensus: 0.80
|
|
116
|
-
- Validators: 2
|
|
117
|
-
- Max iterations: 5
|
|
118
|
-
|
|
119
|
-
Spawn 2-3 workers via Task tool\`,
|
|
120
|
-
"coordinator"
|
|
121
|
-
)
|
|
122
|
-
\`\`\`
|
|
123
|
-
|
|
124
|
-
#### cfn-coordinator-standard
|
|
125
|
-
\`\`\`javascript
|
|
126
|
-
Task("cfn-coordinator-standard",
|
|
127
|
-
\`Execute standard phase: [description]
|
|
128
|
-
|
|
129
|
-
Standard Parameters:
|
|
130
|
-
- Gate threshold: 0.75
|
|
131
|
-
- Consensus: 0.90
|
|
132
|
-
- Validators: 4
|
|
133
|
-
- Max iterations: 10
|
|
134
|
-
|
|
135
|
-
Spawn 3-5 workers via Task tool\`,
|
|
136
|
-
"coordinator"
|
|
137
|
-
)
|
|
138
|
-
\`\`\`
|
|
139
|
-
|
|
140
|
-
#### cfn-coordinator-enterprise
|
|
141
|
-
\`\`\`javascript
|
|
142
|
-
Task("cfn-coordinator-enterprise",
|
|
143
|
-
\`Execute enterprise phase: [description]
|
|
144
|
-
|
|
145
|
-
Enterprise Parameters:
|
|
146
|
-
- Gate threshold: 0.75
|
|
147
|
-
- Consensus: 0.95
|
|
148
|
-
- Validators: 4
|
|
149
|
-
- Max iterations: 15
|
|
150
|
-
- Loop 0.5: Planning consensus
|
|
151
|
-
|
|
152
|
-
Spawn 5-8 workers via Task tool\`,
|
|
153
|
-
"coordinator"
|
|
154
|
-
)
|
|
155
|
-
\`\`\`
|
|
156
|
-
|
|
157
|
-
#### adaptive-coordinator
|
|
158
|
-
\`\`\`javascript
|
|
159
|
-
Task("adaptive-coordinator",
|
|
160
|
-
\`Coordinate with adaptive topology:
|
|
161
|
-
|
|
162
|
-
Topology: mesh (2-7) | hierarchical (8+)
|
|
163
|
-
Dynamic switching based on agent count
|
|
164
|
-
|
|
165
|
-
Spawn workers via Task tool\`,
|
|
166
|
-
"coordinator"
|
|
167
|
-
)
|
|
168
|
-
\`\`\`
|
|
169
|
-
|
|
170
|
-
**Cost Structure (Task-Tool Mode):**
|
|
171
|
-
- All agents use main provider (Claude Max or z.ai based on /switch-api)
|
|
172
|
-
- Higher cost but maximum coordinator intelligence
|
|
173
|
-
- Direct Task tool orchestration
|
|
174
|
-
`;
|
|
175
|
-
|
|
176
|
-
function getCurrentMode() {
|
|
177
|
-
if (!fs.existsSync(CONFIG_FILE)) {
|
|
178
|
-
return { mode: 'task-tool', lastToggled: null };
|
|
179
|
-
}
|
|
180
|
-
return JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function saveMode(mode) {
|
|
184
|
-
const config = {
|
|
185
|
-
mode,
|
|
186
|
-
lastToggled: new Date().toISOString()
|
|
187
|
-
};
|
|
188
|
-
fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
189
|
-
return config;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function updateClaudeMd(mode) {
|
|
193
|
-
let claudeMd = fs.readFileSync(CLAUDE_MD_PATH, 'utf8');
|
|
194
|
-
|
|
195
|
-
// Remove existing sections
|
|
196
|
-
claudeMd = claudeMd.replace(
|
|
197
|
-
new RegExp(`${CLI_COORDINATORS_MARKER}[\\s\\S]*?${CLI_COORDINATORS_END}`, 'g'),
|
|
198
|
-
''
|
|
199
|
-
);
|
|
200
|
-
claudeMd = claudeMd.replace(
|
|
201
|
-
new RegExp(`${TASK_COORDINATORS_MARKER}[\\s\\S]*?${TASK_COORDINATORS_END}`, 'g'),
|
|
202
|
-
''
|
|
203
|
-
);
|
|
204
|
-
|
|
205
|
-
// Find insertion point (after "### Hybrid CLI-Based Routing" section)
|
|
206
|
-
const insertionPattern = /### Hybrid CLI-Based Routing \(Default with Claude Max\)/;
|
|
207
|
-
const match = claudeMd.match(insertionPattern);
|
|
208
|
-
|
|
209
|
-
if (!match) {
|
|
210
|
-
console.error('ā Could not find insertion point in CLAUDE.md');
|
|
211
|
-
return false;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// Find end of Hybrid CLI-Based Routing section (next ### or EOF)
|
|
215
|
-
const sectionStart = match.index + match[0].length;
|
|
216
|
-
const nextSectionMatch = claudeMd.slice(sectionStart).match(/\n### /);
|
|
217
|
-
const insertionPoint = nextSectionMatch
|
|
218
|
-
? sectionStart + nextSectionMatch.index
|
|
219
|
-
: claudeMd.length;
|
|
220
|
-
|
|
221
|
-
// Insert appropriate section
|
|
222
|
-
const sectionToInsert = mode === 'cli'
|
|
223
|
-
? `\n${CLI_COORDINATORS_MARKER}${CLI_COORDINATORS_SECTION}\n${CLI_COORDINATORS_END}\n`
|
|
224
|
-
: `\n${TASK_COORDINATORS_MARKER}${TASK_COORDINATORS_SECTION}\n${TASK_COORDINATORS_END}\n`;
|
|
225
|
-
|
|
226
|
-
claudeMd = claudeMd.slice(0, insertionPoint) + sectionToInsert + claudeMd.slice(insertionPoint);
|
|
227
|
-
|
|
228
|
-
fs.writeFileSync(CLAUDE_MD_PATH, claudeMd);
|
|
229
|
-
return true;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
function showStatus() {
|
|
233
|
-
const config = getCurrentMode();
|
|
234
|
-
const claudeMd = fs.readFileSync(CLAUDE_MD_PATH, 'utf8');
|
|
235
|
-
const hasCliSection = claudeMd.includes(CLI_COORDINATORS_MARKER);
|
|
236
|
-
const hasTaskSection = claudeMd.includes(TASK_COORDINATORS_MARKER);
|
|
237
|
-
|
|
238
|
-
console.log('\nš Cost-Savings Mode Status\n');
|
|
239
|
-
console.log(`Mode: ${config.mode.toUpperCase()}`);
|
|
240
|
-
console.log(`Active sections in CLAUDE.md: ${hasCliSection ? 'CLI' : hasTaskSection ? 'Task-tool' : 'None'}`);
|
|
241
|
-
console.log(`Spawning pattern: ${config.mode === 'cli' ? 'spawn-workers.js' : 'Task()'}`);
|
|
242
|
-
console.log(`Provider: ${config.mode === 'cli' ? 'z.ai (workers)' : 'main provider'}`);
|
|
243
|
-
console.log(`Cost savings: ${config.mode === 'cli' ? '~97%' : '0%'}`);
|
|
244
|
-
console.log(`Last toggled: ${config.lastToggled || 'Never'}\n`);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
function enableCostSavings() {
|
|
248
|
-
console.log('š§ Enabling CLI cost-savings mode...\n');
|
|
249
|
-
|
|
250
|
-
const updated = updateClaudeMd('cli');
|
|
251
|
-
if (!updated) {
|
|
252
|
-
process.exit(1);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
saveMode('cli');
|
|
256
|
-
|
|
257
|
-
console.log('ā
Cost-savings mode ENABLED\n');
|
|
258
|
-
console.log('š Changes applied:');
|
|
259
|
-
console.log(' ⢠CLAUDE.md updated with CLI coordinator sections');
|
|
260
|
-
console.log(' ⢠Coordinators will use spawn-workers.js for spawning');
|
|
261
|
-
console.log(' ⢠Workers will use z.ai provider ($0.50/1M tokens)');
|
|
262
|
-
console.log(' ⢠Coordinators run on Claude Max subscription ($0)');
|
|
263
|
-
console.log(' ⢠~97% cost savings active\n');
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
function disableCostSavings() {
|
|
267
|
-
console.log('š§ Disabling CLI cost-savings mode...\n');
|
|
268
|
-
|
|
269
|
-
const updated = updateClaudeMd('task-tool');
|
|
270
|
-
if (!updated) {
|
|
271
|
-
process.exit(1);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
saveMode('task-tool');
|
|
275
|
-
|
|
276
|
-
console.log('ā
Cost-savings mode DISABLED\n');
|
|
277
|
-
console.log('š Changes applied:');
|
|
278
|
-
console.log(' ⢠CLAUDE.md updated with Task-tool coordinator sections');
|
|
279
|
-
console.log(' ⢠Coordinators will use Task() for spawning');
|
|
280
|
-
console.log(' ⢠All agents use main provider');
|
|
281
|
-
console.log(' ⢠Maximum coordinator intelligence prioritized\n');
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
// Main execution
|
|
285
|
-
const command = process.argv[2] || 'status';
|
|
286
|
-
|
|
287
|
-
switch (command.toLowerCase()) {
|
|
288
|
-
case 'on':
|
|
289
|
-
case 'enable':
|
|
290
|
-
enableCostSavings();
|
|
291
|
-
break;
|
|
292
|
-
case 'off':
|
|
293
|
-
case 'disable':
|
|
294
|
-
disableCostSavings();
|
|
295
|
-
break;
|
|
296
|
-
case 'status':
|
|
297
|
-
showStatus();
|
|
298
|
-
break;
|
|
299
|
-
default:
|
|
300
|
-
console.log('Usage: node scripts/toggle-cost-savings.js [on|off|status]');
|
|
301
|
-
process.exit(1);
|
|
302
|
-
}
|