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,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passive Status Artifact Writer
|
|
3
|
+
*
|
|
4
|
+
* Writes automation status snapshots to .swarm/ for GUI visibility.
|
|
5
|
+
* Provides passive, read-only status information without affecting workflow.
|
|
6
|
+
*/
|
|
7
|
+
/** Automation status snapshot structure */
|
|
8
|
+
export interface AutomationStatusSnapshot {
|
|
9
|
+
/** When this snapshot was generated */
|
|
10
|
+
timestamp: number;
|
|
11
|
+
/** Current automation mode */
|
|
12
|
+
mode: 'manual' | 'hybrid' | 'auto';
|
|
13
|
+
/** Whether automation is enabled */
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
/** Current phase */
|
|
16
|
+
currentPhase: number;
|
|
17
|
+
/** Last trigger information */
|
|
18
|
+
lastTrigger: {
|
|
19
|
+
triggeredAt: number | null;
|
|
20
|
+
triggeredPhase: number | null;
|
|
21
|
+
source: string | null;
|
|
22
|
+
reason: string | null;
|
|
23
|
+
} | null;
|
|
24
|
+
/** Pending actions count */
|
|
25
|
+
pendingActions: number;
|
|
26
|
+
/** Last outcome state */
|
|
27
|
+
lastOutcome: {
|
|
28
|
+
state: 'success' | 'failure' | 'skipped' | 'none';
|
|
29
|
+
phase: number | null;
|
|
30
|
+
outcomeAt: number | null;
|
|
31
|
+
message: string | null;
|
|
32
|
+
} | null;
|
|
33
|
+
/** Feature flags status */
|
|
34
|
+
capabilities: {
|
|
35
|
+
plan_sync: boolean;
|
|
36
|
+
phase_preflight: boolean;
|
|
37
|
+
config_doctor_on_startup: boolean;
|
|
38
|
+
config_doctor_autofix: boolean;
|
|
39
|
+
evidence_auto_summaries: boolean;
|
|
40
|
+
decision_drift_detection: boolean;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Automation Status Artifact Manager
|
|
45
|
+
*
|
|
46
|
+
* Writes passive status snapshots to .swarm/automation-status.json
|
|
47
|
+
*/
|
|
48
|
+
export declare class AutomationStatusArtifact {
|
|
49
|
+
private readonly swarmDir;
|
|
50
|
+
private readonly filename;
|
|
51
|
+
private currentSnapshot;
|
|
52
|
+
constructor(swarmDir: string, filename?: string);
|
|
53
|
+
/**
|
|
54
|
+
* Get the full path to the status file
|
|
55
|
+
*/
|
|
56
|
+
private getFilePath;
|
|
57
|
+
/**
|
|
58
|
+
* Load existing snapshot from disk
|
|
59
|
+
*/
|
|
60
|
+
load(): AutomationStatusSnapshot | null;
|
|
61
|
+
/**
|
|
62
|
+
* Write snapshot to disk
|
|
63
|
+
*/
|
|
64
|
+
private write;
|
|
65
|
+
/**
|
|
66
|
+
* Get current snapshot (in-memory)
|
|
67
|
+
*/
|
|
68
|
+
getSnapshot(): AutomationStatusSnapshot;
|
|
69
|
+
/**
|
|
70
|
+
* Read snapshot from disk (forces reload)
|
|
71
|
+
*/
|
|
72
|
+
read(): AutomationStatusSnapshot;
|
|
73
|
+
/**
|
|
74
|
+
* Update mode and capabilities
|
|
75
|
+
*/
|
|
76
|
+
updateConfig(mode: 'manual' | 'hybrid' | 'auto', capabilities: AutomationStatusSnapshot['capabilities']): void;
|
|
77
|
+
/**
|
|
78
|
+
* Update current phase
|
|
79
|
+
*/
|
|
80
|
+
updatePhase(phase: number): void;
|
|
81
|
+
/**
|
|
82
|
+
* Record a trigger event
|
|
83
|
+
*/
|
|
84
|
+
recordTrigger(triggeredAt: number, triggeredPhase: number, source: string, reason: string): void;
|
|
85
|
+
/**
|
|
86
|
+
* Update pending actions count
|
|
87
|
+
*/
|
|
88
|
+
updatePendingActions(count: number): void;
|
|
89
|
+
/**
|
|
90
|
+
* Record an outcome
|
|
91
|
+
*/
|
|
92
|
+
recordOutcome(state: 'success' | 'failure' | 'skipped', phase: number, message?: string): void;
|
|
93
|
+
/**
|
|
94
|
+
* Clear the last outcome (reset to none)
|
|
95
|
+
*/
|
|
96
|
+
clearOutcome(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Check if automation is enabled (mode != manual)
|
|
99
|
+
*/
|
|
100
|
+
isEnabled(): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Check if a specific capability is enabled
|
|
103
|
+
*/
|
|
104
|
+
hasCapability(capability: keyof AutomationStatusSnapshot['capabilities']): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Get summary for GUI display
|
|
107
|
+
*/
|
|
108
|
+
getGuiSummary(): {
|
|
109
|
+
status: string;
|
|
110
|
+
phase: number;
|
|
111
|
+
lastTrigger: string | null;
|
|
112
|
+
pending: number;
|
|
113
|
+
outcome: string | null;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase-Boundary Preflight Trigger
|
|
3
|
+
*
|
|
4
|
+
* Detects phase-boundary conditions and triggers preflight requests.
|
|
5
|
+
* Manages phase transitions and queues preflight checks via the automation event bus.
|
|
6
|
+
*/
|
|
7
|
+
import type { AutomationConfig } from '../config/schema';
|
|
8
|
+
import { type AutomationEventBus } from './event-bus';
|
|
9
|
+
/** Event types for preflight triggers */
|
|
10
|
+
export type PreflightTriggerEventType = 'preflight.requested' | 'preflight.triggered' | 'preflight.skipped' | 'phase.boundary.detected';
|
|
11
|
+
/** Preflight trigger payload */
|
|
12
|
+
export interface PreflightRequestPayload {
|
|
13
|
+
triggerSource: 'phase_boundary' | 'manual' | 'scheduled';
|
|
14
|
+
currentPhase: number;
|
|
15
|
+
reason: string;
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
/** Phase boundary detection result */
|
|
19
|
+
export interface PhaseBoundaryResult {
|
|
20
|
+
detected: boolean;
|
|
21
|
+
previousPhase: number;
|
|
22
|
+
currentPhase: number;
|
|
23
|
+
reason: string;
|
|
24
|
+
completedTaskCount: number;
|
|
25
|
+
totalTaskCount: number;
|
|
26
|
+
}
|
|
27
|
+
/** Preflight trigger configuration */
|
|
28
|
+
export interface PreflightTriggerConfig {
|
|
29
|
+
/** Minimum tasks that must be completed in a phase to trigger */
|
|
30
|
+
minCompletedTasksThreshold?: number;
|
|
31
|
+
/** Enable trigger even if no tasks (phase auto-complete mode) */
|
|
32
|
+
allowZeroTaskTrigger?: boolean;
|
|
33
|
+
/** Directory to run preflight checks in */
|
|
34
|
+
directory?: string;
|
|
35
|
+
}
|
|
36
|
+
/** Preflight handler type */
|
|
37
|
+
export type PreflightHandler = (request: PreflightRequest) => Promise<void>;
|
|
38
|
+
/** Preflight request queue item */
|
|
39
|
+
export interface PreflightRequest {
|
|
40
|
+
id: string;
|
|
41
|
+
triggeredAt: number;
|
|
42
|
+
currentPhase: number;
|
|
43
|
+
source: 'phase_boundary' | 'manual' | 'scheduled';
|
|
44
|
+
reason: string;
|
|
45
|
+
metadata?: Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
/** Phase boundary detection result */
|
|
48
|
+
export interface PhaseBoundaryResult {
|
|
49
|
+
detected: boolean;
|
|
50
|
+
previousPhase: number;
|
|
51
|
+
currentPhase: number;
|
|
52
|
+
reason: string;
|
|
53
|
+
completedTaskCount: number;
|
|
54
|
+
totalTaskCount: number;
|
|
55
|
+
}
|
|
56
|
+
/** Preflight trigger configuration */
|
|
57
|
+
export interface PreflightTriggerConfig {
|
|
58
|
+
/** Minimum tasks that must be completed in a phase to trigger */
|
|
59
|
+
minCompletedTasksThreshold?: number;
|
|
60
|
+
/** Enable trigger even if no tasks (phase auto-complete mode) */
|
|
61
|
+
allowZeroTaskTrigger?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Phase-Boundary Trigger Detector
|
|
65
|
+
*
|
|
66
|
+
* Monitors plan state to detect when a phase transition occurs.
|
|
67
|
+
*/
|
|
68
|
+
export declare class PhaseBoundaryTrigger {
|
|
69
|
+
private readonly eventBus;
|
|
70
|
+
private readonly config;
|
|
71
|
+
private lastKnownPhase;
|
|
72
|
+
private lastTriggeredPhase;
|
|
73
|
+
constructor(eventBus?: AutomationEventBus, config?: PreflightTriggerConfig);
|
|
74
|
+
/**
|
|
75
|
+
* Set the current phase from external source (plan)
|
|
76
|
+
*/
|
|
77
|
+
setCurrentPhase(phase: number): void;
|
|
78
|
+
/**
|
|
79
|
+
* Get the last known phase
|
|
80
|
+
*/
|
|
81
|
+
getCurrentPhase(): number;
|
|
82
|
+
/**
|
|
83
|
+
* Get the last triggered phase (for external access)
|
|
84
|
+
*/
|
|
85
|
+
get lastTriggeredPhaseValue(): number;
|
|
86
|
+
/**
|
|
87
|
+
* Check if a phase boundary has been crossed
|
|
88
|
+
* Returns the result of the detection
|
|
89
|
+
*/
|
|
90
|
+
detectBoundary(newPhase: number, completedTasks: number, totalTasks: number): PhaseBoundaryResult;
|
|
91
|
+
/**
|
|
92
|
+
* Check if preflight should be triggered based on phase boundary
|
|
93
|
+
* Must be called AFTER phase boundary is detected
|
|
94
|
+
*/
|
|
95
|
+
shouldTriggerPreflight(boundaryResult: PhaseBoundaryResult): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Mark that preflight was triggered for a phase
|
|
98
|
+
*/
|
|
99
|
+
markTriggered(phase: number): void;
|
|
100
|
+
/**
|
|
101
|
+
* Reset trigger state (for testing)
|
|
102
|
+
*/
|
|
103
|
+
reset(): void;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Preflight Trigger Manager
|
|
107
|
+
*
|
|
108
|
+
* Orchestrates trigger detection, feature flag gating, and request publishing.
|
|
109
|
+
*/
|
|
110
|
+
export declare class PreflightTriggerManager {
|
|
111
|
+
private readonly automationConfig;
|
|
112
|
+
private readonly eventBus;
|
|
113
|
+
private readonly trigger;
|
|
114
|
+
private readonly requestQueue;
|
|
115
|
+
private requestCounter;
|
|
116
|
+
private preflightHandler;
|
|
117
|
+
private unsubscribe;
|
|
118
|
+
constructor(automationConfig: AutomationConfig, eventBus?: AutomationEventBus, triggerConfig?: PreflightTriggerConfig);
|
|
119
|
+
/**
|
|
120
|
+
* Check if preflight triggers are enabled via feature flags
|
|
121
|
+
* Returns false if config is missing/invalid (fail-safe)
|
|
122
|
+
*/
|
|
123
|
+
isEnabled(): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Get the automation mode
|
|
126
|
+
* Returns 'unknown' for malformed config (fail-safe)
|
|
127
|
+
*/
|
|
128
|
+
getMode(): string;
|
|
129
|
+
/**
|
|
130
|
+
* Update current phase from plan state
|
|
131
|
+
*/
|
|
132
|
+
updatePhase(phase: number): void;
|
|
133
|
+
/**
|
|
134
|
+
* Check for phase boundary and potentially trigger preflight
|
|
135
|
+
* Returns true if preflight was triggered
|
|
136
|
+
*/
|
|
137
|
+
checkAndTrigger(currentPhase: number, completedTasks: number, totalTasks: number): Promise<boolean>;
|
|
138
|
+
/**
|
|
139
|
+
* Trigger a preflight request
|
|
140
|
+
*/
|
|
141
|
+
private triggerPreflight;
|
|
142
|
+
/**
|
|
143
|
+
* Get pending preflight requests
|
|
144
|
+
*/
|
|
145
|
+
getPendingRequests(): PreflightRequest[];
|
|
146
|
+
/**
|
|
147
|
+
* Get queue size
|
|
148
|
+
*/
|
|
149
|
+
getQueueSize(): number;
|
|
150
|
+
/**
|
|
151
|
+
* Get trigger stats
|
|
152
|
+
* All values are fail-safe for malformed config
|
|
153
|
+
*/
|
|
154
|
+
getStats(): {
|
|
155
|
+
enabled: boolean;
|
|
156
|
+
mode: string;
|
|
157
|
+
currentPhase: number;
|
|
158
|
+
lastTriggeredPhase: number;
|
|
159
|
+
pendingRequests: number;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Reset state (for testing)
|
|
163
|
+
*/
|
|
164
|
+
reset(): void;
|
|
165
|
+
/**
|
|
166
|
+
* Register a handler to be called when preflight is requested.
|
|
167
|
+
* The handler will be invoked with the preflight request details.
|
|
168
|
+
* Only one handler can be registered at a time.
|
|
169
|
+
*/
|
|
170
|
+
registerHandler(handler: PreflightHandler): void;
|
|
171
|
+
/**
|
|
172
|
+
* Unregister the preflight handler
|
|
173
|
+
*/
|
|
174
|
+
unregisterHandler(): void;
|
|
175
|
+
/**
|
|
176
|
+
* Check if a handler is registered
|
|
177
|
+
*/
|
|
178
|
+
hasHandler(): boolean;
|
|
179
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker Lifecycle Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages worker threads for background automation.
|
|
5
|
+
* Handles registration, start/stop, and handler coordination.
|
|
6
|
+
*/
|
|
7
|
+
import type { AutomationQueue, QueueItem } from './queue';
|
|
8
|
+
/** Worker handler function */
|
|
9
|
+
export type WorkerHandler<T = unknown> = (item: QueueItem<T>) => Promise<{
|
|
10
|
+
success: boolean;
|
|
11
|
+
result?: unknown;
|
|
12
|
+
error?: unknown;
|
|
13
|
+
}>;
|
|
14
|
+
/** Worker registration options */
|
|
15
|
+
export interface WorkerRegistration {
|
|
16
|
+
name: string;
|
|
17
|
+
handler: WorkerHandler;
|
|
18
|
+
queue: AutomationQueue;
|
|
19
|
+
concurrency?: number;
|
|
20
|
+
autoStart?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Worker status */
|
|
23
|
+
export type WorkerStatus = 'idle' | 'running' | 'stopping' | 'stopped' | 'error';
|
|
24
|
+
/**
|
|
25
|
+
* Worker Lifecycle Manager
|
|
26
|
+
*
|
|
27
|
+
* Manages worker registration, lifecycle, and processing.
|
|
28
|
+
*/
|
|
29
|
+
export declare class WorkerManager {
|
|
30
|
+
private workers;
|
|
31
|
+
private readonly eventBus;
|
|
32
|
+
constructor();
|
|
33
|
+
/**
|
|
34
|
+
* Register a new worker
|
|
35
|
+
*/
|
|
36
|
+
register(registration: WorkerRegistration): void;
|
|
37
|
+
/**
|
|
38
|
+
* Unregister a worker
|
|
39
|
+
*/
|
|
40
|
+
unregister(name: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Start a worker
|
|
43
|
+
*/
|
|
44
|
+
start(name: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Start processing loop for a worker
|
|
47
|
+
*/
|
|
48
|
+
private startProcessingLoop;
|
|
49
|
+
/**
|
|
50
|
+
* Handle a single queue item
|
|
51
|
+
*/
|
|
52
|
+
private handleItem;
|
|
53
|
+
/**
|
|
54
|
+
* Stop a worker
|
|
55
|
+
*/
|
|
56
|
+
stop(name: string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Start all workers
|
|
59
|
+
*/
|
|
60
|
+
startAll(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Stop all workers
|
|
63
|
+
*/
|
|
64
|
+
stopAll(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Get worker status
|
|
67
|
+
*/
|
|
68
|
+
getStatus(name: string): WorkerStatus | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Get worker statistics
|
|
71
|
+
*/
|
|
72
|
+
getStats(name: string): {
|
|
73
|
+
status: WorkerStatus;
|
|
74
|
+
activeCount: number;
|
|
75
|
+
processedCount: number;
|
|
76
|
+
errorCount: number;
|
|
77
|
+
lastError?: unknown;
|
|
78
|
+
queueSize: number;
|
|
79
|
+
} | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Get all worker names
|
|
82
|
+
*/
|
|
83
|
+
getWorkerNames(): string[];
|
|
84
|
+
/**
|
|
85
|
+
* Check if any workers are running
|
|
86
|
+
*/
|
|
87
|
+
isAnyRunning(): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Get total statistics across all workers
|
|
90
|
+
*/
|
|
91
|
+
getTotalStats(): Record<string, ReturnType<WorkerManager['getStats']>>;
|
|
92
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
export declare function isSafeCachePath(p: string): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Safety guard for lock file deletion. Lock files have different basenames
|
|
5
|
+
* than cache directories so they need a separate check. Mirrors
|
|
6
|
+
* isSafeCachePath()'s defense-in-depth: minimum segment depth, recognized
|
|
7
|
+
* basename, and parent directory must be 'opencode'.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isSafeLockFilePath(p: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Recursively delete every known opencode plugin cache location for
|
|
12
|
+
* opencode-swarm. Returns paths actually cleared and paths that errored.
|
|
13
|
+
* Skips paths that don't exist or fail the safety guard.
|
|
14
|
+
*/
|
|
15
|
+
export declare function evictPluginCaches(): {
|
|
16
|
+
cleared: string[];
|
|
17
|
+
failed: string[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Delete every known opencode plugin lock file (bun.lock, bun.lockb,
|
|
21
|
+
* package-lock.json). Returns paths actually cleared and paths that
|
|
22
|
+
* errored. Skips paths that don't exist or fail the safety guard.
|
|
23
|
+
*
|
|
24
|
+
* Why: opencode runs `bun install` at startup; bun.lock pins the
|
|
25
|
+
* installed plugin version. Deleting the lock forces re-resolution
|
|
26
|
+
* from npm so users actually receive the @latest version after `update`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function evictLockFiles(): {
|
|
29
|
+
cleared: string[];
|
|
30
|
+
failed: string[];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Dispatch function for routing argv tokens to plugin command handlers.
|
|
34
|
+
* Used by the "run" subcommand entry point.
|
|
35
|
+
* Delegates to the unified COMMAND_REGISTRY via resolveCommand().
|
|
36
|
+
*/
|
|
37
|
+
export declare function run(args: string[]): Promise<number>;
|