@equationalapplications/core-llm-wiki 7.14.0 → 7.15.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.
@@ -803,7 +803,7 @@ type WikiDiagnosticSeverity = 'info' | 'warn' | 'error';
803
803
  */
804
804
  type WikiDiagnosticCode = 'ingest_chunk_failed' | 'fact_rejected' | 'task_rejected' | 'fact_deduplicated' | 'edge_dropped' | 'embedding_failed' | 'hook_failed' | 'background_job_failed' | 'heal_skipped' | 'grounding_missing' | 'grounding_failed' | 'classification_low_confidence' | 'classification_invalid' | 'llm_usage' | 'librarian_gate' | 'librarian_op_rejected' | 'contradicts_document' | 'resolve_failed' | 'read_budget' | 'event_retention_held';
805
805
  /** The service run that emitted the diagnostic. */
806
- type WikiDiagnosticOperation = 'ingest' | 'upsertGraph' | 'librarian' | 'heal' | 'ontologyBackfill' | 'reembed' | 'importDump' | 'write' | 'supersede' | 'read' | 'prune';
806
+ type WikiDiagnosticOperation = 'ingest' | 'upsertGraph' | 'librarian' | 'heal' | 'ontologyBackfill' | 'reembed' | 'importDump' | 'write' | 'supersede' | 'remember' | 'read' | 'prune';
807
807
  /** `'auto'` when a write threshold started the run (auto-librarian / auto-heal); `'call'` when the host did. */
808
808
  type WikiDiagnosticTrigger = 'call' | 'auto';
809
809
  /** Identifiers only — never titles, bodies, quotes, LLM output, provider messages, or hashes of content. */
@@ -1215,6 +1215,27 @@ type SupersedeReplacement = string | {
1215
1215
  source_type?: 'user_stated' | 'user_confirmed' | 'librarian_inferred';
1216
1216
  valid_from?: number;
1217
1217
  };
1218
+ /**
1219
+ * Input to `WikiMemory.remember()` (spec `specs/core-remember/spec.md` §3.1).
1220
+ * Only mutable, host-stated facts: `immutable_document` is reserved for
1221
+ * `ingestDocument()`, `librarian_inferred` for the librarian.
1222
+ */
1223
+ interface RememberInput {
1224
+ /** Required; must be non-empty after trim. Stored verbatim. */
1225
+ title: string;
1226
+ /** Required; any string, '' allowed. Stored verbatim. */
1227
+ body: string;
1228
+ /** Default []. Stored verbatim: no trim, no lowercasing, no cap. */
1229
+ tags?: string[];
1230
+ /** Default 'certain'. Explicit `null` is rejected with TypeError (only absence takes the default). */
1231
+ confidence?: WikiFact['confidence'];
1232
+ /** Default 'user_stated'. Explicit `null` is rejected with TypeError (only absence takes the default). */
1233
+ source_type?: 'user_stated' | 'user_confirmed';
1234
+ /** Resolved against the entity's ontology manifest like an `upsertGraph` node type (spec §3.4). Default null. */
1235
+ okf_type?: string | null;
1236
+ /** Epoch ms the fact became true. Absent ⇒ since `created_at`. */
1237
+ valid_from?: number;
1238
+ }
1218
1239
  /** One page of `listDrafts`. `nextCursor` is opaque; pass it back unchanged. */
1219
1240
  interface DraftPage {
1220
1241
  facts: WikiFact[];
@@ -3516,6 +3537,17 @@ declare class TemporalService {
3516
3537
  history(entityId: string, factId: string): Promise<WikiFact[]>;
3517
3538
  }
3518
3539
 
3540
+ /** Direct mutable-fact writes (spec `specs/core-remember/spec.md` §3.3–§3.6). */
3541
+ declare class RememberService {
3542
+ private db;
3543
+ private entryRepo;
3544
+ private ontologyService;
3545
+ private searchService;
3546
+ private embeddingService;
3547
+ constructor(db: SQLiteAdapter, entryRepo: EntryRepository, ontologyService: OntologyService, searchService: SearchService, embeddingService: EmbeddingService);
3548
+ remember(entityId: string, input: RememberInput): Promise<WikiFact>;
3549
+ }
3550
+
3519
3551
  /** Typed escape hatch for tests — not part of the supported consumer API. */
3520
3552
  interface WikiMemoryTestAccess {
3521
3553
  embeddingService: EmbeddingService;
@@ -3529,6 +3561,7 @@ interface WikiMemoryTestAccess {
3529
3561
  promptService: PromptService;
3530
3562
  graphTraversalService: GraphTraversalService;
3531
3563
  temporalService: TemporalService;
3564
+ rememberService: RememberService;
3532
3565
  entryRepo: EntryRepository;
3533
3566
  sourceRefIndexRepo: SourceRefIndexRepository;
3534
3567
  metadataRepo: MetadataRepository;
@@ -3561,6 +3594,7 @@ declare class WikiMemory {
3561
3594
  private lintRepo;
3562
3595
  private lintService;
3563
3596
  private temporalService;
3597
+ private rememberService;
3564
3598
  private readonly okfTrustWrites;
3565
3599
  constructor(db: SQLiteAdapter, options: WikiOptions);
3566
3600
  /**
@@ -3863,6 +3897,21 @@ declare class WikiMemory {
3863
3897
  }>;
3864
3898
  /** The supersession chain containing `factId`, oldest first. [] when unknown. */
3865
3899
  history(entityId: string, factId: string): Promise<WikiFact[]>;
3900
+ /**
3901
+ * Store one mutable fact directly, with no LLM step (spec
3902
+ * `specs/core-remember/spec.md`). One transaction; resolves with the stored
3903
+ * row read back (`id`, timestamps, defaults, `isStale`, `trustTier`). Never
3904
+ * starts the librarian or heal and writes no event, in `'auto'` and
3905
+ * `'deferred'` mode alike. Embeds through `llmProvider.embed` when present;
3906
+ * keyword-only otherwise. Not idempotent. To replace an existing fact use
3907
+ * `supersede()` so history is kept. Opens its own transaction: do not call
3908
+ * it inside `withTransactionAsync` (the serialized adapter would deadlock).
3909
+ *
3910
+ * Throws `TypeError` on invalid input and `WikiStrictOntologyViolation` for
3911
+ * an `okf_type` the entity's strict manifest does not define; nothing is
3912
+ * written in either case.
3913
+ */
3914
+ remember(entityId: string, input: RememberInput): Promise<WikiFact>;
3866
3915
  /**
3867
3916
  * Full and partial ingestion both reject foreign-owned generated fact IDs with
3868
3917
  * `WikiGraphNodeOwnershipConflict`. Such collisions are unexpected. Ingestion
@@ -4059,5 +4108,5 @@ declare class WikiMemory {
4059
4108
  setGeneratedByTask(taskId: string, entityId: string, actor: string): Promise<void>;
4060
4109
  }
4061
4110
 
4062
- export { PromptService as $, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS as A, ONTOLOGY_BACKFILL_RECHECK_MS as B, HEAL_BATCH_SIZE as H, ONTOLOGY_BACKFILL_BATCH_SIZE as O, PrunePartialFailureError as a0, WikiBusyError as a9, WikiSupersedeError as aA, WikiTransactionError as aD, isWikiSearchUnavailableError as aE, validateManifest as aF, EmbeddingService as aG, ImportExportService as aH, IngestionService as aI, JobManager as aJ, MaintenanceService as aK, RetrievalService as aL, SearchService as aM, WriteService as aN, WikiDraftNotFound as aj, WikiDuplicateHashError as ak, WikiGraphNodeOwnershipConflict as ao, WikiIngestEmptyError as ap, WikiInvalidReadOptions as ar, WikiMigrationRequiredError as au, WikiParseError as aw, WikiSearchUnavailableError as ax, WikiSourceRefHashCollision as ay, WikiStrictOntologyViolation as az, WikiMemory as c, HEAL_RECHECK_MS as s, HOOK_TIMEOUT_MARKER as t };
4063
- export type { ChunkFailure as C, DegradedRecord as D, EmbedFactResult as E, FormatContextOptions as F, GraphNeighborhood as G, IngestDocumentResult as I, OntologyBackfillResult as J, OntologyConfig as K, LLMProvider as L, MemoryBundle as M, OntologyEdgeType as N, OntologyManifest as P, OntologyMode as Q, ReadOptions as R, SQLiteAdapter as S, OntologyNodeType as T, OntologyPromptContext as U, OntologyUpdates as V, WikiOptions as W, PendingMaintenance as X, PendingMigrationWork as Y, PendingSourceStatus as Z, PromptOverrides as _, MemoryDump as a, ReembedResult as a1, RunPendingMaintenanceOptions as a2, RunPendingMaintenanceResult as a3, SupersedeReplacement as a4, VectorRanker as a5, VectorRankerFallback as a6, VectorRankerRankArgs as a7, VectorRankerSemanticResult as a8, WikiSupersedeReason as aB, WikiTask as aC, WikiBusyOperation as aa, WikiCheckpoint as ab, WikiConfig as ac, WikiDiagnostic as ad, WikiDiagnosticCode as ae, WikiDiagnosticDetail as af, WikiDiagnosticOperation as ag, WikiDiagnosticSeverity as ah, WikiDiagnosticTrigger as ai, WikiEdge as al, WikiEvent as am, WikiFact as an, WikiInstructions as aq, WikiLintReport as as, WikiMemoryTestAccess as at, WikiOutboxEvent as av, FormattedMemoryDump as b, ClassifierAnswer as d, ClassifierQuestion as e, ClassifyRequest as f, ClassifyResponse as g, DraftPage as h, EmbedFailureKind as i, EmbeddingMarkerKind as j, EntityMaintenanceReport as k, EntityStatus as l, ExtractedFact as m, ExtractedFactEdge as n, ExtractedFactWithOntology as o, ExtractedTask as p, GraphTraversalOptions as q, GroundingConfig as r, HealResult as u, LibrarianConfig as v, LibrarianGateConfig as w, MaintenanceJob as x, MaintenanceStopReason as y, MigrationPolicy as z };
4111
+ export { PromptService as $, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS as A, ONTOLOGY_BACKFILL_RECHECK_MS as B, HEAL_BATCH_SIZE as H, ONTOLOGY_BACKFILL_BATCH_SIZE as O, PrunePartialFailureError as a0, WikiStrictOntologyViolation as aA, WikiSupersedeError as aB, WikiTransactionError as aE, isWikiSearchUnavailableError as aF, validateManifest as aG, EmbeddingService as aH, ImportExportService as aI, IngestionService as aJ, JobManager as aK, MaintenanceService as aL, RetrievalService as aM, SearchService as aN, WriteService as aO, WikiBusyError as aa, WikiDraftNotFound as ak, WikiDuplicateHashError as al, WikiGraphNodeOwnershipConflict as ap, WikiIngestEmptyError as aq, WikiInvalidReadOptions as as, WikiMigrationRequiredError as av, WikiParseError as ax, WikiSearchUnavailableError as ay, WikiSourceRefHashCollision as az, WikiMemory as c, HEAL_RECHECK_MS as s, HOOK_TIMEOUT_MARKER as t };
4112
+ export type { ChunkFailure as C, DegradedRecord as D, EmbedFactResult as E, FormatContextOptions as F, GraphNeighborhood as G, IngestDocumentResult as I, OntologyBackfillResult as J, OntologyConfig as K, LLMProvider as L, MemoryBundle as M, OntologyEdgeType as N, OntologyManifest as P, OntologyMode as Q, ReadOptions as R, SQLiteAdapter as S, OntologyNodeType as T, OntologyPromptContext as U, OntologyUpdates as V, WikiOptions as W, PendingMaintenance as X, PendingMigrationWork as Y, PendingSourceStatus as Z, PromptOverrides as _, MemoryDump as a, ReembedResult as a1, RememberInput as a2, RunPendingMaintenanceOptions as a3, RunPendingMaintenanceResult as a4, SupersedeReplacement as a5, VectorRanker as a6, VectorRankerFallback as a7, VectorRankerRankArgs as a8, VectorRankerSemanticResult as a9, WikiSupersedeReason as aC, WikiTask as aD, WikiBusyOperation as ab, WikiCheckpoint as ac, WikiConfig as ad, WikiDiagnostic as ae, WikiDiagnosticCode as af, WikiDiagnosticDetail as ag, WikiDiagnosticOperation as ah, WikiDiagnosticSeverity as ai, WikiDiagnosticTrigger as aj, WikiEdge as am, WikiEvent as an, WikiFact as ao, WikiInstructions as ar, WikiLintReport as at, WikiMemoryTestAccess as au, WikiOutboxEvent as aw, FormattedMemoryDump as b, ClassifierAnswer as d, ClassifierQuestion as e, ClassifyRequest as f, ClassifyResponse as g, DraftPage as h, EmbedFailureKind as i, EmbeddingMarkerKind as j, EntityMaintenanceReport as k, EntityStatus as l, ExtractedFact as m, ExtractedFactEdge as n, ExtractedFactWithOntology as o, ExtractedTask as p, GraphTraversalOptions as q, GroundingConfig as r, HealResult as u, LibrarianConfig as v, LibrarianGateConfig as w, MaintenanceJob as x, MaintenanceStopReason as y, MigrationPolicy as z };
@@ -803,7 +803,7 @@ type WikiDiagnosticSeverity = 'info' | 'warn' | 'error';
803
803
  */
804
804
  type WikiDiagnosticCode = 'ingest_chunk_failed' | 'fact_rejected' | 'task_rejected' | 'fact_deduplicated' | 'edge_dropped' | 'embedding_failed' | 'hook_failed' | 'background_job_failed' | 'heal_skipped' | 'grounding_missing' | 'grounding_failed' | 'classification_low_confidence' | 'classification_invalid' | 'llm_usage' | 'librarian_gate' | 'librarian_op_rejected' | 'contradicts_document' | 'resolve_failed' | 'read_budget' | 'event_retention_held';
805
805
  /** The service run that emitted the diagnostic. */
806
- type WikiDiagnosticOperation = 'ingest' | 'upsertGraph' | 'librarian' | 'heal' | 'ontologyBackfill' | 'reembed' | 'importDump' | 'write' | 'supersede' | 'read' | 'prune';
806
+ type WikiDiagnosticOperation = 'ingest' | 'upsertGraph' | 'librarian' | 'heal' | 'ontologyBackfill' | 'reembed' | 'importDump' | 'write' | 'supersede' | 'remember' | 'read' | 'prune';
807
807
  /** `'auto'` when a write threshold started the run (auto-librarian / auto-heal); `'call'` when the host did. */
808
808
  type WikiDiagnosticTrigger = 'call' | 'auto';
809
809
  /** Identifiers only — never titles, bodies, quotes, LLM output, provider messages, or hashes of content. */
@@ -1215,6 +1215,27 @@ type SupersedeReplacement = string | {
1215
1215
  source_type?: 'user_stated' | 'user_confirmed' | 'librarian_inferred';
1216
1216
  valid_from?: number;
1217
1217
  };
1218
+ /**
1219
+ * Input to `WikiMemory.remember()` (spec `specs/core-remember/spec.md` §3.1).
1220
+ * Only mutable, host-stated facts: `immutable_document` is reserved for
1221
+ * `ingestDocument()`, `librarian_inferred` for the librarian.
1222
+ */
1223
+ interface RememberInput {
1224
+ /** Required; must be non-empty after trim. Stored verbatim. */
1225
+ title: string;
1226
+ /** Required; any string, '' allowed. Stored verbatim. */
1227
+ body: string;
1228
+ /** Default []. Stored verbatim: no trim, no lowercasing, no cap. */
1229
+ tags?: string[];
1230
+ /** Default 'certain'. Explicit `null` is rejected with TypeError (only absence takes the default). */
1231
+ confidence?: WikiFact['confidence'];
1232
+ /** Default 'user_stated'. Explicit `null` is rejected with TypeError (only absence takes the default). */
1233
+ source_type?: 'user_stated' | 'user_confirmed';
1234
+ /** Resolved against the entity's ontology manifest like an `upsertGraph` node type (spec §3.4). Default null. */
1235
+ okf_type?: string | null;
1236
+ /** Epoch ms the fact became true. Absent ⇒ since `created_at`. */
1237
+ valid_from?: number;
1238
+ }
1218
1239
  /** One page of `listDrafts`. `nextCursor` is opaque; pass it back unchanged. */
1219
1240
  interface DraftPage {
1220
1241
  facts: WikiFact[];
@@ -3516,6 +3537,17 @@ declare class TemporalService {
3516
3537
  history(entityId: string, factId: string): Promise<WikiFact[]>;
3517
3538
  }
3518
3539
 
3540
+ /** Direct mutable-fact writes (spec `specs/core-remember/spec.md` §3.3–§3.6). */
3541
+ declare class RememberService {
3542
+ private db;
3543
+ private entryRepo;
3544
+ private ontologyService;
3545
+ private searchService;
3546
+ private embeddingService;
3547
+ constructor(db: SQLiteAdapter, entryRepo: EntryRepository, ontologyService: OntologyService, searchService: SearchService, embeddingService: EmbeddingService);
3548
+ remember(entityId: string, input: RememberInput): Promise<WikiFact>;
3549
+ }
3550
+
3519
3551
  /** Typed escape hatch for tests — not part of the supported consumer API. */
3520
3552
  interface WikiMemoryTestAccess {
3521
3553
  embeddingService: EmbeddingService;
@@ -3529,6 +3561,7 @@ interface WikiMemoryTestAccess {
3529
3561
  promptService: PromptService;
3530
3562
  graphTraversalService: GraphTraversalService;
3531
3563
  temporalService: TemporalService;
3564
+ rememberService: RememberService;
3532
3565
  entryRepo: EntryRepository;
3533
3566
  sourceRefIndexRepo: SourceRefIndexRepository;
3534
3567
  metadataRepo: MetadataRepository;
@@ -3561,6 +3594,7 @@ declare class WikiMemory {
3561
3594
  private lintRepo;
3562
3595
  private lintService;
3563
3596
  private temporalService;
3597
+ private rememberService;
3564
3598
  private readonly okfTrustWrites;
3565
3599
  constructor(db: SQLiteAdapter, options: WikiOptions);
3566
3600
  /**
@@ -3863,6 +3897,21 @@ declare class WikiMemory {
3863
3897
  }>;
3864
3898
  /** The supersession chain containing `factId`, oldest first. [] when unknown. */
3865
3899
  history(entityId: string, factId: string): Promise<WikiFact[]>;
3900
+ /**
3901
+ * Store one mutable fact directly, with no LLM step (spec
3902
+ * `specs/core-remember/spec.md`). One transaction; resolves with the stored
3903
+ * row read back (`id`, timestamps, defaults, `isStale`, `trustTier`). Never
3904
+ * starts the librarian or heal and writes no event, in `'auto'` and
3905
+ * `'deferred'` mode alike. Embeds through `llmProvider.embed` when present;
3906
+ * keyword-only otherwise. Not idempotent. To replace an existing fact use
3907
+ * `supersede()` so history is kept. Opens its own transaction: do not call
3908
+ * it inside `withTransactionAsync` (the serialized adapter would deadlock).
3909
+ *
3910
+ * Throws `TypeError` on invalid input and `WikiStrictOntologyViolation` for
3911
+ * an `okf_type` the entity's strict manifest does not define; nothing is
3912
+ * written in either case.
3913
+ */
3914
+ remember(entityId: string, input: RememberInput): Promise<WikiFact>;
3866
3915
  /**
3867
3916
  * Full and partial ingestion both reject foreign-owned generated fact IDs with
3868
3917
  * `WikiGraphNodeOwnershipConflict`. Such collisions are unexpected. Ingestion
@@ -4059,5 +4108,5 @@ declare class WikiMemory {
4059
4108
  setGeneratedByTask(taskId: string, entityId: string, actor: string): Promise<void>;
4060
4109
  }
4061
4110
 
4062
- export { PromptService as $, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS as A, ONTOLOGY_BACKFILL_RECHECK_MS as B, HEAL_BATCH_SIZE as H, ONTOLOGY_BACKFILL_BATCH_SIZE as O, PrunePartialFailureError as a0, WikiBusyError as a9, WikiSupersedeError as aA, WikiTransactionError as aD, isWikiSearchUnavailableError as aE, validateManifest as aF, EmbeddingService as aG, ImportExportService as aH, IngestionService as aI, JobManager as aJ, MaintenanceService as aK, RetrievalService as aL, SearchService as aM, WriteService as aN, WikiDraftNotFound as aj, WikiDuplicateHashError as ak, WikiGraphNodeOwnershipConflict as ao, WikiIngestEmptyError as ap, WikiInvalidReadOptions as ar, WikiMigrationRequiredError as au, WikiParseError as aw, WikiSearchUnavailableError as ax, WikiSourceRefHashCollision as ay, WikiStrictOntologyViolation as az, WikiMemory as c, HEAL_RECHECK_MS as s, HOOK_TIMEOUT_MARKER as t };
4063
- export type { ChunkFailure as C, DegradedRecord as D, EmbedFactResult as E, FormatContextOptions as F, GraphNeighborhood as G, IngestDocumentResult as I, OntologyBackfillResult as J, OntologyConfig as K, LLMProvider as L, MemoryBundle as M, OntologyEdgeType as N, OntologyManifest as P, OntologyMode as Q, ReadOptions as R, SQLiteAdapter as S, OntologyNodeType as T, OntologyPromptContext as U, OntologyUpdates as V, WikiOptions as W, PendingMaintenance as X, PendingMigrationWork as Y, PendingSourceStatus as Z, PromptOverrides as _, MemoryDump as a, ReembedResult as a1, RunPendingMaintenanceOptions as a2, RunPendingMaintenanceResult as a3, SupersedeReplacement as a4, VectorRanker as a5, VectorRankerFallback as a6, VectorRankerRankArgs as a7, VectorRankerSemanticResult as a8, WikiSupersedeReason as aB, WikiTask as aC, WikiBusyOperation as aa, WikiCheckpoint as ab, WikiConfig as ac, WikiDiagnostic as ad, WikiDiagnosticCode as ae, WikiDiagnosticDetail as af, WikiDiagnosticOperation as ag, WikiDiagnosticSeverity as ah, WikiDiagnosticTrigger as ai, WikiEdge as al, WikiEvent as am, WikiFact as an, WikiInstructions as aq, WikiLintReport as as, WikiMemoryTestAccess as at, WikiOutboxEvent as av, FormattedMemoryDump as b, ClassifierAnswer as d, ClassifierQuestion as e, ClassifyRequest as f, ClassifyResponse as g, DraftPage as h, EmbedFailureKind as i, EmbeddingMarkerKind as j, EntityMaintenanceReport as k, EntityStatus as l, ExtractedFact as m, ExtractedFactEdge as n, ExtractedFactWithOntology as o, ExtractedTask as p, GraphTraversalOptions as q, GroundingConfig as r, HealResult as u, LibrarianConfig as v, LibrarianGateConfig as w, MaintenanceJob as x, MaintenanceStopReason as y, MigrationPolicy as z };
4111
+ export { PromptService as $, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS as A, ONTOLOGY_BACKFILL_RECHECK_MS as B, HEAL_BATCH_SIZE as H, ONTOLOGY_BACKFILL_BATCH_SIZE as O, PrunePartialFailureError as a0, WikiStrictOntologyViolation as aA, WikiSupersedeError as aB, WikiTransactionError as aE, isWikiSearchUnavailableError as aF, validateManifest as aG, EmbeddingService as aH, ImportExportService as aI, IngestionService as aJ, JobManager as aK, MaintenanceService as aL, RetrievalService as aM, SearchService as aN, WriteService as aO, WikiBusyError as aa, WikiDraftNotFound as ak, WikiDuplicateHashError as al, WikiGraphNodeOwnershipConflict as ap, WikiIngestEmptyError as aq, WikiInvalidReadOptions as as, WikiMigrationRequiredError as av, WikiParseError as ax, WikiSearchUnavailableError as ay, WikiSourceRefHashCollision as az, WikiMemory as c, HEAL_RECHECK_MS as s, HOOK_TIMEOUT_MARKER as t };
4112
+ export type { ChunkFailure as C, DegradedRecord as D, EmbedFactResult as E, FormatContextOptions as F, GraphNeighborhood as G, IngestDocumentResult as I, OntologyBackfillResult as J, OntologyConfig as K, LLMProvider as L, MemoryBundle as M, OntologyEdgeType as N, OntologyManifest as P, OntologyMode as Q, ReadOptions as R, SQLiteAdapter as S, OntologyNodeType as T, OntologyPromptContext as U, OntologyUpdates as V, WikiOptions as W, PendingMaintenance as X, PendingMigrationWork as Y, PendingSourceStatus as Z, PromptOverrides as _, MemoryDump as a, ReembedResult as a1, RememberInput as a2, RunPendingMaintenanceOptions as a3, RunPendingMaintenanceResult as a4, SupersedeReplacement as a5, VectorRanker as a6, VectorRankerFallback as a7, VectorRankerRankArgs as a8, VectorRankerSemanticResult as a9, WikiSupersedeReason as aC, WikiTask as aD, WikiBusyOperation as ab, WikiCheckpoint as ac, WikiConfig as ad, WikiDiagnostic as ae, WikiDiagnosticCode as af, WikiDiagnosticDetail as ag, WikiDiagnosticOperation as ah, WikiDiagnosticSeverity as ai, WikiDiagnosticTrigger as aj, WikiEdge as am, WikiEvent as an, WikiFact as ao, WikiInstructions as ar, WikiLintReport as at, WikiMemoryTestAccess as au, WikiOutboxEvent as aw, FormattedMemoryDump as b, ClassifierAnswer as d, ClassifierQuestion as e, ClassifyRequest as f, ClassifyResponse as g, DraftPage as h, EmbedFailureKind as i, EmbeddingMarkerKind as j, EntityMaintenanceReport as k, EntityStatus as l, ExtractedFact as m, ExtractedFactEdge as n, ExtractedFactWithOntology as o, ExtractedTask as p, GraphTraversalOptions as q, GroundingConfig as r, HealResult as u, LibrarianConfig as v, LibrarianGateConfig as w, MaintenanceJob as x, MaintenanceStopReason as y, MigrationPolicy as z };
@@ -1,2 +1,2 @@
1
- export { aG as EmbeddingService, aH as ImportExportService, aI as IngestionService, aJ as JobManager, aJ as JobManagerType, aK as MaintenanceService, aL as RetrievalService, aM as SearchService, aM as SearchServiceType, at as WikiMemoryTestAccess, aN as WriteService } from './testing-DbrL569t.mjs';
1
+ export { aH as EmbeddingService, aI as ImportExportService, aJ as IngestionService, aK as JobManager, aK as JobManagerType, aL as MaintenanceService, aM as RetrievalService, aN as SearchService, aN as SearchServiceType, au as WikiMemoryTestAccess, aO as WriteService } from './testing-BlGhilQw.mjs';
2
2
  import '@equationalapplications/core-okf';
package/dist/testing.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { aG as EmbeddingService, aH as ImportExportService, aI as IngestionService, aJ as JobManager, aJ as JobManagerType, aK as MaintenanceService, aL as RetrievalService, aM as SearchService, aM as SearchServiceType, at as WikiMemoryTestAccess, aN as WriteService } from './testing-DbrL569t.js';
1
+ export { aH as EmbeddingService, aI as ImportExportService, aJ as IngestionService, aK as JobManager, aK as JobManagerType, aL as MaintenanceService, aM as RetrievalService, aN as SearchService, aN as SearchServiceType, au as WikiMemoryTestAccess, aO as WriteService } from './testing-BlGhilQw.js';
2
2
  import '@equationalapplications/core-okf';
package/dist/testing.js CHANGED
@@ -6628,6 +6628,15 @@ var JobManager = class {
6628
6628
  }
6629
6629
  };
6630
6630
 
6631
+ // src/utils/entityId.ts
6632
+ function assertEntityId(entityId) {
6633
+ if (typeof entityId !== "string" || entityId.length === 0 || entityId.length > 200 || entityId.includes("\0")) {
6634
+ throw new TypeError(
6635
+ `Invalid entityId: must be a non-empty string at most 200 chars with no null bytes; got ${JSON.stringify(entityId)}.`
6636
+ );
6637
+ }
6638
+ }
6639
+
6631
6640
  // src/services/WriteService.ts
6632
6641
  var WriteService = class {
6633
6642
  constructor(db, options, entryRepo, eventRepo, metadataRepo, jobManager, maintenanceService) {
@@ -6653,11 +6662,7 @@ var WriteService = class {
6653
6662
  }
6654
6663
  }
6655
6664
  async write(entityId, event) {
6656
- if (typeof entityId !== "string" || entityId.length === 0 || entityId.length > 200 || entityId.includes("\0")) {
6657
- throw new TypeError(
6658
- `Invalid entityId: must be a non-empty string at most 200 chars with no null bytes; got ${JSON.stringify(entityId)}.`
6659
- );
6660
- }
6665
+ assertEntityId(entityId);
6661
6666
  if (event === null || typeof event !== "object" || Array.isArray(event)) {
6662
6667
  throw new TypeError("Invalid event: must be a non-null object.");
6663
6668
  }