@anuma/sdk 6.20.0 → 6.21.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.
@@ -5696,7 +5696,25 @@ type RecallDegradation =
5696
5696
  * failing back to the single-query path, or a row batch failing while other
5697
5697
  * rows keep usable vectors) — those are logged, not reported, so this stays a
5698
5698
  * reliable outage signal rather than a general embedding-error counter. */
5699
- | "embeddings-unavailable";
5699
+ | "embeddings-unavailable"
5700
+ /** The W5 graph (entity) side lane threw and was dropped. Auxiliary, so recall
5701
+ * still returned — but its RRF signal is missing from the ranking, and until
5702
+ * this existed the drop was a log line and nothing else. */
5703
+ | "graph-lane-failed"
5704
+ /** The W6 temporal side lane threw and was dropped. Same posture as the graph
5705
+ * lane: recall still returned, ranked without the temporal signal. */
5706
+ | "temporal-lane-failed";
5707
+ /**
5708
+ * Why a recall returned nothing. `""` when it returned something, so the field
5709
+ * is always present and groupable rather than being absent on the healthy path.
5710
+ *
5711
+ * The four are different problems: an empty query is a caller bug, no-lanes is a
5712
+ * context wiring bug (the requested kinds have no store), vault-empty is a new
5713
+ * user, and no-candidates is the only one that is about retrieval quality. They
5714
+ * were previously indistinguishable from outside — every one reported
5715
+ * `candidateCount: 0`.
5716
+ */
5717
+ type RecallEmptyReason = "" | "empty-query" | "no-lanes" | "vault-empty" | "no-candidates";
5700
5718
  /**
5701
5719
  * Per-call recall observability payload (see {@link RecallOptions.onDiagnostics}).
5702
5720
  * All timings are wall-clock milliseconds. Lane counts are post-dedupe,
@@ -5747,6 +5765,50 @@ interface RecallDiagnostics {
5747
5765
  factCount: number;
5748
5766
  /** Chunks the chunk lane returned (post-dedupe, pre-fusion). */
5749
5767
  chunkCount: number;
5768
+ /**
5769
+ * Memories actually RETURNED — `memories.length` after fusion, cross-lane
5770
+ * dedup and the `limit` slice.
5771
+ *
5772
+ * `candidateCount` is what was considered; this is what the caller got, and
5773
+ * the two are routinely far apart (the fact lane pulls `limit * 2` when fusing).
5774
+ * Every consumer that wanted "how many memories did this turn actually get"
5775
+ * was reading `candidateCount` and overcounting.
5776
+ */
5777
+ admittedCount: number;
5778
+ /** Highest score among the returned memories; -1 when none were returned. */
5779
+ topScore: number;
5780
+ /** Lowest score among the returned memories; -1 when none were returned. */
5781
+ lowestAdmittedScore: number;
5782
+ /**
5783
+ * The similarity floor the lane that produced these scores actually applied:
5784
+ * the fact lane's when it RETURNED results, otherwise the chunk lane's, and
5785
+ * **-1 when neither ran** (empty query, unwired context). Gated on results
5786
+ * rather than on the lane running, because a fact lane that ran and came
5787
+ * back empty filtered none of the scores in the payload — reporting its
5788
+ * 0.1 default against chunks that cleared 0.5 corrupted the telemetry.
5789
+ * When NOTHING was admitted, the floor a lane did apply is still reported:
5790
+ * "searched at this floor, found nothing" is the useful reading.
5791
+ *
5792
+ * Per-lane rather than one constant because the two defaults differ (0.1 fact
5793
+ * / 0.5 chunk), so a single seeded value reported a floor that a chunk-only
5794
+ * recall never applied. Reported next to the scores because the scores alone
5795
+ * cannot say what they cleared.
5796
+ */
5797
+ minScoreApplied: number;
5798
+ /**
5799
+ * Whether the `limit` cut an ELIGIBLE result — recorded at the cut, not
5800
+ * derived from `candidateCount > limit`. In the fused path `candidateCount`
5801
+ * counts before provenance suppression, so a recall whose suppressed chunks
5802
+ * brought it under the limit would otherwise report a truncation that never
5803
+ * happened.
5804
+ */
5805
+ truncated: boolean;
5806
+ /** Memory ids the W5 graph (entity) side lane contributed to the fusion. */
5807
+ graphLaneCount: number;
5808
+ /** Memory ids the W6 temporal side lane contributed to the fusion. */
5809
+ temporalLaneCount: number;
5810
+ /** Why nothing came back — see {@link RecallEmptyReason}. `""` when something did. */
5811
+ emptyReason: RecallEmptyReason;
5750
5812
  /** Wall-clock phase timings (ms). */
5751
5813
  timings: {
5752
5814
  /** Whole `recall()` call. */
@@ -10841,4 +10903,4 @@ declare function sanitizeQuotes(s: string): string;
10841
10903
  declare function renderTemplate(value: string | null | undefined, template: string): string | null;
10842
10904
  declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
10843
10905
 
10844
- 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 ConsolidationAction, 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 ExtractionFunnel, type ExtractionTimings, 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 };
10906
+ 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 ConsolidationAction, 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 ExtractionFunnel, type ExtractionTimings, 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 RecallEmptyReason, 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 };
@@ -141,7 +141,7 @@ import {
141
141
  updateVaultMemoryOp,
142
142
  upsertMessageOp,
143
143
  vaultMemoryToStored
144
- } from "./chunk-X5EZQFGR.mjs";
144
+ } from "./chunk-4DSDATYG.mjs";
145
145
  import {
146
146
  createStreamingDeAnonymizer,
147
147
  notifyConsolidationFallback,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  recall
3
- } from "./chunk-X5EZQFGR.mjs";
3
+ } from "./chunk-4DSDATYG.mjs";
4
4
  import "./chunk-YXL5VKCO.mjs";
5
5
  import "./chunk-3RPGXXPZ.mjs";
6
6
  export {
@@ -213,6 +213,23 @@ function createRecallDiagnosticsHandler(sink) {
213
213
  usedBudget: diagnostics.usedBudget,
214
214
  reranked: diagnostics.reranked,
215
215
  candidateCount: diagnostics.candidateCount,
216
+ // What the caller actually GOT. `candidateCount` is what was considered,
217
+ // and the two are routinely far apart — the fact lane pulls `limit * 2`
218
+ // when fusing — so a consumer reading candidateCount as "memories this
219
+ // turn received" overcounts.
220
+ admittedCount: diagnostics.admittedCount,
221
+ // Both ends of the admitted range, and the lane counts, ride the EVENT as
222
+ // well as the metrics: a track-only sink is a supported configuration
223
+ // (the module's own PostHog example is exactly that shape), and it could
224
+ // otherwise see neither the bottom of the score range nor which side lane
225
+ // contributed.
226
+ topScore: diagnostics.topScore,
227
+ lowestAdmittedScore: diagnostics.lowestAdmittedScore,
228
+ minScoreApplied: diagnostics.minScoreApplied,
229
+ truncated: diagnostics.truncated,
230
+ emptyReason: diagnostics.emptyReason,
231
+ graphLaneCount: diagnostics.graphLaneCount,
232
+ temporalLaneCount: diagnostics.temporalLaneCount,
216
233
  factCount: diagnostics.factCount,
217
234
  chunkCount: diagnostics.chunkCount,
218
235
  totalMs: diagnostics.timings.total,
@@ -226,8 +243,11 @@ function createRecallDiagnosticsHandler(sink) {
226
243
  metric("recall.duration", ms, { lane });
227
244
  }
228
245
  metric("recall.candidates", diagnostics.candidateCount, {});
246
+ metric("recall.admitted", diagnostics.admittedCount, {});
229
247
  metric("recall.facts", diagnostics.factCount, {});
230
248
  metric("recall.chunks", diagnostics.chunkCount, {});
249
+ metric("recall.lane.graph", diagnostics.graphLaneCount, {});
250
+ metric("recall.lane.temporal", diagnostics.temporalLaneCount, {});
231
251
  if (diagnostics.vaultSize !== void 0) {
232
252
  metric("recall.vault.size", diagnostics.vaultSize, {});
233
253
  }
@@ -422,7 +422,25 @@ type RecallDegradation =
422
422
  * failing back to the single-query path, or a row batch failing while other
423
423
  * rows keep usable vectors) — those are logged, not reported, so this stays a
424
424
  * reliable outage signal rather than a general embedding-error counter. */
425
- | "embeddings-unavailable";
425
+ | "embeddings-unavailable"
426
+ /** The W5 graph (entity) side lane threw and was dropped. Auxiliary, so recall
427
+ * still returned — but its RRF signal is missing from the ranking, and until
428
+ * this existed the drop was a log line and nothing else. */
429
+ | "graph-lane-failed"
430
+ /** The W6 temporal side lane threw and was dropped. Same posture as the graph
431
+ * lane: recall still returned, ranked without the temporal signal. */
432
+ | "temporal-lane-failed";
433
+ /**
434
+ * Why a recall returned nothing. `""` when it returned something, so the field
435
+ * is always present and groupable rather than being absent on the healthy path.
436
+ *
437
+ * The four are different problems: an empty query is a caller bug, no-lanes is a
438
+ * context wiring bug (the requested kinds have no store), vault-empty is a new
439
+ * user, and no-candidates is the only one that is about retrieval quality. They
440
+ * were previously indistinguishable from outside — every one reported
441
+ * `candidateCount: 0`.
442
+ */
443
+ type RecallEmptyReason = "" | "empty-query" | "no-lanes" | "vault-empty" | "no-candidates";
426
444
  /**
427
445
  * Per-call recall observability payload (see {@link RecallOptions.onDiagnostics}).
428
446
  * All timings are wall-clock milliseconds. Lane counts are post-dedupe,
@@ -473,6 +491,50 @@ interface RecallDiagnostics {
473
491
  factCount: number;
474
492
  /** Chunks the chunk lane returned (post-dedupe, pre-fusion). */
475
493
  chunkCount: number;
494
+ /**
495
+ * Memories actually RETURNED — `memories.length` after fusion, cross-lane
496
+ * dedup and the `limit` slice.
497
+ *
498
+ * `candidateCount` is what was considered; this is what the caller got, and
499
+ * the two are routinely far apart (the fact lane pulls `limit * 2` when fusing).
500
+ * Every consumer that wanted "how many memories did this turn actually get"
501
+ * was reading `candidateCount` and overcounting.
502
+ */
503
+ admittedCount: number;
504
+ /** Highest score among the returned memories; -1 when none were returned. */
505
+ topScore: number;
506
+ /** Lowest score among the returned memories; -1 when none were returned. */
507
+ lowestAdmittedScore: number;
508
+ /**
509
+ * The similarity floor the lane that produced these scores actually applied:
510
+ * the fact lane's when it RETURNED results, otherwise the chunk lane's, and
511
+ * **-1 when neither ran** (empty query, unwired context). Gated on results
512
+ * rather than on the lane running, because a fact lane that ran and came
513
+ * back empty filtered none of the scores in the payload — reporting its
514
+ * 0.1 default against chunks that cleared 0.5 corrupted the telemetry.
515
+ * When NOTHING was admitted, the floor a lane did apply is still reported:
516
+ * "searched at this floor, found nothing" is the useful reading.
517
+ *
518
+ * Per-lane rather than one constant because the two defaults differ (0.1 fact
519
+ * / 0.5 chunk), so a single seeded value reported a floor that a chunk-only
520
+ * recall never applied. Reported next to the scores because the scores alone
521
+ * cannot say what they cleared.
522
+ */
523
+ minScoreApplied: number;
524
+ /**
525
+ * Whether the `limit` cut an ELIGIBLE result — recorded at the cut, not
526
+ * derived from `candidateCount > limit`. In the fused path `candidateCount`
527
+ * counts before provenance suppression, so a recall whose suppressed chunks
528
+ * brought it under the limit would otherwise report a truncation that never
529
+ * happened.
530
+ */
531
+ truncated: boolean;
532
+ /** Memory ids the W5 graph (entity) side lane contributed to the fusion. */
533
+ graphLaneCount: number;
534
+ /** Memory ids the W6 temporal side lane contributed to the fusion. */
535
+ temporalLaneCount: number;
536
+ /** Why nothing came back — see {@link RecallEmptyReason}. `""` when something did. */
537
+ emptyReason: RecallEmptyReason;
476
538
  /** Wall-clock phase timings (ms). */
477
539
  timings: {
478
540
  /** Whole `recall()` call. */
@@ -422,7 +422,25 @@ type RecallDegradation =
422
422
  * failing back to the single-query path, or a row batch failing while other
423
423
  * rows keep usable vectors) — those are logged, not reported, so this stays a
424
424
  * reliable outage signal rather than a general embedding-error counter. */
425
- | "embeddings-unavailable";
425
+ | "embeddings-unavailable"
426
+ /** The W5 graph (entity) side lane threw and was dropped. Auxiliary, so recall
427
+ * still returned — but its RRF signal is missing from the ranking, and until
428
+ * this existed the drop was a log line and nothing else. */
429
+ | "graph-lane-failed"
430
+ /** The W6 temporal side lane threw and was dropped. Same posture as the graph
431
+ * lane: recall still returned, ranked without the temporal signal. */
432
+ | "temporal-lane-failed";
433
+ /**
434
+ * Why a recall returned nothing. `""` when it returned something, so the field
435
+ * is always present and groupable rather than being absent on the healthy path.
436
+ *
437
+ * The four are different problems: an empty query is a caller bug, no-lanes is a
438
+ * context wiring bug (the requested kinds have no store), vault-empty is a new
439
+ * user, and no-candidates is the only one that is about retrieval quality. They
440
+ * were previously indistinguishable from outside — every one reported
441
+ * `candidateCount: 0`.
442
+ */
443
+ type RecallEmptyReason = "" | "empty-query" | "no-lanes" | "vault-empty" | "no-candidates";
426
444
  /**
427
445
  * Per-call recall observability payload (see {@link RecallOptions.onDiagnostics}).
428
446
  * All timings are wall-clock milliseconds. Lane counts are post-dedupe,
@@ -473,6 +491,50 @@ interface RecallDiagnostics {
473
491
  factCount: number;
474
492
  /** Chunks the chunk lane returned (post-dedupe, pre-fusion). */
475
493
  chunkCount: number;
494
+ /**
495
+ * Memories actually RETURNED — `memories.length` after fusion, cross-lane
496
+ * dedup and the `limit` slice.
497
+ *
498
+ * `candidateCount` is what was considered; this is what the caller got, and
499
+ * the two are routinely far apart (the fact lane pulls `limit * 2` when fusing).
500
+ * Every consumer that wanted "how many memories did this turn actually get"
501
+ * was reading `candidateCount` and overcounting.
502
+ */
503
+ admittedCount: number;
504
+ /** Highest score among the returned memories; -1 when none were returned. */
505
+ topScore: number;
506
+ /** Lowest score among the returned memories; -1 when none were returned. */
507
+ lowestAdmittedScore: number;
508
+ /**
509
+ * The similarity floor the lane that produced these scores actually applied:
510
+ * the fact lane's when it RETURNED results, otherwise the chunk lane's, and
511
+ * **-1 when neither ran** (empty query, unwired context). Gated on results
512
+ * rather than on the lane running, because a fact lane that ran and came
513
+ * back empty filtered none of the scores in the payload — reporting its
514
+ * 0.1 default against chunks that cleared 0.5 corrupted the telemetry.
515
+ * When NOTHING was admitted, the floor a lane did apply is still reported:
516
+ * "searched at this floor, found nothing" is the useful reading.
517
+ *
518
+ * Per-lane rather than one constant because the two defaults differ (0.1 fact
519
+ * / 0.5 chunk), so a single seeded value reported a floor that a chunk-only
520
+ * recall never applied. Reported next to the scores because the scores alone
521
+ * cannot say what they cleared.
522
+ */
523
+ minScoreApplied: number;
524
+ /**
525
+ * Whether the `limit` cut an ELIGIBLE result — recorded at the cut, not
526
+ * derived from `candidateCount > limit`. In the fused path `candidateCount`
527
+ * counts before provenance suppression, so a recall whose suppressed chunks
528
+ * brought it under the limit would otherwise report a truncation that never
529
+ * happened.
530
+ */
531
+ truncated: boolean;
532
+ /** Memory ids the W5 graph (entity) side lane contributed to the fusion. */
533
+ graphLaneCount: number;
534
+ /** Memory ids the W6 temporal side lane contributed to the fusion. */
535
+ temporalLaneCount: number;
536
+ /** Why nothing came back — see {@link RecallEmptyReason}. `""` when something did. */
537
+ emptyReason: RecallEmptyReason;
476
538
  /** Wall-clock phase timings (ms). */
477
539
  timings: {
478
540
  /** Whole `recall()` call. */
@@ -185,6 +185,23 @@ function createRecallDiagnosticsHandler(sink) {
185
185
  usedBudget: diagnostics.usedBudget,
186
186
  reranked: diagnostics.reranked,
187
187
  candidateCount: diagnostics.candidateCount,
188
+ // What the caller actually GOT. `candidateCount` is what was considered,
189
+ // and the two are routinely far apart — the fact lane pulls `limit * 2`
190
+ // when fusing — so a consumer reading candidateCount as "memories this
191
+ // turn received" overcounts.
192
+ admittedCount: diagnostics.admittedCount,
193
+ // Both ends of the admitted range, and the lane counts, ride the EVENT as
194
+ // well as the metrics: a track-only sink is a supported configuration
195
+ // (the module's own PostHog example is exactly that shape), and it could
196
+ // otherwise see neither the bottom of the score range nor which side lane
197
+ // contributed.
198
+ topScore: diagnostics.topScore,
199
+ lowestAdmittedScore: diagnostics.lowestAdmittedScore,
200
+ minScoreApplied: diagnostics.minScoreApplied,
201
+ truncated: diagnostics.truncated,
202
+ emptyReason: diagnostics.emptyReason,
203
+ graphLaneCount: diagnostics.graphLaneCount,
204
+ temporalLaneCount: diagnostics.temporalLaneCount,
188
205
  factCount: diagnostics.factCount,
189
206
  chunkCount: diagnostics.chunkCount,
190
207
  totalMs: diagnostics.timings.total,
@@ -198,8 +215,11 @@ function createRecallDiagnosticsHandler(sink) {
198
215
  metric("recall.duration", ms, { lane });
199
216
  }
200
217
  metric("recall.candidates", diagnostics.candidateCount, {});
218
+ metric("recall.admitted", diagnostics.admittedCount, {});
201
219
  metric("recall.facts", diagnostics.factCount, {});
202
220
  metric("recall.chunks", diagnostics.chunkCount, {});
221
+ metric("recall.lane.graph", diagnostics.graphLaneCount, {});
222
+ metric("recall.lane.temporal", diagnostics.temporalLaneCount, {});
203
223
  if (diagnostics.vaultSize !== void 0) {
204
224
  metric("recall.vault.size", diagnostics.vaultSize, {});
205
225
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuma/sdk",
3
- "version": "6.20.0",
3
+ "version": "6.21.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",