@anuma/sdk 3.3.0 → 3.4.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/client/index.cjs +793 -1420
- package/dist/client/index.d.mts +406 -402
- package/dist/client/index.d.ts +406 -402
- package/dist/client/index.mjs +793 -1420
- package/dist/expo/{chunk-NMZMXIUM.mjs → chunk-C7PGRFBG.mjs} +82 -9
- package/dist/expo/index.cjs +234 -168
- package/dist/expo/index.d.mts +70 -1
- package/dist/expo/index.d.ts +70 -1
- package/dist/expo/index.mjs +144 -156
- package/dist/expo/{recall-7FUJRHOI.mjs → recall-7ZX6T2VD.mjs} +1 -1
- package/dist/index.cjs +453 -783
- package/dist/index.d.mts +491 -487
- package/dist/index.d.ts +491 -487
- package/dist/index.mjs +453 -783
- package/dist/react/{chunk-GZRK43CA.mjs → chunk-CGC3UJHM.mjs} +82 -9
- package/dist/react/index.cjs +305 -290
- package/dist/react/index.d.mts +453 -380
- package/dist/react/index.d.ts +453 -380
- package/dist/react/index.mjs +215 -278
- package/dist/react/{recall-YZGWZC5W.mjs → recall-OTUNGQHQ.mjs} +1 -1
- package/dist/server/{chunk-NVTMJWFA.mjs → chunk-LUDHA4X4.mjs} +82 -9
- package/dist/server/index.cjs +124 -30
- package/dist/server/index.d.mts +70 -1
- package/dist/server/index.d.ts +70 -1
- package/dist/server/index.mjs +34 -18
- package/dist/server/{recall-76WPPKLR.mjs → recall-GWRWPGE4.mjs} +1 -1
- package/dist/tools/selection/index.cjs +3 -0
- package/dist/tools/selection/index.mjs +3 -0
- package/package.json +2 -2
package/dist/server/index.d.mts
CHANGED
|
@@ -4790,6 +4790,10 @@ interface VaultSearchResult {
|
|
|
4790
4790
|
* real timestamps. Omitted when an item lacks the field upstream. */
|
|
4791
4791
|
createdAt?: Date;
|
|
4792
4792
|
updatedAt?: Date;
|
|
4793
|
+
/** Times this fact has been re-observed — for C2 trend labels. */
|
|
4794
|
+
proofCount?: number | null;
|
|
4795
|
+
/** C3 re-observation watermark (Unix ms) — for C2 trend labels. */
|
|
4796
|
+
lastObservedAt?: number | null;
|
|
4793
4797
|
/** W6 temporal-lane anchors carried through to downstream `RankedMemory`
|
|
4794
4798
|
* so the recall executor can surface dates to the answer model without
|
|
4795
4799
|
* a second per-fact DB lookup + decrypt. Unix ms; null when the fact
|
|
@@ -4831,6 +4835,55 @@ declare function searchVaultMemories(query: string, vaultCtx: VaultMemoryOperati
|
|
|
4831
4835
|
*/
|
|
4832
4836
|
declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
|
|
4833
4837
|
|
|
4838
|
+
/**
|
|
4839
|
+
* C2 — Observation trend labels.
|
|
4840
|
+
*
|
|
4841
|
+
* Algorithmic (no LLM) classification of how a vault fact's evidence has
|
|
4842
|
+
* been evolving, derived from the C3 re-observation watermark
|
|
4843
|
+
* (`lastObservedAt`), `proofCount`, and `createdAt` over 30/90-day windows.
|
|
4844
|
+
*
|
|
4845
|
+
* We do not store a full observation-timestamp series — only first-seen,
|
|
4846
|
+
* last-seen, and count — so density is approximated from that triple.
|
|
4847
|
+
* Good enough for profile signals ("interests trending up") and vault
|
|
4848
|
+
* hygiene badges; not a substitute for an observations tier (C5).
|
|
4849
|
+
*/
|
|
4850
|
+
/** Recent window — observations inside this count as "active". */
|
|
4851
|
+
declare const TREND_RECENT_WINDOW_DAYS = 30;
|
|
4852
|
+
/** Beyond this since last observation → stale. */
|
|
4853
|
+
declare const TREND_STALE_WINDOW_DAYS = 90;
|
|
4854
|
+
/**
|
|
4855
|
+
* How a fact's evidence has been evolving.
|
|
4856
|
+
*
|
|
4857
|
+
* - `new` — first seen inside the recent window, few proofs yet.
|
|
4858
|
+
* - `strengthening` — established fact re-observed recently (rising density).
|
|
4859
|
+
* - `stable` — known for a while, still observed inside the stale window.
|
|
4860
|
+
* - `weakening` — quiet for ≥30 and <90 days after having been observed.
|
|
4861
|
+
* - `stale` — no observation in ≥90 days.
|
|
4862
|
+
*/
|
|
4863
|
+
type ObservationTrend = "new" | "strengthening" | "stable" | "weakening" | "stale";
|
|
4864
|
+
interface ObservationTrendInput {
|
|
4865
|
+
createdAt: Date | number;
|
|
4866
|
+
/**
|
|
4867
|
+
* C3 re-observation watermark (Unix ms). When null/undefined, the fact
|
|
4868
|
+
* has never been merged-into since the column landed — treat `createdAt`
|
|
4869
|
+
* as last-seen.
|
|
4870
|
+
*/
|
|
4871
|
+
lastObservedAt?: number | null;
|
|
4872
|
+
/** Times this fact has been retained/merged. Defaults to 1. */
|
|
4873
|
+
proofCount?: number | null;
|
|
4874
|
+
}
|
|
4875
|
+
/**
|
|
4876
|
+
* Classify a vault fact's observation trend from its evidence timestamps.
|
|
4877
|
+
*
|
|
4878
|
+
* Pure + deterministic. Pass `now` for back-dated eval harnesses.
|
|
4879
|
+
*/
|
|
4880
|
+
declare function classifyObservationTrend(input: ObservationTrendInput, now?: number): ObservationTrend;
|
|
4881
|
+
/**
|
|
4882
|
+
* Summarize trend counts over a set of facts — handy for profile synthesis
|
|
4883
|
+
* ("N interests strengthening") without another LLM pass.
|
|
4884
|
+
*/
|
|
4885
|
+
declare function summarizeObservationTrends(inputs: readonly ObservationTrendInput[], now?: number): Record<ObservationTrend, number>;
|
|
4886
|
+
|
|
4834
4887
|
/**
|
|
4835
4888
|
* Unified memory layer types — the Recall / Retain API.
|
|
4836
4889
|
*
|
|
@@ -4880,6 +4933,16 @@ interface RankedMemory {
|
|
|
4880
4933
|
proofCount?: number;
|
|
4881
4934
|
source?: string;
|
|
4882
4935
|
folderId?: string | null;
|
|
4936
|
+
/**
|
|
4937
|
+
* C3 re-observation watermark (Unix ms). Null/undefined when the fact
|
|
4938
|
+
* has never been merge-reinforced since the column landed.
|
|
4939
|
+
*/
|
|
4940
|
+
lastObservedAt?: number | null;
|
|
4941
|
+
/**
|
|
4942
|
+
* C2 observation-trend label derived from createdAt / lastObservedAt /
|
|
4943
|
+
* proofCount over 30/90-day windows. Fact-only; omitted for chunks.
|
|
4944
|
+
*/
|
|
4945
|
+
observationTrend?: ObservationTrend;
|
|
4883
4946
|
/**
|
|
4884
4947
|
* Anchored event-time for the fact (the date the underlying event
|
|
4885
4948
|
* occurred, not the write time). When present, the recall executor
|
|
@@ -7918,6 +7981,12 @@ interface ProfileDoc {
|
|
|
7918
7981
|
vaultWatermark: number;
|
|
7919
7982
|
/** The config that produced this doc — see {@link ProfileConfigFingerprint}. */
|
|
7920
7983
|
config: ProfileConfigFingerprint;
|
|
7984
|
+
/**
|
|
7985
|
+
* C2 — counts of observation-trend labels over live vault facts at
|
|
7986
|
+
* synthesis time. Lets People Nearby surface "interests trending up"
|
|
7987
|
+
* without another LLM pass. Recomputed every synthesis (not delta-cached).
|
|
7988
|
+
*/
|
|
7989
|
+
observationTrends: Record<ObservationTrend, number>;
|
|
7921
7990
|
/** Unix ms this doc was produced. */
|
|
7922
7991
|
generatedAt: number;
|
|
7923
7992
|
}
|
|
@@ -9053,4 +9122,4 @@ declare function sanitizeQuotes(s: string): string;
|
|
|
9053
9122
|
declare function renderTemplate(value: string | null | undefined, template: string): string | null;
|
|
9054
9123
|
declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
|
|
9055
9124
|
|
|
9056
|
-
export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, 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 ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultFolder, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultFolder, type VaultFolderOperationsContext, VaultMemory, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultFolderOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, moveMemoriesToFolderOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, recall, reflect, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serverPlatformStorage, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };
|
|
9125
|
+
export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, 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 ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultFolder, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultFolder, type VaultFolderOperationsContext, VaultMemory, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultFolderOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, moveMemoriesToFolderOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, recall, reflect, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serverPlatformStorage, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };
|
package/dist/server/index.d.ts
CHANGED
|
@@ -4790,6 +4790,10 @@ interface VaultSearchResult {
|
|
|
4790
4790
|
* real timestamps. Omitted when an item lacks the field upstream. */
|
|
4791
4791
|
createdAt?: Date;
|
|
4792
4792
|
updatedAt?: Date;
|
|
4793
|
+
/** Times this fact has been re-observed — for C2 trend labels. */
|
|
4794
|
+
proofCount?: number | null;
|
|
4795
|
+
/** C3 re-observation watermark (Unix ms) — for C2 trend labels. */
|
|
4796
|
+
lastObservedAt?: number | null;
|
|
4793
4797
|
/** W6 temporal-lane anchors carried through to downstream `RankedMemory`
|
|
4794
4798
|
* so the recall executor can surface dates to the answer model without
|
|
4795
4799
|
* a second per-fact DB lookup + decrypt. Unix ms; null when the fact
|
|
@@ -4831,6 +4835,55 @@ declare function searchVaultMemories(query: string, vaultCtx: VaultMemoryOperati
|
|
|
4831
4835
|
*/
|
|
4832
4836
|
declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
|
|
4833
4837
|
|
|
4838
|
+
/**
|
|
4839
|
+
* C2 — Observation trend labels.
|
|
4840
|
+
*
|
|
4841
|
+
* Algorithmic (no LLM) classification of how a vault fact's evidence has
|
|
4842
|
+
* been evolving, derived from the C3 re-observation watermark
|
|
4843
|
+
* (`lastObservedAt`), `proofCount`, and `createdAt` over 30/90-day windows.
|
|
4844
|
+
*
|
|
4845
|
+
* We do not store a full observation-timestamp series — only first-seen,
|
|
4846
|
+
* last-seen, and count — so density is approximated from that triple.
|
|
4847
|
+
* Good enough for profile signals ("interests trending up") and vault
|
|
4848
|
+
* hygiene badges; not a substitute for an observations tier (C5).
|
|
4849
|
+
*/
|
|
4850
|
+
/** Recent window — observations inside this count as "active". */
|
|
4851
|
+
declare const TREND_RECENT_WINDOW_DAYS = 30;
|
|
4852
|
+
/** Beyond this since last observation → stale. */
|
|
4853
|
+
declare const TREND_STALE_WINDOW_DAYS = 90;
|
|
4854
|
+
/**
|
|
4855
|
+
* How a fact's evidence has been evolving.
|
|
4856
|
+
*
|
|
4857
|
+
* - `new` — first seen inside the recent window, few proofs yet.
|
|
4858
|
+
* - `strengthening` — established fact re-observed recently (rising density).
|
|
4859
|
+
* - `stable` — known for a while, still observed inside the stale window.
|
|
4860
|
+
* - `weakening` — quiet for ≥30 and <90 days after having been observed.
|
|
4861
|
+
* - `stale` — no observation in ≥90 days.
|
|
4862
|
+
*/
|
|
4863
|
+
type ObservationTrend = "new" | "strengthening" | "stable" | "weakening" | "stale";
|
|
4864
|
+
interface ObservationTrendInput {
|
|
4865
|
+
createdAt: Date | number;
|
|
4866
|
+
/**
|
|
4867
|
+
* C3 re-observation watermark (Unix ms). When null/undefined, the fact
|
|
4868
|
+
* has never been merged-into since the column landed — treat `createdAt`
|
|
4869
|
+
* as last-seen.
|
|
4870
|
+
*/
|
|
4871
|
+
lastObservedAt?: number | null;
|
|
4872
|
+
/** Times this fact has been retained/merged. Defaults to 1. */
|
|
4873
|
+
proofCount?: number | null;
|
|
4874
|
+
}
|
|
4875
|
+
/**
|
|
4876
|
+
* Classify a vault fact's observation trend from its evidence timestamps.
|
|
4877
|
+
*
|
|
4878
|
+
* Pure + deterministic. Pass `now` for back-dated eval harnesses.
|
|
4879
|
+
*/
|
|
4880
|
+
declare function classifyObservationTrend(input: ObservationTrendInput, now?: number): ObservationTrend;
|
|
4881
|
+
/**
|
|
4882
|
+
* Summarize trend counts over a set of facts — handy for profile synthesis
|
|
4883
|
+
* ("N interests strengthening") without another LLM pass.
|
|
4884
|
+
*/
|
|
4885
|
+
declare function summarizeObservationTrends(inputs: readonly ObservationTrendInput[], now?: number): Record<ObservationTrend, number>;
|
|
4886
|
+
|
|
4834
4887
|
/**
|
|
4835
4888
|
* Unified memory layer types — the Recall / Retain API.
|
|
4836
4889
|
*
|
|
@@ -4880,6 +4933,16 @@ interface RankedMemory {
|
|
|
4880
4933
|
proofCount?: number;
|
|
4881
4934
|
source?: string;
|
|
4882
4935
|
folderId?: string | null;
|
|
4936
|
+
/**
|
|
4937
|
+
* C3 re-observation watermark (Unix ms). Null/undefined when the fact
|
|
4938
|
+
* has never been merge-reinforced since the column landed.
|
|
4939
|
+
*/
|
|
4940
|
+
lastObservedAt?: number | null;
|
|
4941
|
+
/**
|
|
4942
|
+
* C2 observation-trend label derived from createdAt / lastObservedAt /
|
|
4943
|
+
* proofCount over 30/90-day windows. Fact-only; omitted for chunks.
|
|
4944
|
+
*/
|
|
4945
|
+
observationTrend?: ObservationTrend;
|
|
4883
4946
|
/**
|
|
4884
4947
|
* Anchored event-time for the fact (the date the underlying event
|
|
4885
4948
|
* occurred, not the write time). When present, the recall executor
|
|
@@ -7918,6 +7981,12 @@ interface ProfileDoc {
|
|
|
7918
7981
|
vaultWatermark: number;
|
|
7919
7982
|
/** The config that produced this doc — see {@link ProfileConfigFingerprint}. */
|
|
7920
7983
|
config: ProfileConfigFingerprint;
|
|
7984
|
+
/**
|
|
7985
|
+
* C2 — counts of observation-trend labels over live vault facts at
|
|
7986
|
+
* synthesis time. Lets People Nearby surface "interests trending up"
|
|
7987
|
+
* without another LLM pass. Recomputed every synthesis (not delta-cached).
|
|
7988
|
+
*/
|
|
7989
|
+
observationTrends: Record<ObservationTrend, number>;
|
|
7921
7990
|
/** Unix ms this doc was produced. */
|
|
7922
7991
|
generatedAt: number;
|
|
7923
7992
|
}
|
|
@@ -9053,4 +9122,4 @@ declare function sanitizeQuotes(s: string): string;
|
|
|
9053
9122
|
declare function renderTemplate(value: string | null | undefined, template: string): string | null;
|
|
9054
9123
|
declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
|
|
9055
9124
|
|
|
9056
|
-
export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, 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 ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultFolder, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultFolder, type VaultFolderOperationsContext, VaultMemory, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultFolderOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, moveMemoriesToFolderOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, recall, reflect, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serverPlatformStorage, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };
|
|
9125
|
+
export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, 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 ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultFolder, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultFolder, type VaultFolderOperationsContext, VaultMemory, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultFolderOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, moveMemoriesToFolderOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, recall, reflect, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serverPlatformStorage, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };
|
package/dist/server/index.mjs
CHANGED
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
NODE_BUDGET,
|
|
12
12
|
RerankerUnavailableError,
|
|
13
13
|
TOPICS_EXTRACTION_VERSION,
|
|
14
|
+
TREND_RECENT_WINDOW_DAYS,
|
|
15
|
+
TREND_STALE_WINDOW_DAYS,
|
|
14
16
|
VAULT_SIZE_HOP_CAP,
|
|
15
17
|
archiveVaultMemoryOp,
|
|
16
18
|
assertVaultScopeForSweep,
|
|
@@ -18,6 +20,7 @@ import {
|
|
|
18
20
|
chunkAndEmbedAllMessages,
|
|
19
21
|
chunkAndEmbedMessage,
|
|
20
22
|
chunkText,
|
|
23
|
+
classifyObservationTrend,
|
|
21
24
|
clearAllEncryptionKeys,
|
|
22
25
|
clearAllEncryptionState,
|
|
23
26
|
clearAllKeyPairs,
|
|
@@ -108,6 +111,7 @@ import {
|
|
|
108
111
|
shouldChunkMessage,
|
|
109
112
|
stampTopicsExtractedAtOp,
|
|
110
113
|
stripToolCalls,
|
|
114
|
+
summarizeObservationTrends,
|
|
111
115
|
supersedeVaultMemoryOp,
|
|
112
116
|
traverseGraphLane,
|
|
113
117
|
updateConversationProjectOp,
|
|
@@ -120,7 +124,7 @@ import {
|
|
|
120
124
|
updateVaultMemoryOp,
|
|
121
125
|
upsertMessageOp,
|
|
122
126
|
vaultMemoryToStored
|
|
123
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-LUDHA4X4.mjs";
|
|
124
128
|
import {
|
|
125
129
|
createStreamingDeAnonymizer,
|
|
126
130
|
resolvePiiRedactor
|
|
@@ -6697,6 +6701,13 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
6697
6701
|
includeSuperseded: true
|
|
6698
6702
|
});
|
|
6699
6703
|
const watermark = computeVaultWatermark(memories);
|
|
6704
|
+
const observationTrends = summarizeObservationTrends(
|
|
6705
|
+
memories.filter((m) => !m.isDeleted && m.supersededBy === null).map((m) => ({
|
|
6706
|
+
createdAt: m.createdAt,
|
|
6707
|
+
lastObservedAt: m.lastObservedAt,
|
|
6708
|
+
proofCount: m.proofCount
|
|
6709
|
+
}))
|
|
6710
|
+
);
|
|
6700
6711
|
const presentIds = new Set(memories.map((m) => m.uniqueId));
|
|
6701
6712
|
const hasStaleSections = previous?.sections.some((s) => s.stale);
|
|
6702
6713
|
const citesMissingFact = previous?.sections.some(
|
|
@@ -6704,10 +6715,14 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
6704
6715
|
);
|
|
6705
6716
|
if (previous && previous.vaultWatermark === watermark && !hasStaleSections && !citesMissingFact) {
|
|
6706
6717
|
const sameOrder = previous.sections.length === facets.length && facets.every((f, i) => previous.sections[i]?.key === f.key);
|
|
6707
|
-
if (sameOrder)
|
|
6718
|
+
if (sameOrder) {
|
|
6719
|
+
if (trendsEqual(previous.observationTrends, observationTrends)) return previous;
|
|
6720
|
+
return { ...previous, observationTrends };
|
|
6721
|
+
}
|
|
6708
6722
|
return {
|
|
6709
6723
|
...previous,
|
|
6710
|
-
sections: facets.map((f) => previous.sections.find((s) => s.key === f.key))
|
|
6724
|
+
sections: facets.map((f) => previous.sections.find((s) => s.key === f.key)),
|
|
6725
|
+
observationTrends
|
|
6711
6726
|
};
|
|
6712
6727
|
}
|
|
6713
6728
|
const staleKeys = await computeStaleFacetKeys(ctx, memories, facets, previous, watermark);
|
|
@@ -6740,6 +6755,7 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
6740
6755
|
sections,
|
|
6741
6756
|
vaultWatermark: watermark,
|
|
6742
6757
|
config,
|
|
6758
|
+
observationTrends,
|
|
6743
6759
|
generatedAt: Date.now()
|
|
6744
6760
|
};
|
|
6745
6761
|
}
|
|
@@ -6750,6 +6766,10 @@ function configMatches(a, b) {
|
|
|
6750
6766
|
function facetsSignature(facets) {
|
|
6751
6767
|
return facets.map((f) => JSON.stringify([f.key, f.label, f.query, f.guidance])).sort().join("\n");
|
|
6752
6768
|
}
|
|
6769
|
+
function trendsEqual(a, b) {
|
|
6770
|
+
if (!a) return false;
|
|
6771
|
+
return a.new === b.new && a.strengthening === b.strengthening && a.stable === b.stable && a.weakening === b.weakening && a.stale === b.stale;
|
|
6772
|
+
}
|
|
6753
6773
|
function changeTime(m) {
|
|
6754
6774
|
return Math.max(m.updatedAt.getTime(), m.supersededAt ?? 0, m.lastObservedAt ?? 0);
|
|
6755
6775
|
}
|
|
@@ -9070,7 +9090,7 @@ function createCryptoPricePreProcessor(options = {}) {
|
|
|
9070
9090
|
}
|
|
9071
9091
|
|
|
9072
9092
|
// src/client/core/serverSentEvents.gen.ts
|
|
9073
|
-
|
|
9093
|
+
function createSseClient({
|
|
9074
9094
|
onRequest,
|
|
9075
9095
|
onSseError,
|
|
9076
9096
|
onSseEvent,
|
|
@@ -9082,7 +9102,7 @@ var createSseClient = ({
|
|
|
9082
9102
|
sseSleepFn,
|
|
9083
9103
|
url,
|
|
9084
9104
|
...options
|
|
9085
|
-
})
|
|
9105
|
+
}) {
|
|
9086
9106
|
let lastEventId;
|
|
9087
9107
|
const sleep3 = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
9088
9108
|
const createStream = async function* () {
|
|
@@ -9110,10 +9130,7 @@ var createSseClient = ({
|
|
|
9110
9130
|
}
|
|
9111
9131
|
const _fetch = options.fetch ?? globalThis.fetch;
|
|
9112
9132
|
const response = await _fetch(request);
|
|
9113
|
-
if (!response.ok)
|
|
9114
|
-
throw new Error(
|
|
9115
|
-
`SSE failed: ${response.status} ${response.statusText}`
|
|
9116
|
-
);
|
|
9133
|
+
if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
|
|
9117
9134
|
if (!response.body) throw new Error("No body in SSE response");
|
|
9118
9135
|
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
9119
9136
|
let buffer = "";
|
|
@@ -9129,6 +9146,7 @@ var createSseClient = ({
|
|
|
9129
9146
|
const { done, value } = await reader.read();
|
|
9130
9147
|
if (done) break;
|
|
9131
9148
|
buffer += value;
|
|
9149
|
+
buffer = buffer.replace(/\r\n?/g, "\n");
|
|
9132
9150
|
const chunks = buffer.split("\n\n");
|
|
9133
9151
|
buffer = chunks.pop() ?? "";
|
|
9134
9152
|
for (const chunk of chunks) {
|
|
@@ -9143,10 +9161,7 @@ var createSseClient = ({
|
|
|
9143
9161
|
} else if (line.startsWith("id:")) {
|
|
9144
9162
|
lastEventId = line.replace(/^id:\s*/, "");
|
|
9145
9163
|
} else if (line.startsWith("retry:")) {
|
|
9146
|
-
const parsed = Number.parseInt(
|
|
9147
|
-
line.replace(/^retry:\s*/, ""),
|
|
9148
|
-
10
|
|
9149
|
-
);
|
|
9164
|
+
const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
|
|
9150
9165
|
if (!Number.isNaN(parsed)) {
|
|
9151
9166
|
retryDelay = parsed;
|
|
9152
9167
|
}
|
|
@@ -9192,17 +9207,14 @@ var createSseClient = ({
|
|
|
9192
9207
|
if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) {
|
|
9193
9208
|
break;
|
|
9194
9209
|
}
|
|
9195
|
-
const backoff = Math.min(
|
|
9196
|
-
retryDelay * 2 ** (attempt - 1),
|
|
9197
|
-
sseMaxRetryDelay ?? 3e4
|
|
9198
|
-
);
|
|
9210
|
+
const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4);
|
|
9199
9211
|
await sleep3(backoff);
|
|
9200
9212
|
}
|
|
9201
9213
|
}
|
|
9202
9214
|
};
|
|
9203
9215
|
const stream = createStream();
|
|
9204
9216
|
return { stream };
|
|
9205
|
-
}
|
|
9217
|
+
}
|
|
9206
9218
|
|
|
9207
9219
|
// src/lib/chat/runHooks.ts
|
|
9208
9220
|
function composeHooks(hooks) {
|
|
@@ -12825,6 +12837,8 @@ export {
|
|
|
12825
12837
|
TOOL_CATALOG,
|
|
12826
12838
|
TOPICS_EXTRACTION_VERSION,
|
|
12827
12839
|
TOPIC_EXTRACTION_BATCH_SIZE,
|
|
12840
|
+
TREND_RECENT_WINDOW_DAYS,
|
|
12841
|
+
TREND_STALE_WINDOW_DAYS,
|
|
12828
12842
|
TextProcessor,
|
|
12829
12843
|
UserPreference,
|
|
12830
12844
|
VAULT_SIZE_HOP_CAP,
|
|
@@ -12847,6 +12861,7 @@ export {
|
|
|
12847
12861
|
classifyCryptoPriceBatch,
|
|
12848
12862
|
classifyDecay,
|
|
12849
12863
|
classifyInjectionCandidates,
|
|
12864
|
+
classifyObservationTrend,
|
|
12850
12865
|
classifyStockPrice,
|
|
12851
12866
|
classifyStockPriceBatch,
|
|
12852
12867
|
classifyWeather,
|
|
@@ -13026,6 +13041,7 @@ export {
|
|
|
13026
13041
|
stampTopicsExtractedAtOp,
|
|
13027
13042
|
streamCancelPath,
|
|
13028
13043
|
streamReplayPath,
|
|
13044
|
+
summarizeObservationTrends,
|
|
13029
13045
|
summaryToSystemMessage,
|
|
13030
13046
|
supersedeVaultMemoryOp,
|
|
13031
13047
|
synthesizeProfile,
|
|
@@ -152,6 +152,9 @@ async function withEmbeddingRetry(call) {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
if (threw) throw lastThrown;
|
|
155
|
+
if (last?.error instanceof Error && last.response?.status === void 0) {
|
|
156
|
+
throw last.error;
|
|
157
|
+
}
|
|
155
158
|
return last;
|
|
156
159
|
}
|
|
157
160
|
var EmbeddingHttpError = class extends Error {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anuma/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"devDependencies": {
|
|
171
171
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
172
172
|
"@eslint/js": "^10.0.1",
|
|
173
|
-
"@hey-api/openapi-ts": "0.
|
|
173
|
+
"@hey-api/openapi-ts": "0.97.3",
|
|
174
174
|
"@huggingface/transformers": "^3.0.0",
|
|
175
175
|
"@microsoft/api-extractor": "^7.57.1",
|
|
176
176
|
"@nozbe/watermelondb": "^0.28.0",
|