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,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telemetry module — opt-in, local-only anonymous usage statistics.
|
|
3
|
+
*
|
|
4
|
+
* All data is stored at ~/.swarm/telemetry.json. Nothing is sent remotely.
|
|
5
|
+
* Telemetry is OFF by default; users must explicitly enable it via `hivemind telemetry on`.
|
|
6
|
+
*
|
|
7
|
+
* ── Pipeline integration point ──
|
|
8
|
+
* To wire telemetry into the pipeline, add calls in `packages/cli/src/core/pipeline.ts`:
|
|
9
|
+
*
|
|
10
|
+
* import { Telemetry } from './telemetry.js';
|
|
11
|
+
* const telemetry = new Telemetry();
|
|
12
|
+
*
|
|
13
|
+
* // After each stage completes (in runStage / runMayday):
|
|
14
|
+
* telemetry.record({
|
|
15
|
+
* type: 'stage-run',
|
|
16
|
+
* stage: stageName, // e.g. 'analyze', 'build'
|
|
17
|
+
* status: 'success', // or 'error'
|
|
18
|
+
* cost: agent.cost.totalUsd,
|
|
19
|
+
* duration: Date.now() - stageStartedAt,
|
|
20
|
+
* stack: config.stack,
|
|
21
|
+
* model: agent.model,
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* // After a full pipeline run completes:
|
|
25
|
+
* telemetry.record({
|
|
26
|
+
* type: 'pipeline-run',
|
|
27
|
+
* stages: ['analyze', 'architect', 'plan', 'build', 'test'],
|
|
28
|
+
* totalCost: state.totalCost.totalUsd,
|
|
29
|
+
* duration: Date.now() - pipelineStartedAt,
|
|
30
|
+
* success: true,
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* // After each fix loop iteration:
|
|
34
|
+
* telemetry.record({
|
|
35
|
+
* type: 'fix-iteration',
|
|
36
|
+
* iteration: currentIteration,
|
|
37
|
+
* fixed: fixedCount,
|
|
38
|
+
* remaining: remainingCount,
|
|
39
|
+
* });
|
|
40
|
+
*/
|
|
41
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
|
|
42
|
+
import { join } from 'node:path';
|
|
43
|
+
import { homedir } from 'node:os';
|
|
44
|
+
function emptyData() {
|
|
45
|
+
return {
|
|
46
|
+
enabled: false,
|
|
47
|
+
firstRecordedAt: null,
|
|
48
|
+
lastRecordedAt: null,
|
|
49
|
+
stages: {},
|
|
50
|
+
pipelineRuns: 0,
|
|
51
|
+
pipelineSuccesses: 0,
|
|
52
|
+
pipelineFailures: 0,
|
|
53
|
+
pipelineTotalCost: 0,
|
|
54
|
+
pipelineTotalDuration: 0,
|
|
55
|
+
stacks: {},
|
|
56
|
+
models: {},
|
|
57
|
+
fixIterationsTotal: 0,
|
|
58
|
+
fixIterationsMax: 0,
|
|
59
|
+
fixTotalFixed: 0,
|
|
60
|
+
fixTotalRemaining: 0,
|
|
61
|
+
fixLoopRuns: 0,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export class Telemetry {
|
|
65
|
+
filePath;
|
|
66
|
+
data;
|
|
67
|
+
constructor(baseDir) {
|
|
68
|
+
const dir = baseDir ?? join(homedir(), '.swarm');
|
|
69
|
+
if (!existsSync(dir)) {
|
|
70
|
+
mkdirSync(dir, { recursive: true });
|
|
71
|
+
}
|
|
72
|
+
this.filePath = join(dir, 'telemetry.json');
|
|
73
|
+
this.data = this.load();
|
|
74
|
+
}
|
|
75
|
+
// ── Public API ──
|
|
76
|
+
isEnabled() {
|
|
77
|
+
return this.data.enabled;
|
|
78
|
+
}
|
|
79
|
+
setEnabled(enabled) {
|
|
80
|
+
this.data.enabled = enabled;
|
|
81
|
+
this.save();
|
|
82
|
+
}
|
|
83
|
+
reset() {
|
|
84
|
+
const wasEnabled = this.data.enabled;
|
|
85
|
+
this.data = emptyData();
|
|
86
|
+
this.data.enabled = wasEnabled;
|
|
87
|
+
this.save();
|
|
88
|
+
}
|
|
89
|
+
record(event) {
|
|
90
|
+
if (!this.data.enabled)
|
|
91
|
+
return;
|
|
92
|
+
const now = Date.now();
|
|
93
|
+
if (!this.data.firstRecordedAt)
|
|
94
|
+
this.data.firstRecordedAt = now;
|
|
95
|
+
this.data.lastRecordedAt = now;
|
|
96
|
+
switch (event.type) {
|
|
97
|
+
case 'stage-run':
|
|
98
|
+
this.recordStageRun(event);
|
|
99
|
+
break;
|
|
100
|
+
case 'pipeline-run':
|
|
101
|
+
this.recordPipelineRun(event);
|
|
102
|
+
break;
|
|
103
|
+
case 'fix-iteration':
|
|
104
|
+
this.recordFixIteration(event);
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
this.save();
|
|
108
|
+
}
|
|
109
|
+
getData() {
|
|
110
|
+
return { ...this.data };
|
|
111
|
+
}
|
|
112
|
+
getSummary() {
|
|
113
|
+
const d = this.data;
|
|
114
|
+
const lines = [];
|
|
115
|
+
// Header
|
|
116
|
+
lines.push('');
|
|
117
|
+
lines.push(' SWARM TELEMETRY — Local Usage Statistics');
|
|
118
|
+
lines.push(' ========================================');
|
|
119
|
+
lines.push('');
|
|
120
|
+
if (!d.firstRecordedAt) {
|
|
121
|
+
lines.push(' No data recorded yet. Run some pipelines to see stats!');
|
|
122
|
+
lines.push('');
|
|
123
|
+
return lines.join('\n');
|
|
124
|
+
}
|
|
125
|
+
// Time range
|
|
126
|
+
const first = new Date(d.firstRecordedAt).toLocaleDateString();
|
|
127
|
+
const last = new Date(d.lastRecordedAt).toLocaleDateString();
|
|
128
|
+
lines.push(` Tracking since: ${first} | Last activity: ${last}`);
|
|
129
|
+
lines.push('');
|
|
130
|
+
// Pipeline overview
|
|
131
|
+
lines.push(' PIPELINE RUNS');
|
|
132
|
+
lines.push(' ─────────────');
|
|
133
|
+
lines.push(` Total runs: ${d.pipelineRuns}`);
|
|
134
|
+
lines.push(` Successes: ${d.pipelineSuccesses}`);
|
|
135
|
+
lines.push(` Failures: ${d.pipelineFailures}`);
|
|
136
|
+
if (d.pipelineRuns > 0) {
|
|
137
|
+
const successRate = ((d.pipelineSuccesses / d.pipelineRuns) * 100).toFixed(1);
|
|
138
|
+
const avgCost = (d.pipelineTotalCost / d.pipelineRuns).toFixed(4);
|
|
139
|
+
const avgDuration = formatDuration(d.pipelineTotalDuration / d.pipelineRuns);
|
|
140
|
+
lines.push(` Success rate: ${successRate}%`);
|
|
141
|
+
lines.push(` Total cost: $${d.pipelineTotalCost.toFixed(4)}`);
|
|
142
|
+
lines.push(` Avg cost/run: $${avgCost}`);
|
|
143
|
+
lines.push(` Avg duration: ${avgDuration}`);
|
|
144
|
+
}
|
|
145
|
+
lines.push('');
|
|
146
|
+
// Stage breakdown
|
|
147
|
+
const stageNames = Object.keys(d.stages);
|
|
148
|
+
if (stageNames.length > 0) {
|
|
149
|
+
lines.push(' STAGE BREAKDOWN');
|
|
150
|
+
lines.push(' ───────────────');
|
|
151
|
+
const header = ' ' + 'Stage'.padEnd(14) + 'Runs'.padEnd(8) + 'OK'.padEnd(6) + 'Fail'.padEnd(8) + 'Avg Cost'.padEnd(12) + 'Avg Time';
|
|
152
|
+
lines.push(header);
|
|
153
|
+
lines.push(' ' + '─'.repeat(60));
|
|
154
|
+
for (const name of stageNames) {
|
|
155
|
+
const s = d.stages[name];
|
|
156
|
+
const avgCost = s.runs > 0 ? `$${(s.totalCost / s.runs).toFixed(4)}` : '$0.0000';
|
|
157
|
+
const avgTime = s.runs > 0 ? formatDuration(s.totalDuration / s.runs) : '—';
|
|
158
|
+
lines.push(' ' +
|
|
159
|
+
name.padEnd(14) +
|
|
160
|
+
String(s.runs).padEnd(8) +
|
|
161
|
+
String(s.successes).padEnd(6) +
|
|
162
|
+
String(s.failures).padEnd(8) +
|
|
163
|
+
avgCost.padEnd(12) +
|
|
164
|
+
avgTime);
|
|
165
|
+
}
|
|
166
|
+
lines.push('');
|
|
167
|
+
}
|
|
168
|
+
// Models & stacks
|
|
169
|
+
const modelEntries = Object.entries(d.models).sort((a, b) => b[1] - a[1]);
|
|
170
|
+
const stackEntries = Object.entries(d.stacks).sort((a, b) => b[1] - a[1]);
|
|
171
|
+
if (modelEntries.length > 0 || stackEntries.length > 0) {
|
|
172
|
+
lines.push(' USAGE PATTERNS');
|
|
173
|
+
lines.push(' ──────────────');
|
|
174
|
+
if (modelEntries.length > 0) {
|
|
175
|
+
lines.push(` Models: ${modelEntries.map(([m, c]) => `${m} (${c})`).join(', ')}`);
|
|
176
|
+
}
|
|
177
|
+
if (stackEntries.length > 0) {
|
|
178
|
+
lines.push(` Stacks: ${stackEntries.map(([s, c]) => `${s} (${c})`).join(', ')}`);
|
|
179
|
+
}
|
|
180
|
+
lines.push('');
|
|
181
|
+
}
|
|
182
|
+
// Fix loop stats
|
|
183
|
+
if (d.fixLoopRuns > 0) {
|
|
184
|
+
const avgIterations = (d.fixIterationsTotal / d.fixLoopRuns).toFixed(1);
|
|
185
|
+
lines.push(' FIX LOOP STATS');
|
|
186
|
+
lines.push(' ──────────────');
|
|
187
|
+
lines.push(` Total fix loops: ${d.fixLoopRuns}`);
|
|
188
|
+
lines.push(` Avg iterations: ${avgIterations}`);
|
|
189
|
+
lines.push(` Max iterations: ${d.fixIterationsMax}`);
|
|
190
|
+
lines.push(` Total tests fixed: ${d.fixTotalFixed}`);
|
|
191
|
+
lines.push('');
|
|
192
|
+
}
|
|
193
|
+
return lines.join('\n');
|
|
194
|
+
}
|
|
195
|
+
// ── Private helpers ──
|
|
196
|
+
recordStageRun(event) {
|
|
197
|
+
const stage = event.stage;
|
|
198
|
+
if (!this.data.stages[stage]) {
|
|
199
|
+
this.data.stages[stage] = { runs: 0, successes: 0, failures: 0, totalCost: 0, totalDuration: 0 };
|
|
200
|
+
}
|
|
201
|
+
const s = this.data.stages[stage];
|
|
202
|
+
s.runs++;
|
|
203
|
+
if (event.status === 'success') {
|
|
204
|
+
s.successes++;
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
s.failures++;
|
|
208
|
+
}
|
|
209
|
+
s.totalCost += event.cost;
|
|
210
|
+
s.totalDuration += event.duration;
|
|
211
|
+
if (event.stack) {
|
|
212
|
+
this.data.stacks[event.stack] = (this.data.stacks[event.stack] || 0) + 1;
|
|
213
|
+
}
|
|
214
|
+
if (event.model) {
|
|
215
|
+
this.data.models[event.model] = (this.data.models[event.model] || 0) + 1;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
recordPipelineRun(event) {
|
|
219
|
+
this.data.pipelineRuns++;
|
|
220
|
+
if (event.success) {
|
|
221
|
+
this.data.pipelineSuccesses++;
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
this.data.pipelineFailures++;
|
|
225
|
+
}
|
|
226
|
+
this.data.pipelineTotalCost += event.totalCost;
|
|
227
|
+
this.data.pipelineTotalDuration += event.duration;
|
|
228
|
+
}
|
|
229
|
+
recordFixIteration(event) {
|
|
230
|
+
// Each fix-iteration event with iteration === 1 starts a new fix loop run
|
|
231
|
+
if (event.iteration === 1) {
|
|
232
|
+
this.data.fixLoopRuns++;
|
|
233
|
+
}
|
|
234
|
+
this.data.fixIterationsTotal++;
|
|
235
|
+
if (event.iteration > this.data.fixIterationsMax) {
|
|
236
|
+
this.data.fixIterationsMax = event.iteration;
|
|
237
|
+
}
|
|
238
|
+
this.data.fixTotalFixed += event.fixed;
|
|
239
|
+
this.data.fixTotalRemaining += event.remaining;
|
|
240
|
+
}
|
|
241
|
+
load() {
|
|
242
|
+
if (!existsSync(this.filePath))
|
|
243
|
+
return emptyData();
|
|
244
|
+
try {
|
|
245
|
+
const raw = readFileSync(this.filePath, 'utf-8');
|
|
246
|
+
const parsed = JSON.parse(raw);
|
|
247
|
+
return { ...emptyData(), ...parsed };
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
return emptyData();
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
save() {
|
|
254
|
+
try {
|
|
255
|
+
writeFileSync(this.filePath, JSON.stringify(this.data, null, 2) + '\n');
|
|
256
|
+
}
|
|
257
|
+
catch {
|
|
258
|
+
// Non-critical — don't crash if telemetry write fails
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function formatDuration(ms) {
|
|
263
|
+
if (ms < 1000)
|
|
264
|
+
return `${Math.round(ms)}ms`;
|
|
265
|
+
const seconds = ms / 1000;
|
|
266
|
+
if (seconds < 60)
|
|
267
|
+
return `${seconds.toFixed(1)}s`;
|
|
268
|
+
const minutes = Math.floor(seconds / 60);
|
|
269
|
+
const secs = Math.round(seconds % 60);
|
|
270
|
+
if (minutes < 60)
|
|
271
|
+
return `${minutes}m ${secs}s`;
|
|
272
|
+
const hours = Math.floor(minutes / 60);
|
|
273
|
+
const mins = minutes % 60;
|
|
274
|
+
return `${hours}h ${mins}m`;
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../../src/core/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAsElC,SAAS,SAAS;IAChB,OAAO;QACL,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,IAAI;QACpB,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,CAAC;QACf,iBAAiB,EAAE,CAAC;QACpB,gBAAgB,EAAE,CAAC;QACnB,iBAAiB,EAAE,CAAC;QACpB,qBAAqB,EAAE,CAAC;QACxB,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,CAAC;QACrB,gBAAgB,EAAE,CAAC;QACnB,aAAa,EAAE,CAAC;QAChB,iBAAiB,EAAE,CAAC;QACpB,WAAW,EAAE,CAAC;KACf,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,SAAS;IACZ,QAAQ,CAAS;IACjB,IAAI,CAAgB;IAE5B,YAAY,OAAgB;QAC1B,MAAM,GAAG,GAAG,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACrB,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG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I,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACtC,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,KAAK,IAAI,GAAG,CAAC;IAChD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,OAAO,GAAG,EAAE,CAAC;IAC1B,OAAO,GAAG,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swarm Tool Definitions
|
|
3
|
+
*
|
|
4
|
+
* OpenAI function-calling format tool definitions for API-based models.
|
|
5
|
+
* These tools give non-Claude models the ability to read/write files,
|
|
6
|
+
* run commands, and search code within the project sandbox.
|
|
7
|
+
*/
|
|
8
|
+
import type { ToolDefinition } from '../providers/types.js';
|
|
9
|
+
export declare const SWARM_TOOLS: ToolDefinition[];
|
|
10
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/definitions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,eAAO,MAAM,WAAW,EAAE,cAAc,EAmKvC,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swarm Tool Definitions
|
|
3
|
+
*
|
|
4
|
+
* OpenAI function-calling format tool definitions for API-based models.
|
|
5
|
+
* These tools give non-Claude models the ability to read/write files,
|
|
6
|
+
* run commands, and search code within the project sandbox.
|
|
7
|
+
*/
|
|
8
|
+
export const SWARM_TOOLS = [
|
|
9
|
+
{
|
|
10
|
+
type: 'function',
|
|
11
|
+
function: {
|
|
12
|
+
name: 'read_file',
|
|
13
|
+
description: 'Read the contents of a file. Returns the file content with line numbers. Use startLine/endLine to read a specific range for large files.',
|
|
14
|
+
parameters: {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
path: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'File path relative to project root',
|
|
20
|
+
},
|
|
21
|
+
startLine: {
|
|
22
|
+
type: 'number',
|
|
23
|
+
description: 'Start reading from this line (1-indexed, inclusive)',
|
|
24
|
+
},
|
|
25
|
+
endLine: {
|
|
26
|
+
type: 'number',
|
|
27
|
+
description: 'Stop reading at this line (1-indexed, inclusive)',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
required: ['path'],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'function',
|
|
36
|
+
function: {
|
|
37
|
+
name: 'write_file',
|
|
38
|
+
description: 'Write content to a file. Creates the file if it does not exist, overwrites if it does. Parent directories are created automatically.',
|
|
39
|
+
parameters: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
path: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'File path relative to project root',
|
|
45
|
+
},
|
|
46
|
+
content: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'Full content to write to the file',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
required: ['path', 'content'],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: 'function',
|
|
57
|
+
function: {
|
|
58
|
+
name: 'edit_file',
|
|
59
|
+
description: 'Replace a specific string in a file. The old_text must appear exactly once in the file (unique match required). Use this for surgical edits instead of rewriting entire files.',
|
|
60
|
+
parameters: {
|
|
61
|
+
type: 'object',
|
|
62
|
+
properties: {
|
|
63
|
+
path: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
description: 'File path relative to project root',
|
|
66
|
+
},
|
|
67
|
+
old_text: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
description: 'The exact text to find and replace (must be a unique match)',
|
|
70
|
+
},
|
|
71
|
+
new_text: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
description: 'The replacement text',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
required: ['path', 'old_text', 'new_text'],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: 'function',
|
|
82
|
+
function: {
|
|
83
|
+
name: 'run_command',
|
|
84
|
+
description: 'Execute a shell command and return stdout/stderr. Commands run in /bin/sh. Use cwd to change the working directory. Long-running commands will be terminated after the timeout.',
|
|
85
|
+
parameters: {
|
|
86
|
+
type: 'object',
|
|
87
|
+
properties: {
|
|
88
|
+
command: {
|
|
89
|
+
type: 'string',
|
|
90
|
+
description: 'The shell command to execute',
|
|
91
|
+
},
|
|
92
|
+
cwd: {
|
|
93
|
+
type: 'string',
|
|
94
|
+
description: 'Working directory for the command (relative to project root)',
|
|
95
|
+
},
|
|
96
|
+
timeout: {
|
|
97
|
+
type: 'number',
|
|
98
|
+
description: 'Maximum execution time in milliseconds (default: 30000)',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
required: ['command'],
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: 'function',
|
|
107
|
+
function: {
|
|
108
|
+
name: 'search_files',
|
|
109
|
+
description: 'Search file contents using a regex pattern (like grep). Returns matching lines with file paths and line numbers. Searches recursively from the given path.',
|
|
110
|
+
parameters: {
|
|
111
|
+
type: 'object',
|
|
112
|
+
properties: {
|
|
113
|
+
pattern: {
|
|
114
|
+
type: 'string',
|
|
115
|
+
description: 'Regex pattern to search for in file contents',
|
|
116
|
+
},
|
|
117
|
+
path: {
|
|
118
|
+
type: 'string',
|
|
119
|
+
description: 'Directory to search in, relative to project root (default: project root)',
|
|
120
|
+
},
|
|
121
|
+
glob: {
|
|
122
|
+
type: 'string',
|
|
123
|
+
description: 'File glob pattern to filter which files to search (e.g. "*.ts", "**/*.js")',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
required: ['pattern'],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
type: 'function',
|
|
132
|
+
function: {
|
|
133
|
+
name: 'list_files',
|
|
134
|
+
description: 'List files matching a glob pattern. Returns file paths relative to the project root, sorted alphabetically. Use this to explore the project structure.',
|
|
135
|
+
parameters: {
|
|
136
|
+
type: 'object',
|
|
137
|
+
properties: {
|
|
138
|
+
pattern: {
|
|
139
|
+
type: 'string',
|
|
140
|
+
description: 'Glob pattern to match files (e.g. "src/**/*.ts", "*.json", "**/*")',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
required: ['pattern'],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: 'function',
|
|
149
|
+
function: {
|
|
150
|
+
name: 'create_directory',
|
|
151
|
+
description: 'Create a directory, including any necessary parent directories.',
|
|
152
|
+
parameters: {
|
|
153
|
+
type: 'object',
|
|
154
|
+
properties: {
|
|
155
|
+
path: {
|
|
156
|
+
type: 'string',
|
|
157
|
+
description: 'Directory path relative to project root',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
required: ['path'],
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
];
|
|
165
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../../../src/core/tools/definitions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,CAAC,MAAM,WAAW,GAAqB;IAC3C;QACE,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE,WAAW;YACjB,WAAW,EACT,0IAA0I;YAC5I,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;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ACnE,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,yCAAyC;qBACvD;iBACF;gBACD,QAAQ,EAAE,CAAC,MAAM,CAAC;aACnB;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Executor
|
|
3
|
+
*
|
|
4
|
+
* Executes tool calls from API-based LLMs within the sandbox.
|
|
5
|
+
* Each tool maps to a file/shell operation performed safely within
|
|
6
|
+
* the project root boundary.
|
|
7
|
+
*/
|
|
8
|
+
import { type ToolSandboxConfig } from './sandbox.js';
|
|
9
|
+
export interface ToolResult {
|
|
10
|
+
success: boolean;
|
|
11
|
+
output: string;
|
|
12
|
+
error?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class ToolExecutor {
|
|
15
|
+
private sandbox;
|
|
16
|
+
constructor(sandboxConfig: ToolSandboxConfig);
|
|
17
|
+
/** Execute a tool call by name and return the result */
|
|
18
|
+
execute(toolName: string, args: Record<string, unknown>): Promise<ToolResult>;
|
|
19
|
+
private readFileImpl;
|
|
20
|
+
private writeFileImpl;
|
|
21
|
+
private editFileImpl;
|
|
22
|
+
private runCommandImpl;
|
|
23
|
+
private searchFilesImpl;
|
|
24
|
+
private listFilesImpl;
|
|
25
|
+
private createDirectoryImpl;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/executor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAgBnE,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAc;gBAEjB,aAAa,EAAE,iBAAiB;IAI5C,wDAAwD;IAClD,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;YA4BrE,YAAY;YAsCZ,aAAa;YA0Bb,YAAY;YAoDZ,cAAc;YAqDd,eAAe;YAiEf,aAAa;YAyDb,mBAAmB;CAWlC"}
|