@equationalapplications/core-llm-wiki 4.19.0 → 4.20.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.
@@ -13,6 +13,15 @@ interface SQLiteAdapter {
13
13
  }>;
14
14
  getAllAsync<T>(sql: string, params?: unknown[]): Promise<T[]>;
15
15
  getFirstAsync<T>(sql: string, params?: unknown[]): Promise<T | null>;
16
+ /**
17
+ * Runs `fn` inside a transaction. A bare adapter implementation is not required to
18
+ * serialize concurrent calls itself — `WikiMemory` wraps every adapter it's given in
19
+ * `withSerializedTransactions` (see `db/serializedAdapter.ts`), which is what makes
20
+ * transactions serialize in practice. Once wrapped, inside the callback use ONLY the
21
+ * provided `tx` handle — never the outer database handle (captured via closure or
22
+ * `this.db`). Calling the outer handle deadlocks against the transaction mutex;
23
+ * calling `tx.withTransactionAsync` throws (nested transactions are unsupported).
24
+ */
16
25
  withTransactionAsync<T>(fn: (tx: SQLiteAdapter) => Promise<T>): Promise<T>;
17
26
  closeAsync(): Promise<void>;
18
27
  }
@@ -468,6 +477,19 @@ declare class WikiBusyError extends Error {
468
477
  readonly entityId: string;
469
478
  constructor(operation: WikiBusyOperation, entityId: string);
470
479
  }
480
+ /**
481
+ * Thrown by the serialized transaction wrapper when a SQLite driver error
482
+ * escapes a transaction callback (nested BEGIN, SQLITE_BUSY, constraint
483
+ * violation). Domain errors thrown from callback logic pass through unwrapped.
484
+ * Stable `instanceof` target for observability, mirroring {@link WikiBusyError}.
485
+ */
486
+ declare class WikiTransactionError extends Error {
487
+ /** Best-effort SQLite code lifted from the driver error, e.g. 'SQLITE_BUSY'. */
488
+ readonly sqliteErrorCode?: string;
489
+ constructor(message: string, options: {
490
+ cause: unknown;
491
+ });
492
+ }
471
493
  declare class PrunePartialFailureError extends Error {
472
494
  readonly deleted: number;
473
495
  readonly failedAt: string;
@@ -1365,4 +1387,4 @@ declare class WikiMemory {
1365
1387
  }): Promise<void>;
1366
1388
  }
1367
1389
 
1368
- export { type WikiMemoryTestAccess as A, type WikiOutboxEvent as B, type WikiTask as C, EmbeddingService as D, type EntityStatus as E, type FormatContextOptions as F, type GraphNeighborhood as G, HOOK_TIMEOUT_MARKER as H, ImportExportService as I, IngestionService as J, JobManager as K, type LLMProvider as L, type MemoryBundle as M, MaintenanceService as N, type OntologyConfig as O, type PromptOverrides as P, RetrievalService as Q, type ReadOptions as R, type SQLiteAdapter as S, SearchService as T, WriteService as U, type VectorRanker as V, type WikiOptions as W, type MemoryDump as a, type FormattedMemoryDump as b, WikiMemory as c, type ExtractedFact as d, type ExtractedFactEdge as e, type ExtractedFactWithOntology as f, type ExtractedTask as g, type GraphTraversalOptions as h, type OntologyEdgeType as i, type OntologyManifest as j, type OntologyMode as k, type OntologyNodeType as l, type OntologyPromptContext as m, type OntologyUpdates as n, PromptService as o, PrunePartialFailureError as p, type VectorRankerFallback as q, type VectorRankerRankArgs as r, type VectorRankerSemanticResult as s, WikiBusyError as t, type WikiBusyOperation as u, type WikiCheckpoint as v, type WikiConfig as w, type WikiEdge as x, type WikiEvent as y, type WikiFact as z };
1390
+ export { type WikiMemoryTestAccess as A, type WikiOutboxEvent as B, type WikiTask as C, WikiTransactionError as D, type EntityStatus as E, type FormatContextOptions as F, type GraphNeighborhood as G, HOOK_TIMEOUT_MARKER as H, EmbeddingService as I, ImportExportService as J, IngestionService as K, type LLMProvider as L, type MemoryBundle as M, JobManager as N, type OntologyConfig as O, type PromptOverrides as P, MaintenanceService as Q, type ReadOptions as R, type SQLiteAdapter as S, RetrievalService as T, SearchService as U, type VectorRanker as V, type WikiOptions as W, WriteService as X, type MemoryDump as a, type FormattedMemoryDump as b, WikiMemory as c, type ExtractedFact as d, type ExtractedFactEdge as e, type ExtractedFactWithOntology as f, type ExtractedTask as g, type GraphTraversalOptions as h, type OntologyEdgeType as i, type OntologyManifest as j, type OntologyMode as k, type OntologyNodeType as l, type OntologyPromptContext as m, type OntologyUpdates as n, PromptService as o, PrunePartialFailureError as p, type VectorRankerFallback as q, type VectorRankerRankArgs as r, type VectorRankerSemanticResult as s, WikiBusyError as t, type WikiBusyOperation as u, type WikiCheckpoint as v, type WikiConfig as w, type WikiEdge as x, type WikiEvent as y, type WikiFact as z };
@@ -13,6 +13,15 @@ interface SQLiteAdapter {
13
13
  }>;
14
14
  getAllAsync<T>(sql: string, params?: unknown[]): Promise<T[]>;
15
15
  getFirstAsync<T>(sql: string, params?: unknown[]): Promise<T | null>;
16
+ /**
17
+ * Runs `fn` inside a transaction. A bare adapter implementation is not required to
18
+ * serialize concurrent calls itself — `WikiMemory` wraps every adapter it's given in
19
+ * `withSerializedTransactions` (see `db/serializedAdapter.ts`), which is what makes
20
+ * transactions serialize in practice. Once wrapped, inside the callback use ONLY the
21
+ * provided `tx` handle — never the outer database handle (captured via closure or
22
+ * `this.db`). Calling the outer handle deadlocks against the transaction mutex;
23
+ * calling `tx.withTransactionAsync` throws (nested transactions are unsupported).
24
+ */
16
25
  withTransactionAsync<T>(fn: (tx: SQLiteAdapter) => Promise<T>): Promise<T>;
17
26
  closeAsync(): Promise<void>;
18
27
  }
@@ -468,6 +477,19 @@ declare class WikiBusyError extends Error {
468
477
  readonly entityId: string;
469
478
  constructor(operation: WikiBusyOperation, entityId: string);
470
479
  }
480
+ /**
481
+ * Thrown by the serialized transaction wrapper when a SQLite driver error
482
+ * escapes a transaction callback (nested BEGIN, SQLITE_BUSY, constraint
483
+ * violation). Domain errors thrown from callback logic pass through unwrapped.
484
+ * Stable `instanceof` target for observability, mirroring {@link WikiBusyError}.
485
+ */
486
+ declare class WikiTransactionError extends Error {
487
+ /** Best-effort SQLite code lifted from the driver error, e.g. 'SQLITE_BUSY'. */
488
+ readonly sqliteErrorCode?: string;
489
+ constructor(message: string, options: {
490
+ cause: unknown;
491
+ });
492
+ }
471
493
  declare class PrunePartialFailureError extends Error {
472
494
  readonly deleted: number;
473
495
  readonly failedAt: string;
@@ -1365,4 +1387,4 @@ declare class WikiMemory {
1365
1387
  }): Promise<void>;
1366
1388
  }
1367
1389
 
1368
- export { type WikiMemoryTestAccess as A, type WikiOutboxEvent as B, type WikiTask as C, EmbeddingService as D, type EntityStatus as E, type FormatContextOptions as F, type GraphNeighborhood as G, HOOK_TIMEOUT_MARKER as H, ImportExportService as I, IngestionService as J, JobManager as K, type LLMProvider as L, type MemoryBundle as M, MaintenanceService as N, type OntologyConfig as O, type PromptOverrides as P, RetrievalService as Q, type ReadOptions as R, type SQLiteAdapter as S, SearchService as T, WriteService as U, type VectorRanker as V, type WikiOptions as W, type MemoryDump as a, type FormattedMemoryDump as b, WikiMemory as c, type ExtractedFact as d, type ExtractedFactEdge as e, type ExtractedFactWithOntology as f, type ExtractedTask as g, type GraphTraversalOptions as h, type OntologyEdgeType as i, type OntologyManifest as j, type OntologyMode as k, type OntologyNodeType as l, type OntologyPromptContext as m, type OntologyUpdates as n, PromptService as o, PrunePartialFailureError as p, type VectorRankerFallback as q, type VectorRankerRankArgs as r, type VectorRankerSemanticResult as s, WikiBusyError as t, type WikiBusyOperation as u, type WikiCheckpoint as v, type WikiConfig as w, type WikiEdge as x, type WikiEvent as y, type WikiFact as z };
1390
+ export { type WikiMemoryTestAccess as A, type WikiOutboxEvent as B, type WikiTask as C, WikiTransactionError as D, type EntityStatus as E, type FormatContextOptions as F, type GraphNeighborhood as G, HOOK_TIMEOUT_MARKER as H, EmbeddingService as I, ImportExportService as J, IngestionService as K, type LLMProvider as L, type MemoryBundle as M, JobManager as N, type OntologyConfig as O, type PromptOverrides as P, MaintenanceService as Q, type ReadOptions as R, type SQLiteAdapter as S, RetrievalService as T, SearchService as U, type VectorRanker as V, type WikiOptions as W, WriteService as X, type MemoryDump as a, type FormattedMemoryDump as b, WikiMemory as c, type ExtractedFact as d, type ExtractedFactEdge as e, type ExtractedFactWithOntology as f, type ExtractedTask as g, type GraphTraversalOptions as h, type OntologyEdgeType as i, type OntologyManifest as j, type OntologyMode as k, type OntologyNodeType as l, type OntologyPromptContext as m, type OntologyUpdates as n, PromptService as o, PrunePartialFailureError as p, type VectorRankerFallback as q, type VectorRankerRankArgs as r, type VectorRankerSemanticResult as s, WikiBusyError as t, type WikiBusyOperation as u, type WikiCheckpoint as v, type WikiConfig as w, type WikiEdge as x, type WikiEvent as y, type WikiFact as z };
@@ -1,2 +1,2 @@
1
- export { D as EmbeddingService, I as ImportExportService, J as IngestionService, K as JobManager, K as JobManagerType, N as MaintenanceService, Q as RetrievalService, T as SearchService, T as SearchServiceType, A as WikiMemoryTestAccess, U as WriteService } from './testing-DP3lus54.mjs';
1
+ export { I as EmbeddingService, J as ImportExportService, K as IngestionService, N as JobManager, N as JobManagerType, Q as MaintenanceService, T as RetrievalService, U as SearchService, U as SearchServiceType, A as WikiMemoryTestAccess, X as WriteService } from './testing-BVN_g414.mjs';
2
2
  import 'minisearch';
package/dist/testing.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { D as EmbeddingService, I as ImportExportService, J as IngestionService, K as JobManager, K as JobManagerType, N as MaintenanceService, Q as RetrievalService, T as SearchService, T as SearchServiceType, A as WikiMemoryTestAccess, U as WriteService } from './testing-DP3lus54.js';
1
+ export { I as EmbeddingService, J as ImportExportService, K as IngestionService, N as JobManager, N as JobManagerType, Q as MaintenanceService, T as RetrievalService, U as SearchService, U as SearchServiceType, A as WikiMemoryTestAccess, X as WriteService } from './testing-BVN_g414.js';
2
2
  import 'minisearch';