@anuma/sdk 6.9.0 → 6.11.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-4M56MKBV.mjs → chunk-ZO7S3TBT.mjs} +79 -25
- package/dist/expo/index.cjs +98 -23
- package/dist/expo/index.d.mts +94 -1
- package/dist/expo/index.d.ts +94 -1
- package/dist/expo/index.mjs +31 -11
- package/dist/expo/{recall-WIB7RQQZ.mjs → recall-OALPGL3H.mjs} +1 -1
- package/dist/react/{chunk-EJ65X4GI.mjs → chunk-HNQ2ZEFF.mjs} +79 -25
- package/dist/react/index.cjs +98 -23
- package/dist/react/index.d.mts +94 -1
- package/dist/react/index.d.ts +94 -1
- package/dist/react/index.mjs +31 -11
- package/dist/react/{recall-FWILZSFH.mjs → recall-F5DBVCU2.mjs} +1 -1
- package/dist/server/{chunk-I56324FR.mjs → chunk-BKB6AT7Z.mjs} +79 -25
- package/dist/server/index.cjs +98 -23
- package/dist/server/index.d.mts +94 -1
- package/dist/server/index.d.ts +94 -1
- package/dist/server/index.mjs +31 -11
- package/dist/server/{recall-T7CNXTQ3.mjs → recall-HVIEAH7J.mjs} +1 -1
- package/package.json +1 -1
package/dist/server/index.d.ts
CHANGED
|
@@ -5641,6 +5641,17 @@ interface RecallDiagnostics {
|
|
|
5641
5641
|
* never the cost.
|
|
5642
5642
|
*/
|
|
5643
5643
|
vaultRowsDecrypted?: number;
|
|
5644
|
+
/**
|
|
5645
|
+
* Rows the fact lane had to re-embed through the portal because their stored
|
|
5646
|
+
* vector was unusable — stale `embedding_model`, wrong dimension, or
|
|
5647
|
+
* unparseable. Absent when the fact lane didn't run.
|
|
5648
|
+
*
|
|
5649
|
+
* Expected to be 0 on a healthy vault: rows are embedded at write time and the
|
|
5650
|
+
* re-embed writes the current model back, so a persistently non-zero value
|
|
5651
|
+
* means the writeback is not sticking and every turn is paying for it. On the
|
|
5652
|
+
* LEGACY read path this batch is uncapped, so it can be the whole vault.
|
|
5653
|
+
*/
|
|
5654
|
+
vaultRowsEmbedded?: number;
|
|
5644
5655
|
/** Facts the fact lane returned (post-dedupe, pre-fusion). */
|
|
5645
5656
|
factCount: number;
|
|
5646
5657
|
/** Chunks the chunk lane returned (post-dedupe, pre-fusion). */
|
|
@@ -5653,6 +5664,37 @@ interface RecallDiagnostics {
|
|
|
5653
5664
|
prep: number;
|
|
5654
5665
|
/** Vault fact-lane search (`searchVaultMemoriesWithSize`). */
|
|
5655
5666
|
factLane: number;
|
|
5667
|
+
/**
|
|
5668
|
+
* The cross-encoder's share of {@link factLane} — wall-clock spent inside
|
|
5669
|
+
* `rerankPairs`. Billed even when the CE threw partway through, because a
|
|
5670
|
+
* rerank that burned three seconds and then failed still cost them.
|
|
5671
|
+
*
|
|
5672
|
+
* A SUBSET of `factLane`, not a sibling: read `factLane - rerank` for
|
|
5673
|
+
* everything else the lane did (query embed, vault read, fused ranking).
|
|
5674
|
+
* 0 when the CE did not run; `reranked` is what distinguishes that from a
|
|
5675
|
+
* rerank that cost nothing.
|
|
5676
|
+
*
|
|
5677
|
+
* Exists because #845 spent three rounds arguing about which stage inside
|
|
5678
|
+
* the fact lane dominated — whole-vault read, then admission window, then
|
|
5679
|
+
* the CE — with one aggregate number for all of them. Every hypothesis was
|
|
5680
|
+
* an inference; this makes the question a query.
|
|
5681
|
+
*/
|
|
5682
|
+
rerank: number;
|
|
5683
|
+
/**
|
|
5684
|
+
* The query embed's share of {@link factLane} — one portal round trip.
|
|
5685
|
+
*
|
|
5686
|
+
* Also a SUBSET of `factLane`. Together with `rerank` this makes the lane
|
|
5687
|
+
* decomposable: `factLane - queryEmbed - rerank` is the local work (vault
|
|
5688
|
+
* read, decrypt, BM25/cosine fusion), and each of the three implies a
|
|
5689
|
+
* completely different fix.
|
|
5690
|
+
*
|
|
5691
|
+
* 0 when the lane returned before embedding, which includes every empty
|
|
5692
|
+
* vault — `prepareVaultCandidates` short-circuits first. That is why the
|
|
5693
|
+
* fast `vault_size = 0` population never established a baseline for this
|
|
5694
|
+
* cost, and why the ~850ms floor on the smallest NON-empty vaults had no
|
|
5695
|
+
* attributable owner.
|
|
5696
|
+
*/
|
|
5697
|
+
queryEmbed: number;
|
|
5656
5698
|
/** Chunk-lane search (`searchChunksOp`). */
|
|
5657
5699
|
chunkLane: number;
|
|
5658
5700
|
/** Cross-lane RRF fusion + provenance dedup after both lanes. */
|
|
@@ -9096,6 +9138,39 @@ interface TopicExtractOptions extends PortalLlmAuth {
|
|
|
9096
9138
|
* later sweep, never stamp them.
|
|
9097
9139
|
*/
|
|
9098
9140
|
declare function extractEntitiesForMemories(memories: readonly TopicExtractionInput[], options: TopicExtractOptions): Promise<Map<string, ExtractedEntity[]>>;
|
|
9141
|
+
/**
|
|
9142
|
+
* Why one memory was skipped by a topic sweep.
|
|
9143
|
+
*
|
|
9144
|
+
* Split along the line that actually matters operationally — did the sweep
|
|
9145
|
+
* DECLINE this row on purpose, or did something BREAK:
|
|
9146
|
+
*
|
|
9147
|
+
* Deliberate (healthy; a sweep of nothing but these is a success):
|
|
9148
|
+
* - `excluded` — deleted, owned by another user, or `topicsUserManaged`.
|
|
9149
|
+
* - `link-declined` — the entity-link write's in-row guard declined (the row
|
|
9150
|
+
* became user-managed / deleted / absent mid-run).
|
|
9151
|
+
* - `stamp-declined` — same, caught by the stamp op's own re-check.
|
|
9152
|
+
*
|
|
9153
|
+
* Degraded (something is wrong; see {@link isDegradedTopicSkip}):
|
|
9154
|
+
* - `llm-unanswered` — the batch failed or the model omitted this id. THE one
|
|
9155
|
+
* to alarm on: it is how a wholly broken sweep looks.
|
|
9156
|
+
* - `unreadable` — the row could not be loaded/decrypted.
|
|
9157
|
+
* - `not-found` — the lookup threw (absent row or read fault).
|
|
9158
|
+
* - `link-failed` — the entity-link write threw.
|
|
9159
|
+
*
|
|
9160
|
+
* @public
|
|
9161
|
+
*/
|
|
9162
|
+
type TopicSkipReason = "excluded" | "link-declined" | "stamp-declined" | "llm-unanswered" | "unreadable" | "not-found" | "link-failed";
|
|
9163
|
+
/**
|
|
9164
|
+
* Whether a skip reason means the sweep FAILED on that row, rather than
|
|
9165
|
+
* deliberately passing over it.
|
|
9166
|
+
*
|
|
9167
|
+
* Exported so callers classify identically instead of each re-deriving the
|
|
9168
|
+
* split — the reason this type exists is that one wrong grouping turns a broken
|
|
9169
|
+
* sweep back into a healthy-looking one.
|
|
9170
|
+
*
|
|
9171
|
+
* @public
|
|
9172
|
+
*/
|
|
9173
|
+
declare function isDegradedTopicSkip(reason: TopicSkipReason): boolean;
|
|
9099
9174
|
/** Outcome of one {@link extractAndLinkEntitiesForMemoriesOp} run. */
|
|
9100
9175
|
interface TopicExtractionRunResult {
|
|
9101
9176
|
/** memoryId → entities the LLM returned (post-validation, post-linking). */
|
|
@@ -9108,6 +9183,24 @@ interface TopicExtractionRunResult {
|
|
|
9108
9183
|
* LLM batches. Skipped ids are not stamped, so failed batches are retried
|
|
9109
9184
|
* by a later sweep — callers should apply their own attempt caps. */
|
|
9110
9185
|
skippedIds: string[];
|
|
9186
|
+
/**
|
|
9187
|
+
* Why each id in {@link skippedIds} was skipped.
|
|
9188
|
+
*
|
|
9189
|
+
* `skippedIds` alone cannot distinguish a sweep that deliberately declined
|
|
9190
|
+
* work from one that FAILED: a run where every LLM batch errored and a run
|
|
9191
|
+
* over rows the user has taken manual control of produce an identical array.
|
|
9192
|
+
* That is the same blindness `outcome: 'empty-after-retry'` had before #888 —
|
|
9193
|
+
* a degradation wearing the shape of normal control flow.
|
|
9194
|
+
*
|
|
9195
|
+
* It matters here because topics feed the entity recall lane, so a silently
|
|
9196
|
+
* failing sweep means memories that exist but cannot be found by entity, with
|
|
9197
|
+
* nothing in production saying so.
|
|
9198
|
+
*
|
|
9199
|
+
* Populated in lockstep with `skippedIds` (single `skip()` helper), so the two
|
|
9200
|
+
* cannot drift. Group by {@link isDegradedTopicSkip} to separate "declined" from
|
|
9201
|
+
* "broke".
|
|
9202
|
+
*/
|
|
9203
|
+
skippedReasons: Map<string, TopicSkipReason>;
|
|
9111
9204
|
}
|
|
9112
9205
|
/**
|
|
9113
9206
|
* Run LLM topic extraction over existing vault memories and persist the
|
|
@@ -10420,4 +10513,4 @@ declare function sanitizeQuotes(s: string): string;
|
|
|
10420
10513
|
declare function renderTemplate(value: string | null | undefined, template: string): string | null;
|
|
10421
10514
|
declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
|
|
10422
10515
|
|
|
10423
|
-
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 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_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, 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, EncryptionKeyMissingError, 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 MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, 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 PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type PublishedPhotoMemory, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, 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 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 UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, backfillMemoryTopicsOp, 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, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, 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, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, 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, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp, verifyMemoriesForPublish };
|
|
10516
|
+
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 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_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, 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, EncryptionKeyMissingError, 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 MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, 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 PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type PublishedPhotoMemory, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, 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 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 TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, backfillMemoryTopicsOp, 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, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, 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, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isDegradedTopicSkip, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, 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, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp, verifyMemoriesForPublish };
|
package/dist/server/index.mjs
CHANGED
|
@@ -141,7 +141,7 @@ import {
|
|
|
141
141
|
updateVaultMemoryOp,
|
|
142
142
|
upsertMessageOp,
|
|
143
143
|
vaultMemoryToStored
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-BKB6AT7Z.mjs";
|
|
145
145
|
import {
|
|
146
146
|
createStreamingDeAnonymizer,
|
|
147
147
|
notifyConsolidationFallback,
|
|
@@ -7679,6 +7679,18 @@ function parseTopicResponse(parsed, validIds) {
|
|
|
7679
7679
|
}
|
|
7680
7680
|
return out;
|
|
7681
7681
|
}
|
|
7682
|
+
var DEGRADED_TOPIC_SKIP = {
|
|
7683
|
+
excluded: false,
|
|
7684
|
+
"link-declined": false,
|
|
7685
|
+
"stamp-declined": false,
|
|
7686
|
+
"llm-unanswered": true,
|
|
7687
|
+
unreadable: true,
|
|
7688
|
+
"not-found": true,
|
|
7689
|
+
"link-failed": true
|
|
7690
|
+
};
|
|
7691
|
+
function isDegradedTopicSkip(reason) {
|
|
7692
|
+
return DEGRADED_TOPIC_SKIP[reason] === true;
|
|
7693
|
+
}
|
|
7682
7694
|
async function extractAndLinkEntitiesForMemoriesOp(ctx, memoryIds, options) {
|
|
7683
7695
|
const entityCtx = ctx.entityCtx;
|
|
7684
7696
|
if (!entityCtx) {
|
|
@@ -7687,17 +7699,24 @@ async function extractAndLinkEntitiesForMemoriesOp(ctx, memoryIds, options) {
|
|
|
7687
7699
|
const log = getLogger();
|
|
7688
7700
|
const extractedAt = options.now ?? Date.now();
|
|
7689
7701
|
const skippedIds = [];
|
|
7702
|
+
const skippedReasons = /* @__PURE__ */ new Map();
|
|
7703
|
+
const skip = (id, reason) => {
|
|
7704
|
+
if (skippedReasons.has(id)) return;
|
|
7705
|
+
skippedIds.push(id);
|
|
7706
|
+
skippedReasons.set(id, reason);
|
|
7707
|
+
};
|
|
7690
7708
|
const inputs = [];
|
|
7691
|
-
for (const id of memoryIds) {
|
|
7709
|
+
for (const id of new Set(memoryIds)) {
|
|
7692
7710
|
let record;
|
|
7693
7711
|
try {
|
|
7694
7712
|
record = await ctx.vaultMemoryCollection.find(id);
|
|
7695
|
-
} catch {
|
|
7696
|
-
|
|
7713
|
+
} catch (err) {
|
|
7714
|
+
log.warn("[memory/topics] vault lookup failed for extraction", err);
|
|
7715
|
+
skip(id, "not-found");
|
|
7697
7716
|
continue;
|
|
7698
7717
|
}
|
|
7699
7718
|
if (record.isDeleted || ctx.userId !== void 0 && record.userId !== ctx.userId || record.topicsUserManaged) {
|
|
7700
|
-
|
|
7719
|
+
skip(id, "excluded");
|
|
7701
7720
|
continue;
|
|
7702
7721
|
}
|
|
7703
7722
|
try {
|
|
@@ -7710,7 +7729,7 @@ async function extractAndLinkEntitiesForMemoriesOp(ctx, memoryIds, options) {
|
|
|
7710
7729
|
inputs.push({ id, content: stored.content });
|
|
7711
7730
|
} catch (err) {
|
|
7712
7731
|
log.warn("[memory/topics] failed to load memory for extraction", err);
|
|
7713
|
-
|
|
7732
|
+
skip(id, "unreadable");
|
|
7714
7733
|
}
|
|
7715
7734
|
}
|
|
7716
7735
|
const entitiesByMemory = await extractEntitiesForMemories(inputs, options);
|
|
@@ -7718,19 +7737,19 @@ async function extractAndLinkEntitiesForMemoriesOp(ctx, memoryIds, options) {
|
|
|
7718
7737
|
for (const input of inputs) {
|
|
7719
7738
|
const entities = entitiesByMemory.get(input.id);
|
|
7720
7739
|
if (entities === void 0) {
|
|
7721
|
-
|
|
7740
|
+
skip(input.id, "llm-unanswered");
|
|
7722
7741
|
continue;
|
|
7723
7742
|
}
|
|
7724
7743
|
try {
|
|
7725
7744
|
const linked = await replaceMemoryEntitiesGuardedOp(entityCtx, input.id, entities);
|
|
7726
7745
|
if (linked === null) {
|
|
7727
|
-
|
|
7746
|
+
skip(input.id, "link-declined");
|
|
7728
7747
|
entitiesByMemory.delete(input.id);
|
|
7729
7748
|
continue;
|
|
7730
7749
|
}
|
|
7731
7750
|
} catch (err) {
|
|
7732
7751
|
log.warn("[memory/topics] replaceMemoryEntitiesGuardedOp failed", err);
|
|
7733
|
-
|
|
7752
|
+
skip(input.id, "link-failed");
|
|
7734
7753
|
entitiesByMemory.delete(input.id);
|
|
7735
7754
|
continue;
|
|
7736
7755
|
}
|
|
@@ -7740,11 +7759,11 @@ async function extractAndLinkEntitiesForMemoriesOp(ctx, memoryIds, options) {
|
|
|
7740
7759
|
const stampedSet = new Set(stampedIds);
|
|
7741
7760
|
for (const id of toStamp) {
|
|
7742
7761
|
if (!stampedSet.has(id)) {
|
|
7743
|
-
|
|
7762
|
+
skip(id, "stamp-declined");
|
|
7744
7763
|
entitiesByMemory.delete(id);
|
|
7745
7764
|
}
|
|
7746
7765
|
}
|
|
7747
|
-
return { entitiesByMemory, stampedIds, skippedIds };
|
|
7766
|
+
return { entitiesByMemory, stampedIds, skippedIds, skippedReasons };
|
|
7748
7767
|
}
|
|
7749
7768
|
|
|
7750
7769
|
// src/lib/memory/verifySupport.ts
|
|
@@ -13761,6 +13780,7 @@ export {
|
|
|
13761
13780
|
hasKeyPair,
|
|
13762
13781
|
ingestPublishedPhotoMemoriesOp,
|
|
13763
13782
|
injectionSignatureCatalog,
|
|
13783
|
+
isDegradedTopicSkip,
|
|
13764
13784
|
isRerankerAvailable,
|
|
13765
13785
|
isSupportedFile,
|
|
13766
13786
|
isSupportedMediaType,
|