opencode-swarm 7.87.3 → 7.88.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 (32) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +2 -1
  2. package/.opencode/skills/clarify/SKILL.md +7 -1
  3. package/.opencode/skills/clarify-spec/SKILL.md +1 -1
  4. package/.opencode/skills/issue-ingest/SKILL.md +3 -2
  5. package/.opencode/skills/plan/SKILL.md +7 -1
  6. package/.opencode/skills/specify/SKILL.md +3 -2
  7. package/.opencode/skills/swarm-pr-review/SKILL.md +304 -9
  8. package/README.md +1 -0
  9. package/dist/background/candidate-parser.d.ts +189 -0
  10. package/dist/background/candidate-sidecar-store.d.ts +56 -0
  11. package/dist/cli/{config-doctor-6h64pn8n.js → config-doctor-jzbgpbdh.js} +2 -2
  12. package/dist/cli/{guardrail-explain-2q9myk7c.js → guardrail-explain-995zavv8.js} +5 -5
  13. package/dist/cli/{guardrail-log-eegabqcp.js → guardrail-log-c7egm5km.js} +3 -3
  14. package/dist/cli/{index-q9h0wb04.js → index-0asbrmdx.js} +4 -0
  15. package/dist/cli/{index-kz1bmebr.js → index-4td9ef53.js} +523 -229
  16. package/dist/cli/{index-1cb4wxnm.js → index-819xp49y.js} +1 -1
  17. package/dist/cli/{index-5hvbw5xh.js → index-g00qm2gf.js} +1 -1
  18. package/dist/cli/{index-r3f47swm.js → index-sr7g2msm.js} +6 -6
  19. package/dist/cli/{index-amwa268r.js → index-tt5aehrb.js} +2 -2
  20. package/dist/cli/{index-5vpe6vq9.js → index-vjsr9bqt.js} +1 -1
  21. package/dist/cli/index.js +4 -4
  22. package/dist/cli/{schema-84146tvk.js → schema-vb6jkxgg.js} +1 -1
  23. package/dist/index.js +2114 -991
  24. package/dist/memory/config.d.ts +1 -0
  25. package/dist/memory/gateway.d.ts +1 -0
  26. package/dist/memory/provider-pool.d.ts +50 -0
  27. package/dist/memory/sqlite-provider.d.ts +3 -0
  28. package/dist/tools/index.d.ts +1 -0
  29. package/dist/tools/manifest.d.ts +1 -0
  30. package/dist/tools/parse-lane-candidates.d.ts +2 -0
  31. package/dist/tools/tool-metadata.d.ts +4 -0
  32. package/package.json +1 -1
@@ -28,6 +28,7 @@ export interface MemoryConfig {
28
28
  maintenance: {
29
29
  lowUtilityMaxConfidence: number;
30
30
  lowUtilityMinAgeDays: number;
31
+ autoCompactEveryNRecalls?: number;
31
32
  };
32
33
  hardDelete: boolean;
33
34
  }
@@ -32,6 +32,7 @@ export declare class MemoryGateway {
32
32
  private readonly config;
33
33
  private readonly provider;
34
34
  private readonly now;
35
+ private disposed;
35
36
  constructor(context: MemoryContext, options?: MemoryGatewayOptions);
36
37
  isEnabled(): boolean;
37
38
  dispose(): Promise<void>;
@@ -0,0 +1,50 @@
1
+ import type { MemoryConfig } from './config';
2
+ import type { MemoryProposalStore, MemoryProvider } from './provider';
3
+ /**
4
+ * Return true if the provider is currently managed by the pool.
5
+ *
6
+ * Pooled providers have a `close()` that delegates to `releaseProvider`.
7
+ * Any caller (gateway, commands, tools) can safely call `close()` to release
8
+ * its reference; the pool handles refcount tracking and real close on drain.
9
+ */
10
+ export declare function isPooledProvider(provider: MemoryProvider & Partial<MemoryProposalStore>): boolean;
11
+ /**
12
+ * Return an existing provider for `directory`, or create and cache a new one.
13
+ *
14
+ * The pool key is the canonical absolute path returned by `realpathSync(directory)`.
15
+ * If `realpathSync` fails (broken symlink, permission error, etc.) the resolved
16
+ * absolute path is used as a fallback key.
17
+ *
18
+ * Every access (hit or miss) updates the LRU ordering so the most-used entries
19
+ * survive eviction. Cache hits increment the reference count so the pool knows
20
+ * how many active callers are using the provider.
21
+ *
22
+ * Note: this function returns synchronously. The provider's actual database
23
+ * open happens lazily inside `provider.initialize()`, which callers await
24
+ * separately (and which is protected by the provider's own init mutex).
25
+ */
26
+ export declare function getOrCreateProvider(directory: string, config: MemoryConfig): MemoryProvider & MemoryProposalStore;
27
+ /**
28
+ * Release a pooled provider back to the pool by decrementing its refCount.
29
+ *
30
+ * **Lifecycle contract:** refCount is per-PROVIDER, not per-ACQUISITION.
31
+ * Each acquisition (getOrCreateProvider call) MUST be released exactly once
32
+ * via provider.close() (which calls releaseProvider internally) or
33
+ * MemoryGateway.dispose() (which is one-shot via a `disposed` flag).
34
+ *
35
+ * Calling close() MORE THAN ONCE per acquisition may corrupt refCount.
36
+ * MemoryGateway prevents this with its one-shot dispose flag. Callers that
37
+ * use provider.close() directly (e.g., commands/memory.ts) must ensure
38
+ * they call it exactly once per acquisition — typically by using the
39
+ * provider in a single synchronous or try/finally block.
40
+ *
41
+ * Idle entries (refCount=0) remain in the pool for reuse until LRU eviction.
42
+ * Active entries (refCount>0) are deferred-closed on eviction until all
43
+ * references release.
44
+ */
45
+ export declare function releaseProvider(provider: MemoryProvider & Partial<MemoryProposalStore>): void;
46
+ /**
47
+ * Evict and close every cached provider. Intended for test teardown only —
48
+ * production code should rely on LRU eviction.
49
+ */
50
+ export declare function clearPool(): void;
@@ -26,6 +26,8 @@ export declare class SQLiteMemoryProvider implements MemoryProvider, MemoryPropo
26
26
  private memories;
27
27
  private proposals;
28
28
  private lastAutomaticJsonlMigration;
29
+ private recallCountSinceLastCompaction;
30
+ private isCompacting;
29
31
  constructor(rootDirectory: string, config?: Partial<MemoryConfig>);
30
32
  private databasePath;
31
33
  initialize(): Promise<void>;
@@ -61,6 +63,7 @@ export declare class SQLiteMemoryProvider implements MemoryProvider, MemoryPropo
61
63
  markMigration(version: number, name: string): void;
62
64
  private selectRecallCandidates;
63
65
  private runMigrations;
66
+ private backfillScopeKeys;
64
67
  private initializeFtsIndex;
65
68
  private recreateFtsIndex;
66
69
  private rebuildFtsIndex;
@@ -39,6 +39,7 @@ export { knowledge_recall } from './knowledge-recall';
39
39
  export { knowledge_receipt } from './knowledge-receipt';
40
40
  export { knowledge_remove } from './knowledge-remove';
41
41
  export { lint } from './lint';
42
+ export { parse_lane_candidates } from './parse-lane-candidates';
42
43
  export { phase_complete } from './phase-complete';
43
44
  export { pkg_audit } from './pkg-audit';
44
45
  export { type PlaceholderFinding, type PlaceholderScanInput, type PlaceholderScanResult, placeholder_scan, placeholderScan, } from './placeholder-scan';
@@ -48,6 +48,7 @@ export declare const TOOL_MANIFEST: {
48
48
  sbom_generate: () => ToolDefinition;
49
49
  checkpoint: () => ToolDefinition;
50
50
  pkg_audit: () => ToolDefinition;
51
+ parse_lane_candidates: () => ToolDefinition;
51
52
  test_runner: () => ToolDefinition;
52
53
  test_impact: () => ToolDefinition;
53
54
  mutation_test: () => ToolDefinition;
@@ -0,0 +1,2 @@
1
+ import { createSwarmTool } from './create-tool';
2
+ export declare const parse_lane_candidates: ReturnType<typeof createSwarmTool>;
@@ -123,6 +123,10 @@ export declare const TOOL_METADATA: {
123
123
  description: string;
124
124
  agents: ("reviewer" | "test_engineer" | "critic_hallucination_verifier" | "critic_oversight" | "architect")[];
125
125
  };
126
+ parse_lane_candidates: {
127
+ description: string;
128
+ agents: "architect"[];
129
+ };
126
130
  test_runner: {
127
131
  description: string;
128
132
  agents: ("reviewer" | "test_engineer" | "architect")[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.87.3",
3
+ "version": "7.88.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",