@equationalapplications/core-llm-wiki 4.14.0 → 4.14.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.
- package/README.md +12 -0
- package/dist/{chunk-6FWG2DG4.mjs → chunk-24ANTHZB.mjs} +77 -23
- package/dist/chunk-24ANTHZB.mjs.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +84 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -4
- package/dist/index.mjs.map +1 -1
- package/dist/{testing-CDIDE4Jd.d.mts → testing-DW1qufP0.d.mts} +15 -1
- package/dist/{testing-CDIDE4Jd.d.ts → testing-DW1qufP0.d.ts} +15 -1
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +290 -236
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-6FWG2DG4.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __privateAdd, EmbeddingService, SearchService, JobManager, PromptService, IngestionService, MaintenanceService, ImportExportService, RetrievalService, WriteService, __privateGet, __privateSet, normalizeSourceRef, normalizeSourceHash, generateId } from './chunk-
|
|
2
|
-
export { HOOK_TIMEOUT_MARKER, PromptService, PrunePartialFailureError, WikiBusyError, parseEmbedding } from './chunk-
|
|
1
|
+
import { __privateAdd, EmbeddingService, SearchService, JobManager, PromptService, IngestionService, MaintenanceService, ImportExportService, RetrievalService, WriteService, __privateGet, __privateSet, normalizeSourceRef, normalizeSourceHash, generateId } from './chunk-24ANTHZB.mjs';
|
|
2
|
+
export { HOOK_TIMEOUT_MARKER, PromptService, PrunePartialFailureError, WikiBusyError, parseEmbedding } from './chunk-24ANTHZB.mjs';
|
|
3
3
|
import { buildConceptDocument, buildLogMd, buildIndexMd, buildRootIndexMd } from '@equationalapplications/core-okf';
|
|
4
4
|
|
|
5
5
|
// src/db/schema.ts
|
|
@@ -1410,6 +1410,7 @@ var MetadataRepository = class extends BaseRepository {
|
|
|
1410
1410
|
};
|
|
1411
1411
|
|
|
1412
1412
|
// src/WikiMemory.ts
|
|
1413
|
+
var TABLE_PREFIX_PATTERN = /^[A-Za-z][A-Za-z0-9_]{0,30}_$/;
|
|
1413
1414
|
var _testAccessNonTestEnvWarned;
|
|
1414
1415
|
var WikiMemory = class {
|
|
1415
1416
|
constructor(db, options) {
|
|
@@ -1417,7 +1418,12 @@ var WikiMemory = class {
|
|
|
1417
1418
|
__privateAdd(this, _testAccessNonTestEnvWarned, false);
|
|
1418
1419
|
this.db = db;
|
|
1419
1420
|
this.options = options;
|
|
1420
|
-
this.prefix = options.config?.tablePrefix
|
|
1421
|
+
this.prefix = options.config?.tablePrefix ?? "llm_wiki_";
|
|
1422
|
+
if (!TABLE_PREFIX_PATTERN.test(this.prefix)) {
|
|
1423
|
+
throw new Error(
|
|
1424
|
+
`Invalid tablePrefix: ${JSON.stringify(this.prefix)}. Must match ${TABLE_PREFIX_PATTERN} (letter, then alphanumeric/underscore, ending in "_", max 32 chars total).`
|
|
1425
|
+
);
|
|
1426
|
+
}
|
|
1421
1427
|
this.outboxRepo = new OutboxRepository(db, this.prefix, !!options.config?.enableOutbox);
|
|
1422
1428
|
this.entryRepo = new EntryRepository(db, this.prefix, this.outboxRepo);
|
|
1423
1429
|
this.taskRepo = new TaskRepository(db, this.prefix, this.outboxRepo);
|
|
@@ -1471,6 +1477,7 @@ var WikiMemory = class {
|
|
|
1471
1477
|
this.writeService = new WriteService(
|
|
1472
1478
|
this.db,
|
|
1473
1479
|
this.options,
|
|
1480
|
+
this.entryRepo,
|
|
1474
1481
|
this.eventRepo,
|
|
1475
1482
|
this.metadataRepo,
|
|
1476
1483
|
this.jobManager,
|
|
@@ -1549,7 +1556,7 @@ var WikiMemory = class {
|
|
|
1549
1556
|
async hasChanged(entityId, sourceRef, sourceHash) {
|
|
1550
1557
|
const normalizedRef = normalizeSourceRef(sourceRef);
|
|
1551
1558
|
if (!normalizedRef) {
|
|
1552
|
-
throw new Error(`Invalid sourceRef:
|
|
1559
|
+
throw new Error(`Invalid sourceRef: ${JSON.stringify(sourceRef)}`);
|
|
1553
1560
|
}
|
|
1554
1561
|
const normalizedHash = normalizeSourceHash(sourceHash);
|
|
1555
1562
|
if (!normalizedHash) {
|