@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,628 @@
1
+ /**
2
+ * BlockchainManager - Memory Ownership & Metadata Management
3
+ *
4
+ * Orchestrates blockchain operations for memory records, manages ownership,
5
+ * and provides seamless integration with memory processing pipeline.
6
+ */
7
+
8
+ import { SuiService, MemoryRecord, MemoryIndex, MemoryMetadata, TransactionResult } from './SuiService';
9
+ import { ProcessedMemory } from '../../embedding/types';
10
+
11
+ export interface BlockchainManagerConfig {
12
+ suiConfig?: {
13
+ network?: 'testnet' | 'mainnet' | 'devnet' | 'localnet';
14
+ packageId?: string;
15
+ adminPrivateKey?: string;
16
+ enableBatching?: boolean;
17
+ batchSize?: number;
18
+ batchDelayMs?: number;
19
+ };
20
+ enableOwnershipTracking?: boolean;
21
+ enableMetadataSync?: boolean;
22
+ retryAttempts?: number;
23
+ enableCaching?: boolean;
24
+ }
25
+
26
+ export interface MemoryOwnershipRecord {
27
+ memoryId: string;
28
+ userId: string;
29
+ blockchainRecordId: string;
30
+ vectorId: number;
31
+ blobId: string;
32
+ category: string;
33
+ createdAt: Date;
34
+ transactionDigest: string;
35
+ version: number;
36
+ }
37
+
38
+ export interface IndexOwnershipRecord {
39
+ indexId: string;
40
+ userId: string;
41
+ blockchainRecordId: string;
42
+ indexBlobId: string;
43
+ graphBlobId: string;
44
+ version: number;
45
+ createdAt: Date;
46
+ lastUpdated: Date;
47
+ }
48
+
49
+ export interface BlockchainOperation {
50
+ id: string;
51
+ type: 'create_memory' | 'create_index' | 'update_index';
52
+ userId: string;
53
+ status: 'pending' | 'processing' | 'completed' | 'failed';
54
+ data: any;
55
+ result?: TransactionResult;
56
+ createdAt: Date;
57
+ completedAt?: Date;
58
+ error?: string;
59
+ }
60
+
61
+ export interface OwnershipVerification {
62
+ isOwner: boolean;
63
+ ownerAddress: string;
64
+ recordExists: boolean;
65
+ lastVerified: Date;
66
+ blockchainRecord?: MemoryRecord | MemoryIndex;
67
+ }
68
+
69
+ export interface BlockchainStats {
70
+ totalRecords: number;
71
+ memoryRecords: number;
72
+ indexRecords: number;
73
+ successfulOperations: number;
74
+ failedOperations: number;
75
+ pendingOperations: number;
76
+ averageProcessingTime: number;
77
+ gasEfficiency: {
78
+ averageGasUsed: number;
79
+ totalGasCost: number;
80
+ optimizationSavings: number;
81
+ };
82
+ networkHealth: string;
83
+ }
84
+
85
+ /**
86
+ * Blockchain manager for memory ownership and decentralized metadata
87
+ */
88
+ export class BlockchainManager {
89
+ private suiService: SuiService;
90
+ private ownershipCache = new Map<string, MemoryOwnershipRecord>();
91
+ private indexCache = new Map<string, IndexOwnershipRecord>();
92
+ private operations = new Map<string, BlockchainOperation>();
93
+ private verificationCache = new Map<string, OwnershipVerification>();
94
+
95
+ private readonly config: Required<BlockchainManagerConfig>;
96
+ private stats = {
97
+ totalRecords: 0,
98
+ memoryRecords: 0,
99
+ indexRecords: 0,
100
+ successfulOperations: 0,
101
+ failedOperations: 0,
102
+ pendingOperations: 0,
103
+ averageProcessingTime: 0,
104
+ totalProcessingTime: 0
105
+ };
106
+
107
+ constructor(config: BlockchainManagerConfig = {}) {
108
+ this.config = {
109
+ suiConfig: {
110
+ network: config.suiConfig?.network || 'testnet',
111
+ packageId: config.suiConfig?.packageId,
112
+ adminPrivateKey: config.suiConfig?.adminPrivateKey,
113
+ enableBatching: config.suiConfig?.enableBatching !== false,
114
+ batchSize: config.suiConfig?.batchSize || 10,
115
+ batchDelayMs: config.suiConfig?.batchDelayMs || 5000
116
+ },
117
+ enableOwnershipTracking: config.enableOwnershipTracking !== false,
118
+ enableMetadataSync: config.enableMetadataSync !== false,
119
+ retryAttempts: config.retryAttempts || 3,
120
+ enableCaching: config.enableCaching !== false
121
+ };
122
+
123
+ // Initialize Sui service
124
+ this.suiService = new SuiService(this.config.suiConfig);
125
+ }
126
+
127
+ // ==================== MEMORY RECORD OPERATIONS ====================
128
+
129
+ /**
130
+ * Create blockchain record for processed memory
131
+ */
132
+ async createMemoryRecord(
133
+ memory: ProcessedMemory,
134
+ userId: string,
135
+ options: {
136
+ priority?: 'low' | 'normal' | 'high';
137
+ enableBatching?: boolean;
138
+ customMetadata?: Record<string, string>;
139
+ } = {}
140
+ ): Promise<MemoryOwnershipRecord> {
141
+ const operationId = this.generateOperationId();
142
+
143
+ try {
144
+ // Create operation record
145
+ const operation: BlockchainOperation = {
146
+ id: operationId,
147
+ type: 'create_memory',
148
+ userId,
149
+ status: 'pending',
150
+ data: { memory, options },
151
+ createdAt: new Date()
152
+ };
153
+
154
+ this.operations.set(operationId, operation);
155
+ this.stats.pendingOperations++;
156
+
157
+ // Prepare metadata for blockchain
158
+ const blockchainMetadata = this.convertToBlockchainMetadata(memory, options.customMetadata);
159
+
160
+ // Create blockchain record
161
+ operation.status = 'processing';
162
+ const startTime = Date.now();
163
+
164
+ const result = await this.suiService.createMemoryRecord(
165
+ userId,
166
+ memory.category || 'general',
167
+ memory.vectorId || 0,
168
+ memory.blobId || '',
169
+ blockchainMetadata,
170
+ {
171
+ enableBatching: options.enableBatching,
172
+ priority: this.mapPriority(options.priority)
173
+ }
174
+ );
175
+
176
+ const processingTime = Date.now() - startTime;
177
+
178
+ if (result.success) {
179
+ operation.status = 'completed';
180
+ operation.result = result;
181
+ operation.completedAt = new Date();
182
+
183
+ // Create ownership record
184
+ const ownershipRecord: MemoryOwnershipRecord = {
185
+ memoryId: memory.id,
186
+ userId,
187
+ blockchainRecordId: result.objectId || '',
188
+ vectorId: memory.vectorId || 0,
189
+ blobId: memory.blobId || '',
190
+ category: memory.category || 'general',
191
+ createdAt: new Date(),
192
+ transactionDigest: result.digest,
193
+ version: 1
194
+ };
195
+
196
+ // Cache the record
197
+ if (this.config.enableCaching) {
198
+ this.ownershipCache.set(memory.id, ownershipRecord);
199
+ }
200
+
201
+ // Update statistics
202
+ this.stats.successfulOperations++;
203
+ this.stats.memoryRecords++;
204
+ this.stats.totalRecords++;
205
+ this.updateProcessingTimeStats(processingTime);
206
+
207
+ return ownershipRecord;
208
+
209
+ } else {
210
+ operation.status = 'failed';
211
+ operation.error = result.error;
212
+ this.stats.failedOperations++;
213
+
214
+ throw new Error(`Blockchain record creation failed: ${result.error}`);
215
+ }
216
+
217
+ } catch (error) {
218
+ const operation = this.operations.get(operationId);
219
+ if (operation) {
220
+ operation.status = 'failed';
221
+ operation.error = error instanceof Error ? error.message : String(error);
222
+ }
223
+
224
+ this.stats.failedOperations++;
225
+ this.stats.pendingOperations = Math.max(0, this.stats.pendingOperations - 1);
226
+
227
+ throw new Error(`Failed to create memory record: ${error instanceof Error ? error.message : String(error)}`);
228
+ } finally {
229
+ this.stats.pendingOperations = Math.max(0, this.stats.pendingOperations - 1);
230
+ }
231
+ }
232
+
233
+ /**
234
+ * Create or update memory index on blockchain
235
+ */
236
+ async createOrUpdateMemoryIndex(
237
+ userId: string,
238
+ indexBlobId: string,
239
+ graphBlobId: string,
240
+ existingIndexId?: string,
241
+ options: {
242
+ priority?: 'low' | 'normal' | 'high';
243
+ enableBatching?: boolean;
244
+ expectedVersion?: number;
245
+ } = {}
246
+ ): Promise<IndexOwnershipRecord> {
247
+ const operationId = this.generateOperationId();
248
+
249
+ try {
250
+ const operation: BlockchainOperation = {
251
+ id: operationId,
252
+ type: existingIndexId ? 'update_index' : 'create_index',
253
+ userId,
254
+ status: 'pending',
255
+ data: { indexBlobId, graphBlobId, existingIndexId, options },
256
+ createdAt: new Date()
257
+ };
258
+
259
+ this.operations.set(operationId, operation);
260
+ this.stats.pendingOperations++;
261
+
262
+ operation.status = 'processing';
263
+ const startTime = Date.now();
264
+
265
+ let result: TransactionResult;
266
+
267
+ if (existingIndexId && options.expectedVersion !== undefined) {
268
+ // Update existing index
269
+ result = await this.suiService.updateMemoryIndex(
270
+ existingIndexId,
271
+ userId,
272
+ options.expectedVersion,
273
+ indexBlobId,
274
+ graphBlobId,
275
+ {
276
+ enableBatching: options.enableBatching,
277
+ priority: this.mapPriority(options.priority)
278
+ }
279
+ );
280
+ } else {
281
+ // Create new index
282
+ result = await this.suiService.createMemoryIndex(
283
+ userId,
284
+ indexBlobId,
285
+ graphBlobId,
286
+ {
287
+ enableBatching: options.enableBatching,
288
+ priority: this.mapPriority(options.priority)
289
+ }
290
+ );
291
+ }
292
+
293
+ const processingTime = Date.now() - startTime;
294
+
295
+ if (result.success) {
296
+ operation.status = 'completed';
297
+ operation.result = result;
298
+ operation.completedAt = new Date();
299
+
300
+ // Create or update index record
301
+ const indexRecord: IndexOwnershipRecord = {
302
+ indexId: `index_${userId}_${Date.now()}`,
303
+ userId,
304
+ blockchainRecordId: result.objectId || existingIndexId || '',
305
+ indexBlobId,
306
+ graphBlobId,
307
+ version: existingIndexId ? (options.expectedVersion || 1) + 1 : 1,
308
+ createdAt: existingIndexId ? (this.indexCache.get(existingIndexId)?.createdAt || new Date()) : new Date(),
309
+ lastUpdated: new Date()
310
+ };
311
+
312
+ // Cache the record
313
+ if (this.config.enableCaching) {
314
+ this.indexCache.set(indexRecord.indexId, indexRecord);
315
+ }
316
+
317
+ // Update statistics
318
+ this.stats.successfulOperations++;
319
+ if (!existingIndexId) {
320
+ this.stats.indexRecords++;
321
+ this.stats.totalRecords++;
322
+ }
323
+ this.updateProcessingTimeStats(processingTime);
324
+
325
+ return indexRecord;
326
+
327
+ } else {
328
+ operation.status = 'failed';
329
+ operation.error = result.error;
330
+ this.stats.failedOperations++;
331
+
332
+ throw new Error(`Index operation failed: ${result.error}`);
333
+ }
334
+
335
+ } catch (error) {
336
+ const operation = this.operations.get(operationId);
337
+ if (operation) {
338
+ operation.status = 'failed';
339
+ operation.error = error instanceof Error ? error.message : String(error);
340
+ }
341
+
342
+ this.stats.failedOperations++;
343
+ this.stats.pendingOperations = Math.max(0, this.stats.pendingOperations - 1);
344
+
345
+ throw new Error(`Failed to create/update index: ${error instanceof Error ? error.message : String(error)}`);
346
+ } finally {
347
+ this.stats.pendingOperations = Math.max(0, this.stats.pendingOperations - 1);
348
+ }
349
+ }
350
+
351
+ // ==================== OWNERSHIP VERIFICATION ====================
352
+
353
+ /**
354
+ * Verify memory ownership
355
+ */
356
+ async verifyOwnership(
357
+ memoryId: string,
358
+ userId: string,
359
+ options: {
360
+ useCache?: boolean;
361
+ forceRefresh?: boolean;
362
+ } = {}
363
+ ): Promise<OwnershipVerification> {
364
+ const cacheKey = `${memoryId}_${userId}`;
365
+
366
+ // Check cache first
367
+ if (options.useCache && !options.forceRefresh) {
368
+ const cached = this.verificationCache.get(cacheKey);
369
+ if (cached && this.isCacheValid(cached.lastVerified)) {
370
+ return cached;
371
+ }
372
+ }
373
+
374
+ try {
375
+ // Get ownership record
376
+ const ownershipRecord = this.ownershipCache.get(memoryId);
377
+
378
+ if (!ownershipRecord) {
379
+ // Try to get from blockchain
380
+ const userRecords = await this.suiService.getUserMemoryRecords(userId);
381
+ const blockchainRecord = userRecords.find(r => r.id === memoryId);
382
+
383
+ const verification: OwnershipVerification = {
384
+ isOwner: blockchainRecord ? blockchainRecord.owner === userId : false,
385
+ ownerAddress: blockchainRecord?.owner || '',
386
+ recordExists: !!blockchainRecord,
387
+ lastVerified: new Date(),
388
+ blockchainRecord
389
+ };
390
+
391
+ // Cache the result
392
+ this.verificationCache.set(cacheKey, verification);
393
+ return verification;
394
+ }
395
+
396
+ // Verify ownership record
397
+ const verification: OwnershipVerification = {
398
+ isOwner: ownershipRecord.userId === userId,
399
+ ownerAddress: ownershipRecord.userId,
400
+ recordExists: true,
401
+ lastVerified: new Date()
402
+ };
403
+
404
+ // Cache the result
405
+ this.verificationCache.set(cacheKey, verification);
406
+ return verification;
407
+
408
+ } catch (error) {
409
+ console.error('Ownership verification failed:', error);
410
+
411
+ return {
412
+ isOwner: false,
413
+ ownerAddress: '',
414
+ recordExists: false,
415
+ lastVerified: new Date()
416
+ };
417
+ }
418
+ }
419
+
420
+ /**
421
+ * Get user's memory ownership records
422
+ */
423
+ async getUserOwnershipRecords(userId: string): Promise<{
424
+ memoryRecords: MemoryOwnershipRecord[];
425
+ indexRecords: IndexOwnershipRecord[];
426
+ }> {
427
+ try {
428
+ // Get from cache
429
+ const memoryRecords = Array.from(this.ownershipCache.values())
430
+ .filter(record => record.userId === userId);
431
+
432
+ const indexRecords = Array.from(this.indexCache.values())
433
+ .filter(record => record.userId === userId);
434
+
435
+ // Get from blockchain if cache is empty or incomplete
436
+ if (memoryRecords.length === 0) {
437
+ const blockchainRecords = await this.suiService.getUserMemoryRecords(userId);
438
+
439
+ for (const bcRecord of blockchainRecords) {
440
+ const ownershipRecord: MemoryOwnershipRecord = {
441
+ memoryId: bcRecord.id,
442
+ userId: bcRecord.owner,
443
+ blockchainRecordId: bcRecord.id,
444
+ vectorId: bcRecord.vectorId,
445
+ blobId: bcRecord.blobId,
446
+ category: bcRecord.category,
447
+ createdAt: bcRecord.createdAt,
448
+ transactionDigest: '', // Not available from query
449
+ version: bcRecord.version
450
+ };
451
+
452
+ memoryRecords.push(ownershipRecord);
453
+
454
+ if (this.config.enableCaching) {
455
+ this.ownershipCache.set(bcRecord.id, ownershipRecord);
456
+ }
457
+ }
458
+ }
459
+
460
+ return { memoryRecords, indexRecords };
461
+
462
+ } catch (error) {
463
+ console.error('Failed to get user ownership records:', error);
464
+ return { memoryRecords: [], indexRecords: [] };
465
+ }
466
+ }
467
+
468
+ // ==================== BATCH OPERATIONS ====================
469
+
470
+ /**
471
+ * Process multiple memory records in batch
472
+ */
473
+ async createMemoryRecordsBatch(
474
+ memories: Array<{
475
+ memory: ProcessedMemory;
476
+ userId: string;
477
+ customMetadata?: Record<string, string>;
478
+ }>,
479
+ options: {
480
+ batchSize?: number;
481
+ onProgress?: (completed: number, total: number) => void;
482
+ } = {}
483
+ ): Promise<Array<MemoryOwnershipRecord | { error: string; memoryId: string }>> {
484
+ const batchSize = options.batchSize || 5;
485
+ const results: Array<MemoryOwnershipRecord | { error: string; memoryId: string }> = [];
486
+
487
+ // Process in batches
488
+ for (let i = 0; i < memories.length; i += batchSize) {
489
+ const batch = memories.slice(i, i + batchSize);
490
+
491
+ const batchPromises = batch.map(async ({ memory, userId, customMetadata }) => {
492
+ try {
493
+ return await this.createMemoryRecord(memory, userId, {
494
+ enableBatching: true,
495
+ customMetadata
496
+ });
497
+ } catch (error) {
498
+ return { error: error instanceof Error ? error.message : String(error), memoryId: memory.id };
499
+ }
500
+ });
501
+
502
+ const batchResults = await Promise.all(batchPromises);
503
+ results.push(...batchResults);
504
+
505
+ // Progress callback
506
+ if (options.onProgress) {
507
+ options.onProgress(i + batch.length, memories.length);
508
+ }
509
+ }
510
+
511
+ return results;
512
+ }
513
+
514
+ /**
515
+ * Flush pending blockchain operations
516
+ */
517
+ async flushPendingOperations(): Promise<TransactionResult[]> {
518
+ return await this.suiService.flushBatchQueue();
519
+ }
520
+
521
+ // ==================== ANALYTICS & MONITORING ====================
522
+
523
+ /**
524
+ * Get comprehensive blockchain statistics
525
+ */
526
+ getBlockchainStats(): BlockchainStats {
527
+ const suiStats = this.suiService.getStats();
528
+
529
+ return {
530
+ totalRecords: this.stats.totalRecords,
531
+ memoryRecords: this.stats.memoryRecords,
532
+ indexRecords: this.stats.indexRecords,
533
+ successfulOperations: this.stats.successfulOperations,
534
+ failedOperations: this.stats.failedOperations,
535
+ pendingOperations: this.stats.pendingOperations,
536
+ averageProcessingTime: this.stats.averageProcessingTime,
537
+ gasEfficiency: {
538
+ averageGasUsed: suiStats.averageGasUsed,
539
+ totalGasCost: suiStats.totalGasCost,
540
+ optimizationSavings: suiStats.batchedTransactions * 100 // Estimated savings
541
+ },
542
+ networkHealth: suiStats.networkHealth
543
+ };
544
+ }
545
+
546
+ /**
547
+ * Get operation status
548
+ */
549
+ getOperationStatus(operationId: string): BlockchainOperation | null {
550
+ return this.operations.get(operationId) || null;
551
+ }
552
+
553
+ /**
554
+ * Get pending operations
555
+ */
556
+ getPendingOperations(): BlockchainOperation[] {
557
+ return Array.from(this.operations.values())
558
+ .filter(op => op.status === 'pending' || op.status === 'processing');
559
+ }
560
+
561
+ /**
562
+ * Clear caches and reset
563
+ */
564
+ clearCaches(): void {
565
+ this.ownershipCache.clear();
566
+ this.indexCache.clear();
567
+ this.verificationCache.clear();
568
+ this.operations.clear();
569
+ }
570
+
571
+ // ==================== PRIVATE METHODS ====================
572
+
573
+ private convertToBlockchainMetadata(
574
+ memory: ProcessedMemory,
575
+ customMetadata?: Record<string, string>
576
+ ): MemoryMetadata {
577
+ return {
578
+ contentType: 'text/plain',
579
+ contentSize: memory.content ? memory.content.length : 0,
580
+ contentHash: this.generateContentHash(memory.content),
581
+ category: memory.category || 'general',
582
+ topic: memory.metadata?.topic || `Memory about ${memory.category || 'general'}`,
583
+ importance: memory.metadata?.importance || 5,
584
+ embeddingBlobId: memory.blobId || '',
585
+ embeddingDimension: memory.embedding ? memory.embedding.length : 3072,
586
+ createdTimestamp: memory.createdAt?.getTime() || Date.now(),
587
+ updatedTimestamp: memory.processedAt?.getTime() || memory.createdAt?.getTime() || Date.now(),
588
+ customMetadata: {
589
+ memoryId: memory.id,
590
+ embeddingModel: memory.embeddingModel || 'gemini',
591
+ ...customMetadata
592
+ }
593
+ };
594
+ }
595
+
596
+ private mapPriority(priority?: 'low' | 'normal' | 'high'): number {
597
+ const priorityMap = { low: 1, normal: 2, high: 3 };
598
+ return priorityMap[priority || 'normal'];
599
+ }
600
+
601
+ private generateContentHash(content: string): string {
602
+ // Simple hash - replace with proper hashing in production
603
+ let hash = 0;
604
+ for (let i = 0; i < content.length; i++) {
605
+ const char = content.charCodeAt(i);
606
+ hash = ((hash << 5) - hash) + char;
607
+ hash = hash & hash; // Convert to 32bit integer
608
+ }
609
+ return hash.toString(16);
610
+ }
611
+
612
+ private generateOperationId(): string {
613
+ return `op_${Date.now()}_${Math.random().toString(36).substring(2, 15)}`;
614
+ }
615
+
616
+ private updateProcessingTimeStats(processingTime: number): void {
617
+ this.stats.totalProcessingTime += processingTime;
618
+ this.stats.averageProcessingTime =
619
+ this.stats.totalProcessingTime / this.stats.successfulOperations;
620
+ }
621
+
622
+ private isCacheValid(timestamp: Date): boolean {
623
+ const CACHE_TTL_MS = 10 * 60 * 1000; // 10 minutes
624
+ return Date.now() - timestamp.getTime() < CACHE_TTL_MS;
625
+ }
626
+ }
627
+
628
+ export default BlockchainManager;