@anuma/sdk 3.3.1 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/expo/{chunk-EIHIZ5L4.mjs → chunk-7TATXBC5.mjs} +123 -16
- package/dist/expo/index.cjs +158 -22
- package/dist/expo/index.d.mts +70 -1
- package/dist/expo/index.d.ts +70 -1
- package/dist/expo/index.mjs +27 -3
- package/dist/expo/{recall-C3LJ5R2E.mjs → recall-IO4KJ5W7.mjs} +1 -1
- package/dist/react/{chunk-PWTWECXY.mjs → chunk-DDHTJGZN.mjs} +123 -16
- package/dist/react/index.cjs +158 -22
- package/dist/react/index.d.mts +70 -1
- package/dist/react/index.d.ts +70 -1
- package/dist/react/index.mjs +27 -3
- package/dist/react/{recall-FZVV5XUU.mjs → recall-OPKHWKZX.mjs} +1 -1
- package/dist/server/{chunk-J5QZOPUI.mjs → chunk-V7SVKIXQ.mjs} +123 -16
- package/dist/server/index.cjs +158 -22
- package/dist/server/index.d.mts +70 -1
- package/dist/server/index.d.ts +70 -1
- package/dist/server/index.mjs +27 -3
- package/dist/server/{recall-NNBMWRLB.mjs → recall-IWY2MYHR.mjs} +1 -1
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
|
@@ -6193,6 +6193,10 @@ interface VaultSearchResult {
|
|
|
6193
6193
|
* real timestamps. Omitted when an item lacks the field upstream. */
|
|
6194
6194
|
createdAt?: Date;
|
|
6195
6195
|
updatedAt?: Date;
|
|
6196
|
+
/** Times this fact has been re-observed — for C2 trend labels. */
|
|
6197
|
+
proofCount?: number | null;
|
|
6198
|
+
/** C3 re-observation watermark (Unix ms) — for C2 trends + C4 CE dates. */
|
|
6199
|
+
lastObservedAt?: number | null;
|
|
6196
6200
|
/** W6 temporal-lane anchors carried through to downstream `RankedMemory`
|
|
6197
6201
|
* so the recall executor can surface dates to the answer model without
|
|
6198
6202
|
* a second per-fact DB lookup + decrypt. Unix ms; null when the fact
|
|
@@ -6234,6 +6238,55 @@ declare function searchVaultMemories(query: string, vaultCtx: VaultMemoryOperati
|
|
|
6234
6238
|
*/
|
|
6235
6239
|
declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
|
|
6236
6240
|
|
|
6241
|
+
/**
|
|
6242
|
+
* C2 — Observation trend labels.
|
|
6243
|
+
*
|
|
6244
|
+
* Algorithmic (no LLM) classification of how a vault fact's evidence has
|
|
6245
|
+
* been evolving, derived from the C3 re-observation watermark
|
|
6246
|
+
* (`lastObservedAt`), `proofCount`, and `createdAt` over 30/90-day windows.
|
|
6247
|
+
*
|
|
6248
|
+
* We do not store a full observation-timestamp series — only first-seen,
|
|
6249
|
+
* last-seen, and count — so density is approximated from that triple.
|
|
6250
|
+
* Good enough for profile signals ("interests trending up") and vault
|
|
6251
|
+
* hygiene badges; not a substitute for an observations tier (C5).
|
|
6252
|
+
*/
|
|
6253
|
+
/** Recent window — observations inside this count as "active". */
|
|
6254
|
+
declare const TREND_RECENT_WINDOW_DAYS = 30;
|
|
6255
|
+
/** Beyond this since last observation → stale. */
|
|
6256
|
+
declare const TREND_STALE_WINDOW_DAYS = 90;
|
|
6257
|
+
/**
|
|
6258
|
+
* How a fact's evidence has been evolving.
|
|
6259
|
+
*
|
|
6260
|
+
* - `new` — first seen inside the recent window, few proofs yet.
|
|
6261
|
+
* - `strengthening` — established fact re-observed recently (rising density).
|
|
6262
|
+
* - `stable` — known for a while, still observed inside the stale window.
|
|
6263
|
+
* - `weakening` — quiet for ≥30 and <90 days after having been observed.
|
|
6264
|
+
* - `stale` — no observation in ≥90 days.
|
|
6265
|
+
*/
|
|
6266
|
+
type ObservationTrend = "new" | "strengthening" | "stable" | "weakening" | "stale";
|
|
6267
|
+
interface ObservationTrendInput {
|
|
6268
|
+
createdAt: Date | number;
|
|
6269
|
+
/**
|
|
6270
|
+
* C3 re-observation watermark (Unix ms). When null/undefined, the fact
|
|
6271
|
+
* has never been merged-into since the column landed — treat `createdAt`
|
|
6272
|
+
* as last-seen.
|
|
6273
|
+
*/
|
|
6274
|
+
lastObservedAt?: number | null;
|
|
6275
|
+
/** Times this fact has been retained/merged. Defaults to 1. */
|
|
6276
|
+
proofCount?: number | null;
|
|
6277
|
+
}
|
|
6278
|
+
/**
|
|
6279
|
+
* Classify a vault fact's observation trend from its evidence timestamps.
|
|
6280
|
+
*
|
|
6281
|
+
* Pure + deterministic. Pass `now` for back-dated eval harnesses.
|
|
6282
|
+
*/
|
|
6283
|
+
declare function classifyObservationTrend(input: ObservationTrendInput, now?: number): ObservationTrend;
|
|
6284
|
+
/**
|
|
6285
|
+
* Summarize trend counts over a set of facts — handy for profile synthesis
|
|
6286
|
+
* ("N interests strengthening") without another LLM pass.
|
|
6287
|
+
*/
|
|
6288
|
+
declare function summarizeObservationTrends(inputs: readonly ObservationTrendInput[], now?: number): Record<ObservationTrend, number>;
|
|
6289
|
+
|
|
6237
6290
|
/**
|
|
6238
6291
|
* Unified memory layer types — the Recall / Retain API.
|
|
6239
6292
|
*
|
|
@@ -6283,6 +6336,16 @@ interface RankedMemory {
|
|
|
6283
6336
|
proofCount?: number;
|
|
6284
6337
|
source?: string;
|
|
6285
6338
|
folderId?: string | null;
|
|
6339
|
+
/**
|
|
6340
|
+
* C3 re-observation watermark (Unix ms). Null/undefined when the fact
|
|
6341
|
+
* has never been merge-reinforced since the column landed.
|
|
6342
|
+
*/
|
|
6343
|
+
lastObservedAt?: number | null;
|
|
6344
|
+
/**
|
|
6345
|
+
* C2 observation-trend label derived from createdAt / lastObservedAt /
|
|
6346
|
+
* proofCount over 30/90-day windows. Fact-only; omitted for chunks.
|
|
6347
|
+
*/
|
|
6348
|
+
observationTrend?: ObservationTrend;
|
|
6286
6349
|
/**
|
|
6287
6350
|
* Anchored event-time for the fact (the date the underlying event
|
|
6288
6351
|
* occurred, not the write time). When present, the recall executor
|
|
@@ -8379,6 +8442,12 @@ interface ProfileDoc {
|
|
|
8379
8442
|
vaultWatermark: number;
|
|
8380
8443
|
/** The config that produced this doc — see {@link ProfileConfigFingerprint}. */
|
|
8381
8444
|
config: ProfileConfigFingerprint;
|
|
8445
|
+
/**
|
|
8446
|
+
* C2 — counts of observation-trend labels over live vault facts at
|
|
8447
|
+
* synthesis time. Lets People Nearby surface "interests trending up"
|
|
8448
|
+
* without another LLM pass. Recomputed every synthesis (not delta-cached).
|
|
8449
|
+
*/
|
|
8450
|
+
observationTrends: Record<ObservationTrend, number>;
|
|
8382
8451
|
/** Unix ms this doc was produced. */
|
|
8383
8452
|
generatedAt: number;
|
|
8384
8453
|
}
|
|
@@ -13866,4 +13935,4 @@ declare function renderAnumaTree(node: AnumaNode): React.ReactElement | null;
|
|
|
13866
13935
|
*/
|
|
13867
13936
|
declare function renderAnumaJsx(jsx: string): React.ReactElement | null;
|
|
13868
13937
|
|
|
13869
|
-
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, 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 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_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, ENTITY_FANOUT, ENTITY_KINDS, type EmbeddedWalletSignerFn, type EntityInput, type EntityKind, Entity as EntityModel, type EntityOperationsContext, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, FILE_PLACEHOLDER_PREFIX, FILE_PLACEHOLDER_REGEX, type FactType, type FileMetadata, 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, type IconProps, type ImageProps, type InjectionClassifierOptions, type InjectionReason, type InteractionType, type KnownTag, type LazyStoredConversation, type LineProps, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, MemoryEntity as MemoryEntityModel, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageChunk, type MessageFeedback, type MessageSkeleton, type ModelLoadProgress, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OCRFile, 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 PlatformStorage, type PortalLlmAuth, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSection, type ProfileUpdate, type ProgressCallback, Project, type ProjectOperationsContext, type PromptPreProcessor, type PromptPreProcessorContext, type ProviderAuthState, type ProviderBackupState, ProviderStreamError, type QuantizedEmbedding, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, R2_DEFAULT_TTL_MS, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RectProps, type ReflectOptions, type ReflectResult, RerankerUnavailableError, 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 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 StoredUserPreference, UserPreference as StoredUserPreferenceModel, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, THEME_ATTRS, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, type TextChunk, TextProcessor, type TextProps, type ThemeAttr, type ToolCallArgumentsDeltaEvent, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TranscriptionResult, type TurnCompleteEvent, type TurnSkippedEvent, type UIInteractionContextValue, UIInteractionProvider, type UIInteractionProviderProps, 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 VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, type VoiceRecording, WalletPoller, WatermelonChatStorageAdapter, type WatermelonChatStorageAdapterOptions, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WhisperModel, WordProcessor, ZipProcessor, type ZipProcessorOptions, addConversationMemoriesOp, appFileToStored, archiveVaultMemoryOp, backfillMemoryEntityUserIdsOp, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearCalendarToken, clearConversationMemoriesOp, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGithubToken, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, clearLazyTitleCache, clearMemoryTopicsOverrideOp, clearNotionToken, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createGitHubTools, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createPlatformCursorStore, createProjectOp, createRecallTool, createSavedToolOp, createServerToolsFilter, createStockPricePreProcessor, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllAppFilesOp, deleteAllVaultMemoriesForUserOp, deleteAppFileOp, deleteEncryptedFile, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteProjectOp, deleteSavedToolOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, expandToolSetsAdditive, exportElementToPdf, exportMarkdownToPdf, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractFileIds, fileExists, findById, findMatchingTools, findParentOfId, 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, getVaultFolderMemoryCountOp, getVaultMemoryOp, getVideosOp, handleCalendarCallback, handleDriveCallback, handleGithubCallback, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGithubCredentials, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, hasNotionCredentials, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isCalendarCallback, isDriveCallback, isGithubCallback, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, mediaToStored, migrateCalendarToken, migrateDisplayResult, migrateDriveToken, migrateGithubToken, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, preEmbedVaultMemories, preprocessFiles, previewToolSelection, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, readEncryptedFile, recall, reflect, refreshCalendarToken, refreshDriveToken, refreshGithubToken, refreshNotionToken, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeCalendarToken, revokeDriveToken, revokeGithubToken, revokeNotionAccess, savedToolToStored, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, settingsStorageSchema, shouldChunkMessage, shouldRefreshTools, stampTopicsExtractedAtOp, startGithubAuth, startNotionAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, storeGithubPendingMessage, storeGithubReturnUrl, storeGithubToken, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, 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, walk, webPlatformStorage, writeEncryptedFile };
|
|
13938
|
+
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, 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 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_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, ENTITY_FANOUT, ENTITY_KINDS, type EmbeddedWalletSignerFn, type EntityInput, type EntityKind, Entity as EntityModel, type EntityOperationsContext, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, FILE_PLACEHOLDER_PREFIX, FILE_PLACEHOLDER_REGEX, type FactType, type FileMetadata, 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, type IconProps, type ImageProps, type InjectionClassifierOptions, type InjectionReason, type InteractionType, type KnownTag, type LazyStoredConversation, type LineProps, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, MemoryEntity as MemoryEntityModel, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageChunk, type MessageFeedback, 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 PlatformStorage, type PortalLlmAuth, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSection, type ProfileUpdate, type ProgressCallback, Project, type ProjectOperationsContext, type PromptPreProcessor, type PromptPreProcessorContext, type ProviderAuthState, type ProviderBackupState, ProviderStreamError, type QuantizedEmbedding, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, R2_DEFAULT_TTL_MS, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RectProps, type ReflectOptions, type ReflectResult, RerankerUnavailableError, 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 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 StoredUserPreference, UserPreference as StoredUserPreferenceModel, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, THEME_ATTRS, 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 TranscriptionResult, type TurnCompleteEvent, type TurnSkippedEvent, type UIInteractionContextValue, UIInteractionProvider, type UIInteractionProviderProps, 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 VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, type VoiceRecording, WalletPoller, WatermelonChatStorageAdapter, type WatermelonChatStorageAdapterOptions, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WhisperModel, WordProcessor, ZipProcessor, type ZipProcessorOptions, addConversationMemoriesOp, appFileToStored, archiveVaultMemoryOp, backfillMemoryEntityUserIdsOp, 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, clearNotionToken, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createGitHubTools, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createPlatformCursorStore, createProjectOp, createRecallTool, createSavedToolOp, createServerToolsFilter, createStockPricePreProcessor, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllAppFilesOp, deleteAllVaultMemoriesForUserOp, deleteAppFileOp, deleteEncryptedFile, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteProjectOp, deleteSavedToolOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, expandToolSetsAdditive, exportElementToPdf, exportMarkdownToPdf, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractFileIds, fileExists, findById, findMatchingTools, findParentOfId, 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, getVaultFolderMemoryCountOp, getVaultMemoryOp, getVideosOp, handleCalendarCallback, handleDriveCallback, handleGithubCallback, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGithubCredentials, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, hasNotionCredentials, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isCalendarCallback, isDriveCallback, isGithubCallback, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, mediaToStored, migrateCalendarToken, migrateDisplayResult, migrateDriveToken, migrateGithubToken, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, preEmbedVaultMemories, preprocessFiles, previewToolSelection, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, readEncryptedFile, recall, reflect, refreshCalendarToken, refreshDriveToken, refreshGithubToken, refreshNotionToken, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeCalendarToken, revokeDriveToken, revokeGithubToken, revokeNotionAccess, savedToolToStored, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, settingsStorageSchema, shouldChunkMessage, shouldRefreshTools, stampTopicsExtractedAtOp, startGithubAuth, startNotionAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, storeGithubPendingMessage, storeGithubReturnUrl, storeGithubToken, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, 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, walk, webPlatformStorage, writeEncryptedFile };
|
package/dist/react/index.mjs
CHANGED
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
NODE_BUDGET,
|
|
13
13
|
RerankerUnavailableError,
|
|
14
14
|
TOPICS_EXTRACTION_VERSION,
|
|
15
|
+
TREND_RECENT_WINDOW_DAYS,
|
|
16
|
+
TREND_STALE_WINDOW_DAYS,
|
|
15
17
|
VAULT_SIZE_HOP_CAP,
|
|
16
18
|
archiveVaultMemoryOp,
|
|
17
19
|
assertVaultScopeForSweep,
|
|
@@ -20,6 +22,7 @@ import {
|
|
|
20
22
|
chunkAndEmbedAllMessages,
|
|
21
23
|
chunkAndEmbedMessage,
|
|
22
24
|
chunkText,
|
|
25
|
+
classifyObservationTrend,
|
|
23
26
|
clearAllEncryptionKeys,
|
|
24
27
|
clearAllEncryptionState,
|
|
25
28
|
clearAllKeyPairs,
|
|
@@ -111,6 +114,7 @@ import {
|
|
|
111
114
|
shouldChunkMessage,
|
|
112
115
|
stampTopicsExtractedAtOp,
|
|
113
116
|
stripToolCalls,
|
|
117
|
+
summarizeObservationTrends,
|
|
114
118
|
supersedeVaultMemoryOp,
|
|
115
119
|
traverseGraphLane,
|
|
116
120
|
updateConversationPinnedOp,
|
|
@@ -125,7 +129,7 @@ import {
|
|
|
125
129
|
updateVaultMemoryOp,
|
|
126
130
|
useEncryption,
|
|
127
131
|
vaultMemoryToStored
|
|
128
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-DDHTJGZN.mjs";
|
|
129
133
|
import {
|
|
130
134
|
PiiRedactor,
|
|
131
135
|
createStreamingDeAnonymizer,
|
|
@@ -8734,6 +8738,13 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
8734
8738
|
includeSuperseded: true
|
|
8735
8739
|
});
|
|
8736
8740
|
const watermark = computeVaultWatermark(memories);
|
|
8741
|
+
const observationTrends = summarizeObservationTrends(
|
|
8742
|
+
memories.filter((m) => !m.isDeleted && m.supersededBy === null).map((m) => ({
|
|
8743
|
+
createdAt: m.createdAt,
|
|
8744
|
+
lastObservedAt: m.lastObservedAt,
|
|
8745
|
+
proofCount: m.proofCount
|
|
8746
|
+
}))
|
|
8747
|
+
);
|
|
8737
8748
|
const presentIds = new Set(memories.map((m) => m.uniqueId));
|
|
8738
8749
|
const hasStaleSections = previous?.sections.some((s) => s.stale);
|
|
8739
8750
|
const citesMissingFact = previous?.sections.some(
|
|
@@ -8741,10 +8752,14 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
8741
8752
|
);
|
|
8742
8753
|
if (previous && previous.vaultWatermark === watermark && !hasStaleSections && !citesMissingFact) {
|
|
8743
8754
|
const sameOrder = previous.sections.length === facets.length && facets.every((f, i) => previous.sections[i]?.key === f.key);
|
|
8744
|
-
if (sameOrder)
|
|
8755
|
+
if (sameOrder) {
|
|
8756
|
+
if (trendsEqual(previous.observationTrends, observationTrends)) return previous;
|
|
8757
|
+
return { ...previous, observationTrends };
|
|
8758
|
+
}
|
|
8745
8759
|
return {
|
|
8746
8760
|
...previous,
|
|
8747
|
-
sections: facets.map((f) => previous.sections.find((s) => s.key === f.key))
|
|
8761
|
+
sections: facets.map((f) => previous.sections.find((s) => s.key === f.key)),
|
|
8762
|
+
observationTrends
|
|
8748
8763
|
};
|
|
8749
8764
|
}
|
|
8750
8765
|
const staleKeys = await computeStaleFacetKeys(ctx, memories, facets, previous, watermark);
|
|
@@ -8777,6 +8792,7 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
8777
8792
|
sections,
|
|
8778
8793
|
vaultWatermark: watermark,
|
|
8779
8794
|
config,
|
|
8795
|
+
observationTrends,
|
|
8780
8796
|
generatedAt: Date.now()
|
|
8781
8797
|
};
|
|
8782
8798
|
}
|
|
@@ -8787,6 +8803,10 @@ function configMatches(a, b) {
|
|
|
8787
8803
|
function facetsSignature(facets) {
|
|
8788
8804
|
return facets.map((f) => JSON.stringify([f.key, f.label, f.query, f.guidance])).sort().join("\n");
|
|
8789
8805
|
}
|
|
8806
|
+
function trendsEqual(a, b) {
|
|
8807
|
+
if (!a) return false;
|
|
8808
|
+
return a.new === b.new && a.strengthening === b.strengthening && a.stable === b.stable && a.weakening === b.weakening && a.stale === b.stale;
|
|
8809
|
+
}
|
|
8790
8810
|
function changeTime(m) {
|
|
8791
8811
|
return Math.max(m.updatedAt.getTime(), m.supersededAt ?? 0, m.lastObservedAt ?? 0);
|
|
8792
8812
|
}
|
|
@@ -24794,6 +24814,8 @@ export {
|
|
|
24794
24814
|
THEME_ATTRS,
|
|
24795
24815
|
TOPICS_EXTRACTION_VERSION,
|
|
24796
24816
|
TOPIC_EXTRACTION_BATCH_SIZE,
|
|
24817
|
+
TREND_RECENT_WINDOW_DAYS,
|
|
24818
|
+
TREND_STALE_WINDOW_DAYS,
|
|
24797
24819
|
TextProcessor,
|
|
24798
24820
|
UIInteractionProvider,
|
|
24799
24821
|
VAULT_SIZE_HOP_CAP,
|
|
@@ -24815,6 +24837,7 @@ export {
|
|
|
24815
24837
|
classifyCryptoPriceBatch,
|
|
24816
24838
|
classifyDecay,
|
|
24817
24839
|
classifyInjectionCandidates,
|
|
24840
|
+
classifyObservationTrend,
|
|
24818
24841
|
classifyStockPrice,
|
|
24819
24842
|
classifyStockPriceBatch,
|
|
24820
24843
|
classifyWeather,
|
|
@@ -25084,6 +25107,7 @@ export {
|
|
|
25084
25107
|
storeNotionReturnUrl,
|
|
25085
25108
|
streamCancelPath,
|
|
25086
25109
|
streamReplayPath,
|
|
25110
|
+
summarizeObservationTrends,
|
|
25087
25111
|
supersedeVaultMemoryOp,
|
|
25088
25112
|
synthesizeProfile,
|
|
25089
25113
|
traverseGraphLane,
|
|
@@ -17559,11 +17559,20 @@ async function getModel() {
|
|
|
17559
17559
|
function sigmoid(x) {
|
|
17560
17560
|
return 1 / (1 + Math.exp(-x));
|
|
17561
17561
|
}
|
|
17562
|
+
function formatRerankDoc(content, dateMs) {
|
|
17563
|
+
if (dateMs === null || dateMs === void 0 || !Number.isFinite(dateMs)) return content;
|
|
17564
|
+
const d = new Date(dateMs);
|
|
17565
|
+
if (!Number.isFinite(d.getTime())) return content;
|
|
17566
|
+
const yyyy = d.getFullYear();
|
|
17567
|
+
const mm = String(d.getMonth() + 1).padStart(2, "0");
|
|
17568
|
+
const dd = String(d.getDate()).padStart(2, "0");
|
|
17569
|
+
return `[Date: ${yyyy}-${mm}-${dd}] ${content}`;
|
|
17570
|
+
}
|
|
17562
17571
|
async function rerankPairs(query, items) {
|
|
17563
17572
|
if (items.length === 0 || !query) return [];
|
|
17564
17573
|
const { tokenizer, model } = await getModel();
|
|
17565
17574
|
const queries = items.map(() => query);
|
|
17566
|
-
const docs = items.map((i) => i.content);
|
|
17575
|
+
const docs = items.map((i) => formatRerankDoc(i.content, i.dateMs));
|
|
17567
17576
|
const tokenize2 = tokenizer;
|
|
17568
17577
|
const inputs = tokenize2(queries, { text_pair: docs, padding: true, truncation: true });
|
|
17569
17578
|
const forward = model;
|
|
@@ -17912,6 +17921,23 @@ function createVaultEmbeddingCache(maxSize = DEFAULT_VAULT_CACHE_SIZE) {
|
|
|
17912
17921
|
function normalizeEventTimeKind(kind) {
|
|
17913
17922
|
return kind === "point" || kind === "range" || kind === "ongoing" ? kind : null;
|
|
17914
17923
|
}
|
|
17924
|
+
function rerankDateMs(item) {
|
|
17925
|
+
if (item.eventTimeStart !== null && item.eventTimeStart !== void 0 && Number.isFinite(item.eventTimeStart) && item.eventTimeStart > 0) {
|
|
17926
|
+
return item.eventTimeStart;
|
|
17927
|
+
}
|
|
17928
|
+
if (item.lastObservedAt !== null && item.lastObservedAt !== void 0 && Number.isFinite(item.lastObservedAt) && item.lastObservedAt > 0) {
|
|
17929
|
+
return item.lastObservedAt;
|
|
17930
|
+
}
|
|
17931
|
+
const updatedMs = item.updatedAt?.getTime();
|
|
17932
|
+
if (updatedMs !== null && updatedMs !== void 0 && Number.isFinite(updatedMs) && updatedMs > 0) {
|
|
17933
|
+
return updatedMs;
|
|
17934
|
+
}
|
|
17935
|
+
const createdMs = item.createdAt?.getTime();
|
|
17936
|
+
if (createdMs !== null && createdMs !== void 0 && Number.isFinite(createdMs) && createdMs > 0) {
|
|
17937
|
+
return createdMs;
|
|
17938
|
+
}
|
|
17939
|
+
return void 0;
|
|
17940
|
+
}
|
|
17915
17941
|
var SUPERSESSION_SIMILARITY_THRESHOLD = 0.7;
|
|
17916
17942
|
var SUPERSESSION_MIN_AGE_GAP_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
17917
17943
|
var SUPERSESSION_BOOST_FACTOR = 0.8;
|
|
@@ -18118,6 +18144,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
|
|
|
18118
18144
|
}
|
|
18119
18145
|
let combined;
|
|
18120
18146
|
let tailSlice = [];
|
|
18147
|
+
const itemById = new Map(items.map((i) => [i.id, i]));
|
|
18121
18148
|
if (options?.rerank) {
|
|
18122
18149
|
const rerankTopN = options.rerankTopN ?? 30;
|
|
18123
18150
|
const ceWeight = options.ceWeight ?? 0.1;
|
|
@@ -18125,7 +18152,12 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
|
|
|
18125
18152
|
try {
|
|
18126
18153
|
const reranked = await rerankPairs(
|
|
18127
18154
|
query,
|
|
18128
|
-
headSlice.map((r) => ({
|
|
18155
|
+
headSlice.map((r) => ({
|
|
18156
|
+
id: r.uniqueId,
|
|
18157
|
+
content: r.content,
|
|
18158
|
+
// C4: date-prefix the CE doc so temporal alignment influences rank.
|
|
18159
|
+
dateMs: rerankDateMs(itemById.get(r.uniqueId) ?? r)
|
|
18160
|
+
}))
|
|
18129
18161
|
);
|
|
18130
18162
|
tailSlice = v2Ranked.slice(rerankTopN);
|
|
18131
18163
|
const v2ScoreById = new Map(headSlice.map((r) => [r.uniqueId, r.similarity]));
|
|
@@ -18160,11 +18192,11 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
|
|
|
18160
18192
|
const fused = rrfFuse([headIds, headIds, ...sideLanesAsync], options?.rrfK);
|
|
18161
18193
|
const fusedHead = combined.map((r) => ({ ...r, similarity: fused.get(r.uniqueId) ?? r.similarity })).sort((a, b) => b.similarity - a.similarity);
|
|
18162
18194
|
const seen = new Set(combined.map((r) => r.uniqueId));
|
|
18163
|
-
const
|
|
18195
|
+
const itemById2 = new Map(items.map((i) => [i.id, i]));
|
|
18164
18196
|
for (const lane of sideLanesAsync) {
|
|
18165
18197
|
for (const id of lane) {
|
|
18166
18198
|
if (seen.has(id)) continue;
|
|
18167
|
-
const it =
|
|
18199
|
+
const it = itemById2.get(id);
|
|
18168
18200
|
if (!it) continue;
|
|
18169
18201
|
fusedHead.push({
|
|
18170
18202
|
uniqueId: id,
|
|
@@ -18183,11 +18215,11 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
|
|
|
18183
18215
|
if (options?.mmr) {
|
|
18184
18216
|
const lambda = options.mmrLambda ?? 0.7;
|
|
18185
18217
|
const mmrTopN = options.mmrTopN ?? 20;
|
|
18186
|
-
const
|
|
18218
|
+
const itemById2 = new Map(items.map((i) => [i.id, i]));
|
|
18187
18219
|
const mmrCandidates = combined.slice(0, mmrTopN).map((r) => ({
|
|
18188
18220
|
id: r.uniqueId,
|
|
18189
18221
|
score: r.similarity,
|
|
18190
|
-
embedding:
|
|
18222
|
+
embedding: itemById2.get(r.uniqueId)?.embedding ?? [],
|
|
18191
18223
|
content: r.content
|
|
18192
18224
|
}));
|
|
18193
18225
|
const picked = applyMMR(mmrCandidates, limit, lambda);
|
|
@@ -18309,7 +18341,12 @@ async function rankComposite(originalQuery, originalQueryEmbedding, subQueries,
|
|
|
18309
18341
|
try {
|
|
18310
18342
|
const reranked = await rerankPairs(
|
|
18311
18343
|
originalQuery,
|
|
18312
|
-
headSlice.map((r) => ({
|
|
18344
|
+
headSlice.map((r) => ({
|
|
18345
|
+
id: r.uniqueId,
|
|
18346
|
+
content: r.content,
|
|
18347
|
+
// C4: date-prefix the CE doc so temporal alignment influences rank.
|
|
18348
|
+
dateMs: rerankDateMs(itemById.get(r.uniqueId) ?? r)
|
|
18349
|
+
}))
|
|
18313
18350
|
);
|
|
18314
18351
|
const ceById = new Map(reranked.map((r) => [r.id, r.score]));
|
|
18315
18352
|
const head = headSlice.map((r) => ({
|
|
@@ -18496,6 +18533,7 @@ async function searchVaultMemoriesWithSize(query, vaultCtx, embeddingOptions, ca
|
|
|
18496
18533
|
createdAt: m.createdAt,
|
|
18497
18534
|
updatedAt: m.updatedAt,
|
|
18498
18535
|
proofCount: m.proofCount,
|
|
18536
|
+
lastObservedAt: m.lastObservedAt,
|
|
18499
18537
|
eventTimeStart: m.eventTimeStart,
|
|
18500
18538
|
sourceChunkIds: m.sourceChunkIds,
|
|
18501
18539
|
eventTimeEnd: m.eventTimeEnd,
|
|
@@ -18512,13 +18550,27 @@ async function searchVaultMemoriesWithSize(query, vaultCtx, embeddingOptions, ca
|
|
|
18512
18550
|
);
|
|
18513
18551
|
}
|
|
18514
18552
|
}
|
|
18515
|
-
const
|
|
18516
|
-
memories.map((m) => [
|
|
18553
|
+
const metaById = new Map(
|
|
18554
|
+
memories.map((m) => [
|
|
18555
|
+
m.uniqueId,
|
|
18556
|
+
{
|
|
18557
|
+
createdAt: m.createdAt,
|
|
18558
|
+
updatedAt: m.updatedAt,
|
|
18559
|
+
proofCount: m.proofCount,
|
|
18560
|
+
lastObservedAt: m.lastObservedAt
|
|
18561
|
+
}
|
|
18562
|
+
])
|
|
18517
18563
|
);
|
|
18518
18564
|
const stampTimestamps = (out) => {
|
|
18519
18565
|
const results2 = out.results.map((r) => {
|
|
18520
|
-
const
|
|
18521
|
-
return
|
|
18566
|
+
const meta = metaById.get(r.uniqueId);
|
|
18567
|
+
return meta ? {
|
|
18568
|
+
...r,
|
|
18569
|
+
createdAt: meta.createdAt,
|
|
18570
|
+
updatedAt: meta.updatedAt,
|
|
18571
|
+
proofCount: meta.proofCount,
|
|
18572
|
+
lastObservedAt: meta.lastObservedAt
|
|
18573
|
+
} : r;
|
|
18522
18574
|
});
|
|
18523
18575
|
return {
|
|
18524
18576
|
results: results2,
|
|
@@ -18712,7 +18764,7 @@ function createMemoryVaultSearchTool(vaultCtx, embeddingOptions, cache, searchOp
|
|
|
18712
18764
|
legacy.map((r) => ({ id: r.uniqueId, content: r.content, score: r.similarity }))
|
|
18713
18765
|
);
|
|
18714
18766
|
}
|
|
18715
|
-
const { recall: recall2 } = await import("./recall-
|
|
18767
|
+
const { recall: recall2 } = await import("./recall-IWY2MYHR.mjs");
|
|
18716
18768
|
const result = await recall2(
|
|
18717
18769
|
query,
|
|
18718
18770
|
{ vaultCtx, embeddingOptions, vaultCache: cache },
|
|
@@ -18976,6 +19028,42 @@ Which should be expanded?`,
|
|
|
18976
19028
|
};
|
|
18977
19029
|
}
|
|
18978
19030
|
|
|
19031
|
+
// src/lib/memory/observationTrend.ts
|
|
19032
|
+
var DAY_MS2 = 1e3 * 60 * 60 * 24;
|
|
19033
|
+
var TREND_RECENT_WINDOW_DAYS = 30;
|
|
19034
|
+
var TREND_STALE_WINDOW_DAYS = 90;
|
|
19035
|
+
function toMs(value) {
|
|
19036
|
+
return value instanceof Date ? value.getTime() : value;
|
|
19037
|
+
}
|
|
19038
|
+
function classifyObservationTrend(input, now = Date.now()) {
|
|
19039
|
+
const createdMs = toMs(input.createdAt);
|
|
19040
|
+
if (!Number.isFinite(createdMs) || !Number.isFinite(now)) return "stable";
|
|
19041
|
+
const lastMsRaw = input.lastObservedAt;
|
|
19042
|
+
const lastMs = lastMsRaw !== null && lastMsRaw !== void 0 && Number.isFinite(lastMsRaw) ? Math.max(createdMs, lastMsRaw) : createdMs;
|
|
19043
|
+
const proofs = Math.max(1, input.proofCount ?? 1);
|
|
19044
|
+
const ageDays = Math.max(0, (now - createdMs) / DAY_MS2);
|
|
19045
|
+
const daysSinceLast = Math.max(0, (now - lastMs) / DAY_MS2);
|
|
19046
|
+
if (daysSinceLast >= TREND_STALE_WINDOW_DAYS) return "stale";
|
|
19047
|
+
if (daysSinceLast >= TREND_RECENT_WINDOW_DAYS) return "weakening";
|
|
19048
|
+
if (ageDays <= TREND_RECENT_WINDOW_DAYS && proofs <= 2) return "new";
|
|
19049
|
+
if (proofs >= 3) return "strengthening";
|
|
19050
|
+
if (proofs >= 2 && ageDays > TREND_RECENT_WINDOW_DAYS) return "strengthening";
|
|
19051
|
+
return "stable";
|
|
19052
|
+
}
|
|
19053
|
+
function summarizeObservationTrends(inputs, now = Date.now()) {
|
|
19054
|
+
const counts = {
|
|
19055
|
+
new: 0,
|
|
19056
|
+
strengthening: 0,
|
|
19057
|
+
stable: 0,
|
|
19058
|
+
weakening: 0,
|
|
19059
|
+
stale: 0
|
|
19060
|
+
};
|
|
19061
|
+
for (const input of inputs) {
|
|
19062
|
+
counts[classifyObservationTrend(input, now)]++;
|
|
19063
|
+
}
|
|
19064
|
+
return counts;
|
|
19065
|
+
}
|
|
19066
|
+
|
|
18979
19067
|
// src/lib/memory/queryTemporal.ts
|
|
18980
19068
|
var RELATIVE_DAY_ENTRIES = [
|
|
18981
19069
|
[/\btoday\b/, "today", 0],
|
|
@@ -19370,7 +19458,7 @@ async function recall(query, ctx, options = {}) {
|
|
|
19370
19458
|
const fuseStart = nowMs();
|
|
19371
19459
|
if (types.length === 1 || factResults.length === 0 || chunkResults.length === 0) {
|
|
19372
19460
|
const memories2 = [
|
|
19373
|
-
...factResults.map(toFactMemory),
|
|
19461
|
+
...factResults.map((r) => toFactMemory(r, options.now)),
|
|
19374
19462
|
...chunkResults.map(toChunkMemory)
|
|
19375
19463
|
];
|
|
19376
19464
|
memories2.sort((a, b) => b.score - a.score);
|
|
@@ -19391,7 +19479,7 @@ async function recall(query, ctx, options = {}) {
|
|
|
19391
19479
|
const fused = rrfFuse([factRanking, chunkRanking], options.rrfK);
|
|
19392
19480
|
const byId = /* @__PURE__ */ new Map();
|
|
19393
19481
|
for (const r of factResults) {
|
|
19394
|
-
const m = toFactMemory(r);
|
|
19482
|
+
const m = toFactMemory(r, options.now);
|
|
19395
19483
|
m.score = fused.get(`fact:${r.uniqueId}`) ?? 0;
|
|
19396
19484
|
if (!m.scoreBreakdown) m.scoreBreakdown = {};
|
|
19397
19485
|
m.scoreBreakdown.fused = r.similarity;
|
|
@@ -19440,7 +19528,10 @@ async function recall(query, ctx, options = {}) {
|
|
|
19440
19528
|
...vaultSize !== void 0 && { vaultSize }
|
|
19441
19529
|
};
|
|
19442
19530
|
}
|
|
19443
|
-
function toFactMemory(r) {
|
|
19531
|
+
function toFactMemory(r, now) {
|
|
19532
|
+
const createdAt = r.createdAt ?? /* @__PURE__ */ new Date(0);
|
|
19533
|
+
const proofCount = r.proofCount ?? void 0;
|
|
19534
|
+
const lastObservedAt = r.lastObservedAt ?? null;
|
|
19444
19535
|
return {
|
|
19445
19536
|
id: r.uniqueId,
|
|
19446
19537
|
kind: "fact",
|
|
@@ -19456,6 +19547,18 @@ function toFactMemory(r) {
|
|
|
19456
19547
|
// (and UI reading them) carry the fact's type. Undefined when untyped.
|
|
19457
19548
|
...r.factType !== void 0 && { factType: r.factType },
|
|
19458
19549
|
...r.sourceChunkIds !== void 0 && r.sourceChunkIds !== null && { sourceChunkIds: r.sourceChunkIds },
|
|
19550
|
+
...proofCount !== void 0 && proofCount !== null && { proofCount },
|
|
19551
|
+
...lastObservedAt !== null && { lastObservedAt },
|
|
19552
|
+
// C2 — algorithmic trend from evidence timestamps (no LLM). Honor
|
|
19553
|
+
// RecallOptions.now so back-dated eval harnesses get consistent labels.
|
|
19554
|
+
observationTrend: classifyObservationTrend(
|
|
19555
|
+
{
|
|
19556
|
+
createdAt,
|
|
19557
|
+
lastObservedAt,
|
|
19558
|
+
proofCount
|
|
19559
|
+
},
|
|
19560
|
+
now ?? Date.now()
|
|
19561
|
+
),
|
|
19459
19562
|
// r.similarity from searchVaultMemoriesWithSize is the fused score
|
|
19460
19563
|
// (cosine + BM25 + RRF + recency + proof) when useFusion=true (the
|
|
19461
19564
|
// default) and pure cosine when useFusion=false. The breakdown
|
|
@@ -19464,7 +19567,7 @@ function toFactMemory(r) {
|
|
|
19464
19567
|
content: r.content,
|
|
19465
19568
|
score: r.similarity,
|
|
19466
19569
|
scoreBreakdown: { fused: r.similarity },
|
|
19467
|
-
createdAt
|
|
19570
|
+
createdAt,
|
|
19468
19571
|
updatedAt: r.updatedAt ?? /* @__PURE__ */ new Date(0)
|
|
19469
19572
|
};
|
|
19470
19573
|
}
|
|
@@ -19653,6 +19756,10 @@ export {
|
|
|
19653
19756
|
capHopsForDensity,
|
|
19654
19757
|
traverseGraphLane,
|
|
19655
19758
|
createLlmNeighborRefiner,
|
|
19759
|
+
TREND_RECENT_WINDOW_DAYS,
|
|
19760
|
+
TREND_STALE_WINDOW_DAYS,
|
|
19761
|
+
classifyObservationTrend,
|
|
19762
|
+
summarizeObservationTrends,
|
|
19656
19763
|
recall,
|
|
19657
19764
|
preEmbedVaultMemories,
|
|
19658
19765
|
eagerEmbedContent,
|