@equationalapplications/core-llm-wiki 4.8.0 → 4.10.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.
@@ -52,6 +52,12 @@ interface WikiConfig {
52
52
  hybridWeight?: number;
53
53
  /** Global prompt overrides for text generation calls (`ingestDocument`, `runLibrarian`, `runHeal`). Does not affect embedding generation. Runtime overrides on individual method calls take precedence. */
54
54
  prompts?: PromptOverrides;
55
+ /**
56
+ * When true, entry and task mutations append an event to the internal outbox table.
57
+ * The table is always created; this flag only controls whether writes occur.
58
+ * @default false
59
+ */
60
+ enableOutbox?: boolean;
55
61
  }
56
62
  interface ReadOptions {
57
63
  maxResults?: number;
@@ -363,6 +369,16 @@ declare class PrunePartialFailureError extends Error {
363
369
  }
364
370
  declare const HOOK_TIMEOUT_MARKER: unique symbol;
365
371
 
372
+ interface WikiOutboxEvent<T = unknown> {
373
+ id: string;
374
+ entity_id: string;
375
+ table_name: string;
376
+ record_id: string;
377
+ operation: 'INSERT' | 'UPDATE' | 'DELETE';
378
+ payload: T;
379
+ created_at: number;
380
+ }
381
+
366
382
  /**
367
383
  * Abstract base for all repositories.
368
384
  * Provides db accessor + prefix-aware helpers.
@@ -379,8 +395,11 @@ declare abstract class BaseRepository {
379
395
  }
380
396
 
381
397
  declare class OutboxRepository extends BaseRepository {
398
+ private enableOutbox;
399
+ constructor(db: SQLiteAdapter, prefix: string, enableOutbox?: boolean);
382
400
  /**
383
401
  * Insert a new outbox event within the provided transaction.
402
+ * No-op when enableOutbox is false.
384
403
  * `tx` is required — callers must always pass the active transaction
385
404
  * so the write is atomic with the main table mutation.
386
405
  */
@@ -392,7 +411,7 @@ declare class OutboxRepository extends BaseRepository {
392
411
  payload: any;
393
412
  }, tx: SQLiteAdapter): Promise<void>;
394
413
  /**
395
- * Fetch pending outbox rows ordered by created_at ASC.
414
+ * Fetch pending outbox rows ordered by created_at ASC, rowid ASC.
396
415
  * Reads directly from `this.db` (not a transaction).
397
416
  */
398
417
  fetchPending(limit?: number): Promise<any[]>;
@@ -1107,6 +1126,16 @@ declare class WikiMemory {
1107
1126
  truncated: boolean;
1108
1127
  chunks: number;
1109
1128
  }>;
1129
+ /**
1130
+ * Returns up to `limit` unprocessed outbox events, oldest first.
1131
+ * Works regardless of enableOutbox value — allows draining after disabling.
1132
+ */
1133
+ getUnprocessedOutboxEvents(limit?: number): Promise<WikiOutboxEvent[]>;
1134
+ /**
1135
+ * Deletes the given event IDs from the outbox table.
1136
+ * Call after successfully committing events to the external system.
1137
+ */
1138
+ markOutboxEventsProcessed(eventIds: string[]): Promise<void>;
1110
1139
  }
1111
1140
 
1112
- export { type EntityStatus as E, type FormatContextOptions as F, HOOK_TIMEOUT_MARKER as H, ImportExportService as I, JobManager as J, type LLMProvider as L, type MemoryBundle as M, type PromptOverrides as P, type ReadOptions as R, type SQLiteAdapter as S, type VectorRanker as V, type WikiOptions as W, type MemoryDump as a, type FormattedMemoryDump as b, WikiMemory as c, type ExtractedFact as d, type ExtractedTask as e, PromptService as f, PrunePartialFailureError as g, type VectorRankerFallback as h, type VectorRankerRankArgs as i, type VectorRankerSemanticResult as j, WikiBusyError as k, type WikiBusyOperation as l, type WikiCheckpoint as m, type WikiConfig as n, type WikiEvent as o, type WikiFact as p, type WikiMemoryTestAccess as q, type WikiTask as r, EmbeddingService as s, IngestionService as t, MaintenanceService as u, RetrievalService as v, SearchService as w, WriteService as x };
1141
+ export { type EntityStatus as E, type FormatContextOptions as F, HOOK_TIMEOUT_MARKER as H, ImportExportService as I, JobManager as J, type LLMProvider as L, type MemoryBundle as M, type PromptOverrides as P, type ReadOptions as R, type SQLiteAdapter as S, type VectorRanker as V, type WikiOptions as W, type MemoryDump as a, type FormattedMemoryDump as b, WikiMemory as c, type ExtractedFact as d, type ExtractedTask as e, PromptService as f, PrunePartialFailureError as g, type VectorRankerFallback as h, type VectorRankerRankArgs as i, type VectorRankerSemanticResult as j, WikiBusyError as k, type WikiBusyOperation as l, type WikiCheckpoint as m, type WikiConfig as n, type WikiEvent as o, type WikiFact as p, type WikiMemoryTestAccess as q, type WikiOutboxEvent as r, type WikiTask as s, EmbeddingService as t, IngestionService as u, MaintenanceService as v, RetrievalService as w, SearchService as x, WriteService as y };
@@ -52,6 +52,12 @@ interface WikiConfig {
52
52
  hybridWeight?: number;
53
53
  /** Global prompt overrides for text generation calls (`ingestDocument`, `runLibrarian`, `runHeal`). Does not affect embedding generation. Runtime overrides on individual method calls take precedence. */
54
54
  prompts?: PromptOverrides;
55
+ /**
56
+ * When true, entry and task mutations append an event to the internal outbox table.
57
+ * The table is always created; this flag only controls whether writes occur.
58
+ * @default false
59
+ */
60
+ enableOutbox?: boolean;
55
61
  }
56
62
  interface ReadOptions {
57
63
  maxResults?: number;
@@ -363,6 +369,16 @@ declare class PrunePartialFailureError extends Error {
363
369
  }
364
370
  declare const HOOK_TIMEOUT_MARKER: unique symbol;
365
371
 
372
+ interface WikiOutboxEvent<T = unknown> {
373
+ id: string;
374
+ entity_id: string;
375
+ table_name: string;
376
+ record_id: string;
377
+ operation: 'INSERT' | 'UPDATE' | 'DELETE';
378
+ payload: T;
379
+ created_at: number;
380
+ }
381
+
366
382
  /**
367
383
  * Abstract base for all repositories.
368
384
  * Provides db accessor + prefix-aware helpers.
@@ -379,8 +395,11 @@ declare abstract class BaseRepository {
379
395
  }
380
396
 
381
397
  declare class OutboxRepository extends BaseRepository {
398
+ private enableOutbox;
399
+ constructor(db: SQLiteAdapter, prefix: string, enableOutbox?: boolean);
382
400
  /**
383
401
  * Insert a new outbox event within the provided transaction.
402
+ * No-op when enableOutbox is false.
384
403
  * `tx` is required — callers must always pass the active transaction
385
404
  * so the write is atomic with the main table mutation.
386
405
  */
@@ -392,7 +411,7 @@ declare class OutboxRepository extends BaseRepository {
392
411
  payload: any;
393
412
  }, tx: SQLiteAdapter): Promise<void>;
394
413
  /**
395
- * Fetch pending outbox rows ordered by created_at ASC.
414
+ * Fetch pending outbox rows ordered by created_at ASC, rowid ASC.
396
415
  * Reads directly from `this.db` (not a transaction).
397
416
  */
398
417
  fetchPending(limit?: number): Promise<any[]>;
@@ -1107,6 +1126,16 @@ declare class WikiMemory {
1107
1126
  truncated: boolean;
1108
1127
  chunks: number;
1109
1128
  }>;
1129
+ /**
1130
+ * Returns up to `limit` unprocessed outbox events, oldest first.
1131
+ * Works regardless of enableOutbox value — allows draining after disabling.
1132
+ */
1133
+ getUnprocessedOutboxEvents(limit?: number): Promise<WikiOutboxEvent[]>;
1134
+ /**
1135
+ * Deletes the given event IDs from the outbox table.
1136
+ * Call after successfully committing events to the external system.
1137
+ */
1138
+ markOutboxEventsProcessed(eventIds: string[]): Promise<void>;
1110
1139
  }
1111
1140
 
1112
- export { type EntityStatus as E, type FormatContextOptions as F, HOOK_TIMEOUT_MARKER as H, ImportExportService as I, JobManager as J, type LLMProvider as L, type MemoryBundle as M, type PromptOverrides as P, type ReadOptions as R, type SQLiteAdapter as S, type VectorRanker as V, type WikiOptions as W, type MemoryDump as a, type FormattedMemoryDump as b, WikiMemory as c, type ExtractedFact as d, type ExtractedTask as e, PromptService as f, PrunePartialFailureError as g, type VectorRankerFallback as h, type VectorRankerRankArgs as i, type VectorRankerSemanticResult as j, WikiBusyError as k, type WikiBusyOperation as l, type WikiCheckpoint as m, type WikiConfig as n, type WikiEvent as o, type WikiFact as p, type WikiMemoryTestAccess as q, type WikiTask as r, EmbeddingService as s, IngestionService as t, MaintenanceService as u, RetrievalService as v, SearchService as w, WriteService as x };
1141
+ export { type EntityStatus as E, type FormatContextOptions as F, HOOK_TIMEOUT_MARKER as H, ImportExportService as I, JobManager as J, type LLMProvider as L, type MemoryBundle as M, type PromptOverrides as P, type ReadOptions as R, type SQLiteAdapter as S, type VectorRanker as V, type WikiOptions as W, type MemoryDump as a, type FormattedMemoryDump as b, WikiMemory as c, type ExtractedFact as d, type ExtractedTask as e, PromptService as f, PrunePartialFailureError as g, type VectorRankerFallback as h, type VectorRankerRankArgs as i, type VectorRankerSemanticResult as j, WikiBusyError as k, type WikiBusyOperation as l, type WikiCheckpoint as m, type WikiConfig as n, type WikiEvent as o, type WikiFact as p, type WikiMemoryTestAccess as q, type WikiOutboxEvent as r, type WikiTask as s, EmbeddingService as t, IngestionService as u, MaintenanceService as v, RetrievalService as w, SearchService as x, WriteService as y };
@@ -1,2 +1,2 @@
1
- export { s as EmbeddingService, I as ImportExportService, t as IngestionService, J as JobManager, J as JobManagerType, u as MaintenanceService, v as RetrievalService, w as SearchService, w as SearchServiceType, q as WikiMemoryTestAccess, x as WriteService } from './testing-hfpeX01Q.mjs';
1
+ export { t as EmbeddingService, I as ImportExportService, u as IngestionService, J as JobManager, J as JobManagerType, v as MaintenanceService, w as RetrievalService, x as SearchService, x as SearchServiceType, q as WikiMemoryTestAccess, y as WriteService } from './testing-CDIDE4Jd.mjs';
2
2
  import 'minisearch';
package/dist/testing.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { s as EmbeddingService, I as ImportExportService, t as IngestionService, J as JobManager, J as JobManagerType, u as MaintenanceService, v as RetrievalService, w as SearchService, w as SearchServiceType, q as WikiMemoryTestAccess, x as WriteService } from './testing-hfpeX01Q.js';
1
+ export { t as EmbeddingService, I as ImportExportService, u as IngestionService, J as JobManager, J as JobManagerType, v as MaintenanceService, w as RetrievalService, x as SearchService, x as SearchServiceType, q as WikiMemoryTestAccess, y as WriteService } from './testing-CDIDE4Jd.js';
2
2
  import 'minisearch';