@anuma/sdk 4.2.0 → 4.2.1
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-VBO6KSNQ.mjs → chunk-3CDSIN22.mjs} +304 -49
- package/dist/expo/index.cjs +307 -49
- package/dist/expo/index.d.mts +92 -7
- package/dist/expo/index.d.ts +92 -7
- package/dist/expo/index.mjs +7 -1
- package/dist/expo/{recall-OCQOA7M3.mjs → recall-NARBDQAK.mjs} +1 -1
- package/dist/index.cjs +31 -17
- package/dist/index.mjs +31 -17
- package/dist/react/{chunk-BS7C4CUW.mjs → chunk-CUJDSH55.mjs} +304 -49
- package/dist/react/index.cjs +307 -49
- package/dist/react/index.d.mts +86 -7
- package/dist/react/index.d.ts +86 -7
- package/dist/react/index.mjs +7 -1
- package/dist/react/{recall-WXCZHXHZ.mjs → recall-FPPCKYYH.mjs} +1 -1
- package/dist/server/{chunk-WADHFDMA.mjs → chunk-UQDYBQVF.mjs} +304 -49
- package/dist/server/index.cjs +307 -49
- package/dist/server/index.d.mts +85 -6
- package/dist/server/index.d.ts +85 -6
- package/dist/server/index.mjs +7 -1
- package/dist/server/{recall-QTVT7HCZ.mjs → recall-ZHEPQNEU.mjs} +1 -1
- package/package.json +1 -1
package/dist/expo/index.d.mts
CHANGED
|
@@ -3506,6 +3506,15 @@ interface StoredMessage {
|
|
|
3506
3506
|
feedback?: MessageFeedback;
|
|
3507
3507
|
/** Tool call events from the backend response (for reconstructing tool call history) */
|
|
3508
3508
|
toolCallEvents?: LlmapiToolCallEvent[];
|
|
3509
|
+
/**
|
|
3510
|
+
* Set when `content` could not be decrypted on read (#561).
|
|
3511
|
+
* The `content` field still holds the original ciphertext — never a
|
|
3512
|
+
* `[Decryption Failed]` placeholder — so a later unlock can recover.
|
|
3513
|
+
* - `key_missing`: no key for this field's `enc:vN:` version in the store
|
|
3514
|
+
* - `auth_mismatch`: a key was present but AES-GCM auth failed (wrong key)
|
|
3515
|
+
* - `invalid_payload`: malformed ciphertext envelope
|
|
3516
|
+
*/
|
|
3517
|
+
decryptionStatus?: "key_missing" | "auth_mismatch" | "invalid_payload";
|
|
3509
3518
|
}
|
|
3510
3519
|
interface ActivityPhase {
|
|
3511
3520
|
id: string;
|
|
@@ -4141,6 +4150,35 @@ declare class Conversation extends Model {
|
|
|
4141
4150
|
pinnedAt?: Date | null;
|
|
4142
4151
|
}
|
|
4143
4152
|
|
|
4153
|
+
/**
|
|
4154
|
+
* Encryption key version type.
|
|
4155
|
+
* - "v2": Legacy SHA-256 derived key (for reading enc:v2: data)
|
|
4156
|
+
* - "v3": HKDF derived key with domain separation (for new encryption)
|
|
4157
|
+
*/
|
|
4158
|
+
type EncryptionKeyVersion = "v2" | "v3";
|
|
4159
|
+
/**
|
|
4160
|
+
* Thrown by {@link getEncryptionKey} when the requested version is absent.
|
|
4161
|
+
* Distinct from AES-GCM auth-tag failures so decrypt callers can tell
|
|
4162
|
+
* "need to derive/hydrate this version" from "wrong key for intact ciphertext".
|
|
4163
|
+
*/
|
|
4164
|
+
declare class EncryptionKeyMissingError extends Error {
|
|
4165
|
+
readonly address: string;
|
|
4166
|
+
readonly version: EncryptionKeyVersion;
|
|
4167
|
+
constructor(address: string, version: EncryptionKeyVersion);
|
|
4168
|
+
}
|
|
4169
|
+
/**
|
|
4170
|
+
* Options for {@link requestEncryptionKey}.
|
|
4171
|
+
*/
|
|
4172
|
+
interface RequestEncryptionKeyOptions {
|
|
4173
|
+
/**
|
|
4174
|
+
* When true, re-derive and replace any existing in-memory keys for this
|
|
4175
|
+
* address. Default false preserves the historical "if present, return"
|
|
4176
|
+
* short-circuit. Prefer {@link refreshEncryptionKeyIfMatches} when the
|
|
4177
|
+
* caller has ciphertext that must keep working — force-replace can pin a
|
|
4178
|
+
* newly derived wrong key over a still-valid one.
|
|
4179
|
+
*/
|
|
4180
|
+
force?: boolean;
|
|
4181
|
+
}
|
|
4144
4182
|
/**
|
|
4145
4183
|
* Register a callback that fires when an encryption key becomes available for an address.
|
|
4146
4184
|
* If the key is already available, the callback fires immediately.
|
|
@@ -4186,9 +4224,30 @@ declare function clearAllEncryptionState(): void;
|
|
|
4186
4224
|
*/
|
|
4187
4225
|
declare function clearAllEncryptionKeys(): void;
|
|
4188
4226
|
/**
|
|
4189
|
-
* Checks if an encryption key exists in memory for the given wallet address
|
|
4227
|
+
* Checks if an encryption key exists in memory for the given wallet address.
|
|
4228
|
+
*
|
|
4229
|
+
* @param address - Wallet address
|
|
4230
|
+
* @param version - When omitted, checks the **v3** (`current`) key — the key
|
|
4231
|
+
* write/OPFS/encrypt paths need. Callers that only need to read legacy
|
|
4232
|
+
* `enc:v2:` data should pass `"v2"` explicitly. (#561 / PR #828)
|
|
4233
|
+
*/
|
|
4234
|
+
declare function hasEncryptionKey(address: string, version?: EncryptionKeyVersion): boolean;
|
|
4235
|
+
/**
|
|
4236
|
+
* Seed (or merge) raw key hex into the in-memory store without signing.
|
|
4237
|
+
*
|
|
4238
|
+
* Used by platform polyfills that hydrate from SecureStore / keychain where
|
|
4239
|
+
* one version may be missing — callers must not require both versions to
|
|
4240
|
+
* exist before the other becomes usable (#561).
|
|
4241
|
+
*
|
|
4242
|
+
* Existing versions are preserved when the corresponding argument is omitted.
|
|
4243
|
+
* Pass an explicit empty merge is not supported; omit the field to leave it.
|
|
4244
|
+
*
|
|
4245
|
+
* Each provided key must be 64 hex characters (32-byte AES key).
|
|
4190
4246
|
*/
|
|
4191
|
-
declare function
|
|
4247
|
+
declare function seedEncryptionKeys(address: string, keys: {
|
|
4248
|
+
legacy?: string;
|
|
4249
|
+
current?: string;
|
|
4250
|
+
}): void;
|
|
4192
4251
|
/**
|
|
4193
4252
|
* Options for signing messages.
|
|
4194
4253
|
*/
|
|
@@ -4209,24 +4268,50 @@ type SignMessageFn = (message: string, options?: SignMessageOptions) => Promise<
|
|
|
4209
4268
|
type EmbeddedWalletSignerFn = (message: string, options?: SignMessageOptions) => Promise<string>;
|
|
4210
4269
|
/**
|
|
4211
4270
|
* Requests the user to sign a message to generate an encryption key.
|
|
4212
|
-
* If a key already exists in memory for the given wallet, resolves immediately
|
|
4271
|
+
* If a key already exists in memory for the given wallet, resolves immediately
|
|
4272
|
+
* unless {@link RequestEncryptionKeyOptions.force} is set.
|
|
4213
4273
|
*
|
|
4214
4274
|
* Note: Keys are stored in memory only and do not persist across page reloads.
|
|
4215
4275
|
* This is a security feature - users must sign once per session to derive their key.
|
|
4216
4276
|
*
|
|
4277
|
+
* When a seeded/pinned store already has keys and the fresh derive does not
|
|
4278
|
+
* match any of them, the store is left unchanged and this resolves to `false`
|
|
4279
|
+
* (without firing {@link onKeyAvailable}). Callers that need write readiness
|
|
4280
|
+
* should check the return value or {@link hasEncryptionKey} before encrypting
|
|
4281
|
+
* so they can surface a re-unlock UI instead of failing downstream (#828).
|
|
4282
|
+
*
|
|
4217
4283
|
* @param walletAddress - The wallet address to generate the key for
|
|
4218
4284
|
* @param signMessage - Function to sign a message (returns signature hex string)
|
|
4219
4285
|
* @param embeddedWalletSigner - Optional function for silent signing with embedded wallets
|
|
4220
|
-
* @
|
|
4286
|
+
* @param options - Optional flags (e.g. force re-derive)
|
|
4287
|
+
* @returns `true` when keys are available after the call; `false` when a
|
|
4288
|
+
* divergent derive left the store unchanged (or the session was torn down
|
|
4289
|
+
* mid-flight).
|
|
4290
|
+
*/
|
|
4291
|
+
declare function requestEncryptionKey(walletAddress: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn, options?: RequestEncryptionKeyOptions): Promise<boolean>;
|
|
4292
|
+
/**
|
|
4293
|
+
* Re-derive encryption keys from a fresh signature and commit them **only if**
|
|
4294
|
+
* they successfully decrypt `probeCiphertext` (a prefixed `enc:v2:` / `enc:v3:`
|
|
4295
|
+
* value). If they do not, the existing in-memory keys are left untouched.
|
|
4296
|
+
*
|
|
4297
|
+
* Concurrent calls for the same wallet share one sign+derive. Each caller then
|
|
4298
|
+
* probes **its own** ciphertext against those candidates, so mixed-era messages
|
|
4299
|
+
* in one `Promise.all` batch can still recover when only the leader's probe
|
|
4300
|
+
* misses (#828 review). Failed candidates are memoized for the session so
|
|
4301
|
+
* pagination does not re-prompt on every page when the wallet has changed.
|
|
4302
|
+
*
|
|
4303
|
+
* @returns true when keys were refreshed (probe decrypted); false when the
|
|
4304
|
+
* probe failed under the candidate keys (store unchanged) or the probe was
|
|
4305
|
+
* not encrypted.
|
|
4221
4306
|
*/
|
|
4222
|
-
declare function
|
|
4307
|
+
declare function refreshEncryptionKeyIfMatches(walletAddress: string, probeCiphertext: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn): Promise<boolean>;
|
|
4223
4308
|
/**
|
|
4224
4309
|
* Result returned by the useEncryption hook.
|
|
4225
4310
|
* @category Hooks
|
|
4226
4311
|
*/
|
|
4227
4312
|
interface UseEncryptionResult {
|
|
4228
4313
|
/** Request and generate an encryption key for a wallet address */
|
|
4229
|
-
requestEncryptionKey: (walletAddress: string) => Promise<
|
|
4314
|
+
requestEncryptionKey: (walletAddress: string) => Promise<boolean>;
|
|
4230
4315
|
/** Request and generate an ECDH key pair for a wallet address */
|
|
4231
4316
|
requestKeyPair: (walletAddress: string) => Promise<void>;
|
|
4232
4317
|
/** Export the public key for a wallet address as base64-encoded SPKI */
|
|
@@ -9253,4 +9338,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
|
|
|
9253
9338
|
*/
|
|
9254
9339
|
declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
|
|
9255
9340
|
|
|
9256
|
-
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, backfillMemoryTopicsOp, 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, relinkMemoryTopicsOp, 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 };
|
|
9341
|
+
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, EncryptionKeyMissingError, 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, type RequestEncryptionKeyOptions, 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, backfillMemoryTopicsOp, 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, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
|
package/dist/expo/index.d.ts
CHANGED
|
@@ -3506,6 +3506,15 @@ interface StoredMessage {
|
|
|
3506
3506
|
feedback?: MessageFeedback;
|
|
3507
3507
|
/** Tool call events from the backend response (for reconstructing tool call history) */
|
|
3508
3508
|
toolCallEvents?: LlmapiToolCallEvent[];
|
|
3509
|
+
/**
|
|
3510
|
+
* Set when `content` could not be decrypted on read (#561).
|
|
3511
|
+
* The `content` field still holds the original ciphertext — never a
|
|
3512
|
+
* `[Decryption Failed]` placeholder — so a later unlock can recover.
|
|
3513
|
+
* - `key_missing`: no key for this field's `enc:vN:` version in the store
|
|
3514
|
+
* - `auth_mismatch`: a key was present but AES-GCM auth failed (wrong key)
|
|
3515
|
+
* - `invalid_payload`: malformed ciphertext envelope
|
|
3516
|
+
*/
|
|
3517
|
+
decryptionStatus?: "key_missing" | "auth_mismatch" | "invalid_payload";
|
|
3509
3518
|
}
|
|
3510
3519
|
interface ActivityPhase {
|
|
3511
3520
|
id: string;
|
|
@@ -4141,6 +4150,35 @@ declare class Conversation extends Model {
|
|
|
4141
4150
|
pinnedAt?: Date | null;
|
|
4142
4151
|
}
|
|
4143
4152
|
|
|
4153
|
+
/**
|
|
4154
|
+
* Encryption key version type.
|
|
4155
|
+
* - "v2": Legacy SHA-256 derived key (for reading enc:v2: data)
|
|
4156
|
+
* - "v3": HKDF derived key with domain separation (for new encryption)
|
|
4157
|
+
*/
|
|
4158
|
+
type EncryptionKeyVersion = "v2" | "v3";
|
|
4159
|
+
/**
|
|
4160
|
+
* Thrown by {@link getEncryptionKey} when the requested version is absent.
|
|
4161
|
+
* Distinct from AES-GCM auth-tag failures so decrypt callers can tell
|
|
4162
|
+
* "need to derive/hydrate this version" from "wrong key for intact ciphertext".
|
|
4163
|
+
*/
|
|
4164
|
+
declare class EncryptionKeyMissingError extends Error {
|
|
4165
|
+
readonly address: string;
|
|
4166
|
+
readonly version: EncryptionKeyVersion;
|
|
4167
|
+
constructor(address: string, version: EncryptionKeyVersion);
|
|
4168
|
+
}
|
|
4169
|
+
/**
|
|
4170
|
+
* Options for {@link requestEncryptionKey}.
|
|
4171
|
+
*/
|
|
4172
|
+
interface RequestEncryptionKeyOptions {
|
|
4173
|
+
/**
|
|
4174
|
+
* When true, re-derive and replace any existing in-memory keys for this
|
|
4175
|
+
* address. Default false preserves the historical "if present, return"
|
|
4176
|
+
* short-circuit. Prefer {@link refreshEncryptionKeyIfMatches} when the
|
|
4177
|
+
* caller has ciphertext that must keep working — force-replace can pin a
|
|
4178
|
+
* newly derived wrong key over a still-valid one.
|
|
4179
|
+
*/
|
|
4180
|
+
force?: boolean;
|
|
4181
|
+
}
|
|
4144
4182
|
/**
|
|
4145
4183
|
* Register a callback that fires when an encryption key becomes available for an address.
|
|
4146
4184
|
* If the key is already available, the callback fires immediately.
|
|
@@ -4186,9 +4224,30 @@ declare function clearAllEncryptionState(): void;
|
|
|
4186
4224
|
*/
|
|
4187
4225
|
declare function clearAllEncryptionKeys(): void;
|
|
4188
4226
|
/**
|
|
4189
|
-
* Checks if an encryption key exists in memory for the given wallet address
|
|
4227
|
+
* Checks if an encryption key exists in memory for the given wallet address.
|
|
4228
|
+
*
|
|
4229
|
+
* @param address - Wallet address
|
|
4230
|
+
* @param version - When omitted, checks the **v3** (`current`) key — the key
|
|
4231
|
+
* write/OPFS/encrypt paths need. Callers that only need to read legacy
|
|
4232
|
+
* `enc:v2:` data should pass `"v2"` explicitly. (#561 / PR #828)
|
|
4233
|
+
*/
|
|
4234
|
+
declare function hasEncryptionKey(address: string, version?: EncryptionKeyVersion): boolean;
|
|
4235
|
+
/**
|
|
4236
|
+
* Seed (or merge) raw key hex into the in-memory store without signing.
|
|
4237
|
+
*
|
|
4238
|
+
* Used by platform polyfills that hydrate from SecureStore / keychain where
|
|
4239
|
+
* one version may be missing — callers must not require both versions to
|
|
4240
|
+
* exist before the other becomes usable (#561).
|
|
4241
|
+
*
|
|
4242
|
+
* Existing versions are preserved when the corresponding argument is omitted.
|
|
4243
|
+
* Pass an explicit empty merge is not supported; omit the field to leave it.
|
|
4244
|
+
*
|
|
4245
|
+
* Each provided key must be 64 hex characters (32-byte AES key).
|
|
4190
4246
|
*/
|
|
4191
|
-
declare function
|
|
4247
|
+
declare function seedEncryptionKeys(address: string, keys: {
|
|
4248
|
+
legacy?: string;
|
|
4249
|
+
current?: string;
|
|
4250
|
+
}): void;
|
|
4192
4251
|
/**
|
|
4193
4252
|
* Options for signing messages.
|
|
4194
4253
|
*/
|
|
@@ -4209,24 +4268,50 @@ type SignMessageFn = (message: string, options?: SignMessageOptions) => Promise<
|
|
|
4209
4268
|
type EmbeddedWalletSignerFn = (message: string, options?: SignMessageOptions) => Promise<string>;
|
|
4210
4269
|
/**
|
|
4211
4270
|
* Requests the user to sign a message to generate an encryption key.
|
|
4212
|
-
* If a key already exists in memory for the given wallet, resolves immediately
|
|
4271
|
+
* If a key already exists in memory for the given wallet, resolves immediately
|
|
4272
|
+
* unless {@link RequestEncryptionKeyOptions.force} is set.
|
|
4213
4273
|
*
|
|
4214
4274
|
* Note: Keys are stored in memory only and do not persist across page reloads.
|
|
4215
4275
|
* This is a security feature - users must sign once per session to derive their key.
|
|
4216
4276
|
*
|
|
4277
|
+
* When a seeded/pinned store already has keys and the fresh derive does not
|
|
4278
|
+
* match any of them, the store is left unchanged and this resolves to `false`
|
|
4279
|
+
* (without firing {@link onKeyAvailable}). Callers that need write readiness
|
|
4280
|
+
* should check the return value or {@link hasEncryptionKey} before encrypting
|
|
4281
|
+
* so they can surface a re-unlock UI instead of failing downstream (#828).
|
|
4282
|
+
*
|
|
4217
4283
|
* @param walletAddress - The wallet address to generate the key for
|
|
4218
4284
|
* @param signMessage - Function to sign a message (returns signature hex string)
|
|
4219
4285
|
* @param embeddedWalletSigner - Optional function for silent signing with embedded wallets
|
|
4220
|
-
* @
|
|
4286
|
+
* @param options - Optional flags (e.g. force re-derive)
|
|
4287
|
+
* @returns `true` when keys are available after the call; `false` when a
|
|
4288
|
+
* divergent derive left the store unchanged (or the session was torn down
|
|
4289
|
+
* mid-flight).
|
|
4290
|
+
*/
|
|
4291
|
+
declare function requestEncryptionKey(walletAddress: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn, options?: RequestEncryptionKeyOptions): Promise<boolean>;
|
|
4292
|
+
/**
|
|
4293
|
+
* Re-derive encryption keys from a fresh signature and commit them **only if**
|
|
4294
|
+
* they successfully decrypt `probeCiphertext` (a prefixed `enc:v2:` / `enc:v3:`
|
|
4295
|
+
* value). If they do not, the existing in-memory keys are left untouched.
|
|
4296
|
+
*
|
|
4297
|
+
* Concurrent calls for the same wallet share one sign+derive. Each caller then
|
|
4298
|
+
* probes **its own** ciphertext against those candidates, so mixed-era messages
|
|
4299
|
+
* in one `Promise.all` batch can still recover when only the leader's probe
|
|
4300
|
+
* misses (#828 review). Failed candidates are memoized for the session so
|
|
4301
|
+
* pagination does not re-prompt on every page when the wallet has changed.
|
|
4302
|
+
*
|
|
4303
|
+
* @returns true when keys were refreshed (probe decrypted); false when the
|
|
4304
|
+
* probe failed under the candidate keys (store unchanged) or the probe was
|
|
4305
|
+
* not encrypted.
|
|
4221
4306
|
*/
|
|
4222
|
-
declare function
|
|
4307
|
+
declare function refreshEncryptionKeyIfMatches(walletAddress: string, probeCiphertext: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn): Promise<boolean>;
|
|
4223
4308
|
/**
|
|
4224
4309
|
* Result returned by the useEncryption hook.
|
|
4225
4310
|
* @category Hooks
|
|
4226
4311
|
*/
|
|
4227
4312
|
interface UseEncryptionResult {
|
|
4228
4313
|
/** Request and generate an encryption key for a wallet address */
|
|
4229
|
-
requestEncryptionKey: (walletAddress: string) => Promise<
|
|
4314
|
+
requestEncryptionKey: (walletAddress: string) => Promise<boolean>;
|
|
4230
4315
|
/** Request and generate an ECDH key pair for a wallet address */
|
|
4231
4316
|
requestKeyPair: (walletAddress: string) => Promise<void>;
|
|
4232
4317
|
/** Export the public key for a wallet address as base64-encoded SPKI */
|
|
@@ -9253,4 +9338,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
|
|
|
9253
9338
|
*/
|
|
9254
9339
|
declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
|
|
9255
9340
|
|
|
9256
|
-
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, backfillMemoryTopicsOp, 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, relinkMemoryTopicsOp, 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 };
|
|
9341
|
+
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, EncryptionKeyMissingError, 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, type RequestEncryptionKeyOptions, 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, backfillMemoryTopicsOp, 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, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
|
package/dist/expo/index.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
EMBEDDINGS_DEGRADED_EMPTY,
|
|
9
9
|
ENTITY_FANOUT,
|
|
10
10
|
ENTITY_KINDS,
|
|
11
|
+
EncryptionKeyMissingError,
|
|
11
12
|
LRUCache,
|
|
12
13
|
MAX_HOPS,
|
|
13
14
|
NODE_BUDGET,
|
|
@@ -92,6 +93,7 @@ import {
|
|
|
92
93
|
prepareVaultCandidates,
|
|
93
94
|
rankPreparedVaultCandidates,
|
|
94
95
|
recall,
|
|
96
|
+
refreshEncryptionKeyIfMatches,
|
|
95
97
|
relinkMemoryTopicsOp,
|
|
96
98
|
replaceMemoryEntitiesGuardedOp,
|
|
97
99
|
requestEncryptionKey,
|
|
@@ -99,6 +101,7 @@ import {
|
|
|
99
101
|
restoreVaultMemoryOp,
|
|
100
102
|
searchChunksOp,
|
|
101
103
|
searchVaultMemories,
|
|
104
|
+
seedEncryptionKeys,
|
|
102
105
|
setMemoryVisibilityOp,
|
|
103
106
|
shouldChunkMessage,
|
|
104
107
|
stampTopicsExtractedAtOp,
|
|
@@ -116,7 +119,7 @@ import {
|
|
|
116
119
|
upsertMessageOp,
|
|
117
120
|
useEncryption,
|
|
118
121
|
vaultMemoryToStored
|
|
119
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-3CDSIN22.mjs";
|
|
120
123
|
import {
|
|
121
124
|
PII_PATTERNS,
|
|
122
125
|
PiiRedactor,
|
|
@@ -14232,6 +14235,7 @@ export {
|
|
|
14232
14235
|
DEFAULT_VAULT_CACHE_SIZE,
|
|
14233
14236
|
DatabaseManager,
|
|
14234
14237
|
ENTITY_FANOUT,
|
|
14238
|
+
EncryptionKeyMissingError,
|
|
14235
14239
|
HARD_DELETE_WINDOW_MS,
|
|
14236
14240
|
INFERENCE_ID_HEADER,
|
|
14237
14241
|
LoggerProvider,
|
|
@@ -14358,6 +14362,7 @@ export {
|
|
|
14358
14362
|
rankProfileCandidates,
|
|
14359
14363
|
recall,
|
|
14360
14364
|
reflect,
|
|
14365
|
+
refreshEncryptionKeyIfMatches,
|
|
14361
14366
|
refreshNotionAccessToken,
|
|
14362
14367
|
registerNotionClient,
|
|
14363
14368
|
relinkMemoryTopicsOp,
|
|
@@ -14372,6 +14377,7 @@ export {
|
|
|
14372
14377
|
sdkModelClasses,
|
|
14373
14378
|
sdkSchema,
|
|
14374
14379
|
searchVaultMemories,
|
|
14380
|
+
seedEncryptionKeys,
|
|
14375
14381
|
setLogger,
|
|
14376
14382
|
setMemoryVisibilityOp,
|
|
14377
14383
|
shouldChunkMessage,
|
package/dist/index.cjs
CHANGED
|
@@ -2830,6 +2830,16 @@ function buildSystemPrompt(ctx, options) {
|
|
|
2830
2830
|
}
|
|
2831
2831
|
|
|
2832
2832
|
// src/react/useEncryption.ts
|
|
2833
|
+
var EncryptionKeyMissingError = class extends Error {
|
|
2834
|
+
constructor(address, version) {
|
|
2835
|
+
super(
|
|
2836
|
+
`Encryption key (${version}) not found for ${address}. Please sign a message to generate your encryption key.`
|
|
2837
|
+
);
|
|
2838
|
+
this.name = "EncryptionKeyMissingError";
|
|
2839
|
+
this.address = address;
|
|
2840
|
+
this.version = version;
|
|
2841
|
+
}
|
|
2842
|
+
};
|
|
2833
2843
|
var encryptionKeyStore = /* @__PURE__ */ new Map();
|
|
2834
2844
|
var cryptoKeyCache = /* @__PURE__ */ new Map();
|
|
2835
2845
|
var clearAllEncryptionStateCallbacks = /* @__PURE__ */ new Set();
|
|
@@ -2839,14 +2849,11 @@ function onClearAllEncryptionState(callback) {
|
|
|
2839
2849
|
clearAllEncryptionStateCallbacks.delete(callback);
|
|
2840
2850
|
};
|
|
2841
2851
|
}
|
|
2842
|
-
function getStoredKey(address) {
|
|
2843
|
-
const keys = encryptionKeyStore.get(address);
|
|
2844
|
-
return keys?.current ?? null;
|
|
2845
|
-
}
|
|
2846
2852
|
function getStoredKeyByVersion(address, version) {
|
|
2847
2853
|
const keys = encryptionKeyStore.get(address);
|
|
2848
2854
|
if (!keys) return null;
|
|
2849
|
-
|
|
2855
|
+
const value = version === "v2" ? keys.legacy : keys.current;
|
|
2856
|
+
return value ?? null;
|
|
2850
2857
|
}
|
|
2851
2858
|
function hexToBytes(hex) {
|
|
2852
2859
|
const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex;
|
|
@@ -2866,9 +2873,7 @@ async function getEncryptionKey(address, version = "v3") {
|
|
|
2866
2873
|
}
|
|
2867
2874
|
const keyHex = getStoredKeyByVersion(address, version);
|
|
2868
2875
|
if (!keyHex) {
|
|
2869
|
-
throw new
|
|
2870
|
-
"Encryption key not found. Please sign a message to generate your encryption key."
|
|
2871
|
-
);
|
|
2876
|
+
throw new EncryptionKeyMissingError(address, version);
|
|
2872
2877
|
}
|
|
2873
2878
|
const keyBytes = hexToBytes(keyHex);
|
|
2874
2879
|
const cryptoKey = await crypto.subtle.importKey(
|
|
@@ -2885,8 +2890,8 @@ async function decryptData(encryptedHex, address, version = "v3") {
|
|
|
2885
2890
|
const key = await getEncryptionKey(address, version);
|
|
2886
2891
|
return decryptDataWithKey(encryptedHex, key);
|
|
2887
2892
|
}
|
|
2888
|
-
function hasEncryptionKey(address) {
|
|
2889
|
-
return
|
|
2893
|
+
function hasEncryptionKey(address, version) {
|
|
2894
|
+
return getStoredKeyByVersion(address, version ?? "v3") !== null;
|
|
2890
2895
|
}
|
|
2891
2896
|
async function decryptDataWithKey(encryptedHex, key) {
|
|
2892
2897
|
const combined = hexToBytes(encryptedHex);
|
|
@@ -2919,20 +2924,29 @@ function detectEncryptionVersion(value) {
|
|
|
2919
2924
|
}
|
|
2920
2925
|
return null;
|
|
2921
2926
|
}
|
|
2922
|
-
async function
|
|
2923
|
-
if (!value) return value;
|
|
2927
|
+
async function decryptFieldDetailed(value, address) {
|
|
2928
|
+
if (!value) return { status: "plaintext", value };
|
|
2924
2929
|
const detected = detectEncryptionVersion(value);
|
|
2925
|
-
if (!detected) return value;
|
|
2930
|
+
if (!detected) return { status: "plaintext", value };
|
|
2926
2931
|
if (detected.encryptedData.length < 56 || !/^[0-9a-f]+$/i.test(detected.encryptedData)) {
|
|
2927
|
-
return value;
|
|
2932
|
+
return { status: "invalid_payload", value, version: detected.version };
|
|
2928
2933
|
}
|
|
2929
2934
|
try {
|
|
2930
|
-
|
|
2935
|
+
const plaintext = await decryptData(detected.encryptedData, address, detected.version);
|
|
2936
|
+
return { status: "ok", value: plaintext, version: detected.version };
|
|
2931
2937
|
} catch (error) {
|
|
2932
|
-
|
|
2933
|
-
|
|
2938
|
+
if (error instanceof EncryptionKeyMissingError) {
|
|
2939
|
+
getLogger().warn("Failed to decrypt field (key missing for version):", error.message);
|
|
2940
|
+
return { status: "key_missing", value, version: detected.version };
|
|
2941
|
+
}
|
|
2942
|
+
getLogger().warn("Failed to decrypt field (auth mismatch or crypto error):", error);
|
|
2943
|
+
return { status: "auth_mismatch", value, version: detected.version };
|
|
2934
2944
|
}
|
|
2935
2945
|
}
|
|
2946
|
+
async function decryptField(value, address) {
|
|
2947
|
+
const result = await decryptFieldDetailed(value, address);
|
|
2948
|
+
return result.value;
|
|
2949
|
+
}
|
|
2936
2950
|
|
|
2937
2951
|
// src/lib/chat/useChat/strategies/types.ts
|
|
2938
2952
|
function isChatCompletionResponse(r) {
|
package/dist/index.mjs
CHANGED
|
@@ -2634,6 +2634,16 @@ function buildSystemPrompt(ctx, options) {
|
|
|
2634
2634
|
}
|
|
2635
2635
|
|
|
2636
2636
|
// src/react/useEncryption.ts
|
|
2637
|
+
var EncryptionKeyMissingError = class extends Error {
|
|
2638
|
+
constructor(address, version) {
|
|
2639
|
+
super(
|
|
2640
|
+
`Encryption key (${version}) not found for ${address}. Please sign a message to generate your encryption key.`
|
|
2641
|
+
);
|
|
2642
|
+
this.name = "EncryptionKeyMissingError";
|
|
2643
|
+
this.address = address;
|
|
2644
|
+
this.version = version;
|
|
2645
|
+
}
|
|
2646
|
+
};
|
|
2637
2647
|
var encryptionKeyStore = /* @__PURE__ */ new Map();
|
|
2638
2648
|
var cryptoKeyCache = /* @__PURE__ */ new Map();
|
|
2639
2649
|
var clearAllEncryptionStateCallbacks = /* @__PURE__ */ new Set();
|
|
@@ -2643,14 +2653,11 @@ function onClearAllEncryptionState(callback) {
|
|
|
2643
2653
|
clearAllEncryptionStateCallbacks.delete(callback);
|
|
2644
2654
|
};
|
|
2645
2655
|
}
|
|
2646
|
-
function getStoredKey(address) {
|
|
2647
|
-
const keys = encryptionKeyStore.get(address);
|
|
2648
|
-
return keys?.current ?? null;
|
|
2649
|
-
}
|
|
2650
2656
|
function getStoredKeyByVersion(address, version) {
|
|
2651
2657
|
const keys = encryptionKeyStore.get(address);
|
|
2652
2658
|
if (!keys) return null;
|
|
2653
|
-
|
|
2659
|
+
const value = version === "v2" ? keys.legacy : keys.current;
|
|
2660
|
+
return value ?? null;
|
|
2654
2661
|
}
|
|
2655
2662
|
function hexToBytes(hex) {
|
|
2656
2663
|
const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex;
|
|
@@ -2670,9 +2677,7 @@ async function getEncryptionKey(address, version = "v3") {
|
|
|
2670
2677
|
}
|
|
2671
2678
|
const keyHex = getStoredKeyByVersion(address, version);
|
|
2672
2679
|
if (!keyHex) {
|
|
2673
|
-
throw new
|
|
2674
|
-
"Encryption key not found. Please sign a message to generate your encryption key."
|
|
2675
|
-
);
|
|
2680
|
+
throw new EncryptionKeyMissingError(address, version);
|
|
2676
2681
|
}
|
|
2677
2682
|
const keyBytes = hexToBytes(keyHex);
|
|
2678
2683
|
const cryptoKey = await crypto.subtle.importKey(
|
|
@@ -2689,8 +2694,8 @@ async function decryptData(encryptedHex, address, version = "v3") {
|
|
|
2689
2694
|
const key = await getEncryptionKey(address, version);
|
|
2690
2695
|
return decryptDataWithKey(encryptedHex, key);
|
|
2691
2696
|
}
|
|
2692
|
-
function hasEncryptionKey(address) {
|
|
2693
|
-
return
|
|
2697
|
+
function hasEncryptionKey(address, version) {
|
|
2698
|
+
return getStoredKeyByVersion(address, version ?? "v3") !== null;
|
|
2694
2699
|
}
|
|
2695
2700
|
async function decryptDataWithKey(encryptedHex, key) {
|
|
2696
2701
|
const combined = hexToBytes(encryptedHex);
|
|
@@ -2723,20 +2728,29 @@ function detectEncryptionVersion(value) {
|
|
|
2723
2728
|
}
|
|
2724
2729
|
return null;
|
|
2725
2730
|
}
|
|
2726
|
-
async function
|
|
2727
|
-
if (!value) return value;
|
|
2731
|
+
async function decryptFieldDetailed(value, address) {
|
|
2732
|
+
if (!value) return { status: "plaintext", value };
|
|
2728
2733
|
const detected = detectEncryptionVersion(value);
|
|
2729
|
-
if (!detected) return value;
|
|
2734
|
+
if (!detected) return { status: "plaintext", value };
|
|
2730
2735
|
if (detected.encryptedData.length < 56 || !/^[0-9a-f]+$/i.test(detected.encryptedData)) {
|
|
2731
|
-
return value;
|
|
2736
|
+
return { status: "invalid_payload", value, version: detected.version };
|
|
2732
2737
|
}
|
|
2733
2738
|
try {
|
|
2734
|
-
|
|
2739
|
+
const plaintext = await decryptData(detected.encryptedData, address, detected.version);
|
|
2740
|
+
return { status: "ok", value: plaintext, version: detected.version };
|
|
2735
2741
|
} catch (error) {
|
|
2736
|
-
|
|
2737
|
-
|
|
2742
|
+
if (error instanceof EncryptionKeyMissingError) {
|
|
2743
|
+
getLogger().warn("Failed to decrypt field (key missing for version):", error.message);
|
|
2744
|
+
return { status: "key_missing", value, version: detected.version };
|
|
2745
|
+
}
|
|
2746
|
+
getLogger().warn("Failed to decrypt field (auth mismatch or crypto error):", error);
|
|
2747
|
+
return { status: "auth_mismatch", value, version: detected.version };
|
|
2738
2748
|
}
|
|
2739
2749
|
}
|
|
2750
|
+
async function decryptField(value, address) {
|
|
2751
|
+
const result = await decryptFieldDetailed(value, address);
|
|
2752
|
+
return result.value;
|
|
2753
|
+
}
|
|
2740
2754
|
|
|
2741
2755
|
// src/lib/chat/useChat/strategies/types.ts
|
|
2742
2756
|
function isChatCompletionResponse(r) {
|