@oobe-protocol-labs/synapse-client-sdk 1.2.1 → 1.2.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.
Files changed (564) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/dist/cjs/ai/gateway/index.d.ts +86 -5
  3. package/dist/cjs/ai/gateway/index.d.ts.map +1 -1
  4. package/dist/cjs/ai/gateway/index.js +278 -40
  5. package/dist/cjs/ai/gateway/index.js.map +1 -1
  6. package/dist/cjs/ai/gateway/registry.d.ts +223 -0
  7. package/dist/cjs/ai/gateway/registry.d.ts.map +1 -0
  8. package/dist/cjs/ai/gateway/registry.js +290 -0
  9. package/dist/cjs/ai/gateway/registry.js.map +1 -0
  10. package/dist/cjs/ai/gateway/types.d.ts +107 -1
  11. package/dist/cjs/ai/gateway/types.d.ts.map +1 -1
  12. package/dist/cjs/ai/gateway/x402/index.d.ts +2 -4
  13. package/dist/cjs/ai/gateway/x402/index.d.ts.map +1 -1
  14. package/dist/cjs/ai/gateway/x402/index.js +2 -1
  15. package/dist/cjs/ai/gateway/x402/index.js.map +1 -1
  16. package/dist/cjs/ai/gateway/x402/registry.d.ts +131 -1
  17. package/dist/cjs/ai/gateway/x402/registry.d.ts.map +1 -1
  18. package/dist/cjs/ai/gateway/x402/registry.js +229 -1
  19. package/dist/cjs/ai/gateway/x402/registry.js.map +1 -1
  20. package/dist/cjs/ai/index.d.ts +2 -1
  21. package/dist/cjs/ai/index.d.ts.map +1 -1
  22. package/dist/cjs/ai/index.js +21 -2
  23. package/dist/cjs/ai/index.js.map +1 -1
  24. package/dist/cjs/ai/persistence/helpers.d.ts +83 -0
  25. package/dist/cjs/ai/persistence/helpers.d.ts.map +1 -0
  26. package/dist/cjs/ai/persistence/helpers.js +193 -0
  27. package/dist/cjs/ai/persistence/helpers.js.map +1 -0
  28. package/dist/cjs/ai/persistence/index.d.ts +91 -0
  29. package/dist/cjs/ai/persistence/index.d.ts.map +1 -0
  30. package/dist/cjs/ai/persistence/index.js +109 -0
  31. package/dist/cjs/ai/persistence/index.js.map +1 -0
  32. package/dist/cjs/ai/persistence/memory.d.ts +71 -0
  33. package/dist/cjs/ai/persistence/memory.d.ts.map +1 -0
  34. package/dist/cjs/ai/persistence/memory.js +192 -0
  35. package/dist/cjs/ai/persistence/memory.js.map +1 -0
  36. package/dist/cjs/ai/persistence/postgresql.d.ts +119 -0
  37. package/dist/cjs/ai/persistence/postgresql.d.ts.map +1 -0
  38. package/dist/cjs/ai/persistence/postgresql.js +310 -0
  39. package/dist/cjs/ai/persistence/postgresql.js.map +1 -0
  40. package/dist/cjs/ai/persistence/redis.d.ts +84 -0
  41. package/dist/cjs/ai/persistence/redis.d.ts.map +1 -0
  42. package/dist/cjs/ai/persistence/redis.js +241 -0
  43. package/dist/cjs/ai/persistence/redis.js.map +1 -0
  44. package/dist/cjs/ai/persistence/types.d.ts +267 -0
  45. package/dist/cjs/ai/persistence/types.d.ts.map +1 -0
  46. package/dist/cjs/ai/persistence/types.js +40 -0
  47. package/dist/cjs/ai/persistence/types.js.map +1 -0
  48. package/dist/cjs/core/client.d.ts +16 -0
  49. package/dist/cjs/core/client.d.ts.map +1 -1
  50. package/dist/cjs/core/client.js +18 -0
  51. package/dist/cjs/core/client.js.map +1 -1
  52. package/dist/cjs/next/index.d.ts +141 -0
  53. package/dist/cjs/next/index.d.ts.map +1 -0
  54. package/dist/cjs/next/index.js +177 -0
  55. package/dist/cjs/next/index.js.map +1 -0
  56. package/dist/cjs/utils/helpers.d.ts +79 -1
  57. package/dist/cjs/utils/helpers.d.ts.map +1 -1
  58. package/dist/cjs/utils/helpers.js +109 -0
  59. package/dist/cjs/utils/helpers.js.map +1 -1
  60. package/dist/docs/assets/navigation.js +1 -1
  61. package/dist/docs/assets/search.js +1 -1
  62. package/dist/docs/classes/AccountReader.html +18 -18
  63. package/dist/docs/classes/AccountsClient.html +10 -10
  64. package/dist/docs/classes/AsyncProviderError.html +4 -4
  65. package/dist/docs/classes/CircularDependencyError.html +4 -4
  66. package/dist/docs/classes/DasClient.html +13 -13
  67. package/dist/docs/classes/GeyserParser.html +17 -17
  68. package/dist/docs/classes/GrpcTransport.html +6 -6
  69. package/dist/docs/classes/HttpTransport.html +4 -4
  70. package/dist/docs/classes/InstructionWriter.html +11 -11
  71. package/dist/docs/classes/MemoryGuard.html +9 -9
  72. package/dist/docs/classes/NetworkError.html +5 -5
  73. package/dist/docs/classes/RefRegistry.html +11 -11
  74. package/dist/docs/classes/RefReleasedError.html +4 -4
  75. package/dist/docs/classes/RpcMethodNotFoundError.html +4 -4
  76. package/dist/docs/classes/ServiceNotFoundError.html +4 -4
  77. package/dist/docs/classes/ServiceRef.html +13 -13
  78. package/dist/docs/classes/SolanaRpc.html +55 -55
  79. package/dist/docs/classes/SynapseClient.html +25 -15
  80. package/dist/docs/classes/SynapseContext.html +27 -27
  81. package/dist/docs/classes/SynapseError.html +4 -4
  82. package/dist/docs/classes/TimeoutError.html +4 -4
  83. package/dist/docs/classes/UpstreamError.html +6 -6
  84. package/dist/docs/classes/WeakServiceRef.html +4 -4
  85. package/dist/docs/classes/WsClient.html +10 -10
  86. package/dist/docs/enums/SynapseNetwork.html +2 -2
  87. package/dist/docs/enums/SynapseRegion.html +2 -2
  88. package/dist/docs/enums/TokenExtensionType.html +2 -2
  89. package/dist/docs/functions/Epoch-1.html +1 -1
  90. package/dist/docs/functions/Lamports-2.html +1 -1
  91. package/dist/docs/functions/Pubkey-1.html +1 -1
  92. package/dist/docs/functions/Sig.html +1 -1
  93. package/dist/docs/functions/Slot-1.html +1 -1
  94. package/dist/docs/functions/UnixTs.html +1 -1
  95. package/dist/docs/functions/autoSelectRegion.html +1 -1
  96. package/dist/docs/functions/autoWire.html +1 -1
  97. package/dist/docs/functions/base58Encode.html +1 -1
  98. package/dist/docs/functions/base64ToBytes.html +1 -1
  99. package/dist/docs/functions/bigIntReplacer.html +6 -0
  100. package/dist/docs/functions/chunk.html +1 -1
  101. package/dist/docs/functions/computeBalanceChanges.html +1 -1
  102. package/dist/docs/functions/computeTokenBalanceChanges.html +1 -1
  103. package/dist/docs/functions/createBareContext.html +1 -1
  104. package/dist/docs/functions/createBinding.html +1 -1
  105. package/dist/docs/functions/createBoundHook.html +1 -1
  106. package/dist/docs/functions/createReactAdapter.html +1 -1
  107. package/dist/docs/functions/createRefHook.html +1 -1
  108. package/dist/docs/functions/createServerMiddleware.html +1 -1
  109. package/dist/docs/functions/createServiceHook.html +1 -1
  110. package/dist/docs/functions/createSingleton.html +15 -0
  111. package/dist/docs/functions/createSynapse.html +1 -1
  112. package/dist/docs/functions/createSynapseContext.html +1 -1
  113. package/dist/docs/functions/createToken.html +1 -1
  114. package/dist/docs/functions/decodeBase58.html +1 -1
  115. package/dist/docs/functions/decodeLookupTable.html +1 -1
  116. package/dist/docs/functions/decodeMint.html +1 -1
  117. package/dist/docs/functions/decodeMultisig.html +1 -1
  118. package/dist/docs/functions/decodeNonceAccount.html +1 -1
  119. package/dist/docs/functions/decodeStakeAccount.html +1 -1
  120. package/dist/docs/functions/decodeToken2022Account.html +1 -1
  121. package/dist/docs/functions/decodeToken2022Mint.html +1 -1
  122. package/dist/docs/functions/decodeTokenAccount.html +1 -1
  123. package/dist/docs/functions/encodeBase58.html +1 -1
  124. package/dist/docs/functions/fetchLookupTable.html +1 -1
  125. package/dist/docs/functions/fetchMint.html +1 -1
  126. package/dist/docs/functions/fetchNonceAccount.html +1 -1
  127. package/dist/docs/functions/fetchStakeAccount.html +1 -1
  128. package/dist/docs/functions/fetchTokenAccount.html +1 -1
  129. package/dist/docs/functions/fetchTokenAccountsByOwner.html +1 -1
  130. package/dist/docs/functions/fromKitAddress.html +1 -1
  131. package/dist/docs/functions/getAccountInfo.html +1 -1
  132. package/dist/docs/functions/getAsset.html +1 -1
  133. package/dist/docs/functions/getAssetBatch.html +1 -1
  134. package/dist/docs/functions/getAssetProof.html +1 -1
  135. package/dist/docs/functions/getAssetProofBatch.html +1 -1
  136. package/dist/docs/functions/getAssetsByAuthority.html +1 -1
  137. package/dist/docs/functions/getAssetsByCreator.html +1 -1
  138. package/dist/docs/functions/getAssetsByGroup.html +1 -1
  139. package/dist/docs/functions/getAssetsByOwner.html +1 -1
  140. package/dist/docs/functions/getBalance.html +1 -1
  141. package/dist/docs/functions/getBlock.html +1 -1
  142. package/dist/docs/functions/getBlockCommitment.html +1 -1
  143. package/dist/docs/functions/getBlockHeight.html +1 -1
  144. package/dist/docs/functions/getBlockProduction.html +1 -1
  145. package/dist/docs/functions/getBlockTime.html +1 -1
  146. package/dist/docs/functions/getBlocks.html +1 -1
  147. package/dist/docs/functions/getBlocksWithLimit.html +1 -1
  148. package/dist/docs/functions/getClusterNodes.html +1 -1
  149. package/dist/docs/functions/getContext.html +1 -1
  150. package/dist/docs/functions/getDecodedAccount.html +1 -1
  151. package/dist/docs/functions/getDecodedAccounts.html +1 -1
  152. package/dist/docs/functions/getEnvironment.html +1 -1
  153. package/dist/docs/functions/getEpochInfo.html +1 -1
  154. package/dist/docs/functions/getEpochSchedule.html +1 -1
  155. package/dist/docs/functions/getFeeForMessage.html +1 -1
  156. package/dist/docs/functions/getFirstAvailableBlock.html +1 -1
  157. package/dist/docs/functions/getGenesisHash.html +1 -1
  158. package/dist/docs/functions/getHealth.html +1 -1
  159. package/dist/docs/functions/getHighestSnapshotSlot.html +1 -1
  160. package/dist/docs/functions/getIdentity.html +1 -1
  161. package/dist/docs/functions/getInflationGovernor.html +1 -1
  162. package/dist/docs/functions/getInflationRate.html +1 -1
  163. package/dist/docs/functions/getInflationReward.html +1 -1
  164. package/dist/docs/functions/getLargestAccounts.html +1 -1
  165. package/dist/docs/functions/getLatestBlockhash.html +1 -1
  166. package/dist/docs/functions/getLeaderSchedule.html +1 -1
  167. package/dist/docs/functions/getMaxRetransmitSlot.html +1 -1
  168. package/dist/docs/functions/getMaxShredInsertSlot.html +1 -1
  169. package/dist/docs/functions/getMinimumBalanceForRentExemption.html +1 -1
  170. package/dist/docs/functions/getMultipleAccounts.html +1 -1
  171. package/dist/docs/functions/getProgramAccounts.html +1 -1
  172. package/dist/docs/functions/getProgramCategory.html +1 -1
  173. package/dist/docs/functions/getRecentPerformanceSamples.html +1 -1
  174. package/dist/docs/functions/getRecentPrioritizationFees.html +1 -1
  175. package/dist/docs/functions/getSignatureStatuses.html +1 -1
  176. package/dist/docs/functions/getSignaturesForAddress.html +1 -1
  177. package/dist/docs/functions/getSignaturesForAsset.html +1 -1
  178. package/dist/docs/functions/getSlot.html +1 -1
  179. package/dist/docs/functions/getSlotLeader.html +1 -1
  180. package/dist/docs/functions/getSlotLeaders.html +1 -1
  181. package/dist/docs/functions/getStakeActivation.html +1 -1
  182. package/dist/docs/functions/getStakeMinimumDelegation.html +1 -1
  183. package/dist/docs/functions/getSupply.html +1 -1
  184. package/dist/docs/functions/getTokenAccountBalance.html +1 -1
  185. package/dist/docs/functions/getTokenAccounts.html +1 -1
  186. package/dist/docs/functions/getTokenAccountsByDelegate.html +1 -1
  187. package/dist/docs/functions/getTokenAccountsByOwner.html +1 -1
  188. package/dist/docs/functions/getTokenLargestAccounts.html +1 -1
  189. package/dist/docs/functions/getTokenSupply.html +1 -1
  190. package/dist/docs/functions/getTransaction.html +1 -1
  191. package/dist/docs/functions/getTransactionCount.html +1 -1
  192. package/dist/docs/functions/getVersion.html +1 -1
  193. package/dist/docs/functions/getVoteAccounts.html +1 -1
  194. package/dist/docs/functions/isBlockhashValid.html +1 -1
  195. package/dist/docs/functions/isBrowser.html +1 -1
  196. package/dist/docs/functions/isDisposable.html +1 -1
  197. package/dist/docs/functions/isProgramInCategory.html +1 -1
  198. package/dist/docs/functions/isServer.html +1 -1
  199. package/dist/docs/functions/isValidPubkey.html +1 -1
  200. package/dist/docs/functions/isValidSignature.html +1 -1
  201. package/dist/docs/functions/lamportsToSol.html +1 -1
  202. package/dist/docs/functions/listEndpoints.html +1 -1
  203. package/dist/docs/functions/listNetworks.html +1 -1
  204. package/dist/docs/functions/listRegions.html +1 -1
  205. package/dist/docs/functions/minimumLedgerSlot.html +1 -1
  206. package/dist/docs/functions/parseAccountUpdate.html +1 -1
  207. package/dist/docs/functions/parseBlockMeta.html +1 -1
  208. package/dist/docs/functions/parseEntry.html +1 -1
  209. package/dist/docs/functions/parseGeyserUpdate.html +1 -1
  210. package/dist/docs/functions/parseSlotUpdate.html +1 -1
  211. package/dist/docs/functions/parseTimestamp.html +1 -1
  212. package/dist/docs/functions/parseTransaction.html +1 -1
  213. package/dist/docs/functions/probeLatency.html +1 -1
  214. package/dist/docs/functions/rawBufferToBase58.html +1 -1
  215. package/dist/docs/functions/rawBufferToBase64.html +1 -1
  216. package/dist/docs/functions/rawBufferToBytes.html +1 -1
  217. package/dist/docs/functions/rawBufferToHex.html +1 -1
  218. package/dist/docs/functions/readonly.html +1 -1
  219. package/dist/docs/functions/readonlySigner.html +1 -1
  220. package/dist/docs/functions/requestAirdrop.html +1 -1
  221. package/dist/docs/functions/resolveEndpoint.html +1 -1
  222. package/dist/docs/functions/resolveProgram.html +1 -1
  223. package/dist/docs/functions/resolveProgramBatch.html +1 -1
  224. package/dist/docs/functions/retry.html +1 -1
  225. package/dist/docs/functions/searchAssets.html +1 -1
  226. package/dist/docs/functions/sendTransaction.html +1 -1
  227. package/dist/docs/functions/setGlobalContext.html +1 -1
  228. package/dist/docs/functions/simulateTransaction.html +1 -1
  229. package/dist/docs/functions/sleep.html +1 -1
  230. package/dist/docs/functions/solToLamports.html +1 -1
  231. package/dist/docs/functions/toClientConfig.html +1 -1
  232. package/dist/docs/functions/toJsonSafe.html +13 -0
  233. package/dist/docs/functions/toKitAddress.html +1 -1
  234. package/dist/docs/functions/toKitInstruction.html +1 -1
  235. package/dist/docs/functions/toKitLamports.html +1 -1
  236. package/dist/docs/functions/toKitSignatureString.html +1 -1
  237. package/dist/docs/functions/tryGetContext.html +1 -1
  238. package/dist/docs/functions/tryUseService.html +1 -1
  239. package/dist/docs/functions/useBoundServices.html +1 -1
  240. package/dist/docs/functions/useService.html +1 -1
  241. package/dist/docs/functions/useSharedRef.html +1 -1
  242. package/dist/docs/functions/withRef.html +1 -1
  243. package/dist/docs/functions/withRefAsync.html +1 -1
  244. package/dist/docs/functions/writable.html +1 -1
  245. package/dist/docs/functions/writableSigner.html +1 -1
  246. package/dist/docs/interfaces/AccountInfo.html +7 -7
  247. package/dist/docs/interfaces/AccountMeta.html +4 -4
  248. package/dist/docs/interfaces/AccountNotification.html +2 -2
  249. package/dist/docs/interfaces/AccountSubParams.html +2 -2
  250. package/dist/docs/interfaces/AddMemoParams.html +5 -5
  251. package/dist/docs/interfaces/AdvanceNonceParams.html +3 -3
  252. package/dist/docs/interfaces/AliasProvider.html +2 -2
  253. package/dist/docs/interfaces/AllocateParams.html +3 -3
  254. package/dist/docs/interfaces/ApproveCheckedParams.html +9 -9
  255. package/dist/docs/interfaces/ApproveParams.html +7 -7
  256. package/dist/docs/interfaces/AssetSignatureInfo.html +2 -2
  257. package/dist/docs/interfaces/AssetSignaturesPage.html +2 -2
  258. package/dist/docs/interfaces/AssignParams.html +3 -3
  259. package/dist/docs/interfaces/AsyncFactoryProvider.html +2 -2
  260. package/dist/docs/interfaces/AuthorizeNonceParams.html +4 -4
  261. package/dist/docs/interfaces/BalanceChange.html +6 -6
  262. package/dist/docs/interfaces/BlockProduction.html +3 -3
  263. package/dist/docs/interfaces/BlockResult.html +2 -2
  264. package/dist/docs/interfaces/BlockReward.html +2 -2
  265. package/dist/docs/interfaces/BlockhashResult.html +2 -2
  266. package/dist/docs/interfaces/BurnCheckedParams.html +8 -8
  267. package/dist/docs/interfaces/BurnParams.html +7 -7
  268. package/dist/docs/interfaces/CallOptions.html +6 -6
  269. package/dist/docs/interfaces/ClassProvider.html +2 -2
  270. package/dist/docs/interfaces/CloseAccountParams.html +6 -6
  271. package/dist/docs/interfaces/ConfirmedTransaction.html +6 -6
  272. package/dist/docs/interfaces/ContactInfo.html +2 -2
  273. package/dist/docs/interfaces/ContextAdapter.html +5 -5
  274. package/dist/docs/interfaces/ContextEvents.html +6 -6
  275. package/dist/docs/interfaces/ContextModule.html +3 -3
  276. package/dist/docs/interfaces/CreateATAParams.html +6 -6
  277. package/dist/docs/interfaces/CreateAccountParams.html +6 -6
  278. package/dist/docs/interfaces/CreateAccountWithSeedParams.html +8 -8
  279. package/dist/docs/interfaces/CreateSynapseContextOpts.html +4 -4
  280. package/dist/docs/interfaces/DasAsset.html +2 -2
  281. package/dist/docs/interfaces/DasAssetProof.html +2 -2
  282. package/dist/docs/interfaces/DasAuthority.html +2 -2
  283. package/dist/docs/interfaces/DasCompression.html +2 -2
  284. package/dist/docs/interfaces/DasContent.html +2 -2
  285. package/dist/docs/interfaces/DasCreator.html +2 -2
  286. package/dist/docs/interfaces/DasFile.html +2 -2
  287. package/dist/docs/interfaces/DasGrouping.html +2 -2
  288. package/dist/docs/interfaces/DasOpts.html +2 -2
  289. package/dist/docs/interfaces/DasOwnership.html +2 -2
  290. package/dist/docs/interfaces/DasPage.html +2 -2
  291. package/dist/docs/interfaces/DasRoyalty.html +2 -2
  292. package/dist/docs/interfaces/DasSearchParams.html +2 -2
  293. package/dist/docs/interfaces/DasSupply.html +2 -2
  294. package/dist/docs/interfaces/DataSlice.html +3 -3
  295. package/dist/docs/interfaces/DecodedAccountResult.html +4 -4
  296. package/dist/docs/interfaces/DecodedLookupTable.html +8 -8
  297. package/dist/docs/interfaces/DecodedMint.html +6 -6
  298. package/dist/docs/interfaces/DecodedMultisig.html +5 -5
  299. package/dist/docs/interfaces/DecodedNonceAccount.html +6 -6
  300. package/dist/docs/interfaces/DecodedStakeAccount.html +2 -2
  301. package/dist/docs/interfaces/DecodedToken2022Account.html +9 -9
  302. package/dist/docs/interfaces/DecodedToken2022Mint.html +6 -6
  303. package/dist/docs/interfaces/DecodedTokenAccount.html +9 -9
  304. package/dist/docs/interfaces/DefaultAccountStateExt.html +2 -2
  305. package/dist/docs/interfaces/Disposable.html +2 -2
  306. package/dist/docs/interfaces/EndpointConnectConfig.html +5 -5
  307. package/dist/docs/interfaces/EpochInfo.html +7 -7
  308. package/dist/docs/interfaces/EpochSchedule.html +2 -2
  309. package/dist/docs/interfaces/FactoryProvider.html +2 -2
  310. package/dist/docs/interfaces/FetchedMint.html +6 -6
  311. package/dist/docs/interfaces/FetchedTokenAccount.html +6 -6
  312. package/dist/docs/interfaces/FreezeThawParams.html +6 -6
  313. package/dist/docs/interfaces/GetAccountInfoOpts.html +6 -6
  314. package/dist/docs/interfaces/GetAssetsByAuthorityParams.html +2 -2
  315. package/dist/docs/interfaces/GetAssetsByCreatorParams.html +2 -2
  316. package/dist/docs/interfaces/GetAssetsByGroupParams.html +2 -2
  317. package/dist/docs/interfaces/GetAssetsByOwnerParams.html +2 -2
  318. package/dist/docs/interfaces/GetBlockOpts.html +6 -6
  319. package/dist/docs/interfaces/GetBlockProductionOpts.html +6 -6
  320. package/dist/docs/interfaces/GetMultipleAccountsOpts.html +6 -6
  321. package/dist/docs/interfaces/GetProgramAccountsOpts.html +6 -6
  322. package/dist/docs/interfaces/GetSignatureStatusesOpts.html +6 -6
  323. package/dist/docs/interfaces/GetSignaturesOpts.html +7 -7
  324. package/dist/docs/interfaces/GetTokenAccountsParams.html +2 -2
  325. package/dist/docs/interfaces/GetTransactionOpts.html +6 -6
  326. package/dist/docs/interfaces/GeyserParserConfig.html +6 -6
  327. package/dist/docs/interfaces/GeyserParserEvents.html +9 -9
  328. package/dist/docs/interfaces/GeyserParserStats.html +2 -2
  329. package/dist/docs/interfaces/GrpcCallOptions.html +2 -2
  330. package/dist/docs/interfaces/GrpcTransportConfig.html +6 -6
  331. package/dist/docs/interfaces/ImmutableOwnerExt.html +2 -2
  332. package/dist/docs/interfaces/InflationGovernor.html +2 -2
  333. package/dist/docs/interfaces/InflationRate.html +2 -2
  334. package/dist/docs/interfaces/InflationReward.html +2 -2
  335. package/dist/docs/interfaces/InitializeAccountParams.html +5 -5
  336. package/dist/docs/interfaces/InitializeMintParams.html +6 -6
  337. package/dist/docs/interfaces/InitializeNonceParams.html +3 -3
  338. package/dist/docs/interfaces/InterestBearingConfigExt.html +2 -2
  339. package/dist/docs/interfaces/LatencyProbeResult.html +2 -2
  340. package/dist/docs/interfaces/LeakReport.html +5 -5
  341. package/dist/docs/interfaces/LogsNotification.html +2 -2
  342. package/dist/docs/interfaces/LogsSubParams.html +2 -2
  343. package/dist/docs/interfaces/MemoTransferExt.html +2 -2
  344. package/dist/docs/interfaces/MemoryGuardConfig.html +4 -4
  345. package/dist/docs/interfaces/MetadataPointerExt.html +2 -2
  346. package/dist/docs/interfaces/MintCloseAuthorityExt.html +2 -2
  347. package/dist/docs/interfaces/MintToCheckedParams.html +8 -8
  348. package/dist/docs/interfaces/MintToParams.html +7 -7
  349. package/dist/docs/interfaces/NonTransferableExt.html +2 -2
  350. package/dist/docs/interfaces/PaginationOpts.html +2 -2
  351. package/dist/docs/interfaces/ParsedAccountUpdate.html +16 -16
  352. package/dist/docs/interfaces/ParsedBlockMeta.html +2 -2
  353. package/dist/docs/interfaces/ParsedEntry.html +2 -2
  354. package/dist/docs/interfaces/ParsedInstruction.html +9 -9
  355. package/dist/docs/interfaces/ParsedSlotUpdate.html +3 -3
  356. package/dist/docs/interfaces/ParsedTransaction.html +19 -19
  357. package/dist/docs/interfaces/PerfSample.html +2 -2
  358. package/dist/docs/interfaces/PermanentDelegateExt.html +2 -2
  359. package/dist/docs/interfaces/ProgramAccount.html +2 -2
  360. package/dist/docs/interfaces/ProgramNotification.html +2 -2
  361. package/dist/docs/interfaces/ProgramSubParams.html +2 -2
  362. package/dist/docs/interfaces/ProgramsBundle.html +33 -33
  363. package/dist/docs/interfaces/RawAccountInfo.html +2 -2
  364. package/dist/docs/interfaces/RawBlockMeta.html +2 -2
  365. package/dist/docs/interfaces/RawBuffer.html +2 -2
  366. package/dist/docs/interfaces/RawCompiledInstruction.html +2 -2
  367. package/dist/docs/interfaces/RawEntry.html +2 -2
  368. package/dist/docs/interfaces/RawGeyserUpdate.html +2 -2
  369. package/dist/docs/interfaces/RawInnerInstruction.html +2 -2
  370. package/dist/docs/interfaces/RawSlotInfo.html +2 -2
  371. package/dist/docs/interfaces/RawTimestamp.html +2 -2
  372. package/dist/docs/interfaces/RawTokenBalance.html +2 -2
  373. package/dist/docs/interfaces/RawTransactionInfo.html +2 -2
  374. package/dist/docs/interfaces/ReactAdapterConfig.html +2 -2
  375. package/dist/docs/interfaces/RecoverNestedParams.html +7 -7
  376. package/dist/docs/interfaces/RefRegistryConfig.html +2 -2
  377. package/dist/docs/interfaces/RefStats.html +7 -7
  378. package/dist/docs/interfaces/RequestHeapFrameParams.html +2 -2
  379. package/dist/docs/interfaces/ResolveMiddleware.html +1 -1
  380. package/dist/docs/interfaces/RevokeParams.html +5 -5
  381. package/dist/docs/interfaces/RootNotification.html +2 -2
  382. package/dist/docs/interfaces/RootSubParams.html +1 -1
  383. package/dist/docs/interfaces/RpcContext.html +2 -2
  384. package/dist/docs/interfaces/RpcError.html +4 -4
  385. package/dist/docs/interfaces/RpcRequest.html +3 -3
  386. package/dist/docs/interfaces/RpcResponse.html +2 -2
  387. package/dist/docs/interfaces/SendTransactionOpts.html +6 -6
  388. package/dist/docs/interfaces/ServerAdapterConfig.html +3 -3
  389. package/dist/docs/interfaces/ServiceBinding.html +6 -6
  390. package/dist/docs/interfaces/ServiceRegistration.html +3 -3
  391. package/dist/docs/interfaces/ServiceResolver.html +6 -6
  392. package/dist/docs/interfaces/ServiceToken.html +4 -4
  393. package/dist/docs/interfaces/SetComputeUnitLimitParams.html +2 -2
  394. package/dist/docs/interfaces/SetComputeUnitPriceParams.html +2 -2
  395. package/dist/docs/interfaces/SetLoadedAccountsDataSizeLimitParams.html +2 -2
  396. package/dist/docs/interfaces/SignatureInfo.html +7 -7
  397. package/dist/docs/interfaces/SignatureNotification.html +2 -2
  398. package/dist/docs/interfaces/SignatureStatus.html +5 -5
  399. package/dist/docs/interfaces/SignatureSubParams.html +2 -2
  400. package/dist/docs/interfaces/SignaturesForAssetParams.html +2 -2
  401. package/dist/docs/interfaces/SimulateResult.html +2 -2
  402. package/dist/docs/interfaces/SimulateTransactionOpts.html +7 -7
  403. package/dist/docs/interfaces/SingletonOptions.html +7 -0
  404. package/dist/docs/interfaces/SlotNotification.html +2 -2
  405. package/dist/docs/interfaces/SlotSubParams.html +1 -1
  406. package/dist/docs/interfaces/SortOpts.html +2 -2
  407. package/dist/docs/interfaces/StakeAuthorized.html +2 -2
  408. package/dist/docs/interfaces/StakeDelegation.html +3 -3
  409. package/dist/docs/interfaces/StakeLockup.html +4 -4
  410. package/dist/docs/interfaces/StakeMeta.html +2 -2
  411. package/dist/docs/interfaces/Supply.html +5 -5
  412. package/dist/docs/interfaces/SynapseClientConfig.html +9 -9
  413. package/dist/docs/interfaces/SynapseClientLike.html +2 -2
  414. package/dist/docs/interfaces/SynapseEndpoint.html +7 -7
  415. package/dist/docs/interfaces/SyncNativeParams.html +3 -3
  416. package/dist/docs/interfaces/SystemTransferParams.html +4 -4
  417. package/dist/docs/interfaces/TokenAccount.html +3 -3
  418. package/dist/docs/interfaces/TokenAccountsByOwnerResult.html +2 -2
  419. package/dist/docs/interfaces/TokenAmount.html +5 -5
  420. package/dist/docs/interfaces/TokenBalanceChange.html +2 -2
  421. package/dist/docs/interfaces/TokenTransferParams.html +7 -7
  422. package/dist/docs/interfaces/TransactionInstruction.html +4 -4
  423. package/dist/docs/interfaces/TransactionMeta.html +11 -11
  424. package/dist/docs/interfaces/TransferCheckedParams.html +9 -9
  425. package/dist/docs/interfaces/TransferFeeAmount.html +2 -2
  426. package/dist/docs/interfaces/TransferFeeConfig.html +2 -2
  427. package/dist/docs/interfaces/TransportConfig.html +7 -7
  428. package/dist/docs/interfaces/UnknownExtension.html +2 -2
  429. package/dist/docs/interfaces/ValueProvider.html +2 -2
  430. package/dist/docs/interfaces/VoteAccount.html +9 -9
  431. package/dist/docs/interfaces/VoteAccountsResult.html +3 -3
  432. package/dist/docs/interfaces/WithdrawNonceParams.html +5 -5
  433. package/dist/docs/interfaces/WsConfig.html +6 -6
  434. package/dist/docs/media/CHANGELOG.md +74 -0
  435. package/dist/docs/modules.html +4 -0
  436. package/dist/docs/types/AccountFetchOpts.html +1 -1
  437. package/dist/docs/types/AccountFilter.html +1 -1
  438. package/dist/docs/types/Base58.html +1 -1
  439. package/dist/docs/types/Brand.html +1 -1
  440. package/dist/docs/types/Commitment.html +1 -1
  441. package/dist/docs/types/DasSortBy.html +1 -1
  442. package/dist/docs/types/DasSortDirection.html +1 -1
  443. package/dist/docs/types/DataSizeFilter.html +1 -1
  444. package/dist/docs/types/DecodedExtension.html +1 -1
  445. package/dist/docs/types/Encoding.html +1 -1
  446. package/dist/docs/types/Epoch.html +1 -1
  447. package/dist/docs/types/Lamports.html +1 -1
  448. package/dist/docs/types/LogsFilter.html +1 -1
  449. package/dist/docs/types/MemcmpFilter.html +1 -1
  450. package/dist/docs/types/NonceState.html +1 -1
  451. package/dist/docs/types/ParsedGeyserUpdate.html +1 -1
  452. package/dist/docs/types/Pubkey.html +1 -1
  453. package/dist/docs/types/RuntimeEnv.html +1 -1
  454. package/dist/docs/types/ServiceLifecycle.html +1 -1
  455. package/dist/docs/types/ServiceProvider.html +1 -1
  456. package/dist/docs/types/Signature.html +1 -1
  457. package/dist/docs/types/Slot.html +1 -1
  458. package/dist/docs/types/StakeAccountType.html +1 -1
  459. package/dist/docs/types/SubscriptionId.html +1 -1
  460. package/dist/docs/types/TokenAccountState.html +1 -1
  461. package/dist/docs/types/TransactionDetail.html +1 -1
  462. package/dist/docs/types/UnaryMethod.html +1 -1
  463. package/dist/docs/types/UnixTimestamp.html +1 -1
  464. package/dist/docs/types/WsNotification.html +1 -1
  465. package/dist/docs/variables/ASSOCIATED_TOKEN_PROGRAM.html +1 -1
  466. package/dist/docs/variables/AssociatedToken.html +4 -4
  467. package/dist/docs/variables/COMPUTE_BUDGET_PROGRAM.html +1 -1
  468. package/dist/docs/variables/ComputeBudget.html +5 -5
  469. package/dist/docs/variables/JUPITER_PROGRAMS.html +1 -1
  470. package/dist/docs/variables/KNOWN_PROGRAMS.html +1 -1
  471. package/dist/docs/variables/KNOWN_PROGRAMS_COUNT.html +1 -1
  472. package/dist/docs/variables/LOOKUP_TABLE_HEADER_SIZE.html +1 -1
  473. package/dist/docs/variables/LOOKUP_TABLE_PROGRAM_ID.html +1 -1
  474. package/dist/docs/variables/MARINADE_PROGRAMS.html +1 -1
  475. package/dist/docs/variables/MAX_MULTISIG_SIGNERS.html +1 -1
  476. package/dist/docs/variables/MEMO_PROGRAM_V1.html +1 -1
  477. package/dist/docs/variables/MEMO_PROGRAM_V2.html +1 -1
  478. package/dist/docs/variables/METAPLEX_PROGRAMS.html +1 -1
  479. package/dist/docs/variables/METEORA_PROGRAMS.html +1 -1
  480. package/dist/docs/variables/MINT_SIZE.html +1 -1
  481. package/dist/docs/variables/MULTISIG_SIZE.html +1 -1
  482. package/dist/docs/variables/Memo.html +2 -2
  483. package/dist/docs/variables/NONCE_ACCOUNT_SIZE.html +1 -1
  484. package/dist/docs/variables/ORCA_PROGRAMS.html +1 -1
  485. package/dist/docs/variables/OTHER_PROGRAMS.html +1 -1
  486. package/dist/docs/variables/RAYDIUM_PROGRAMS.html +1 -1
  487. package/dist/docs/variables/SDK_USER_AGENT.html +1 -1
  488. package/dist/docs/variables/SPL_PROGRAMS.html +1 -1
  489. package/dist/docs/variables/STAKE_PROGRAM_ID.html +1 -1
  490. package/dist/docs/variables/SYNAPSE_DEVNET_EU.html +1 -1
  491. package/dist/docs/variables/SYNAPSE_DEVNET_US.html +1 -1
  492. package/dist/docs/variables/SYNAPSE_ENDPOINTS.html +1 -1
  493. package/dist/docs/variables/SYNAPSE_MAINNET_EU.html +1 -1
  494. package/dist/docs/variables/SYNAPSE_MAINNET_US.html +1 -1
  495. package/dist/docs/variables/SYSTEM_PROGRAM.html +1 -1
  496. package/dist/docs/variables/SYSTEM_PROGRAMS.html +1 -1
  497. package/dist/docs/variables/SYSTEM_PROGRAM_ID.html +1 -1
  498. package/dist/docs/variables/SplToken.html +16 -16
  499. package/dist/docs/variables/SystemProgram.html +10 -10
  500. package/dist/docs/variables/TOKEN_2022_PROGRAM.html +1 -1
  501. package/dist/docs/variables/TOKEN_2022_PROGRAM_ID.html +1 -1
  502. package/dist/docs/variables/TOKEN_ACCOUNT_SIZE.html +1 -1
  503. package/dist/docs/variables/TOKEN_PROGRAM.html +1 -1
  504. package/dist/docs/variables/TOKEN_PROGRAM_ID.html +1 -1
  505. package/dist/docs/variables/Tokens.html +1 -1
  506. package/dist/esm/ai/gateway/index.d.ts +86 -5
  507. package/dist/esm/ai/gateway/index.d.ts.map +1 -1
  508. package/dist/esm/ai/gateway/index.js +275 -39
  509. package/dist/esm/ai/gateway/index.js.map +1 -1
  510. package/dist/esm/ai/gateway/registry.d.ts +223 -0
  511. package/dist/esm/ai/gateway/registry.d.ts.map +1 -0
  512. package/dist/esm/ai/gateway/registry.js +285 -0
  513. package/dist/esm/ai/gateway/registry.js.map +1 -0
  514. package/dist/esm/ai/gateway/types.d.ts +107 -1
  515. package/dist/esm/ai/gateway/types.d.ts.map +1 -1
  516. package/dist/esm/ai/gateway/x402/index.d.ts +2 -4
  517. package/dist/esm/ai/gateway/x402/index.d.ts.map +1 -1
  518. package/dist/esm/ai/gateway/x402/index.js +2 -3
  519. package/dist/esm/ai/gateway/x402/index.js.map +1 -1
  520. package/dist/esm/ai/gateway/x402/registry.d.ts +131 -1
  521. package/dist/esm/ai/gateway/x402/registry.d.ts.map +1 -1
  522. package/dist/esm/ai/gateway/x402/registry.js +227 -0
  523. package/dist/esm/ai/gateway/x402/registry.js.map +1 -1
  524. package/dist/esm/ai/index.d.ts +2 -1
  525. package/dist/esm/ai/index.d.ts.map +1 -1
  526. package/dist/esm/ai/index.js +13 -1
  527. package/dist/esm/ai/index.js.map +1 -1
  528. package/dist/esm/ai/persistence/helpers.d.ts +83 -0
  529. package/dist/esm/ai/persistence/helpers.d.ts.map +1 -0
  530. package/dist/esm/ai/persistence/helpers.js +183 -0
  531. package/dist/esm/ai/persistence/helpers.js.map +1 -0
  532. package/dist/esm/ai/persistence/index.d.ts +91 -0
  533. package/dist/esm/ai/persistence/index.d.ts.map +1 -0
  534. package/dist/esm/ai/persistence/index.js +94 -0
  535. package/dist/esm/ai/persistence/index.js.map +1 -0
  536. package/dist/esm/ai/persistence/memory.d.ts +71 -0
  537. package/dist/esm/ai/persistence/memory.d.ts.map +1 -0
  538. package/dist/esm/ai/persistence/memory.js +188 -0
  539. package/dist/esm/ai/persistence/memory.js.map +1 -0
  540. package/dist/esm/ai/persistence/postgresql.d.ts +119 -0
  541. package/dist/esm/ai/persistence/postgresql.d.ts.map +1 -0
  542. package/dist/esm/ai/persistence/postgresql.js +306 -0
  543. package/dist/esm/ai/persistence/postgresql.js.map +1 -0
  544. package/dist/esm/ai/persistence/redis.d.ts +84 -0
  545. package/dist/esm/ai/persistence/redis.d.ts.map +1 -0
  546. package/dist/esm/ai/persistence/redis.js +237 -0
  547. package/dist/esm/ai/persistence/redis.js.map +1 -0
  548. package/dist/esm/ai/persistence/types.d.ts +267 -0
  549. package/dist/esm/ai/persistence/types.d.ts.map +1 -0
  550. package/dist/esm/ai/persistence/types.js +36 -0
  551. package/dist/esm/ai/persistence/types.js.map +1 -0
  552. package/dist/esm/core/client.d.ts +16 -0
  553. package/dist/esm/core/client.d.ts.map +1 -1
  554. package/dist/esm/core/client.js +18 -0
  555. package/dist/esm/core/client.js.map +1 -1
  556. package/dist/esm/next/index.d.ts +141 -0
  557. package/dist/esm/next/index.d.ts.map +1 -0
  558. package/dist/esm/next/index.js +171 -0
  559. package/dist/esm/next/index.js.map +1 -0
  560. package/dist/esm/utils/helpers.d.ts +79 -1
  561. package/dist/esm/utils/helpers.d.ts.map +1 -1
  562. package/dist/esm/utils/helpers.js +106 -0
  563. package/dist/esm/utils/helpers.js.map +1 -1
  564. package/package.json +20 -2
@@ -69,10 +69,8 @@
69
69
  * @since 1.0.0
70
70
  */
71
71
  export type { X402Network, X402ResourceInfo, X402PaymentRequirements, X402PaymentRequired, X402PaymentPayload, ExactSvmPayload, ExactEvmEip3009Payload, ExactEvmPermit2Payload, X402VerifyResponse, X402SettleResponse, X402SettlementResponse, X402CreateAuthHeaders, X402FacilitatorConfig, X402SupportedKind, X402SupportedResponse, X402RouteConfig, X402Config, KnownFacilitatorInfo, } from './types';
72
- export { SOLANA_MAINNET, SOLANA_DEVNET, USDC_SOLANA_MAINNET, USDC_SOLANA_DEVNET, USDC_MAINNET, // deprecated alias
73
- USDC_DEVNET, // deprecated alias
74
- BASE_MAINNET, BASE_SEPOLIA, ETHEREUM_MAINNET, POLYGON_MAINNET, AVALANCHE_MAINNET, SEI_MAINNET, USDC_BASE_MAINNET, USDC_BASE_SEPOLIA, USDC_ETHEREUM_MAINNET, X402_PERMIT2_PROXY, SVM_NETWORKS, EVM_NETWORKS, isSvmNetwork, isEvmNetwork, KnownFacilitator, EvmTransferMethod, X402ProtocolVersion, X402_HEADER_PAYMENT_REQUIRED, X402_HEADER_PAYMENT_SIGNATURE, X402_HEADER_PAYMENT_RESPONSE, X402_STATUS_CODE, X402_VERSION, } from './types';
75
- export { FACILITATOR_REGISTRY, getFacilitatorInfo, findFacilitatorsByNetwork, findGasSponsoredFacilitators, listKnownFacilitators, resolveKnownFacilitator, } from './registry';
72
+ export { SOLANA_MAINNET, SOLANA_DEVNET, USDC_SOLANA_MAINNET, USDC_SOLANA_DEVNET, USDC_MAINNET, USDC_DEVNET, BASE_MAINNET, BASE_SEPOLIA, ETHEREUM_MAINNET, POLYGON_MAINNET, AVALANCHE_MAINNET, SEI_MAINNET, USDC_BASE_MAINNET, USDC_BASE_SEPOLIA, USDC_ETHEREUM_MAINNET, X402_PERMIT2_PROXY, SVM_NETWORKS, EVM_NETWORKS, isSvmNetwork, isEvmNetwork, KnownFacilitator, EvmTransferMethod, X402ProtocolVersion, X402_HEADER_PAYMENT_REQUIRED, X402_HEADER_PAYMENT_SIGNATURE, X402_HEADER_PAYMENT_RESPONSE, X402_STATUS_CODE, X402_VERSION, } from './types';
73
+ export { FACILITATOR_REGISTRY, getFacilitatorInfo, findFacilitatorsByNetwork, findGasSponsoredFacilitators, listKnownFacilitators, resolveKnownFacilitator, FacilitatorDiscovery, type FacilitatorHealthResult, type FindBestOptions, } from './registry';
76
74
  export { FacilitatorClient, FacilitatorError, VerifyError, SettleError, createFacilitator, } from './facilitator';
77
75
  export { X402Paywall, encodePaymentHeader, decodePaymentHeader, } from './paywall';
78
76
  export type { PaywallResult, SettleResult, } from './paywall';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/gateway/x402/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAGH,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAEL,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EAAG,mBAAmB;AAClC,WAAW,EAAI,mBAAmB;AAGlC,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAGlB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EAGZ,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EAGnB,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,gBAAgB,EAChB,YAAY,GACb,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AAEnB,YAAY,EACV,aAAa,EACb,YAAY,GACb,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,UAAU,EACV,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAElB,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/gateway/x402/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAGH,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAEL,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EAGX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAGlB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EAGZ,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EAGnB,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,gBAAgB,EAChB,YAAY,GACb,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AAEnB,YAAY,EACV,aAAa,EACb,YAAY,GACb,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,UAAU,EACV,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAElB,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,UAAU,CAAC"}
@@ -70,8 +70,7 @@
70
70
  */
71
71
  export {
72
72
  /* ── Solana networks & assets ── */
73
- SOLANA_MAINNET, SOLANA_DEVNET, USDC_SOLANA_MAINNET, USDC_SOLANA_DEVNET, USDC_MAINNET, // deprecated alias
74
- USDC_DEVNET, // deprecated alias
73
+ SOLANA_MAINNET, SOLANA_DEVNET, USDC_SOLANA_MAINNET, USDC_SOLANA_DEVNET, USDC_MAINNET, USDC_DEVNET,
75
74
  /* ── Base / EVM networks & assets ── */
76
75
  BASE_MAINNET, BASE_SEPOLIA, ETHEREUM_MAINNET, POLYGON_MAINNET, AVALANCHE_MAINNET, SEI_MAINNET, USDC_BASE_MAINNET, USDC_BASE_SEPOLIA, USDC_ETHEREUM_MAINNET, X402_PERMIT2_PROXY,
77
76
  /* ── Network collections & helpers ── */
@@ -81,7 +80,7 @@ KnownFacilitator, EvmTransferMethod, X402ProtocolVersion,
81
80
  /* ── Header constants ── */
82
81
  X402_HEADER_PAYMENT_REQUIRED, X402_HEADER_PAYMENT_SIGNATURE, X402_HEADER_PAYMENT_RESPONSE, X402_STATUS_CODE, X402_VERSION, } from './types.js';
83
82
  /* ── Facilitator Registry ────────────────────────────────────── */
84
- export { FACILITATOR_REGISTRY, getFacilitatorInfo, findFacilitatorsByNetwork, findGasSponsoredFacilitators, listKnownFacilitators, resolveKnownFacilitator, } from './registry.js';
83
+ export { FACILITATOR_REGISTRY, getFacilitatorInfo, findFacilitatorsByNetwork, findGasSponsoredFacilitators, listKnownFacilitators, resolveKnownFacilitator, FacilitatorDiscovery, } from './registry.js';
85
84
  /* ── Facilitator Client ──────────────────────────────────────── */
86
85
  export { FacilitatorClient, FacilitatorError, VerifyError, SettleError, createFacilitator, } from './facilitator.js';
87
86
  /* ── Paywall (Resource Server / Seller) ──────────────────────── */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/gateway/x402/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAwBH,OAAO;AACL,oCAAoC;AACpC,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EAAG,mBAAmB;AAClC,WAAW,EAAI,mBAAmB;AAElC,wCAAwC;AACxC,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB;AAElB,yCAAyC;AACzC,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY;AAEZ,iBAAiB;AACjB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB;AAEnB,4BAA4B;AAC5B,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,gBAAgB,EAChB,YAAY,GACb,MAAM,SAAS,CAAC;AAEjB,oEAAoE;AACpE,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAEpB,oEAAoE;AACpE,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,oEAAoE;AACpE,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AAOnB,oEAAoE;AACpE,OAAO,EACL,UAAU,EACV,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/gateway/x402/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAwBH,OAAO;AACL,oCAAoC;AACpC,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,WAAW;AAEX,wCAAwC;AACxC,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB;AAElB,yCAAyC;AACzC,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY;AAEZ,iBAAiB;AACjB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB;AAEnB,4BAA4B;AAC5B,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,gBAAgB,EAChB,YAAY,GACb,MAAM,SAAS,CAAC;AAEjB,oEAAoE;AACpE,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GAGrB,MAAM,YAAY,CAAC;AAEpB,oEAAoE;AACpE,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,oEAAoE;AACpE,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AAOnB,oEAAoE;AACpE,OAAO,EACL,UAAU,EACV,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,UAAU,CAAC"}
@@ -27,7 +27,7 @@
27
27
  * @since 1.0.0
28
28
  */
29
29
  import type { X402FacilitatorConfig, X402Network, KnownFacilitatorInfo } from './types';
30
- import { KnownFacilitator } from './types';
30
+ import { KnownFacilitator, X402ProtocolVersion } from './types';
31
31
  /**
32
32
  * @description Complete registry of known x402 facilitators with their configuration,
33
33
  * supported networks, and metadata.
@@ -83,4 +83,134 @@ export declare function listKnownFacilitators(): KnownFacilitator[];
83
83
  * @since 1.0.0
84
84
  */
85
85
  export declare function resolveKnownFacilitator(facilitator: KnownFacilitator, overrides?: Partial<Omit<X402FacilitatorConfig, 'url'>>): X402FacilitatorConfig;
86
+ /**
87
+ * @description Result of a {@link FacilitatorDiscovery.healthCheck} call.
88
+ * @since 1.2.2
89
+ */
90
+ export interface FacilitatorHealthResult {
91
+ facilitator: KnownFacilitator;
92
+ url: string;
93
+ healthy: boolean;
94
+ latencyMs: number;
95
+ error?: string;
96
+ }
97
+ /**
98
+ * @description Options for {@link FacilitatorDiscovery.findBest}.
99
+ * @since 1.2.2
100
+ */
101
+ export interface FindBestOptions {
102
+ /** Required network support. */
103
+ network?: X402Network;
104
+ /** Prefer gas-sponsored facilitators. */
105
+ preferGasSponsored?: boolean;
106
+ /** Require gas sponsorship (strict). */
107
+ requireGasSponsored?: boolean;
108
+ /** Required protocol version. */
109
+ version?: X402ProtocolVersion;
110
+ /** Run a health check and exclude unhealthy facilitators. Default: `false`. */
111
+ healthCheck?: boolean;
112
+ }
113
+ /**
114
+ * @description Runtime-aware facilitator discovery service.
115
+ *
116
+ * Wraps the static {@link FACILITATOR_REGISTRY} with dynamic operations:
117
+ * health checking, smart selection, and filtering by multiple criteria.
118
+ *
119
+ * @since 1.2.2
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * import { FacilitatorDiscovery, SOLANA_MAINNET } from '@oobe-protocol-labs/synapse-client-sdk';
124
+ *
125
+ * const discovery = new FacilitatorDiscovery();
126
+ *
127
+ * // Find the best facilitator for Solana mainnet (with health check)
128
+ * const best = await discovery.findBest({ network: SOLANA_MAINNET, healthCheck: true });
129
+ *
130
+ * // Health check all facilitators
131
+ * const health = await discovery.healthCheck();
132
+ * console.log(health.filter(h => h.healthy));
133
+ * ```
134
+ */
135
+ export declare class FacilitatorDiscovery {
136
+ private readonly timeoutMs;
137
+ /**
138
+ * @param {{ timeoutMs?: number }} [opts] - Options
139
+ * @param {number} [opts.timeoutMs=5000] - Timeout for health check requests
140
+ */
141
+ constructor(opts?: {
142
+ timeoutMs?: number;
143
+ });
144
+ /**
145
+ * @description Get all known facilitators as an array.
146
+ * @returns {KnownFacilitatorInfo[]} All facilitators
147
+ * @since 1.2.2
148
+ */
149
+ all(): KnownFacilitatorInfo[];
150
+ /**
151
+ * @description Filter facilitators by a predicate.
152
+ *
153
+ * @param {(info: KnownFacilitatorInfo) => boolean} predicate - Filter function
154
+ * @returns {KnownFacilitatorInfo[]} Matching facilitators
155
+ * @since 1.2.2
156
+ *
157
+ * @example
158
+ * ```ts
159
+ * const solana = discovery.filter(f => f.supportedNetworks.includes(SOLANA_MAINNET));
160
+ * const noKey = discovery.filter(f => !f.requiresApiKey);
161
+ * ```
162
+ */
163
+ filter(predicate: (info: KnownFacilitatorInfo) => boolean): KnownFacilitatorInfo[];
164
+ /**
165
+ * @description Filter facilitators by network, protocol version, and gas sponsoring.
166
+ *
167
+ * @param {object} criteria - Filter criteria
168
+ * @returns {KnownFacilitatorInfo[]} Matching facilitators
169
+ * @since 1.2.2
170
+ */
171
+ query(criteria: {
172
+ network?: X402Network;
173
+ version?: X402ProtocolVersion;
174
+ gasSponsored?: boolean;
175
+ requiresApiKey?: boolean;
176
+ scheme?: string;
177
+ }): KnownFacilitatorInfo[];
178
+ /**
179
+ * @description Health check one or all known facilitators.
180
+ *
181
+ * Sends a `GET /supported` request (standard x402 endpoint) and
182
+ * measures round-trip time. Times out after `timeoutMs`.
183
+ *
184
+ * @param {KnownFacilitator} [facilitator] - Check a specific facilitator, or omit for all
185
+ * @returns {Promise<FacilitatorHealthResult[]>} Health results
186
+ * @since 1.2.2
187
+ */
188
+ healthCheck(facilitator?: KnownFacilitator): Promise<FacilitatorHealthResult[]>;
189
+ /**
190
+ * @description Find the best facilitator based on criteria and optional health check.
191
+ *
192
+ * Selection priority:
193
+ * 1. Filter by `network`, `version`, `requireGasSponsored`
194
+ * 2. If `healthCheck` is true, remove unhealthy facilitators
195
+ * 3. Sort by: gas-sponsored preference → lowest latency
196
+ * 4. Return the top match (or `null` if none match)
197
+ *
198
+ * @param {FindBestOptions} [opts] - Selection criteria
199
+ * @returns {Promise<KnownFacilitatorInfo | null>} Best match or null
200
+ * @since 1.2.2
201
+ *
202
+ * @example
203
+ * ```ts
204
+ * const best = await discovery.findBest({
205
+ * network: SOLANA_MAINNET,
206
+ * preferGasSponsored: true,
207
+ * healthCheck: true,
208
+ * });
209
+ * if (best) {
210
+ * const facilitator = createFacilitator(best.id);
211
+ * }
212
+ * ```
213
+ */
214
+ findBest(opts?: FindBestOptions): Promise<KnownFacilitatorInfo | null>;
215
+ }
86
216
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../../src/ai/gateway/x402/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EACL,gBAAgB,EAUjB,MAAM,SAAS,CAAC;AAMjB;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,gBAAgB,EAAE,oBAAoB,CA8KnF,CAAC;AAMH;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,gBAAgB,GAC5B,oBAAoB,GAAG,SAAS,CAElC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,WAAW,GACnB,oBAAoB,EAAE,CAQxB;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,IAAI,oBAAoB,EAAE,CAQrE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,gBAAgB,EAAE,CAE1D;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,gBAAgB,EAC7B,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC,GACtD,qBAAqB,CAWvB"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../../src/ai/gateway/x402/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EASpB,MAAM,SAAS,CAAC;AAMjB;;;;;;;;GAQG;AACH,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CAAC,EAAE,MAAM,CAAA;KAAO;IAI7C;;;;OAIG;IACH,GAAG,IAAI,oBAAoB,EAAE;IAI7B;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,OAAO,GAAG,oBAAoB,EAAE;IAIlF;;;;;;OAMG;IACH,KAAK,CAAC,QAAQ,EAAE;QACd,OAAO,CAAC,EAAE,WAAW,CAAC;QACtB,OAAO,CAAC,EAAE,mBAAmB,CAAC;QAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,oBAAoB,EAAE;IAW1B;;;;;;;;;OASG;IACG,WAAW,CAAC,WAAW,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC;IA4CrF;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;CA4EjF"}
@@ -283,4 +283,231 @@ export function resolveKnownFacilitator(facilitator, overrides) {
283
283
  timeoutMs: overrides?.timeoutMs ?? 30_000,
284
284
  };
285
285
  }
286
+ /**
287
+ * @description Runtime-aware facilitator discovery service.
288
+ *
289
+ * Wraps the static {@link FACILITATOR_REGISTRY} with dynamic operations:
290
+ * health checking, smart selection, and filtering by multiple criteria.
291
+ *
292
+ * @since 1.2.2
293
+ *
294
+ * @example
295
+ * ```ts
296
+ * import { FacilitatorDiscovery, SOLANA_MAINNET } from '@oobe-protocol-labs/synapse-client-sdk';
297
+ *
298
+ * const discovery = new FacilitatorDiscovery();
299
+ *
300
+ * // Find the best facilitator for Solana mainnet (with health check)
301
+ * const best = await discovery.findBest({ network: SOLANA_MAINNET, healthCheck: true });
302
+ *
303
+ * // Health check all facilitators
304
+ * const health = await discovery.healthCheck();
305
+ * console.log(health.filter(h => h.healthy));
306
+ * ```
307
+ */
308
+ export class FacilitatorDiscovery {
309
+ timeoutMs;
310
+ /**
311
+ * @param {{ timeoutMs?: number }} [opts] - Options
312
+ * @param {number} [opts.timeoutMs=5000] - Timeout for health check requests
313
+ */
314
+ constructor(opts = {}) {
315
+ this.timeoutMs = opts.timeoutMs ?? 5_000;
316
+ }
317
+ /**
318
+ * @description Get all known facilitators as an array.
319
+ * @returns {KnownFacilitatorInfo[]} All facilitators
320
+ * @since 1.2.2
321
+ */
322
+ all() {
323
+ return [...FACILITATOR_REGISTRY.values()];
324
+ }
325
+ /**
326
+ * @description Filter facilitators by a predicate.
327
+ *
328
+ * @param {(info: KnownFacilitatorInfo) => boolean} predicate - Filter function
329
+ * @returns {KnownFacilitatorInfo[]} Matching facilitators
330
+ * @since 1.2.2
331
+ *
332
+ * @example
333
+ * ```ts
334
+ * const solana = discovery.filter(f => f.supportedNetworks.includes(SOLANA_MAINNET));
335
+ * const noKey = discovery.filter(f => !f.requiresApiKey);
336
+ * ```
337
+ */
338
+ filter(predicate) {
339
+ return [...FACILITATOR_REGISTRY.values()].filter(predicate);
340
+ }
341
+ /**
342
+ * @description Filter facilitators by network, protocol version, and gas sponsoring.
343
+ *
344
+ * @param {object} criteria - Filter criteria
345
+ * @returns {KnownFacilitatorInfo[]} Matching facilitators
346
+ * @since 1.2.2
347
+ */
348
+ query(criteria) {
349
+ return this.filter(info => {
350
+ if (criteria.network && !info.supportedNetworks.includes(criteria.network))
351
+ return false;
352
+ if (criteria.version && !info.supportedVersions.includes(criteria.version))
353
+ return false;
354
+ if (criteria.gasSponsored != null && info.gasSponsored !== criteria.gasSponsored)
355
+ return false;
356
+ if (criteria.requiresApiKey != null && info.requiresApiKey !== criteria.requiresApiKey)
357
+ return false;
358
+ if (criteria.scheme && !info.supportedSchemes.includes(criteria.scheme))
359
+ return false;
360
+ return true;
361
+ });
362
+ }
363
+ /**
364
+ * @description Health check one or all known facilitators.
365
+ *
366
+ * Sends a `GET /supported` request (standard x402 endpoint) and
367
+ * measures round-trip time. Times out after `timeoutMs`.
368
+ *
369
+ * @param {KnownFacilitator} [facilitator] - Check a specific facilitator, or omit for all
370
+ * @returns {Promise<FacilitatorHealthResult[]>} Health results
371
+ * @since 1.2.2
372
+ */
373
+ async healthCheck(facilitator) {
374
+ const targets = facilitator
375
+ ? [FACILITATOR_REGISTRY.get(facilitator)].filter(Boolean)
376
+ : [...FACILITATOR_REGISTRY.values()];
377
+ const results = await Promise.allSettled(targets.map(async (info) => {
378
+ const start = performance.now();
379
+ try {
380
+ const controller = new AbortController();
381
+ const timeout = setTimeout(() => controller.abort(), this.timeoutMs);
382
+ const res = await fetch(`${info.url}/supported`, {
383
+ method: 'GET',
384
+ signal: controller.signal,
385
+ });
386
+ clearTimeout(timeout);
387
+ const latencyMs = Math.round(performance.now() - start);
388
+ return {
389
+ facilitator: info.id,
390
+ url: info.url,
391
+ healthy: res.ok || res.status === 200,
392
+ latencyMs,
393
+ };
394
+ }
395
+ catch (err) {
396
+ return {
397
+ facilitator: info.id,
398
+ url: info.url,
399
+ healthy: false,
400
+ latencyMs: Math.round(performance.now() - start),
401
+ error: String(err),
402
+ };
403
+ }
404
+ }));
405
+ return results.map(r => r.status === 'fulfilled' ? r.value : {
406
+ facilitator: KnownFacilitator.CoinbaseDefault,
407
+ url: '',
408
+ healthy: false,
409
+ latencyMs: 0,
410
+ error: String(r.reason),
411
+ });
412
+ }
413
+ /**
414
+ * @description Find the best facilitator based on criteria and optional health check.
415
+ *
416
+ * Selection priority:
417
+ * 1. Filter by `network`, `version`, `requireGasSponsored`
418
+ * 2. If `healthCheck` is true, remove unhealthy facilitators
419
+ * 3. Sort by: gas-sponsored preference → lowest latency
420
+ * 4. Return the top match (or `null` if none match)
421
+ *
422
+ * @param {FindBestOptions} [opts] - Selection criteria
423
+ * @returns {Promise<KnownFacilitatorInfo | null>} Best match or null
424
+ * @since 1.2.2
425
+ *
426
+ * @example
427
+ * ```ts
428
+ * const best = await discovery.findBest({
429
+ * network: SOLANA_MAINNET,
430
+ * preferGasSponsored: true,
431
+ * healthCheck: true,
432
+ * });
433
+ * if (best) {
434
+ * const facilitator = createFacilitator(best.id);
435
+ * }
436
+ * ```
437
+ */
438
+ async findBest(opts = {}) {
439
+ // Step 1: Filter by criteria
440
+ let candidates = this.filter(info => {
441
+ if (opts.network && !info.supportedNetworks.includes(opts.network))
442
+ return false;
443
+ if (opts.version && !info.supportedVersions.includes(opts.version))
444
+ return false;
445
+ if (opts.requireGasSponsored && !info.gasSponsored)
446
+ return false;
447
+ return true;
448
+ });
449
+ if (candidates.length === 0)
450
+ return null;
451
+ // Step 2: Optional health check
452
+ let healthResults = null;
453
+ if (opts.healthCheck) {
454
+ const checks = await Promise.allSettled(candidates.map(async (info) => {
455
+ const start = performance.now();
456
+ try {
457
+ const controller = new AbortController();
458
+ const timeout = setTimeout(() => controller.abort(), this.timeoutMs);
459
+ const res = await fetch(`${info.url}/supported`, {
460
+ method: 'GET',
461
+ signal: controller.signal,
462
+ });
463
+ clearTimeout(timeout);
464
+ return {
465
+ facilitator: info.id,
466
+ url: info.url,
467
+ healthy: res.ok,
468
+ latencyMs: Math.round(performance.now() - start),
469
+ };
470
+ }
471
+ catch (err) {
472
+ return {
473
+ facilitator: info.id,
474
+ url: info.url,
475
+ healthy: false,
476
+ latencyMs: Math.round(performance.now() - start),
477
+ error: String(err),
478
+ };
479
+ }
480
+ }));
481
+ healthResults = new Map();
482
+ for (const r of checks) {
483
+ if (r.status === 'fulfilled') {
484
+ healthResults.set(r.value.facilitator, r.value);
485
+ }
486
+ }
487
+ // Remove unhealthy
488
+ candidates = candidates.filter(c => healthResults.get(c.id)?.healthy !== false);
489
+ if (candidates.length === 0)
490
+ return null;
491
+ }
492
+ // Step 3: Sort by preference
493
+ candidates.sort((a, b) => {
494
+ // Prefer gas-sponsored if requested
495
+ if (opts.preferGasSponsored) {
496
+ if (a.gasSponsored && !b.gasSponsored)
497
+ return -1;
498
+ if (!a.gasSponsored && b.gasSponsored)
499
+ return 1;
500
+ }
501
+ // Then by latency (if health checked)
502
+ if (healthResults) {
503
+ const aLatency = healthResults.get(a.id)?.latencyMs ?? Infinity;
504
+ const bLatency = healthResults.get(b.id)?.latencyMs ?? Infinity;
505
+ return aLatency - bLatency;
506
+ }
507
+ // Otherwise by network coverage (more = better)
508
+ return b.supportedNetworks.length - a.supportedNetworks.length;
509
+ });
510
+ return candidates[0] ?? null;
511
+ }
512
+ }
286
513
  //# sourceMappingURL=registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../../src/ai/gateway/x402/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB;;qEAEqE;AAErE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwD,IAAI,GAAG,CAG9F;IACA,8DAA8D;IAC9D;QACE,gBAAgB,CAAC,KAAK;QACtB;YACE,EAAE,EAAE,gBAAgB,CAAC,KAAK;YAC1B,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,oEAAoE;YACjF,GAAG,EAAE,mCAAmC;YACxC,iBAAiB,EAAE;gBACjB,cAAc;gBACd,aAAa;gBACb,YAAY;gBACZ,YAAY;gBACZ,eAAe;gBACf,iBAAiB;gBACjB,WAAW;gBACX,cAA6B,EAAI,iBAAiB;gBAClD,cAA6B,EAAI,eAAe;gBAChD,eAA8B,EAAG,cAAc;gBAC/C,YAA2B,EAAM,UAAU;gBAC3C,aAA4B,EAAK,kBAAkB;gBACnD,mBAAkC;aACnC;YACD,iBAAiB,EAAE,CAAC,mBAAmB,CAAC,EAAE,EAAE,mBAAmB,CAAC,EAAE,CAAC;YACnE,gBAAg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AC,CAAC;QACrB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,CAAC,GAAG,oBAAoB,CAAC,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CACrC,WAA6B,EAC7B,SAAuD;IAEvD,MAAM,IAAI,GAAG,oBAAoB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACnD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,WAAW,kBAAkB,qBAAqB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9G,CAAC;IAED,OAAO;QACL,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,iBAAiB,EAAE,SAAS,EAAE,iBAAiB;QAC/C,SAAS,EAAE,SAAS,EAAE,SAAS,IAAI,MAAM;KAC1C,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../../src/ai/gateway/x402/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB;;qEAEqE;AAErE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwD,IAAI,GAAG,CAG9F;IACA,8DAA8D;IAC9D;QACE,gBAAgB,CAAC,KAAK;QACtB;YACE,EAAE,EAAE,gBAAgB,CAAC,KAAK;YAC1B,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,oEAAoE;YACjF,GAAG,EAAE,mCAAmC;YACxC,iBAAiB,EAAE;gBACjB,cAAc;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,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,KAAK,KAAK,CAAC,CAAC;YACjF,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,IAAI,CAAC;QAC3C,CAAC;QAED,6BAA6B;QAC7B,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACvB,oCAAoC;YACpC,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC5B,IAAI,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,YAAY;oBAAE,OAAO,CAAC,CAAC,CAAC;gBACjD,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,YAAY;oBAAE,OAAO,CAAC,CAAC;YAClD,CAAC;YAED,sCAAsC;YACtC,IAAI,aAAa,EAAE,CAAC;gBAClB,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,IAAI,QAAQ,CAAC;gBAChE,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,IAAI,QAAQ,CAAC;gBAChE,OAAO,QAAQ,GAAG,QAAQ,CAAC;YAC7B,CAAC;YAED,gDAAgD;YAChD,OAAO,CAAC,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC;QACjE,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC/B,CAAC;CACF"}
@@ -16,6 +16,7 @@
16
16
  */
17
17
  export { createExecutableSolanaTools, agentRpcMethods, solanaToolNames, type AgentRpcMethod, type SolanaTool, type SolanaToolMap, type SolanaToolkit, type CreateSolanaToolsOpts, } from './tools';
18
18
  export { createJupiterTools, createRaydiumTools, createMetaplexTools, createJupiterOnchainTools, createRaydiumOnchainTools, createSolanaProgramsTools, createProtocolTools, jupiterMethods, jupiterMethodNames, raydiumMethods, raydiumMethodNames, metaplexMethods, metaplexMethodNames, jupiterOnchainMethods, jupiterOnchainMethodNames, raydiumOnchainMethods, raydiumOnchainMethodNames, solanaProgramsMethods, solanaProgramsMethodNames, ProtocolHttpClient, ProtocolApiError, buildProtocolTools, createMethodRegistry, JUPITER_API_URL, RAYDIUM_API_URL, JUPITER_PROGRAM_IDS, RAYDIUM_PROGRAM_IDS, type ProtocolMethod, type ProtocolToolkit, type ProtocolTool, type ProtocolClientConfig, type CreateProtocolToolsOpts, type JupiterToolsConfig, type RaydiumToolsConfig, type MetaplexToolsConfig, type JupiterOnchainToolsConfig, type RaydiumOnchainToolsConfig, type SolanaProgramsToolsConfig, type CreateProtocolToolsConfig, type AllProtocolToolkits, } from './tools';
19
- export { AgentGateway, createAgentGateway, AgentSession, SessionError, BudgetExhaustedError, RateLimitExceededError, SessionExpiredError, CallLimitExceededError, PricingEngine, DEFAULT_TIERS, ResponseValidator, ToolMarketplace, GatewayError, SessionNotFoundError, MaxSessionsError, IntentVerificationError, type AgentId, type AgentIdentity, type AgentCredential, type PaymentToken, type PricingTier, type PaymentIntent, type PaymentReceipt, type SessionState, type SessionStatus, type ResponseAttestation, type AttestedResult, type ToolListing, type ToolBundle, type GatewayEventType, type GatewayEvent, type GatewayEventHandler, type GatewayConfig, type DynamicPricingConfig, type MarketplaceQuery, type MarketplaceStats, createAgentId, X402Paywall, X402Client, FacilitatorClient, createFacilitator, createX402Client, encodePaymentHeader, decodePaymentHeader, defaultRequirementsSelector, SOLANA_MAINNET, SOLANA_DEVNET, USDC_MAINNET, USDC_DEVNET, X402_HEADER_PAYMENT_REQUIRED, X402_HEADER_PAYMENT_SIGNATURE, X402_HEADER_PAYMENT_RESPONSE, X402_STATUS_CODE, X402_VERSION, FacilitatorError, VerifyError, SettleError, X402ClientError, NoAcceptablePaymentError, PaymentSigningError, PaymentRetryError, type X402Network, type X402ResourceInfo, type X402PaymentRequirements, type X402PaymentRequired, type X402PaymentPayload, type ExactSvmPayload, type X402VerifyResponse, type X402SettleResponse, type X402SettlementResponse, type X402CreateAuthHeaders, type X402FacilitatorConfig, type X402SupportedKind, type X402SupportedResponse, type X402RouteConfig, type X402Config, type X402PayloadSigner, type X402RequirementsSelector, type X402BudgetCheck, type X402ClientConfig, type X402PaymentOutcome, type PaywallResult, type SettleResult, } from './gateway';
19
+ export { AgentGateway, createAgentGateway, AgentSession, SessionError, BudgetExhaustedError, RateLimitExceededError, SessionExpiredError, CallLimitExceededError, PricingEngine, DEFAULT_TIERS, ResponseValidator, ToolMarketplace, AgentRegistry, MemoryAdapter, type PersistenceAdapter, type AgentRegistryConfig, GatewayError, SessionNotFoundError, MaxSessionsError, IntentVerificationError, type AgentId, type AgentIdentity, type AgentCredential, type PaymentToken, type PricingTier, type PaymentIntent, type PaymentReceipt, type SessionState, type SessionStatus, type ResponseAttestation, type AttestedResult, type ToolListing, type ToolBundle, type GatewayEventType, type GatewayEvent, type GatewayEventHandler, type GatewayConfig, type DynamicPricingConfig, type MarketplaceQuery, type MarketplaceStats, createAgentId, type RetryConfig, type SnapshotDepth, type GatewaySnapshot, type X402PipelineStep, X402Paywall, X402Client, FacilitatorClient, createFacilitator, createX402Client, encodePaymentHeader, decodePaymentHeader, defaultRequirementsSelector, SOLANA_MAINNET, SOLANA_DEVNET, USDC_MAINNET, USDC_DEVNET, X402_HEADER_PAYMENT_REQUIRED, X402_HEADER_PAYMENT_SIGNATURE, X402_HEADER_PAYMENT_RESPONSE, X402_STATUS_CODE, X402_VERSION, FacilitatorError, VerifyError, SettleError, X402ClientError, NoAcceptablePaymentError, PaymentSigningError, PaymentRetryError, FacilitatorDiscovery, type FacilitatorHealthResult, type FindBestOptions, type X402Network, type X402ResourceInfo, type X402PaymentRequirements, type X402PaymentRequired, type X402PaymentPayload, type ExactSvmPayload, type X402VerifyResponse, type X402SettleResponse, type X402SettlementResponse, type X402CreateAuthHeaders, type X402FacilitatorConfig, type X402SupportedKind, type X402SupportedResponse, type X402RouteConfig, type X402Config, type X402PayloadSigner, type X402RequirementsSelector, type X402BudgetCheck, type X402ClientConfig, type X402PaymentOutcome, type PaywallResult, type SettleResult, } from './gateway';
20
+ export { MemoryStore, RedisPersistence, PostgresPersistence, PersistenceError, serialize as serializeForStore, deserialize as deserializeFromStore, buildKey as buildStoreKey, buildSchema as buildPostgresSchema, SCHEMA_VERSION as PERSISTENCE_SCHEMA_VERSION, type PersistenceStore, type RedisLike, type PgLike, type SessionRecord, type ReceiptRecord, type MetricPoint, type SetOptions, type ListOptions, type MetricQueryOpts, type StoreConfig, type RedisStoreConfig, type PostgresStoreConfig, type MemoryStoreConfig, } from './persistence';
20
21
  export { getJupiterTools, getRaydiumTools, } from './lazy';
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,qBAAqB,GAC3B,MAAM,SAAS,CAAC;AAGjB,OAAO,EAEL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EAEnB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EAEzB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EAEpB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EAEnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACz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B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,eAAe,EACf,eAAe,GAChB,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,qBAAqB,GAC3B,MAAM,SAAS,CAAC;AAGjB,OAAO,EAEL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EAEnB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EAEzB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EAEpB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EAEnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB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B,oBAAoB,EACpB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EAGpB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAEL,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EAGnB,gBAAgB,EAGhB,SAAS,IAAI,iBAAiB,EAC9B,WAAW,IAAI,oBAAoB,EACnC,QAAQ,IAAI,aAAa,EACzB,WAAW,IAAI,mBAAmB,EAClC,cAAc,IAAI,0BAA0B,EAG5C,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,eAAe,EACf,eAAe,GAChB,MAAM,QAAQ,CAAC"}
@@ -38,12 +38,24 @@ PricingEngine, DEFAULT_TIERS,
38
38
  ResponseValidator,
39
39
  // Marketplace
40
40
  ToolMarketplace,
41
+ // Agent Registry
42
+ AgentRegistry, MemoryAdapter,
41
43
  // Errors
42
44
  GatewayError, SessionNotFoundError, MaxSessionsError, IntentVerificationError, createAgentId,
43
45
  // x402 Protocol
44
46
  X402Paywall, X402Client, FacilitatorClient, createFacilitator, createX402Client, encodePaymentHeader, decodePaymentHeader, defaultRequirementsSelector, SOLANA_MAINNET, SOLANA_DEVNET, USDC_MAINNET, USDC_DEVNET, X402_HEADER_PAYMENT_REQUIRED, X402_HEADER_PAYMENT_SIGNATURE, X402_HEADER_PAYMENT_RESPONSE, X402_STATUS_CODE, X402_VERSION,
45
47
  // x402 Errors
46
- FacilitatorError, VerifyError, SettleError, X402ClientError, NoAcceptablePaymentError, PaymentSigningError, PaymentRetryError, } from './gateway/index.js';
48
+ FacilitatorError, VerifyError, SettleError, X402ClientError, NoAcceptablePaymentError, PaymentSigningError, PaymentRetryError,
49
+ // x402 Discovery
50
+ FacilitatorDiscovery, } from './gateway/index.js';
51
+ // ── Persistence (Redis, PostgreSQL, Memory) ──────────────────
52
+ export {
53
+ // Adapters
54
+ MemoryStore, RedisPersistence, PostgresPersistence,
55
+ // Error
56
+ PersistenceError,
57
+ // Helpers
58
+ serialize as serializeForStore, deserialize as deserializeFromStore, buildKey as buildStoreKey, buildSchema as buildPostgresSchema, SCHEMA_VERSION as PERSISTENCE_SCHEMA_VERSION, } from './persistence/index.js';
47
59
  // ── Lazy factories (Next.js / webpack compatibility) ──────────
48
60
  export { getJupiterTools, getRaydiumTools, } from './lazy.js';
49
61
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,iEAAiE;AACjE,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,eAAe,GAMhB,MAAM,SAAS,CAAC;AAEjB,iEAAiE;AACjE,OAAO;AACL,YAAY;AACZ,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB;AACnB,UAAU;AACV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB;AACzB,wBAAwB;AACxB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB;AACpB,YAAY;AACZ,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,mBAAmB,GAepB,MAAM,SAAS,CAAC;AAEjB,iEAAiE;AACjE,OAAO;AACL,oBAAoB;AACpB,YAAY,EACZ,kBAAkB;AAElB,UAAU;AACV,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB;AAEtB,UAAU;AACV,aAAa,EACb,aAAa;AAEb,cAAc;AACd,iBAAiB;AAEjB,cAAc;AACd,eAAe;AAEf,SAAS;AACT,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,uBAAuB,EAuBvB,aAAa;AAEb,gBAAgB;AAChB,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,cAAc,EACd,aAAa,EACb,YAAY,EACZ,WAAW,EACX,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,gBAAgB,EAChB,YAAY;AAEZ,cAAc;AACd,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,GAyBlB,MAAM,WAAW,CAAC;AAEnB,iEAAiE;AACjE,OAAO,EACL,eAAe,EACf,eAAe,GAChB,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,iEAAiE;AACjE,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,e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AAoB,GA2BrB,MAAM,WAAW,CAAC;AAEnB,gEAAgE;AAChE,OAAO;AACL,WAAW;AACX,WAAW,EACX,gBAAgB,EAChB,mBAAmB;AAEnB,QAAQ;AACR,gBAAgB;AAEhB,UAAU;AACV,SAAS,IAAI,iBAAiB,EAC9B,WAAW,IAAI,oBAAoB,EACnC,QAAQ,IAAI,aAAa,EACzB,WAAW,IAAI,mBAAmB,EAClC,cAAc,IAAI,0BAA0B,GAgB7C,MAAM,eAAe,CAAC;AAEvB,iEAAiE;AACjE,OAAO,EACL,eAAe,EACf,eAAe,GAChB,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @module ai/persistence/helpers
3
+ * @description Serialization utilities, key builders, and PostgreSQL schema
4
+ * for the Synapse AI persistence layer.
5
+ *
6
+ * @since 1.2.2
7
+ */
8
+ /**
9
+ * Serialize a value to a JSON string, converting `BigInt` to strings.
10
+ *
11
+ * @param value - Any value (may contain `BigInt`, `Map`, nested objects).
12
+ * @returns JSON string safe for storage.
13
+ * @since 1.2.2
14
+ */
15
+ export declare function serialize(value: unknown): string;
16
+ /**
17
+ * Deserialize a JSON string back to a typed value.
18
+ *
19
+ * @typeParam T - Expected return type.
20
+ * @param json - JSON string from the store.
21
+ * @returns Parsed value.
22
+ * @since 1.2.2
23
+ */
24
+ export declare function deserialize<T = unknown>(json: string): T;
25
+ /**
26
+ * Build a namespaced Redis key from segments.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * buildKey('synapse', 'agent', 'did:agent:1');
31
+ * // → 'synapse:agent:did:agent:1'
32
+ * ```
33
+ *
34
+ * @param parts - Key segments joined by `:`.
35
+ * @returns Colon-delimited key string.
36
+ * @since 1.2.2
37
+ */
38
+ export declare function buildKey(...parts: string[]): string;
39
+ /**
40
+ * Strip a prefix from a Redis key and return the remaining segments.
41
+ *
42
+ * @param prefix - The prefix to strip (e.g. `'synapse'`).
43
+ * @param key - Full key (e.g. `'synapse:agent:id1'`).
44
+ * @returns Remaining segments after the prefix (e.g. `['agent', 'id1']`).
45
+ * @since 1.2.2
46
+ */
47
+ export declare function parseKey(prefix: string, key: string): string[];
48
+ /**
49
+ * Extract the agent ID from a namespaced Redis key.
50
+ *
51
+ * @param prefix - Key prefix (e.g. `'synapse'`).
52
+ * @param key - Full key (e.g. `'synapse:agent:my-agent'`).
53
+ * @returns The agent ID segment, or the full key if pattern doesn't match.
54
+ * @since 1.2.2
55
+ */
56
+ export declare function extractAgentId(prefix: string, key: string): string;
57
+ /** Current schema version. Bump when adding migrations. */
58
+ export declare const SCHEMA_VERSION = 1;
59
+ /**
60
+ * Generate the full PostgreSQL DDL for a given table prefix.
61
+ *
62
+ * Creates tables:
63
+ * - `{prefix}_agents` — agent snapshots (JSONB)
64
+ * - `{prefix}_sessions` — session records (JSONB)
65
+ * - `{prefix}_receipts` — payment receipts (JSONB)
66
+ * - `{prefix}_metrics` — time-series metric points
67
+ * - `{prefix}_kv` — generic key-value store
68
+ * - `{prefix}_schema_version` — migration tracking
69
+ *
70
+ * @param prefix - Table name prefix (default: `'synapse'`).
71
+ * @returns SQL DDL string ready for `client.query()`.
72
+ * @since 1.2.2
73
+ */
74
+ export declare function buildSchema(prefix?: string): string;
75
+ /**
76
+ * SQL to clean up expired rows from the KV table.
77
+ *
78
+ * @param prefix - Table name prefix.
79
+ * @returns DELETE statement string.
80
+ * @since 1.2.2
81
+ */
82
+ export declare function buildKvCleanupSql(prefix?: string): string;
83
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/ai/persistence/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEhD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAExD;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAG9D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAIlE;AAMD,2DAA2D;AAC3D,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,MAAM,GAAE,MAAkB,GAAG,MAAM,CA2E9D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,MAAkB,GAAG,MAAM,CAEpE"}