@equationalapplications/core-llm-wiki 4.18.0 → 4.19.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.
@@ -709,6 +709,7 @@ declare class MetadataRepository extends BaseRepository {
709
709
  deleteCheckpoint(entityId: string, tx: SQLiteAdapter): Promise<void>;
710
710
  getMeta(key: string, tx?: SQLiteAdapter): Promise<string | null>;
711
711
  setMeta(key: string, value: string, tx: SQLiteAdapter): Promise<void>;
712
+ deleteMeta(key: string, tx?: SQLiteAdapter): Promise<void>;
712
713
  clearDimensionMismatch(tx: SQLiteAdapter): Promise<void>;
713
714
  tableExists(tableName: string, tx?: SQLiteAdapter): Promise<boolean>;
714
715
  getTableDdl(tableName: string, tx?: SQLiteAdapter): Promise<string | null>;
@@ -1302,6 +1303,8 @@ declare class WikiMemory {
1302
1303
  subscribeEntityStatus(entityId: string, callback: (status: EntityStatus) => void): () => void;
1303
1304
  clearVectorCache(): void;
1304
1305
  exportDump(entityIds?: string[]): Promise<MemoryDump>;
1306
+ /** Entity summary prose persisted from an OKF profile ≥ 1 import; null when none stored. */
1307
+ getEntitySummary(entityId: string): Promise<string | null>;
1305
1308
  importDump(dump: MemoryDump, opts?: {
1306
1309
  merge?: boolean;
1307
1310
  }): Promise<void>;
@@ -709,6 +709,7 @@ declare class MetadataRepository extends BaseRepository {
709
709
  deleteCheckpoint(entityId: string, tx: SQLiteAdapter): Promise<void>;
710
710
  getMeta(key: string, tx?: SQLiteAdapter): Promise<string | null>;
711
711
  setMeta(key: string, value: string, tx: SQLiteAdapter): Promise<void>;
712
+ deleteMeta(key: string, tx?: SQLiteAdapter): Promise<void>;
712
713
  clearDimensionMismatch(tx: SQLiteAdapter): Promise<void>;
713
714
  tableExists(tableName: string, tx?: SQLiteAdapter): Promise<boolean>;
714
715
  getTableDdl(tableName: string, tx?: SQLiteAdapter): Promise<string | null>;
@@ -1302,6 +1303,8 @@ declare class WikiMemory {
1302
1303
  subscribeEntityStatus(entityId: string, callback: (status: EntityStatus) => void): () => void;
1303
1304
  clearVectorCache(): void;
1304
1305
  exportDump(entityIds?: string[]): Promise<MemoryDump>;
1306
+ /** Entity summary prose persisted from an OKF profile ≥ 1 import; null when none stored. */
1307
+ getEntitySummary(entityId: string): Promise<string | null>;
1305
1308
  importDump(dump: MemoryDump, opts?: {
1306
1309
  merge?: boolean;
1307
1310
  }): Promise<void>;
@@ -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-BfxdUHg9.mjs';
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';
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-BfxdUHg9.js';
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';
2
2
  import 'minisearch';
package/dist/testing.js CHANGED
@@ -369,6 +369,16 @@ var EmbeddingService = class {
369
369
  }
370
370
  };
371
371
 
372
+ // src/utils/ontology.ts
373
+ function normalizeTitleKey(title) {
374
+ return title.trim().toLowerCase().replace(/\s+/g, " ");
375
+ }
376
+
377
+ // src/repositories/MetadataRepository.ts
378
+ function entitySummaryMetaKey(entityId) {
379
+ return `entity_summary:${entityId}`;
380
+ }
381
+
372
382
  // src/services/ImportExportService.ts
373
383
  var MAX_EMBEDDING_BLOB_BYTES = 32 * 1024;
374
384
  var IMPORT_TITLE_MAX = 500;
@@ -424,11 +434,12 @@ var ImportExportService = class {
424
434
  }
425
435
  }
426
436
  async getFullBundle(entityId, opts) {
427
- const [factsRaw, tasks, events, edges] = await Promise.all([
437
+ const [factsRaw, tasks, events, edges, summaryValue] = await Promise.all([
428
438
  opts?.includeBlobs ? this.entryRepo.findAllByEntityIdWithBlobs(entityId) : this.entryRepo.findAllByEntityId(entityId),
429
439
  this.taskRepo.findAllByEntityId(entityId),
430
440
  this.eventRepo.getByEntityId(entityId, opts?.maxEvents),
431
- this.edgeRepo.getByEntityId(entityId)
441
+ this.edgeRepo.getByEntityId(entityId),
442
+ this.metadataRepo.getMeta(entitySummaryMetaKey(entityId))
432
443
  ]);
433
444
  const facts = factsRaw.map((f) => {
434
445
  const {
@@ -447,7 +458,13 @@ var ImportExportService = class {
447
458
  tags: typeof factBase.tags === "string" ? JSON.parse(factBase.tags) : factBase.tags
448
459
  };
449
460
  });
450
- return { facts, tasks, events, edges };
461
+ return {
462
+ facts,
463
+ tasks,
464
+ events,
465
+ edges,
466
+ ...summaryValue != null ? { summary: summaryValue } : {}
467
+ };
451
468
  }
452
469
  /** Single-entity import transaction + post-processing; package-internal hook for tests. */
453
470
  async doImportEntity(entityId, bundle, merge) {
@@ -472,6 +489,11 @@ var ImportExportService = class {
472
489
  await this.edgeRepo.bulkDeleteByEntityId(entityId, tx);
473
490
  await this.metadataRepo.deleteCheckpoint(entityId, tx);
474
491
  }
492
+ if (bundle.summary !== void 0) {
493
+ await this.metadataRepo.setMeta(entitySummaryMetaKey(entityId), bundle.summary, tx);
494
+ } else if (!merge) {
495
+ await this.metadataRepo.deleteMeta(entitySummaryMetaKey(entityId), tx);
496
+ }
475
497
  const factIds = bundle.facts.map((fact) => fact.id);
476
498
  const existingFactsById = /* @__PURE__ */ new Map();
477
499
  const existingFacts = await this.entryRepo.findExistingMetadataByIds(
@@ -795,11 +817,6 @@ After running the migration SQL, restart your application.`
795
817
  );
796
818
  }
797
819
  };
798
-
799
- // src/utils/ontology.ts
800
- function normalizeTitleKey(title) {
801
- return title.trim().toLowerCase().replace(/\s+/g, " ");
802
- }
803
820
  function generateId(prefix = "") {
804
821
  if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
805
822
  return prefix + crypto.randomUUID().replace(/-/g, "").substring(0, 24);
@@ -1278,6 +1295,7 @@ var MaintenanceService = class {
1278
1295
  deletedEntries = await this.entryRepo.bulkSoftDeleteByEntityId(entityId, tx);
1279
1296
  deletedTasks = await this.taskRepo.bulkSoftDeleteByEntityId(entityId, tx);
1280
1297
  await this.metadataRepo.updateCheckpoint(entityId, { memory: 0, heal: 0 }, tx);
1298
+ await this.metadataRepo.deleteMeta(entitySummaryMetaKey(entityId), tx);
1281
1299
  } else {
1282
1300
  const hasIdSelectors = params.entryId !== void 0 || params.taskId !== void 0;
1283
1301
  const hasSourceSelectors = params.sourceRef !== void 0 || params.sourceHash !== void 0;