opencode-swarm 7.33.2 → 7.34.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.
@@ -4,6 +4,7 @@ export { MemoryDisabledError, MemoryValidationError } from './errors';
4
4
  export type { MemoryGatewayOptions, ProposeMemoryInput, RecallMemoryInput, } from './gateway';
5
5
  export { createConfiguredMemoryProvider, createMemoryGateway, MemoryGateway, } from './gateway';
6
6
  export { createMemoryLifecycleHooks, type MemoryLifecycleHookOptions, type MemoryLifecycleHooks, } from './injector';
7
+ export { backupLegacyJsonl, getLegacyJsonlFileStatus, type JsonlBackupResult, type JsonlImportPayload, type JsonlInvalidRow, type JsonlMigrationReport, LEGACY_JSONL_MIGRATION_NAME, LEGACY_JSONL_MIGRATION_VERSION, readLegacyJsonl, readMigrationReport, resolveMemoryStorageDir, resolveSqliteDatabasePath, writeJsonlExport, writeMigrationReport, } from './jsonl-migration';
7
8
  export { LocalJsonlMemoryProvider } from './local-jsonl-provider';
8
9
  export { buildRecallPromptBlock } from './prompt-block';
9
10
  export type { MemoryProposalStore, MemoryProvider } from './provider';
@@ -0,0 +1,47 @@
1
+ import { type MemoryConfig } from './config';
2
+ import type { MemoryProposal, MemoryRecord } from './types';
3
+ export declare const LEGACY_JSONL_MIGRATION_VERSION = 2;
4
+ export declare const LEGACY_JSONL_MIGRATION_NAME = "legacy_jsonl_import_complete";
5
+ export interface JsonlInvalidRow {
6
+ file: 'memories.jsonl' | 'proposals.jsonl';
7
+ line: number;
8
+ error: string;
9
+ }
10
+ export interface JsonlImportPayload {
11
+ memories: MemoryRecord[];
12
+ proposals: MemoryProposal[];
13
+ invalidRows: JsonlInvalidRow[];
14
+ totalRows: number;
15
+ }
16
+ export interface JsonlBackupResult {
17
+ source: string;
18
+ backup: string;
19
+ created: boolean;
20
+ }
21
+ export interface JsonlMigrationReport {
22
+ migration: typeof LEGACY_JSONL_MIGRATION_NAME;
23
+ completedAt: string;
24
+ skipped: boolean;
25
+ reason?: string;
26
+ importedMemories: number;
27
+ importedProposals: number;
28
+ invalidRows: JsonlInvalidRow[];
29
+ backups: JsonlBackupResult[];
30
+ }
31
+ export declare function resolveMemoryStorageDir(rootDirectory: string, config?: Partial<MemoryConfig>): string;
32
+ export declare function resolveSqliteDatabasePath(rootDirectory: string, config?: Partial<MemoryConfig>): string;
33
+ export declare function readLegacyJsonl(rootDirectory: string, config?: Partial<MemoryConfig>): Promise<JsonlImportPayload>;
34
+ export declare function backupLegacyJsonl(rootDirectory: string, config?: Partial<MemoryConfig>): Promise<JsonlBackupResult[]>;
35
+ export declare function writeJsonlExport(rootDirectory: string, config: Partial<MemoryConfig>, memories: MemoryRecord[], proposals: MemoryProposal[]): Promise<{
36
+ directory: string;
37
+ memoriesPath: string;
38
+ proposalsPath: string;
39
+ }>;
40
+ export declare function writeMigrationReport(rootDirectory: string, report: JsonlMigrationReport, config?: Partial<MemoryConfig>): Promise<string>;
41
+ export declare function readMigrationReport(rootDirectory: string, config?: Partial<MemoryConfig>): Promise<JsonlMigrationReport | null>;
42
+ export declare function getLegacyJsonlFileStatus(rootDirectory: string, config?: Partial<MemoryConfig>): Promise<Array<{
43
+ file: 'memories.jsonl' | 'proposals.jsonl';
44
+ path: string;
45
+ exists: boolean;
46
+ sizeBytes: number;
47
+ }>>;
@@ -1,7 +1,14 @@
1
1
  import { type MemoryConfig } from './config';
2
+ import { type JsonlMigrationReport } from './jsonl-migration';
2
3
  import type { MemoryProposalStore, MemoryProvider, MemoryRecallUsageEvent } from './provider';
3
4
  import type { RecallScoringDiagnostics } from './scoring';
4
5
  import type { MemoryListFilter, MemoryProposal, MemoryRecord, RecallRequest, RecallResultItem } from './types';
6
+ export interface SQLiteJsonlImportResult {
7
+ importedMemories: number;
8
+ importedProposals: number;
9
+ invalidRows: JsonlMigrationReport['invalidRows'];
10
+ totalRows: number;
11
+ }
5
12
  export declare class SQLiteMemoryProvider implements MemoryProvider, MemoryProposalStore {
6
13
  readonly name = "sqlite";
7
14
  private readonly rootDirectory;
@@ -10,6 +17,7 @@ export declare class SQLiteMemoryProvider implements MemoryProvider, MemoryPropo
10
17
  private db;
11
18
  private memories;
12
19
  private proposals;
20
+ private lastAutomaticJsonlMigration;
13
21
  constructor(rootDirectory: string, config?: Partial<MemoryConfig>);
14
22
  private databasePath;
15
23
  initialize(): Promise<void>;
@@ -29,10 +37,23 @@ export declare class SQLiteMemoryProvider implements MemoryProvider, MemoryPropo
29
37
  limit?: number;
30
38
  }): Promise<MemoryProposal[]>;
31
39
  close(): void;
40
+ importJsonl(): Promise<SQLiteJsonlImportResult>;
41
+ exportJsonl(): Promise<{
42
+ directory: string;
43
+ memoriesPath: string;
44
+ proposalsPath: string;
45
+ memories: number;
46
+ proposals: number;
47
+ }>;
48
+ hasMigration(name: string): boolean;
49
+ markMigration(version: number, name: string): void;
32
50
  private runMigrations;
33
51
  private loadMemories;
34
52
  private loadProposals;
35
53
  private writeMemory;
54
+ private writeProposal;
55
+ private migrateLegacyJsonlIfNeeded;
56
+ private importLegacyJsonlRows;
36
57
  private event;
37
58
  private insertEvent;
38
59
  private requireDb;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.33.2",
3
+ "version": "7.34.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",