@equationalapplications/core-llm-wiki 9.4.3 → 9.5.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.
@@ -42,10 +42,9 @@ var SQLITE_RESULT_CODE_NAMES = {
42
42
  // 2067 = SQLITE_CONSTRAINT_UNIQUE — a UNIQUE index rejecting an INSERT/UPDATE.
43
43
  // better-sqlite3 / node:sqlite enable extended result codes and report it
44
44
  // directly. expo-sqlite never emits it (as of expo-sqlite 58.0.14, per
45
- // #403): it leaves extended result codes off
46
- // and surfaces the same failure as the primary code 19 with the
47
- // "UNIQUE constraint failed" message text, which `extractSqliteCode` below
48
- // refines back to this name (#403).
45
+ // #403): it leaves extended result codes off and surfaces the same failure
46
+ // as the primary code 19 with the "UNIQUE constraint failed" message text,
47
+ // which `extractSqliteCode` below refines back to this name (#403).
49
48
  2067: "SQLITE_CONSTRAINT_UNIQUE",
50
49
  // 267 = SQLITE_CORRUPT_VTAB — a corrupt FTS5 shadow table (ftsCorruptionClass).
51
50
  267: "SQLITE_CORRUPT_VTAB",
@@ -7168,15 +7167,21 @@ DROP TRIGGER IF EXISTS ${ad};`);
7168
7167
  }
7169
7168
  }
7170
7169
  async forget(entityId, params, opts) {
7171
- if (params.clearAll && (params.entryId !== void 0 || params.taskId !== void 0 || params.sourceRef !== void 0 || params.sourceHash !== void 0)) {
7172
- throw new Error("forget() clearAll is mutually exclusive with entryId, taskId, sourceRef, and sourceHash");
7170
+ if (params.clearAll && (params.entryId !== void 0 || params.taskId !== void 0 || params.sourceRef !== void 0 || params.sourceHash !== void 0 || params.eventId !== void 0)) {
7171
+ throw new Error("forget() clearAll is mutually exclusive with entryId, taskId, sourceRef, sourceHash, and eventId");
7173
7172
  }
7174
7173
  if (params.includeEvents && !params.clearAll) {
7175
7174
  throw new Error("forget() includeEvents requires clearAll: true");
7176
7175
  }
7177
- if (params.includeChain && (params.entryId === void 0 || params.clearAll || params.taskId !== void 0 || params.sourceRef !== void 0 || params.sourceHash !== void 0)) {
7176
+ if (params.includeChain && (params.entryId === void 0 || params.clearAll || params.taskId !== void 0 || params.sourceRef !== void 0 || params.sourceHash !== void 0 || params.eventId !== void 0)) {
7178
7177
  throw new Error("forget() includeChain composes only with entryId");
7179
7178
  }
7179
+ if (params.eventId !== void 0 && (params.entryId !== void 0 || params.taskId !== void 0 || params.sourceRef !== void 0 || params.sourceHash !== void 0)) {
7180
+ throw new Error("forget() eventId is mutually exclusive with entryId, taskId, sourceRef, and sourceHash");
7181
+ }
7182
+ if (params.eventId !== void 0 && (typeof params.eventId !== "string" || params.eventId === "")) {
7183
+ throw new Error("Invalid eventId");
7184
+ }
7180
7185
  if (opts?.dryRun === true) {
7181
7186
  return this.forgetDryRun(entityId, params);
7182
7187
  }
@@ -7244,14 +7249,19 @@ DROP TRIGGER IF EXISTS ${ad};`);
7244
7249
  if (sourceRef || sourceHash) {
7245
7250
  for (const id of await this.entryRepo.findIdsBySource(entityId, sourceRef, sourceHash, tx, true)) deletedEntryIds.push(id);
7246
7251
  }
7252
+ if (params.eventId !== void 0) {
7253
+ for (const id of await this.entryRepo.findIdsByPointerEvent(entityId, params.eventId, tx, true)) deletedEntryIds.push(id);
7254
+ }
7247
7255
  const entryPromise = params.entryId ? this.entryRepo.softDelete(params.entryId, entityId, tx).then((r) => r.changes > 0) : null;
7248
7256
  const taskDeletedPromise = params.taskId ? this.taskRepo.softDeleteById(params.taskId, entityId, tx).then((r) => r.changes > 0) : null;
7249
7257
  const refPromise = sourceRef || sourceHash ? this.entryRepo.softDeleteBySource(entityId, tx, sourceRef, sourceHash) : null;
7258
+ const pointerPromise = params.eventId !== void 0 ? this.entryRepo.softDeleteByPointerEvent(entityId, params.eventId, tx) : null;
7250
7259
  const sourceRefIndexPromise = touchSourceRefIndex && sourceRef ? this.sourceRefIndexRepo.softDeleteByEntityAndSourceRef(entityId, sourceRef, tx).then(() => void 0) : null;
7251
- const [entryResult, taskResult, refResult] = await Promise.all([
7260
+ const [entryResult, taskResult, refResult, pointerResult] = await Promise.all([
7252
7261
  entryPromise ?? Promise.resolve(false),
7253
7262
  taskDeletedPromise ?? Promise.resolve(false),
7254
7263
  refPromise ?? Promise.resolve(0),
7264
+ pointerPromise ?? Promise.resolve(0),
7255
7265
  sourceRefIndexPromise ?? Promise.resolve(void 0)
7256
7266
  ]);
7257
7267
  if (entryResult) deletedEntries++;
@@ -7260,6 +7270,7 @@ DROP TRIGGER IF EXISTS ${ad};`);
7260
7270
  }
7261
7271
  if (taskResult) deletedTasks++;
7262
7272
  deletedEntries += refResult;
7273
+ deletedEntries += pointerResult;
7263
7274
  }
7264
7275
  if (ledgerOn && this.vectorRemoval?.gate() === "hook" && deletedEntryIds.length > 0) {
7265
7276
  await this.vectorRemovalRepo?.backstopEnqueue(entityId, Array.from(new Set(deletedEntryIds)), now, tx);
@@ -7405,7 +7416,7 @@ DROP TRIGGER IF EXISTS ${ad};`);
7405
7416
  return out;
7406
7417
  }
7407
7418
  if (params.entryId !== void 0 || params.taskId !== void 0) {
7408
- throw new Error("forget({ dryRun: true }) does not support entryId/taskId selectors (entryId is accepted only with includeChain); use sourceRef/sourceHash or clearAll");
7419
+ throw new Error("forget({ dryRun: true }) does not support entryId/taskId selectors (entryId is accepted only with includeChain); use sourceRef/sourceHash, eventId, or clearAll");
7409
7420
  }
7410
7421
  if (params.clearAll) {
7411
7422
  const entries2 = await this.entryRepo.countLiveByEntityId(entityId);
@@ -7416,6 +7427,10 @@ DROP TRIGGER IF EXISTS ${ad};`);
7416
7427
  }
7417
7428
  return { deleted: { entries: entries2, tasks }, metadataReset: true };
7418
7429
  }
7430
+ if (params.eventId !== void 0) {
7431
+ const entries2 = await this.entryRepo.countLiveByPointerEvent(entityId, params.eventId);
7432
+ return { deleted: { entries: entries2, tasks: 0 } };
7433
+ }
7419
7434
  const sourceRef = params.sourceRef !== void 0 ? normalizeSourceRef(params.sourceRef) : null;
7420
7435
  if (params.sourceRef !== void 0 && !sourceRef) throw new Error("Invalid sourceRef");
7421
7436
  const sourceHash = params.sourceHash !== void 0 ? normalizeSourceHash(params.sourceHash) : null;
@@ -10706,5 +10721,5 @@ var WriteService = class {
10706
10721
  };
10707
10722
 
10708
10723
  export { BaseRepository, CURRENT_SCHEMA_VERSION, CheckpointIncompleteError, DEFAULT_CHUNK_OVERLAP, DEFAULT_MAX_CHUNK_LENGTH, DEFAULT_MAX_EMBED_CHARS, DiagnosticBuffer, EMBED_CHARS_CEILING, EdgeRepository, EmbeddingService, EraseStepError, FTS5_DRAIN_CHUNK, FTS5_REBUILD_SNAPSHOT_KEY, FTS5_REBUILD_WM_KEY, FTS5_RECLAIM_MERGE_PAGES, FTS5_RETIRED_COUNTER_KEY, FTS5_RETIRED_TABLES_KEY, FTS5_STATE_KEY, FTS5_SWEEP_CURSOR_KEY, HEAL_ANCHORS_PER_CANDIDATE, HEAL_BATCH_SIZE, HEAL_MAX_FACT_BODY_CHARS_L3, HEAL_MAX_TASKS, HEAL_RECHECK_MS, HOOK_TIMEOUT_MARKER, ImportExportService, IngestionService, JobManager, MAX_EMBED_ATTEMPTS, MIGRATIONS, MaintenanceService, MetadataRepository, ONTOLOGY_BACKFILL_BATCH_SIZE, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS, ONTOLOGY_BACKFILL_RECHECK_MS, ONTOLOGY_BACKFILL_SYSTEM_PROMPT, PromptService, PrunePartialFailureError, RetrievalService, SearchService, SourceStoreService, TemporalService, UnavailableIndexStrategy, UsageMeter, VectorRemovalRepository, VectorRemovalService, WikiBusyError, WikiDraftNotFound, WikiDuplicateHashError, WikiExternalDeletionError, WikiGraphNodeOwnershipConflict, WikiIngestEmptyError, WikiInvalidReadOptions, WikiMigrationRequiredError, WikiParseError, WikiSearchUnavailableError, WikiSourceRefHashCollision, WikiStrictOntologyViolation, WikiSupersedeError, WikiTransactionError, WriteService, __privateAdd, __privateGet, __privateSet, assertEntityId, assertEpochMs, chunkText, configureRandomSource, createLegacySourceTypeIndex, createdAtValue, detectSchemaVersion, drainChunkSql, drainHiSql, edgeTripleAllowed, emitDiagnostic, emptyManifest, entityDrainChunkSql, entityDrainHiSql, entitySummaryMetaKey, extractSqliteCode, factTokenCost, fts5LedgerDropSql, fts5PendingIndexesDdl, fts5TablesDdl, fts5TriggerNames, fts5TriggersDdl, generateId, idDrainChunkSql, idReindexChunkSql, isLiveAt, isRetiredTableName, isUsableDate, isWikiSearchUnavailableError, liveAtSql, normalizeSourceHash, normalizeSourceRef, normalizeTitleKey, packFactsByBudget, parseEmbedding, parseJsonArray, parseJsonObject, parseStoredSourcePointer, passageFtsTablesDdl, passageFtsTriggerNames, passageFtsTriggersDdl, probePendingWork, readRebuildProgress, reanchorRebuildFingerprint, resolveEdgeDefinitions, resolveGrounding, resolveLibrarianStrategy, resolveNodeType, retiredTableName, runSourceRefNormalize, safeSlice, serializeSourcePointer, setupDatabase, sweepChunkSql, sweepHiSql, typeSatisfies, validateInlineEdges, validateManifest, validateSourcePointerValue, warnChangedDefaultsOnce, windowChunkSql, windowHiSql, writeNormalizeStamp, writeRebuildStart };
10709
- //# sourceMappingURL=chunk-TRLMWC5G.mjs.map
10710
- //# sourceMappingURL=chunk-TRLMWC5G.mjs.map
10724
+ //# sourceMappingURL=chunk-ZVVZACYI.mjs.map
10725
+ //# sourceMappingURL=chunk-ZVVZACYI.mjs.map