@reverbia/sdk 1.0.0-next.20260110155148 → 1.0.0-next.20260110214809
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/index.cjs +4 -3
- package/dist/expo/index.d.mts +10 -3
- package/dist/expo/index.d.ts +10 -3
- package/dist/expo/index.mjs +4 -3
- package/dist/react/index.cjs +397 -22
- package/dist/react/index.d.mts +110 -4
- package/dist/react/index.d.ts +110 -4
- package/dist/react/index.mjs +423 -55
- package/package.json +1 -1
package/dist/react/index.d.mts
CHANGED
|
@@ -1055,6 +1055,15 @@ declare function clearEncryptionKey(address: string): void;
|
|
|
1055
1055
|
* Clears all encryption keys from memory
|
|
1056
1056
|
*/
|
|
1057
1057
|
declare function clearAllEncryptionKeys(): void;
|
|
1058
|
+
/**
|
|
1059
|
+
* Gets the encryption key from in-memory storage and imports it as a CryptoKey.
|
|
1060
|
+
* The key must have been previously requested via requestEncryptionKey.
|
|
1061
|
+
*
|
|
1062
|
+
* @param address - The wallet address
|
|
1063
|
+
* @returns The CryptoKey for AES-GCM encryption/decryption
|
|
1064
|
+
* @throws Error if the key hasn't been requested yet
|
|
1065
|
+
*/
|
|
1066
|
+
declare function getEncryptionKey(address: string): Promise<CryptoKey>;
|
|
1058
1067
|
/**
|
|
1059
1068
|
* Encrypts data using AES-GCM with the stored encryption key.
|
|
1060
1069
|
*
|
|
@@ -1122,17 +1131,24 @@ declare function decryptDataBytes(encryptedHex: string, address: string): Promis
|
|
|
1122
1131
|
* Checks if an encryption key exists in memory for the given wallet address
|
|
1123
1132
|
*/
|
|
1124
1133
|
declare function hasEncryptionKey(address: string): boolean;
|
|
1134
|
+
/**
|
|
1135
|
+
* Options for signing messages.
|
|
1136
|
+
*/
|
|
1137
|
+
interface SignMessageOptions {
|
|
1138
|
+
/** Whether to show wallet UI during signing. Default: true */
|
|
1139
|
+
showWalletUIs?: boolean;
|
|
1140
|
+
}
|
|
1125
1141
|
/**
|
|
1126
1142
|
* Type for the signMessage function that client must provide.
|
|
1127
|
-
* This is typically from Privy's useSignMessage hook
|
|
1143
|
+
* This is typically from Privy's useSignMessage hook.
|
|
1128
1144
|
*/
|
|
1129
|
-
type SignMessageFn = (message: string) => Promise<string>;
|
|
1145
|
+
type SignMessageFn = (message: string, options?: SignMessageOptions) => Promise<string>;
|
|
1130
1146
|
/**
|
|
1131
1147
|
* Type for embedded wallet signer function that enables silent signing.
|
|
1132
1148
|
* For Privy embedded wallets, this can sign programmatically without user interaction
|
|
1133
1149
|
* when configured correctly in the Privy dashboard.
|
|
1134
1150
|
*/
|
|
1135
|
-
type EmbeddedWalletSignerFn = (message: string) => Promise<string>;
|
|
1151
|
+
type EmbeddedWalletSignerFn = (message: string, options?: SignMessageOptions) => Promise<string>;
|
|
1136
1152
|
/**
|
|
1137
1153
|
* Requests the user to sign a message to generate an encryption key.
|
|
1138
1154
|
* If a key already exists in memory for the given wallet, resolves immediately.
|
|
@@ -1816,6 +1832,18 @@ interface UseChatStorageOptions extends BaseUseChatStorageOptions {
|
|
|
1816
1832
|
* - "completions": OpenAI Chat Completions API (wider model compatibility)
|
|
1817
1833
|
*/
|
|
1818
1834
|
apiType?: ApiType;
|
|
1835
|
+
/**
|
|
1836
|
+
* Wallet address for encrypted file storage.
|
|
1837
|
+
* When provided, MCP-generated images are automatically encrypted and stored
|
|
1838
|
+
* in OPFS using wallet-derived keys. Messages are returned with working blob URLs.
|
|
1839
|
+
*
|
|
1840
|
+
* Requires:
|
|
1841
|
+
* - OPFS browser support
|
|
1842
|
+
* - Encryption key to be requested via `requestEncryptionKey` first
|
|
1843
|
+
*
|
|
1844
|
+
* When not provided, falls back to the `writeFile` callback in sendMessage args.
|
|
1845
|
+
*/
|
|
1846
|
+
walletAddress?: string;
|
|
1819
1847
|
}
|
|
1820
1848
|
/**
|
|
1821
1849
|
* Arguments for sendMessage with storage (React version)
|
|
@@ -1982,6 +2010,84 @@ interface UseChatStorageResult extends BaseUseChatStorageResult {
|
|
|
1982
2010
|
*/
|
|
1983
2011
|
declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageResult;
|
|
1984
2012
|
|
|
2013
|
+
/**
|
|
2014
|
+
* Checks if the browser supports OPFS.
|
|
2015
|
+
*/
|
|
2016
|
+
declare function isOPFSSupported(): boolean;
|
|
2017
|
+
/**
|
|
2018
|
+
* File metadata stored alongside encrypted content.
|
|
2019
|
+
*/
|
|
2020
|
+
interface StoredFileMetadata {
|
|
2021
|
+
id: string;
|
|
2022
|
+
name: string;
|
|
2023
|
+
type: string;
|
|
2024
|
+
size: number;
|
|
2025
|
+
sourceUrl?: string;
|
|
2026
|
+
createdAt: number;
|
|
2027
|
+
}
|
|
2028
|
+
/**
|
|
2029
|
+
* Writes an encrypted file to OPFS.
|
|
2030
|
+
*
|
|
2031
|
+
* @param fileId - Unique identifier for the file
|
|
2032
|
+
* @param blob - The file content
|
|
2033
|
+
* @param encryptionKey - CryptoKey for encryption
|
|
2034
|
+
* @param metadata - Optional metadata (name, type, sourceUrl)
|
|
2035
|
+
*/
|
|
2036
|
+
declare function writeEncryptedFile(fileId: string, blob: Blob, encryptionKey: CryptoKey, metadata?: {
|
|
2037
|
+
name?: string;
|
|
2038
|
+
sourceUrl?: string;
|
|
2039
|
+
}): Promise<void>;
|
|
2040
|
+
/**
|
|
2041
|
+
* Reads and decrypts a file from OPFS.
|
|
2042
|
+
*
|
|
2043
|
+
* @param fileId - The file identifier
|
|
2044
|
+
* @param encryptionKey - CryptoKey for decryption
|
|
2045
|
+
* @returns The decrypted blob, or null if not found
|
|
2046
|
+
*/
|
|
2047
|
+
declare function readEncryptedFile(fileId: string, encryptionKey: CryptoKey): Promise<{
|
|
2048
|
+
blob: Blob;
|
|
2049
|
+
metadata: StoredFileMetadata;
|
|
2050
|
+
} | null>;
|
|
2051
|
+
/**
|
|
2052
|
+
* Deletes a file from OPFS.
|
|
2053
|
+
*
|
|
2054
|
+
* @param fileId - The file identifier
|
|
2055
|
+
*/
|
|
2056
|
+
declare function deleteEncryptedFile(fileId: string): Promise<void>;
|
|
2057
|
+
/**
|
|
2058
|
+
* Checks if a file exists in OPFS.
|
|
2059
|
+
*
|
|
2060
|
+
* @param fileId - The file identifier
|
|
2061
|
+
*/
|
|
2062
|
+
declare function fileExists(fileId: string): Promise<boolean>;
|
|
2063
|
+
/**
|
|
2064
|
+
* Manager for blob URLs to prevent memory leaks.
|
|
2065
|
+
* Tracks active blob URLs and provides cleanup functionality.
|
|
2066
|
+
*/
|
|
2067
|
+
declare class BlobUrlManager {
|
|
2068
|
+
private activeUrls;
|
|
2069
|
+
/**
|
|
2070
|
+
* Creates a blob URL for a file and tracks it.
|
|
2071
|
+
*/
|
|
2072
|
+
createUrl(fileId: string, blob: Blob): string;
|
|
2073
|
+
/**
|
|
2074
|
+
* Gets the active blob URL for a file, if any.
|
|
2075
|
+
*/
|
|
2076
|
+
getUrl(fileId: string): string | undefined;
|
|
2077
|
+
/**
|
|
2078
|
+
* Revokes a blob URL and removes it from tracking.
|
|
2079
|
+
*/
|
|
2080
|
+
revokeUrl(fileId: string): void;
|
|
2081
|
+
/**
|
|
2082
|
+
* Revokes all tracked blob URLs.
|
|
2083
|
+
*/
|
|
2084
|
+
revokeAll(): void;
|
|
2085
|
+
/**
|
|
2086
|
+
* Gets the count of active blob URLs.
|
|
2087
|
+
*/
|
|
2088
|
+
get size(): number;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
1985
2091
|
/**
|
|
1986
2092
|
* Combined WatermelonDB schema for all SDK storage modules.
|
|
1987
2093
|
*
|
|
@@ -3801,4 +3907,4 @@ declare function storeDriveToken(accessToken: string, expiresIn?: number, refres
|
|
|
3801
3907
|
*/
|
|
3802
3908
|
declare function hasDriveCredentials(): boolean;
|
|
3803
3909
|
|
|
3804
|
-
export { DEFAULT_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type CreateConversationOptions, type CreateMemoryOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateUserPreferenceOptions, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CONVERSATIONS_FOLDER as DEFAULT_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as DEFAULT_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_DROPBOX_FOLDER, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_PERSONALITY_SETTINGS, type DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, type EmbeddedWalletSignerFn, type FileMetadata, type GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, type MemoryItem, type MemoryType, type OCRFile, type PdfFile, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type ProfileUpdate, type ProgressCallback, type ProviderAuthState, type ProviderBackupState, SLIDER_CONFIG, type SearchMessagesOptions, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type SignMessageFn, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredMemory, Memory as StoredMemoryModel, type StoredMemoryWithSimilarity, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type UpdateMemoryOptions, type UpdateModelPreferenceOptions, type UpdateUserPreferenceOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseImageGenerationResult, type UseMemoryStorageOptions, type UseMemoryStorageResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UseSearchResult, type UseSettingsOptions, type UseSettingsResult, chatStorageMigrations, chatStorageSchema, clearAllEncryptionKeys, clearAllKeyPairs, clearCalendarToken, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, createMemoryContextSystemMessage, decryptData, decryptDataBytes, encryptData, exportPublicKey, extractConversationContext, findFileIdBySourceUrl, formatMemoriesForChat, generateCompositeKey, generateConversationId, generateUniqueKey, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getCalendarAccessToken, getDriveAccessToken, getGoogleDriveStoredToken, getValidCalendarToken, getValidDriveToken, handleCalendarCallback, handleDriveCallback, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, isCalendarCallback, isDriveCallback, memoryStorageSchema, refreshCalendarToken, refreshDriveToken, replaceUrlWithMCPPlaceholder, requestEncryptionKey, requestKeyPair, revokeCalendarToken, revokeDriveToken, sdkMigrations, sdkModelClasses, sdkSchema, settingsStorageSchema, startCalendarAuth, startDriveAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, useBackup, useBackupAuth, useChat, useChatStorage, useDropboxAuth, useDropboxBackup, useEncryption, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useImageGeneration, useMemoryStorage, useModels, useOCR, usePdf, useSearch, useSettings, userPreferencesStorageSchema };
|
|
3910
|
+
export { DEFAULT_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, BlobUrlManager, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type CreateConversationOptions, type CreateMemoryOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateUserPreferenceOptions, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CONVERSATIONS_FOLDER as DEFAULT_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as DEFAULT_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_DROPBOX_FOLDER, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_PERSONALITY_SETTINGS, type DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, type EmbeddedWalletSignerFn, type FileMetadata, type GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, type MemoryItem, type MemoryType, type OCRFile, type PdfFile, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type ProfileUpdate, type ProgressCallback, type ProviderAuthState, type ProviderBackupState, SLIDER_CONFIG, type SearchMessagesOptions, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type SignMessageFn, type SignMessageOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredMemory, Memory as StoredMemoryModel, type StoredMemoryWithSimilarity, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type UpdateMemoryOptions, type UpdateModelPreferenceOptions, type UpdateUserPreferenceOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseImageGenerationResult, type UseMemoryStorageOptions, type UseMemoryStorageResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UseSearchResult, type UseSettingsOptions, type UseSettingsResult, chatStorageMigrations, chatStorageSchema, clearAllEncryptionKeys, clearAllKeyPairs, clearCalendarToken, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, createMemoryContextSystemMessage, decryptData, decryptDataBytes, deleteEncryptedFile, encryptData, exportPublicKey, extractConversationContext, fileExists, findFileIdBySourceUrl, formatMemoriesForChat, generateCompositeKey, generateConversationId, generateUniqueKey, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getCalendarAccessToken, getDriveAccessToken, getEncryptionKey, getGoogleDriveStoredToken, getValidCalendarToken, getValidDriveToken, handleCalendarCallback, handleDriveCallback, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, isCalendarCallback, isDriveCallback, isOPFSSupported, memoryStorageSchema, readEncryptedFile, refreshCalendarToken, refreshDriveToken, replaceUrlWithMCPPlaceholder, requestEncryptionKey, requestKeyPair, revokeCalendarToken, revokeDriveToken, sdkMigrations, sdkModelClasses, sdkSchema, settingsStorageSchema, startCalendarAuth, startDriveAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, useBackup, useBackupAuth, useChat, useChatStorage, useDropboxAuth, useDropboxBackup, useEncryption, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useImageGeneration, useMemoryStorage, useModels, useOCR, usePdf, useSearch, useSettings, userPreferencesStorageSchema, writeEncryptedFile };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1055,6 +1055,15 @@ declare function clearEncryptionKey(address: string): void;
|
|
|
1055
1055
|
* Clears all encryption keys from memory
|
|
1056
1056
|
*/
|
|
1057
1057
|
declare function clearAllEncryptionKeys(): void;
|
|
1058
|
+
/**
|
|
1059
|
+
* Gets the encryption key from in-memory storage and imports it as a CryptoKey.
|
|
1060
|
+
* The key must have been previously requested via requestEncryptionKey.
|
|
1061
|
+
*
|
|
1062
|
+
* @param address - The wallet address
|
|
1063
|
+
* @returns The CryptoKey for AES-GCM encryption/decryption
|
|
1064
|
+
* @throws Error if the key hasn't been requested yet
|
|
1065
|
+
*/
|
|
1066
|
+
declare function getEncryptionKey(address: string): Promise<CryptoKey>;
|
|
1058
1067
|
/**
|
|
1059
1068
|
* Encrypts data using AES-GCM with the stored encryption key.
|
|
1060
1069
|
*
|
|
@@ -1122,17 +1131,24 @@ declare function decryptDataBytes(encryptedHex: string, address: string): Promis
|
|
|
1122
1131
|
* Checks if an encryption key exists in memory for the given wallet address
|
|
1123
1132
|
*/
|
|
1124
1133
|
declare function hasEncryptionKey(address: string): boolean;
|
|
1134
|
+
/**
|
|
1135
|
+
* Options for signing messages.
|
|
1136
|
+
*/
|
|
1137
|
+
interface SignMessageOptions {
|
|
1138
|
+
/** Whether to show wallet UI during signing. Default: true */
|
|
1139
|
+
showWalletUIs?: boolean;
|
|
1140
|
+
}
|
|
1125
1141
|
/**
|
|
1126
1142
|
* Type for the signMessage function that client must provide.
|
|
1127
|
-
* This is typically from Privy's useSignMessage hook
|
|
1143
|
+
* This is typically from Privy's useSignMessage hook.
|
|
1128
1144
|
*/
|
|
1129
|
-
type SignMessageFn = (message: string) => Promise<string>;
|
|
1145
|
+
type SignMessageFn = (message: string, options?: SignMessageOptions) => Promise<string>;
|
|
1130
1146
|
/**
|
|
1131
1147
|
* Type for embedded wallet signer function that enables silent signing.
|
|
1132
1148
|
* For Privy embedded wallets, this can sign programmatically without user interaction
|
|
1133
1149
|
* when configured correctly in the Privy dashboard.
|
|
1134
1150
|
*/
|
|
1135
|
-
type EmbeddedWalletSignerFn = (message: string) => Promise<string>;
|
|
1151
|
+
type EmbeddedWalletSignerFn = (message: string, options?: SignMessageOptions) => Promise<string>;
|
|
1136
1152
|
/**
|
|
1137
1153
|
* Requests the user to sign a message to generate an encryption key.
|
|
1138
1154
|
* If a key already exists in memory for the given wallet, resolves immediately.
|
|
@@ -1816,6 +1832,18 @@ interface UseChatStorageOptions extends BaseUseChatStorageOptions {
|
|
|
1816
1832
|
* - "completions": OpenAI Chat Completions API (wider model compatibility)
|
|
1817
1833
|
*/
|
|
1818
1834
|
apiType?: ApiType;
|
|
1835
|
+
/**
|
|
1836
|
+
* Wallet address for encrypted file storage.
|
|
1837
|
+
* When provided, MCP-generated images are automatically encrypted and stored
|
|
1838
|
+
* in OPFS using wallet-derived keys. Messages are returned with working blob URLs.
|
|
1839
|
+
*
|
|
1840
|
+
* Requires:
|
|
1841
|
+
* - OPFS browser support
|
|
1842
|
+
* - Encryption key to be requested via `requestEncryptionKey` first
|
|
1843
|
+
*
|
|
1844
|
+
* When not provided, falls back to the `writeFile` callback in sendMessage args.
|
|
1845
|
+
*/
|
|
1846
|
+
walletAddress?: string;
|
|
1819
1847
|
}
|
|
1820
1848
|
/**
|
|
1821
1849
|
* Arguments for sendMessage with storage (React version)
|
|
@@ -1982,6 +2010,84 @@ interface UseChatStorageResult extends BaseUseChatStorageResult {
|
|
|
1982
2010
|
*/
|
|
1983
2011
|
declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageResult;
|
|
1984
2012
|
|
|
2013
|
+
/**
|
|
2014
|
+
* Checks if the browser supports OPFS.
|
|
2015
|
+
*/
|
|
2016
|
+
declare function isOPFSSupported(): boolean;
|
|
2017
|
+
/**
|
|
2018
|
+
* File metadata stored alongside encrypted content.
|
|
2019
|
+
*/
|
|
2020
|
+
interface StoredFileMetadata {
|
|
2021
|
+
id: string;
|
|
2022
|
+
name: string;
|
|
2023
|
+
type: string;
|
|
2024
|
+
size: number;
|
|
2025
|
+
sourceUrl?: string;
|
|
2026
|
+
createdAt: number;
|
|
2027
|
+
}
|
|
2028
|
+
/**
|
|
2029
|
+
* Writes an encrypted file to OPFS.
|
|
2030
|
+
*
|
|
2031
|
+
* @param fileId - Unique identifier for the file
|
|
2032
|
+
* @param blob - The file content
|
|
2033
|
+
* @param encryptionKey - CryptoKey for encryption
|
|
2034
|
+
* @param metadata - Optional metadata (name, type, sourceUrl)
|
|
2035
|
+
*/
|
|
2036
|
+
declare function writeEncryptedFile(fileId: string, blob: Blob, encryptionKey: CryptoKey, metadata?: {
|
|
2037
|
+
name?: string;
|
|
2038
|
+
sourceUrl?: string;
|
|
2039
|
+
}): Promise<void>;
|
|
2040
|
+
/**
|
|
2041
|
+
* Reads and decrypts a file from OPFS.
|
|
2042
|
+
*
|
|
2043
|
+
* @param fileId - The file identifier
|
|
2044
|
+
* @param encryptionKey - CryptoKey for decryption
|
|
2045
|
+
* @returns The decrypted blob, or null if not found
|
|
2046
|
+
*/
|
|
2047
|
+
declare function readEncryptedFile(fileId: string, encryptionKey: CryptoKey): Promise<{
|
|
2048
|
+
blob: Blob;
|
|
2049
|
+
metadata: StoredFileMetadata;
|
|
2050
|
+
} | null>;
|
|
2051
|
+
/**
|
|
2052
|
+
* Deletes a file from OPFS.
|
|
2053
|
+
*
|
|
2054
|
+
* @param fileId - The file identifier
|
|
2055
|
+
*/
|
|
2056
|
+
declare function deleteEncryptedFile(fileId: string): Promise<void>;
|
|
2057
|
+
/**
|
|
2058
|
+
* Checks if a file exists in OPFS.
|
|
2059
|
+
*
|
|
2060
|
+
* @param fileId - The file identifier
|
|
2061
|
+
*/
|
|
2062
|
+
declare function fileExists(fileId: string): Promise<boolean>;
|
|
2063
|
+
/**
|
|
2064
|
+
* Manager for blob URLs to prevent memory leaks.
|
|
2065
|
+
* Tracks active blob URLs and provides cleanup functionality.
|
|
2066
|
+
*/
|
|
2067
|
+
declare class BlobUrlManager {
|
|
2068
|
+
private activeUrls;
|
|
2069
|
+
/**
|
|
2070
|
+
* Creates a blob URL for a file and tracks it.
|
|
2071
|
+
*/
|
|
2072
|
+
createUrl(fileId: string, blob: Blob): string;
|
|
2073
|
+
/**
|
|
2074
|
+
* Gets the active blob URL for a file, if any.
|
|
2075
|
+
*/
|
|
2076
|
+
getUrl(fileId: string): string | undefined;
|
|
2077
|
+
/**
|
|
2078
|
+
* Revokes a blob URL and removes it from tracking.
|
|
2079
|
+
*/
|
|
2080
|
+
revokeUrl(fileId: string): void;
|
|
2081
|
+
/**
|
|
2082
|
+
* Revokes all tracked blob URLs.
|
|
2083
|
+
*/
|
|
2084
|
+
revokeAll(): void;
|
|
2085
|
+
/**
|
|
2086
|
+
* Gets the count of active blob URLs.
|
|
2087
|
+
*/
|
|
2088
|
+
get size(): number;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
1985
2091
|
/**
|
|
1986
2092
|
* Combined WatermelonDB schema for all SDK storage modules.
|
|
1987
2093
|
*
|
|
@@ -3801,4 +3907,4 @@ declare function storeDriveToken(accessToken: string, expiresIn?: number, refres
|
|
|
3801
3907
|
*/
|
|
3802
3908
|
declare function hasDriveCredentials(): boolean;
|
|
3803
3909
|
|
|
3804
|
-
export { DEFAULT_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type CreateConversationOptions, type CreateMemoryOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateUserPreferenceOptions, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CONVERSATIONS_FOLDER as DEFAULT_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as DEFAULT_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_DROPBOX_FOLDER, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_PERSONALITY_SETTINGS, type DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, type EmbeddedWalletSignerFn, type FileMetadata, type GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, type MemoryItem, type MemoryType, type OCRFile, type PdfFile, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type ProfileUpdate, type ProgressCallback, type ProviderAuthState, type ProviderBackupState, SLIDER_CONFIG, type SearchMessagesOptions, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type SignMessageFn, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredMemory, Memory as StoredMemoryModel, type StoredMemoryWithSimilarity, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type UpdateMemoryOptions, type UpdateModelPreferenceOptions, type UpdateUserPreferenceOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseImageGenerationResult, type UseMemoryStorageOptions, type UseMemoryStorageResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UseSearchResult, type UseSettingsOptions, type UseSettingsResult, chatStorageMigrations, chatStorageSchema, clearAllEncryptionKeys, clearAllKeyPairs, clearCalendarToken, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, createMemoryContextSystemMessage, decryptData, decryptDataBytes, encryptData, exportPublicKey, extractConversationContext, findFileIdBySourceUrl, formatMemoriesForChat, generateCompositeKey, generateConversationId, generateUniqueKey, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getCalendarAccessToken, getDriveAccessToken, getGoogleDriveStoredToken, getValidCalendarToken, getValidDriveToken, handleCalendarCallback, handleDriveCallback, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, isCalendarCallback, isDriveCallback, memoryStorageSchema, refreshCalendarToken, refreshDriveToken, replaceUrlWithMCPPlaceholder, requestEncryptionKey, requestKeyPair, revokeCalendarToken, revokeDriveToken, sdkMigrations, sdkModelClasses, sdkSchema, settingsStorageSchema, startCalendarAuth, startDriveAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, useBackup, useBackupAuth, useChat, useChatStorage, useDropboxAuth, useDropboxBackup, useEncryption, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useImageGeneration, useMemoryStorage, useModels, useOCR, usePdf, useSearch, useSettings, userPreferencesStorageSchema };
|
|
3910
|
+
export { DEFAULT_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, BlobUrlManager, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type CreateConversationOptions, type CreateMemoryOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateUserPreferenceOptions, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CONVERSATIONS_FOLDER as DEFAULT_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as DEFAULT_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_DROPBOX_FOLDER, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_PERSONALITY_SETTINGS, type DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, type EmbeddedWalletSignerFn, type FileMetadata, type GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, type MemoryItem, type MemoryType, type OCRFile, type PdfFile, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type ProfileUpdate, type ProgressCallback, type ProviderAuthState, type ProviderBackupState, SLIDER_CONFIG, type SearchMessagesOptions, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type SignMessageFn, type SignMessageOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredMemory, Memory as StoredMemoryModel, type StoredMemoryWithSimilarity, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type UpdateMemoryOptions, type UpdateModelPreferenceOptions, type UpdateUserPreferenceOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseImageGenerationResult, type UseMemoryStorageOptions, type UseMemoryStorageResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UseSearchResult, type UseSettingsOptions, type UseSettingsResult, chatStorageMigrations, chatStorageSchema, clearAllEncryptionKeys, clearAllKeyPairs, clearCalendarToken, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, createMemoryContextSystemMessage, decryptData, decryptDataBytes, deleteEncryptedFile, encryptData, exportPublicKey, extractConversationContext, fileExists, findFileIdBySourceUrl, formatMemoriesForChat, generateCompositeKey, generateConversationId, generateUniqueKey, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getCalendarAccessToken, getDriveAccessToken, getEncryptionKey, getGoogleDriveStoredToken, getValidCalendarToken, getValidDriveToken, handleCalendarCallback, handleDriveCallback, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, isCalendarCallback, isDriveCallback, isOPFSSupported, memoryStorageSchema, readEncryptedFile, refreshCalendarToken, refreshDriveToken, replaceUrlWithMCPPlaceholder, requestEncryptionKey, requestKeyPair, revokeCalendarToken, revokeDriveToken, sdkMigrations, sdkModelClasses, sdkSchema, settingsStorageSchema, startCalendarAuth, startDriveAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, useBackup, useBackupAuth, useChat, useChatStorage, useDropboxAuth, useDropboxBackup, useEncryption, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useImageGeneration, useMemoryStorage, useModels, useOCR, usePdf, useSearch, useSettings, userPreferencesStorageSchema, writeEncryptedFile };
|