opencode-swarm 6.27.0 → 7.0.0-beta.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.
Files changed (281) hide show
  1. package/README.md +40 -1179
  2. package/dist/{agents/architect.d.ts → architect.d.ts} +1 -5
  3. package/dist/checkpoint.d.ts +7 -0
  4. package/dist/cli/index.js +11353 -20907
  5. package/dist/co-change-analyzer.d.ts +1 -0
  6. package/dist/compat.d.ts +12 -0
  7. package/dist/config-doctor.d.ts +1 -0
  8. package/dist/{config/loader.d.ts → config.d.ts} +6 -11
  9. package/dist/detector.d.ts +7 -0
  10. package/dist/diagnose-service.d.ts +1 -0
  11. package/dist/evidence-schema.d.ts +2 -0
  12. package/dist/evidence-service.d.ts +1 -0
  13. package/dist/export-service.d.ts +1 -0
  14. package/dist/handoff-service.d.ts +1 -0
  15. package/dist/history-service.d.ts +1 -0
  16. package/dist/hive-promoter.d.ts +2 -0
  17. package/dist/index.d.ts +1 -15
  18. package/dist/index.js +48739 -47886
  19. package/dist/knowledge-migrator.d.ts +2 -0
  20. package/dist/knowledge-store.d.ts +1 -0
  21. package/dist/knowledge-types.d.ts +1 -0
  22. package/dist/knowledge-validator.d.ts +2 -0
  23. package/dist/loader.d.ts +1 -0
  24. package/dist/manager.d.ts +1 -0
  25. package/dist/models.d.ts +1 -0
  26. package/dist/plan-service.d.ts +1 -0
  27. package/dist/preflight-service.d.ts +1 -0
  28. package/dist/profiles.d.ts +7 -0
  29. package/dist/register.d.ts +36 -0
  30. package/dist/schema.d.ts +2 -0
  31. package/dist/snapshot-writer.d.ts +1 -0
  32. package/dist/state.d.ts +1 -292
  33. package/dist/status-service.d.ts +15 -0
  34. package/dist/telemetry/src/events.d.ts +308 -0
  35. package/dist/telemetry/src/guards.d.ts +14 -0
  36. package/dist/telemetry/src/index.d.ts +4 -0
  37. package/dist/telemetry/src/version.d.ts +1 -0
  38. package/dist/utils.d.ts +1 -0
  39. package/dist/write-retro.d.ts +1 -0
  40. package/package.json +12 -13
  41. package/LICENSE +0 -21
  42. package/dist/__tests__/security-adversarial.test.d.ts +0 -1
  43. package/dist/agents/architect-permission.adversarial.test.d.ts +0 -5
  44. package/dist/agents/architect.turbo-banner.test.d.ts +0 -1
  45. package/dist/agents/coder.d.ts +0 -2
  46. package/dist/agents/critic.d.ts +0 -3
  47. package/dist/agents/designer.d.ts +0 -2
  48. package/dist/agents/docs.d.ts +0 -2
  49. package/dist/agents/explorer.d.ts +0 -3
  50. package/dist/agents/index.d.ts +0 -27
  51. package/dist/agents/reviewer.d.ts +0 -5
  52. package/dist/agents/sme.d.ts +0 -2
  53. package/dist/agents/test-engineer.adversarial.test.d.ts +0 -5
  54. package/dist/agents/test-engineer.d.ts +0 -2
  55. package/dist/agents/test-engineer.security.test.d.ts +0 -1
  56. package/dist/background/circuit-breaker.d.ts +0 -149
  57. package/dist/background/event-bus.d.ts +0 -60
  58. package/dist/background/evidence-summary-integration.d.ts +0 -73
  59. package/dist/background/index.d.ts +0 -22
  60. package/dist/background/manager.d.ts +0 -122
  61. package/dist/background/plan-sync-worker.d.ts +0 -122
  62. package/dist/background/queue.d.ts +0 -117
  63. package/dist/background/status-artifact.d.ts +0 -115
  64. package/dist/background/trigger.d.ts +0 -179
  65. package/dist/background/trigger.vulnerability.test.d.ts +0 -1
  66. package/dist/background/worker.d.ts +0 -92
  67. package/dist/cli/index.d.ts +0 -6
  68. package/dist/commands/checkpoint.d.ts +0 -5
  69. package/dist/commands/command-adapters.security.test.d.ts +0 -14
  70. package/dist/commands/commands.test.d.ts +0 -1
  71. package/dist/commands/config.d.ts +0 -5
  72. package/dist/commands/curate.test.d.ts +0 -1
  73. package/dist/commands/index.d.ts +0 -39
  74. package/dist/commands/turbo-registration.test.d.ts +0 -5
  75. package/dist/commands/turbo-sessionid.test.d.ts +0 -5
  76. package/dist/commands/turbo.regression.test.d.ts +0 -11
  77. package/dist/commands/turbo.test.d.ts +0 -5
  78. package/dist/config/constants.architect-whitelist.test.d.ts +0 -1
  79. package/dist/config/constants.d.ts +0 -37
  80. package/dist/config/evidence-schema.d.ts +0 -1152
  81. package/dist/config/index.d.ts +0 -9
  82. package/dist/config/plan-schema.d.ts +0 -151
  83. package/dist/config/schema.d.ts +0 -700
  84. package/dist/context/role-filter.d.ts +0 -27
  85. package/dist/context/zone-classifier.d.ts +0 -17
  86. package/dist/diff/ast-diff.d.ts +0 -20
  87. package/dist/evidence/index.d.ts +0 -2
  88. package/dist/evidence/manager.d.ts +0 -74
  89. package/dist/gate-evidence.d.ts +0 -70
  90. package/dist/gate-evidence.test.d.ts +0 -1
  91. package/dist/git/branch.d.ts +0 -50
  92. package/dist/git/index.d.ts +0 -22
  93. package/dist/git/pr.d.ts +0 -28
  94. package/dist/hooks/adversarial-detector.d.ts +0 -34
  95. package/dist/hooks/agent-activity.d.ts +0 -38
  96. package/dist/hooks/co-change-suggester.d.ts +0 -51
  97. package/dist/hooks/compaction-customizer.d.ts +0 -11
  98. package/dist/hooks/context-budget.d.ts +0 -34
  99. package/dist/hooks/context-scoring.d.ts +0 -70
  100. package/dist/hooks/curator-drift.d.ts +0 -30
  101. package/dist/hooks/curator-types.d.ts +0 -99
  102. package/dist/hooks/curator.d.ts +0 -70
  103. package/dist/hooks/dark-matter-detector.d.ts +0 -38
  104. package/dist/hooks/delegation-gate.d.ts +0 -53
  105. package/dist/hooks/delegation-gate.evidence.test.d.ts +0 -4
  106. package/dist/hooks/delegation-gate.plan-fallback-security.test.d.ts +0 -13
  107. package/dist/hooks/delegation-gate.plan-fallback.test.d.ts +0 -5
  108. package/dist/hooks/delegation-gate.seed-state.test.d.ts +0 -1
  109. package/dist/hooks/delegation-gate.turbo-evidence.test.d.ts +0 -8
  110. package/dist/hooks/delegation-sanitizer.d.ts +0 -24
  111. package/dist/hooks/delegation-tracker.d.ts +0 -14
  112. package/dist/hooks/extractors.d.ts +0 -53
  113. package/dist/hooks/guardrails.d.ts +0 -73
  114. package/dist/hooks/hive-promoter.d.ts +0 -40
  115. package/dist/hooks/index.d.ts +0 -16
  116. package/dist/hooks/knowledge-curator.d.ts +0 -22
  117. package/dist/hooks/knowledge-injector.d.ts +0 -20
  118. package/dist/hooks/knowledge-migrator.d.ts +0 -10
  119. package/dist/hooks/knowledge-reader.d.ts +0 -22
  120. package/dist/hooks/knowledge-store.d.ts +0 -20
  121. package/dist/hooks/knowledge-types.d.ts +0 -117
  122. package/dist/hooks/knowledge-validator.d.ts +0 -28
  123. package/dist/hooks/message-priority.d.ts +0 -105
  124. package/dist/hooks/messages-transform.d.ts +0 -13
  125. package/dist/hooks/model-limits.d.ts +0 -96
  126. package/dist/hooks/phase-monitor.d.ts +0 -22
  127. package/dist/hooks/pipeline-tracker.d.ts +0 -41
  128. package/dist/hooks/steering-consumed.d.ts +0 -30
  129. package/dist/hooks/system-enhancer.d.ts +0 -30
  130. package/dist/hooks/tool-summarizer.d.ts +0 -28
  131. package/dist/hooks/utils.d.ts +0 -20
  132. package/dist/index.adversarial-bootstrap.test.d.ts +0 -1
  133. package/dist/index.bootstrap-adversarial.test.d.ts +0 -1
  134. package/dist/index.bootstrap-directory.test.d.ts +0 -1
  135. package/dist/knowledge/identity.d.ts +0 -25
  136. package/dist/knowledge/index.d.ts +0 -2
  137. package/dist/lang/detector.d.ts +0 -20
  138. package/dist/lang/grammars/tree-sitter-dart.wasm +0 -0
  139. package/dist/lang/grammars/tree-sitter-kotlin.wasm +0 -0
  140. package/dist/lang/grammars/tree-sitter-swift.wasm +0 -0
  141. package/dist/lang/index.d.ts +0 -4
  142. package/dist/lang/profiles.d.ts +0 -71
  143. package/dist/lang/registry.d.ts +0 -24
  144. package/dist/lang/runtime.d.ts +0 -35
  145. package/dist/output/agent-writer.d.ts +0 -27
  146. package/dist/output/index.d.ts +0 -1
  147. package/dist/parallel/dependency-graph.d.ts +0 -34
  148. package/dist/parallel/file-locks.d.ts +0 -33
  149. package/dist/parallel/index.d.ts +0 -4
  150. package/dist/parallel/meta-indexer.d.ts +0 -32
  151. package/dist/parallel/review-router.d.ts +0 -29
  152. package/dist/plan/index.d.ts +0 -1
  153. package/dist/plan/manager.d.ts +0 -40
  154. package/dist/plan/manager.update-task-status.test.d.ts +0 -1
  155. package/dist/quality/index.d.ts +0 -1
  156. package/dist/quality/metrics.d.ts +0 -20
  157. package/dist/sast/rules/c.d.ts +0 -9
  158. package/dist/sast/rules/csharp.d.ts +0 -9
  159. package/dist/sast/rules/go.d.ts +0 -9
  160. package/dist/sast/rules/index.d.ts +0 -72
  161. package/dist/sast/rules/java.d.ts +0 -9
  162. package/dist/sast/rules/javascript.d.ts +0 -9
  163. package/dist/sast/rules/php.d.ts +0 -9
  164. package/dist/sast/rules/python.d.ts +0 -9
  165. package/dist/sast/semgrep.d.ts +0 -68
  166. package/dist/sast/semgrep.test.d.ts +0 -1
  167. package/dist/sbom/cyclonedx.d.ts +0 -101
  168. package/dist/sbom/detectors/dart.d.ts +0 -7
  169. package/dist/sbom/detectors/dotnet.d.ts +0 -7
  170. package/dist/sbom/detectors/go.d.ts +0 -7
  171. package/dist/sbom/detectors/index.d.ts +0 -53
  172. package/dist/sbom/detectors/java.d.ts +0 -7
  173. package/dist/sbom/detectors/nodejs.d.ts +0 -7
  174. package/dist/sbom/detectors/python.d.ts +0 -7
  175. package/dist/sbom/detectors/rust.d.ts +0 -7
  176. package/dist/sbom/detectors/swift.d.ts +0 -7
  177. package/dist/services/config-doctor.d.ts +0 -125
  178. package/dist/services/config-doctor.security.test.d.ts +0 -1
  179. package/dist/services/config-doctor.test.d.ts +0 -1
  180. package/dist/services/context-budget-service.d.ts +0 -101
  181. package/dist/services/decision-drift-analyzer.d.ts +0 -96
  182. package/dist/services/diagnose-service.d.ts +0 -31
  183. package/dist/services/evidence-service.d.ts +0 -65
  184. package/dist/services/evidence-summary-service.d.ts +0 -75
  185. package/dist/services/export-service.d.ts +0 -23
  186. package/dist/services/handoff-service.d.ts +0 -61
  187. package/dist/services/history-service.d.ts +0 -35
  188. package/dist/services/index.d.ts +0 -13
  189. package/dist/services/plan-service.d.ts +0 -25
  190. package/dist/services/preflight-integration.d.ts +0 -38
  191. package/dist/services/preflight-service.d.ts +0 -62
  192. package/dist/services/run-memory.d.ts +0 -66
  193. package/dist/services/status-service.d.ts +0 -29
  194. package/dist/services/status-service.turbo-indicator.test.d.ts +0 -5
  195. package/dist/session/snapshot-reader.d.ts +0 -37
  196. package/dist/session/snapshot-writer.d.ts +0 -89
  197. package/dist/skills/index.d.ts +0 -30
  198. package/dist/state.rehydrate.test.d.ts +0 -1
  199. package/dist/state.rehydration-adversarial.test.d.ts +0 -1
  200. package/dist/state.rehydration-integration.test.d.ts +0 -1
  201. package/dist/state.session-restart.test.d.ts +0 -7
  202. package/dist/summaries/index.d.ts +0 -2
  203. package/dist/summaries/manager.d.ts +0 -29
  204. package/dist/summaries/summarizer.d.ts +0 -38
  205. package/dist/tools/barrel-export-check-gate-status.test.d.ts +0 -6
  206. package/dist/tools/build-check.d.ts +0 -50
  207. package/dist/tools/check-gate-status.adversarial.test.d.ts +0 -1
  208. package/dist/tools/check-gate-status.d.ts +0 -7
  209. package/dist/tools/check-gate-status.gates.test.d.ts +0 -1
  210. package/dist/tools/check-gate-status.plugin-registration.test.d.ts +0 -1
  211. package/dist/tools/checkpoint.d.ts +0 -2
  212. package/dist/tools/co-change-analyzer.d.ts +0 -45
  213. package/dist/tools/complexity-hotspots.d.ts +0 -2
  214. package/dist/tools/declare-scope.d.ts +0 -49
  215. package/dist/tools/diff.d.ts +0 -18
  216. package/dist/tools/domain-detector.d.ts +0 -6
  217. package/dist/tools/evidence-check.d.ts +0 -8
  218. package/dist/tools/file-extractor.d.ts +0 -9
  219. package/dist/tools/gitingest.d.ts +0 -18
  220. package/dist/tools/imports.d.ts +0 -5
  221. package/dist/tools/index.d.ts +0 -31
  222. package/dist/tools/knowledge-query.d.ts +0 -5
  223. package/dist/tools/lint.d.ts +0 -50
  224. package/dist/tools/phase-complete.d.ts +0 -25
  225. package/dist/tools/pkg-audit.d.ts +0 -2
  226. package/dist/tools/placeholder-scan.d.ts +0 -26
  227. package/dist/tools/plugin-registration-adversarial.test.d.ts +0 -1
  228. package/dist/tools/pre-check-batch.d.ts +0 -56
  229. package/dist/tools/quality-budget.d.ts +0 -24
  230. package/dist/tools/retrieve-summary.d.ts +0 -2
  231. package/dist/tools/sast-scan.d.ts +0 -60
  232. package/dist/tools/save-plan.d.ts +0 -63
  233. package/dist/tools/sbom-generate.d.ts +0 -26
  234. package/dist/tools/schema-drift.d.ts +0 -2
  235. package/dist/tools/secretscan.d.ts +0 -35
  236. package/dist/tools/symbols.d.ts +0 -2
  237. package/dist/tools/syntax-check.d.ts +0 -35
  238. package/dist/tools/test-runner.d.ts +0 -49
  239. package/dist/tools/test-runner.security-adversarial.test.d.ts +0 -5
  240. package/dist/tools/todo-extract.d.ts +0 -2
  241. package/dist/tools/tool-names.d.ts +0 -10
  242. package/dist/tools/update-task-status.d.ts +0 -74
  243. package/dist/tools/update-task-status.gates.test.d.ts +0 -1
  244. package/dist/tools/update-task-status.turbo-bypass.test.d.ts +0 -1
  245. package/dist/tools/write-retro.d.ts +0 -53
  246. package/dist/types/delegation.d.ts +0 -24
  247. package/dist/types/events.d.ts +0 -55
  248. package/dist/utils/errors.d.ts +0 -33
  249. package/dist/utils/index.d.ts +0 -4
  250. package/dist/utils/logger.d.ts +0 -3
  251. package/dist/utils/merge.d.ts +0 -5
  252. package/dist/utils/regex.d.ts +0 -30
  253. package/dist/utils/tool-output.d.ts +0 -10
  254. /package/dist/{commands/agents.d.ts → agents.d.ts} +0 -0
  255. /package/dist/{commands/analyze.d.ts → analyze.d.ts} +0 -0
  256. /package/dist/{commands/archive.d.ts → archive.d.ts} +0 -0
  257. /package/dist/{commands/benchmark.d.ts → benchmark.d.ts} +0 -0
  258. /package/dist/{commands/clarify.d.ts → clarify.d.ts} +0 -0
  259. /package/dist/{tools/create-tool.d.ts → create-tool.d.ts} +0 -0
  260. /package/dist/{commands/curate.d.ts → curate.d.ts} +0 -0
  261. /package/dist/{commands/dark-matter.d.ts → dark-matter.d.ts} +0 -0
  262. /package/dist/{commands/diagnose.d.ts → diagnose.d.ts} +0 -0
  263. /package/dist/{build/discovery.d.ts → discovery.d.ts} +0 -0
  264. /package/dist/{commands/doctor.d.ts → doctor.d.ts} +0 -0
  265. /package/dist/{commands/evidence.d.ts → evidence.d.ts} +0 -0
  266. /package/dist/{commands/export.d.ts → export.d.ts} +0 -0
  267. /package/dist/{commands/handoff.d.ts → handoff.d.ts} +0 -0
  268. /package/dist/{commands/history.d.ts → history.d.ts} +0 -0
  269. /package/dist/{commands/knowledge.d.ts → knowledge.d.ts} +0 -0
  270. /package/dist/{commands/plan.d.ts → plan.d.ts} +0 -0
  271. /package/dist/{commands/preflight.d.ts → preflight.d.ts} +0 -0
  272. /package/dist/{commands/promote.d.ts → promote.d.ts} +0 -0
  273. /package/dist/{commands/reset.d.ts → reset.d.ts} +0 -0
  274. /package/dist/{commands/retrieve.d.ts → retrieve.d.ts} +0 -0
  275. /package/dist/{commands/rollback.d.ts → rollback.d.ts} +0 -0
  276. /package/dist/{commands/simulate.d.ts → simulate.d.ts} +0 -0
  277. /package/dist/{commands/specify.d.ts → specify.d.ts} +0 -0
  278. /package/dist/{commands/status.d.ts → status.d.ts} +0 -0
  279. /package/dist/{commands/sync-plan.d.ts → sync-plan.d.ts} +0 -0
  280. /package/dist/{commands/turbo.d.ts → turbo.d.ts} +0 -0
  281. /package/dist/{commands/write_retro.d.ts → write_retro.d.ts} +0 -0
@@ -1,179 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,92 +0,0 @@
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
- }
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env bun
2
- /**
3
- * Dispatch function for routing argv tokens to plugin command handlers.
4
- * Used by the "run" subcommand entry point.
5
- */
6
- export declare function run(args: string[]): Promise<number>;
@@ -1,5 +0,0 @@
1
- /**
2
- * Handle /swarm checkpoint command
3
- * Creates, lists, restores, or deletes checkpoints with optional label
4
- */
5
- export declare function handleCheckpointCommand(directory: string, args: string[]): Promise<string>;
@@ -1,14 +0,0 @@
1
- /**
2
- * Adversarial Security Tests for Command Adapters (Task 5.10)
3
- *
4
- * ATTACK VECTORS COVERED:
5
- * 1. Path Traversal - attempts to escape .swarm directory via command args
6
- * 2. Null Byte Injection - injecting null bytes to truncate paths/strings
7
- * 3. Control Character Injection - injecting control chars (0x00-0x1F)
8
- * 4. Command Injection - shell metacharacters in args
9
- * 5. Argument Pollution - malformed, oversized, special character args
10
- * 6. Flag Injection - malicious flag values and combinations
11
- * 7. Unicode Attacks - unicode normalization/replacement attacks
12
- * 8. Edge Cases - empty, extremely long, boundary values
13
- */
14
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- /**
2
- * Handles the /swarm config command.
3
- * Loads and displays the current resolved plugin configuration.
4
- */
5
- export declare function handleConfigCommand(directory: string, _args: string[]): Promise<string>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,39 +0,0 @@
1
- import type { AgentDefinition } from '../agents';
2
- export { handleAgentsCommand } from './agents';
3
- export { handleAnalyzeCommand } from './analyze';
4
- export { handleArchiveCommand } from './archive';
5
- export { handleBenchmarkCommand } from './benchmark';
6
- export { handleClarifyCommand } from './clarify';
7
- export { handleConfigCommand } from './config';
8
- export { handleCurateCommand } from './curate';
9
- export { handleDarkMatterCommand } from './dark-matter';
10
- export { handleDiagnoseCommand } from './diagnose';
11
- export { handleDoctorCommand } from './doctor';
12
- export { handleEvidenceCommand, handleEvidenceSummaryCommand, } from './evidence';
13
- export { handleExportCommand } from './export';
14
- export { handleHandoffCommand } from './handoff';
15
- export { handleHistoryCommand } from './history';
16
- export { handleKnowledgeListCommand, handleKnowledgeMigrateCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, } from './knowledge';
17
- export { handlePlanCommand } from './plan';
18
- export { handlePreflightCommand } from './preflight';
19
- export { handlePromoteCommand } from './promote';
20
- export { handleResetCommand } from './reset';
21
- export { handleRetrieveCommand } from './retrieve';
22
- export { handleRollbackCommand } from './rollback';
23
- export { handleSimulateCommand } from './simulate';
24
- export { handleSpecifyCommand } from './specify';
25
- export { handleStatusCommand } from './status';
26
- export { handleSyncPlanCommand } from './sync-plan';
27
- export { handleTurboCommand } from './turbo';
28
- export { handleWriteRetroCommand } from './write_retro';
29
- /**
30
- * Creates a command.execute.before handler for /swarm commands.
31
- * Uses factory pattern to close over directory and agents.
32
- */
33
- export declare function createSwarmCommandHandler(directory: string, agents: Record<string, AgentDefinition>): (input: {
34
- command: string;
35
- sessionID: string;
36
- arguments: string;
37
- }, output: {
38
- parts: unknown[];
39
- }) => Promise<void>;
@@ -1,5 +0,0 @@
1
- /**
2
- * Tests for Task 3.12: Turbo Mode command registration in src/commands/index.ts
3
- * Verifies import, export, help text, and switch case routing for /swarm turbo
4
- */
5
- export {};
@@ -1,5 +0,0 @@
1
- /**
2
- * Tests for Task 3.13: Empty sessionID handling in handleTurboCommand
3
- * Tests the CLI wiring fix where empty sessionID returns proper error message
4
- */
5
- export {};
@@ -1,11 +0,0 @@
1
- /**
2
- * Regression Tests for Task 4: Turbo Mode Integration
3
- *
4
- * These tests verify that Turbo Mode is correctly integrated across all surfaces:
5
- * 1. /swarm turbo command toggles turboMode correctly
6
- * 2. checkReviewerGate bypasses Stage B when turboMode is active AND task is not Tier 3
7
- * 3. Evidence records include turbo flag when recorded under turboMode
8
- * 4. Architect prompt includes TURBO MODE ACTIVE banner when active
9
- * 5. Status output shows TURBO MODE indicator when active
10
- */
11
- export {};
@@ -1,5 +0,0 @@
1
- /**
2
- * Tests for Task 3.11: handleTurboCommand function
3
- * Tests the /swarm turbo command toggle functionality
4
- */
5
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,37 +0,0 @@
1
- import type { ToolName } from '../tools/tool-names';
2
- export declare const QA_AGENTS: readonly ["reviewer", "critic"];
3
- export declare const PIPELINE_AGENTS: readonly ["explorer", "coder", "test_engineer"];
4
- export declare const ORCHESTRATOR_NAME: "architect";
5
- export declare const ALL_SUBAGENT_NAMES: readonly ["sme", "docs", "designer", "reviewer", "critic", "explorer", "coder", "test_engineer"];
6
- export declare const ALL_AGENT_NAMES: readonly ["architect", "sme", "docs", "designer", "reviewer", "critic", "explorer", "coder", "test_engineer"];
7
- export type QAAgentName = (typeof QA_AGENTS)[number];
8
- export type PipelineAgentName = (typeof PIPELINE_AGENTS)[number];
9
- export type AgentName = (typeof ALL_AGENT_NAMES)[number];
10
- export declare const AGENT_TOOL_MAP: Record<AgentName, ToolName[]>;
11
- export declare const DEFAULT_MODELS: Record<string, string>;
12
- export declare function isQAAgent(name: string): name is QAAgentName;
13
- export declare function isSubagent(name: string): boolean;
14
- import type { ScoringConfig } from './schema';
15
- export declare const DEFAULT_SCORING_CONFIG: ScoringConfig;
16
- /**
17
- * Resolve scoring configuration by deep-merging user config with defaults.
18
- * Missing scoring block → use defaults; partial weights → merge with defaults.
19
- *
20
- * @param userConfig - Optional user-provided scoring configuration
21
- * @returns The effective scoring configuration with all defaults applied
22
- */
23
- export declare function resolveScoringConfig(userConfig?: ScoringConfig): ScoringConfig;
24
- /**
25
- * Model ID substrings that identify low-capability models.
26
- * If a model's ID contains any of these substrings (case-insensitive),
27
- * it is considered a low-capability model.
28
- */
29
- export declare const LOW_CAPABILITY_MODELS: readonly ["mini", "nano", "small", "free"];
30
- /**
31
- * Returns true if the given modelId contains any LOW_CAPABILITY_MODELS substring
32
- * (case-insensitive comparison).
33
- *
34
- * @param modelId - The model ID to check
35
- * @returns true if the model is considered low capability, false otherwise
36
- */
37
- export declare function isLowCapabilityModel(modelId: string): boolean;