opencode-swarm 7.68.0 → 7.68.2

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.
@@ -1,10 +1,12 @@
1
1
  /** One-time migration from .swarm/context.md → .swarm/knowledge.jsonl for existing projects. */
2
+ import { appendKnowledge } from './knowledge-store.js';
2
3
  import type { KnowledgeCategory, KnowledgeConfig } from './knowledge-types.js';
3
4
  export interface MigrationResult {
4
5
  migrated: boolean;
5
6
  entriesMigrated: number;
6
7
  entriesDropped: number;
7
8
  entriesTotal: number;
9
+ entryErrors?: string[];
8
10
  skippedReason?: 'sentinel-exists' | 'no-context-file' | 'empty-context' | 'external-sentinel-exists';
9
11
  }
10
12
  export declare function migrateKnowledgeToExternal(_directory: string, _config: KnowledgeConfig): Promise<MigrationResult>;
@@ -18,8 +20,10 @@ interface Section {
18
20
  body: string;
19
21
  }
20
22
  export declare const _internals: {
23
+ appendKnowledge: typeof appendKnowledge;
21
24
  migrateContextToKnowledge: typeof migrateContextToKnowledge;
22
25
  migrateKnowledgeToExternal: typeof migrateKnowledgeToExternal;
26
+ migrateHiveKnowledgeLegacy: typeof migrateHiveKnowledgeLegacy;
23
27
  parseContextMd: typeof parseContextMd;
24
28
  splitIntoSections: typeof splitIntoSections;
25
29
  extractBullets: typeof extractBullets;
@@ -27,8 +31,21 @@ export declare const _internals: {
27
31
  truncateLesson: typeof truncateLesson;
28
32
  inferProjectName: typeof inferProjectName;
29
33
  writeSentinel: typeof writeSentinel;
34
+ resolveLegacyHiveKnowledgePath: typeof resolveLegacyHiveKnowledgePath;
30
35
  };
31
36
  export declare function migrateContextToKnowledge(directory: string, config: KnowledgeConfig): Promise<MigrationResult>;
37
+ /**
38
+ * Migrate legacy hive knowledge from {platform-data-dir}/hive-knowledge.jsonl
39
+ * to {platform-data-dir}/shared-learnings.jsonl with HiveKnowledgeEntry schema.
40
+ *
41
+ * This handles data that was created before the dual-hive-promoter consolidation (v7.63.0).
42
+ * Legacy entries were in a flat schema; this converts them to the current HiveKnowledgeEntry format
43
+ * and deduplicates against existing hive entries.
44
+ *
45
+ * @param config - Knowledge configuration
46
+ * @returns Migration result with counts and status
47
+ */
48
+ export declare function migrateHiveKnowledgeLegacy(config: KnowledgeConfig): Promise<MigrationResult>;
32
49
  /**
33
50
  * Parse context.md content into raw migration entries.
34
51
  * Extracts bullets from sections matching: lessons-learned, patterns, sme-cache, decisions.
@@ -59,4 +76,10 @@ declare function inferProjectName(directory: string): string;
59
76
  * Write sentinel file to track migration status.
60
77
  */
61
78
  declare function writeSentinel(sentinelPath: string, migrated: number, dropped: number): Promise<void>;
79
+ /**
80
+ * Resolve the legacy hive knowledge file path.
81
+ * Legacy data was stored in {platform-data-dir}/hive-knowledge.jsonl before consolidation.
82
+ * This matches the resolveHiveKnowledgePath() pattern but returns the old path.
83
+ */
84
+ declare function resolveLegacyHiveKnowledgePath(): string;
62
85
  export {};