@anuma/sdk 3.9.6 → 3.10.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.
@@ -4484,6 +4484,15 @@ declare class VaultMemory extends Model {
4484
4484
  archivedAt: number | null;
4485
4485
  /** Tier-0 security (PR3) — "quarantined" | "trusted" | null. */
4486
4486
  trustTier: string | null;
4487
+ /** People Nearby visibility: 'private' | 'public'. Null on legacy rows, and
4488
+ * any unrecognised value, read as 'private' — never published without opt-in. */
4489
+ visibility: string | null;
4490
+ /** Owner opted this memory into their own digital twin (twin-scoped only). */
4491
+ twinOptIn: boolean | null;
4492
+ /** Unix ms when visibility last became non-private; null while private. */
4493
+ publishedAt: number | null;
4494
+ /** Reserved coarse-geohash slot for landmark/Trail memories. */
4495
+ geohash: string | null;
4487
4496
  createdAt: Date;
4488
4497
  updatedAt: Date;
4489
4498
  isDeleted: boolean;
@@ -5653,6 +5662,20 @@ declare function extractAndRetain(messages: AutoExtractMessage[], retainCtx: Ret
5653
5662
  quarantined: QuarantinedMemoryInfo[];
5654
5663
  }>;
5655
5664
 
5665
+ /**
5666
+ * People Nearby cross-user visibility. ORTHOGONAL to `scope` (model access):
5667
+ * - `private`: local-only (default; null column grandfathered as private)
5668
+ * - `public`: embedding + plaintext may be published (compatibility matching,
5669
+ * profile display, discovery answers, digital-twin prompts)
5670
+ *
5671
+ * TWO TIERS ONLY (decided 2026-07-27). An earlier design had a middle
5672
+ * `matchable` tier that published a memory's embedding while keeping its text
5673
+ * on-device; it was dropped, so a memory either never leaves the device or is
5674
+ * published with its content. Any unrecognised stored value — including a
5675
+ * `matchable` row written by a pre-release build — reads as `private`, which is
5676
+ * the fail-safe direction: it un-publishes rather than exposes.
5677
+ */
5678
+ type VaultMemoryVisibility = "private" | "public";
5656
5679
  interface StoredVaultMemory {
5657
5680
  /** WatermelonDB internal ID */
5658
5681
  uniqueId: string;
@@ -5711,6 +5734,15 @@ interface StoredVaultMemory {
5711
5734
  archivedAt: number | null;
5712
5735
  /** Tier-0 security (PR3) — "quarantined" | "trusted" | null. */
5713
5736
  trustTier: string | null;
5737
+ /** People Nearby cross-user visibility. Null column reads as "private". */
5738
+ visibility: VaultMemoryVisibility;
5739
+ /** Owner opted this memory into their own digital twin even when otherwise
5740
+ * private (twin-scoped only — never indexed for matching, never displayed). */
5741
+ twinOptIn: boolean;
5742
+ /** Unix ms when visibility last became non-private; null while private. */
5743
+ publishedAt: number | null;
5744
+ /** Reserved coarse-geohash slot for landmark/Trail memories. */
5745
+ geohash: string | null;
5714
5746
  createdAt: Date;
5715
5747
  updatedAt: Date;
5716
5748
  isDeleted: boolean;
@@ -5747,6 +5779,15 @@ interface CreateVaultMemoryOptions {
5747
5779
  /** Tier-0 security (PR3) — set "quarantined" when the injection screen
5748
5780
  * flagged this fact. Omit for the default (null/trusted). */
5749
5781
  trustTier?: string;
5782
+ /** People Nearby cross-user visibility. Defaults to "private" if omitted —
5783
+ * creation NEVER publishes; use {@link setMemoryVisibilityOp} so the
5784
+ * published_at bookkeeping stays consistent. Accepted here only so bulk
5785
+ * restore/import paths can round-trip an existing visibility. */
5786
+ visibility?: VaultMemoryVisibility;
5787
+ /** Round-trip slot for restore/import; see {@link visibility}. */
5788
+ publishedAt?: number | null;
5789
+ /** Coarse geohash for location-tagged memory sources (landmarks/Trail). */
5790
+ geohash?: string;
5750
5791
  }
5751
5792
  interface UpdateVaultMemoryOptions {
5752
5793
  content: string;
@@ -5869,11 +5910,35 @@ declare function getAllVaultMemoriesOp(ctx: VaultMemoryOperationsContext, option
5869
5910
  * Used by a "memory history" view to render retired facts.
5870
5911
  */
5871
5912
  includeSuperseded?: boolean;
5913
+ /**
5914
+ * Filter by People Nearby visibility. Legacy rows with a NULL column
5915
+ * count as "private". Used by the publish reconciler to fetch the
5916
+ * published set to diff against the server index.
5917
+ */
5918
+ visibility?: VaultMemoryVisibility[];
5872
5919
  }): Promise<StoredVaultMemory[]>;
5873
5920
  declare function getAllVaultMemoryContentsOp(ctx: VaultMemoryOperationsContext, options?: {
5874
5921
  since?: Date;
5875
5922
  }): Promise<string[]>;
5876
5923
  declare function updateVaultMemoryOp(ctx: VaultMemoryOperationsContext, id: string, opts: UpdateVaultMemoryOptions): Promise<StoredVaultMemory | null>;
5924
+ /**
5925
+ * Set a memory's People Nearby visibility (and optionally its twin opt-in).
5926
+ *
5927
+ * This is the ONLY sanctioned write path for `visibility` — it keeps the
5928
+ * `published_at` bookkeeping consistent: transitioning to `public`
5929
+ * stamps `published_at` (kept if already set); transitioning to `private`
5930
+ * clears it (revoke). The server index remains the authority for what IS
5931
+ * published — this records the user's intent for the reconciler to act on.
5932
+ *
5933
+ * Preserves `updated_at`: a visibility change is metadata, not a
5934
+ * re-observation, so it must not inflate the recency multiplier (mirrors
5935
+ * {@link setMemoryEntitiesOp}).
5936
+ */
5937
+ declare function setMemoryVisibilityOp(ctx: VaultMemoryOperationsContext, id: string, opts: {
5938
+ visibility: VaultMemoryVisibility;
5939
+ /** If provided, sets the twin opt-in flag alongside the visibility. */
5940
+ twinOptIn?: boolean;
5941
+ }): Promise<StoredVaultMemory | null>;
5877
5942
  declare function deleteVaultMemoryOp(ctx: VaultMemoryOperationsContext, id: string): Promise<boolean>;
5878
5943
  /**
5879
5944
  * Mark a memory as superseded by a newer one (A2 write-time supersession).
@@ -6434,6 +6499,21 @@ interface CreateAutoExtractorOptions {
6434
6499
  */
6435
6500
  onFallback?: (reason: ConsolidationFallbackReason) => void;
6436
6501
  };
6502
+ /**
6503
+ * Tier-0 security (PR5) — enable the optional SECOND-layer LLM injection
6504
+ * classifier over the candidates the deterministic screen passed as clean.
6505
+ * Presence is the switch, so `injectionClassifier: {}` is how a client turns
6506
+ * it on. Auth is NOT configured here — like `consolidate`, the call reuses
6507
+ * the `extract` credentials and defaults to its `baseUrl`. See
6508
+ * `injectionClassifier.ts` for the safety posture and the defaults.
6509
+ */
6510
+ injectionClassifier?: {
6511
+ /** Portal base URL for classifier calls. Default: the `extract` options' `baseUrl`. */
6512
+ baseUrl?: string;
6513
+ model?: string;
6514
+ maxCandidates?: number;
6515
+ totalTimeoutMs?: number;
6516
+ };
6437
6517
  /** Per-fact event — fires once per memory written. */
6438
6518
  onMemoryExtracted?: (event: MemoryExtractedEvent) => void;
6439
6519
  /**
@@ -8319,8 +8399,13 @@ declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageR
8319
8399
  * backfill (null = legacy/untyped, active, un-screened — content is
8320
8400
  * encrypted so in-migration classification is impossible; NULL = zero-risk,
8321
8401
  * exact embedding_model precedent)
8402
+ * - v41: Added visibility, twin_opt_in, published_at, geohash columns to
8403
+ * memory_vault for the People Nearby cross-user visibility axis. Visibility
8404
+ * is TWO-tier (`private | public`); null — and any unrecognised value —
8405
+ * reads as 'private', so nothing pre-existing is ever published without an
8406
+ * explicit visibility write
8322
8407
  */
8323
- declare const SDK_SCHEMA_VERSION = 40;
8408
+ declare const SDK_SCHEMA_VERSION = 41;
8324
8409
  /**
8325
8410
  * Combined WatermelonDB schema for all SDK storage modules.
8326
8411
  *
@@ -8405,6 +8490,7 @@ declare const sdkSchema: Readonly<{
8405
8490
  * - v37 → v38: Added `topics_extracted_version` column to memory_vault (extraction-logic version; null read as 0 so a TOPICS_EXTRACTION_VERSION bump re-extracts stale rows)
8406
8491
  * - v38 → v39: Added `last_observed_at` column to memory_vault (C3 re-observation watermark; stamped on retain merge, distinct from updated_at)
8407
8492
  * - v39 → v40: Added `fact_type`, `archived_at`, `trust_tier` columns to memory_vault for typed memory + decay + Tier-0 security (all nullable + plaintext, NULL backfill)
8493
+ * - v40 → v41: Added `visibility`, `twin_opt_in`, `published_at`, `geohash` columns to memory_vault for the People Nearby cross-user visibility axis (two-tier `private | public`; null/unknown grandfathered as 'private')
8408
8494
  */
8409
8495
  declare const sdkMigrations: Readonly<{
8410
8496
  validated: true;
@@ -8926,4 +9012,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
8926
9012
  */
8927
9013
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
8928
9014
 
8929
- export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, 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, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, 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 RedactionResult, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hardDeleteDecayedOp, hasEncryptionKey, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshNotionAccessToken, registerNotionClient, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, setLogger, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
9015
+ export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, 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, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, 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 RedactionResult, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hardDeleteDecayedOp, hasEncryptionKey, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshNotionAccessToken, registerNotionClient, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, setLogger, setMemoryVisibilityOp, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
@@ -94,6 +94,7 @@ import {
94
94
  restoreVaultMemoryOp,
95
95
  searchChunksOp,
96
96
  searchVaultMemories,
97
+ setMemoryVisibilityOp,
97
98
  shouldChunkMessage,
98
99
  stampTopicsExtractedAtOp,
99
100
  stripToolCalls,
@@ -110,7 +111,7 @@ import {
110
111
  upsertMessageOp,
111
112
  useEncryption,
112
113
  vaultMemoryToStored
113
- } from "./chunk-FFB4CDPC.mjs";
114
+ } from "./chunk-CFGUZHAY.mjs";
114
115
  import {
115
116
  PII_PATTERNS,
116
117
  PiiRedactor,
@@ -5579,6 +5580,18 @@ __decorateClass([
5579
5580
  __decorateClass([
5580
5581
  field3("trust_tier")
5581
5582
  ], VaultMemory.prototype, "trustTier", 2);
5583
+ __decorateClass([
5584
+ field3("visibility")
5585
+ ], VaultMemory.prototype, "visibility", 2);
5586
+ __decorateClass([
5587
+ field3("twin_opt_in")
5588
+ ], VaultMemory.prototype, "twinOptIn", 2);
5589
+ __decorateClass([
5590
+ field3("published_at")
5591
+ ], VaultMemory.prototype, "publishedAt", 2);
5592
+ __decorateClass([
5593
+ field3("geohash")
5594
+ ], VaultMemory.prototype, "geohash", 2);
5582
5595
  __decorateClass([
5583
5596
  readonly2,
5584
5597
  date3("created_at")
@@ -7170,18 +7183,16 @@ function createAutoExtractor(options) {
7170
7183
  } catch {
7171
7184
  }
7172
7185
  };
7173
- const consolidateBaseUrl = options.consolidate?.baseUrl ?? options.extract.baseUrl;
7174
- const consolidateOptions = options.consolidate ? {
7175
- ...options.extract.apiKey !== void 0 && { apiKey: options.extract.apiKey },
7176
- ...options.extract.getToken !== void 0 && { getToken: options.extract.getToken },
7177
- ...consolidateBaseUrl !== void 0 && { baseUrl: consolidateBaseUrl },
7178
- ...options.consolidate.model !== void 0 && { model: options.consolidate.model },
7179
- ...options.consolidate.onFallback !== void 0 && {
7180
- onFallback: options.consolidate.onFallback
7181
- }
7182
- // PII redaction is inherited from `extract.piiRedaction` inside
7183
- // extractAndRetain (so direct callers are covered too), not copied here.
7184
- } : void 0;
7186
+ const subPassAuth = (baseUrlOverride) => {
7187
+ const baseUrl = baseUrlOverride ?? options.extract.baseUrl;
7188
+ return {
7189
+ ...options.extract.apiKey !== void 0 && { apiKey: options.extract.apiKey },
7190
+ ...options.extract.getToken !== void 0 && { getToken: options.extract.getToken },
7191
+ ...baseUrl !== void 0 && { baseUrl }
7192
+ };
7193
+ };
7194
+ const consolidateOptions = options.consolidate ? { ...options.consolidate, ...subPassAuth(options.consolidate.baseUrl) } : void 0;
7195
+ const injectionClassifierOptions = options.injectionClassifier ? { ...options.injectionClassifier, ...subPassAuth(options.injectionClassifier.baseUrl) } : void 0;
7185
7196
  if (options.retainCtx.vaultCtx.entityCtx && !options.entityCtx) {
7186
7197
  getLogger().warn(
7187
7198
  "[memory/extract] retainCtx.vaultCtx.entityCtx is set but extractor was created without `entityCtx` \u2014 W5 graph lane will receive no writes"
@@ -7235,6 +7246,9 @@ function createAutoExtractor(options) {
7235
7246
  ...options.scope !== void 0 && { scope: options.scope },
7236
7247
  ...options.folderId !== void 0 && { folderId: options.folderId },
7237
7248
  ...consolidateOptions !== void 0 && { consolidateOptions },
7249
+ ...injectionClassifierOptions !== void 0 && {
7250
+ injectionClassifier: injectionClassifierOptions
7251
+ },
7238
7252
  ...options.onCandidateFailed && {
7239
7253
  onCandidateFailed: (candidate, error) => options.onCandidateFailed?.({ candidate, error, conversationId })
7240
7254
  },
@@ -11677,7 +11691,7 @@ __decorateClass([
11677
11691
  ], VaultFolder.prototype, "context", 2);
11678
11692
 
11679
11693
  // src/lib/db/schema.ts
11680
- var SDK_SCHEMA_VERSION = 40;
11694
+ var SDK_SCHEMA_VERSION = 41;
11681
11695
  var sdkSchema = appSchema2({
11682
11696
  version: SDK_SCHEMA_VERSION,
11683
11697
  tables: [
@@ -11836,7 +11850,26 @@ var sdkSchema = appSchema2({
11836
11850
  // Tier-0 security (PR3) — "quarantined" when the write-time injection
11837
11851
  // screen flagged this fact, else null/"trusted". Indexed so the recall
11838
11852
  // choke point can default-exclude quarantined rows.
11839
- { name: "trust_tier", type: "string", isOptional: true, isIndexed: true }
11853
+ { name: "trust_tier", type: "string", isOptional: true, isIndexed: true },
11854
+ // People Nearby cross-user visibility axis — ORTHOGONAL to `scope`
11855
+ // (which partitions by MODEL access: private vs shared providers).
11856
+ // TWO tiers: 'private' (or null, or any unrecognised value —
11857
+ // grandfathered / fail-safe) = local-only; 'public' = embedding +
11858
+ // plaintext may be published (matching/profile/discovery/twin).
11859
+ // The server index is the authority for what IS published; this
11860
+ // column records the user's intent.
11861
+ { name: "visibility", type: "string", isOptional: true, isIndexed: true },
11862
+ // When true, the owner opted this memory into their own digital twin
11863
+ // even if it is otherwise private (twin-scoped upload only — never
11864
+ // indexed for matching, never displayed). Null/false = follows visibility.
11865
+ { name: "twin_opt_in", type: "boolean", isOptional: true },
11866
+ // Unix ms when visibility last became non-private. Null when private
11867
+ // (cleared on revoke) — the publish reconciler uses it to diff local
11868
+ // intent against the server index.
11869
+ { name: "published_at", type: "number", isOptional: true },
11870
+ // Reserved geo slot (coarse geohash) for landmark/Trail memories.
11871
+ // Unused at launch; populated by location-tagged memory sources.
11872
+ { name: "geohash", type: "string", isOptional: true }
11840
11873
  ]
11841
11874
  }),
11842
11875
  // Entity table — canonical names extracted from auto-extraction (W5).
@@ -12511,6 +12544,24 @@ var sdkMigrations = schemaMigrations2({
12511
12544
  ]
12512
12545
  })
12513
12546
  ]
12547
+ },
12548
+ // v40 -> v41: People Nearby visibility axis on memory_vault. Existing rows
12549
+ // keep visibility NULL — read as 'private' (nothing pre-existing is ever
12550
+ // published without an explicit user action; the consent posture requires
12551
+ // opt-in, never a retroactive default).
12552
+ {
12553
+ toVersion: 41,
12554
+ steps: [
12555
+ addColumns2({
12556
+ table: "memory_vault",
12557
+ columns: [
12558
+ { name: "visibility", type: "string", isOptional: true, isIndexed: true },
12559
+ { name: "twin_opt_in", type: "boolean", isOptional: true },
12560
+ { name: "published_at", type: "number", isOptional: true },
12561
+ { name: "geohash", type: "string", isOptional: true }
12562
+ ]
12563
+ })
12564
+ ]
12514
12565
  }
12515
12566
  ]
12516
12567
  });
@@ -14000,6 +14051,7 @@ export {
14000
14051
  sdkSchema,
14001
14052
  searchVaultMemories,
14002
14053
  setLogger,
14054
+ setMemoryVisibilityOp,
14003
14055
  shouldChunkMessage,
14004
14056
  stampTopicsExtractedAtOp,
14005
14057
  streamCancelPath,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  recall
3
- } from "./chunk-FFB4CDPC.mjs";
3
+ } from "./chunk-CFGUZHAY.mjs";
4
4
  import "./chunk-BOY27A2C.mjs";
5
5
  import "./chunk-GYKJOWEO.mjs";
6
6
  export {
@@ -2187,6 +2187,19 @@ async function decryptVaultMemoryFields(memory, address, signMessage, embeddedWa
2187
2187
  }
2188
2188
 
2189
2189
  // src/lib/db/memoryVault/operations.ts
2190
+ function visibilityOrPrivate(value) {
2191
+ return value === "public" ? value : "private";
2192
+ }
2193
+ var NON_PRIVATE_VISIBILITIES = ["public"];
2194
+ function visibilityConditions(requested) {
2195
+ if (!requested?.length) return [];
2196
+ if (!requested.includes("private")) {
2197
+ return [Q3.where("visibility", Q3.oneOf([...requested]))];
2198
+ }
2199
+ const excluded = NON_PRIVATE_VISIBILITIES.filter((v) => !requested.includes(v));
2200
+ if (excluded.length === 0) return [];
2201
+ return [Q3.or(Q3.where("visibility", null), Q3.where("visibility", Q3.notIn(excluded)))];
2202
+ }
2190
2203
  function isOwnedByCtxUser(ctx, record) {
2191
2204
  return ctx.userId === void 0 || record.userId === ctx.userId;
2192
2205
  }
@@ -2248,6 +2261,10 @@ function vaultMemoryToStoredRaw(memory) {
2248
2261
  factType: memory.factType ?? null,
2249
2262
  archivedAt: memory.archivedAt ?? null,
2250
2263
  trustTier: memory.trustTier ?? null,
2264
+ visibility: visibilityOrPrivate(memory.visibility),
2265
+ twinOptIn: memory.twinOptIn ?? false,
2266
+ publishedAt: memory.publishedAt ?? null,
2267
+ geohash: memory.geohash ?? null,
2251
2268
  createdAt: memory.createdAt,
2252
2269
  updatedAt: memory.updatedAt,
2253
2270
  isDeleted: memory.isDeleted
@@ -2295,6 +2312,14 @@ async function createVaultMemoryOp(ctx, opts) {
2295
2312
  if (opts.trustTier !== void 0) {
2296
2313
  record._setRaw("trust_tier", normalizeTrustTier(opts.trustTier));
2297
2314
  }
2315
+ record._setRaw("visibility", opts.visibility ?? "private");
2316
+ record._setRaw(
2317
+ "published_at",
2318
+ opts.visibility && opts.visibility !== "private" ? opts.publishedAt ?? Date.now() : null
2319
+ );
2320
+ if (opts.geohash !== void 0) {
2321
+ record._setRaw("geohash", opts.geohash);
2322
+ }
2298
2323
  });
2299
2324
  });
2300
2325
  return vaultMemoryToStored(created, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner);
@@ -2441,6 +2466,14 @@ async function createVaultMemoriesBatchOp(ctx, optionsArray) {
2441
2466
  if (opts.trustTier !== void 0) {
2442
2467
  record._setRaw("trust_tier", normalizeTrustTier(opts.trustTier));
2443
2468
  }
2469
+ record._setRaw("visibility", opts.visibility ?? "private");
2470
+ record._setRaw(
2471
+ "published_at",
2472
+ opts.visibility && opts.visibility !== "private" ? opts.publishedAt ?? Date.now() : null
2473
+ );
2474
+ if (opts.geohash !== void 0) {
2475
+ record._setRaw("geohash", opts.geohash);
2476
+ }
2444
2477
  })
2445
2478
  );
2446
2479
  await ctx.database.batch(...prepared);
@@ -2504,6 +2537,10 @@ function vaultMemoryRawToStoredRaw(raw) {
2504
2537
  factType: raw.fact_type ?? null,
2505
2538
  archivedAt: raw.archived_at ?? null,
2506
2539
  trustTier: raw.trust_tier ?? null,
2540
+ visibility: visibilityOrPrivate(raw.visibility),
2541
+ twinOptIn: raw.twin_opt_in === true || raw.twin_opt_in === 1,
2542
+ publishedAt: raw.published_at ?? null,
2543
+ geohash: raw.geohash ?? null,
2507
2544
  createdAt: new Date(raw.created_at),
2508
2545
  updatedAt: new Date(raw.updated_at),
2509
2546
  isDeleted: raw.is_deleted === true || raw.is_deleted === 1
@@ -2520,6 +2557,7 @@ async function getAllVaultMemoriesOp(ctx, options) {
2520
2557
  const conditions = [
2521
2558
  ...baseVaultConditions(ctx, options),
2522
2559
  ...options?.scopes?.length ? [Q3.where("scope", Q3.oneOf(options.scopes))] : [],
2560
+ ...visibilityConditions(options?.visibility),
2523
2561
  ...options?.folderId !== void 0 ? [Q3.where("folder_id", options.folderId)] : [],
2524
2562
  ...options?.factTypes?.length ? [Q3.where("fact_type", Q3.oneOf(options.factTypes))] : [],
2525
2563
  Q3.sortBy(options?.since ? "updated_at" : "created_at", Q3.desc),
@@ -2813,6 +2851,38 @@ async function clearMemoryTopicsOverrideOp(ctx, memoryId) {
2813
2851
  });
2814
2852
  return true;
2815
2853
  }
2854
+ async function setMemoryVisibilityOp(ctx, id, opts) {
2855
+ let record;
2856
+ try {
2857
+ record = await ctx.vaultMemoryCollection.find(id);
2858
+ } catch {
2859
+ return null;
2860
+ }
2861
+ if (record.isDeleted || !isOwnedByCtxUser(ctx, record)) return null;
2862
+ let stale = false;
2863
+ await ctx.database.write(async () => {
2864
+ if (record.isDeleted || !isOwnedByCtxUser(ctx, record)) {
2865
+ stale = true;
2866
+ return;
2867
+ }
2868
+ const currentUpdatedAt = record.updatedAt.getTime();
2869
+ const currentPublishedAt = record.publishedAt ?? null;
2870
+ await record.update((r) => {
2871
+ r._setRaw("visibility", opts.visibility);
2872
+ if (opts.visibility === "private") {
2873
+ r._setRaw("published_at", null);
2874
+ } else if (currentPublishedAt === null) {
2875
+ r._setRaw("published_at", Date.now());
2876
+ }
2877
+ if (opts.twinOptIn !== void 0) {
2878
+ r._setRaw("twin_opt_in", opts.twinOptIn);
2879
+ }
2880
+ r._setRaw("updated_at", currentUpdatedAt);
2881
+ });
2882
+ });
2883
+ if (stale) return null;
2884
+ return vaultMemoryToStored(record, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner);
2885
+ }
2816
2886
  async function deleteVaultMemoryOp(ctx, id) {
2817
2887
  try {
2818
2888
  const record = await ctx.vaultMemoryCollection.find(id);
@@ -5959,7 +6029,7 @@ function createMemoryVaultSearchTool(vaultCtx, embeddingOptions, cache, searchOp
5959
6029
  legacy.map((r) => ({ id: r.uniqueId, content: r.content, score: r.similarity }))
5960
6030
  );
5961
6031
  }
5962
- const { recall: recall2 } = await import("./recall-ELUJPQQB.mjs");
6032
+ const { recall: recall2 } = await import("./recall-GCW2EV4V.mjs");
5963
6033
  const result = await recall2(
5964
6034
  query,
5965
6035
  { vaultCtx, embeddingOptions, vaultCache: cache },
@@ -6986,6 +7056,7 @@ export {
6986
7056
  updateVaultMemoryOp,
6987
7057
  setMemoryEntitiesOp,
6988
7058
  clearMemoryTopicsOverrideOp,
7059
+ setMemoryVisibilityOp,
6989
7060
  deleteVaultMemoryOp,
6990
7061
  supersedeVaultMemoryOp,
6991
7062
  getUnfiledVaultMemoriesOp,