@anuma/sdk 6.39.2 → 6.40.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.
- package/dist/expo/index.cjs +333 -28
- package/dist/expo/index.d.mts +28 -8
- package/dist/expo/index.d.ts +28 -8
- package/dist/expo/index.mjs +333 -28
- package/dist/react/index.cjs +333 -28
- package/dist/react/index.d.mts +28 -8
- package/dist/react/index.d.ts +28 -8
- package/dist/react/index.mjs +333 -28
- package/dist/server/index.cjs +123 -18
- package/dist/server/index.d.mts +34 -8
- package/dist/server/index.d.ts +34 -8
- package/dist/server/index.mjs +123 -18
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
|
@@ -3247,12 +3247,10 @@ type StreamingTransportOptions = {
|
|
|
3247
3247
|
inferenceId: string;
|
|
3248
3248
|
}) => void;
|
|
3249
3249
|
/**
|
|
3250
|
-
* Fires
|
|
3251
|
-
*
|
|
3252
|
-
*
|
|
3253
|
-
*
|
|
3254
|
-
* apart from a dead connection (no bytes at all). Not every transport emits it
|
|
3255
|
-
* — the xhr transport does; treat its absence as "no extra liveness info".
|
|
3250
|
+
* Fires when the transport receives bytes, including SSE keep-alive comments.
|
|
3251
|
+
* Consumers can use this callback to reset the idle timeout.
|
|
3252
|
+
* The fetch and XHR transports emit it.
|
|
3253
|
+
* Custom transports can omit it if they cannot report byte activity.
|
|
3256
3254
|
*/
|
|
3257
3255
|
onActivity?: () => void;
|
|
3258
3256
|
};
|
|
@@ -7640,13 +7638,33 @@ interface MemorySubscribeOptions {
|
|
|
7640
7638
|
* from the main interface.
|
|
7641
7639
|
* @public
|
|
7642
7640
|
*/
|
|
7643
|
-
interface MemoryMaintenance {
|
|
7641
|
+
interface MemoryMaintenance extends MemoryTopicMaintenance {
|
|
7644
7642
|
/** Decay sweeper bound to this store's vault (see `createDecaySweeper`). */
|
|
7645
7643
|
createDecaySweeper(options?: Omit<CreateDecaySweeperOptions, "vaultCtx">): DecaySweeper;
|
|
7646
7644
|
/** One page of the topic-extraction backlog (see `getMemoriesNeedingTopicExtractionOp`). */
|
|
7647
7645
|
getTopicBacklog(options?: {
|
|
7648
7646
|
limit?: number;
|
|
7649
7647
|
}): Promise<MemoriesNeedingTopicExtraction>;
|
|
7648
|
+
}
|
|
7649
|
+
/** @public */
|
|
7650
|
+
interface MemoryTopicBacklog {
|
|
7651
|
+
pending: readonly {
|
|
7652
|
+
uniqueId: string;
|
|
7653
|
+
}[];
|
|
7654
|
+
linkedUnstamped: readonly string[];
|
|
7655
|
+
topicsToRelink: readonly string[];
|
|
7656
|
+
topicsBackfill: readonly string[];
|
|
7657
|
+
}
|
|
7658
|
+
/**
|
|
7659
|
+
* Topic-extraction upkeep for either backend. On a remote store `pending` carries ids only, the
|
|
7660
|
+
* other backlog lists are always empty, and `relinkTopics` / `backfillTopics` do nothing.
|
|
7661
|
+
* @public
|
|
7662
|
+
*/
|
|
7663
|
+
interface MemoryTopicMaintenance {
|
|
7664
|
+
/** One page of the topic-extraction backlog, edited or outdated rows first. */
|
|
7665
|
+
getTopicBacklog(options?: {
|
|
7666
|
+
limit?: number;
|
|
7667
|
+
}): Promise<MemoryTopicBacklog>;
|
|
7650
7668
|
/** LLM topic extraction + link + stamp for these memories. */
|
|
7651
7669
|
extractTopics(memoryIds: readonly string[], options: TopicExtractOptions & {
|
|
7652
7670
|
now?: number;
|
|
@@ -7723,6 +7741,8 @@ interface MemoryStore {
|
|
|
7723
7741
|
subscribe(onChange: () => void, options?: MemorySubscribeOptions): () => void;
|
|
7724
7742
|
/** TRANSITIONAL — see {@link MemoryMaintenance}. Absent on a remote backend. */
|
|
7725
7743
|
maintenance?: MemoryMaintenance;
|
|
7744
|
+
/** Topic-extraction upkeep, available on every backend. */
|
|
7745
|
+
readonly topicMaintenance: MemoryTopicMaintenance;
|
|
7726
7746
|
}
|
|
7727
7747
|
|
|
7728
7748
|
/**
|
|
@@ -16371,4 +16391,4 @@ type UseWalletBindingResult = {
|
|
|
16371
16391
|
*/
|
|
16372
16392
|
declare function useWalletBinding(options?: UseWalletBindingOptions): UseWalletBindingResult;
|
|
16373
16393
|
|
|
16374
|
-
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_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, 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 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_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_CONVERSATIONS_FOLDER as DEFAULT_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as DEFAULT_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_DROPBOX_FOLDER, 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 DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, 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 GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, 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 MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryTopic, 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 RecallToolCallbacks, type RecallToolOptions, 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, 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 TopicExtractionInput, type TopicExtractionRunResult, 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 UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseExportPdfResult, type UseFilesOptions, type UseFilesResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, 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, clearCalendarToken, clearConversationMemoriesOp, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGithubToken, clearGoogleDriveToken, 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, 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, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getAndClearGithubPendingMessage, getAndClearGithubReturnUrl, getAndClearNotionPendingMessage, getAndClearNotionReturnUrl, getAppFileMapOp, getAppFileOp, getAppFilesOp, getAudioOp, getCachedServerTools, getCalendarAccessToken, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getDriveAccessToken, getEncryptionKey, getEntitiesByMemoryIdsOp, getGithubAccessToken, getGoogleDriveStoredToken, 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, getValidCalendarToken, getValidDriveToken, getValidGithubToken, getValidNotionToken, getVaultCandidateKeysOp, getVaultEmbeddingsByIdsOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, getVideosOp, handleCalendarCallback, handleDriveCallback, handleGithubCallback, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGithubCredentials, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, hasNotionCredentials, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isAttachedFilesText, isCalendarCallback, isDegradedTopicSkip, isDriveCallback, isEncrypted, isGithubCallback, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, maskScopedEmbeddingCache, mediaToStored, memoryCipher, migrateCalendarToken, migrateDisplayResult, migrateDriveToken, migrateGithubToken, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, parseMedia, preEmbedVaultMemories, preprocessFiles, previewToolSelection, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, rankProfileCandidates, readEncryptedFile, recall, reencryptMemoryField, reflect, refreshCalendarToken, refreshDriveToken, refreshEncryptionKeyIfMatches, refreshGithubToken, refreshNotionToken, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeCalendarToken, revokeDriveToken, revokeGithubToken, revokeNotionAccess, savedToolToStored, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, setMemoryVisibilityOp, settingsStorageSchema, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, stampTopicsExtractedAtOp, startGithubAuth, startNotionAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, storeGithubPendingMessage, storeGithubReturnUrl, storeGithubToken, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateAttrs, updateConversationProjectOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageFeedbackOp, updateProjectNameOp, updateProjectOp, updateSavedToolOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, useAnumaTheme, useBackup, useBackupAuth, useChat, useChatStorage, useCredits, useDatabaseManager, useDropboxAuth, useDropboxBackup, useEncryption, useExportPdf, useFiles, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useModels, useOCR, usePdf, usePhoneCalls, useProjects, useSettings, useSubscription, useTools, useUIInteraction, useVoice, useWalletBinding, userPreferencesStorageSchema, verifyMemoriesForPublish, walk, webPlatformStorage, withActiveToolSetServerTools, withInternalFlowMarker, writeEncryptedFile };
|
|
16394
|
+
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_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, 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 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_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_CONVERSATIONS_FOLDER as DEFAULT_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as DEFAULT_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_DROPBOX_FOLDER, 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 DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, 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 GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, 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 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 RecallToolCallbacks, type RecallToolOptions, 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, 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 TopicExtractionInput, type TopicExtractionRunResult, 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 UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseExportPdfResult, type UseFilesOptions, type UseFilesResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, 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, clearCalendarToken, clearConversationMemoriesOp, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGithubToken, clearGoogleDriveToken, 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, 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, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getAndClearGithubPendingMessage, getAndClearGithubReturnUrl, getAndClearNotionPendingMessage, getAndClearNotionReturnUrl, getAppFileMapOp, getAppFileOp, getAppFilesOp, getAudioOp, getCachedServerTools, getCalendarAccessToken, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getDriveAccessToken, getEncryptionKey, getEntitiesByMemoryIdsOp, getGithubAccessToken, getGoogleDriveStoredToken, 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, getValidCalendarToken, getValidDriveToken, getValidGithubToken, getValidNotionToken, getVaultCandidateKeysOp, getVaultEmbeddingsByIdsOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, getVideosOp, handleCalendarCallback, handleDriveCallback, handleGithubCallback, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGithubCredentials, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, hasNotionCredentials, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isAttachedFilesText, isCalendarCallback, isDegradedTopicSkip, isDriveCallback, isEncrypted, isGithubCallback, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, maskScopedEmbeddingCache, mediaToStored, memoryCipher, migrateCalendarToken, migrateDisplayResult, migrateDriveToken, migrateGithubToken, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, parseMedia, preEmbedVaultMemories, preprocessFiles, previewToolSelection, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, rankProfileCandidates, readEncryptedFile, recall, reencryptMemoryField, reflect, refreshCalendarToken, refreshDriveToken, refreshEncryptionKeyIfMatches, refreshGithubToken, refreshNotionToken, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeCalendarToken, revokeDriveToken, revokeGithubToken, revokeNotionAccess, savedToolToStored, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, setMemoryVisibilityOp, settingsStorageSchema, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, stampTopicsExtractedAtOp, startGithubAuth, startNotionAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, storeGithubPendingMessage, storeGithubReturnUrl, storeGithubToken, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateAttrs, updateConversationProjectOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageFeedbackOp, updateProjectNameOp, updateProjectOp, updateSavedToolOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, useAnumaTheme, useBackup, useBackupAuth, useChat, useChatStorage, useCredits, useDatabaseManager, useDropboxAuth, useDropboxBackup, useEncryption, useExportPdf, useFiles, useGoogleDriveAuth, useGoogleDriveBackup, 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
|
@@ -6889,6 +6889,93 @@ function composeHooks(hooks) {
|
|
|
6889
6889
|
};
|
|
6890
6890
|
}
|
|
6891
6891
|
|
|
6892
|
+
// src/lib/chat/streamIdleTimeout.ts
|
|
6893
|
+
var StreamIdleTimeoutError = class extends Error {
|
|
6894
|
+
constructor(idleTimeoutMs) {
|
|
6895
|
+
super(`Stream timed out after ${idleTimeoutMs} ms without activity.`);
|
|
6896
|
+
this.name = "StreamIdleTimeoutError";
|
|
6897
|
+
this.idleTimeoutMs = idleTimeoutMs;
|
|
6898
|
+
}
|
|
6899
|
+
};
|
|
6900
|
+
function withStreamIdleTimeout(transport, idleTimeoutMs) {
|
|
6901
|
+
if (!(idleTimeoutMs > 0) || idleTimeoutMs === Infinity) return transport;
|
|
6902
|
+
return (options) => ({
|
|
6903
|
+
stream: (async function* () {
|
|
6904
|
+
const controller = new AbortController();
|
|
6905
|
+
let timer;
|
|
6906
|
+
let settled = false;
|
|
6907
|
+
let completed = false;
|
|
6908
|
+
let iterator;
|
|
6909
|
+
let interruption;
|
|
6910
|
+
let rejectPending;
|
|
6911
|
+
const disarm = () => {
|
|
6912
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
6913
|
+
timer = void 0;
|
|
6914
|
+
};
|
|
6915
|
+
const interrupt = (error) => {
|
|
6916
|
+
if (interruption) return;
|
|
6917
|
+
interruption = error;
|
|
6918
|
+
rejectPending?.(error);
|
|
6919
|
+
controller.abort();
|
|
6920
|
+
};
|
|
6921
|
+
const arm = () => {
|
|
6922
|
+
if (settled || controller.signal.aborted) return;
|
|
6923
|
+
disarm();
|
|
6924
|
+
timer = setTimeout(() => {
|
|
6925
|
+
interrupt(new StreamIdleTimeoutError(idleTimeoutMs));
|
|
6926
|
+
}, idleTimeoutMs);
|
|
6927
|
+
};
|
|
6928
|
+
const onAbort = () => {
|
|
6929
|
+
controller.abort();
|
|
6930
|
+
};
|
|
6931
|
+
options.signal?.addEventListener("abort", onAbort, { once: true });
|
|
6932
|
+
try {
|
|
6933
|
+
if (options.signal?.aborted) {
|
|
6934
|
+
const error = new Error("Request aborted");
|
|
6935
|
+
error.name = "AbortError";
|
|
6936
|
+
throw error;
|
|
6937
|
+
}
|
|
6938
|
+
arm();
|
|
6939
|
+
iterator = transport({
|
|
6940
|
+
...options,
|
|
6941
|
+
signal: controller.signal,
|
|
6942
|
+
onActivity: () => {
|
|
6943
|
+
arm();
|
|
6944
|
+
options.onActivity?.();
|
|
6945
|
+
}
|
|
6946
|
+
}).stream[Symbol.asyncIterator]();
|
|
6947
|
+
while (true) {
|
|
6948
|
+
if (interruption) throw interruption;
|
|
6949
|
+
const next = await new Promise((resolve, reject) => {
|
|
6950
|
+
rejectPending = reject;
|
|
6951
|
+
Promise.resolve(iterator.next()).then(resolve, reject);
|
|
6952
|
+
});
|
|
6953
|
+
rejectPending = void 0;
|
|
6954
|
+
if (next.done) {
|
|
6955
|
+
completed = true;
|
|
6956
|
+
break;
|
|
6957
|
+
}
|
|
6958
|
+
arm();
|
|
6959
|
+
yield next.value;
|
|
6960
|
+
}
|
|
6961
|
+
} finally {
|
|
6962
|
+
settled = true;
|
|
6963
|
+
rejectPending = void 0;
|
|
6964
|
+
disarm();
|
|
6965
|
+
options.signal?.removeEventListener("abort", onAbort);
|
|
6966
|
+
if (!completed) {
|
|
6967
|
+
controller.abort();
|
|
6968
|
+
try {
|
|
6969
|
+
void iterator?.return?.().catch(() => {
|
|
6970
|
+
});
|
|
6971
|
+
} catch {
|
|
6972
|
+
}
|
|
6973
|
+
}
|
|
6974
|
+
}
|
|
6975
|
+
})()
|
|
6976
|
+
});
|
|
6977
|
+
}
|
|
6978
|
+
|
|
6892
6979
|
// src/lib/chat/useChat/utils.ts
|
|
6893
6980
|
import { jsonrepair } from "jsonrepair";
|
|
6894
6981
|
function parseToolArguments(raw) {
|
|
@@ -9078,7 +9165,20 @@ var defaultTransport = (options) => {
|
|
|
9078
9165
|
} catch {
|
|
9079
9166
|
}
|
|
9080
9167
|
}
|
|
9081
|
-
return response;
|
|
9168
|
+
if (!response.body || !options.onActivity) return response;
|
|
9169
|
+
const body = response.body.pipeThrough(
|
|
9170
|
+
new TransformStream({
|
|
9171
|
+
transform(chunk, controller) {
|
|
9172
|
+
if (chunk.byteLength > 0) options.onActivity?.();
|
|
9173
|
+
controller.enqueue(chunk);
|
|
9174
|
+
}
|
|
9175
|
+
})
|
|
9176
|
+
);
|
|
9177
|
+
return new Response(body, {
|
|
9178
|
+
status: response.status,
|
|
9179
|
+
statusText: response.statusText,
|
|
9180
|
+
headers: response.headers
|
|
9181
|
+
});
|
|
9082
9182
|
};
|
|
9083
9183
|
return createSseClient({
|
|
9084
9184
|
method: options.method ?? "POST",
|
|
@@ -9135,6 +9235,7 @@ async function runToolLoop(options) {
|
|
|
9135
9235
|
conversationId,
|
|
9136
9236
|
smoothing,
|
|
9137
9237
|
signal,
|
|
9238
|
+
idleTimeoutMs = 12e4,
|
|
9138
9239
|
resumable,
|
|
9139
9240
|
detachSignal,
|
|
9140
9241
|
onStreamMeta,
|
|
@@ -9148,13 +9249,14 @@ async function runToolLoop(options) {
|
|
|
9148
9249
|
onStepFinish,
|
|
9149
9250
|
onRequest,
|
|
9150
9251
|
onStreamRetry,
|
|
9151
|
-
transport
|
|
9252
|
+
transport = defaultTransport,
|
|
9152
9253
|
preProcessors,
|
|
9153
9254
|
maxConnectorCalls = 2,
|
|
9154
9255
|
hooks: hooksOption,
|
|
9155
9256
|
piiRedaction,
|
|
9156
9257
|
onPiiRedacted
|
|
9157
9258
|
} = options;
|
|
9259
|
+
const makeStreamingRequest = withStreamIdleTimeout(transport, idleTimeoutMs);
|
|
9158
9260
|
const hooks = Array.isArray(hooksOption) ? composeHooks(hooksOption) : hooksOption;
|
|
9159
9261
|
const runId = generateRunId();
|
|
9160
9262
|
let messages = options.messages;
|
|
@@ -21244,6 +21346,14 @@ function createLocalMemoryStore(options) {
|
|
|
21244
21346
|
getLogger().warn("[memory/store] Failed to embed memory:", err);
|
|
21245
21347
|
});
|
|
21246
21348
|
};
|
|
21349
|
+
const maintenance = {
|
|
21350
|
+
createDecaySweeper: (sweeperOptions) => createDecaySweeper({ ...sweeperOptions, vaultCtx }),
|
|
21351
|
+
getTopicBacklog: (backlogOptions) => getMemoriesNeedingTopicExtractionOp(vaultCtx, backlogOptions),
|
|
21352
|
+
extractTopics: (memoryIds, extractOptions) => extractAndLinkEntitiesForMemoriesOp(vaultCtx, memoryIds, extractOptions),
|
|
21353
|
+
stampTopicsExtracted: (memoryIds, extractedAt, version) => stampTopicsExtractedAtOp(vaultCtx, memoryIds, extractedAt, version),
|
|
21354
|
+
relinkTopics: (memoryIds) => relinkMemoryTopicsOp(vaultCtx, memoryIds),
|
|
21355
|
+
backfillTopics: (memoryIds) => backfillMemoryTopicsOp(vaultCtx, memoryIds)
|
|
21356
|
+
};
|
|
21247
21357
|
return {
|
|
21248
21358
|
masksEmbeddingInput: options.embeddingOptions.maskInput !== void 0,
|
|
21249
21359
|
list: (listOptions) => getAllVaultMemoriesOp(vaultCtx, listOptions),
|
|
@@ -21257,21 +21367,22 @@ function createLocalMemoryStore(options) {
|
|
|
21257
21367
|
memoriesByTopics: (names) => getMemoriesByEntityNamesOp(entityCtx, names),
|
|
21258
21368
|
topicsByMemories: (memoryIds) => getEntitiesByMemoryIdsOp(entityCtx, memoryIds),
|
|
21259
21369
|
listTopics: async () => {
|
|
21260
|
-
const links = await entityCtx.memoryEntityCollection.query(...linksOwnedBy).
|
|
21370
|
+
const links = await entityCtx.memoryEntityCollection.query(...linksOwnedBy).unsafeFetchRaw();
|
|
21261
21371
|
const members = /* @__PURE__ */ new Map();
|
|
21262
21372
|
for (const link of links) {
|
|
21263
|
-
const entityId = String(link.
|
|
21373
|
+
const entityId = String(link.entity_id);
|
|
21264
21374
|
const set = members.get(entityId) ?? /* @__PURE__ */ new Set();
|
|
21265
|
-
set.add(String(link.
|
|
21375
|
+
set.add(String(link.memory_id));
|
|
21266
21376
|
members.set(entityId, set);
|
|
21267
21377
|
}
|
|
21268
|
-
const entities = userId === void 0 ? await entityCtx.entityCollection.query().
|
|
21378
|
+
const entities = userId === void 0 ? await entityCtx.entityCollection.query().unsafeFetchRaw() : members.size ? await entityCtx.entityCollection.query(Q15.where("id", Q15.oneOf([...members.keys()]))).unsafeFetchRaw() : [];
|
|
21269
21379
|
const byName = /* @__PURE__ */ new Map();
|
|
21270
21380
|
for (const entity of entities) {
|
|
21271
|
-
const
|
|
21272
|
-
const
|
|
21273
|
-
byName.
|
|
21274
|
-
|
|
21381
|
+
const name = String(entity.canonical_name);
|
|
21382
|
+
const count2 = members.get(String(entity.id))?.size ?? 0;
|
|
21383
|
+
const existing = byName.get(name);
|
|
21384
|
+
byName.set(name, {
|
|
21385
|
+
name,
|
|
21275
21386
|
kind: existing?.kind ?? entity.kind ?? null,
|
|
21276
21387
|
memoryCount: (existing?.memoryCount ?? 0) + count2
|
|
21277
21388
|
});
|
|
@@ -21362,14 +21473,8 @@ function createLocalMemoryStore(options) {
|
|
|
21362
21473
|
}
|
|
21363
21474
|
return () => subscriptions.forEach((s) => s.unsubscribe());
|
|
21364
21475
|
},
|
|
21365
|
-
maintenance
|
|
21366
|
-
|
|
21367
|
-
getTopicBacklog: (backlogOptions) => getMemoriesNeedingTopicExtractionOp(vaultCtx, backlogOptions),
|
|
21368
|
-
extractTopics: (memoryIds, extractOptions) => extractAndLinkEntitiesForMemoriesOp(vaultCtx, memoryIds, extractOptions),
|
|
21369
|
-
stampTopicsExtracted: (memoryIds, extractedAt, version) => stampTopicsExtractedAtOp(vaultCtx, memoryIds, extractedAt, version),
|
|
21370
|
-
relinkTopics: (memoryIds) => relinkMemoryTopicsOp(vaultCtx, memoryIds),
|
|
21371
|
-
backfillTopics: (memoryIds) => backfillMemoryTopicsOp(vaultCtx, memoryIds)
|
|
21372
|
-
}
|
|
21476
|
+
maintenance,
|
|
21477
|
+
topicMaintenance: maintenance
|
|
21373
21478
|
};
|
|
21374
21479
|
}
|
|
21375
21480
|
|
|
@@ -22153,7 +22258,7 @@ function createRemoteMemoryPipeline(options) {
|
|
|
22153
22258
|
const memory = {
|
|
22154
22259
|
...snapshot.memory,
|
|
22155
22260
|
content: patch.content,
|
|
22156
|
-
updated_at: patch.preserveUpdatedAt ? snapshot.memory.updated_at : Date.now()
|
|
22261
|
+
updated_at: patch.preserveUpdatedAt ? snapshot.memory.updated_at : Math.max(Date.now(), (snapshot.memory.topics_extracted_at ?? 0) + 1)
|
|
22157
22262
|
};
|
|
22158
22263
|
if (patch.scope !== void 0) memory.scope = patch.scope;
|
|
22159
22264
|
if (patch.embedding === void 0 && patch.content !== snapshot.memory.content) {
|
|
@@ -22286,6 +22391,7 @@ function projection({ memory }) {
|
|
|
22286
22391
|
};
|
|
22287
22392
|
}
|
|
22288
22393
|
function relevant(change, options) {
|
|
22394
|
+
if (change === "metadata") return false;
|
|
22289
22395
|
return options.includeDeleted ? change === "membership" : change !== "embedding" || !!options.embeddings;
|
|
22290
22396
|
}
|
|
22291
22397
|
function safely(onChange) {
|
|
@@ -22377,6 +22483,17 @@ function mergeTopics(existing, added) {
|
|
|
22377
22483
|
}
|
|
22378
22484
|
return [...byName.values()];
|
|
22379
22485
|
}
|
|
22486
|
+
function sameTopics(stored2, next) {
|
|
22487
|
+
const key = (t) => JSON.stringify([t.name, t.kind ?? null, t.source]);
|
|
22488
|
+
if (stored2 === null || stored2.length !== next.length) return false;
|
|
22489
|
+
const keys = new Set(stored2.map(key));
|
|
22490
|
+
return next.every((t) => keys.has(key(t)));
|
|
22491
|
+
}
|
|
22492
|
+
function extractionDue(memory) {
|
|
22493
|
+
const stamp = memory.topics_extracted_at;
|
|
22494
|
+
if (stamp === void 0 || stamp === null) return "fresh";
|
|
22495
|
+
return memory.updated_at > stamp || (memory.topics_extracted_version ?? 0) < TOPICS_EXTRACTION_VERSION ? "stale" : null;
|
|
22496
|
+
}
|
|
22380
22497
|
function canonicalTopics(row) {
|
|
22381
22498
|
return new Set((parseTopics(row.topics) ?? []).map((topic) => normalizeEntityName(topic.name)));
|
|
22382
22499
|
}
|
|
@@ -22389,7 +22506,12 @@ function createRemoteMemoryStore(options) {
|
|
|
22389
22506
|
const seen = /* @__PURE__ */ new Map();
|
|
22390
22507
|
let timer;
|
|
22391
22508
|
const notify = (change, records = []) => {
|
|
22392
|
-
if (timer)
|
|
22509
|
+
if (timer)
|
|
22510
|
+
for (const record2 of records) {
|
|
22511
|
+
const previous = seen.get(record2.memory.memory_id);
|
|
22512
|
+
if ((previous?.version ?? 0) + 1 === record2.version)
|
|
22513
|
+
seen.set(record2.memory.memory_id, record2);
|
|
22514
|
+
}
|
|
22393
22515
|
for (const subscriber of [...subscribers])
|
|
22394
22516
|
if (relevant(change, subscriber.options)) safely(subscriber.onChange);
|
|
22395
22517
|
};
|
|
@@ -22450,15 +22572,72 @@ function createRemoteMemoryStore(options) {
|
|
|
22450
22572
|
const record2 = await persistence.get(id);
|
|
22451
22573
|
return record2 && !record2.memory.is_deleted ? record2 : null;
|
|
22452
22574
|
};
|
|
22453
|
-
const
|
|
22575
|
+
const mutateLocked = async (id, change, edit) => {
|
|
22454
22576
|
const record2 = await live(id);
|
|
22455
22577
|
if (!record2) return null;
|
|
22456
22578
|
const next = edit(structuredClone(record2.memory));
|
|
22457
22579
|
if (!next) return null;
|
|
22458
22580
|
const saved = await persistence.put(next, record2);
|
|
22459
|
-
notify(change, [saved]);
|
|
22581
|
+
notify(typeof change === "function" ? change(record2.memory) : change, [saved]);
|
|
22460
22582
|
return saved;
|
|
22461
|
-
}
|
|
22583
|
+
};
|
|
22584
|
+
const mutate = (id, change, edit) => serialized(id, () => mutateLocked(id, change, edit));
|
|
22585
|
+
const serializedAll = (ids, task) => [...new Set(ids)].sort().reduceRight((inner, id) => () => serialized(id, inner), task)();
|
|
22586
|
+
const mutateMany = async (ids, change, edit) => {
|
|
22587
|
+
const saved = /* @__PURE__ */ new Map();
|
|
22588
|
+
const failed = /* @__PURE__ */ new Map();
|
|
22589
|
+
for (const slice of chunks([...new Set(ids)], MAX_BATCH)) {
|
|
22590
|
+
await serializedAll(slice, async () => {
|
|
22591
|
+
const writes = [];
|
|
22592
|
+
let read;
|
|
22593
|
+
try {
|
|
22594
|
+
read = await readEveryState(slice);
|
|
22595
|
+
} catch (error) {
|
|
22596
|
+
for (const id of slice) failed.set(id, error);
|
|
22597
|
+
return;
|
|
22598
|
+
}
|
|
22599
|
+
const { records, unreadable } = read;
|
|
22600
|
+
for (const id of slice) {
|
|
22601
|
+
const record2 = records.get(id);
|
|
22602
|
+
if (unreadable.has(id)) failed.set(id, new Error(`Memory ${id} could not be decrypted`));
|
|
22603
|
+
else if (!record2) failed.set(id, new Error(`Memory ${id} was not found`));
|
|
22604
|
+
else if (!record2.memory.is_deleted) {
|
|
22605
|
+
const memory = edit(structuredClone(record2.memory));
|
|
22606
|
+
if (memory) writes.push({ before: record2, memory });
|
|
22607
|
+
}
|
|
22608
|
+
}
|
|
22609
|
+
if (writes.length === 0) return;
|
|
22610
|
+
try {
|
|
22611
|
+
const written = await persistence.putMany(
|
|
22612
|
+
writes.map(({ before, memory }) => ({ memory, expectedVersion: before }))
|
|
22613
|
+
);
|
|
22614
|
+
const byChange = /* @__PURE__ */ new Map();
|
|
22615
|
+
written.forEach((record2, i) => {
|
|
22616
|
+
saved.set(record2.memory.memory_id, record2);
|
|
22617
|
+
const kind = change(writes[i].before.memory);
|
|
22618
|
+
byChange.set(kind, [...byChange.get(kind) ?? [], record2]);
|
|
22619
|
+
});
|
|
22620
|
+
for (const [kind, changed] of byChange) notify(kind, changed);
|
|
22621
|
+
} catch (error) {
|
|
22622
|
+
const perRow = error instanceof RemoteMemoryError && (error.code === "version_conflict" || error.status === 429);
|
|
22623
|
+
for (const { before } of writes) {
|
|
22624
|
+
const id = before.memory.memory_id;
|
|
22625
|
+
if (!perRow) {
|
|
22626
|
+
failed.set(id, error);
|
|
22627
|
+
continue;
|
|
22628
|
+
}
|
|
22629
|
+
try {
|
|
22630
|
+
const record2 = await mutateLocked(id, change, edit);
|
|
22631
|
+
if (record2) saved.set(id, record2);
|
|
22632
|
+
} catch (rowError) {
|
|
22633
|
+
failed.set(id, rowError);
|
|
22634
|
+
}
|
|
22635
|
+
}
|
|
22636
|
+
}
|
|
22637
|
+
});
|
|
22638
|
+
}
|
|
22639
|
+
return { saved, failed };
|
|
22640
|
+
};
|
|
22462
22641
|
const embedInBackground = ({ memory: { memory_id: id, content } }) => {
|
|
22463
22642
|
generateEmbedding(content, embeddingOptions).then(
|
|
22464
22643
|
(vector) => serialized(id, async () => {
|
|
@@ -22514,11 +22693,10 @@ function createRemoteMemoryStore(options) {
|
|
|
22514
22693
|
return records.map((record2) => stored(record2.memory));
|
|
22515
22694
|
};
|
|
22516
22695
|
const asStored = (record2) => record2 ? stored(record2.memory) : null;
|
|
22517
|
-
const
|
|
22696
|
+
const knownKinds = async (topics) => {
|
|
22518
22697
|
const unkinded = [
|
|
22519
22698
|
...new Set(topics.filter((t) => !t.kind).map((t) => normalizeEntityName(t.name)))
|
|
22520
22699
|
];
|
|
22521
|
-
if (unkinded.length === 0) return topics;
|
|
22522
22700
|
const kinds = /* @__PURE__ */ new Map();
|
|
22523
22701
|
for (const names of chunks(unkinded, MAX_QUERY_TOPICS)) {
|
|
22524
22702
|
for (const { memory } of await pages(metadata, {
|
|
@@ -22533,10 +22711,136 @@ function createRemoteMemoryStore(options) {
|
|
|
22533
22711
|
}
|
|
22534
22712
|
}
|
|
22535
22713
|
}
|
|
22536
|
-
return
|
|
22714
|
+
return (topic) => {
|
|
22537
22715
|
const kind = topic.kind ?? kinds.get(normalizeEntityName(topic.name));
|
|
22538
22716
|
return kind ? { ...topic, kind } : topic;
|
|
22539
|
-
}
|
|
22717
|
+
};
|
|
22718
|
+
};
|
|
22719
|
+
const withKnownKinds = async (topics) => topics.map(await knownKinds(topics));
|
|
22720
|
+
const readEveryState = async (ids) => {
|
|
22721
|
+
const records = /* @__PURE__ */ new Map();
|
|
22722
|
+
const unreadable = /* @__PURE__ */ new Set();
|
|
22723
|
+
for (const memory_ids of chunks(ids, MAX_QUERY_IDS)) {
|
|
22724
|
+
let cursor2;
|
|
22725
|
+
do {
|
|
22726
|
+
const page = await persistence.query({
|
|
22727
|
+
memory_ids,
|
|
22728
|
+
include_deleted: true,
|
|
22729
|
+
include_archived: true,
|
|
22730
|
+
include_quarantined: true,
|
|
22731
|
+
include_superseded: true,
|
|
22732
|
+
limit: 200,
|
|
22733
|
+
...cursor2 && { cursor: cursor2 }
|
|
22734
|
+
});
|
|
22735
|
+
warnFailed(page.failed);
|
|
22736
|
+
for (const record2 of page.items) records.set(record2.memory.memory_id, record2);
|
|
22737
|
+
for (const failure of page.failed) unreadable.add(failure.memory_id);
|
|
22738
|
+
cursor2 = page.next_cursor;
|
|
22739
|
+
} while (cursor2);
|
|
22740
|
+
}
|
|
22741
|
+
return { records, unreadable };
|
|
22742
|
+
};
|
|
22743
|
+
const topicMaintenance = {
|
|
22744
|
+
getTopicBacklog: async (backlogOptions = {}) => {
|
|
22745
|
+
const stale = [];
|
|
22746
|
+
const fresh = [];
|
|
22747
|
+
for (const { memory } of await pages(metadata, { order: "created" })) {
|
|
22748
|
+
if (memory.topics_user_managed) continue;
|
|
22749
|
+
const due = extractionDue(memory);
|
|
22750
|
+
if (due === "stale") stale.push(memory.memory_id);
|
|
22751
|
+
else if (due === "fresh") fresh.push(memory.memory_id);
|
|
22752
|
+
}
|
|
22753
|
+
const limit = backlogOptions.limit !== void 0 && backlogOptions.limit > 0 ? backlogOptions.limit : Infinity;
|
|
22754
|
+
return {
|
|
22755
|
+
pending: [...stale, ...fresh].slice(0, limit).map((uniqueId) => ({ uniqueId })),
|
|
22756
|
+
linkedUnstamped: [],
|
|
22757
|
+
topicsToRelink: [],
|
|
22758
|
+
topicsBackfill: []
|
|
22759
|
+
};
|
|
22760
|
+
},
|
|
22761
|
+
extractTopics: async (memoryIds, extractOptions) => {
|
|
22762
|
+
const extractedAt = extractOptions.now ?? Date.now();
|
|
22763
|
+
const skippedIds = [];
|
|
22764
|
+
const skippedReasons = /* @__PURE__ */ new Map();
|
|
22765
|
+
const skip = (id, reason) => {
|
|
22766
|
+
if (skippedReasons.has(id)) return;
|
|
22767
|
+
skippedIds.push(id);
|
|
22768
|
+
skippedReasons.set(id, reason);
|
|
22769
|
+
};
|
|
22770
|
+
const ids = [...new Set(memoryIds)];
|
|
22771
|
+
const { records, unreadable } = await readEveryState(ids);
|
|
22772
|
+
const inputs = [];
|
|
22773
|
+
for (const id of ids) {
|
|
22774
|
+
const memory = records.get(id)?.memory;
|
|
22775
|
+
if (unreadable.has(id)) skip(id, "unreadable");
|
|
22776
|
+
else if (!memory) skip(id, "not-found");
|
|
22777
|
+
else if (memory.is_deleted || memory.topics_user_managed) skip(id, "excluded");
|
|
22778
|
+
else inputs.push({ id, content: memory.content });
|
|
22779
|
+
}
|
|
22780
|
+
const entitiesByMemory = await extractEntitiesForMemories(inputs, extractOptions);
|
|
22781
|
+
const answered = /* @__PURE__ */ new Map();
|
|
22782
|
+
for (const input of inputs) {
|
|
22783
|
+
const entities = entitiesByMemory.get(input.id);
|
|
22784
|
+
if (entities === void 0) skip(input.id, "llm-unanswered");
|
|
22785
|
+
else
|
|
22786
|
+
answered.set(input.id, { content: input.content, topics: topicInputs(entities, "auto") });
|
|
22787
|
+
}
|
|
22788
|
+
const stampedIds = [];
|
|
22789
|
+
const fail = (id, reason) => {
|
|
22790
|
+
skip(id, reason);
|
|
22791
|
+
entitiesByMemory.delete(id);
|
|
22792
|
+
};
|
|
22793
|
+
try {
|
|
22794
|
+
const kinded = await knownKinds([...answered.values()].flatMap((a) => a.topics));
|
|
22795
|
+
const topics = new Map(
|
|
22796
|
+
[...answered].map(([id, a]) => [id, mergeTopics([], a.topics.map(kinded))])
|
|
22797
|
+
);
|
|
22798
|
+
const unchanged = (memory) => sameTopics(parseTopics(memory.topics), topics.get(memory.memory_id));
|
|
22799
|
+
const { saved, failed } = await mutateMany(
|
|
22800
|
+
[...answered.keys()],
|
|
22801
|
+
(before) => sameTopics(parseTopics(before.topics) ?? [], topics.get(before.memory_id)) ? "metadata" : "edit",
|
|
22802
|
+
(memory) => {
|
|
22803
|
+
if (memory.topics_user_managed || memory.content !== answered.get(memory.memory_id).content)
|
|
22804
|
+
return null;
|
|
22805
|
+
return {
|
|
22806
|
+
...memory,
|
|
22807
|
+
...!unchanged(memory) && {
|
|
22808
|
+
topics: serializeTopics(topics.get(memory.memory_id)),
|
|
22809
|
+
topics_updated_at: Date.now()
|
|
22810
|
+
},
|
|
22811
|
+
topics_extracted_at: Math.max(extractedAt, memory.updated_at),
|
|
22812
|
+
topics_extracted_version: TOPICS_EXTRACTION_VERSION
|
|
22813
|
+
};
|
|
22814
|
+
}
|
|
22815
|
+
);
|
|
22816
|
+
for (const id of answered.keys()) {
|
|
22817
|
+
if (saved.has(id)) stampedIds.push(id);
|
|
22818
|
+
else fail(id, failed.has(id) ? "link-failed" : "link-declined");
|
|
22819
|
+
}
|
|
22820
|
+
if (failed.size)
|
|
22821
|
+
getLogger().warn(
|
|
22822
|
+
"[memory/remote-store] Failed to write extracted topics:",
|
|
22823
|
+
failed.values().next().value
|
|
22824
|
+
);
|
|
22825
|
+
} catch (error) {
|
|
22826
|
+
getLogger().warn("[memory/remote-store] Failed to write extracted topics:", error);
|
|
22827
|
+
for (const id of answered.keys()) fail(id, "link-failed");
|
|
22828
|
+
}
|
|
22829
|
+
return { entitiesByMemory, stampedIds, skippedIds, skippedReasons };
|
|
22830
|
+
},
|
|
22831
|
+
stampTopicsExtracted: async (memoryIds, extractedAt, version = TOPICS_EXTRACTION_VERSION) => {
|
|
22832
|
+
const ids = [...new Set(memoryIds)];
|
|
22833
|
+
const { saved, failed } = await mutateMany(
|
|
22834
|
+
ids,
|
|
22835
|
+
() => "metadata",
|
|
22836
|
+
(memory) => memory.topics_user_managed ? null : { ...memory, topics_extracted_at: extractedAt, topics_extracted_version: version }
|
|
22837
|
+
);
|
|
22838
|
+
if (failed.size)
|
|
22839
|
+
getLogger().warn("[memory/remote-store] Failed to stamp topics:", [...failed.values()]);
|
|
22840
|
+
return ids.filter((id) => saved.has(id));
|
|
22841
|
+
},
|
|
22842
|
+
relinkTopics: () => Promise.resolve([]),
|
|
22843
|
+
backfillTopics: () => Promise.resolve([])
|
|
22540
22844
|
};
|
|
22541
22845
|
const everyState = {
|
|
22542
22846
|
include_deleted: true,
|
|
@@ -22615,6 +22919,7 @@ function createRemoteMemoryStore(options) {
|
|
|
22615
22919
|
};
|
|
22616
22920
|
return {
|
|
22617
22921
|
masksEmbeddingInput: embeddingOptions.maskInput !== void 0,
|
|
22922
|
+
topicMaintenance,
|
|
22618
22923
|
list: async (listOptions = {}) => (await listRows(decrypted, listOptions, listFilters(listOptions), maxOf(listOptions))).map(
|
|
22619
22924
|
(r) => stored(r.memory)
|
|
22620
22925
|
),
|
|
@@ -22699,7 +23004,7 @@ function createRemoteMemoryStore(options) {
|
|
|
22699
23004
|
const kind = patch.kind !== void 0 ? patch.kind : memory.kind;
|
|
22700
23005
|
assertValidKindLevel(kind, level);
|
|
22701
23006
|
memory.content = patch.content;
|
|
22702
|
-
memory.updated_at = Date.now();
|
|
23007
|
+
memory.updated_at = Math.max(Date.now(), (memory.topics_extracted_at ?? 0) + 1);
|
|
22703
23008
|
if (patch.level !== void 0) {
|
|
22704
23009
|
memory.level = level;
|
|
22705
23010
|
memory.scope = scopeForLevel(level);
|