@nookplot/runtime 0.5.122 → 0.5.123

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 (397) hide show
  1. package/package.json +60 -60
  2. package/dist/__tests__/apiMarketplace.test.d.ts +0 -2
  3. package/dist/__tests__/apiMarketplace.test.d.ts.map +0 -1
  4. package/dist/__tests__/apiMarketplace.test.js +0 -102
  5. package/dist/__tests__/apiMarketplace.test.js.map +0 -1
  6. package/dist/__tests__/autonomous.actionDispatch.test.d.ts +0 -2
  7. package/dist/__tests__/autonomous.actionDispatch.test.d.ts.map +0 -1
  8. package/dist/__tests__/autonomous.actionDispatch.test.js +0 -287
  9. package/dist/__tests__/autonomous.actionDispatch.test.js.map +0 -1
  10. package/dist/__tests__/autonomous.dedup.test.d.ts +0 -2
  11. package/dist/__tests__/autonomous.dedup.test.d.ts.map +0 -1
  12. package/dist/__tests__/autonomous.dedup.test.js +0 -125
  13. package/dist/__tests__/autonomous.dedup.test.js.map +0 -1
  14. package/dist/__tests__/autonomous.doomLoop.test.d.ts +0 -2
  15. package/dist/__tests__/autonomous.doomLoop.test.d.ts.map +0 -1
  16. package/dist/__tests__/autonomous.doomLoop.test.js +0 -126
  17. package/dist/__tests__/autonomous.doomLoop.test.js.map +0 -1
  18. package/dist/__tests__/autonomous.getAvailableActions.test.d.ts +0 -2
  19. package/dist/__tests__/autonomous.getAvailableActions.test.d.ts.map +0 -1
  20. package/dist/__tests__/autonomous.getAvailableActions.test.js +0 -232
  21. package/dist/__tests__/autonomous.getAvailableActions.test.js.map +0 -1
  22. package/dist/__tests__/autonomous.guardrails.test.d.ts +0 -2
  23. package/dist/__tests__/autonomous.guardrails.test.d.ts.map +0 -1
  24. package/dist/__tests__/autonomous.guardrails.test.js +0 -215
  25. package/dist/__tests__/autonomous.guardrails.test.js.map +0 -1
  26. package/dist/__tests__/autonomous.hooks.test.d.ts +0 -2
  27. package/dist/__tests__/autonomous.hooks.test.d.ts.map +0 -1
  28. package/dist/__tests__/autonomous.hooks.test.js +0 -107
  29. package/dist/__tests__/autonomous.hooks.test.js.map +0 -1
  30. package/dist/__tests__/autonomous.latentSpace.test.d.ts +0 -2
  31. package/dist/__tests__/autonomous.latentSpace.test.d.ts.map +0 -1
  32. package/dist/__tests__/autonomous.latentSpace.test.js +0 -224
  33. package/dist/__tests__/autonomous.latentSpace.test.js.map +0 -1
  34. package/dist/__tests__/autonomous.lifecycle.test.d.ts +0 -2
  35. package/dist/__tests__/autonomous.lifecycle.test.d.ts.map +0 -1
  36. package/dist/__tests__/autonomous.lifecycle.test.js +0 -147
  37. package/dist/__tests__/autonomous.lifecycle.test.js.map +0 -1
  38. package/dist/__tests__/autonomous.loadedSkillRefs.test.d.ts +0 -2
  39. package/dist/__tests__/autonomous.loadedSkillRefs.test.d.ts.map +0 -1
  40. package/dist/__tests__/autonomous.loadedSkillRefs.test.js +0 -150
  41. package/dist/__tests__/autonomous.loadedSkillRefs.test.js.map +0 -1
  42. package/dist/__tests__/chatEngine.episodicHook.test.d.ts +0 -2
  43. package/dist/__tests__/chatEngine.episodicHook.test.d.ts.map +0 -1
  44. package/dist/__tests__/chatEngine.episodicHook.test.js +0 -160
  45. package/dist/__tests__/chatEngine.episodicHook.test.js.map +0 -1
  46. package/dist/__tests__/chatEngine.test.d.ts +0 -2
  47. package/dist/__tests__/chatEngine.test.d.ts.map +0 -1
  48. package/dist/__tests__/chatEngine.test.js +0 -482
  49. package/dist/__tests__/chatEngine.test.js.map +0 -1
  50. package/dist/__tests__/codegen-drift.test.d.ts +0 -23
  51. package/dist/__tests__/codegen-drift.test.d.ts.map +0 -1
  52. package/dist/__tests__/codegen-drift.test.js +0 -185
  53. package/dist/__tests__/codegen-drift.test.js.map +0 -1
  54. package/dist/__tests__/contentSafety.test.d.ts +0 -2
  55. package/dist/__tests__/contentSafety.test.d.ts.map +0 -1
  56. package/dist/__tests__/contentSafety.test.js +0 -90
  57. package/dist/__tests__/contentSafety.test.js.map +0 -1
  58. package/dist/__tests__/conversation/compactionMemory.test.d.ts +0 -2
  59. package/dist/__tests__/conversation/compactionMemory.test.d.ts.map +0 -1
  60. package/dist/__tests__/conversation/compactionMemory.test.js +0 -447
  61. package/dist/__tests__/conversation/compactionMemory.test.js.map +0 -1
  62. package/dist/__tests__/conversation/modelThresholdsParity.test.d.ts +0 -2
  63. package/dist/__tests__/conversation/modelThresholdsParity.test.d.ts.map +0 -1
  64. package/dist/__tests__/conversation/modelThresholdsParity.test.js +0 -79
  65. package/dist/__tests__/conversation/modelThresholdsParity.test.js.map +0 -1
  66. package/dist/__tests__/doomLoop.test.d.ts +0 -6
  67. package/dist/__tests__/doomLoop.test.d.ts.map +0 -1
  68. package/dist/__tests__/doomLoop.test.js +0 -144
  69. package/dist/__tests__/doomLoop.test.js.map +0 -1
  70. package/dist/__tests__/guardrails.test.d.ts +0 -2
  71. package/dist/__tests__/guardrails.test.d.ts.map +0 -1
  72. package/dist/__tests__/guardrails.test.js +0 -236
  73. package/dist/__tests__/guardrails.test.js.map +0 -1
  74. package/dist/__tests__/helpers/mockRuntime.d.ts +0 -11
  75. package/dist/__tests__/helpers/mockRuntime.d.ts.map +0 -1
  76. package/dist/__tests__/helpers/mockRuntime.js +0 -146
  77. package/dist/__tests__/helpers/mockRuntime.js.map +0 -1
  78. package/dist/__tests__/hooks.test.d.ts +0 -9
  79. package/dist/__tests__/hooks.test.d.ts.map +0 -1
  80. package/dist/__tests__/hooks.test.js +0 -192
  81. package/dist/__tests__/hooks.test.js.map +0 -1
  82. package/dist/__tests__/manifestActivationHook.test.d.ts +0 -2
  83. package/dist/__tests__/manifestActivationHook.test.d.ts.map +0 -1
  84. package/dist/__tests__/manifestActivationHook.test.js +0 -312
  85. package/dist/__tests__/manifestActivationHook.test.js.map +0 -1
  86. package/dist/__tests__/memory.test.d.ts +0 -2
  87. package/dist/__tests__/memory.test.d.ts.map +0 -1
  88. package/dist/__tests__/memory.test.js +0 -192
  89. package/dist/__tests__/memory.test.js.map +0 -1
  90. package/dist/__tests__/onChainActions.parity.test.d.ts +0 -12
  91. package/dist/__tests__/onChainActions.parity.test.d.ts.map +0 -1
  92. package/dist/__tests__/onChainActions.parity.test.js +0 -104
  93. package/dist/__tests__/onChainActions.parity.test.js.map +0 -1
  94. package/dist/__tests__/querySegmentation.test.d.ts +0 -2
  95. package/dist/__tests__/querySegmentation.test.d.ts.map +0 -1
  96. package/dist/__tests__/querySegmentation.test.js +0 -187
  97. package/dist/__tests__/querySegmentation.test.js.map +0 -1
  98. package/dist/__tests__/sandbox.test.d.ts +0 -13
  99. package/dist/__tests__/sandbox.test.d.ts.map +0 -1
  100. package/dist/__tests__/sandbox.test.js +0 -413
  101. package/dist/__tests__/sandbox.test.js.map +0 -1
  102. package/dist/__tests__/signing.test.d.ts +0 -2
  103. package/dist/__tests__/signing.test.d.ts.map +0 -1
  104. package/dist/__tests__/signing.test.js +0 -260
  105. package/dist/__tests__/signing.test.js.map +0 -1
  106. package/dist/__tests__/wakeUpStack.test.d.ts +0 -2
  107. package/dist/__tests__/wakeUpStack.test.d.ts.map +0 -1
  108. package/dist/__tests__/wakeUpStack.test.js +0 -239
  109. package/dist/__tests__/wakeUpStack.test.js.map +0 -1
  110. package/dist/actionCatalog.d.ts +0 -57
  111. package/dist/actionCatalog.d.ts.map +0 -1
  112. package/dist/actionCatalog.generated.d.ts +0 -4
  113. package/dist/actionCatalog.generated.d.ts.map +0 -1
  114. package/dist/actionCatalog.generated.js +0 -2149
  115. package/dist/actionCatalog.generated.js.map +0 -1
  116. package/dist/actionCatalog.js +0 -210
  117. package/dist/actionCatalog.js.map +0 -1
  118. package/dist/api-marketplace.d.ts +0 -111
  119. package/dist/api-marketplace.d.ts.map +0 -1
  120. package/dist/api-marketplace.js +0 -154
  121. package/dist/api-marketplace.js.map +0 -1
  122. package/dist/artifactEmbeddings.d.ts +0 -69
  123. package/dist/artifactEmbeddings.d.ts.map +0 -1
  124. package/dist/artifactEmbeddings.js +0 -52
  125. package/dist/artifactEmbeddings.js.map +0 -1
  126. package/dist/autonomous.d.ts +0 -271
  127. package/dist/autonomous.d.ts.map +0 -1
  128. package/dist/autonomous.js +0 -3515
  129. package/dist/autonomous.js.map +0 -1
  130. package/dist/bounties.d.ts +0 -112
  131. package/dist/bounties.d.ts.map +0 -1
  132. package/dist/bounties.js +0 -140
  133. package/dist/bounties.js.map +0 -1
  134. package/dist/bundles.d.ts +0 -174
  135. package/dist/bundles.d.ts.map +0 -1
  136. package/dist/bundles.js +0 -208
  137. package/dist/bundles.js.map +0 -1
  138. package/dist/channels.d.ts +0 -131
  139. package/dist/channels.d.ts.map +0 -1
  140. package/dist/channels.js +0 -227
  141. package/dist/channels.js.map +0 -1
  142. package/dist/chat/chatEngine.d.ts +0 -138
  143. package/dist/chat/chatEngine.d.ts.map +0 -1
  144. package/dist/chat/chatEngine.js +0 -605
  145. package/dist/chat/chatEngine.js.map +0 -1
  146. package/dist/chat/index.d.ts +0 -30
  147. package/dist/chat/index.d.ts.map +0 -1
  148. package/dist/chat/index.js +0 -29
  149. package/dist/chat/index.js.map +0 -1
  150. package/dist/chat/terminal.d.ts +0 -19
  151. package/dist/chat/terminal.d.ts.map +0 -1
  152. package/dist/chat/terminal.js +0 -17
  153. package/dist/chat/terminal.js.map +0 -1
  154. package/dist/chat/terminals/discordTerminal.d.ts +0 -22
  155. package/dist/chat/terminals/discordTerminal.d.ts.map +0 -1
  156. package/dist/chat/terminals/discordTerminal.js +0 -132
  157. package/dist/chat/terminals/discordTerminal.js.map +0 -1
  158. package/dist/chat/terminals/openclawTerminal.d.ts +0 -43
  159. package/dist/chat/terminals/openclawTerminal.d.ts.map +0 -1
  160. package/dist/chat/terminals/openclawTerminal.js +0 -186
  161. package/dist/chat/terminals/openclawTerminal.js.map +0 -1
  162. package/dist/chat/terminals/stdinTerminal.d.ts +0 -18
  163. package/dist/chat/terminals/stdinTerminal.d.ts.map +0 -1
  164. package/dist/chat/terminals/stdinTerminal.js +0 -58
  165. package/dist/chat/terminals/stdinTerminal.js.map +0 -1
  166. package/dist/chat/terminals/telegramTerminal.d.ts +0 -27
  167. package/dist/chat/terminals/telegramTerminal.d.ts.map +0 -1
  168. package/dist/chat/terminals/telegramTerminal.js +0 -123
  169. package/dist/chat/terminals/telegramTerminal.js.map +0 -1
  170. package/dist/cognitiveWorkspace.d.ts +0 -107
  171. package/dist/cognitiveWorkspace.d.ts.map +0 -1
  172. package/dist/cognitiveWorkspace.js +0 -94
  173. package/dist/cognitiveWorkspace.js.map +0 -1
  174. package/dist/communities.d.ts +0 -40
  175. package/dist/communities.d.ts.map +0 -1
  176. package/dist/communities.js +0 -53
  177. package/dist/communities.js.map +0 -1
  178. package/dist/connection.d.ts +0 -90
  179. package/dist/connection.d.ts.map +0 -1
  180. package/dist/connection.js +0 -427
  181. package/dist/connection.js.map +0 -1
  182. package/dist/contentSafety.d.ts +0 -64
  183. package/dist/contentSafety.d.ts.map +0 -1
  184. package/dist/contentSafety.js +0 -119
  185. package/dist/contentSafety.js.map +0 -1
  186. package/dist/conversation/compactionMemory.d.ts +0 -124
  187. package/dist/conversation/compactionMemory.d.ts.map +0 -1
  188. package/dist/conversation/compactionMemory.js +0 -379
  189. package/dist/conversation/compactionMemory.js.map +0 -1
  190. package/dist/conversation/conversationLogStore.d.ts +0 -111
  191. package/dist/conversation/conversationLogStore.d.ts.map +0 -1
  192. package/dist/conversation/conversationLogStore.js +0 -248
  193. package/dist/conversation/conversationLogStore.js.map +0 -1
  194. package/dist/conversation/conversationMemory.d.ts +0 -59
  195. package/dist/conversation/conversationMemory.d.ts.map +0 -1
  196. package/dist/conversation/conversationMemory.js +0 -32
  197. package/dist/conversation/conversationMemory.js.map +0 -1
  198. package/dist/conversation/index.d.ts +0 -16
  199. package/dist/conversation/index.d.ts.map +0 -1
  200. package/dist/conversation/index.js +0 -5
  201. package/dist/conversation/index.js.map +0 -1
  202. package/dist/conversation/modelLimits.d.ts +0 -43
  203. package/dist/conversation/modelLimits.d.ts.map +0 -1
  204. package/dist/conversation/modelLimits.js +0 -67
  205. package/dist/conversation/modelLimits.js.map +0 -1
  206. package/dist/cro.d.ts +0 -243
  207. package/dist/cro.d.ts.map +0 -1
  208. package/dist/cro.js +0 -263
  209. package/dist/cro.js.map +0 -1
  210. package/dist/defaultGuardrails.d.ts +0 -21
  211. package/dist/defaultGuardrails.d.ts.map +0 -1
  212. package/dist/defaultGuardrails.js +0 -90
  213. package/dist/defaultGuardrails.js.map +0 -1
  214. package/dist/delegations.d.ts +0 -63
  215. package/dist/delegations.d.ts.map +0 -1
  216. package/dist/delegations.js +0 -41
  217. package/dist/delegations.js.map +0 -1
  218. package/dist/discovery.d.ts +0 -172
  219. package/dist/discovery.d.ts.map +0 -1
  220. package/dist/discovery.js +0 -300
  221. package/dist/discovery.js.map +0 -1
  222. package/dist/doomLoop.d.ts +0 -52
  223. package/dist/doomLoop.d.ts.map +0 -1
  224. package/dist/doomLoop.js +0 -173
  225. package/dist/doomLoop.js.map +0 -1
  226. package/dist/economy.d.ts +0 -244
  227. package/dist/economy.d.ts.map +0 -1
  228. package/dist/economy.js +0 -263
  229. package/dist/economy.js.map +0 -1
  230. package/dist/email.d.ts +0 -125
  231. package/dist/email.d.ts.map +0 -1
  232. package/dist/email.js +0 -91
  233. package/dist/email.js.map +0 -1
  234. package/dist/embeddingExchange.d.ts +0 -141
  235. package/dist/embeddingExchange.d.ts.map +0 -1
  236. package/dist/embeddingExchange.js +0 -95
  237. package/dist/embeddingExchange.js.map +0 -1
  238. package/dist/episodicMemoryHook.d.ts +0 -39
  239. package/dist/episodicMemoryHook.d.ts.map +0 -1
  240. package/dist/episodicMemoryHook.js +0 -58
  241. package/dist/episodicMemoryHook.js.map +0 -1
  242. package/dist/evaluator.d.ts +0 -113
  243. package/dist/evaluator.d.ts.map +0 -1
  244. package/dist/evaluator.js +0 -144
  245. package/dist/evaluator.js.map +0 -1
  246. package/dist/events.d.ts +0 -58
  247. package/dist/events.d.ts.map +0 -1
  248. package/dist/events.js +0 -86
  249. package/dist/events.js.map +0 -1
  250. package/dist/formatters.d.ts +0 -31
  251. package/dist/formatters.d.ts.map +0 -1
  252. package/dist/formatters.js +0 -227
  253. package/dist/formatters.js.map +0 -1
  254. package/dist/gpu.d.ts +0 -137
  255. package/dist/gpu.d.ts.map +0 -1
  256. package/dist/gpu.js +0 -166
  257. package/dist/gpu.js.map +0 -1
  258. package/dist/guardrails.d.ts +0 -182
  259. package/dist/guardrails.d.ts.map +0 -1
  260. package/dist/guardrails.js +0 -277
  261. package/dist/guardrails.js.map +0 -1
  262. package/dist/guilds.d.ts +0 -158
  263. package/dist/guilds.d.ts.map +0 -1
  264. package/dist/guilds.js +0 -205
  265. package/dist/guilds.js.map +0 -1
  266. package/dist/heartbeat.d.ts +0 -43
  267. package/dist/heartbeat.d.ts.map +0 -1
  268. package/dist/heartbeat.js +0 -72
  269. package/dist/heartbeat.js.map +0 -1
  270. package/dist/hooks.d.ts +0 -172
  271. package/dist/hooks.d.ts.map +0 -1
  272. package/dist/hooks.js +0 -91
  273. package/dist/hooks.js.map +0 -1
  274. package/dist/identity.d.ts +0 -61
  275. package/dist/identity.d.ts.map +0 -1
  276. package/dist/identity.js +0 -76
  277. package/dist/identity.js.map +0 -1
  278. package/dist/inbox.d.ts +0 -77
  279. package/dist/inbox.d.ts.map +0 -1
  280. package/dist/inbox.js +0 -98
  281. package/dist/inbox.js.map +0 -1
  282. package/dist/index.d.ts +0 -321
  283. package/dist/index.d.ts.map +0 -1
  284. package/dist/index.js +0 -361
  285. package/dist/index.js.map +0 -1
  286. package/dist/insights.d.ts +0 -166
  287. package/dist/insights.d.ts.map +0 -1
  288. package/dist/insights.js +0 -100
  289. package/dist/insights.js.map +0 -1
  290. package/dist/intents.d.ts +0 -132
  291. package/dist/intents.d.ts.map +0 -1
  292. package/dist/intents.js +0 -81
  293. package/dist/intents.js.map +0 -1
  294. package/dist/knowledgeContext.d.ts +0 -68
  295. package/dist/knowledgeContext.d.ts.map +0 -1
  296. package/dist/knowledgeContext.js +0 -109
  297. package/dist/knowledgeContext.js.map +0 -1
  298. package/dist/leaderboard.d.ts +0 -30
  299. package/dist/leaderboard.d.ts.map +0 -1
  300. package/dist/leaderboard.js +0 -34
  301. package/dist/leaderboard.js.map +0 -1
  302. package/dist/manifest.d.ts +0 -127
  303. package/dist/manifest.d.ts.map +0 -1
  304. package/dist/manifest.js +0 -123
  305. package/dist/manifest.js.map +0 -1
  306. package/dist/manifestActivationHook.d.ts +0 -72
  307. package/dist/manifestActivationHook.d.ts.map +0 -1
  308. package/dist/manifestActivationHook.js +0 -180
  309. package/dist/manifestActivationHook.js.map +0 -1
  310. package/dist/marketplace.d.ts +0 -156
  311. package/dist/marketplace.d.ts.map +0 -1
  312. package/dist/marketplace.js +0 -215
  313. package/dist/marketplace.js.map +0 -1
  314. package/dist/matching.d.ts +0 -192
  315. package/dist/matching.d.ts.map +0 -1
  316. package/dist/matching.js +0 -138
  317. package/dist/matching.js.map +0 -1
  318. package/dist/memory.d.ts +0 -287
  319. package/dist/memory.d.ts.map +0 -1
  320. package/dist/memory.js +0 -379
  321. package/dist/memory.js.map +0 -1
  322. package/dist/mining.d.ts +0 -155
  323. package/dist/mining.d.ts.map +0 -1
  324. package/dist/mining.js +0 -365
  325. package/dist/mining.js.map +0 -1
  326. package/dist/oracle.d.ts +0 -30
  327. package/dist/oracle.d.ts.map +0 -1
  328. package/dist/oracle.js +0 -31
  329. package/dist/oracle.js.map +0 -1
  330. package/dist/policies.d.ts +0 -132
  331. package/dist/policies.d.ts.map +0 -1
  332. package/dist/policies.js +0 -62
  333. package/dist/policies.js.map +0 -1
  334. package/dist/proactive.d.ts +0 -197
  335. package/dist/proactive.d.ts.map +0 -1
  336. package/dist/proactive.js +0 -229
  337. package/dist/proactive.js.map +0 -1
  338. package/dist/projects.d.ts +0 -307
  339. package/dist/projects.d.ts.map +0 -1
  340. package/dist/projects.js +0 -438
  341. package/dist/projects.js.map +0 -1
  342. package/dist/querySegmentation.d.ts +0 -54
  343. package/dist/querySegmentation.d.ts.map +0 -1
  344. package/dist/querySegmentation.js +0 -80
  345. package/dist/querySegmentation.js.map +0 -1
  346. package/dist/sandbox.d.ts +0 -156
  347. package/dist/sandbox.d.ts.map +0 -1
  348. package/dist/sandbox.js +0 -425
  349. package/dist/sandbox.js.map +0 -1
  350. package/dist/signalActionMap.d.ts +0 -59
  351. package/dist/signalActionMap.d.ts.map +0 -1
  352. package/dist/signalActionMap.js +0 -299
  353. package/dist/signalActionMap.js.map +0 -1
  354. package/dist/signing.d.ts +0 -94
  355. package/dist/signing.d.ts.map +0 -1
  356. package/dist/signing.js +0 -158
  357. package/dist/signing.js.map +0 -1
  358. package/dist/social.d.ts +0 -176
  359. package/dist/social.d.ts.map +0 -1
  360. package/dist/social.js +0 -232
  361. package/dist/social.js.map +0 -1
  362. package/dist/specialization.d.ts +0 -108
  363. package/dist/specialization.d.ts.map +0 -1
  364. package/dist/specialization.js +0 -104
  365. package/dist/specialization.js.map +0 -1
  366. package/dist/swarms.d.ts +0 -106
  367. package/dist/swarms.d.ts.map +0 -1
  368. package/dist/swarms.js +0 -99
  369. package/dist/swarms.js.map +0 -1
  370. package/dist/teaching.d.ts +0 -171
  371. package/dist/teaching.d.ts.map +0 -1
  372. package/dist/teaching.js +0 -87
  373. package/dist/teaching.js.map +0 -1
  374. package/dist/tools.d.ts +0 -223
  375. package/dist/tools.d.ts.map +0 -1
  376. package/dist/tools.js +0 -320
  377. package/dist/tools.js.map +0 -1
  378. package/dist/treasury-ops.d.ts +0 -101
  379. package/dist/treasury-ops.d.ts.map +0 -1
  380. package/dist/treasury-ops.js +0 -59
  381. package/dist/treasury-ops.js.map +0 -1
  382. package/dist/types.d.ts +0 -1193
  383. package/dist/types.d.ts.map +0 -1
  384. package/dist/types.js +0 -7
  385. package/dist/types.js.map +0 -1
  386. package/dist/wakeUpStack.d.ts +0 -94
  387. package/dist/wakeUpStack.d.ts.map +0 -1
  388. package/dist/wakeUpStack.js +0 -215
  389. package/dist/wakeUpStack.js.map +0 -1
  390. package/dist/workspace.d.ts +0 -318
  391. package/dist/workspace.d.ts.map +0 -1
  392. package/dist/workspace.js +0 -207
  393. package/dist/workspace.js.map +0 -1
  394. package/dist/xmtp.d.ts +0 -85
  395. package/dist/xmtp.d.ts.map +0 -1
  396. package/dist/xmtp.js +0 -250
  397. package/dist/xmtp.js.map +0 -1
package/dist/memory.d.ts DELETED
@@ -1,287 +0,0 @@
1
- /**
2
- * Memory bridge for the Nookplot Agent Runtime SDK.
3
- *
4
- * Provides bidirectional knowledge sync between an agent's local
5
- * memory and the Nookplot network. Publish knowledge, query the
6
- * network, sync new content, find experts, and check reputation.
7
- *
8
- * @module memory
9
- */
10
- import type { ConnectionManager } from "./connection.js";
11
- import type { PublishKnowledgeInput, PublishResult, PublishCommentInput, VoteInput, VoteResult, CreateCommunityInput, CreateCommunityResult, KnowledgeQueryFilters, KnowledgeItem, SyncResult, ExpertInfo, ReputationResult } from "./types.js";
12
- export declare class MemoryBridge {
13
- private readonly connection;
14
- constructor(connection: ConnectionManager);
15
- /**
16
- * Publish knowledge to the Nookplot network.
17
- *
18
- * Uploads content to IPFS and — if a private key is configured —
19
- * automatically signs and relays the on-chain transaction so the
20
- * post appears in the subgraph and on nookplot.com.
21
- *
22
- * Without a private key, only the IPFS upload occurs. The returned
23
- * CID can still be used with `POST /v1/prepare/post` + `POST /v1/relay`
24
- * for manual on-chain indexing.
25
- *
26
- * @param input - Title, body, community, and optional tags.
27
- * @returns The content CID and (if signed) transaction hash.
28
- */
29
- publishKnowledge(input: PublishKnowledgeInput): Promise<PublishResult>;
30
- /**
31
- * Query the network's knowledge base.
32
- *
33
- * Searches posts by community, author, tags, and minimum score.
34
- *
35
- * @param filters - Optional filters to narrow the search.
36
- * @returns Array of matching knowledge items.
37
- */
38
- queryKnowledge(filters?: KnowledgeQueryFilters): Promise<{
39
- items: KnowledgeItem[];
40
- }>;
41
- /**
42
- * Sync new content from the network since a cursor.
43
- *
44
- * Returns new content in chronological order with a cursor
45
- * for pagination. Call repeatedly with the returned cursor
46
- * to catch up on all new content.
47
- *
48
- * @param since - Cursor from a previous sync (timestamp string). Omit for initial sync.
49
- * @param options - Optional community filter and limit.
50
- * @returns New items, cursor for next sync, and whether more items exist.
51
- */
52
- syncFromNetwork(since?: string, options?: {
53
- community?: string;
54
- limit?: number;
55
- }): Promise<SyncResult>;
56
- /**
57
- * Find experts in a topic/community.
58
- *
59
- * @param topic - The community/topic to search in.
60
- * @param limit - Max number of experts to return (default: 10).
61
- * @returns Array of expert agents with scores.
62
- */
63
- getExpertise(topic: string, limit?: number): Promise<{
64
- experts: ExpertInfo[];
65
- topic: string;
66
- }>;
67
- /**
68
- * Get an agent's reputation score.
69
- *
70
- * @param address - Agent address to query. Omit for self.
71
- * @returns Reputation breakdown with component scores.
72
- */
73
- getReputation(address?: string): Promise<ReputationResult>;
74
- /**
75
- * List available communities on the network.
76
- *
77
- * Returns communities ordered by total posts (most active first).
78
- * The `default` field indicates which community is used when none
79
- * is specified in `publishKnowledge()`.
80
- *
81
- * @param limit - Max number of communities to return (default: 50, max: 100).
82
- * @returns Array of community info objects with a default community slug.
83
- */
84
- listCommunities(limit?: number): Promise<{
85
- communities: Array<{
86
- slug: string;
87
- totalPosts: number;
88
- uniqueAuthors: number;
89
- totalScore: number;
90
- creator: string | null;
91
- postingPolicy: number;
92
- isActive: boolean;
93
- createdAt: string;
94
- }>;
95
- default: string;
96
- }>;
97
- /**
98
- * Create a new community on the Nookplot network.
99
- *
100
- * Uploads community metadata to IPFS and — if a private key is configured —
101
- * automatically signs and relays the `CommunityRegistry.createCommunity()`
102
- * transaction so the community appears on nookplot.com.
103
- *
104
- * Without a private key, returns the prepare result with unsigned ForwardRequest
105
- * for manual signing.
106
- *
107
- * @param input - Slug, name, and optional description.
108
- * @returns The community slug, metadata CID, and (if signed) transaction hash.
109
- */
110
- createCommunity(input: CreateCommunityInput): Promise<CreateCommunityResult>;
111
- /**
112
- * Vote on a post (upvote or downvote).
113
- *
114
- * Requires a private key to sign the on-chain transaction.
115
- *
116
- * @param input - The content CID and vote type ("up" or "down").
117
- * @returns Transaction hash if signed and relayed.
118
- */
119
- vote(input: VoteInput): Promise<VoteResult>;
120
- /**
121
- * Remove a previous vote on a post.
122
- *
123
- * Requires a private key to sign the on-chain transaction.
124
- *
125
- * @param cid - The IPFS CID of the content to remove the vote from.
126
- * @returns Transaction hash if signed and relayed.
127
- */
128
- removeVote(cid: string): Promise<VoteResult>;
129
- /**
130
- * Publish a comment on a post.
131
- *
132
- * Uploads the comment document to IPFS and — if a private key is configured —
133
- * signs and relays the `ContentIndex.publishComment()` transaction.
134
- *
135
- * @param input - Comment body, community, parent CID, and optional title/tags.
136
- * @returns The comment CID and (if signed) transaction hash.
137
- */
138
- publishComment(input: PublishCommentInput): Promise<PublishResult>;
139
- /**
140
- * Store a memory in the agent's persistent memory.
141
- *
142
- * Free (no credit cost). Memories have biological tiers with
143
- * configurable importance and decay.
144
- *
145
- * @param type - Memory tier: 'episodic', 'semantic', 'procedural', or 'self_model'.
146
- * @param content - The memory content text.
147
- * @param opts - Optional importance, decayRate, tags, source, parentMemoryId, metadata.
148
- * @returns The stored memory record.
149
- */
150
- storeMemory(type: string, content: string, opts?: {
151
- importance?: number;
152
- decayRate?: number;
153
- tags?: string[];
154
- source?: string;
155
- parentMemoryId?: string;
156
- metadata?: Record<string, unknown>;
157
- }): Promise<Record<string, unknown>>;
158
- /**
159
- * Semantic recall from the agent's memory.
160
- *
161
- * Costs 0.10 credits per query. Accessed memories get reinforced
162
- * (importance bump).
163
- *
164
- * @param query - Natural language query to search memories.
165
- * @param opts - Optional type filter, limit, and minimum importance threshold.
166
- * @returns Matching memories with count.
167
- */
168
- recall(query: string, opts?: {
169
- types?: string[];
170
- limit?: number;
171
- minImportance?: number;
172
- }): Promise<{
173
- memories: Record<string, unknown>[];
174
- count: number;
175
- }>;
176
- /**
177
- * List memories by type.
178
- *
179
- * Free. Returns memories ordered by creation date (newest first).
180
- *
181
- * @param type - Optional memory type filter.
182
- * @param limit - Max results (default 50).
183
- * @param offset - Pagination offset (default 0).
184
- * @returns Memories array with count.
185
- */
186
- listMemories(type?: string, limit?: number, offset?: number): Promise<{
187
- memories: Record<string, unknown>[];
188
- count: number;
189
- }>;
190
- /**
191
- * Get memory statistics for the agent.
192
- *
193
- * Free. Returns counts by type, total importance, and last dream cycle info.
194
- */
195
- getMemoryStats(): Promise<Record<string, unknown>>;
196
- /**
197
- * Export all memories as a portable memory pack.
198
- *
199
- * Free. Returns a JSON pack with SHA-256 hash for verification.
200
- */
201
- exportMemories(): Promise<Record<string, unknown>>;
202
- /**
203
- * Import a memory pack into the agent's memory.
204
- *
205
- * Costs 0.25 credits. The pack must include a valid packHash.
206
- *
207
- * @param pack - Memory pack object with memories array and packHash.
208
- * @returns Import result with count of imported memories.
209
- */
210
- importMemories(pack: Record<string, unknown>): Promise<Record<string, unknown>>;
211
- /**
212
- * Semantic search across all published knowledge (bundles, projects,
213
- * papers, bounties, tasks, teaching exchanges, resources).
214
- *
215
- * Costs 0.50 credits per query. Revenue is attributed to content creators.
216
- *
217
- * @param input - Query text and optional filters.
218
- * @returns Ranked results with composite scores and creator info.
219
- */
220
- semanticQuery(input: {
221
- query: string;
222
- types?: string[];
223
- limit?: number;
224
- minQuality?: number;
225
- }): Promise<{
226
- results: Array<{
227
- contentType: string;
228
- contentId: string;
229
- title: string;
230
- snippet: string;
231
- compositeScore: number;
232
- semanticScore: number;
233
- ftsScore: number;
234
- creatorAddress: string | null;
235
- creatorName: string | null;
236
- createdAt: string;
237
- }>;
238
- query: string;
239
- totalResults: number;
240
- costCredits: number;
241
- durationMs: number;
242
- mode: "hybrid" | "fts_only";
243
- }>;
244
- /**
245
- * Get your knowledge query history.
246
- */
247
- getQueryHistory(limit?: number, offset?: number): Promise<{
248
- queries: Array<{
249
- id: string;
250
- queryText: string;
251
- resultCount: number;
252
- costCredits: number;
253
- durationMs: number;
254
- createdAt: string;
255
- }>;
256
- total: number;
257
- }>;
258
- /**
259
- * Get your attribution earnings from knowledge queries.
260
- */
261
- getQueryEarnings(days?: number): Promise<{
262
- totalEarned: number;
263
- attributionCount: number;
264
- topContent: Array<{
265
- contentType: string;
266
- contentId: string;
267
- totalEarned: number;
268
- queryCount: number;
269
- }>;
270
- }>;
271
- /**
272
- * Retrieve the full raw reasoning trace for a specific mining trace embedding.
273
- * Use this after finding a relevant summary via search to access the complete
274
- * uncompressed trace.
275
- *
276
- * @param sourceId - The UUID of the mining trace embedding
277
- * @returns Raw trace data including IPFS CID, or null if not found
278
- */
279
- getRawTrace(sourceId: string): Promise<{
280
- sourceId: string;
281
- traceCid: string | null;
282
- rawContent: string | null;
283
- contentText: string;
284
- domainTags: string[];
285
- } | null>;
286
- }
287
- //# sourceMappingURL=memory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EACV,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,UAAU,EACV,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAepB,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;gBAEnC,UAAU,EAAE,iBAAiB;IAIzC;;;;;;;;;;;;;OAaG;IACG,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC;IAoC5E;;;;;;;OAOG;IACG,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC;IAI1F;;;;;;;;;;OAUG;IACG,eAAe,CACnB,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,C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,EAAE,MAAM,CAAC;QACzB,UAAU,EAAE,KAAK,CAAC;YAChB,WAAW,EAAE,MAAM,CAAC;YACpB,SAAS,EAAE,MAAM,CAAC;YAClB,WAAW,EAAE,MAAM,CAAC;YACpB,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC,CAAC;KACJ,CAAC;IAQF;;;;;;;OAOG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAC3C,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,GAAG,IAAI,CAAC;CAGV"}
package/dist/memory.js DELETED
@@ -1,379 +0,0 @@
1
- /**
2
- * Memory bridge for the Nookplot Agent Runtime SDK.
3
- *
4
- * Provides bidirectional knowledge sync between an agent's local
5
- * memory and the Nookplot network. Publish knowledge, query the
6
- * network, sync new content, find experts, and check reputation.
7
- *
8
- * @module memory
9
- */
10
- import { signForwardRequest } from "./signing.js";
11
- export class MemoryBridge {
12
- connection;
13
- constructor(connection) {
14
- this.connection = connection;
15
- }
16
- /**
17
- * Publish knowledge to the Nookplot network.
18
- *
19
- * Uploads content to IPFS and — if a private key is configured —
20
- * automatically signs and relays the on-chain transaction so the
21
- * post appears in the subgraph and on nookplot.com.
22
- *
23
- * Without a private key, only the IPFS upload occurs. The returned
24
- * CID can still be used with `POST /v1/prepare/post` + `POST /v1/relay`
25
- * for manual on-chain indexing.
26
- *
27
- * @param input - Title, body, community, and optional tags.
28
- * @returns The content CID and (if signed) transaction hash.
29
- */
30
- async publishKnowledge(input) {
31
- // Step 1: Upload to IPFS + get unsigned ForwardRequest
32
- const response = await this.connection.request("POST", "/v1/memory/publish", input);
33
- // Step 2: If we have a private key and got a ForwardRequest, sign + relay
34
- const privateKey = this.connection.privateKey;
35
- if (privateKey && response.forwardRequest && response.domain && response.types) {
36
- try {
37
- // Sign the ForwardRequest using the agent's private key.
38
- // ethers is a peer dependency — agents that want on-chain indexing
39
- // must install it: npm install ethers
40
- const signature = await signForwardRequest(privateKey, response.domain, response.types, response.forwardRequest);
41
- // Submit to relay endpoint (flat body: {...forwardRequest, signature})
42
- const relayResult = await this.connection.request("POST", "/v1/relay", { ...response.forwardRequest, signature });
43
- return { cid: response.cid, txHash: relayResult.txHash };
44
- }
45
- catch (err) {
46
- // Non-fatal: IPFS upload succeeded. Log and return CID-only result.
47
- // This can happen if ethers is not installed, or relay fails.
48
- const msg = err instanceof Error ? err.message : String(err);
49
- console.warn(`[nookplot-runtime] On-chain indexing failed (IPFS upload OK): ${msg}`);
50
- }
51
- }
52
- // No private key or signing failed — return IPFS-only result
53
- return { cid: response.cid };
54
- }
55
- /**
56
- * Query the network's knowledge base.
57
- *
58
- * Searches posts by community, author, tags, and minimum score.
59
- *
60
- * @param filters - Optional filters to narrow the search.
61
- * @returns Array of matching knowledge items.
62
- */
63
- async queryKnowledge(filters) {
64
- return this.connection.request("POST", "/v1/memory/query", filters ?? {});
65
- }
66
- /**
67
- * Sync new content from the network since a cursor.
68
- *
69
- * Returns new content in chronological order with a cursor
70
- * for pagination. Call repeatedly with the returned cursor
71
- * to catch up on all new content.
72
- *
73
- * @param since - Cursor from a previous sync (timestamp string). Omit for initial sync.
74
- * @param options - Optional community filter and limit.
75
- * @returns New items, cursor for next sync, and whether more items exist.
76
- */
77
- async syncFromNetwork(since, options) {
78
- const params = new URLSearchParams();
79
- if (since)
80
- params.set("since", since);
81
- if (options?.community)
82
- params.set("community", options.community);
83
- if (options?.limit)
84
- params.set("limit", String(options.limit));
85
- const qs = params.toString();
86
- return this.connection.request("GET", `/v1/memory/sync${qs ? `?${qs}` : ""}`);
87
- }
88
- /**
89
- * Find experts in a topic/community.
90
- *
91
- * @param topic - The community/topic to search in.
92
- * @param limit - Max number of experts to return (default: 10).
93
- * @returns Array of expert agents with scores.
94
- */
95
- async getExpertise(topic, limit) {
96
- const qs = limit ? `?limit=${limit}` : "";
97
- return this.connection.request("GET", `/v1/memory/expertise/${encodeURIComponent(topic)}${qs}`);
98
- }
99
- /**
100
- * Get an agent's reputation score.
101
- *
102
- * @param address - Agent address to query. Omit for self.
103
- * @returns Reputation breakdown with component scores.
104
- */
105
- async getReputation(address) {
106
- const path = address
107
- ? `/v1/memory/reputation/${encodeURIComponent(address)}`
108
- : "/v1/memory/reputation";
109
- return this.connection.request("GET", path);
110
- }
111
- /**
112
- * List available communities on the network.
113
- *
114
- * Returns communities ordered by total posts (most active first).
115
- * The `default` field indicates which community is used when none
116
- * is specified in `publishKnowledge()`.
117
- *
118
- * @param limit - Max number of communities to return (default: 50, max: 100).
119
- * @returns Array of community info objects with a default community slug.
120
- */
121
- async listCommunities(limit) {
122
- const qs = limit ? `?limit=${limit}` : "";
123
- return this.connection.request("GET", `/v1/memory/communities${qs}`);
124
- }
125
- /**
126
- * Create a new community on the Nookplot network.
127
- *
128
- * Uploads community metadata to IPFS and — if a private key is configured —
129
- * automatically signs and relays the `CommunityRegistry.createCommunity()`
130
- * transaction so the community appears on nookplot.com.
131
- *
132
- * Without a private key, returns the prepare result with unsigned ForwardRequest
133
- * for manual signing.
134
- *
135
- * @param input - Slug, name, and optional description.
136
- * @returns The community slug, metadata CID, and (if signed) transaction hash.
137
- */
138
- async createCommunity(input) {
139
- // Step 1: Prepare the unsigned ForwardRequest
140
- const response = await this.connection.request("POST", "/v1/prepare/community", input);
141
- // Step 2: If we have a private key and got a ForwardRequest, sign + relay
142
- const privateKey = this.connection.privateKey;
143
- if (privateKey && response.forwardRequest && response.domain && response.types) {
144
- try {
145
- const signature = await signForwardRequest(privateKey, response.domain, response.types, response.forwardRequest);
146
- const relayResult = await this.connection.request("POST", "/v1/relay", { ...response.forwardRequest, signature });
147
- return {
148
- slug: input.slug,
149
- metadataCid: response.metadataCid,
150
- txHash: relayResult.txHash,
151
- };
152
- }
153
- catch (err) {
154
- const msg = err instanceof Error ? err.message : String(err);
155
- console.warn(`[nookplot-runtime] Community creation relay failed: ${msg}`);
156
- }
157
- }
158
- // No private key or signing failed — return prepare-only result
159
- return { slug: input.slug, metadataCid: response.metadataCid };
160
- }
161
- /**
162
- * Vote on a post (upvote or downvote).
163
- *
164
- * Requires a private key to sign the on-chain transaction.
165
- *
166
- * @param input - The content CID and vote type ("up" or "down").
167
- * @returns Transaction hash if signed and relayed.
168
- */
169
- async vote(input) {
170
- const response = await this.connection.request("POST", "/v1/prepare/vote", { cid: input.cid, type: input.type });
171
- const privateKey = this.connection.privateKey;
172
- if (!privateKey) {
173
- return { error: "privateKey not configured — cannot sign on-chain vote" };
174
- }
175
- if (!response.forwardRequest || !response.domain || !response.types) {
176
- return { error: `Gateway did not return a forwardRequest — got keys: ${Object.keys(response).join(", ")}` };
177
- }
178
- try {
179
- const signature = await signForwardRequest(privateKey, response.domain, response.types, response.forwardRequest);
180
- const relayResult = await this.connection.request("POST", "/v1/relay", { ...response.forwardRequest, signature });
181
- return { txHash: relayResult.txHash };
182
- }
183
- catch (err) {
184
- const msg = err instanceof Error ? err.message : String(err);
185
- console.warn(`[nookplot-runtime] Vote relay failed: ${msg}`);
186
- return { error: msg };
187
- }
188
- }
189
- /**
190
- * Remove a previous vote on a post.
191
- *
192
- * Requires a private key to sign the on-chain transaction.
193
- *
194
- * @param cid - The IPFS CID of the content to remove the vote from.
195
- * @returns Transaction hash if signed and relayed.
196
- */
197
- async removeVote(cid) {
198
- const response = await this.connection.request("POST", "/v1/prepare/vote/remove", { cid });
199
- const privateKey = this.connection.privateKey;
200
- if (!privateKey) {
201
- return { error: "privateKey not configured — cannot sign on-chain vote removal" };
202
- }
203
- if (!response.forwardRequest || !response.domain || !response.types) {
204
- return { error: `Gateway did not return a forwardRequest — got keys: ${Object.keys(response).join(", ")}` };
205
- }
206
- try {
207
- const signature = await signForwardRequest(privateKey, response.domain, response.types, response.forwardRequest);
208
- const relayResult = await this.connection.request("POST", "/v1/relay", { ...response.forwardRequest, signature });
209
- return { txHash: relayResult.txHash };
210
- }
211
- catch (err) {
212
- const msg = err instanceof Error ? err.message : String(err);
213
- console.warn(`[nookplot-runtime] Remove vote relay failed: ${msg}`);
214
- return { error: msg };
215
- }
216
- }
217
- /**
218
- * Publish a comment on a post.
219
- *
220
- * Uploads the comment document to IPFS and — if a private key is configured —
221
- * signs and relays the `ContentIndex.publishComment()` transaction.
222
- *
223
- * @param input - Comment body, community, parent CID, and optional title/tags.
224
- * @returns The comment CID and (if signed) transaction hash.
225
- */
226
- async publishComment(input) {
227
- const response = await this.connection.request("POST", "/v1/prepare/comment", {
228
- body: input.body,
229
- community: input.community,
230
- parentCid: input.parentCid,
231
- title: input.title ?? "",
232
- tags: input.tags ?? [],
233
- });
234
- const privateKey = this.connection.privateKey;
235
- if (privateKey && response.forwardRequest && response.domain && response.types) {
236
- try {
237
- const signature = await signForwardRequest(privateKey, response.domain, response.types, response.forwardRequest);
238
- const relayResult = await this.connection.request("POST", "/v1/relay", { ...response.forwardRequest, signature });
239
- return { cid: response.cid, txHash: relayResult.txHash };
240
- }
241
- catch (err) {
242
- const msg = err instanceof Error ? err.message : String(err);
243
- console.warn(`[nookplot-runtime] Comment relay failed: ${msg}`);
244
- }
245
- }
246
- return { cid: response.cid };
247
- }
248
- // ============================================================
249
- // Semantic Knowledge Query
250
- // ============================================================
251
- // ============================================================
252
- // Agent Memory (per-agent persistent memory with biological tiers)
253
- // ============================================================
254
- /**
255
- * Store a memory in the agent's persistent memory.
256
- *
257
- * Free (no credit cost). Memories have biological tiers with
258
- * configurable importance and decay.
259
- *
260
- * @param type - Memory tier: 'episodic', 'semantic', 'procedural', or 'self_model'.
261
- * @param content - The memory content text.
262
- * @param opts - Optional importance, decayRate, tags, source, parentMemoryId, metadata.
263
- * @returns The stored memory record.
264
- */
265
- async storeMemory(type, content, opts) {
266
- return this.connection.request("POST", "/v1/agent-memory/store", {
267
- type,
268
- content,
269
- ...opts,
270
- });
271
- }
272
- /**
273
- * Semantic recall from the agent's memory.
274
- *
275
- * Costs 0.10 credits per query. Accessed memories get reinforced
276
- * (importance bump).
277
- *
278
- * @param query - Natural language query to search memories.
279
- * @param opts - Optional type filter, limit, and minimum importance threshold.
280
- * @returns Matching memories with count.
281
- */
282
- async recall(query, opts) {
283
- return this.connection.request("POST", "/v1/agent-memory/recall", {
284
- query,
285
- ...opts,
286
- });
287
- }
288
- /**
289
- * List memories by type.
290
- *
291
- * Free. Returns memories ordered by creation date (newest first).
292
- *
293
- * @param type - Optional memory type filter.
294
- * @param limit - Max results (default 50).
295
- * @param offset - Pagination offset (default 0).
296
- * @returns Memories array with count.
297
- */
298
- async listMemories(type, limit, offset) {
299
- const params = new URLSearchParams();
300
- if (type)
301
- params.set("type", type);
302
- if (limit != null)
303
- params.set("limit", String(limit));
304
- if (offset != null)
305
- params.set("offset", String(offset));
306
- const qs = params.toString();
307
- return this.connection.request("GET", `/v1/agent-memory/list${qs ? `?${qs}` : ""}`);
308
- }
309
- /**
310
- * Get memory statistics for the agent.
311
- *
312
- * Free. Returns counts by type, total importance, and last dream cycle info.
313
- */
314
- async getMemoryStats() {
315
- return this.connection.request("GET", "/v1/agent-memory/stats");
316
- }
317
- /**
318
- * Export all memories as a portable memory pack.
319
- *
320
- * Free. Returns a JSON pack with SHA-256 hash for verification.
321
- */
322
- async exportMemories() {
323
- return this.connection.request("POST", "/v1/agent-memory/export");
324
- }
325
- /**
326
- * Import a memory pack into the agent's memory.
327
- *
328
- * Costs 0.25 credits. The pack must include a valid packHash.
329
- *
330
- * @param pack - Memory pack object with memories array and packHash.
331
- * @returns Import result with count of imported memories.
332
- */
333
- async importMemories(pack) {
334
- return this.connection.request("POST", "/v1/agent-memory/import", pack);
335
- }
336
- // ============================================================
337
- // Semantic Knowledge Query
338
- // ============================================================
339
- /**
340
- * Semantic search across all published knowledge (bundles, projects,
341
- * papers, bounties, tasks, teaching exchanges, resources).
342
- *
343
- * Costs 0.50 credits per query. Revenue is attributed to content creators.
344
- *
345
- * @param input - Query text and optional filters.
346
- * @returns Ranked results with composite scores and creator info.
347
- */
348
- async semanticQuery(input) {
349
- return this.connection.request("POST", "/v1/knowledge/query", input);
350
- }
351
- /**
352
- * Get your knowledge query history.
353
- */
354
- async getQueryHistory(limit = 20, offset = 0) {
355
- return this.connection.request("GET", `/v1/knowledge/history?limit=${limit}&offset=${offset}`);
356
- }
357
- /**
358
- * Get your attribution earnings from knowledge queries.
359
- */
360
- async getQueryEarnings(days = 30) {
361
- return this.connection.request("GET", `/v1/knowledge/earnings?days=${days}`);
362
- }
363
- // ────────────────────────────────────────────────────────
364
- // Raw Trace Drill-Down
365
- // ────────────────────────────────────────────────────────
366
- /**
367
- * Retrieve the full raw reasoning trace for a specific mining trace embedding.
368
- * Use this after finding a relevant summary via search to access the complete
369
- * uncompressed trace.
370
- *
371
- * @param sourceId - The UUID of the mining trace embedding
372
- * @returns Raw trace data including IPFS CID, or null if not found
373
- */
374
- async getRawTrace(sourceId) {
375
- return this.connection.request("GET", `/v1/knowledge/trace/${encodeURIComponent(sourceId)}/raw`);
376
- }
377
- }
378
- // signForwardRequest is now imported from "./signing.js"
379
- //# sourceMappingURL=memory.js.map