@anuma/sdk 6.26.2 → 6.27.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.
@@ -1491,6 +1491,7 @@ __export(index_exports, {
1491
1491
  createMemoryVaultSearchTool: () => createMemoryVaultSearchTool,
1492
1492
  createMemoryVaultTool: () => createMemoryVaultTool,
1493
1493
  createMessageSourceResolver: () => createMessageSourceResolver,
1494
+ createNotionProxyTools: () => createNotionProxyTools,
1494
1495
  createNotionTools: () => createNotionTools,
1495
1496
  createPlatformCursorStore: () => createPlatformCursorStore,
1496
1497
  createRecallTool: () => createRecallTool,
@@ -24848,6 +24849,19 @@ async function refreshNotionAccessToken(params) {
24848
24849
  return result;
24849
24850
  }
24850
24851
 
24852
+ // src/lib/connectors/errors.ts
24853
+ function buildConnectorErrorResult(code, provider, connectUrl, extras) {
24854
+ const payload = {
24855
+ __anuma_connector_error_v1: true,
24856
+ code,
24857
+ provider,
24858
+ connect_url: connectUrl,
24859
+ missing_scopes: extras?.missingScopes,
24860
+ required: extras?.required
24861
+ };
24862
+ return JSON.stringify(payload);
24863
+ }
24864
+
24851
24865
  // src/tools/notion.ts
24852
24866
  var MCP_HTTP_ENDPOINT = "https://mcp.notion.com/mcp";
24853
24867
  var MAX_CONTENT_LENGTH2 = 5e4;
@@ -25020,8 +25034,83 @@ async function callMCPTool(accessToken, toolName, args) {
25020
25034
  }
25021
25035
  return truncateToolResult(jsonRpcResponse.result);
25022
25036
  }
25023
- function createNotionSearchTool(getAccessToken, requestNotionAccess) {
25037
+ var NOTION_PROVIDER = "notion";
25038
+ function directRunner(getAccessToken, requestNotionAccess) {
25039
+ return async (toolName, args) => {
25040
+ let token = getAccessToken();
25041
+ if (!token) {
25042
+ token = await requestNotionAccess();
25043
+ }
25044
+ return callMCPTool(token, toolName, args);
25045
+ };
25046
+ }
25047
+ function readField(json4, key) {
25048
+ return typeof json4 === "object" && json4 !== null ? json4[key] : void 0;
25049
+ }
25050
+ function readString(json4, key) {
25051
+ const value = readField(json4, key);
25052
+ return typeof value === "string" ? value : void 0;
25053
+ }
25054
+ function notionConnectorError(status, json4) {
25055
+ const code = readField(json4, "code");
25056
+ if (status === 503) {
25057
+ return code === "upstream_unavailable" ? buildConnectorErrorResult("upstream_unavailable", NOTION_PROVIDER) : null;
25058
+ }
25059
+ if (status !== 401 && status !== 403 && status !== 412) return null;
25060
+ switch (code) {
25061
+ case "scope_not_covered": {
25062
+ const missingScopes = readField(json4, "missing_scopes");
25063
+ return buildConnectorErrorResult(
25064
+ "scope_not_covered",
25065
+ NOTION_PROVIDER,
25066
+ readString(json4, "connect_url"),
25067
+ Array.isArray(missingScopes) ? { missingScopes } : void 0
25068
+ );
25069
+ }
25070
+ case "insufficient_scope":
25071
+ return buildConnectorErrorResult("insufficient_scope", NOTION_PROVIDER, void 0, {
25072
+ required: readString(json4, "required")
25073
+ });
25074
+ case "upstream_unavailable":
25075
+ return buildConnectorErrorResult("upstream_unavailable", NOTION_PROVIDER);
25076
+ default:
25077
+ return buildConnectorErrorResult(
25078
+ "connector_not_connected",
25079
+ NOTION_PROVIDER,
25080
+ readString(json4, "connect_url")
25081
+ );
25082
+ }
25083
+ }
25084
+ function proxyRunner(callMcp) {
25085
+ return async (toolName, args) => {
25086
+ const { status, json: json4 } = await callMcp(toolName, args);
25087
+ if (status >= 200 && status < 300) {
25088
+ const result = readField(json4, "result");
25089
+ if (result === void 0) {
25090
+ throw new Error(`Notion returned no result (${status})`);
25091
+ }
25092
+ return truncateToolResult(result);
25093
+ }
25094
+ const connectorError = notionConnectorError(status, json4);
25095
+ if (connectorError) return connectorError;
25096
+ const message = readField(json4, "error");
25097
+ throw new Error(`${typeof message === "string" ? message : JSON.stringify(json4)} (${status})`);
25098
+ };
25099
+ }
25100
+ function withNotionExecutor(run, errorPrefix, tool) {
25024
25101
  return {
25102
+ ...tool,
25103
+ executor: async (args) => {
25104
+ try {
25105
+ return await run(tool.function.name, args);
25106
+ } catch (error) {
25107
+ return `${errorPrefix}: ${error instanceof Error ? error.message : String(error)}`;
25108
+ }
25109
+ }
25110
+ };
25111
+ }
25112
+ function notionSearchTool(run) {
25113
+ return withNotionExecutor(run, "Error searching Notion", {
25025
25114
  type: "function",
25026
25115
  function: {
25027
25116
  name: "notion-search",
@@ -25062,22 +25151,11 @@ function createNotionSearchTool(getAccessToken, requestNotionAccess) {
25062
25151
  },
25063
25152
  required: ["query"]
25064
25153
  }
25065
- },
25066
- executor: async (args) => {
25067
- let token = getAccessToken();
25068
- if (!token) {
25069
- token = await requestNotionAccess();
25070
- }
25071
- try {
25072
- return await callMCPTool(token, "notion-search", args);
25073
- } catch (error) {
25074
- return `Error searching Notion: ${error instanceof Error ? error.message : String(error)}`;
25075
- }
25076
25154
  }
25077
- };
25155
+ });
25078
25156
  }
25079
- function createNotionFetchTool(getAccessToken, requestNotionAccess) {
25080
- return {
25157
+ function notionFetchTool(run) {
25158
+ return withNotionExecutor(run, "Error fetching Notion page", {
25081
25159
  type: "function",
25082
25160
  function: {
25083
25161
  name: "notion-fetch",
@@ -25100,22 +25178,11 @@ function createNotionFetchTool(getAccessToken, requestNotionAccess) {
25100
25178
  },
25101
25179
  required: ["id"]
25102
25180
  }
25103
- },
25104
- executor: async (args) => {
25105
- let token = getAccessToken();
25106
- if (!token) {
25107
- token = await requestNotionAccess();
25108
- }
25109
- try {
25110
- return await callMCPTool(token, "notion-fetch", args);
25111
- } catch (error) {
25112
- return `Error fetching Notion page: ${error instanceof Error ? error.message : String(error)}`;
25113
- }
25114
25181
  }
25115
- };
25182
+ });
25116
25183
  }
25117
- function createNotionCreatePagesTool(getAccessToken, requestNotionAccess) {
25118
- return {
25184
+ function notionCreatePagesTool(run) {
25185
+ return withNotionExecutor(run, "Error creating Notion page", {
25119
25186
  type: "function",
25120
25187
  function: {
25121
25188
  name: "notion-create-pages",
@@ -25148,22 +25215,11 @@ function createNotionCreatePagesTool(getAccessToken, requestNotionAccess) {
25148
25215
  },
25149
25216
  required: ["pages"]
25150
25217
  }
25151
- },
25152
- executor: async (args) => {
25153
- let token = getAccessToken();
25154
- if (!token) {
25155
- token = await requestNotionAccess();
25156
- }
25157
- try {
25158
- return await callMCPTool(token, "notion-create-pages", args);
25159
- } catch (error) {
25160
- return `Error creating Notion page: ${error instanceof Error ? error.message : String(error)}`;
25161
- }
25162
25218
  }
25163
- };
25219
+ });
25164
25220
  }
25165
- function createNotionUpdatePageTool(getAccessToken, requestNotionAccess) {
25166
- return {
25221
+ function notionUpdatePageTool(run) {
25222
+ return withNotionExecutor(run, "Error updating Notion page", {
25167
25223
  type: "function",
25168
25224
  function: {
25169
25225
  name: "notion-update-page",
@@ -25211,22 +25267,11 @@ function createNotionUpdatePageTool(getAccessToken, requestNotionAccess) {
25211
25267
  },
25212
25268
  required: ["data"]
25213
25269
  }
25214
- },
25215
- executor: async (args) => {
25216
- let token = getAccessToken();
25217
- if (!token) {
25218
- token = await requestNotionAccess();
25219
- }
25220
- try {
25221
- return await callMCPTool(token, "notion-update-page", args);
25222
- } catch (error) {
25223
- return `Error updating Notion page: ${error instanceof Error ? error.message : String(error)}`;
25224
- }
25225
25270
  }
25226
- };
25271
+ });
25227
25272
  }
25228
- function createNotionMovePagesTool(getAccessToken, requestNotionAccess) {
25229
- return {
25273
+ function notionMovePagesTool(run) {
25274
+ return withNotionExecutor(run, "Error moving Notion pages", {
25230
25275
  type: "function",
25231
25276
  function: {
25232
25277
  name: "notion-move-pages",
@@ -25246,22 +25291,11 @@ function createNotionMovePagesTool(getAccessToken, requestNotionAccess) {
25246
25291
  },
25247
25292
  required: ["page_or_database_ids", "new_parent"]
25248
25293
  }
25249
- },
25250
- executor: async (args) => {
25251
- let token = getAccessToken();
25252
- if (!token) {
25253
- token = await requestNotionAccess();
25254
- }
25255
- try {
25256
- return await callMCPTool(token, "notion-move-pages", args);
25257
- } catch (error) {
25258
- return `Error moving Notion pages: ${error instanceof Error ? error.message : String(error)}`;
25259
- }
25260
25294
  }
25261
- };
25295
+ });
25262
25296
  }
25263
- function createNotionDuplicatePageTool(getAccessToken, requestNotionAccess) {
25264
- return {
25297
+ function notionDuplicatePageTool(run) {
25298
+ return withNotionExecutor(run, "Error duplicating Notion page", {
25265
25299
  type: "function",
25266
25300
  function: {
25267
25301
  name: "notion-duplicate-page",
@@ -25276,22 +25310,11 @@ function createNotionDuplicatePageTool(getAccessToken, requestNotionAccess) {
25276
25310
  },
25277
25311
  required: ["page_id"]
25278
25312
  }
25279
- },
25280
- executor: async (args) => {
25281
- let token = getAccessToken();
25282
- if (!token) {
25283
- token = await requestNotionAccess();
25284
- }
25285
- try {
25286
- return await callMCPTool(token, "notion-duplicate-page", args);
25287
- } catch (error) {
25288
- return `Error duplicating Notion page: ${error instanceof Error ? error.message : String(error)}`;
25289
- }
25290
25313
  }
25291
- };
25314
+ });
25292
25315
  }
25293
- function createNotionCreateDatabaseTool(getAccessToken, requestNotionAccess) {
25294
- return {
25316
+ function notionCreateDatabaseTool(run) {
25317
+ return withNotionExecutor(run, "Error creating Notion database", {
25295
25318
  type: "function",
25296
25319
  function: {
25297
25320
  name: "notion-create-database",
@@ -25320,22 +25343,11 @@ function createNotionCreateDatabaseTool(getAccessToken, requestNotionAccess) {
25320
25343
  },
25321
25344
  required: ["properties"]
25322
25345
  }
25323
- },
25324
- executor: async (args) => {
25325
- let token = getAccessToken();
25326
- if (!token) {
25327
- token = await requestNotionAccess();
25328
- }
25329
- try {
25330
- return await callMCPTool(token, "notion-create-database", args);
25331
- } catch (error) {
25332
- return `Error creating Notion database: ${error instanceof Error ? error.message : String(error)}`;
25333
- }
25334
25346
  }
25335
- };
25347
+ });
25336
25348
  }
25337
- function createNotionUpdateDataSourceTool(getAccessToken, requestNotionAccess) {
25338
- return {
25349
+ function notionUpdateDataSourceTool(run) {
25350
+ return withNotionExecutor(run, "Error updating Notion data source", {
25339
25351
  type: "function",
25340
25352
  function: {
25341
25353
  name: "notion-update-data-source",
@@ -25372,22 +25384,11 @@ function createNotionUpdateDataSourceTool(getAccessToken, requestNotionAccess) {
25372
25384
  },
25373
25385
  required: ["data_source_id"]
25374
25386
  }
25375
- },
25376
- executor: async (args) => {
25377
- let token = getAccessToken();
25378
- if (!token) {
25379
- token = await requestNotionAccess();
25380
- }
25381
- try {
25382
- return await callMCPTool(token, "notion-update-data-source", args);
25383
- } catch (error) {
25384
- return `Error updating Notion data source: ${error instanceof Error ? error.message : String(error)}`;
25385
- }
25386
25387
  }
25387
- };
25388
+ });
25388
25389
  }
25389
- function createNotionCreateCommentTool(getAccessToken, requestNotionAccess) {
25390
- return {
25390
+ function notionCreateCommentTool(run) {
25391
+ return withNotionExecutor(run, "Error creating Notion comment", {
25391
25392
  type: "function",
25392
25393
  function: {
25393
25394
  name: "notion-create-comment",
@@ -25427,22 +25428,11 @@ function createNotionCreateCommentTool(getAccessToken, requestNotionAccess) {
25427
25428
  },
25428
25429
  required: ["page_id", "rich_text"]
25429
25430
  }
25430
- },
25431
- executor: async (args) => {
25432
- let token = getAccessToken();
25433
- if (!token) {
25434
- token = await requestNotionAccess();
25435
- }
25436
- try {
25437
- return await callMCPTool(token, "notion-create-comment", args);
25438
- } catch (error) {
25439
- return `Error creating Notion comment: ${error instanceof Error ? error.message : String(error)}`;
25440
- }
25441
25431
  }
25442
- };
25432
+ });
25443
25433
  }
25444
- function createNotionGetCommentsTool(getAccessToken, requestNotionAccess) {
25445
- return {
25434
+ function notionGetCommentsTool(run) {
25435
+ return withNotionExecutor(run, "Error retrieving Notion comments", {
25446
25436
  type: "function",
25447
25437
  function: {
25448
25438
  name: "notion-get-comments",
@@ -25469,22 +25459,11 @@ function createNotionGetCommentsTool(getAccessToken, requestNotionAccess) {
25469
25459
  },
25470
25460
  required: ["page_id"]
25471
25461
  }
25472
- },
25473
- executor: async (args) => {
25474
- let token = getAccessToken();
25475
- if (!token) {
25476
- token = await requestNotionAccess();
25477
- }
25478
- try {
25479
- return await callMCPTool(token, "notion-get-comments", args);
25480
- } catch (error) {
25481
- return `Error retrieving Notion comments: ${error instanceof Error ? error.message : String(error)}`;
25482
- }
25483
25462
  }
25484
- };
25463
+ });
25485
25464
  }
25486
- function createNotionGetUsersTool(getAccessToken, requestNotionAccess) {
25487
- return {
25465
+ function notionGetUsersTool(run) {
25466
+ return withNotionExecutor(run, "Error listing Notion users", {
25488
25467
  type: "function",
25489
25468
  function: {
25490
25469
  name: "notion-get-users",
@@ -25510,22 +25489,11 @@ function createNotionGetUsersTool(getAccessToken, requestNotionAccess) {
25510
25489
  }
25511
25490
  }
25512
25491
  }
25513
- },
25514
- executor: async (args) => {
25515
- let token = getAccessToken();
25516
- if (!token) {
25517
- token = await requestNotionAccess();
25518
- }
25519
- try {
25520
- return await callMCPTool(token, "notion-get-users", args);
25521
- } catch (error) {
25522
- return `Error listing Notion users: ${error instanceof Error ? error.message : String(error)}`;
25523
- }
25524
25492
  }
25525
- };
25493
+ });
25526
25494
  }
25527
- function createNotionGetTeamsTool(getAccessToken, requestNotionAccess) {
25528
- return {
25495
+ function notionGetTeamsTool(run) {
25496
+ return withNotionExecutor(run, "Error retrieving Notion teams", {
25529
25497
  type: "function",
25530
25498
  function: {
25531
25499
  name: "notion-get-teams",
@@ -25539,40 +25507,35 @@ function createNotionGetTeamsTool(getAccessToken, requestNotionAccess) {
25539
25507
  }
25540
25508
  }
25541
25509
  }
25542
- },
25543
- executor: async (args) => {
25544
- let token = getAccessToken();
25545
- if (!token) {
25546
- token = await requestNotionAccess();
25547
- }
25548
- try {
25549
- return await callMCPTool(token, "notion-get-teams", args);
25550
- } catch (error) {
25551
- return `Error retrieving Notion teams: ${error instanceof Error ? error.message : String(error)}`;
25552
- }
25553
25510
  }
25554
- };
25511
+ });
25555
25512
  }
25513
+ var NOTION_TOOLS = [
25514
+ // Search
25515
+ notionSearchTool,
25516
+ // Pages
25517
+ notionFetchTool,
25518
+ notionCreatePagesTool,
25519
+ notionUpdatePageTool,
25520
+ notionMovePagesTool,
25521
+ notionDuplicatePageTool,
25522
+ // Data Sources (Databases)
25523
+ notionCreateDatabaseTool,
25524
+ notionUpdateDataSourceTool,
25525
+ // Comments
25526
+ notionCreateCommentTool,
25527
+ notionGetCommentsTool,
25528
+ // Users & Teams
25529
+ notionGetUsersTool,
25530
+ notionGetTeamsTool
25531
+ ];
25556
25532
  function createNotionTools(getAccessToken, requestNotionAccess) {
25557
- return [
25558
- // Search
25559
- createNotionSearchTool(getAccessToken, requestNotionAccess),
25560
- // Pages
25561
- createNotionFetchTool(getAccessToken, requestNotionAccess),
25562
- createNotionCreatePagesTool(getAccessToken, requestNotionAccess),
25563
- createNotionUpdatePageTool(getAccessToken, requestNotionAccess),
25564
- createNotionMovePagesTool(getAccessToken, requestNotionAccess),
25565
- createNotionDuplicatePageTool(getAccessToken, requestNotionAccess),
25566
- // Data Sources (Databases)
25567
- createNotionCreateDatabaseTool(getAccessToken, requestNotionAccess),
25568
- createNotionUpdateDataSourceTool(getAccessToken, requestNotionAccess),
25569
- // Comments
25570
- createNotionCreateCommentTool(getAccessToken, requestNotionAccess),
25571
- createNotionGetCommentsTool(getAccessToken, requestNotionAccess),
25572
- // Users & Teams
25573
- createNotionGetUsersTool(getAccessToken, requestNotionAccess),
25574
- createNotionGetTeamsTool(getAccessToken, requestNotionAccess)
25575
- ];
25533
+ const run = directRunner(getAccessToken, requestNotionAccess);
25534
+ return NOTION_TOOLS.map((tool) => tool(run));
25535
+ }
25536
+ function createNotionProxyTools(callMcp) {
25537
+ const run = proxyRunner(callMcp);
25538
+ return NOTION_TOOLS.map((tool) => tool(run));
25576
25539
  }
25577
25540
  // Annotate the CommonJS export names for ESM import in node:
25578
25541
  0 && (module.exports = {
@@ -25668,6 +25631,7 @@ function createNotionTools(getAccessToken, requestNotionAccess) {
25668
25631
  createMemoryVaultSearchTool,
25669
25632
  createMemoryVaultTool,
25670
25633
  createMessageSourceResolver,
25634
+ createNotionProxyTools,
25671
25635
  createNotionTools,
25672
25636
  createPlatformCursorStore,
25673
25637
  createRecallTool,
@@ -11288,10 +11288,25 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
11288
11288
  * MCP Server: https://mcp.notion.com/mcp (Streamable HTTP)
11289
11289
  * Fallback: https://mcp.notion.com/sse (Server-Sent Events)
11290
11290
  *
11291
+ * The MCP server rejects browser origins, so browser and mobile consumers use
11292
+ * `createNotionProxyTools`, which hands each call to an injected
11293
+ * {@link NotionMcpCaller} that goes through the portal instead.
11294
+ *
11291
11295
  * @see https://developers.notion.com/guides/mcp/build-mcp-client
11292
11296
  * @see https://modelcontextprotocol.io
11293
11297
  */
11294
11298
 
11299
+ /**
11300
+ * Calls the portal's Notion MCP endpoint with a tool name and its arguments,
11301
+ * and resolves to the response status + parsed JSON. Consumers wire this to
11302
+ * `POST {portalBaseUrl}/api/v1/connectors/notion/mcp` with the user's Privy
11303
+ * bearer and a JSON body `{ tool, arguments }`; the portal mints the Notion
11304
+ * token and runs the MCP handshake server-side.
11305
+ */
11306
+ type NotionMcpCaller = (tool: string, args: Record<string, unknown>) => Promise<{
11307
+ status: number;
11308
+ json: unknown;
11309
+ }>;
11295
11310
  /**
11296
11311
  * Create all Notion MCP tools
11297
11312
  *
@@ -11299,5 +11314,18 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
11299
11314
  * The MCP server handles all Notion API interactions.
11300
11315
  */
11301
11316
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
11317
+ /**
11318
+ * Create all Notion MCP tools, routed through the portal.
11319
+ *
11320
+ * Same tools as {@link createNotionTools}, but no request reaches
11321
+ * mcp.notion.com from this runtime: Notion's MCP server rejects browser
11322
+ * origins, so the portal runs the call server-side. When the portal reports
11323
+ * the connector is not connected (401, 403, 412), the tool returns the
11324
+ * canonical `__anuma_connector_error_v1` result. Executors never throw.
11325
+ *
11326
+ * @param callMcp POSTs `{ tool, arguments }` to the portal's
11327
+ * `/api/v1/connectors/notion/mcp` endpoint and resolves to `{ status, json }`.
11328
+ */
11329
+ declare function createNotionProxyTools(callMcp: NotionMcpCaller): ToolConfig[];
11302
11330
 
11303
- export { type AutoExtractMessage, type AutoExtractor, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type ManualFactType, 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, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PhotoIngestResult, type PhotoMediaRef, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryTopicsOp, buildAttachedFilesText, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteMessageOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, hardDeleteDecayedOp, hasEncryptionKey, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isAttachedFilesText, isDegradedTopicSkip, isEncrypted, isPiiRedactor, isRerankerAvailable, maskScopedEmbeddingCache, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, shouldRecallMemory, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };
11331
+ export { type AutoExtractMessage, type AutoExtractor, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type ManualFactType, 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, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionMcpCaller, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PhotoIngestResult, type PhotoMediaRef, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryTopicsOp, buildAttachedFilesText, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createNotionProxyTools, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteMessageOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, hardDeleteDecayedOp, hasEncryptionKey, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isAttachedFilesText, isDegradedTopicSkip, isEncrypted, isPiiRedactor, isRerankerAvailable, maskScopedEmbeddingCache, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, shouldRecallMemory, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };
@@ -11288,10 +11288,25 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
11288
11288
  * MCP Server: https://mcp.notion.com/mcp (Streamable HTTP)
11289
11289
  * Fallback: https://mcp.notion.com/sse (Server-Sent Events)
11290
11290
  *
11291
+ * The MCP server rejects browser origins, so browser and mobile consumers use
11292
+ * `createNotionProxyTools`, which hands each call to an injected
11293
+ * {@link NotionMcpCaller} that goes through the portal instead.
11294
+ *
11291
11295
  * @see https://developers.notion.com/guides/mcp/build-mcp-client
11292
11296
  * @see https://modelcontextprotocol.io
11293
11297
  */
11294
11298
 
11299
+ /**
11300
+ * Calls the portal's Notion MCP endpoint with a tool name and its arguments,
11301
+ * and resolves to the response status + parsed JSON. Consumers wire this to
11302
+ * `POST {portalBaseUrl}/api/v1/connectors/notion/mcp` with the user's Privy
11303
+ * bearer and a JSON body `{ tool, arguments }`; the portal mints the Notion
11304
+ * token and runs the MCP handshake server-side.
11305
+ */
11306
+ type NotionMcpCaller = (tool: string, args: Record<string, unknown>) => Promise<{
11307
+ status: number;
11308
+ json: unknown;
11309
+ }>;
11295
11310
  /**
11296
11311
  * Create all Notion MCP tools
11297
11312
  *
@@ -11299,5 +11314,18 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
11299
11314
  * The MCP server handles all Notion API interactions.
11300
11315
  */
11301
11316
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
11317
+ /**
11318
+ * Create all Notion MCP tools, routed through the portal.
11319
+ *
11320
+ * Same tools as {@link createNotionTools}, but no request reaches
11321
+ * mcp.notion.com from this runtime: Notion's MCP server rejects browser
11322
+ * origins, so the portal runs the call server-side. When the portal reports
11323
+ * the connector is not connected (401, 403, 412), the tool returns the
11324
+ * canonical `__anuma_connector_error_v1` result. Executors never throw.
11325
+ *
11326
+ * @param callMcp POSTs `{ tool, arguments }` to the portal's
11327
+ * `/api/v1/connectors/notion/mcp` endpoint and resolves to `{ status, json }`.
11328
+ */
11329
+ declare function createNotionProxyTools(callMcp: NotionMcpCaller): ToolConfig[];
11302
11330
 
11303
- export { type AutoExtractMessage, type AutoExtractor, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type ManualFactType, 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, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PhotoIngestResult, type PhotoMediaRef, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryTopicsOp, buildAttachedFilesText, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteMessageOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, hardDeleteDecayedOp, hasEncryptionKey, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isAttachedFilesText, isDegradedTopicSkip, isEncrypted, isPiiRedactor, isRerankerAvailable, maskScopedEmbeddingCache, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, shouldRecallMemory, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };
11331
+ export { type AutoExtractMessage, type AutoExtractor, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type ManualFactType, 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, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionMcpCaller, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PhotoIngestResult, type PhotoMediaRef, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryTopicsOp, buildAttachedFilesText, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createNotionProxyTools, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteMessageOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, hardDeleteDecayedOp, hasEncryptionKey, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isAttachedFilesText, isDegradedTopicSkip, isEncrypted, isPiiRedactor, isRerankerAvailable, maskScopedEmbeddingCache, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, shouldRecallMemory, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };