@anuma/sdk 6.27.0 → 6.27.2

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.
@@ -16446,6 +16446,7 @@ __export(index_exports, {
16446
16446
  deleteProjectOp: () => deleteProjectOp,
16447
16447
  deleteUserPreferenceOp: () => deleteUserPreferenceOp,
16448
16448
  deleteVaultMemoryOp: () => deleteVaultMemoryOp,
16449
+ deriveKeyFromSignatureBytes: () => deriveKeyFromSignatureBytes,
16449
16450
  eagerEmbedContent: () => eagerEmbedContent,
16450
16451
  embedAllMessages: () => embedAllMessages,
16451
16452
  embedMessage: () => embedMessage,
@@ -19051,11 +19052,32 @@ function clearAllEncryptionState() {
19051
19052
  function clearAllEncryptionKeys() {
19052
19053
  clearAllEncryptionState();
19053
19054
  }
19055
+ function hexNibble(code) {
19056
+ if (code >= 48 && code <= 57) return code - 48;
19057
+ if (code >= 65 && code <= 70) return code - 55;
19058
+ if (code >= 97 && code <= 102) return code - 87;
19059
+ return -1;
19060
+ }
19054
19061
  function hexToBytes(hex) {
19062
+ if (typeof hex !== "string") {
19063
+ throw new TypeError(
19064
+ "hexToBytes: expected a hex string. Pass raw signature bytes to deriveKeyFromSignatureBytes instead of stringifying them."
19065
+ );
19066
+ }
19055
19067
  const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex;
19068
+ if (cleanHex.length === 0 || cleanHex.length % 2 !== 0) {
19069
+ throw new Error(
19070
+ `hexToBytes: invalid hex string (expected a non-empty even length, got ${cleanHex.length})`
19071
+ );
19072
+ }
19056
19073
  const bytes = new Uint8Array(cleanHex.length / 2);
19057
19074
  for (let i = 0; i < cleanHex.length; i += 2) {
19058
- bytes[i / 2] = parseInt(cleanHex.slice(i, i + 2), 16);
19075
+ const hi = hexNibble(cleanHex.charCodeAt(i));
19076
+ const lo = hexNibble(cleanHex.charCodeAt(i + 1));
19077
+ if (hi < 0 || lo < 0) {
19078
+ throw new Error(`hexToBytes: invalid hex string (non-hex character at index ${i})`);
19079
+ }
19080
+ bytes[i / 2] = hi << 4 | lo;
19059
19081
  }
19060
19082
  return bytes;
19061
19083
  }
@@ -19067,15 +19089,12 @@ var SHARED_TEXT_DECODER = new TextDecoder();
19067
19089
  function isValidWalletAddress(address) {
19068
19090
  return /^0x[a-fA-F0-9]{40}$/.test(address);
19069
19091
  }
19070
- async function deriveKeyFromSignature(signature) {
19071
- const sigBytes = hexToBytes(signature);
19072
- const hashBuffer = await crypto.subtle.digest("SHA-256", sigBytes.buffer);
19073
- const hashBytes = new Uint8Array(hashBuffer);
19074
- return bytesToHex(hashBytes);
19075
- }
19076
- async function deriveKeyFromSignatureV3(signature) {
19077
- const sigBytes = hexToBytes(signature);
19078
- const ikm = await crypto.subtle.digest("SHA-256", sigBytes.buffer);
19092
+ var AES_GCM_V3_INFO = "anuma-sdk-aes-gcm-v3";
19093
+ var AES_GCM_V4_INFO = "anuma-sdk-aes-gcm-v4";
19094
+ var MIN_SIGNATURE_BYTES = 64;
19095
+ async function deriveHkdfAesKeyHex(signatureBytes, info) {
19096
+ const sigBytes = new Uint8Array(signatureBytes);
19097
+ const ikm = await crypto.subtle.digest("SHA-256", sigBytes);
19079
19098
  const hkdfKey = await crypto.subtle.importKey("raw", ikm, { name: "HKDF" }, false, [
19080
19099
  "deriveBits"
19081
19100
  ]);
@@ -19085,13 +19104,32 @@ async function deriveKeyFromSignatureV3(signature) {
19085
19104
  hash: "SHA-256",
19086
19105
  salt: new Uint8Array(32),
19087
19106
  // Zero salt (HKDF spec: uses hash-length zero buffer)
19088
- info: SHARED_TEXT_ENCODER.encode("anuma-sdk-aes-gcm-v3")
19107
+ info: SHARED_TEXT_ENCODER.encode(info)
19089
19108
  },
19090
19109
  hkdfKey,
19091
19110
  256
19092
19111
  );
19093
19112
  return bytesToHex(new Uint8Array(derivedBits));
19094
19113
  }
19114
+ async function deriveKeyFromSignature(signature) {
19115
+ const sigBytes = hexToBytes(signature);
19116
+ const hashBuffer = await crypto.subtle.digest("SHA-256", sigBytes.buffer);
19117
+ return bytesToHex(new Uint8Array(hashBuffer));
19118
+ }
19119
+ async function deriveKeyFromSignatureV3(signature) {
19120
+ return deriveHkdfAesKeyHex(hexToBytes(signature), AES_GCM_V3_INFO);
19121
+ }
19122
+ async function deriveKeyFromSignatureBytes(signature) {
19123
+ if (!(signature instanceof Uint8Array)) {
19124
+ throw new TypeError("deriveKeyFromSignatureBytes: expected a Uint8Array signature");
19125
+ }
19126
+ if (signature.byteLength < MIN_SIGNATURE_BYTES) {
19127
+ throw new Error(
19128
+ `deriveKeyFromSignatureBytes: signature must be at least ${MIN_SIGNATURE_BYTES} bytes, got ${signature.byteLength}`
19129
+ );
19130
+ }
19131
+ return deriveHkdfAesKeyHex(signature, AES_GCM_V4_INFO);
19132
+ }
19095
19133
  function getStoredKeyPair(address) {
19096
19134
  return keyPairStore.get(address) ?? null;
19097
19135
  }
@@ -19109,8 +19147,9 @@ async function deriveKeyPairFromSignature(signature, address) {
19109
19147
  {
19110
19148
  name: "HKDF",
19111
19149
  hash: "SHA-256",
19150
+ // EVM addresses are case-insensitive. Base58 is not — this salt stays
19151
+ // behind the EVM address gate in requestKeyPair.
19112
19152
  salt: SHARED_TEXT_ENCODER.encode(address.toLowerCase()),
19113
- // Wallet address as salt
19114
19153
  info: SHARED_TEXT_ENCODER.encode("ECDH-P256-KeyPair")
19115
19154
  // Context info
19116
19155
  },
@@ -23358,6 +23397,30 @@ var import_watermelondb20 = __toESM(require_watermelondb());
23358
23397
  init_logger();
23359
23398
 
23360
23399
  // src/lib/storage/mcpImages.ts
23400
+ var IMAGE_TOOL_NAMES = /* @__PURE__ */ new Set([
23401
+ "AnumaMediaMCP-anuma_create_image",
23402
+ "anuma_create_image",
23403
+ // Deprecated anuma-image-mcp tools, retained so images in already-stored
23404
+ // conversations still re-materialize on replay.
23405
+ "AnumaImageMCP-generate_cloud_image",
23406
+ "AnumaImageMCP-edit_cloud_image",
23407
+ "generate_cloud_image",
23408
+ "edit_cloud_image"
23409
+ ]);
23410
+ function toolOutputForModel(name, output) {
23411
+ if (!name || !IMAGE_TOOL_NAMES.has(name)) return output;
23412
+ try {
23413
+ const {
23414
+ imageUrl: _imageUrl,
23415
+ url: _url,
23416
+ output_images: _outputImages,
23417
+ ...rest
23418
+ } = JSON.parse(output);
23419
+ return JSON.stringify(rest);
23420
+ } catch {
23421
+ return output;
23422
+ }
23423
+ }
23361
23424
  var VIDEO_EXTENSIONS = ["mp4", "webm", "mov"];
23362
23425
  var VIDEO_EXTENSION_RE = new RegExp(`\\.(${VIDEO_EXTENSIONS.join("|")})(?:[?#]|$)`, "i");
23363
23426
  function videoExtensionOf(value) {
@@ -37102,6 +37165,40 @@ function extractLastUserText(messages) {
37102
37165
  function isToolErrorResult(result) {
37103
37166
  return result !== null && typeof result === "object" && "error" in result && typeof result.error === "string";
37104
37167
  }
37168
+ function serverToolCallMessages(events, messages, skipIds) {
37169
+ const seen = new Set(skipIds);
37170
+ for (const m of messages) {
37171
+ if (m.tool_call_id) seen.add(m.tool_call_id);
37172
+ for (const tc of m.tool_calls ?? []) if (tc.id) seen.add(tc.id);
37173
+ }
37174
+ const executed = [];
37175
+ for (const event of events ?? []) {
37176
+ if (!event.id || event.output === void 0 || event.output === null || seen.has(event.id)) {
37177
+ continue;
37178
+ }
37179
+ seen.add(event.id);
37180
+ executed.push(event);
37181
+ }
37182
+ if (executed.length === 0) return [];
37183
+ return [
37184
+ {
37185
+ role: "assistant",
37186
+ content: void 0,
37187
+ tool_calls: executed.map((event) => ({
37188
+ id: event.id,
37189
+ type: "function",
37190
+ function: { name: event.name, arguments: event.arguments }
37191
+ }))
37192
+ },
37193
+ ...executed.map(
37194
+ (event) => ({
37195
+ role: "tool",
37196
+ tool_call_id: event.id,
37197
+ content: [{ type: "text", text: toolOutputForModel(event.name, event.output ?? "") }]
37198
+ })
37199
+ )
37200
+ ];
37201
+ }
37105
37202
  function getToolName(tool) {
37106
37203
  const func = tool.function;
37107
37204
  const nestedName = func?.name;
@@ -37871,7 +37968,14 @@ Executing tool: ${toolInfo}
37871
37968
  }
37872
37969
  }))
37873
37970
  };
37874
- const toolResultMessages = [assistantMessage];
37971
+ const toolResultMessages = [
37972
+ ...serverToolCallMessages(
37973
+ currentAccumulator.toolCallEvents,
37974
+ currentMessages,
37975
+ new Set(toolCallsToExecute.map((tc) => tc.id))
37976
+ ),
37977
+ assistantMessage
37978
+ ];
37875
37979
  for (const execResult of continueResults) {
37876
37980
  const resultContent = execResult.error ? `Error: ${execResult.error}` : safeJsonStringify(execResult.result);
37877
37981
  toolResultMessages.push({
@@ -38755,6 +38859,7 @@ function buildSystemPrompt(ctx, options) {
38755
38859
  deleteProjectOp,
38756
38860
  deleteUserPreferenceOp,
38757
38861
  deleteVaultMemoryOp,
38862
+ deriveKeyFromSignatureBytes,
38758
38863
  eagerEmbedContent,
38759
38864
  embedAllMessages,
38760
38865
  embedMessage,
@@ -3908,6 +3908,10 @@ declare class ConversationSummary extends Model$1 {
3908
3908
  * Encryption key version type.
3909
3909
  * - "v2": Legacy SHA-256 derived key (for reading enc:v2: data)
3910
3910
  * - "v3": HKDF derived key with domain separation (for new encryption)
3911
+ *
3912
+ * Raw signature bytes (Privy Solana `signMessage` returns a `Uint8Array`) are
3913
+ * not a stored version. Derive them with {@link deriveKeyFromSignatureBytes}.
3914
+ * {@link requestEncryptionKey} still derives v2 and v3 from a hex signature only.
3911
3915
  */
3912
3916
  type EncryptionKeyVersion = "v2" | "v3";
3913
3917
  /**
@@ -3977,6 +3981,25 @@ declare function clearAllEncryptionState(): void;
3977
3981
  * requests, and derived ECDH key pairs (both in-memory and persisted).
3978
3982
  */
3979
3983
  declare function clearAllEncryptionKeys(): void;
3984
+ /**
3985
+ * Derives the bytes-native AES key from a raw signature.
3986
+ *
3987
+ * Privy Solana `signMessage` returns a `Uint8Array`. Pass those bytes here.
3988
+ * The signature is never hex-encoded, base58-encoded, or passed through
3989
+ * `String()`. That string round-trip is what made {@link hexToBytes} store
3990
+ * zeros for every non-hex pair and yield a low-entropy AES key.
3991
+ *
3992
+ * This is the derivation for the next key version (`anuma-sdk-aes-gcm-v4`).
3993
+ * {@link requestEncryptionKey} does not install it; v2 and v3 stay on the
3994
+ * hex-string path so existing ciphertext keeps decrypting. The return value
3995
+ * is the same 64-char hex form the in-memory store already uses.
3996
+ *
3997
+ * @param signature - Raw signature bytes. Must be at least 64 bytes.
3998
+ * @returns 32-byte AES-GCM key as hex, without a `0x` prefix.
3999
+ * @throws Error when `signature` is shorter than 64 bytes.
4000
+ * @category Encryption
4001
+ */
4002
+ declare function deriveKeyFromSignatureBytes(signature: Uint8Array): Promise<string>;
3980
4003
  /**
3981
4004
  * Gets the encryption key from in-memory storage and imports it as a CryptoKey.
3982
4005
  * The key must have been previously requested via requestEncryptionKey.
@@ -4174,6 +4197,11 @@ interface SignMessageOptions {
4174
4197
  /**
4175
4198
  * Type for the signMessage function that client must provide.
4176
4199
  * This is typically from Privy's useSignMessage hook.
4200
+ *
4201
+ * The resolved value must be a hex signature (`0x`-prefixed or bare). A
4202
+ * non-hex string — including `String(uint8Array)` or a base58 signature —
4203
+ * throws from key derivation instead of becoming a zero-filled AES key.
4204
+ * Raw signature bytes go to {@link deriveKeyFromSignatureBytes}.
4177
4205
  */
4178
4206
  type SignMessageFn = (message: string, options?: SignMessageOptions) => Promise<string>;
4179
4207
  /**
@@ -11255,4 +11283,4 @@ declare function sanitizeQuotes(s: string): string;
11255
11283
  declare function renderTemplate(value: string | null | undefined, template: string): string | null;
11256
11284
  declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
11257
11285
 
11258
- export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationAction, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type PublishedPhotoMemory, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, assembleMemoryContext, backfillMemoryTopicsOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isDegradedTopicSkip, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp, verifyMemoriesForPublish };
11286
+ export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationAction, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type PublishedPhotoMemory, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, assembleMemoryContext, backfillMemoryTopicsOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, deriveKeyFromSignatureBytes, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isDegradedTopicSkip, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp, verifyMemoriesForPublish };
@@ -3908,6 +3908,10 @@ declare class ConversationSummary extends Model$1 {
3908
3908
  * Encryption key version type.
3909
3909
  * - "v2": Legacy SHA-256 derived key (for reading enc:v2: data)
3910
3910
  * - "v3": HKDF derived key with domain separation (for new encryption)
3911
+ *
3912
+ * Raw signature bytes (Privy Solana `signMessage` returns a `Uint8Array`) are
3913
+ * not a stored version. Derive them with {@link deriveKeyFromSignatureBytes}.
3914
+ * {@link requestEncryptionKey} still derives v2 and v3 from a hex signature only.
3911
3915
  */
3912
3916
  type EncryptionKeyVersion = "v2" | "v3";
3913
3917
  /**
@@ -3977,6 +3981,25 @@ declare function clearAllEncryptionState(): void;
3977
3981
  * requests, and derived ECDH key pairs (both in-memory and persisted).
3978
3982
  */
3979
3983
  declare function clearAllEncryptionKeys(): void;
3984
+ /**
3985
+ * Derives the bytes-native AES key from a raw signature.
3986
+ *
3987
+ * Privy Solana `signMessage` returns a `Uint8Array`. Pass those bytes here.
3988
+ * The signature is never hex-encoded, base58-encoded, or passed through
3989
+ * `String()`. That string round-trip is what made {@link hexToBytes} store
3990
+ * zeros for every non-hex pair and yield a low-entropy AES key.
3991
+ *
3992
+ * This is the derivation for the next key version (`anuma-sdk-aes-gcm-v4`).
3993
+ * {@link requestEncryptionKey} does not install it; v2 and v3 stay on the
3994
+ * hex-string path so existing ciphertext keeps decrypting. The return value
3995
+ * is the same 64-char hex form the in-memory store already uses.
3996
+ *
3997
+ * @param signature - Raw signature bytes. Must be at least 64 bytes.
3998
+ * @returns 32-byte AES-GCM key as hex, without a `0x` prefix.
3999
+ * @throws Error when `signature` is shorter than 64 bytes.
4000
+ * @category Encryption
4001
+ */
4002
+ declare function deriveKeyFromSignatureBytes(signature: Uint8Array): Promise<string>;
3980
4003
  /**
3981
4004
  * Gets the encryption key from in-memory storage and imports it as a CryptoKey.
3982
4005
  * The key must have been previously requested via requestEncryptionKey.
@@ -4174,6 +4197,11 @@ interface SignMessageOptions {
4174
4197
  /**
4175
4198
  * Type for the signMessage function that client must provide.
4176
4199
  * This is typically from Privy's useSignMessage hook.
4200
+ *
4201
+ * The resolved value must be a hex signature (`0x`-prefixed or bare). A
4202
+ * non-hex string — including `String(uint8Array)` or a base58 signature —
4203
+ * throws from key derivation instead of becoming a zero-filled AES key.
4204
+ * Raw signature bytes go to {@link deriveKeyFromSignatureBytes}.
4177
4205
  */
4178
4206
  type SignMessageFn = (message: string, options?: SignMessageOptions) => Promise<string>;
4179
4207
  /**
@@ -11255,4 +11283,4 @@ declare function sanitizeQuotes(s: string): string;
11255
11283
  declare function renderTemplate(value: string | null | undefined, template: string): string | null;
11256
11284
  declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
11257
11285
 
11258
- export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationAction, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type PublishedPhotoMemory, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, assembleMemoryContext, backfillMemoryTopicsOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isDegradedTopicSkip, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp, verifyMemoriesForPublish };
11286
+ export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationAction, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type PublishedPhotoMemory, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, assembleMemoryContext, backfillMemoryTopicsOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, deriveKeyFromSignatureBytes, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isDegradedTopicSkip, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp, verifyMemoriesForPublish };
@@ -17377,11 +17377,32 @@ function clearAllEncryptionState() {
17377
17377
  function clearAllEncryptionKeys() {
17378
17378
  clearAllEncryptionState();
17379
17379
  }
17380
+ function hexNibble(code) {
17381
+ if (code >= 48 && code <= 57) return code - 48;
17382
+ if (code >= 65 && code <= 70) return code - 55;
17383
+ if (code >= 97 && code <= 102) return code - 87;
17384
+ return -1;
17385
+ }
17380
17386
  function hexToBytes(hex) {
17387
+ if (typeof hex !== "string") {
17388
+ throw new TypeError(
17389
+ "hexToBytes: expected a hex string. Pass raw signature bytes to deriveKeyFromSignatureBytes instead of stringifying them."
17390
+ );
17391
+ }
17381
17392
  const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex;
17393
+ if (cleanHex.length === 0 || cleanHex.length % 2 !== 0) {
17394
+ throw new Error(
17395
+ `hexToBytes: invalid hex string (expected a non-empty even length, got ${cleanHex.length})`
17396
+ );
17397
+ }
17382
17398
  const bytes = new Uint8Array(cleanHex.length / 2);
17383
17399
  for (let i = 0; i < cleanHex.length; i += 2) {
17384
- bytes[i / 2] = parseInt(cleanHex.slice(i, i + 2), 16);
17400
+ const hi = hexNibble(cleanHex.charCodeAt(i));
17401
+ const lo = hexNibble(cleanHex.charCodeAt(i + 1));
17402
+ if (hi < 0 || lo < 0) {
17403
+ throw new Error(`hexToBytes: invalid hex string (non-hex character at index ${i})`);
17404
+ }
17405
+ bytes[i / 2] = hi << 4 | lo;
17385
17406
  }
17386
17407
  return bytes;
17387
17408
  }
@@ -17393,15 +17414,12 @@ var SHARED_TEXT_DECODER = new TextDecoder();
17393
17414
  function isValidWalletAddress(address) {
17394
17415
  return /^0x[a-fA-F0-9]{40}$/.test(address);
17395
17416
  }
17396
- async function deriveKeyFromSignature(signature) {
17397
- const sigBytes = hexToBytes(signature);
17398
- const hashBuffer = await crypto.subtle.digest("SHA-256", sigBytes.buffer);
17399
- const hashBytes = new Uint8Array(hashBuffer);
17400
- return bytesToHex(hashBytes);
17401
- }
17402
- async function deriveKeyFromSignatureV3(signature) {
17403
- const sigBytes = hexToBytes(signature);
17404
- const ikm = await crypto.subtle.digest("SHA-256", sigBytes.buffer);
17417
+ var AES_GCM_V3_INFO = "anuma-sdk-aes-gcm-v3";
17418
+ var AES_GCM_V4_INFO = "anuma-sdk-aes-gcm-v4";
17419
+ var MIN_SIGNATURE_BYTES = 64;
17420
+ async function deriveHkdfAesKeyHex(signatureBytes, info) {
17421
+ const sigBytes = new Uint8Array(signatureBytes);
17422
+ const ikm = await crypto.subtle.digest("SHA-256", sigBytes);
17405
17423
  const hkdfKey = await crypto.subtle.importKey("raw", ikm, { name: "HKDF" }, false, [
17406
17424
  "deriveBits"
17407
17425
  ]);
@@ -17411,13 +17429,32 @@ async function deriveKeyFromSignatureV3(signature) {
17411
17429
  hash: "SHA-256",
17412
17430
  salt: new Uint8Array(32),
17413
17431
  // Zero salt (HKDF spec: uses hash-length zero buffer)
17414
- info: SHARED_TEXT_ENCODER.encode("anuma-sdk-aes-gcm-v3")
17432
+ info: SHARED_TEXT_ENCODER.encode(info)
17415
17433
  },
17416
17434
  hkdfKey,
17417
17435
  256
17418
17436
  );
17419
17437
  return bytesToHex(new Uint8Array(derivedBits));
17420
17438
  }
17439
+ async function deriveKeyFromSignature(signature) {
17440
+ const sigBytes = hexToBytes(signature);
17441
+ const hashBuffer = await crypto.subtle.digest("SHA-256", sigBytes.buffer);
17442
+ return bytesToHex(new Uint8Array(hashBuffer));
17443
+ }
17444
+ async function deriveKeyFromSignatureV3(signature) {
17445
+ return deriveHkdfAesKeyHex(hexToBytes(signature), AES_GCM_V3_INFO);
17446
+ }
17447
+ async function deriveKeyFromSignatureBytes(signature) {
17448
+ if (!(signature instanceof Uint8Array)) {
17449
+ throw new TypeError("deriveKeyFromSignatureBytes: expected a Uint8Array signature");
17450
+ }
17451
+ if (signature.byteLength < MIN_SIGNATURE_BYTES) {
17452
+ throw new Error(
17453
+ `deriveKeyFromSignatureBytes: signature must be at least ${MIN_SIGNATURE_BYTES} bytes, got ${signature.byteLength}`
17454
+ );
17455
+ }
17456
+ return deriveHkdfAesKeyHex(signature, AES_GCM_V4_INFO);
17457
+ }
17421
17458
  function getStoredKeyPair(address) {
17422
17459
  return keyPairStore.get(address) ?? null;
17423
17460
  }
@@ -17435,8 +17472,9 @@ async function deriveKeyPairFromSignature(signature, address) {
17435
17472
  {
17436
17473
  name: "HKDF",
17437
17474
  hash: "SHA-256",
17475
+ // EVM addresses are case-insensitive. Base58 is not — this salt stays
17476
+ // behind the EVM address gate in requestKeyPair.
17438
17477
  salt: SHARED_TEXT_ENCODER.encode(address.toLowerCase()),
17439
- // Wallet address as salt
17440
17478
  info: SHARED_TEXT_ENCODER.encode("ECDH-P256-KeyPair")
17441
17479
  // Context info
17442
17480
  },
@@ -21672,6 +21710,30 @@ function isSupportedMediaType(mimeType) {
21672
21710
  var import_watermelondb20 = __toESM(require_watermelondb());
21673
21711
 
21674
21712
  // src/lib/storage/mcpImages.ts
21713
+ var IMAGE_TOOL_NAMES = /* @__PURE__ */ new Set([
21714
+ "AnumaMediaMCP-anuma_create_image",
21715
+ "anuma_create_image",
21716
+ // Deprecated anuma-image-mcp tools, retained so images in already-stored
21717
+ // conversations still re-materialize on replay.
21718
+ "AnumaImageMCP-generate_cloud_image",
21719
+ "AnumaImageMCP-edit_cloud_image",
21720
+ "generate_cloud_image",
21721
+ "edit_cloud_image"
21722
+ ]);
21723
+ function toolOutputForModel(name, output) {
21724
+ if (!name || !IMAGE_TOOL_NAMES.has(name)) return output;
21725
+ try {
21726
+ const {
21727
+ imageUrl: _imageUrl,
21728
+ url: _url,
21729
+ output_images: _outputImages,
21730
+ ...rest
21731
+ } = JSON.parse(output);
21732
+ return JSON.stringify(rest);
21733
+ } catch {
21734
+ return output;
21735
+ }
21736
+ }
21675
21737
  var VIDEO_EXTENSIONS = ["mp4", "webm", "mov"];
21676
21738
  var VIDEO_EXTENSION_RE = new RegExp(`\\.(${VIDEO_EXTENSIONS.join("|")})(?:[?#]|$)`, "i");
21677
21739
  function videoExtensionOf(value) {
@@ -35349,6 +35411,40 @@ function extractLastUserText(messages) {
35349
35411
  function isToolErrorResult(result) {
35350
35412
  return result !== null && typeof result === "object" && "error" in result && typeof result.error === "string";
35351
35413
  }
35414
+ function serverToolCallMessages(events, messages, skipIds) {
35415
+ const seen = new Set(skipIds);
35416
+ for (const m of messages) {
35417
+ if (m.tool_call_id) seen.add(m.tool_call_id);
35418
+ for (const tc of m.tool_calls ?? []) if (tc.id) seen.add(tc.id);
35419
+ }
35420
+ const executed = [];
35421
+ for (const event of events ?? []) {
35422
+ if (!event.id || event.output === void 0 || event.output === null || seen.has(event.id)) {
35423
+ continue;
35424
+ }
35425
+ seen.add(event.id);
35426
+ executed.push(event);
35427
+ }
35428
+ if (executed.length === 0) return [];
35429
+ return [
35430
+ {
35431
+ role: "assistant",
35432
+ content: void 0,
35433
+ tool_calls: executed.map((event) => ({
35434
+ id: event.id,
35435
+ type: "function",
35436
+ function: { name: event.name, arguments: event.arguments }
35437
+ }))
35438
+ },
35439
+ ...executed.map(
35440
+ (event) => ({
35441
+ role: "tool",
35442
+ tool_call_id: event.id,
35443
+ content: [{ type: "text", text: toolOutputForModel(event.name, event.output ?? "") }]
35444
+ })
35445
+ )
35446
+ ];
35447
+ }
35352
35448
  function getToolName(tool) {
35353
35449
  const func = tool.function;
35354
35450
  const nestedName = func?.name;
@@ -36118,7 +36214,14 @@ Executing tool: ${toolInfo}
36118
36214
  }
36119
36215
  }))
36120
36216
  };
36121
- const toolResultMessages = [assistantMessage];
36217
+ const toolResultMessages = [
36218
+ ...serverToolCallMessages(
36219
+ currentAccumulator.toolCallEvents,
36220
+ currentMessages,
36221
+ new Set(toolCallsToExecute.map((tc) => tc.id))
36222
+ ),
36223
+ assistantMessage
36224
+ ];
36122
36225
  for (const execResult of continueResults) {
36123
36226
  const resultContent = execResult.error ? `Error: ${execResult.error}` : safeJsonStringify(execResult.result);
36124
36227
  toolResultMessages.push({
@@ -37001,6 +37104,7 @@ export {
37001
37104
  deleteProjectOp,
37002
37105
  deleteUserPreferenceOp,
37003
37106
  deleteVaultMemoryOp,
37107
+ deriveKeyFromSignatureBytes,
37004
37108
  eagerEmbedContent,
37005
37109
  embedAllMessages,
37006
37110
  embedMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuma/sdk",
3
- "version": "6.27.0",
3
+ "version": "6.27.2",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",