hivemind-pipeline 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +63 -0
- package/README.md +352 -0
- package/dist/bin/swarm.d.ts +3 -0
- package/dist/bin/swarm.d.ts.map +1 -0
- package/dist/bin/swarm.js +293 -0
- package/dist/bin/swarm.js.map +1 -0
- package/dist/dashboard/assets/index-Cf_KwDES.js +359 -0
- package/dist/dashboard/assets/index-SatEQz0u.css +1 -0
- package/dist/dashboard/index.html +16 -0
- package/dist/prompts/Architect-Go.md +455 -0
- package/dist/prompts/Architect-Node.md +379 -0
- package/dist/prompts/Architect-Python.md +63 -0
- package/dist/prompts/Architect-React.md +352 -0
- package/dist/prompts/Architect-Rust.md +63 -0
- package/dist/prompts/Architect-Swift.md +61 -0
- package/dist/prompts/Software-engineer-go.md +254 -0
- package/dist/prompts/Software-engineer-node.md +241 -0
- package/dist/prompts/Software-engineer-python.md +70 -0
- package/dist/prompts/Software-engineer-react.md +167 -0
- package/dist/prompts/Software-engineer-rust.md +69 -0
- package/dist/prompts/Software-engineer-swift.md +69 -0
- package/dist/prompts/Software-lead-go.md +247 -0
- package/dist/prompts/Software-lead-node.md +238 -0
- package/dist/prompts/Software-lead-python.md +53 -0
- package/dist/prompts/Software-lead-react.md +229 -0
- package/dist/prompts/Software-lead-rust.md +53 -0
- package/dist/prompts/Software-lead-swift.md +53 -0
- package/dist/prompts/analyst-go.md +351 -0
- package/dist/prompts/analyst-node.md +317 -0
- package/dist/prompts/analyst-python.md +139 -0
- package/dist/prompts/analyst-react.md +428 -0
- package/dist/prompts/analyst-rust.md +125 -0
- package/dist/prompts/analyst-swift.md +125 -0
- package/dist/prompts/test-engineer-go.md +99 -0
- package/dist/prompts/test-engineer-node.md +97 -0
- package/dist/prompts/test-engineer-python.md +61 -0
- package/dist/prompts/test-engineer-react.md +104 -0
- package/dist/prompts/test-engineer-rust.md +62 -0
- package/dist/prompts/test-engineer-swift.md +66 -0
- package/dist/src/__tests__/commands/analyze.test.d.ts +2 -0
- package/dist/src/__tests__/commands/analyze.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/analyze.test.js +61 -0
- package/dist/src/__tests__/commands/analyze.test.js.map +1 -0
- package/dist/src/__tests__/commands/architect.test.d.ts +2 -0
- package/dist/src/__tests__/commands/architect.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/architect.test.js +46 -0
- package/dist/src/__tests__/commands/architect.test.js.map +1 -0
- package/dist/src/__tests__/commands/build.test.d.ts +2 -0
- package/dist/src/__tests__/commands/build.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/build.test.js +69 -0
- package/dist/src/__tests__/commands/build.test.js.map +1 -0
- package/dist/src/__tests__/commands/dashboard.test.d.ts +2 -0
- package/dist/src/__tests__/commands/dashboard.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/dashboard.test.js +95 -0
- package/dist/src/__tests__/commands/dashboard.test.js.map +1 -0
- package/dist/src/__tests__/commands/doctor.test.d.ts +2 -0
- package/dist/src/__tests__/commands/doctor.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/doctor.test.js +69 -0
- package/dist/src/__tests__/commands/doctor.test.js.map +1 -0
- package/dist/src/__tests__/commands/fix.test.d.ts +2 -0
- package/dist/src/__tests__/commands/fix.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/fix.test.js +147 -0
- package/dist/src/__tests__/commands/fix.test.js.map +1 -0
- package/dist/src/__tests__/commands/init.test.d.ts +2 -0
- package/dist/src/__tests__/commands/init.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/init.test.js +79 -0
- package/dist/src/__tests__/commands/init.test.js.map +1 -0
- package/dist/src/__tests__/commands/learn.test.d.ts +2 -0
- package/dist/src/__tests__/commands/learn.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/learn.test.js +64 -0
- package/dist/src/__tests__/commands/learn.test.js.map +1 -0
- package/dist/src/__tests__/commands/mayday.test.d.ts +2 -0
- package/dist/src/__tests__/commands/mayday.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/mayday.test.js +115 -0
- package/dist/src/__tests__/commands/mayday.test.js.map +1 -0
- package/dist/src/__tests__/commands/memory.test.d.ts +2 -0
- package/dist/src/__tests__/commands/memory.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/memory.test.js +80 -0
- package/dist/src/__tests__/commands/memory.test.js.map +1 -0
- package/dist/src/__tests__/commands/plan.test.d.ts +2 -0
- package/dist/src/__tests__/commands/plan.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/plan.test.js +46 -0
- package/dist/src/__tests__/commands/plan.test.js.map +1 -0
- package/dist/src/__tests__/commands/pr.test.d.ts +2 -0
- package/dist/src/__tests__/commands/pr.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/pr.test.js +170 -0
- package/dist/src/__tests__/commands/pr.test.js.map +1 -0
- package/dist/src/__tests__/commands/refactor.test.d.ts +2 -0
- package/dist/src/__tests__/commands/refactor.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/refactor.test.js +107 -0
- package/dist/src/__tests__/commands/refactor.test.js.map +1 -0
- package/dist/src/__tests__/commands/review.test.d.ts +2 -0
- package/dist/src/__tests__/commands/review.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/review.test.js +125 -0
- package/dist/src/__tests__/commands/review.test.js.map +1 -0
- package/dist/src/__tests__/commands/shared.test.d.ts +2 -0
- package/dist/src/__tests__/commands/shared.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/shared.test.js +112 -0
- package/dist/src/__tests__/commands/shared.test.js.map +1 -0
- package/dist/src/__tests__/commands/spike.test.d.ts +2 -0
- package/dist/src/__tests__/commands/spike.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/spike.test.js +75 -0
- package/dist/src/__tests__/commands/spike.test.js.map +1 -0
- package/dist/src/__tests__/commands/stats.test.d.ts +2 -0
- package/dist/src/__tests__/commands/stats.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/stats.test.js +82 -0
- package/dist/src/__tests__/commands/stats.test.js.map +1 -0
- package/dist/src/__tests__/commands/status.test.d.ts +2 -0
- package/dist/src/__tests__/commands/status.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/status.test.js +60 -0
- package/dist/src/__tests__/commands/status.test.js.map +1 -0
- package/dist/src/__tests__/commands/test-cmd.test.d.ts +2 -0
- package/dist/src/__tests__/commands/test-cmd.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/test-cmd.test.js +76 -0
- package/dist/src/__tests__/commands/test-cmd.test.js.map +1 -0
- package/dist/src/__tests__/commands/test-gen.test.d.ts +2 -0
- package/dist/src/__tests__/commands/test-gen.test.d.ts.map +1 -0
- package/dist/src/__tests__/commands/test-gen.test.js +151 -0
- package/dist/src/__tests__/commands/test-gen.test.js.map +1 -0
- package/dist/src/__tests__/core/agent-manager.test.d.ts +2 -0
- package/dist/src/__tests__/core/agent-manager.test.d.ts.map +1 -0
- package/dist/src/__tests__/core/agent-manager.test.js +167 -0
- package/dist/src/__tests__/core/agent-manager.test.js.map +1 -0
- package/dist/src/__tests__/core/agent-process.test.d.ts +2 -0
- package/dist/src/__tests__/core/agent-process.test.d.ts.map +1 -0
- package/dist/src/__tests__/core/agent-process.test.js +178 -0
- package/dist/src/__tests__/core/agent-process.test.js.map +1 -0
- package/dist/src/__tests__/core/guardrails.test.d.ts +2 -0
- package/dist/src/__tests__/core/guardrails.test.d.ts.map +1 -0
- package/dist/src/__tests__/core/guardrails.test.js +249 -0
- package/dist/src/__tests__/core/guardrails.test.js.map +1 -0
- package/dist/src/__tests__/core/pipeline.test.d.ts +2 -0
- package/dist/src/__tests__/core/pipeline.test.d.ts.map +1 -0
- package/dist/src/__tests__/core/pipeline.test.js +331 -0
- package/dist/src/__tests__/core/pipeline.test.js.map +1 -0
- package/dist/src/__tests__/core/state.test.d.ts +2 -0
- package/dist/src/__tests__/core/state.test.d.ts.map +1 -0
- package/dist/src/__tests__/core/state.test.js +132 -0
- package/dist/src/__tests__/core/state.test.js.map +1 -0
- package/dist/src/__tests__/core/ws-server.test.d.ts +2 -0
- package/dist/src/__tests__/core/ws-server.test.d.ts.map +1 -0
- package/dist/src/__tests__/core/ws-server.test.js +177 -0
- package/dist/src/__tests__/core/ws-server.test.js.map +1 -0
- package/dist/src/__tests__/helpers/temp-dir.d.ts +8 -0
- package/dist/src/__tests__/helpers/temp-dir.d.ts.map +1 -0
- package/dist/src/__tests__/helpers/temp-dir.js +25 -0
- package/dist/src/__tests__/helpers/temp-dir.js.map +1 -0
- package/dist/src/commands/agent.d.ts +3 -0
- package/dist/src/commands/agent.d.ts.map +1 -0
- package/dist/src/commands/agent.js +103 -0
- package/dist/src/commands/agent.js.map +1 -0
- package/dist/src/commands/allocate.d.ts +3 -0
- package/dist/src/commands/allocate.d.ts.map +1 -0
- package/dist/src/commands/allocate.js +229 -0
- package/dist/src/commands/allocate.js.map +1 -0
- package/dist/src/commands/analyze.d.ts +3 -0
- package/dist/src/commands/analyze.d.ts.map +1 -0
- package/dist/src/commands/analyze.js +63 -0
- package/dist/src/commands/analyze.js.map +1 -0
- package/dist/src/commands/architect-review.d.ts +3 -0
- package/dist/src/commands/architect-review.d.ts.map +1 -0
- package/dist/src/commands/architect-review.js +695 -0
- package/dist/src/commands/architect-review.js.map +1 -0
- package/dist/src/commands/architect.d.ts +3 -0
- package/dist/src/commands/architect.d.ts.map +1 -0
- package/dist/src/commands/architect.js +49 -0
- package/dist/src/commands/architect.js.map +1 -0
- package/dist/src/commands/audit.d.ts +3 -0
- package/dist/src/commands/audit.d.ts.map +1 -0
- package/dist/src/commands/audit.js +55 -0
- package/dist/src/commands/audit.js.map +1 -0
- package/dist/src/commands/autopilot.d.ts +7 -0
- package/dist/src/commands/autopilot.d.ts.map +1 -0
- package/dist/src/commands/autopilot.js +377 -0
- package/dist/src/commands/autopilot.js.map +1 -0
- package/dist/src/commands/babysit-prs.d.ts +13 -0
- package/dist/src/commands/babysit-prs.d.ts.map +1 -0
- package/dist/src/commands/babysit-prs.js +283 -0
- package/dist/src/commands/babysit-prs.js.map +1 -0
- package/dist/src/commands/benchmark.d.ts +34 -0
- package/dist/src/commands/benchmark.d.ts.map +1 -0
- package/dist/src/commands/benchmark.js +534 -0
- package/dist/src/commands/benchmark.js.map +1 -0
- package/dist/src/commands/build.d.ts +3 -0
- package/dist/src/commands/build.d.ts.map +1 -0
- package/dist/src/commands/build.js +63 -0
- package/dist/src/commands/build.js.map +1 -0
- package/dist/src/commands/check.d.ts +3 -0
- package/dist/src/commands/check.d.ts.map +1 -0
- package/dist/src/commands/check.js +102 -0
- package/dist/src/commands/check.js.map +1 -0
- package/dist/src/commands/ci.d.ts +3 -0
- package/dist/src/commands/ci.d.ts.map +1 -0
- package/dist/src/commands/ci.js +124 -0
- package/dist/src/commands/ci.js.map +1 -0
- package/dist/src/commands/compete.d.ts +3 -0
- package/dist/src/commands/compete.d.ts.map +1 -0
- package/dist/src/commands/compete.js +164 -0
- package/dist/src/commands/compete.js.map +1 -0
- package/dist/src/commands/compliance.d.ts +3 -0
- package/dist/src/commands/compliance.d.ts.map +1 -0
- package/dist/src/commands/compliance.js +722 -0
- package/dist/src/commands/compliance.js.map +1 -0
- package/dist/src/commands/context.d.ts +3 -0
- package/dist/src/commands/context.d.ts.map +1 -0
- package/dist/src/commands/context.js +171 -0
- package/dist/src/commands/context.js.map +1 -0
- package/dist/src/commands/contract.d.ts +3 -0
- package/dist/src/commands/contract.d.ts.map +1 -0
- package/dist/src/commands/contract.js +384 -0
- package/dist/src/commands/contract.js.map +1 -0
- package/dist/src/commands/dashboard.d.ts +3 -0
- package/dist/src/commands/dashboard.d.ts.map +1 -0
- package/dist/src/commands/dashboard.js +114 -0
- package/dist/src/commands/dashboard.js.map +1 -0
- package/dist/src/commands/delegate.d.ts +3 -0
- package/dist/src/commands/delegate.d.ts.map +1 -0
- package/dist/src/commands/delegate.js +474 -0
- package/dist/src/commands/delegate.js.map +1 -0
- package/dist/src/commands/deploy.d.ts +17 -0
- package/dist/src/commands/deploy.d.ts.map +1 -0
- package/dist/src/commands/deploy.js +163 -0
- package/dist/src/commands/deploy.js.map +1 -0
- package/dist/src/commands/deps.d.ts +3 -0
- package/dist/src/commands/deps.d.ts.map +1 -0
- package/dist/src/commands/deps.js +548 -0
- package/dist/src/commands/deps.js.map +1 -0
- package/dist/src/commands/doctor.d.ts +3 -0
- package/dist/src/commands/doctor.d.ts.map +1 -0
- package/dist/src/commands/doctor.js +120 -0
- package/dist/src/commands/doctor.js.map +1 -0
- package/dist/src/commands/empathize.d.ts +3 -0
- package/dist/src/commands/empathize.d.ts.map +1 -0
- package/dist/src/commands/empathize.js +253 -0
- package/dist/src/commands/empathize.js.map +1 -0
- package/dist/src/commands/evaluate.d.ts +3 -0
- package/dist/src/commands/evaluate.d.ts.map +1 -0
- package/dist/src/commands/evaluate.js +49 -0
- package/dist/src/commands/evaluate.js.map +1 -0
- package/dist/src/commands/evolve.d.ts +3 -0
- package/dist/src/commands/evolve.d.ts.map +1 -0
- package/dist/src/commands/evolve.js +841 -0
- package/dist/src/commands/evolve.js.map +1 -0
- package/dist/src/commands/experiment.d.ts +3 -0
- package/dist/src/commands/experiment.d.ts.map +1 -0
- package/dist/src/commands/experiment.js +286 -0
- package/dist/src/commands/experiment.js.map +1 -0
- package/dist/src/commands/explain.d.ts +3 -0
- package/dist/src/commands/explain.d.ts.map +1 -0
- package/dist/src/commands/explain.js +159 -0
- package/dist/src/commands/explain.js.map +1 -0
- package/dist/src/commands/federate.d.ts +3 -0
- package/dist/src/commands/federate.d.ts.map +1 -0
- package/dist/src/commands/federate.js +148 -0
- package/dist/src/commands/federate.js.map +1 -0
- package/dist/src/commands/fingerprint.d.ts +3 -0
- package/dist/src/commands/fingerprint.d.ts.map +1 -0
- package/dist/src/commands/fingerprint.js +65 -0
- package/dist/src/commands/fingerprint.js.map +1 -0
- package/dist/src/commands/fix.d.ts +3 -0
- package/dist/src/commands/fix.d.ts.map +1 -0
- package/dist/src/commands/fix.js +160 -0
- package/dist/src/commands/fix.js.map +1 -0
- package/dist/src/commands/fleet.d.ts +3 -0
- package/dist/src/commands/fleet.d.ts.map +1 -0
- package/dist/src/commands/fleet.js +311 -0
- package/dist/src/commands/fleet.js.map +1 -0
- package/dist/src/commands/forecast.d.ts +3 -0
- package/dist/src/commands/forecast.d.ts.map +1 -0
- package/dist/src/commands/forecast.js +522 -0
- package/dist/src/commands/forecast.js.map +1 -0
- package/dist/src/commands/govern.d.ts +3 -0
- package/dist/src/commands/govern.d.ts.map +1 -0
- package/dist/src/commands/govern.js +280 -0
- package/dist/src/commands/govern.js.map +1 -0
- package/dist/src/commands/health.d.ts +17 -0
- package/dist/src/commands/health.d.ts.map +1 -0
- package/dist/src/commands/health.js +491 -0
- package/dist/src/commands/health.js.map +1 -0
- package/dist/src/commands/impact.d.ts +3 -0
- package/dist/src/commands/impact.d.ts.map +1 -0
- package/dist/src/commands/impact.js +186 -0
- package/dist/src/commands/impact.js.map +1 -0
- package/dist/src/commands/improve.d.ts +3 -0
- package/dist/src/commands/improve.d.ts.map +1 -0
- package/dist/src/commands/improve.js +240 -0
- package/dist/src/commands/improve.js.map +1 -0
- package/dist/src/commands/inbox.d.ts +29 -0
- package/dist/src/commands/inbox.d.ts.map +1 -0
- package/dist/src/commands/inbox.js +538 -0
- package/dist/src/commands/inbox.js.map +1 -0
- package/dist/src/commands/incident.d.ts +15 -0
- package/dist/src/commands/incident.d.ts.map +1 -0
- package/dist/src/commands/incident.js +318 -0
- package/dist/src/commands/incident.js.map +1 -0
- package/dist/src/commands/init.d.ts +3 -0
- package/dist/src/commands/init.d.ts.map +1 -0
- package/dist/src/commands/init.js +97 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/journal.d.ts +3 -0
- package/dist/src/commands/journal.d.ts.map +1 -0
- package/dist/src/commands/journal.js +146 -0
- package/dist/src/commands/journal.js.map +1 -0
- package/dist/src/commands/learn.d.ts +9 -0
- package/dist/src/commands/learn.d.ts.map +1 -0
- package/dist/src/commands/learn.js +107 -0
- package/dist/src/commands/learn.js.map +1 -0
- package/dist/src/commands/mayday.d.ts +3 -0
- package/dist/src/commands/mayday.d.ts.map +1 -0
- package/dist/src/commands/mayday.js +145 -0
- package/dist/src/commands/mayday.js.map +1 -0
- package/dist/src/commands/memory.d.ts +3 -0
- package/dist/src/commands/memory.d.ts.map +1 -0
- package/dist/src/commands/memory.js +113 -0
- package/dist/src/commands/memory.js.map +1 -0
- package/dist/src/commands/mentor.d.ts +3 -0
- package/dist/src/commands/mentor.d.ts.map +1 -0
- package/dist/src/commands/mentor.js +225 -0
- package/dist/src/commands/mentor.js.map +1 -0
- package/dist/src/commands/migrate.d.ts +3 -0
- package/dist/src/commands/migrate.d.ts.map +1 -0
- package/dist/src/commands/migrate.js +169 -0
- package/dist/src/commands/migrate.js.map +1 -0
- package/dist/src/commands/models.d.ts +3 -0
- package/dist/src/commands/models.d.ts.map +1 -0
- package/dist/src/commands/models.js +396 -0
- package/dist/src/commands/models.js.map +1 -0
- package/dist/src/commands/multi-repo.d.ts +18 -0
- package/dist/src/commands/multi-repo.d.ts.map +1 -0
- package/dist/src/commands/multi-repo.js +423 -0
- package/dist/src/commands/multi-repo.js.map +1 -0
- package/dist/src/commands/negotiate.d.ts +3 -0
- package/dist/src/commands/negotiate.d.ts.map +1 -0
- package/dist/src/commands/negotiate.js +239 -0
- package/dist/src/commands/negotiate.js.map +1 -0
- package/dist/src/commands/observe.d.ts +3 -0
- package/dist/src/commands/observe.d.ts.map +1 -0
- package/dist/src/commands/observe.js +445 -0
- package/dist/src/commands/observe.js.map +1 -0
- package/dist/src/commands/onboard.d.ts +3 -0
- package/dist/src/commands/onboard.d.ts.map +1 -0
- package/dist/src/commands/onboard.js +263 -0
- package/dist/src/commands/onboard.js.map +1 -0
- package/dist/src/commands/optimize.d.ts +3 -0
- package/dist/src/commands/optimize.d.ts.map +1 -0
- package/dist/src/commands/optimize.js +340 -0
- package/dist/src/commands/optimize.js.map +1 -0
- package/dist/src/commands/own.d.ts +3 -0
- package/dist/src/commands/own.d.ts.map +1 -0
- package/dist/src/commands/own.js +499 -0
- package/dist/src/commands/own.js.map +1 -0
- package/dist/src/commands/pair.d.ts +3 -0
- package/dist/src/commands/pair.d.ts.map +1 -0
- package/dist/src/commands/pair.js +206 -0
- package/dist/src/commands/pair.js.map +1 -0
- package/dist/src/commands/pipeline.d.ts +3 -0
- package/dist/src/commands/pipeline.d.ts.map +1 -0
- package/dist/src/commands/pipeline.js +143 -0
- package/dist/src/commands/pipeline.js.map +1 -0
- package/dist/src/commands/plan.d.ts +3 -0
- package/dist/src/commands/plan.d.ts.map +1 -0
- package/dist/src/commands/plan.js +49 -0
- package/dist/src/commands/plan.js.map +1 -0
- package/dist/src/commands/plugin.d.ts +3 -0
- package/dist/src/commands/plugin.d.ts.map +1 -0
- package/dist/src/commands/plugin.js +114 -0
- package/dist/src/commands/plugin.js.map +1 -0
- package/dist/src/commands/pm.d.ts +38 -0
- package/dist/src/commands/pm.d.ts.map +1 -0
- package/dist/src/commands/pm.js +664 -0
- package/dist/src/commands/pm.js.map +1 -0
- package/dist/src/commands/pr.d.ts +3 -0
- package/dist/src/commands/pr.d.ts.map +1 -0
- package/dist/src/commands/pr.js +225 -0
- package/dist/src/commands/pr.js.map +1 -0
- package/dist/src/commands/prompt-guard.d.ts +3 -0
- package/dist/src/commands/prompt-guard.d.ts.map +1 -0
- package/dist/src/commands/prompt-guard.js +54 -0
- package/dist/src/commands/prompt-guard.js.map +1 -0
- package/dist/src/commands/provenance.d.ts +3 -0
- package/dist/src/commands/provenance.d.ts.map +1 -0
- package/dist/src/commands/provenance.js +96 -0
- package/dist/src/commands/provenance.js.map +1 -0
- package/dist/src/commands/recover.d.ts +3 -0
- package/dist/src/commands/recover.d.ts.map +1 -0
- package/dist/src/commands/recover.js +32 -0
- package/dist/src/commands/recover.js.map +1 -0
- package/dist/src/commands/refactor.d.ts +3 -0
- package/dist/src/commands/refactor.d.ts.map +1 -0
- package/dist/src/commands/refactor.js +143 -0
- package/dist/src/commands/refactor.js.map +1 -0
- package/dist/src/commands/report.d.ts +66 -0
- package/dist/src/commands/report.d.ts.map +1 -0
- package/dist/src/commands/report.js +493 -0
- package/dist/src/commands/report.js.map +1 -0
- package/dist/src/commands/retro.d.ts +71 -0
- package/dist/src/commands/retro.d.ts.map +1 -0
- package/dist/src/commands/retro.js +449 -0
- package/dist/src/commands/retro.js.map +1 -0
- package/dist/src/commands/review.d.ts +3 -0
- package/dist/src/commands/review.d.ts.map +1 -0
- package/dist/src/commands/review.js +202 -0
- package/dist/src/commands/review.js.map +1 -0
- package/dist/src/commands/risk.d.ts +3 -0
- package/dist/src/commands/risk.d.ts.map +1 -0
- package/dist/src/commands/risk.js +110 -0
- package/dist/src/commands/risk.js.map +1 -0
- package/dist/src/commands/roadmap.d.ts +3 -0
- package/dist/src/commands/roadmap.d.ts.map +1 -0
- package/dist/src/commands/roadmap.js +506 -0
- package/dist/src/commands/roadmap.js.map +1 -0
- package/dist/src/commands/runtime-monitor.d.ts +3 -0
- package/dist/src/commands/runtime-monitor.d.ts.map +1 -0
- package/dist/src/commands/runtime-monitor.js +154 -0
- package/dist/src/commands/runtime-monitor.js.map +1 -0
- package/dist/src/commands/sandbox.d.ts +3 -0
- package/dist/src/commands/sandbox.d.ts.map +1 -0
- package/dist/src/commands/sandbox.js +201 -0
- package/dist/src/commands/sandbox.js.map +1 -0
- package/dist/src/commands/scope.d.ts +3 -0
- package/dist/src/commands/scope.d.ts.map +1 -0
- package/dist/src/commands/scope.js +192 -0
- package/dist/src/commands/scope.js.map +1 -0
- package/dist/src/commands/secrets.d.ts +3 -0
- package/dist/src/commands/secrets.d.ts.map +1 -0
- package/dist/src/commands/secrets.js +99 -0
- package/dist/src/commands/secrets.js.map +1 -0
- package/dist/src/commands/secure.d.ts +3 -0
- package/dist/src/commands/secure.d.ts.map +1 -0
- package/dist/src/commands/secure.js +215 -0
- package/dist/src/commands/secure.js.map +1 -0
- package/dist/src/commands/server.d.ts +3 -0
- package/dist/src/commands/server.d.ts.map +1 -0
- package/dist/src/commands/server.js +228 -0
- package/dist/src/commands/server.js.map +1 -0
- package/dist/src/commands/shared.d.ts +18 -0
- package/dist/src/commands/shared.d.ts.map +1 -0
- package/dist/src/commands/shared.js +61 -0
- package/dist/src/commands/shared.js.map +1 -0
- package/dist/src/commands/simplify.d.ts +3 -0
- package/dist/src/commands/simplify.d.ts.map +1 -0
- package/dist/src/commands/simplify.js +194 -0
- package/dist/src/commands/simplify.js.map +1 -0
- package/dist/src/commands/simulate.d.ts +3 -0
- package/dist/src/commands/simulate.d.ts.map +1 -0
- package/dist/src/commands/simulate.js +275 -0
- package/dist/src/commands/simulate.js.map +1 -0
- package/dist/src/commands/slo.d.ts +3 -0
- package/dist/src/commands/slo.d.ts.map +1 -0
- package/dist/src/commands/slo.js +341 -0
- package/dist/src/commands/slo.js.map +1 -0
- package/dist/src/commands/spawn-capability.d.ts +3 -0
- package/dist/src/commands/spawn-capability.d.ts.map +1 -0
- package/dist/src/commands/spawn-capability.js +153 -0
- package/dist/src/commands/spawn-capability.js.map +1 -0
- package/dist/src/commands/specialize.d.ts +3 -0
- package/dist/src/commands/specialize.d.ts.map +1 -0
- package/dist/src/commands/specialize.js +266 -0
- package/dist/src/commands/specialize.js.map +1 -0
- package/dist/src/commands/spike.d.ts +3 -0
- package/dist/src/commands/spike.d.ts.map +1 -0
- package/dist/src/commands/spike.js +109 -0
- package/dist/src/commands/spike.js.map +1 -0
- package/dist/src/commands/standup.d.ts +3 -0
- package/dist/src/commands/standup.d.ts.map +1 -0
- package/dist/src/commands/standup.js +76 -0
- package/dist/src/commands/standup.js.map +1 -0
- package/dist/src/commands/stats.d.ts +39 -0
- package/dist/src/commands/stats.d.ts.map +1 -0
- package/dist/src/commands/stats.js +185 -0
- package/dist/src/commands/stats.js.map +1 -0
- package/dist/src/commands/status.d.ts +3 -0
- package/dist/src/commands/status.d.ts.map +1 -0
- package/dist/src/commands/status.js +65 -0
- package/dist/src/commands/status.js.map +1 -0
- package/dist/src/commands/supply-chain.d.ts +3 -0
- package/dist/src/commands/supply-chain.d.ts.map +1 -0
- package/dist/src/commands/supply-chain.js +110 -0
- package/dist/src/commands/supply-chain.js.map +1 -0
- package/dist/src/commands/system.d.ts +3 -0
- package/dist/src/commands/system.d.ts.map +1 -0
- package/dist/src/commands/system.js +582 -0
- package/dist/src/commands/system.js.map +1 -0
- package/dist/src/commands/teach.d.ts +3 -0
- package/dist/src/commands/teach.d.ts.map +1 -0
- package/dist/src/commands/teach.js +420 -0
- package/dist/src/commands/teach.js.map +1 -0
- package/dist/src/commands/team.d.ts +44 -0
- package/dist/src/commands/team.d.ts.map +1 -0
- package/dist/src/commands/team.js +355 -0
- package/dist/src/commands/team.js.map +1 -0
- package/dist/src/commands/telemetry.d.ts +3 -0
- package/dist/src/commands/telemetry.d.ts.map +1 -0
- package/dist/src/commands/telemetry.js +87 -0
- package/dist/src/commands/telemetry.js.map +1 -0
- package/dist/src/commands/test-gen.d.ts +3 -0
- package/dist/src/commands/test-gen.d.ts.map +1 -0
- package/dist/src/commands/test-gen.js +541 -0
- package/dist/src/commands/test-gen.js.map +1 -0
- package/dist/src/commands/test.d.ts +3 -0
- package/dist/src/commands/test.d.ts.map +1 -0
- package/dist/src/commands/test.js +84 -0
- package/dist/src/commands/test.js.map +1 -0
- package/dist/src/commands/watch.d.ts +11 -0
- package/dist/src/commands/watch.d.ts.map +1 -0
- package/dist/src/commands/watch.js +317 -0
- package/dist/src/commands/watch.js.map +1 -0
- package/dist/src/core/activity-tracker.d.ts +70 -0
- package/dist/src/core/activity-tracker.d.ts.map +1 -0
- package/dist/src/core/activity-tracker.js +294 -0
- package/dist/src/core/activity-tracker.js.map +1 -0
- package/dist/src/core/agent-bus.d.ts +38 -0
- package/dist/src/core/agent-bus.d.ts.map +1 -0
- package/dist/src/core/agent-bus.js +128 -0
- package/dist/src/core/agent-bus.js.map +1 -0
- package/dist/src/core/agent-loop.d.ts +79 -0
- package/dist/src/core/agent-loop.d.ts.map +1 -0
- package/dist/src/core/agent-loop.js +225 -0
- package/dist/src/core/agent-loop.js.map +1 -0
- package/dist/src/core/agent-manager.d.ts +90 -0
- package/dist/src/core/agent-manager.d.ts.map +1 -0
- package/dist/src/core/agent-manager.js +549 -0
- package/dist/src/core/agent-manager.js.map +1 -0
- package/dist/src/core/agent-process.d.ts +95 -0
- package/dist/src/core/agent-process.d.ts.map +1 -0
- package/dist/src/core/agent-process.js +428 -0
- package/dist/src/core/agent-process.js.map +1 -0
- package/dist/src/core/ambiguity-detector.d.ts +31 -0
- package/dist/src/core/ambiguity-detector.d.ts.map +1 -0
- package/dist/src/core/ambiguity-detector.js +286 -0
- package/dist/src/core/ambiguity-detector.js.map +1 -0
- package/dist/src/core/anomaly-detector.d.ts +30 -0
- package/dist/src/core/anomaly-detector.d.ts.map +1 -0
- package/dist/src/core/anomaly-detector.js +300 -0
- package/dist/src/core/anomaly-detector.js.map +1 -0
- package/dist/src/core/api-lifecycle.d.ts +11 -0
- package/dist/src/core/api-lifecycle.d.ts.map +1 -0
- package/dist/src/core/api-lifecycle.js +178 -0
- package/dist/src/core/api-lifecycle.js.map +1 -0
- package/dist/src/core/audit.d.ts +36 -0
- package/dist/src/core/audit.d.ts.map +1 -0
- package/dist/src/core/audit.js +88 -0
- package/dist/src/core/audit.js.map +1 -0
- package/dist/src/core/capability-spawner.d.ts +17 -0
- package/dist/src/core/capability-spawner.d.ts.map +1 -0
- package/dist/src/core/capability-spawner.js +170 -0
- package/dist/src/core/capability-spawner.js.map +1 -0
- package/dist/src/core/codebase-index.d.ts +53 -0
- package/dist/src/core/codebase-index.d.ts.map +1 -0
- package/dist/src/core/codebase-index.js +540 -0
- package/dist/src/core/codebase-index.js.map +1 -0
- package/dist/src/core/codebase-scanner.d.ts +3 -0
- package/dist/src/core/codebase-scanner.d.ts.map +1 -0
- package/dist/src/core/codebase-scanner.js +179 -0
- package/dist/src/core/codebase-scanner.js.map +1 -0
- package/dist/src/core/competitive-intel.d.ts +18 -0
- package/dist/src/core/competitive-intel.d.ts.map +1 -0
- package/dist/src/core/competitive-intel.js +167 -0
- package/dist/src/core/competitive-intel.js.map +1 -0
- package/dist/src/core/config.d.ts +14 -0
- package/dist/src/core/config.d.ts.map +1 -0
- package/dist/src/core/config.js +116 -0
- package/dist/src/core/config.js.map +1 -0
- package/dist/src/core/convention-extractor.d.ts +8 -0
- package/dist/src/core/convention-extractor.d.ts.map +1 -0
- package/dist/src/core/convention-extractor.js +382 -0
- package/dist/src/core/convention-extractor.js.map +1 -0
- package/dist/src/core/cost-tracker.d.ts +23 -0
- package/dist/src/core/cost-tracker.d.ts.map +1 -0
- package/dist/src/core/cost-tracker.js +83 -0
- package/dist/src/core/cost-tracker.js.map +1 -0
- package/dist/src/core/decision-journal.d.ts +41 -0
- package/dist/src/core/decision-journal.d.ts.map +1 -0
- package/dist/src/core/decision-journal.js +204 -0
- package/dist/src/core/decision-journal.js.map +1 -0
- package/dist/src/core/experiment-engine.d.ts +31 -0
- package/dist/src/core/experiment-engine.d.ts.map +1 -0
- package/dist/src/core/experiment-engine.js +248 -0
- package/dist/src/core/experiment-engine.js.map +1 -0
- package/dist/src/core/federation.d.ts +18 -0
- package/dist/src/core/federation.d.ts.map +1 -0
- package/dist/src/core/federation.js +202 -0
- package/dist/src/core/federation.js.map +1 -0
- package/dist/src/core/fingerprint.d.ts +42 -0
- package/dist/src/core/fingerprint.d.ts.map +1 -0
- package/dist/src/core/fingerprint.js +316 -0
- package/dist/src/core/fingerprint.js.map +1 -0
- package/dist/src/core/git.d.ts +50 -0
- package/dist/src/core/git.d.ts.map +1 -0
- package/dist/src/core/git.js +342 -0
- package/dist/src/core/git.js.map +1 -0
- package/dist/src/core/governance.d.ts +53 -0
- package/dist/src/core/governance.d.ts.map +1 -0
- package/dist/src/core/governance.js +276 -0
- package/dist/src/core/governance.js.map +1 -0
- package/dist/src/core/guardrails.d.ts +34 -0
- package/dist/src/core/guardrails.d.ts.map +1 -0
- package/dist/src/core/guardrails.js +575 -0
- package/dist/src/core/guardrails.js.map +1 -0
- package/dist/src/core/impact-analyzer.d.ts +56 -0
- package/dist/src/core/impact-analyzer.d.ts.map +1 -0
- package/dist/src/core/impact-analyzer.js +309 -0
- package/dist/src/core/impact-analyzer.js.map +1 -0
- package/dist/src/core/input-listener.d.ts +45 -0
- package/dist/src/core/input-listener.d.ts.map +1 -0
- package/dist/src/core/input-listener.js +116 -0
- package/dist/src/core/input-listener.js.map +1 -0
- package/dist/src/core/memory-store.d.ts +61 -0
- package/dist/src/core/memory-store.d.ts.map +1 -0
- package/dist/src/core/memory-store.js +195 -0
- package/dist/src/core/memory-store.js.map +1 -0
- package/dist/src/core/observability.d.ts +56 -0
- package/dist/src/core/observability.d.ts.map +1 -0
- package/dist/src/core/observability.js +305 -0
- package/dist/src/core/observability.js.map +1 -0
- package/dist/src/core/pair-engine.d.ts +47 -0
- package/dist/src/core/pair-engine.d.ts.map +1 -0
- package/dist/src/core/pair-engine.js +355 -0
- package/dist/src/core/pair-engine.js.map +1 -0
- package/dist/src/core/perf-analyzer.d.ts +35 -0
- package/dist/src/core/perf-analyzer.d.ts.map +1 -0
- package/dist/src/core/perf-analyzer.js +598 -0
- package/dist/src/core/perf-analyzer.js.map +1 -0
- package/dist/src/core/pipeline-loader.d.ts +46 -0
- package/dist/src/core/pipeline-loader.d.ts.map +1 -0
- package/dist/src/core/pipeline-loader.js +182 -0
- package/dist/src/core/pipeline-loader.js.map +1 -0
- package/dist/src/core/pipeline.d.ts +183 -0
- package/dist/src/core/pipeline.d.ts.map +1 -0
- package/dist/src/core/pipeline.js +2264 -0
- package/dist/src/core/pipeline.js.map +1 -0
- package/dist/src/core/plugins.d.ts +61 -0
- package/dist/src/core/plugins.d.ts.map +1 -0
- package/dist/src/core/plugins.js +114 -0
- package/dist/src/core/plugins.js.map +1 -0
- package/dist/src/core/preflight.d.ts +7 -0
- package/dist/src/core/preflight.d.ts.map +1 -0
- package/dist/src/core/preflight.js +35 -0
- package/dist/src/core/preflight.js.map +1 -0
- package/dist/src/core/prompt-guard.d.ts +44 -0
- package/dist/src/core/prompt-guard.d.ts.map +1 -0
- package/dist/src/core/prompt-guard.js +274 -0
- package/dist/src/core/prompt-guard.js.map +1 -0
- package/dist/src/core/provenance.d.ts +39 -0
- package/dist/src/core/provenance.d.ts.map +1 -0
- package/dist/src/core/provenance.js +115 -0
- package/dist/src/core/provenance.js.map +1 -0
- package/dist/src/core/providers/anthropic-api.d.ts +34 -0
- package/dist/src/core/providers/anthropic-api.d.ts.map +1 -0
- package/dist/src/core/providers/anthropic-api.js +522 -0
- package/dist/src/core/providers/anthropic-api.js.map +1 -0
- package/dist/src/core/providers/api-agent-backend.d.ts +31 -0
- package/dist/src/core/providers/api-agent-backend.d.ts.map +1 -0
- package/dist/src/core/providers/api-agent-backend.js +127 -0
- package/dist/src/core/providers/api-agent-backend.js.map +1 -0
- package/dist/src/core/providers/api-text-backend.d.ts +35 -0
- package/dist/src/core/providers/api-text-backend.d.ts.map +1 -0
- package/dist/src/core/providers/api-text-backend.js +145 -0
- package/dist/src/core/providers/api-text-backend.js.map +1 -0
- package/dist/src/core/providers/claude-cli.d.ts +80 -0
- package/dist/src/core/providers/claude-cli.d.ts.map +1 -0
- package/dist/src/core/providers/claude-cli.js +489 -0
- package/dist/src/core/providers/claude-cli.js.map +1 -0
- package/dist/src/core/providers/cost-table.d.ts +46 -0
- package/dist/src/core/providers/cost-table.d.ts.map +1 -0
- package/dist/src/core/providers/cost-table.js +136 -0
- package/dist/src/core/providers/cost-table.js.map +1 -0
- package/dist/src/core/providers/google.d.ts +26 -0
- package/dist/src/core/providers/google.d.ts.map +1 -0
- package/dist/src/core/providers/google.js +165 -0
- package/dist/src/core/providers/google.js.map +1 -0
- package/dist/src/core/providers/model-catalog.d.ts +72 -0
- package/dist/src/core/providers/model-catalog.d.ts.map +1 -0
- package/dist/src/core/providers/model-catalog.js +290 -0
- package/dist/src/core/providers/model-catalog.js.map +1 -0
- package/dist/src/core/providers/openai-compat.d.ts +35 -0
- package/dist/src/core/providers/openai-compat.d.ts.map +1 -0
- package/dist/src/core/providers/openai-compat.js +479 -0
- package/dist/src/core/providers/openai-compat.js.map +1 -0
- package/dist/src/core/providers/prompt-adapter.d.ts +42 -0
- package/dist/src/core/providers/prompt-adapter.d.ts.map +1 -0
- package/dist/src/core/providers/prompt-adapter.js +282 -0
- package/dist/src/core/providers/prompt-adapter.js.map +1 -0
- package/dist/src/core/providers/registry.d.ts +93 -0
- package/dist/src/core/providers/registry.d.ts.map +1 -0
- package/dist/src/core/providers/registry.js +191 -0
- package/dist/src/core/providers/registry.js.map +1 -0
- package/dist/src/core/providers/types.d.ts +165 -0
- package/dist/src/core/providers/types.d.ts.map +1 -0
- package/dist/src/core/providers/types.js +13 -0
- package/dist/src/core/providers/types.js.map +1 -0
- package/dist/src/core/quality.d.ts +22 -0
- package/dist/src/core/quality.d.ts.map +1 -0
- package/dist/src/core/quality.js +209 -0
- package/dist/src/core/quality.js.map +1 -0
- package/dist/src/core/resource-allocator.d.ts +37 -0
- package/dist/src/core/resource-allocator.d.ts.map +1 -0
- package/dist/src/core/resource-allocator.js +480 -0
- package/dist/src/core/resource-allocator.js.map +1 -0
- package/dist/src/core/risk-scorer.d.ts +35 -0
- package/dist/src/core/risk-scorer.d.ts.map +1 -0
- package/dist/src/core/risk-scorer.js +226 -0
- package/dist/src/core/risk-scorer.js.map +1 -0
- package/dist/src/core/runtime-monitor.d.ts +49 -0
- package/dist/src/core/runtime-monitor.d.ts.map +1 -0
- package/dist/src/core/runtime-monitor.js +235 -0
- package/dist/src/core/runtime-monitor.js.map +1 -0
- package/dist/src/core/sandbox.d.ts +47 -0
- package/dist/src/core/sandbox.d.ts.map +1 -0
- package/dist/src/core/sandbox.js +277 -0
- package/dist/src/core/sandbox.js.map +1 -0
- package/dist/src/core/secret-detector.d.ts +25 -0
- package/dist/src/core/secret-detector.d.ts.map +1 -0
- package/dist/src/core/secret-detector.js +307 -0
- package/dist/src/core/secret-detector.js.map +1 -0
- package/dist/src/core/security-scanner.d.ts +36 -0
- package/dist/src/core/security-scanner.d.ts.map +1 -0
- package/dist/src/core/security-scanner.js +366 -0
- package/dist/src/core/security-scanner.js.map +1 -0
- package/dist/src/core/self-improvement.d.ts +26 -0
- package/dist/src/core/self-improvement.d.ts.map +1 -0
- package/dist/src/core/self-improvement.js +356 -0
- package/dist/src/core/self-improvement.js.map +1 -0
- package/dist/src/core/simulator.d.ts +28 -0
- package/dist/src/core/simulator.d.ts.map +1 -0
- package/dist/src/core/simulator.js +334 -0
- package/dist/src/core/simulator.js.map +1 -0
- package/dist/src/core/specialization.d.ts +47 -0
- package/dist/src/core/specialization.d.ts.map +1 -0
- package/dist/src/core/specialization.js +239 -0
- package/dist/src/core/specialization.js.map +1 -0
- package/dist/src/core/stakeholder-engine.d.ts +47 -0
- package/dist/src/core/stakeholder-engine.d.ts.map +1 -0
- package/dist/src/core/stakeholder-engine.js +380 -0
- package/dist/src/core/stakeholder-engine.js.map +1 -0
- package/dist/src/core/state.d.ts +99 -0
- package/dist/src/core/state.d.ts.map +1 -0
- package/dist/src/core/state.js +545 -0
- package/dist/src/core/state.js.map +1 -0
- package/dist/src/core/supply-chain.d.ts +26 -0
- package/dist/src/core/supply-chain.d.ts.map +1 -0
- package/dist/src/core/supply-chain.js +332 -0
- package/dist/src/core/supply-chain.js.map +1 -0
- package/dist/src/core/telemetry.d.ts +110 -0
- package/dist/src/core/telemetry.d.ts.map +1 -0
- package/dist/src/core/telemetry.js +276 -0
- package/dist/src/core/telemetry.js.map +1 -0
- package/dist/src/core/tools/definitions.d.ts +10 -0
- package/dist/src/core/tools/definitions.d.ts.map +1 -0
- package/dist/src/core/tools/definitions.js +165 -0
- package/dist/src/core/tools/definitions.js.map +1 -0
- package/dist/src/core/tools/executor.d.ts +27 -0
- package/dist/src/core/tools/executor.d.ts.map +1 -0
- package/dist/src/core/tools/executor.js +306 -0
- package/dist/src/core/tools/executor.js.map +1 -0
- package/dist/src/core/tools/sandbox.d.ts +41 -0
- package/dist/src/core/tools/sandbox.d.ts.map +1 -0
- package/dist/src/core/tools/sandbox.js +106 -0
- package/dist/src/core/tools/sandbox.js.map +1 -0
- package/dist/src/core/training-pipeline.d.ts +66 -0
- package/dist/src/core/training-pipeline.d.ts.map +1 -0
- package/dist/src/core/training-pipeline.js +267 -0
- package/dist/src/core/training-pipeline.js.map +1 -0
- package/dist/src/core/triage.d.ts +56 -0
- package/dist/src/core/triage.d.ts.map +1 -0
- package/dist/src/core/triage.js +227 -0
- package/dist/src/core/triage.js.map +1 -0
- package/dist/src/core/user-intelligence.d.ts +29 -0
- package/dist/src/core/user-intelligence.d.ts.map +1 -0
- package/dist/src/core/user-intelligence.js +172 -0
- package/dist/src/core/user-intelligence.js.map +1 -0
- package/dist/src/core/webhooks.d.ts +32 -0
- package/dist/src/core/webhooks.d.ts.map +1 -0
- package/dist/src/core/webhooks.js +126 -0
- package/dist/src/core/webhooks.js.map +1 -0
- package/dist/src/core/ws-server.d.ts +43 -0
- package/dist/src/core/ws-server.d.ts.map +1 -0
- package/dist/src/core/ws-server.js +3278 -0
- package/dist/src/core/ws-server.js.map +1 -0
- package/dist/src/prompts/loader.d.ts +36 -0
- package/dist/src/prompts/loader.d.ts.map +1 -0
- package/dist/src/prompts/loader.js +156 -0
- package/dist/src/prompts/loader.js.map +1 -0
- package/dist/src/types.d.ts +2539 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +62 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
const METRICS_PATH = '.swarm/observability/metrics.jsonl';
|
|
4
|
+
const REPORT_PATH = '.swarm/simulation-reports.json';
|
|
5
|
+
export class Simulator {
|
|
6
|
+
cwd;
|
|
7
|
+
metrics = [];
|
|
8
|
+
results = [];
|
|
9
|
+
report = null;
|
|
10
|
+
constructor(cwd) {
|
|
11
|
+
this.cwd = cwd;
|
|
12
|
+
this.loadMetrics();
|
|
13
|
+
}
|
|
14
|
+
// ── Public API ──────────────────────────────────────────────
|
|
15
|
+
/** Run a full simulation suite or a specific scenario */
|
|
16
|
+
simulate(cwd, scenario) {
|
|
17
|
+
const workDir = cwd ?? this.cwd;
|
|
18
|
+
this.results = [];
|
|
19
|
+
if (scenario) {
|
|
20
|
+
this.results.push(this.runScenario(scenario, workDir));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
// Default suite: traffic replay, 2x scale, and basic chaos
|
|
24
|
+
this.results.push(this.runScenario({ name: 'traffic-replay-baseline', type: 'traffic-replay', config: {} }, workDir));
|
|
25
|
+
this.results.push(this.runScenario({ name: 'scale-2x', type: 'scale', config: { factor: 2 } }, workDir));
|
|
26
|
+
this.results.push(this.runScenario({ name: 'chaos-dependency-failure', type: 'chaos', config: { target: 'primary-db', mode: 'latency' } }, workDir));
|
|
27
|
+
}
|
|
28
|
+
this.report = this.buildReport();
|
|
29
|
+
this.persist();
|
|
30
|
+
return this.report;
|
|
31
|
+
}
|
|
32
|
+
/** Estimate resource usage at Nx traffic */
|
|
33
|
+
scaleTest(factor) {
|
|
34
|
+
const scenario = {
|
|
35
|
+
name: `scale-${factor}x`,
|
|
36
|
+
type: 'scale',
|
|
37
|
+
config: { factor },
|
|
38
|
+
};
|
|
39
|
+
const result = this.runScenario(scenario, this.cwd);
|
|
40
|
+
this.results.push(result);
|
|
41
|
+
this.report = this.buildReport();
|
|
42
|
+
this.persist();
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
/** Model dependency failures */
|
|
46
|
+
chaosTest(scenario) {
|
|
47
|
+
const sim = {
|
|
48
|
+
name: `chaos-${scenario}`,
|
|
49
|
+
type: 'chaos',
|
|
50
|
+
config: { target: scenario, mode: 'full-outage' },
|
|
51
|
+
};
|
|
52
|
+
const result = this.runScenario(sim, this.cwd);
|
|
53
|
+
this.results.push(result);
|
|
54
|
+
this.report = this.buildReport();
|
|
55
|
+
this.persist();
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
/** Return the latest report */
|
|
59
|
+
getReport() {
|
|
60
|
+
if (this.report)
|
|
61
|
+
return this.report;
|
|
62
|
+
return this.loadReport();
|
|
63
|
+
}
|
|
64
|
+
// ── Scenario execution ─────────────────────────────────────
|
|
65
|
+
runScenario(scenario, workDir) {
|
|
66
|
+
const start = Date.now();
|
|
67
|
+
switch (scenario.type) {
|
|
68
|
+
case 'traffic-replay':
|
|
69
|
+
return this.runTrafficReplay(scenario, workDir, start);
|
|
70
|
+
case 'scale':
|
|
71
|
+
return this.runScaleScenario(scenario, workDir, start);
|
|
72
|
+
case 'chaos':
|
|
73
|
+
return this.runChaosScenario(scenario, workDir, start);
|
|
74
|
+
default:
|
|
75
|
+
return {
|
|
76
|
+
scenario: scenario.name,
|
|
77
|
+
passed: false,
|
|
78
|
+
metrics: [],
|
|
79
|
+
issues: [{ severity: 'error', description: `Unknown scenario type: ${scenario.type}` }],
|
|
80
|
+
duration: Date.now() - start,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// ── Traffic replay ──────────────────────────────────────────
|
|
85
|
+
runTrafficReplay(scenario, _workDir, start) {
|
|
86
|
+
const pattern = this.analyzeTrafficPattern();
|
|
87
|
+
const metrics = [];
|
|
88
|
+
const issues = [];
|
|
89
|
+
// Analyze request rate from metrics
|
|
90
|
+
const rps = pattern.avgRequestsPerSec;
|
|
91
|
+
metrics.push({
|
|
92
|
+
name: 'avg-rps',
|
|
93
|
+
value: rps,
|
|
94
|
+
threshold: 100,
|
|
95
|
+
status: rps > 100 ? 'fail' : rps > 50 ? 'warn' : 'pass',
|
|
96
|
+
});
|
|
97
|
+
// Analyze p99 latency
|
|
98
|
+
const p99 = pattern.p99LatencyMs;
|
|
99
|
+
metrics.push({
|
|
100
|
+
name: 'p99-latency-ms',
|
|
101
|
+
value: p99,
|
|
102
|
+
threshold: 500,
|
|
103
|
+
status: p99 > 500 ? 'fail' : p99 > 200 ? 'warn' : 'pass',
|
|
104
|
+
});
|
|
105
|
+
// Analyze error rate
|
|
106
|
+
const errorRate = pattern.errorRate;
|
|
107
|
+
metrics.push({
|
|
108
|
+
name: 'error-rate',
|
|
109
|
+
value: errorRate,
|
|
110
|
+
threshold: 0.01,
|
|
111
|
+
status: errorRate > 0.01 ? 'fail' : errorRate > 0.005 ? 'warn' : 'pass',
|
|
112
|
+
});
|
|
113
|
+
if (p99 > 500) {
|
|
114
|
+
issues.push({ severity: 'high', description: `P99 latency ${p99}ms exceeds 500ms threshold` });
|
|
115
|
+
}
|
|
116
|
+
if (errorRate > 0.01) {
|
|
117
|
+
issues.push({ severity: 'high', description: `Error rate ${(errorRate * 100).toFixed(2)}% exceeds 1% threshold` });
|
|
118
|
+
}
|
|
119
|
+
const passed = metrics.every(m => m.status !== 'fail');
|
|
120
|
+
return { scenario: scenario.name, passed, metrics, issues, duration: Date.now() - start };
|
|
121
|
+
}
|
|
122
|
+
// ── Scale simulation ────────────────────────────────────────
|
|
123
|
+
runScaleScenario(scenario, _workDir, start) {
|
|
124
|
+
const factor = scenario.config.factor || 2;
|
|
125
|
+
const prediction = this.predictResources(factor);
|
|
126
|
+
const metrics = [];
|
|
127
|
+
const issues = [];
|
|
128
|
+
metrics.push({
|
|
129
|
+
name: 'estimated-cpu-cores',
|
|
130
|
+
value: prediction.cpu,
|
|
131
|
+
threshold: 16,
|
|
132
|
+
status: prediction.cpu > 16 ? 'fail' : prediction.cpu > 8 ? 'warn' : 'pass',
|
|
133
|
+
});
|
|
134
|
+
metrics.push({
|
|
135
|
+
name: 'estimated-memory-mb',
|
|
136
|
+
value: prediction.memoryMb,
|
|
137
|
+
threshold: 8192,
|
|
138
|
+
status: prediction.memoryMb > 8192 ? 'fail' : prediction.memoryMb > 4096 ? 'warn' : 'pass',
|
|
139
|
+
});
|
|
140
|
+
metrics.push({
|
|
141
|
+
name: 'estimated-disk-io-mbps',
|
|
142
|
+
value: prediction.diskIoMbps,
|
|
143
|
+
threshold: 500,
|
|
144
|
+
status: prediction.diskIoMbps > 500 ? 'fail' : prediction.diskIoMbps > 250 ? 'warn' : 'pass',
|
|
145
|
+
});
|
|
146
|
+
metrics.push({
|
|
147
|
+
name: 'estimated-network-mbps',
|
|
148
|
+
value: prediction.networkMbps,
|
|
149
|
+
threshold: 1000,
|
|
150
|
+
status: prediction.networkMbps > 1000 ? 'fail' : prediction.networkMbps > 500 ? 'warn' : 'pass',
|
|
151
|
+
});
|
|
152
|
+
metrics.push({
|
|
153
|
+
name: 'estimated-cost-usd-hr',
|
|
154
|
+
value: prediction.estimatedCost,
|
|
155
|
+
threshold: 50,
|
|
156
|
+
status: prediction.estimatedCost > 50 ? 'fail' : prediction.estimatedCost > 25 ? 'warn' : 'pass',
|
|
157
|
+
});
|
|
158
|
+
if (prediction.cpu > 16) {
|
|
159
|
+
issues.push({ severity: 'high', description: `At ${factor}x scale, estimated CPU (${prediction.cpu} cores) exceeds capacity` });
|
|
160
|
+
}
|
|
161
|
+
if (prediction.memoryMb > 8192) {
|
|
162
|
+
issues.push({ severity: 'high', description: `At ${factor}x scale, estimated memory (${prediction.memoryMb}MB) exceeds capacity` });
|
|
163
|
+
}
|
|
164
|
+
const passed = metrics.every(m => m.status !== 'fail');
|
|
165
|
+
return { scenario: scenario.name, passed, metrics, issues, duration: Date.now() - start };
|
|
166
|
+
}
|
|
167
|
+
// ── Chaos simulation ────────────────────────────────────────
|
|
168
|
+
runChaosScenario(scenario, _workDir, start) {
|
|
169
|
+
const target = scenario.config.target || 'unknown';
|
|
170
|
+
const mode = scenario.config.mode || 'latency';
|
|
171
|
+
const failure = this.modelDependencyFailure(target, mode);
|
|
172
|
+
const metrics = [];
|
|
173
|
+
const issues = [];
|
|
174
|
+
const impactSeverity = { none: 0, degraded: 1, 'partial-outage': 2, 'full-outage': 3 };
|
|
175
|
+
const impactScore = impactSeverity[failure.impact] ?? 0;
|
|
176
|
+
metrics.push({
|
|
177
|
+
name: 'impact-level',
|
|
178
|
+
value: impactScore,
|
|
179
|
+
threshold: 2,
|
|
180
|
+
status: impactScore >= 3 ? 'fail' : impactScore >= 2 ? 'warn' : 'pass',
|
|
181
|
+
});
|
|
182
|
+
metrics.push({
|
|
183
|
+
name: 'recovery-time-sec',
|
|
184
|
+
value: failure.recoveryTimeSec,
|
|
185
|
+
threshold: 60,
|
|
186
|
+
status: failure.recoveryTimeSec > 60 ? 'fail' : failure.recoveryTimeSec > 30 ? 'warn' : 'pass',
|
|
187
|
+
});
|
|
188
|
+
if (failure.impact === 'full-outage') {
|
|
189
|
+
issues.push({
|
|
190
|
+
severity: 'critical',
|
|
191
|
+
description: `${failure.dependency} ${failure.failureMode} causes full outage (recovery: ${failure.recoveryTimeSec}s)`,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
else if (failure.impact === 'partial-outage') {
|
|
195
|
+
issues.push({
|
|
196
|
+
severity: 'high',
|
|
197
|
+
description: `${failure.dependency} ${failure.failureMode} causes partial outage`,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
const passed = metrics.every(m => m.status !== 'fail');
|
|
201
|
+
return { scenario: scenario.name, passed, metrics, issues, duration: Date.now() - start };
|
|
202
|
+
}
|
|
203
|
+
// ── Traffic analysis ────────────────────────────────────────
|
|
204
|
+
analyzeTrafficPattern() {
|
|
205
|
+
if (this.metrics.length === 0) {
|
|
206
|
+
// No metrics available — return conservative defaults
|
|
207
|
+
return { avgRequestsPerSec: 10, p99LatencyMs: 150, errorRate: 0.002, peakRps: 25 };
|
|
208
|
+
}
|
|
209
|
+
const rpsMetrics = this.metrics.filter(m => m.name === 'http.requests' || m.name === 'rps');
|
|
210
|
+
const latencyMetrics = this.metrics.filter(m => m.name === 'http.latency_ms' || m.name === 'latency');
|
|
211
|
+
const errorMetrics = this.metrics.filter(m => m.name === 'http.errors' || m.name === 'error_count');
|
|
212
|
+
const avgRps = rpsMetrics.length > 0
|
|
213
|
+
? rpsMetrics.reduce((sum, m) => sum + m.value, 0) / rpsMetrics.length
|
|
214
|
+
: 10;
|
|
215
|
+
const peakRps = rpsMetrics.length > 0
|
|
216
|
+
? Math.max(...rpsMetrics.map(m => m.value))
|
|
217
|
+
: 25;
|
|
218
|
+
// Approximate p99 from sorted latency values
|
|
219
|
+
const sortedLatency = latencyMetrics.map(m => m.value).sort((a, b) => a - b);
|
|
220
|
+
const p99Index = Math.floor(sortedLatency.length * 0.99);
|
|
221
|
+
const p99 = sortedLatency.length > 0 ? sortedLatency[Math.min(p99Index, sortedLatency.length - 1)] : 150;
|
|
222
|
+
const totalErrors = errorMetrics.reduce((sum, m) => sum + m.value, 0);
|
|
223
|
+
const totalRequests = rpsMetrics.reduce((sum, m) => sum + m.value, 0);
|
|
224
|
+
const errorRate = totalRequests > 0 ? totalErrors / totalRequests : 0.002;
|
|
225
|
+
return { avgRequestsPerSec: Math.round(avgRps * 100) / 100, p99LatencyMs: Math.round(p99), errorRate, peakRps };
|
|
226
|
+
}
|
|
227
|
+
// ── Resource prediction ─────────────────────────────────────
|
|
228
|
+
predictResources(factor) {
|
|
229
|
+
const pattern = this.analyzeTrafficPattern();
|
|
230
|
+
const baseRps = pattern.avgRequestsPerSec;
|
|
231
|
+
const targetRps = baseRps * factor;
|
|
232
|
+
// Heuristic: linear scaling with sub-linear memory growth
|
|
233
|
+
const cpu = Math.round((targetRps / 50) * 100) / 100; // ~50 rps per core
|
|
234
|
+
const memoryMb = Math.round(512 + (targetRps * 8) * Math.pow(factor, 0.7));
|
|
235
|
+
const diskIoMbps = Math.round(targetRps * 0.5 * 100) / 100;
|
|
236
|
+
const networkMbps = Math.round(targetRps * 0.2 * 100) / 100;
|
|
237
|
+
// Rough cost model: $0.05/core/hr + $0.005/GB/hr
|
|
238
|
+
const estimatedCost = Math.round((cpu * 0.05 + (memoryMb / 1024) * 0.005) * 100) / 100;
|
|
239
|
+
return { cpu, memoryMb, diskIoMbps, networkMbps, estimatedCost };
|
|
240
|
+
}
|
|
241
|
+
// ── Chaos modeling ──────────────────────────────────────────
|
|
242
|
+
modelDependencyFailure(target, mode) {
|
|
243
|
+
// Common dependency failure models
|
|
244
|
+
const failureMode = mode || 'latency';
|
|
245
|
+
const impactMap = {
|
|
246
|
+
'primary-db': { latency: 'degraded', timeout: 'partial-outage', 'error-rate': 'partial-outage', 'full-outage': 'full-outage' },
|
|
247
|
+
'cache': { latency: 'degraded', timeout: 'degraded', 'error-rate': 'degraded', 'full-outage': 'degraded' },
|
|
248
|
+
'queue': { latency: 'degraded', timeout: 'partial-outage', 'error-rate': 'partial-outage', 'full-outage': 'partial-outage' },
|
|
249
|
+
'auth-service': { latency: 'degraded', timeout: 'partial-outage', 'error-rate': 'degraded', 'full-outage': 'full-outage' },
|
|
250
|
+
'cdn': { latency: 'degraded', timeout: 'degraded', 'error-rate': 'none', 'full-outage': 'degraded' },
|
|
251
|
+
};
|
|
252
|
+
const recoveryMap = {
|
|
253
|
+
latency: 15,
|
|
254
|
+
timeout: 30,
|
|
255
|
+
'error-rate': 20,
|
|
256
|
+
'full-outage': 120,
|
|
257
|
+
};
|
|
258
|
+
const targetImpact = impactMap[target];
|
|
259
|
+
const impact = targetImpact
|
|
260
|
+
? (targetImpact[failureMode] ?? 'partial-outage')
|
|
261
|
+
: 'partial-outage'; // Unknown dependency — assume moderate impact
|
|
262
|
+
const recoveryTimeSec = recoveryMap[failureMode] ?? 60;
|
|
263
|
+
return { dependency: target, failureMode, impact, recoveryTimeSec };
|
|
264
|
+
}
|
|
265
|
+
// ── Report building ─────────────────────────────────────────
|
|
266
|
+
buildReport() {
|
|
267
|
+
const overallPass = this.results.every(r => r.passed);
|
|
268
|
+
const allIssues = this.results.flatMap(r => r.issues);
|
|
269
|
+
const hasCritical = allIssues.some(i => i.severity === 'critical');
|
|
270
|
+
const hasHigh = allIssues.some(i => i.severity === 'high');
|
|
271
|
+
const riskLevel = hasCritical
|
|
272
|
+
? 'critical'
|
|
273
|
+
: hasHigh
|
|
274
|
+
? 'high'
|
|
275
|
+
: overallPass
|
|
276
|
+
? 'low'
|
|
277
|
+
: 'medium';
|
|
278
|
+
const recommendations = [];
|
|
279
|
+
for (const result of this.results) {
|
|
280
|
+
for (const metric of result.metrics) {
|
|
281
|
+
if (metric.status === 'fail') {
|
|
282
|
+
recommendations.push(`[${result.scenario}] ${metric.name} (${metric.value}) exceeds threshold (${metric.threshold}) — investigate and remediate`);
|
|
283
|
+
}
|
|
284
|
+
else if (metric.status === 'warn') {
|
|
285
|
+
recommendations.push(`[${result.scenario}] ${metric.name} (${metric.value}) approaching threshold (${metric.threshold}) — monitor closely`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (recommendations.length === 0 && overallPass) {
|
|
290
|
+
recommendations.push('All scenarios passed within acceptable thresholds');
|
|
291
|
+
}
|
|
292
|
+
return {
|
|
293
|
+
scenarios: [...this.results],
|
|
294
|
+
overallPass,
|
|
295
|
+
riskLevel,
|
|
296
|
+
recommendations,
|
|
297
|
+
timestamp: Date.now(),
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
// ── Persistence ─────────────────────────────────────────────
|
|
301
|
+
loadMetrics() {
|
|
302
|
+
const metricsPath = join(this.cwd, METRICS_PATH);
|
|
303
|
+
if (!existsSync(metricsPath)) {
|
|
304
|
+
this.metrics = [];
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
try {
|
|
308
|
+
const lines = readFileSync(metricsPath, 'utf-8').trim().split('\n').filter(Boolean);
|
|
309
|
+
this.metrics = lines.map(line => JSON.parse(line));
|
|
310
|
+
}
|
|
311
|
+
catch {
|
|
312
|
+
this.metrics = [];
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
loadReport() {
|
|
316
|
+
const reportPath = join(this.cwd, REPORT_PATH);
|
|
317
|
+
if (!existsSync(reportPath))
|
|
318
|
+
return null;
|
|
319
|
+
try {
|
|
320
|
+
return JSON.parse(readFileSync(reportPath, 'utf-8'));
|
|
321
|
+
}
|
|
322
|
+
catch {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
persist() {
|
|
327
|
+
const swarmDir = join(this.cwd, '.swarm');
|
|
328
|
+
if (!existsSync(swarmDir))
|
|
329
|
+
mkdirSync(swarmDir, { recursive: true });
|
|
330
|
+
const reportPath = join(this.cwd, REPORT_PATH);
|
|
331
|
+
writeFileSync(reportPath, JSON.stringify(this.report, null, 2), 'utf-8');
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
//# sourceMappingURL=simulator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulator.js","sourceRoot":"","sources":["../../../src/core/simulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA4BjC,MAAM,YAAY,GAAG,oCAAoC,CAAC;AAC1D,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAErD,MAAM,OAAO,SAAS;IACZ,GAAG,CAAS;IACZ,OAAO,GAAkB,EAAE,CAAC;IAC5B,OAAO,GAAuB,EAAE,CAAC;IACjC,MAAM,GAA4B,IAAI,CAAC;IAE/C,YAAY,GAAW;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,+DAA+D;IAE/D,yDAAyD;IACzD,QAAQ,CAAC,GAAY,EAAE,QAA6B;QAClD,MAAM,OAAO,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAElB,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,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AAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YAAE,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAEpE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAC/C,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { SpecialistAgent, SpecializeState } from '../types.js';
|
|
2
|
+
/** Built-in specialist domains */
|
|
3
|
+
export declare const BUILTIN_DOMAINS: readonly ["security", "performance", "database", "frontend", "infrastructure", "testing"];
|
|
4
|
+
export type BuiltinDomain = (typeof BUILTIN_DOMAINS)[number];
|
|
5
|
+
export type SpecialistDomain = SpecialistAgent['domain'];
|
|
6
|
+
export declare class SpecializationEngine {
|
|
7
|
+
private swarmDir;
|
|
8
|
+
private statePath;
|
|
9
|
+
private state;
|
|
10
|
+
constructor(swarmDir: string);
|
|
11
|
+
/** Load state from disk or create empty */
|
|
12
|
+
private loadState;
|
|
13
|
+
/** Persist state to disk */
|
|
14
|
+
private save;
|
|
15
|
+
/** Create a new specialist agent */
|
|
16
|
+
createSpecialist(domain: string, name?: string): SpecialistAgent;
|
|
17
|
+
/** Route a task description to the best specialist(s) */
|
|
18
|
+
routeTask(description: string): Array<{
|
|
19
|
+
specialist: SpecialistAgent;
|
|
20
|
+
score: number;
|
|
21
|
+
matchedKeywords: string[];
|
|
22
|
+
}>;
|
|
23
|
+
/** Record the outcome of a task assigned to a specialist */
|
|
24
|
+
recordOutcome(taskId: string, specialistId: string, success: boolean): void;
|
|
25
|
+
/** Count successes for a specialist from routing history */
|
|
26
|
+
private countSuccesses;
|
|
27
|
+
/** Calculate expertise score based on tasks completed and success rate */
|
|
28
|
+
private calculateExpertise;
|
|
29
|
+
/** Track collaboration between two specialists on a task */
|
|
30
|
+
trackCollaboration(fromId: string, toId: string, type?: string): void;
|
|
31
|
+
/** Get all specialists */
|
|
32
|
+
getSpecialists(): SpecialistAgent[];
|
|
33
|
+
/** Get a specialist by ID */
|
|
34
|
+
getSpecialist(id: string): SpecialistAgent | undefined;
|
|
35
|
+
/** Get aggregate stats */
|
|
36
|
+
getStats(): {
|
|
37
|
+
totalSpecialists: number;
|
|
38
|
+
totalTasks: number;
|
|
39
|
+
overallSuccessRate: number;
|
|
40
|
+
avgExpertise: number;
|
|
41
|
+
topDomain: string | null;
|
|
42
|
+
collaborationCount: number;
|
|
43
|
+
};
|
|
44
|
+
/** Get full state (for serialization / dashboard) */
|
|
45
|
+
getState(): SpecializeState;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=specialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specialization.d.ts","sourceRoot":"","sources":["../../../src/core/specialization.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEpE,kCAAkC;AAClC,eAAO,MAAM,eAAe,2FAOlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAC7D,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AA4CzD,qBAAa,oBAAoB;IAInB,OAAO,CAAC,QAAQ;IAH5B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,KAAK,CAAkB;gBAEX,QAAQ,EAAE,MAAM;IAKpC,2CAA2C;IAC3C,OAAO,CAAC,SAAS;IAYjB,4BAA4B;IAC5B,OAAO,CAAC,IAAI;IAOZ,oCAAoC;IACpC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe;IAyBhE,yDAAyD;IACzD,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC;QAAE,UAAU,EAAE,eAAe,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAsDhH,4DAA4D;IAC5D,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IA2B3E,4DAA4D;IAC5D,OAAO,CAAC,cAAc;IAMtB,0EAA0E;IAC1E,OAAO,CAAC,kBAAkB;IAY1B,4DAA4D;IAC5D,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAe,GAAG,IAAI;IAU7E,0BAA0B;IAC1B,cAAc,IAAI,eAAe,EAAE;IAInC,6BAA6B;IAC7B,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAItD,0BAA0B;IAC1B,QAAQ,IAAI;QACV,gBAAgB,EAAE,MAAM,CAAC;QACzB,UAAU,EAAE,MAAM,CAAC;QACnB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,kBAAkB,EAAE,MAAM,CAAC;KAC5B;IA8BD,qDAAqD;IACrD,QAAQ,IAAI,eAAe;CAG5B"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { randomUUID } from 'node:crypto';
|
|
4
|
+
/** Built-in specialist domains */
|
|
5
|
+
export const BUILTIN_DOMAINS = [
|
|
6
|
+
'security',
|
|
7
|
+
'performance',
|
|
8
|
+
'database',
|
|
9
|
+
'frontend',
|
|
10
|
+
'infrastructure',
|
|
11
|
+
'testing',
|
|
12
|
+
];
|
|
13
|
+
/** Keywords used for task routing per domain */
|
|
14
|
+
const DOMAIN_KEYWORDS = {
|
|
15
|
+
security: [
|
|
16
|
+
'auth', 'login', 'token', 'jwt', 'oauth', 'session', 'permission', 'rbac',
|
|
17
|
+
'acl', 'encrypt', 'decrypt', 'credential', 'secret', 'vulnerability', 'xss',
|
|
18
|
+
'csrf', 'injection', 'sanitize', 'cors', 'ssl', 'tls', 'certificate',
|
|
19
|
+
],
|
|
20
|
+
performance: [
|
|
21
|
+
'optimize', 'cache', 'latency', 'throughput', 'memory', 'leak', 'profile',
|
|
22
|
+
'benchmark', 'slow', 'bottleneck', 'load', 'concurrency', 'parallel',
|
|
23
|
+
'async', 'queue', 'batch', 'lazy', 'debounce', 'throttle', 'pool',
|
|
24
|
+
],
|
|
25
|
+
database: [
|
|
26
|
+
'database', 'db', 'sql', 'query', 'migration', 'schema', 'index', 'table',
|
|
27
|
+
'column', 'relation', 'join', 'transaction', 'orm', 'prisma', 'sequelize',
|
|
28
|
+
'mongoose', 'postgres', 'mysql', 'redis', 'mongo', 'sqlite', 'seed',
|
|
29
|
+
],
|
|
30
|
+
frontend: [
|
|
31
|
+
'ui', 'ux', 'component', 'react', 'vue', 'angular', 'svelte', 'css',
|
|
32
|
+
'tailwind', 'style', 'layout', 'responsive', 'accessibility', 'a11y',
|
|
33
|
+
'animation', 'form', 'modal', 'dropdown', 'button', 'page', 'route',
|
|
34
|
+
],
|
|
35
|
+
infrastructure: [
|
|
36
|
+
'deploy', 'docker', 'kubernetes', 'k8s', 'ci', 'cd', 'pipeline', 'terraform',
|
|
37
|
+
'aws', 'gcp', 'azure', 'cloud', 'nginx', 'proxy', 'load balancer', 'dns',
|
|
38
|
+
'ssl', 'env', 'config', 'monitoring', 'logging', 'alert', 'helm',
|
|
39
|
+
],
|
|
40
|
+
testing: [
|
|
41
|
+
'test', 'spec', 'jest', 'mocha', 'vitest', 'cypress', 'playwright',
|
|
42
|
+
'e2e', 'integration', 'unit', 'coverage', 'mock', 'stub', 'fixture',
|
|
43
|
+
'assertion', 'snapshot', 'regression', 'flaky', 'ci test',
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
function emptyState() {
|
|
47
|
+
return {
|
|
48
|
+
specialists: [],
|
|
49
|
+
routingHistory: [],
|
|
50
|
+
collaborations: [],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export class SpecializationEngine {
|
|
54
|
+
swarmDir;
|
|
55
|
+
statePath;
|
|
56
|
+
state;
|
|
57
|
+
constructor(swarmDir) {
|
|
58
|
+
this.swarmDir = swarmDir;
|
|
59
|
+
this.statePath = join(swarmDir, 'specialists.json');
|
|
60
|
+
this.state = this.loadState();
|
|
61
|
+
}
|
|
62
|
+
/** Load state from disk or create empty */
|
|
63
|
+
loadState() {
|
|
64
|
+
if (!existsSync(this.statePath)) {
|
|
65
|
+
return emptyState();
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const raw = readFileSync(this.statePath, 'utf-8');
|
|
69
|
+
return JSON.parse(raw);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return emptyState();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** Persist state to disk */
|
|
76
|
+
save() {
|
|
77
|
+
if (!existsSync(this.swarmDir)) {
|
|
78
|
+
mkdirSync(this.swarmDir, { recursive: true });
|
|
79
|
+
}
|
|
80
|
+
writeFileSync(this.statePath, JSON.stringify(this.state, null, 2), 'utf-8');
|
|
81
|
+
}
|
|
82
|
+
/** Create a new specialist agent */
|
|
83
|
+
createSpecialist(domain, name) {
|
|
84
|
+
const normalizedDomain = domain.toLowerCase().trim();
|
|
85
|
+
const isBuiltin = BUILTIN_DOMAINS.includes(normalizedDomain);
|
|
86
|
+
const resolvedDomain = isBuiltin
|
|
87
|
+
? normalizedDomain
|
|
88
|
+
: 'custom';
|
|
89
|
+
const specialist = {
|
|
90
|
+
id: randomUUID(),
|
|
91
|
+
domain: resolvedDomain,
|
|
92
|
+
name: name || `${normalizedDomain}-specialist`,
|
|
93
|
+
expertiseScore: 0,
|
|
94
|
+
tasksCompleted: 0,
|
|
95
|
+
successRate: 0,
|
|
96
|
+
memoryItems: 0,
|
|
97
|
+
status: 'active',
|
|
98
|
+
createdAt: Date.now(),
|
|
99
|
+
lastUsed: Date.now(),
|
|
100
|
+
};
|
|
101
|
+
this.state.specialists.push(specialist);
|
|
102
|
+
this.save();
|
|
103
|
+
return specialist;
|
|
104
|
+
}
|
|
105
|
+
/** Route a task description to the best specialist(s) */
|
|
106
|
+
routeTask(description) {
|
|
107
|
+
const lower = description.toLowerCase();
|
|
108
|
+
const results = [];
|
|
109
|
+
for (const specialist of this.state.specialists) {
|
|
110
|
+
if (specialist.status === 'disabled')
|
|
111
|
+
continue;
|
|
112
|
+
const keywords = DOMAIN_KEYWORDS[specialist.domain] || [];
|
|
113
|
+
const matchedKeywords = [];
|
|
114
|
+
// Keyword matching
|
|
115
|
+
for (const kw of keywords) {
|
|
116
|
+
if (lower.includes(kw)) {
|
|
117
|
+
matchedKeywords.push(kw);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Custom domain: match against specialist name
|
|
121
|
+
if (specialist.domain === 'custom' && lower.includes(specialist.name.replace(/-specialist$/, ''))) {
|
|
122
|
+
matchedKeywords.push(specialist.name);
|
|
123
|
+
}
|
|
124
|
+
if (matchedKeywords.length === 0)
|
|
125
|
+
continue;
|
|
126
|
+
// Base score from keyword density (0-60)
|
|
127
|
+
const keywordScore = Math.min(60, matchedKeywords.length * 15);
|
|
128
|
+
// Expertise bonus (0-30)
|
|
129
|
+
const expertiseBonus = Math.round(specialist.expertiseScore * 0.3);
|
|
130
|
+
// Recency bonus (0-10): used in last 24h
|
|
131
|
+
const dayMs = 24 * 60 * 60 * 1000;
|
|
132
|
+
const recencyBonus = (Date.now() - specialist.lastUsed) < dayMs ? 10 : 0;
|
|
133
|
+
const score = Math.min(100, keywordScore + expertiseBonus + recencyBonus);
|
|
134
|
+
results.push({ specialist, score, matchedKeywords });
|
|
135
|
+
}
|
|
136
|
+
// Record routing in history
|
|
137
|
+
const sorted = results.sort((a, b) => b.score - a.score);
|
|
138
|
+
if (sorted.length > 0) {
|
|
139
|
+
this.state.routingHistory.push({
|
|
140
|
+
taskDescription: description,
|
|
141
|
+
routed: sorted[0].specialist.id,
|
|
142
|
+
confidence: sorted[0].score,
|
|
143
|
+
timestamp: Date.now(),
|
|
144
|
+
});
|
|
145
|
+
this.save();
|
|
146
|
+
}
|
|
147
|
+
return sorted;
|
|
148
|
+
}
|
|
149
|
+
/** Record the outcome of a task assigned to a specialist */
|
|
150
|
+
recordOutcome(taskId, specialistId, success) {
|
|
151
|
+
const specialist = this.state.specialists.find(s => s.id === specialistId);
|
|
152
|
+
if (!specialist)
|
|
153
|
+
return;
|
|
154
|
+
specialist.tasksCompleted++;
|
|
155
|
+
specialist.lastUsed = Date.now();
|
|
156
|
+
specialist.memoryItems++;
|
|
157
|
+
specialist.status = 'active';
|
|
158
|
+
// Recalculate success rate
|
|
159
|
+
const totalSuccesses = this.countSuccesses(specialistId) + (success ? 1 : 0);
|
|
160
|
+
specialist.successRate = Math.round((totalSuccesses / specialist.tasksCompleted) * 100);
|
|
161
|
+
// Recalculate expertise score (0-100)
|
|
162
|
+
specialist.expertiseScore = this.calculateExpertise(specialist);
|
|
163
|
+
// Record outcome in routing history (update last entry for this specialist)
|
|
164
|
+
const lastRouting = [...this.state.routingHistory]
|
|
165
|
+
.reverse()
|
|
166
|
+
.find(r => r.routed === specialistId && !r.outcome);
|
|
167
|
+
if (lastRouting) {
|
|
168
|
+
lastRouting.outcome = success ? 'success' : 'failure';
|
|
169
|
+
}
|
|
170
|
+
this.save();
|
|
171
|
+
}
|
|
172
|
+
/** Count successes for a specialist from routing history */
|
|
173
|
+
countSuccesses(specialistId) {
|
|
174
|
+
return this.state.routingHistory
|
|
175
|
+
.filter(r => r.routed === specialistId && r.outcome === 'success')
|
|
176
|
+
.length;
|
|
177
|
+
}
|
|
178
|
+
/** Calculate expertise score based on tasks completed and success rate */
|
|
179
|
+
calculateExpertise(specialist) {
|
|
180
|
+
if (specialist.tasksCompleted === 0)
|
|
181
|
+
return 0;
|
|
182
|
+
// Volume component (0-50): logarithmic growth, caps around 50 tasks
|
|
183
|
+
const volumeScore = Math.min(50, Math.round(Math.log2(specialist.tasksCompleted + 1) * 8.8));
|
|
184
|
+
// Accuracy component (0-50): success rate scaled
|
|
185
|
+
const accuracyScore = Math.round((specialist.successRate / 100) * 50);
|
|
186
|
+
return Math.min(100, volumeScore + accuracyScore);
|
|
187
|
+
}
|
|
188
|
+
/** Track collaboration between two specialists on a task */
|
|
189
|
+
trackCollaboration(fromId, toId, type = 'task') {
|
|
190
|
+
this.state.collaborations.push({
|
|
191
|
+
from: fromId,
|
|
192
|
+
to: toId,
|
|
193
|
+
type,
|
|
194
|
+
timestamp: Date.now(),
|
|
195
|
+
});
|
|
196
|
+
this.save();
|
|
197
|
+
}
|
|
198
|
+
/** Get all specialists */
|
|
199
|
+
getSpecialists() {
|
|
200
|
+
return [...this.state.specialists];
|
|
201
|
+
}
|
|
202
|
+
/** Get a specialist by ID */
|
|
203
|
+
getSpecialist(id) {
|
|
204
|
+
return this.state.specialists.find(s => s.id === id);
|
|
205
|
+
}
|
|
206
|
+
/** Get aggregate stats */
|
|
207
|
+
getStats() {
|
|
208
|
+
const specialists = this.state.specialists;
|
|
209
|
+
const totalTasks = specialists.reduce((sum, s) => sum + s.tasksCompleted, 0);
|
|
210
|
+
const avgSuccessRate = specialists.length > 0
|
|
211
|
+
? Math.round(specialists.reduce((sum, s) => sum + s.successRate, 0) / specialists.length)
|
|
212
|
+
: 0;
|
|
213
|
+
const avgExpertise = specialists.length > 0
|
|
214
|
+
? Math.round(specialists.reduce((sum, s) => sum + s.expertiseScore, 0) / specialists.length)
|
|
215
|
+
: 0;
|
|
216
|
+
// Find the domain with the most completed tasks
|
|
217
|
+
let topDomain = null;
|
|
218
|
+
let topTasks = 0;
|
|
219
|
+
for (const s of specialists) {
|
|
220
|
+
if (s.tasksCompleted > topTasks) {
|
|
221
|
+
topTasks = s.tasksCompleted;
|
|
222
|
+
topDomain = s.domain;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return {
|
|
226
|
+
totalSpecialists: specialists.length,
|
|
227
|
+
totalTasks,
|
|
228
|
+
overallSuccessRate: avgSuccessRate,
|
|
229
|
+
avgExpertise,
|
|
230
|
+
topDomain,
|
|
231
|
+
collaborationCount: this.state.collaborations.length,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
/** Get full state (for serialization / dashboard) */
|
|
235
|
+
getState() {
|
|
236
|
+
return { ...this.state };
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=specialization.js.map
|