opencode-swarm 7.61.0 → 7.62.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.
@@ -0,0 +1,45 @@
1
+ export type EffectiveSpecSource = 'swarm' | 'openspec_projection';
2
+ export interface OpenSpecArtifact {
3
+ relPath: string;
4
+ bytes: number;
5
+ mtimeMs: number;
6
+ }
7
+ export interface OpenSpecChange {
8
+ id: string;
9
+ proposal: boolean;
10
+ design: boolean;
11
+ tasks: boolean;
12
+ specs: OpenSpecArtifact[];
13
+ }
14
+ export interface EffectiveSpec {
15
+ source: EffectiveSpecSource;
16
+ content: string;
17
+ hash: string;
18
+ mtime: string | null;
19
+ sourcePaths: string[];
20
+ warnings: string[];
21
+ }
22
+ export interface SddStatus {
23
+ provider: EffectiveSpecSource | 'none';
24
+ swSpecExists: boolean;
25
+ openSpecExists: boolean;
26
+ currentSpecs: OpenSpecArtifact[];
27
+ changes: OpenSpecChange[];
28
+ effectiveSpec: EffectiveSpec | null;
29
+ errors: string[];
30
+ warnings: string[];
31
+ }
32
+ export declare function loadSddStatusSync(directory: string): SddStatus;
33
+ export declare function buildOpenSpecProjectionSync(directory: string, options?: {
34
+ changeId?: string;
35
+ }): EffectiveSpec | null;
36
+ export declare function readEffectiveSpecSync(directory: string): EffectiveSpec | null;
37
+ export declare function writeProjectedSpecSync(directory: string, options?: {
38
+ changeId?: string;
39
+ dryRun?: boolean;
40
+ }): {
41
+ written: boolean;
42
+ projection: EffectiveSpec | null;
43
+ archivePath?: string;
44
+ path: string;
45
+ };
package/dist/state.d.ts CHANGED
@@ -334,6 +334,23 @@ export declare const swarmState: {
334
334
  * Reset all state to initial values - useful for testing
335
335
  */
336
336
  export declare function resetSwarmState(): void;
337
+ /**
338
+ * Reset swarm state while preserving the 7 module-scoped singletons that are
339
+ * populated once at plugin init and must survive a /swarm close + re-init
340
+ * within the same process lifetime.
341
+ *
342
+ * The preserved fields are:
343
+ * - opencodeClient (SDK client for curator/full-auto delegation)
344
+ * - fullAutoEnabledInConfig (config flag read at init)
345
+ * - curatorInitAgentNames, curatorPhaseAgentNames (curator registry)
346
+ * - skillImproverAgentNames, specWriterAgentNames (skill/spec registry)
347
+ * - generatedAgentNames (full-auto delegation guard registry)
348
+ *
349
+ * Implementation: save all 7 to locals, call resetSwarmState(), restore all 7.
350
+ * Synchronous (matches resetSwarmState contract). Errors from resetSwarmState
351
+ * propagate to caller (no try/catch wrapper).
352
+ */
353
+ export declare function resetSwarmStatePreservingSingletons(): void;
337
354
  /**
338
355
  * Start a new agent session with initialized guardrail state.
339
356
  * Also removes any stale sessions older than staleDurationMs.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Gate 2 – Drift Verifier.
3
3
  * Conditional on drift_check QA gate. Blocks when drift evidence is missing
4
- * (when spec.md exists) or when the verdict is rejected.
4
+ * (when an effective spec exists) or when the verdict is rejected.
5
5
  */
6
6
  import type { GateContext, GateResult } from './types';
7
7
  export declare function runDriftGate(ctx: GateContext): Promise<GateResult>;
@@ -1,4 +1,5 @@
1
1
  import type { Plan } from '../config/plan-schema';
2
+ import { readEffectiveSpecSync } from '../sdd/effective-spec';
2
3
  /**
3
4
  * Computes SHA-256 hex hash of `.swarm/spec.md` content in the given directory.
4
5
  * Returns null if the file does not exist (does NOT throw).
@@ -20,4 +21,5 @@ export declare function isSpecStale(directory: string, plan: Plan): Promise<{
20
21
  export declare const _internals: {
21
22
  computeSpecHash: typeof computeSpecHash;
22
23
  isSpecStale: typeof isSpecStale;
24
+ readEffectiveSpecSync: typeof readEffectiveSpecSync;
23
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.61.0",
3
+ "version": "7.62.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",