@nookplot/runtime 0.5.129 → 0.5.131

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 (441) hide show
  1. package/package.json +3 -3
  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 -236
  21. package/dist/__tests__/autonomous.getAvailableActions.test.js.map +0 -1
  22. package/dist/__tests__/autonomous.goalBootstrap.test.d.ts +0 -2
  23. package/dist/__tests__/autonomous.goalBootstrap.test.d.ts.map +0 -1
  24. package/dist/__tests__/autonomous.goalBootstrap.test.js +0 -148
  25. package/dist/__tests__/autonomous.goalBootstrap.test.js.map +0 -1
  26. package/dist/__tests__/autonomous.guardrails.test.d.ts +0 -2
  27. package/dist/__tests__/autonomous.guardrails.test.d.ts.map +0 -1
  28. package/dist/__tests__/autonomous.guardrails.test.js +0 -215
  29. package/dist/__tests__/autonomous.guardrails.test.js.map +0 -1
  30. package/dist/__tests__/autonomous.hooks.test.d.ts +0 -2
  31. package/dist/__tests__/autonomous.hooks.test.d.ts.map +0 -1
  32. package/dist/__tests__/autonomous.hooks.test.js +0 -107
  33. package/dist/__tests__/autonomous.hooks.test.js.map +0 -1
  34. package/dist/__tests__/autonomous.latentSpace.test.d.ts +0 -2
  35. package/dist/__tests__/autonomous.latentSpace.test.d.ts.map +0 -1
  36. package/dist/__tests__/autonomous.latentSpace.test.js +0 -224
  37. package/dist/__tests__/autonomous.latentSpace.test.js.map +0 -1
  38. package/dist/__tests__/autonomous.lifecycle.test.d.ts +0 -2
  39. package/dist/__tests__/autonomous.lifecycle.test.d.ts.map +0 -1
  40. package/dist/__tests__/autonomous.lifecycle.test.js +0 -147
  41. package/dist/__tests__/autonomous.lifecycle.test.js.map +0 -1
  42. package/dist/__tests__/autonomous.loadedSkillRefs.test.d.ts +0 -2
  43. package/dist/__tests__/autonomous.loadedSkillRefs.test.d.ts.map +0 -1
  44. package/dist/__tests__/autonomous.loadedSkillRefs.test.js +0 -150
  45. package/dist/__tests__/autonomous.loadedSkillRefs.test.js.map +0 -1
  46. package/dist/__tests__/autonomous.miningTrack.test.d.ts +0 -2
  47. package/dist/__tests__/autonomous.miningTrack.test.d.ts.map +0 -1
  48. package/dist/__tests__/autonomous.miningTrack.test.js +0 -38
  49. package/dist/__tests__/autonomous.miningTrack.test.js.map +0 -1
  50. package/dist/__tests__/chatEngine.episodicHook.test.d.ts +0 -2
  51. package/dist/__tests__/chatEngine.episodicHook.test.d.ts.map +0 -1
  52. package/dist/__tests__/chatEngine.episodicHook.test.js +0 -160
  53. package/dist/__tests__/chatEngine.episodicHook.test.js.map +0 -1
  54. package/dist/__tests__/chatEngine.test.d.ts +0 -2
  55. package/dist/__tests__/chatEngine.test.d.ts.map +0 -1
  56. package/dist/__tests__/chatEngine.test.js +0 -482
  57. package/dist/__tests__/chatEngine.test.js.map +0 -1
  58. package/dist/__tests__/codegen-drift.test.d.ts +0 -23
  59. package/dist/__tests__/codegen-drift.test.d.ts.map +0 -1
  60. package/dist/__tests__/codegen-drift.test.js +0 -187
  61. package/dist/__tests__/codegen-drift.test.js.map +0 -1
  62. package/dist/__tests__/contentSafety.test.d.ts +0 -2
  63. package/dist/__tests__/contentSafety.test.d.ts.map +0 -1
  64. package/dist/__tests__/contentSafety.test.js +0 -90
  65. package/dist/__tests__/contentSafety.test.js.map +0 -1
  66. package/dist/__tests__/conversation/compactionMemory.test.d.ts +0 -2
  67. package/dist/__tests__/conversation/compactionMemory.test.d.ts.map +0 -1
  68. package/dist/__tests__/conversation/compactionMemory.test.js +0 -447
  69. package/dist/__tests__/conversation/compactionMemory.test.js.map +0 -1
  70. package/dist/__tests__/conversation/modelThresholdsParity.test.d.ts +0 -2
  71. package/dist/__tests__/conversation/modelThresholdsParity.test.d.ts.map +0 -1
  72. package/dist/__tests__/conversation/modelThresholdsParity.test.js +0 -74
  73. package/dist/__tests__/conversation/modelThresholdsParity.test.js.map +0 -1
  74. package/dist/__tests__/doomLoop.test.d.ts +0 -6
  75. package/dist/__tests__/doomLoop.test.d.ts.map +0 -1
  76. package/dist/__tests__/doomLoop.test.js +0 -144
  77. package/dist/__tests__/doomLoop.test.js.map +0 -1
  78. package/dist/__tests__/goalLoop.test.d.ts +0 -2
  79. package/dist/__tests__/goalLoop.test.d.ts.map +0 -1
  80. package/dist/__tests__/goalLoop.test.js +0 -335
  81. package/dist/__tests__/goalLoop.test.js.map +0 -1
  82. package/dist/__tests__/guardrails.test.d.ts +0 -2
  83. package/dist/__tests__/guardrails.test.d.ts.map +0 -1
  84. package/dist/__tests__/guardrails.test.js +0 -236
  85. package/dist/__tests__/guardrails.test.js.map +0 -1
  86. package/dist/__tests__/helpers/mockRuntime.d.ts +0 -11
  87. package/dist/__tests__/helpers/mockRuntime.d.ts.map +0 -1
  88. package/dist/__tests__/helpers/mockRuntime.js +0 -153
  89. package/dist/__tests__/helpers/mockRuntime.js.map +0 -1
  90. package/dist/__tests__/hooks.test.d.ts +0 -9
  91. package/dist/__tests__/hooks.test.d.ts.map +0 -1
  92. package/dist/__tests__/hooks.test.js +0 -192
  93. package/dist/__tests__/hooks.test.js.map +0 -1
  94. package/dist/__tests__/loadProfile.test.d.ts +0 -8
  95. package/dist/__tests__/loadProfile.test.d.ts.map +0 -1
  96. package/dist/__tests__/loadProfile.test.js +0 -134
  97. package/dist/__tests__/loadProfile.test.js.map +0 -1
  98. package/dist/__tests__/manifestActivationHook.test.d.ts +0 -2
  99. package/dist/__tests__/manifestActivationHook.test.d.ts.map +0 -1
  100. package/dist/__tests__/manifestActivationHook.test.js +0 -312
  101. package/dist/__tests__/manifestActivationHook.test.js.map +0 -1
  102. package/dist/__tests__/memory.test.d.ts +0 -2
  103. package/dist/__tests__/memory.test.d.ts.map +0 -1
  104. package/dist/__tests__/memory.test.js +0 -192
  105. package/dist/__tests__/memory.test.js.map +0 -1
  106. package/dist/__tests__/mining.test.d.ts +0 -2
  107. package/dist/__tests__/mining.test.d.ts.map +0 -1
  108. package/dist/__tests__/mining.test.js +0 -306
  109. package/dist/__tests__/mining.test.js.map +0 -1
  110. package/dist/__tests__/onChainActions.parity.test.d.ts +0 -12
  111. package/dist/__tests__/onChainActions.parity.test.d.ts.map +0 -1
  112. package/dist/__tests__/onChainActions.parity.test.js +0 -104
  113. package/dist/__tests__/onChainActions.parity.test.js.map +0 -1
  114. package/dist/__tests__/presetLoader.test.d.ts +0 -2
  115. package/dist/__tests__/presetLoader.test.d.ts.map +0 -1
  116. package/dist/__tests__/presetLoader.test.js +0 -749
  117. package/dist/__tests__/presetLoader.test.js.map +0 -1
  118. package/dist/__tests__/querySegmentation.test.d.ts +0 -2
  119. package/dist/__tests__/querySegmentation.test.d.ts.map +0 -1
  120. package/dist/__tests__/querySegmentation.test.js +0 -187
  121. package/dist/__tests__/querySegmentation.test.js.map +0 -1
  122. package/dist/__tests__/sandbox.test.d.ts +0 -13
  123. package/dist/__tests__/sandbox.test.d.ts.map +0 -1
  124. package/dist/__tests__/sandbox.test.js +0 -413
  125. package/dist/__tests__/sandbox.test.js.map +0 -1
  126. package/dist/__tests__/signing.test.d.ts +0 -2
  127. package/dist/__tests__/signing.test.d.ts.map +0 -1
  128. package/dist/__tests__/signing.test.js +0 -260
  129. package/dist/__tests__/signing.test.js.map +0 -1
  130. package/dist/__tests__/wakeUpStack.test.d.ts +0 -2
  131. package/dist/__tests__/wakeUpStack.test.d.ts.map +0 -1
  132. package/dist/__tests__/wakeUpStack.test.js +0 -239
  133. package/dist/__tests__/wakeUpStack.test.js.map +0 -1
  134. package/dist/actionCatalog.d.ts +0 -57
  135. package/dist/actionCatalog.d.ts.map +0 -1
  136. package/dist/actionCatalog.generated.d.ts +0 -4
  137. package/dist/actionCatalog.generated.d.ts.map +0 -1
  138. package/dist/actionCatalog.generated.js +0 -2279
  139. package/dist/actionCatalog.generated.js.map +0 -1
  140. package/dist/actionCatalog.js +0 -214
  141. package/dist/actionCatalog.js.map +0 -1
  142. package/dist/api-marketplace.d.ts +0 -111
  143. package/dist/api-marketplace.d.ts.map +0 -1
  144. package/dist/api-marketplace.js +0 -154
  145. package/dist/api-marketplace.js.map +0 -1
  146. package/dist/artifactEmbeddings.d.ts +0 -69
  147. package/dist/artifactEmbeddings.d.ts.map +0 -1
  148. package/dist/artifactEmbeddings.js +0 -52
  149. package/dist/artifactEmbeddings.js.map +0 -1
  150. package/dist/autonomous.d.ts +0 -285
  151. package/dist/autonomous.d.ts.map +0 -1
  152. package/dist/autonomous.js +0 -3661
  153. package/dist/autonomous.js.map +0 -1
  154. package/dist/bounties.d.ts +0 -112
  155. package/dist/bounties.d.ts.map +0 -1
  156. package/dist/bounties.js +0 -140
  157. package/dist/bounties.js.map +0 -1
  158. package/dist/bundles.d.ts +0 -174
  159. package/dist/bundles.d.ts.map +0 -1
  160. package/dist/bundles.js +0 -208
  161. package/dist/bundles.js.map +0 -1
  162. package/dist/channels.d.ts +0 -131
  163. package/dist/channels.d.ts.map +0 -1
  164. package/dist/channels.js +0 -227
  165. package/dist/channels.js.map +0 -1
  166. package/dist/chat/chatEngine.d.ts +0 -138
  167. package/dist/chat/chatEngine.d.ts.map +0 -1
  168. package/dist/chat/chatEngine.js +0 -613
  169. package/dist/chat/chatEngine.js.map +0 -1
  170. package/dist/chat/index.d.ts +0 -30
  171. package/dist/chat/index.d.ts.map +0 -1
  172. package/dist/chat/index.js +0 -29
  173. package/dist/chat/index.js.map +0 -1
  174. package/dist/chat/terminal.d.ts +0 -19
  175. package/dist/chat/terminal.d.ts.map +0 -1
  176. package/dist/chat/terminal.js +0 -17
  177. package/dist/chat/terminal.js.map +0 -1
  178. package/dist/chat/terminals/discordTerminal.d.ts +0 -22
  179. package/dist/chat/terminals/discordTerminal.d.ts.map +0 -1
  180. package/dist/chat/terminals/discordTerminal.js +0 -132
  181. package/dist/chat/terminals/discordTerminal.js.map +0 -1
  182. package/dist/chat/terminals/openclawTerminal.d.ts +0 -43
  183. package/dist/chat/terminals/openclawTerminal.d.ts.map +0 -1
  184. package/dist/chat/terminals/openclawTerminal.js +0 -186
  185. package/dist/chat/terminals/openclawTerminal.js.map +0 -1
  186. package/dist/chat/terminals/stdinTerminal.d.ts +0 -18
  187. package/dist/chat/terminals/stdinTerminal.d.ts.map +0 -1
  188. package/dist/chat/terminals/stdinTerminal.js +0 -58
  189. package/dist/chat/terminals/stdinTerminal.js.map +0 -1
  190. package/dist/chat/terminals/telegramTerminal.d.ts +0 -27
  191. package/dist/chat/terminals/telegramTerminal.d.ts.map +0 -1
  192. package/dist/chat/terminals/telegramTerminal.js +0 -123
  193. package/dist/chat/terminals/telegramTerminal.js.map +0 -1
  194. package/dist/cognitiveWorkspace.d.ts +0 -107
  195. package/dist/cognitiveWorkspace.d.ts.map +0 -1
  196. package/dist/cognitiveWorkspace.js +0 -94
  197. package/dist/cognitiveWorkspace.js.map +0 -1
  198. package/dist/communities.d.ts +0 -40
  199. package/dist/communities.d.ts.map +0 -1
  200. package/dist/communities.js +0 -53
  201. package/dist/communities.js.map +0 -1
  202. package/dist/connection.d.ts +0 -90
  203. package/dist/connection.d.ts.map +0 -1
  204. package/dist/connection.js +0 -428
  205. package/dist/connection.js.map +0 -1
  206. package/dist/contentSafety.d.ts +0 -64
  207. package/dist/contentSafety.d.ts.map +0 -1
  208. package/dist/contentSafety.js +0 -123
  209. package/dist/contentSafety.js.map +0 -1
  210. package/dist/conversation/compactionMemory.d.ts +0 -124
  211. package/dist/conversation/compactionMemory.d.ts.map +0 -1
  212. package/dist/conversation/compactionMemory.js +0 -379
  213. package/dist/conversation/compactionMemory.js.map +0 -1
  214. package/dist/conversation/conversationLogStore.d.ts +0 -111
  215. package/dist/conversation/conversationLogStore.d.ts.map +0 -1
  216. package/dist/conversation/conversationLogStore.js +0 -248
  217. package/dist/conversation/conversationLogStore.js.map +0 -1
  218. package/dist/conversation/conversationMemory.d.ts +0 -59
  219. package/dist/conversation/conversationMemory.d.ts.map +0 -1
  220. package/dist/conversation/conversationMemory.js +0 -32
  221. package/dist/conversation/conversationMemory.js.map +0 -1
  222. package/dist/conversation/index.d.ts +0 -16
  223. package/dist/conversation/index.d.ts.map +0 -1
  224. package/dist/conversation/index.js +0 -5
  225. package/dist/conversation/index.js.map +0 -1
  226. package/dist/conversation/modelLimits.d.ts +0 -43
  227. package/dist/conversation/modelLimits.d.ts.map +0 -1
  228. package/dist/conversation/modelLimits.js +0 -67
  229. package/dist/conversation/modelLimits.js.map +0 -1
  230. package/dist/cro.d.ts +0 -243
  231. package/dist/cro.d.ts.map +0 -1
  232. package/dist/cro.js +0 -263
  233. package/dist/cro.js.map +0 -1
  234. package/dist/defaultGuardrails.d.ts +0 -21
  235. package/dist/defaultGuardrails.d.ts.map +0 -1
  236. package/dist/defaultGuardrails.js +0 -90
  237. package/dist/defaultGuardrails.js.map +0 -1
  238. package/dist/delegations.d.ts +0 -63
  239. package/dist/delegations.d.ts.map +0 -1
  240. package/dist/delegations.js +0 -41
  241. package/dist/delegations.js.map +0 -1
  242. package/dist/discovery.d.ts +0 -172
  243. package/dist/discovery.d.ts.map +0 -1
  244. package/dist/discovery.js +0 -300
  245. package/dist/discovery.js.map +0 -1
  246. package/dist/doomLoop.d.ts +0 -52
  247. package/dist/doomLoop.d.ts.map +0 -1
  248. package/dist/doomLoop.js +0 -173
  249. package/dist/doomLoop.js.map +0 -1
  250. package/dist/economy.d.ts +0 -244
  251. package/dist/economy.d.ts.map +0 -1
  252. package/dist/economy.js +0 -263
  253. package/dist/economy.js.map +0 -1
  254. package/dist/email.d.ts +0 -125
  255. package/dist/email.d.ts.map +0 -1
  256. package/dist/email.js +0 -91
  257. package/dist/email.js.map +0 -1
  258. package/dist/embeddingExchange.d.ts +0 -141
  259. package/dist/embeddingExchange.d.ts.map +0 -1
  260. package/dist/embeddingExchange.js +0 -95
  261. package/dist/embeddingExchange.js.map +0 -1
  262. package/dist/episodicMemoryHook.d.ts +0 -39
  263. package/dist/episodicMemoryHook.d.ts.map +0 -1
  264. package/dist/episodicMemoryHook.js +0 -58
  265. package/dist/episodicMemoryHook.js.map +0 -1
  266. package/dist/evaluator.d.ts +0 -113
  267. package/dist/evaluator.d.ts.map +0 -1
  268. package/dist/evaluator.js +0 -144
  269. package/dist/evaluator.js.map +0 -1
  270. package/dist/events.d.ts +0 -58
  271. package/dist/events.d.ts.map +0 -1
  272. package/dist/events.js +0 -86
  273. package/dist/events.js.map +0 -1
  274. package/dist/formatters.d.ts +0 -31
  275. package/dist/formatters.d.ts.map +0 -1
  276. package/dist/formatters.js +0 -227
  277. package/dist/formatters.js.map +0 -1
  278. package/dist/goal/goalLoop.d.ts +0 -78
  279. package/dist/goal/goalLoop.d.ts.map +0 -1
  280. package/dist/goal/goalLoop.js +0 -376
  281. package/dist/goal/goalLoop.js.map +0 -1
  282. package/dist/goal/goalPrompts.d.ts +0 -20
  283. package/dist/goal/goalPrompts.d.ts.map +0 -1
  284. package/dist/goal/goalPrompts.js +0 -54
  285. package/dist/goal/goalPrompts.js.map +0 -1
  286. package/dist/goal/types.d.ts +0 -98
  287. package/dist/goal/types.d.ts.map +0 -1
  288. package/dist/goal/types.js +0 -7
  289. package/dist/goal/types.js.map +0 -1
  290. package/dist/gpu.d.ts +0 -137
  291. package/dist/gpu.d.ts.map +0 -1
  292. package/dist/gpu.js +0 -166
  293. package/dist/gpu.js.map +0 -1
  294. package/dist/guardrails.d.ts +0 -182
  295. package/dist/guardrails.d.ts.map +0 -1
  296. package/dist/guardrails.js +0 -277
  297. package/dist/guardrails.js.map +0 -1
  298. package/dist/guilds.d.ts +0 -158
  299. package/dist/guilds.d.ts.map +0 -1
  300. package/dist/guilds.js +0 -205
  301. package/dist/guilds.js.map +0 -1
  302. package/dist/heartbeat.d.ts +0 -43
  303. package/dist/heartbeat.d.ts.map +0 -1
  304. package/dist/heartbeat.js +0 -72
  305. package/dist/heartbeat.js.map +0 -1
  306. package/dist/hooks.d.ts +0 -172
  307. package/dist/hooks.d.ts.map +0 -1
  308. package/dist/hooks.js +0 -91
  309. package/dist/hooks.js.map +0 -1
  310. package/dist/identity.d.ts +0 -112
  311. package/dist/identity.d.ts.map +0 -1
  312. package/dist/identity.js +0 -126
  313. package/dist/identity.js.map +0 -1
  314. package/dist/inbox.d.ts +0 -77
  315. package/dist/inbox.d.ts.map +0 -1
  316. package/dist/inbox.js +0 -98
  317. package/dist/inbox.js.map +0 -1
  318. package/dist/index.d.ts +0 -329
  319. package/dist/index.d.ts.map +0 -1
  320. package/dist/index.js +0 -366
  321. package/dist/index.js.map +0 -1
  322. package/dist/insights.d.ts +0 -166
  323. package/dist/insights.d.ts.map +0 -1
  324. package/dist/insights.js +0 -100
  325. package/dist/insights.js.map +0 -1
  326. package/dist/intents.d.ts +0 -132
  327. package/dist/intents.d.ts.map +0 -1
  328. package/dist/intents.js +0 -81
  329. package/dist/intents.js.map +0 -1
  330. package/dist/knowledgeContext.d.ts +0 -68
  331. package/dist/knowledgeContext.d.ts.map +0 -1
  332. package/dist/knowledgeContext.js +0 -109
  333. package/dist/knowledgeContext.js.map +0 -1
  334. package/dist/leaderboard.d.ts +0 -30
  335. package/dist/leaderboard.d.ts.map +0 -1
  336. package/dist/leaderboard.js +0 -34
  337. package/dist/leaderboard.js.map +0 -1
  338. package/dist/loadProfile.d.ts +0 -100
  339. package/dist/loadProfile.d.ts.map +0 -1
  340. package/dist/loadProfile.js +0 -221
  341. package/dist/loadProfile.js.map +0 -1
  342. package/dist/manifest.d.ts +0 -127
  343. package/dist/manifest.d.ts.map +0 -1
  344. package/dist/manifest.js +0 -123
  345. package/dist/manifest.js.map +0 -1
  346. package/dist/manifestActivationHook.d.ts +0 -72
  347. package/dist/manifestActivationHook.d.ts.map +0 -1
  348. package/dist/manifestActivationHook.js +0 -180
  349. package/dist/manifestActivationHook.js.map +0 -1
  350. package/dist/marketplace.d.ts +0 -156
  351. package/dist/marketplace.d.ts.map +0 -1
  352. package/dist/marketplace.js +0 -215
  353. package/dist/marketplace.js.map +0 -1
  354. package/dist/matching.d.ts +0 -192
  355. package/dist/matching.d.ts.map +0 -1
  356. package/dist/matching.js +0 -138
  357. package/dist/matching.js.map +0 -1
  358. package/dist/memory.d.ts +0 -287
  359. package/dist/memory.d.ts.map +0 -1
  360. package/dist/memory.js +0 -379
  361. package/dist/memory.js.map +0 -1
  362. package/dist/mining.d.ts +0 -155
  363. package/dist/mining.d.ts.map +0 -1
  364. package/dist/mining.js +0 -365
  365. package/dist/mining.js.map +0 -1
  366. package/dist/oracle.d.ts +0 -30
  367. package/dist/oracle.d.ts.map +0 -1
  368. package/dist/oracle.js +0 -31
  369. package/dist/oracle.js.map +0 -1
  370. package/dist/policies.d.ts +0 -132
  371. package/dist/policies.d.ts.map +0 -1
  372. package/dist/policies.js +0 -62
  373. package/dist/policies.js.map +0 -1
  374. package/dist/presetLoader.d.ts +0 -130
  375. package/dist/presetLoader.d.ts.map +0 -1
  376. package/dist/presetLoader.js +0 -734
  377. package/dist/presetLoader.js.map +0 -1
  378. package/dist/proactive.d.ts +0 -197
  379. package/dist/proactive.d.ts.map +0 -1
  380. package/dist/proactive.js +0 -229
  381. package/dist/proactive.js.map +0 -1
  382. package/dist/projects.d.ts +0 -307
  383. package/dist/projects.d.ts.map +0 -1
  384. package/dist/projects.js +0 -438
  385. package/dist/projects.js.map +0 -1
  386. package/dist/querySegmentation.d.ts +0 -54
  387. package/dist/querySegmentation.d.ts.map +0 -1
  388. package/dist/querySegmentation.js +0 -80
  389. package/dist/querySegmentation.js.map +0 -1
  390. package/dist/sandbox.d.ts +0 -156
  391. package/dist/sandbox.d.ts.map +0 -1
  392. package/dist/sandbox.js +0 -425
  393. package/dist/sandbox.js.map +0 -1
  394. package/dist/signalActionMap.d.ts +0 -59
  395. package/dist/signalActionMap.d.ts.map +0 -1
  396. package/dist/signalActionMap.js +0 -305
  397. package/dist/signalActionMap.js.map +0 -1
  398. package/dist/signing.d.ts +0 -94
  399. package/dist/signing.d.ts.map +0 -1
  400. package/dist/signing.js +0 -158
  401. package/dist/signing.js.map +0 -1
  402. package/dist/social.d.ts +0 -176
  403. package/dist/social.d.ts.map +0 -1
  404. package/dist/social.js +0 -232
  405. package/dist/social.js.map +0 -1
  406. package/dist/specialization.d.ts +0 -108
  407. package/dist/specialization.d.ts.map +0 -1
  408. package/dist/specialization.js +0 -104
  409. package/dist/specialization.js.map +0 -1
  410. package/dist/swarms.d.ts +0 -119
  411. package/dist/swarms.d.ts.map +0 -1
  412. package/dist/swarms.js +0 -103
  413. package/dist/swarms.js.map +0 -1
  414. package/dist/teaching.d.ts +0 -171
  415. package/dist/teaching.d.ts.map +0 -1
  416. package/dist/teaching.js +0 -87
  417. package/dist/teaching.js.map +0 -1
  418. package/dist/tools.d.ts +0 -223
  419. package/dist/tools.d.ts.map +0 -1
  420. package/dist/tools.js +0 -325
  421. package/dist/tools.js.map +0 -1
  422. package/dist/treasury-ops.d.ts +0 -101
  423. package/dist/treasury-ops.d.ts.map +0 -1
  424. package/dist/treasury-ops.js +0 -59
  425. package/dist/treasury-ops.js.map +0 -1
  426. package/dist/types.d.ts +0 -1193
  427. package/dist/types.d.ts.map +0 -1
  428. package/dist/types.js +0 -7
  429. package/dist/types.js.map +0 -1
  430. package/dist/wakeUpStack.d.ts +0 -94
  431. package/dist/wakeUpStack.d.ts.map +0 -1
  432. package/dist/wakeUpStack.js +0 -215
  433. package/dist/wakeUpStack.js.map +0 -1
  434. package/dist/workspace.d.ts +0 -318
  435. package/dist/workspace.d.ts.map +0 -1
  436. package/dist/workspace.js +0 -207
  437. package/dist/workspace.js.map +0 -1
  438. package/dist/xmtp.d.ts +0 -85
  439. package/dist/xmtp.d.ts.map +0 -1
  440. package/dist/xmtp.js +0 -250
  441. package/dist/xmtp.js.map +0 -1
@@ -1,376 +0,0 @@
1
- /**
2
- * GoalLoop — the L3 step-by-step execution engine for goal-driven agents.
3
- *
4
- * Invoked by `AutonomousAgent.bootstrapGoal()` when an agent was forged
5
- * with `initial_goal` set (typically via an L1 swarm suggestion).
6
- *
7
- * The loop:
8
- * 1. Asks the LLM "what's the next step?" given the goal + recent history
9
- * 2. Parses a JSON decision from the response
10
- * 3. Executes or records the decision
11
- * 4. Checks termination conditions (complete, budget, stuck, capability gap)
12
- *
13
- * Design choices (see ROADMAP_orchestrator-swarm-autodeploy.md §3):
14
- * - Atomic goals, no project decomposition (v1 simplification)
15
- * - Budget is soft — the real gate is owner NOOK balance, not the goal cap
16
- * - 3 reformulations of the same step → blocked_stuck
17
- * - 3 consecutive no-ops → treat as complete (the agent has nothing else to do)
18
- *
19
- * @module goal/goalLoop
20
- */
21
- import { GOAL_STEP_SYSTEM_PROMPT, buildGoalStepUserPrompt } from "./goalPrompts.js";
22
- import { buildCorrectivePrompt, checkForDoomLoopFromSignatures, makeSignature, } from "../doomLoop.js";
23
- const DEFAULT_MAX_STEPS = 20;
24
- const DEFAULT_MAX_NOOPS = 3;
25
- const DEFAULT_MAX_REFORMULATIONS = 3;
26
- const DOOM_LOOP_MAX_TRIGGERS = 3;
27
- const DOOM_LOOP_SIGNATURE_WINDOW = 30;
28
- export class GoalLoop {
29
- runtime;
30
- goal;
31
- budgetNook;
32
- maxSteps;
33
- maxNoops;
34
- maxReformulations;
35
- verbose;
36
- inferenceCall;
37
- parentSwarmId;
38
- recentSteps = [];
39
- spentNook = 0n;
40
- stepsExecuted = 0;
41
- toolSignatures = [];
42
- doomLoopTriggers = 0;
43
- doomLoopNote = null;
44
- constructor(opts) {
45
- this.runtime = opts.runtime;
46
- this.goal = opts.goal;
47
- this.budgetNook = opts.budgetNook;
48
- this.maxSteps = opts.maxSteps ?? DEFAULT_MAX_STEPS;
49
- this.maxNoops = opts.maxConsecutiveNoops ?? DEFAULT_MAX_NOOPS;
50
- this.maxReformulations = opts.maxReformulations ?? DEFAULT_MAX_REFORMULATIONS;
51
- this.verbose = opts.verbose ?? false;
52
- this.parentSwarmId = opts.parentSwarmId ?? null;
53
- this.inferenceCall = opts.inferenceCall ?? this.defaultInferenceCall.bind(this);
54
- }
55
- /**
56
- * Run the loop to completion. Returns exactly one of four outcomes.
57
- * Never throws for normal termination — only throws for unrecoverable
58
- * infrastructure errors (e.g. runtime not connected).
59
- */
60
- async run() {
61
- let consecutiveNoops = 0;
62
- let sameStepRepetitions = 0;
63
- let lastStepDescription = "";
64
- for (let step = 0; step < this.maxSteps; step++) {
65
- const decision = await this.askLLMForNextAction();
66
- if (!decision) {
67
- consecutiveNoops++;
68
- if (consecutiveNoops >= this.maxNoops) {
69
- return this.finalizeFallback("LLM returned unparseable output 3x");
70
- }
71
- continue;
72
- }
73
- // --- Termination check: complete ---
74
- if (decision.type === "complete") {
75
- return {
76
- outcome: "complete",
77
- artifact: {
78
- title: decision.title?.slice(0, 200) || "Goal artifact",
79
- body: decision.body?.slice(0, 80_000) || "(empty)",
80
- domain: decision.domain?.slice(0, 120) || "general",
81
- },
82
- stepsExecuted: this.stepsExecuted,
83
- spentNook: this.spentNook,
84
- };
85
- }
86
- // --- Termination check: capability gap ---
87
- if (decision.type === "needs_capability") {
88
- return {
89
- outcome: "blocked_capability",
90
- capabilityNeeded: decision.description.slice(0, 1000),
91
- suggestedPreset: decision.suggestedPreset,
92
- spentNook: this.spentNook,
93
- };
94
- }
95
- // --- Stuck detection (same step repeated N times) ---
96
- if (decision.description === lastStepDescription) {
97
- sameStepRepetitions++;
98
- if (sameStepRepetitions >= this.maxReformulations) {
99
- return {
100
- outcome: "blocked_stuck",
101
- stuckReason: decision.description.slice(0, 1000),
102
- spentNook: this.spentNook,
103
- };
104
- }
105
- }
106
- else {
107
- sameStepRepetitions = 0;
108
- }
109
- lastStepDescription = decision.description;
110
- // --- No-op ---
111
- if (decision.type === "noop") {
112
- consecutiveNoops++;
113
- if (consecutiveNoops >= this.maxNoops) {
114
- return this.finalizeFallback("agent returned 3 no-ops in a row");
115
- }
116
- await this.recordStepRemotely(step + 1, "noop", decision.description, "", 0);
117
- continue;
118
- }
119
- consecutiveNoops = 0;
120
- // --- Execute the action ---
121
- const execResult = await this.executeAction(decision);
122
- this.spentNook += BigInt(Math.max(0, Math.round(execResult.costNook)));
123
- this.stepsExecuted++;
124
- this.recentSteps.push({
125
- stepNumber: step + 1,
126
- actionType: decision.actionName,
127
- outputSummary: execResult.output,
128
- });
129
- if (this.recentSteps.length > 16)
130
- this.recentSteps.shift();
131
- await this.recordStepRemotely(step + 1, decision.actionName, decision.description, execResult.output, execResult.costNook);
132
- // --- Doom-loop detection (same tool+args 3x, or A,B,A,B patterns) ---
133
- // Triggers inject a corrective prompt for the next turn.
134
- // 3 triggers in one goal short-circuits to blocked_stuck.
135
- this.toolSignatures.push(makeSignature(decision.actionName, decision.actionParams));
136
- if (this.toolSignatures.length > DOOM_LOOP_SIGNATURE_WINDOW) {
137
- this.toolSignatures = this.toolSignatures.slice(-DOOM_LOOP_SIGNATURE_WINDOW);
138
- }
139
- const offender = checkForDoomLoopFromSignatures(this.toolSignatures);
140
- if (offender) {
141
- this.doomLoopTriggers++;
142
- if (this.doomLoopTriggers >= DOOM_LOOP_MAX_TRIGGERS) {
143
- return {
144
- outcome: "blocked_stuck",
145
- stuckReason: `doom loop on '${offender}' (${this.doomLoopTriggers} triggers)`.slice(0, 1000),
146
- spentNook: this.spentNook,
147
- };
148
- }
149
- this.doomLoopNote = buildCorrectivePrompt(offender);
150
- }
151
- // --- Soft budget warning (non-blocking) ---
152
- if (this.spentNook > this.budgetNook) {
153
- if (this.verbose) {
154
- console.warn(`[goalLoop] Over soft budget: spent=${this.spentNook} budget=${this.budgetNook}`);
155
- }
156
- }
157
- }
158
- // Hit maxSteps cap without calling `complete` — treat as done.
159
- return this.finalizeFallback(`hit maxSteps cap (${this.maxSteps})`);
160
- }
161
- // =======================================================================
162
- // Private helpers
163
- // =======================================================================
164
- async askLLMForNextAction() {
165
- try {
166
- let userPrompt = buildGoalStepUserPrompt(this.goal, this.recentSteps, this.spentNook, this.budgetNook);
167
- if (this.doomLoopNote) {
168
- userPrompt = `${this.doomLoopNote}\n\n---\n\n${userPrompt}`;
169
- this.doomLoopNote = null;
170
- }
171
- const response = await this.inferenceCall({
172
- systemPrompt: GOAL_STEP_SYSTEM_PROMPT,
173
- userPrompt,
174
- maxTokens: 1024,
175
- temperature: 0.5,
176
- });
177
- this.spentNook += BigInt(Math.max(0, Math.round(response.costNook ?? 0)));
178
- return parseGoalAction(response.content);
179
- }
180
- catch (err) {
181
- if (this.verbose) {
182
- console.error("[goalLoop] LLM call failed:", err);
183
- }
184
- return null;
185
- }
186
- }
187
- /**
188
- * Default inference caller — uses the runtime's inference API if available,
189
- * otherwise returns a noop response. Consumers with custom inference wiring
190
- * should pass `inferenceCall` in GoalLoopOptions.
191
- */
192
- async defaultInferenceCall(input) {
193
- // The runtime economy manager exposes inference via /v1/agents/me/inference.
194
- // We don't take a hard dependency on its exact API here — cast through
195
- // unknown so environments without inference wired up fall through cleanly.
196
- const economy = this.runtime.economy;
197
- if (!economy?.inference) {
198
- throw new Error("GoalLoop has no inferenceCall configured and runtime.economy.inference is unavailable");
199
- }
200
- const result = (await economy.inference({
201
- messages: [
202
- { role: "system", content: input.systemPrompt },
203
- { role: "user", content: input.userPrompt },
204
- ],
205
- maxTokens: input.maxTokens,
206
- temperature: input.temperature,
207
- }));
208
- return {
209
- content: result.content ?? "",
210
- costNook: result.costNook,
211
- };
212
- }
213
- /**
214
- * Execute one action via the runtime's action dispatch pipeline.
215
- *
216
- * All actions go through `POST /v1/actions/execute` which handles both
217
- * off-chain (direct) and on-chain (sign-required) action types. This
218
- * preserves the CLAUDE.md Rule 5 invariant that all on-chain state
219
- * changes go through prepare → sign → relay.
220
- */
221
- async executeAction(action) {
222
- try {
223
- const connection = this.runtime.connection;
224
- if (!connection?.request) {
225
- return { ok: false, output: "runtime not connected", costNook: 0 };
226
- }
227
- const dispatchResult = (await connection.request("POST", "/v1/actions/execute", {
228
- toolName: `nookplot_${action.actionName}`,
229
- payload: action.actionParams,
230
- }));
231
- const status = dispatchResult?.status ?? "completed";
232
- if (status === "error") {
233
- return {
234
- ok: false,
235
- output: String(dispatchResult.error ?? "action failed").slice(0, 500),
236
- costNook: 0,
237
- error: dispatchResult.error,
238
- };
239
- }
240
- // NOTE: sign_required actions are NOT auto-signed here. The goal loop
241
- // v1 focuses on off-chain research/synthesis tools. If the LLM requests
242
- // an on-chain action, we return it to the loop as output but do NOT
243
- // execute — the autonomous signal path handles approval + relay for
244
- // delegated actions separately.
245
- if (status === "sign_required") {
246
- return {
247
- ok: true,
248
- output: `[sign_required] ${action.actionName} — skipped in goal loop v1 (use directive or on-chain action flow)`,
249
- costNook: 0,
250
- };
251
- }
252
- const outputText = typeof dispatchResult.result === "string"
253
- ? dispatchResult.result
254
- : JSON.stringify(dispatchResult.result ?? {}).slice(0, 500);
255
- return {
256
- ok: true,
257
- output: outputText.slice(0, 500),
258
- costNook: Number(dispatchResult.costNook ?? 0),
259
- };
260
- }
261
- catch (err) {
262
- const msg = err instanceof Error ? err.message : String(err);
263
- return { ok: false, output: msg.slice(0, 500), costNook: 0, error: msg };
264
- }
265
- }
266
- async recordStepRemotely(stepNumber, actionType, inputSummary, outputSummary, costNook) {
267
- try {
268
- await this.runtime.identity.recordGoalStep({
269
- stepNumber,
270
- actionType,
271
- inputSummary: inputSummary.slice(0, 500),
272
- outputSummary: outputSummary.slice(0, 500),
273
- nookSpent: Math.max(0, Math.round(costNook)),
274
- });
275
- }
276
- catch (err) {
277
- if (this.verbose) {
278
- console.error("[goalLoop] recordGoalStep failed:", err);
279
- }
280
- // Non-fatal — the loop continues
281
- }
282
- }
283
- /**
284
- * Treat the current state as a completed goal. Used when the LLM stalls
285
- * or the max step count is exceeded. Produces a summary artifact from
286
- * the recent step history so the user has something to review.
287
- */
288
- finalizeFallback(reason) {
289
- const body = this.recentSteps.length === 0
290
- ? `Goal loop terminated: ${reason}.\n\nNo progress was made on: ${this.goal}`
291
- : [
292
- `# Goal Progress`,
293
- ``,
294
- `**Goal:** ${this.goal}`,
295
- ``,
296
- `**Termination:** ${reason}`,
297
- ``,
298
- `**Steps executed:** ${this.stepsExecuted}`,
299
- ``,
300
- `## Recent steps`,
301
- ``,
302
- ...this.recentSteps.map((s, i) => `${i + 1}. **${s.actionType ?? "?"}** — ${(s.outputSummary ?? "").slice(0, 200)}`),
303
- ].join("\n");
304
- return {
305
- outcome: "complete",
306
- artifact: {
307
- title: this.goal.slice(0, 200),
308
- body,
309
- domain: "goal-fallback",
310
- },
311
- stepsExecuted: this.stepsExecuted,
312
- spentNook: this.spentNook,
313
- };
314
- }
315
- }
316
- // ---------------------------------------------------------------------------
317
- // JSON parsing — tolerant to prose wrapping the JSON block
318
- // ---------------------------------------------------------------------------
319
- /**
320
- * Parse a goal action from an LLM response. Tries to extract the first
321
- * `{...}` JSON block from the content and coerce it into a GoalAction.
322
- *
323
- * Exported for unit testing.
324
- */
325
- export function parseGoalAction(content) {
326
- if (!content)
327
- return null;
328
- const match = content.match(/\{[\s\S]*\}/);
329
- if (!match)
330
- return null;
331
- let parsed;
332
- try {
333
- parsed = JSON.parse(match[0]);
334
- }
335
- catch {
336
- return null;
337
- }
338
- if (!parsed || typeof parsed !== "object")
339
- return null;
340
- const obj = parsed;
341
- const type = typeof obj.type === "string" ? obj.type : null;
342
- if (!type)
343
- return null;
344
- if (type === "action") {
345
- const actionName = typeof obj.action_name === "string" ? obj.action_name : "";
346
- const actionParams = typeof obj.action_params === "object" && obj.action_params !== null
347
- ? obj.action_params
348
- : {};
349
- const description = typeof obj.description === "string" ? obj.description : actionName;
350
- if (!actionName)
351
- return null;
352
- return { type: "action", actionName, actionParams, description };
353
- }
354
- if (type === "complete") {
355
- const title = typeof obj.title === "string" ? obj.title : "";
356
- const body = typeof obj.body === "string" ? obj.body : "";
357
- const domain = typeof obj.domain === "string" ? obj.domain : "general";
358
- const description = typeof obj.description === "string" ? obj.description : "complete";
359
- if (!title || !body)
360
- return null;
361
- return { type: "complete", title, body, domain, description };
362
- }
363
- if (type === "noop") {
364
- const description = typeof obj.description === "string" ? obj.description : "noop";
365
- return { type: "noop", description };
366
- }
367
- if (type === "needs_capability") {
368
- const description = typeof obj.description === "string" ? obj.description : "";
369
- const suggestedPreset = typeof obj.suggested_preset === "string" ? obj.suggested_preset : undefined;
370
- if (!description)
371
- return null;
372
- return { type: "needs_capability", description, suggestedPreset };
373
- }
374
- return null;
375
- }
376
- //# sourceMappingURL=goalLoop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"goalLoop.js","sourceRoot":"","sources":["../../src/goal/goalLoop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AASH,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,aAAa,GAEd,MAAM,gBAAgB,CAAC;AAQxB,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,0BAA0B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C,CAAC,CAAC,UAAU,CAAC;QACvF,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACjC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAChE,CAAC;IAED,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,MAAM,WAAW,GAAG,OAAO,GAAG,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;QACnF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IACvC,CAAC;IAED,IAAI,IAAI,KAAK,kBAAkB,EAAE,CAAC;QAChC,MAAM,WAAW,GAAG,OAAO,GAAG,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/E,MAAM,eAAe,GAAG,OAAO,GAAG,CAAC,gBAAgB,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC;QACpG,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC;QAC9B,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;IACpE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,20 +0,0 @@
1
- /**
2
- * Prompt templates for the goal loop.
3
- *
4
- * The system prompt is deliberately terse — the agent's own soul (personality,
5
- * style) is layered on top by whatever higher-level chat driver the consumer
6
- * chooses. The goal loop cares only about producing valid JSON actions.
7
- *
8
- * @module goal/goalPrompts
9
- */
10
- export declare const GOAL_STEP_SYSTEM_PROMPT = "You are an autonomous Nookplot agent working on a specific goal. Each turn, you choose the single next action that moves you toward completion.\n\nYou have access to tools including web_search (search the live web), search_knowledge (query your KG + mining traces + network), egress_request (call external APIs), and publishing actions.\n\nYour decision each turn is ONE of:\n\n1. Execute an action \u2014 return { \"type\": \"action\", \"action_name\": \"...\", \"action_params\": {...}, \"description\": \"...\" }\n2. Complete the goal \u2014 return { \"type\": \"complete\", \"title\": \"...\", \"body\": \"<final markdown artifact>\", \"domain\": \"<short topic>\", \"description\": \"...\" }\n3. Declare no-op \u2014 return { \"type\": \"noop\", \"description\": \"...\" } (use sparingly; 3 consecutive no-ops ends the goal)\n4. Declare capability gap \u2014 return { \"type\": \"needs_capability\", \"description\": \"...\", \"suggested_preset\": \"...\" | null }\n\nRules:\n- Be concise and focused. Do NOT explore beyond the goal.\n- Cite sources in the body when using web_search results.\n- Prefer search_knowledge (free) before web_search (costs credits) for anything that might be in the knowledge graph.\n- You have a hard cap of 20 steps. Do not waste them.\n- If the goal is ambiguous, interpret narrowly \u2014 complete a narrow version rather than wandering broadly.\n- Budget is a soft cap \u2014 stay under if you can, but the goal matters more than the estimate.\n- When finished, ALWAYS return type \"complete\" with the deliverable in \"body\". Do NOT keep iterating after the goal is achieved.\n\nReturn only valid JSON. No prose outside the JSON block.";
11
- /**
12
- * Build the per-step user prompt. Includes the goal, recent steps, and
13
- * current spend. Kept deliberately compact to fit alongside the catalog
14
- * of available actions that the consumer may choose to append.
15
- */
16
- export declare function buildGoalStepUserPrompt(goal: string, previousSteps: Array<{
17
- actionType: string | null;
18
- outputSummary: string | null;
19
- }>, spentNook: bigint, budgetNook: bigint): string;
20
- //# sourceMappingURL=goalPrompts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"goalPrompts.d.ts","sourceRoot":"","sources":["../../src/goal/goalPrompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,uBAAuB,kpDAoBqB,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,KAAK,CAAC;IAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,EACjF,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,MAAM,CAkBR"}
@@ -1,54 +0,0 @@
1
- /**
2
- * Prompt templates for the goal loop.
3
- *
4
- * The system prompt is deliberately terse — the agent's own soul (personality,
5
- * style) is layered on top by whatever higher-level chat driver the consumer
6
- * chooses. The goal loop cares only about producing valid JSON actions.
7
- *
8
- * @module goal/goalPrompts
9
- */
10
- export const GOAL_STEP_SYSTEM_PROMPT = `You are an autonomous Nookplot agent working on a specific goal. Each turn, you choose the single next action that moves you toward completion.
11
-
12
- You have access to tools including web_search (search the live web), search_knowledge (query your KG + mining traces + network), egress_request (call external APIs), and publishing actions.
13
-
14
- Your decision each turn is ONE of:
15
-
16
- 1. Execute an action — return { "type": "action", "action_name": "...", "action_params": {...}, "description": "..." }
17
- 2. Complete the goal — return { "type": "complete", "title": "...", "body": "<final markdown artifact>", "domain": "<short topic>", "description": "..." }
18
- 3. Declare no-op — return { "type": "noop", "description": "..." } (use sparingly; 3 consecutive no-ops ends the goal)
19
- 4. Declare capability gap — return { "type": "needs_capability", "description": "...", "suggested_preset": "..." | null }
20
-
21
- Rules:
22
- - Be concise and focused. Do NOT explore beyond the goal.
23
- - Cite sources in the body when using web_search results.
24
- - Prefer search_knowledge (free) before web_search (costs credits) for anything that might be in the knowledge graph.
25
- - You have a hard cap of 20 steps. Do not waste them.
26
- - If the goal is ambiguous, interpret narrowly — complete a narrow version rather than wandering broadly.
27
- - Budget is a soft cap — stay under if you can, but the goal matters more than the estimate.
28
- - When finished, ALWAYS return type "complete" with the deliverable in "body". Do NOT keep iterating after the goal is achieved.
29
-
30
- Return only valid JSON. No prose outside the JSON block.`;
31
- /**
32
- * Build the per-step user prompt. Includes the goal, recent steps, and
33
- * current spend. Kept deliberately compact to fit alongside the catalog
34
- * of available actions that the consumer may choose to append.
35
- */
36
- export function buildGoalStepUserPrompt(goal, previousSteps, spentNook, budgetNook) {
37
- const spent = spentNook.toString();
38
- const budget = budgetNook.toString();
39
- const stepsText = previousSteps.length === 0
40
- ? "(no previous steps)"
41
- : previousSteps
42
- .slice(-8)
43
- .map((s, i) => `${i + 1}. ${s.actionType ?? "?"}: ${(s.outputSummary ?? "").slice(0, 180)}`)
44
- .join("\n");
45
- return `Goal: ${goal}
46
-
47
- Previous steps:
48
- ${stepsText}
49
-
50
- Spent so far: ${spent} / ${budget} NOOK (soft cap)
51
-
52
- Choose the next action. Return JSON only.`;
53
- }
54
- //# sourceMappingURL=goalPrompts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"goalPrompts.js","sourceRoot":"","sources":["../../src/goal/goalPrompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;yDAoBkB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAY,EACZ,aAAiF,EACjF,SAAiB,EACjB,UAAkB;IAElB,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC;IACrC,MAAM,SAAS,GAAG,aAAa,CAAC,MAAM,KAAK,CAAC;QAC1C,CAAC,CAAC,qBAAqB;QACvB,CAAC,CAAC,aAAa;aACV,KAAK,CAAC,CAAC,CAAC,CAAC;aACT,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,UAAU,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;aAC3F,IAAI,CAAC,IAAI,CAAC,CAAC;IAElB,OAAO,SAAS,IAAI;;;EAGpB,SAAS;;gBAEK,KAAK,MAAM,MAAM;;0CAES,CAAC;AAC3C,CAAC"}
@@ -1,98 +0,0 @@
1
- /**
2
- * Goal loop types — shared interfaces for the L3 autonomous goal execution loop.
3
- *
4
- * @module goal/types
5
- */
6
- import type { NookplotRuntime } from "../index.js";
7
- /**
8
- * One action the LLM can return each turn of the goal loop.
9
- * Parsed from the model's JSON response.
10
- */
11
- export type GoalAction = {
12
- type: "action";
13
- actionName: string;
14
- actionParams: Record<string, unknown>;
15
- description: string;
16
- } | {
17
- type: "complete";
18
- title: string;
19
- body: string;
20
- domain: string;
21
- description: string;
22
- } | {
23
- type: "noop";
24
- description: string;
25
- } | {
26
- type: "needs_capability";
27
- description: string;
28
- suggestedPreset?: string;
29
- };
30
- /**
31
- * Terminal state of a GoalLoop.run() invocation. Always one of the four
32
- * outcomes — the loop never throws for normal termination conditions.
33
- */
34
- export type GoalResult = {
35
- outcome: "complete";
36
- artifact: {
37
- title: string;
38
- body: string;
39
- domain: string;
40
- };
41
- stepsExecuted: number;
42
- spentNook: bigint;
43
- } | {
44
- outcome: "blocked_budget";
45
- spentNook: bigint;
46
- } | {
47
- outcome: "blocked_stuck";
48
- stuckReason: string;
49
- spentNook: bigint;
50
- } | {
51
- outcome: "blocked_capability";
52
- capabilityNeeded: string;
53
- suggestedPreset?: string;
54
- spentNook: bigint;
55
- };
56
- /**
57
- * Configuration for a single run of the GoalLoop.
58
- */
59
- export interface GoalLoopOptions {
60
- runtime: NookplotRuntime;
61
- goal: string;
62
- /** Soft cap — loop continues past this but emits a warning. */
63
- budgetNook: bigint;
64
- parentSwarmId?: string | null;
65
- /** Hard stop on step count. Default 20. */
66
- maxSteps?: number;
67
- /** Hard stop on consecutive no-op responses. Default 3. */
68
- maxConsecutiveNoops?: number;
69
- /** Hard stop on consecutive identical step descriptions. Default 3. */
70
- maxReformulations?: number;
71
- /** Optional verbose logging. */
72
- verbose?: boolean;
73
- /**
74
- * Optional LLM caller — defaults to runtime.economy.inference or a runtime
75
- * provided by the consumer. The caller is abstracted because different
76
- * environments wire inference differently (platform / BYOK / Ollama).
77
- */
78
- inferenceCall?: (input: {
79
- systemPrompt: string;
80
- userPrompt: string;
81
- maxTokens: number;
82
- temperature: number;
83
- }) => Promise<{
84
- content: string;
85
- costNook?: number;
86
- }>;
87
- }
88
- /**
89
- * Result of executing a single step within the goal loop.
90
- * costNook is optional because many actions are free (off-chain tools).
91
- */
92
- export interface StepExecutionResult {
93
- ok: boolean;
94
- output: string;
95
- costNook: number;
96
- error?: string;
97
- }
98
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/goal/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;CACrB,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB,GACD;IACE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,GACD;IACE,IAAI,EAAE,kBAAkB,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEN;;;GAGG;AACH,MAAM,MAAM,UAAU,GAClB;IACE,OAAO,EAAE,UAAU,CAAC;IACpB,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,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AAM,CAAC;CAChB"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Goal loop types — shared interfaces for the L3 autonomous goal execution loop.
3
- *
4
- * @module goal/types
5
- */
6
- export {};
7
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/goal/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}