@anuma/sdk 6.7.2 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{react/chunk-B5UPJRCU.mjs → expo/chunk-CJ32HO6Q.mjs} +62 -11
- package/dist/expo/{chunk-VOMDHMKH.mjs → chunk-OUFITMDL.mjs} +1 -1
- package/dist/expo/{chunk-2YHVYDEL.mjs → chunk-YO5UXOC4.mjs} +3 -2
- package/dist/{react/consolidate-ZCGS7QUA.mjs → expo/consolidate-4BMNVOL4.mjs} +3 -2
- package/dist/expo/index.cjs +101 -18
- package/dist/expo/index.d.mts +105 -2
- package/dist/expo/index.d.ts +105 -2
- package/dist/expo/index.mjs +34 -10
- package/dist/expo/{recall-M3JVFTZL.mjs → recall-IEKVX4JL.mjs} +2 -2
- package/dist/index.cjs +10 -0
- package/dist/index.d.mts +49 -1
- package/dist/index.d.ts +49 -1
- package/dist/index.mjs +8 -0
- package/dist/{expo/chunk-B5UPJRCU.mjs → react/chunk-CJ32HO6Q.mjs} +62 -11
- package/dist/react/{chunk-2ARMO2NN.mjs → chunk-DY5VGC6K.mjs} +1 -1
- package/dist/react/{chunk-S6WPXD5N.mjs → chunk-POCLKALT.mjs} +3 -2
- package/dist/{expo/consolidate-TWE6OSSZ.mjs → react/consolidate-5TP3J6BY.mjs} +3 -2
- package/dist/react/index.cjs +101 -18
- package/dist/react/index.d.mts +105 -2
- package/dist/react/index.d.ts +105 -2
- package/dist/react/index.mjs +34 -10
- package/dist/react/{recall-ROEK55FJ.mjs → recall-B2AIAPCM.mjs} +2 -2
- package/dist/server/{chunk-TD7SMY7C.mjs → chunk-FS6DNUNT.mjs} +3 -2
- package/dist/server/{chunk-VHWLLYKO.mjs → chunk-KF5OU4IN.mjs} +62 -11
- package/dist/server/{chunk-CR5P3YIK.mjs → chunk-MEQ2PAEX.mjs} +1 -1
- package/dist/server/{consolidate-FWYK5KXB.mjs → consolidate-QDWEYFTZ.mjs} +3 -2
- package/dist/server/index.cjs +101 -18
- package/dist/server/index.d.mts +105 -2
- package/dist/server/index.d.ts +105 -2
- package/dist/server/index.mjs +34 -10
- package/dist/server/{recall-CGDEW2LQ.mjs → recall-2GAPE2XH.mjs} +2 -2
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
|
@@ -6122,6 +6122,44 @@ declare function getMemoriesByEntityNamesOp(ctx: EntityOperationsContext, entity
|
|
|
6122
6122
|
*/
|
|
6123
6123
|
declare function getEntitiesByMemoryIdsOp(ctx: EntityOperationsContext, memoryIds: readonly string[]): Promise<Map<string, Set<string>>>;
|
|
6124
6124
|
|
|
6125
|
+
/**
|
|
6126
|
+
* Shared portal LLM call for the memory pipeline.
|
|
6127
|
+
*
|
|
6128
|
+
* The three LLM-driven steps (`extractFacts`, `consolidateMemory`,
|
|
6129
|
+
* `decomposeQuery`) share the same shape: POST to `/api/v1/chat/completions`
|
|
6130
|
+
* with a system+user prompt and `response_format: json_object`, parse
|
|
6131
|
+
* `choices[0].message.content` as JSON, validate, return null on any failure.
|
|
6132
|
+
* This helper owns the fetch+timeout+parse+log boilerplate so each caller
|
|
6133
|
+
* stays focused on its prompt and validator.
|
|
6134
|
+
*
|
|
6135
|
+
* PROMPT CACHING. The portal inserts explicit prompt-cache breakpoints only for
|
|
6136
|
+
* `anthropic/` models. Its request schema does carry OpenAI's
|
|
6137
|
+
* `prompt_cache_key`, but that is a routing hint for OpenAI's own implicit
|
|
6138
|
+
* cache rather than a switch that enables caching, and we deliberately don't
|
|
6139
|
+
* send it: the memory pipeline runs open-weights models by default (gpt-oss for
|
|
6140
|
+
* extraction/topics, ling for consolidation), and this module already has one
|
|
6141
|
+
* hard lesson about OpenAI-standard fields a non-OpenAI provider hard-400s on
|
|
6142
|
+
* (`response_format`, below). Revisit only with a verified per-provider gate.
|
|
6143
|
+
*
|
|
6144
|
+
* So on the models this pipeline actually uses, the only cache that can hit is
|
|
6145
|
+
* the provider's own implicit prefix cache — which makes prefix stability the
|
|
6146
|
+
* one lever a caller controls. Messages are assembled system-first (below), so
|
|
6147
|
+
* every caller must pass a CONSTANT `systemPrompt` and keep all per-call
|
|
6148
|
+
* material in `userMessage`: a single interpolated timestamp, id, or count in a
|
|
6149
|
+
* system prompt shifts every byte after it and misses the cache on every
|
|
6150
|
+
* request thereafter. The memory callers are regression-gated on that property
|
|
6151
|
+
* in `promptPrefixStability.test.ts`.
|
|
6152
|
+
*
|
|
6153
|
+
* Whether those implicit caches hit is observable: each successful response
|
|
6154
|
+
* logs the portal's reported token counts at debug level, including
|
|
6155
|
+
* `portal.cached_tokens` (the prompt tokens the provider served from cache —
|
|
6156
|
+
* the portal omits the field when there was no hit). See {@link logPortalUsage}.
|
|
6157
|
+
*
|
|
6158
|
+
* There is no batch/async-bulk route on the portal, so a backfill or reindex
|
|
6159
|
+
* has no discounted-throughput path either; its only levers are the same stable
|
|
6160
|
+
* prefix and caller-side batching (e.g. topicExtract's 10-memories-per-call).
|
|
6161
|
+
*/
|
|
6162
|
+
|
|
6125
6163
|
/**
|
|
6126
6164
|
* Auth for portal LLM calls (extraction, consolidation, decomposition,
|
|
6127
6165
|
* reflection). Mirrors `memoryEngine`'s `EmbeddingOptions` dual-auth:
|
|
@@ -6140,6 +6178,60 @@ interface PortalLlmAuth {
|
|
|
6140
6178
|
/** Function to get an auth token (e.g., Privy's getIdentityToken). Token is sent as `Authorization: Bearer`. */
|
|
6141
6179
|
getToken?: () => Promise<string | null>;
|
|
6142
6180
|
}
|
|
6181
|
+
/**
|
|
6182
|
+
* Why a portal JSON completion gave up, as a STABLE low-cardinality code.
|
|
6183
|
+
*
|
|
6184
|
+
* The retry loop has always classified its failures precisely, but only as an
|
|
6185
|
+
* interpolated `reason` string for `log.warn` — and prod ships no SDK log
|
|
6186
|
+
* (sdk#883), so in production every one of these collapsed into a single
|
|
6187
|
+
* `empty-after-retry` with no way to tell them apart. That is what made the
|
|
6188
|
+
* 2026-08-11 audit need a Prometheus cross-check to discover that the portal
|
|
6189
|
+
* was returning HTTP 200 with an empty body on ~60% of extraction turns.
|
|
6190
|
+
*
|
|
6191
|
+
* Codes are deliberately an enum, not the `reason` string: the strings embed
|
|
6192
|
+
* status codes and error messages, so they are unbounded and useless as an
|
|
6193
|
+
* analytics property. Keep this list SHORT and stable — it is a telemetry
|
|
6194
|
+
* contract, and a value added here has to mean the same thing in six months.
|
|
6195
|
+
*
|
|
6196
|
+
* @public
|
|
6197
|
+
*/
|
|
6198
|
+
type PortalLlmFailureReason =
|
|
6199
|
+
/** No usable credential — `getToken` returned null or threw. Terminal. */
|
|
6200
|
+
"auth-unavailable"
|
|
6201
|
+
/** Non-retryable HTTP status (400/403/404, or 401 on the static-apiKey path). */
|
|
6202
|
+
| "http-terminal"
|
|
6203
|
+
/** Retryable status (408/409/425/429/5xx) that never succeeded. */
|
|
6204
|
+
| "http-retryable"
|
|
6205
|
+
/** Network error or the per-attempt timeout aborted the fetch. */
|
|
6206
|
+
| "network"
|
|
6207
|
+
/** HTTP 200 but the envelope itself wasn't JSON. */
|
|
6208
|
+
| "body-parse-failed"
|
|
6209
|
+
/**
|
|
6210
|
+
* HTTP 200 with NO completion content. The reasoning-class failure mode:
|
|
6211
|
+
* the model spends its budget on unreturned thinking and answers empty.
|
|
6212
|
+
*/
|
|
6213
|
+
| "empty-content"
|
|
6214
|
+
/** Content present, but no parseable JSON in it (prose, a clarifying question). */
|
|
6215
|
+
| "invalid-json"
|
|
6216
|
+
/** Content parsed to a literal `null`, which is never a valid response. */
|
|
6217
|
+
| "null-completion"
|
|
6218
|
+
/** `totalTimeoutMs` was spent before the next attempt could run. */
|
|
6219
|
+
| "time-budget-exhausted";
|
|
6220
|
+
/**
|
|
6221
|
+
* A give-up report: the classified {@link PortalLlmFailureReason} plus the
|
|
6222
|
+
* little context worth carrying into telemetry. Both extra fields are bounded
|
|
6223
|
+
* (a status code, a small attempt count), so both are safe as event properties.
|
|
6224
|
+
*
|
|
6225
|
+
* @public
|
|
6226
|
+
*/
|
|
6227
|
+
interface PortalLlmFailure {
|
|
6228
|
+
/** Stable code for the last failure observed. */
|
|
6229
|
+
reason: PortalLlmFailureReason;
|
|
6230
|
+
/** HTTP status, when the failure was an HTTP one. */
|
|
6231
|
+
httpStatus?: number;
|
|
6232
|
+
/** How many attempts ran before giving up (1-based, ≥ 1). */
|
|
6233
|
+
attempts: number;
|
|
6234
|
+
}
|
|
6143
6235
|
|
|
6144
6236
|
/**
|
|
6145
6237
|
* Optional LLM injection classifier — Tier-0 security second layer (PR5).
|
|
@@ -7244,8 +7336,14 @@ interface ExtractFactsOptions extends PortalLlmAuth {
|
|
|
7244
7336
|
* `{candidates: []}` "nothing durable here". Lets callers distinguish a
|
|
7245
7337
|
* silently-degrading extractor from quiet turns (the two are otherwise
|
|
7246
7338
|
* indistinguishable). See {@link extractAndRetain}'s `outcome`.
|
|
7339
|
+
*
|
|
7340
|
+
* Receives the classified {@link PortalLlmFailure}. Knowing THAT extraction
|
|
7341
|
+
* failed was not enough: the 2026-08-11 audit found ~60% of production turns
|
|
7342
|
+
* ending here and had to cross-check Prometheus to learn that the cause was
|
|
7343
|
+
* HTTP-200-with-empty-body rather than the 403 everyone assumed. Forward
|
|
7344
|
+
* `failure.reason` into analytics so the next such question is a query.
|
|
7247
7345
|
*/
|
|
7248
|
-
onExhaustedEmpty?: () => void;
|
|
7346
|
+
onExhaustedEmpty?: (failure: PortalLlmFailure) => void;
|
|
7249
7347
|
/**
|
|
7250
7348
|
* Called when the extractor DID produce candidates but PII de-anonymization
|
|
7251
7349
|
* dropped every one of them — the model mangled its placeholders (so they
|
|
@@ -7368,6 +7466,11 @@ declare function extractAndRetain(messages: AutoExtractMessage[], retainCtx: Ret
|
|
|
7368
7466
|
* "extracted but held for review".
|
|
7369
7467
|
*/
|
|
7370
7468
|
quarantined: QuarantinedMemoryInfo[];
|
|
7469
|
+
/**
|
|
7470
|
+
* Present only when `outcome` is `empty-after-retry` — the classified cause of
|
|
7471
|
+
* the give-up, so "extraction is failing" can be reported as *why* it failed.
|
|
7472
|
+
*/
|
|
7473
|
+
failure?: PortalLlmFailure;
|
|
7371
7474
|
}>;
|
|
7372
7475
|
|
|
7373
7476
|
/**
|
|
@@ -15402,4 +15505,4 @@ declare function renderAnumaTree(node: AnumaNode): React.ReactElement | null;
|
|
|
15402
15505
|
*/
|
|
15403
15506
|
declare function renderAnumaJsx(jsx: string): React.ReactElement | null;
|
|
15404
15507
|
|
|
15405
|
-
export { Anuma, type AnumaChild, AnumaJsxError, type AnumaNode, AnumaShadowIsolationProvider, type AnumaShadowIsolationProviderProps, type AnumaTheme, AnumaThemeProvider, type AnumaThemeProviderProps, AppFile as AppFileModel, type AppFileOperationsContext, type AttrValue, type AutoExtractMessage, type AutoExtractor, DEFAULT_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, BUILT_IN_TOOL_SETS, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, BlobUrlManager, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, ChartCard, type ChartCardProps, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChatStorageAdapter, type ChatStorageObservable, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type CircleProps, type ClientToolsFilterFn, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type ConversationQueryOptions, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateEntityOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateSavedToolOptions, type CreateServerToolsFilterOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, 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_EXCLUDED_SERVER_TOOLS, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DeckProps, type DisplayToolMigrations, type DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, ENTITY_FANOUT, ENTITY_KINDS, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type EncryptionKeyVersion, type EntityInput, type EntityKind, Entity as EntityModel, type EntityOperationsContext, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, FILE_PLACEHOLDER_PREFIX, FILE_PLACEHOLDER_REGEX, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, type GraphTraversalOptions, type GroupProps, HARD_DELETE_WINDOW_MS, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, INFERENCE_ID_HEADER, type IconProps, type ImageProps, type InjectionClassifierOptions, type InjectionReason, type InteractionType, type KnownTag, type LazyStoredConversation, type LineProps, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, MemoryEntity as MemoryEntityModel, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageChunk, type MessageFeedback, type MessageOrigin, type MessageSkeleton, type ModelLoadProgress, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OCRFile, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, type PdfExportOptions, type PdfExportProgress, type PdfExportStage, type PdfFile, PdfProcessor, type PendingInteraction, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PhoneCallPollingOptions, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, type ProgressCallback, Project, type ProjectOperationsContext, type PromptPreProcessor, type PromptPreProcessorContext, type ProviderAuthState, type ProviderBackupState, ProviderStreamError, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, R2_DEFAULT_TTL_MS, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RectProps, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, STREAM_RESUMABLE_HEADER, SavedTool as SavedToolModel, type SavedToolOperationsContext, type SavedToolParameter, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenProps, type ScreenResult, type ScreenedCandidate, type SearchMessagesOptions, type SearchSource, type SelectServerToolsForPromptOptions, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type ServerTool, type ServerToolsFilter, type ServerToolsFilterFn, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type SignMessageOptions, type SlideProps, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredAppFile, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredEntity, type StoredFileWithContext, type StoredMedia, Media as StoredMediaModel, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredProject, type StoredSavedTool, type StoredTopic, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, THEME_ATTRS, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type TextProps, type ThemeAttr, type ToolCallArgumentsDeltaEvent, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSource, type TranscriptionResult, type TurnCompleteEvent, type TurnSkippedEvent, type UIInteractionContextValue, UIInteractionProvider, type UIInteractionProviderProps, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateSavedToolOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseExportPdfResult, type UseFilesOptions, type UseFilesResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UsePhoneCallsOptions, type UsePhoneCallsResult, type UseProjectsOptions, type UseProjectsResult, type UseSettingsOptions, type UseSettingsResult, type UseSubscriptionOptions, type UseSubscriptionResult, type UseToolsOptions, type UseToolsResult, type UseVoiceOptions, type UseVoiceResult, type UseWalletBindingOptions, type UseWalletBindingResult, VAULT_SIZE_HOP_CAP, type VaultCandidateKey, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, type VoiceRecording, WalletPoller, WatermelonChatStorageAdapter, type WatermelonChatStorageAdapterOptions, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WhisperModel, WordProcessor, ZipProcessor, type ZipProcessorOptions, addConversationMemoriesOp, appFileToStored, archiveVaultMemoryOp, backfillMemoryEntityUserIdsOp, backfillMemoryTopicsOp, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearCalendarToken, clearConversationMemoriesOp, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGithubToken, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, clearLazyTitleCache, clearMemoryTopicsOverrideOp, clearNotionToken, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createGitHubTools, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createSavedToolOp, createServerToolsFilter, createStockPricePreProcessor, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllAppFilesOp, deleteAllVaultMemoriesForUserOp, deleteAppFileOp, deleteEncryptedFile, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteProjectOp, deleteSavedToolOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, expandToolSetsAdditive, exportElementToPdf, exportMarkdownToPdf, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractFileIds, fileExists, findById, findMatchingTools, findParentOfId, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllSavedToolsOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getAndClearGithubPendingMessage, getAndClearGithubReturnUrl, getAndClearNotionPendingMessage, getAndClearNotionReturnUrl, getAppFileMapOp, getAppFileOp, getAppFilesOp, getAudioOp, getCachedServerTools, getCalendarAccessToken, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getDriveAccessToken, getEncryptionKey, getEntitiesByMemoryIdsOp, getGithubAccessToken, getGoogleDriveStoredToken, getId, getImagesOp, getLogger, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesByEntityNamesOp, getMemoriesNeedingTopicExtractionOp, getNotionAccessToken, getNotionMCPUrl, getNumberAttr, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getSavedToolByIdOp, getServerTools, getStringAttr, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserUploadedMediaOp, getValidCalendarToken, getValidDriveToken, getValidGithubToken, getValidNotionToken, getVaultCandidateKeysOp, getVaultEmbeddingsByIdsOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, getVideosOp, handleCalendarCallback, handleDriveCallback, handleGithubCallback, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGithubCredentials, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, hasNotionCredentials, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isCalendarCallback, isDriveCallback, isGithubCallback, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, mediaToStored, migrateCalendarToken, migrateDisplayResult, migrateDriveToken, migrateGithubToken, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, parseMedia, preEmbedVaultMemories, preprocessFiles, previewToolSelection, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, rankProfileCandidates, readEncryptedFile, recall, reflect, refreshCalendarToken, refreshDriveToken, refreshEncryptionKeyIfMatches, refreshGithubToken, refreshNotionToken, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeCalendarToken, revokeDriveToken, revokeGithubToken, revokeNotionAccess, savedToolToStored, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, setMemoryVisibilityOp, settingsStorageSchema, shouldChunkMessage, shouldRefreshTools, stampTopicsExtractedAtOp, startGithubAuth, startNotionAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, storeGithubPendingMessage, storeGithubReturnUrl, storeGithubToken, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateAttrs, updateConversationProjectOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageFeedbackOp, updateProjectNameOp, updateProjectOp, updateSavedToolOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, useAnumaTheme, useBackup, useBackupAuth, useChat, useChatStorage, useCredits, useDatabaseManager, useDropboxAuth, useDropboxBackup, useEncryption, useExportPdf, useFiles, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useModels, useOCR, usePdf, usePhoneCalls, useProjects, useSettings, useSubscription, useTools, useUIInteraction, useVoice, useWalletBinding, userPreferencesStorageSchema, verifyMemoriesForPublish, walk, webPlatformStorage, writeEncryptedFile };
|
|
15508
|
+
export { Anuma, type AnumaChild, AnumaJsxError, type AnumaNode, AnumaShadowIsolationProvider, type AnumaShadowIsolationProviderProps, type AnumaTheme, AnumaThemeProvider, type AnumaThemeProviderProps, AppFile as AppFileModel, type AppFileOperationsContext, type AttrValue, type AutoExtractMessage, type AutoExtractor, DEFAULT_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, BUILT_IN_TOOL_SETS, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, BlobUrlManager, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, ChartCard, type ChartCardProps, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChatStorageAdapter, type ChatStorageObservable, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type CircleProps, type ClientToolsFilterFn, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type ConversationQueryOptions, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateEntityOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateSavedToolOptions, type CreateServerToolsFilterOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, 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_EXCLUDED_SERVER_TOOLS, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DeckProps, type DisplayToolMigrations, type DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, ENTITY_FANOUT, ENTITY_KINDS, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type EncryptionKeyVersion, type EntityInput, type EntityKind, Entity as EntityModel, type EntityOperationsContext, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, FILE_PLACEHOLDER_PREFIX, FILE_PLACEHOLDER_REGEX, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, type GraphTraversalOptions, type GroupProps, HARD_DELETE_WINDOW_MS, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, INFERENCE_ID_HEADER, type IconProps, type ImageProps, type InjectionClassifierOptions, type InjectionReason, type InteractionType, type KnownTag, type LazyStoredConversation, type LineProps, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, MemoryEntity as MemoryEntityModel, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageChunk, type MessageFeedback, type MessageOrigin, type MessageSkeleton, type ModelLoadProgress, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OCRFile, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, type PdfExportOptions, type PdfExportProgress, type PdfExportStage, type PdfFile, PdfProcessor, type PendingInteraction, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PhoneCallPollingOptions, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, type ProgressCallback, Project, type ProjectOperationsContext, type PromptPreProcessor, type PromptPreProcessorContext, type ProviderAuthState, type ProviderBackupState, ProviderStreamError, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, R2_DEFAULT_TTL_MS, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RectProps, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, STREAM_RESUMABLE_HEADER, SavedTool as SavedToolModel, type SavedToolOperationsContext, type SavedToolParameter, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenProps, type ScreenResult, type ScreenedCandidate, type SearchMessagesOptions, type SearchSource, type SelectServerToolsForPromptOptions, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type ServerTool, type ServerToolsFilter, type ServerToolsFilterFn, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type SignMessageOptions, type SlideProps, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredAppFile, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredEntity, type StoredFileWithContext, type StoredMedia, Media as StoredMediaModel, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredProject, type StoredSavedTool, type StoredTopic, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, THEME_ATTRS, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type TextProps, type ThemeAttr, type ToolCallArgumentsDeltaEvent, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSource, type TranscriptionResult, type TurnCompleteEvent, type TurnSkippedEvent, type UIInteractionContextValue, UIInteractionProvider, type UIInteractionProviderProps, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateSavedToolOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseExportPdfResult, type UseFilesOptions, type UseFilesResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UsePhoneCallsOptions, type UsePhoneCallsResult, type UseProjectsOptions, type UseProjectsResult, type UseSettingsOptions, type UseSettingsResult, type UseSubscriptionOptions, type UseSubscriptionResult, type UseToolsOptions, type UseToolsResult, type UseVoiceOptions, type UseVoiceResult, type UseWalletBindingOptions, type UseWalletBindingResult, VAULT_SIZE_HOP_CAP, type VaultCandidateKey, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, type VoiceRecording, WalletPoller, WatermelonChatStorageAdapter, type WatermelonChatStorageAdapterOptions, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WhisperModel, WordProcessor, ZipProcessor, type ZipProcessorOptions, addConversationMemoriesOp, appFileToStored, archiveVaultMemoryOp, backfillMemoryEntityUserIdsOp, backfillMemoryTopicsOp, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearCalendarToken, clearConversationMemoriesOp, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGithubToken, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, clearLazyTitleCache, clearMemoryTopicsOverrideOp, clearNotionToken, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createGitHubTools, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createSavedToolOp, createServerToolsFilter, createStockPricePreProcessor, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllAppFilesOp, deleteAllVaultMemoriesForUserOp, deleteAppFileOp, deleteEncryptedFile, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteProjectOp, deleteSavedToolOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, expandToolSetsAdditive, exportElementToPdf, exportMarkdownToPdf, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractFileIds, fileExists, findById, findMatchingTools, findParentOfId, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllSavedToolsOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getAndClearGithubPendingMessage, getAndClearGithubReturnUrl, getAndClearNotionPendingMessage, getAndClearNotionReturnUrl, getAppFileMapOp, getAppFileOp, getAppFilesOp, getAudioOp, getCachedServerTools, getCalendarAccessToken, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getDriveAccessToken, getEncryptionKey, getEntitiesByMemoryIdsOp, getGithubAccessToken, getGoogleDriveStoredToken, getId, getImagesOp, getLogger, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesByEntityNamesOp, getMemoriesNeedingTopicExtractionOp, getNotionAccessToken, getNotionMCPUrl, getNumberAttr, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getSavedToolByIdOp, getServerTools, getStringAttr, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserUploadedMediaOp, getValidCalendarToken, getValidDriveToken, getValidGithubToken, getValidNotionToken, getVaultCandidateKeysOp, getVaultEmbeddingsByIdsOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, getVideosOp, handleCalendarCallback, handleDriveCallback, handleGithubCallback, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGithubCredentials, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, hasNotionCredentials, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isCalendarCallback, isDriveCallback, isGithubCallback, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, mediaToStored, migrateCalendarToken, migrateDisplayResult, migrateDriveToken, migrateGithubToken, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, parseMedia, preEmbedVaultMemories, preprocessFiles, previewToolSelection, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, rankProfileCandidates, readEncryptedFile, recall, reflect, refreshCalendarToken, refreshDriveToken, refreshEncryptionKeyIfMatches, refreshGithubToken, refreshNotionToken, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeCalendarToken, revokeDriveToken, revokeGithubToken, revokeNotionAccess, savedToolToStored, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, setMemoryVisibilityOp, settingsStorageSchema, shouldChunkMessage, shouldRefreshTools, stampTopicsExtractedAtOp, startGithubAuth, startNotionAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, storeGithubPendingMessage, storeGithubReturnUrl, storeGithubToken, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateAttrs, updateConversationProjectOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageFeedbackOp, updateProjectNameOp, updateProjectOp, updateSavedToolOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, useAnumaTheme, useBackup, useBackupAuth, useChat, useChatStorage, useCredits, useDatabaseManager, useDropboxAuth, useDropboxBackup, useEncryption, useExportPdf, useFiles, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useModels, useOCR, usePdf, usePhoneCalls, useProjects, useSettings, useSubscription, useTools, useUIInteraction, useVoice, useWalletBinding, userPreferencesStorageSchema, verifyMemoriesForPublish, walk, webPlatformStorage, writeEncryptedFile };
|
package/dist/react/index.mjs
CHANGED
|
@@ -178,14 +178,14 @@ import {
|
|
|
178
178
|
updateVaultMemoryOp,
|
|
179
179
|
useEncryption,
|
|
180
180
|
vaultMemoryToStored
|
|
181
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-POCLKALT.mjs";
|
|
182
182
|
import {
|
|
183
183
|
PiiRedactor,
|
|
184
184
|
createStreamingDeAnonymizer,
|
|
185
185
|
isPiiRedactor,
|
|
186
186
|
notifyConsolidationFallback,
|
|
187
187
|
resolvePiiRedactor
|
|
188
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-DY5VGC6K.mjs";
|
|
189
189
|
import {
|
|
190
190
|
INTERNAL_FLOW_MARKER,
|
|
191
191
|
callPortalJsonCompletion,
|
|
@@ -196,9 +196,10 @@ import {
|
|
|
196
196
|
resolvePortalAuthHeaders,
|
|
197
197
|
setLogger,
|
|
198
198
|
supportsResponseFormat,
|
|
199
|
+
taskTypeHeader,
|
|
199
200
|
validateEndpointOverride,
|
|
200
201
|
withInternalFlowMarker
|
|
201
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-CJ32HO6Q.mjs";
|
|
202
203
|
import {
|
|
203
204
|
BASE_URL,
|
|
204
205
|
MCP_R2_DOMAIN,
|
|
@@ -5149,7 +5150,12 @@ async function callSummarizationLlm(prompt, model, token, baseUrl) {
|
|
|
5149
5150
|
method: "POST",
|
|
5150
5151
|
headers: {
|
|
5151
5152
|
"Content-Type": "application/json",
|
|
5152
|
-
Authorization: `Bearer ${token}
|
|
5153
|
+
Authorization: `Bearer ${token}`,
|
|
5154
|
+
// Names the task so the portal can own this prompt server-side instead of
|
|
5155
|
+
// trusting the one we build. Summarization is the archetypal Class-B flow:
|
|
5156
|
+
// one fixed purpose, no conversation, and today its instructions are ours
|
|
5157
|
+
// to reword.
|
|
5158
|
+
...taskTypeHeader("summarize")
|
|
5153
5159
|
},
|
|
5154
5160
|
body: JSON.stringify({
|
|
5155
5161
|
model,
|
|
@@ -7205,6 +7211,7 @@ async function classifyInjectionCandidates(candidates, options) {
|
|
|
7205
7211
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
7206
7212
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
7207
7213
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
7214
|
+
taskType: "memory_injection_check",
|
|
7208
7215
|
model: options.model ?? DEFAULT_MODEL,
|
|
7209
7216
|
systemPrompt: SYSTEM_PROMPT,
|
|
7210
7217
|
userMessage: `Candidate facts:
|
|
@@ -7679,7 +7686,7 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
|
|
|
7679
7686
|
content: m.content,
|
|
7680
7687
|
similarity: m.similarity
|
|
7681
7688
|
}));
|
|
7682
|
-
const { consolidateMemory: doConsolidate } = await import("./consolidate-
|
|
7689
|
+
const { consolidateMemory: doConsolidate } = await import("./consolidate-5TP3J6BY.mjs");
|
|
7683
7690
|
const decision = await doConsolidate(trimmed, candidates, consolidateOptions);
|
|
7684
7691
|
if (decision.action === "create") return null;
|
|
7685
7692
|
if (decision.action === "supersede" && decision.content) {
|
|
@@ -7896,10 +7903,15 @@ async function extractFacts(messages, options) {
|
|
|
7896
7903
|
}
|
|
7897
7904
|
const transcript = transcriptLines.join("\n");
|
|
7898
7905
|
const today = formatLocalDate(options.now ?? Date.now());
|
|
7906
|
+
let failure;
|
|
7899
7907
|
const parsed = await callPortalJsonCompletion({
|
|
7908
|
+
onFailure: (f) => {
|
|
7909
|
+
failure = f;
|
|
7910
|
+
},
|
|
7900
7911
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
7901
7912
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
7902
7913
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
7914
|
+
taskType: "memory_extract",
|
|
7903
7915
|
...options.endpointOverride !== void 0 && {
|
|
7904
7916
|
endpointOverride: options.endpointOverride
|
|
7905
7917
|
},
|
|
@@ -7919,7 +7931,7 @@ Extract durable user facts.`,
|
|
|
7919
7931
|
...options.backoffMs && { backoffMs: options.backoffMs }
|
|
7920
7932
|
});
|
|
7921
7933
|
if (parsed === null) {
|
|
7922
|
-
options.onExhaustedEmpty?.();
|
|
7934
|
+
options.onExhaustedEmpty?.(failure ?? { reason: "empty-content", attempts: 1 });
|
|
7923
7935
|
return [];
|
|
7924
7936
|
}
|
|
7925
7937
|
const fallbackSourceId = [...messages].reverse().find((m) => m.role === "user")?.id;
|
|
@@ -7963,14 +7975,16 @@ async function extractAndRetain(messages, retainCtx, options) {
|
|
|
7963
7975
|
...resolvedConsolidatePii !== void 0 && { piiRedaction: resolvedConsolidatePii }
|
|
7964
7976
|
} : void 0;
|
|
7965
7977
|
let exhaustedEmpty = false;
|
|
7978
|
+
let exhaustedFailure;
|
|
7966
7979
|
let droppedAfterRedaction = false;
|
|
7967
7980
|
const callerOnExhaustedEmpty = options.extract.onExhaustedEmpty;
|
|
7968
7981
|
const callerOnCandidatesDropped = options.extract.onCandidatesDropped;
|
|
7969
7982
|
const candidates = await extractFacts(messages, {
|
|
7970
7983
|
...options.extract,
|
|
7971
|
-
onExhaustedEmpty: () => {
|
|
7984
|
+
onExhaustedEmpty: (failure) => {
|
|
7972
7985
|
exhaustedEmpty = true;
|
|
7973
|
-
|
|
7986
|
+
exhaustedFailure = failure;
|
|
7987
|
+
callerOnExhaustedEmpty?.(failure);
|
|
7974
7988
|
},
|
|
7975
7989
|
onCandidatesDropped: () => {
|
|
7976
7990
|
droppedAfterRedaction = true;
|
|
@@ -8089,12 +8103,19 @@ async function extractAndRetain(messages, retainCtx, options) {
|
|
|
8089
8103
|
results,
|
|
8090
8104
|
failedCount: failedWrites,
|
|
8091
8105
|
outcome,
|
|
8092
|
-
quarantined: quarantinedInfo
|
|
8106
|
+
quarantined: quarantinedInfo,
|
|
8107
|
+
// Only meaningful alongside `outcome: "empty-after-retry"`. Returned as well
|
|
8108
|
+
// as pushed through the callback so a consumer that only inspects the result
|
|
8109
|
+
// (rather than wiring a hook) can still report WHY.
|
|
8110
|
+
...exhaustedFailure !== void 0 && { failure: exhaustedFailure }
|
|
8093
8111
|
};
|
|
8094
8112
|
}
|
|
8113
|
+
var UTTERANCE_ECHO_RE = /^(?:said|says|asked|answered|replied|guessed|typed)\s*:\s*(?:'[^']*'|"[^"]*"|‘[^’]*’|“[^”]*”)[\s.!?]*$/iu;
|
|
8095
8114
|
function isLowSignalContent(content, ownNames) {
|
|
8096
|
-
const
|
|
8115
|
+
const trimmed = content.trim();
|
|
8116
|
+
const normalized = trimmed.replace(/[.!?]+$/, "").toLowerCase();
|
|
8097
8117
|
if (normalized.length < MIN_CONTENT_LENGTH) return true;
|
|
8118
|
+
if (UTTERANCE_ECHO_RE.test(trimmed)) return true;
|
|
8098
8119
|
if (ownNames.some(
|
|
8099
8120
|
(n) => normalized === n.trim().replace(/[.!?]+$/, "").toLowerCase()
|
|
8100
8121
|
)) {
|
|
@@ -8453,6 +8474,7 @@ function createLlmDecayClassifier(options) {
|
|
|
8453
8474
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
8454
8475
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
8455
8476
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
8477
|
+
taskType: "memory_decay",
|
|
8456
8478
|
model: options.model ?? DEFAULT_MODEL2,
|
|
8457
8479
|
systemPrompt: SYSTEM_PROMPT3,
|
|
8458
8480
|
userMessage: `Memory content:
|
|
@@ -9576,6 +9598,7 @@ When a memory refers to one of these, reuse the EXACT existing name (same spelli
|
|
|
9576
9598
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
9577
9599
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
9578
9600
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
9601
|
+
taskType: "memory_topic",
|
|
9579
9602
|
...options.endpointOverride !== void 0 && {
|
|
9580
9603
|
endpointOverride: options.endpointOverride
|
|
9581
9604
|
},
|
|
@@ -9765,6 +9788,7 @@ ${evidence}`);
|
|
|
9765
9788
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
9766
9789
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
9767
9790
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
9791
|
+
taskType: "memory_verify_support",
|
|
9768
9792
|
model: options.model ?? DEFAULT_MODEL4,
|
|
9769
9793
|
systemPrompt: SYSTEM_PROMPT5,
|
|
9770
9794
|
userMessage: `Stored facts and their sources:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
callPortalJsonCompletion,
|
|
3
3
|
getLogger
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KF5OU4IN.mjs";
|
|
5
5
|
import {
|
|
6
6
|
BASE_URL,
|
|
7
7
|
__commonJS,
|
|
@@ -20845,7 +20845,7 @@ function createMemoryVaultSearchTool(vaultCtx, embeddingOptions, cache, searchOp
|
|
|
20845
20845
|
subQueries = decomp.subQueries;
|
|
20846
20846
|
}
|
|
20847
20847
|
}
|
|
20848
|
-
const { recall: recall2 } = await import("./recall-
|
|
20848
|
+
const { recall: recall2 } = await import("./recall-2GAPE2XH.mjs");
|
|
20849
20849
|
let recallDegraded = [];
|
|
20850
20850
|
const result = await recall2(
|
|
20851
20851
|
query,
|
|
@@ -21112,6 +21112,7 @@ Output strict JSON, no prose: { "expand": [<entity names to expand, verbatim fro
|
|
|
21112
21112
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
21113
21113
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
21114
21114
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
21115
|
+
taskType: "memory_graph",
|
|
21115
21116
|
model: options.model ?? DEFAULT_REFINER_MODEL,
|
|
21116
21117
|
systemPrompt,
|
|
21117
21118
|
userMessage: `Question: ${query}
|
|
@@ -40,6 +40,12 @@ function withInternalFlowMarker(systemPrompt) {
|
|
|
40
40
|
${systemPrompt}`;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
// src/lib/taskType.ts
|
|
44
|
+
var TASK_TYPE_HEADER = "X-Anuma-Task-Type";
|
|
45
|
+
function taskTypeHeader(taskType) {
|
|
46
|
+
return taskType ? { [TASK_TYPE_HEADER]: taskType } : {};
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
// src/lib/memory/portalLlm.ts
|
|
44
50
|
function defaultBaseUrl() {
|
|
45
51
|
return typeof process !== "undefined" && process.env?.ANUMA_PORTAL_BASE_URL || BASE_URL;
|
|
@@ -102,9 +108,15 @@ async function callPortalJsonCompletion(req) {
|
|
|
102
108
|
const maxAttempts = Math.max(1, req.maxAttempts ?? 3);
|
|
103
109
|
const startedAt = Date.now();
|
|
104
110
|
const overBudget = () => req.totalTimeoutMs !== void 0 && Date.now() - startedAt >= req.totalTimeoutMs;
|
|
111
|
+
let lastFailure;
|
|
112
|
+
const giveUp = () => {
|
|
113
|
+
req.onFailure?.(lastFailure ?? { reason: "network", attempts: maxAttempts });
|
|
114
|
+
return null;
|
|
115
|
+
};
|
|
105
116
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
106
117
|
if (attempt > 1 && overBudget()) {
|
|
107
118
|
log.warn(`[${req.tag}] over time budget before attempt ${attempt}, giving up`);
|
|
119
|
+
lastFailure = { reason: "time-budget-exhausted", attempts: attempt - 1 };
|
|
108
120
|
break;
|
|
109
121
|
}
|
|
110
122
|
const attemptReq = req.totalTimeoutMs !== void 0 ? {
|
|
@@ -116,9 +128,14 @@ async function callPortalJsonCompletion(req) {
|
|
|
116
128
|
} : req;
|
|
117
129
|
const outcome = await attemptPortalJson(attemptReq, endpoint);
|
|
118
130
|
if (outcome.kind === "ok") return outcome.value;
|
|
131
|
+
lastFailure = {
|
|
132
|
+
reason: outcome.code,
|
|
133
|
+
...outcome.httpStatus !== void 0 && { httpStatus: outcome.httpStatus },
|
|
134
|
+
attempts: attempt
|
|
135
|
+
};
|
|
119
136
|
if (outcome.kind === "terminal") {
|
|
120
137
|
log.warn(`[${req.tag}] ${outcome.reason}`);
|
|
121
|
-
return
|
|
138
|
+
return giveUp();
|
|
122
139
|
}
|
|
123
140
|
if (attempt >= maxAttempts) {
|
|
124
141
|
log.warn(`[${req.tag}] ${outcome.reason} \u2014 attempt ${attempt}/${maxAttempts}, giving up`);
|
|
@@ -130,19 +147,21 @@ async function callPortalJsonCompletion(req) {
|
|
|
130
147
|
log.warn(
|
|
131
148
|
`[${req.tag}] ${outcome.reason} \u2014 attempt ${attempt}/${maxAttempts}, over time budget, giving up`
|
|
132
149
|
);
|
|
150
|
+
lastFailure = { reason: "time-budget-exhausted", attempts: attempt };
|
|
133
151
|
break;
|
|
134
152
|
}
|
|
135
153
|
log.warn(`[${req.tag}] ${outcome.reason} \u2014 attempt ${attempt}/${maxAttempts}, retrying`);
|
|
136
154
|
if (delay > 0) await sleep(delay);
|
|
137
155
|
}
|
|
138
|
-
return
|
|
156
|
+
return giveUp();
|
|
139
157
|
}
|
|
140
158
|
async function attemptPortalJson(req, endpoint) {
|
|
141
159
|
const baseUrl = req.baseUrl ?? defaultBaseUrl();
|
|
142
160
|
const fetchImpl = req.fetchFn ?? fetch;
|
|
143
161
|
const timeoutMs = req.timeoutMs ?? 6e4;
|
|
144
162
|
const authHeaders = await resolvePortalAuthHeaders(req, req.tag);
|
|
145
|
-
if (authHeaders === null)
|
|
163
|
+
if (authHeaders === null)
|
|
164
|
+
return { kind: "terminal", code: "auth-unavailable", reason: "auth unavailable (no token)" };
|
|
146
165
|
const isAnthropic = req.model.startsWith("anthropic/");
|
|
147
166
|
const prefill = isAnthropic ? "{" : "";
|
|
148
167
|
const messages = [
|
|
@@ -169,37 +188,67 @@ async function attemptPortalJson(req, endpoint) {
|
|
|
169
188
|
try {
|
|
170
189
|
response = await fetchImpl(`${baseUrl}${endpoint}`, {
|
|
171
190
|
method: "POST",
|
|
172
|
-
|
|
191
|
+
// Attached HERE, at the one transport every background memory op shares, so
|
|
192
|
+
// a new flow gets the provenance by construction rather than by remembering.
|
|
193
|
+
headers: {
|
|
194
|
+
...authHeaders,
|
|
195
|
+
...taskTypeHeader(req.taskType),
|
|
196
|
+
"Content-Type": "application/json"
|
|
197
|
+
},
|
|
173
198
|
body: JSON.stringify(requestBody),
|
|
174
199
|
signal: controller.signal
|
|
175
200
|
});
|
|
176
201
|
} catch (err) {
|
|
177
202
|
clearTimeout(timer);
|
|
178
|
-
return {
|
|
203
|
+
return {
|
|
204
|
+
kind: "retryable",
|
|
205
|
+
code: "network",
|
|
206
|
+
reason: `fetch failed: ${err.message}`
|
|
207
|
+
};
|
|
179
208
|
}
|
|
180
209
|
if (!response.ok) {
|
|
181
210
|
clearTimeout(timer);
|
|
182
211
|
const reason = `portal returned ${response.status}`;
|
|
183
212
|
if (response.status === 401) {
|
|
184
213
|
const tokenAuth = !req.apiKey && !!req.getToken;
|
|
185
|
-
return tokenAuth ? {
|
|
214
|
+
return tokenAuth ? {
|
|
215
|
+
kind: "retryable",
|
|
216
|
+
code: "http-retryable",
|
|
217
|
+
reason: `${reason} (token may be expired; refreshing)`,
|
|
218
|
+
httpStatus: response.status
|
|
219
|
+
} : { kind: "terminal", code: "http-terminal", reason, httpStatus: response.status };
|
|
186
220
|
}
|
|
187
|
-
if (!isRetryableStatus(response.status))
|
|
221
|
+
if (!isRetryableStatus(response.status))
|
|
222
|
+
return { kind: "terminal", code: "http-terminal", reason, httpStatus: response.status };
|
|
188
223
|
const retryAfterMs = parseRetryAfterMs(response.headers.get("retry-after"));
|
|
189
|
-
return
|
|
224
|
+
return {
|
|
225
|
+
kind: "retryable",
|
|
226
|
+
code: "http-retryable",
|
|
227
|
+
reason,
|
|
228
|
+
httpStatus: response.status,
|
|
229
|
+
...retryAfterMs !== null && { retryAfterMs }
|
|
230
|
+
};
|
|
190
231
|
}
|
|
191
232
|
let body;
|
|
192
233
|
try {
|
|
193
234
|
body = await response.json();
|
|
194
235
|
} catch (err) {
|
|
195
236
|
clearTimeout(timer);
|
|
196
|
-
return {
|
|
237
|
+
return {
|
|
238
|
+
kind: "retryable",
|
|
239
|
+
code: "body-parse-failed",
|
|
240
|
+
reason: `response body parse failed: ${err.message}`
|
|
241
|
+
};
|
|
197
242
|
}
|
|
198
243
|
clearTimeout(timer);
|
|
199
244
|
logPortalUsage(body, req.tag);
|
|
200
245
|
const rawContent = extractCompletionContent(body);
|
|
201
246
|
if (!rawContent) {
|
|
202
|
-
return {
|
|
247
|
+
return {
|
|
248
|
+
kind: "retryable",
|
|
249
|
+
code: "empty-content",
|
|
250
|
+
reason: "portal response had no completion content"
|
|
251
|
+
};
|
|
203
252
|
}
|
|
204
253
|
const looksLikeContinuation = prefill && /^\s*"/.test(rawContent);
|
|
205
254
|
const content = looksLikeContinuation ? prefill + rawContent : rawContent;
|
|
@@ -210,11 +259,12 @@ async function attemptPortalJson(req, endpoint) {
|
|
|
210
259
|
} catch (err) {
|
|
211
260
|
return {
|
|
212
261
|
kind: "retryable",
|
|
262
|
+
code: "invalid-json",
|
|
213
263
|
reason: `completion was not valid JSON: ${err.message}`
|
|
214
264
|
};
|
|
215
265
|
}
|
|
216
266
|
if (value === null) {
|
|
217
|
-
return { kind: "retryable", reason: "completion parsed to null" };
|
|
267
|
+
return { kind: "retryable", code: "null-completion", reason: "completion parsed to null" };
|
|
218
268
|
}
|
|
219
269
|
return { kind: "ok", value };
|
|
220
270
|
}
|
|
@@ -288,6 +338,7 @@ export {
|
|
|
288
338
|
getLogger,
|
|
289
339
|
INTERNAL_FLOW_MARKER,
|
|
290
340
|
withInternalFlowMarker,
|
|
341
|
+
taskTypeHeader,
|
|
291
342
|
validateEndpointOverride,
|
|
292
343
|
supportsResponseFormat,
|
|
293
344
|
resolvePortalAuthHeaders,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
notifyConsolidationFallback,
|
|
3
3
|
resolvePiiRedactor
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MEQ2PAEX.mjs";
|
|
5
5
|
import {
|
|
6
6
|
callPortalJsonCompletion
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KF5OU4IN.mjs";
|
|
8
8
|
import "./chunk-3RPGXXPZ.mjs";
|
|
9
9
|
|
|
10
10
|
// src/lib/memory/consolidate.ts
|
|
@@ -77,6 +77,7 @@ ${candidateText}`;
|
|
|
77
77
|
...options.apiKey !== void 0 && { apiKey: options.apiKey },
|
|
78
78
|
...options.getToken !== void 0 && { getToken: options.getToken },
|
|
79
79
|
...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
|
|
80
|
+
taskType: "memory_consolidate",
|
|
80
81
|
model: options.model ?? DEFAULT_CONSOLIDATION_MODEL,
|
|
81
82
|
systemPrompt: SYSTEM_PROMPT,
|
|
82
83
|
userMessage,
|