opencode-swarm 7.0.0-beta.1 → 7.0.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 +21 -0
- package/README.md +1265 -40
- package/dist/__tests__/acknowledge-spec-drift.test.d.ts +1 -0
- package/dist/__tests__/cli-version.adversarial.test.d.ts +1 -0
- package/dist/__tests__/cli-version.test.d.ts +1 -0
- package/dist/__tests__/conflict-resolution.test.d.ts +1 -0
- package/dist/__tests__/convene-general-council.test.d.ts +10 -0
- package/dist/__tests__/critic_drift_verifier-whitelist.test.d.ts +1 -0
- package/dist/__tests__/critic_hallucination_verifier-whitelist.test.d.ts +1 -0
- package/dist/__tests__/disagreement-detector.test.d.ts +7 -0
- package/dist/__tests__/evidence-lock.adversarial.test.d.ts +8 -0
- package/dist/__tests__/evidence-lock.test.d.ts +6 -0
- package/dist/__tests__/gate-evidence.adversarial.test.d.ts +7 -0
- package/dist/__tests__/general-council-service.test.d.ts +7 -0
- package/dist/__tests__/lint-spec.test.d.ts +1 -0
- package/dist/__tests__/preflight-phase.test.d.ts +1 -0
- package/dist/__tests__/qa-gate-hardening.test.d.ts +12 -0
- package/dist/__tests__/req-coverage.test.d.ts +1 -0
- package/dist/__tests__/security-adversarial.test.d.ts +1 -0
- package/dist/__tests__/sounding-board-parser.test.d.ts +1 -0
- package/dist/__tests__/spec-hash.test.d.ts +1 -0
- package/dist/__tests__/spec-schema.test.d.ts +1 -0
- package/dist/__tests__/web-search-provider.test.d.ts +6 -0
- package/dist/__tests__/write-drift-evidence-requirement-coverage.test.d.ts +4 -0
- package/dist/adversarial-tests.test.d.ts +1 -0
- package/dist/agents/architect-permission.adversarial.test.d.ts +5 -0
- package/dist/agents/architect.commands-list.adversarial.test.d.ts +1 -0
- package/dist/agents/architect.commands-list.test.d.ts +1 -0
- package/dist/agents/architect.d.ts +57 -0
- package/dist/agents/architect.dark-matter.test.d.ts +1 -0
- package/dist/agents/architect.designer-gate.test.d.ts +1 -0
- package/dist/agents/coder.d.ts +2 -0
- package/dist/agents/council-member.d.ts +30 -0
- package/dist/agents/council-member.test.d.ts +8 -0
- package/dist/agents/council-moderator.d.ts +20 -0
- package/dist/agents/critic.d.ts +34 -0
- package/dist/agents/curator-agent.d.ts +14 -0
- package/dist/agents/designer.d.ts +2 -0
- package/dist/agents/docs.d.ts +2 -0
- package/dist/agents/explorer-consumer-contract.test.d.ts +1 -0
- package/dist/agents/explorer-role-boundary.test.d.ts +1 -0
- package/dist/agents/explorer.d.ts +5 -0
- package/dist/agents/index.d.ts +52 -0
- package/dist/agents/reviewer.d.ts +5 -0
- package/dist/agents/sme.d.ts +2 -0
- package/dist/agents/test-engineer.adversarial.test.d.ts +5 -0
- package/dist/agents/test-engineer.d.ts +2 -0
- package/dist/agents/test-engineer.security.test.d.ts +1 -0
- package/dist/background/circuit-breaker.d.ts +149 -0
- package/dist/background/event-bus.d.ts +60 -0
- package/dist/background/evidence-summary-integration.d.ts +73 -0
- package/dist/background/index.d.ts +22 -0
- package/dist/background/manager.d.ts +122 -0
- package/dist/background/plan-sync-worker.d.ts +122 -0
- package/dist/background/queue.d.ts +117 -0
- package/dist/background/status-artifact.d.ts +115 -0
- package/dist/background/trigger.d.ts +179 -0
- package/dist/background/trigger.vulnerability.test.d.ts +1 -0
- package/dist/background/worker.d.ts +92 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.js +31227 -11423
- package/dist/commands/acknowledge-spec-drift.d.ts +5 -0
- package/dist/commands/brainstorm.d.ts +13 -0
- package/dist/commands/brainstorm.test.d.ts +1 -0
- package/dist/commands/checkpoint.d.ts +5 -0
- package/dist/commands/close.d.ts +11 -0
- package/dist/commands/command-adapters.security.test.d.ts +14 -0
- package/dist/commands/commands.test.d.ts +1 -0
- package/dist/commands/config.d.ts +5 -0
- package/dist/commands/council.d.ts +17 -0
- package/dist/commands/council.test.d.ts +4 -0
- package/dist/commands/curate.test.d.ts +1 -0
- package/dist/commands/doctor.d.ts +17 -0
- package/dist/commands/full-auto-config-guard.test.d.ts +7 -0
- package/dist/commands/full-auto-discoverability.test.d.ts +8 -0
- package/dist/commands/full-auto-registration.test.d.ts +5 -0
- package/dist/commands/full-auto-sessionid.test.d.ts +5 -0
- package/dist/commands/full-auto.d.ts +10 -0
- package/dist/commands/full-auto.regression.test.d.ts +10 -0
- package/dist/commands/full-auto.test.d.ts +6 -0
- package/dist/commands/index.d.ts +50 -0
- package/dist/commands/index.help-text.test.d.ts +1 -0
- package/dist/commands/issue.d.ts +13 -0
- package/dist/{knowledge.d.ts → commands/knowledge.d.ts} +2 -0
- package/dist/commands/pr-review.d.ts +11 -0
- package/dist/commands/qa-gates.d.ts +15 -0
- package/dist/commands/qa-gates.test.d.ts +1 -0
- package/dist/commands/registry-documentation.test.d.ts +1 -0
- package/dist/commands/registry-type.test.d.ts +1 -0
- package/dist/commands/registry.d.ts +282 -0
- package/dist/commands/reset-session.d.ts +7 -0
- package/dist/commands/shortcut-routing.test.d.ts +11 -0
- package/dist/{sync-plan.d.ts → commands/sync-plan.d.ts} +3 -1
- package/dist/commands/turbo-registration.test.d.ts +5 -0
- package/dist/commands/turbo-sessionid.test.d.ts +5 -0
- package/dist/commands/turbo.regression.test.d.ts +11 -0
- package/dist/commands/turbo.test.d.ts +5 -0
- package/dist/config/agent-categories.d.ts +12 -0
- package/dist/config/cache-paths.d.ts +11 -0
- package/dist/config/constants.architect-whitelist.test.d.ts +1 -0
- package/dist/config/constants.d.ts +72 -0
- package/dist/config/evidence-schema.d.ts +1352 -0
- package/dist/config/index.d.ts +11 -0
- package/dist/{config.d.ts → config/loader.d.ts} +11 -6
- package/dist/config/plan-schema.d.ts +191 -0
- package/dist/config/schema.d.ts +1078 -0
- package/dist/config/spec-schema.d.ts +113 -0
- package/dist/context/role-filter.d.ts +27 -0
- package/dist/context/zone-classifier.d.ts +17 -0
- package/dist/council/__tests__/council-evidence-writer.adversarial.test.d.ts +6 -0
- package/dist/council/council-advisory.d.ts +46 -0
- package/dist/council/council-evidence-writer.d.ts +18 -0
- package/dist/council/council-service.d.ts +21 -0
- package/dist/council/criteria-store.d.ts +9 -0
- package/dist/council/disagreement-detector.d.ts +24 -0
- package/dist/council/general-council-advisory.d.ts +29 -0
- package/dist/council/general-council-service.d.ts +22 -0
- package/dist/council/general-council-types.d.ts +98 -0
- package/dist/council/types.d.ts +126 -0
- package/dist/council/web-search-provider.d.ts +35 -0
- package/dist/db/global-db.d.ts +22 -0
- package/dist/db/global-db.test.d.ts +7 -0
- package/dist/db/index.d.ts +13 -0
- package/dist/db/project-db.d.ts +40 -0
- package/dist/db/project-db.test.d.ts +4 -0
- package/dist/db/qa-gate-profile.d.ts +107 -0
- package/dist/db/qa-gate-profile.test.d.ts +4 -0
- package/dist/diff/__tests__/semantic-classifier.test.d.ts +1 -0
- package/dist/diff/__tests__/summary-generator.test.d.ts +1 -0
- package/dist/diff/ast-diff.d.ts +21 -0
- package/dist/diff/semantic-classifier.d.ts +59 -0
- package/dist/diff/summary-generator.d.ts +33 -0
- package/dist/environment/index.d.ts +3 -0
- package/dist/environment/profile.d.ts +50 -0
- package/dist/environment/prompt-renderer.d.ts +6 -0
- package/dist/evidence/index.d.ts +2 -0
- package/dist/evidence/lock.d.ts +36 -0
- package/dist/evidence/manager.d.ts +78 -0
- package/dist/gate-evidence.d.ts +69 -0
- package/dist/gate-evidence.test.d.ts +1 -0
- package/dist/git/branch.d.ts +70 -0
- package/dist/git/index.d.ts +22 -0
- package/dist/git/pr.d.ts +28 -0
- package/dist/graph/graph-builder.d.ts +39 -0
- package/dist/graph/graph-query.d.ts +42 -0
- package/dist/graph/graph-store.d.ts +27 -0
- package/dist/graph/import-extractor.d.ts +44 -0
- package/dist/graph/index.d.ts +16 -0
- package/dist/graph/symbol-extractor.d.ts +17 -0
- package/dist/graph/types.d.ts +84 -0
- package/dist/hooks/__tests__/semantic-diff-injection.test.d.ts +1 -0
- package/dist/hooks/adversarial-detector.d.ts +50 -0
- package/dist/hooks/agent-activity.d.ts +38 -0
- package/dist/hooks/co-change-suggester.d.ts +51 -0
- package/dist/hooks/compaction-customizer.d.ts +11 -0
- package/dist/hooks/conflict-resolution.d.ts +12 -0
- package/dist/hooks/context-budget.d.ts +34 -0
- package/dist/hooks/context-scoring.d.ts +70 -0
- package/dist/hooks/curator-drift-advisory.test.d.ts +1 -0
- package/dist/hooks/curator-drift.d.ts +30 -0
- package/dist/hooks/curator-llm-factory.d.ts +20 -0
- package/dist/hooks/curator-types.d.ts +103 -0
- package/dist/hooks/curator.d.ts +108 -0
- package/dist/hooks/dark-matter-detector.d.ts +38 -0
- package/dist/hooks/delegation-gate.d.ts +78 -0
- package/dist/hooks/delegation-gate.evidence.test.d.ts +4 -0
- package/dist/hooks/delegation-gate.getEvidenceTaskId.test.d.ts +20 -0
- package/dist/hooks/delegation-gate.plan-fallback-security.test.d.ts +13 -0
- package/dist/hooks/delegation-gate.plan-fallback.test.d.ts +5 -0
- package/dist/hooks/delegation-gate.seed-state.test.d.ts +1 -0
- package/dist/hooks/delegation-gate.turbo-evidence.test.d.ts +8 -0
- package/dist/hooks/delegation-gate.verify.test.d.ts +11 -0
- package/dist/hooks/delegation-ledger.d.ts +37 -0
- package/dist/hooks/delegation-ledger.test.d.ts +11 -0
- package/dist/hooks/delegation-sanitizer.d.ts +24 -0
- package/dist/hooks/delegation-tracker.d.ts +15 -0
- package/dist/hooks/diff-scope.d.ts +12 -0
- package/dist/hooks/diff-scope.test.d.ts +1 -0
- package/dist/hooks/extractors.d.ts +53 -0
- package/dist/hooks/full-auto-intercept.d.ts +77 -0
- package/dist/hooks/guardrails.d.ts +174 -0
- package/dist/hooks/hive-promoter.d.ts +40 -0
- package/dist/hooks/incremental-verify.d.ts +34 -0
- package/dist/hooks/incremental-verify.test.d.ts +1 -0
- package/dist/hooks/index.d.ts +20 -0
- package/dist/hooks/knowledge-curator.d.ts +27 -0
- package/dist/hooks/knowledge-injector.d.ts +20 -0
- package/dist/hooks/knowledge-migrator.d.ts +11 -0
- package/dist/hooks/knowledge-reader.d.ts +22 -0
- package/dist/hooks/knowledge-store.d.ts +30 -0
- package/dist/hooks/knowledge-types.d.ts +131 -0
- package/dist/hooks/knowledge-validator.d.ts +29 -0
- package/dist/hooks/loop-detector.d.ts +17 -0
- package/dist/hooks/loop-detector.test.d.ts +1 -0
- package/dist/hooks/message-priority.d.ts +105 -0
- package/dist/hooks/messages-transform.d.ts +13 -0
- package/dist/hooks/model-limits.d.ts +96 -0
- package/dist/hooks/normalize-tool-name.d.ts +25 -0
- package/dist/hooks/phase-monitor.d.ts +29 -0
- package/dist/hooks/pipeline-tracker.d.ts +41 -0
- package/dist/hooks/repo-graph-builder.d.ts +32 -0
- package/dist/hooks/repo-graph-injection.d.ts +45 -0
- package/dist/hooks/review-receipt.d.ts +189 -0
- package/dist/hooks/scope-guard-throw-behavior.test.d.ts +15 -0
- package/dist/hooks/scope-guard.adversarial.test.d.ts +1 -0
- package/dist/hooks/scope-guard.d.ts +43 -0
- package/dist/hooks/scope-guard.test.d.ts +14 -0
- package/dist/hooks/self-review.d.ts +14 -0
- package/dist/hooks/self-review.test.d.ts +14 -0
- package/dist/hooks/semantic-diff-injection.d.ts +24 -0
- package/dist/hooks/slop-detector.adversarial.test.d.ts +1 -0
- package/dist/hooks/slop-detector.d.ts +17 -0
- package/dist/hooks/slop-detector.test.d.ts +1 -0
- package/dist/hooks/spawn-helper.d.ts +5 -0
- package/dist/hooks/spawn-helper.test.d.ts +1 -0
- package/dist/hooks/steering-consumed.d.ts +30 -0
- package/dist/hooks/system-enhancer.d.ts +30 -0
- package/dist/hooks/tool-summarizer.d.ts +28 -0
- package/dist/hooks/trajectory-logger.d.ts +69 -0
- package/dist/hooks/utils.d.ts +20 -0
- package/dist/hooks/watchdog.integration.test.d.ts +9 -0
- package/dist/index.adversarial-bootstrap.test.d.ts +1 -0
- package/dist/index.bootstrap-adversarial.test.d.ts +1 -0
- package/dist/index.bootstrap-directory.test.d.ts +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +74704 -47714
- package/dist/knowledge/identity.d.ts +25 -0
- package/dist/knowledge/index.d.ts +2 -0
- package/dist/lang/detector.d.ts +20 -0
- package/dist/lang/framework-detector.d.ts +98 -0
- package/dist/lang/grammars/tree-sitter-dart.wasm +0 -0
- package/dist/lang/grammars/tree-sitter-kotlin.wasm +0 -0
- package/dist/lang/grammars/tree-sitter-swift.wasm +0 -0
- package/dist/lang/grammars/tree-sitter.wasm +0 -0
- package/dist/lang/index.d.ts +4 -0
- package/dist/lang/profiles.d.ts +72 -0
- package/dist/lang/registry.d.ts +24 -0
- package/dist/lang/runtime.d.ts +35 -0
- package/dist/model-fallback.adversarial.test.d.ts +22 -0
- package/dist/model-fallback.test.d.ts +12 -0
- package/dist/mutation/__tests__/engine.adversarial.test.d.ts +1 -0
- package/dist/mutation/__tests__/engine.test.d.ts +1 -0
- package/dist/mutation/__tests__/equivalence.adversarial.test.d.ts +1 -0
- package/dist/mutation/__tests__/equivalence.test.d.ts +1 -0
- package/dist/mutation/__tests__/gate.adversarial.test.d.ts +1 -0
- package/dist/mutation/__tests__/gate.test.d.ts +1 -0
- package/dist/mutation/__tests__/generator.test.d.ts +1 -0
- package/dist/mutation/engine.d.ts +47 -0
- package/dist/mutation/equivalence.d.ts +35 -0
- package/dist/mutation/gate.d.ts +28 -0
- package/dist/mutation/generator.d.ts +16 -0
- package/dist/output/agent-writer.d.ts +27 -0
- package/dist/output/index.d.ts +1 -0
- package/dist/parallel/dependency-graph.d.ts +34 -0
- package/dist/parallel/dispatcher/index.d.ts +12 -0
- package/dist/parallel/dispatcher/noop-dispatcher.d.ts +18 -0
- package/dist/parallel/dispatcher/noop-dispatcher.test.d.ts +10 -0
- package/dist/parallel/dispatcher/parallel-dispatcher.d.ts +18 -0
- package/dist/parallel/dispatcher/types.d.ts +33 -0
- package/dist/parallel/file-locks.d.ts +40 -0
- package/dist/parallel/index.d.ts +5 -0
- package/dist/parallel/meta-indexer.d.ts +32 -0
- package/dist/parallel/review-router.d.ts +29 -0
- package/dist/plan/checkpoint.d.ts +25 -0
- package/dist/plan/checkpoint.test.d.ts +1 -0
- package/dist/plan/index.d.ts +1 -0
- package/dist/plan/ledger-integrity.test.d.ts +5 -0
- package/dist/plan/ledger-snapshot-adversarial.test.d.ts +1 -0
- package/dist/plan/ledger.d.ts +286 -0
- package/dist/plan/ledger.test.d.ts +1 -0
- package/dist/plan/manager.cas-backoff.test.d.ts +10 -0
- package/dist/plan/manager.d.ts +90 -0
- package/dist/plan/manager.ledger-aware.test.d.ts +1 -0
- package/dist/plan/manager.loadplan-validation-guard.test.d.ts +13 -0
- package/dist/plan/manager.update-task-status.test.d.ts +1 -0
- package/dist/plan/migration-revert.regression.test.d.ts +8 -0
- package/dist/prm/__tests__/course-correction.test.d.ts +1 -0
- package/dist/prm/__tests__/escalation-queue-drain.test.d.ts +1 -0
- package/dist/prm/__tests__/escalation.test.d.ts +1 -0
- package/dist/prm/__tests__/index.test.d.ts +1 -0
- package/dist/prm/__tests__/integration.test.d.ts +1 -0
- package/dist/prm/__tests__/pattern-detector.test.d.ts +5 -0
- package/dist/prm/__tests__/replay.test.d.ts +1 -0
- package/dist/prm/__tests__/trajectory-store.test.d.ts +7 -0
- package/dist/prm/course-correction.d.ts +20 -0
- package/dist/prm/escalation.d.ts +73 -0
- package/dist/prm/index.d.ts +58 -0
- package/dist/prm/pattern-detector.d.ts +71 -0
- package/dist/prm/replay.d.ts +44 -0
- package/dist/prm/trajectory-store.d.ts +66 -0
- package/dist/prm/types.d.ts +120 -0
- package/dist/quality/index.d.ts +1 -0
- package/dist/quality/metrics.d.ts +25 -0
- package/dist/sast/rules/c.d.ts +9 -0
- package/dist/sast/rules/csharp.d.ts +9 -0
- package/dist/sast/rules/go.d.ts +9 -0
- package/dist/sast/rules/index.d.ts +72 -0
- package/dist/sast/rules/java.d.ts +9 -0
- package/dist/sast/rules/javascript.d.ts +9 -0
- package/dist/sast/rules/php.d.ts +9 -0
- package/dist/sast/rules/python.d.ts +9 -0
- package/dist/sast/semgrep.d.ts +68 -0
- package/dist/sast/semgrep.test.d.ts +1 -0
- package/dist/sbom/cyclonedx.d.ts +101 -0
- package/dist/sbom/detectors/dart.d.ts +7 -0
- package/dist/sbom/detectors/dotnet.d.ts +7 -0
- package/dist/sbom/detectors/go.d.ts +7 -0
- package/dist/sbom/detectors/index.d.ts +53 -0
- package/dist/sbom/detectors/java.d.ts +7 -0
- package/dist/sbom/detectors/nodejs.d.ts +7 -0
- package/dist/sbom/detectors/python.d.ts +7 -0
- package/dist/sbom/detectors/rust.d.ts +7 -0
- package/dist/sbom/detectors/swift.d.ts +7 -0
- package/dist/scope/scope-persistence.d.ts +109 -0
- package/dist/scope/scope-persistence.test.d.ts +13 -0
- package/dist/services/compaction-service.d.ts +28 -0
- package/dist/services/compaction-service.test.d.ts +1 -0
- package/dist/services/config-doctor.d.ts +125 -0
- package/dist/services/config-doctor.security.test.d.ts +1 -0
- package/dist/services/config-doctor.test.d.ts +1 -0
- package/dist/services/context-budget-service.d.ts +101 -0
- package/dist/services/decision-drift-analyzer.d.ts +96 -0
- package/dist/services/diagnose-service.d.ts +41 -0
- package/dist/services/evidence-service.d.ts +65 -0
- package/dist/services/evidence-summary-service.d.ts +75 -0
- package/dist/services/export-service.d.ts +30 -0
- package/dist/services/handoff-service.d.ts +74 -0
- package/dist/services/history-service.d.ts +35 -0
- package/dist/services/index.d.ts +13 -0
- package/dist/services/plan-service.d.ts +25 -0
- package/dist/services/preflight-integration.d.ts +38 -0
- package/dist/services/preflight-service.d.ts +62 -0
- package/dist/services/run-memory.d.ts +66 -0
- package/dist/services/status-service.d.ts +35 -0
- package/dist/services/status-service.turbo-indicator.test.d.ts +5 -0
- package/dist/services/tool-doctor.d.ts +26 -0
- package/dist/services/tool-doctor.test.d.ts +1 -0
- package/dist/services/version-check.d.ts +28 -0
- package/dist/services/warning-buffer.d.ts +9 -0
- package/dist/session/snapshot-reader.d.ts +37 -0
- package/dist/session/snapshot-writer.d.ts +115 -0
- package/dist/skills/index.d.ts +30 -0
- package/dist/state/agent-run-context.d.ts +24 -0
- package/dist/state.agent-run-context.test.d.ts +10 -0
- package/dist/state.d.ts +501 -1
- package/dist/state.rehydrate.test.d.ts +1 -0
- package/dist/state.rehydration-adversarial.test.d.ts +1 -0
- package/dist/state.rehydration-integration.test.d.ts +1 -0
- package/dist/state.session-restart.test.d.ts +7 -0
- package/dist/summaries/index.d.ts +2 -0
- package/dist/summaries/manager.d.ts +29 -0
- package/dist/summaries/summarizer.d.ts +38 -0
- package/dist/telemetry.d.ts +59 -0
- package/dist/telemetry.test.d.ts +1 -0
- package/dist/test-impact/__tests__/analyzer-import-fix.adversarial.test.d.ts +1 -0
- package/dist/test-impact/__tests__/analyzer-import-fix.test.d.ts +1 -0
- package/dist/test-impact/__tests__/analyzer.adversarial.test.d.ts +1 -0
- package/dist/test-impact/__tests__/analyzer.test.d.ts +1 -0
- package/dist/test-impact/__tests__/council-fixes.test.d.ts +1 -0
- package/dist/test-impact/__tests__/failure-classifier.adversarial.test.d.ts +1 -0
- package/dist/test-impact/__tests__/failure-classifier.test.d.ts +1 -0
- package/dist/test-impact/__tests__/flaky-detector.adversarial.test.d.ts +1 -0
- package/dist/test-impact/__tests__/flaky-detector.test.d.ts +1 -0
- package/dist/test-impact/__tests__/history-store.adversarial.test.d.ts +1 -0
- package/dist/test-impact/__tests__/history-store.test.d.ts +1 -0
- package/dist/test-impact/__tests__/test-impact.adversarial.test.d.ts +1 -0
- package/dist/test-impact/__tests__/test-impact.test.d.ts +1 -0
- package/dist/test-impact/analyzer.d.ts +9 -0
- package/dist/test-impact/failure-classifier.d.ts +26 -0
- package/dist/test-impact/flaky-detector.d.ts +14 -0
- package/dist/test-impact/history-store.d.ts +15 -0
- package/dist/tools/__tests__/barrel-exports.test.d.ts +1 -0
- package/dist/tools/__tests__/diff-ast-fallback.test.d.ts +1 -0
- package/dist/tools/__tests__/diff-markdown-summary.test.d.ts +1 -0
- package/dist/tools/__tests__/diff-semantic.test.d.ts +1 -0
- package/dist/tools/__tests__/diff-summary.adversarial.test.d.ts +1 -0
- package/dist/tools/__tests__/diff-summary.test.d.ts +1 -0
- package/dist/tools/__tests__/mutation-test.adversarial.test.d.ts +1 -0
- package/dist/tools/__tests__/mutation-test.sourcefiles.test.d.ts +1 -0
- package/dist/tools/__tests__/mutation-test.test.d.ts +1 -0
- package/dist/tools/__tests__/test-runner-history.test.d.ts +1 -0
- package/dist/tools/__tests__/test-runner-impact.adversarial.test.d.ts +1 -0
- package/dist/tools/__tests__/test-runner-impact.test.d.ts +1 -0
- package/dist/tools/__tests__/test-runner-source-files.test.d.ts +1 -0
- package/dist/tools/barrel-export-check-gate-status.test.d.ts +6 -0
- package/dist/tools/batch-symbols.d.ts +24 -0
- package/dist/tools/batch-symbols.test.d.ts +1 -0
- package/dist/tools/build-check.d.ts +50 -0
- package/dist/tools/check-gate-status.adversarial.test.d.ts +1 -0
- package/dist/tools/check-gate-status.d.ts +7 -0
- package/dist/tools/check-gate-status.gates.test.d.ts +1 -0
- package/dist/tools/check-gate-status.plugin-registration.test.d.ts +1 -0
- package/dist/tools/checkpoint.d.ts +2 -0
- package/dist/tools/co-change-analyzer.d.ts +45 -0
- package/dist/tools/completion-verify.d.ts +25 -0
- package/dist/tools/complexity-hotspots.d.ts +2 -0
- package/dist/tools/convene-council.d.ts +53 -0
- package/dist/tools/convene-general-council.d.ts +25 -0
- package/dist/{create-tool.d.ts → tools/create-tool.d.ts} +13 -1
- package/dist/tools/curator-analyze.d.ts +7 -0
- package/dist/tools/curator-analyze.test.d.ts +1 -0
- package/dist/tools/declare-council-criteria.d.ts +14 -0
- package/dist/tools/declare-scope.d.ts +50 -0
- package/dist/tools/diff-summary.d.ts +12 -0
- package/dist/tools/diff.d.ts +24 -0
- package/dist/tools/doc-scan.d.ts +38 -0
- package/dist/tools/domain-detector.d.ts +6 -0
- package/dist/tools/evidence-check.d.ts +8 -0
- package/dist/tools/file-extractor.d.ts +9 -0
- package/dist/tools/generate-mutants.d.ts +15 -0
- package/dist/tools/get-approved-plan.d.ts +55 -0
- package/dist/tools/get-qa-gate-profile.d.ts +27 -0
- package/dist/tools/gitingest.d.ts +18 -0
- package/dist/tools/imports.d.ts +5 -0
- package/dist/tools/index.d.ts +66 -0
- package/dist/tools/knowledge-add.d.ts +2 -0
- package/dist/tools/knowledge-query.d.ts +5 -0
- package/dist/tools/knowledge-recall.d.ts +2 -0
- package/dist/tools/knowledge-remove.d.ts +2 -0
- package/dist/tools/knowledge-tools.integration.test.d.ts +1 -0
- package/dist/tools/lint-spec.d.ts +2 -0
- package/dist/tools/lint.d.ts +63 -0
- package/dist/tools/mutation-test.d.ts +2 -0
- package/dist/tools/mutation-test.security.test.d.ts +1 -0
- package/dist/tools/phase-complete.d.ts +25 -0
- package/dist/tools/pkg-audit.d.ts +2 -0
- package/dist/tools/placeholder-scan.d.ts +28 -0
- package/dist/tools/plugin-registration-adversarial.test.d.ts +1 -0
- package/dist/tools/pre-check-batch.d.ts +89 -0
- package/dist/tools/quality-budget.d.ts +26 -0
- package/dist/tools/repo-graph.d.ts +226 -0
- package/dist/tools/repo-map.d.ts +2 -0
- package/dist/tools/req-coverage.d.ts +47 -0
- package/dist/tools/resolve-working-directory.d.ts +35 -0
- package/dist/tools/resolve-working-directory.test.d.ts +1 -0
- package/dist/tools/retrieve-summary.d.ts +2 -0
- package/dist/tools/sast-baseline.d.ts +126 -0
- package/dist/tools/sast-scan.d.ts +87 -0
- package/dist/tools/save-plan.d.ts +95 -0
- package/dist/tools/save-plan.subdirectory-rejection.test.d.ts +1 -0
- package/dist/tools/sbom-generate.d.ts +26 -0
- package/dist/tools/schema-drift.d.ts +2 -0
- package/dist/tools/search.adversarial.test.d.ts +1 -0
- package/dist/tools/search.d.ts +29 -0
- package/dist/tools/search.test.d.ts +1 -0
- package/dist/tools/secretscan.d.ts +35 -0
- package/dist/tools/set-qa-gates.d.ts +40 -0
- package/dist/tools/suggest-patch.adversarial.test.d.ts +1 -0
- package/dist/tools/suggest-patch.d.ts +37 -0
- package/dist/tools/suggest-patch.test.d.ts +1 -0
- package/dist/tools/symbols.d.ts +21 -0
- package/dist/tools/syntax-check.d.ts +37 -0
- package/dist/tools/test-impact.d.ts +2 -0
- package/dist/tools/test-runner.d.ts +86 -0
- package/dist/tools/test-runner.security-adversarial.test.d.ts +5 -0
- package/dist/tools/todo-extract.d.ts +2 -0
- package/dist/tools/tool-names.d.ts +10 -0
- package/dist/tools/update-task-status.adversarial.test.d.ts +13 -0
- package/dist/tools/update-task-status.d.ts +114 -0
- package/dist/tools/update-task-status.gates.test.d.ts +1 -0
- package/dist/tools/update-task-status.test.d.ts +1 -0
- package/dist/tools/update-task-status.turbo-bypass.test.d.ts +1 -0
- package/dist/tools/verify-six-tools-registration.test.d.ts +9 -0
- package/dist/tools/web-search.d.ts +13 -0
- package/dist/tools/write-drift-evidence.d.ts +31 -0
- package/dist/tools/write-hallucination-evidence.d.ts +30 -0
- package/dist/tools/write-mutation-evidence.d.ts +34 -0
- package/dist/tools/write-mutation-evidence.test.d.ts +1 -0
- package/dist/tools/write-retro.d.ts +55 -0
- package/dist/transient-retry.test.d.ts +10 -0
- package/dist/types/delegation.d.ts +24 -0
- package/dist/types/events.d.ts +125 -0
- package/dist/utils/errors.d.ts +33 -0
- package/dist/utils/gitignore-warning.d.ts +17 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/logger.d.ts +3 -0
- package/dist/utils/merge.d.ts +5 -0
- package/dist/utils/path-security.d.ts +36 -0
- package/dist/utils/regex.d.ts +30 -0
- package/dist/utils/spec-hash.d.ts +15 -0
- package/dist/utils/tool-output.d.ts +12 -0
- package/dist/validation/task-id.d.ts +43 -0
- package/package.json +21 -14
- package/dist/architect.d.ts +0 -7
- package/dist/checkpoint.d.ts +0 -7
- package/dist/co-change-analyzer.d.ts +0 -1
- package/dist/compat.d.ts +0 -12
- package/dist/config-doctor.d.ts +0 -1
- package/dist/detector.d.ts +0 -7
- package/dist/diagnose-service.d.ts +0 -1
- package/dist/doctor.d.ts +0 -5
- package/dist/evidence-schema.d.ts +0 -2
- package/dist/evidence-service.d.ts +0 -1
- package/dist/export-service.d.ts +0 -1
- package/dist/handoff-service.d.ts +0 -1
- package/dist/history-service.d.ts +0 -1
- package/dist/hive-promoter.d.ts +0 -2
- package/dist/knowledge-migrator.d.ts +0 -2
- package/dist/knowledge-store.d.ts +0 -1
- package/dist/knowledge-types.d.ts +0 -1
- package/dist/knowledge-validator.d.ts +0 -2
- package/dist/loader.d.ts +0 -1
- package/dist/manager.d.ts +0 -1
- package/dist/models.d.ts +0 -1
- package/dist/plan-service.d.ts +0 -1
- package/dist/preflight-service.d.ts +0 -1
- package/dist/profiles.d.ts +0 -7
- package/dist/register.d.ts +0 -36
- package/dist/schema.d.ts +0 -2
- package/dist/snapshot-writer.d.ts +0 -1
- package/dist/status-service.d.ts +0 -15
- package/dist/telemetry/src/events.d.ts +0 -308
- package/dist/telemetry/src/guards.d.ts +0 -14
- package/dist/telemetry/src/index.d.ts +0 -4
- package/dist/telemetry/src/version.d.ts +0 -1
- package/dist/utils.d.ts +0 -1
- package/dist/write-retro.d.ts +0 -1
- /package/dist/{discovery.d.ts → build/discovery.d.ts} +0 -0
- /package/dist/{agents.d.ts → commands/agents.d.ts} +0 -0
- /package/dist/{analyze.d.ts → commands/analyze.d.ts} +0 -0
- /package/dist/{archive.d.ts → commands/archive.d.ts} +0 -0
- /package/dist/{benchmark.d.ts → commands/benchmark.d.ts} +0 -0
- /package/dist/{clarify.d.ts → commands/clarify.d.ts} +0 -0
- /package/dist/{curate.d.ts → commands/curate.d.ts} +0 -0
- /package/dist/{dark-matter.d.ts → commands/dark-matter.d.ts} +0 -0
- /package/dist/{diagnose.d.ts → commands/diagnose.d.ts} +0 -0
- /package/dist/{evidence.d.ts → commands/evidence.d.ts} +0 -0
- /package/dist/{export.d.ts → commands/export.d.ts} +0 -0
- /package/dist/{handoff.d.ts → commands/handoff.d.ts} +0 -0
- /package/dist/{history.d.ts → commands/history.d.ts} +0 -0
- /package/dist/{plan.d.ts → commands/plan.d.ts} +0 -0
- /package/dist/{preflight.d.ts → commands/preflight.d.ts} +0 -0
- /package/dist/{promote.d.ts → commands/promote.d.ts} +0 -0
- /package/dist/{reset.d.ts → commands/reset.d.ts} +0 -0
- /package/dist/{retrieve.d.ts → commands/retrieve.d.ts} +0 -0
- /package/dist/{rollback.d.ts → commands/rollback.d.ts} +0 -0
- /package/dist/{simulate.d.ts → commands/simulate.d.ts} +0 -0
- /package/dist/{specify.d.ts → commands/specify.d.ts} +0 -0
- /package/dist/{status.d.ts → commands/status.d.ts} +0 -0
- /package/dist/{turbo.d.ts → commands/turbo.d.ts} +0 -0
- /package/dist/{write_retro.d.ts → commands/write-retro.d.ts} +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool to retrieve the last critic-approved immutable plan snapshot.
|
|
3
|
+
*
|
|
4
|
+
* Wraps `loadLastApprovedPlan` from `src/plan/ledger.ts` as a tool callable
|
|
5
|
+
* by the critic `phase_drift_verifier` agent. Enables active baseline drift
|
|
6
|
+
* comparison: the drift verifier can compare the immutable approved snapshot
|
|
7
|
+
* against the current `plan.json` to detect silent plan mutations introduced
|
|
8
|
+
* after approval.
|
|
9
|
+
*
|
|
10
|
+
* The tool internally derives `plan_id` from the current plan for
|
|
11
|
+
* cross-identity safety — the caller does not need to know the format.
|
|
12
|
+
*
|
|
13
|
+
* Read-only: no file writes.
|
|
14
|
+
*
|
|
15
|
+
* @see https://github.com/zaxbysauce/opencode-swarm/issues/449
|
|
16
|
+
*/
|
|
17
|
+
import type { tool } from '@opencode-ai/plugin';
|
|
18
|
+
interface GetApprovedPlanResult {
|
|
19
|
+
success: boolean;
|
|
20
|
+
reason?: string;
|
|
21
|
+
approved_plan?: ApprovedPlanPayload;
|
|
22
|
+
current_plan?: CurrentPlanPayload | null;
|
|
23
|
+
drift_detected?: boolean | 'unknown';
|
|
24
|
+
current_plan_error?: string;
|
|
25
|
+
/** SHA-256 hex digest over {plan_id, gates} of the current QA gate profile,
|
|
26
|
+
* or null when no profile exists for this plan. Used by the critic to
|
|
27
|
+
* detect silent gate mutations post-approval. */
|
|
28
|
+
qa_profile_hash?: string | null;
|
|
29
|
+
}
|
|
30
|
+
interface ApprovedPlanPayload {
|
|
31
|
+
plan: unknown;
|
|
32
|
+
approval_metadata: Record<string, unknown> | undefined;
|
|
33
|
+
snapshot_seq: number;
|
|
34
|
+
snapshot_timestamp: string;
|
|
35
|
+
payload_hash: string;
|
|
36
|
+
/** The execution_profile from the approved snapshot, if any. */
|
|
37
|
+
execution_profile?: {
|
|
38
|
+
parallelization_enabled: boolean;
|
|
39
|
+
max_concurrent_tasks: number;
|
|
40
|
+
council_parallel: boolean;
|
|
41
|
+
locked: boolean;
|
|
42
|
+
} | null;
|
|
43
|
+
}
|
|
44
|
+
interface CurrentPlanPayload {
|
|
45
|
+
plan: unknown;
|
|
46
|
+
current_hash: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Core execution logic — exported for direct testing.
|
|
50
|
+
*/
|
|
51
|
+
export declare function executeGetApprovedPlan(args: {
|
|
52
|
+
summary_only?: boolean;
|
|
53
|
+
}, directory: string): Promise<GetApprovedPlanResult>;
|
|
54
|
+
export declare const get_approved_plan: ReturnType<typeof tool>;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool to retrieve the QA gate profile for the current plan.
|
|
3
|
+
*
|
|
4
|
+
* Read-only: derives plan_id from plan.json, then looks up the profile in the
|
|
5
|
+
* per-project DB. Returns the spec-level profile gates, lock state, and profile
|
|
6
|
+
* hash. Callers layering session overrides should combine with
|
|
7
|
+
* `getEffectiveGates` themselves — this tool intentionally returns the
|
|
8
|
+
* persisted/locked spec-level view.
|
|
9
|
+
*/
|
|
10
|
+
import type { tool } from '@opencode-ai/plugin';
|
|
11
|
+
interface GetQaGateProfileResult {
|
|
12
|
+
success: boolean;
|
|
13
|
+
reason?: string;
|
|
14
|
+
plan_id?: string;
|
|
15
|
+
profile?: {
|
|
16
|
+
plan_id: string;
|
|
17
|
+
project_type: string | null;
|
|
18
|
+
gates: Record<string, boolean>;
|
|
19
|
+
locked_at: string | null;
|
|
20
|
+
locked_by_snapshot_seq: number | null;
|
|
21
|
+
created_at: string;
|
|
22
|
+
profile_hash: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare function executeGetQaGateProfile(_args: Record<string, unknown>, directory: string): Promise<GetQaGateProfileResult>;
|
|
26
|
+
export declare const get_qa_gate_profile: ReturnType<typeof tool>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createSwarmTool } from './create-tool';
|
|
2
|
+
export interface GitingestArgs {
|
|
3
|
+
url: string;
|
|
4
|
+
maxFileSize?: number;
|
|
5
|
+
pattern?: string;
|
|
6
|
+
patternType?: 'include' | 'exclude';
|
|
7
|
+
}
|
|
8
|
+
export declare const GITINGEST_TIMEOUT_MS = 10000;
|
|
9
|
+
export declare const GITINGEST_MAX_RESPONSE_BYTES = 5242880;
|
|
10
|
+
export declare const GITINGEST_MAX_RETRIES = 2;
|
|
11
|
+
/**
|
|
12
|
+
* Fetch repository content via gitingest.com API with timeout, size guard, and retry logic
|
|
13
|
+
*/
|
|
14
|
+
export declare function fetchGitingest(args: GitingestArgs): Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Gitingest tool for fetching GitHub repository contents
|
|
17
|
+
*/
|
|
18
|
+
export declare const gitingest: ReturnType<typeof createSwarmTool>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export { batch_symbols } from './batch-symbols';
|
|
2
|
+
export { build_check } from './build-check';
|
|
3
|
+
export { check_gate_status } from './check-gate-status';
|
|
4
|
+
export { checkpoint } from './checkpoint';
|
|
5
|
+
export { co_change_analyzer } from './co-change-analyzer';
|
|
6
|
+
export { completion_verify } from './completion-verify';
|
|
7
|
+
export { complexity_hotspots } from './complexity-hotspots';
|
|
8
|
+
export { submit_council_verdicts } from './convene-council';
|
|
9
|
+
export { convene_general_council } from './convene-general-council';
|
|
10
|
+
export { curator_analyze } from './curator-analyze';
|
|
11
|
+
export { declare_council_criteria } from './declare-council-criteria';
|
|
12
|
+
export { declare_scope } from './declare-scope';
|
|
13
|
+
export { type DiffErrorResult, type DiffResult, diff } from './diff';
|
|
14
|
+
export { diff_summary } from './diff-summary';
|
|
15
|
+
export { doc_extract, doc_scan } from './doc-scan';
|
|
16
|
+
export { detect_domains } from './domain-detector';
|
|
17
|
+
export { evidence_check } from './evidence-check';
|
|
18
|
+
export { extract_code_blocks } from './file-extractor';
|
|
19
|
+
export { get_approved_plan } from './get-approved-plan';
|
|
20
|
+
export { get_qa_gate_profile } from './get-qa-gate-profile';
|
|
21
|
+
export { fetchGitingest, type GitingestArgs, gitingest } from './gitingest';
|
|
22
|
+
export { imports } from './imports';
|
|
23
|
+
export { knowledge_add } from './knowledge-add';
|
|
24
|
+
export { knowledge_query } from './knowledge-query';
|
|
25
|
+
export { knowledge_recall } from './knowledge-recall';
|
|
26
|
+
export { knowledge_remove } from './knowledge-remove';
|
|
27
|
+
export { lint } from './lint';
|
|
28
|
+
export { phase_complete } from './phase-complete';
|
|
29
|
+
export { pkg_audit } from './pkg-audit';
|
|
30
|
+
export { type PlaceholderFinding, type PlaceholderScanInput, type PlaceholderScanResult, placeholder_scan, placeholderScan, } from './placeholder-scan';
|
|
31
|
+
export { type PreCheckBatchInput, type PreCheckBatchResult, pre_check_batch, runPreCheckBatch, type ToolResult, } from './pre-check-batch';
|
|
32
|
+
export { type QualityBudgetInput, type QualityBudgetResult, quality_budget, qualityBudget, } from './quality-budget';
|
|
33
|
+
export { buildWorkspaceGraph, type GraphEdge, type GraphNode, loadGraph, loadOrCreateGraph, type RepoGraph, resolveModuleSpecifier, saveGraph, updateGraphForFiles, } from './repo-graph';
|
|
34
|
+
export { repo_map } from './repo-map';
|
|
35
|
+
export { req_coverage } from './req-coverage';
|
|
36
|
+
export { retrieve_summary } from './retrieve-summary';
|
|
37
|
+
export { type SastScanFinding, type SastScanInput, type SastScanResult, sast_scan, sastScan, } from './sast-scan';
|
|
38
|
+
export type { SavePlanArgs, SavePlanResult } from './save-plan';
|
|
39
|
+
export { save_plan } from './save-plan';
|
|
40
|
+
export { type SbomGenerateInput, type SbomGenerateResult, sbom_generate, } from './sbom-generate';
|
|
41
|
+
export { schema_drift } from './schema-drift';
|
|
42
|
+
export { search } from './search';
|
|
43
|
+
export { type SecretFinding, type SecretscanResult, secretscan, } from './secretscan';
|
|
44
|
+
export { set_qa_gates } from './set-qa-gates';
|
|
45
|
+
import { suggestPatch } from './suggest-patch';
|
|
46
|
+
export { suggestPatch };
|
|
47
|
+
export type { SuggestPatchArgs } from './suggest-patch';
|
|
48
|
+
export declare const suggest_patch: typeof suggestPatch;
|
|
49
|
+
export type { ClassifiedFailure, FailureClassification, FailureCluster, } from '../test-impact/failure-classifier.js';
|
|
50
|
+
export { classifyAndCluster, classifyFailure, clusterFailures, } from '../test-impact/failure-classifier.js';
|
|
51
|
+
export type { FlakyTestEntry } from '../test-impact/flaky-detector.js';
|
|
52
|
+
export { computeFlakyScore, detectFlakyTests, isTestQuarantined, } from '../test-impact/flaky-detector.js';
|
|
53
|
+
export { generate_mutants } from './generate-mutants';
|
|
54
|
+
export { lint_spec } from './lint-spec';
|
|
55
|
+
export { mutation_test } from './mutation-test';
|
|
56
|
+
export { symbols } from './symbols';
|
|
57
|
+
export { type SyntaxCheckFileResult, type SyntaxCheckInput, type SyntaxCheckResult, syntax_check, syntaxCheck, } from './syntax-check';
|
|
58
|
+
export { test_impact } from './test-impact';
|
|
59
|
+
export { test_runner } from './test-runner';
|
|
60
|
+
export { todo_extract } from './todo-extract';
|
|
61
|
+
export { executeUpdateTaskStatus, type UpdateTaskStatusArgs, type UpdateTaskStatusResult, update_task_status, } from './update-task-status';
|
|
62
|
+
export { web_search } from './web-search';
|
|
63
|
+
export { write_drift_evidence } from './write-drift-evidence';
|
|
64
|
+
export { write_hallucination_evidence } from './write-hallucination-evidence';
|
|
65
|
+
export { write_mutation_evidence } from './write-mutation-evidence';
|
|
66
|
+
export { executeWriteRetro, write_retro } from './write-retro';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { tool } from '@opencode-ai/plugin';
|
|
2
|
+
export declare const MAX_OUTPUT_BYTES = 512000;
|
|
3
|
+
export declare const MAX_COMMAND_LENGTH = 500;
|
|
4
|
+
export declare const SUPPORTED_LINTERS: readonly ["biome", "eslint"];
|
|
5
|
+
export type SupportedLinter = (typeof SUPPORTED_LINTERS)[number];
|
|
6
|
+
export type AdditionalLinter = 'ruff' | 'clippy' | 'golangci-lint' | 'checkstyle' | 'ktlint' | 'dotnet-format' | 'cppcheck' | 'swiftlint' | 'dart-analyze' | 'rubocop';
|
|
7
|
+
export interface LintSuccessResult {
|
|
8
|
+
success: true;
|
|
9
|
+
mode: 'fix' | 'check';
|
|
10
|
+
linter: SupportedLinter | AdditionalLinter;
|
|
11
|
+
command: string[];
|
|
12
|
+
exitCode: number;
|
|
13
|
+
output: string;
|
|
14
|
+
message?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface LintErrorResult {
|
|
17
|
+
success: false;
|
|
18
|
+
mode: 'fix' | 'check';
|
|
19
|
+
linter?: SupportedLinter | AdditionalLinter;
|
|
20
|
+
command?: string[];
|
|
21
|
+
exitCode?: number;
|
|
22
|
+
output?: string;
|
|
23
|
+
error: string;
|
|
24
|
+
message?: string;
|
|
25
|
+
}
|
|
26
|
+
export type LintResult = LintSuccessResult | LintErrorResult;
|
|
27
|
+
export { containsControlChars, containsPathTraversal, } from '../utils/path-security';
|
|
28
|
+
export declare function validateArgs(args: unknown): args is {
|
|
29
|
+
mode: 'fix' | 'check';
|
|
30
|
+
};
|
|
31
|
+
export declare function getLinterCommand(linter: SupportedLinter, mode: 'fix' | 'check', projectDir: string): string[];
|
|
32
|
+
/**
|
|
33
|
+
* Build the shell command for an additional (non-JS/TS) linter.
|
|
34
|
+
* cppcheck has no --fix mode; csharp and some others behave differently.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getAdditionalLinterCommand(linter: AdditionalLinter, mode: 'fix' | 'check', cwd: string): string[];
|
|
37
|
+
/**
|
|
38
|
+
* Detect the first available additional (non-JS/TS) linter for the current project.
|
|
39
|
+
* Returns null when no additional linter is detected or its binary is unavailable.
|
|
40
|
+
*/
|
|
41
|
+
export declare function detectAdditionalLinter(cwd: string): 'ruff' | 'clippy' | 'golangci-lint' | 'checkstyle' | 'ktlint' | 'dotnet-format' | 'cppcheck' | 'swiftlint' | 'dart-analyze' | 'rubocop' | null;
|
|
42
|
+
/** Compute the local biome binary path for a given project directory. */
|
|
43
|
+
export declare function getBiomeBinPath(directory: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve the binary path for a linter, using the same hierarchy as detectAvailableLinter:
|
|
46
|
+
* 1. Local node_modules/.bin
|
|
47
|
+
* 2. Ancestor node_modules/.bin (monorepo)
|
|
48
|
+
* 3. process.env.PATH scan
|
|
49
|
+
* 4. Local path as fallback (may not exist)
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveLinterBinPath(linter: SupportedLinter, projectDir: string): string;
|
|
52
|
+
/** Compute the local eslint binary path for a given project directory. */
|
|
53
|
+
export declare function getEslintBinPath(directory: string): string;
|
|
54
|
+
export declare function detectAvailableLinter(directory?: string): Promise<SupportedLinter | null>;
|
|
55
|
+
/** Internal implementation — accepts pre-computed binary paths for testability. */
|
|
56
|
+
export declare function _detectAvailableLinter(_projectDir: string, biomeBin: string, eslintBin: string): Promise<SupportedLinter | null>;
|
|
57
|
+
export declare function runLint(linter: SupportedLinter, mode: 'fix' | 'check', directory: string): Promise<LintResult>;
|
|
58
|
+
/**
|
|
59
|
+
* Run an additional (non-JS/TS) linter.
|
|
60
|
+
* Follows the same structure as runLint() but uses getAdditionalLinterCommand().
|
|
61
|
+
*/
|
|
62
|
+
export declare function runAdditionalLint(linter: AdditionalLinter, mode: 'fix' | 'check', cwd: string): Promise<LintResult>;
|
|
63
|
+
export declare const lint: ReturnType<typeof tool>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase completion tool for tracking and validating phase completion.
|
|
3
|
+
* Core implementation - gathers data, enforces policy, writes event, resets state.
|
|
4
|
+
*/
|
|
5
|
+
import type { ToolDefinition } from '@opencode-ai/plugin/tool';
|
|
6
|
+
/**
|
|
7
|
+
* Arguments for the phase_complete tool
|
|
8
|
+
*/
|
|
9
|
+
export interface PhaseCompleteArgs {
|
|
10
|
+
/** The phase number being completed */
|
|
11
|
+
phase: number;
|
|
12
|
+
/** Optional summary of the phase */
|
|
13
|
+
summary?: string;
|
|
14
|
+
/** Session ID to track state (optional, defaults to current session context) */
|
|
15
|
+
sessionID?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Execute the phase_complete tool
|
|
19
|
+
* Gathers data, enforces policy, writes event, resets state
|
|
20
|
+
*/
|
|
21
|
+
export declare function executePhaseComplete(args: PhaseCompleteArgs, workingDirectory?: string, directory?: string): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Tool definition for phase_complete
|
|
24
|
+
*/
|
|
25
|
+
export declare const phase_complete: ToolDefinition;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { tool } from '@opencode-ai/plugin';
|
|
2
|
+
import type { EvidenceVerdict } from '../config/evidence-schema';
|
|
3
|
+
export interface PlaceholderScanInput {
|
|
4
|
+
changed_files: string[];
|
|
5
|
+
allow_globs?: string[];
|
|
6
|
+
deny_patterns?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface PlaceholderFinding {
|
|
9
|
+
path: string;
|
|
10
|
+
line: number;
|
|
11
|
+
kind: 'comment' | 'string' | 'function_body' | 'other';
|
|
12
|
+
excerpt: string;
|
|
13
|
+
rule_id: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PlaceholderScanResult {
|
|
16
|
+
verdict: EvidenceVerdict;
|
|
17
|
+
findings: PlaceholderFinding[];
|
|
18
|
+
summary: {
|
|
19
|
+
files_scanned: number;
|
|
20
|
+
findings_count: number;
|
|
21
|
+
files_with_findings: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Scan files for placeholder content (TODO/FIXME comments, stub implementations, etc.)
|
|
26
|
+
*/
|
|
27
|
+
export declare function placeholderScan(input: PlaceholderScanInput, directory: string): Promise<PlaceholderScanResult>;
|
|
28
|
+
export declare const placeholder_scan: ReturnType<typeof tool>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pre-Check Batch Tool
|
|
3
|
+
* Runs 4 verification tools in parallel: lint, secretscan, sast-scan, quality-budget
|
|
4
|
+
* Returns unified result with gates_passed status
|
|
5
|
+
*/
|
|
6
|
+
import type { tool } from '@opencode-ai/plugin';
|
|
7
|
+
import type { PluginConfig } from '../config';
|
|
8
|
+
import type { LintResult } from './lint';
|
|
9
|
+
import type { QualityBudgetResult } from './quality-budget';
|
|
10
|
+
import type { SastScanFinding, SastScanResult } from './sast-scan';
|
|
11
|
+
import type { SecretscanErrorResult, SecretscanResult } from './secretscan';
|
|
12
|
+
export interface PreCheckBatchInput {
|
|
13
|
+
/** List of specific files to check (optional) */
|
|
14
|
+
files?: string[];
|
|
15
|
+
/** Directory to scan */
|
|
16
|
+
directory: string;
|
|
17
|
+
/** SAST severity threshold (default: medium) */
|
|
18
|
+
sast_threshold?: 'low' | 'medium' | 'high' | 'critical';
|
|
19
|
+
/** Optional plugin config */
|
|
20
|
+
config?: PluginConfig;
|
|
21
|
+
/**
|
|
22
|
+
* Current phase number (positive integer >= 1).
|
|
23
|
+
* When provided, enables SAST baseline diffing: only findings absent from the
|
|
24
|
+
* phase-scoped baseline (.swarm/evidence/{phase}/sast-baseline.json) drive the
|
|
25
|
+
* fail verdict. Capture the baseline before first coder delegation via sast_scan
|
|
26
|
+
* with capture_baseline:true.
|
|
27
|
+
*/
|
|
28
|
+
phase?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface ToolResult<T> {
|
|
31
|
+
/** Whether the tool was executed */
|
|
32
|
+
ran: boolean;
|
|
33
|
+
/** Tool result if successful */
|
|
34
|
+
result?: T;
|
|
35
|
+
/** Error message if failed */
|
|
36
|
+
error?: string;
|
|
37
|
+
/** Duration in milliseconds */
|
|
38
|
+
duration_ms: number;
|
|
39
|
+
}
|
|
40
|
+
export interface PreCheckBatchResult {
|
|
41
|
+
/** Overall gate status: true if all security gates pass */
|
|
42
|
+
gates_passed: boolean;
|
|
43
|
+
/** Lint tool result */
|
|
44
|
+
lint: ToolResult<LintResult>;
|
|
45
|
+
/** Secretscan tool result */
|
|
46
|
+
secretscan: ToolResult<SecretscanResult | SecretscanErrorResult>;
|
|
47
|
+
/** SAST scan tool result */
|
|
48
|
+
sast_scan: ToolResult<SastScanResult>;
|
|
49
|
+
/** Quality budget tool result */
|
|
50
|
+
quality_budget: ToolResult<QualityBudgetResult>;
|
|
51
|
+
/** Total duration in milliseconds */
|
|
52
|
+
total_duration_ms: number;
|
|
53
|
+
/** Pre-existing SAST findings on unchanged lines, requiring reviewer triage */
|
|
54
|
+
sast_preexisting_findings?: SastScanFinding[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Parse unified diff output (with -U0) to extract added/modified line numbers per file.
|
|
58
|
+
* Returns a Map from normalised file path → Set of changed line numbers.
|
|
59
|
+
*/
|
|
60
|
+
export declare function parseDiffLineRanges(diffOutput: string): Map<string, Set<number>>;
|
|
61
|
+
/**
|
|
62
|
+
* Get changed line ranges for the current branch vs its base.
|
|
63
|
+
* Tries three strategies in order:
|
|
64
|
+
* 1. merge-base diff against main/master (captures all branch changes, works after commit)
|
|
65
|
+
* 2. HEAD~1 (single-commit diff, works after commit)
|
|
66
|
+
* 3. HEAD (unstaged/staged changes, works before commit)
|
|
67
|
+
* Returns null if git is unavailable or no changes found.
|
|
68
|
+
*/
|
|
69
|
+
export declare function getChangedLineRanges(directory: string): Promise<Map<string, Set<number>> | null>;
|
|
70
|
+
/**
|
|
71
|
+
* Classify SAST findings as "new" (on changed lines) or "pre-existing" (unchanged lines).
|
|
72
|
+
* A finding is "new" if its file+line intersects the changed line ranges from git diff.
|
|
73
|
+
* If line ranges cannot be determined (git unavailable), all findings are treated as new (fail-closed).
|
|
74
|
+
*/
|
|
75
|
+
export declare function classifySastFindings(findings: SastScanFinding[], changedLineRanges: Map<string, Set<number>> | null, directory: string): {
|
|
76
|
+
newFindings: SastScanFinding[];
|
|
77
|
+
preexistingFindings: SastScanFinding[];
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Run all 4 pre-check tools in parallel with concurrency limit
|
|
81
|
+
* @param input - The pre-check batch input
|
|
82
|
+
* @param workspaceDir - Optional workspace directory for traversal validation (defaults to directory param or process.cwd())
|
|
83
|
+
*/
|
|
84
|
+
export declare function runPreCheckBatch(input: PreCheckBatchInput, workspaceDir?: string, contextDir?: string): Promise<PreCheckBatchResult>;
|
|
85
|
+
/**
|
|
86
|
+
* Pre-check batch tool - runs 4 verification tools in parallel
|
|
87
|
+
* Returns unified result with gates_passed status
|
|
88
|
+
*/
|
|
89
|
+
export declare const pre_check_batch: ReturnType<typeof tool>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { tool } from '@opencode-ai/plugin';
|
|
2
|
+
import type { QualityBudgetConfig } from '../config/schema';
|
|
3
|
+
import { type QualityMetrics, type QualityViolation } from '../quality/metrics';
|
|
4
|
+
export interface QualityBudgetInput {
|
|
5
|
+
changed_files: string[];
|
|
6
|
+
config?: Partial<QualityBudgetConfig>;
|
|
7
|
+
}
|
|
8
|
+
export interface QualityBudgetResult {
|
|
9
|
+
verdict: 'pass' | 'fail';
|
|
10
|
+
metrics: QualityMetrics;
|
|
11
|
+
violations: QualityViolation[];
|
|
12
|
+
summary: {
|
|
13
|
+
files_analyzed: number;
|
|
14
|
+
violations_count: number;
|
|
15
|
+
errors_count: number;
|
|
16
|
+
warnings_count: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Quality budget tool - enforces maintainability budgets for changed files
|
|
21
|
+
*
|
|
22
|
+
* Computes quality metrics (complexity, API, duplication, test ratio)
|
|
23
|
+
* and compares against configured thresholds to ensure code quality.
|
|
24
|
+
*/
|
|
25
|
+
export declare function qualityBudget(input: QualityBudgetInput, directory: string): Promise<QualityBudgetResult>;
|
|
26
|
+
export declare const quality_budget: ReturnType<typeof tool>;
|