aec-agent 1.0.3 → 1.0.4

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 (554) hide show
  1. package/dist/agent-core.d.ts +123 -3
  2. package/dist/agent-core.d.ts.map +1 -1
  3. package/dist/agent-core.js +219 -23
  4. package/dist/agent-core.js.map +1 -1
  5. package/dist/components/artifact-hub/artifact-hub.d.ts +11 -1
  6. package/dist/components/artifact-hub/artifact-hub.d.ts.map +1 -1
  7. package/dist/components/artifact-hub/artifact-hub.js +21 -1
  8. package/dist/components/artifact-hub/artifact-hub.js.map +1 -1
  9. package/dist/components/channel-platform-hub/adapter-kit.d.ts +51 -0
  10. package/dist/components/channel-platform-hub/adapter-kit.d.ts.map +1 -0
  11. package/dist/components/channel-platform-hub/adapter-kit.js +153 -0
  12. package/dist/components/channel-platform-hub/adapter-kit.js.map +1 -0
  13. package/dist/components/channel-platform-hub/channel-platform-hub.d.ts +34 -0
  14. package/dist/components/channel-platform-hub/channel-platform-hub.d.ts.map +1 -0
  15. package/dist/components/channel-platform-hub/channel-platform-hub.js +52 -0
  16. package/dist/components/channel-platform-hub/channel-platform-hub.js.map +1 -0
  17. package/dist/components/channel-platform-hub/discord/discord-adapter.d.ts +57 -0
  18. package/dist/components/channel-platform-hub/discord/discord-adapter.d.ts.map +1 -0
  19. package/dist/components/channel-platform-hub/discord/discord-adapter.js +412 -0
  20. package/dist/components/channel-platform-hub/discord/discord-adapter.js.map +1 -0
  21. package/dist/components/channel-platform-hub/slack/slack-adapter.d.ts +56 -0
  22. package/dist/components/channel-platform-hub/slack/slack-adapter.d.ts.map +1 -0
  23. package/dist/components/channel-platform-hub/slack/slack-adapter.js +349 -0
  24. package/dist/components/channel-platform-hub/slack/slack-adapter.js.map +1 -0
  25. package/dist/components/channel-platform-hub/slack/slack-mrkdwn.d.ts +3 -0
  26. package/dist/components/channel-platform-hub/slack/slack-mrkdwn.d.ts.map +1 -0
  27. package/dist/components/channel-platform-hub/slack/slack-mrkdwn.js +70 -0
  28. package/dist/components/channel-platform-hub/slack/slack-mrkdwn.js.map +1 -0
  29. package/dist/components/channel-platform-hub/teams/teams-adapter.d.ts +51 -0
  30. package/dist/components/channel-platform-hub/teams/teams-adapter.d.ts.map +1 -0
  31. package/dist/components/channel-platform-hub/teams/teams-adapter.js +333 -0
  32. package/dist/components/channel-platform-hub/teams/teams-adapter.js.map +1 -0
  33. package/dist/components/channel-platform-hub/telegram/telegram-adapter.d.ts +46 -0
  34. package/dist/components/channel-platform-hub/telegram/telegram-adapter.d.ts.map +1 -0
  35. package/dist/components/channel-platform-hub/telegram/telegram-adapter.js +304 -0
  36. package/dist/components/channel-platform-hub/telegram/telegram-adapter.js.map +1 -0
  37. package/dist/components/channel-platform-hub/telegram/telegram-markdown.d.ts +3 -0
  38. package/dist/components/channel-platform-hub/telegram/telegram-markdown.d.ts.map +1 -0
  39. package/dist/components/channel-platform-hub/telegram/telegram-markdown.js +87 -0
  40. package/dist/components/channel-platform-hub/telegram/telegram-markdown.js.map +1 -0
  41. package/dist/components/channel-platform-hub/types.d.ts +290 -0
  42. package/dist/components/channel-platform-hub/types.d.ts.map +1 -0
  43. package/dist/components/channel-platform-hub/types.js +23 -0
  44. package/dist/components/channel-platform-hub/types.js.map +1 -0
  45. package/dist/components/event-handler/event-dispatcher.d.ts +28 -3
  46. package/dist/components/event-handler/event-dispatcher.d.ts.map +1 -1
  47. package/dist/components/event-handler/event-dispatcher.js +77 -13
  48. package/dist/components/event-handler/event-dispatcher.js.map +1 -1
  49. package/dist/components/event-handler/events.d.ts +316 -15
  50. package/dist/components/event-handler/events.d.ts.map +1 -1
  51. package/dist/components/event-handler/events.js +94 -2
  52. package/dist/components/event-handler/events.js.map +1 -1
  53. package/dist/components/event-handler/types.d.ts +26 -0
  54. package/dist/components/event-handler/types.d.ts.map +1 -1
  55. package/dist/components/group-hub/group-hub.d.ts +117 -0
  56. package/dist/components/group-hub/group-hub.d.ts.map +1 -0
  57. package/dist/components/group-hub/group-hub.js +334 -0
  58. package/dist/components/group-hub/group-hub.js.map +1 -0
  59. package/dist/components/group-hub/group-turns.d.ts +109 -0
  60. package/dist/components/group-hub/group-turns.d.ts.map +1 -0
  61. package/dist/components/group-hub/group-turns.js +834 -0
  62. package/dist/components/group-hub/group-turns.js.map +1 -0
  63. package/dist/components/group-hub/member-prompt.d.ts +28 -0
  64. package/dist/components/group-hub/member-prompt.d.ts.map +1 -0
  65. package/dist/components/group-hub/member-prompt.js +111 -0
  66. package/dist/components/group-hub/member-prompt.js.map +1 -0
  67. package/dist/components/group-hub/recipients.d.ts +10 -0
  68. package/dist/components/group-hub/recipients.d.ts.map +1 -0
  69. package/dist/components/group-hub/recipients.js +83 -0
  70. package/dist/components/group-hub/recipients.js.map +1 -0
  71. package/dist/components/group-hub/thread.d.ts +57 -0
  72. package/dist/components/group-hub/thread.d.ts.map +1 -0
  73. package/dist/components/group-hub/thread.js +126 -0
  74. package/dist/components/group-hub/thread.js.map +1 -0
  75. package/dist/components/group-hub/types.d.ts +277 -0
  76. package/dist/components/group-hub/types.d.ts.map +1 -0
  77. package/dist/components/group-hub/types.js +51 -0
  78. package/dist/components/group-hub/types.js.map +1 -0
  79. package/dist/components/llm-provider-hub/providers/anthropic-provider.d.ts.map +1 -1
  80. package/dist/components/llm-provider-hub/providers/anthropic-provider.js +22 -2
  81. package/dist/components/llm-provider-hub/providers/anthropic-provider.js.map +1 -1
  82. package/dist/components/llm-provider-hub/providers/bedrock-provider.d.ts.map +1 -1
  83. package/dist/components/llm-provider-hub/providers/bedrock-provider.js +15 -3
  84. package/dist/components/llm-provider-hub/providers/bedrock-provider.js.map +1 -1
  85. package/dist/components/llm-provider-hub/providers/model-info-mappers.d.ts.map +1 -1
  86. package/dist/components/llm-provider-hub/providers/model-info-mappers.js +27 -0
  87. package/dist/components/llm-provider-hub/providers/model-info-mappers.js.map +1 -1
  88. package/dist/components/llm-provider-hub/providers/openai-compatible-provider.d.ts.map +1 -1
  89. package/dist/components/llm-provider-hub/providers/openai-compatible-provider.js +10 -3
  90. package/dist/components/llm-provider-hub/providers/openai-compatible-provider.js.map +1 -1
  91. package/dist/components/llm-provider-hub/providers/openai-subscription-provider.d.ts +1 -0
  92. package/dist/components/llm-provider-hub/providers/openai-subscription-provider.d.ts.map +1 -1
  93. package/dist/components/llm-provider-hub/providers/openai-subscription-provider.js +35 -3
  94. package/dist/components/llm-provider-hub/providers/openai-subscription-provider.js.map +1 -1
  95. package/dist/components/llm-provider-hub/types.d.ts +20 -0
  96. package/dist/components/llm-provider-hub/types.d.ts.map +1 -1
  97. package/dist/components/llm-provider-hub/types.js +5 -0
  98. package/dist/components/llm-provider-hub/types.js.map +1 -1
  99. package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.d.ts +87 -8
  100. package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.d.ts.map +1 -1
  101. package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.js +465 -62
  102. package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.js.map +1 -1
  103. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.d.ts +14 -1
  104. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.d.ts.map +1 -1
  105. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.js +25 -1
  106. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.js.map +1 -1
  107. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.d.ts +14 -1
  108. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.d.ts.map +1 -1
  109. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.js +14 -22
  110. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.js.map +1 -1
  111. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.d.ts +41 -3
  112. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.d.ts.map +1 -1
  113. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.js +152 -44
  114. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.js.map +1 -1
  115. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.d.ts +15 -0
  116. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.d.ts.map +1 -1
  117. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.js +35 -1
  118. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.js.map +1 -1
  119. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.d.ts +10 -1
  120. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.d.ts.map +1 -1
  121. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.js +39 -6
  122. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.js.map +1 -1
  123. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.types.d.ts +2 -1
  124. package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.types.d.ts.map +1 -1
  125. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/context-usage.d.ts +47 -0
  126. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/context-usage.d.ts.map +1 -0
  127. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/context-usage.js +61 -0
  128. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/context-usage.js.map +1 -0
  129. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.d.ts +1 -1
  130. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.d.ts.map +1 -1
  131. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.js +1 -1
  132. package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.js.map +1 -1
  133. package/dist/components/multi-agent-orchestration/agent/agent-loop/types.d.ts +131 -8
  134. package/dist/components/multi-agent-orchestration/agent/agent-loop/types.d.ts.map +1 -1
  135. package/dist/components/multi-agent-orchestration/agent/agent-loop/types.js +17 -1
  136. package/dist/components/multi-agent-orchestration/agent/agent-loop/types.js.map +1 -1
  137. package/dist/components/multi-agent-orchestration/agent/agent.d.ts +101 -15
  138. package/dist/components/multi-agent-orchestration/agent/agent.d.ts.map +1 -1
  139. package/dist/components/multi-agent-orchestration/agent/agent.js +415 -44
  140. package/dist/components/multi-agent-orchestration/agent/agent.js.map +1 -1
  141. package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.d.ts +245 -1
  142. package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.d.ts.map +1 -1
  143. package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.js +1583 -0
  144. package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.js.map +1 -1
  145. package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-prompts.d.ts +76 -0
  146. package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-prompts.d.ts.map +1 -0
  147. package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-prompts.js +236 -0
  148. package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-prompts.js.map +1 -0
  149. package/dist/components/multi-agent-orchestration/agent/channel-manager/text.d.ts +15 -0
  150. package/dist/components/multi-agent-orchestration/agent/channel-manager/text.d.ts.map +1 -0
  151. package/dist/components/multi-agent-orchestration/agent/channel-manager/text.js +80 -0
  152. package/dist/components/multi-agent-orchestration/agent/channel-manager/text.js.map +1 -0
  153. package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-stream.d.ts +13 -0
  154. package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-stream.d.ts.map +1 -0
  155. package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-stream.js +41 -0
  156. package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-stream.js.map +1 -0
  157. package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-view.d.ts +69 -0
  158. package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-view.d.ts.map +1 -0
  159. package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-view.js +210 -0
  160. package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-view.js.map +1 -0
  161. package/dist/components/multi-agent-orchestration/agent/channel-manager/types.d.ts +76 -0
  162. package/dist/components/multi-agent-orchestration/agent/channel-manager/types.d.ts.map +1 -0
  163. package/dist/components/multi-agent-orchestration/agent/channel-manager/types.js +7 -0
  164. package/dist/components/multi-agent-orchestration/agent/channel-manager/types.js.map +1 -0
  165. package/dist/components/multi-agent-orchestration/agent/command-manager/built-in-commands.d.ts +37 -0
  166. package/dist/components/multi-agent-orchestration/agent/command-manager/built-in-commands.d.ts.map +1 -0
  167. package/dist/components/multi-agent-orchestration/agent/command-manager/built-in-commands.js +544 -0
  168. package/dist/components/multi-agent-orchestration/agent/command-manager/built-in-commands.js.map +1 -0
  169. package/dist/components/multi-agent-orchestration/agent/command-manager/command-manager.d.ts +75 -0
  170. package/dist/components/multi-agent-orchestration/agent/command-manager/command-manager.d.ts.map +1 -0
  171. package/dist/components/multi-agent-orchestration/agent/command-manager/command-manager.js +299 -0
  172. package/dist/components/multi-agent-orchestration/agent/command-manager/command-manager.js.map +1 -0
  173. package/dist/components/multi-agent-orchestration/agent/command-manager/parse.d.ts +17 -0
  174. package/dist/components/multi-agent-orchestration/agent/command-manager/parse.d.ts.map +1 -0
  175. package/dist/components/multi-agent-orchestration/agent/command-manager/parse.js +19 -0
  176. package/dist/components/multi-agent-orchestration/agent/command-manager/parse.js.map +1 -0
  177. package/dist/components/multi-agent-orchestration/agent/command-manager/types.d.ts +197 -0
  178. package/dist/components/multi-agent-orchestration/agent/command-manager/types.d.ts.map +1 -0
  179. package/dist/components/multi-agent-orchestration/agent/command-manager/types.js +3 -0
  180. package/dist/components/multi-agent-orchestration/agent/command-manager/types.js.map +1 -0
  181. package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.d.ts +37 -1
  182. package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.d.ts.map +1 -1
  183. package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.js +54 -2
  184. package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.js.map +1 -1
  185. package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.d.ts +118 -14
  186. package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.d.ts.map +1 -1
  187. package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.js +239 -50
  188. package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.js.map +1 -1
  189. package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation.d.ts +34 -0
  190. package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation.d.ts.map +1 -0
  191. package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation.js +74 -0
  192. package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation.js.map +1 -0
  193. package/dist/components/multi-agent-orchestration/agent/conversation-manager/turn-gate.d.ts +49 -0
  194. package/dist/components/multi-agent-orchestration/agent/conversation-manager/turn-gate.d.ts.map +1 -0
  195. package/dist/components/multi-agent-orchestration/agent/conversation-manager/turn-gate.js +171 -0
  196. package/dist/components/multi-agent-orchestration/agent/conversation-manager/turn-gate.js.map +1 -0
  197. package/dist/components/multi-agent-orchestration/agent/job-manager/clock.d.ts +43 -0
  198. package/dist/components/multi-agent-orchestration/agent/job-manager/clock.d.ts.map +1 -0
  199. package/dist/components/multi-agent-orchestration/agent/job-manager/clock.js +116 -0
  200. package/dist/components/multi-agent-orchestration/agent/job-manager/clock.js.map +1 -0
  201. package/dist/components/multi-agent-orchestration/agent/job-manager/internal-events.d.ts +17 -0
  202. package/dist/components/multi-agent-orchestration/agent/job-manager/internal-events.d.ts.map +1 -0
  203. package/dist/components/multi-agent-orchestration/agent/job-manager/internal-events.js +93 -0
  204. package/dist/components/multi-agent-orchestration/agent/job-manager/internal-events.js.map +1 -0
  205. package/dist/components/multi-agent-orchestration/agent/job-manager/job-manager.d.ts +208 -0
  206. package/dist/components/multi-agent-orchestration/agent/job-manager/job-manager.d.ts.map +1 -0
  207. package/dist/components/multi-agent-orchestration/agent/job-manager/job-manager.js +1207 -0
  208. package/dist/components/multi-agent-orchestration/agent/job-manager/job-manager.js.map +1 -0
  209. package/dist/components/multi-agent-orchestration/agent/job-manager/rules.d.ts +129 -0
  210. package/dist/components/multi-agent-orchestration/agent/job-manager/rules.d.ts.map +1 -0
  211. package/dist/components/multi-agent-orchestration/agent/job-manager/rules.js +598 -0
  212. package/dist/components/multi-agent-orchestration/agent/job-manager/rules.js.map +1 -0
  213. package/dist/components/multi-agent-orchestration/agent/job-manager/schedule.d.ts +15 -0
  214. package/dist/components/multi-agent-orchestration/agent/job-manager/schedule.d.ts.map +1 -0
  215. package/dist/components/multi-agent-orchestration/agent/job-manager/schedule.js +113 -0
  216. package/dist/components/multi-agent-orchestration/agent/job-manager/schedule.js.map +1 -0
  217. package/dist/components/multi-agent-orchestration/agent/job-manager/timers.d.ts +8 -0
  218. package/dist/components/multi-agent-orchestration/agent/job-manager/timers.d.ts.map +1 -0
  219. package/dist/components/multi-agent-orchestration/agent/job-manager/timers.js +33 -0
  220. package/dist/components/multi-agent-orchestration/agent/job-manager/timers.js.map +1 -0
  221. package/dist/components/multi-agent-orchestration/agent/job-manager/types.d.ts +495 -0
  222. package/dist/components/multi-agent-orchestration/agent/job-manager/types.d.ts.map +1 -0
  223. package/dist/components/multi-agent-orchestration/agent/job-manager/types.js +50 -0
  224. package/dist/components/multi-agent-orchestration/agent/job-manager/types.js.map +1 -0
  225. package/dist/components/multi-agent-orchestration/agent/job-manager/webhook.d.ts +37 -0
  226. package/dist/components/multi-agent-orchestration/agent/job-manager/webhook.d.ts.map +1 -0
  227. package/dist/components/multi-agent-orchestration/agent/job-manager/webhook.js +157 -0
  228. package/dist/components/multi-agent-orchestration/agent/job-manager/webhook.js.map +1 -0
  229. package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.d.ts +7 -0
  230. package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.d.ts.map +1 -1
  231. package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.js +189 -30
  232. package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.js.map +1 -1
  233. package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.d.ts +17 -0
  234. package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.d.ts.map +1 -1
  235. package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.js +51 -0
  236. package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.js.map +1 -1
  237. package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.d.ts +5 -0
  238. package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.d.ts.map +1 -1
  239. package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.js +16 -0
  240. package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.js.map +1 -1
  241. package/dist/components/multi-agent-orchestration/agent/secret-manager/secret-manager.d.ts +41 -0
  242. package/dist/components/multi-agent-orchestration/agent/secret-manager/secret-manager.d.ts.map +1 -0
  243. package/dist/components/multi-agent-orchestration/agent/secret-manager/secret-manager.js +98 -0
  244. package/dist/components/multi-agent-orchestration/agent/secret-manager/secret-manager.js.map +1 -0
  245. package/dist/components/multi-agent-orchestration/agent/secret-manager/types.d.ts +37 -0
  246. package/dist/components/multi-agent-orchestration/agent/secret-manager/types.d.ts.map +1 -0
  247. package/dist/components/multi-agent-orchestration/agent/secret-manager/types.js.map +1 -0
  248. package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.d.ts.map +1 -1
  249. package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.js +1 -0
  250. package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.js.map +1 -1
  251. package/dist/components/multi-agent-orchestration/agent/subagent-manager/brief.d.ts +21 -0
  252. package/dist/components/multi-agent-orchestration/agent/subagent-manager/brief.d.ts.map +1 -0
  253. package/dist/components/multi-agent-orchestration/agent/subagent-manager/brief.js +113 -0
  254. package/dist/components/multi-agent-orchestration/agent/subagent-manager/brief.js.map +1 -0
  255. package/dist/components/multi-agent-orchestration/agent/subagent-manager/child-loop.d.ts +52 -0
  256. package/dist/components/multi-agent-orchestration/agent/subagent-manager/child-loop.d.ts.map +1 -0
  257. package/dist/components/multi-agent-orchestration/agent/subagent-manager/child-loop.js +63 -0
  258. package/dist/components/multi-agent-orchestration/agent/subagent-manager/child-loop.js.map +1 -0
  259. package/dist/components/multi-agent-orchestration/agent/subagent-manager/semaphore.d.ts +18 -0
  260. package/dist/components/multi-agent-orchestration/agent/subagent-manager/semaphore.d.ts.map +1 -0
  261. package/dist/components/multi-agent-orchestration/agent/subagent-manager/semaphore.js +56 -0
  262. package/dist/components/multi-agent-orchestration/agent/subagent-manager/semaphore.js.map +1 -0
  263. package/dist/components/multi-agent-orchestration/agent/subagent-manager/subagent-manager.d.ts +128 -0
  264. package/dist/components/multi-agent-orchestration/agent/subagent-manager/subagent-manager.d.ts.map +1 -0
  265. package/dist/components/multi-agent-orchestration/agent/subagent-manager/subagent-manager.js +661 -0
  266. package/dist/components/multi-agent-orchestration/agent/subagent-manager/subagent-manager.js.map +1 -0
  267. package/dist/components/multi-agent-orchestration/agent/subagent-manager/types.d.ts +307 -0
  268. package/dist/components/multi-agent-orchestration/agent/subagent-manager/types.d.ts.map +1 -0
  269. package/dist/components/multi-agent-orchestration/agent/subagent-manager/types.js +60 -0
  270. package/dist/components/multi-agent-orchestration/agent/subagent-manager/types.js.map +1 -0
  271. package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.d.ts +14 -3
  272. package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.d.ts.map +1 -1
  273. package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.js +18 -5
  274. package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.js.map +1 -1
  275. package/dist/components/multi-agent-orchestration/agent/types.d.ts +84 -1
  276. package/dist/components/multi-agent-orchestration/agent/types.d.ts.map +1 -1
  277. package/dist/components/multi-agent-orchestration/multi-agent-orchestration.d.ts +11 -4
  278. package/dist/components/multi-agent-orchestration/multi-agent-orchestration.d.ts.map +1 -1
  279. package/dist/components/multi-agent-orchestration/multi-agent-orchestration.js +72 -4
  280. package/dist/components/multi-agent-orchestration/multi-agent-orchestration.js.map +1 -1
  281. package/dist/components/persistence-hub/default-stores/memory-channel-store.d.ts +11 -0
  282. package/dist/components/persistence-hub/default-stores/memory-channel-store.d.ts.map +1 -0
  283. package/dist/components/persistence-hub/default-stores/memory-channel-store.js +33 -0
  284. package/dist/components/persistence-hub/default-stores/memory-channel-store.js.map +1 -0
  285. package/dist/components/persistence-hub/default-stores/memory-group-store.d.ts +21 -0
  286. package/dist/components/persistence-hub/default-stores/memory-group-store.d.ts.map +1 -0
  287. package/dist/components/persistence-hub/default-stores/memory-group-store.js +62 -0
  288. package/dist/components/persistence-hub/default-stores/memory-group-store.js.map +1 -0
  289. package/dist/components/persistence-hub/default-stores/memory-job-store.d.ts +31 -0
  290. package/dist/components/persistence-hub/default-stores/memory-job-store.d.ts.map +1 -0
  291. package/dist/components/persistence-hub/default-stores/memory-job-store.js +234 -0
  292. package/dist/components/persistence-hub/default-stores/memory-job-store.js.map +1 -0
  293. package/dist/components/persistence-hub/default-stores/memory-secret-store.d.ts +12 -0
  294. package/dist/components/persistence-hub/default-stores/memory-secret-store.d.ts.map +1 -0
  295. package/dist/components/persistence-hub/default-stores/memory-secret-store.js +38 -0
  296. package/dist/components/persistence-hub/default-stores/memory-secret-store.js.map +1 -0
  297. package/dist/components/persistence-hub/default-stores/memory-session-store.d.ts.map +1 -1
  298. package/dist/components/persistence-hub/default-stores/memory-session-store.js +7 -0
  299. package/dist/components/persistence-hub/default-stores/memory-session-store.js.map +1 -1
  300. package/dist/components/persistence-hub/default-stores/memory-subagent-run-store.d.ts +10 -0
  301. package/dist/components/persistence-hub/default-stores/memory-subagent-run-store.d.ts.map +1 -0
  302. package/dist/components/persistence-hub/default-stores/memory-subagent-run-store.js +30 -0
  303. package/dist/components/persistence-hub/default-stores/memory-subagent-run-store.js.map +1 -0
  304. package/dist/components/persistence-hub/default-stores/memory-subagent-type-store.d.ts +9 -0
  305. package/dist/components/persistence-hub/default-stores/memory-subagent-type-store.d.ts.map +1 -0
  306. package/dist/components/persistence-hub/default-stores/memory-subagent-type-store.js +17 -0
  307. package/dist/components/persistence-hub/default-stores/memory-subagent-type-store.js.map +1 -0
  308. package/dist/components/persistence-hub/persistence-hub.d.ts +41 -0
  309. package/dist/components/persistence-hub/persistence-hub.d.ts.map +1 -1
  310. package/dist/components/persistence-hub/persistence-hub.js +41 -0
  311. package/dist/components/persistence-hub/persistence-hub.js.map +1 -1
  312. package/dist/components/persistence-hub/types/channel-store.d.ts +12 -0
  313. package/dist/components/persistence-hub/types/channel-store.d.ts.map +1 -0
  314. package/dist/components/persistence-hub/types/channel-store.js +2 -0
  315. package/dist/components/persistence-hub/types/channel-store.js.map +1 -0
  316. package/dist/components/persistence-hub/types/group-store.d.ts +27 -0
  317. package/dist/components/persistence-hub/types/group-store.d.ts.map +1 -0
  318. package/dist/components/persistence-hub/types/group-store.js +2 -0
  319. package/dist/components/persistence-hub/types/group-store.js.map +1 -0
  320. package/dist/components/persistence-hub/types/job-store.d.ts +112 -0
  321. package/dist/components/persistence-hub/types/job-store.d.ts.map +1 -0
  322. package/dist/components/persistence-hub/types/job-store.js +2 -0
  323. package/dist/components/persistence-hub/types/job-store.js.map +1 -0
  324. package/dist/components/persistence-hub/types/secret-store.d.ts +18 -0
  325. package/dist/components/persistence-hub/types/secret-store.d.ts.map +1 -0
  326. package/dist/components/persistence-hub/types/secret-store.js +2 -0
  327. package/dist/components/persistence-hub/types/secret-store.js.map +1 -0
  328. package/dist/components/persistence-hub/types/session-store.d.ts +5 -0
  329. package/dist/components/persistence-hub/types/session-store.d.ts.map +1 -1
  330. package/dist/components/persistence-hub/types/subagent-run-store.d.ts +11 -0
  331. package/dist/components/persistence-hub/types/subagent-run-store.d.ts.map +1 -0
  332. package/dist/components/persistence-hub/types/subagent-run-store.js +2 -0
  333. package/dist/components/persistence-hub/types/subagent-run-store.js.map +1 -0
  334. package/dist/components/persistence-hub/types/subagent-type-store.d.ts +9 -0
  335. package/dist/components/persistence-hub/types/subagent-type-store.d.ts.map +1 -0
  336. package/dist/components/persistence-hub/types/subagent-type-store.js +2 -0
  337. package/dist/components/persistence-hub/types/subagent-type-store.js.map +1 -0
  338. package/dist/components/sandbox-hub/docker/docker-sandbox.d.ts +4 -1
  339. package/dist/components/sandbox-hub/docker/docker-sandbox.d.ts.map +1 -1
  340. package/dist/components/sandbox-hub/docker/docker-sandbox.js +398 -1
  341. package/dist/components/sandbox-hub/docker/docker-sandbox.js.map +1 -1
  342. package/dist/components/sandbox-hub/docker/sandbox-helper.d.ts.map +1 -1
  343. package/dist/components/sandbox-hub/docker/sandbox-helper.js +386 -5
  344. package/dist/components/sandbox-hub/docker/sandbox-helper.js.map +1 -1
  345. package/dist/components/sandbox-hub/host/host-sandbox.d.ts +16 -0
  346. package/dist/components/sandbox-hub/host/host-sandbox.d.ts.map +1 -1
  347. package/dist/components/sandbox-hub/host/host-sandbox.js +283 -2
  348. package/dist/components/sandbox-hub/host/host-sandbox.js.map +1 -1
  349. package/dist/components/sandbox-hub/sandbox-hub.d.ts +9 -0
  350. package/dist/components/sandbox-hub/sandbox-hub.d.ts.map +1 -1
  351. package/dist/components/sandbox-hub/sandbox-hub.js +18 -0
  352. package/dist/components/sandbox-hub/sandbox-hub.js.map +1 -1
  353. package/dist/components/sandbox-hub/traced-sandbox.d.ts.map +1 -1
  354. package/dist/components/sandbox-hub/traced-sandbox.js +32 -0
  355. package/dist/components/sandbox-hub/traced-sandbox.js.map +1 -1
  356. package/dist/components/sandbox-hub/types/sandbox.d.ts +106 -1
  357. package/dist/components/sandbox-hub/types/sandbox.d.ts.map +1 -1
  358. package/dist/components/sandbox-hub/types/sandbox.js +0 -13
  359. package/dist/components/sandbox-hub/types/sandbox.js.map +1 -1
  360. package/dist/components/secret-hub/envelope.d.ts +48 -0
  361. package/dist/components/secret-hub/envelope.d.ts.map +1 -0
  362. package/dist/components/secret-hub/envelope.js +157 -0
  363. package/dist/components/secret-hub/envelope.js.map +1 -0
  364. package/dist/components/secret-hub/rules.d.ts +33 -0
  365. package/dist/components/secret-hub/rules.d.ts.map +1 -0
  366. package/dist/components/secret-hub/rules.js +142 -0
  367. package/dist/components/secret-hub/rules.js.map +1 -0
  368. package/dist/components/secret-hub/secret-hub-provider.d.ts +61 -0
  369. package/dist/components/secret-hub/secret-hub-provider.d.ts.map +1 -0
  370. package/dist/components/secret-hub/secret-hub-provider.js +73 -0
  371. package/dist/components/secret-hub/secret-hub-provider.js.map +1 -0
  372. package/dist/components/secret-hub/secret-hub.d.ts +102 -0
  373. package/dist/components/secret-hub/secret-hub.d.ts.map +1 -0
  374. package/dist/components/secret-hub/secret-hub.js +267 -0
  375. package/dist/components/secret-hub/secret-hub.js.map +1 -0
  376. package/dist/components/secret-hub/types.d.ts +77 -0
  377. package/dist/components/secret-hub/types.d.ts.map +1 -0
  378. package/dist/components/secret-hub/types.js +23 -0
  379. package/dist/components/secret-hub/types.js.map +1 -0
  380. package/dist/components/skill-hub/built-in-skills/essential-skills.d.ts +1 -1
  381. package/dist/components/skill-hub/built-in-skills/essential-skills.d.ts.map +1 -1
  382. package/dist/components/skill-hub/built-in-skills/essential-skills.js +7 -2
  383. package/dist/components/skill-hub/built-in-skills/essential-skills.js.map +1 -1
  384. package/dist/components/skill-hub/built-in-skills/watch-and-notify.d.ts +3 -0
  385. package/dist/components/skill-hub/built-in-skills/watch-and-notify.d.ts.map +1 -0
  386. package/dist/components/skill-hub/built-in-skills/watch-and-notify.js +94 -0
  387. package/dist/components/skill-hub/built-in-skills/watch-and-notify.js.map +1 -0
  388. package/dist/components/skill-hub/skill-hub.d.ts +9 -1
  389. package/dist/components/skill-hub/skill-hub.d.ts.map +1 -1
  390. package/dist/components/skill-hub/skill-hub.js +11 -1
  391. package/dist/components/skill-hub/skill-hub.js.map +1 -1
  392. package/dist/components/subagent-hub/built-in-types.d.ts +3 -0
  393. package/dist/components/subagent-hub/built-in-types.d.ts.map +1 -0
  394. package/dist/components/subagent-hub/built-in-types.js +24 -0
  395. package/dist/components/subagent-hub/built-in-types.js.map +1 -0
  396. package/dist/components/subagent-hub/subagent-hub.d.ts +41 -0
  397. package/dist/components/subagent-hub/subagent-hub.d.ts.map +1 -0
  398. package/dist/components/subagent-hub/subagent-hub.js +158 -0
  399. package/dist/components/subagent-hub/subagent-hub.js.map +1 -0
  400. package/dist/components/subagent-hub/types.d.ts +40 -0
  401. package/dist/components/subagent-hub/types.d.ts.map +1 -0
  402. package/dist/components/subagent-hub/types.js +8 -0
  403. package/dist/components/subagent-hub/types.js.map +1 -0
  404. package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.d.ts +4 -1
  405. package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.d.ts.map +1 -1
  406. package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.js +4 -0
  407. package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.js.map +1 -1
  408. package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.d.ts.map +1 -1
  409. package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.js +4 -1
  410. package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.js.map +1 -1
  411. package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.d.ts.map +1 -1
  412. package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.js +4 -1
  413. package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.js.map +1 -1
  414. package/dist/components/tool-hub/built-in-tools/jobs/create-job-tools.d.ts +10 -0
  415. package/dist/components/tool-hub/built-in-tools/jobs/create-job-tools.d.ts.map +1 -0
  416. package/dist/components/tool-hub/built-in-tools/jobs/create-job-tools.js +13 -0
  417. package/dist/components/tool-hub/built-in-tools/jobs/create-job-tools.js.map +1 -0
  418. package/dist/components/tool-hub/built-in-tools/jobs/job-tool-helpers.d.ts +60 -0
  419. package/dist/components/tool-hub/built-in-tools/jobs/job-tool-helpers.d.ts.map +1 -0
  420. package/dist/components/tool-hub/built-in-tools/jobs/job-tool-helpers.js +240 -0
  421. package/dist/components/tool-hub/built-in-tools/jobs/job-tool-helpers.js.map +1 -0
  422. package/dist/components/tool-hub/built-in-tools/jobs/list-jobs-tool.d.ts +14 -0
  423. package/dist/components/tool-hub/built-in-tools/jobs/list-jobs-tool.d.ts.map +1 -0
  424. package/dist/components/tool-hub/built-in-tools/jobs/list-jobs-tool.js +36 -0
  425. package/dist/components/tool-hub/built-in-tools/jobs/list-jobs-tool.js.map +1 -0
  426. package/dist/components/tool-hub/built-in-tools/jobs/manage-job-tool.d.ts +32 -0
  427. package/dist/components/tool-hub/built-in-tools/jobs/manage-job-tool.d.ts.map +1 -0
  428. package/dist/components/tool-hub/built-in-tools/jobs/manage-job-tool.js +458 -0
  429. package/dist/components/tool-hub/built-in-tools/jobs/manage-job-tool.js.map +1 -0
  430. package/dist/components/tool-hub/built-in-tools/preview/create-preview-tools.d.ts +9 -0
  431. package/dist/components/tool-hub/built-in-tools/preview/create-preview-tools.d.ts.map +1 -0
  432. package/dist/components/tool-hub/built-in-tools/preview/create-preview-tools.js +20 -0
  433. package/dist/components/tool-hub/built-in-tools/preview/create-preview-tools.js.map +1 -0
  434. package/dist/components/tool-hub/built-in-tools/preview/list-apps-tool.d.ts +12 -0
  435. package/dist/components/tool-hub/built-in-tools/preview/list-apps-tool.d.ts.map +1 -0
  436. package/dist/components/tool-hub/built-in-tools/preview/list-apps-tool.js +57 -0
  437. package/dist/components/tool-hub/built-in-tools/preview/list-apps-tool.js.map +1 -0
  438. package/dist/components/tool-hub/built-in-tools/preview/open-in-app-tool.d.ts +15 -0
  439. package/dist/components/tool-hub/built-in-tools/preview/open-in-app-tool.d.ts.map +1 -0
  440. package/dist/components/tool-hub/built-in-tools/preview/open-in-app-tool.js +80 -0
  441. package/dist/components/tool-hub/built-in-tools/preview/open-in-app-tool.js.map +1 -0
  442. package/dist/components/tool-hub/built-in-tools/preview/preview-helpers.d.ts +53 -0
  443. package/dist/components/tool-hub/built-in-tools/preview/preview-helpers.d.ts.map +1 -0
  444. package/dist/components/tool-hub/built-in-tools/preview/preview-helpers.js +100 -0
  445. package/dist/components/tool-hub/built-in-tools/preview/preview-helpers.js.map +1 -0
  446. package/dist/components/tool-hub/built-in-tools/preview/preview-tool.d.ts +14 -0
  447. package/dist/components/tool-hub/built-in-tools/preview/preview-tool.d.ts.map +1 -0
  448. package/dist/components/tool-hub/built-in-tools/preview/preview-tool.js +63 -0
  449. package/dist/components/tool-hub/built-in-tools/preview/preview-tool.js.map +1 -0
  450. package/dist/components/tool-hub/built-in-tools/preview/service-tools.d.ts +33 -0
  451. package/dist/components/tool-hub/built-in-tools/preview/service-tools.d.ts.map +1 -0
  452. package/dist/components/tool-hub/built-in-tools/preview/service-tools.js +180 -0
  453. package/dist/components/tool-hub/built-in-tools/preview/service-tools.js.map +1 -0
  454. package/dist/components/tool-hub/built-in-tools/secrets/create-secret-tools.d.ts +6 -0
  455. package/dist/components/tool-hub/built-in-tools/secrets/create-secret-tools.d.ts.map +1 -0
  456. package/dist/components/tool-hub/built-in-tools/secrets/create-secret-tools.js +9 -0
  457. package/dist/components/tool-hub/built-in-tools/secrets/create-secret-tools.js.map +1 -0
  458. package/dist/components/tool-hub/built-in-tools/secrets/list-secrets-tool.d.ts +12 -0
  459. package/dist/components/tool-hub/built-in-tools/secrets/list-secrets-tool.d.ts.map +1 -0
  460. package/dist/components/tool-hub/built-in-tools/secrets/list-secrets-tool.js +30 -0
  461. package/dist/components/tool-hub/built-in-tools/secrets/list-secrets-tool.js.map +1 -0
  462. package/dist/components/tool-hub/built-in-tools/secrets/manage-secret-tool.d.ts +22 -0
  463. package/dist/components/tool-hub/built-in-tools/secrets/manage-secret-tool.d.ts.map +1 -0
  464. package/dist/components/tool-hub/built-in-tools/secrets/manage-secret-tool.js +113 -0
  465. package/dist/components/tool-hub/built-in-tools/secrets/manage-secret-tool.js.map +1 -0
  466. package/dist/components/tool-hub/built-in-tools/secrets/secret-tool-helpers.d.ts +9 -0
  467. package/dist/components/tool-hub/built-in-tools/secrets/secret-tool-helpers.d.ts.map +1 -0
  468. package/dist/components/tool-hub/built-in-tools/secrets/secret-tool-helpers.js +29 -0
  469. package/dist/components/tool-hub/built-in-tools/secrets/secret-tool-helpers.js.map +1 -0
  470. package/dist/components/tool-hub/built-in-tools/subagents/spawn-subagent-tool.d.ts +27 -0
  471. package/dist/components/tool-hub/built-in-tools/subagents/spawn-subagent-tool.d.ts.map +1 -0
  472. package/dist/components/tool-hub/built-in-tools/subagents/spawn-subagent-tool.js +112 -0
  473. package/dist/components/tool-hub/built-in-tools/subagents/spawn-subagent-tool.js.map +1 -0
  474. package/dist/components/tool-hub/built-in-tools/web/http-request-tool.d.ts +43 -0
  475. package/dist/components/tool-hub/built-in-tools/web/http-request-tool.d.ts.map +1 -0
  476. package/dist/components/tool-hub/built-in-tools/web/http-request-tool.js +234 -0
  477. package/dist/components/tool-hub/built-in-tools/web/http-request-tool.js.map +1 -0
  478. package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.d.ts.map +1 -1
  479. package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.js +2 -0
  480. package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.js.map +1 -1
  481. package/dist/components/tool-hub/built-in-tools/web/web-search-tool.d.ts.map +1 -1
  482. package/dist/components/tool-hub/built-in-tools/web/web-search-tool.js +2 -0
  483. package/dist/components/tool-hub/built-in-tools/web/web-search-tool.js.map +1 -1
  484. package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.d.ts.map +1 -1
  485. package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.js +9 -1
  486. package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.js.map +1 -1
  487. package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.d.ts.map +1 -1
  488. package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.js +9 -2
  489. package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.js.map +1 -1
  490. package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.d.ts +17 -0
  491. package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.d.ts.map +1 -1
  492. package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.js +29 -0
  493. package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.js.map +1 -1
  494. package/dist/components/tool-hub/tool-links.d.ts +9 -0
  495. package/dist/components/tool-hub/tool-links.d.ts.map +1 -0
  496. package/dist/components/tool-hub/tool-links.js +11 -0
  497. package/dist/components/tool-hub/tool-links.js.map +1 -0
  498. package/dist/components/tool-hub/types.d.ts +101 -1
  499. package/dist/components/tool-hub/types.d.ts.map +1 -1
  500. package/dist/index.d.ts +109 -8
  501. package/dist/index.d.ts.map +1 -1
  502. package/dist/index.js +68 -0
  503. package/dist/index.js.map +1 -1
  504. package/dist/kernel/errors/channel-error.d.ts +24 -0
  505. package/dist/kernel/errors/channel-error.d.ts.map +1 -0
  506. package/dist/kernel/errors/channel-error.js +15 -0
  507. package/dist/kernel/errors/channel-error.js.map +1 -0
  508. package/dist/kernel/errors/command-error.d.ts +12 -0
  509. package/dist/kernel/errors/command-error.d.ts.map +1 -0
  510. package/dist/kernel/errors/command-error.js +11 -0
  511. package/dist/kernel/errors/command-error.js.map +1 -0
  512. package/dist/kernel/errors/group-error.d.ts +15 -0
  513. package/dist/kernel/errors/group-error.d.ts.map +1 -0
  514. package/dist/kernel/errors/group-error.js +10 -0
  515. package/dist/kernel/errors/group-error.js.map +1 -0
  516. package/dist/kernel/errors/job-error.d.ts +23 -0
  517. package/dist/kernel/errors/job-error.d.ts.map +1 -0
  518. package/dist/kernel/errors/job-error.js +15 -0
  519. package/dist/kernel/errors/job-error.js.map +1 -0
  520. package/dist/kernel/errors/secret-error.d.ts +19 -0
  521. package/dist/kernel/errors/secret-error.d.ts.map +1 -0
  522. package/dist/kernel/errors/secret-error.js +10 -0
  523. package/dist/kernel/errors/secret-error.js.map +1 -0
  524. package/dist/kernel/errors/session-error.d.ts +5 -1
  525. package/dist/kernel/errors/session-error.d.ts.map +1 -1
  526. package/dist/kernel/errors/session-error.js.map +1 -1
  527. package/dist/kernel/errors/subagent-error.d.ts +19 -0
  528. package/dist/kernel/errors/subagent-error.d.ts.map +1 -0
  529. package/dist/kernel/errors/subagent-error.js +10 -0
  530. package/dist/kernel/errors/subagent-error.js.map +1 -0
  531. package/dist/kernel/interfaces/kernel.d.ts +15 -0
  532. package/dist/kernel/interfaces/kernel.d.ts.map +1 -1
  533. package/dist/kernel/types.d.ts +80 -1
  534. package/dist/kernel/types.d.ts.map +1 -1
  535. package/dist/testing/fake-channel.d.ts +60 -0
  536. package/dist/testing/fake-channel.d.ts.map +1 -0
  537. package/dist/testing/fake-channel.js +135 -0
  538. package/dist/testing/fake-channel.js.map +1 -0
  539. package/dist/testing/in-memory-sandbox.d.ts +4 -1
  540. package/dist/testing/in-memory-sandbox.d.ts.map +1 -1
  541. package/dist/testing/in-memory-sandbox.js +63 -3
  542. package/dist/testing/in-memory-sandbox.js.map +1 -1
  543. package/dist/testing/mock-session-store.d.ts.map +1 -1
  544. package/dist/testing/mock-session-store.js +7 -0
  545. package/dist/testing/mock-session-store.js.map +1 -1
  546. package/package.json +2 -1
  547. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.d.ts +0 -38
  548. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.d.ts.map +0 -1
  549. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.js +0 -155
  550. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.js.map +0 -1
  551. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.d.ts +0 -27
  552. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.d.ts.map +0 -1
  553. package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.js.map +0 -1
  554. /package/dist/components/multi-agent-orchestration/agent/{scheduled-job-manager → secret-manager}/types.js +0 -0
@@ -1,74 +1,263 @@
1
+ import { SDKEventType } from "../../../event-handler/events.js";
2
+ import { SessionError } from "../../../../kernel/errors/session-error.js";
3
+ import { Conversation } from "./conversation.js";
4
+ import { TurnGate } from "./turn-gate.js";
5
+ /**
6
+ * An agent's sessions (A-97).
7
+ *
8
+ * Every turn runs in a session named by id and works on its own Conversation,
9
+ * loaded from the stores when the turn starts — so turns in different sessions
10
+ * share no in-memory state and can run in parallel (the TurnGate keeps
11
+ * turns of the same session in order).
12
+ *
13
+ * The "default session" set by startSession()/loadSession() is only the
14
+ * session a chat()/chatStream() call uses when it names none (the API before
15
+ * A-97). It no longer holds any history in memory.
16
+ */
1
17
  export class ConversationManager {
2
18
  persistence;
3
- currentSession = null;
4
- // In-memory caches loaded from the stores on startSession / loadSession
5
- _messages = [];
6
- _compactedMessages = null;
7
- constructor(persistence) {
19
+ events;
20
+ /** Session used by turns that name none — set by startSession()/loadSession(). */
21
+ defaultSessionId = null;
22
+ /**
23
+ * A-97: when turns may run — sessions in parallel, one turn at a time per session,
24
+ * capped by `getMaxConcurrentTurns` (read on every turn, so updateLoopConfig applies).
25
+ */
26
+ turnGate;
27
+ /**
28
+ * A-135: the Conversation of each session a turn is running in (at most one per session,
29
+ * the TurnGate sees to that). setApprovalMode() changes its Session too, so the turn's
30
+ * own session writes never put the old mode back.
31
+ */
32
+ openTurns = new Map();
33
+ /**
34
+ * A-136: sessions whose running turn is read-only (RunOptions.readOnly, e.g. /review):
35
+ * that turn runs in plan mode whatever the session's own approval mode.
36
+ */
37
+ readOnlyTurns = new Set();
38
+ constructor(persistence, getMaxConcurrentTurns = () => 0,
39
+ /** A-135: where SessionApprovalModeChanged is emitted (absent = no event). */
40
+ events) {
8
41
  this.persistence = persistence;
42
+ this.events = events;
43
+ this.turnGate = new TurnGate(getMaxConcurrentTurns);
9
44
  }
10
45
  async startSession(metadata, llmModel) {
11
- this.currentSession = await this.persistence.sessions.create(metadata);
12
- this._messages = [];
13
- this._compactedMessages = null;
46
+ const session = await this.persistence.sessions.create(metadata);
14
47
  if (llmModel) {
15
- this.currentSession.llmModel = llmModel;
16
- await this.persistence.sessions.update(this.currentSession);
48
+ session.llmModel = llmModel;
49
+ await this.persistence.sessions.update(session);
17
50
  }
18
- return this.currentSession;
51
+ this.defaultSessionId = session.id;
52
+ return session;
19
53
  }
54
+ /**
55
+ * Make an existing session the default for turns that name none. Returns the
56
+ * session as stored, or null (and clears the default) when it does not exist.
57
+ */
20
58
  async loadSession(sessionId) {
21
- this.currentSession = await this.persistence.sessions.get(sessionId);
22
- if (!this.currentSession) {
23
- this._messages = [];
24
- this._compactedMessages = null;
59
+ const session = await this.persistence.sessions.get(sessionId);
60
+ this.defaultSessionId = session ? session.id : null;
61
+ return session;
62
+ }
63
+ /** The session turns that name none run in, or null before startSession()/loadSession(). */
64
+ getDefaultSessionId() {
65
+ return this.defaultSessionId;
66
+ }
67
+ /**
68
+ * Load a session's conversation for one turn. Call it once the turn holds the
69
+ * session's slot, so no other turn of that session is writing.
70
+ * Null when the session does not exist.
71
+ */
72
+ open(sessionId) {
73
+ return Conversation.load(this.persistence, sessionId);
74
+ }
75
+ /** A-136: a session — the running turn's copy when there is one (it is the newest), else as stored; null when none. */
76
+ async getSession(sessionId) {
77
+ return this.openTurns.get(sessionId)?.getSession() ?? (await this.persistence.sessions.get(sessionId));
78
+ }
79
+ /** A session's full history, read from the message store. */
80
+ async getMessages(sessionId) {
81
+ return this.persistence.messages.get(sessionId);
82
+ }
83
+ async listSessions(filter) {
84
+ return this.persistence.sessions.list(filter);
85
+ }
86
+ /**
87
+ * Start a turn (A-97): resolve its session, wait for that session's slot (and one
88
+ * under the agent cap), then load the session's conversation.
89
+ * Resolves null when `signal` aborted while waiting — nothing ran or was saved.
90
+ * The caller must release() the returned turn when it ends.
91
+ */
92
+ async beginTurn(sessionId, signal,
93
+ /** A-136: readOnly = the turn runs in plan mode (only read-only tool calls). */
94
+ options) {
95
+ const id = this.resolveSessionId(sessionId);
96
+ const turn = await this.turnGate.acquire(id, signal);
97
+ if (!turn)
25
98
  return null;
99
+ let conversation;
100
+ try {
101
+ conversation = await this.openConversation(id);
102
+ }
103
+ catch (err) {
104
+ turn.release();
105
+ throw err;
26
106
  }
27
- // Load messages from their dedicated stores
28
- this._messages = await this.persistence.messages.get(sessionId);
29
- const compacted = await this.persistence.compactedMessages.get(sessionId);
30
- this._compactedMessages = compacted.length > 0 ? compacted : null;
31
- return this.currentSession;
32
- }
33
- async addMessage(message) {
34
- if (!this.currentSession)
35
- throw new Error("No active session");
36
- const sessionId = this.currentSession.id;
37
- if (!message.timestamp)
38
- message.timestamp = new Date().toISOString();
39
- this._messages.push(message);
40
- await this.persistence.messages.append(sessionId, message);
41
- if (this._compactedMessages) {
42
- this._compactedMessages.push(message);
43
- await this.persistence.compactedMessages.append(sessionId, message);
107
+ this.openTurns.set(id, conversation);
108
+ if (options?.readOnly)
109
+ this.readOnlyTurns.add(id);
110
+ return {
111
+ ...turn,
112
+ conversation,
113
+ release: () => {
114
+ if (this.openTurns.get(id) === conversation) {
115
+ this.openTurns.delete(id);
116
+ this.readOnlyTurns.delete(id);
117
+ }
118
+ turn.release();
119
+ },
120
+ };
121
+ }
122
+ /** A-136: is a turn running in the session now? */
123
+ isBusy(sessionId) {
124
+ return this.openTurns.has(sessionId);
125
+ }
126
+ /**
127
+ * A-135: a session's approval mode — from the running turn's session when there is one
128
+ * (it holds the latest value), else from the store. "ask" when unset, for an unknown
129
+ * session, and always for a job's session (nobody is there to have chosen YOLO).
130
+ */
131
+ async approvalMode(sessionId) {
132
+ // A-136: a read-only turn (/review) plans, whatever the session's mode.
133
+ if (this.readOnlyTurns.has(sessionId))
134
+ return "plan";
135
+ const session = this.openTurns.get(sessionId)?.getSession() ?? (await this.persistence.sessions.get(sessionId));
136
+ if (session?.approvalMode === "plan")
137
+ return "plan";
138
+ return session?.approvalMode === "yolo" && session.jobId === undefined ? "yolo" : "ask";
139
+ }
140
+ /**
141
+ * A-135: set a session's approval mode. It does not wait for a running turn of the
142
+ * session: that turn's next call that needs approval already uses the new mode.
143
+ * Returns the session as saved, or null when it does not exist. Throws
144
+ * SessionError "not_allowed" for YOLO in a job's session.
145
+ */
146
+ async setApprovalMode(sessionId, mode) {
147
+ // The running turn's copy is the newest (token usage, timestamps): change and save that one.
148
+ const session = this.openTurns.get(sessionId)?.getSession() ?? (await this.persistence.sessions.get(sessionId));
149
+ if (!session)
150
+ return null;
151
+ const yolo = mode === "yolo";
152
+ if (yolo && session.jobId !== undefined) {
153
+ throw new SessionError("a job's session can't use YOLO mode: its runs have nobody to switch it off", "not_allowed");
44
154
  }
45
- this.currentSession.updatedAt = Date.now();
46
- await this.persistence.sessions.update(this.currentSession);
155
+ // A-136: "plan" is stored like "yolo"; "ask" (the default) clears the field.
156
+ if (mode === "ask")
157
+ delete session.approvalMode;
158
+ else
159
+ session.approvalMode = mode;
160
+ session.updatedAt = Date.now();
161
+ await this.persistence.sessions.update(session);
162
+ this.events?.eventBus.emit({
163
+ type: SDKEventType.SessionApprovalModeChanged,
164
+ sessionId,
165
+ payload: { agentId: this.events.agentId, sessionId, mode: session.approvalMode ?? "ask" },
166
+ });
167
+ return session;
47
168
  }
48
169
  /**
49
- * Replace the LLM working set after compaction.
50
- * Only the agent loop should call this — the UI always reads `messages`.
170
+ * A-136: change a session's settings outside a turn (/rename, /model). Like setApprovalMode
171
+ * it does not wait for a running turn: it changes that turn's copy of the session (so the
172
+ * turn's own writes keep the change) and saves it. `fields` names what changed, for the
173
+ * SessionUpdated event. Returns the session as saved, or null when it does not exist.
51
174
  */
52
- async setCompactedMessages(compacted) {
53
- if (!this.currentSession)
54
- throw new Error("No active session");
55
- this._compactedMessages = compacted;
56
- await this.persistence.compactedMessages.set(this.currentSession.id, compacted);
175
+ async updateSession(sessionId, fields, change) {
176
+ const session = this.openTurns.get(sessionId)?.getSession() ?? (await this.persistence.sessions.get(sessionId));
177
+ if (!session)
178
+ return null;
179
+ change(session);
180
+ session.updatedAt = Date.now();
181
+ await this.persistence.sessions.update(session);
182
+ this.emitUpdated(sessionId, fields);
183
+ return session;
57
184
  }
58
185
  /**
59
- * Returns the LLM working set (compacted if available, full otherwise).
186
+ * A-136: start a fresh session next to `fromSessionId` (/clear): same metadata (so a host
187
+ * or chat app finds it where it found the old one) without the title, and the same model
188
+ * and context window. The old session stays as it was, resumable. It becomes the default
189
+ * session when the old one was. Null when `fromSessionId` does not exist.
60
190
  */
61
- getLlmMessages() {
62
- return this._compactedMessages ?? this._messages;
191
+ async startSessionFrom(fromSessionId) {
192
+ const from = await this.persistence.sessions.get(fromSessionId);
193
+ if (!from)
194
+ return null;
195
+ const { title: _title, ...metadata } = from.metadata;
196
+ const session = await this.persistence.sessions.create(metadata);
197
+ if (from.llmModel !== undefined || from.contextWindowTokens !== undefined) {
198
+ if (from.llmModel !== undefined)
199
+ session.llmModel = from.llmModel;
200
+ if (from.contextWindowTokens !== undefined)
201
+ session.contextWindowTokens = from.contextWindowTokens;
202
+ await this.persistence.sessions.update(session);
203
+ }
204
+ if (this.defaultSessionId === fromSessionId)
205
+ this.defaultSessionId = session.id;
206
+ return session;
63
207
  }
64
- getMessages() {
65
- return this._messages;
208
+ /** A-136: emit SessionUpdated for a change made outside a turn (absent bus = nothing). */
209
+ emitUpdated(sessionId, fields) {
210
+ this.events?.eventBus.emit({
211
+ type: SDKEventType.SessionUpdated,
212
+ sessionId,
213
+ payload: { agentId: this.events.agentId, sessionId, fields },
214
+ });
66
215
  }
67
- getSession() {
68
- return this.currentSession;
216
+ /**
217
+ * Add a message to a session outside a model turn (A-100 phase 3: a scheduled job's
218
+ * result posted in a chat joins that chat's conversation, so a reply there has it).
219
+ * It waits for the session like a turn does, so it lands between turns, never inside one.
220
+ */
221
+ async appendMessage(sessionId, message) {
222
+ const turn = await this.beginTurn(sessionId);
223
+ if (!turn)
224
+ return;
225
+ try {
226
+ await turn.conversation.addMessage(message);
227
+ }
228
+ finally {
229
+ turn.release();
230
+ }
69
231
  }
70
- async listSessions(filter) {
71
- return this.persistence.sessions.list(filter);
232
+ /** A-97: how many turns are running now, across all sessions. */
233
+ get runningTurns() {
234
+ return this.turnGate.runningTurns;
235
+ }
236
+ /** A-97: aborts every running turn (in any session), waits for them, and refuses new ones. */
237
+ dispose() {
238
+ return this.turnGate.dispose();
239
+ }
240
+ /** The session a turn runs in: the one named, else the startSession/loadSession default. */
241
+ resolveSessionId(sessionId) {
242
+ const resolved = sessionId ?? this.defaultSessionId;
243
+ if (!resolved)
244
+ throw new Error("No active session — call startSession or loadSession first, or pass RunOptions.sessionId");
245
+ return resolved;
72
246
  }
247
+ async openConversation(sessionId) {
248
+ const conversation = await this.open(sessionId);
249
+ if (!conversation)
250
+ throw new Error(`Session ${sessionId} not found`);
251
+ return conversation;
252
+ }
253
+ }
254
+ /** A-97: the result of a turn whose signal aborted while it waited for its session — nothing ran or was saved. */
255
+ export function abortedBeforeStart() {
256
+ return {
257
+ message: { role: "assistant", content: "" },
258
+ usage: { inputTokens: 0, outputTokens: 0 },
259
+ iterations: 0,
260
+ aborted: true,
261
+ };
73
262
  }
74
263
  //# sourceMappingURL=conversation-manager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-manager.js","sourceRoot":"","sources":["../../../../../src/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,mBAAmB;IAOpB,WAAW;IANb,cAAc,GAAmB,IAAI,CAAC;IAC9C,wEAAwE;IAChE,SAAS,GAAc,EAAE,CAAC;IAC1B,kBAAkB,GAAqB,IAAI,CAAC;IAEpD,YACU,WAA2B;2BAA3B,WAAW;IAAmB,CAAC;IAEzC,KAAK,CAAC,YAAY,CAAC,QAAkC,EAAE,QAAiB;QACtE,IAAI,CAA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AC7B,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,MAAsB;QACvC,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;CACF"}
1
+ {"version":3,"file":"conversation-manager.js","sourceRoot":"","sources":["../../../../../src/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAG1E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,mBAAmB;IAqBpB,WAAW;IAGX,MAAM;IAvBhB,kFAAkF;IAC1E,gBAAgB,GAAkB,IAAI,CAAC;IAC/C;;;OAGG;IACK,QAAQ,CAAW;IAC3B;;;;OAIG;IACK,SAAS,GAAG,IAAI,GAAG,EAAwB,CAAC;IACpD;;;OAGG;IACK,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;IAE1C,YACU,WAA2B,EACnC,qBAAqB,GAAiB,GAAG,EAAE,CAAC,CAAC;IAC7C,8EAA8E;IACtE,MAAgD;2BAHhD,WAAW;sBAGX,MAAM;QAEd,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAAkC,EAAE,QAAiB;QACtE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjE,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC5B,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CA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AAQ,CAAC,OAAO,EAAE,CAAC;IACjC,CAAC;IAED,4FAA4F;IACpF,gBAAgB,CAAC,SAAkB;QACzC,MAAM,QAAQ,GAAG,SAAS,IAAI,IAAI,CAAC,gBAAgB,CAAC;QACpD,IAAI,CAAC,QAAQ;YACX,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;QACJ,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,SAAiB;QAC9C,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChD,IAAI,CAAC,YAAY;YAAE,MAAM,IAAI,KAAK,CAAC,WAAW,SAAS,YAAY,CAAC,CAAC;QACrE,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAQD,kHAAkH;AAClH,MAAM,UAAU,kBAAkB;IAChC,OAAO;QACL,OAAO,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE;QAC3C,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;QAC1C,UAAU,EAAE,CAAC;QACb,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { Message, Session } from "../../../../kernel/types.js";
2
+ import type { PersistenceHub } from "../../../persistence-hub/persistence-hub.js";
3
+ /**
4
+ * One session's conversation for the length of one turn (A-97): the session
5
+ * record, its full history and its compacted LLM working set.
6
+ *
7
+ * A Conversation is loaded from the stores when a turn starts (under that
8
+ * session's turn lock) and dropped when the turn ends, so every turn sees what
9
+ * the stores hold — including writes the host made between turns — and two
10
+ * sessions of one agent never share in-memory state. Every write goes straight
11
+ * to the stores.
12
+ */
13
+ export declare class Conversation {
14
+ private persistence;
15
+ private session;
16
+ private messages;
17
+ private compactedMessages;
18
+ private constructor();
19
+ /** Load a session's conversation from the stores. Null when the session does not exist. */
20
+ static load(persistence: PersistenceHub, sessionId: string): Promise<Conversation | null>;
21
+ addMessage(message: Message): Promise<void>;
22
+ /**
23
+ * Replace the LLM working set after compaction.
24
+ * Only the agent loop should call this — the UI always reads `messages`.
25
+ */
26
+ setCompactedMessages(compacted: Message[]): Promise<void>;
27
+ /** A-136: change this turn's session and save it (/compact resets its reported context size). */
28
+ updateSession(change: (session: Session) => void): Promise<void>;
29
+ /** Returns the LLM working set (compacted if available, full otherwise). */
30
+ getLlmMessages(): Message[];
31
+ getMessages(): Message[];
32
+ getSession(): Session;
33
+ }
34
+ //# sourceMappingURL=conversation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/components/multi-agent-orchestration/agent/conversation-manager/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAElF;;;;;;;;;GASG;AACH,qBAAa,YAAY;IAErB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,OAAO;IAEf,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,iBAAiB;IAL3B,OAAO,eAMH;IAEJ,2FAA2F;IAC3F,OAAa,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAS9F;IAEK,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAWhD;IAED;;;OAGG;IACG,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAG9D;IAED,iGAAiG;IAC3F,aAAa,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAIrE;IAED,4EAA4E;IAC5E,cAAc,IAAI,OAAO,EAAE,CAE1B;IAED,WAAW,IAAI,OAAO,EAAE,CAEvB;IAED,UAAU,IAAI,OAAO,CAEpB;CACF"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * One session's conversation for the length of one turn (A-97): the session
3
+ * record, its full history and its compacted LLM working set.
4
+ *
5
+ * A Conversation is loaded from the stores when a turn starts (under that
6
+ * session's turn lock) and dropped when the turn ends, so every turn sees what
7
+ * the stores hold — including writes the host made between turns — and two
8
+ * sessions of one agent never share in-memory state. Every write goes straight
9
+ * to the stores.
10
+ */
11
+ export class Conversation {
12
+ persistence;
13
+ session;
14
+ messages;
15
+ compactedMessages;
16
+ constructor(persistence, session,
17
+ // In-memory caches loaded from the stores when the turn starts (load() below)
18
+ messages, compactedMessages) {
19
+ this.persistence = persistence;
20
+ this.session = session;
21
+ this.messages = messages;
22
+ this.compactedMessages = compactedMessages;
23
+ }
24
+ /** Load a session's conversation from the stores. Null when the session does not exist. */
25
+ static async load(persistence, sessionId) {
26
+ const session = await persistence.sessions.get(sessionId);
27
+ if (!session)
28
+ return null;
29
+ // Load messages from their dedicated stores
30
+ const [messages, compacted] = await Promise.all([
31
+ persistence.messages.get(sessionId),
32
+ persistence.compactedMessages.get(sessionId),
33
+ ]);
34
+ return new Conversation(persistence, session, messages, compacted.length > 0 ? compacted : null);
35
+ }
36
+ async addMessage(message) {
37
+ const sessionId = this.session.id;
38
+ if (!message.timestamp)
39
+ message.timestamp = new Date().toISOString();
40
+ this.messages.push(message);
41
+ await this.persistence.messages.append(sessionId, message);
42
+ if (this.compactedMessages) {
43
+ this.compactedMessages.push(message);
44
+ await this.persistence.compactedMessages.append(sessionId, message);
45
+ }
46
+ this.session.updatedAt = Date.now();
47
+ await this.persistence.sessions.update(this.session);
48
+ }
49
+ /**
50
+ * Replace the LLM working set after compaction.
51
+ * Only the agent loop should call this — the UI always reads `messages`.
52
+ */
53
+ async setCompactedMessages(compacted) {
54
+ this.compactedMessages = compacted;
55
+ await this.persistence.compactedMessages.set(this.session.id, compacted);
56
+ }
57
+ /** A-136: change this turn's session and save it (/compact resets its reported context size). */
58
+ async updateSession(change) {
59
+ change(this.session);
60
+ this.session.updatedAt = Date.now();
61
+ await this.persistence.sessions.update(this.session);
62
+ }
63
+ /** Returns the LLM working set (compacted if available, full otherwise). */
64
+ getLlmMessages() {
65
+ return this.compactedMessages ?? this.messages;
66
+ }
67
+ getMessages() {
68
+ return this.messages;
69
+ }
70
+ getSession() {
71
+ return this.session;
72
+ }
73
+ }
74
+ //# sourceMappingURL=conversation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../../../src/components/multi-agent-orchestration/agent/conversation-manager/conversation.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,MAAM,OAAO,YAAY;IAEb,WAAW;IACX,OAAO;IAEP,QAAQ;IACR,iBAAiB;IAL3B,YACU,WAA2B,EAC3B,OAAgB;IACxB,8EAA8E;IACtE,QAAmB,EACnB,iBAAmC;2BAJnC,WAAW;uBACX,OAAO;wBAEP,QAAQ;iCACR,iBAAiB;IACxB,CAAC;IAEJ,2FAA2F;IAC3F,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,WAA2B,EAAE,SAAiB;QAC9D,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC1D,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC1B,4CAA4C;QAC5C,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC9C,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC;YACnC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC;SAC7C,CAAC,CAAC;QACH,OAAO,IAAI,YAAY,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,C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AQ,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,4EAA4E;IAC5E,cAAc;QACZ,OAAO,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,QAAQ,CAAC;IACjD,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Decides when an agent's turns may run (A-97).
3
+ *
4
+ * - Turns in different sessions run in parallel.
5
+ * - Turns in the same session run one at a time, in arrival order: a session's
6
+ * history is appended in order, so two turns at once would interleave.
7
+ * - An optional per-agent cap (`maxConcurrent`, 0 = no cap) bounds how many
8
+ * turns run at once across all sessions, for cost and rate-limit control.
9
+ * - A turn waiting for its slot can be cancelled with its AbortSignal.
10
+ * - dispose() aborts every running turn, waits for them to end, and refuses new ones.
11
+ */
12
+ export declare class TurnGate {
13
+ private getMaxConcurrent;
14
+ /** Per session: the tail of its queue — resolves when the last queued turn has ended. */
15
+ private sessionTails;
16
+ /** Turns waiting for a free slot under the agent cap, oldest first. */
17
+ private capWaiters;
18
+ private running;
19
+ private active;
20
+ private disposed;
21
+ /** The sessions whose turn is running in the current async context — catches a turn that would wait for itself. */
22
+ private readonly context;
23
+ constructor(getMaxConcurrent: () => number);
24
+ /**
25
+ * Wait for this session's turn (and a slot under the agent cap). Resolves with
26
+ * the turn's handle, or with null when `signal` aborted while waiting.
27
+ * Throws when the gate is disposed, or when called from inside a running turn
28
+ * of the same session (that turn would wait for itself forever).
29
+ */
30
+ acquire(sessionId: string, signal?: AbortSignal): Promise<TurnHandle | null>;
31
+ /** How many turns are running now (across all sessions). */
32
+ get runningTurns(): number;
33
+ /** Abort every running turn and wait for them to end. Later acquire() calls throw. */
34
+ dispose(): Promise<void>;
35
+ private takeSlot;
36
+ private freeSlot;
37
+ /** Give the slot a finished turn frees to the oldest waiter — or free it when nobody waits. */
38
+ private handOn;
39
+ }
40
+ /** A running turn, handed out by TurnGate.acquire(). */
41
+ export interface TurnHandle {
42
+ /** Aborted when the caller's signal aborts or the agent is disposed. */
43
+ signal: AbortSignal;
44
+ /** Run the turn's work inside the gate's call context (detects a nested same-session turn). */
45
+ run<T>(fn: () => T): T;
46
+ /** End the turn: lets the session's next turn start and frees the agent slot. Safe to call twice. */
47
+ release(): void;
48
+ }
49
+ //# sourceMappingURL=turn-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turn-gate.d.ts","sourceRoot":"","sources":["../../../../../src/components/multi-agent-orchestration/agent/conversation-manager/turn-gate.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,qBAAa,QAAQ;IAWP,OAAO,CAAC,gBAAgB;IAVpC,yFAAyF;IACzF,OAAO,CAAC,YAAY,CAAoC;IACxD,uEAAuE;IACvE,OAAO,CAAC,UAAU,CAAmB;IACrC,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,QAAQ,CAAS;IACzB,mHAAmH;IACnH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgD;IAExE,YAAoB,gBAAgB,EAAE,MAAM,MAAM,EAAI;IAEtD;;;;;OAKG;IACG,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAgEjF;IAED,4DAA4D;IAC5D,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,sFAAsF;IAChF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAO7B;YAEa,QAAQ;IAsBtB,OAAO,CAAC,QAAQ;IAQhB,+FAA+F;IAC/F,OAAO,CAAC,MAAM;CASf;AAED,wDAAwD;AACxD,MAAM,WAAW,UAAU;IACzB,wEAAwE;IACxE,MAAM,EAAE,WAAW,CAAC;IACpB,+FAA+F;IAC/F,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACvB,qGAAqG;IACrG,OAAO,IAAI,IAAI,CAAC;CACjB"}