getmy-ruflo 3.5.43
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/bin/ruflo.js +29 -0
- package/package.json +50 -0
- package/v3/@claude-flow/cli/bin/cli.js +156 -0
- package/v3/@claude-flow/cli/bin/mcp-server.js +199 -0
- package/v3/@claude-flow/cli/bin/mcp-sse-server.js +596 -0
- package/v3/@claude-flow/cli/bin/preinstall.cjs +2 -0
- package/v3/@claude-flow/cli/dist/src/appliance/gguf-engine.d.ts +91 -0
- package/v3/@claude-flow/cli/dist/src/appliance/gguf-engine.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/gguf-engine.js +425 -0
- package/v3/@claude-flow/cli/dist/src/appliance/gguf-engine.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
- package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.js +292 -0
- package/v3/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-builder.d.ts +44 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-builder.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-builder.js +329 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-builder.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-distribution.d.ts +97 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-distribution.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-distribution.js +370 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-distribution.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-format.d.ts +111 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-format.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-format.js +393 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-format.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-runner.d.ts +69 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-runner.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-runner.js +237 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-runner.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-signing.d.ts +123 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-signing.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-signing.js +347 -0
- package/v3/@claude-flow/cli/dist/src/appliance/rvfa-signing.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/benchmarks/pretrain/index.d.ts +58 -0
- package/v3/@claude-flow/cli/dist/src/benchmarks/pretrain/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/benchmarks/pretrain/index.js +404 -0
- package/v3/@claude-flow/cli/dist/src/benchmarks/pretrain/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/agent.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/agent.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/agent.js +919 -0
- package/v3/@claude-flow/cli/dist/src/commands/agent.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/analyze.d.ts +19 -0
- package/v3/@claude-flow/cli/dist/src/commands/analyze.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/analyze.js +1823 -0
- package/v3/@claude-flow/cli/dist/src/commands/analyze.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/appliance-advanced.d.ts +9 -0
- package/v3/@claude-flow/cli/dist/src/commands/appliance-advanced.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/appliance-advanced.js +215 -0
- package/v3/@claude-flow/cli/dist/src/commands/appliance-advanced.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/appliance.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/appliance.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/appliance.js +406 -0
- package/v3/@claude-flow/cli/dist/src/commands/appliance.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/benchmark.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/commands/benchmark.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/benchmark.js +459 -0
- package/v3/@claude-flow/cli/dist/src/commands/benchmark.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/claims.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/commands/claims.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/claims.js +373 -0
- package/v3/@claude-flow/cli/dist/src/commands/claims.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/cleanup.d.ts +13 -0
- package/v3/@claude-flow/cli/dist/src/commands/cleanup.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/cleanup.js +218 -0
- package/v3/@claude-flow/cli/dist/src/commands/cleanup.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/completions.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/commands/completions.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/completions.js +539 -0
- package/v3/@claude-flow/cli/dist/src/commands/completions.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/config.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/config.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/config.js +406 -0
- package/v3/@claude-flow/cli/dist/src/commands/config.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/daemon.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/daemon.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/daemon.js +656 -0
- package/v3/@claude-flow/cli/dist/src/commands/daemon.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/deployment.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/commands/deployment.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/deployment.js +289 -0
- package/v3/@claude-flow/cli/dist/src/commands/deployment.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/doctor.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/commands/doctor.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/doctor.js +619 -0
- package/v3/@claude-flow/cli/dist/src/commands/doctor.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/embeddings.d.ts +18 -0
- package/v3/@claude-flow/cli/dist/src/commands/embeddings.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/embeddings.js +1576 -0
- package/v3/@claude-flow/cli/dist/src/commands/embeddings.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/guidance.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/guidance.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/guidance.js +560 -0
- package/v3/@claude-flow/cli/dist/src/commands/guidance.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/hive-mind.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/commands/hive-mind.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/hive-mind.js +1230 -0
- package/v3/@claude-flow/cli/dist/src/commands/hive-mind.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/hooks.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/hooks.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/hooks.js +4441 -0
- package/v3/@claude-flow/cli/dist/src/commands/hooks.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/index.d.ts +115 -0
- package/v3/@claude-flow/cli/dist/src/commands/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/index.js +377 -0
- package/v3/@claude-flow/cli/dist/src/commands/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/init.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/init.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/init.js +969 -0
- package/v3/@claude-flow/cli/dist/src/commands/init.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/issues.d.ts +21 -0
- package/v3/@claude-flow/cli/dist/src/commands/issues.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/issues.js +567 -0
- package/v3/@claude-flow/cli/dist/src/commands/issues.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/mcp.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/commands/mcp.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/mcp.js +779 -0
- package/v3/@claude-flow/cli/dist/src/commands/mcp.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/memory.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/memory.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/memory.js +1292 -0
- package/v3/@claude-flow/cli/dist/src/commands/memory.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/migrate.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/migrate.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/migrate.js +410 -0
- package/v3/@claude-flow/cli/dist/src/commands/migrate.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/neural.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/commands/neural.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/neural.js +1454 -0
- package/v3/@claude-flow/cli/dist/src/commands/neural.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/performance.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/commands/performance.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/performance.js +579 -0
- package/v3/@claude-flow/cli/dist/src/commands/performance.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/plugins.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/commands/plugins.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/plugins.js +820 -0
- package/v3/@claude-flow/cli/dist/src/commands/plugins.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/process.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/commands/process.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/process.js +641 -0
- package/v3/@claude-flow/cli/dist/src/commands/process.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/progress.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/commands/progress.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/progress.js +259 -0
- package/v3/@claude-flow/cli/dist/src/commands/progress.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/providers.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/commands/providers.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/providers.js +232 -0
- package/v3/@claude-flow/cli/dist/src/commands/providers.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/route.d.ts +16 -0
- package/v3/@claude-flow/cli/dist/src/commands/route.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/route.js +813 -0
- package/v3/@claude-flow/cli/dist/src/commands/route.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/backup.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/backup.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/backup.js +746 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/backup.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/benchmark.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/benchmark.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/benchmark.js +480 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/benchmark.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/import.d.ts +18 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/import.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/import.js +349 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/import.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/index.d.ts +29 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/index.js +129 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/init.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/init.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/init.js +431 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/init.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/migrate.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/migrate.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/migrate.js +481 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/migrate.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/optimize.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/optimize.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/optimize.js +503 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/optimize.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/setup.d.ts +18 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/setup.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/setup.js +765 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/setup.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/status.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/status.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/status.js +456 -0
- package/v3/@claude-flow/cli/dist/src/commands/ruvector/status.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/security.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/commands/security.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/security.js +606 -0
- package/v3/@claude-flow/cli/dist/src/commands/security.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/session.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/session.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/session.js +750 -0
- package/v3/@claude-flow/cli/dist/src/commands/session.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/start.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/start.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/start.js +418 -0
- package/v3/@claude-flow/cli/dist/src/commands/start.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/status.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/status.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/status.js +591 -0
- package/v3/@claude-flow/cli/dist/src/commands/status.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/swarm.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/swarm.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/swarm.js +748 -0
- package/v3/@claude-flow/cli/dist/src/commands/swarm.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/task.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/task.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/task.js +671 -0
- package/v3/@claude-flow/cli/dist/src/commands/task.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/transfer-store.d.ts +13 -0
- package/v3/@claude-flow/cli/dist/src/commands/transfer-store.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/transfer-store.js +428 -0
- package/v3/@claude-flow/cli/dist/src/commands/transfer-store.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/update.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/update.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/update.js +276 -0
- package/v3/@claude-flow/cli/dist/src/commands/update.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/workflow.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/commands/workflow.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/workflow.js +617 -0
- package/v3/@claude-flow/cli/dist/src/commands/workflow.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/config-adapter.d.ts +15 -0
- package/v3/@claude-flow/cli/dist/src/config-adapter.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/config-adapter.js +186 -0
- package/v3/@claude-flow/cli/dist/src/config-adapter.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/index.d.ts +76 -0
- package/v3/@claude-flow/cli/dist/src/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/index.js +472 -0
- package/v3/@claude-flow/cli/dist/src/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
- package/v3/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.js +264 -0
- package/v3/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.d.ts +25 -0
- package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.js +486 -0
- package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/executor.d.ts +41 -0
- package/v3/@claude-flow/cli/dist/src/init/executor.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/executor.js +1738 -0
- package/v3/@claude-flow/cli/dist/src/init/executor.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/helpers-generator.d.ts +60 -0
- package/v3/@claude-flow/cli/dist/src/init/helpers-generator.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/helpers-generator.js +1181 -0
- package/v3/@claude-flow/cli/dist/src/init/helpers-generator.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/index.d.ts +13 -0
- package/v3/@claude-flow/cli/dist/src/init/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/index.js +15 -0
- package/v3/@claude-flow/cli/dist/src/init/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/mcp-generator.d.ts +26 -0
- package/v3/@claude-flow/cli/dist/src/init/mcp-generator.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/mcp-generator.js +116 -0
- package/v3/@claude-flow/cli/dist/src/init/mcp-generator.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/settings-generator.d.ts +14 -0
- package/v3/@claude-flow/cli/dist/src/init/settings-generator.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/settings-generator.js +403 -0
- package/v3/@claude-flow/cli/dist/src/init/settings-generator.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/statusline-generator.d.ts +28 -0
- package/v3/@claude-flow/cli/dist/src/init/statusline-generator.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/statusline-generator.js +833 -0
- package/v3/@claude-flow/cli/dist/src/init/statusline-generator.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/types.d.ts +295 -0
- package/v3/@claude-flow/cli/dist/src/init/types.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/init/types.js +263 -0
- package/v3/@claude-flow/cli/dist/src/init/types.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-client.d.ts +98 -0
- package/v3/@claude-flow/cli/dist/src/mcp-client.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-client.js +278 -0
- package/v3/@claude-flow/cli/dist/src/mcp-client.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-server.d.ts +161 -0
- package/v3/@claude-flow/cli/dist/src/mcp-server.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-server.js +627 -0
- package/v3/@claude-flow/cli/dist/src/mcp-server.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.d.ts +49 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js +622 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.d.ts +30 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js +557 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.d.ts +38 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.js +317 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/auto-install.d.ts +83 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/auto-install.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/auto-install.js +131 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/auto-install.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.js +639 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/browser-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.d.ts +12 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.js +732 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.js +352 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/config-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.d.ts +13 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.js +827 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.d.ts +13 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.js +426 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/daa-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/dev-tools.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/dev-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/dev-tools.js +713 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/dev-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.d.ts +9 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.js +782 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.d.ts +13 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.js +373 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/github-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.js +811 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.d.ts +44 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +3112 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/index.d.ts +29 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/index.js +28 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/infrastructure-tools.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/infrastructure-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/infrastructure-tools.js +547 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/infrastructure-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.d.ts +14 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js +512 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.d.ts +16 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.js +461 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/neural-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.d.ts +16 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.js +534 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/plugin-tools.d.ts +19 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/plugin-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/plugin-tools.js +135 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/plugin-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/process-manager-tools.d.ts +9 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/process-manager-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/process-manager-tools.js +516 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/process-manager-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.d.ts +14 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.js +348 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/progress-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/refactor-tools.d.ts +10 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/refactor-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/refactor-tools.js +471 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/refactor-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.d.ts +9 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.js +283 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/ruvllm-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.d.ts +18 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.js +434 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/security-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.js +315 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/skill-dispatch-tools.d.ts +17 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/skill-dispatch-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/skill-dispatch-tools.js +384 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/skill-dispatch-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/skills-tools.d.ts +14 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/skills-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/skills-tools.js +295 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/skills-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.d.ts +9 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.js +321 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.d.ts +13 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.js +417 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/system-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js +404 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.d.ts +15 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.js +339 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.d.ts +14 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.js +396 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/types.d.ts +31 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/types.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/types.js +7 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/types.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts +9 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.js +230 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.d.ts +8 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.js +572 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.d.ts +295 -0
- package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.js +601 -0
- package/v3/@claude-flow/cli/dist/src/memory/ewc-consolidation.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/memory/intelligence.d.ts +338 -0
- package/v3/@claude-flow/cli/dist/src/memory/intelligence.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/memory/intelligence.js +1023 -0
- package/v3/@claude-flow/cli/dist/src/memory/intelligence.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.d.ts +407 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.js +1494 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +434 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +2243 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/memory/sona-optimizer.d.ts +227 -0
- package/v3/@claude-flow/cli/dist/src/memory/sona-optimizer.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/memory/sona-optimizer.js +633 -0
- package/v3/@claude-flow/cli/dist/src/memory/sona-optimizer.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/output.d.ts +133 -0
- package/v3/@claude-flow/cli/dist/src/output.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/output.js +514 -0
- package/v3/@claude-flow/cli/dist/src/output.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/parser.d.ts +51 -0
- package/v3/@claude-flow/cli/dist/src/parser.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/parser.js +423 -0
- package/v3/@claude-flow/cli/dist/src/parser.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/manager.d.ts +133 -0
- package/v3/@claude-flow/cli/dist/src/plugins/manager.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/manager.js +400 -0
- package/v3/@claude-flow/cli/dist/src/plugins/manager.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.d.ts +88 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.js +1147 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/discovery.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/index.d.ts +76 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/index.js +141 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/search.d.ts +46 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/search.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/search.js +230 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/search.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/types.d.ts +274 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/types.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/types.js +7 -0
- package/v3/@claude-flow/cli/dist/src/plugins/store/types.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.d.ts +7 -0
- package/v3/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.js +126 -0
- package/v3/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/tests/standalone-test.d.ts +12 -0
- package/v3/@claude-flow/cli/dist/src/plugins/tests/standalone-test.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/tests/standalone-test.js +188 -0
- package/v3/@claude-flow/cli/dist/src/plugins/tests/standalone-test.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.d.ts +7 -0
- package/v3/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.js +206 -0
- package/v3/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/process-supervisor.d.ts +41 -0
- package/v3/@claude-flow/cli/dist/src/process-supervisor.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/process-supervisor.js +214 -0
- package/v3/@claude-flow/cli/dist/src/process-supervisor.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/production/circuit-breaker.d.ts +101 -0
- package/v3/@claude-flow/cli/dist/src/production/circuit-breaker.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/production/circuit-breaker.js +241 -0
- package/v3/@claude-flow/cli/dist/src/production/circuit-breaker.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/production/error-handler.d.ts +92 -0
- package/v3/@claude-flow/cli/dist/src/production/error-handler.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/production/error-handler.js +299 -0
- package/v3/@claude-flow/cli/dist/src/production/error-handler.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/production/index.d.ts +23 -0
- package/v3/@claude-flow/cli/dist/src/production/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/production/index.js +18 -0
- package/v3/@claude-flow/cli/dist/src/production/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/production/monitoring.d.ts +161 -0
- package/v3/@claude-flow/cli/dist/src/production/monitoring.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/production/monitoring.js +356 -0
- package/v3/@claude-flow/cli/dist/src/production/monitoring.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/production/rate-limiter.d.ts +80 -0
- package/v3/@claude-flow/cli/dist/src/production/rate-limiter.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/production/rate-limiter.js +201 -0
- package/v3/@claude-flow/cli/dist/src/production/rate-limiter.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/production/retry.d.ts +48 -0
- package/v3/@claude-flow/cli/dist/src/production/retry.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/production/retry.js +179 -0
- package/v3/@claude-flow/cli/dist/src/production/retry.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/prompt.d.ts +44 -0
- package/v3/@claude-flow/cli/dist/src/prompt.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/prompt.js +501 -0
- package/v3/@claude-flow/cli/dist/src/prompt.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/runtime/headless.d.ts +60 -0
- package/v3/@claude-flow/cli/dist/src/runtime/headless.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/runtime/headless.js +284 -0
- package/v3/@claude-flow/cli/dist/src/runtime/headless.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/agent-wasm.d.ts +182 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/agent-wasm.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/agent-wasm.js +316 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/agent-wasm.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.d.ts +67 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.js +277 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/ast-analyzer.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.d.ts +160 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.js +529 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/coverage-router.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.d.ts +33 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.js +157 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/coverage-tools.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.d.ts +175 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.js +698 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/diff-classifier.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.d.ts +146 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.js +529 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/flash-attention.d.ts +195 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/flash-attention.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/flash-attention.js +643 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/flash-attention.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.d.ts +187 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.js +929 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/graph-analyzer.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/index.d.ts +40 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/index.js +76 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.d.ts +218 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.js +455 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/lora-adapter.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/model-router.d.ts +220 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/model-router.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/model-router.js +488 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/model-router.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/moe-router.d.ts +206 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/moe-router.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/moe-router.js +626 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/moe-router.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/q-learning-router.d.ts +211 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/q-learning-router.js +681 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/q-learning-router.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/ruvllm-wasm.d.ts +179 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/ruvllm-wasm.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/ruvllm-wasm.js +363 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/ruvllm-wasm.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/semantic-router.d.ts +77 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/semantic-router.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/semantic-router.js +178 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/semantic-router.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/vector-db.d.ts +69 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/vector-db.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/vector-db.js +243 -0
- package/v3/@claude-flow/cli/dist/src/ruvector/vector-db.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/agentic-flow-bridge.d.ts +54 -0
- package/v3/@claude-flow/cli/dist/src/services/agentic-flow-bridge.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/agentic-flow-bridge.js +100 -0
- package/v3/@claude-flow/cli/dist/src/services/agentic-flow-bridge.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/claim-service.d.ts +204 -0
- package/v3/@claude-flow/cli/dist/src/services/claim-service.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/claim-service.js +818 -0
- package/v3/@claude-flow/cli/dist/src/services/claim-service.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/container-worker-pool.d.ts +197 -0
- package/v3/@claude-flow/cli/dist/src/services/container-worker-pool.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/container-worker-pool.js +583 -0
- package/v3/@claude-flow/cli/dist/src/services/container-worker-pool.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/headless-worker-executor.d.ts +304 -0
- package/v3/@claude-flow/cli/dist/src/services/headless-worker-executor.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/headless-worker-executor.js +1011 -0
- package/v3/@claude-flow/cli/dist/src/services/headless-worker-executor.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/index.d.ts +13 -0
- package/v3/@claude-flow/cli/dist/src/services/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/index.js +11 -0
- package/v3/@claude-flow/cli/dist/src/services/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/registry-api.d.ts +58 -0
- package/v3/@claude-flow/cli/dist/src/services/registry-api.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/registry-api.js +146 -0
- package/v3/@claude-flow/cli/dist/src/services/registry-api.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/ruvector-training.d.ts +222 -0
- package/v3/@claude-flow/cli/dist/src/services/ruvector-training.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/ruvector-training.js +688 -0
- package/v3/@claude-flow/cli/dist/src/services/ruvector-training.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/worker-daemon.d.ts +237 -0
- package/v3/@claude-flow/cli/dist/src/services/worker-daemon.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/worker-daemon.js +959 -0
- package/v3/@claude-flow/cli/dist/src/services/worker-daemon.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/worker-queue.d.ts +194 -0
- package/v3/@claude-flow/cli/dist/src/services/worker-queue.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/services/worker-queue.js +513 -0
- package/v3/@claude-flow/cli/dist/src/services/worker-queue.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/suggest.d.ts +53 -0
- package/v3/@claude-flow/cli/dist/src/suggest.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/suggest.js +200 -0
- package/v3/@claude-flow/cli/dist/src/suggest.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/anonymization/index.d.ts +25 -0
- package/v3/@claude-flow/cli/dist/src/transfer/anonymization/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/anonymization/index.js +175 -0
- package/v3/@claude-flow/cli/dist/src/transfer/anonymization/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/deploy-seraphine.d.ts +13 -0
- package/v3/@claude-flow/cli/dist/src/transfer/deploy-seraphine.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/deploy-seraphine.js +205 -0
- package/v3/@claude-flow/cli/dist/src/transfer/deploy-seraphine.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/export.d.ts +25 -0
- package/v3/@claude-flow/cli/dist/src/transfer/export.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/export.js +113 -0
- package/v3/@claude-flow/cli/dist/src/transfer/export.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/index.d.ts +12 -0
- package/v3/@claude-flow/cli/dist/src/transfer/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/index.js +31 -0
- package/v3/@claude-flow/cli/dist/src/transfer/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.d.ts +109 -0
- package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.js +307 -0
- package/v3/@claude-flow/cli/dist/src/transfer/ipfs/client.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/ipfs/upload.d.ts +95 -0
- package/v3/@claude-flow/cli/dist/src/transfer/ipfs/upload.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/ipfs/upload.js +411 -0
- package/v3/@claude-flow/cli/dist/src/transfer/ipfs/upload.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/models/seraphine.d.ts +72 -0
- package/v3/@claude-flow/cli/dist/src/transfer/models/seraphine.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/models/seraphine.js +373 -0
- package/v3/@claude-flow/cli/dist/src/transfer/models/seraphine.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/serialization/cfp.d.ts +49 -0
- package/v3/@claude-flow/cli/dist/src/transfer/serialization/cfp.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/serialization/cfp.js +183 -0
- package/v3/@claude-flow/cli/dist/src/transfer/serialization/cfp.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/storage/gcs.d.ts +82 -0
- package/v3/@claude-flow/cli/dist/src/transfer/storage/gcs.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/storage/gcs.js +272 -0
- package/v3/@claude-flow/cli/dist/src/transfer/storage/gcs.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/storage/index.d.ts +6 -0
- package/v3/@claude-flow/cli/dist/src/transfer/storage/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/storage/index.js +6 -0
- package/v3/@claude-flow/cli/dist/src/transfer/storage/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/discovery.d.ts +84 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/discovery.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/discovery.js +382 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/discovery.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/download.d.ts +70 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/download.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/download.js +334 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/download.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/index.d.ts +84 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/index.js +153 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/publish.d.ts +76 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/publish.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/publish.js +294 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/publish.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/registry.d.ts +58 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/registry.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/registry.js +285 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/registry.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/search.d.ts +54 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/search.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/search.js +232 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/search.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.d.ts +12 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.js +190 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/types.d.ts +193 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/types.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/types.js +6 -0
- package/v3/@claude-flow/cli/dist/src/transfer/store/types.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/test-seraphine.d.ts +6 -0
- package/v3/@claude-flow/cli/dist/src/transfer/test-seraphine.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/test-seraphine.js +105 -0
- package/v3/@claude-flow/cli/dist/src/transfer/test-seraphine.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/tests/test-store.d.ts +7 -0
- package/v3/@claude-flow/cli/dist/src/transfer/tests/test-store.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/tests/test-store.js +214 -0
- package/v3/@claude-flow/cli/dist/src/transfer/tests/test-store.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/types.d.ts +245 -0
- package/v3/@claude-flow/cli/dist/src/transfer/types.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/transfer/types.js +6 -0
- package/v3/@claude-flow/cli/dist/src/transfer/types.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/types.d.ts +198 -0
- package/v3/@claude-flow/cli/dist/src/types.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/types.js +38 -0
- package/v3/@claude-flow/cli/dist/src/types.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/update/checker.d.ts +34 -0
- package/v3/@claude-flow/cli/dist/src/update/checker.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/update/checker.js +190 -0
- package/v3/@claude-flow/cli/dist/src/update/checker.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/update/executor.d.ts +32 -0
- package/v3/@claude-flow/cli/dist/src/update/executor.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/update/executor.js +181 -0
- package/v3/@claude-flow/cli/dist/src/update/executor.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/update/index.d.ts +33 -0
- package/v3/@claude-flow/cli/dist/src/update/index.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/update/index.js +64 -0
- package/v3/@claude-flow/cli/dist/src/update/index.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/update/rate-limiter.d.ts +20 -0
- package/v3/@claude-flow/cli/dist/src/update/rate-limiter.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/update/rate-limiter.js +96 -0
- package/v3/@claude-flow/cli/dist/src/update/rate-limiter.js.map +1 -0
- package/v3/@claude-flow/cli/dist/src/update/validator.d.ts +17 -0
- package/v3/@claude-flow/cli/dist/src/update/validator.d.ts.map +1 -0
- package/v3/@claude-flow/cli/dist/src/update/validator.js +123 -0
- package/v3/@claude-flow/cli/dist/src/update/validator.js.map +1 -0
- package/v3/@claude-flow/cli/dist/tsconfig.tsbuildinfo +1 -0
- package/v3/@claude-flow/cli/package.json +109 -0
|
@@ -0,0 +1,1011 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headless Worker Executor
|
|
3
|
+
* Enables workers to invoke Claude Code in headless mode with configurable sandbox profiles.
|
|
4
|
+
*
|
|
5
|
+
* ADR-020: Headless Worker Integration Architecture
|
|
6
|
+
* - Integrates with CLAUDE_CODE_HEADLESS and CLAUDE_CODE_SANDBOX_MODE environment variables
|
|
7
|
+
* - Provides process pool for concurrent execution
|
|
8
|
+
* - Builds context from file glob patterns
|
|
9
|
+
* - Supports prompt templates and output parsing
|
|
10
|
+
* - Implements timeout and graceful error handling
|
|
11
|
+
*
|
|
12
|
+
* Key Features:
|
|
13
|
+
* - Process pool with configurable maxConcurrent
|
|
14
|
+
* - Context building from file glob patterns with caching
|
|
15
|
+
* - Prompt template system with context injection
|
|
16
|
+
* - Output parsing (text, json, markdown)
|
|
17
|
+
* - Timeout handling with graceful termination
|
|
18
|
+
* - Execution logging for debugging
|
|
19
|
+
* - Event emission for monitoring
|
|
20
|
+
*/
|
|
21
|
+
import { spawn, execSync } from 'child_process';
|
|
22
|
+
import { EventEmitter } from 'events';
|
|
23
|
+
import { existsSync, readFileSync, readdirSync, mkdirSync, writeFileSync } from 'fs';
|
|
24
|
+
import { join } from 'path';
|
|
25
|
+
// ============================================
|
|
26
|
+
// Constants
|
|
27
|
+
// ============================================
|
|
28
|
+
/**
|
|
29
|
+
* Array of headless worker types for runtime checking
|
|
30
|
+
*/
|
|
31
|
+
export const HEADLESS_WORKER_TYPES = [
|
|
32
|
+
'audit',
|
|
33
|
+
'optimize',
|
|
34
|
+
'testgaps',
|
|
35
|
+
'document',
|
|
36
|
+
'ultralearn',
|
|
37
|
+
'refactor',
|
|
38
|
+
'deepdive',
|
|
39
|
+
'predict',
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Array of local worker types
|
|
43
|
+
*/
|
|
44
|
+
export const LOCAL_WORKER_TYPES = [
|
|
45
|
+
'map',
|
|
46
|
+
'consolidate',
|
|
47
|
+
'benchmark',
|
|
48
|
+
'preload',
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* Model ID mapping
|
|
52
|
+
*/
|
|
53
|
+
const MODEL_IDS = {
|
|
54
|
+
sonnet: 'claude-sonnet-4-5-20250929',
|
|
55
|
+
opus: 'claude-opus-4-6',
|
|
56
|
+
haiku: 'claude-haiku-4-5-20251001',
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Default headless worker configurations based on ADR-020
|
|
60
|
+
*/
|
|
61
|
+
export const HEADLESS_WORKER_CONFIGS = {
|
|
62
|
+
audit: {
|
|
63
|
+
type: 'audit',
|
|
64
|
+
mode: 'headless',
|
|
65
|
+
intervalMs: 30 * 60 * 1000,
|
|
66
|
+
priority: 'critical',
|
|
67
|
+
description: 'AI-powered security analysis',
|
|
68
|
+
enabled: true,
|
|
69
|
+
headless: {
|
|
70
|
+
promptTemplate: `Perform a security audit of this codebase. Check for:
|
|
71
|
+
- Hardcoded secrets (API keys, passwords, tokens, connection strings in source files)
|
|
72
|
+
- SQL injection vulnerabilities (unsanitized user input in queries)
|
|
73
|
+
- XSS vulnerabilities (unescaped output rendered in HTML/templates)
|
|
74
|
+
- Path traversal risks (user-controlled file paths without validation)
|
|
75
|
+
- Command injection (unsanitized input passed to shell/exec calls)
|
|
76
|
+
- Insecure dependencies (known CVEs in package.json dependencies)
|
|
77
|
+
- Authentication/authorization issues (missing auth checks, weak token handling)
|
|
78
|
+
|
|
79
|
+
Report findings with severity levels. Provide a JSON report with:
|
|
80
|
+
{
|
|
81
|
+
"vulnerabilities": [{ "severity": "critical|high|medium|low", "type": "secret|sqli|xss|path-traversal|command-injection|dependency|auth", "file": "...", "line": N, "description": "...", "recommendation": "..." }],
|
|
82
|
+
"riskScore": 0-100,
|
|
83
|
+
"summary": { "critical": N, "high": N, "medium": N, "low": N },
|
|
84
|
+
"recommendations": ["..."]
|
|
85
|
+
}`,
|
|
86
|
+
sandbox: 'strict',
|
|
87
|
+
model: 'haiku',
|
|
88
|
+
outputFormat: 'json',
|
|
89
|
+
contextPatterns: ['**/*.ts', '**/*.js', '**/.env*', '**/package.json'],
|
|
90
|
+
timeoutMs: 5 * 60 * 1000,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
optimize: {
|
|
94
|
+
type: 'optimize',
|
|
95
|
+
mode: 'headless',
|
|
96
|
+
intervalMs: 60 * 60 * 1000,
|
|
97
|
+
priority: 'high',
|
|
98
|
+
description: 'AI optimization suggestions',
|
|
99
|
+
enabled: true,
|
|
100
|
+
headless: {
|
|
101
|
+
promptTemplate: `Analyze this codebase for performance bottlenecks. Check for:
|
|
102
|
+
- N+1 query patterns (repeated DB/API calls inside loops)
|
|
103
|
+
- Unnecessary re-renders (missing memoization, unstable references in React components)
|
|
104
|
+
- Large bundle sizes (heavy imports that could be lazy-loaded or tree-shaken)
|
|
105
|
+
- Unoptimized loops (O(n^2) patterns, redundant iterations, missing early exits)
|
|
106
|
+
- Memory leaks (unclosed streams, unremoved event listeners, growing caches without eviction)
|
|
107
|
+
- Missing caching opportunities (repeated expensive computations, redundant file reads)
|
|
108
|
+
- Synchronous blocking operations (sync I/O in hot paths, missing async/await)
|
|
109
|
+
|
|
110
|
+
For each finding, suggest a specific improvement with before/after code examples where applicable.
|
|
111
|
+
Prioritize findings by estimated performance impact (high/medium/low).`,
|
|
112
|
+
sandbox: 'permissive',
|
|
113
|
+
model: 'sonnet',
|
|
114
|
+
outputFormat: 'markdown',
|
|
115
|
+
contextPatterns: ['src/**/*.ts', 'src/**/*.tsx'],
|
|
116
|
+
timeoutMs: 10 * 60 * 1000,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
testgaps: {
|
|
120
|
+
type: 'testgaps',
|
|
121
|
+
mode: 'headless',
|
|
122
|
+
intervalMs: 60 * 60 * 1000,
|
|
123
|
+
priority: 'normal',
|
|
124
|
+
description: 'AI test gap analysis',
|
|
125
|
+
enabled: true,
|
|
126
|
+
headless: {
|
|
127
|
+
promptTemplate: `Analyze test coverage gaps in this codebase. Identify:
|
|
128
|
+
- Untested exported functions and public class methods (compare src/ exports against test files)
|
|
129
|
+
- Missing edge cases (null/undefined inputs, empty collections, boundary values, error paths)
|
|
130
|
+
- Areas with low coverage (files with no corresponding test file, complex branches without tests)
|
|
131
|
+
- Missing error handling tests (try/catch blocks, rejected promises, error event handlers)
|
|
132
|
+
- Integration test gaps (API endpoint combinations, multi-service workflows, database transactions)
|
|
133
|
+
- Missing regression tests for known bug patterns
|
|
134
|
+
|
|
135
|
+
Prioritize gaps by risk (how likely a bug here would cause production issues) and complexity (how hard the code is to reason about). For each gap, provide a test skeleton with describe/it blocks and key assertions.`,
|
|
136
|
+
sandbox: 'permissive',
|
|
137
|
+
model: 'sonnet',
|
|
138
|
+
outputFormat: 'markdown',
|
|
139
|
+
contextPatterns: ['src/**/*.ts', 'tests/**/*.ts', '__tests__/**/*.ts'],
|
|
140
|
+
timeoutMs: 10 * 60 * 1000,
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
document: {
|
|
144
|
+
type: 'document',
|
|
145
|
+
mode: 'headless',
|
|
146
|
+
intervalMs: 120 * 60 * 1000,
|
|
147
|
+
priority: 'low',
|
|
148
|
+
description: 'AI documentation generation',
|
|
149
|
+
enabled: false,
|
|
150
|
+
headless: {
|
|
151
|
+
promptTemplate: `Review code for documentation gaps. Identify and generate documentation for:
|
|
152
|
+
- Public APIs and exported functions missing JSDoc comments (include @param, @returns, @throws, @example)
|
|
153
|
+
- Exported classes and interfaces without description comments
|
|
154
|
+
- Complex logic blocks (algorithms, state machines, recursive functions) that lack inline explanations
|
|
155
|
+
- Module-level documentation (purpose, usage patterns, dependencies)
|
|
156
|
+
- Type definitions that would benefit from property descriptions
|
|
157
|
+
|
|
158
|
+
For each gap found, generate a complete JSDoc stub ready to be inserted. Focus on public-facing code first, then internal utilities. Include usage examples for non-obvious APIs.`,
|
|
159
|
+
sandbox: 'permissive',
|
|
160
|
+
model: 'haiku',
|
|
161
|
+
outputFormat: 'markdown',
|
|
162
|
+
contextPatterns: ['src/**/*.ts'],
|
|
163
|
+
timeoutMs: 10 * 60 * 1000,
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
ultralearn: {
|
|
167
|
+
type: 'ultralearn',
|
|
168
|
+
mode: 'headless',
|
|
169
|
+
intervalMs: 0, // Manual trigger only
|
|
170
|
+
priority: 'normal',
|
|
171
|
+
description: 'Deep knowledge acquisition',
|
|
172
|
+
enabled: false,
|
|
173
|
+
headless: {
|
|
174
|
+
promptTemplate: `Deeply analyze this codebase to learn:
|
|
175
|
+
- Architectural patterns used
|
|
176
|
+
- Coding conventions
|
|
177
|
+
- Domain-specific terminology
|
|
178
|
+
- Common patterns and idioms
|
|
179
|
+
- Team preferences
|
|
180
|
+
|
|
181
|
+
Provide insights as JSON:
|
|
182
|
+
{
|
|
183
|
+
"architecture": { "patterns": [...], "style": "..." },
|
|
184
|
+
"conventions": { "naming": "...", "formatting": "..." },
|
|
185
|
+
"domains": ["..."],
|
|
186
|
+
"insights": ["..."]
|
|
187
|
+
}`,
|
|
188
|
+
sandbox: 'strict',
|
|
189
|
+
model: 'opus',
|
|
190
|
+
outputFormat: 'json',
|
|
191
|
+
contextPatterns: ['**/*.ts', '**/CLAUDE.md', '**/README.md'],
|
|
192
|
+
timeoutMs: 15 * 60 * 1000,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
refactor: {
|
|
196
|
+
type: 'refactor',
|
|
197
|
+
mode: 'headless',
|
|
198
|
+
intervalMs: 0, // Manual trigger only
|
|
199
|
+
priority: 'normal',
|
|
200
|
+
description: 'AI refactoring suggestions',
|
|
201
|
+
enabled: false,
|
|
202
|
+
headless: {
|
|
203
|
+
promptTemplate: `Identify refactoring opportunities in this codebase. Look for:
|
|
204
|
+
- Code duplication (similar logic repeated across files or functions that should be extracted)
|
|
205
|
+
- Long methods (functions exceeding 30-40 lines that should be decomposed)
|
|
206
|
+
- Complex conditionals (deeply nested if/else, switch statements that could use polymorphism or lookup tables)
|
|
207
|
+
- Unclear naming (variables, functions, or classes whose names do not convey their purpose)
|
|
208
|
+
- Dead code (unreachable branches, unused exports, commented-out blocks)
|
|
209
|
+
- God classes/modules (files doing too many things that should be split by responsibility)
|
|
210
|
+
- Missing abstractions (repeated patterns that could become shared utilities or base classes)
|
|
211
|
+
|
|
212
|
+
For each finding, suggest a specific refactoring with before/after code examples. Categorize by effort (quick-win vs. significant restructuring) and impact (readability, maintainability, testability).`,
|
|
213
|
+
sandbox: 'permissive',
|
|
214
|
+
model: 'sonnet',
|
|
215
|
+
outputFormat: 'markdown',
|
|
216
|
+
contextPatterns: ['src/**/*.ts'],
|
|
217
|
+
timeoutMs: 10 * 60 * 1000,
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
deepdive: {
|
|
221
|
+
type: 'deepdive',
|
|
222
|
+
mode: 'headless',
|
|
223
|
+
intervalMs: 0, // Manual trigger only
|
|
224
|
+
priority: 'normal',
|
|
225
|
+
description: 'Deep code analysis',
|
|
226
|
+
enabled: false,
|
|
227
|
+
headless: {
|
|
228
|
+
promptTemplate: `Perform deep analysis of this codebase:
|
|
229
|
+
- Understand data flow
|
|
230
|
+
- Map dependencies
|
|
231
|
+
- Identify architectural issues
|
|
232
|
+
- Find potential bugs
|
|
233
|
+
- Analyze error handling
|
|
234
|
+
|
|
235
|
+
Provide comprehensive report.`,
|
|
236
|
+
sandbox: 'strict',
|
|
237
|
+
model: 'opus',
|
|
238
|
+
outputFormat: 'markdown',
|
|
239
|
+
contextPatterns: ['src/**/*.ts'],
|
|
240
|
+
timeoutMs: 15 * 60 * 1000,
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
predict: {
|
|
244
|
+
type: 'predict',
|
|
245
|
+
mode: 'headless',
|
|
246
|
+
intervalMs: 10 * 60 * 1000,
|
|
247
|
+
priority: 'low',
|
|
248
|
+
description: 'Predictive preloading',
|
|
249
|
+
enabled: false,
|
|
250
|
+
headless: {
|
|
251
|
+
promptTemplate: `Analyze recent code changes and development activity to predict likely next tasks. Examine:
|
|
252
|
+
- Recently modified files and their dependencies (what files are commonly edited together)
|
|
253
|
+
- Patterns in development activity (feature branches, test additions after implementations, config changes after new modules)
|
|
254
|
+
- Incomplete work indicators (TODO/FIXME comments, partial implementations, failing tests)
|
|
255
|
+
- Dependency chains (if module A was updated, modules B and C likely need updates too)
|
|
256
|
+
|
|
257
|
+
Suggest preloading of relevant context for the developer. Provide predictions as JSON:
|
|
258
|
+
{
|
|
259
|
+
"predictedNextFiles": [{ "file": "...", "reason": "...", "confidence": 0.0-1.0 }],
|
|
260
|
+
"suggestedTasks": [{ "task": "...", "reason": "...", "priority": "high|medium|low" }],
|
|
261
|
+
"testsToRun": ["..."],
|
|
262
|
+
"docsToReference": ["..."],
|
|
263
|
+
"overallConfidence": 0.0-1.0
|
|
264
|
+
}`,
|
|
265
|
+
sandbox: 'strict',
|
|
266
|
+
model: 'haiku',
|
|
267
|
+
outputFormat: 'json',
|
|
268
|
+
contextPatterns: ['.claude-flow/metrics/*.json'],
|
|
269
|
+
timeoutMs: 2 * 60 * 1000,
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Local worker configurations
|
|
275
|
+
*/
|
|
276
|
+
export const LOCAL_WORKER_CONFIGS = {
|
|
277
|
+
map: {
|
|
278
|
+
type: 'map',
|
|
279
|
+
mode: 'local',
|
|
280
|
+
intervalMs: 15 * 60 * 1000,
|
|
281
|
+
priority: 'normal',
|
|
282
|
+
description: 'Codebase mapping',
|
|
283
|
+
enabled: true,
|
|
284
|
+
},
|
|
285
|
+
consolidate: {
|
|
286
|
+
type: 'consolidate',
|
|
287
|
+
mode: 'local',
|
|
288
|
+
intervalMs: 30 * 60 * 1000,
|
|
289
|
+
priority: 'low',
|
|
290
|
+
description: 'Memory consolidation',
|
|
291
|
+
enabled: true,
|
|
292
|
+
},
|
|
293
|
+
benchmark: {
|
|
294
|
+
type: 'benchmark',
|
|
295
|
+
mode: 'local',
|
|
296
|
+
intervalMs: 60 * 60 * 1000,
|
|
297
|
+
priority: 'low',
|
|
298
|
+
description: 'Performance benchmarking',
|
|
299
|
+
enabled: false,
|
|
300
|
+
},
|
|
301
|
+
preload: {
|
|
302
|
+
type: 'preload',
|
|
303
|
+
mode: 'local',
|
|
304
|
+
intervalMs: 5 * 60 * 1000,
|
|
305
|
+
priority: 'low',
|
|
306
|
+
description: 'Resource preloading',
|
|
307
|
+
enabled: false,
|
|
308
|
+
},
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* Combined worker configurations
|
|
312
|
+
*/
|
|
313
|
+
export const ALL_WORKER_CONFIGS = [
|
|
314
|
+
...Object.values(HEADLESS_WORKER_CONFIGS),
|
|
315
|
+
...Object.values(LOCAL_WORKER_CONFIGS),
|
|
316
|
+
];
|
|
317
|
+
// ============================================
|
|
318
|
+
// Utility Functions
|
|
319
|
+
// ============================================
|
|
320
|
+
/**
|
|
321
|
+
* Check if a worker type is a headless worker
|
|
322
|
+
*/
|
|
323
|
+
export function isHeadlessWorker(type) {
|
|
324
|
+
return HEADLESS_WORKER_TYPES.includes(type);
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Check if a worker type is a local worker
|
|
328
|
+
*/
|
|
329
|
+
export function isLocalWorker(type) {
|
|
330
|
+
return LOCAL_WORKER_TYPES.includes(type);
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Get model ID from model type
|
|
334
|
+
*/
|
|
335
|
+
export function getModelId(model) {
|
|
336
|
+
return MODEL_IDS[model];
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Get worker configuration by type
|
|
340
|
+
*/
|
|
341
|
+
export function getWorkerConfig(type) {
|
|
342
|
+
if (isHeadlessWorker(type)) {
|
|
343
|
+
return HEADLESS_WORKER_CONFIGS[type];
|
|
344
|
+
}
|
|
345
|
+
if (isLocalWorker(type)) {
|
|
346
|
+
return LOCAL_WORKER_CONFIGS[type];
|
|
347
|
+
}
|
|
348
|
+
return undefined;
|
|
349
|
+
}
|
|
350
|
+
// ============================================
|
|
351
|
+
// HeadlessWorkerExecutor Class
|
|
352
|
+
// ============================================
|
|
353
|
+
/**
|
|
354
|
+
* HeadlessWorkerExecutor - Executes workers using Claude Code in headless mode
|
|
355
|
+
*
|
|
356
|
+
* Features:
|
|
357
|
+
* - Process pool with configurable concurrency limit
|
|
358
|
+
* - Pending queue for overflow requests
|
|
359
|
+
* - Context caching with configurable TTL
|
|
360
|
+
* - Execution logging for debugging
|
|
361
|
+
* - Event emission for monitoring
|
|
362
|
+
* - Graceful termination
|
|
363
|
+
*/
|
|
364
|
+
export class HeadlessWorkerExecutor extends EventEmitter {
|
|
365
|
+
projectRoot;
|
|
366
|
+
config;
|
|
367
|
+
processPool = new Map();
|
|
368
|
+
pendingQueue = [];
|
|
369
|
+
contextCache = new Map();
|
|
370
|
+
claudeCodeAvailable = null;
|
|
371
|
+
claudeCodeVersion = null;
|
|
372
|
+
constructor(projectRoot, options) {
|
|
373
|
+
super();
|
|
374
|
+
this.projectRoot = projectRoot;
|
|
375
|
+
// Merge with defaults
|
|
376
|
+
this.config = {
|
|
377
|
+
maxConcurrent: options?.maxConcurrent ?? 2,
|
|
378
|
+
defaultTimeoutMs: options?.defaultTimeoutMs ?? 5 * 60 * 1000,
|
|
379
|
+
maxContextFiles: options?.maxContextFiles ?? 20,
|
|
380
|
+
maxCharsPerFile: options?.maxCharsPerFile ?? 5000,
|
|
381
|
+
logDir: options?.logDir ?? join(projectRoot, '.claude-flow', 'logs', 'headless'),
|
|
382
|
+
cacheContext: options?.cacheContext ?? true,
|
|
383
|
+
cacheTtlMs: options?.cacheTtlMs ?? 60000, // 1 minute default
|
|
384
|
+
};
|
|
385
|
+
// Ensure log directory exists
|
|
386
|
+
this.ensureLogDir();
|
|
387
|
+
}
|
|
388
|
+
// ============================================
|
|
389
|
+
// Public API
|
|
390
|
+
// ============================================
|
|
391
|
+
/**
|
|
392
|
+
* Check if Claude Code CLI is available
|
|
393
|
+
*/
|
|
394
|
+
async isAvailable() {
|
|
395
|
+
if (this.claudeCodeAvailable !== null) {
|
|
396
|
+
return this.claudeCodeAvailable;
|
|
397
|
+
}
|
|
398
|
+
try {
|
|
399
|
+
const output = execSync('claude --version', {
|
|
400
|
+
encoding: 'utf-8',
|
|
401
|
+
stdio: 'pipe',
|
|
402
|
+
timeout: 5000,
|
|
403
|
+
windowsHide: true, // Prevent phantom console windows on Windows
|
|
404
|
+
});
|
|
405
|
+
this.claudeCodeAvailable = true;
|
|
406
|
+
this.claudeCodeVersion = output.trim();
|
|
407
|
+
this.emit('status', { available: true, version: this.claudeCodeVersion });
|
|
408
|
+
return true;
|
|
409
|
+
}
|
|
410
|
+
catch {
|
|
411
|
+
this.claudeCodeAvailable = false;
|
|
412
|
+
this.emit('status', { available: false });
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Get Claude Code version
|
|
418
|
+
*/
|
|
419
|
+
async getVersion() {
|
|
420
|
+
await this.isAvailable();
|
|
421
|
+
return this.claudeCodeVersion;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Execute a headless worker
|
|
425
|
+
*/
|
|
426
|
+
async execute(workerType, configOverrides) {
|
|
427
|
+
const baseConfig = HEADLESS_WORKER_CONFIGS[workerType];
|
|
428
|
+
if (!baseConfig) {
|
|
429
|
+
throw new Error(`Unknown headless worker type: ${workerType}`);
|
|
430
|
+
}
|
|
431
|
+
// Check availability
|
|
432
|
+
const available = await this.isAvailable();
|
|
433
|
+
if (!available) {
|
|
434
|
+
const result = this.createErrorResult(workerType, 'Claude Code CLI not available. Install with: npm install -g @anthropic-ai/claude-code');
|
|
435
|
+
this.emit('error', result);
|
|
436
|
+
return result;
|
|
437
|
+
}
|
|
438
|
+
// Check concurrent limit
|
|
439
|
+
if (this.processPool.size >= this.config.maxConcurrent) {
|
|
440
|
+
// Queue the request
|
|
441
|
+
return new Promise((resolve, reject) => {
|
|
442
|
+
const entry = {
|
|
443
|
+
workerType,
|
|
444
|
+
config: configOverrides,
|
|
445
|
+
resolve,
|
|
446
|
+
reject,
|
|
447
|
+
queuedAt: new Date(),
|
|
448
|
+
};
|
|
449
|
+
this.pendingQueue.push(entry);
|
|
450
|
+
this.emit('queued', {
|
|
451
|
+
workerType,
|
|
452
|
+
queuePosition: this.pendingQueue.length,
|
|
453
|
+
});
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
// Execute immediately
|
|
457
|
+
return this.executeInternal(workerType, configOverrides);
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Get pool status
|
|
461
|
+
*/
|
|
462
|
+
getPoolStatus() {
|
|
463
|
+
const now = Date.now();
|
|
464
|
+
return {
|
|
465
|
+
activeCount: this.processPool.size,
|
|
466
|
+
queueLength: this.pendingQueue.length,
|
|
467
|
+
maxConcurrent: this.config.maxConcurrent,
|
|
468
|
+
activeWorkers: Array.from(this.processPool.values()).map((entry) => ({
|
|
469
|
+
executionId: entry.executionId,
|
|
470
|
+
workerType: entry.workerType,
|
|
471
|
+
startTime: entry.startTime,
|
|
472
|
+
elapsedMs: now - entry.startTime.getTime(),
|
|
473
|
+
})),
|
|
474
|
+
queuedWorkers: this.pendingQueue.map((entry) => ({
|
|
475
|
+
workerType: entry.workerType,
|
|
476
|
+
queuedAt: entry.queuedAt,
|
|
477
|
+
waitingMs: now - entry.queuedAt.getTime(),
|
|
478
|
+
})),
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Get number of active executions
|
|
483
|
+
*/
|
|
484
|
+
getActiveCount() {
|
|
485
|
+
return this.processPool.size;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Cancel a running execution
|
|
489
|
+
*/
|
|
490
|
+
cancel(executionId) {
|
|
491
|
+
const entry = this.processPool.get(executionId);
|
|
492
|
+
if (!entry) {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
clearTimeout(entry.timeout);
|
|
496
|
+
entry.process.kill('SIGTERM');
|
|
497
|
+
this.processPool.delete(executionId);
|
|
498
|
+
this.emit('cancelled', { executionId });
|
|
499
|
+
// Process next in queue
|
|
500
|
+
this.processQueue();
|
|
501
|
+
return true;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Cancel all running executions
|
|
505
|
+
*/
|
|
506
|
+
cancelAll() {
|
|
507
|
+
let cancelled = 0;
|
|
508
|
+
// Cancel active processes (convert to array to avoid iterator issues)
|
|
509
|
+
const entries = Array.from(this.processPool.entries());
|
|
510
|
+
for (const [executionId, entry] of entries) {
|
|
511
|
+
clearTimeout(entry.timeout);
|
|
512
|
+
entry.process.kill('SIGTERM');
|
|
513
|
+
this.emit('cancelled', { executionId });
|
|
514
|
+
cancelled++;
|
|
515
|
+
}
|
|
516
|
+
this.processPool.clear();
|
|
517
|
+
// Reject pending queue
|
|
518
|
+
for (const entry of this.pendingQueue) {
|
|
519
|
+
entry.reject(new Error('Executor cancelled all executions'));
|
|
520
|
+
}
|
|
521
|
+
this.pendingQueue = [];
|
|
522
|
+
this.emit('allCancelled', { count: cancelled });
|
|
523
|
+
return cancelled;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Clear context cache
|
|
527
|
+
*/
|
|
528
|
+
clearContextCache() {
|
|
529
|
+
this.contextCache.clear();
|
|
530
|
+
this.emit('cacheClear', {});
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Get worker configuration
|
|
534
|
+
*/
|
|
535
|
+
getConfig(workerType) {
|
|
536
|
+
return HEADLESS_WORKER_CONFIGS[workerType];
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Get all headless worker types
|
|
540
|
+
*/
|
|
541
|
+
getHeadlessWorkerTypes() {
|
|
542
|
+
return [...HEADLESS_WORKER_TYPES];
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Get all local worker types
|
|
546
|
+
*/
|
|
547
|
+
getLocalWorkerTypes() {
|
|
548
|
+
return [...LOCAL_WORKER_TYPES];
|
|
549
|
+
}
|
|
550
|
+
// ============================================
|
|
551
|
+
// Private Methods
|
|
552
|
+
// ============================================
|
|
553
|
+
/**
|
|
554
|
+
* Ensure log directory exists
|
|
555
|
+
*/
|
|
556
|
+
ensureLogDir() {
|
|
557
|
+
try {
|
|
558
|
+
if (!existsSync(this.config.logDir)) {
|
|
559
|
+
mkdirSync(this.config.logDir, { recursive: true });
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
catch (error) {
|
|
563
|
+
this.emit('warning', { message: 'Failed to create log directory', error });
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Internal execution logic
|
|
568
|
+
*/
|
|
569
|
+
async executeInternal(workerType, configOverrides) {
|
|
570
|
+
const baseConfig = HEADLESS_WORKER_CONFIGS[workerType];
|
|
571
|
+
const headless = { ...baseConfig.headless, ...configOverrides };
|
|
572
|
+
const startTime = Date.now();
|
|
573
|
+
const executionId = `${workerType}_${startTime}_${Math.random().toString(36).slice(2, 8)}`;
|
|
574
|
+
this.emit('start', { executionId, workerType, config: headless });
|
|
575
|
+
try {
|
|
576
|
+
// Build context from file patterns
|
|
577
|
+
const context = await this.buildContext(headless.contextPatterns || []);
|
|
578
|
+
// Build the full prompt
|
|
579
|
+
const fullPrompt = this.buildPrompt(headless.promptTemplate, context);
|
|
580
|
+
// Log prompt for debugging
|
|
581
|
+
this.logExecution(executionId, 'prompt', fullPrompt);
|
|
582
|
+
// Execute Claude Code headlessly
|
|
583
|
+
const result = await this.executeClaudeCode(fullPrompt, {
|
|
584
|
+
sandbox: headless.sandbox,
|
|
585
|
+
model: headless.model || 'sonnet',
|
|
586
|
+
timeoutMs: headless.timeoutMs || this.config.defaultTimeoutMs,
|
|
587
|
+
executionId,
|
|
588
|
+
workerType,
|
|
589
|
+
});
|
|
590
|
+
// Parse output based on format
|
|
591
|
+
let parsedOutput;
|
|
592
|
+
if (headless.outputFormat === 'json' && result.output) {
|
|
593
|
+
parsedOutput = this.parseJsonOutput(result.output);
|
|
594
|
+
}
|
|
595
|
+
else if (headless.outputFormat === 'markdown' && result.output) {
|
|
596
|
+
parsedOutput = this.parseMarkdownOutput(result.output);
|
|
597
|
+
}
|
|
598
|
+
const executionResult = {
|
|
599
|
+
success: result.success,
|
|
600
|
+
output: result.output,
|
|
601
|
+
parsedOutput,
|
|
602
|
+
durationMs: Date.now() - startTime,
|
|
603
|
+
tokensUsed: result.tokensUsed,
|
|
604
|
+
model: headless.model || 'sonnet',
|
|
605
|
+
sandboxMode: headless.sandbox,
|
|
606
|
+
workerType,
|
|
607
|
+
timestamp: new Date(),
|
|
608
|
+
executionId,
|
|
609
|
+
error: result.error,
|
|
610
|
+
};
|
|
611
|
+
// Log result
|
|
612
|
+
this.logExecution(executionId, 'result', JSON.stringify(executionResult, null, 2));
|
|
613
|
+
this.emit('complete', executionResult);
|
|
614
|
+
return executionResult;
|
|
615
|
+
}
|
|
616
|
+
catch (error) {
|
|
617
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
618
|
+
const executionResult = this.createErrorResult(workerType, errorMessage);
|
|
619
|
+
executionResult.executionId = executionId;
|
|
620
|
+
executionResult.durationMs = Date.now() - startTime;
|
|
621
|
+
this.logExecution(executionId, 'error', errorMessage);
|
|
622
|
+
this.emit('error', executionResult);
|
|
623
|
+
return executionResult;
|
|
624
|
+
}
|
|
625
|
+
finally {
|
|
626
|
+
// Process next in queue
|
|
627
|
+
this.processQueue();
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Process the pending queue
|
|
632
|
+
*/
|
|
633
|
+
processQueue() {
|
|
634
|
+
while (this.pendingQueue.length > 0 &&
|
|
635
|
+
this.processPool.size < this.config.maxConcurrent) {
|
|
636
|
+
const next = this.pendingQueue.shift();
|
|
637
|
+
if (!next)
|
|
638
|
+
break;
|
|
639
|
+
this.executeInternal(next.workerType, next.config)
|
|
640
|
+
.then(next.resolve)
|
|
641
|
+
.catch(next.reject);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Build context from file patterns
|
|
646
|
+
*/
|
|
647
|
+
async buildContext(patterns) {
|
|
648
|
+
if (patterns.length === 0)
|
|
649
|
+
return '';
|
|
650
|
+
// Check cache
|
|
651
|
+
const cacheKey = patterns.sort().join('|');
|
|
652
|
+
if (this.config.cacheContext) {
|
|
653
|
+
const cached = this.contextCache.get(cacheKey);
|
|
654
|
+
if (cached && Date.now() - cached.timestamp < this.config.cacheTtlMs) {
|
|
655
|
+
return cached.content;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
// Collect files matching patterns
|
|
659
|
+
const files = [];
|
|
660
|
+
for (const pattern of patterns) {
|
|
661
|
+
const matches = this.simpleGlob(pattern);
|
|
662
|
+
files.push(...matches);
|
|
663
|
+
}
|
|
664
|
+
// Deduplicate and limit
|
|
665
|
+
const uniqueFiles = Array.from(new Set(files)).slice(0, this.config.maxContextFiles);
|
|
666
|
+
// Build context
|
|
667
|
+
const contextParts = [];
|
|
668
|
+
for (const file of uniqueFiles) {
|
|
669
|
+
try {
|
|
670
|
+
const fullPath = join(this.projectRoot, file);
|
|
671
|
+
if (!existsSync(fullPath))
|
|
672
|
+
continue;
|
|
673
|
+
const content = readFileSync(fullPath, 'utf-8');
|
|
674
|
+
const truncated = content.slice(0, this.config.maxCharsPerFile);
|
|
675
|
+
const wasTruncated = content.length > this.config.maxCharsPerFile;
|
|
676
|
+
contextParts.push(`--- ${file}${wasTruncated ? ' (truncated)' : ''} ---\n${truncated}`);
|
|
677
|
+
}
|
|
678
|
+
catch {
|
|
679
|
+
// Skip unreadable files
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
const contextContent = contextParts.join('\n\n');
|
|
683
|
+
// Cache the result
|
|
684
|
+
if (this.config.cacheContext) {
|
|
685
|
+
this.contextCache.set(cacheKey, {
|
|
686
|
+
content: contextContent,
|
|
687
|
+
timestamp: Date.now(),
|
|
688
|
+
patterns,
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
return contextContent;
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Simple glob implementation for file matching
|
|
695
|
+
*/
|
|
696
|
+
simpleGlob(pattern) {
|
|
697
|
+
const results = [];
|
|
698
|
+
// Handle simple patterns (no wildcards)
|
|
699
|
+
if (!pattern.includes('*')) {
|
|
700
|
+
const fullPath = join(this.projectRoot, pattern);
|
|
701
|
+
if (existsSync(fullPath)) {
|
|
702
|
+
results.push(pattern);
|
|
703
|
+
}
|
|
704
|
+
return results;
|
|
705
|
+
}
|
|
706
|
+
// Parse pattern parts
|
|
707
|
+
const parts = pattern.split('/');
|
|
708
|
+
const scanDir = (dir, remainingParts) => {
|
|
709
|
+
if (remainingParts.length === 0)
|
|
710
|
+
return;
|
|
711
|
+
if (results.length >= 100)
|
|
712
|
+
return; // Limit results
|
|
713
|
+
try {
|
|
714
|
+
const fullDir = join(this.projectRoot, dir);
|
|
715
|
+
if (!existsSync(fullDir))
|
|
716
|
+
return;
|
|
717
|
+
const entries = readdirSync(fullDir, { withFileTypes: true });
|
|
718
|
+
const currentPart = remainingParts[0];
|
|
719
|
+
const isLastPart = remainingParts.length === 1;
|
|
720
|
+
for (const entry of entries) {
|
|
721
|
+
// Skip common non-code directories
|
|
722
|
+
if (entry.name === 'node_modules' ||
|
|
723
|
+
entry.name === '.git' ||
|
|
724
|
+
entry.name === 'dist' ||
|
|
725
|
+
entry.name === 'build' ||
|
|
726
|
+
entry.name === 'coverage' ||
|
|
727
|
+
entry.name === '.next' ||
|
|
728
|
+
entry.name === '.cache') {
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
const entryPath = dir ? `${dir}/${entry.name}` : entry.name;
|
|
732
|
+
if (currentPart === '**') {
|
|
733
|
+
// Recursive glob
|
|
734
|
+
if (entry.isDirectory()) {
|
|
735
|
+
scanDir(entryPath, remainingParts); // Continue with **
|
|
736
|
+
scanDir(entryPath, remainingParts.slice(1)); // Try next part
|
|
737
|
+
}
|
|
738
|
+
else if (entry.isFile() && remainingParts.length > 1) {
|
|
739
|
+
// Check if file matches next pattern part
|
|
740
|
+
const nextPart = remainingParts[1];
|
|
741
|
+
if (this.matchesPattern(entry.name, nextPart)) {
|
|
742
|
+
results.push(entryPath);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
else if (this.matchesPattern(entry.name, currentPart)) {
|
|
747
|
+
if (isLastPart && entry.isFile()) {
|
|
748
|
+
results.push(entryPath);
|
|
749
|
+
}
|
|
750
|
+
else if (!isLastPart && entry.isDirectory()) {
|
|
751
|
+
scanDir(entryPath, remainingParts.slice(1));
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
catch {
|
|
757
|
+
// Skip unreadable directories
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
scanDir('', parts);
|
|
761
|
+
return results;
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Match filename against a simple pattern
|
|
765
|
+
*/
|
|
766
|
+
matchesPattern(name, pattern) {
|
|
767
|
+
if (pattern === '*')
|
|
768
|
+
return true;
|
|
769
|
+
if (pattern === '**')
|
|
770
|
+
return true;
|
|
771
|
+
// Handle *.ext patterns
|
|
772
|
+
if (pattern.startsWith('*.')) {
|
|
773
|
+
return name.endsWith(pattern.slice(1));
|
|
774
|
+
}
|
|
775
|
+
// Handle prefix* patterns
|
|
776
|
+
if (pattern.endsWith('*')) {
|
|
777
|
+
return name.startsWith(pattern.slice(0, -1));
|
|
778
|
+
}
|
|
779
|
+
// Handle *suffix patterns
|
|
780
|
+
if (pattern.startsWith('*')) {
|
|
781
|
+
return name.endsWith(pattern.slice(1));
|
|
782
|
+
}
|
|
783
|
+
// Exact match
|
|
784
|
+
return name === pattern;
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Build full prompt with context
|
|
788
|
+
*/
|
|
789
|
+
buildPrompt(template, context) {
|
|
790
|
+
if (!context) {
|
|
791
|
+
return `${template}
|
|
792
|
+
|
|
793
|
+
## Instructions
|
|
794
|
+
|
|
795
|
+
Analyze the codebase and provide your response following the format specified in the task.`;
|
|
796
|
+
}
|
|
797
|
+
return `${template}
|
|
798
|
+
|
|
799
|
+
## Codebase Context
|
|
800
|
+
|
|
801
|
+
${context}
|
|
802
|
+
|
|
803
|
+
## Instructions
|
|
804
|
+
|
|
805
|
+
Analyze the above codebase context and provide your response following the format specified in the task.`;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Execute Claude Code in headless mode
|
|
809
|
+
*/
|
|
810
|
+
executeClaudeCode(prompt, options) {
|
|
811
|
+
return new Promise((resolve) => {
|
|
812
|
+
const env = {
|
|
813
|
+
...process.env,
|
|
814
|
+
CLAUDE_CODE_HEADLESS: 'true',
|
|
815
|
+
CLAUDE_CODE_SANDBOX_MODE: options.sandbox,
|
|
816
|
+
};
|
|
817
|
+
// Set model
|
|
818
|
+
env.ANTHROPIC_MODEL = MODEL_IDS[options.model];
|
|
819
|
+
// Spawn claude CLI process
|
|
820
|
+
// Fix #1395 Bug 1: Use 'ignore' for stdin since prompt is passed as CLI arg.
|
|
821
|
+
// Using 'pipe' for stdin caused claude --print to block forever waiting for input.
|
|
822
|
+
const child = spawn('claude', ['--print', prompt], {
|
|
823
|
+
cwd: this.projectRoot,
|
|
824
|
+
env,
|
|
825
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
826
|
+
windowsHide: true, // Prevent phantom console windows on Windows
|
|
827
|
+
});
|
|
828
|
+
// Setup timeout
|
|
829
|
+
const timeoutHandle = setTimeout(() => {
|
|
830
|
+
if (this.processPool.has(options.executionId)) {
|
|
831
|
+
child.kill('SIGTERM');
|
|
832
|
+
// Give it a moment to terminate gracefully
|
|
833
|
+
setTimeout(() => {
|
|
834
|
+
if (!child.killed) {
|
|
835
|
+
child.kill('SIGKILL');
|
|
836
|
+
}
|
|
837
|
+
}, 5000);
|
|
838
|
+
}
|
|
839
|
+
}, options.timeoutMs);
|
|
840
|
+
// Track in process pool
|
|
841
|
+
const poolEntry = {
|
|
842
|
+
process: child,
|
|
843
|
+
executionId: options.executionId,
|
|
844
|
+
workerType: options.workerType,
|
|
845
|
+
startTime: new Date(),
|
|
846
|
+
timeout: timeoutHandle,
|
|
847
|
+
};
|
|
848
|
+
this.processPool.set(options.executionId, poolEntry);
|
|
849
|
+
let stdout = '';
|
|
850
|
+
let stderr = '';
|
|
851
|
+
let resolved = false;
|
|
852
|
+
const cleanup = () => {
|
|
853
|
+
clearTimeout(timeoutHandle);
|
|
854
|
+
this.processPool.delete(options.executionId);
|
|
855
|
+
};
|
|
856
|
+
child.stdout?.on('data', (data) => {
|
|
857
|
+
const chunk = data.toString();
|
|
858
|
+
stdout += chunk;
|
|
859
|
+
this.emit('output', {
|
|
860
|
+
executionId: options.executionId,
|
|
861
|
+
type: 'stdout',
|
|
862
|
+
data: chunk,
|
|
863
|
+
});
|
|
864
|
+
});
|
|
865
|
+
child.stderr?.on('data', (data) => {
|
|
866
|
+
const chunk = data.toString();
|
|
867
|
+
stderr += chunk;
|
|
868
|
+
this.emit('output', {
|
|
869
|
+
executionId: options.executionId,
|
|
870
|
+
type: 'stderr',
|
|
871
|
+
data: chunk,
|
|
872
|
+
});
|
|
873
|
+
});
|
|
874
|
+
child.on('close', (code) => {
|
|
875
|
+
if (resolved)
|
|
876
|
+
return;
|
|
877
|
+
resolved = true;
|
|
878
|
+
cleanup();
|
|
879
|
+
resolve({
|
|
880
|
+
success: code === 0,
|
|
881
|
+
output: stdout || stderr,
|
|
882
|
+
error: code !== 0 ? stderr || `Process exited with code ${code}` : undefined,
|
|
883
|
+
});
|
|
884
|
+
});
|
|
885
|
+
child.on('error', (error) => {
|
|
886
|
+
if (resolved)
|
|
887
|
+
return;
|
|
888
|
+
resolved = true;
|
|
889
|
+
cleanup();
|
|
890
|
+
resolve({
|
|
891
|
+
success: false,
|
|
892
|
+
output: '',
|
|
893
|
+
error: error.message,
|
|
894
|
+
});
|
|
895
|
+
});
|
|
896
|
+
// Handle timeout
|
|
897
|
+
setTimeout(() => {
|
|
898
|
+
if (resolved)
|
|
899
|
+
return;
|
|
900
|
+
if (!this.processPool.has(options.executionId))
|
|
901
|
+
return;
|
|
902
|
+
resolved = true;
|
|
903
|
+
child.kill('SIGTERM');
|
|
904
|
+
cleanup();
|
|
905
|
+
resolve({
|
|
906
|
+
success: false,
|
|
907
|
+
output: stdout || stderr,
|
|
908
|
+
error: `Execution timed out after ${options.timeoutMs}ms`,
|
|
909
|
+
});
|
|
910
|
+
}, options.timeoutMs + 100); // Slightly after the kill timeout
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* Parse JSON output from Claude Code
|
|
915
|
+
*/
|
|
916
|
+
parseJsonOutput(output) {
|
|
917
|
+
try {
|
|
918
|
+
// Try to find JSON in code blocks first
|
|
919
|
+
const codeBlockMatch = output.match(/```(?:json)?\s*([\s\S]*?)```/);
|
|
920
|
+
if (codeBlockMatch) {
|
|
921
|
+
return JSON.parse(codeBlockMatch[1].trim());
|
|
922
|
+
}
|
|
923
|
+
// Try to find any JSON object
|
|
924
|
+
const jsonMatch = output.match(/\{[\s\S]*\}/);
|
|
925
|
+
if (jsonMatch) {
|
|
926
|
+
return JSON.parse(jsonMatch[0]);
|
|
927
|
+
}
|
|
928
|
+
// Try direct parse
|
|
929
|
+
return JSON.parse(output.trim());
|
|
930
|
+
}
|
|
931
|
+
catch {
|
|
932
|
+
return {
|
|
933
|
+
parseError: true,
|
|
934
|
+
rawOutput: output,
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Parse markdown output into sections
|
|
940
|
+
*/
|
|
941
|
+
parseMarkdownOutput(output) {
|
|
942
|
+
const sections = [];
|
|
943
|
+
const codeBlocks = [];
|
|
944
|
+
// Extract code blocks first
|
|
945
|
+
const codeBlockRegex = /```(\w*)\n([\s\S]*?)```/g;
|
|
946
|
+
let codeMatch;
|
|
947
|
+
while ((codeMatch = codeBlockRegex.exec(output)) !== null) {
|
|
948
|
+
codeBlocks.push({
|
|
949
|
+
language: codeMatch[1] || 'text',
|
|
950
|
+
code: codeMatch[2].trim(),
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
// Parse sections
|
|
954
|
+
const lines = output.split('\n');
|
|
955
|
+
let currentSection = null;
|
|
956
|
+
for (const line of lines) {
|
|
957
|
+
const headerMatch = line.match(/^(#{1,6})\s+(.+)$/);
|
|
958
|
+
if (headerMatch) {
|
|
959
|
+
if (currentSection) {
|
|
960
|
+
sections.push(currentSection);
|
|
961
|
+
}
|
|
962
|
+
currentSection = {
|
|
963
|
+
title: headerMatch[2].trim(),
|
|
964
|
+
content: '',
|
|
965
|
+
level: headerMatch[1].length,
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
else if (currentSection) {
|
|
969
|
+
currentSection.content += line + '\n';
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
if (currentSection) {
|
|
973
|
+
currentSection.content = currentSection.content.trim();
|
|
974
|
+
sections.push(currentSection);
|
|
975
|
+
}
|
|
976
|
+
return { sections, codeBlocks };
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* Create an error result
|
|
980
|
+
*/
|
|
981
|
+
createErrorResult(workerType, error) {
|
|
982
|
+
return {
|
|
983
|
+
success: false,
|
|
984
|
+
output: '',
|
|
985
|
+
durationMs: 0,
|
|
986
|
+
model: 'unknown',
|
|
987
|
+
sandboxMode: 'strict',
|
|
988
|
+
workerType,
|
|
989
|
+
timestamp: new Date(),
|
|
990
|
+
executionId: `error_${Date.now()}`,
|
|
991
|
+
error,
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* Log execution details for debugging
|
|
996
|
+
*/
|
|
997
|
+
logExecution(executionId, type, content) {
|
|
998
|
+
try {
|
|
999
|
+
const timestamp = new Date().toISOString();
|
|
1000
|
+
const logFile = join(this.config.logDir, `${executionId}_${type}.log`);
|
|
1001
|
+
const logContent = `[${timestamp}] ${type.toUpperCase()}\n${'='.repeat(60)}\n${content}\n`;
|
|
1002
|
+
writeFileSync(logFile, logContent);
|
|
1003
|
+
}
|
|
1004
|
+
catch {
|
|
1005
|
+
// Ignore log write errors
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
// Export default
|
|
1010
|
+
export default HeadlessWorkerExecutor;
|
|
1011
|
+
//# sourceMappingURL=headless-worker-executor.js.map
|