@anuma/sdk 6.19.0 → 6.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -823,6 +823,7 @@ var client = createClient(createClientConfig(createConfig()));
823
823
  var getWellKnownJwksJson = (options) => (options?.client ?? client).get({ url: "/.well-known/jwks.json", ...options });
824
824
  var getAdminReferralGrantsStats = (options) => (options?.client ?? client).get({ url: "/admin/referral-grants/stats", ...options });
825
825
  var deleteApiV1Account = (options) => (options?.client ?? client).delete({ url: "/api/v1/account", ...options });
826
+ var postApiV1AccountVerifyChallenge = (options) => (options?.client ?? client).post({ url: "/api/v1/account/verify-challenge", ...options });
826
827
  var postApiV1AdminAddCredits = (options) => (options.client ?? client).post({
827
828
  url: "/api/v1/admin/add-credits",
828
829
  ...options,
@@ -906,6 +907,34 @@ var putApiV1AdminConnectorsByProvider = (options) => (options.client ?? client).
906
907
  ...options.headers
907
908
  }
908
909
  });
910
+ var getApiV1AdminModerationCsam = (options) => (options.client ?? client).get({ url: "/api/v1/admin/moderation/csam", ...options });
911
+ var getApiV1AdminModerationCsamByIdHistory = (options) => (options.client ?? client).get({ url: "/api/v1/admin/moderation/csam/{id}/history", ...options });
912
+ var putApiV1AdminModerationCsamByIdReview = (options) => (options.client ?? client).put({
913
+ url: "/api/v1/admin/moderation/csam/{id}/review",
914
+ ...options,
915
+ headers: {
916
+ "Content-Type": "application/json",
917
+ ...options.headers
918
+ }
919
+ });
920
+ var getApiV1AdminNearbyAccessCodes = (options) => (options.client ?? client).get({ url: "/api/v1/admin/nearby/access-codes", ...options });
921
+ var postApiV1AdminNearbyAccessCodes = (options) => (options.client ?? client).post({
922
+ url: "/api/v1/admin/nearby/access-codes",
923
+ ...options,
924
+ headers: {
925
+ "Content-Type": "application/json",
926
+ ...options.headers
927
+ }
928
+ });
929
+ var postApiV1AdminNearbyAccessCodesRevoke = (options) => (options.client ?? client).post({
930
+ url: "/api/v1/admin/nearby/access-codes/revoke",
931
+ ...options,
932
+ headers: {
933
+ "Content-Type": "application/json",
934
+ ...options.headers
935
+ }
936
+ });
937
+ var getApiV1AdminNearbyMeetupsById = (options) => (options.client ?? client).get({ url: "/api/v1/admin/nearby/meetups/{id}", ...options });
909
938
  var postApiV1AdminNotificationsAnnounceModel = (options) => (options.client ?? client).post({
910
939
  url: "/api/v1/admin/notifications/announce-model",
911
940
  ...options,
@@ -1017,6 +1046,14 @@ var postApiV1AdminUsersInternalTester = (options) => (options.client ?? client).
1017
1046
  }
1018
1047
  });
1019
1048
  var getApiV1AdminUsersLookup = (options) => (options.client ?? client).get({ url: "/api/v1/admin/users/lookup", ...options });
1049
+ var postApiV1AdminUsersNearbyBeta = (options) => (options.client ?? client).post({
1050
+ url: "/api/v1/admin/users/nearby-beta",
1051
+ ...options,
1052
+ headers: {
1053
+ "Content-Type": "application/json",
1054
+ ...options.headers
1055
+ }
1056
+ });
1020
1057
  var postApiV1AdminUsersSuspend = (options) => (options.client ?? client).post({
1021
1058
  url: "/api/v1/admin/users/suspend",
1022
1059
  ...options,
@@ -1261,14 +1298,6 @@ var postApiV1GuestChatCompletions = (options) => (options.client ?? client).post
1261
1298
  var getApiV1Me = (options) => (options?.client ?? client).get({ url: "/api/v1/me", ...options });
1262
1299
  var getApiV1MediaSharedBySlug = (options) => (options.client ?? client).get({ url: "/api/v1/media/shared/{slug}", ...options });
1263
1300
  var getApiV1Models = (options) => (options?.client ?? client).get({ url: "/api/v1/models", ...options });
1264
- var postApiV1Moderate = (options) => (options.client ?? client).post({
1265
- url: "/api/v1/moderate",
1266
- ...options,
1267
- headers: {
1268
- "Content-Type": "application/json",
1269
- ...options.headers
1270
- }
1271
- });
1272
1301
  var postApiV1NotificationsDevices = (options) => (options.client ?? client).post({
1273
1302
  url: "/api/v1/notifications/devices",
1274
1303
  ...options,
@@ -1525,6 +1554,14 @@ var postInternalComplete = (options) => (options.client ?? client).post({
1525
1554
  ...options.headers
1526
1555
  }
1527
1556
  });
1557
+ var postInternalDmRequests = (options) => (options.client ?? client).post({
1558
+ url: "/internal/dm/requests",
1559
+ ...options,
1560
+ headers: {
1561
+ "Content-Type": "application/json",
1562
+ ...options.headers
1563
+ }
1564
+ });
1528
1565
  var postInternalEmbeddings = (options) => (options.client ?? client).post({
1529
1566
  url: "/internal/embeddings",
1530
1567
  ...options,
@@ -1541,8 +1578,8 @@ var postInternalExtractPhotoFacts = (options) => (options.client ?? client).post
1541
1578
  ...options.headers
1542
1579
  }
1543
1580
  });
1544
- var postInternalModerate = (options) => (options.client ?? client).post({
1545
- url: "/internal/moderate",
1581
+ var postInternalMeetupsJoins = (options) => (options.client ?? client).post({
1582
+ url: "/internal/meetups/joins",
1546
1583
  ...options,
1547
1584
  headers: {
1548
1585
  "Content-Type": "application/json",
@@ -1565,6 +1602,15 @@ var postInternalPrefineryClaimTokens = (options) => (options.client ?? client).p
1565
1602
  ...options.headers
1566
1603
  }
1567
1604
  });
1605
+ var getNearbyAccess = (options) => (options?.client ?? client).get({ url: "/nearby/access", ...options });
1606
+ var postNearbyAccessCode = (options) => (options.client ?? client).post({
1607
+ url: "/nearby/access-code",
1608
+ ...options,
1609
+ headers: {
1610
+ "Content-Type": "application/json",
1611
+ ...options.headers
1612
+ }
1613
+ });
1568
1614
  var postNearbyWaitlist = (options) => (options.client ?? client).post({
1569
1615
  url: "/nearby/waitlist",
1570
1616
  ...options,
@@ -1620,6 +1666,7 @@ var postReferralInvite = (options) => (options.client ?? client).post({
1620
1666
  }
1621
1667
  });
1622
1668
  var getReferralMe = (options) => (options?.client ?? client).get({ url: "/referral/me", ...options });
1669
+ var getReferralRewards = (options) => (options?.client ?? client).get({ url: "/referral/rewards", ...options });
1623
1670
  var postWebhooksPrefinery = (options) => (options?.client ?? client).post({
1624
1671
  url: "/webhooks/prefinery",
1625
1672
  ...options,
@@ -1654,6 +1701,10 @@ export {
1654
1701
  getApiV1AdminAppsById,
1655
1702
  getApiV1AdminBotStatus,
1656
1703
  getApiV1AdminConnectors,
1704
+ getApiV1AdminModerationCsam,
1705
+ getApiV1AdminModerationCsamByIdHistory,
1706
+ getApiV1AdminNearbyAccessCodes,
1707
+ getApiV1AdminNearbyMeetupsById,
1657
1708
  getApiV1AdminNotificationsCampaigns,
1658
1709
  getApiV1AdminNotificationsCampaignsByCampaignId,
1659
1710
  getApiV1AdminOauthClients,
@@ -1710,21 +1761,26 @@ export {
1710
1761
  getConnectorsByProviderConnect,
1711
1762
  getHealth,
1712
1763
  getInternalAccountsByDidByDid,
1764
+ getNearbyAccess,
1713
1765
  getOauthAuthorize,
1714
1766
  getOauthConsent,
1715
1767
  getReferralMe,
1768
+ getReferralRewards,
1716
1769
  getWellKnownJwksJson,
1717
1770
  patchApiV1AdminNotificationsCampaignsByCampaignId,
1718
1771
  patchApiV1AdminOauthClientsByClientId,
1719
1772
  patchApiV1DeveloperAppsByAppUuid,
1720
1773
  patchApiV1DeveloperAppsByAppUuidUsersByAddress,
1721
1774
  patchApiV1UserOauthGrantsById,
1775
+ postApiV1AccountVerifyChallenge,
1722
1776
  postApiV1AdminAddCredits,
1723
1777
  postApiV1AdminAgents,
1724
1778
  postApiV1AdminApps,
1725
1779
  postApiV1AdminAppsByAppIdApiKeys,
1726
1780
  postApiV1AdminBotPollerStart,
1727
1781
  postApiV1AdminBotPollerStop,
1782
+ postApiV1AdminNearbyAccessCodes,
1783
+ postApiV1AdminNearbyAccessCodesRevoke,
1728
1784
  postApiV1AdminNotificationsAnnounceModel,
1729
1785
  postApiV1AdminNotificationsCampaigns,
1730
1786
  postApiV1AdminNotificationsCampaignsByCampaignIdCancel,
@@ -1737,6 +1793,7 @@ export {
1737
1793
  postApiV1AdminSeedApps,
1738
1794
  postApiV1AdminSubscriptionTier,
1739
1795
  postApiV1AdminUsersInternalTester,
1796
+ postApiV1AdminUsersNearbyBeta,
1740
1797
  postApiV1AdminUsersSuspend,
1741
1798
  postApiV1AdminUsersUnsuspend,
1742
1799
  postApiV1AuthMfaDisable,
@@ -1764,7 +1821,6 @@ export {
1764
1821
  postApiV1DeveloperAppsByAppUuidUsersByAddressTopUp,
1765
1822
  postApiV1Embeddings,
1766
1823
  postApiV1GuestChatCompletions,
1767
- postApiV1Moderate,
1768
1824
  postApiV1NotificationsDevices,
1769
1825
  postApiV1NotificationsDevicesUnregister,
1770
1826
  postApiV1PhoneCalls,
@@ -1795,11 +1851,13 @@ export {
1795
1851
  postAuthOauthByProviderRevoke,
1796
1852
  postInternalAccountsByPhoneHashes,
1797
1853
  postInternalComplete,
1854
+ postInternalDmRequests,
1798
1855
  postInternalEmbeddings,
1799
1856
  postInternalExtractPhotoFacts,
1800
- postInternalModerate,
1857
+ postInternalMeetupsJoins,
1801
1858
  postInternalNearbyActivations,
1802
1859
  postInternalPrefineryClaimTokens,
1860
+ postNearbyAccessCode,
1803
1861
  postNearbyWaitlist,
1804
1862
  postOauthConsent,
1805
1863
  postOauthRevoke,
@@ -1813,6 +1871,7 @@ export {
1813
1871
  putApiV1AdminAppsById,
1814
1872
  putApiV1AdminBotConfig,
1815
1873
  putApiV1AdminConnectorsByProvider,
1874
+ putApiV1AdminModerationCsamByIdReview,
1816
1875
  putApiV1AdminPersonasById,
1817
1876
  putApiV1AgentsByIdPreference,
1818
1877
  putApiV1ConnectorsByProviderScopes,
@@ -5643,6 +5643,7 @@ function createVaultEmbeddingCache(maxSize = DEFAULT_VAULT_CACHE_SIZE) {
5643
5643
  }
5644
5644
 
5645
5645
  // src/lib/memoryVault/searchTool.ts
5646
+ var DEFAULT_RERANK_TOP_N = 5;
5646
5647
  var nowMs = () => typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
5647
5648
  var warnedProgrammaticDecomposeIgnored = false;
5648
5649
  function normalizeEventTimeKind(kind) {
@@ -5873,7 +5874,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
5873
5874
  let tailSlice = [];
5874
5875
  const itemById = new Map(items.map((i) => [i.id, i]));
5875
5876
  if (options?.rerank) {
5876
- const rerankTopN = options.rerankTopN ?? 30;
5877
+ const rerankTopN = options.rerankTopN ?? DEFAULT_RERANK_TOP_N;
5877
5878
  const ceWeight = options.ceWeight ?? 0.1;
5878
5879
  const headSlice = v2Ranked.slice(0, rerankTopN);
5879
5880
  const ceStart = nowMs();
@@ -5919,9 +5920,12 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
5919
5920
  }
5920
5921
  if (sideLanesAsync.length > 0) {
5921
5922
  const headIds = combined.map((r) => r.uniqueId);
5922
- const fused = rrfFuse([headIds, headIds, ...sideLanesAsync], options?.rrfK);
5923
- const fusedHead = combined.map((r) => ({ ...r, similarity: fused.get(r.uniqueId) ?? r.similarity })).sort((a, b) => b.similarity - a.similarity);
5924
- const seen = new Set(combined.map((r) => r.uniqueId));
5923
+ const tailIds = tailSlice.map((r) => r.uniqueId);
5924
+ const rankedIds = tailIds.length > 0 ? [...headIds, ...tailIds] : headIds;
5925
+ const fused = rrfFuse([rankedIds, rankedIds, ...sideLanesAsync], options?.rrfK);
5926
+ const fusedHead = [...combined, ...tailSlice].map((r) => ({ ...r, similarity: fused.get(r.uniqueId) ?? r.similarity })).sort((a, b) => b.similarity - a.similarity);
5927
+ tailSlice = [];
5928
+ const seen = new Set(fusedHead.map((r) => r.uniqueId));
5925
5929
  const itemById2 = new Map(items.map((i) => [i.id, i]));
5926
5930
  for (const lane of sideLanesAsync) {
5927
5931
  for (const id of lane) {
@@ -5946,7 +5950,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
5946
5950
  const lambda = options.mmrLambda ?? 0.7;
5947
5951
  const mmrTopN = options.mmrTopN ?? 20;
5948
5952
  const itemById2 = new Map(items.map((i) => [i.id, i]));
5949
- const mmrCandidates = combined.slice(0, mmrTopN).map((r) => ({
5953
+ const mmrCandidates = [...combined, ...tailSlice].slice(0, mmrTopN).map((r) => ({
5950
5954
  id: r.uniqueId,
5951
5955
  score: r.similarity,
5952
5956
  embedding: itemById2.get(r.uniqueId)?.embedding ?? [],
@@ -5954,7 +5958,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
5954
5958
  }));
5955
5959
  const picked = applyMMR(mmrCandidates, limit, lambda);
5956
5960
  const pickedIds = new Set(picked.map((p) => p.id));
5957
- const resultMap = new Map(combined.map((r) => [r.uniqueId, r]));
5961
+ const resultMap = new Map([...combined, ...tailSlice].map((r) => [r.uniqueId, r]));
5958
5962
  const pickedResults = picked.map((p) => {
5959
5963
  const orig = resultMap.get(p.id);
5960
5964
  return {
@@ -6068,7 +6072,7 @@ async function rankComposite(originalQuery, originalQueryEmbedding, subQueries,
6068
6072
  }
6069
6073
  }
6070
6074
  if (options?.rerank && combined.length > 0) {
6071
- const rerankTopN = options.rerankTopN ?? 30;
6075
+ const rerankTopN = options.rerankTopN ?? DEFAULT_RERANK_TOP_N;
6072
6076
  const ceWeight = options.ceWeight ?? 0.1;
6073
6077
  const headSlice = combined.slice(0, rerankTopN);
6074
6078
  const tailSlice = combined.slice(rerankTopN);
@@ -6908,7 +6912,7 @@ function createMemoryVaultSearchTool(vaultCtx, embeddingOptions, cache, searchOp
6908
6912
  subQueries = decomp.subQueries;
6909
6913
  }
6910
6914
  }
6911
- const { recall: recall2 } = await import("./recall-B3PUQHJK.mjs");
6915
+ const { recall: recall2 } = await import("./recall-SCMH2R24.mjs");
6912
6916
  let recallDegraded = [];
6913
6917
  const result = await recall2(
6914
6918
  query,
@@ -8293,7 +8293,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
8293
8293
  let tailSlice = [];
8294
8294
  const itemById = new Map(items.map((i) => [i.id, i]));
8295
8295
  if (options?.rerank) {
8296
- const rerankTopN = options.rerankTopN ?? 30;
8296
+ const rerankTopN = options.rerankTopN ?? DEFAULT_RERANK_TOP_N;
8297
8297
  const ceWeight = options.ceWeight ?? 0.1;
8298
8298
  const headSlice = v2Ranked.slice(0, rerankTopN);
8299
8299
  const ceStart = nowMs2();
@@ -8339,9 +8339,12 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
8339
8339
  }
8340
8340
  if (sideLanesAsync.length > 0) {
8341
8341
  const headIds = combined.map((r) => r.uniqueId);
8342
- const fused = rrfFuse([headIds, headIds, ...sideLanesAsync], options?.rrfK);
8343
- const fusedHead = combined.map((r) => ({ ...r, similarity: fused.get(r.uniqueId) ?? r.similarity })).sort((a, b) => b.similarity - a.similarity);
8344
- const seen = new Set(combined.map((r) => r.uniqueId));
8342
+ const tailIds = tailSlice.map((r) => r.uniqueId);
8343
+ const rankedIds = tailIds.length > 0 ? [...headIds, ...tailIds] : headIds;
8344
+ const fused = rrfFuse([rankedIds, rankedIds, ...sideLanesAsync], options?.rrfK);
8345
+ const fusedHead = [...combined, ...tailSlice].map((r) => ({ ...r, similarity: fused.get(r.uniqueId) ?? r.similarity })).sort((a, b) => b.similarity - a.similarity);
8346
+ tailSlice = [];
8347
+ const seen = new Set(fusedHead.map((r) => r.uniqueId));
8345
8348
  const itemById2 = new Map(items.map((i) => [i.id, i]));
8346
8349
  for (const lane of sideLanesAsync) {
8347
8350
  for (const id of lane) {
@@ -8366,7 +8369,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
8366
8369
  const lambda = options.mmrLambda ?? 0.7;
8367
8370
  const mmrTopN = options.mmrTopN ?? 20;
8368
8371
  const itemById2 = new Map(items.map((i) => [i.id, i]));
8369
- const mmrCandidates = combined.slice(0, mmrTopN).map((r) => ({
8372
+ const mmrCandidates = [...combined, ...tailSlice].slice(0, mmrTopN).map((r) => ({
8370
8373
  id: r.uniqueId,
8371
8374
  score: r.similarity,
8372
8375
  embedding: itemById2.get(r.uniqueId)?.embedding ?? [],
@@ -8374,7 +8377,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
8374
8377
  }));
8375
8378
  const picked = applyMMR(mmrCandidates, limit, lambda);
8376
8379
  const pickedIds = new Set(picked.map((p) => p.id));
8377
- const resultMap = new Map(combined.map((r) => [r.uniqueId, r]));
8380
+ const resultMap = new Map([...combined, ...tailSlice].map((r) => [r.uniqueId, r]));
8378
8381
  const pickedResults = picked.map((p) => {
8379
8382
  const orig = resultMap.get(p.id);
8380
8383
  return {
@@ -8488,7 +8491,7 @@ async function rankComposite(originalQuery, originalQueryEmbedding, subQueries,
8488
8491
  }
8489
8492
  }
8490
8493
  if (options?.rerank && combined.length > 0) {
8491
- const rerankTopN = options.rerankTopN ?? 30;
8494
+ const rerankTopN = options.rerankTopN ?? DEFAULT_RERANK_TOP_N;
8492
8495
  const ceWeight = options.ceWeight ?? 0.1;
8493
8496
  const headSlice = combined.slice(0, rerankTopN);
8494
8497
  const tailSlice = combined.slice(rerankTopN);
@@ -9373,7 +9376,7 @@ ${formatted}`;
9373
9376
  }
9374
9377
  };
9375
9378
  }
9376
- var nowMs2, warnedProgrammaticDecomposeIgnored, SUPERSESSION_SIMILARITY_THRESHOLD, SUPERSESSION_MIN_AGE_GAP_MS, SUPERSESSION_BOOST_FACTOR, SUPERSESSION_MAX_WINDOW, EMBEDDINGS_DEGRADED_EMPTY_NO_LEXICAL;
9379
+ var DEFAULT_RERANK_TOP_N, nowMs2, warnedProgrammaticDecomposeIgnored, SUPERSESSION_SIMILARITY_THRESHOLD, SUPERSESSION_MIN_AGE_GAP_MS, SUPERSESSION_BOOST_FACTOR, SUPERSESSION_MAX_WINDOW, EMBEDDINGS_DEGRADED_EMPTY_NO_LEXICAL;
9377
9380
  var init_searchTool = __esm({
9378
9381
  "src/lib/memoryVault/searchTool.ts"() {
9379
9382
  "use strict";
@@ -9391,6 +9394,7 @@ var init_searchTool = __esm({
9391
9394
  init_bm25();
9392
9395
  init_decomposeQuery();
9393
9396
  init_lruCache();
9397
+ DEFAULT_RERANK_TOP_N = 5;
9394
9398
  nowMs2 = () => typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
9395
9399
  warnedProgrammaticDecomposeIgnored = false;
9396
9400
  SUPERSESSION_SIMILARITY_THRESHOLD = 0.7;
@@ -5375,7 +5375,7 @@ interface MemoryVaultSearchOptions {
5375
5375
  * When true, switches to the async pipeline (rankFusedVaultMemoriesAsync).
5376
5376
  */
5377
5377
  rerank?: boolean;
5378
- /** Number of CE rerank candidates. Default 30. */
5378
+ /** Number of CE rerank candidates. Default 5 ({@link DEFAULT_RERANK_TOP_N}). */
5379
5379
  rerankTopN?: number;
5380
5380
  /** Multiplicative cross-encoder blend weight. Default 0.1. Only used when `rerank` is true. */
5381
5381
  ceWeight?: number;
@@ -5730,7 +5730,8 @@ interface RecallOptions {
5730
5730
  * swallowed (diagnostics must never break retrieval). Off unless provided.
5731
5731
  */
5732
5732
  onDiagnostics?: (diagnostics: RecallDiagnostics) => void;
5733
- /** Number of candidates fed to the cross-encoder rerank stage. Default: 30. */
5733
+ /** Number of candidates fed to the cross-encoder rerank stage. Default: 5;
5734
+ * was 30 until 2026-08-13 — see anuma-ai/sdk#845. */
5734
5735
  rerankTopN?: number;
5735
5736
  /** Multiplicative cross-encoder blend weight. Default: 0.1. */
5736
5737
  ceWeight?: number;
@@ -5375,7 +5375,7 @@ interface MemoryVaultSearchOptions {
5375
5375
  * When true, switches to the async pipeline (rankFusedVaultMemoriesAsync).
5376
5376
  */
5377
5377
  rerank?: boolean;
5378
- /** Number of CE rerank candidates. Default 30. */
5378
+ /** Number of CE rerank candidates. Default 5 ({@link DEFAULT_RERANK_TOP_N}). */
5379
5379
  rerankTopN?: number;
5380
5380
  /** Multiplicative cross-encoder blend weight. Default 0.1. Only used when `rerank` is true. */
5381
5381
  ceWeight?: number;
@@ -5730,7 +5730,8 @@ interface RecallOptions {
5730
5730
  * swallowed (diagnostics must never break retrieval). Off unless provided.
5731
5731
  */
5732
5732
  onDiagnostics?: (diagnostics: RecallDiagnostics) => void;
5733
- /** Number of candidates fed to the cross-encoder rerank stage. Default: 30. */
5733
+ /** Number of candidates fed to the cross-encoder rerank stage. Default: 5;
5734
+ * was 30 until 2026-08-13 — see anuma-ai/sdk#845. */
5734
5735
  rerankTopN?: number;
5735
5736
  /** Multiplicative cross-encoder blend weight. Default: 0.1. */
5736
5737
  ceWeight?: number;
@@ -133,7 +133,7 @@ import {
133
133
  upsertMessageOp,
134
134
  useEncryption,
135
135
  vaultMemoryToStored
136
- } from "./chunk-L253L67R.mjs";
136
+ } from "./chunk-7HRJOHW4.mjs";
137
137
  import {
138
138
  PII_PATTERNS,
139
139
  PiiRedactor,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  recall
3
- } from "./chunk-L253L67R.mjs";
3
+ } from "./chunk-7HRJOHW4.mjs";
4
4
  import "./chunk-WUG6GTHO.mjs";
5
5
  import "./chunk-GYKJOWEO.mjs";
6
6
  export {
package/dist/index.d.mts CHANGED
@@ -4453,6 +4453,10 @@ type GetApiV1AdminUsersLookupData = {
4453
4453
  * Email address (requires Privy credentials)
4454
4454
  */
4455
4455
  email?: string;
4456
+ /**
4457
+ * Portal account id
4458
+ */
4459
+ account_id?: number;
4456
4460
  };
4457
4461
  url: '/api/v1/admin/users/lookup';
4458
4462
  };
@@ -4639,6 +4643,10 @@ type PostApiV1ChatCompletionsErrors = {
4639
4643
  * Model provider rate limit exceeded
4640
4644
  */
4641
4645
  429: ResponseErrorResponse;
4646
+ /**
4647
+ * Client closed the request before a response was produced
4648
+ */
4649
+ 499: ResponseErrorResponse;
4642
4650
  /**
4643
4651
  * Internal Server Error
4644
4652
  */
@@ -5619,6 +5627,10 @@ type PostApiV1EmbeddingsErrors = {
5619
5627
  * Model provider rate limit exceeded
5620
5628
  */
5621
5629
  429: ResponseErrorResponse;
5630
+ /**
5631
+ * Client closed the request before a response was produced
5632
+ */
5633
+ 499: ResponseErrorResponse;
5622
5634
  /**
5623
5635
  * Internal Server Error
5624
5636
  */
@@ -5838,6 +5850,10 @@ type PostApiV1ResponsesErrors = {
5838
5850
  * Model provider rate limit exceeded
5839
5851
  */
5840
5852
  429: ResponseErrorResponse;
5853
+ /**
5854
+ * Client closed the request before a response was produced
5855
+ */
5856
+ 499: ResponseErrorResponse;
5841
5857
  /**
5842
5858
  * Internal Server Error
5843
5859
  */
@@ -6760,7 +6776,7 @@ declare const deleteApiV1AdminTextReset: <ThrowOnError extends boolean = false>(
6760
6776
  /**
6761
6777
  * Lookup user by identifier
6762
6778
  *
6763
- * Retrieves account details, all app enrollments with balances, and text registrations. Accepts wallet_address, phone, telegram, or email (exactly one required). When the identifier resolves to a Privy user that has no portal account (e.g. a Privy signup that never onboarded), returns 200 with account=null, portal_account_exists=false, and a privy block describing the Privy identity, instead of 404 — so an operator can still see (and delete) the Privy user.
6779
+ * Retrieves account details, all app enrollments with balances, and text registrations. Accepts wallet_address, phone, telegram, email or account_id (exactly one required). The response's privy block carries the email, resolved from the account's Privy DID when the query itself did not go through Privy. When the identifier resolves to a Privy user that has no portal account (e.g. a Privy signup that never onboarded), returns 200 with account=null, portal_account_exists=false, and a privy block describing the Privy identity, instead of 404 — so an operator can still see (and delete) the Privy user.
6764
6780
  */
6765
6781
  declare const getApiV1AdminUsersLookup: <ThrowOnError extends boolean = false>(options: Options<GetApiV1AdminUsersLookupData, ThrowOnError>) => RequestResult<GetApiV1AdminUsersLookupResponses, GetApiV1AdminUsersLookupErrors, ThrowOnError>;
6766
6782
  /**
package/dist/index.d.ts CHANGED
@@ -4453,6 +4453,10 @@ type GetApiV1AdminUsersLookupData = {
4453
4453
  * Email address (requires Privy credentials)
4454
4454
  */
4455
4455
  email?: string;
4456
+ /**
4457
+ * Portal account id
4458
+ */
4459
+ account_id?: number;
4456
4460
  };
4457
4461
  url: '/api/v1/admin/users/lookup';
4458
4462
  };
@@ -4639,6 +4643,10 @@ type PostApiV1ChatCompletionsErrors = {
4639
4643
  * Model provider rate limit exceeded
4640
4644
  */
4641
4645
  429: ResponseErrorResponse;
4646
+ /**
4647
+ * Client closed the request before a response was produced
4648
+ */
4649
+ 499: ResponseErrorResponse;
4642
4650
  /**
4643
4651
  * Internal Server Error
4644
4652
  */
@@ -5619,6 +5627,10 @@ type PostApiV1EmbeddingsErrors = {
5619
5627
  * Model provider rate limit exceeded
5620
5628
  */
5621
5629
  429: ResponseErrorResponse;
5630
+ /**
5631
+ * Client closed the request before a response was produced
5632
+ */
5633
+ 499: ResponseErrorResponse;
5622
5634
  /**
5623
5635
  * Internal Server Error
5624
5636
  */
@@ -5838,6 +5850,10 @@ type PostApiV1ResponsesErrors = {
5838
5850
  * Model provider rate limit exceeded
5839
5851
  */
5840
5852
  429: ResponseErrorResponse;
5853
+ /**
5854
+ * Client closed the request before a response was produced
5855
+ */
5856
+ 499: ResponseErrorResponse;
5841
5857
  /**
5842
5858
  * Internal Server Error
5843
5859
  */
@@ -6760,7 +6776,7 @@ declare const deleteApiV1AdminTextReset: <ThrowOnError extends boolean = false>(
6760
6776
  /**
6761
6777
  * Lookup user by identifier
6762
6778
  *
6763
- * Retrieves account details, all app enrollments with balances, and text registrations. Accepts wallet_address, phone, telegram, or email (exactly one required). When the identifier resolves to a Privy user that has no portal account (e.g. a Privy signup that never onboarded), returns 200 with account=null, portal_account_exists=false, and a privy block describing the Privy identity, instead of 404 — so an operator can still see (and delete) the Privy user.
6779
+ * Retrieves account details, all app enrollments with balances, and text registrations. Accepts wallet_address, phone, telegram, email or account_id (exactly one required). The response's privy block carries the email, resolved from the account's Privy DID when the query itself did not go through Privy. When the identifier resolves to a Privy user that has no portal account (e.g. a Privy signup that never onboarded), returns 200 with account=null, portal_account_exists=false, and a privy block describing the Privy identity, instead of 404 — so an operator can still see (and delete) the Privy user.
6764
6780
  */
6765
6781
  declare const getApiV1AdminUsersLookup: <ThrowOnError extends boolean = false>(options: Options<GetApiV1AdminUsersLookupData, ThrowOnError>) => RequestResult<GetApiV1AdminUsersLookupResponses, GetApiV1AdminUsersLookupErrors, ThrowOnError>;
6766
6782
  /**
@@ -5927,6 +5927,7 @@ function createVaultEmbeddingCache(maxSize = DEFAULT_VAULT_CACHE_SIZE) {
5927
5927
  }
5928
5928
 
5929
5929
  // src/lib/memoryVault/searchTool.ts
5930
+ var DEFAULT_RERANK_TOP_N = 5;
5930
5931
  var nowMs = () => typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
5931
5932
  var warnedProgrammaticDecomposeIgnored = false;
5932
5933
  function normalizeEventTimeKind(kind) {
@@ -6157,7 +6158,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
6157
6158
  let tailSlice = [];
6158
6159
  const itemById = new Map(items.map((i) => [i.id, i]));
6159
6160
  if (options?.rerank) {
6160
- const rerankTopN = options.rerankTopN ?? 30;
6161
+ const rerankTopN = options.rerankTopN ?? DEFAULT_RERANK_TOP_N;
6161
6162
  const ceWeight = options.ceWeight ?? 0.1;
6162
6163
  const headSlice = v2Ranked.slice(0, rerankTopN);
6163
6164
  const ceStart = nowMs();
@@ -6203,9 +6204,12 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
6203
6204
  }
6204
6205
  if (sideLanesAsync.length > 0) {
6205
6206
  const headIds = combined.map((r) => r.uniqueId);
6206
- const fused = rrfFuse([headIds, headIds, ...sideLanesAsync], options?.rrfK);
6207
- const fusedHead = combined.map((r) => ({ ...r, similarity: fused.get(r.uniqueId) ?? r.similarity })).sort((a, b) => b.similarity - a.similarity);
6208
- const seen = new Set(combined.map((r) => r.uniqueId));
6207
+ const tailIds = tailSlice.map((r) => r.uniqueId);
6208
+ const rankedIds = tailIds.length > 0 ? [...headIds, ...tailIds] : headIds;
6209
+ const fused = rrfFuse([rankedIds, rankedIds, ...sideLanesAsync], options?.rrfK);
6210
+ const fusedHead = [...combined, ...tailSlice].map((r) => ({ ...r, similarity: fused.get(r.uniqueId) ?? r.similarity })).sort((a, b) => b.similarity - a.similarity);
6211
+ tailSlice = [];
6212
+ const seen = new Set(fusedHead.map((r) => r.uniqueId));
6209
6213
  const itemById2 = new Map(items.map((i) => [i.id, i]));
6210
6214
  for (const lane of sideLanesAsync) {
6211
6215
  for (const id of lane) {
@@ -6230,7 +6234,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
6230
6234
  const lambda = options.mmrLambda ?? 0.7;
6231
6235
  const mmrTopN = options.mmrTopN ?? 20;
6232
6236
  const itemById2 = new Map(items.map((i) => [i.id, i]));
6233
- const mmrCandidates = combined.slice(0, mmrTopN).map((r) => ({
6237
+ const mmrCandidates = [...combined, ...tailSlice].slice(0, mmrTopN).map((r) => ({
6234
6238
  id: r.uniqueId,
6235
6239
  score: r.similarity,
6236
6240
  embedding: itemById2.get(r.uniqueId)?.embedding ?? [],
@@ -6238,7 +6242,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
6238
6242
  }));
6239
6243
  const picked = applyMMR(mmrCandidates, limit, lambda);
6240
6244
  const pickedIds = new Set(picked.map((p) => p.id));
6241
- const resultMap = new Map(combined.map((r) => [r.uniqueId, r]));
6245
+ const resultMap = new Map([...combined, ...tailSlice].map((r) => [r.uniqueId, r]));
6242
6246
  const pickedResults = picked.map((p) => {
6243
6247
  const orig = resultMap.get(p.id);
6244
6248
  return {
@@ -6352,7 +6356,7 @@ async function rankComposite(originalQuery, originalQueryEmbedding, subQueries,
6352
6356
  }
6353
6357
  }
6354
6358
  if (options?.rerank && combined.length > 0) {
6355
- const rerankTopN = options.rerankTopN ?? 30;
6359
+ const rerankTopN = options.rerankTopN ?? DEFAULT_RERANK_TOP_N;
6356
6360
  const ceWeight = options.ceWeight ?? 0.1;
6357
6361
  const headSlice = combined.slice(0, rerankTopN);
6358
6362
  const tailSlice = combined.slice(rerankTopN);
@@ -7192,7 +7196,7 @@ function createMemoryVaultSearchTool(vaultCtx, embeddingOptions, cache, searchOp
7192
7196
  subQueries = decomp.subQueries;
7193
7197
  }
7194
7198
  }
7195
- const { recall: recall2 } = await import("./recall-WPYCG4ED.mjs");
7199
+ const { recall: recall2 } = await import("./recall-B3M4BWQ2.mjs");
7196
7200
  let recallDegraded = [];
7197
7201
  const result = await recall2(
7198
7202
  query,
@@ -8577,7 +8577,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
8577
8577
  let tailSlice = [];
8578
8578
  const itemById = new Map(items.map((i) => [i.id, i]));
8579
8579
  if (options?.rerank) {
8580
- const rerankTopN = options.rerankTopN ?? 30;
8580
+ const rerankTopN = options.rerankTopN ?? DEFAULT_RERANK_TOP_N;
8581
8581
  const ceWeight = options.ceWeight ?? 0.1;
8582
8582
  const headSlice = v2Ranked.slice(0, rerankTopN);
8583
8583
  const ceStart = nowMs2();
@@ -8623,9 +8623,12 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
8623
8623
  }
8624
8624
  if (sideLanesAsync.length > 0) {
8625
8625
  const headIds = combined.map((r) => r.uniqueId);
8626
- const fused = rrfFuse([headIds, headIds, ...sideLanesAsync], options?.rrfK);
8627
- const fusedHead = combined.map((r) => ({ ...r, similarity: fused.get(r.uniqueId) ?? r.similarity })).sort((a, b) => b.similarity - a.similarity);
8628
- const seen = new Set(combined.map((r) => r.uniqueId));
8626
+ const tailIds = tailSlice.map((r) => r.uniqueId);
8627
+ const rankedIds = tailIds.length > 0 ? [...headIds, ...tailIds] : headIds;
8628
+ const fused = rrfFuse([rankedIds, rankedIds, ...sideLanesAsync], options?.rrfK);
8629
+ const fusedHead = [...combined, ...tailSlice].map((r) => ({ ...r, similarity: fused.get(r.uniqueId) ?? r.similarity })).sort((a, b) => b.similarity - a.similarity);
8630
+ tailSlice = [];
8631
+ const seen = new Set(fusedHead.map((r) => r.uniqueId));
8629
8632
  const itemById2 = new Map(items.map((i) => [i.id, i]));
8630
8633
  for (const lane of sideLanesAsync) {
8631
8634
  for (const id of lane) {
@@ -8650,7 +8653,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
8650
8653
  const lambda = options.mmrLambda ?? 0.7;
8651
8654
  const mmrTopN = options.mmrTopN ?? 20;
8652
8655
  const itemById2 = new Map(items.map((i) => [i.id, i]));
8653
- const mmrCandidates = combined.slice(0, mmrTopN).map((r) => ({
8656
+ const mmrCandidates = [...combined, ...tailSlice].slice(0, mmrTopN).map((r) => ({
8654
8657
  id: r.uniqueId,
8655
8658
  score: r.similarity,
8656
8659
  embedding: itemById2.get(r.uniqueId)?.embedding ?? [],
@@ -8658,7 +8661,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
8658
8661
  }));
8659
8662
  const picked = applyMMR(mmrCandidates, limit, lambda);
8660
8663
  const pickedIds = new Set(picked.map((p) => p.id));
8661
- const resultMap = new Map(combined.map((r) => [r.uniqueId, r]));
8664
+ const resultMap = new Map([...combined, ...tailSlice].map((r) => [r.uniqueId, r]));
8662
8665
  const pickedResults = picked.map((p) => {
8663
8666
  const orig = resultMap.get(p.id);
8664
8667
  return {
@@ -8772,7 +8775,7 @@ async function rankComposite(originalQuery, originalQueryEmbedding, subQueries,
8772
8775
  }
8773
8776
  }
8774
8777
  if (options?.rerank && combined.length > 0) {
8775
- const rerankTopN = options.rerankTopN ?? 30;
8778
+ const rerankTopN = options.rerankTopN ?? DEFAULT_RERANK_TOP_N;
8776
8779
  const ceWeight = options.ceWeight ?? 0.1;
8777
8780
  const headSlice = combined.slice(0, rerankTopN);
8778
8781
  const tailSlice = combined.slice(rerankTopN);
@@ -9657,7 +9660,7 @@ ${formatted}`;
9657
9660
  }
9658
9661
  };
9659
9662
  }
9660
- var nowMs2, warnedProgrammaticDecomposeIgnored, SUPERSESSION_SIMILARITY_THRESHOLD, SUPERSESSION_MIN_AGE_GAP_MS, SUPERSESSION_BOOST_FACTOR, SUPERSESSION_MAX_WINDOW, EMBEDDINGS_DEGRADED_EMPTY_NO_LEXICAL;
9663
+ var DEFAULT_RERANK_TOP_N, nowMs2, warnedProgrammaticDecomposeIgnored, SUPERSESSION_SIMILARITY_THRESHOLD, SUPERSESSION_MIN_AGE_GAP_MS, SUPERSESSION_BOOST_FACTOR, SUPERSESSION_MAX_WINDOW, EMBEDDINGS_DEGRADED_EMPTY_NO_LEXICAL;
9661
9664
  var init_searchTool = __esm({
9662
9665
  "src/lib/memoryVault/searchTool.ts"() {
9663
9666
  "use strict";
@@ -9675,6 +9678,7 @@ var init_searchTool = __esm({
9675
9678
  init_bm25();
9676
9679
  init_decomposeQuery();
9677
9680
  init_lruCache();
9681
+ DEFAULT_RERANK_TOP_N = 5;
9678
9682
  nowMs2 = () => typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
9679
9683
  warnedProgrammaticDecomposeIgnored = false;
9680
9684
  SUPERSESSION_SIMILARITY_THRESHOLD = 0.7;
@@ -6644,7 +6644,7 @@ interface MemoryVaultSearchOptions {
6644
6644
  * When true, switches to the async pipeline (rankFusedVaultMemoriesAsync).
6645
6645
  */
6646
6646
  rerank?: boolean;
6647
- /** Number of CE rerank candidates. Default 30. */
6647
+ /** Number of CE rerank candidates. Default 5 ({@link DEFAULT_RERANK_TOP_N}). */
6648
6648
  rerankTopN?: number;
6649
6649
  /** Multiplicative cross-encoder blend weight. Default 0.1. Only used when `rerank` is true. */
6650
6650
  ceWeight?: number;
@@ -6999,7 +6999,8 @@ interface RecallOptions {
6999
6999
  * swallowed (diagnostics must never break retrieval). Off unless provided.
7000
7000
  */
7001
7001
  onDiagnostics?: (diagnostics: RecallDiagnostics) => void;
7002
- /** Number of candidates fed to the cross-encoder rerank stage. Default: 30. */
7002
+ /** Number of candidates fed to the cross-encoder rerank stage. Default: 5;
7003
+ * was 30 until 2026-08-13 — see anuma-ai/sdk#845. */
7003
7004
  rerankTopN?: number;
7004
7005
  /** Multiplicative cross-encoder blend weight. Default: 0.1. */
7005
7006
  ceWeight?: number;