wunderland 0.72.2 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1146) hide show
  1. package/README.md +6 -8
  2. package/dist/agents/builder/AgentManifest.d.ts +1 -1
  3. package/dist/agents/builder/AgentManifest.d.ts.map +1 -1
  4. package/dist/agents/builder/NaturalLanguageAgentBuilder.d.ts +2 -2
  5. package/dist/agents/builder/NaturalLanguageAgentBuilder.d.ts.map +1 -1
  6. package/dist/agents/builder/WunderlandSeed.d.ts +3 -3
  7. package/dist/agents/builder/WunderlandSeed.d.ts.map +1 -1
  8. package/dist/agents/builder/WunderlandSeed.js +1 -1
  9. package/dist/agents/builder/WunderlandSeed.js.map +1 -1
  10. package/dist/agents/builder/validation.d.ts +2 -2
  11. package/dist/agents/builder/validation.d.ts.map +1 -1
  12. package/dist/agents/builder/validation.js +1 -1
  13. package/dist/agents/builder/validation.js.map +1 -1
  14. package/dist/agents/lifecycle/AgentBootstrap.d.ts +8 -8
  15. package/dist/agents/lifecycle/AgentBootstrap.d.ts.map +1 -1
  16. package/dist/agents/lifecycle/AgentBootstrap.js +21 -21
  17. package/dist/agents/lifecycle/AgentBootstrap.js.map +1 -1
  18. package/dist/agents/lifecycle/SeedNetworkManager.d.ts +1 -1
  19. package/dist/agents/lifecycle/SeedNetworkManager.d.ts.map +1 -1
  20. package/dist/agents/presets/PresetLoader.d.ts +1 -1
  21. package/dist/agents/presets/PresetLoader.d.ts.map +1 -1
  22. package/dist/agents/presets/resolve-skill-context.d.ts +23 -0
  23. package/dist/agents/presets/resolve-skill-context.d.ts.map +1 -0
  24. package/dist/agents/presets/resolve-skill-context.js +165 -0
  25. package/dist/agents/presets/resolve-skill-context.js.map +1 -0
  26. package/dist/agents/prompts/PromptBuilder.d.ts +1 -1
  27. package/dist/agents/prompts/PromptBuilder.d.ts.map +1 -1
  28. package/dist/autonomy/jobs/JobEvaluator.d.ts +1 -1
  29. package/dist/autonomy/jobs/JobEvaluator.d.ts.map +1 -1
  30. package/dist/autonomy/jobs/JobMemoryService.d.ts +1 -1
  31. package/dist/autonomy/jobs/JobMemoryService.d.ts.map +1 -1
  32. package/dist/autonomy/orchestration/mission-tools.d.ts +10 -0
  33. package/dist/autonomy/orchestration/mission-tools.d.ts.map +1 -0
  34. package/dist/autonomy/orchestration/mission-tools.js +32 -0
  35. package/dist/autonomy/orchestration/mission-tools.js.map +1 -0
  36. package/dist/autonomy/orchestration/yaml-compiler.d.ts +1 -0
  37. package/dist/autonomy/orchestration/yaml-compiler.d.ts.map +1 -1
  38. package/dist/autonomy/orchestration/yaml-compiler.js +3 -0
  39. package/dist/autonomy/orchestration/yaml-compiler.js.map +1 -1
  40. package/dist/autonomy/scheduling/CronScheduler.d.ts +27 -2
  41. package/dist/autonomy/scheduling/CronScheduler.d.ts.map +1 -1
  42. package/dist/autonomy/scheduling/CronScheduler.js +95 -27
  43. package/dist/autonomy/scheduling/CronScheduler.js.map +1 -1
  44. package/dist/autonomy/social/BrowsingEngine.d.ts +1 -1
  45. package/dist/autonomy/social/BrowsingEngine.d.ts.map +1 -1
  46. package/dist/autonomy/social/DynamicVoiceProfile.d.ts +1 -1
  47. package/dist/autonomy/social/DynamicVoiceProfile.d.ts.map +1 -1
  48. package/dist/autonomy/social/InputManifest.d.ts +2 -2
  49. package/dist/autonomy/social/InputManifest.d.ts.map +1 -1
  50. package/dist/autonomy/social/InputManifest.js +1 -1
  51. package/dist/autonomy/social/InputManifest.js.map +1 -1
  52. package/dist/autonomy/social/MoodEngine.d.ts +1 -1
  53. package/dist/autonomy/social/MoodEngine.d.ts.map +1 -1
  54. package/dist/autonomy/social/NewsroomAgency.d.ts +1 -1
  55. package/dist/autonomy/social/NewsroomAgency.d.ts.map +1 -1
  56. package/dist/autonomy/social/NewsroomAgency.js +2 -2
  57. package/dist/autonomy/social/NewsroomAgency.js.map +1 -1
  58. package/dist/autonomy/social/PostDecisionEngine.d.ts +1 -1
  59. package/dist/autonomy/social/PostDecisionEngine.d.ts.map +1 -1
  60. package/dist/autonomy/social/ToolAccessProfiles.d.ts +2 -2
  61. package/dist/autonomy/social/ToolAccessProfiles.d.ts.map +1 -1
  62. package/dist/autonomy/social/ToolAccessProfiles.js +13 -4
  63. package/dist/autonomy/social/ToolAccessProfiles.js.map +1 -1
  64. package/dist/autonomy/social/TraitEvolution.d.ts +1 -1
  65. package/dist/autonomy/social/TraitEvolution.d.ts.map +1 -1
  66. package/dist/autonomy/social/TrustEngine.d.ts +1 -1
  67. package/dist/autonomy/social/TrustEngine.d.ts.map +1 -1
  68. package/dist/autonomy/social/WonderlandNetwork.js +1 -1
  69. package/dist/autonomy/social/WonderlandNetwork.js.map +1 -1
  70. package/dist/autonomy/social/types.d.ts +1 -1
  71. package/dist/autonomy/social/types.d.ts.map +1 -1
  72. package/dist/bootstrap/index.d.ts +4 -4
  73. package/dist/bootstrap/index.d.ts.map +1 -1
  74. package/dist/bootstrap/index.js +4 -4
  75. package/dist/bootstrap/index.js.map +1 -1
  76. package/dist/channels/api/api-index.d.ts.map +1 -0
  77. package/dist/channels/api/api-index.js.map +1 -0
  78. package/dist/channels/api/chat-runtime.d.ts +68 -0
  79. package/dist/channels/api/chat-runtime.d.ts.map +1 -0
  80. package/dist/channels/api/chat-runtime.js +123 -0
  81. package/dist/channels/api/chat-runtime.js.map +1 -0
  82. package/dist/channels/api/index.d.ts.map +1 -0
  83. package/dist/channels/api/index.js.map +1 -0
  84. package/dist/channels/api/rate-limiter.d.ts.map +1 -0
  85. package/dist/channels/api/rate-limiter.js.map +1 -0
  86. package/dist/channels/api/routes/agents.d.ts.map +1 -0
  87. package/dist/channels/api/routes/agents.js.map +1 -0
  88. package/dist/channels/api/routes/chat.d.ts.map +1 -0
  89. package/dist/channels/api/routes/chat.js +287 -0
  90. package/dist/channels/api/routes/chat.js.map +1 -0
  91. package/dist/channels/api/routes/config.d.ts.map +1 -0
  92. package/dist/channels/api/routes/config.js.map +1 -0
  93. package/dist/channels/api/routes/health.d.ts.map +1 -0
  94. package/dist/channels/api/routes/health.js.map +1 -0
  95. package/dist/channels/api/routes/index.d.ts.map +1 -0
  96. package/dist/channels/api/routes/index.js.map +1 -0
  97. package/dist/channels/api/routes/social.d.ts.map +1 -0
  98. package/dist/channels/api/routes/social.js.map +1 -0
  99. package/dist/channels/api/routes/types.d.ts +85 -0
  100. package/dist/channels/api/routes/types.d.ts.map +1 -0
  101. package/dist/channels/api/routes/types.js.map +1 -0
  102. package/dist/channels/api/server-helpers.d.ts +32 -0
  103. package/dist/channels/api/server-helpers.d.ts.map +1 -0
  104. package/dist/channels/api/server-helpers.js.map +1 -0
  105. package/dist/channels/api/server.d.ts +97 -0
  106. package/dist/channels/api/server.d.ts.map +1 -0
  107. package/dist/channels/api/server.js +1065 -0
  108. package/dist/channels/api/server.js.map +1 -0
  109. package/dist/channels/api/types.d.ts +527 -0
  110. package/dist/channels/api/types.d.ts.map +1 -0
  111. package/dist/channels/api/types.js.map +1 -0
  112. package/dist/channels/browser/BrowserClient.d.ts.map +1 -0
  113. package/dist/channels/browser/BrowserClient.js.map +1 -0
  114. package/dist/channels/browser/BrowserInteractions.d.ts.map +1 -0
  115. package/dist/channels/browser/BrowserInteractions.js.map +1 -0
  116. package/dist/channels/browser/BrowserSession.d.ts.map +1 -0
  117. package/dist/channels/browser/BrowserSession.js.map +1 -0
  118. package/dist/channels/browser/browser-index.d.ts.map +1 -0
  119. package/dist/channels/browser/browser-index.js.map +1 -0
  120. package/dist/channels/browser/index.d.ts.map +1 -0
  121. package/dist/channels/browser/index.js.map +1 -0
  122. package/dist/channels/browser/types.d.ts.map +1 -0
  123. package/dist/channels/browser/types.js.map +1 -0
  124. package/dist/channels/chat/ChatTaskResponder.d.ts +22 -0
  125. package/dist/channels/chat/ChatTaskResponder.d.ts.map +1 -1
  126. package/dist/channels/chat/ChatTaskResponder.js +37 -5
  127. package/dist/channels/chat/ChatTaskResponder.js.map +1 -1
  128. package/dist/channels/chat/types.d.ts +10 -0
  129. package/dist/channels/chat/types.d.ts.map +1 -1
  130. package/dist/channels/voice/call-client.d.ts.map +1 -0
  131. package/dist/channels/voice/call-client.js.map +1 -0
  132. package/dist/channels/voice/index.d.ts.map +1 -0
  133. package/dist/channels/voice/index.js.map +1 -0
  134. package/dist/channels/voice/speech-catalog.d.ts.map +1 -0
  135. package/dist/channels/voice/speech-catalog.js.map +1 -0
  136. package/dist/channels/voice/streaming-pipeline.d.ts.map +1 -0
  137. package/dist/channels/voice/streaming-pipeline.js +305 -0
  138. package/dist/channels/voice/streaming-pipeline.js.map +1 -0
  139. package/dist/channels/voice/telephony-webhook-server.d.ts.map +1 -0
  140. package/dist/channels/voice/telephony-webhook-server.js.map +1 -0
  141. package/dist/channels/voice/voice-index.d.ts.map +1 -0
  142. package/dist/channels/voice/voice-index.js.map +1 -0
  143. package/dist/channels/voice/ws-server.d.ts.map +1 -0
  144. package/dist/channels/voice/ws-server.js +187 -0
  145. package/dist/channels/voice/ws-server.js.map +1 -0
  146. package/dist/cli/commands/ChatREPL.d.ts +1 -1
  147. package/dist/cli/commands/ChatREPL.d.ts.map +1 -1
  148. package/dist/cli/commands/ChatREPL.js +1 -1
  149. package/dist/cli/commands/ChatREPL.js.map +1 -1
  150. package/dist/cli/commands/ChatStreamRenderer.d.ts +1 -1
  151. package/dist/cli/commands/ChatStreamRenderer.d.ts.map +1 -1
  152. package/dist/cli/commands/ChatStreamRenderer.js +1 -1
  153. package/dist/cli/commands/ChatStreamRenderer.js.map +1 -1
  154. package/dist/cli/commands/agency.js +1 -1
  155. package/dist/cli/commands/agency.js.map +1 -1
  156. package/dist/cli/commands/agent/serve.js +1 -1
  157. package/dist/cli/commands/agent/serve.js.map +1 -1
  158. package/dist/cli/commands/ai/audio.js +2 -2
  159. package/dist/cli/commands/ai/audio.js.map +1 -1
  160. package/dist/cli/commands/ai/image.js +1 -1
  161. package/dist/cli/commands/ai/image.js.map +1 -1
  162. package/dist/cli/commands/ai/structured.js +1 -1
  163. package/dist/cli/commands/ai/structured.js.map +1 -1
  164. package/dist/cli/commands/ai/video.js +1 -1
  165. package/dist/cli/commands/ai/video.js.map +1 -1
  166. package/dist/cli/commands/batch-create.js +1 -1
  167. package/dist/cli/commands/batch-create.js.map +1 -1
  168. package/dist/cli/commands/chat-ui.d.ts +1 -1
  169. package/dist/cli/commands/chat-ui.d.ts.map +1 -1
  170. package/dist/cli/commands/chat.js +23 -23
  171. package/dist/cli/commands/chat.js.map +1 -1
  172. package/dist/cli/commands/create.js +1 -1
  173. package/dist/cli/commands/create.js.map +1 -1
  174. package/dist/cli/commands/cron.d.ts.map +1 -1
  175. package/dist/cli/commands/cron.js +5 -4
  176. package/dist/cli/commands/cron.js.map +1 -1
  177. package/dist/cli/commands/dashboard/routes/index.js +1 -1
  178. package/dist/cli/commands/dashboard/routes/index.js.map +1 -1
  179. package/dist/cli/commands/export-session.js +2 -2
  180. package/dist/cli/commands/export-session.js.map +1 -1
  181. package/dist/cli/commands/list-personas.js +1 -1
  182. package/dist/cli/commands/list-personas.js.map +1 -1
  183. package/dist/cli/commands/mission-model-flags.d.ts +52 -0
  184. package/dist/cli/commands/mission-model-flags.d.ts.map +1 -0
  185. package/dist/cli/commands/mission-model-flags.js +90 -0
  186. package/dist/cli/commands/mission-model-flags.js.map +1 -0
  187. package/dist/cli/commands/mission.d.ts.map +1 -1
  188. package/dist/cli/commands/mission.js +38 -16
  189. package/dist/cli/commands/mission.js.map +1 -1
  190. package/dist/cli/commands/new.js +1 -1
  191. package/dist/cli/commands/new.js.map +1 -1
  192. package/dist/cli/commands/provenance.js +1 -1
  193. package/dist/cli/commands/provenance.js.map +1 -1
  194. package/dist/cli/commands/rag.js +2 -2
  195. package/dist/cli/commands/rag.js.map +1 -1
  196. package/dist/cli/commands/spawn.js +1 -1
  197. package/dist/cli/commands/spawn.js.map +1 -1
  198. package/dist/cli/commands/start/adaptive-runtime-init.js +2 -2
  199. package/dist/cli/commands/start/adaptive-runtime-init.js.map +1 -1
  200. package/dist/cli/commands/start/agent-turn.d.ts +38 -0
  201. package/dist/cli/commands/start/agent-turn.d.ts.map +1 -0
  202. package/dist/cli/commands/start/agent-turn.js +110 -0
  203. package/dist/cli/commands/start/agent-turn.js.map +1 -0
  204. package/dist/cli/commands/start/channel-handler.d.ts +1 -1
  205. package/dist/cli/commands/start/channel-handler.d.ts.map +1 -1
  206. package/dist/cli/commands/start/channel-handler.js +5 -5
  207. package/dist/cli/commands/start/channel-handler.js.map +1 -1
  208. package/dist/cli/commands/start/config-loader.js +1 -1
  209. package/dist/cli/commands/start/config-loader.js.map +1 -1
  210. package/dist/cli/commands/start/extension-loader.js +8 -8
  211. package/dist/cli/commands/start/extension-loader.js.map +1 -1
  212. package/dist/cli/commands/start/http-server.js +1 -1
  213. package/dist/cli/commands/start/http-server.js.map +1 -1
  214. package/dist/cli/commands/start/llm-provider-setup.js +2 -2
  215. package/dist/cli/commands/start/llm-provider-setup.js.map +1 -1
  216. package/dist/cli/commands/start/local-memory-tool.d.ts +1 -1
  217. package/dist/cli/commands/start/local-memory-tool.d.ts.map +1 -1
  218. package/dist/cli/commands/start/local-memory-tool.js +2 -2
  219. package/dist/cli/commands/start/local-memory-tool.js.map +1 -1
  220. package/dist/cli/commands/start/routes/chat.js +4 -4
  221. package/dist/cli/commands/start/routes/chat.js.map +1 -1
  222. package/dist/cli/commands/start/routes/index.d.ts +2 -0
  223. package/dist/cli/commands/start/routes/index.d.ts.map +1 -1
  224. package/dist/cli/commands/start/routes/index.js +30 -0
  225. package/dist/cli/commands/start/routes/index.js.map +1 -1
  226. package/dist/cli/commands/start/routes/types.d.ts +1 -1
  227. package/dist/cli/commands/start/routes/types.d.ts.map +1 -1
  228. package/dist/cli/commands/start/routes/webhooks.d.ts +44 -0
  229. package/dist/cli/commands/start/routes/webhooks.d.ts.map +1 -0
  230. package/dist/cli/commands/start/routes/webhooks.js +106 -0
  231. package/dist/cli/commands/start/routes/webhooks.js.map +1 -0
  232. package/dist/cli/commands/start/seed-initializer.js +4 -4
  233. package/dist/cli/commands/start/seed-initializer.js.map +1 -1
  234. package/dist/cli/commands/start/skills-discovery-setup.js +2 -2
  235. package/dist/cli/commands/start/skills-discovery-setup.js.map +1 -1
  236. package/dist/cli/commands/start/storage-init.js +1 -1
  237. package/dist/cli/commands/start/storage-init.js.map +1 -1
  238. package/dist/cli/commands/status.js +2 -2
  239. package/dist/cli/commands/status.js.map +1 -1
  240. package/dist/cli/commands/voice.js +1 -1
  241. package/dist/cli/commands/voice.js.map +1 -1
  242. package/dist/cli/commands/workflows.d.ts +1 -1
  243. package/dist/cli/commands/workflows.d.ts.map +1 -1
  244. package/dist/cli/commands/workflows.js +3 -3
  245. package/dist/cli/commands/workflows.js.map +1 -1
  246. package/dist/cli/constants.d.ts +1 -1
  247. package/dist/cli/constants.js +1 -1
  248. package/dist/cli/constants.js.map +1 -1
  249. package/dist/cli/daemon/daemon-state.js +1 -1
  250. package/dist/cli/daemon/daemon-state.js.map +1 -1
  251. package/dist/cli/export/report-export.d.ts +47 -0
  252. package/dist/cli/export/report-export.d.ts.map +1 -0
  253. package/dist/cli/export/report-export.js +120 -0
  254. package/dist/cli/export/report-export.js.map +1 -0
  255. package/dist/cli/index.d.ts.map +1 -1
  256. package/dist/cli/index.js +13 -10
  257. package/dist/cli/index.js.map +1 -1
  258. package/dist/cli/tui/views/discovery-view.js +1 -1
  259. package/dist/cli/tui/views/discovery-view.js.map +1 -1
  260. package/dist/cli/tui/views/rag-view.js +1 -1
  261. package/dist/cli/tui/views/rag-view.js.map +1 -1
  262. package/dist/cli/tui/views/status-view.js +3 -3
  263. package/dist/cli/tui/views/status-view.js.map +1 -1
  264. package/dist/cli/tui/views/voice-view.js +1 -1
  265. package/dist/cli/tui/views/voice-view.js.map +1 -1
  266. package/dist/cli/wizards/setup-wizard.js +1 -1
  267. package/dist/cli/wizards/setup-wizard.js.map +1 -1
  268. package/dist/cli/wizards/voice-wizard.js +1 -1
  269. package/dist/cli/wizards/voice-wizard.js.map +1 -1
  270. package/dist/core/index.d.ts +6 -18
  271. package/dist/core/index.d.ts.map +1 -1
  272. package/dist/core/index.js +6 -35
  273. package/dist/core/index.js.map +1 -1
  274. package/dist/memory/auto-ingest/MemoryAutoIngestPipeline.d.ts +68 -0
  275. package/dist/memory/auto-ingest/MemoryAutoIngestPipeline.d.ts.map +1 -0
  276. package/dist/memory/auto-ingest/MemoryAutoIngestPipeline.js.map +1 -0
  277. package/dist/memory/auto-ingest/index.d.ts.map +1 -0
  278. package/dist/memory/auto-ingest/index.js.map +1 -0
  279. package/dist/memory/index.d.ts +5 -3
  280. package/dist/memory/index.d.ts.map +1 -1
  281. package/dist/memory/index.js +5 -3
  282. package/dist/memory/index.js.map +1 -1
  283. package/dist/memory/initialization/CognitiveMemoryInitializer.d.ts.map +1 -0
  284. package/dist/memory/initialization/CognitiveMemoryInitializer.js +98 -0
  285. package/dist/memory/initialization/CognitiveMemoryInitializer.js.map +1 -0
  286. package/dist/memory/initialization/MemorySystemInitializer.d.ts.map +1 -0
  287. package/dist/memory/initialization/MemorySystemInitializer.js.map +1 -0
  288. package/dist/memory/initialization/index.d.ts.map +1 -0
  289. package/dist/memory/initialization/index.js.map +1 -0
  290. package/dist/memory/rag/QueryExpander.d.ts.map +1 -0
  291. package/dist/memory/rag/QueryExpander.js.map +1 -0
  292. package/dist/memory/rag/RAGAuditPersistence.d.ts.map +1 -0
  293. package/dist/memory/rag/RAGAuditPersistence.js.map +1 -0
  294. package/dist/memory/rag/http-proxy.d.ts +16 -0
  295. package/dist/memory/rag/http-proxy.d.ts.map +1 -0
  296. package/dist/memory/rag/http-proxy.js.map +1 -0
  297. package/dist/memory/rag/hyde-integration.d.ts +41 -0
  298. package/dist/memory/rag/hyde-integration.d.ts.map +1 -0
  299. package/dist/memory/rag/hyde-integration.js +87 -0
  300. package/dist/memory/rag/hyde-integration.js.map +1 -0
  301. package/dist/memory/rag/index.d.ts.map +1 -0
  302. package/dist/memory/rag/index.js.map +1 -0
  303. package/dist/memory/rag/rag-client.d.ts.map +1 -0
  304. package/dist/memory/rag/rag-client.js.map +1 -0
  305. package/dist/memory/rag/rag-index.d.ts.map +1 -0
  306. package/dist/memory/rag/rag-index.js.map +1 -0
  307. package/dist/memory/rag/runtime-tools.d.ts +4 -0
  308. package/dist/memory/rag/runtime-tools.d.ts.map +1 -0
  309. package/dist/memory/rag/runtime-tools.js +115 -0
  310. package/dist/memory/rag/runtime-tools.js.map +1 -0
  311. package/dist/memory/retrieval/TurnMemoryRetriever.d.ts +21 -0
  312. package/dist/memory/retrieval/TurnMemoryRetriever.d.ts.map +1 -0
  313. package/dist/memory/retrieval/TurnMemoryRetriever.js.map +1 -0
  314. package/dist/memory/retrieval/index.d.ts.map +1 -0
  315. package/dist/memory/retrieval/index.js.map +1 -0
  316. package/dist/memory/storage/AgentMemoryAdapter.d.ts.map +1 -0
  317. package/dist/memory/storage/AgentMemoryAdapter.js.map +1 -0
  318. package/dist/memory/storage/AgentStateStore.d.ts.map +1 -0
  319. package/dist/memory/storage/AgentStateStore.js.map +1 -0
  320. package/dist/memory/storage/AgentStorageManager.d.ts.map +1 -0
  321. package/dist/memory/storage/AgentStorageManager.js.map +1 -0
  322. package/dist/memory/storage/PersonalityMemoryConfig.d.ts.map +1 -0
  323. package/dist/memory/storage/PersonalityMemoryConfig.js.map +1 -0
  324. package/dist/memory/storage/index.d.ts.map +1 -0
  325. package/dist/memory/storage/index.js.map +1 -0
  326. package/dist/memory/storage/storage-index.d.ts +13 -0
  327. package/dist/memory/storage/storage-index.d.ts.map +1 -0
  328. package/dist/memory/storage/storage-index.js +11 -0
  329. package/dist/memory/storage/storage-index.js.map +1 -0
  330. package/dist/memory/storage/types.d.ts.map +1 -0
  331. package/dist/memory/storage/types.js.map +1 -0
  332. package/dist/platform/config/config-index.d.ts.map +1 -0
  333. package/dist/platform/config/config-index.js.map +1 -0
  334. package/dist/platform/config/effective-agent-config.d.ts +24 -0
  335. package/dist/platform/config/effective-agent-config.d.ts.map +1 -0
  336. package/dist/platform/config/effective-agent-config.js +272 -0
  337. package/dist/platform/config/effective-agent-config.js.map +1 -0
  338. package/dist/platform/config/errors.d.ts.map +1 -0
  339. package/dist/platform/config/errors.js.map +1 -0
  340. package/dist/platform/config/index.d.ts.map +1 -0
  341. package/dist/platform/config/index.js.map +1 -0
  342. package/dist/platform/config/load.d.ts +32 -0
  343. package/dist/platform/config/load.d.ts.map +1 -0
  344. package/dist/platform/config/load.js.map +1 -0
  345. package/dist/platform/config/persona-registry.d.ts +48 -0
  346. package/dist/platform/config/persona-registry.d.ts.map +1 -0
  347. package/dist/platform/config/persona-registry.js.map +1 -0
  348. package/dist/platform/config/provider-defaults.d.ts +54 -0
  349. package/dist/platform/config/provider-defaults.d.ts.map +1 -0
  350. package/dist/platform/config/provider-defaults.js.map +1 -0
  351. package/dist/platform/config/schema.d.ts +7 -0
  352. package/dist/platform/config/schema.d.ts.map +1 -0
  353. package/dist/platform/config/schema.js.map +1 -0
  354. package/dist/platform/config/wallet-types.d.ts.map +1 -0
  355. package/dist/platform/config/wallet-types.js.map +1 -0
  356. package/dist/platform/discovery/WunderlandDiscoveryManager.d.ts +129 -0
  357. package/dist/platform/discovery/WunderlandDiscoveryManager.d.ts.map +1 -0
  358. package/dist/platform/discovery/WunderlandDiscoveryManager.js +357 -0
  359. package/dist/platform/discovery/WunderlandDiscoveryManager.js.map +1 -0
  360. package/dist/platform/discovery/discovery-index.d.ts.map +1 -0
  361. package/dist/platform/discovery/discovery-index.js.map +1 -0
  362. package/dist/platform/discovery/index.d.ts.map +1 -0
  363. package/dist/platform/discovery/index.js.map +1 -0
  364. package/dist/platform/discovery/preset-co-occurrence.d.ts.map +1 -0
  365. package/dist/platform/discovery/preset-co-occurrence.js +36 -0
  366. package/dist/platform/discovery/preset-co-occurrence.js.map +1 -0
  367. package/dist/platform/observability/TokenUsageTracker.d.ts +115 -0
  368. package/dist/platform/observability/TokenUsageTracker.d.ts.map +1 -0
  369. package/dist/platform/observability/TokenUsageTracker.js +219 -0
  370. package/dist/platform/observability/TokenUsageTracker.js.map +1 -0
  371. package/dist/platform/observability/session-text-log.d.ts +1 -1
  372. package/dist/platform/observability/session-text-log.d.ts.map +1 -1
  373. package/dist/platform/observability/session-text-log.js +1 -1
  374. package/dist/platform/observability/session-text-log.js.map +1 -1
  375. package/dist/platform/observability/token-usage.d.ts +2 -2
  376. package/dist/platform/observability/token-usage.d.ts.map +1 -1
  377. package/dist/platform/observability/token-usage.js +1 -1
  378. package/dist/platform/observability/token-usage.js.map +1 -1
  379. package/dist/platform/observability/usage-ledger.d.ts +1 -1
  380. package/dist/platform/observability/usage-ledger.d.ts.map +1 -1
  381. package/dist/platform/observability/usage-ledger.js +3 -3
  382. package/dist/platform/observability/usage-ledger.js.map +1 -1
  383. package/dist/public/index.d.ts +3 -3
  384. package/dist/public/index.d.ts.map +1 -1
  385. package/dist/public/index.js +21 -21
  386. package/dist/public/index.js.map +1 -1
  387. package/dist/public/types.d.ts +7 -7
  388. package/dist/public/types.d.ts.map +1 -1
  389. package/dist/runtime/agentos-bridge/agentos-runtime.d.ts.map +1 -0
  390. package/dist/runtime/agentos-bridge/agentos-runtime.js.map +1 -0
  391. package/dist/runtime/agentos-bridge/index.d.ts.map +1 -0
  392. package/dist/runtime/agentos-bridge/index.js.map +1 -0
  393. package/dist/runtime/agentos-bridge/query-router-init.d.ts +165 -0
  394. package/dist/runtime/agentos-bridge/query-router-init.d.ts.map +1 -0
  395. package/dist/runtime/agentos-bridge/query-router-init.js.map +1 -0
  396. package/dist/runtime/agentos-bridge/rag-state-persistence.d.ts.map +1 -0
  397. package/dist/runtime/agentos-bridge/rag-state-persistence.js.map +1 -0
  398. package/dist/runtime/agentos-bridge/research-classifier.d.ts.map +1 -0
  399. package/dist/runtime/agentos-bridge/research-classifier.js.map +1 -0
  400. package/dist/runtime/agentos-bridge/unified-retriever-builder.d.ts +189 -0
  401. package/dist/runtime/agentos-bridge/unified-retriever-builder.d.ts.map +1 -0
  402. package/dist/runtime/agentos-bridge/unified-retriever-builder.js +335 -0
  403. package/dist/runtime/agentos-bridge/unified-retriever-builder.js.map +1 -0
  404. package/dist/runtime/compaction/CompactionManager.d.ts.map +1 -0
  405. package/dist/runtime/compaction/CompactionManager.js.map +1 -0
  406. package/dist/runtime/compaction/index.d.ts.map +1 -0
  407. package/dist/runtime/compaction/index.js.map +1 -0
  408. package/dist/runtime/execution/adaptive-execution.d.ts +102 -0
  409. package/dist/runtime/execution/adaptive-execution.d.ts.map +1 -0
  410. package/dist/runtime/execution/adaptive-execution.js.map +1 -0
  411. package/dist/runtime/execution/empty-output-fallback.d.ts.map +1 -0
  412. package/dist/runtime/execution/empty-output-fallback.js.map +1 -0
  413. package/dist/runtime/execution/graph-runner.d.ts +58 -0
  414. package/dist/runtime/execution/graph-runner.d.ts.map +1 -0
  415. package/dist/runtime/execution/graph-runner.js +411 -0
  416. package/dist/runtime/execution/graph-runner.js.map +1 -0
  417. package/dist/runtime/execution/index.d.ts.map +1 -0
  418. package/dist/runtime/execution/index.js.map +1 -0
  419. package/dist/runtime/execution/keyed-mutex.d.ts +27 -0
  420. package/dist/runtime/execution/keyed-mutex.d.ts.map +1 -0
  421. package/dist/runtime/execution/keyed-mutex.js +52 -0
  422. package/dist/runtime/execution/keyed-mutex.js.map +1 -0
  423. package/dist/runtime/execution/llm-stream-adapter.d.ts.map +1 -0
  424. package/dist/runtime/execution/llm-stream-adapter.js.map +1 -0
  425. package/dist/runtime/execution/request-persona.d.ts +38 -0
  426. package/dist/runtime/execution/request-persona.d.ts.map +1 -0
  427. package/dist/runtime/execution/request-persona.js +117 -0
  428. package/dist/runtime/execution/request-persona.js.map +1 -0
  429. package/dist/runtime/execution/schema-on-demand.d.ts +45 -0
  430. package/dist/runtime/execution/schema-on-demand.d.ts.map +1 -0
  431. package/dist/runtime/execution/schema-on-demand.js +348 -0
  432. package/dist/runtime/execution/schema-on-demand.js.map +1 -0
  433. package/dist/runtime/execution/system-prompt-builder.d.ts +36 -0
  434. package/dist/runtime/execution/system-prompt-builder.d.ts.map +1 -0
  435. package/dist/runtime/execution/system-prompt-builder.js.map +1 -0
  436. package/dist/runtime/identity/agent-identity.d.ts.map +1 -0
  437. package/dist/runtime/identity/agent-identity.js.map +1 -0
  438. package/dist/runtime/identity/api-key-resolver.d.ts.map +1 -0
  439. package/dist/runtime/identity/api-key-resolver.js.map +1 -0
  440. package/dist/runtime/identity/index.d.ts.map +1 -0
  441. package/dist/runtime/identity/index.js.map +1 -0
  442. package/dist/runtime/inference/HierarchicalInferenceRouter.d.ts +102 -0
  443. package/dist/runtime/inference/HierarchicalInferenceRouter.d.ts.map +1 -0
  444. package/dist/runtime/inference/HierarchicalInferenceRouter.js +407 -0
  445. package/dist/runtime/inference/HierarchicalInferenceRouter.js.map +1 -0
  446. package/dist/runtime/inference/SmallModelResolver.d.ts.map +1 -0
  447. package/dist/runtime/inference/SmallModelResolver.js +137 -0
  448. package/dist/runtime/inference/SmallModelResolver.js.map +1 -0
  449. package/dist/runtime/inference/index.d.ts.map +1 -0
  450. package/dist/runtime/inference/index.js.map +1 -0
  451. package/dist/runtime/inference/inference-index.d.ts.map +1 -0
  452. package/dist/runtime/inference/inference-index.js.map +1 -0
  453. package/dist/runtime/inference/types.d.ts +116 -0
  454. package/dist/runtime/inference/types.d.ts.map +1 -0
  455. package/dist/runtime/inference/types.js.map +1 -0
  456. package/dist/runtime/tools/CronTool.d.ts +16 -0
  457. package/dist/runtime/tools/CronTool.d.ts.map +1 -0
  458. package/dist/runtime/tools/CronTool.js +281 -0
  459. package/dist/runtime/tools/CronTool.js.map +1 -0
  460. package/dist/runtime/tools/ElevenLabsTool.d.ts.map +1 -0
  461. package/dist/runtime/tools/ElevenLabsTool.js.map +1 -0
  462. package/dist/runtime/tools/FeedSearchTool.d.ts.map +1 -0
  463. package/dist/runtime/tools/FeedSearchTool.js.map +1 -0
  464. package/dist/runtime/tools/GiphyTool.d.ts.map +1 -0
  465. package/dist/runtime/tools/GiphyTool.js.map +1 -0
  466. package/dist/runtime/tools/LlmsTxtDiscovery.d.ts.map +1 -0
  467. package/dist/runtime/tools/LlmsTxtDiscovery.js.map +1 -0
  468. package/dist/runtime/tools/MediaSearchTool.d.ts.map +1 -0
  469. package/dist/runtime/tools/MediaSearchTool.js.map +1 -0
  470. package/dist/runtime/tools/MemoryReadTool.d.ts.map +1 -0
  471. package/dist/runtime/tools/MemoryReadTool.js.map +1 -0
  472. package/dist/runtime/tools/NewsSearchTool.d.ts.map +1 -0
  473. package/dist/runtime/tools/NewsSearchTool.js.map +1 -0
  474. package/dist/runtime/tools/RAGTool.d.ts.map +1 -0
  475. package/dist/runtime/tools/RAGTool.js +132 -0
  476. package/dist/runtime/tools/RAGTool.js.map +1 -0
  477. package/dist/runtime/tools/RequestFolderAccessTool.d.ts +28 -0
  478. package/dist/runtime/tools/RequestFolderAccessTool.d.ts.map +1 -0
  479. package/dist/runtime/tools/RequestFolderAccessTool.js +124 -0
  480. package/dist/runtime/tools/RequestFolderAccessTool.js.map +1 -0
  481. package/dist/runtime/tools/SerperSearchTool.d.ts.map +1 -0
  482. package/dist/runtime/tools/SerperSearchTool.js.map +1 -0
  483. package/dist/runtime/tools/SocialPostTool.d.ts +76 -0
  484. package/dist/runtime/tools/SocialPostTool.d.ts.map +1 -0
  485. package/dist/runtime/tools/SocialPostTool.js +116 -0
  486. package/dist/runtime/tools/SocialPostTool.js.map +1 -0
  487. package/dist/runtime/tools/ToolApprovalHandler.d.ts +152 -0
  488. package/dist/runtime/tools/ToolApprovalHandler.d.ts.map +1 -0
  489. package/dist/runtime/tools/ToolApprovalHandler.js +269 -0
  490. package/dist/runtime/tools/ToolApprovalHandler.js.map +1 -0
  491. package/dist/runtime/tools/ToolRegistry.d.ts.map +1 -0
  492. package/dist/runtime/tools/ToolRegistry.js.map +1 -0
  493. package/dist/runtime/tools/ToolStreamProcessor.d.ts +200 -0
  494. package/dist/runtime/tools/ToolStreamProcessor.d.ts.map +1 -0
  495. package/dist/runtime/tools/ToolStreamProcessor.js +410 -0
  496. package/dist/runtime/tools/ToolStreamProcessor.js.map +1 -0
  497. package/dist/runtime/tools/index.d.ts.map +1 -0
  498. package/dist/runtime/tools/index.js.map +1 -0
  499. package/dist/runtime/tools/ollama-options.d.ts.map +1 -0
  500. package/dist/runtime/tools/ollama-options.js.map +1 -0
  501. package/dist/runtime/tools/policy.d.ts +98 -0
  502. package/dist/runtime/tools/policy.d.ts.map +1 -0
  503. package/dist/runtime/tools/policy.js +253 -0
  504. package/dist/runtime/tools/policy.js.map +1 -0
  505. package/dist/runtime/tools/tool-calling.d.ts +111 -0
  506. package/dist/runtime/tools/tool-calling.d.ts.map +1 -0
  507. package/dist/runtime/tools/tool-calling.js +713 -0
  508. package/dist/runtime/tools/tool-calling.js.map +1 -0
  509. package/dist/runtime/tools/tool-failure-learner.d.ts +57 -0
  510. package/dist/runtime/tools/tool-failure-learner.d.ts.map +1 -0
  511. package/dist/runtime/tools/tool-failure-learner.js.map +1 -0
  512. package/dist/runtime/tools/tool-function-names.d.ts.map +1 -0
  513. package/dist/runtime/tools/tool-function-names.js.map +1 -0
  514. package/dist/runtime/tools/tool-helpers.d.ts +355 -0
  515. package/dist/runtime/tools/tool-helpers.d.ts.map +1 -0
  516. package/dist/runtime/tools/tool-helpers.js +1022 -0
  517. package/dist/runtime/tools/tool-helpers.js.map +1 -0
  518. package/dist/runtime/tools/tools-index.d.ts.map +1 -0
  519. package/dist/runtime/tools/tools-index.js.map +1 -0
  520. package/dist/runtime/tools/turn-tool-selection.d.ts +16 -0
  521. package/dist/runtime/tools/turn-tool-selection.d.ts.map +1 -0
  522. package/dist/runtime/tools/turn-tool-selection.js +94 -0
  523. package/dist/runtime/tools/turn-tool-selection.js.map +1 -0
  524. package/dist/runtime/tools/workspace.d.ts.map +1 -0
  525. package/dist/runtime/tools/workspace.js.map +1 -0
  526. package/dist/security/SecurityTiers.d.ts +1 -1
  527. package/dist/security/SecurityTiers.d.ts.map +1 -1
  528. package/dist/security/SecurityTiers.js +1 -1
  529. package/dist/security/SecurityTiers.js.map +1 -1
  530. package/dist/security/SignedOutputVerifier.d.ts +1 -1
  531. package/dist/security/SignedOutputVerifier.d.ts.map +1 -1
  532. package/dist/security/SignedOutputVerifier.js +1 -1
  533. package/dist/security/SignedOutputVerifier.js.map +1 -1
  534. package/dist/security/StepUpAuthorizationManager.d.ts +1 -1
  535. package/dist/security/StepUpAuthorizationManager.d.ts.map +1 -1
  536. package/dist/security/StepUpAuthorizationManager.js +1 -1
  537. package/dist/security/StepUpAuthorizationManager.js.map +1 -1
  538. package/dist/security/WunderlandSecurityPipeline.d.ts +1 -1
  539. package/dist/security/WunderlandSecurityPipeline.d.ts.map +1 -1
  540. package/dist/security/authorization-types.d.ts +1 -1
  541. package/dist/security/authorization-types.d.ts.map +1 -1
  542. package/dist/security/safe-merge.d.ts.map +1 -0
  543. package/dist/security/safe-merge.js.map +1 -0
  544. package/dist/security/ssrf-guard.d.ts +96 -0
  545. package/dist/security/ssrf-guard.d.ts.map +1 -0
  546. package/dist/security/ssrf-guard.js +293 -0
  547. package/dist/security/ssrf-guard.js.map +1 -0
  548. package/dist/security/types.d.ts +2 -2
  549. package/dist/security/types.d.ts.map +1 -1
  550. package/dist/skills/index.d.ts +4 -6
  551. package/dist/skills/index.d.ts.map +1 -1
  552. package/dist/skills/index.js +4 -7
  553. package/dist/skills/index.js.map +1 -1
  554. package/dist/types/core-types.d.ts +359 -0
  555. package/dist/types/core-types.d.ts.map +1 -0
  556. package/dist/types/core-types.js +224 -0
  557. package/dist/types/core-types.js.map +1 -0
  558. package/package.json +16 -66
  559. package/dist/advanced/agency.d.ts +0 -8
  560. package/dist/advanced/agency.d.ts.map +0 -1
  561. package/dist/advanced/agency.js +0 -8
  562. package/dist/advanced/agency.js.map +0 -1
  563. package/dist/advanced/authorization.d.ts +0 -3
  564. package/dist/advanced/authorization.d.ts.map +0 -1
  565. package/dist/advanced/authorization.js +0 -4
  566. package/dist/advanced/authorization.js.map +0 -1
  567. package/dist/advanced/browser.d.ts +0 -2
  568. package/dist/advanced/browser.d.ts.map +0 -1
  569. package/dist/advanced/browser.js +0 -3
  570. package/dist/advanced/browser.js.map +0 -1
  571. package/dist/advanced/core.d.ts +0 -2
  572. package/dist/advanced/core.d.ts.map +0 -1
  573. package/dist/advanced/core.js +0 -3
  574. package/dist/advanced/core.js.map +0 -1
  575. package/dist/advanced/evaluation.d.ts +0 -8
  576. package/dist/advanced/evaluation.d.ts.map +0 -1
  577. package/dist/advanced/evaluation.js +0 -8
  578. package/dist/advanced/evaluation.js.map +0 -1
  579. package/dist/advanced/guardrails.d.ts +0 -2
  580. package/dist/advanced/guardrails.d.ts.map +0 -1
  581. package/dist/advanced/guardrails.js +0 -3
  582. package/dist/advanced/guardrails.js.map +0 -1
  583. package/dist/advanced/index.d.ts +0 -61
  584. package/dist/advanced/index.d.ts.map +0 -1
  585. package/dist/advanced/index.js +0 -93
  586. package/dist/advanced/index.js.map +0 -1
  587. package/dist/advanced/inference.d.ts +0 -2
  588. package/dist/advanced/inference.d.ts.map +0 -1
  589. package/dist/advanced/inference.js +0 -3
  590. package/dist/advanced/inference.js.map +0 -1
  591. package/dist/advanced/jobs.d.ts +0 -2
  592. package/dist/advanced/jobs.d.ts.map +0 -1
  593. package/dist/advanced/jobs.js +0 -3
  594. package/dist/advanced/jobs.js.map +0 -1
  595. package/dist/advanced/knowledge.d.ts +0 -8
  596. package/dist/advanced/knowledge.d.ts.map +0 -1
  597. package/dist/advanced/knowledge.js +0 -8
  598. package/dist/advanced/knowledge.js.map +0 -1
  599. package/dist/advanced/marketplace.d.ts +0 -8
  600. package/dist/advanced/marketplace.d.ts.map +0 -1
  601. package/dist/advanced/marketplace.js +0 -8
  602. package/dist/advanced/marketplace.js.map +0 -1
  603. package/dist/advanced/pairing.d.ts +0 -2
  604. package/dist/advanced/pairing.d.ts.map +0 -1
  605. package/dist/advanced/pairing.js +0 -3
  606. package/dist/advanced/pairing.js.map +0 -1
  607. package/dist/advanced/planning.d.ts +0 -8
  608. package/dist/advanced/planning.d.ts.map +0 -1
  609. package/dist/advanced/planning.js +0 -8
  610. package/dist/advanced/planning.js.map +0 -1
  611. package/dist/advanced/provenance.d.ts +0 -8
  612. package/dist/advanced/provenance.d.ts.map +0 -1
  613. package/dist/advanced/provenance.js +0 -8
  614. package/dist/advanced/provenance.js.map +0 -1
  615. package/dist/advanced/rag.d.ts +0 -2
  616. package/dist/advanced/rag.d.ts.map +0 -1
  617. package/dist/advanced/rag.js +0 -3
  618. package/dist/advanced/rag.js.map +0 -1
  619. package/dist/advanced/scheduling.d.ts +0 -2
  620. package/dist/advanced/scheduling.d.ts.map +0 -1
  621. package/dist/advanced/scheduling.js +0 -3
  622. package/dist/advanced/scheduling.js.map +0 -1
  623. package/dist/advanced/security.d.ts +0 -2
  624. package/dist/advanced/security.d.ts.map +0 -1
  625. package/dist/advanced/security.js +0 -3
  626. package/dist/advanced/security.js.map +0 -1
  627. package/dist/advanced/skills.d.ts +0 -2
  628. package/dist/advanced/skills.d.ts.map +0 -1
  629. package/dist/advanced/skills.js +0 -3
  630. package/dist/advanced/skills.js.map +0 -1
  631. package/dist/advanced/social.d.ts +0 -2
  632. package/dist/advanced/social.d.ts.map +0 -1
  633. package/dist/advanced/social.js +0 -3
  634. package/dist/advanced/social.js.map +0 -1
  635. package/dist/advanced/structured.d.ts +0 -8
  636. package/dist/advanced/structured.d.ts.map +0 -1
  637. package/dist/advanced/structured.js +0 -8
  638. package/dist/advanced/structured.js.map +0 -1
  639. package/dist/advanced/voice.d.ts +0 -2
  640. package/dist/advanced/voice.d.ts.map +0 -1
  641. package/dist/advanced/voice.js +0 -3
  642. package/dist/advanced/voice.js.map +0 -1
  643. package/dist/advanced/workflows.d.ts +0 -15
  644. package/dist/advanced/workflows.d.ts.map +0 -1
  645. package/dist/advanced/workflows.js +0 -15
  646. package/dist/advanced/workflows.js.map +0 -1
  647. package/dist/api/index.d.ts +0 -2
  648. package/dist/api/index.d.ts.map +0 -1
  649. package/dist/api/index.js +0 -2
  650. package/dist/api/index.js.map +0 -1
  651. package/dist/browser/index.d.ts +0 -2
  652. package/dist/browser/index.d.ts.map +0 -1
  653. package/dist/browser/index.js +0 -2
  654. package/dist/browser/index.js.map +0 -1
  655. package/dist/channels/api-new/api-index.d.ts.map +0 -1
  656. package/dist/channels/api-new/api-index.js.map +0 -1
  657. package/dist/channels/api-new/chat-runtime.d.ts +0 -68
  658. package/dist/channels/api-new/chat-runtime.d.ts.map +0 -1
  659. package/dist/channels/api-new/chat-runtime.js +0 -123
  660. package/dist/channels/api-new/chat-runtime.js.map +0 -1
  661. package/dist/channels/api-new/index.d.ts.map +0 -1
  662. package/dist/channels/api-new/index.js.map +0 -1
  663. package/dist/channels/api-new/rate-limiter.d.ts.map +0 -1
  664. package/dist/channels/api-new/rate-limiter.js.map +0 -1
  665. package/dist/channels/api-new/routes/agents.d.ts.map +0 -1
  666. package/dist/channels/api-new/routes/agents.js.map +0 -1
  667. package/dist/channels/api-new/routes/chat.d.ts.map +0 -1
  668. package/dist/channels/api-new/routes/chat.js +0 -287
  669. package/dist/channels/api-new/routes/chat.js.map +0 -1
  670. package/dist/channels/api-new/routes/config.d.ts.map +0 -1
  671. package/dist/channels/api-new/routes/config.js.map +0 -1
  672. package/dist/channels/api-new/routes/health.d.ts.map +0 -1
  673. package/dist/channels/api-new/routes/health.js.map +0 -1
  674. package/dist/channels/api-new/routes/index.d.ts.map +0 -1
  675. package/dist/channels/api-new/routes/index.js.map +0 -1
  676. package/dist/channels/api-new/routes/social.d.ts.map +0 -1
  677. package/dist/channels/api-new/routes/social.js.map +0 -1
  678. package/dist/channels/api-new/routes/types.d.ts +0 -85
  679. package/dist/channels/api-new/routes/types.d.ts.map +0 -1
  680. package/dist/channels/api-new/routes/types.js.map +0 -1
  681. package/dist/channels/api-new/server-helpers.d.ts +0 -32
  682. package/dist/channels/api-new/server-helpers.d.ts.map +0 -1
  683. package/dist/channels/api-new/server-helpers.js.map +0 -1
  684. package/dist/channels/api-new/server.d.ts +0 -97
  685. package/dist/channels/api-new/server.d.ts.map +0 -1
  686. package/dist/channels/api-new/server.js +0 -1065
  687. package/dist/channels/api-new/server.js.map +0 -1
  688. package/dist/channels/api-new/types.d.ts +0 -527
  689. package/dist/channels/api-new/types.d.ts.map +0 -1
  690. package/dist/channels/api-new/types.js.map +0 -1
  691. package/dist/channels/browser-new/BrowserClient.d.ts.map +0 -1
  692. package/dist/channels/browser-new/BrowserClient.js.map +0 -1
  693. package/dist/channels/browser-new/BrowserInteractions.d.ts.map +0 -1
  694. package/dist/channels/browser-new/BrowserInteractions.js.map +0 -1
  695. package/dist/channels/browser-new/BrowserSession.d.ts.map +0 -1
  696. package/dist/channels/browser-new/BrowserSession.js.map +0 -1
  697. package/dist/channels/browser-new/browser-index.d.ts.map +0 -1
  698. package/dist/channels/browser-new/browser-index.js.map +0 -1
  699. package/dist/channels/browser-new/index.d.ts.map +0 -1
  700. package/dist/channels/browser-new/index.js.map +0 -1
  701. package/dist/channels/browser-new/types.d.ts.map +0 -1
  702. package/dist/channels/browser-new/types.js.map +0 -1
  703. package/dist/channels/voice-new/call-client.d.ts.map +0 -1
  704. package/dist/channels/voice-new/call-client.js.map +0 -1
  705. package/dist/channels/voice-new/index.d.ts.map +0 -1
  706. package/dist/channels/voice-new/index.js.map +0 -1
  707. package/dist/channels/voice-new/speech-catalog.d.ts.map +0 -1
  708. package/dist/channels/voice-new/speech-catalog.js.map +0 -1
  709. package/dist/channels/voice-new/streaming-pipeline.d.ts.map +0 -1
  710. package/dist/channels/voice-new/streaming-pipeline.js +0 -305
  711. package/dist/channels/voice-new/streaming-pipeline.js.map +0 -1
  712. package/dist/channels/voice-new/telephony-webhook-server.d.ts.map +0 -1
  713. package/dist/channels/voice-new/telephony-webhook-server.js.map +0 -1
  714. package/dist/channels/voice-new/voice-index.d.ts.map +0 -1
  715. package/dist/channels/voice-new/voice-index.js.map +0 -1
  716. package/dist/channels/voice-new/ws-server.d.ts.map +0 -1
  717. package/dist/channels/voice-new/ws-server.js +0 -187
  718. package/dist/channels/voice-new/ws-server.js.map +0 -1
  719. package/dist/config/index.d.ts +0 -2
  720. package/dist/config/index.d.ts.map +0 -1
  721. package/dist/config/index.js +0 -2
  722. package/dist/config/index.js.map +0 -1
  723. package/dist/core/TokenUsageTracker.d.ts +0 -115
  724. package/dist/core/TokenUsageTracker.d.ts.map +0 -1
  725. package/dist/core/TokenUsageTracker.js +0 -219
  726. package/dist/core/TokenUsageTracker.js.map +0 -1
  727. package/dist/core/resolve-skill-context.d.ts +0 -23
  728. package/dist/core/resolve-skill-context.d.ts.map +0 -1
  729. package/dist/core/resolve-skill-context.js +0 -165
  730. package/dist/core/resolve-skill-context.js.map +0 -1
  731. package/dist/core/safe-merge.d.ts.map +0 -1
  732. package/dist/core/safe-merge.js.map +0 -1
  733. package/dist/core/ssrf-guard.d.ts +0 -67
  734. package/dist/core/ssrf-guard.d.ts.map +0 -1
  735. package/dist/core/ssrf-guard.js +0 -242
  736. package/dist/core/ssrf-guard.js.map +0 -1
  737. package/dist/core/types.d.ts +0 -359
  738. package/dist/core/types.d.ts.map +0 -1
  739. package/dist/core/types.js +0 -224
  740. package/dist/core/types.js.map +0 -1
  741. package/dist/discovery/index.d.ts +0 -2
  742. package/dist/discovery/index.d.ts.map +0 -1
  743. package/dist/discovery/index.js +0 -2
  744. package/dist/discovery/index.js.map +0 -1
  745. package/dist/memory-new/auto-ingest/MemoryAutoIngestPipeline.d.ts +0 -68
  746. package/dist/memory-new/auto-ingest/MemoryAutoIngestPipeline.d.ts.map +0 -1
  747. package/dist/memory-new/auto-ingest/MemoryAutoIngestPipeline.js.map +0 -1
  748. package/dist/memory-new/auto-ingest/index.d.ts.map +0 -1
  749. package/dist/memory-new/auto-ingest/index.js.map +0 -1
  750. package/dist/memory-new/initialization/CognitiveMemoryInitializer.d.ts.map +0 -1
  751. package/dist/memory-new/initialization/CognitiveMemoryInitializer.js +0 -98
  752. package/dist/memory-new/initialization/CognitiveMemoryInitializer.js.map +0 -1
  753. package/dist/memory-new/initialization/MemorySystemInitializer.d.ts.map +0 -1
  754. package/dist/memory-new/initialization/MemorySystemInitializer.js.map +0 -1
  755. package/dist/memory-new/initialization/index.d.ts.map +0 -1
  756. package/dist/memory-new/initialization/index.js.map +0 -1
  757. package/dist/memory-new/rag/QueryExpander.d.ts.map +0 -1
  758. package/dist/memory-new/rag/QueryExpander.js.map +0 -1
  759. package/dist/memory-new/rag/RAGAuditPersistence.d.ts.map +0 -1
  760. package/dist/memory-new/rag/RAGAuditPersistence.js.map +0 -1
  761. package/dist/memory-new/rag/http-proxy.d.ts +0 -16
  762. package/dist/memory-new/rag/http-proxy.d.ts.map +0 -1
  763. package/dist/memory-new/rag/http-proxy.js.map +0 -1
  764. package/dist/memory-new/rag/hyde-integration.d.ts +0 -41
  765. package/dist/memory-new/rag/hyde-integration.d.ts.map +0 -1
  766. package/dist/memory-new/rag/hyde-integration.js +0 -87
  767. package/dist/memory-new/rag/hyde-integration.js.map +0 -1
  768. package/dist/memory-new/rag/index.d.ts.map +0 -1
  769. package/dist/memory-new/rag/index.js.map +0 -1
  770. package/dist/memory-new/rag/rag-client.d.ts.map +0 -1
  771. package/dist/memory-new/rag/rag-client.js.map +0 -1
  772. package/dist/memory-new/rag/rag-index.d.ts.map +0 -1
  773. package/dist/memory-new/rag/rag-index.js.map +0 -1
  774. package/dist/memory-new/rag/runtime-tools.d.ts +0 -4
  775. package/dist/memory-new/rag/runtime-tools.d.ts.map +0 -1
  776. package/dist/memory-new/rag/runtime-tools.js +0 -115
  777. package/dist/memory-new/rag/runtime-tools.js.map +0 -1
  778. package/dist/memory-new/retrieval/TurnMemoryRetriever.d.ts +0 -21
  779. package/dist/memory-new/retrieval/TurnMemoryRetriever.d.ts.map +0 -1
  780. package/dist/memory-new/retrieval/TurnMemoryRetriever.js.map +0 -1
  781. package/dist/memory-new/retrieval/index.d.ts.map +0 -1
  782. package/dist/memory-new/retrieval/index.js.map +0 -1
  783. package/dist/memory-new/storage/AgentMemoryAdapter.d.ts.map +0 -1
  784. package/dist/memory-new/storage/AgentMemoryAdapter.js.map +0 -1
  785. package/dist/memory-new/storage/AgentStateStore.d.ts.map +0 -1
  786. package/dist/memory-new/storage/AgentStateStore.js.map +0 -1
  787. package/dist/memory-new/storage/AgentStorageManager.d.ts.map +0 -1
  788. package/dist/memory-new/storage/AgentStorageManager.js.map +0 -1
  789. package/dist/memory-new/storage/PersonalityMemoryConfig.d.ts.map +0 -1
  790. package/dist/memory-new/storage/PersonalityMemoryConfig.js.map +0 -1
  791. package/dist/memory-new/storage/index.d.ts.map +0 -1
  792. package/dist/memory-new/storage/index.js.map +0 -1
  793. package/dist/memory-new/storage/storage-index.d.ts +0 -13
  794. package/dist/memory-new/storage/storage-index.d.ts.map +0 -1
  795. package/dist/memory-new/storage/storage-index.js +0 -11
  796. package/dist/memory-new/storage/storage-index.js.map +0 -1
  797. package/dist/memory-new/storage/types.d.ts.map +0 -1
  798. package/dist/memory-new/storage/types.js.map +0 -1
  799. package/dist/platform/config-new/config-index.d.ts.map +0 -1
  800. package/dist/platform/config-new/config-index.js.map +0 -1
  801. package/dist/platform/config-new/effective-agent-config.d.ts +0 -24
  802. package/dist/platform/config-new/effective-agent-config.d.ts.map +0 -1
  803. package/dist/platform/config-new/effective-agent-config.js +0 -272
  804. package/dist/platform/config-new/effective-agent-config.js.map +0 -1
  805. package/dist/platform/config-new/errors.d.ts.map +0 -1
  806. package/dist/platform/config-new/errors.js.map +0 -1
  807. package/dist/platform/config-new/index.d.ts.map +0 -1
  808. package/dist/platform/config-new/index.js.map +0 -1
  809. package/dist/platform/config-new/load.d.ts +0 -32
  810. package/dist/platform/config-new/load.d.ts.map +0 -1
  811. package/dist/platform/config-new/load.js.map +0 -1
  812. package/dist/platform/config-new/persona-registry.d.ts +0 -48
  813. package/dist/platform/config-new/persona-registry.d.ts.map +0 -1
  814. package/dist/platform/config-new/persona-registry.js.map +0 -1
  815. package/dist/platform/config-new/provider-defaults.d.ts +0 -54
  816. package/dist/platform/config-new/provider-defaults.d.ts.map +0 -1
  817. package/dist/platform/config-new/provider-defaults.js.map +0 -1
  818. package/dist/platform/config-new/schema.d.ts +0 -7
  819. package/dist/platform/config-new/schema.d.ts.map +0 -1
  820. package/dist/platform/config-new/schema.js.map +0 -1
  821. package/dist/platform/config-new/wallet-types.d.ts.map +0 -1
  822. package/dist/platform/config-new/wallet-types.js.map +0 -1
  823. package/dist/platform/discovery-new/WunderlandDiscoveryManager.d.ts +0 -129
  824. package/dist/platform/discovery-new/WunderlandDiscoveryManager.d.ts.map +0 -1
  825. package/dist/platform/discovery-new/WunderlandDiscoveryManager.js +0 -357
  826. package/dist/platform/discovery-new/WunderlandDiscoveryManager.js.map +0 -1
  827. package/dist/platform/discovery-new/discovery-index.d.ts.map +0 -1
  828. package/dist/platform/discovery-new/discovery-index.js.map +0 -1
  829. package/dist/platform/discovery-new/index.d.ts.map +0 -1
  830. package/dist/platform/discovery-new/index.js.map +0 -1
  831. package/dist/platform/discovery-new/preset-co-occurrence.d.ts.map +0 -1
  832. package/dist/platform/discovery-new/preset-co-occurrence.js +0 -36
  833. package/dist/platform/discovery-new/preset-co-occurrence.js.map +0 -1
  834. package/dist/rag/index.d.ts +0 -2
  835. package/dist/rag/index.d.ts.map +0 -1
  836. package/dist/rag/index.js +0 -2
  837. package/dist/rag/index.js.map +0 -1
  838. package/dist/runtime/index.d.ts +0 -22
  839. package/dist/runtime/index.d.ts.map +0 -1
  840. package/dist/runtime/index.js +0 -23
  841. package/dist/runtime/index.js.map +0 -1
  842. package/dist/runtime-new/agentos-bridge/agentos-runtime.d.ts.map +0 -1
  843. package/dist/runtime-new/agentos-bridge/agentos-runtime.js.map +0 -1
  844. package/dist/runtime-new/agentos-bridge/index.d.ts.map +0 -1
  845. package/dist/runtime-new/agentos-bridge/index.js.map +0 -1
  846. package/dist/runtime-new/agentos-bridge/query-router-init.d.ts +0 -165
  847. package/dist/runtime-new/agentos-bridge/query-router-init.d.ts.map +0 -1
  848. package/dist/runtime-new/agentos-bridge/query-router-init.js.map +0 -1
  849. package/dist/runtime-new/agentos-bridge/rag-state-persistence.d.ts.map +0 -1
  850. package/dist/runtime-new/agentos-bridge/rag-state-persistence.js.map +0 -1
  851. package/dist/runtime-new/agentos-bridge/research-classifier.d.ts.map +0 -1
  852. package/dist/runtime-new/agentos-bridge/research-classifier.js.map +0 -1
  853. package/dist/runtime-new/agentos-bridge/unified-retriever-builder.d.ts +0 -189
  854. package/dist/runtime-new/agentos-bridge/unified-retriever-builder.d.ts.map +0 -1
  855. package/dist/runtime-new/agentos-bridge/unified-retriever-builder.js +0 -335
  856. package/dist/runtime-new/agentos-bridge/unified-retriever-builder.js.map +0 -1
  857. package/dist/runtime-new/compaction/CompactionManager.d.ts.map +0 -1
  858. package/dist/runtime-new/compaction/CompactionManager.js.map +0 -1
  859. package/dist/runtime-new/compaction/index.d.ts.map +0 -1
  860. package/dist/runtime-new/compaction/index.js.map +0 -1
  861. package/dist/runtime-new/execution/adaptive-execution.d.ts +0 -102
  862. package/dist/runtime-new/execution/adaptive-execution.d.ts.map +0 -1
  863. package/dist/runtime-new/execution/adaptive-execution.js.map +0 -1
  864. package/dist/runtime-new/execution/empty-output-fallback.d.ts.map +0 -1
  865. package/dist/runtime-new/execution/empty-output-fallback.js.map +0 -1
  866. package/dist/runtime-new/execution/graph-runner.d.ts +0 -58
  867. package/dist/runtime-new/execution/graph-runner.d.ts.map +0 -1
  868. package/dist/runtime-new/execution/graph-runner.js +0 -411
  869. package/dist/runtime-new/execution/graph-runner.js.map +0 -1
  870. package/dist/runtime-new/execution/index.d.ts.map +0 -1
  871. package/dist/runtime-new/execution/index.js.map +0 -1
  872. package/dist/runtime-new/execution/llm-stream-adapter.d.ts.map +0 -1
  873. package/dist/runtime-new/execution/llm-stream-adapter.js.map +0 -1
  874. package/dist/runtime-new/execution/request-persona.d.ts +0 -38
  875. package/dist/runtime-new/execution/request-persona.d.ts.map +0 -1
  876. package/dist/runtime-new/execution/request-persona.js +0 -117
  877. package/dist/runtime-new/execution/request-persona.js.map +0 -1
  878. package/dist/runtime-new/execution/schema-on-demand.d.ts +0 -45
  879. package/dist/runtime-new/execution/schema-on-demand.d.ts.map +0 -1
  880. package/dist/runtime-new/execution/schema-on-demand.js +0 -348
  881. package/dist/runtime-new/execution/schema-on-demand.js.map +0 -1
  882. package/dist/runtime-new/execution/system-prompt-builder.d.ts +0 -36
  883. package/dist/runtime-new/execution/system-prompt-builder.d.ts.map +0 -1
  884. package/dist/runtime-new/execution/system-prompt-builder.js.map +0 -1
  885. package/dist/runtime-new/identity/agent-identity.d.ts.map +0 -1
  886. package/dist/runtime-new/identity/agent-identity.js.map +0 -1
  887. package/dist/runtime-new/identity/api-key-resolver.d.ts.map +0 -1
  888. package/dist/runtime-new/identity/api-key-resolver.js.map +0 -1
  889. package/dist/runtime-new/identity/index.d.ts.map +0 -1
  890. package/dist/runtime-new/identity/index.js.map +0 -1
  891. package/dist/runtime-new/inference/HierarchicalInferenceRouter.d.ts +0 -102
  892. package/dist/runtime-new/inference/HierarchicalInferenceRouter.d.ts.map +0 -1
  893. package/dist/runtime-new/inference/HierarchicalInferenceRouter.js +0 -407
  894. package/dist/runtime-new/inference/HierarchicalInferenceRouter.js.map +0 -1
  895. package/dist/runtime-new/inference/SmallModelResolver.d.ts.map +0 -1
  896. package/dist/runtime-new/inference/SmallModelResolver.js +0 -137
  897. package/dist/runtime-new/inference/SmallModelResolver.js.map +0 -1
  898. package/dist/runtime-new/inference/index.d.ts.map +0 -1
  899. package/dist/runtime-new/inference/index.js.map +0 -1
  900. package/dist/runtime-new/inference/inference-index.d.ts.map +0 -1
  901. package/dist/runtime-new/inference/inference-index.js.map +0 -1
  902. package/dist/runtime-new/inference/types.d.ts +0 -116
  903. package/dist/runtime-new/inference/types.d.ts.map +0 -1
  904. package/dist/runtime-new/inference/types.js.map +0 -1
  905. package/dist/runtime-new/tools/CronTool.d.ts +0 -16
  906. package/dist/runtime-new/tools/CronTool.d.ts.map +0 -1
  907. package/dist/runtime-new/tools/CronTool.js +0 -281
  908. package/dist/runtime-new/tools/CronTool.js.map +0 -1
  909. package/dist/runtime-new/tools/ElevenLabsTool.d.ts.map +0 -1
  910. package/dist/runtime-new/tools/ElevenLabsTool.js.map +0 -1
  911. package/dist/runtime-new/tools/FeedSearchTool.d.ts.map +0 -1
  912. package/dist/runtime-new/tools/FeedSearchTool.js.map +0 -1
  913. package/dist/runtime-new/tools/GiphyTool.d.ts.map +0 -1
  914. package/dist/runtime-new/tools/GiphyTool.js.map +0 -1
  915. package/dist/runtime-new/tools/LlmsTxtDiscovery.d.ts.map +0 -1
  916. package/dist/runtime-new/tools/LlmsTxtDiscovery.js.map +0 -1
  917. package/dist/runtime-new/tools/MediaSearchTool.d.ts.map +0 -1
  918. package/dist/runtime-new/tools/MediaSearchTool.js.map +0 -1
  919. package/dist/runtime-new/tools/MemoryReadTool.d.ts.map +0 -1
  920. package/dist/runtime-new/tools/MemoryReadTool.js.map +0 -1
  921. package/dist/runtime-new/tools/NewsSearchTool.d.ts.map +0 -1
  922. package/dist/runtime-new/tools/NewsSearchTool.js.map +0 -1
  923. package/dist/runtime-new/tools/RAGTool.d.ts.map +0 -1
  924. package/dist/runtime-new/tools/RAGTool.js +0 -132
  925. package/dist/runtime-new/tools/RAGTool.js.map +0 -1
  926. package/dist/runtime-new/tools/RequestFolderAccessTool.d.ts +0 -28
  927. package/dist/runtime-new/tools/RequestFolderAccessTool.d.ts.map +0 -1
  928. package/dist/runtime-new/tools/RequestFolderAccessTool.js +0 -124
  929. package/dist/runtime-new/tools/RequestFolderAccessTool.js.map +0 -1
  930. package/dist/runtime-new/tools/SerperSearchTool.d.ts.map +0 -1
  931. package/dist/runtime-new/tools/SerperSearchTool.js.map +0 -1
  932. package/dist/runtime-new/tools/SocialPostTool.d.ts +0 -76
  933. package/dist/runtime-new/tools/SocialPostTool.d.ts.map +0 -1
  934. package/dist/runtime-new/tools/SocialPostTool.js +0 -116
  935. package/dist/runtime-new/tools/SocialPostTool.js.map +0 -1
  936. package/dist/runtime-new/tools/ToolApprovalHandler.d.ts +0 -152
  937. package/dist/runtime-new/tools/ToolApprovalHandler.d.ts.map +0 -1
  938. package/dist/runtime-new/tools/ToolApprovalHandler.js +0 -269
  939. package/dist/runtime-new/tools/ToolApprovalHandler.js.map +0 -1
  940. package/dist/runtime-new/tools/ToolRegistry.d.ts.map +0 -1
  941. package/dist/runtime-new/tools/ToolRegistry.js.map +0 -1
  942. package/dist/runtime-new/tools/ToolStreamProcessor.d.ts +0 -200
  943. package/dist/runtime-new/tools/ToolStreamProcessor.d.ts.map +0 -1
  944. package/dist/runtime-new/tools/ToolStreamProcessor.js +0 -410
  945. package/dist/runtime-new/tools/ToolStreamProcessor.js.map +0 -1
  946. package/dist/runtime-new/tools/index.d.ts.map +0 -1
  947. package/dist/runtime-new/tools/index.js.map +0 -1
  948. package/dist/runtime-new/tools/ollama-options.d.ts.map +0 -1
  949. package/dist/runtime-new/tools/ollama-options.js.map +0 -1
  950. package/dist/runtime-new/tools/policy.d.ts +0 -98
  951. package/dist/runtime-new/tools/policy.d.ts.map +0 -1
  952. package/dist/runtime-new/tools/policy.js +0 -251
  953. package/dist/runtime-new/tools/policy.js.map +0 -1
  954. package/dist/runtime-new/tools/tool-calling.d.ts +0 -111
  955. package/dist/runtime-new/tools/tool-calling.d.ts.map +0 -1
  956. package/dist/runtime-new/tools/tool-calling.js +0 -713
  957. package/dist/runtime-new/tools/tool-calling.js.map +0 -1
  958. package/dist/runtime-new/tools/tool-failure-learner.d.ts +0 -57
  959. package/dist/runtime-new/tools/tool-failure-learner.d.ts.map +0 -1
  960. package/dist/runtime-new/tools/tool-failure-learner.js.map +0 -1
  961. package/dist/runtime-new/tools/tool-function-names.d.ts.map +0 -1
  962. package/dist/runtime-new/tools/tool-function-names.js.map +0 -1
  963. package/dist/runtime-new/tools/tool-helpers.d.ts +0 -355
  964. package/dist/runtime-new/tools/tool-helpers.d.ts.map +0 -1
  965. package/dist/runtime-new/tools/tool-helpers.js +0 -1022
  966. package/dist/runtime-new/tools/tool-helpers.js.map +0 -1
  967. package/dist/runtime-new/tools/tools-index.d.ts.map +0 -1
  968. package/dist/runtime-new/tools/tools-index.js.map +0 -1
  969. package/dist/runtime-new/tools/turn-tool-selection.d.ts +0 -16
  970. package/dist/runtime-new/tools/turn-tool-selection.d.ts.map +0 -1
  971. package/dist/runtime-new/tools/turn-tool-selection.js +0 -94
  972. package/dist/runtime-new/tools/turn-tool-selection.js.map +0 -1
  973. package/dist/runtime-new/tools/workspace.d.ts.map +0 -1
  974. package/dist/runtime-new/tools/workspace.js.map +0 -1
  975. package/dist/storage/index.d.ts +0 -2
  976. package/dist/storage/index.d.ts.map +0 -1
  977. package/dist/storage/index.js +0 -2
  978. package/dist/storage/index.js.map +0 -1
  979. package/dist/tools/index.d.ts +0 -2
  980. package/dist/tools/index.d.ts.map +0 -1
  981. package/dist/tools/index.js +0 -2
  982. package/dist/tools/index.js.map +0 -1
  983. package/dist/voice/index.d.ts +0 -2
  984. package/dist/voice/index.d.ts.map +0 -1
  985. package/dist/voice/index.js +0 -2
  986. package/dist/voice/index.js.map +0 -1
  987. /package/dist/channels/{api-new → api}/api-index.d.ts +0 -0
  988. /package/dist/channels/{api-new → api}/api-index.js +0 -0
  989. /package/dist/channels/{api-new → api}/index.d.ts +0 -0
  990. /package/dist/channels/{api-new → api}/index.js +0 -0
  991. /package/dist/channels/{api-new → api}/rate-limiter.d.ts +0 -0
  992. /package/dist/channels/{api-new → api}/rate-limiter.js +0 -0
  993. /package/dist/channels/{api-new → api}/routes/agents.d.ts +0 -0
  994. /package/dist/channels/{api-new → api}/routes/agents.js +0 -0
  995. /package/dist/channels/{api-new → api}/routes/chat.d.ts +0 -0
  996. /package/dist/channels/{api-new → api}/routes/config.d.ts +0 -0
  997. /package/dist/channels/{api-new → api}/routes/config.js +0 -0
  998. /package/dist/channels/{api-new → api}/routes/health.d.ts +0 -0
  999. /package/dist/channels/{api-new → api}/routes/health.js +0 -0
  1000. /package/dist/channels/{api-new → api}/routes/index.d.ts +0 -0
  1001. /package/dist/channels/{api-new → api}/routes/index.js +0 -0
  1002. /package/dist/channels/{api-new → api}/routes/social.d.ts +0 -0
  1003. /package/dist/channels/{api-new → api}/routes/social.js +0 -0
  1004. /package/dist/channels/{api-new → api}/routes/types.js +0 -0
  1005. /package/dist/channels/{api-new → api}/server-helpers.js +0 -0
  1006. /package/dist/channels/{api-new → api}/types.js +0 -0
  1007. /package/dist/channels/{browser-new → browser}/BrowserClient.d.ts +0 -0
  1008. /package/dist/channels/{browser-new → browser}/BrowserClient.js +0 -0
  1009. /package/dist/channels/{browser-new → browser}/BrowserInteractions.d.ts +0 -0
  1010. /package/dist/channels/{browser-new → browser}/BrowserInteractions.js +0 -0
  1011. /package/dist/channels/{browser-new → browser}/BrowserSession.d.ts +0 -0
  1012. /package/dist/channels/{browser-new → browser}/BrowserSession.js +0 -0
  1013. /package/dist/channels/{browser-new → browser}/browser-index.d.ts +0 -0
  1014. /package/dist/channels/{browser-new → browser}/browser-index.js +0 -0
  1015. /package/dist/channels/{browser-new → browser}/index.d.ts +0 -0
  1016. /package/dist/channels/{browser-new → browser}/index.js +0 -0
  1017. /package/dist/channels/{browser-new → browser}/types.d.ts +0 -0
  1018. /package/dist/channels/{browser-new → browser}/types.js +0 -0
  1019. /package/dist/channels/{voice-new → voice}/call-client.d.ts +0 -0
  1020. /package/dist/channels/{voice-new → voice}/call-client.js +0 -0
  1021. /package/dist/channels/{voice-new → voice}/index.d.ts +0 -0
  1022. /package/dist/channels/{voice-new → voice}/index.js +0 -0
  1023. /package/dist/channels/{voice-new → voice}/speech-catalog.d.ts +0 -0
  1024. /package/dist/channels/{voice-new → voice}/speech-catalog.js +0 -0
  1025. /package/dist/channels/{voice-new → voice}/streaming-pipeline.d.ts +0 -0
  1026. /package/dist/channels/{voice-new → voice}/telephony-webhook-server.d.ts +0 -0
  1027. /package/dist/channels/{voice-new → voice}/telephony-webhook-server.js +0 -0
  1028. /package/dist/channels/{voice-new → voice}/voice-index.d.ts +0 -0
  1029. /package/dist/channels/{voice-new → voice}/voice-index.js +0 -0
  1030. /package/dist/channels/{voice-new → voice}/ws-server.d.ts +0 -0
  1031. /package/dist/{memory-new → memory}/auto-ingest/MemoryAutoIngestPipeline.js +0 -0
  1032. /package/dist/{memory-new → memory}/auto-ingest/index.d.ts +0 -0
  1033. /package/dist/{memory-new → memory}/auto-ingest/index.js +0 -0
  1034. /package/dist/{memory-new → memory}/initialization/CognitiveMemoryInitializer.d.ts +0 -0
  1035. /package/dist/{memory-new → memory}/initialization/MemorySystemInitializer.d.ts +0 -0
  1036. /package/dist/{memory-new → memory}/initialization/MemorySystemInitializer.js +0 -0
  1037. /package/dist/{memory-new → memory}/initialization/index.d.ts +0 -0
  1038. /package/dist/{memory-new → memory}/initialization/index.js +0 -0
  1039. /package/dist/{memory-new → memory}/rag/QueryExpander.d.ts +0 -0
  1040. /package/dist/{memory-new → memory}/rag/QueryExpander.js +0 -0
  1041. /package/dist/{memory-new → memory}/rag/RAGAuditPersistence.d.ts +0 -0
  1042. /package/dist/{memory-new → memory}/rag/RAGAuditPersistence.js +0 -0
  1043. /package/dist/{memory-new → memory}/rag/http-proxy.js +0 -0
  1044. /package/dist/{memory-new → memory}/rag/index.d.ts +0 -0
  1045. /package/dist/{memory-new → memory}/rag/index.js +0 -0
  1046. /package/dist/{memory-new → memory}/rag/rag-client.d.ts +0 -0
  1047. /package/dist/{memory-new → memory}/rag/rag-client.js +0 -0
  1048. /package/dist/{memory-new → memory}/rag/rag-index.d.ts +0 -0
  1049. /package/dist/{memory-new → memory}/rag/rag-index.js +0 -0
  1050. /package/dist/{memory-new → memory}/retrieval/TurnMemoryRetriever.js +0 -0
  1051. /package/dist/{memory-new → memory}/retrieval/index.d.ts +0 -0
  1052. /package/dist/{memory-new → memory}/retrieval/index.js +0 -0
  1053. /package/dist/{memory-new → memory}/storage/AgentMemoryAdapter.d.ts +0 -0
  1054. /package/dist/{memory-new → memory}/storage/AgentMemoryAdapter.js +0 -0
  1055. /package/dist/{memory-new → memory}/storage/AgentStateStore.d.ts +0 -0
  1056. /package/dist/{memory-new → memory}/storage/AgentStateStore.js +0 -0
  1057. /package/dist/{memory-new → memory}/storage/AgentStorageManager.d.ts +0 -0
  1058. /package/dist/{memory-new → memory}/storage/AgentStorageManager.js +0 -0
  1059. /package/dist/{memory-new → memory}/storage/PersonalityMemoryConfig.d.ts +0 -0
  1060. /package/dist/{memory-new → memory}/storage/PersonalityMemoryConfig.js +0 -0
  1061. /package/dist/{memory-new → memory}/storage/index.d.ts +0 -0
  1062. /package/dist/{memory-new → memory}/storage/index.js +0 -0
  1063. /package/dist/{memory-new → memory}/storage/types.d.ts +0 -0
  1064. /package/dist/{memory-new → memory}/storage/types.js +0 -0
  1065. /package/dist/platform/{config-new → config}/config-index.d.ts +0 -0
  1066. /package/dist/platform/{config-new → config}/config-index.js +0 -0
  1067. /package/dist/platform/{config-new → config}/errors.d.ts +0 -0
  1068. /package/dist/platform/{config-new → config}/errors.js +0 -0
  1069. /package/dist/platform/{config-new → config}/index.d.ts +0 -0
  1070. /package/dist/platform/{config-new → config}/index.js +0 -0
  1071. /package/dist/platform/{config-new → config}/load.js +0 -0
  1072. /package/dist/platform/{config-new → config}/persona-registry.js +0 -0
  1073. /package/dist/platform/{config-new → config}/provider-defaults.js +0 -0
  1074. /package/dist/platform/{config-new → config}/schema.js +0 -0
  1075. /package/dist/platform/{config-new → config}/wallet-types.d.ts +0 -0
  1076. /package/dist/platform/{config-new → config}/wallet-types.js +0 -0
  1077. /package/dist/platform/{discovery-new → discovery}/discovery-index.d.ts +0 -0
  1078. /package/dist/platform/{discovery-new → discovery}/discovery-index.js +0 -0
  1079. /package/dist/platform/{discovery-new → discovery}/index.d.ts +0 -0
  1080. /package/dist/platform/{discovery-new → discovery}/index.js +0 -0
  1081. /package/dist/platform/{discovery-new → discovery}/preset-co-occurrence.d.ts +0 -0
  1082. /package/dist/{runtime-new → runtime}/agentos-bridge/agentos-runtime.d.ts +0 -0
  1083. /package/dist/{runtime-new → runtime}/agentos-bridge/agentos-runtime.js +0 -0
  1084. /package/dist/{runtime-new → runtime}/agentos-bridge/index.d.ts +0 -0
  1085. /package/dist/{runtime-new → runtime}/agentos-bridge/index.js +0 -0
  1086. /package/dist/{runtime-new → runtime}/agentos-bridge/query-router-init.js +0 -0
  1087. /package/dist/{runtime-new → runtime}/agentos-bridge/rag-state-persistence.d.ts +0 -0
  1088. /package/dist/{runtime-new → runtime}/agentos-bridge/rag-state-persistence.js +0 -0
  1089. /package/dist/{runtime-new → runtime}/agentos-bridge/research-classifier.d.ts +0 -0
  1090. /package/dist/{runtime-new → runtime}/agentos-bridge/research-classifier.js +0 -0
  1091. /package/dist/{runtime-new → runtime}/compaction/CompactionManager.d.ts +0 -0
  1092. /package/dist/{runtime-new → runtime}/compaction/CompactionManager.js +0 -0
  1093. /package/dist/{runtime-new → runtime}/compaction/index.d.ts +0 -0
  1094. /package/dist/{runtime-new → runtime}/compaction/index.js +0 -0
  1095. /package/dist/{runtime-new → runtime}/execution/adaptive-execution.js +0 -0
  1096. /package/dist/{runtime-new → runtime}/execution/empty-output-fallback.d.ts +0 -0
  1097. /package/dist/{runtime-new → runtime}/execution/empty-output-fallback.js +0 -0
  1098. /package/dist/{runtime-new → runtime}/execution/index.d.ts +0 -0
  1099. /package/dist/{runtime-new → runtime}/execution/index.js +0 -0
  1100. /package/dist/{runtime-new → runtime}/execution/llm-stream-adapter.d.ts +0 -0
  1101. /package/dist/{runtime-new → runtime}/execution/llm-stream-adapter.js +0 -0
  1102. /package/dist/{runtime-new → runtime}/execution/system-prompt-builder.js +0 -0
  1103. /package/dist/{runtime-new → runtime}/identity/agent-identity.d.ts +0 -0
  1104. /package/dist/{runtime-new → runtime}/identity/agent-identity.js +0 -0
  1105. /package/dist/{runtime-new → runtime}/identity/api-key-resolver.d.ts +0 -0
  1106. /package/dist/{runtime-new → runtime}/identity/api-key-resolver.js +0 -0
  1107. /package/dist/{runtime-new → runtime}/identity/index.d.ts +0 -0
  1108. /package/dist/{runtime-new → runtime}/identity/index.js +0 -0
  1109. /package/dist/{runtime-new → runtime}/inference/SmallModelResolver.d.ts +0 -0
  1110. /package/dist/{runtime-new → runtime}/inference/index.d.ts +0 -0
  1111. /package/dist/{runtime-new → runtime}/inference/index.js +0 -0
  1112. /package/dist/{runtime-new → runtime}/inference/inference-index.d.ts +0 -0
  1113. /package/dist/{runtime-new → runtime}/inference/inference-index.js +0 -0
  1114. /package/dist/{runtime-new → runtime}/inference/types.js +0 -0
  1115. /package/dist/{runtime-new → runtime}/tools/ElevenLabsTool.d.ts +0 -0
  1116. /package/dist/{runtime-new → runtime}/tools/ElevenLabsTool.js +0 -0
  1117. /package/dist/{runtime-new → runtime}/tools/FeedSearchTool.d.ts +0 -0
  1118. /package/dist/{runtime-new → runtime}/tools/FeedSearchTool.js +0 -0
  1119. /package/dist/{runtime-new → runtime}/tools/GiphyTool.d.ts +0 -0
  1120. /package/dist/{runtime-new → runtime}/tools/GiphyTool.js +0 -0
  1121. /package/dist/{runtime-new → runtime}/tools/LlmsTxtDiscovery.d.ts +0 -0
  1122. /package/dist/{runtime-new → runtime}/tools/LlmsTxtDiscovery.js +0 -0
  1123. /package/dist/{runtime-new → runtime}/tools/MediaSearchTool.d.ts +0 -0
  1124. /package/dist/{runtime-new → runtime}/tools/MediaSearchTool.js +0 -0
  1125. /package/dist/{runtime-new → runtime}/tools/MemoryReadTool.d.ts +0 -0
  1126. /package/dist/{runtime-new → runtime}/tools/MemoryReadTool.js +0 -0
  1127. /package/dist/{runtime-new → runtime}/tools/NewsSearchTool.d.ts +0 -0
  1128. /package/dist/{runtime-new → runtime}/tools/NewsSearchTool.js +0 -0
  1129. /package/dist/{runtime-new → runtime}/tools/RAGTool.d.ts +0 -0
  1130. /package/dist/{runtime-new → runtime}/tools/SerperSearchTool.d.ts +0 -0
  1131. /package/dist/{runtime-new → runtime}/tools/SerperSearchTool.js +0 -0
  1132. /package/dist/{runtime-new → runtime}/tools/ToolRegistry.d.ts +0 -0
  1133. /package/dist/{runtime-new → runtime}/tools/ToolRegistry.js +0 -0
  1134. /package/dist/{runtime-new → runtime}/tools/index.d.ts +0 -0
  1135. /package/dist/{runtime-new → runtime}/tools/index.js +0 -0
  1136. /package/dist/{runtime-new → runtime}/tools/ollama-options.d.ts +0 -0
  1137. /package/dist/{runtime-new → runtime}/tools/ollama-options.js +0 -0
  1138. /package/dist/{runtime-new → runtime}/tools/tool-failure-learner.js +0 -0
  1139. /package/dist/{runtime-new → runtime}/tools/tool-function-names.d.ts +0 -0
  1140. /package/dist/{runtime-new → runtime}/tools/tool-function-names.js +0 -0
  1141. /package/dist/{runtime-new → runtime}/tools/tools-index.d.ts +0 -0
  1142. /package/dist/{runtime-new → runtime}/tools/tools-index.js +0 -0
  1143. /package/dist/{runtime-new → runtime}/tools/workspace.d.ts +0 -0
  1144. /package/dist/{runtime-new → runtime}/tools/workspace.js +0 -0
  1145. /package/dist/{core → security}/safe-merge.d.ts +0 -0
  1146. /package/dist/{core → security}/safe-merge.js +0 -0
@@ -0,0 +1,152 @@
1
+ /**
2
+ * @fileoverview HITL approval flow, security tier permission checks,
3
+ * step-up authorization, guardrails validation, and tool allowlist/denylist
4
+ * checking.
5
+ *
6
+ * Extracted from `tool-calling.ts` to isolate the authorization and
7
+ * guardrails layer from the LLM loop and streaming logic. Both the
8
+ * non-streaming {@link runToolCallingTurn} and streaming
9
+ * {@link streamToolCallingTurn} delegate tool authorization to the
10
+ * functions exported here.
11
+ *
12
+ * @module wunderland/runtime/ToolApprovalHandler
13
+ */
14
+ import type { StepUpAuthorizationManager } from '../../security/StepUpAuthorizationManager.js';
15
+ import type { ToolInstance } from './tool-helpers.js';
16
+ export { TOOL_FALLBACK_MAP } from './tool-helpers.js';
17
+ /**
18
+ * Options for {@link authorizeToolCall}.
19
+ *
20
+ * Contains everything needed to decide whether a tool call should be
21
+ * executed, denied, or escalated to the user for HITL approval.
22
+ */
23
+ export interface ToolAuthorizationOpts {
24
+ /** The resolved tool instance. */
25
+ tool: ToolInstance;
26
+ /** The canonical tool name (after any rewriting). */
27
+ toolName: string;
28
+ /** The tool call arguments from the LLM. */
29
+ args: Record<string, unknown>;
30
+ /** The tool call ID for message correlation. */
31
+ callId: string;
32
+ /** The authorization manager instance. */
33
+ authManager: StepUpAuthorizationManager;
34
+ /** Shared context passed to tool execution. */
35
+ toolContext: Record<string, unknown>;
36
+ /** Whether to skip all permission checks. */
37
+ dangerouslySkipPermissions: boolean;
38
+ /** Interactive permission callback for HITL approval. */
39
+ askPermission: (tool: ToolInstance, args: Record<string, unknown>) => Promise<boolean>;
40
+ /** Whether to wrap tool output for the LLM. */
41
+ shouldWrapToolOutputs: boolean;
42
+ /** Whether to abort on any tool failure. */
43
+ failClosedOnToolFailure: boolean;
44
+ /** Mutable message array for pushing denial messages. */
45
+ messages: Array<Record<string, unknown>>;
46
+ }
47
+ /**
48
+ * Result of a tool authorization check.
49
+ */
50
+ export interface ToolAuthorizationResult {
51
+ /** Whether the tool call is authorized to proceed. */
52
+ authorized: boolean;
53
+ /** Whether the user explicitly approved this call via HITL. */
54
+ hitlApproved: boolean;
55
+ /** If authorization failed and fail_closed is active, the reply to return. */
56
+ earlyReturn?: string;
57
+ /** If authorization failed, the denial reason. */
58
+ error?: string;
59
+ }
60
+ /**
61
+ * Options for {@link executeWithGuardrails}.
62
+ *
63
+ * Encapsulates the guardrails validation, folder escalation, and
64
+ * tool execution within a single instrumented span.
65
+ */
66
+ export interface GuardrailExecutionOpts {
67
+ /** The resolved tool instance. */
68
+ tool: ToolInstance;
69
+ /** The canonical tool name. */
70
+ toolName: string;
71
+ /** The resolved tool key from the tool map. */
72
+ resolvedToolKey: string;
73
+ /** The tool call arguments. */
74
+ args: Record<string, unknown>;
75
+ /** The tool call ID. */
76
+ callId: string;
77
+ /** Shared context passed to tool execution. */
78
+ toolContext: Record<string, unknown>;
79
+ /** Per-call tool context (may include onToolProgress). */
80
+ callToolContext: Record<string, unknown>;
81
+ /** Whether the user already HITL-approved this call (skip re-prompting). */
82
+ hitlApproved: boolean;
83
+ /** Whether to skip all permission checks. */
84
+ dangerouslySkipPermissions: boolean;
85
+ /** Interactive permission callback for folder escalation. */
86
+ askPermission: (tool: ToolInstance, args: Record<string, unknown>) => Promise<boolean>;
87
+ }
88
+ /**
89
+ * Perform step-up authorization for a tool call.
90
+ *
91
+ * Evaluates the tool against the {@link StepUpAuthorizationManager}'s
92
+ * tier configuration:
93
+ *
94
+ * - **Tier 1 (Autonomous)**: Auto-approved, no prompt.
95
+ * - **Tier 2 (Async Review)**: Auto-approved, queued for review.
96
+ * - **Tier 3 (Sync HITL)**: Prompts the user via `askPermission`.
97
+ *
98
+ * When `dangerouslySkipPermissions` is `true`, all tiers are auto-approved.
99
+ *
100
+ * @param opts - Authorization options.
101
+ * @returns Authorization result indicating whether to proceed.
102
+ */
103
+ export declare function authorizeToolCall(opts: ToolAuthorizationOpts): Promise<ToolAuthorizationResult>;
104
+ /**
105
+ * Execute a tool with guardrails validation and folder escalation.
106
+ *
107
+ * Wraps tool execution inside an OTel span and performs:
108
+ *
109
+ * 1. **Pre-check**: `file_read` on directories fails fast with a helpful message.
110
+ * 2. **Guardrails validation**: Checks folder access rules, sandbox boundaries.
111
+ * 3. **Folder escalation**: If denied paths are escalatable, prompts the user
112
+ * (or auto-grants if HITL already approved this call) and adds folder rules.
113
+ * 4. **Execution**: Calls `tool.execute(args, callToolContext)`.
114
+ *
115
+ * @param opts - Execution options.
116
+ * @returns The tool execution result.
117
+ */
118
+ export declare function executeWithGuardrails(opts: GuardrailExecutionOpts): Promise<{
119
+ success: boolean;
120
+ output?: unknown;
121
+ error?: string;
122
+ }>;
123
+ /**
124
+ * Build the tool result message payload, including fallback suggestions
125
+ * for failed or empty-result tools.
126
+ *
127
+ * @param result - The tool execution result.
128
+ * @param toolName - The canonical tool name.
129
+ * @param callId - The tool call ID.
130
+ * @param toolMap - The current tool map (to check fallback availability).
131
+ * @param shouldWrapToolOutputs - Whether to wrap output for the LLM.
132
+ * @param debugMode - Whether to log debug output.
133
+ * @returns The message content string to push into the conversation.
134
+ */
135
+ export declare function buildToolResultPayload(result: {
136
+ success: boolean;
137
+ output?: unknown;
138
+ error?: string;
139
+ }, toolName: string, callId: string, toolMap: Map<string, ToolInstance>, shouldWrapToolOutputs: boolean, debugMode: boolean): Promise<string>;
140
+ /**
141
+ * Build the error payload for a tool that threw an exception.
142
+ *
143
+ * Includes API key guidance hints and suggested fallback tools when
144
+ * available in the tool map.
145
+ *
146
+ * @param errMsg - The error message from the thrown exception.
147
+ * @param toolName - The canonical tool name.
148
+ * @param toolMap - The current tool map.
149
+ * @returns The JSON-serialized error payload.
150
+ */
151
+ export declare function buildToolErrorPayload(errMsg: string, toolName: string, toolMap: Map<string, ToolInstance>): Promise<string>;
152
+ //# sourceMappingURL=ToolApprovalHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolApprovalHandler.d.ts","sourceRoot":"","sources":["../../../src/runtime/tools/ToolApprovalHandler.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAetD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAItD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,kCAAkC;IAClC,IAAI,EAAE,YAAY,CAAC;IACnB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,WAAW,EAAE,0BAA0B,CAAC;IACxC,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,6CAA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EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACxF;AAID;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,uBAAuB,CAAC,CA0DlC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA+FjE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9D,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EAClC,qBAAqB,EAAE,OAAO,EAC9B,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,MAAM,CAAC,CAqCjB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,GACjC,OAAO,CAAC,MAAM,CAAC,CAcjB"}
@@ -0,0 +1,269 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * @fileoverview HITL approval flow, security tier permission checks,
4
+ * step-up authorization, guardrails validation, and tool allowlist/denylist
5
+ * checking.
6
+ *
7
+ * Extracted from `tool-calling.ts` to isolate the authorization and
8
+ * guardrails layer from the LLM loop and streaming logic. Both the
9
+ * non-streaming {@link runToolCallingTurn} and streaming
10
+ * {@link streamToolCallingTurn} delegate tool authorization to the
11
+ * functions exported here.
12
+ *
13
+ * @module wunderland/runtime/ToolApprovalHandler
14
+ */
15
+ import * as path from 'node:path';
16
+ import { ToolRiskTier, } from '../../types/core-types.js';
17
+ import { getGuardrails, toAuthorizableTool, wrapUntrustedToolOutput, getAgentIdForGuardrails, getAgentWorkspaceDirFromContext, withSpan, redactToolOutputForLLM, safeJsonStringify, isEmptySearchResult, TOOL_FALLBACK_MAP, } from './tool-helpers.js';
18
+ // Re-export TOOL_FALLBACK_MAP for consumers that import from this module.
19
+ export { TOOL_FALLBACK_MAP } from './tool-helpers.js';
20
+ // ── Functions ──────────────────────────────────────────────────────────────
21
+ /**
22
+ * Perform step-up authorization for a tool call.
23
+ *
24
+ * Evaluates the tool against the {@link StepUpAuthorizationManager}'s
25
+ * tier configuration:
26
+ *
27
+ * - **Tier 1 (Autonomous)**: Auto-approved, no prompt.
28
+ * - **Tier 2 (Async Review)**: Auto-approved, queued for review.
29
+ * - **Tier 3 (Sync HITL)**: Prompts the user via `askPermission`.
30
+ *
31
+ * When `dangerouslySkipPermissions` is `true`, all tiers are auto-approved.
32
+ *
33
+ * @param opts - Authorization options.
34
+ * @returns Authorization result indicating whether to proceed.
35
+ */
36
+ export async function authorizeToolCall(opts) {
37
+ const { tool, toolName, args, callId, authManager, toolContext, dangerouslySkipPermissions, askPermission, shouldWrapToolOutputs, failClosedOnToolFailure, messages } = opts;
38
+ const authResult = await authManager.authorize({
39
+ tool: toAuthorizableTool(tool),
40
+ args,
41
+ context: {
42
+ userId: String(toolContext?.['userContext'] && typeof toolContext['userContext'] === 'object'
43
+ ? toolContext['userContext']?.['userId'] ?? 'cli-user'
44
+ : 'cli-user'),
45
+ sessionId: String(toolContext?.['gmiId'] ?? 'cli'),
46
+ gmiId: String(toolContext?.['personaId'] ?? 'cli'),
47
+ },
48
+ timestamp: new Date(),
49
+ });
50
+ if (!authResult.authorized) {
51
+ if (authResult.tier === ToolRiskTier.TIER_3_SYNC_HITL && !dangerouslySkipPermissions) {
52
+ const ok = await askPermission(tool, args);
53
+ if (!ok) {
54
+ const denial = JSON.stringify({ error: `Permission denied for tool: ${toolName}` });
55
+ messages.push({
56
+ role: 'tool',
57
+ tool_call_id: callId,
58
+ content: shouldWrapToolOutputs
59
+ ? wrapUntrustedToolOutput(denial, { toolName, toolCallId: callId, includeWarning: false })
60
+ : denial,
61
+ });
62
+ const earlyReturn = failClosedOnToolFailure
63
+ ? `[tool_failure_mode=fail_closed] Permission denied for tool: ${toolName}.`
64
+ : undefined;
65
+ if (earlyReturn) {
66
+ messages.push({ role: 'assistant', content: earlyReturn });
67
+ }
68
+ return { authorized: false, hitlApproved: false, earlyReturn, error: `Permission denied for tool: ${toolName}` };
69
+ }
70
+ return { authorized: true, hitlApproved: true };
71
+ }
72
+ else if (!dangerouslySkipPermissions) {
73
+ const denial = JSON.stringify({ error: `Permission denied for tool: ${toolName}` });
74
+ messages.push({
75
+ role: 'tool',
76
+ tool_call_id: callId,
77
+ content: shouldWrapToolOutputs
78
+ ? wrapUntrustedToolOutput(denial, { toolName, toolCallId: callId, includeWarning: false })
79
+ : denial,
80
+ });
81
+ const earlyReturn = failClosedOnToolFailure
82
+ ? `[tool_failure_mode=fail_closed] Permission denied for tool: ${toolName}.`
83
+ : undefined;
84
+ if (earlyReturn) {
85
+ messages.push({ role: 'assistant', content: earlyReturn });
86
+ }
87
+ return { authorized: false, hitlApproved: false, earlyReturn, error: `Permission denied for tool: ${toolName}` };
88
+ }
89
+ // dangerouslySkipPermissions — fall through to authorized
90
+ }
91
+ return { authorized: true, hitlApproved: false };
92
+ }
93
+ /**
94
+ * Execute a tool with guardrails validation and folder escalation.
95
+ *
96
+ * Wraps tool execution inside an OTel span and performs:
97
+ *
98
+ * 1. **Pre-check**: `file_read` on directories fails fast with a helpful message.
99
+ * 2. **Guardrails validation**: Checks folder access rules, sandbox boundaries.
100
+ * 3. **Folder escalation**: If denied paths are escalatable, prompts the user
101
+ * (or auto-grants if HITL already approved this call) and adds folder rules.
102
+ * 4. **Execution**: Calls `tool.execute(args, callToolContext)`.
103
+ *
104
+ * @param opts - Execution options.
105
+ * @returns The tool execution result.
106
+ */
107
+ export async function executeWithGuardrails(opts) {
108
+ return await withSpan('wunderland.tool.execute', {
109
+ tool_name: opts.toolName,
110
+ tool_category: opts.tool.category ?? '',
111
+ tool_has_side_effects: opts.tool.hasSideEffects === true,
112
+ authorized: true,
113
+ }, async () => {
114
+ // Pre-check: file_read on directories should fail-fast
115
+ if (opts.tool.name === 'file_read') {
116
+ const readPath = opts.args.path || opts.args.file_path || opts.args.filePath;
117
+ if (typeof readPath === 'string') {
118
+ try {
119
+ const fsp = await import('node:fs/promises');
120
+ const s = await fsp.stat(path.resolve(readPath));
121
+ if (s.isDirectory()) {
122
+ return {
123
+ success: false,
124
+ error: `"${readPath}" is a directory, not a file. Use list_directory to view directory contents.`,
125
+ };
126
+ }
127
+ }
128
+ catch { /* path doesn't exist — let normal flow handle */ }
129
+ }
130
+ }
131
+ // Guardrails validation
132
+ const guardrails = getGuardrails();
133
+ const agentId = getAgentIdForGuardrails(opts.toolContext);
134
+ const guardrailsCheck = await guardrails.validateBeforeExecution({
135
+ toolId: opts.resolvedToolKey || opts.tool.name,
136
+ toolName: opts.tool.name,
137
+ args: opts.args,
138
+ agentId,
139
+ userId: opts.toolContext.userContext?.userId,
140
+ sessionId: opts.toolContext.sessionId,
141
+ workingDirectory: getAgentWorkspaceDirFromContext(opts.toolContext, agentId),
142
+ tool: opts.tool,
143
+ });
144
+ if (!guardrailsCheck.allowed) {
145
+ // Attempt automatic permission escalation via HITL
146
+ const deniedPaths = (guardrailsCheck.violations || [])
147
+ .map(v => v.attemptedPath)
148
+ .filter((p) => !!p);
149
+ const allEscalatable = deniedPaths.length > 0 && deniedPaths.every(p => guardrails.isEscalatable(p));
150
+ if (allEscalatable) {
151
+ const operation = deniedPaths.length > 0 ? (guardrailsCheck.violations?.[0]?.operation || opts.tool.name) : opts.tool.name;
152
+ const isWrite = operation.includes('write') || operation.includes('delete') || operation.includes('append');
153
+ const autoGrant = opts.hitlApproved || opts.dangerouslySkipPermissions;
154
+ const approved = autoGrant || (opts.askPermission
155
+ ? await opts.askPermission({ ...opts.tool, name: `folder_access:${opts.tool.name}`, description: `Grant ${isWrite ? 'write' : 'read'} access to: ${deniedPaths.join(', ')}` }, { paths: deniedPaths, operation: isWrite ? 'write' : 'read', originalTool: opts.tool.name })
156
+ : false);
157
+ if (approved) {
158
+ for (const p of deniedPaths) {
159
+ const dir = p.endsWith('/') ? p : path.dirname(p);
160
+ guardrails.addFolderRule(agentId, {
161
+ pattern: `${dir}/**`,
162
+ read: true,
163
+ write: isWrite,
164
+ description: `Granted at runtime for ${opts.tool.name}`,
165
+ });
166
+ const shellSvc = opts.tool.shellService;
167
+ if (shellSvc && typeof shellSvc.addReadRoot === 'function') {
168
+ shellSvc.addReadRoot(dir);
169
+ if (isWrite) {
170
+ shellSvc.addWriteRoot(dir);
171
+ }
172
+ }
173
+ }
174
+ return await opts.tool.execute(opts.args, opts.callToolContext);
175
+ }
176
+ }
177
+ return {
178
+ success: false,
179
+ error: guardrailsCheck.reason,
180
+ output: {
181
+ violations: guardrailsCheck.violations,
182
+ canRequestAccess: allEscalatable,
183
+ },
184
+ };
185
+ }
186
+ return await opts.tool.execute(opts.args, opts.callToolContext);
187
+ });
188
+ }
189
+ /**
190
+ * Build the tool result message payload, including fallback suggestions
191
+ * for failed or empty-result tools.
192
+ *
193
+ * @param result - The tool execution result.
194
+ * @param toolName - The canonical tool name.
195
+ * @param callId - The tool call ID.
196
+ * @param toolMap - The current tool map (to check fallback availability).
197
+ * @param shouldWrapToolOutputs - Whether to wrap output for the LLM.
198
+ * @param debugMode - Whether to log debug output.
199
+ * @returns The message content string to push into the conversation.
200
+ */
201
+ export async function buildToolResultPayload(result, toolName, callId, toolMap, shouldWrapToolOutputs, debugMode) {
202
+ let payload;
203
+ if (result?.success) {
204
+ payload = redactToolOutputForLLM(result.output);
205
+ const emptyFallbacks = TOOL_FALLBACK_MAP[toolName];
206
+ const availableEmptyFallbacks = emptyFallbacks?.filter(f => toolMap?.has(f));
207
+ if (availableEmptyFallbacks?.length && isEmptySearchResult(result.output)) {
208
+ payload = {
209
+ ...((typeof payload === 'object' && payload) || { output: payload }),
210
+ suggestedFallbacks: availableEmptyFallbacks,
211
+ hint: 'Search returned 0 results. Try the suggested fallback tools.',
212
+ };
213
+ }
214
+ }
215
+ else {
216
+ const errorMsg = result?.error || 'Tool failed';
217
+ let apiKeyHint;
218
+ try {
219
+ const registry = await import('@framers/agentos-extensions-registry');
220
+ const getApiKeyGuidance = registry.getApiKeyGuidance;
221
+ if (typeof getApiKeyGuidance === 'function')
222
+ apiKeyHint = getApiKeyGuidance(errorMsg, toolName) ?? undefined;
223
+ }
224
+ catch { /* best-effort */ }
225
+ const fallbacksOnFail = TOOL_FALLBACK_MAP[toolName];
226
+ const availableFallbacksOnFail = fallbacksOnFail?.filter(f => toolMap?.has(f));
227
+ payload = {
228
+ error: errorMsg,
229
+ ...(apiKeyHint ? { apiKeyGuidance: apiKeyHint } : null),
230
+ ...(availableFallbacksOnFail?.length ? { suggestedFallbacks: availableFallbacksOnFail } : null),
231
+ };
232
+ }
233
+ const json = safeJsonStringify(payload, 20000);
234
+ if (debugMode) {
235
+ console.log(`[tool-calling] Tool ${toolName} result: success=${result?.success}, output=${json.slice(0, 300)}`);
236
+ }
237
+ return shouldWrapToolOutputs
238
+ ? wrapUntrustedToolOutput(json, { toolName, toolCallId: callId, includeWarning: true })
239
+ : json;
240
+ }
241
+ /**
242
+ * Build the error payload for a tool that threw an exception.
243
+ *
244
+ * Includes API key guidance hints and suggested fallback tools when
245
+ * available in the tool map.
246
+ *
247
+ * @param errMsg - The error message from the thrown exception.
248
+ * @param toolName - The canonical tool name.
249
+ * @param toolMap - The current tool map.
250
+ * @returns The JSON-serialized error payload.
251
+ */
252
+ export async function buildToolErrorPayload(errMsg, toolName, toolMap) {
253
+ let apiKeyGuidance;
254
+ try {
255
+ const registry = await import('@framers/agentos-extensions-registry');
256
+ const getApiKeyGuidance = registry.getApiKeyGuidance;
257
+ if (typeof getApiKeyGuidance === 'function')
258
+ apiKeyGuidance = getApiKeyGuidance(errMsg, toolName) ?? undefined;
259
+ }
260
+ catch { /* best-effort */ }
261
+ const fallbacks = TOOL_FALLBACK_MAP[toolName];
262
+ const availableFallbacks = fallbacks?.filter(f => toolMap?.has(f));
263
+ return JSON.stringify({
264
+ error: `Tool threw: ${errMsg}`,
265
+ ...(apiKeyGuidance ? { apiKeyGuidance } : null),
266
+ ...(availableFallbacks?.length ? { suggestedFallbacks: availableFallbacks } : null),
267
+ });
268
+ }
269
+ //# sourceMappingURL=ToolApprovalHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolApprovalHandler.js","sourceRoot":"","sources":["../../../src/runtime/tools/ToolApprovalHandler.ts"],"names":[],"mappings":"AAAA,cAAc;AACd;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EACL,YAAY,GACb,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,+BAA+B,EAC/B,QAAQ,EACR,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,0EAA0E;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AA8EtD,8EAA8E;AAE9E;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,IAA2B;IAE3B,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,0BAA0B,EAAE,aAAa,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE7K,MAAM,UAAU,GAAG,MAAM,WAAW,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C9F;QACD,CAAC,mBAAmB,CAAC,cAAc,CAAC,EAAE;YACpC,SAAS,EAAE,cAAc;YACzB,MAAM,EAAE,cAAc;gBACpB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,8FAA8F;SACnG;KACF,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,200 @@
1
+ /**
2
+ * @fileoverview Streaming tool-call parsing and SSE chunk assembly.
3
+ *
4
+ * Extracted from `tool-calling.ts` to isolate the streaming-specific
5
+ * logic (SSE line iteration, token yielding, multi-round streaming loop)
6
+ * from the non-streaming tool-calling loop and the shared authorization
7
+ * layer.
8
+ *
9
+ * The main export is {@link streamToolCallingTurn}, an async generator
10
+ * that yields individual text tokens as they arrive from the LLM streaming
11
+ * API, enabling real-time TTS playback.
12
+ *
13
+ * @module wunderland/runtime/ToolStreamProcessor
14
+ */
15
+ import type { StepUpAuthorizationConfig } from '../../types/core-types.js';
16
+ import type { StepUpAuthorizationManager } from '../../security/StepUpAuthorizationManager.js';
17
+ import type { ToolInstance, LLMProviderConfig } from './tool-helpers.js';
18
+ /**
19
+ * Options for {@link streamToolCallingTurn}.
20
+ *
21
+ * Mirrors `runToolCallingTurn` options with the addition of an `AbortSignal`
22
+ * that enables external cancellation of the in-flight streaming LLM request.
23
+ * This is critical for the voice pipeline's barge-in flow: when the user
24
+ * starts speaking while the agent is mid-response, the pipeline aborts the
25
+ * signal to immediately stop token generation at the provider, saving both
26
+ * latency and tokens.
27
+ *
28
+ * @see {@link streamToolCallingTurn}
29
+ */
30
+ export interface StreamToolCallingTurnOpts {
31
+ /** LLM provider identifier (e.g. `'openai'`, `'openrouter'`, `'ollama'`). */
32
+ providerId?: string;
33
+ /** API key (or promise resolving to one) for the LLM provider. */
34
+ apiKey: string | Promise<string>;
35
+ /** Model name/ID (e.g. `'gpt-4o-mini'`, `'llama3'`). */
36
+ model: string;
37
+ /**
38
+ * Mutable conversation history. The streaming function appends assistant
39
+ * and tool messages to this array as the conversation progresses.
40
+ */
41
+ messages: Array<Record<string, unknown>>;
42
+ /** Map of tool name -> tool instance for tool execution. */
43
+ toolMap: Map<string, ToolInstance>;
44
+ /** Pre-built tool definitions (overrides auto-generation from toolMap). */
45
+ toolDefs?: Array<Record<string, unknown>>;
46
+ /** Lazy tool definition supplier (called per round; overrides toolDefs). */
47
+ getToolDefs?: () => Array<Record<string, unknown>>;
48
+ /** Shared context object passed to every tool `execute()` call. */
49
+ toolContext: Record<string, unknown>;
50
+ /** Maximum number of LLM round-trips before forcibly stopping. */
51
+ maxRounds: number;
52
+ /** When `true`, bypasses all step-up authorization checks. */
53
+ dangerouslySkipPermissions: boolean;
54
+ /** Custom step-up authorization tier configuration. */
55
+ stepUpAuthConfig?: StepUpAuthorizationConfig;
56
+ /** Interactive permission callback for Tier 3 (sync HITL) tools. */
57
+ askPermission: (tool: ToolInstance, args: Record<string, unknown>) => Promise<boolean>;
58
+ /** Optional checkpoint callback invoked before executing a batch of tool calls. */
59
+ askCheckpoint?: (info: {
60
+ round: number;
61
+ toolCalls: Array<{
62
+ toolName: string;
63
+ hasSideEffects: boolean;
64
+ args: Record<string, unknown>;
65
+ }>;
66
+ }) => Promise<boolean>;
67
+ /** Notification callback fired when a tool call is about to execute. */
68
+ onToolCall?: (tool: ToolInstance, args: Record<string, unknown>) => void;
69
+ /** Notification callback fired after each tool call completes. */
70
+ onToolResult?: (info: {
71
+ toolName: string;
72
+ args: Record<string, unknown>;
73
+ success: boolean;
74
+ error?: string;
75
+ output?: unknown;
76
+ durationMs: number;
77
+ }) => void;
78
+ /** Pre-configured authorization manager (skips internal creation). */
79
+ authorizationManager?: StepUpAuthorizationManager;
80
+ /** Custom base URL for the LLM API endpoint. */
81
+ baseUrl?: string;
82
+ /** Fallback LLM provider config for automatic retry on transient errors. */
83
+ fallback?: LLMProviderConfig;
84
+ /** Callback fired when the primary provider fails and we fall back. */
85
+ onFallback?: (primaryError: Error, fallbackProvider: string) => void;
86
+ /** Lazy API key supplier (alternative to static `apiKey`). */
87
+ getApiKey?: () => string | Promise<string>;
88
+ /** Ollama-specific runtime options (e.g. num_ctx, num_gpu). */
89
+ ollamaOptions?: Record<string, unknown>;
90
+ /**
91
+ * Behavior when a tool execution fails.
92
+ * - `'fail_open'` — report the error to the LLM and let it continue.
93
+ * - `'fail_closed'` — immediately abort the turn.
94
+ */
95
+ toolFailureMode?: 'fail_open' | 'fail_closed';
96
+ /** When `true`, tool names that require sanitization cause an error instead. */
97
+ strictToolNames?: boolean;
98
+ /** Enable verbose debug logging for the streaming loop. */
99
+ debug?: boolean;
100
+ /** Progress callback for long-running tool executions. */
101
+ onToolProgress?: (info: {
102
+ toolName: string;
103
+ phase: string;
104
+ message: string;
105
+ progress?: number;
106
+ }) => void;
107
+ /**
108
+ * External abort signal for cancelling the in-flight streaming LLM request.
109
+ *
110
+ * When aborted, the HTTP stream is terminated immediately via the
111
+ * `AbortController` wired into `fetch()`. This is the primary mechanism
112
+ * for voice pipeline barge-in: the orchestrator calls `abort()` on the
113
+ * agent session, which triggers this signal, stopping token generation
114
+ * at the provider.
115
+ *
116
+ * @see {@link StreamingPipelineAgentSession.abort}
117
+ */
118
+ signal?: AbortSignal;
119
+ }
120
+ /**
121
+ * Streaming variant of `runToolCallingTurn`.
122
+ *
123
+ * Yields individual text tokens as they arrive from the LLM streaming API,
124
+ * enabling real-time TTS playback (~500ms first-token latency instead of
125
+ * waiting for the full LLM response). Tool-call rounds are handled
126
+ * identically to the non-streaming variant: tool execution blocks, then
127
+ * the next LLM round resumes streaming.
128
+ *
129
+ * ## Multi-round streaming + blocking tool execution
130
+ *
131
+ * The outer loop runs up to `opts.maxRounds` LLM round-trips:
132
+ *
133
+ * 1. **Stream phase** -- Send the conversation to the LLM with
134
+ * `stream: true` and yield text tokens as they arrive via SSE. Tool-call
135
+ * fragments are accumulated silently by `wrapStreamingLLMAsGenerator`.
136
+ * 2. **Tool phase** (blocking) -- If the model's `finish_reason` is
137
+ * `'tool_calls'`, execute each requested tool synchronously. Tool
138
+ * results are appended to `opts.messages` as `role: 'tool'` messages.
139
+ * 3. **Next round** -- Loop back to step 1 with the updated conversation
140
+ * history, allowing the model to incorporate tool results and stream
141
+ * more text or request additional tools.
142
+ *
143
+ * The generator terminates when the model finishes with text only
144
+ * (`finish_reason: 'stop'`), the abort signal fires, or the round limit
145
+ * is reached.
146
+ *
147
+ * ## AbortSignal integration
148
+ *
149
+ * The optional `opts.signal` is wired through three layers:
150
+ * - **Outer loop**: checked at the start of each round and after tool execution.
151
+ * - **SSE fetch**: passed to `fetch()` so the HTTP connection is torn down
152
+ * immediately on abort, stopping token generation at the provider.
153
+ * - **Token iteration**: checked between each yielded token so the generator
154
+ * exits promptly after abort.
155
+ *
156
+ * This triple-layer cancellation ensures that voice pipeline barge-in stops
157
+ * the LLM within one event-loop tick of the abort signal.
158
+ *
159
+ * ## Provider fallback
160
+ *
161
+ * For providers that do not support SSE streaming (Ollama, Anthropic via
162
+ * the Messages API), this automatically falls back to the non-streaming
163
+ * `runToolCallingTurn` and post-splits the complete response into
164
+ * word-boundary chunks so the caller still receives an incremental token
165
+ * stream.
166
+ *
167
+ * @param opts - Configuration for the streaming tool-calling turn.
168
+ * @yields Individual text token strings (typically 1-4 words each).
169
+ * @returns The full accumulated reply text after all rounds complete.
170
+ *
171
+ * @example
172
+ * ```ts
173
+ * const controller = new AbortController();
174
+ * const gen = streamToolCallingTurn({
175
+ * providerId: 'openai',
176
+ * apiKey: process.env.OPENAI_API_KEY!,
177
+ * model: 'gpt-4o-mini',
178
+ * messages: [{ role: 'user', content: 'Hello' }],
179
+ * toolMap: myToolMap,
180
+ * toolContext: {},
181
+ * maxRounds: 8,
182
+ * dangerouslySkipPermissions: true,
183
+ * askPermission: async () => true,
184
+ * signal: controller.signal,
185
+ * });
186
+ *
187
+ * let result = await gen.next();
188
+ * while (!result.done) {
189
+ * ttsEngine.feed(result.value); // stream to TTS immediately
190
+ * result = await gen.next();
191
+ * }
192
+ * const fullReply = result.value;
193
+ * ```
194
+ *
195
+ * @see {@link runToolCallingTurn} for the non-streaming variant.
196
+ * @see {@link wrapStreamingLLMAsGenerator} for the SSE-to-generator adapter.
197
+ * @see {@link streamingOpenaiChatWithTools} for the HTTP streaming layer.
198
+ */
199
+ export declare function streamToolCallingTurn(opts: StreamToolCallingTurnOpts): AsyncGenerator<string, string, undefined>;
200
+ //# sourceMappingURL=ToolStreamProcessor.d.ts.map