opencode-swarm 7.117.0 → 7.118.0

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 (40) hide show
  1. package/dist/cli/{config-doctor-htzxe394.js → config-doctor-p73yfdz0.js} +2 -2
  2. package/dist/cli/{curator-fr2m5hna.js → curator-920swpnk.js} +10 -10
  3. package/dist/cli/{curator-llm-factory-m0kvna8n.js → curator-llm-factory-kqt1f4sw.js} +10 -10
  4. package/dist/cli/{guardrail-explain-xjgk822d.js → guardrail-explain-bycz51b0.js} +11 -11
  5. package/dist/cli/{guardrail-log-dzbqcgz9.js → guardrail-log-qjqgg7pz.js} +3 -3
  6. package/dist/cli/{hive-promoter-zpk5jmx0.js → hive-promoter-w9pgfs6w.js} +15 -10
  7. package/dist/cli/{index-m7hc7nn7.js → index-11q1t6g0.js} +1 -1
  8. package/dist/cli/{index-vkdr12ek.js → index-34tsqvqb.js} +1894 -1327
  9. package/dist/cli/{index-n3sm9ewn.js → index-470tykwx.js} +2 -2
  10. package/dist/cli/{index-dc3j6jmk.js → index-5hze8ztj.js} +10 -21
  11. package/dist/cli/{index-m43zgtjn.js → index-bcg89pt8.js} +1 -1
  12. package/dist/cli/{index-8j5d3ytd.js → index-g2wrs7jy.js} +1 -1
  13. package/dist/cli/{index-af94ke83.js → index-jbdgpqpj.js} +3 -3
  14. package/dist/cli/{index-pgtqxat4.js → index-k83hebh1.js} +12 -12
  15. package/dist/cli/{index-nvc0nsvg.js → index-pdk1n8yh.js} +2 -0
  16. package/dist/cli/{index-c9m5skgs.js → index-pjhfe7c3.js} +2 -2
  17. package/dist/cli/{index-aws8yhwq.js → index-qx5z58a7.js} +19 -31
  18. package/dist/cli/{index-hskmya46.js → index-sb9x6xjj.js} +3 -3
  19. package/dist/cli/{index-4f4zv8pb.js → index-wpgv6hht.js} +25 -1
  20. package/dist/cli/index.js +10 -10
  21. package/dist/cli/{knowledge-escalator-bmk725p4.js → knowledge-escalator-gt1q632m.js} +4 -4
  22. package/dist/cli/{knowledge-events-px14n75v.js → knowledge-events-0bjdtdsb.js} +2 -2
  23. package/dist/cli/{knowledge-store-z9znvtn2.js → knowledge-store-fm2300xf.js} +7 -2
  24. package/dist/cli/{knowledge-validator-7r5t821g.js → knowledge-validator-91kx3eqv.js} +3 -3
  25. package/dist/cli/{schema-bqn7g3ez.js → schema-7c484wjz.js} +1 -1
  26. package/dist/cli/{skill-generator-4d3w8sqt.js → skill-generator-t47xyfps.js} +5 -5
  27. package/dist/commands/promote.d.ts +3 -0
  28. package/dist/commands/registry.d.ts +2 -2
  29. package/dist/config/schema.d.ts +8 -4
  30. package/dist/hooks/curator-postmortem.d.ts +1 -1
  31. package/dist/hooks/hive-policy.d.ts +81 -0
  32. package/dist/hooks/hive-promoter.d.ts +147 -28
  33. package/dist/hooks/hive-transaction.d.ts +113 -0
  34. package/dist/hooks/knowledge-events.d.ts +2 -1
  35. package/dist/hooks/knowledge-store.d.ts +6 -5
  36. package/dist/hooks/knowledge-types.d.ts +87 -0
  37. package/dist/index.js +325 -315
  38. package/dist/knowledge/hive-paths.d.ts +51 -0
  39. package/dist/services/knowledge-diagnostics.d.ts +18 -0
  40. package/package.json +1 -1
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Centralized hive (cross-project) storage path resolution.
3
+ *
4
+ * Problem (issue #1847 §1): the platform-specific branch that derives the hive
5
+ * data directory was duplicated across `src/hooks/knowledge-store.ts`
6
+ * (`resolveHiveKnowledgePath`/`resolveHiveRejectedPath`/`resolveHiveEventsPath`)
7
+ * and `src/hooks/knowledge-events.ts` (`resolveHiveEventsPath`). Each duplication
8
+ * is a drift vector — the audit-event path and the store path could diverge.
9
+ *
10
+ * This module is the single source of truth for hive path resolution. Both
11
+ * hooks re-export from here so the store, the rejected log, and the audit-event
12
+ * log always share one directory.
13
+ *
14
+ * Subprocess contract (AGENTS.md invariant 3): this module performs NO
15
+ * subprocess calls and holds NO module-level mutable state (invariant 8). It
16
+ * reads `process.env.HOME`/`LOCALAPPDATA`/`XDG_DATA_HOME` live on each call so
17
+ * tests can redirect the hive directory via `process.env.HOME` without a cache.
18
+ *
19
+ * It is NOT imported on the plugin-init path (invariant 1); hive writes happen
20
+ * only on the `/swarm promote`/close/curate/postmortem lazy paths, never on
21
+ * `server()` resolution.
22
+ */
23
+ /**
24
+ * Resolve the platform-specific hive data directory (the directory that holds
25
+ * `shared-learnings.jsonl`, `shared-learnings-rejected.jsonl`, and
26
+ * `shared-knowledge-events.jsonl`). Reads `process.env.HOME` live each call —
27
+ * Bun caches `os.homedir()`, so changing `$HOME` after the first cached call
28
+ * is only observed by reading the env var first.
29
+ */
30
+ export declare function resolveHiveDataDir(): string;
31
+ /** Path to the hive knowledge store (`shared-learnings.jsonl`). */
32
+ export declare function resolveHiveKnowledgePath(): string;
33
+ /** Path to the hive rejected-lessons log (`shared-learnings-rejected.jsonl`). */
34
+ export declare function resolveHiveRejectedPath(): string;
35
+ /**
36
+ * Path to the shared, cross-project hive knowledge-events log
37
+ * (`shared-knowledge-events.jsonl`). Lives alongside the hive store so the
38
+ * store and its audit history share one scope and one directory lock.
39
+ */
40
+ export declare function resolveHiveEventsPath(): string;
41
+ /**
42
+ * Test-only DI seam (AGENTS.md invariant 7). Tests redirect the hive directory
43
+ * by overriding `resolveHiveDataDir` here rather than `mock.module`-ing each
44
+ * consumer, which leaks across test files in Bun's shared runner.
45
+ */
46
+ export declare const _internals: {
47
+ resolveHiveDataDir: typeof resolveHiveDataDir;
48
+ resolveHiveKnowledgePath: typeof resolveHiveKnowledgePath;
49
+ resolveHiveRejectedPath: typeof resolveHiveRejectedPath;
50
+ resolveHiveEventsPath: typeof resolveHiveEventsPath;
51
+ };
@@ -73,6 +73,24 @@ export interface KnowledgeDebugMeta {
73
73
  */
74
74
  local_orphaned: boolean;
75
75
  };
76
+ /**
77
+ * Hive promotion health (issue #1847). Surfaces lineage presence and any
78
+ * manual-override promotions so an operator can audit forced entries.
79
+ */
80
+ hive: {
81
+ /** Hive entries carrying a #1847 lineage block. */
82
+ entries_with_lineage: number;
83
+ /** Hive entries promoted via an audited --force override (AC9 visibility). */
84
+ override_promotions: number;
85
+ /** Up to 20 most-recent override entries (id, failed gates, reason). */
86
+ override_entries: Array<{
87
+ id: string;
88
+ lesson_excerpt: string;
89
+ override_failed_gates?: string[];
90
+ reason?: string;
91
+ promotion_event_id?: string;
92
+ }>;
93
+ };
76
94
  }
77
95
  /**
78
96
  * Compute the debug-metadata block for the knowledge system. Best-effort: never
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.117.0",
3
+ "version": "7.118.0",
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",