@anuma/sdk 7.3.0 → 7.3.2
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/dist/expo/index.cjs +189 -73
- package/dist/expo/index.d.mts +4 -1
- package/dist/expo/index.d.ts +4 -1
- package/dist/expo/index.mjs +189 -73
- package/dist/react/index.cjs +187 -73
- package/dist/react/index.d.mts +4 -1
- package/dist/react/index.d.ts +4 -1
- package/dist/react/index.mjs +187 -73
- package/dist/server/index.cjs +185 -71
- package/dist/server/index.d.mts +3 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.mjs +185 -71
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
|
@@ -5765,6 +5765,7 @@ declare function extractFacts(messages: AutoExtractMessage[], options: ExtractFa
|
|
|
5765
5765
|
* look like `no-facts`.
|
|
5766
5766
|
*/
|
|
5767
5767
|
type ExtractOutcome = "extracted" | "no-facts" | "empty-after-retry" | "dropped-after-redaction";
|
|
5768
|
+
type WriteFailureReason = "source-ineligible" | "embeddings-unavailable" | "merge-not-persisted" | "aborted" | "unknown";
|
|
5768
5769
|
/**
|
|
5769
5770
|
* Stage 2 — for each extracted candidate, call retain() with auto-merge
|
|
5770
5771
|
* enabled. When `consolidateOptions` are wired, retain()'s consolidation pass
|
|
@@ -5835,6 +5836,7 @@ declare function extractAndRetain(messages: AutoExtractMessage[], retainCtx: Ret
|
|
|
5835
5836
|
candidates: ExtractedCandidate[];
|
|
5836
5837
|
results: RetainResult[];
|
|
5837
5838
|
failedCount: number;
|
|
5839
|
+
writeFailureReason?: WriteFailureReason;
|
|
5838
5840
|
outcome: ExtractOutcome;
|
|
5839
5841
|
/**
|
|
5840
5842
|
* Tier-0 security (PR3) — candidates quarantined by the injection screen and
|
|
@@ -10562,6 +10564,7 @@ interface TurnCompleteEvent {
|
|
|
10562
10564
|
results: RetainResult[];
|
|
10563
10565
|
/** Per-candidate retain() failures. `onError` only fires on pipeline throws. */
|
|
10564
10566
|
failedCount: number;
|
|
10567
|
+
writeFailureReason?: WriteFailureReason;
|
|
10565
10568
|
durationMs: number;
|
|
10566
10569
|
conversationId?: string;
|
|
10567
10570
|
/**
|
|
@@ -15558,4 +15561,4 @@ type UseWalletBindingResult = {
|
|
|
15558
15561
|
*/
|
|
15559
15562
|
declare function useWalletBinding(options?: UseWalletBindingOptions): UseWalletBindingResult;
|
|
15560
15563
|
|
|
15561
|
-
export { Anuma, type AnumaChild, AnumaJsxError, type AnumaNode, AnumaShadowIsolationProvider, type AnumaShadowIsolationProviderProps, type AnumaTheme, AnumaThemeProvider, type AnumaThemeProviderProps, AppFile as AppFileModel, type AppFileOperationsContext, type AttrValue, type AutoExtractMessage, type AutoExtractor, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, BUILT_IN_TOOL_SETS, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, BlobUrlManager, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, ChartCard, type ChartCardProps, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChatStorageAdapter, type ChatStorageObservable, type ChunkSearchResult, type ChunkSearchStats, type ChunkVectorCache, type ChunkingOptions, type CircleProps, type ClientToolsFilterFn, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type ConversationQueryOptions, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateEntityOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateSavedToolOptions, type CreateServerToolsFilterOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DeckProps, type DisplayToolMigrations, type DurableAutoExtractorOptions, ENTITY_FANOUT, ENTITY_KINDS, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type EncryptionKeyVersion, type EntityInput, type EntityKind, Entity as EntityModel, type EntityOperationsContext, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, FILE_PLACEHOLDER_PREFIX, FILE_PLACEHOLDER_REGEX, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, type GroupProps, HARD_DELETE_WINDOW_MS, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, INFERENCE_ID_HEADER, INTERNAL_FLOW_MARKER, type IconProps, type ImageProps, type InjectionClassifierOptions, type InjectionReason, type InteractionType, type KnownTag, type LazyStoredConversation, type LineProps, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LocalMemoryStoreOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, MEMORY_KINDS, MEMORY_LEVELS, type ManualFactType, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type MemoryCreate, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, MemoryEntity as MemoryEntityModel, type MemoryExtractedEvent, MemoryKeyError, type MemoryKeyRing, type MemoryKind, type MemoryLevel, MemoryLevelError, type MemoryListOptions, type MemoryMaintenance, type MemoryMigrationOptions, type MemoryMigrationProgress, type MemoryMigrationResult, type MemoryMigrationSkip, type MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryTopic, type MemoryTopicBacklog, type MemoryTopicMaintenance, type MemoryUpdate, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageChunk, type MessageFeedback, type MessageOrigin, type MessageSkeleton, type ModelLoadProgress, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OCRFile, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, type PdfExportOptions, type PdfExportProgress, type PdfExportStage, type PdfFile, PdfProcessor, type PendingInteraction, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PhoneCallPollingOptions, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, type ProgressCallback, Project, type ProjectOperationsContext, type PromptPreProcessor, type PromptPreProcessorContext, type ProviderAuthState, type ProviderBackupState, ProviderStreamError, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, R2_DEFAULT_TTL_MS, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallTelemetryCallbacks, type RecallToolCallbacks, type RecallToolOptions, type RecallTruncation, type RecencyOptions, type RectProps, type ReflectOptions, type ReflectResult, type RemoteMemoryCandidateOptions, type RemoteMemoryDecodeFailure, RemoteMemoryError, type RemoteMemoryListOptions, type RemoteMemoryMetadataPage, type RemoteMemoryMetadataRecord, type RemoteMemoryPage, RemoteMemoryPartialCreateError, type RemoteMemoryPersistence, type RemoteMemoryPersistenceOptions, type RemoteMemoryPipeline, type RemoteMemoryPipelineOptions, type RemoteMemoryQueryOptions, type RemoteMemoryQueryPage, type RemoteMemoryReadFilters, type RemoteMemoryRecord, type RemoteMemoryRow, type RemoteMemoryStoreOptions, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ReservationReceipt, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, STREAM_RESUMABLE_HEADER, SavedTool as SavedToolModel, type SavedToolOperationsContext, type SavedToolParameter, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenProps, type ScreenResult, type ScreenedCandidate, type SearchMessagesOptions, type SearchSource, type SelectServerToolsForPromptOptions, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type ServerTool, type ServerToolsFilter, type ServerToolsFilterFn, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type SignMessageOptions, type SlideProps, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredAppFile, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredEntity, type StoredFileWithContext, type StoredMedia, Media as StoredMediaModel, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredProject, type StoredSavedTool, type StoredTopic, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, THEME_ATTRS, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TOPIC_SALIENCE_WEIGHTS, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type TextProps, type ThemeAttr, type ToolCallArgumentsDeltaEvent, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type TopicExtractOptions, type TopicExtractionBatchDiagnostics, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSalience, type TopicSkipReason, type TopicSource, type TranscriptionResult, type TurnCompleteEvent, type TurnSkippedEvent, type UIInteractionContextValue, UIInteractionProvider, type UIInteractionProviderProps, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateSavedToolOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseEncryptionResult, type UseExportPdfResult, type UseFilesOptions, type UseFilesResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UsePhoneCallsOptions, type UsePhoneCallsResult, type UseProjectsOptions, type UseProjectsResult, type UseSettingsOptions, type UseSettingsResult, type UseSubscriptionOptions, type UseSubscriptionResult, type UseToolsOptions, type UseToolsResult, type UseVoiceOptions, type UseVoiceResult, type UseWalletBindingOptions, type UseWalletBindingResult, VAULT_SIZE_HOP_CAP, type VaultCandidateKey, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryKind, type VaultMemoryOperationsContext, type VaultMemoryProjection, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, type VoiceRecording, WalletPoller, WatermelonChatStorageAdapter, type WatermelonChatStorageAdapterOptions, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WhisperModel, WordProcessor, ZipProcessor, type ZipProcessorOptions, addConversationMemoriesOp, appFileToStored, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryEntityUserIdsOp, backfillMemoryTopicsOp, buildAttachedFilesText, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearConversationMemoriesOp, clearEncryptionKey, clearICloudAuth, clearKeyPair, clearLazyTitleCache, clearMemoryTopicsOverrideOp, clearModelsCache, clearNotionToken, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createGitHubTools, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createRemoteMemoryPersistence, createRemoteMemoryPipeline, createRemoteMemoryStore, createSavedToolOp, createServerToolsFilter, createStockPricePreProcessor, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllAppFilesOp, deleteAllVaultMemoriesForUserOp, deleteAppFileOp, deleteEncryptedFile, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteProjectOp, deleteSavedToolOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, deriveKeyFromSignatureBytes, deriveMemoryKeyRing, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, encryptToolCallEventsOp, ensureDefaultFoldersOp, expandToolSetsAdditive, exportElementToPdf, exportMarkdownToPdf, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractFileIds, extractMCPImageUrls, extractReservationReceipts, fileExists, findById, findMatchingTools, findParentOfId, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllSavedToolsOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAndClearNotionPendingMessage, getAndClearNotionReturnUrl, getAppFileMapOp, getAppFileOp, getAppFilesOp, getAudioOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getEntitiesByMemoryIdsOp, getId, getImagesOp, getLogger, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesByEntityNamesOp, getMemoriesNeedingTopicExtractionOp, getNotionAccessToken, getNotionMCPUrl, getNumberAttr, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getSavedToolByIdOp, getServerTools, getStringAttr, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserUploadedMediaOp, getValidNotionToken, getVaultCandidateKeysOp, getVaultEmbeddingsByIdsOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, getVideosOp, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasICloudCredentials, hasKeyPair, hasNotionCredentials, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isAttachedFilesText, isDegradedTopicSkip, isEncrypted, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, maskScopedEmbeddingCache, mediaToStored, memoryCipher, migrateDisplayResult, migrateMemoriesToRemote, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, parseMedia, preEmbedVaultMemories, preprocessFiles, previewToolSelection, primaryTopic, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, rankProfileCandidates, readEncryptedFile, recall, reencryptMemoryField, reflect, refreshEncryptionKeyIfMatches, refreshNotionToken, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeNotionAccess, savedToolToStored, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, setMemoryVisibilityOp, settingsStorageSchema, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, stampTopicsExtractedAtOp, startNotionAuth, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, topicWeight, traverseGraphLane, ttlForType, updateAttrs, updateConversationProjectOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageFeedbackOp, updateProjectNameOp, updateProjectOp, updateSavedToolOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, useAnumaTheme, useBackup, useBackupAuth, useChat, useChatStorage, useCredits, useDatabaseManager, useEncryption, useExportPdf, useFiles, useICloudAuth, useICloudBackup, useModels, useOCR, usePdf, usePhoneCalls, useProjects, useSettings, useSubscription, useTools, useUIInteraction, useVoice, useWalletBinding, userPreferencesStorageSchema, verifyMemoriesForPublish, walk, webPlatformStorage, withActiveToolSetServerTools, withInternalFlowMarker, writeEncryptedFile };
|
|
15564
|
+
export { Anuma, type AnumaChild, AnumaJsxError, type AnumaNode, AnumaShadowIsolationProvider, type AnumaShadowIsolationProviderProps, type AnumaTheme, AnumaThemeProvider, type AnumaThemeProviderProps, AppFile as AppFileModel, type AppFileOperationsContext, type AttrValue, type AutoExtractMessage, type AutoExtractor, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, BUILT_IN_TOOL_SETS, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, BlobUrlManager, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, ChartCard, type ChartCardProps, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChatStorageAdapter, type ChatStorageObservable, type ChunkSearchResult, type ChunkSearchStats, type ChunkVectorCache, type ChunkingOptions, type CircleProps, type ClientToolsFilterFn, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type ConversationQueryOptions, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateEntityOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateSavedToolOptions, type CreateServerToolsFilterOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DeckProps, type DisplayToolMigrations, type DurableAutoExtractorOptions, ENTITY_FANOUT, ENTITY_KINDS, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type EncryptionKeyVersion, type EntityInput, type EntityKind, Entity as EntityModel, type EntityOperationsContext, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, FILE_PLACEHOLDER_PREFIX, FILE_PLACEHOLDER_REGEX, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, type GroupProps, HARD_DELETE_WINDOW_MS, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, INFERENCE_ID_HEADER, INTERNAL_FLOW_MARKER, type IconProps, type ImageProps, type InjectionClassifierOptions, type InjectionReason, type InteractionType, type KnownTag, type LazyStoredConversation, type LineProps, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LocalMemoryStoreOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, MEMORY_KINDS, MEMORY_LEVELS, type ManualFactType, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type MemoryCreate, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, MemoryEntity as MemoryEntityModel, type MemoryExtractedEvent, MemoryKeyError, type MemoryKeyRing, type MemoryKind, type MemoryLevel, MemoryLevelError, type MemoryListOptions, type MemoryMaintenance, type MemoryMigrationOptions, type MemoryMigrationProgress, type MemoryMigrationResult, type MemoryMigrationSkip, type MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryTopic, type MemoryTopicBacklog, type MemoryTopicMaintenance, type MemoryUpdate, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageChunk, type MessageFeedback, type MessageOrigin, type MessageSkeleton, type ModelLoadProgress, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OCRFile, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, type PdfExportOptions, type PdfExportProgress, type PdfExportStage, type PdfFile, PdfProcessor, type PendingInteraction, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PhoneCallPollingOptions, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, type ProgressCallback, Project, type ProjectOperationsContext, type PromptPreProcessor, type PromptPreProcessorContext, type ProviderAuthState, type ProviderBackupState, ProviderStreamError, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, R2_DEFAULT_TTL_MS, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallTelemetryCallbacks, type RecallToolCallbacks, type RecallToolOptions, type RecallTruncation, type RecencyOptions, type RectProps, type ReflectOptions, type ReflectResult, type RemoteMemoryCandidateOptions, type RemoteMemoryDecodeFailure, RemoteMemoryError, type RemoteMemoryListOptions, type RemoteMemoryMetadataPage, type RemoteMemoryMetadataRecord, type RemoteMemoryPage, RemoteMemoryPartialCreateError, type RemoteMemoryPersistence, type RemoteMemoryPersistenceOptions, type RemoteMemoryPipeline, type RemoteMemoryPipelineOptions, type RemoteMemoryQueryOptions, type RemoteMemoryQueryPage, type RemoteMemoryReadFilters, type RemoteMemoryRecord, type RemoteMemoryRow, type RemoteMemoryStoreOptions, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ReservationReceipt, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, STREAM_RESUMABLE_HEADER, SavedTool as SavedToolModel, type SavedToolOperationsContext, type SavedToolParameter, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenProps, type ScreenResult, type ScreenedCandidate, type SearchMessagesOptions, type SearchSource, type SelectServerToolsForPromptOptions, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type ServerTool, type ServerToolsFilter, type ServerToolsFilterFn, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type SignMessageOptions, type SlideProps, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredAppFile, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredEntity, type StoredFileWithContext, type StoredMedia, Media as StoredMediaModel, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredProject, type StoredSavedTool, type StoredTopic, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, THEME_ATTRS, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TOPIC_SALIENCE_WEIGHTS, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type TextProps, type ThemeAttr, type ToolCallArgumentsDeltaEvent, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type TopicExtractOptions, type TopicExtractionBatchDiagnostics, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSalience, type TopicSkipReason, type TopicSource, type TranscriptionResult, type TurnCompleteEvent, type TurnSkippedEvent, type UIInteractionContextValue, UIInteractionProvider, type UIInteractionProviderProps, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateSavedToolOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseEncryptionResult, type UseExportPdfResult, type UseFilesOptions, type UseFilesResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UsePhoneCallsOptions, type UsePhoneCallsResult, type UseProjectsOptions, type UseProjectsResult, type UseSettingsOptions, type UseSettingsResult, type UseSubscriptionOptions, type UseSubscriptionResult, type UseToolsOptions, type UseToolsResult, type UseVoiceOptions, type UseVoiceResult, type UseWalletBindingOptions, type UseWalletBindingResult, VAULT_SIZE_HOP_CAP, type VaultCandidateKey, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryKind, type VaultMemoryOperationsContext, type VaultMemoryProjection, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, type VoiceRecording, WalletPoller, WatermelonChatStorageAdapter, type WatermelonChatStorageAdapterOptions, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WhisperModel, WordProcessor, type WriteFailureReason, ZipProcessor, type ZipProcessorOptions, addConversationMemoriesOp, appFileToStored, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryEntityUserIdsOp, backfillMemoryTopicsOp, buildAttachedFilesText, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearConversationMemoriesOp, clearEncryptionKey, clearICloudAuth, clearKeyPair, clearLazyTitleCache, clearMemoryTopicsOverrideOp, clearModelsCache, clearNotionToken, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createGitHubTools, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createRemoteMemoryPersistence, createRemoteMemoryPipeline, createRemoteMemoryStore, createSavedToolOp, createServerToolsFilter, createStockPricePreProcessor, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllAppFilesOp, deleteAllVaultMemoriesForUserOp, deleteAppFileOp, deleteEncryptedFile, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteProjectOp, deleteSavedToolOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, deriveKeyFromSignatureBytes, deriveMemoryKeyRing, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, encryptToolCallEventsOp, ensureDefaultFoldersOp, expandToolSetsAdditive, exportElementToPdf, exportMarkdownToPdf, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractFileIds, extractMCPImageUrls, extractReservationReceipts, fileExists, findById, findMatchingTools, findParentOfId, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllSavedToolsOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAndClearNotionPendingMessage, getAndClearNotionReturnUrl, getAppFileMapOp, getAppFileOp, getAppFilesOp, getAudioOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getEntitiesByMemoryIdsOp, getId, getImagesOp, getLogger, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesByEntityNamesOp, getMemoriesNeedingTopicExtractionOp, getNotionAccessToken, getNotionMCPUrl, getNumberAttr, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getSavedToolByIdOp, getServerTools, getStringAttr, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserUploadedMediaOp, getValidNotionToken, getVaultCandidateKeysOp, getVaultEmbeddingsByIdsOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, getVideosOp, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasICloudCredentials, hasKeyPair, hasNotionCredentials, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isAttachedFilesText, isDegradedTopicSkip, isEncrypted, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, maskScopedEmbeddingCache, mediaToStored, memoryCipher, migrateDisplayResult, migrateMemoriesToRemote, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, parseMedia, preEmbedVaultMemories, preprocessFiles, previewToolSelection, primaryTopic, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, rankProfileCandidates, readEncryptedFile, recall, reencryptMemoryField, reflect, refreshEncryptionKeyIfMatches, refreshNotionToken, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeNotionAccess, savedToolToStored, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, setMemoryVisibilityOp, settingsStorageSchema, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, stampTopicsExtractedAtOp, startNotionAuth, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, topicWeight, traverseGraphLane, ttlForType, updateAttrs, updateConversationProjectOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageFeedbackOp, updateProjectNameOp, updateProjectOp, updateSavedToolOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, useAnumaTheme, useBackup, useBackupAuth, useChat, useChatStorage, useCredits, useDatabaseManager, useEncryption, useExportPdf, useFiles, useICloudAuth, useICloudBackup, useModels, useOCR, usePdf, usePhoneCalls, useProjects, useSettings, useSubscription, useTools, useUIInteraction, useVoice, useWalletBinding, userPreferencesStorageSchema, verifyMemoriesForPublish, walk, webPlatformStorage, withActiveToolSetServerTools, withInternalFlowMarker, writeEncryptedFile };
|
package/dist/react/index.mjs
CHANGED
|
@@ -69,7 +69,7 @@ function onKeyAvailable(address, callback) {
|
|
|
69
69
|
callbacks.add(callback);
|
|
70
70
|
return () => {
|
|
71
71
|
callbacks.delete(callback);
|
|
72
|
-
if (callbacks.size === 0) {
|
|
72
|
+
if (callbacks.size === 0 && keyAvailableCallbacks.get(address) === callbacks) {
|
|
73
73
|
keyAvailableCallbacks.delete(address);
|
|
74
74
|
}
|
|
75
75
|
};
|
|
@@ -10438,6 +10438,67 @@ __decorateClass([
|
|
|
10438
10438
|
// src/lib/db/entities/operations.ts
|
|
10439
10439
|
import { Q as Q5 } from "@nozbe/watermelondb";
|
|
10440
10440
|
|
|
10441
|
+
// src/lib/db/memoryVault/types.ts
|
|
10442
|
+
var MEMORY_KINDS = [
|
|
10443
|
+
"display_name",
|
|
10444
|
+
"birth_date",
|
|
10445
|
+
"bio",
|
|
10446
|
+
"occupation",
|
|
10447
|
+
"interest",
|
|
10448
|
+
"gender",
|
|
10449
|
+
"height_cm",
|
|
10450
|
+
"looking_for",
|
|
10451
|
+
"politics",
|
|
10452
|
+
"religion",
|
|
10453
|
+
"ethnicity",
|
|
10454
|
+
"smoking",
|
|
10455
|
+
"drinking",
|
|
10456
|
+
"exercise",
|
|
10457
|
+
"sexuality",
|
|
10458
|
+
"prompt"
|
|
10459
|
+
];
|
|
10460
|
+
var MEMORY_LEVELS = ["private", "matching", "profile"];
|
|
10461
|
+
var MemoryLevelError = class extends Error {
|
|
10462
|
+
constructor(message) {
|
|
10463
|
+
super(message);
|
|
10464
|
+
this.name = "MemoryLevelError";
|
|
10465
|
+
}
|
|
10466
|
+
};
|
|
10467
|
+
var MemorySourceIneligibleError = class extends Error {
|
|
10468
|
+
constructor() {
|
|
10469
|
+
super("Memory source is no longer eligible");
|
|
10470
|
+
this.name = "MemorySourceIneligibleError";
|
|
10471
|
+
}
|
|
10472
|
+
};
|
|
10473
|
+
var PUBLISHED_SCOPES = /* @__PURE__ */ new Set(["shared", "public"]);
|
|
10474
|
+
function levelFromScope(scope) {
|
|
10475
|
+
return typeof scope === "string" && PUBLISHED_SCOPES.has(scope) ? "matching" : "private";
|
|
10476
|
+
}
|
|
10477
|
+
function scopeForLevel(level) {
|
|
10478
|
+
return level === "private" ? "private" : "shared";
|
|
10479
|
+
}
|
|
10480
|
+
function resolveMemoryLevel(level, scope) {
|
|
10481
|
+
return typeof level === "string" && MEMORY_LEVELS.includes(level) ? level : levelFromScope(scope);
|
|
10482
|
+
}
|
|
10483
|
+
function levelForScopeChange(current, nextScope) {
|
|
10484
|
+
const implied = levelFromScope(nextScope);
|
|
10485
|
+
return implied === "matching" && resolveMemoryLevel(current.level, current.scope) === "profile" ? "profile" : implied;
|
|
10486
|
+
}
|
|
10487
|
+
function parseMedia(value) {
|
|
10488
|
+
if (typeof value !== "string" || value === "") return null;
|
|
10489
|
+
try {
|
|
10490
|
+
const parsed = JSON.parse(value);
|
|
10491
|
+
if (!Array.isArray(parsed)) return null;
|
|
10492
|
+
const refs = parsed.filter((r) => typeof r === "object" && r !== null).map((r) => ({
|
|
10493
|
+
feedItemId: Number(r.feedItemId ?? r.feed_item_id),
|
|
10494
|
+
objectKey: r.objectKey ?? r.object_key ?? null
|
|
10495
|
+
})).filter((r) => Number.isFinite(r.feedItemId));
|
|
10496
|
+
return refs.length > 0 ? refs : null;
|
|
10497
|
+
} catch {
|
|
10498
|
+
return null;
|
|
10499
|
+
}
|
|
10500
|
+
}
|
|
10501
|
+
|
|
10441
10502
|
// src/lib/db/entities/types.ts
|
|
10442
10503
|
var ENTITY_KINDS = [
|
|
10443
10504
|
"person",
|
|
@@ -10497,7 +10558,7 @@ function parseTopics(value) {
|
|
|
10497
10558
|
// src/lib/db/entities/operations.ts
|
|
10498
10559
|
async function assertCanWrite(ctx) {
|
|
10499
10560
|
if (ctx.canWrite && !await ctx.canWrite()) {
|
|
10500
|
-
throw new
|
|
10561
|
+
throw new MemorySourceIneligibleError();
|
|
10501
10562
|
}
|
|
10502
10563
|
}
|
|
10503
10564
|
function entityToStored(e) {
|
|
@@ -13139,61 +13200,6 @@ function serializeSourceChunkIds(ids) {
|
|
|
13139
13200
|
return JSON.stringify(ids.slice(start));
|
|
13140
13201
|
}
|
|
13141
13202
|
|
|
13142
|
-
// src/lib/db/memoryVault/types.ts
|
|
13143
|
-
var MEMORY_KINDS = [
|
|
13144
|
-
"display_name",
|
|
13145
|
-
"birth_date",
|
|
13146
|
-
"bio",
|
|
13147
|
-
"occupation",
|
|
13148
|
-
"interest",
|
|
13149
|
-
"gender",
|
|
13150
|
-
"height_cm",
|
|
13151
|
-
"looking_for",
|
|
13152
|
-
"politics",
|
|
13153
|
-
"religion",
|
|
13154
|
-
"ethnicity",
|
|
13155
|
-
"smoking",
|
|
13156
|
-
"drinking",
|
|
13157
|
-
"exercise",
|
|
13158
|
-
"sexuality",
|
|
13159
|
-
"prompt"
|
|
13160
|
-
];
|
|
13161
|
-
var MEMORY_LEVELS = ["private", "matching", "profile"];
|
|
13162
|
-
var MemoryLevelError = class extends Error {
|
|
13163
|
-
constructor(message) {
|
|
13164
|
-
super(message);
|
|
13165
|
-
this.name = "MemoryLevelError";
|
|
13166
|
-
}
|
|
13167
|
-
};
|
|
13168
|
-
var PUBLISHED_SCOPES = /* @__PURE__ */ new Set(["shared", "public"]);
|
|
13169
|
-
function levelFromScope(scope) {
|
|
13170
|
-
return typeof scope === "string" && PUBLISHED_SCOPES.has(scope) ? "matching" : "private";
|
|
13171
|
-
}
|
|
13172
|
-
function scopeForLevel(level) {
|
|
13173
|
-
return level === "private" ? "private" : "shared";
|
|
13174
|
-
}
|
|
13175
|
-
function resolveMemoryLevel(level, scope) {
|
|
13176
|
-
return typeof level === "string" && MEMORY_LEVELS.includes(level) ? level : levelFromScope(scope);
|
|
13177
|
-
}
|
|
13178
|
-
function levelForScopeChange(current, nextScope) {
|
|
13179
|
-
const implied = levelFromScope(nextScope);
|
|
13180
|
-
return implied === "matching" && resolveMemoryLevel(current.level, current.scope) === "profile" ? "profile" : implied;
|
|
13181
|
-
}
|
|
13182
|
-
function parseMedia(value) {
|
|
13183
|
-
if (typeof value !== "string" || value === "") return null;
|
|
13184
|
-
try {
|
|
13185
|
-
const parsed = JSON.parse(value);
|
|
13186
|
-
if (!Array.isArray(parsed)) return null;
|
|
13187
|
-
const refs = parsed.filter((r) => typeof r === "object" && r !== null).map((r) => ({
|
|
13188
|
-
feedItemId: Number(r.feedItemId ?? r.feed_item_id),
|
|
13189
|
-
objectKey: r.objectKey ?? r.object_key ?? null
|
|
13190
|
-
})).filter((r) => Number.isFinite(r.feedItemId));
|
|
13191
|
-
return refs.length > 0 ? refs : null;
|
|
13192
|
-
} catch {
|
|
13193
|
-
return null;
|
|
13194
|
-
}
|
|
13195
|
-
}
|
|
13196
|
-
|
|
13197
13203
|
// src/lib/db/memoryVault/operations.ts
|
|
13198
13204
|
function visibilityOrPrivate(value) {
|
|
13199
13205
|
return value === "public" ? value : "private";
|
|
@@ -13213,7 +13219,7 @@ function isKinded(record2) {
|
|
|
13213
13219
|
}
|
|
13214
13220
|
async function assertCanWrite2(ctx) {
|
|
13215
13221
|
if (ctx.canWrite && !await ctx.canWrite()) {
|
|
13216
|
-
throw new
|
|
13222
|
+
throw new MemorySourceIneligibleError();
|
|
13217
13223
|
}
|
|
13218
13224
|
}
|
|
13219
13225
|
function assertValidKindLevel(kind, level) {
|
|
@@ -13904,7 +13910,7 @@ async function updateVaultMemoryOp(ctx, id, opts) {
|
|
|
13904
13910
|
ctx.embeddedWalletSigner
|
|
13905
13911
|
);
|
|
13906
13912
|
} catch (err) {
|
|
13907
|
-
if (err instanceof MemoryLevelError) throw err;
|
|
13913
|
+
if (err instanceof MemoryLevelError || err instanceof MemorySourceIneligibleError) throw err;
|
|
13908
13914
|
return null;
|
|
13909
13915
|
}
|
|
13910
13916
|
}
|
|
@@ -17878,6 +17884,13 @@ var DEFAULT_AUTO_MERGE_THRESHOLD = 0.8;
|
|
|
17878
17884
|
var DEFAULT_SCOPE = "private";
|
|
17879
17885
|
var DEFAULT_CONSOLIDATE_THRESHOLD = 0.55;
|
|
17880
17886
|
var DEFAULT_CONSOLIDATE_TOP_K = 20;
|
|
17887
|
+
var RetainError = class extends Error {
|
|
17888
|
+
constructor(reason, message) {
|
|
17889
|
+
super(message);
|
|
17890
|
+
this.reason = reason;
|
|
17891
|
+
this.name = "RetainError";
|
|
17892
|
+
}
|
|
17893
|
+
};
|
|
17881
17894
|
async function retain(content, ctx, options = {}) {
|
|
17882
17895
|
const embeddingOptions = {
|
|
17883
17896
|
...ctx.embeddingOptions,
|
|
@@ -17933,7 +17946,8 @@ async function retainWithPersistence(content, ctx, options = {}) {
|
|
|
17933
17946
|
});
|
|
17934
17947
|
prepared = withoutKindedRows(prepared);
|
|
17935
17948
|
if (prepared.embeddingFailure || prepared.embeddingsUnavailable) {
|
|
17936
|
-
throw new
|
|
17949
|
+
throw new RetainError(
|
|
17950
|
+
"embeddings-unavailable",
|
|
17937
17951
|
"retain: embeddings unavailable \u2014 refusing to auto-merge against an inert cosine lane, which would create a duplicate instead of merging into the existing memory. Retry when embeddings recover, or pass enableAutoMerge: false to force a create."
|
|
17938
17952
|
);
|
|
17939
17953
|
}
|
|
@@ -18303,7 +18317,10 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
|
|
|
18303
18317
|
async function assertMergeTargetGoneOrThrow(ctx, targetId) {
|
|
18304
18318
|
const stillExists = await (ctx.persistence.getFresh ? ctx.persistence.getFresh(targetId) : ctx.persistence.get(targetId));
|
|
18305
18319
|
if (stillExists && (stillExists.kind === null || stillExists.kind === void 0)) {
|
|
18306
|
-
throw new
|
|
18320
|
+
throw new RetainError(
|
|
18321
|
+
"merge-not-persisted",
|
|
18322
|
+
`retain: merge into memory ${targetId} failed to persist`
|
|
18323
|
+
);
|
|
18307
18324
|
}
|
|
18308
18325
|
}
|
|
18309
18326
|
|
|
@@ -18461,6 +18478,12 @@ function restoreCandidates(candidates, redactor, ownNames) {
|
|
|
18461
18478
|
(c) => c.candidate.content.length <= MAX_CONTENT_LENGTH && !c.unresolved && !isLowSignalContent(c.candidate.content, ownNames)
|
|
18462
18479
|
).map((c) => c.candidate);
|
|
18463
18480
|
}
|
|
18481
|
+
function writeFailureReasonOf(err) {
|
|
18482
|
+
if (err instanceof MemorySourceIneligibleError) return "source-ineligible";
|
|
18483
|
+
if (err instanceof RetainError) return err.reason;
|
|
18484
|
+
if (err?.name === "AbortError") return "aborted";
|
|
18485
|
+
return "unknown";
|
|
18486
|
+
}
|
|
18464
18487
|
async function extractAndRetain(messages, retainCtx, options) {
|
|
18465
18488
|
const { memoryStore, signal } = options;
|
|
18466
18489
|
if (memoryStore === null) throw new Error("Memory store is not ready");
|
|
@@ -18550,6 +18573,7 @@ async function extractAndRetain(messages, retainCtx, options) {
|
|
|
18550
18573
|
const results = [];
|
|
18551
18574
|
const quarantinedInfo = [];
|
|
18552
18575
|
let failedWrites = 0;
|
|
18576
|
+
let writeFailureReason;
|
|
18553
18577
|
let auditRows;
|
|
18554
18578
|
const tRetain = Date.now();
|
|
18555
18579
|
for (const { candidate, isQuarantined, reason, signature } of toRetain) {
|
|
@@ -18645,6 +18669,7 @@ async function extractAndRetain(messages, retainCtx, options) {
|
|
|
18645
18669
|
}
|
|
18646
18670
|
} catch (err) {
|
|
18647
18671
|
failedWrites++;
|
|
18672
|
+
writeFailureReason ?? (writeFailureReason = writeFailureReasonOf(err));
|
|
18648
18673
|
log.warn("[memory/extract] retain failed for one candidate", err);
|
|
18649
18674
|
options.onCandidateFailed?.(candidate, err);
|
|
18650
18675
|
}
|
|
@@ -18657,6 +18682,7 @@ async function extractAndRetain(messages, retainCtx, options) {
|
|
|
18657
18682
|
candidates: succeededCandidates,
|
|
18658
18683
|
results,
|
|
18659
18684
|
failedCount: failedWrites,
|
|
18685
|
+
...writeFailureReason !== void 0 && { writeFailureReason },
|
|
18660
18686
|
outcome: outcome2,
|
|
18661
18687
|
quarantined: quarantinedInfo,
|
|
18662
18688
|
funnel: {
|
|
@@ -18925,7 +18951,17 @@ function createAutoExtractor(options) {
|
|
|
18925
18951
|
const t0 = Date.now();
|
|
18926
18952
|
void (async () => {
|
|
18927
18953
|
try {
|
|
18928
|
-
const {
|
|
18954
|
+
const {
|
|
18955
|
+
candidates,
|
|
18956
|
+
results,
|
|
18957
|
+
failedCount,
|
|
18958
|
+
writeFailureReason,
|
|
18959
|
+
outcome: outcome2,
|
|
18960
|
+
failure,
|
|
18961
|
+
funnel,
|
|
18962
|
+
timings,
|
|
18963
|
+
model
|
|
18964
|
+
} = await extractAndRetain(window2, retainCtx, {
|
|
18929
18965
|
extract,
|
|
18930
18966
|
memoryStore: options.memoryStore,
|
|
18931
18967
|
signal: options.signal,
|
|
@@ -18961,6 +18997,7 @@ function createAutoExtractor(options) {
|
|
|
18961
18997
|
candidates,
|
|
18962
18998
|
results,
|
|
18963
18999
|
failedCount,
|
|
19000
|
+
...writeFailureReason !== void 0 && { writeFailureReason },
|
|
18964
19001
|
durationMs: Date.now() - t0,
|
|
18965
19002
|
conversationId,
|
|
18966
19003
|
outcome: outcome2,
|
|
@@ -21073,10 +21110,10 @@ function createLocalMemoryStore(options) {
|
|
|
21073
21110
|
const assertWrite = async (writeOptions) => {
|
|
21074
21111
|
writeOptions?.signal?.throwIfAborted();
|
|
21075
21112
|
if (writeOptions?.canWrite && !await writeOptions.canWrite()) {
|
|
21076
|
-
throw new
|
|
21113
|
+
throw new MemorySourceIneligibleError();
|
|
21077
21114
|
}
|
|
21078
21115
|
if (options.canWrite && !await options.canWrite()) {
|
|
21079
|
-
throw new
|
|
21116
|
+
throw new MemorySourceIneligibleError();
|
|
21080
21117
|
}
|
|
21081
21118
|
writeOptions?.signal?.throwIfAborted();
|
|
21082
21119
|
};
|
|
@@ -21885,7 +21922,7 @@ function createRemoteMemoryPipeline(options) {
|
|
|
21885
21922
|
const assertWrite = async () => {
|
|
21886
21923
|
signal?.throwIfAborted();
|
|
21887
21924
|
if (writeOptions?.canWrite && !await writeOptions.canWrite())
|
|
21888
|
-
throw new
|
|
21925
|
+
throw new MemorySourceIneligibleError();
|
|
21889
21926
|
signal?.throwIfAborted();
|
|
21890
21927
|
};
|
|
21891
21928
|
const rejectUndecryptable = (failed) => {
|
|
@@ -22891,7 +22928,7 @@ function createRemoteMemoryStore(options) {
|
|
|
22891
22928
|
if (!record2) return null;
|
|
22892
22929
|
if (record2.memory.is_deleted) return null;
|
|
22893
22930
|
if (writeOptions?.canWrite && !await writeOptions.canWrite())
|
|
22894
|
-
throw new
|
|
22931
|
+
throw new MemorySourceIneligibleError();
|
|
22895
22932
|
writeOptions?.signal?.throwIfAborted();
|
|
22896
22933
|
const next = edit(structuredClone(record2.memory));
|
|
22897
22934
|
if (!next) return null;
|
|
@@ -24229,10 +24266,20 @@ function batchError(result) {
|
|
|
24229
24266
|
var AccountFailureError = class extends Error {
|
|
24230
24267
|
};
|
|
24231
24268
|
var LockedSourcesError = class extends Error {
|
|
24232
|
-
constructor(persistentIds) {
|
|
24233
|
-
|
|
24269
|
+
constructor(persistentIds, locked) {
|
|
24270
|
+
const counts = /* @__PURE__ */ new Map();
|
|
24271
|
+
for (const message of locked) {
|
|
24272
|
+
const version = /^enc:(v\d+):/.exec(message.content)?.[1] ?? "unknown";
|
|
24273
|
+
const key = `${message.decryptionStatus ?? "no_status"}:${version}`;
|
|
24274
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
24275
|
+
}
|
|
24276
|
+
const summary = [...counts].map(([key, count2]) => `${key}=${count2}`).join(", ");
|
|
24277
|
+
super(`Source messages are locked; retained for retry (${summary})`);
|
|
24234
24278
|
this.persistentIds = persistentIds;
|
|
24235
24279
|
}
|
|
24280
|
+
get awaitingKey() {
|
|
24281
|
+
return this.persistentIds.length === 0;
|
|
24282
|
+
}
|
|
24236
24283
|
};
|
|
24237
24284
|
function splitTurns(messages) {
|
|
24238
24285
|
const turns = [];
|
|
@@ -24286,6 +24333,8 @@ function createDurableAutoExtractor(options) {
|
|
|
24286
24333
|
const attempts = /* @__PURE__ */ new Map();
|
|
24287
24334
|
const sessionFailures = /* @__PURE__ */ new Map();
|
|
24288
24335
|
const skippedThisSession = /* @__PURE__ */ new Set();
|
|
24336
|
+
const awaitingKey = /* @__PURE__ */ new Set();
|
|
24337
|
+
let keyEpoch = 0;
|
|
24289
24338
|
const clock = options.now ?? Date.now;
|
|
24290
24339
|
const reportError = (error, conversationId) => {
|
|
24291
24340
|
try {
|
|
@@ -24479,13 +24528,15 @@ function createDurableAutoExtractor(options) {
|
|
|
24479
24528
|
for (const job of pending) {
|
|
24480
24529
|
if (disposed) break;
|
|
24481
24530
|
const attempted = attempts.get(job.id) ?? 0;
|
|
24482
|
-
if (attempted >= MAX_ATTEMPTS || skippedThisSession.has(job.id))
|
|
24531
|
+
if (attempted >= MAX_ATTEMPTS || skippedThisSession.has(job.id) || awaitingKey.has(job.id))
|
|
24532
|
+
continue;
|
|
24483
24533
|
if (processed >= MAX_JOBS_PER_PASS) {
|
|
24484
24534
|
scheduleAfterSuccess = true;
|
|
24485
24535
|
break;
|
|
24486
24536
|
}
|
|
24487
24537
|
processed++;
|
|
24488
24538
|
const conversationId = String(job._getRaw("conversation_id"));
|
|
24539
|
+
const epochAtRead = keyEpoch;
|
|
24489
24540
|
let ids = [];
|
|
24490
24541
|
let loaded = [];
|
|
24491
24542
|
try {
|
|
@@ -24519,16 +24570,39 @@ function createDurableAutoExtractor(options) {
|
|
|
24519
24570
|
);
|
|
24520
24571
|
continue;
|
|
24521
24572
|
}
|
|
24522
|
-
const
|
|
24573
|
+
const foreign = new Set(
|
|
24574
|
+
ids.filter((_id, index) => loaded[index]?.conversationId !== conversationId)
|
|
24575
|
+
);
|
|
24576
|
+
if (foreign.size) {
|
|
24577
|
+
await database.write(
|
|
24578
|
+
() => job.update(
|
|
24579
|
+
(r) => r._setRaw(
|
|
24580
|
+
"message_ids",
|
|
24581
|
+
JSON.stringify(idsOf(job).filter((id) => !foreign.has(id)))
|
|
24582
|
+
)
|
|
24583
|
+
)
|
|
24584
|
+
);
|
|
24585
|
+
attempts.delete(job.id);
|
|
24586
|
+
scheduleAfterSuccess = true;
|
|
24587
|
+
reportError(
|
|
24588
|
+
new Error(`Dropped ${foreign.size} source id(s) from another conversation`),
|
|
24589
|
+
conversationId
|
|
24590
|
+
);
|
|
24591
|
+
continue;
|
|
24592
|
+
}
|
|
24593
|
+
const locked = loaded.filter(
|
|
24594
|
+
(message) => !!message && isEncrypted(message.content)
|
|
24595
|
+
);
|
|
24523
24596
|
if (locked.length) {
|
|
24524
24597
|
throw new LockedSourcesError(
|
|
24525
24598
|
locked.flatMap(
|
|
24526
24599
|
(message) => message.decryptionStatus === "auth_mismatch" || message.decryptionStatus === "invalid_payload" ? [message.uniqueId] : []
|
|
24527
|
-
)
|
|
24600
|
+
),
|
|
24601
|
+
locked
|
|
24528
24602
|
);
|
|
24529
24603
|
}
|
|
24530
24604
|
const messages = loaded.flatMap(
|
|
24531
|
-
(m) => m &&
|
|
24605
|
+
(m) => m && (m.role === "user" || m.role === "assistant") ? [{ id: m.uniqueId, role: m.role, content: m.content }] : []
|
|
24532
24606
|
);
|
|
24533
24607
|
const jobScope = currentScope() === "private" ? "private" : String(job._getRaw("scope"));
|
|
24534
24608
|
const jobFolderId = job._getRaw("folder_id") ?? null;
|
|
@@ -24578,6 +24652,12 @@ function createDurableAutoExtractor(options) {
|
|
|
24578
24652
|
scheduleAfterSuccess = true;
|
|
24579
24653
|
} catch (error) {
|
|
24580
24654
|
if (disposed) break;
|
|
24655
|
+
if (error instanceof LockedSourcesError && error.awaitingKey) {
|
|
24656
|
+
reportError(error, conversationId);
|
|
24657
|
+
if (keyEpoch === epochAtRead) awaitingKey.add(job.id);
|
|
24658
|
+
else scheduleAfterSuccess = true;
|
|
24659
|
+
continue;
|
|
24660
|
+
}
|
|
24581
24661
|
attempts.set(job.id, attempted + 1);
|
|
24582
24662
|
retry = true;
|
|
24583
24663
|
reportError(error, conversationId);
|
|
@@ -24605,7 +24685,18 @@ function createDurableAutoExtractor(options) {
|
|
|
24605
24685
|
activeBatch?.abort(options.signal?.reason);
|
|
24606
24686
|
if (timer !== void 0) clearTimeout(timer);
|
|
24607
24687
|
options.signal?.removeEventListener("abort", dispose);
|
|
24688
|
+
unsubscribeKey?.();
|
|
24608
24689
|
}
|
|
24690
|
+
const unsubscribeKey = vault.walletAddress ? onKeyAvailable(vault.walletAddress, () => {
|
|
24691
|
+
keyEpoch++;
|
|
24692
|
+
if (!awaitingKey.size) return;
|
|
24693
|
+
awaitingKey.clear();
|
|
24694
|
+
if (timer !== void 0) {
|
|
24695
|
+
clearTimeout(timer);
|
|
24696
|
+
timer = void 0;
|
|
24697
|
+
}
|
|
24698
|
+
schedule(0);
|
|
24699
|
+
}) : void 0;
|
|
24609
24700
|
if (options.signal?.aborted) dispose();
|
|
24610
24701
|
else options.signal?.addEventListener("abort", dispose, { once: true });
|
|
24611
24702
|
schedule(0);
|
|
@@ -24621,9 +24712,31 @@ function createDurableAutoExtractor(options) {
|
|
|
24621
24712
|
(candidate) => candidate._getRaw("scope") === scope && (candidate._getRaw("folder_id") ?? null) === folderId
|
|
24622
24713
|
);
|
|
24623
24714
|
const positions = new Map(ids.map((id, index) => [id, index]));
|
|
24715
|
+
const watermarks = existing.flatMap((prior) => {
|
|
24716
|
+
const watermark = prior._getRaw("watermark");
|
|
24717
|
+
return typeof watermark === "string" && watermark ? [watermark] : [];
|
|
24718
|
+
});
|
|
24719
|
+
if (watermarks.length) {
|
|
24720
|
+
const misplaced = new Set(
|
|
24721
|
+
await storage.messagesCollection.query(
|
|
24722
|
+
Q16.where("id", Q16.oneOf(watermarks)),
|
|
24723
|
+
Q16.where("conversation_id", Q16.notEq(conversationId))
|
|
24724
|
+
).fetchIds()
|
|
24725
|
+
);
|
|
24726
|
+
for (const prior of existing)
|
|
24727
|
+
if (misplaced.has(String(prior._getRaw("watermark"))))
|
|
24728
|
+
await prior.update((r) => {
|
|
24729
|
+
r._setRaw("watermark", null);
|
|
24730
|
+
r._setRaw("watermark_seq", null);
|
|
24731
|
+
});
|
|
24732
|
+
}
|
|
24624
24733
|
const rows = await storage.messagesCollection.query(Q16.where("id", Q16.oneOf(ids))).fetch();
|
|
24734
|
+
const foreignRows = new Set(
|
|
24735
|
+
rows.filter((row) => row._getRaw("conversation_id") !== conversationId).map((row) => row.id)
|
|
24736
|
+
);
|
|
24625
24737
|
const sequences = /* @__PURE__ */ new Map();
|
|
24626
24738
|
for (const row of rows) {
|
|
24739
|
+
if (foreignRows.has(row.id)) continue;
|
|
24627
24740
|
const sequence = Number(row._getRaw("message_id"));
|
|
24628
24741
|
if (Number.isFinite(sequence) && sequence > 0) sequences.set(row.id, sequence);
|
|
24629
24742
|
}
|
|
@@ -24666,13 +24779,14 @@ function createDurableAutoExtractor(options) {
|
|
|
24666
24779
|
const ownWatermark = job?._getRaw("watermark");
|
|
24667
24780
|
const atOwnWatermark = !!job && boundary >= 0 && failedSessionsOf(job, String(ownWatermark)) < MAX_FAILED_SESSIONS && (ids[boundary] === ownWatermark || sequences.get(ids[boundary]) !== void 0 && sequences.get(ids[boundary]) === seqOf(job));
|
|
24668
24781
|
const overlapStart = atOwnWatermark ? Math.max(0, boundary - 1) : start;
|
|
24669
|
-
const fresh = ids.slice(overlapStart).filter((id) => !foreignSources.has(id));
|
|
24782
|
+
const fresh = ids.slice(overlapStart).filter((id) => !foreignSources.has(id) && !foreignRows.has(id));
|
|
24670
24783
|
if (!fresh.length) return;
|
|
24671
24784
|
if (job) {
|
|
24672
24785
|
await job.update(
|
|
24673
24786
|
(r) => r._setRaw("message_ids", JSON.stringify([.../* @__PURE__ */ new Set([...idsOf(job), ...fresh])]))
|
|
24674
24787
|
);
|
|
24675
24788
|
attempts.delete(job.id);
|
|
24789
|
+
awaitingKey.delete(job.id);
|
|
24676
24790
|
} else {
|
|
24677
24791
|
await jobs.create((r) => {
|
|
24678
24792
|
r._setRaw("owner_key", owner);
|