@memberjunction/content-autotagging 5.23.0 → 5.25.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.
Files changed (48) hide show
  1. package/dist/CloudStorage/generic/CloudStorageBase.d.ts +1 -1
  2. package/dist/CloudStorage/generic/CloudStorageBase.d.ts.map +1 -1
  3. package/dist/CloudStorage/generic/CloudStorageBase.js +2 -1
  4. package/dist/CloudStorage/generic/CloudStorageBase.js.map +1 -1
  5. package/dist/CloudStorage/index.d.ts +5 -0
  6. package/dist/CloudStorage/index.d.ts.map +1 -1
  7. package/dist/CloudStorage/index.js +5 -0
  8. package/dist/CloudStorage/index.js.map +1 -1
  9. package/dist/CloudStorage/providers/AutotagCloudStorage.d.ts +61 -0
  10. package/dist/CloudStorage/providers/AutotagCloudStorage.d.ts.map +1 -0
  11. package/dist/CloudStorage/providers/AutotagCloudStorage.js +257 -0
  12. package/dist/CloudStorage/providers/AutotagCloudStorage.js.map +1 -0
  13. package/dist/Core/generic/AutotagBase.d.ts +10 -1
  14. package/dist/Core/generic/AutotagBase.d.ts.map +1 -1
  15. package/dist/Core/generic/AutotagBase.js.map +1 -1
  16. package/dist/Engine/generic/AutotagBaseEngine.d.ts +324 -18
  17. package/dist/Engine/generic/AutotagBaseEngine.d.ts.map +1 -1
  18. package/dist/Engine/generic/AutotagBaseEngine.js +1036 -178
  19. package/dist/Engine/generic/AutotagBaseEngine.js.map +1 -1
  20. package/dist/Engine/generic/RateLimiter.d.ts +49 -0
  21. package/dist/Engine/generic/RateLimiter.d.ts.map +1 -0
  22. package/dist/Engine/generic/RateLimiter.js +98 -0
  23. package/dist/Engine/generic/RateLimiter.js.map +1 -0
  24. package/dist/Engine/index.d.ts +1 -0
  25. package/dist/Engine/index.d.ts.map +1 -1
  26. package/dist/Engine/index.js +1 -0
  27. package/dist/Engine/index.js.map +1 -1
  28. package/dist/Entity/generic/AutotagEntity.d.ts +68 -14
  29. package/dist/Entity/generic/AutotagEntity.d.ts.map +1 -1
  30. package/dist/Entity/generic/AutotagEntity.js +396 -83
  31. package/dist/Entity/generic/AutotagEntity.js.map +1 -1
  32. package/dist/LocalFileSystem/generic/AutotagLocalFileSystem.d.ts +1 -1
  33. package/dist/LocalFileSystem/generic/AutotagLocalFileSystem.d.ts.map +1 -1
  34. package/dist/LocalFileSystem/generic/AutotagLocalFileSystem.js +2 -1
  35. package/dist/LocalFileSystem/generic/AutotagLocalFileSystem.js.map +1 -1
  36. package/dist/RSSFeed/generic/AutotagRSSFeed.d.ts +47 -16
  37. package/dist/RSSFeed/generic/AutotagRSSFeed.d.ts.map +1 -1
  38. package/dist/RSSFeed/generic/AutotagRSSFeed.js +239 -120
  39. package/dist/RSSFeed/generic/AutotagRSSFeed.js.map +1 -1
  40. package/dist/Websites/generic/AutotagWebsite.d.ts +1 -1
  41. package/dist/Websites/generic/AutotagWebsite.d.ts.map +1 -1
  42. package/dist/Websites/generic/AutotagWebsite.js +2 -1
  43. package/dist/Websites/generic/AutotagWebsite.js.map +1 -1
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +1 -0
  47. package/dist/index.js.map +1 -1
  48. package/package.json +16 -11
@@ -1,8 +1,21 @@
1
1
  import { BaseEngine, IMetadataProvider, UserInfo } from '@memberjunction/core';
2
- import { MJContentSourceEntity, MJContentItemEntity, MJContentFileTypeEntity, MJContentTypeEntity, MJContentSourceTypeEntity, MJContentTypeAttributeEntity, MJContentSourceTypeParamEntity } from '@memberjunction/core-entities';
2
+ import { MJContentSourceEntity, MJContentItemEntity, MJContentFileTypeEntity, MJContentProcessRunEntity, MJContentTypeEntity, MJContentSourceTypeEntity, MJContentTypeAttributeEntity, MJContentItemTagEntity, MJContentSourceTypeParamEntity, MJContentProcessRunEntity_IContentProcessRunConfiguration } from '@memberjunction/core-entities';
3
3
  import { ContentSourceParams, ContentSourceTypeParams, ContentSourceTypeParamValue } from './content.types.js';
4
+ import { RateLimiter } from './RateLimiter.js';
4
5
  import { ProcessRunParams, JsonObject, ContentItemProcessParams } from './process.types.js';
5
6
  import type { MJAIPromptEntityExtended } from '@memberjunction/ai-core-plus';
7
+ /**
8
+ * Result of a vectorization operation, including counts and AIPromptRun IDs
9
+ * for linking to ContentProcessRunDetail records.
10
+ */
11
+ export interface VectorizeResult {
12
+ /** Number of items successfully vectorized */
13
+ vectorized: number;
14
+ /** Number of items skipped (e.g., empty text) */
15
+ skipped: number;
16
+ /** AIPromptRun IDs created during embedding, for junction table linking */
17
+ promptRunIDs: string[];
18
+ }
6
19
  /**
7
20
  * Core engine for content autotagging. Extends BaseEngine to cache content metadata
8
21
  * (types, source types, file types, attributes) at startup. Uses AIEngine via composition
@@ -10,16 +23,15 @@ import type { MJAIPromptEntityExtended } from '@memberjunction/ai-core-plus';
10
23
  */
11
24
  export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
12
25
  static get Instance(): AutotagBaseEngine;
13
- private _ContentTypes;
14
- private _ContentSourceTypes;
15
- private _ContentFileTypes;
16
26
  private _ContentTypeAttributes;
17
27
  private _ContentSourceTypeParams;
18
- /** All content types, cached at startup */
28
+ /** Shortcut to KnowledgeHubMetadataEngine */
29
+ private get khEngine();
30
+ /** All content types — delegated to KnowledgeHubMetadataEngine */
19
31
  get ContentTypes(): MJContentTypeEntity[];
20
- /** All content source types, cached at startup */
32
+ /** All content source types delegated to KnowledgeHubMetadataEngine */
21
33
  get ContentSourceTypes(): MJContentSourceTypeEntity[];
22
- /** All content file types, cached at startup */
34
+ /** All content file types delegated to KnowledgeHubMetadataEngine */
23
35
  get ContentFileTypes(): MJContentFileTypeEntity[];
24
36
  /** All content type attributes, cached at startup */
25
37
  get ContentTypeAttributes(): MJContentTypeAttributeEntity[];
@@ -30,7 +42,19 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
30
42
  * Given a list of content items, extract the text from each and process with LLM for tagging.
31
43
  * Items are processed in configurable batches with controlled concurrency within each batch.
32
44
  */
33
- ExtractTextAndProcessWithLLM(contentItems: MJContentItemEntity[], contextUser: UserInfo, batchSize?: number, onProgress?: (processed: number, total: number, currentItem?: string) => void): Promise<void>;
45
+ /**
46
+ * Process content items through the LLM tagging pipeline with production-grade
47
+ * batch management: cursor-based resume, pause/cancel support, rate limiting,
48
+ * and circuit breaker. Each batch checkpoints progress so interrupted runs
49
+ * can be resumed from where they left off.
50
+ *
51
+ * @param contentItems - items to process
52
+ * @param contextUser - current user for permissions/audit
53
+ * @param processRun - optional ContentProcessRun entity for checkpoint tracking
54
+ * @param config - optional pipeline configuration for rate limits, thresholds
55
+ * @param onProgress - optional callback for UI progress updates
56
+ */
57
+ ExtractTextAndProcessWithLLM(contentItems: MJContentItemEntity[], contextUser: UserInfo, processRun?: MJContentProcessRunEntity, config?: MJContentProcessRunEntity_IContentProcessRunConfiguration, onProgress?: (processed: number, total: number, currentItem?: string) => void): Promise<void>;
34
58
  /**
35
59
  * Builds processing parameters for a single content item
36
60
  */
@@ -39,11 +63,82 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
39
63
  * Process a content item's text with the LLM and save results.
40
64
  */
41
65
  ProcessContentItemText(params: ContentItemProcessParams, contextUser: UserInfo): Promise<void>;
66
+ /** Update embedding status for a batch of content items */
67
+ private updateEmbeddingStatusBatch;
68
+ /** Update a content item's TaggingStatus and LastTaggedAt */
69
+ private updateContentItemTaggingStatus;
42
70
  /**
43
71
  * Resolves the "Content Autotagging" prompt from the AIEngine cache.
44
72
  * Throws if the prompt is not found or not active.
45
73
  */
46
74
  private getAutotagPrompt;
75
+ /**
76
+ * Optional taxonomy JSON string to inject into the autotagging prompt.
77
+ * Set by the caller (e.g., AutotagEntity) before calling ExtractTextAndProcessWithLLM.
78
+ * When set, the prompt template receives an `existingTaxonomy` variable containing
79
+ * the JSON tree of existing tags so the LLM can prefer existing tags.
80
+ */
81
+ TaxonomyContext: string | null;
82
+ /**
83
+ * When true, skip checksum comparison and reprocess all content items
84
+ * even if their content hasn't changed. Useful when changing embedding models,
85
+ * LLM models, or vector databases.
86
+ */
87
+ ForceReprocess: boolean;
88
+ /**
89
+ * When true, suppresses the legacy saveProcessRun() call at the end of
90
+ * ExtractTextAndProcessWithLLM. Set by the action when the resolver is
91
+ * managing the ContentProcessRun record externally.
92
+ */
93
+ ExternalRunTrackingActive: boolean;
94
+ /** Rate limiter for LLM (tagging) API calls */
95
+ LLMRateLimiter: RateLimiter;
96
+ /** Rate limiter for embedding API calls */
97
+ EmbeddingRateLimiter: RateLimiter;
98
+ /** Rate limiter for vector DB API calls */
99
+ VectorDBRateLimiter: RateLimiter;
100
+ /**
101
+ * Initialize the taxonomy bridge so ALL content source types (RSS, Entity, Website, etc.)
102
+ * automatically create formal Tag + TaggedItem records from LLM-generated ContentItemTags.
103
+ *
104
+ * This sets up:
105
+ * 1. TagEngine with semantic embeddings for tag matching
106
+ * 2. TaxonomyContext for prompt injection (tells LLM about existing tags)
107
+ * 3. OnContentItemTagSaved callback that bridges ContentItemTag → Tag + TaggedItem
108
+ *
109
+ * Call this ONCE before running any providers. The bridge stays active until
110
+ * CleanupTaxonomyBridge() is called.
111
+ */
112
+ InitializeTaxonomyBridge(contextUser: UserInfo): Promise<void>;
113
+ /**
114
+ * Clean up the taxonomy bridge after all providers have finished.
115
+ */
116
+ CleanupTaxonomyBridge(): void;
117
+ /**
118
+ * Build a markdown-formatted taxonomy for LLM prompt injection.
119
+ * Uses heading levels for hierarchy depth (# for root, ## for child, etc.)
120
+ * so the LLM can return tag paths like "Root / Child / Grandchild".
121
+ */
122
+ private buildTaxonomyMarkdown;
123
+ /**
124
+ * Bridge a ContentItemTag to the formal MJ Tag taxonomy.
125
+ * Uses TagEngine.ResolveTag() in auto-grow mode by default.
126
+ *
127
+ * After resolving/creating the formal Tag, also creates a TaggedItem record:
128
+ * - For Entity sources: tags the original entity record (e.g., Products row)
129
+ * - For non-Entity sources (RSS, Website, etc.): tags the ContentItem itself
130
+ */
131
+ private BridgeContentItemTagToTaxonomy;
132
+ /**
133
+ * Creates a TaggedItem record linking a formal Tag to the appropriate entity record.
134
+ *
135
+ * For Entity-sourced content items: resolves the EntityRecordDocument to find the
136
+ * original entity (e.g., Products) and record ID, then tags that entity record.
137
+ *
138
+ * For non-Entity-sourced content items (RSS, Website, Cloud Storage): tags the
139
+ * ContentItem itself (EntityID = "MJ: Content Items" entity, RecordID = content item ID).
140
+ */
141
+ private createTaggedItemFromContentItemTag;
47
142
  /**
48
143
  * Builds template data for the autotagging prompt from processing params and chunk context.
49
144
  */
@@ -71,9 +166,19 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
71
166
  * Simple character-based chunking as fallback
72
167
  */
73
168
  private fallbackChunkText;
169
+ /**
170
+ * Optional callback invoked after each ContentItemTag is saved, enabling the
171
+ * tag taxonomy bridge (ContentItemTag → Tag + TaggedItem). Set by providers
172
+ * like AutotagEntity that want to link free-text tags to formal taxonomy entries.
173
+ *
174
+ * Parameters: (contentItemTag: MJContentItemTagEntity, parentTag: string | null, contextUser: UserInfo)
175
+ */
176
+ OnContentItemTagSaved: ((tag: MJContentItemTagEntity, parentTag: string | null, contextUser: UserInfo) => Promise<void>) | null;
74
177
  /**
75
178
  * Saves keyword tags from LLM results as Content Item Tags.
76
179
  * Uses batched saves for better performance.
180
+ * After each tag is saved, invokes the OnContentItemTagSaved callback (if set)
181
+ * for taxonomy bridge processing.
77
182
  */
78
183
  saveContentItemTags(contentItemID: string, LLMResults: JsonObject, contextUser: UserInfo): Promise<void>;
79
184
  /**
@@ -83,8 +188,14 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
83
188
  saveResultsToContentItemAttribute(LLMResults: JsonObject, contextUser: UserInfo): Promise<void>;
84
189
  /**
85
190
  * Retrieves all content sources for a given content source type.
191
+ * Throws if no sources are found.
86
192
  */
87
193
  getAllContentSources(contextUser: UserInfo, contentSourceTypeID: string): Promise<MJContentSourceEntity[]>;
194
+ /**
195
+ * Retrieves all content sources for a given content source type.
196
+ * Returns an empty array (instead of throwing) when no sources are configured.
197
+ */
198
+ GetAllContentSourcesSafe(_contextUser: UserInfo, contentSourceTypeID: string): Promise<MJContentSourceEntity[]>;
88
199
  SetSubclassContentSourceType(subclass: string): string;
89
200
  getContentSourceParams(contentSource: MJContentSourceEntity, contextUser: UserInfo): Promise<Map<string, ContentSourceTypeParamValue>>;
90
201
  GetDefaultContentSourceTypeParams(contentSourceTypeParamID: string): ContentSourceTypeParams;
@@ -113,9 +224,33 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
113
224
  getChecksumFromText(text: string): Promise<string>;
114
225
  getContentItemIDFromURL(contentSourceParams: ContentSourceParams, contextUser: UserInfo): Promise<string>;
115
226
  /**
116
- * Saves process run metadata to the database.
227
+ * Saves process run metadata to the database (backward-compatible simple version).
117
228
  */
118
229
  saveProcessRun(processRunParams: ProcessRunParams, contextUser: UserInfo): Promise<void>;
230
+ /**
231
+ * Create a new ContentProcessRun record for batched pipeline execution.
232
+ * Returns the entity so the caller can update cursor/status as batches complete.
233
+ * Uses the JSONType ConfigurationObject for strongly-typed configuration.
234
+ */
235
+ CreateBatchedProcessRun(sourceID: string, totalItemCount: number, batchSize: number, contextUser: UserInfo, config?: MJContentProcessRunEntity_IContentProcessRunConfiguration): Promise<MJContentProcessRunEntity>;
236
+ /**
237
+ * Update a batched process run's cursor position after a batch completes.
238
+ * Checks CancellationRequested to support pause/cancel.
239
+ * @returns true if processing should continue, false if cancelled/paused
240
+ */
241
+ UpdateBatchCursor(processRun: MJContentProcessRunEntity, processedCount: number, errorCount: number): Promise<boolean>;
242
+ /**
243
+ * Complete a batched process run (success or failure).
244
+ */
245
+ CompleteBatchedProcessRun(processRun: MJContentProcessRunEntity, status: 'Completed' | 'Failed' | 'Cancelled', errorMessage?: string): Promise<void>;
246
+ /**
247
+ * Create rate limiters from the pipeline configuration.
248
+ */
249
+ CreateRateLimiters(config?: MJContentProcessRunEntity_IContentProcessRunConfiguration): {
250
+ llm: RateLimiter;
251
+ embedding: RateLimiter;
252
+ vectorDB: RateLimiter;
253
+ };
119
254
  parsePDF(dataBuffer: Buffer): Promise<string>;
120
255
  parseDOCX(dataBuffer: Buffer): Promise<string>;
121
256
  parseHTML(data: string): Promise<string>;
@@ -126,16 +261,51 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
126
261
  * from per-ContentSource overrides, per-ContentType defaults, or the global fallback
127
262
  * (first active VectorIndex). Each group is processed in configurable batches with
128
263
  * parallel upserts within each batch.
264
+ *
265
+ * Uses AIModelRunner to create AIPromptRun records for each embedding batch,
266
+ * enabling token/cost tracking and linking to ContentProcessRunDetail records.
267
+ *
268
+ * @param items - content items to vectorize
269
+ * @param contextUser - current user for permissions/audit
270
+ * @param onProgress - optional callback for progress updates
271
+ * @param batchSize - number of items per embedding batch
272
+ * @returns counts of vectorized/skipped items and collected AIPromptRun IDs
129
273
  */
130
- VectorizeContentItems(items: MJContentItemEntity[], contextUser: UserInfo, onProgress?: (processed: number, total: number) => void, batchSize?: number): Promise<{
131
- vectorized: number;
132
- skipped: number;
133
- }>;
274
+ VectorizeContentItems(items: MJContentItemEntity[], contextUser: UserInfo, onProgress?: (processed: number, total: number) => void, batchSize?: number): Promise<VectorizeResult>;
134
275
  /**
135
276
  * Process a single infrastructure group: embed texts in batches and upsert to vector DB.
136
- * Upserts within each batch run in parallel for throughput.
277
+ * Uses AIModelRunner for each embedding batch to create AIPromptRun records with
278
+ * token/cost tracking. Upserts within each batch run in parallel for throughput.
279
+ *
280
+ * @param items - content items in this infrastructure group
281
+ * @param infra - resolved embedding + vector DB infrastructure
282
+ * @param tagMap - pre-loaded tags for metadata enrichment
283
+ * @param batchSize - number of items per embedding batch
284
+ * @param contextUser - current user for AIModelRunner tracking
285
+ * @param onBatchComplete - callback invoked after each batch with item count
286
+ * @returns count of vectorized items and collected AIPromptRun IDs
137
287
  */
138
288
  private vectorizeGroup;
289
+ /**
290
+ * Resolve the "Content Embedding" prompt ID from AIEngine for AIModelRunner tracking.
291
+ * Returns undefined if the prompt is not found (AIModelRunner will fall back to
292
+ * the first active Embedding-type prompt).
293
+ */
294
+ private resolveEmbeddingPromptID;
295
+ /**
296
+ * Build text chunks for a batch of content items. Items with long text
297
+ * produce multiple chunks via TextChunker.
298
+ */
299
+ private buildChunksForBatch;
300
+ /**
301
+ * Build VectorRecord objects from embedding chunks and their corresponding vectors.
302
+ */
303
+ private buildVectorRecords;
304
+ /**
305
+ * Upsert vector records to the vector database in sub-batches with rate limiting.
306
+ * Returns true if all sub-batches succeeded.
307
+ */
308
+ private upsertVectorRecords;
139
309
  /**
140
310
  * Load content source and content type records for all unique source/type IDs
141
311
  * referenced by the given items. Returns maps keyed by normalized ID.
@@ -164,12 +334,12 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
164
334
  */
165
335
  private buildVectorInfrastructure;
166
336
  /**
167
- * Fallback: resolve infrastructure from the first active VectorIndex (original behavior).
337
+ * Fallback: resolve infrastructure from the first available VectorIndex (original behavior).
168
338
  */
169
339
  private getDefaultVectorInfrastructure;
170
340
  /**
171
- * Shared helper: given a vector index record and embedding model ID, resolve all
172
- * driver instances needed for embedding + upsert.
341
+ * Shared helper: given vector index details and embedding model ID, resolve all
342
+ * driver instances needed for embedding + upsert. Uses AIEngine for Vector Databases.
173
343
  */
174
344
  private createInfrastructureFromIndex;
175
345
  /** Find an embedding model by ID in AIEngine, with helpful error reporting */
@@ -181,10 +351,146 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
181
351
  /** SHA-1 deterministic vector ID for a content item */
182
352
  private contentItemVectorId;
183
353
  /** Build the text that gets embedded: Title + Description + full Text */
184
- private buildEmbeddingText;
354
+ /**
355
+ * Max tokens per embedding chunk. text-embedding-3-small supports 8,191 tokens.
356
+ * We use a conservative limit to avoid hitting the boundary.
357
+ */
358
+ private static readonly MAX_EMBEDDING_TOKENS;
359
+ /**
360
+ * Build the text to embed for a content item, and chunk it if it exceeds
361
+ * the embedding model's token limit. Returns one or more text chunks.
362
+ */
363
+ private buildEmbeddingChunks;
185
364
  /** Build metadata stored alongside the vector — truncate large text fields */
186
365
  private buildVectorMetadata;
187
366
  /** Load all tags for the given items in a single RunView call */
188
367
  private loadTagsForItems;
368
+ /**
369
+ * Attempts to recompute tag co-occurrence data after the LLM tagging pipeline completes.
370
+ * Uses dynamic import to avoid a hard dependency on the tag-engine package.
371
+ * If TagCoOccurrenceEngine is not available or fails, it logs a warning and continues.
372
+ */
373
+ private recomputeCoOccurrenceIfAvailable;
374
+ /**
375
+ * Detects duplicate content items by matching the given item's checksum against
376
+ * other content items from **different** content sources. When an exact checksum
377
+ * match is found, a {@link MJContentItemDuplicateEntity} record is created with
378
+ * `DetectionMethod = 'Checksum'` and `SimilarityScore = 1.0`.
379
+ *
380
+ * Duplicate pairs are stored in canonical order (lower ID = ContentItemAID) to
381
+ * prevent mirror duplicates. If a duplicate pair already exists for the same
382
+ * detection method, no new record is created.
383
+ *
384
+ * @param contentItem - The content item whose checksum should be checked for duplicates.
385
+ * Must already be saved (i.e., have a valid ID and Checksum).
386
+ * @param contextUser - The authenticated user context for data access and audit.
387
+ * @returns A promise that resolves when detection is complete. Does not throw on
388
+ * failure — errors are logged and swallowed to avoid disrupting the pipeline.
389
+ */
390
+ DetectChecksumDuplicates(contentItem: MJContentItemEntity, contextUser: UserInfo): Promise<void>;
391
+ /**
392
+ * Detects duplicate content items by matching the given item's title (Name field)
393
+ * against other content items from **different** content sources. When an exact
394
+ * title match is found, a {@link MJContentItemDuplicateEntity} record is created
395
+ * with `DetectionMethod = 'Title'` and `SimilarityScore = 1.0`.
396
+ *
397
+ * Duplicate pairs are stored in canonical order (lower ID = ContentItemAID) to
398
+ * prevent mirror duplicates. If a duplicate pair already exists for the same
399
+ * detection method, no new record is created.
400
+ *
401
+ * @param contentItem - The content item whose title should be checked for duplicates.
402
+ * Must already be saved (i.e., have a valid ID and Name).
403
+ * @param contextUser - The authenticated user context for data access and audit.
404
+ * @returns A promise that resolves when detection is complete. Does not throw on
405
+ * failure — errors are logged and swallowed to avoid disrupting the pipeline.
406
+ */
407
+ DetectTitleDuplicates(contentItem: MJContentItemEntity, contextUser: UserInfo): Promise<void>;
408
+ /**
409
+ * Runs all non-vector deduplication checks (checksum and title) for a content item.
410
+ * This is a convenience method intended to be called after saving/updating a content item.
411
+ *
412
+ * @param contentItem - The saved content item to check for duplicates.
413
+ * @param contextUser - The authenticated user context for data access and audit.
414
+ */
415
+ DetectDuplicates(contentItem: MJContentItemEntity, contextUser: UserInfo): Promise<void>;
416
+ /**
417
+ * Detects near-duplicate content items by querying the vector index for items
418
+ * with high cosine similarity (> 0.95 threshold). Only creates duplicate records
419
+ * for matches from DIFFERENT content sources to avoid self-matches.
420
+ *
421
+ * This is expensive so it only checks the top 3 most similar results.
422
+ * Controlled by the `enableVectorDedup` flag.
423
+ *
424
+ * @param contentItem - The content item to check (must have text and be vectorized).
425
+ * @param contextUser - The authenticated user context for data access and audit.
426
+ * @param enableVectorDedup - Whether to run vector-based dedup (default false).
427
+ */
428
+ DetectVectorDuplicates(contentItem: MJContentItemEntity, contextUser: UserInfo, enableVectorDedup?: boolean): Promise<void>;
429
+ /**
430
+ * Internal implementation of vector-based dedup. Resolves the vector infrastructure
431
+ * for the item, embeds its text, queries for similar vectors, and creates duplicate
432
+ * records for high-similarity matches from different sources.
433
+ */
434
+ private performVectorDedupCheck;
435
+ /**
436
+ * Check if a content item belongs to a different source than the given sourceID.
437
+ */
438
+ private isFromDifferentSource;
439
+ /**
440
+ * Resolves a duplicate record by updating its Status and Resolution fields.
441
+ *
442
+ * @param duplicateID - The ID of the ContentItemDuplicate record.
443
+ * @param resolution - The resolution choice: 'KeepA', 'KeepB', 'NotDuplicate'.
444
+ * @param contextUser - The authenticated user context.
445
+ */
446
+ ResolveContentDuplicate(duplicateID: string, resolution: 'KeepA' | 'KeepB' | 'NotDuplicate', contextUser: UserInfo): Promise<boolean>;
447
+ /**
448
+ * Applies the resolution to a duplicate record by setting the Status and Resolution fields.
449
+ */
450
+ private applyDuplicateResolution;
451
+ /**
452
+ * Finds content items with the same checksum from different content sources.
453
+ *
454
+ * @param checksum - The SHA-256 checksum to search for.
455
+ * @param excludeSourceID - The content source ID to exclude (the item's own source).
456
+ * @param excludeItemID - The content item ID to exclude (the item itself).
457
+ * @param contextUser - The authenticated user context.
458
+ * @returns An array of matching content items (simple objects with ID field).
459
+ */
460
+ private findItemsByChecksum;
461
+ /**
462
+ * Finds content items with the same title (Name) from different content sources.
463
+ *
464
+ * @param title - The title to search for (exact match).
465
+ * @param excludeSourceID - The content source ID to exclude (the item's own source).
466
+ * @param excludeItemID - The content item ID to exclude (the item itself).
467
+ * @param contextUser - The authenticated user context.
468
+ * @returns An array of matching content items (simple objects with ID field).
469
+ */
470
+ private findItemsByTitle;
471
+ /**
472
+ * Creates a {@link MJContentItemDuplicateEntity} record for a detected duplicate pair,
473
+ * but only if one does not already exist for the same pair and detection method.
474
+ *
475
+ * IDs are stored in canonical order: the lexicographically smaller ID is always
476
+ * ContentItemAID to prevent mirror duplicates (A,B) vs (B,A).
477
+ *
478
+ * @param itemAID - One of the duplicate item IDs.
479
+ * @param itemBID - The other duplicate item ID.
480
+ * @param similarityScore - The similarity score (0.0 to 1.0).
481
+ * @param detectionMethod - How the duplicate was detected.
482
+ * @param contextUser - The authenticated user context.
483
+ */
484
+ private createDuplicateRecordIfNotExists;
485
+ /**
486
+ * Checks whether a duplicate record already exists for the given pair and detection method.
487
+ *
488
+ * @param canonicalAID - The canonical (ordered) ContentItemAID.
489
+ * @param canonicalBID - The canonical (ordered) ContentItemBID.
490
+ * @param detectionMethod - The detection method to check.
491
+ * @param contextUser - The authenticated user context.
492
+ * @returns True if a record already exists.
493
+ */
494
+ private duplicatePairExists;
189
495
  }
190
496
  //# sourceMappingURL=AutotagBaseEngine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AutotagBaseEngine.d.ts","sourceRoot":"","sources":["../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