opencode-swarm 7.71.0 → 7.71.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.
@@ -16,7 +16,33 @@ export { formatCourseCorrectionForInjection, generateCourseCorrection, } from '.
16
16
  export { createDefaultEscalationState, EscalationTracker } from './escalation';
17
17
  export { detectContextThrash, detectExpansionDrift, detectPatterns, detectPingPong, detectRepetitionLoop, detectStuckOnTest, } from './pattern-detector';
18
18
  export type { CourseCorrection, EscalationState, PatternDetectionResult, PatternMatch, PatternSeverity, PatternType, PrmConfig, TaxonomyCategory, TrajectoryEntry, } from './types';
19
+ import { getAgentSession } from '../state';
20
+ import { telemetry } from '../telemetry';
21
+ import { formatCourseCorrectionForInjection, generateCourseCorrection } from './course-correction';
22
+ import { detectPatterns } from './pattern-detector';
23
+ import { recordReplayEntry, startReplayRecording } from './replay';
24
+ import { cleanupOldTrajectoryFiles, getInMemoryTrajectory, readTrajectory } from './trajectory-store';
19
25
  import type { PrmConfig } from './types';
26
+ /**
27
+ * Test-only dependency-injection seam — see `gitignore-warning.ts:_internals`.
28
+ *
29
+ * Production code calls `_internals.fn(...)` so tests can replace each
30
+ * function on this object without touching the real module. `vi.spyOn` from
31
+ * `bun:test` leaks across files in Bun's shared test-runner process, which
32
+ * would corrupt unrelated suites that import the same modules.
33
+ */
34
+ export declare const _internals: {
35
+ getAgentSession: typeof getAgentSession;
36
+ readTrajectory: typeof readTrajectory;
37
+ getInMemoryTrajectory: typeof getInMemoryTrajectory;
38
+ detectPatterns: typeof detectPatterns;
39
+ generateCourseCorrection: typeof generateCourseCorrection;
40
+ formatCourseCorrectionForInjection: typeof formatCourseCorrectionForInjection;
41
+ cleanupOldTrajectoryFiles: typeof cleanupOldTrajectoryFiles;
42
+ recordReplayEntry: typeof recordReplayEntry;
43
+ startReplayRecording: typeof startReplayRecording;
44
+ telemetry: typeof telemetry;
45
+ };
20
46
  /**
21
47
  * Context passed to toolAfter handler
22
48
  */
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Shared preamble helpers for QA-gate modules.
3
+ *
4
+ * Multiple gates (mutation, hallucination, drift, phase-council, final-council)
5
+ * repeat the same loadPlan → derivePlanId → getProfile → resolve session
6
+ * overrides → getEffectiveGates sequence. This module extracts that
7
+ * preamble into a single reusable function so each gate only contains its
8
+ * unique verdict logic.
9
+ */
10
+ import type { RuntimePlan } from '../../../config/plan-schema';
11
+ import type { QaGates } from '../../../db/qa-gate-profile.js';
12
+ /**
13
+ * Result of resolving the shared QA-gate preamble.
14
+ *
15
+ * - `resolved === false` → plan or profile could not be loaded.
16
+ * Gates that default to *disabled* when the
17
+ * preamble fails should return pass-through.
18
+ * - `resolved === true` → `plan`, `profile`, and `effectiveGates`
19
+ * are all populated and the gate can inspect
20
+ * the flag it cares about.
21
+ */
22
+ export interface GatePreambleResult {
23
+ resolved: boolean;
24
+ plan?: RuntimePlan;
25
+ effectiveGates?: QaGates;
26
+ }
27
+ /**
28
+ * Load the plan, derive its identity, look up the QA-gate profile, resolve
29
+ * any session-level overrides, and compute the effective gate flags.
30
+ *
31
+ * Returns `{ resolved: false }` for expected soft-failure cases (plan or
32
+ * profile missing). Unexpected errors (e.g. JSON parse errors, file
33
+ * system errors) are allowed to propagate so that each gate's outer
34
+ * catch block can report them with gate-specific diagnostics via
35
+ * `safeWarn()`.
36
+ */
37
+ export declare function resolveGatePreamble(dir: string, sessionID: string | undefined): Promise<GatePreambleResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.71.0",
3
+ "version": "7.71.1",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",