opencode-swarm 7.0.0-beta.1 → 7.0.1
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 +37 -0
- package/dist/cli/index.js +31346 -11426
- 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/{reset.d.ts → commands/reset.d.ts} +1 -1
- 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 +17 -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 +74690 -47646
- 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 +12 -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/{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,113 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ObligationSchema: z.ZodEnum<{
|
|
3
|
+
MUST: "MUST";
|
|
4
|
+
SHALL: "SHALL";
|
|
5
|
+
SHOULD: "SHOULD";
|
|
6
|
+
MAY: "MAY";
|
|
7
|
+
}>;
|
|
8
|
+
export type Obligation = z.infer<typeof ObligationSchema>;
|
|
9
|
+
export declare const SpecRequirementSchema: z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
obligation: z.ZodEnum<{
|
|
12
|
+
MUST: "MUST";
|
|
13
|
+
SHALL: "SHALL";
|
|
14
|
+
SHOULD: "SHOULD";
|
|
15
|
+
MAY: "MAY";
|
|
16
|
+
}>;
|
|
17
|
+
text: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type SpecRequirement = z.infer<typeof SpecRequirementSchema>;
|
|
20
|
+
export declare const SpecScenarioSchema: z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
given: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
23
|
+
when: z.ZodArray<z.ZodString>;
|
|
24
|
+
thenClauses: z.ZodArray<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type SpecScenario = z.infer<typeof SpecScenarioSchema>;
|
|
27
|
+
export declare const SpecSectionSchema: z.ZodObject<{
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
requirements: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
obligation: z.ZodEnum<{
|
|
32
|
+
MUST: "MUST";
|
|
33
|
+
SHALL: "SHALL";
|
|
34
|
+
SHOULD: "SHOULD";
|
|
35
|
+
MAY: "MAY";
|
|
36
|
+
}>;
|
|
37
|
+
text: z.ZodString;
|
|
38
|
+
}, z.core.$strip>>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type SpecSection = z.infer<typeof SpecSectionSchema>;
|
|
41
|
+
export declare const SwarmSpecSchema: z.ZodObject<{
|
|
42
|
+
title: z.ZodString;
|
|
43
|
+
purpose: z.ZodString;
|
|
44
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
requirements: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
47
|
+
id: z.ZodString;
|
|
48
|
+
obligation: z.ZodEnum<{
|
|
49
|
+
MUST: "MUST";
|
|
50
|
+
SHALL: "SHALL";
|
|
51
|
+
SHOULD: "SHOULD";
|
|
52
|
+
MAY: "MAY";
|
|
53
|
+
}>;
|
|
54
|
+
text: z.ZodString;
|
|
55
|
+
}, z.core.$strip>>>;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export type SwarmSpec = z.infer<typeof SwarmSpecSchema>;
|
|
59
|
+
export declare const SpecDeltaSchema: z.ZodObject<{
|
|
60
|
+
added: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
61
|
+
id: z.ZodString;
|
|
62
|
+
obligation: z.ZodEnum<{
|
|
63
|
+
MUST: "MUST";
|
|
64
|
+
SHALL: "SHALL";
|
|
65
|
+
SHOULD: "SHOULD";
|
|
66
|
+
MAY: "MAY";
|
|
67
|
+
}>;
|
|
68
|
+
text: z.ZodString;
|
|
69
|
+
}, z.core.$strip>>>;
|
|
70
|
+
modified: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
obligation: z.ZodEnum<{
|
|
73
|
+
MUST: "MUST";
|
|
74
|
+
SHALL: "SHALL";
|
|
75
|
+
SHOULD: "SHOULD";
|
|
76
|
+
MAY: "MAY";
|
|
77
|
+
}>;
|
|
78
|
+
text: z.ZodString;
|
|
79
|
+
}, z.core.$strip>>>;
|
|
80
|
+
removed: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
obligation: z.ZodEnum<{
|
|
83
|
+
MUST: "MUST";
|
|
84
|
+
SHALL: "SHALL";
|
|
85
|
+
SHOULD: "SHOULD";
|
|
86
|
+
MAY: "MAY";
|
|
87
|
+
}>;
|
|
88
|
+
text: z.ZodString;
|
|
89
|
+
}, z.core.$strip>>>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
export type SpecDelta = z.infer<typeof SpecDeltaSchema>;
|
|
92
|
+
export declare const DeltaSpecSchema: z.ZodType<SwarmSpec | SpecDelta>;
|
|
93
|
+
export type DeltaSpec = z.infer<typeof DeltaSpecSchema>;
|
|
94
|
+
interface ValidationIssue {
|
|
95
|
+
line: number;
|
|
96
|
+
message: string;
|
|
97
|
+
}
|
|
98
|
+
interface SpecContentValidationResult {
|
|
99
|
+
valid: boolean;
|
|
100
|
+
issues: ValidationIssue[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Validate raw markdown spec content using regex patterns.
|
|
104
|
+
* Checks for:
|
|
105
|
+
* - FR-### requirement IDs
|
|
106
|
+
* - Obligation keywords (MUST, SHALL, SHOULD, MAY)
|
|
107
|
+
* - Section headers (## Section Name)
|
|
108
|
+
*
|
|
109
|
+
* @param content - Raw markdown string to validate
|
|
110
|
+
* @returns Validation result with issues array
|
|
111
|
+
*/
|
|
112
|
+
export declare function validateSpecContent(content: string): SpecContentValidationResult;
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role-Scoped Context Injection Filter
|
|
3
|
+
* Filters context entries based on [FOR: ...] tags for role-based context delivery.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Context entry with role metadata
|
|
7
|
+
*/
|
|
8
|
+
export interface ContextEntry {
|
|
9
|
+
role: 'user' | 'assistant' | 'system';
|
|
10
|
+
content: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Filter context entries based on target role and [FOR: ...] tags.
|
|
15
|
+
*
|
|
16
|
+
* Filtering rules:
|
|
17
|
+
* - Entries with [FOR: ALL] are included for all agents
|
|
18
|
+
* - Entries with [FOR: specific_agents] are included only for named agents
|
|
19
|
+
* - Entries without [FOR: ...] tag are included for all agents (backward compatibility)
|
|
20
|
+
* - System prompts, delegation envelopes, plan content, and knowledge entries are never filtered
|
|
21
|
+
*
|
|
22
|
+
* @param entries - Array of context entries to filter
|
|
23
|
+
* @param targetRole - The target agent role to filter for
|
|
24
|
+
* @param directory - Optional project directory for metrics logging (defaults to cwd)
|
|
25
|
+
* @returns Filtered array of context entries
|
|
26
|
+
*/
|
|
27
|
+
export declare function filterByRole(entries: ContextEntry[], targetRole: string, directory?: string): ContextEntry[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type FileZone = 'production' | 'test' | 'config' | 'generated' | 'docs' | 'build';
|
|
2
|
+
export interface ZoneClassification {
|
|
3
|
+
filePath: string;
|
|
4
|
+
zone: FileZone;
|
|
5
|
+
confidence: 'high' | 'medium';
|
|
6
|
+
reason: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ZonePolicy {
|
|
9
|
+
qaDepth: 'full' | 'standard' | 'light' | 'skip';
|
|
10
|
+
lintRequired: boolean;
|
|
11
|
+
testRequired: boolean;
|
|
12
|
+
reviewRequired: boolean;
|
|
13
|
+
securityReviewRequired: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function classifyFile(filePath: string): ZoneClassification;
|
|
16
|
+
export declare function classifyFiles(filePaths: string[]): ZoneClassification[];
|
|
17
|
+
export declare function getZonePolicy(zone: FileZone): ZonePolicy;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work Complete Council — advisory routing helper.
|
|
3
|
+
*
|
|
4
|
+
* Purpose:
|
|
5
|
+
* Routes a CouncilSynthesis (unifiedFeedbackMd + verdict metadata) into the
|
|
6
|
+
* architect's non-blocking advisory queue (`session.pendingAdvisoryMessages`).
|
|
7
|
+
* The guardrails `messagesTransform` hook drains that queue into an
|
|
8
|
+
* [ADVISORIES] block prepended to the architect's first SYSTEM message on
|
|
9
|
+
* the next turn.
|
|
10
|
+
*
|
|
11
|
+
* Runtime call site:
|
|
12
|
+
* `src/tools/convene-council.ts` invokes this helper after writing evidence,
|
|
13
|
+
* guarded by `ctx?.sessionID` and `getAgentSession`. Missing session, missing
|
|
14
|
+
* sessionID, or any thrown error silently skip — the advisory is never
|
|
15
|
+
* critical-path. The helper is also re-exported for direct use by any future
|
|
16
|
+
* caller that wants to push synthesis output into an advisory queue.
|
|
17
|
+
*
|
|
18
|
+
* Scope and known limitation:
|
|
19
|
+
* The advisory queue is READ by the architect session on its next turn (self
|
|
20
|
+
* echo). It is NOT a programmatic architect→coder delivery channel — the
|
|
21
|
+
* architect still has to render `unifiedFeedbackMd` into the coder's
|
|
22
|
+
* delegation payload manually, per the prompt's four-phase workflow. A
|
|
23
|
+
* dedicated architect→coder advisory primitive is future work.
|
|
24
|
+
*
|
|
25
|
+
* Dedup semantics:
|
|
26
|
+
* Dedup key is `council:${taskId}:${roundNumber}`. If the queue already
|
|
27
|
+
* contains a string whose content includes that key, the push is a no-op.
|
|
28
|
+
* Different rounds or tasks push distinct entries.
|
|
29
|
+
*
|
|
30
|
+
* Blocking signal (metadata only):
|
|
31
|
+
* - REJECT → header declares `blocking=true`. Council vetoed the candidate.
|
|
32
|
+
* - CONCERNS→ `blocking=false`. Architect should weigh fixes but is not vetoed.
|
|
33
|
+
* - APPROVE → `blocking=false`. Helper skips push entirely when there are no
|
|
34
|
+
* advisoryFindings (nothing useful to surface).
|
|
35
|
+
*/
|
|
36
|
+
import type { AgentSessionState } from '../state';
|
|
37
|
+
import type { CouncilSynthesis } from './types';
|
|
38
|
+
/**
|
|
39
|
+
* Push a CouncilSynthesis into the given session's advisory queue so the
|
|
40
|
+
* architect will see it as an [ADVISORIES] block on the next messagesTransform.
|
|
41
|
+
*
|
|
42
|
+
* Idempotent per (taskId, roundNumber): repeated calls with the same key
|
|
43
|
+
* leave the queue unchanged. Safe to call on APPROVE — it is a no-op when
|
|
44
|
+
* there are no advisoryFindings.
|
|
45
|
+
*/
|
|
46
|
+
export declare function pushCouncilAdvisory(session: Pick<AgentSessionState, 'pendingAdvisoryMessages'>, synthesis: CouncilSynthesis): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work Complete Council — evidence writer.
|
|
3
|
+
*
|
|
4
|
+
* Stamps the council synthesis result into `.swarm/evidence/{taskId}.json`
|
|
5
|
+
* under `gates.council`, matching the shape other gate writers use and the
|
|
6
|
+
* shape that `check_gate_status` and `update_task_status` consume (they read
|
|
7
|
+
* `evidence.gates[gateName]`). Council-specific fields (verdict, vetoedBy,
|
|
8
|
+
* roundNumber, allCriteriaMet) are stored alongside the standard GateInfo
|
|
9
|
+
* fields (sessionId, timestamp, agent); existing consumers only check
|
|
10
|
+
* `gates.council != null`, so the extras are compatible.
|
|
11
|
+
*
|
|
12
|
+
* Existing fields in the evidence file — top-level keys AND other `gates[*]`
|
|
13
|
+
* entries — are preserved across the write. The raw taskId is used as the
|
|
14
|
+
* filename; defense-in-depth regex validation rejects malformed IDs before
|
|
15
|
+
* any filesystem op.
|
|
16
|
+
*/
|
|
17
|
+
import type { CouncilSynthesis } from './types';
|
|
18
|
+
export declare function writeCouncilEvidence(workingDir: string, synthesis: CouncilSynthesis): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work Complete Council — pure synthesis service.
|
|
3
|
+
*
|
|
4
|
+
* Given the verdicts of council members (critic, reviewer, sme, test_engineer),
|
|
5
|
+
* compute the overall verdict, classify findings, detect conflicts, and build a
|
|
6
|
+
* single unified feedback document for the coder.
|
|
7
|
+
*
|
|
8
|
+
* No I/O — fully unit-testable with mock inputs. All file reads/writes happen in
|
|
9
|
+
* sibling modules (criteria-store, council-evidence-writer).
|
|
10
|
+
*/
|
|
11
|
+
import type { CouncilConfig, CouncilCriteria, CouncilMemberVerdict, CouncilSynthesis, PhaseCouncilSynthesis } from './types';
|
|
12
|
+
export declare function synthesizeCouncilVerdicts(taskId: string, swarmId: string, verdicts: CouncilMemberVerdict[], criteria: CouncilCriteria | null, roundNumber: number, config?: Partial<CouncilConfig>): CouncilSynthesis;
|
|
13
|
+
/**
|
|
14
|
+
* Synthesize phase-level council verdicts into a PhaseCouncilSynthesis.
|
|
15
|
+
* Reuses the same veto detection, conflict detection, and finding
|
|
16
|
+
* classification logic as per-task council, but scoped to a phase number.
|
|
17
|
+
*
|
|
18
|
+
* Evidence is written to .swarm/evidence/{phase}/phase-council.json relative
|
|
19
|
+
* to workingDir (or cwd).
|
|
20
|
+
*/
|
|
21
|
+
export declare function synthesizePhaseCouncilAdvisory(phaseNumber: number, phaseSummary: string, verdicts: CouncilMemberVerdict[], roundNumber: number, config?: Partial<CouncilConfig>, workingDir?: string): PhaseCouncilSynthesis;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work Complete Council — pre-declaration criteria writer/reader.
|
|
3
|
+
*
|
|
4
|
+
* Stores acceptance criteria under .swarm/council/{safeId}.json so they can be
|
|
5
|
+
* read back during council evaluation.
|
|
6
|
+
*/
|
|
7
|
+
import type { CouncilCriteria, CouncilCriteriaItem } from './types';
|
|
8
|
+
export declare function writeCriteria(workingDir: string, taskId: string, criteria: CouncilCriteriaItem[]): void;
|
|
9
|
+
export declare function readCriteria(workingDir: string, taskId: string): CouncilCriteria | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disagreement detection for the General Council Mode.
|
|
3
|
+
*
|
|
4
|
+
* Pure function module — no I/O, no HTTP, deterministic. Takes Round 1 member
|
|
5
|
+
* responses, returns the set of factual disagreements that should be routed
|
|
6
|
+
* back to disputing members for Round 2 reconciliation.
|
|
7
|
+
*
|
|
8
|
+
* Two-pass detection:
|
|
9
|
+
* Pass 1 — Explicit linguistic markers ("I disagree with", "unlike", etc.)
|
|
10
|
+
* Pass 2 — Claim divergence heuristic (mutually exclusive recommendations)
|
|
11
|
+
*
|
|
12
|
+
* NSED design note (arXiv:2601.16863): only the disagreement delta is fed
|
|
13
|
+
* forward to Round 2, not full Round 1 context — mirrors the "semantic forget
|
|
14
|
+
* gate" selective-retention insight and keeps prompt sizes bounded.
|
|
15
|
+
*/
|
|
16
|
+
import type { GeneralCouncilDisagreement, GeneralCouncilMemberResponse } from './general-council-types.js';
|
|
17
|
+
/**
|
|
18
|
+
* Detect disagreements across Round 1 member responses.
|
|
19
|
+
*
|
|
20
|
+
* Returns at most MAX_DISAGREEMENTS items, deduplicated by topic. Pure function:
|
|
21
|
+
* given the same input, produces the same output. Empty inputs and missing
|
|
22
|
+
* fields are handled without throwing.
|
|
23
|
+
*/
|
|
24
|
+
export declare function detectDisagreements(responses: GeneralCouncilMemberResponse[]): GeneralCouncilDisagreement[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* General Council Mode — advisory routing helper.
|
|
3
|
+
*
|
|
4
|
+
* Sibling to ./council-advisory.ts (which is hard-typed to CouncilSynthesis
|
|
5
|
+
* for the verdict-based Work Complete Council). This helper accepts a
|
|
6
|
+
* GeneralCouncilResult and renders an advisory body the architect will see
|
|
7
|
+
* on its next turn via the standard pendingAdvisoryMessages → ADVISORIES
|
|
8
|
+
* messagesTransform flow.
|
|
9
|
+
*
|
|
10
|
+
* Design choices:
|
|
11
|
+
* - No dedup. The general council is user-triggered (`/swarm council ...`);
|
|
12
|
+
* a user asking the same question twice expects two advisories. The
|
|
13
|
+
* QA-council dedup-by-taskId-and-round semantic doesn't apply here —
|
|
14
|
+
* general council has no taskId.
|
|
15
|
+
* - No "blocking" header. The general council is advisory by definition.
|
|
16
|
+
* Use a clear visual marker so the architect distinguishes it from the
|
|
17
|
+
* QA council's blocking advisories.
|
|
18
|
+
*/
|
|
19
|
+
import type { AgentSessionState } from '../state';
|
|
20
|
+
import type { GeneralCouncilResult } from './general-council-types.js';
|
|
21
|
+
/**
|
|
22
|
+
* Push a GeneralCouncilResult into the architect's advisory queue. The body
|
|
23
|
+
* is the synthesis markdown plus the moderator output when present.
|
|
24
|
+
*
|
|
25
|
+
* Safe to call: missing session or empty advisory body silently skips.
|
|
26
|
+
* Always idempotent at the architect-prompt level (no duplicate-suppression
|
|
27
|
+
* here — see header comment for rationale).
|
|
28
|
+
*/
|
|
29
|
+
export declare function pushGeneralCouncilAdvisory(session: Pick<AgentSessionState, 'pendingAdvisoryMessages'>, result: GeneralCouncilResult): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* General Council Mode — pure synthesis service.
|
|
3
|
+
*
|
|
4
|
+
* No I/O, no HTTP. Takes completed member responses for all rounds and
|
|
5
|
+
* produces the final `GeneralCouncilResult`. Mirrors the design of
|
|
6
|
+
* `./council-service.ts` (synthesizeCouncilVerdicts).
|
|
7
|
+
*
|
|
8
|
+
* Quadratic Voting (NSED arXiv:2601.16863): consensus claims are weighted by
|
|
9
|
+
* member confidence rather than counted by headcount. A claim is a consensus
|
|
10
|
+
* point only when its weighted agreement exceeds 0.6 across members.
|
|
11
|
+
*
|
|
12
|
+
* MAINTAIN/CONCEDE/NUANCE protocol (ConfMAD): a Round 2 response with the
|
|
13
|
+
* CONCEDE keyword on a topic resolves the corresponding Round 1 disagreement;
|
|
14
|
+
* MAINTAIN leaves it persisting; NUANCE marks it persisting-with-boundary.
|
|
15
|
+
*/
|
|
16
|
+
import type { GeneralCouncilDeliberationResponse, GeneralCouncilMemberResponse, GeneralCouncilResult } from './general-council-types.js';
|
|
17
|
+
/**
|
|
18
|
+
* Pure synthesis. Given completed member responses, produces the final
|
|
19
|
+
* `GeneralCouncilResult` (without `moderatorOutput` — moderator is invoked
|
|
20
|
+
* by the architect after this returns and populated separately).
|
|
21
|
+
*/
|
|
22
|
+
export declare function synthesizeGeneralCouncil(question: string, mode: 'general' | 'spec_review', round1Responses: GeneralCouncilMemberResponse[], round2Responses: GeneralCouncilDeliberationResponse[]): GeneralCouncilResult;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* General Council Mode — data contracts.
|
|
3
|
+
*
|
|
4
|
+
* Distinct from the Work Complete Council (`./types.ts`). The general council
|
|
5
|
+
* is an advisory deliberation system: user-selected models each independently
|
|
6
|
+
* web-search and answer a question, then optionally engage in a single
|
|
7
|
+
* disagreement-targeted reconciliation round. A moderator agent synthesizes
|
|
8
|
+
* the final user-facing answer.
|
|
9
|
+
*
|
|
10
|
+
* No business logic, no I/O. Only types, interfaces, and defaults.
|
|
11
|
+
*/
|
|
12
|
+
export type GeneralCouncilMemberRole = 'generalist' | 'skeptic' | 'domain_expert' | 'devil_advocate' | 'synthesizer';
|
|
13
|
+
export interface WebSearchResult {
|
|
14
|
+
title: string;
|
|
15
|
+
url: string;
|
|
16
|
+
snippet: string;
|
|
17
|
+
query: string;
|
|
18
|
+
}
|
|
19
|
+
export interface GeneralCouncilMemberConfig {
|
|
20
|
+
memberId: string;
|
|
21
|
+
model: string;
|
|
22
|
+
role: GeneralCouncilMemberRole;
|
|
23
|
+
persona?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface GeneralCouncilMemberResponse {
|
|
26
|
+
memberId: string;
|
|
27
|
+
model: string;
|
|
28
|
+
role: GeneralCouncilMemberRole;
|
|
29
|
+
response: string;
|
|
30
|
+
sources: WebSearchResult[];
|
|
31
|
+
searchQueries: string[];
|
|
32
|
+
/** Self-reported confidence (0.0–1.0) — feeds Quadratic Voting weighted consensus */
|
|
33
|
+
confidence: number;
|
|
34
|
+
areasOfUncertainty: string[];
|
|
35
|
+
durationMs: number;
|
|
36
|
+
}
|
|
37
|
+
export interface GeneralCouncilDisagreementPosition {
|
|
38
|
+
memberId: string;
|
|
39
|
+
claim: string;
|
|
40
|
+
evidence: string;
|
|
41
|
+
}
|
|
42
|
+
export interface GeneralCouncilDisagreement {
|
|
43
|
+
topic: string;
|
|
44
|
+
positions: GeneralCouncilDisagreementPosition[];
|
|
45
|
+
}
|
|
46
|
+
export interface GeneralCouncilDeliberationResponse extends GeneralCouncilMemberResponse {
|
|
47
|
+
/** Topics the member addressed in Round 2 (subset of Round 1 disagreements). */
|
|
48
|
+
disagreementTopics: string[];
|
|
49
|
+
}
|
|
50
|
+
export interface GeneralCouncilResult {
|
|
51
|
+
question: string;
|
|
52
|
+
mode: 'general' | 'spec_review';
|
|
53
|
+
round1Responses: GeneralCouncilMemberResponse[];
|
|
54
|
+
disagreements: GeneralCouncilDisagreement[];
|
|
55
|
+
round2Responses: GeneralCouncilDeliberationResponse[];
|
|
56
|
+
/** Structural synthesis markdown (sections: consensus / disagreements / sources). */
|
|
57
|
+
synthesis: string;
|
|
58
|
+
consensusPoints: string[];
|
|
59
|
+
persistingDisagreements: string[];
|
|
60
|
+
allSources: WebSearchResult[];
|
|
61
|
+
/**
|
|
62
|
+
* Final moderator output (when council.general.moderator: true and a moderator
|
|
63
|
+
* model is configured). Populated by `convene-general-council.ts` after the
|
|
64
|
+
* architect delegates the moderator prompt to `council_moderator`. Undefined
|
|
65
|
+
* when no moderator pass is configured.
|
|
66
|
+
*/
|
|
67
|
+
moderatorOutput?: string;
|
|
68
|
+
timestamp: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Config shape — matched in schema.ts via GeneralCouncilConfigSchema.
|
|
72
|
+
*
|
|
73
|
+
* `enabled` defaults to false (feature gate). The moderator pass requires
|
|
74
|
+
* a configured `moderatorModel`; when set, the architect delegates the
|
|
75
|
+
* moderator prompt produced by `convene_general_council` to the dedicated
|
|
76
|
+
* `council_moderator` agent (no `web_search` access — synthesis only).
|
|
77
|
+
*/
|
|
78
|
+
export interface GeneralCouncilConfig {
|
|
79
|
+
enabled: boolean;
|
|
80
|
+
searchProvider: 'tavily' | 'brave';
|
|
81
|
+
/**
|
|
82
|
+
* Optional API key. When omitted, falls back to `TAVILY_API_KEY` or
|
|
83
|
+
* `BRAVE_SEARCH_API_KEY` env vars depending on `searchProvider`.
|
|
84
|
+
*/
|
|
85
|
+
searchApiKey?: string;
|
|
86
|
+
members: GeneralCouncilMemberConfig[];
|
|
87
|
+
/** Named groups of members for `/swarm council --preset <name>`. */
|
|
88
|
+
presets: Record<string, GeneralCouncilMemberConfig[]>;
|
|
89
|
+
/** When true, after Round 1 the architect routes disagreements back to disputing members. */
|
|
90
|
+
deliberate: boolean;
|
|
91
|
+
/** When true, the architect delegates a moderator pass to `council_moderator` after synthesis. */
|
|
92
|
+
moderator: boolean;
|
|
93
|
+
/** Required when `moderator: true` — model identifier for the council_moderator delegation. */
|
|
94
|
+
moderatorModel?: string;
|
|
95
|
+
/** Hard cap on results returned per member per search call (1–20). Defaults to 5. */
|
|
96
|
+
maxSourcesPerMember: number;
|
|
97
|
+
}
|
|
98
|
+
export declare const GENERAL_COUNCIL_DEFAULTS: GeneralCouncilConfig;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work Complete Council — data contracts.
|
|
3
|
+
*
|
|
4
|
+
* Flat, stable schema — no nested generics. Designed for reliable LLM output.
|
|
5
|
+
* No business logic, no I/O. Only types, interfaces, and defaults.
|
|
6
|
+
*/
|
|
7
|
+
export type CouncilVerdict = 'APPROVE' | 'CONCERNS' | 'REJECT';
|
|
8
|
+
export type CouncilFindingSeverity = 'HIGH' | 'MEDIUM' | 'LOW';
|
|
9
|
+
export type CouncilFindingCategory = 'logic' | 'edge_case' | 'error_handling' | 'spec_compliance' | 'security' | 'maintainability' | 'naming' | 'domain' | 'test_gap' | 'test_quality' | 'mutation_gap' | 'adversarial_gap' | 'slop_pattern' | 'hallucinated_api' | 'lazy_abstraction' | 'cargo_cult' | 'spec_drift' | 'other';
|
|
10
|
+
export type CouncilAgent = 'critic' | 'reviewer' | 'sme' | 'test_engineer' | 'explorer';
|
|
11
|
+
export interface CouncilFinding {
|
|
12
|
+
severity: CouncilFindingSeverity;
|
|
13
|
+
category: CouncilFindingCategory;
|
|
14
|
+
/** e.g. "src/tools/convene-council.ts:42" */
|
|
15
|
+
location: string;
|
|
16
|
+
/** Human-readable explanation */
|
|
17
|
+
detail: string;
|
|
18
|
+
/** Concrete quote or line reference */
|
|
19
|
+
evidence: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CouncilMemberVerdict {
|
|
22
|
+
agent: CouncilAgent;
|
|
23
|
+
verdict: CouncilVerdict;
|
|
24
|
+
/** Confidence 0.0–1.0 */
|
|
25
|
+
confidence: number;
|
|
26
|
+
findings: CouncilFinding[];
|
|
27
|
+
/** Criteria IDs from pre-declaration (e.g. ["C1","C3"]) */
|
|
28
|
+
criteriaAssessed: string[];
|
|
29
|
+
/** Criteria IDs that failed */
|
|
30
|
+
criteriaUnmet: string[];
|
|
31
|
+
durationMs: number;
|
|
32
|
+
}
|
|
33
|
+
export interface CouncilSynthesis {
|
|
34
|
+
taskId: string;
|
|
35
|
+
swarmId: string;
|
|
36
|
+
/** ISO 8601 */
|
|
37
|
+
timestamp: string;
|
|
38
|
+
overallVerdict: CouncilVerdict;
|
|
39
|
+
vetoedBy: CouncilAgent[] | null;
|
|
40
|
+
memberVerdicts: CouncilMemberVerdict[];
|
|
41
|
+
unresolvedConflicts: string[];
|
|
42
|
+
/** Severity HIGH + MEDIUM from veto members */
|
|
43
|
+
requiredFixes: CouncilFinding[];
|
|
44
|
+
/** Severity LOW or from non-veto members */
|
|
45
|
+
advisoryFindings: CouncilFinding[];
|
|
46
|
+
/** Single markdown document sent to coder */
|
|
47
|
+
unifiedFeedbackMd: string;
|
|
48
|
+
/** 1-indexed */
|
|
49
|
+
roundNumber: number;
|
|
50
|
+
allCriteriaMet: boolean;
|
|
51
|
+
/** Distinct council members that produced verdicts (deduplicated count). */
|
|
52
|
+
quorumSize: number;
|
|
53
|
+
/** true when called with an empty verdicts array — the APPROVE is vacuous */
|
|
54
|
+
emptyVerdictsWarning?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Phase-level council synthesis result.
|
|
58
|
+
* Distinct from CouncilSynthesis — scoped to a phase number
|
|
59
|
+
* rather than a task ID, and targets .swarm/evidence/{phase}/phase-council.json
|
|
60
|
+
* for evidence-file attestation.
|
|
61
|
+
*/
|
|
62
|
+
export interface PhaseCouncilSynthesis {
|
|
63
|
+
phaseNumber: number;
|
|
64
|
+
/** Always 'phase' — distinguishes from task-level council */
|
|
65
|
+
scope: 'phase';
|
|
66
|
+
/** ISO 8601 */
|
|
67
|
+
timestamp: string;
|
|
68
|
+
overallVerdict: CouncilVerdict;
|
|
69
|
+
vetoedBy: CouncilAgent[] | null;
|
|
70
|
+
memberVerdicts: CouncilMemberVerdict[];
|
|
71
|
+
unresolvedConflicts: string[];
|
|
72
|
+
/** Severity HIGH + MEDIUM from veto members */
|
|
73
|
+
requiredFixes: CouncilFinding[];
|
|
74
|
+
/** Severity LOW or from non-veto members */
|
|
75
|
+
advisoryFindings: CouncilFinding[];
|
|
76
|
+
/** Phase-level advisory notes for the architect */
|
|
77
|
+
advisoryNotes: string[];
|
|
78
|
+
/** Single markdown document for phase review */
|
|
79
|
+
unifiedFeedbackMd: string;
|
|
80
|
+
/** 1-indexed */
|
|
81
|
+
roundNumber: number;
|
|
82
|
+
allCriteriaMet: boolean;
|
|
83
|
+
/** Distinct council members that produced verdicts */
|
|
84
|
+
quorumSize: number;
|
|
85
|
+
/** Path where evidence was written, e.g. .swarm/evidence/1/phase-council.json */
|
|
86
|
+
evidencePath: string;
|
|
87
|
+
/** Summary of the phase being reviewed */
|
|
88
|
+
phaseSummary?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface CouncilCriteriaItem {
|
|
91
|
+
id: string;
|
|
92
|
+
description: string;
|
|
93
|
+
mandatory: boolean;
|
|
94
|
+
}
|
|
95
|
+
export interface CouncilCriteria {
|
|
96
|
+
taskId: string;
|
|
97
|
+
criteria: CouncilCriteriaItem[];
|
|
98
|
+
/** ISO 8601 */
|
|
99
|
+
declaredAt: string;
|
|
100
|
+
}
|
|
101
|
+
/** Config shape — matched in schema.ts via CouncilConfigSchema. */
|
|
102
|
+
export interface CouncilConfig {
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
/** Default 3 */
|
|
105
|
+
maxRounds: number;
|
|
106
|
+
/** Default 30_000 */
|
|
107
|
+
parallelTimeoutMs: number;
|
|
108
|
+
/** Default true — any REJECT blocks */
|
|
109
|
+
vetoPriority: boolean;
|
|
110
|
+
/** Default false — when true, submit_council_verdicts rejects unless all 5 member verdicts are provided */
|
|
111
|
+
requireAllMembers: boolean;
|
|
112
|
+
/** Default 3 — minimum distinct council members required for quorum. requireAllMembers: true overrides this to 5. */
|
|
113
|
+
minimumMembers: number;
|
|
114
|
+
/**
|
|
115
|
+
* Optional webhook URL or handler name for auto-escalation when maxRounds is
|
|
116
|
+
* reached without APPROVE. Reserved for forward compatibility — NOT yet
|
|
117
|
+
* implemented. Currently, maxRounds exhaustion surfaces a user-facing message
|
|
118
|
+
* via `buildUnifiedFeedbackMd` in council-service.ts (see the "Escalate to
|
|
119
|
+
* user" block), and the architect must relay it to the user. Future wiring
|
|
120
|
+
* options: critic_oversight agent, HTTP webhook, or configurable handler.
|
|
121
|
+
*/
|
|
122
|
+
escalateOnMaxRounds?: string;
|
|
123
|
+
/** Default true — CONCERNS verdict at phase-level council does NOT block completion (advisory). Set false to make CONCERNS block like REJECT. */
|
|
124
|
+
phaseConcernsAllowComplete: boolean;
|
|
125
|
+
}
|
|
126
|
+
export declare const COUNCIL_DEFAULTS: CouncilConfig;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web search provider abstraction for the General Council Mode.
|
|
3
|
+
*
|
|
4
|
+
* Two concrete providers (Tavily, Brave) plus a factory that selects one
|
|
5
|
+
* based on `GeneralCouncilConfig.searchProvider`. Pure HTTP layer — no tool
|
|
6
|
+
* wiring or prompt rendering. Uses the native `fetch` API (Bun-compatible);
|
|
7
|
+
* no external HTTP libraries.
|
|
8
|
+
*
|
|
9
|
+
* Errors are surfaced as typed exceptions:
|
|
10
|
+
* - WebSearchConfigError — missing API key (factory)
|
|
11
|
+
* - WebSearchError — HTTP failure (4xx/5xx, network, timeout)
|
|
12
|
+
* Malformed but successful responses produce an empty result array, never throw.
|
|
13
|
+
*/
|
|
14
|
+
import type { GeneralCouncilConfig, WebSearchResult } from './general-council-types.js';
|
|
15
|
+
export declare class WebSearchError extends Error {
|
|
16
|
+
readonly cause?: unknown | undefined;
|
|
17
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
18
|
+
}
|
|
19
|
+
export declare class WebSearchConfigError extends Error {
|
|
20
|
+
constructor(message: string);
|
|
21
|
+
}
|
|
22
|
+
export interface WebSearchProvider {
|
|
23
|
+
search(query: string, maxResults: number): Promise<WebSearchResult[]>;
|
|
24
|
+
}
|
|
25
|
+
export declare class TavilyProvider implements WebSearchProvider {
|
|
26
|
+
private readonly apiKey;
|
|
27
|
+
constructor(apiKey: string);
|
|
28
|
+
search(query: string, maxResults: number): Promise<WebSearchResult[]>;
|
|
29
|
+
}
|
|
30
|
+
export declare class BraveProvider implements WebSearchProvider {
|
|
31
|
+
private readonly apiKey;
|
|
32
|
+
constructor(apiKey: string);
|
|
33
|
+
search(query: string, maxResults: number): Promise<WebSearchResult[]>;
|
|
34
|
+
}
|
|
35
|
+
export declare function createWebSearchProvider(config: GeneralCouncilConfig): WebSearchProvider;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global SQLite database singleton for opencode-swarm.
|
|
3
|
+
*
|
|
4
|
+
* Owns `global-rules.db` in the platform config directory. Stores cross-project
|
|
5
|
+
* rules and agent prompt sections. Per-project QA gate profiles live in the
|
|
6
|
+
* project DB (see `./project-db.ts`), not here.
|
|
7
|
+
*/
|
|
8
|
+
import type { Database } from 'bun:sqlite';
|
|
9
|
+
/**
|
|
10
|
+
* Run all pending migrations on the provided database.
|
|
11
|
+
* Idempotent: existing migrations are not re-applied.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runGlobalMigrations(db: Database): void;
|
|
14
|
+
/**
|
|
15
|
+
* Return the process-wide singleton global database, creating it on first call.
|
|
16
|
+
* Directory is created if it does not exist. WAL mode is enabled immediately.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getGlobalDb(): Database;
|
|
19
|
+
/**
|
|
20
|
+
* Close and clear the global database singleton. Test-only.
|
|
21
|
+
*/
|
|
22
|
+
export declare function closeGlobalDb(): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel re-exports for the opencode-swarm SQLite database layer.
|
|
3
|
+
*
|
|
4
|
+
* - `global-db`: process-wide singleton for cross-project rules and
|
|
5
|
+
* agent prompt sections (`global-rules.db` in the platform config dir).
|
|
6
|
+
* - `project-db`: per-project database cache (`.swarm/swarm.db`), keyed by
|
|
7
|
+
* normalized directory path.
|
|
8
|
+
* - `qa-gate-profile`: service layer for per-plan QA gate profiles stored
|
|
9
|
+
* in the project DB.
|
|
10
|
+
*/
|
|
11
|
+
export { closeGlobalDb, getGlobalDb, runGlobalMigrations, } from './global-db.js';
|
|
12
|
+
export { closeAllProjectDbs, closeProjectDb, getProjectDb, projectDbExists, projectDbPath, runProjectMigrations, } from './project-db.js';
|
|
13
|
+
export { computeProfileHash, DEFAULT_QA_GATES, getEffectiveGates, getOrCreateProfile, getProfile, lockProfile, type QaGateProfile, type QaGates, setGates, } from './qa-gate-profile.js';
|