@cmdoss/memwal-sdk 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (784) hide show
  1. package/ARCHITECTURE.md +463 -0
  2. package/BENCHMARKS.md +238 -0
  3. package/README.md +142 -0
  4. package/dist/access/PermissionService.d.ts +179 -0
  5. package/dist/access/PermissionService.d.ts.map +1 -0
  6. package/dist/access/PermissionService.js +445 -0
  7. package/dist/access/PermissionService.js.map +1 -0
  8. package/dist/access/index.d.ts +8 -0
  9. package/dist/access/index.d.ts.map +1 -0
  10. package/dist/access/index.js +7 -0
  11. package/dist/access/index.js.map +1 -0
  12. package/dist/aggregation/AggregationService.d.ts +132 -0
  13. package/dist/aggregation/AggregationService.d.ts.map +1 -0
  14. package/dist/aggregation/AggregationService.js +225 -0
  15. package/dist/aggregation/AggregationService.js.map +1 -0
  16. package/dist/aggregation/index.d.ts +8 -0
  17. package/dist/aggregation/index.d.ts.map +1 -0
  18. package/dist/aggregation/index.js +7 -0
  19. package/dist/aggregation/index.js.map +1 -0
  20. package/dist/ai-sdk/PDWVectorStore.d.ts +124 -0
  21. package/dist/ai-sdk/PDWVectorStore.d.ts.map +1 -0
  22. package/dist/ai-sdk/PDWVectorStore.js +557 -0
  23. package/dist/ai-sdk/PDWVectorStore.js.map +1 -0
  24. package/dist/ai-sdk/index.d.ts +45 -0
  25. package/dist/ai-sdk/index.d.ts.map +1 -0
  26. package/dist/ai-sdk/index.js +45 -0
  27. package/dist/ai-sdk/index.js.map +1 -0
  28. package/dist/ai-sdk/tools.d.ts +153 -0
  29. package/dist/ai-sdk/tools.d.ts.map +1 -0
  30. package/dist/ai-sdk/tools.js +312 -0
  31. package/dist/ai-sdk/tools.js.map +1 -0
  32. package/dist/ai-sdk/types.d.ts +336 -0
  33. package/dist/ai-sdk/types.d.ts.map +1 -0
  34. package/dist/ai-sdk/types.js +36 -0
  35. package/dist/ai-sdk/types.js.map +1 -0
  36. package/dist/api/client.d.ts +43 -0
  37. package/dist/api/client.d.ts.map +1 -0
  38. package/dist/api/client.js +136 -0
  39. package/dist/api/client.js.map +1 -0
  40. package/dist/batch/BatchManager.d.ts +147 -0
  41. package/dist/batch/BatchManager.d.ts.map +1 -0
  42. package/dist/batch/BatchManager.js +427 -0
  43. package/dist/batch/BatchManager.js.map +1 -0
  44. package/dist/batch/BatchingService.d.ts +122 -0
  45. package/dist/batch/BatchingService.d.ts.map +1 -0
  46. package/dist/batch/BatchingService.js +301 -0
  47. package/dist/batch/BatchingService.js.map +1 -0
  48. package/dist/batch/MemoryProcessingCache.d.ts +147 -0
  49. package/dist/batch/MemoryProcessingCache.d.ts.map +1 -0
  50. package/dist/batch/MemoryProcessingCache.js +349 -0
  51. package/dist/batch/MemoryProcessingCache.js.map +1 -0
  52. package/dist/batch/index.d.ts +13 -0
  53. package/dist/batch/index.d.ts.map +1 -0
  54. package/dist/batch/index.js +10 -0
  55. package/dist/batch/index.js.map +1 -0
  56. package/dist/browser.d.ts +73 -0
  57. package/dist/browser.d.ts.map +1 -0
  58. package/dist/browser.js +66 -0
  59. package/dist/browser.js.map +1 -0
  60. package/dist/chat/index.d.ts +13 -0
  61. package/dist/chat/index.d.ts.map +1 -0
  62. package/dist/chat/index.js +14 -0
  63. package/dist/chat/index.js.map +1 -0
  64. package/dist/client/ClientMemoryManager.d.ts +202 -0
  65. package/dist/client/ClientMemoryManager.d.ts.map +1 -0
  66. package/dist/client/ClientMemoryManager.js +764 -0
  67. package/dist/client/ClientMemoryManager.js.map +1 -0
  68. package/dist/client/PersonalDataWallet.d.ts +406 -0
  69. package/dist/client/PersonalDataWallet.d.ts.map +1 -0
  70. package/dist/client/PersonalDataWallet.js +229 -0
  71. package/dist/client/PersonalDataWallet.js.map +1 -0
  72. package/dist/client/SimplePDWClient.d.ts +534 -0
  73. package/dist/client/SimplePDWClient.d.ts.map +1 -0
  74. package/dist/client/SimplePDWClient.js +876 -0
  75. package/dist/client/SimplePDWClient.js.map +1 -0
  76. package/dist/client/factory.d.ts +99 -0
  77. package/dist/client/factory.d.ts.map +1 -0
  78. package/dist/client/factory.js +126 -0
  79. package/dist/client/factory.js.map +1 -0
  80. package/dist/client/namespaces/AnalyticsNamespace.d.ts +178 -0
  81. package/dist/client/namespaces/AnalyticsNamespace.d.ts.map +1 -0
  82. package/dist/client/namespaces/AnalyticsNamespace.js +261 -0
  83. package/dist/client/namespaces/AnalyticsNamespace.js.map +1 -0
  84. package/dist/client/namespaces/BatchNamespace.d.ts +120 -0
  85. package/dist/client/namespaces/BatchNamespace.d.ts.map +1 -0
  86. package/dist/client/namespaces/BatchNamespace.js +261 -0
  87. package/dist/client/namespaces/BatchNamespace.js.map +1 -0
  88. package/dist/client/namespaces/CacheNamespace.d.ts +80 -0
  89. package/dist/client/namespaces/CacheNamespace.d.ts.map +1 -0
  90. package/dist/client/namespaces/CacheNamespace.js +100 -0
  91. package/dist/client/namespaces/CacheNamespace.js.map +1 -0
  92. package/dist/client/namespaces/CapabilityNamespace.d.ts +145 -0
  93. package/dist/client/namespaces/CapabilityNamespace.d.ts.map +1 -0
  94. package/dist/client/namespaces/CapabilityNamespace.js +181 -0
  95. package/dist/client/namespaces/CapabilityNamespace.js.map +1 -0
  96. package/dist/client/namespaces/ChatNamespace.d.ts +110 -0
  97. package/dist/client/namespaces/ChatNamespace.d.ts.map +1 -0
  98. package/dist/client/namespaces/ChatNamespace.js +123 -0
  99. package/dist/client/namespaces/ChatNamespace.js.map +1 -0
  100. package/dist/client/namespaces/ClassifyNamespace.d.ts +96 -0
  101. package/dist/client/namespaces/ClassifyNamespace.d.ts.map +1 -0
  102. package/dist/client/namespaces/ClassifyNamespace.js +149 -0
  103. package/dist/client/namespaces/ClassifyNamespace.js.map +1 -0
  104. package/dist/client/namespaces/ContextNamespace.d.ts +150 -0
  105. package/dist/client/namespaces/ContextNamespace.d.ts.map +1 -0
  106. package/dist/client/namespaces/ContextNamespace.js +250 -0
  107. package/dist/client/namespaces/ContextNamespace.js.map +1 -0
  108. package/dist/client/namespaces/EmbeddingsNamespace.d.ts +64 -0
  109. package/dist/client/namespaces/EmbeddingsNamespace.d.ts.map +1 -0
  110. package/dist/client/namespaces/EmbeddingsNamespace.js +86 -0
  111. package/dist/client/namespaces/EmbeddingsNamespace.js.map +1 -0
  112. package/dist/client/namespaces/EncryptionNamespace.d.ts +128 -0
  113. package/dist/client/namespaces/EncryptionNamespace.d.ts.map +1 -0
  114. package/dist/client/namespaces/EncryptionNamespace.js +161 -0
  115. package/dist/client/namespaces/EncryptionNamespace.js.map +1 -0
  116. package/dist/client/namespaces/GraphNamespace.d.ts +168 -0
  117. package/dist/client/namespaces/GraphNamespace.d.ts.map +1 -0
  118. package/dist/client/namespaces/GraphNamespace.js +314 -0
  119. package/dist/client/namespaces/GraphNamespace.js.map +1 -0
  120. package/dist/client/namespaces/IndexNamespace.d.ts +141 -0
  121. package/dist/client/namespaces/IndexNamespace.d.ts.map +1 -0
  122. package/dist/client/namespaces/IndexNamespace.js +238 -0
  123. package/dist/client/namespaces/IndexNamespace.js.map +1 -0
  124. package/dist/client/namespaces/MemoryNamespace.d.ts +277 -0
  125. package/dist/client/namespaces/MemoryNamespace.d.ts.map +1 -0
  126. package/dist/client/namespaces/MemoryNamespace.js +907 -0
  127. package/dist/client/namespaces/MemoryNamespace.js.map +1 -0
  128. package/dist/client/namespaces/PermissionsNamespace.d.ts +114 -0
  129. package/dist/client/namespaces/PermissionsNamespace.d.ts.map +1 -0
  130. package/dist/client/namespaces/PermissionsNamespace.js +179 -0
  131. package/dist/client/namespaces/PermissionsNamespace.js.map +1 -0
  132. package/dist/client/namespaces/PipelineNamespace.d.ts +125 -0
  133. package/dist/client/namespaces/PipelineNamespace.d.ts.map +1 -0
  134. package/dist/client/namespaces/PipelineNamespace.js +171 -0
  135. package/dist/client/namespaces/PipelineNamespace.js.map +1 -0
  136. package/dist/client/namespaces/SearchNamespace.d.ts +382 -0
  137. package/dist/client/namespaces/SearchNamespace.d.ts.map +1 -0
  138. package/dist/client/namespaces/SearchNamespace.js +821 -0
  139. package/dist/client/namespaces/SearchNamespace.js.map +1 -0
  140. package/dist/client/namespaces/StorageNamespace.d.ts +180 -0
  141. package/dist/client/namespaces/StorageNamespace.d.ts.map +1 -0
  142. package/dist/client/namespaces/StorageNamespace.js +354 -0
  143. package/dist/client/namespaces/StorageNamespace.js.map +1 -0
  144. package/dist/client/namespaces/TxNamespace.d.ts +143 -0
  145. package/dist/client/namespaces/TxNamespace.d.ts.map +1 -0
  146. package/dist/client/namespaces/TxNamespace.js +208 -0
  147. package/dist/client/namespaces/TxNamespace.js.map +1 -0
  148. package/dist/client/namespaces/WalletNamespace.d.ts +124 -0
  149. package/dist/client/namespaces/WalletNamespace.d.ts.map +1 -0
  150. package/dist/client/namespaces/WalletNamespace.js +197 -0
  151. package/dist/client/namespaces/WalletNamespace.js.map +1 -0
  152. package/dist/client/namespaces/consolidated/AINamespace.d.ts +265 -0
  153. package/dist/client/namespaces/consolidated/AINamespace.d.ts.map +1 -0
  154. package/dist/client/namespaces/consolidated/AINamespace.js +390 -0
  155. package/dist/client/namespaces/consolidated/AINamespace.js.map +1 -0
  156. package/dist/client/namespaces/consolidated/BlockchainNamespace.d.ts +265 -0
  157. package/dist/client/namespaces/consolidated/BlockchainNamespace.d.ts.map +1 -0
  158. package/dist/client/namespaces/consolidated/BlockchainNamespace.js +412 -0
  159. package/dist/client/namespaces/consolidated/BlockchainNamespace.js.map +1 -0
  160. package/dist/client/namespaces/consolidated/SecurityNamespace.d.ts +354 -0
  161. package/dist/client/namespaces/consolidated/SecurityNamespace.d.ts.map +1 -0
  162. package/dist/client/namespaces/consolidated/SecurityNamespace.js +522 -0
  163. package/dist/client/namespaces/consolidated/SecurityNamespace.js.map +1 -0
  164. package/dist/client/namespaces/consolidated/StorageNamespace.d.ts +235 -0
  165. package/dist/client/namespaces/consolidated/StorageNamespace.d.ts.map +1 -0
  166. package/dist/client/namespaces/consolidated/StorageNamespace.js +351 -0
  167. package/dist/client/namespaces/consolidated/StorageNamespace.js.map +1 -0
  168. package/dist/client/namespaces/consolidated/index.d.ts +17 -0
  169. package/dist/client/namespaces/consolidated/index.d.ts.map +1 -0
  170. package/dist/client/namespaces/consolidated/index.js +13 -0
  171. package/dist/client/namespaces/consolidated/index.js.map +1 -0
  172. package/dist/client/signers/KeypairSigner.d.ts +55 -0
  173. package/dist/client/signers/KeypairSigner.d.ts.map +1 -0
  174. package/dist/client/signers/KeypairSigner.js +84 -0
  175. package/dist/client/signers/KeypairSigner.js.map +1 -0
  176. package/dist/client/signers/UnifiedSigner.d.ts +88 -0
  177. package/dist/client/signers/UnifiedSigner.d.ts.map +1 -0
  178. package/dist/client/signers/UnifiedSigner.js +13 -0
  179. package/dist/client/signers/UnifiedSigner.js.map +1 -0
  180. package/dist/client/signers/WalletAdapterSigner.d.ts +94 -0
  181. package/dist/client/signers/WalletAdapterSigner.d.ts.map +1 -0
  182. package/dist/client/signers/WalletAdapterSigner.js +91 -0
  183. package/dist/client/signers/WalletAdapterSigner.js.map +1 -0
  184. package/dist/client/signers/index.d.ts +14 -0
  185. package/dist/client/signers/index.d.ts.map +1 -0
  186. package/dist/client/signers/index.js +12 -0
  187. package/dist/client/signers/index.js.map +1 -0
  188. package/dist/config/ConfigurationHelper.d.ts +167 -0
  189. package/dist/config/ConfigurationHelper.d.ts.map +1 -0
  190. package/dist/config/ConfigurationHelper.js +283 -0
  191. package/dist/config/ConfigurationHelper.js.map +1 -0
  192. package/dist/config/defaults.d.ts +9 -0
  193. package/dist/config/defaults.d.ts.map +1 -0
  194. package/dist/config/defaults.js +49 -0
  195. package/dist/config/defaults.js.map +1 -0
  196. package/dist/config/index.d.ts +9 -0
  197. package/dist/config/index.d.ts.map +1 -0
  198. package/dist/config/index.js +8 -0
  199. package/dist/config/index.js.map +1 -0
  200. package/dist/config/validation.d.ts +12 -0
  201. package/dist/config/validation.d.ts.map +1 -0
  202. package/dist/config/validation.js +61 -0
  203. package/dist/config/validation.js.map +1 -0
  204. package/dist/core/index.d.ts +11 -0
  205. package/dist/core/index.d.ts.map +1 -0
  206. package/dist/core/index.js +13 -0
  207. package/dist/core/index.js.map +1 -0
  208. package/dist/core/interfaces/IService.d.ts +162 -0
  209. package/dist/core/interfaces/IService.d.ts.map +1 -0
  210. package/dist/core/interfaces/IService.js +159 -0
  211. package/dist/core/interfaces/IService.js.map +1 -0
  212. package/dist/core/interfaces/index.d.ts +7 -0
  213. package/dist/core/interfaces/index.d.ts.map +1 -0
  214. package/dist/core/interfaces/index.js +7 -0
  215. package/dist/core/interfaces/index.js.map +1 -0
  216. package/dist/core/types/capability.d.ts +268 -0
  217. package/dist/core/types/capability.d.ts.map +1 -0
  218. package/dist/core/types/capability.js +16 -0
  219. package/dist/core/types/capability.js.map +1 -0
  220. package/dist/core/types/index.d.ts +750 -0
  221. package/dist/core/types/index.d.ts.map +1 -0
  222. package/dist/core/types/index.js +6 -0
  223. package/dist/core/types/index.js.map +1 -0
  224. package/dist/core/types/wallet.d.ts +254 -0
  225. package/dist/core/types/wallet.d.ts.map +1 -0
  226. package/dist/core/types/wallet.js +27 -0
  227. package/dist/core/types/wallet.js.map +1 -0
  228. package/dist/core/types.d.ts +8 -0
  229. package/dist/core/types.d.ts.map +1 -0
  230. package/dist/core/types.js +8 -0
  231. package/dist/core/types.js.map +1 -0
  232. package/dist/core/wallet.d.ts +209 -0
  233. package/dist/core/wallet.d.ts.map +1 -0
  234. package/dist/core/wallet.js +27 -0
  235. package/dist/core/wallet.js.map +1 -0
  236. package/dist/embedding/index.d.ts +9 -0
  237. package/dist/embedding/index.d.ts.map +1 -0
  238. package/dist/embedding/index.js +8 -0
  239. package/dist/embedding/index.js.map +1 -0
  240. package/dist/embedding/types.d.ts +302 -0
  241. package/dist/embedding/types.d.ts.map +1 -0
  242. package/dist/embedding/types.js +9 -0
  243. package/dist/embedding/types.js.map +1 -0
  244. package/dist/encryption/index.d.ts +14 -0
  245. package/dist/encryption/index.d.ts.map +1 -0
  246. package/dist/encryption/index.js +14 -0
  247. package/dist/encryption/index.js.map +1 -0
  248. package/dist/errors/index.d.ts +149 -0
  249. package/dist/errors/index.d.ts.map +1 -0
  250. package/dist/errors/index.js +301 -0
  251. package/dist/errors/index.js.map +1 -0
  252. package/dist/errors/recovery.d.ts +128 -0
  253. package/dist/errors/recovery.d.ts.map +1 -0
  254. package/dist/errors/recovery.js +320 -0
  255. package/dist/errors/recovery.js.map +1 -0
  256. package/dist/errors/validation.d.ts +106 -0
  257. package/dist/errors/validation.d.ts.map +1 -0
  258. package/dist/errors/validation.js +354 -0
  259. package/dist/errors/validation.js.map +1 -0
  260. package/dist/generated/pdw/capability.d.ts +223 -0
  261. package/dist/generated/pdw/capability.d.ts.map +1 -0
  262. package/dist/generated/pdw/capability.js +238 -0
  263. package/dist/generated/pdw/capability.js.map +1 -0
  264. package/dist/generated/pdw/deps/sui/object.d.ts +9 -0
  265. package/dist/generated/pdw/deps/sui/object.d.ts.map +1 -0
  266. package/dist/generated/pdw/deps/sui/object.js +11 -0
  267. package/dist/generated/pdw/deps/sui/object.js.map +1 -0
  268. package/dist/generated/pdw/deps/sui/vec_map.d.ts +37 -0
  269. package/dist/generated/pdw/deps/sui/vec_map.d.ts.map +1 -0
  270. package/dist/generated/pdw/deps/sui/vec_map.js +28 -0
  271. package/dist/generated/pdw/deps/sui/vec_map.js.map +1 -0
  272. package/dist/generated/pdw/memory.d.ts +676 -0
  273. package/dist/generated/pdw/memory.d.ts.map +1 -0
  274. package/dist/generated/pdw/memory.js +681 -0
  275. package/dist/generated/pdw/memory.js.map +1 -0
  276. package/dist/generated/pdw/wallet.d.ts +78 -0
  277. package/dist/generated/pdw/wallet.d.ts.map +1 -0
  278. package/dist/generated/pdw/wallet.js +89 -0
  279. package/dist/generated/pdw/wallet.js.map +1 -0
  280. package/dist/generated/utils/index.d.ts +12 -0
  281. package/dist/generated/utils/index.d.ts.map +1 -0
  282. package/dist/generated/utils/index.js +132 -0
  283. package/dist/generated/utils/index.js.map +1 -0
  284. package/dist/graph/BrowserKnowledgeGraphManager.d.ts +101 -0
  285. package/dist/graph/BrowserKnowledgeGraphManager.d.ts.map +1 -0
  286. package/dist/graph/BrowserKnowledgeGraphManager.js +411 -0
  287. package/dist/graph/BrowserKnowledgeGraphManager.js.map +1 -0
  288. package/dist/graph/GraphService.d.ts +194 -0
  289. package/dist/graph/GraphService.d.ts.map +1 -0
  290. package/dist/graph/GraphService.js +662 -0
  291. package/dist/graph/GraphService.js.map +1 -0
  292. package/dist/graph/KnowledgeGraphManager.d.ts +161 -0
  293. package/dist/graph/KnowledgeGraphManager.d.ts.map +1 -0
  294. package/dist/graph/KnowledgeGraphManager.js +495 -0
  295. package/dist/graph/KnowledgeGraphManager.js.map +1 -0
  296. package/dist/graph/index.d.ts +11 -0
  297. package/dist/graph/index.d.ts.map +1 -0
  298. package/dist/graph/index.js +9 -0
  299. package/dist/graph/index.js.map +1 -0
  300. package/dist/hooks.wip/index.d.ts +55 -0
  301. package/dist/hooks.wip/index.d.ts.map +1 -0
  302. package/dist/hooks.wip/index.js +58 -0
  303. package/dist/hooks.wip/index.js.map +1 -0
  304. package/dist/hooks.wip/useCreateMemory.d.ts +111 -0
  305. package/dist/hooks.wip/useCreateMemory.d.ts.map +1 -0
  306. package/dist/hooks.wip/useCreateMemory.js +149 -0
  307. package/dist/hooks.wip/useCreateMemory.js.map +1 -0
  308. package/dist/hooks.wip/useCreateMemoryBatch.d.ts +122 -0
  309. package/dist/hooks.wip/useCreateMemoryBatch.d.ts.map +1 -0
  310. package/dist/hooks.wip/useCreateMemoryBatch.js +221 -0
  311. package/dist/hooks.wip/useCreateMemoryBatch.js.map +1 -0
  312. package/dist/hooks.wip/useKnowledgeGraph.d.ts +66 -0
  313. package/dist/hooks.wip/useKnowledgeGraph.d.ts.map +1 -0
  314. package/dist/hooks.wip/useKnowledgeGraph.js +229 -0
  315. package/dist/hooks.wip/useKnowledgeGraph.js.map +1 -0
  316. package/dist/hooks.wip/useMemoryChat.d.ts +106 -0
  317. package/dist/hooks.wip/useMemoryChat.d.ts.map +1 -0
  318. package/dist/hooks.wip/useMemoryChat.js +284 -0
  319. package/dist/hooks.wip/useMemoryChat.js.map +1 -0
  320. package/dist/hooks.wip/useMemoryIndex.d.ts +90 -0
  321. package/dist/hooks.wip/useMemoryIndex.d.ts.map +1 -0
  322. package/dist/hooks.wip/useMemoryIndex.js +218 -0
  323. package/dist/hooks.wip/useMemoryIndex.js.map +1 -0
  324. package/dist/hooks.wip/useMemoryManager.d.ts +35 -0
  325. package/dist/hooks.wip/useMemoryManager.d.ts.map +1 -0
  326. package/dist/hooks.wip/useMemoryManager.js +86 -0
  327. package/dist/hooks.wip/useMemoryManager.js.map +1 -0
  328. package/dist/hooks.wip/useMemorySearch.d.ts +100 -0
  329. package/dist/hooks.wip/useMemorySearch.d.ts.map +1 -0
  330. package/dist/hooks.wip/useMemorySearch.js +278 -0
  331. package/dist/hooks.wip/useMemorySearch.js.map +1 -0
  332. package/dist/hooks.wip/useMemoryServices.d.ts +80 -0
  333. package/dist/hooks.wip/useMemoryServices.d.ts.map +1 -0
  334. package/dist/hooks.wip/useMemoryServices.js +264 -0
  335. package/dist/hooks.wip/useMemoryServices.js.map +1 -0
  336. package/dist/hooks.wip/usePDWRAG.d.ts +112 -0
  337. package/dist/hooks.wip/usePDWRAG.d.ts.map +1 -0
  338. package/dist/hooks.wip/usePDWRAG.js +121 -0
  339. package/dist/hooks.wip/usePDWRAG.js.map +1 -0
  340. package/dist/hooks.wip/usePDWVectorStore.d.ts +68 -0
  341. package/dist/hooks.wip/usePDWVectorStore.d.ts.map +1 -0
  342. package/dist/hooks.wip/usePDWVectorStore.js +102 -0
  343. package/dist/hooks.wip/usePDWVectorStore.js.map +1 -0
  344. package/dist/hooks.wip/useRetrieveEmbedding.d.ts +138 -0
  345. package/dist/hooks.wip/useRetrieveEmbedding.d.ts.map +1 -0
  346. package/dist/hooks.wip/useRetrieveEmbedding.js +121 -0
  347. package/dist/hooks.wip/useRetrieveEmbedding.js.map +1 -0
  348. package/dist/hooks.wip/useSearchMemories.d.ts +103 -0
  349. package/dist/hooks.wip/useSearchMemories.d.ts.map +1 -0
  350. package/dist/hooks.wip/useSearchMemories.js +146 -0
  351. package/dist/hooks.wip/useSearchMemories.js.map +1 -0
  352. package/dist/hooks.wip/useStoreEmbedding.d.ts +174 -0
  353. package/dist/hooks.wip/useStoreEmbedding.d.ts.map +1 -0
  354. package/dist/hooks.wip/useStoreEmbedding.js +167 -0
  355. package/dist/hooks.wip/useStoreEmbedding.js.map +1 -0
  356. package/dist/hooks.wip/useWalletMemories.d.ts +119 -0
  357. package/dist/hooks.wip/useWalletMemories.d.ts.map +1 -0
  358. package/dist/hooks.wip/useWalletMemories.js +166 -0
  359. package/dist/hooks.wip/useWalletMemories.js.map +1 -0
  360. package/dist/hooks.wip/utils/cache.d.ts +25 -0
  361. package/dist/hooks.wip/utils/cache.d.ts.map +1 -0
  362. package/dist/hooks.wip/utils/cache.js +38 -0
  363. package/dist/hooks.wip/utils/cache.js.map +1 -0
  364. package/dist/hooks.wip/utils/types.d.ts +138 -0
  365. package/dist/hooks.wip/utils/types.d.ts.map +1 -0
  366. package/dist/hooks.wip/utils/types.js +5 -0
  367. package/dist/hooks.wip/utils/types.js.map +1 -0
  368. package/dist/index.d.ts +190 -0
  369. package/dist/index.d.ts.map +1 -0
  370. package/dist/index.js +298 -0
  371. package/dist/index.js.map +1 -0
  372. package/dist/infrastructure/ai/EmbeddingService.d.ts +101 -0
  373. package/dist/infrastructure/ai/EmbeddingService.d.ts.map +1 -0
  374. package/dist/infrastructure/ai/EmbeddingService.js +242 -0
  375. package/dist/infrastructure/ai/EmbeddingService.js.map +1 -0
  376. package/dist/infrastructure/ai/GeminiAIService.d.ts +84 -0
  377. package/dist/infrastructure/ai/GeminiAIService.d.ts.map +1 -0
  378. package/dist/infrastructure/ai/GeminiAIService.js +300 -0
  379. package/dist/infrastructure/ai/GeminiAIService.js.map +1 -0
  380. package/dist/infrastructure/ai/index.d.ts +8 -0
  381. package/dist/infrastructure/ai/index.d.ts.map +1 -0
  382. package/dist/infrastructure/ai/index.js +8 -0
  383. package/dist/infrastructure/ai/index.js.map +1 -0
  384. package/dist/infrastructure/index.d.ts +16 -0
  385. package/dist/infrastructure/index.d.ts.map +1 -0
  386. package/dist/infrastructure/index.js +19 -0
  387. package/dist/infrastructure/index.js.map +1 -0
  388. package/dist/infrastructure/seal/EncryptionService.d.ts +162 -0
  389. package/dist/infrastructure/seal/EncryptionService.d.ts.map +1 -0
  390. package/dist/infrastructure/seal/EncryptionService.js +466 -0
  391. package/dist/infrastructure/seal/EncryptionService.js.map +1 -0
  392. package/dist/infrastructure/seal/SealService.d.ts +132 -0
  393. package/dist/infrastructure/seal/SealService.d.ts.map +1 -0
  394. package/dist/infrastructure/seal/SealService.js +473 -0
  395. package/dist/infrastructure/seal/SealService.js.map +1 -0
  396. package/dist/infrastructure/seal/index.d.ts +8 -0
  397. package/dist/infrastructure/seal/index.d.ts.map +1 -0
  398. package/dist/infrastructure/seal/index.js +8 -0
  399. package/dist/infrastructure/seal/index.js.map +1 -0
  400. package/dist/infrastructure/sui/BlockchainManager.d.ts +161 -0
  401. package/dist/infrastructure/sui/BlockchainManager.d.ts.map +1 -0
  402. package/dist/infrastructure/sui/BlockchainManager.js +421 -0
  403. package/dist/infrastructure/sui/BlockchainManager.js.map +1 -0
  404. package/dist/infrastructure/sui/SuiService.d.ts +179 -0
  405. package/dist/infrastructure/sui/SuiService.d.ts.map +1 -0
  406. package/dist/infrastructure/sui/SuiService.js +658 -0
  407. package/dist/infrastructure/sui/SuiService.js.map +1 -0
  408. package/dist/infrastructure/sui/index.d.ts +8 -0
  409. package/dist/infrastructure/sui/index.d.ts.map +1 -0
  410. package/dist/infrastructure/sui/index.js +8 -0
  411. package/dist/infrastructure/sui/index.js.map +1 -0
  412. package/dist/infrastructure/walrus/StorageManager.d.ts +207 -0
  413. package/dist/infrastructure/walrus/StorageManager.d.ts.map +1 -0
  414. package/dist/infrastructure/walrus/StorageManager.js +413 -0
  415. package/dist/infrastructure/walrus/StorageManager.js.map +1 -0
  416. package/dist/infrastructure/walrus/WalrusStorageService.d.ts +177 -0
  417. package/dist/infrastructure/walrus/WalrusStorageService.d.ts.map +1 -0
  418. package/dist/infrastructure/walrus/WalrusStorageService.js +403 -0
  419. package/dist/infrastructure/walrus/WalrusStorageService.js.map +1 -0
  420. package/dist/infrastructure/walrus/index.d.ts +8 -0
  421. package/dist/infrastructure/walrus/index.d.ts.map +1 -0
  422. package/dist/infrastructure/walrus/index.js +8 -0
  423. package/dist/infrastructure/walrus/index.js.map +1 -0
  424. package/dist/langchain/PDWEmbeddings.d.ts +77 -0
  425. package/dist/langchain/PDWEmbeddings.d.ts.map +1 -0
  426. package/dist/langchain/PDWEmbeddings.js +96 -0
  427. package/dist/langchain/PDWEmbeddings.js.map +1 -0
  428. package/dist/langchain/PDWVectorStore.d.ts +173 -0
  429. package/dist/langchain/PDWVectorStore.d.ts.map +1 -0
  430. package/dist/langchain/PDWVectorStore.js +304 -0
  431. package/dist/langchain/PDWVectorStore.js.map +1 -0
  432. package/dist/langchain/createPDWRAG.d.ts +115 -0
  433. package/dist/langchain/createPDWRAG.d.ts.map +1 -0
  434. package/dist/langchain/createPDWRAG.js +181 -0
  435. package/dist/langchain/createPDWRAG.js.map +1 -0
  436. package/dist/langchain/index.d.ts +35 -0
  437. package/dist/langchain/index.d.ts.map +1 -0
  438. package/dist/langchain/index.js +35 -0
  439. package/dist/langchain/index.js.map +1 -0
  440. package/dist/memory/index.d.ts +13 -0
  441. package/dist/memory/index.d.ts.map +1 -0
  442. package/dist/memory/index.js +14 -0
  443. package/dist/memory/index.js.map +1 -0
  444. package/dist/permissions/ConsentRepository.d.ts +71 -0
  445. package/dist/permissions/ConsentRepository.d.ts.map +1 -0
  446. package/dist/permissions/ConsentRepository.js +297 -0
  447. package/dist/permissions/ConsentRepository.js.map +1 -0
  448. package/dist/permissions/index.d.ts +9 -0
  449. package/dist/permissions/index.d.ts.map +1 -0
  450. package/dist/permissions/index.js +8 -0
  451. package/dist/permissions/index.js.map +1 -0
  452. package/dist/pipeline/MemoryPipeline.d.ts +191 -0
  453. package/dist/pipeline/MemoryPipeline.d.ts.map +1 -0
  454. package/dist/pipeline/MemoryPipeline.js +588 -0
  455. package/dist/pipeline/MemoryPipeline.js.map +1 -0
  456. package/dist/pipeline/PipelineManager.d.ts +178 -0
  457. package/dist/pipeline/PipelineManager.d.ts.map +1 -0
  458. package/dist/pipeline/PipelineManager.js +485 -0
  459. package/dist/pipeline/PipelineManager.js.map +1 -0
  460. package/dist/pipeline/index.d.ts +13 -0
  461. package/dist/pipeline/index.d.ts.map +1 -0
  462. package/dist/pipeline/index.js +11 -0
  463. package/dist/pipeline/index.js.map +1 -0
  464. package/dist/retrieval/AdvancedSearchService.d.ts +231 -0
  465. package/dist/retrieval/AdvancedSearchService.d.ts.map +1 -0
  466. package/dist/retrieval/AdvancedSearchService.js +384 -0
  467. package/dist/retrieval/AdvancedSearchService.js.map +1 -0
  468. package/dist/retrieval/MemoryAnalyticsService.d.ts +227 -0
  469. package/dist/retrieval/MemoryAnalyticsService.d.ts.map +1 -0
  470. package/dist/retrieval/MemoryAnalyticsService.js +417 -0
  471. package/dist/retrieval/MemoryAnalyticsService.js.map +1 -0
  472. package/dist/retrieval/MemoryDecryptionPipeline.d.ts +191 -0
  473. package/dist/retrieval/MemoryDecryptionPipeline.d.ts.map +1 -0
  474. package/dist/retrieval/MemoryDecryptionPipeline.js +623 -0
  475. package/dist/retrieval/MemoryDecryptionPipeline.js.map +1 -0
  476. package/dist/retrieval/MemoryRetrievalService.d.ts +248 -0
  477. package/dist/retrieval/MemoryRetrievalService.d.ts.map +1 -0
  478. package/dist/retrieval/MemoryRetrievalService.js +519 -0
  479. package/dist/retrieval/MemoryRetrievalService.js.map +1 -0
  480. package/dist/retrieval/index.d.ts +14 -0
  481. package/dist/retrieval/index.d.ts.map +1 -0
  482. package/dist/retrieval/index.js +10 -0
  483. package/dist/retrieval/index.js.map +1 -0
  484. package/dist/services/BatchService.d.ts +109 -0
  485. package/dist/services/BatchService.d.ts.map +1 -0
  486. package/dist/services/BatchService.js +259 -0
  487. package/dist/services/BatchService.js.map +1 -0
  488. package/dist/services/CapabilityService.d.ts +141 -0
  489. package/dist/services/CapabilityService.d.ts.map +1 -0
  490. package/dist/services/CapabilityService.js +361 -0
  491. package/dist/services/CapabilityService.js.map +1 -0
  492. package/dist/services/ChatService.d.ts +89 -0
  493. package/dist/services/ChatService.d.ts.map +1 -0
  494. package/dist/services/ChatService.js +319 -0
  495. package/dist/services/ChatService.js.map +1 -0
  496. package/dist/services/ClassifierService.d.ts +104 -0
  497. package/dist/services/ClassifierService.d.ts.map +1 -0
  498. package/dist/services/ClassifierService.js +374 -0
  499. package/dist/services/ClassifierService.js.map +1 -0
  500. package/dist/services/CrossContextPermissionService.d.ts +149 -0
  501. package/dist/services/CrossContextPermissionService.d.ts.map +1 -0
  502. package/dist/services/CrossContextPermissionService.js +337 -0
  503. package/dist/services/CrossContextPermissionService.js.map +1 -0
  504. package/dist/services/EmbeddingService.d.ts +206 -0
  505. package/dist/services/EmbeddingService.d.ts.map +1 -0
  506. package/dist/services/EmbeddingService.js +504 -0
  507. package/dist/services/EmbeddingService.js.map +1 -0
  508. package/dist/services/EncryptionService.d.ts +201 -0
  509. package/dist/services/EncryptionService.d.ts.map +1 -0
  510. package/dist/services/EncryptionService.js +558 -0
  511. package/dist/services/EncryptionService.js.map +1 -0
  512. package/dist/services/GeminiAIService.d.ts +112 -0
  513. package/dist/services/GeminiAIService.d.ts.map +1 -0
  514. package/dist/services/GeminiAIService.js +389 -0
  515. package/dist/services/GeminiAIService.js.map +1 -0
  516. package/dist/services/IndexManager.d.ts +238 -0
  517. package/dist/services/IndexManager.d.ts.map +1 -0
  518. package/dist/services/IndexManager.js +691 -0
  519. package/dist/services/IndexManager.js.map +1 -0
  520. package/dist/services/MemoryIndexService.d.ts +222 -0
  521. package/dist/services/MemoryIndexService.d.ts.map +1 -0
  522. package/dist/services/MemoryIndexService.js +695 -0
  523. package/dist/services/MemoryIndexService.js.map +1 -0
  524. package/dist/services/MemoryService.d.ts +156 -0
  525. package/dist/services/MemoryService.d.ts.map +1 -0
  526. package/dist/services/MemoryService.js +273 -0
  527. package/dist/services/MemoryService.js.map +1 -0
  528. package/dist/services/QueryService.d.ts +182 -0
  529. package/dist/services/QueryService.d.ts.map +1 -0
  530. package/dist/services/QueryService.js +631 -0
  531. package/dist/services/QueryService.js.map +1 -0
  532. package/dist/services/StorageService.d.ts +523 -0
  533. package/dist/services/StorageService.d.ts.map +1 -0
  534. package/dist/services/StorageService.js +627 -0
  535. package/dist/services/StorageService.js.map +1 -0
  536. package/dist/services/TransactionService.d.ts +179 -0
  537. package/dist/services/TransactionService.d.ts.map +1 -0
  538. package/dist/services/TransactionService.js +639 -0
  539. package/dist/services/TransactionService.js.map +1 -0
  540. package/dist/services/VectorService.d.ts +122 -0
  541. package/dist/services/VectorService.d.ts.map +1 -0
  542. package/dist/services/VectorService.js +371 -0
  543. package/dist/services/VectorService.js.map +1 -0
  544. package/dist/services/ViewService.d.ts +126 -0
  545. package/dist/services/ViewService.d.ts.map +1 -0
  546. package/dist/services/ViewService.js +356 -0
  547. package/dist/services/ViewService.js.map +1 -0
  548. package/dist/services/index.d.ts +12 -0
  549. package/dist/services/index.d.ts.map +1 -0
  550. package/dist/services/index.js +11 -0
  551. package/dist/services/index.js.map +1 -0
  552. package/dist/services/storage/BlobAttributesManager.d.ts +60 -0
  553. package/dist/services/storage/BlobAttributesManager.d.ts.map +1 -0
  554. package/dist/services/storage/BlobAttributesManager.js +265 -0
  555. package/dist/services/storage/BlobAttributesManager.js.map +1 -0
  556. package/dist/services/storage/KnowledgeGraphManager.d.ts +162 -0
  557. package/dist/services/storage/KnowledgeGraphManager.d.ts.map +1 -0
  558. package/dist/services/storage/KnowledgeGraphManager.js +303 -0
  559. package/dist/services/storage/KnowledgeGraphManager.js.map +1 -0
  560. package/dist/services/storage/MemorySearchManager.d.ts +154 -0
  561. package/dist/services/storage/MemorySearchManager.d.ts.map +1 -0
  562. package/dist/services/storage/MemorySearchManager.js +260 -0
  563. package/dist/services/storage/MemorySearchManager.js.map +1 -0
  564. package/dist/services/storage/QuiltBatchManager.d.ts +185 -0
  565. package/dist/services/storage/QuiltBatchManager.d.ts.map +1 -0
  566. package/dist/services/storage/QuiltBatchManager.js +385 -0
  567. package/dist/services/storage/QuiltBatchManager.js.map +1 -0
  568. package/dist/services/storage/WalrusMetadataManager.d.ts +89 -0
  569. package/dist/services/storage/WalrusMetadataManager.d.ts.map +1 -0
  570. package/dist/services/storage/WalrusMetadataManager.js +177 -0
  571. package/dist/services/storage/WalrusMetadataManager.js.map +1 -0
  572. package/dist/services/storage/WalrusStorageManager.d.ts +113 -0
  573. package/dist/services/storage/WalrusStorageManager.d.ts.map +1 -0
  574. package/dist/services/storage/WalrusStorageManager.js +211 -0
  575. package/dist/services/storage/WalrusStorageManager.js.map +1 -0
  576. package/dist/services/storage/index.d.ts +24 -0
  577. package/dist/services/storage/index.d.ts.map +1 -0
  578. package/dist/services/storage/index.js +18 -0
  579. package/dist/services/storage/index.js.map +1 -0
  580. package/dist/transactions/index.d.ts +13 -0
  581. package/dist/transactions/index.d.ts.map +1 -0
  582. package/dist/transactions/index.js +14 -0
  583. package/dist/transactions/index.js.map +1 -0
  584. package/dist/types/index.d.ts +12 -0
  585. package/dist/types/index.d.ts.map +1 -0
  586. package/dist/types/index.js +13 -0
  587. package/dist/types/index.js.map +1 -0
  588. package/dist/types/wallet.d.ts +12 -0
  589. package/dist/types/wallet.d.ts.map +1 -0
  590. package/dist/types/wallet.js +13 -0
  591. package/dist/types/wallet.js.map +1 -0
  592. package/dist/utils/index.d.ts +21 -0
  593. package/dist/utils/index.d.ts.map +1 -0
  594. package/dist/utils/index.js +30 -0
  595. package/dist/utils/index.js.map +1 -0
  596. package/dist/utils/rebuildIndex.d.ts +79 -0
  597. package/dist/utils/rebuildIndex.d.ts.map +1 -0
  598. package/dist/utils/rebuildIndex.js +211 -0
  599. package/dist/utils/rebuildIndex.js.map +1 -0
  600. package/dist/utils/rebuildIndexNode.d.ts +70 -0
  601. package/dist/utils/rebuildIndexNode.d.ts.map +1 -0
  602. package/dist/utils/rebuildIndexNode.js +236 -0
  603. package/dist/utils/rebuildIndexNode.js.map +1 -0
  604. package/dist/vector/BrowserHnswIndexService.d.ts +93 -0
  605. package/dist/vector/BrowserHnswIndexService.d.ts.map +1 -0
  606. package/dist/vector/BrowserHnswIndexService.js +581 -0
  607. package/dist/vector/BrowserHnswIndexService.js.map +1 -0
  608. package/dist/vector/HnswWasmService.d.ts +97 -0
  609. package/dist/vector/HnswWasmService.d.ts.map +1 -0
  610. package/dist/vector/HnswWasmService.js +518 -0
  611. package/dist/vector/HnswWasmService.js.map +1 -0
  612. package/dist/vector/IHnswService.d.ts +179 -0
  613. package/dist/vector/IHnswService.d.ts.map +1 -0
  614. package/dist/vector/IHnswService.js +25 -0
  615. package/dist/vector/IHnswService.js.map +1 -0
  616. package/dist/vector/NodeHnswService.d.ts +80 -0
  617. package/dist/vector/NodeHnswService.d.ts.map +1 -0
  618. package/dist/vector/NodeHnswService.js +589 -0
  619. package/dist/vector/NodeHnswService.js.map +1 -0
  620. package/dist/vector/VectorManager.d.ts +142 -0
  621. package/dist/vector/VectorManager.d.ts.map +1 -0
  622. package/dist/vector/VectorManager.js +339 -0
  623. package/dist/vector/VectorManager.js.map +1 -0
  624. package/dist/vector/createHnswService.d.ts +51 -0
  625. package/dist/vector/createHnswService.d.ts.map +1 -0
  626. package/dist/vector/createHnswService.js +120 -0
  627. package/dist/vector/createHnswService.js.map +1 -0
  628. package/dist/vector/index.d.ts +24 -0
  629. package/dist/vector/index.d.ts.map +1 -0
  630. package/dist/vector/index.js +24 -0
  631. package/dist/vector/index.js.map +1 -0
  632. package/dist/view/ViewService.d.ts +136 -0
  633. package/dist/view/ViewService.d.ts.map +1 -0
  634. package/dist/view/ViewService.js +325 -0
  635. package/dist/view/ViewService.js.map +1 -0
  636. package/dist/view/index.d.ts +7 -0
  637. package/dist/view/index.d.ts.map +1 -0
  638. package/dist/view/index.js +7 -0
  639. package/dist/view/index.js.map +1 -0
  640. package/dist/wallet/ContextWalletService.d.ts +172 -0
  641. package/dist/wallet/ContextWalletService.d.ts.map +1 -0
  642. package/dist/wallet/ContextWalletService.js +510 -0
  643. package/dist/wallet/ContextWalletService.js.map +1 -0
  644. package/dist/wallet/MainWalletService.d.ts +114 -0
  645. package/dist/wallet/MainWalletService.d.ts.map +1 -0
  646. package/dist/wallet/MainWalletService.js +259 -0
  647. package/dist/wallet/MainWalletService.js.map +1 -0
  648. package/dist/wallet/index.d.ts +16 -0
  649. package/dist/wallet/index.d.ts.map +1 -0
  650. package/dist/wallet/index.js +14 -0
  651. package/dist/wallet/index.js.map +1 -0
  652. package/package.json +150 -0
  653. package/src/access/PermissionService.ts +636 -0
  654. package/src/access/index.ts +8 -0
  655. package/src/aggregation/AggregationService.ts +390 -0
  656. package/src/aggregation/index.ts +8 -0
  657. package/src/ai-sdk/PDWVectorStore.ts +712 -0
  658. package/src/ai-sdk/index.ts +65 -0
  659. package/src/ai-sdk/tools.ts +460 -0
  660. package/src/ai-sdk/types.ts +404 -0
  661. package/src/batch/BatchManager.ts +598 -0
  662. package/src/batch/BatchingService.ts +430 -0
  663. package/src/batch/MemoryProcessingCache.ts +493 -0
  664. package/src/batch/index.ts +31 -0
  665. package/src/browser.ts +196 -0
  666. package/src/client/ClientMemoryManager.ts +982 -0
  667. package/src/client/PersonalDataWallet.ts +346 -0
  668. package/src/client/SimplePDWClient.ts +1180 -0
  669. package/src/client/factory.ts +155 -0
  670. package/src/client/namespaces/AnalyticsNamespace.ts +377 -0
  671. package/src/client/namespaces/BatchNamespace.ts +356 -0
  672. package/src/client/namespaces/CacheNamespace.ts +123 -0
  673. package/src/client/namespaces/CapabilityNamespace.ts +217 -0
  674. package/src/client/namespaces/ClassifyNamespace.ts +169 -0
  675. package/src/client/namespaces/ContextNamespace.ts +297 -0
  676. package/src/client/namespaces/EmbeddingsNamespace.ts +99 -0
  677. package/src/client/namespaces/EncryptionNamespace.ts +221 -0
  678. package/src/client/namespaces/GraphNamespace.ts +468 -0
  679. package/src/client/namespaces/IndexNamespace.ts +283 -0
  680. package/src/client/namespaces/MemoryNamespace.ts +1135 -0
  681. package/src/client/namespaces/PermissionsNamespace.ts +254 -0
  682. package/src/client/namespaces/PipelineNamespace.ts +220 -0
  683. package/src/client/namespaces/SearchNamespace.ts +1036 -0
  684. package/src/client/namespaces/StorageNamespace.ts +458 -0
  685. package/src/client/namespaces/TxNamespace.ts +260 -0
  686. package/src/client/namespaces/WalletNamespace.ts +243 -0
  687. package/src/client/namespaces/consolidated/AINamespace.ts +449 -0
  688. package/src/client/namespaces/consolidated/BlockchainNamespace.ts +492 -0
  689. package/src/client/namespaces/consolidated/SecurityNamespace.ts +648 -0
  690. package/src/client/namespaces/consolidated/StorageNamespace.ts +440 -0
  691. package/src/client/namespaces/consolidated/index.ts +39 -0
  692. package/src/client/signers/KeypairSigner.ts +101 -0
  693. package/src/client/signers/UnifiedSigner.ts +99 -0
  694. package/src/client/signers/WalletAdapterSigner.ts +149 -0
  695. package/src/client/signers/index.ts +19 -0
  696. package/src/config/ConfigurationHelper.ts +413 -0
  697. package/src/config/defaults.ts +52 -0
  698. package/src/config/index.ts +9 -0
  699. package/src/config/validation.ts +71 -0
  700. package/src/core/index.ts +14 -0
  701. package/src/core/interfaces/IService.ts +307 -0
  702. package/src/core/interfaces/index.ts +8 -0
  703. package/src/core/types/capability.ts +297 -0
  704. package/src/core/types/index.ts +871 -0
  705. package/src/core/types/wallet.ts +271 -0
  706. package/src/core/types.ts +9 -0
  707. package/src/core/wallet.ts +223 -0
  708. package/src/embedding/index.ts +20 -0
  709. package/src/embedding/types.ts +358 -0
  710. package/src/errors/index.ts +603 -0
  711. package/src/errors/recovery.ts +462 -0
  712. package/src/errors/validation.ts +568 -0
  713. package/src/generated/pdw/capability.ts +319 -0
  714. package/src/generated/pdw/deps/sui/object.ts +13 -0
  715. package/src/generated/pdw/deps/sui/vec_map.ts +33 -0
  716. package/src/generated/pdw/memory.ts +1088 -0
  717. package/src/generated/pdw/wallet.ts +124 -0
  718. package/src/generated/utils/index.ts +159 -0
  719. package/src/graph/GraphService.ts +888 -0
  720. package/src/graph/KnowledgeGraphManager.ts +729 -0
  721. package/src/graph/index.ts +26 -0
  722. package/src/index.ts +458 -0
  723. package/src/infrastructure/index.ts +22 -0
  724. package/src/infrastructure/seal/EncryptionService.ts +604 -0
  725. package/src/infrastructure/seal/SealService.ts +616 -0
  726. package/src/infrastructure/seal/index.ts +9 -0
  727. package/src/infrastructure/sui/BlockchainManager.ts +628 -0
  728. package/src/infrastructure/sui/SuiService.ts +888 -0
  729. package/src/infrastructure/sui/index.ts +9 -0
  730. package/src/infrastructure/walrus/StorageManager.ts +605 -0
  731. package/src/infrastructure/walrus/WalrusStorageService.ts +613 -0
  732. package/src/infrastructure/walrus/index.ts +9 -0
  733. package/src/langchain/PDWEmbeddings.ts +145 -0
  734. package/src/langchain/PDWVectorStore.ts +456 -0
  735. package/src/langchain/README.md +116 -0
  736. package/src/langchain/createPDWRAG.ts +303 -0
  737. package/src/langchain/index.ts +47 -0
  738. package/src/permissions/ConsentRepository.ts +364 -0
  739. package/src/permissions/index.ts +9 -0
  740. package/src/pipeline/MemoryPipeline.ts +863 -0
  741. package/src/pipeline/PipelineManager.ts +684 -0
  742. package/src/pipeline/index.ts +27 -0
  743. package/src/retrieval/AdvancedSearchService.ts +630 -0
  744. package/src/retrieval/MemoryAnalyticsService.ts +712 -0
  745. package/src/retrieval/MemoryDecryptionPipeline.ts +825 -0
  746. package/src/retrieval/MemoryRetrievalService.ts +831 -0
  747. package/src/retrieval/index.ts +43 -0
  748. package/src/services/BatchService.ts +353 -0
  749. package/src/services/CapabilityService.ts +448 -0
  750. package/src/services/ClassifierService.ts +466 -0
  751. package/src/services/CrossContextPermissionService.ts +484 -0
  752. package/src/services/EmbeddingService.ts +706 -0
  753. package/src/services/EncryptionService.ts +712 -0
  754. package/src/services/GeminiAIService.ts +497 -0
  755. package/src/services/IndexManager.ts +1004 -0
  756. package/src/services/MemoryIndexService.ts +922 -0
  757. package/src/services/MemoryService.ts +370 -0
  758. package/src/services/QueryService.ts +891 -0
  759. package/src/services/StorageService.ts +1111 -0
  760. package/src/services/TransactionService.ts +791 -0
  761. package/src/services/VectorService.ts +462 -0
  762. package/src/services/ViewService.ts +485 -0
  763. package/src/services/index.ts +25 -0
  764. package/src/services/storage/BlobAttributesManager.ts +342 -0
  765. package/src/services/storage/KnowledgeGraphManager.ts +425 -0
  766. package/src/services/storage/MemorySearchManager.ts +387 -0
  767. package/src/services/storage/QuiltBatchManager.ts +532 -0
  768. package/src/services/storage/WalrusMetadataManager.ts +271 -0
  769. package/src/services/storage/WalrusStorageManager.ts +290 -0
  770. package/src/services/storage/index.ts +52 -0
  771. package/src/types/index.ts +13 -0
  772. package/src/utils/index.ts +68 -0
  773. package/src/utils/rebuildIndex.ts +290 -0
  774. package/src/utils/rebuildIndexNode.ts +341 -0
  775. package/src/vector/BrowserHnswIndexService.ts +758 -0
  776. package/src/vector/HnswWasmService.ts +679 -0
  777. package/src/vector/IHnswService.ts +224 -0
  778. package/src/vector/NodeHnswService.ts +713 -0
  779. package/src/vector/VectorManager.ts +479 -0
  780. package/src/vector/createHnswService.ts +135 -0
  781. package/src/vector/index.ts +57 -0
  782. package/src/wallet/ContextWalletService.ts +657 -0
  783. package/src/wallet/MainWalletService.ts +318 -0
  784. package/src/wallet/index.ts +17 -0
@@ -0,0 +1,458 @@
1
+ /**
2
+ * Storage Namespace - Direct Walrus Storage Operations
3
+ *
4
+ * Simple wrapper around StorageService for direct Walrus access.
5
+ * Delegates to existing storage managers:
6
+ * - WalrusStorageManager (upload/download)
7
+ * - QuiltBatchManager (batch operations)
8
+ * - WalrusMetadataManager (metadata)
9
+ * - BlobAttributesManager (dynamic fields)
10
+ *
11
+ * @module client/namespaces
12
+ */
13
+
14
+ import type { ServiceContainer } from '../SimplePDWClient';
15
+
16
+ /**
17
+ * Upload result
18
+ */
19
+ export interface UploadResult {
20
+ blobId: string;
21
+ size: number;
22
+ contentType?: string;
23
+ metadata?: Record<string, any>;
24
+ }
25
+
26
+ /**
27
+ * Quilt result (batch upload)
28
+ */
29
+ export interface QuiltResult {
30
+ quiltId: string;
31
+ files: Array<{
32
+ name: string;
33
+ blobId: string;
34
+ size: number;
35
+ }>;
36
+ totalSize: number;
37
+ }
38
+
39
+ /**
40
+ * Blob metadata
41
+ */
42
+ export interface BlobMetadata {
43
+ [key: string]: string | number | boolean;
44
+ }
45
+
46
+ /**
47
+ * File for batch upload
48
+ */
49
+ export interface FileUpload {
50
+ name: string;
51
+ data: Uint8Array;
52
+ contentType?: string;
53
+ }
54
+
55
+ /**
56
+ * Storage statistics
57
+ */
58
+ export interface StorageStats {
59
+ totalBlobs: number;
60
+ totalSize: number;
61
+ blobsByCategory: Record<string, number>;
62
+ }
63
+
64
+ /**
65
+ * Storage Namespace
66
+ *
67
+ * Handles direct Walrus storage operations
68
+ */
69
+ export class StorageNamespace {
70
+ constructor(private services: ServiceContainer) {}
71
+
72
+ /**
73
+ * Upload data to Walrus
74
+ *
75
+ * Delegates to StorageService.uploadBlob() (WalrusStorageManager)
76
+ *
77
+ * @param data - Data bytes to upload
78
+ * @param metadata - Optional metadata
79
+ * @returns Upload result with blob ID
80
+ *
81
+ * @example
82
+ * ```typescript
83
+ * const data = new TextEncoder().encode('Hello world');
84
+ * const result = await pdw.storage.upload(data, {
85
+ * contentType: 'text/plain',
86
+ * category: 'document'
87
+ * });
88
+ * ```
89
+ */
90
+ async upload(data: Uint8Array, metadata?: BlobMetadata): Promise<UploadResult> {
91
+ try {
92
+ // Delegate to StorageService (uses WalrusStorageManager internally)
93
+ const result = await this.services.storage.uploadBlob(
94
+ data,
95
+ {
96
+ signer: this.services.config.signer.getSigner(),
97
+ epochs: 3,
98
+ deletable: true,
99
+ metadata: metadata as any
100
+ }
101
+ );
102
+
103
+ return {
104
+ blobId: result.blobId,
105
+ size: data.length,
106
+ metadata
107
+ };
108
+ } catch (error) {
109
+ throw new Error(`Upload failed: ${error instanceof Error ? error.message : String(error)}`);
110
+ }
111
+ }
112
+
113
+ /**
114
+ * Download data from Walrus
115
+ *
116
+ * @param blobId - Blob ID to download
117
+ * @returns Data bytes
118
+ */
119
+ async download(blobId: string): Promise<Uint8Array> {
120
+ try {
121
+ const result = await this.services.storage.retrieve(blobId);
122
+
123
+ if (result instanceof Uint8Array) {
124
+ return result;
125
+ }
126
+
127
+ // Convert string to Uint8Array if needed
128
+ if (typeof result === 'string') {
129
+ return new TextEncoder().encode(result);
130
+ }
131
+
132
+ throw new Error('Unexpected blob format');
133
+ } catch (error) {
134
+ throw new Error(`Download failed: ${error instanceof Error ? error.message : String(error)}`);
135
+ }
136
+ }
137
+
138
+ /**
139
+ * Delete a blob (soft delete)
140
+ *
141
+ * Walrus blobs are immutable and cannot be truly deleted.
142
+ * This marks the blob as deleted by setting a `deleted_at` attribute on-chain.
143
+ * The blob data remains on Walrus but will be filtered out in queries.
144
+ *
145
+ * @param blobId - Blob ID to mark as deleted
146
+ */
147
+ async delete(blobId: string): Promise<void> {
148
+ try {
149
+ if (!blobId) {
150
+ throw new Error('Blob ID is required');
151
+ }
152
+
153
+ // Mark as deleted by setting deleted_at attribute
154
+ // This is a soft delete - the blob remains on Walrus but is marked as deleted
155
+ await this.services.storage.updateBlobAttributes(
156
+ blobId,
157
+ {
158
+ deleted_at: new Date().toISOString(),
159
+ deleted_by: this.services.config.userAddress
160
+ },
161
+ this.services.config.signer.getSigner()
162
+ );
163
+
164
+ console.log(`Blob ${blobId} marked as deleted`);
165
+ } catch (error) {
166
+ throw new Error(`Delete failed: ${error instanceof Error ? error.message : String(error)}`);
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Upload multiple files as a Quilt (batch)
172
+ *
173
+ * @param files - Array of files to upload
174
+ * @returns Quilt result with file mappings
175
+ */
176
+ async uploadBatch(files: FileUpload[]): Promise<QuiltResult> {
177
+ try {
178
+ // Use uploadMemoryBatch (StorageService has this, not uploadQuilt)
179
+ const memories = files.map(f => ({
180
+ content: new TextDecoder().decode(f.data),
181
+ category: 'general',
182
+ importance: 5,
183
+ topic: f.name,
184
+ embedding: [] as number[],
185
+ encryptedContent: f.data, // Use file data as encrypted content
186
+ summary: ''
187
+ }));
188
+
189
+ const result = await this.services.storage.uploadMemoryBatch(
190
+ memories,
191
+ {
192
+ signer: this.services.config.signer.getSigner(),
193
+ epochs: 3,
194
+ userAddress: this.services.config.userAddress
195
+ }
196
+ );
197
+
198
+ return {
199
+ quiltId: result.quiltId,
200
+ files: result.files.map((f: any) => ({
201
+ name: f.identifier,
202
+ blobId: f.blobId,
203
+ size: 0 // Size not available in result
204
+ })),
205
+ totalSize: files.reduce((sum, f) => sum + f.data.length, 0)
206
+ };
207
+ } catch (error) {
208
+ throw new Error(`Batch upload failed: ${error instanceof Error ? error.message : String(error)}`);
209
+ }
210
+ }
211
+
212
+ /**
213
+ * Download multiple files from a Quilt
214
+ *
215
+ * Retrieves all WalrusFiles from a quilt and downloads their content.
216
+ * File names are extracted from identifiers or tags.
217
+ *
218
+ * @param quiltId - Quilt ID
219
+ * @returns Array of files with name and data
220
+ */
221
+ async downloadBatch(quiltId: string): Promise<Array<{ name: string; data: Uint8Array }>> {
222
+ try {
223
+ if (!quiltId) {
224
+ throw new Error('Quilt ID is required');
225
+ }
226
+
227
+ // Get all WalrusFile objects from quilt
228
+ const files = await this.services.storage.getQuiltFiles(quiltId);
229
+
230
+ if (!files || files.length === 0) {
231
+ console.warn(`No files found in quilt ${quiltId}`);
232
+ return [];
233
+ }
234
+
235
+ // Download each file in parallel
236
+ const results = await Promise.all(
237
+ files.map(async (file: any, index: number) => {
238
+ try {
239
+ // Extract name from identifier or tags
240
+ let name = `file-${index}`;
241
+
242
+ // Try to get identifier (filename)
243
+ if (typeof file.getIdentifier === 'function') {
244
+ const identifier = file.getIdentifier();
245
+ if (identifier) {
246
+ name = identifier;
247
+ }
248
+ }
249
+
250
+ // Try to get name from tags as fallback
251
+ if (name === `file-${index}` && typeof file.getTags === 'function') {
252
+ const tags = await file.getTags();
253
+ if (tags?.topic) {
254
+ name = tags.topic;
255
+ }
256
+ }
257
+
258
+ // Get blob content - WalrusFile should have blob reference
259
+ let data: Uint8Array;
260
+
261
+ // Try to read content directly from file if available
262
+ if (typeof file.read === 'function') {
263
+ data = await file.read();
264
+ } else if (file.blobId) {
265
+ // Fallback: retrieve via blobId
266
+ const result = await this.services.storage.retrieve(file.blobId);
267
+ data = result instanceof Uint8Array ? result : new TextEncoder().encode(String(result));
268
+ } else if (file.contents) {
269
+ // Direct contents access
270
+ data = file.contents instanceof Uint8Array
271
+ ? file.contents
272
+ : new TextEncoder().encode(String(file.contents));
273
+ } else {
274
+ throw new Error(`Cannot extract content from file at index ${index}`);
275
+ }
276
+
277
+ return { name, data };
278
+ } catch (fileError) {
279
+ console.warn(`Failed to download file at index ${index}:`, fileError);
280
+ // Return empty data for failed files instead of throwing
281
+ return { name: `file-${index}-error`, data: new Uint8Array(0) };
282
+ }
283
+ })
284
+ );
285
+
286
+ // Filter out failed downloads (empty data)
287
+ return results.filter(r => r.data.length > 0);
288
+ } catch (error) {
289
+ throw new Error(`Batch download failed: ${error instanceof Error ? error.message : String(error)}`);
290
+ }
291
+ }
292
+
293
+ /**
294
+ * Set metadata for a blob
295
+ *
296
+ * @param blobId - Blob ID
297
+ * @param metadata - Metadata to attach
298
+ */
299
+ async setMetadata(blobId: string, metadata: BlobMetadata): Promise<void> {
300
+ try {
301
+ // Use attachMetadataToBlob (correct method name)
302
+ await this.services.storage.attachMetadataToBlob(
303
+ blobId,
304
+ metadata as any,
305
+ this.services.config.signer.getSigner()
306
+ );
307
+ } catch (error) {
308
+ throw new Error(`Set metadata failed: ${error instanceof Error ? error.message : String(error)}`);
309
+ }
310
+ }
311
+
312
+ /**
313
+ * Get metadata for a blob
314
+ *
315
+ * @param blobId - Blob ID
316
+ * @returns Blob metadata
317
+ */
318
+ async getMetadata(blobId: string): Promise<BlobMetadata> {
319
+ try {
320
+ // Use retrieveBlobMetadata (correct method name)
321
+ const metadata = await this.services.storage.retrieveBlobMetadata(blobId);
322
+ return metadata as BlobMetadata;
323
+ } catch (error) {
324
+ throw new Error(`Get metadata failed: ${error instanceof Error ? error.message : String(error)}`);
325
+ }
326
+ }
327
+
328
+ /**
329
+ * List blobs for user
330
+ *
331
+ * @param filter - Optional filter
332
+ * @returns Array of blob info
333
+ */
334
+ async listBlobs(filter?: { category?: string; limit?: number }): Promise<Array<{ blobId: string; metadata: BlobMetadata }>> {
335
+ try {
336
+ // Use searchByMetadata
337
+ const results = await this.services.storage.searchByMetadata(
338
+ this.services.config.userAddress,
339
+ {} // MetadataSearchQuery - minimal params
340
+ );
341
+
342
+ return results.map((r: any) => ({
343
+ blobId: r.blobId,
344
+ metadata: r.metadata || {}
345
+ }));
346
+ } catch (error) {
347
+ throw new Error(`List blobs failed: ${error instanceof Error ? error.message : String(error)}`);
348
+ }
349
+ }
350
+
351
+ /**
352
+ * Get storage statistics
353
+ *
354
+ * Calculates total size from blob metadata (content_size field).
355
+ *
356
+ * @returns Storage stats
357
+ */
358
+ async getStats(): Promise<StorageStats> {
359
+ try {
360
+ // Get all blobs
361
+ const blobs = await this.listBlobs({ limit: 1000 });
362
+
363
+ const stats: StorageStats = {
364
+ totalBlobs: blobs.length,
365
+ totalSize: 0,
366
+ blobsByCategory: {}
367
+ };
368
+
369
+ // Count by category and accumulate size
370
+ blobs.forEach(b => {
371
+ const category = b.metadata.category as string || 'general';
372
+ stats.blobsByCategory[category] = (stats.blobsByCategory[category] || 0) + 1;
373
+
374
+ // Sum up content sizes from metadata
375
+ const size = Number(b.metadata.content_size || b.metadata.contentSize || b.metadata.size || 0);
376
+ if (!isNaN(size)) {
377
+ stats.totalSize += size;
378
+ }
379
+ });
380
+
381
+ return stats;
382
+ } catch (error) {
383
+ throw new Error(`Get storage stats failed: ${error instanceof Error ? error.message : String(error)}`);
384
+ }
385
+ }
386
+
387
+ /**
388
+ * Cleanup old or unused blobs
389
+ *
390
+ * Marks blobs as deleted if they meet cleanup criteria:
391
+ * - Already marked as deleted (removes from active queries)
392
+ * - Low importance and old (optional aggressive cleanup)
393
+ *
394
+ * Note: Walrus blobs cannot be truly deleted. This marks them
395
+ * as deleted via attributes for filtering in queries.
396
+ *
397
+ * @param options - Cleanup options
398
+ * @returns Number of blobs marked for cleanup
399
+ */
400
+ async cleanup(options?: {
401
+ /** Remove blobs already marked as deleted from listings */
402
+ removeDeleted?: boolean;
403
+ /** Mark old, low-importance blobs as deleted */
404
+ aggressiveCleanup?: boolean;
405
+ /** Max age in days for aggressive cleanup (default: 90) */
406
+ maxAgeDays?: number;
407
+ /** Max importance for aggressive cleanup (default: 3) */
408
+ maxImportance?: number;
409
+ }): Promise<number> {
410
+ try {
411
+ const {
412
+ removeDeleted = true,
413
+ aggressiveCleanup = false,
414
+ maxAgeDays = 90,
415
+ maxImportance = 3
416
+ } = options || {};
417
+
418
+ let cleanedCount = 0;
419
+ const blobs = await this.listBlobs({ limit: 1000 });
420
+
421
+ for (const blob of blobs) {
422
+ try {
423
+ const metadata = blob.metadata;
424
+
425
+ // Skip if already processed
426
+ if (metadata.deleted_at) {
427
+ continue;
428
+ }
429
+
430
+ // Aggressive cleanup: mark old, low-importance blobs
431
+ if (aggressiveCleanup) {
432
+ const importance = Number(metadata.importance) || 5;
433
+ const createdAt = metadata.created_at
434
+ ? new Date(metadata.created_at as string).getTime()
435
+ : Date.now();
436
+ const ageInDays = (Date.now() - createdAt) / (1000 * 60 * 60 * 24);
437
+
438
+ if (importance <= maxImportance && ageInDays >= maxAgeDays) {
439
+ await this.delete(blob.blobId);
440
+ cleanedCount++;
441
+ console.log(`Cleaned up old blob ${blob.blobId} (age: ${ageInDays.toFixed(0)} days, importance: ${importance})`);
442
+ }
443
+ }
444
+ } catch (blobError) {
445
+ console.warn(`Failed to process blob ${blob.blobId} during cleanup:`, blobError);
446
+ }
447
+ }
448
+
449
+ if (cleanedCount > 0) {
450
+ console.log(`Storage cleanup completed: ${cleanedCount} blobs marked for cleanup`);
451
+ }
452
+
453
+ return cleanedCount;
454
+ } catch (error) {
455
+ throw new Error(`Cleanup failed: ${error instanceof Error ? error.message : String(error)}`);
456
+ }
457
+ }
458
+ }
@@ -0,0 +1,260 @@
1
+ /**
2
+ * Tx Namespace - Transaction Utilities
3
+ *
4
+ * Pure delegation to TransactionService for PTB building and execution.
5
+ * Provides convenient methods for common blockchain operations.
6
+ *
7
+ * @module client/namespaces
8
+ */
9
+
10
+ import type { ServiceContainer } from '../SimplePDWClient';
11
+ import { Transaction } from '@mysten/sui/transactions';
12
+ import type { TransactionResult } from '../../types';
13
+
14
+ /**
15
+ * Memory transaction options
16
+ */
17
+ export interface MemoryTxOptions {
18
+ category: string;
19
+ vectorId: number;
20
+ blobId: string;
21
+ importance: number;
22
+ gasBudget?: number;
23
+ }
24
+
25
+ /**
26
+ * Batch operation types supported by PTB
27
+ */
28
+ export type BatchOperationType = 'createMemory' | 'updateMemory' | 'deleteMemory' | 'createCap' | 'transferCap' | 'burnCap';
29
+
30
+ /**
31
+ * Batch operation definition
32
+ */
33
+ export interface BatchOperation {
34
+ type: BatchOperationType;
35
+ options: any;
36
+ }
37
+
38
+ /**
39
+ * Tx Namespace
40
+ *
41
+ * Handles transaction building and execution utilities
42
+ */
43
+ export class TxNamespace {
44
+ constructor(private services: ServiceContainer) {}
45
+
46
+ /**
47
+ * Build transaction for creating memory record
48
+ *
49
+ * Delegates to: TransactionService.buildCreateMemoryRecordLightweight()
50
+ *
51
+ * @param options - Memory creation options
52
+ * @returns Transaction object
53
+ */
54
+ buildCreate(options: MemoryTxOptions): Transaction {
55
+ if (!this.services.tx) {
56
+ throw new Error('Transaction service not configured.');
57
+ }
58
+
59
+ return this.services.tx.buildCreateMemoryRecordLightweight({
60
+ category: options.category,
61
+ vectorId: options.vectorId,
62
+ blobId: options.blobId,
63
+ importance: options.importance,
64
+ gasBudget: options.gasBudget
65
+ });
66
+ }
67
+
68
+ /**
69
+ * Build transaction for updating memory metadata
70
+ *
71
+ * Delegates to: TransactionService.buildUpdateMemoryMetadata()
72
+ *
73
+ * @param memoryId - Memory ID to update
74
+ * @param metadataBlobId - New metadata blob ID
75
+ * @returns Transaction object
76
+ */
77
+ buildUpdate(memoryId: string, metadataBlobId: string): Transaction {
78
+ if (!this.services.tx) {
79
+ throw new Error('Transaction service not configured.');
80
+ }
81
+
82
+ return this.services.tx.buildUpdateMemoryMetadata({
83
+ memoryId,
84
+ metadataBlobId,
85
+ embeddingDimension: 3072 // Default for Gemini
86
+ });
87
+ }
88
+
89
+ /**
90
+ * Build transaction for deleting memory record
91
+ *
92
+ * Delegates to: TransactionService.buildDeleteMemoryRecord()
93
+ *
94
+ * @param memoryId - Memory ID to delete
95
+ * @returns Transaction object
96
+ */
97
+ buildDelete(memoryId: string): Transaction {
98
+ if (!this.services.tx) {
99
+ throw new Error('Transaction service not configured.');
100
+ }
101
+
102
+ return this.services.tx.buildDeleteMemoryRecord({
103
+ memoryId
104
+ });
105
+ }
106
+
107
+ /**
108
+ * Execute a transaction
109
+ *
110
+ * Delegates to: TransactionService.executeTransaction()
111
+ *
112
+ * @param tx - Transaction to execute
113
+ * @returns Transaction result with digest and status
114
+ */
115
+ async execute(tx: Transaction): Promise<TransactionResult> {
116
+ if (!this.services.tx) {
117
+ throw new Error('Transaction service not configured.');
118
+ }
119
+
120
+ return await this.services.tx.executeTransaction(
121
+ tx,
122
+ this.services.config.signer.getSigner()
123
+ );
124
+ }
125
+
126
+ /**
127
+ * Build and execute in one call
128
+ *
129
+ * Convenience method combining build + execute
130
+ *
131
+ * @param options - Memory creation options
132
+ * @returns Transaction result
133
+ */
134
+ async createMemory(options: MemoryTxOptions): Promise<TransactionResult> {
135
+ const tx = this.buildCreate(options);
136
+ return await this.execute(tx);
137
+ }
138
+
139
+ /**
140
+ * Build batch transaction (combine multiple operations into single PTB)
141
+ *
142
+ * Delegates to TransactionService.buildBatchTransaction() for proper PTB composition.
143
+ * All operations are executed atomically in a single transaction.
144
+ *
145
+ * @param operations - Array of typed operations to batch
146
+ * @returns Combined transaction with all move calls
147
+ *
148
+ * @example
149
+ * ```typescript
150
+ * const tx = pdw.tx.buildBatch([
151
+ * { type: 'createMemory', options: { category: 'note', vectorId: 1, blobId: 'abc', importance: 5 } },
152
+ * { type: 'createMemory', options: { category: 'task', vectorId: 2, blobId: 'def', importance: 7 } },
153
+ * ]);
154
+ * const result = await pdw.tx.execute(tx);
155
+ * ```
156
+ */
157
+ buildBatch(operations: BatchOperation[]): Transaction {
158
+ if (!this.services.tx) {
159
+ throw new Error('Transaction service not configured.');
160
+ }
161
+
162
+ return this.services.tx.buildBatchTransaction(operations);
163
+ }
164
+
165
+ /**
166
+ * Build and execute batch transaction in one call
167
+ *
168
+ * Convenience method combining buildBatch + execute
169
+ *
170
+ * @param operations - Array of typed operations to batch
171
+ * @param gasBudget - Optional gas budget override
172
+ * @returns Transaction result with digest and status
173
+ *
174
+ * @example
175
+ * ```typescript
176
+ * const result = await pdw.tx.executeBatch([
177
+ * { type: 'createMemory', options: { ... } },
178
+ * { type: 'deleteMemory', options: { memoryId: '0x123' } },
179
+ * ]);
180
+ * ```
181
+ */
182
+ async executeBatch(operations: BatchOperation[], gasBudget?: number): Promise<TransactionResult> {
183
+ if (!this.services.tx) {
184
+ throw new Error('Transaction service not configured.');
185
+ }
186
+
187
+ return await this.services.tx.executeBatch(
188
+ operations,
189
+ this.services.config.signer.getSigner(),
190
+ { gasBudget }
191
+ );
192
+ }
193
+
194
+ /**
195
+ * Estimate gas cost for transaction
196
+ *
197
+ * Dry-runs transaction to estimate gas
198
+ *
199
+ * @param tx - Transaction to estimate
200
+ * @returns Estimated gas cost
201
+ */
202
+ async estimateGas(tx: Transaction): Promise<number> {
203
+ if (!this.services.tx) {
204
+ throw new Error('Transaction service not configured.');
205
+ }
206
+
207
+ try {
208
+ // Use Sui client to dry-run
209
+ const dryRun = await this.services.config.sui.client.dryRunTransactionBlock({
210
+ transactionBlock: await tx.build({ client: this.services.config.sui.client })
211
+ });
212
+
213
+ const gasUsed = dryRun.effects.gasUsed;
214
+ const totalGas =
215
+ Number(gasUsed.computationCost) +
216
+ Number(gasUsed.storageCost) -
217
+ Number(gasUsed.storageRebate);
218
+
219
+ return totalGas;
220
+ } catch (error) {
221
+ throw new Error(`Gas estimation failed: ${error instanceof Error ? error.message : String(error)}`);
222
+ }
223
+ }
224
+
225
+ /**
226
+ * Wait for transaction confirmation
227
+ *
228
+ * Waits for transaction to be confirmed on-chain
229
+ *
230
+ * @param digest - Transaction digest
231
+ * @returns Transaction effects
232
+ */
233
+ async waitForConfirmation(digest: string): Promise<TransactionResult> {
234
+ if (!this.services.tx) {
235
+ throw new Error('Transaction service not configured.');
236
+ }
237
+
238
+ try {
239
+ const result = await this.services.config.sui.client.waitForTransaction({
240
+ digest,
241
+ options: {
242
+ showEffects: true,
243
+ showObjectChanges: true,
244
+ showEvents: true
245
+ }
246
+ });
247
+
248
+ return {
249
+ digest: result.digest,
250
+ status: result.effects?.status?.status === 'success' ? 'success' : 'failure',
251
+ effects: result.effects,
252
+ gasUsed: result.effects?.gasUsed?.computationCost
253
+ ? Number(result.effects.gasUsed.computationCost)
254
+ : undefined
255
+ };
256
+ } catch (error) {
257
+ throw new Error(`Wait for confirmation failed: ${error instanceof Error ? error.message : String(error)}`);
258
+ }
259
+ }
260
+ }