botmancers 0.7.0 → 0.9.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 (389) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +5 -5
  3. package/app/.next/BUILD_ID +1 -1
  4. package/app/.next/app-path-routes-manifest.json +12 -1
  5. package/app/.next/build-manifest.json +3 -3
  6. package/app/.next/prerender-manifest.json +4 -4
  7. package/app/.next/required-server-files.json +2 -2
  8. package/app/.next/routes-manifest.json +90 -0
  9. package/app/.next/server/app/_global-error.html +1 -1
  10. package/app/.next/server/app/_global-error.rsc +1 -1
  11. package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/_not-found.html +1 -1
  17. package/app/.next/server/app/_not-found.rsc +2 -2
  18. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  19. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  20. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  21. package/app/.next/server/app/agents/[id]/activity/page/app-paths-manifest.json +3 -0
  22. package/app/.next/server/app/agents/[id]/activity/page/next-font-manifest.json +11 -0
  23. package/app/.next/server/app/agents/[id]/activity/page.js +14 -0
  24. package/app/.next/server/app/agents/[id]/activity/page.js.nft.json +1 -0
  25. package/app/.next/server/app/agents/[id]/activity/page_client-reference-manifest.js +3 -0
  26. package/app/.next/server/app/agents/[id]/conversations/[conversationId]/page/app-paths-manifest.json +3 -0
  27. package/app/.next/server/app/agents/[id]/conversations/[conversationId]/page/build-manifest.json +20 -0
  28. package/app/.next/server/app/agents/[id]/conversations/[conversationId]/page/next-font-manifest.json +11 -0
  29. package/app/.next/server/app/agents/[id]/conversations/[conversationId]/page/react-loadable-manifest.json +1 -0
  30. package/app/.next/server/app/agents/[id]/conversations/[conversationId]/page/server-reference-manifest.json +4 -0
  31. package/app/.next/server/app/agents/[id]/conversations/[conversationId]/page.js +14 -0
  32. package/app/.next/server/app/agents/[id]/conversations/[conversationId]/page.js.nft.json +1 -0
  33. package/app/.next/server/app/agents/[id]/conversations/[conversationId]/page_client-reference-manifest.js +3 -0
  34. package/app/.next/server/app/agents/[id]/conversations/page/app-paths-manifest.json +3 -0
  35. package/app/.next/server/app/agents/[id]/conversations/page/build-manifest.json +20 -0
  36. package/app/.next/server/app/agents/[id]/conversations/page/next-font-manifest.json +11 -0
  37. package/app/.next/server/app/agents/[id]/conversations/page/react-loadable-manifest.json +1 -0
  38. package/app/.next/server/app/agents/[id]/conversations/page/server-reference-manifest.json +4 -0
  39. package/app/.next/server/app/agents/[id]/conversations/page.js +14 -0
  40. package/app/.next/server/app/agents/[id]/conversations/page.js.nft.json +1 -0
  41. package/app/.next/server/app/agents/[id]/conversations/page_client-reference-manifest.js +3 -0
  42. package/app/.next/server/app/agents/[id]/page/app-paths-manifest.json +3 -0
  43. package/app/.next/server/app/agents/[id]/page/build-manifest.json +20 -0
  44. package/app/.next/server/app/{threads → agents}/[id]/page/next-font-manifest.json +1 -1
  45. package/app/.next/server/app/agents/[id]/page/react-loadable-manifest.json +1 -0
  46. package/app/.next/server/app/agents/[id]/page/server-reference-manifest.json +4 -0
  47. package/app/.next/server/app/{threads → agents}/[id]/page.js +6 -5
  48. package/app/.next/server/app/{threads → agents}/[id]/page.js.nft.json +1 -1
  49. package/app/.next/server/app/agents/[id]/page_client-reference-manifest.js +3 -0
  50. package/app/.next/server/app/agents/[id]/sessions/page/app-paths-manifest.json +3 -0
  51. package/app/.next/server/app/agents/[id]/sessions/page/build-manifest.json +20 -0
  52. package/app/.next/server/app/agents/[id]/sessions/page/next-font-manifest.json +11 -0
  53. package/app/.next/server/app/agents/[id]/sessions/page/react-loadable-manifest.json +1 -0
  54. package/app/.next/server/app/agents/[id]/sessions/page/server-reference-manifest.json +4 -0
  55. package/app/.next/server/app/agents/[id]/sessions/page.js +14 -0
  56. package/app/.next/server/app/agents/[id]/sessions/page.js.nft.json +1 -0
  57. package/app/.next/server/app/agents/[id]/sessions/page_client-reference-manifest.js +3 -0
  58. package/app/.next/server/app/agents/[id]/slack/page/app-paths-manifest.json +3 -0
  59. package/app/.next/server/app/agents/[id]/slack/page/build-manifest.json +20 -0
  60. package/app/.next/server/app/agents/[id]/slack/page/next-font-manifest.json +11 -0
  61. package/app/.next/server/app/agents/[id]/slack/page/react-loadable-manifest.json +1 -0
  62. package/app/.next/server/app/agents/[id]/slack/page/server-reference-manifest.json +4 -0
  63. package/app/.next/server/app/agents/[id]/slack/page.js +14 -0
  64. package/app/.next/server/app/agents/[id]/slack/page.js.nft.json +1 -0
  65. package/app/.next/server/app/agents/[id]/slack/page_client-reference-manifest.js +3 -0
  66. package/app/.next/server/app/api/bots/[id]/activity/route/app-paths-manifest.json +3 -0
  67. package/app/.next/server/app/api/bots/[id]/activity/route/build-manifest.json +12 -0
  68. package/app/.next/server/app/api/bots/[id]/activity/route/server-reference-manifest.json +4 -0
  69. package/app/.next/server/app/api/bots/[id]/activity/route.js +9 -0
  70. package/app/.next/server/app/api/bots/[id]/activity/route.js.nft.json +1 -0
  71. package/app/.next/server/app/api/bots/[id]/activity/route_client-reference-manifest.js +3 -0
  72. package/app/.next/server/app/api/bots/[id]/config/route.js +1 -1
  73. package/app/.next/server/app/api/bots/[id]/config/route.js.nft.json +1 -1
  74. package/app/.next/server/app/api/bots/[id]/conversations/[conversationId]/route/app-paths-manifest.json +3 -0
  75. package/app/.next/server/app/api/bots/[id]/conversations/[conversationId]/route/build-manifest.json +12 -0
  76. package/app/.next/server/app/api/bots/[id]/conversations/[conversationId]/route/server-reference-manifest.json +4 -0
  77. package/app/.next/server/app/api/bots/[id]/conversations/[conversationId]/route.js +12 -0
  78. package/app/.next/server/app/api/bots/[id]/conversations/[conversationId]/route.js.nft.json +1 -0
  79. package/app/.next/server/app/api/bots/[id]/conversations/[conversationId]/route_client-reference-manifest.js +3 -0
  80. package/app/.next/server/app/api/bots/[id]/conversations/route/app-paths-manifest.json +3 -0
  81. package/app/.next/server/app/api/bots/[id]/conversations/route/build-manifest.json +12 -0
  82. package/app/.next/server/app/api/bots/[id]/conversations/route/server-reference-manifest.json +4 -0
  83. package/app/.next/server/app/api/bots/[id]/conversations/route.js +12 -0
  84. package/app/.next/server/app/api/bots/[id]/conversations/route.js.nft.json +1 -0
  85. package/app/.next/server/app/api/bots/[id]/conversations/route_client-reference-manifest.js +3 -0
  86. package/app/.next/server/app/api/bots/[id]/overview/route/app-paths-manifest.json +3 -0
  87. package/app/.next/server/app/api/bots/[id]/overview/route/build-manifest.json +12 -0
  88. package/app/.next/server/app/api/bots/[id]/overview/route/server-reference-manifest.json +4 -0
  89. package/app/.next/server/app/api/bots/[id]/overview/route.js +12 -0
  90. package/app/.next/server/app/api/bots/[id]/overview/route.js.nft.json +1 -0
  91. package/app/.next/server/app/api/bots/[id]/overview/route_client-reference-manifest.js +3 -0
  92. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route.js +2 -2
  93. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route.js.nft.json +1 -1
  94. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/route.js +2 -2
  95. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/route.js.nft.json +1 -1
  96. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/shares/route.js +1 -1
  97. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/shares/route.js.nft.json +1 -1
  98. package/app/.next/server/app/api/bots/[id]/sessions/route.js +3 -3
  99. package/app/.next/server/app/api/bots/[id]/sessions/route.js.nft.json +1 -1
  100. package/app/.next/server/app/api/bots/[id]/sessions/sync/route/app-paths-manifest.json +3 -0
  101. package/app/.next/server/app/api/bots/[id]/sessions/sync/route/build-manifest.json +12 -0
  102. package/app/.next/server/app/api/bots/[id]/sessions/sync/route/server-reference-manifest.json +4 -0
  103. package/app/.next/server/app/api/bots/[id]/sessions/sync/route.js +11 -0
  104. package/app/.next/server/app/api/bots/[id]/sessions/sync/route.js.nft.json +1 -0
  105. package/app/.next/server/app/api/bots/[id]/sessions/sync/route_client-reference-manifest.js +3 -0
  106. package/app/.next/server/app/api/bots/[id]/share-policy/route.js +1 -1
  107. package/app/.next/server/app/api/bots/[id]/share-policy/route.js.nft.json +1 -1
  108. package/app/.next/server/app/api/bots/[id]/skill/route.js +1 -1
  109. package/app/.next/server/app/api/bots/[id]/skill/route.js.nft.json +1 -1
  110. package/app/.next/server/app/api/bots/availability/route.js.nft.json +1 -1
  111. package/app/.next/server/app/api/bots/delete-preview/route.js +1 -1
  112. package/app/.next/server/app/api/bots/delete-preview/route.js.nft.json +1 -1
  113. package/app/.next/server/app/api/bots/import/route.js +1 -1
  114. package/app/.next/server/app/api/bots/import/route.js.nft.json +1 -1
  115. package/app/.next/server/app/api/bots/manage/route.js +1 -1
  116. package/app/.next/server/app/api/bots/manage/route.js.nft.json +1 -1
  117. package/app/.next/server/app/api/bots/name-migrations/route.js +1 -1
  118. package/app/.next/server/app/api/bots/name-migrations/route.js.nft.json +1 -1
  119. package/app/.next/server/app/api/bots/route.js +5 -5
  120. package/app/.next/server/app/api/bots/route.js.nft.json +1 -1
  121. package/app/.next/server/app/api/conversations/[id]/approve/route.js.nft.json +1 -1
  122. package/app/.next/server/app/api/conversations/[id]/deny/route.js.nft.json +1 -1
  123. package/app/.next/server/app/api/conversations/[id]/draft/route.js +1 -1
  124. package/app/.next/server/app/api/conversations/[id]/draft/route.js.nft.json +1 -1
  125. package/app/.next/server/app/api/conversations/[id]/messages/[messageId]/stop/route.js.nft.json +1 -1
  126. package/app/.next/server/app/api/conversations/[id]/messages/route.js +5 -5
  127. package/app/.next/server/app/api/conversations/[id]/messages/route.js.nft.json +1 -1
  128. package/app/.next/server/app/api/conversations/[id]/route.js +1 -1
  129. package/app/.next/server/app/api/conversations/[id]/route.js.nft.json +1 -1
  130. package/app/.next/server/app/api/conversations/[id]/stop/route.js +6 -6
  131. package/app/.next/server/app/api/conversations/[id]/stop/route.js.nft.json +1 -1
  132. package/app/.next/server/app/api/conversations/route.js +1 -1
  133. package/app/.next/server/app/api/conversations/route.js.nft.json +1 -1
  134. package/app/.next/server/app/api/exchanges/[id]/cancel/route.js +1 -1
  135. package/app/.next/server/app/api/exchanges/[id]/cancel/route.js.nft.json +1 -1
  136. package/app/.next/server/app/api/exchanges/[id]/route.js +1 -1
  137. package/app/.next/server/app/api/exchanges/[id]/route.js.nft.json +1 -1
  138. package/app/.next/server/app/api/exchanges/route.js +2 -2
  139. package/app/.next/server/app/api/exchanges/route.js.nft.json +1 -1
  140. package/app/.next/server/app/api/files/[name]/route.js +1 -1
  141. package/app/.next/server/app/api/files/[name]/route.js.nft.json +1 -1
  142. package/app/.next/server/app/api/groups/route.js +1 -1
  143. package/app/.next/server/app/api/groups/route.js.nft.json +1 -1
  144. package/app/.next/server/app/api/health/route.js +1 -1
  145. package/app/.next/server/app/api/health/route.js.nft.json +1 -1
  146. package/app/.next/server/app/api/import-capabilities/route.js.nft.json +1 -1
  147. package/app/.next/server/app/api/marketplace-handoff/route.js.nft.json +1 -1
  148. package/app/.next/server/app/api/marketplace-handoff/status/route.js.nft.json +1 -1
  149. package/app/.next/server/app/api/mcp/route.js +1 -1
  150. package/app/.next/server/app/api/mcp/route.js.nft.json +1 -1
  151. package/app/.next/server/app/api/messages/[id]/between/route.js +1 -1
  152. package/app/.next/server/app/api/messages/[id]/between/route.js.nft.json +1 -1
  153. package/app/.next/server/app/api/runtime-connections/route.js +1 -1
  154. package/app/.next/server/app/api/runtime-connections/route.js.nft.json +1 -1
  155. package/app/.next/server/app/api/service-grants/route.js.nft.json +1 -1
  156. package/app/.next/server/app/api/shares/[shareRef]/revoke/route.js +1 -1
  157. package/app/.next/server/app/api/shares/[shareRef]/revoke/route.js.nft.json +1 -1
  158. package/app/.next/server/app/api/shares/route.js +1 -1
  159. package/app/.next/server/app/api/shares/route.js.nft.json +1 -1
  160. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js +4 -3
  161. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js.nft.json +1 -1
  162. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js +4 -3
  163. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js.nft.json +1 -1
  164. package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js +1 -1
  165. package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js.nft.json +1 -1
  166. package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js +4 -3
  167. package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js.nft.json +1 -1
  168. package/app/.next/server/app/api/v0/agents/[agentId]/route.js +4 -3
  169. package/app/.next/server/app/api/v0/agents/[agentId]/route.js.nft.json +1 -1
  170. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js +4 -3
  171. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js.nft.json +1 -1
  172. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js +4 -3
  173. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js.nft.json +1 -1
  174. package/app/.next/server/app/api/v0/agents/route.js +4 -3
  175. package/app/.next/server/app/api/v0/agents/route.js.nft.json +1 -1
  176. package/app/.next/server/app/api/v0/capabilities/route.js +4 -3
  177. package/app/.next/server/app/api/v0/capabilities/route.js.nft.json +1 -1
  178. package/app/.next/server/app/api/v0/conversations/[id]/route.js +1 -1
  179. package/app/.next/server/app/api/v0/conversations/[id]/route.js.nft.json +1 -1
  180. package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js +4 -3
  181. package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js.nft.json +1 -1
  182. package/app/.next/server/app/api/v0/exchanges/[id]/route.js +4 -3
  183. package/app/.next/server/app/api/v0/exchanges/[id]/route.js.nft.json +1 -1
  184. package/app/.next/server/app/api/v0/exchanges/route.js +4 -3
  185. package/app/.next/server/app/api/v0/exchanges/route.js.nft.json +1 -1
  186. package/app/.next/server/app/api/v0/mcp/route.js +6 -5
  187. package/app/.next/server/app/api/v0/mcp/route.js.nft.json +1 -1
  188. package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js +4 -3
  189. package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js.nft.json +1 -1
  190. package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js +4 -3
  191. package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js.nft.json +1 -1
  192. package/app/.next/server/app/api/v0/pins/[pinRef]/route.js +4 -3
  193. package/app/.next/server/app/api/v0/pins/[pinRef]/route.js.nft.json +1 -1
  194. package/app/.next/server/app/api/v0/requests/[id]/route.js +1 -1
  195. package/app/.next/server/app/api/v0/requests/[id]/route.js.nft.json +1 -1
  196. package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js +4 -3
  197. package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js.nft.json +1 -1
  198. package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js +4 -3
  199. package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js.nft.json +1 -1
  200. package/app/.next/server/app/api/v0/sessions/[ref]/shares/route.js +4 -3
  201. package/app/.next/server/app/api/v0/sessions/[ref]/shares/route.js.nft.json +1 -1
  202. package/app/.next/server/app/api/v0/shares/[shareRef]/revoke/route.js +4 -3
  203. package/app/.next/server/app/api/v0/shares/[shareRef]/revoke/route.js.nft.json +1 -1
  204. package/app/.next/server/app/api/v0/shares/[shareRef]/route.js +4 -3
  205. package/app/.next/server/app/api/v0/shares/[shareRef]/route.js.nft.json +1 -1
  206. package/app/.next/server/app/api/v0/shares/current/route.js +4 -3
  207. package/app/.next/server/app/api/v0/shares/current/route.js.nft.json +1 -1
  208. package/app/.next/server/app/api/v0/shares/route.js +4 -3
  209. package/app/.next/server/app/api/v0/shares/route.js.nft.json +1 -1
  210. package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js +1 -1
  211. package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js.nft.json +1 -1
  212. package/app/.next/server/app/api/wakes/[id]/decision/route.js +1 -1
  213. package/app/.next/server/app/api/wakes/[id]/decision/route.js.nft.json +1 -1
  214. package/app/.next/server/app/api/wakes/[id]/retry/route.js +1 -1
  215. package/app/.next/server/app/api/wakes/[id]/retry/route.js.nft.json +1 -1
  216. package/app/.next/server/app/bots/[id]/config/page.js.nft.json +1 -1
  217. package/app/.next/server/app/bots/[id]/config/page_client-reference-manifest.js +1 -1
  218. package/app/.next/server/app/exchanges/page.js.nft.json +1 -1
  219. package/app/.next/server/app/exchanges/page_client-reference-manifest.js +1 -1
  220. package/app/.next/server/app/exchanges.html +1 -1
  221. package/app/.next/server/app/exchanges.rsc +3 -3
  222. package/app/.next/server/app/exchanges.segments/_full.segment.rsc +3 -3
  223. package/app/.next/server/app/exchanges.segments/_tree.segment.rsc +2 -2
  224. package/app/.next/server/app/exchanges.segments/exchanges/__PAGE__.segment.rsc +3 -3
  225. package/app/.next/server/app/index.html +1 -1
  226. package/app/.next/server/app/index.rsc +3 -3
  227. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  228. package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
  229. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  230. package/app/.next/server/app/page.js.nft.json +1 -1
  231. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  232. package/app/.next/server/app/settings/page.js.nft.json +1 -1
  233. package/app/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  234. package/app/.next/server/app/settings.html +1 -1
  235. package/app/.next/server/app/settings.rsc +2 -2
  236. package/app/.next/server/app/settings.segments/_full.segment.rsc +2 -2
  237. package/app/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  238. package/app/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  239. package/app/.next/server/app/threads/[id]/route/app-paths-manifest.json +3 -0
  240. package/app/.next/server/app/threads/[id]/route/build-manifest.json +12 -0
  241. package/app/.next/server/app/threads/[id]/route/server-reference-manifest.json +4 -0
  242. package/app/.next/server/app/threads/[id]/route.js +10 -0
  243. package/app/.next/server/app/threads/[id]/route.js.nft.json +1 -0
  244. package/app/.next/server/app/threads/[id]/route_client-reference-manifest.js +3 -0
  245. package/app/.next/server/app-paths-manifest.json +12 -1
  246. package/app/.next/server/chunks/1oeh_server_app_api_bots_[id]_conversations_[conversationId]_route_actions_11cb2lr.js +3 -0
  247. package/app/.next/server/chunks/{[root-of-the-server]__17xl_55._.js → [root-of-the-server]__03pk_x_._.js} +1 -1
  248. package/app/.next/server/chunks/{[root-of-the-server]__0mp8bap._.js → [root-of-the-server]__05ds5md._.js} +1 -1
  249. package/app/.next/server/chunks/[root-of-the-server]__0anfwiu._.js +52 -0
  250. package/app/.next/server/chunks/{[root-of-the-server]__0-w_t2y._.js → [root-of-the-server]__0atpy-s._.js} +1 -1
  251. package/app/.next/server/chunks/[root-of-the-server]__0hhill-._.js +3 -0
  252. package/app/.next/server/chunks/{[root-of-the-server]__06w5xhe._.js → [root-of-the-server]__0hiikkz._.js} +1 -1
  253. package/app/.next/server/chunks/[root-of-the-server]__0k8wfe2._.js +3 -0
  254. package/app/.next/server/chunks/{[root-of-the-server]__1eps2a4._.js → [root-of-the-server]__0pp5x67._.js} +1 -1
  255. package/app/.next/server/chunks/[root-of-the-server]__0qqsovi._.js +3 -0
  256. package/app/.next/server/chunks/{[root-of-the-server]__1dxr858._.js → [root-of-the-server]__0thkp5l._.js} +1 -1
  257. package/app/.next/server/chunks/[root-of-the-server]__0xhwlr4._.js +3 -0
  258. package/app/.next/server/chunks/{[root-of-the-server]__0-vcyi-._.js → [root-of-the-server]__11yt1hv._.js} +1 -1
  259. package/app/.next/server/chunks/[root-of-the-server]__1280ke1._.js +46 -0
  260. package/app/.next/server/chunks/{[root-of-the-server]__0iqh5ta._.js → [root-of-the-server]__12wk406._.js} +1 -1
  261. package/app/.next/server/chunks/[root-of-the-server]__13wghn3._.js +46 -0
  262. package/app/.next/server/chunks/{[root-of-the-server]__0lwsto-._.js → [root-of-the-server]__14cwco7._.js} +3 -3
  263. package/app/.next/server/chunks/{[root-of-the-server]__1kczttr._.js → [root-of-the-server]__185i_bv._.js} +1 -1
  264. package/app/.next/server/chunks/[root-of-the-server]__1byhehl._.js +3 -0
  265. package/app/.next/server/chunks/{[root-of-the-server]__10b5-i-._.js → [root-of-the-server]__1ez_5xy._.js} +1 -1
  266. package/app/.next/server/chunks/[root-of-the-server]__1jxwu9_._.js +52 -0
  267. package/app/.next/server/chunks/{[root-of-the-server]__0o9ijih._.js → [root-of-the-server]__1mxp6z6._.js} +1 -1
  268. package/app/.next/server/chunks/{[root-of-the-server]__0ey3_2x._.js → [root-of-the-server]__1s2-vw3._.js} +1 -1
  269. package/app/.next/server/chunks/{[root-of-the-server]__1hwy3jx._.js → [root-of-the-server]__1xq61ti._.js} +1 -1
  270. package/app/.next/server/chunks/{[root-of-the-server]__04b3ml2._.js → [root-of-the-server]__20om7um._.js} +1 -1
  271. package/app/.next/server/chunks/_0061c2q._.js +1 -1
  272. package/app/.next/server/chunks/_0_b7py8._.js +3 -0
  273. package/app/.next/server/chunks/_0a2do3x._.js +1 -1
  274. package/app/.next/server/chunks/_1-5mthb._.js +1 -1
  275. package/app/.next/server/chunks/_12i5gam._.js +7 -0
  276. package/app/.next/server/chunks/_1a0er16._.js +18 -0
  277. package/app/.next/server/chunks/_1uxmsh3._.js +18 -0
  278. package/app/.next/server/chunks/_next-internal_server_app_api_bots_[id]_activity_route_actions_06oyah6.js +3 -0
  279. package/app/.next/server/chunks/_next-internal_server_app_api_bots_[id]_conversations_route_actions_0op0mjv.js +3 -0
  280. package/app/.next/server/chunks/_next-internal_server_app_api_bots_[id]_overview_route_actions_20nuetv.js +3 -0
  281. package/app/.next/server/chunks/_next-internal_server_app_api_bots_[id]_sessions_sync_route_actions_00y6n-f.js +3 -0
  282. package/app/.next/server/chunks/{ssr/_next-internal_server_app_threads_[id]_page_actions_1fte2n3.js → _next-internal_server_app_threads_[id]_route_actions_13zq3u6.js} +2 -2
  283. package/app/.next/server/chunks/lib_0-opbv7._.js +69 -55
  284. package/app/.next/server/chunks/lib_0aejojj._.js +69 -55
  285. package/app/.next/server/chunks/lib_0al5wbc._.js +330 -0
  286. package/app/.next/server/chunks/lib_0i8cm07._.js +3 -0
  287. package/app/.next/server/chunks/lib_0il0ml1._.js +69 -55
  288. package/app/.next/server/chunks/lib_0iujsdg._.js +69 -55
  289. package/app/.next/server/chunks/{lib_15adnlz._.js → lib_15a9ejf._.js} +53 -44
  290. package/app/.next/server/chunks/{lib_1zc7-gl._.js → lib_19pzc33._.js} +53 -44
  291. package/app/.next/server/chunks/lib_1a4ucxv._.js +330 -0
  292. package/app/.next/server/chunks/lib_1dehbst._.js +69 -55
  293. package/app/.next/server/chunks/lib_1z4vnh4._.js +69 -55
  294. package/app/.next/server/chunks/lib_1z7d95m._.js +2181 -0
  295. package/app/.next/server/chunks/lib_service-api-http_ts_0xzqhny._.js +1 -23
  296. package/app/.next/server/chunks/lib_service-api_ts_18eok4w._.js +25 -0
  297. package/app/.next/server/chunks/node_modules_next_1zc5q0a._.js +11 -11
  298. package/app/.next/server/chunks/ssr/1oeh_server_app_agents_[id]_conversations_[conversationId]_page_actions_08lev_i.js +3 -0
  299. package/app/.next/server/chunks/ssr/[root-of-the-server]__06s7ons._.js +3 -0
  300. package/app/.next/server/chunks/ssr/[root-of-the-server]__0r8nmcc._.js +3 -0
  301. package/app/.next/server/chunks/ssr/[root-of-the-server]__19qlmru._.js +3 -0
  302. package/app/.next/server/chunks/ssr/[root-of-the-server]__1dpye-p._.js +3 -0
  303. package/app/.next/server/chunks/ssr/[root-of-the-server]__1fxu3a8._.js +3 -0
  304. package/app/.next/server/chunks/ssr/[root-of-the-server]__1t9ljq3._.js +3 -0
  305. package/app/.next/server/chunks/ssr/_0_u9-u6._.js +3 -0
  306. package/app/.next/server/chunks/ssr/_0g3y1u9._.js +3 -0
  307. package/app/.next/server/chunks/ssr/{node_modules_next_0x3i8za._.js → _0gzxfz3._.js} +2 -2
  308. package/app/.next/server/chunks/ssr/_0rvu-il._.js +131 -0
  309. package/app/.next/server/chunks/ssr/_0u7urta._.js +5 -0
  310. package/app/.next/server/chunks/ssr/_17ngohj._.js +3 -0
  311. package/app/.next/server/chunks/ssr/_1iq-7cn._.js +3 -0
  312. package/app/.next/server/chunks/ssr/_next-internal_server_app_agents_[id]_activity_page_actions_1a_v567.js +3 -0
  313. package/app/.next/server/chunks/ssr/_next-internal_server_app_agents_[id]_conversations_page_actions_1dpbbj-.js +3 -0
  314. package/app/.next/server/chunks/ssr/_next-internal_server_app_agents_[id]_page_actions_0k__y7g.js +3 -0
  315. package/app/.next/server/chunks/ssr/_next-internal_server_app_agents_[id]_sessions_page_actions_1hft42g.js +3 -0
  316. package/app/.next/server/chunks/ssr/_next-internal_server_app_agents_[id]_slack_page_actions_0dmtbj_.js +3 -0
  317. package/app/.next/server/chunks/ssr/app_1-nwnha._.js +3 -0
  318. package/app/.next/server/chunks/ssr/app_agents_[id]_009y8_j._.js +3 -0
  319. package/app/.next/server/chunks/ssr/app_agents_[id]_0sr4fdg._.js +3 -0
  320. package/app/.next/server/chunks/ssr/app_agents_[id]_activity_AgentActivityPage_tsx_042-590._.js +3 -0
  321. package/app/.next/server/chunks/ssr/app_agents_[id]_conversations_page_tsx_15zl_c8._.js +3 -0
  322. package/app/.next/server/chunks/ssr/app_agents_[id]_sessions_page_tsx_0tfup-2._.js +10 -0
  323. package/app/.next/server/chunks/ssr/app_agents_[id]_slack_AgentSlackPage_tsx_20njhs1._.js +3 -0
  324. package/app/.next/server/chunks/ssr/app_bots_[id]_config_page_tsx_1e0uue9._.js +1 -1
  325. package/app/.next/server/chunks/ssr/app_page_tsx_0pxmutw._.js +3 -0
  326. package/app/.next/server/chunks/ssr/lib_0pfn9gs._.js +3 -0
  327. package/app/.next/server/chunks/ssr/lib_agent-registration-ui_ts_1z582mm._.js +3 -0
  328. package/app/.next/server/chunks/ssr/lib_exchange-view_ts_1a4q9ju._.js +3 -0
  329. package/app/.next/server/chunks/ssr/lib_share-view_ts_08psw5o._.js +3 -0
  330. package/app/.next/server/instrumentation.js +1 -1
  331. package/app/.next/server/middleware-build-manifest.js +3 -3
  332. package/app/.next/server/next-font-manifest.js +1 -1
  333. package/app/.next/server/next-font-manifest.json +24 -4
  334. package/app/.next/server/pages/404.html +1 -1
  335. package/app/.next/server/pages/500.html +1 -1
  336. package/app/.next/server/server-reference-manifest.js +1 -1
  337. package/app/.next/server/server-reference-manifest.json +1 -1
  338. package/app/.next/static/chunks/02q7gb87r2ca3.css +3 -0
  339. package/app/.next/static/chunks/06i_6p0-ipitj.js +1 -0
  340. package/app/.next/static/chunks/0cjh4u-f7mlwd.js +1 -0
  341. package/app/.next/static/chunks/1dhk3pcv7yvm6.js +1 -0
  342. package/app/.next/static/chunks/1ka9dp1l6c0ga.js +3 -0
  343. package/app/.next/static/chunks/1ttvnc6qdye8s.js +1 -0
  344. package/app/.next/static/chunks/1ypwptc0fsn4w.js +1 -0
  345. package/app/.next/static/chunks/2-fhbx41zyanc.js +1 -0
  346. package/app/.next/static/chunks/2cc4uzbhs_v23.js +1 -0
  347. package/app/.next/static/chunks/2n1u8a2efnt88.js +1 -0
  348. package/app/.next/static/chunks/34v8aumua0x5n.js +1 -0
  349. package/app/.next/static/chunks/3aasli1i-eiio.js +1 -0
  350. package/app/.next/static/chunks/3p_p4gnr0d2-x.js +1 -0
  351. package/app/.next/static/chunks/3s9t477v-z09o.js +1 -0
  352. package/app/.next/static/chunks/3y5bo6syunkzn.js +8 -0
  353. package/app/BUILD_INFO.json +2 -2
  354. package/app/package.json +1 -1
  355. package/app/server.js +1 -1
  356. package/package.json +1 -1
  357. package/app/.next/server/app/threads/[id]/page/app-paths-manifest.json +0 -3
  358. package/app/.next/server/app/threads/[id]/page_client-reference-manifest.js +0 -3
  359. package/app/.next/server/chunks/[root-of-the-server]__0792yb1._.js +0 -44
  360. package/app/.next/server/chunks/[root-of-the-server]__0d3fjix._.js +0 -3
  361. package/app/.next/server/chunks/[root-of-the-server]__0e_agq4._.js +0 -3
  362. package/app/.next/server/chunks/[root-of-the-server]__0qaiqut._.js +0 -44
  363. package/app/.next/server/chunks/[root-of-the-server]__17mum5-._.js +0 -3
  364. package/app/.next/server/chunks/[root-of-the-server]__1x8phwp._.js +0 -44
  365. package/app/.next/server/chunks/_0qv-4by._.js +0 -3
  366. package/app/.next/server/chunks/lib_0v6lblw._.js +0 -5
  367. package/app/.next/server/chunks/lib_agent-api_ts_0iv52-o._.js +0 -3
  368. package/app/.next/server/chunks/ssr/[root-of-the-server]__1t063pe._.js +0 -3
  369. package/app/.next/server/chunks/ssr/_0_fa0na._.js +0 -3
  370. package/app/.next/server/chunks/ssr/_0a6r_bx._.js +0 -3
  371. package/app/.next/server/chunks/ssr/_0epgorw._.js +0 -3
  372. package/app/.next/server/chunks/ssr/_1cvuhjt._.js +0 -3
  373. package/app/.next/server/chunks/ssr/_1is_iwu._.js +0 -3
  374. package/app/.next/server/chunks/ssr/_1n5mvo5._.js +0 -3
  375. package/app/.next/server/chunks/ssr/_1o94bnv._.js +0 -5
  376. package/app/.next/server/chunks/ssr/app_exchanges_page_tsx_0j-n2a1._.js +0 -3
  377. package/app/.next/static/chunks/1ouuczm-gmvxs.js +0 -1
  378. package/app/.next/static/chunks/1w72fds3-utrx.js +0 -1
  379. package/app/.next/static/chunks/2095-o17ji0fs.css +0 -3
  380. package/app/.next/static/chunks/2q-tgwkalrnms.js +0 -1
  381. package/app/.next/static/chunks/34bv9o9bjkwk0.js +0 -3
  382. package/app/.next/static/chunks/3rwwunh5sdjzg.js +0 -1
  383. package/app/.next/static/chunks/3z3mn526_3fwd.js +0 -1
  384. /package/app/.next/server/app/{threads/[id] → agents/[id]/activity}/page/build-manifest.json +0 -0
  385. /package/app/.next/server/app/{threads/[id] → agents/[id]/activity}/page/react-loadable-manifest.json +0 -0
  386. /package/app/.next/server/app/{threads/[id] → agents/[id]/activity}/page/server-reference-manifest.json +0 -0
  387. /package/app/.next/static/{A9sQnaf9i6YzjHNoPgRfU → nOdd5VXbf23ohQcBBjvHa}/_buildManifest.js +0 -0
  388. /package/app/.next/static/{A9sQnaf9i6YzjHNoPgRfU → nOdd5VXbf23ohQcBBjvHa}/_clientMiddlewareManifest.js +0 -0
  389. /package/app/.next/static/{A9sQnaf9i6YzjHNoPgRfU → nOdd5VXbf23ohQcBBjvHa}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31713,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(22016),s=e.i(57688),r=e.i(18566),l=e.i(64711),i=e.i(87303),o=e.i(89873),c=e.i(68684),d=e.i(74904),u=e.i(33851),m=e.i(44079),h=e.i(52900),p=e.i(68541),f=e.i(15983),g=e.i(10718);function x(e){return String(e).padStart(2,"0")}function y(e){let t=new Date(e);return`${t.getFullYear()}-${x(t.getMonth()+1)}-${x(t.getDate())} ${x(t.getHours())}:${x(t.getMinutes())}`}function v({onClose:e,onDeleted:a}){let s=(0,n.useId)(),[r,l]=(0,n.useState)(null),[i,o]=(0,n.useState)(""),[c,u]=(0,n.useState)(""),[m,h]=(0,n.useState)([]),[p,x]=(0,n.useState)(!1),j=(0,n.useRef)(null),b=(0,n.useRef)(null),w=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=!1;return fetch("/api/bots/manage",{cache:"no-store"}).then(async t=>{let n=await t.json().catch(()=>null);if(!e){if(!t.ok||!Array.isArray(n))return void o("string"==typeof n?.error?n.error:"Could not load agents.");l(n)}}).catch(()=>{e||o("Could not load agents.")}),j.current?.focus(),()=>{e=!0}},[]);let N=c.trim().toLowerCase(),C=(r??[]).filter(e=>e.name.toLowerCase().includes(N)),S=C.filter(e=>!e.blocked);return(0,n.useEffect)(()=>{if(p)return;let t=t=>{"Escape"===t.key&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[p,e]),(0,t.jsxs)("div",{className:"modal-scrim manage-scrim",children:[(0,t.jsxs)("div",{ref:w,className:"manage-card",role:"dialog","aria-modal":"true","aria-labelledby":s,onKeyDown:e=>{if("Tab"!==e.key||!w.current)return;let t=Array.from(w.current.querySelectorAll("button:not(:disabled), input:not(:disabled)"));if(0===t.length)return;let n=t[0],a=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),a.focus()):e.shiftKey||document.activeElement!==a||(e.preventDefault(),n.focus())},children:[(0,t.jsxs)("div",{className:"manage-head",children:[(0,t.jsx)("h2",{id:s,className:"delete-title",children:"Manage agents"}),(0,t.jsx)("button",{type:"button",className:"cancel-btn",onClick:e,children:"Close"})]}),(0,t.jsx)("label",{className:"manage-search-label",htmlFor:`${s}-search`,children:"Filter by name"}),(0,t.jsx)("input",{id:`${s}-search`,ref:j,className:"manage-search",type:"search",value:c,onChange:e=>u(e.target.value),placeholder:"Name contains…"}),(0,t.jsxs)("div",{className:"manage-tools",children:[(0,t.jsx)("button",{type:"button",className:"pin-word",onClick:()=>{h(e=>Array.from(new Set([...e,...S.map(e=>e.id)])))},disabled:0===S.length,children:"Select all shown"}),(0,t.jsx)("button",{type:"button",className:"pin-word",onClick:()=>{h([]),j.current?.focus()},disabled:0===m.length,children:"Clear selection"}),(0,t.jsxs)("span",{className:"manage-count","aria-live":"polite",children:[m.length," selected · ",C.length," shown of ",r?.length??0]})]}),i?(0,t.jsx)("p",{className:"delete-error",role:"alert",children:i}):null,r||i?null:(0,t.jsx)("p",{className:"delete-copy",children:"Loading agents…"}),r?(0,t.jsxs)("ul",{className:"manage-list","aria-label":"Agents",children:[0===C.length?(0,t.jsx)("li",{className:"delete-copy",children:"No agents match."}):null,C.map(e=>{let n=`${s}-row-${e.id}`,a=(0,d.botConnectionLabel)(e)??"Not set";return(0,t.jsxs)("li",{className:e.blocked?"manage-row is-blocked":"manage-row","data-agent-id":e.id,children:[(0,t.jsx)("input",{id:n,type:"checkbox",checked:m.includes(e.id),disabled:!!e.blocked,onChange:()=>{var t;return t=e.id,void h(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},"aria-describedby":e.blocked?`${n}-reason`:void 0}),(0,t.jsxs)("div",{className:"manage-copy",children:[(0,t.jsxs)("label",{htmlFor:n,className:"manage-name",children:[e.name,e.hidden?(0,t.jsx)("span",{className:"manage-tag",children:"Hidden"}):null]}),(0,t.jsxs)("dl",{className:"manage-meta",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Agent"}),(0,t.jsx)("dd",{children:(0,d.botAgentLabel)(e)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Connection"}),(0,t.jsx)("dd",{children:a})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Source"}),(0,t.jsx)("dd",{children:e.source_provider||"Created here"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Created"}),(0,t.jsx)("dd",{children:y(e.created_at)})]}),e.last_activity?(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Last activity"}),(0,t.jsx)("dd",{children:y(e.last_activity)})]}):null]}),e.blocked?(0,t.jsx)("p",{id:`${n}-reason`,className:"manage-reason",children:(0,g.blockedReasonCopy)(e.blocked)}):null]})]},e.id)})]}):null,(0,t.jsxs)("div",{className:"form-actions manage-actions",children:[(0,t.jsx)("button",{type:"button",className:"cancel-btn",onClick:e,children:"Cancel"}),(0,t.jsxs)("button",{ref:b,type:"button",className:"delete-btn",disabled:0===m.length,onClick:()=>x(!0),children:["Delete selected",m.length>0?` (${m.length})`:""]})]})]}),p?(0,t.jsx)(f.default,{ids:m,onCancel:()=>{x(!1),requestAnimationFrame(()=>b.current?.focus())},onDeleted:a}):null]})}var j=e.i(71836);function b({view:e,agentName:n}){if("loading"===e)return(0,t.jsx)("p",{className:"thread-note",role:"status",children:"Loading messages…"});if("error"===e)return(0,t.jsx)("p",{className:"thread-note thread-note-error",role:"alert",children:"Couldn’t load messages. Trying again…"});if("empty"===e){let e={title:`No messages with ${n} yet.`,hint:"Say something below to start the conversation."};return(0,t.jsxs)("div",{className:"thread-empty","data-thread-empty":"",children:[(0,t.jsx)("p",{className:"thread-empty-title",children:e.title}),(0,t.jsx)("p",{className:"thread-empty-hint",children:e.hint})]})}return null}var w=e.i(46986),N=e.i(96594),C=e.i(15366),S=e.i(54423),k=e.i(13255),R=e.i(63352),A=e.i(3136);function D(e,t,n){let a=t?`/agents/${encodeURIComponent(e)}/conversations/${encodeURIComponent(t)}`:`/agents/${encodeURIComponent(e)}/conversations`;return n?`${a}?exchange=${encodeURIComponent(n)}`:a}function I(e){return!!e&&"chief-of-staff"===e.name.toLowerCase()}function E(e){return I(e)?0:e.pinned?1:2}function $(e){let t=e;for(let e=0;e<2;e++){let e=t.replace(/^\s*\[Message from [^\]]+\]\s*(?:\r?\n)?/,"");if(e===t)break;t=e}return t.replace(/^\s+/,"")}function T(e){let t=e;for(let e=0;e<4;e++){let e=t.replace(/^\s*\[(?:Message from|From) [^\]]+\]\s*(?:\r?\n)?/,"");if(e===t)break;t=e}return t}function L({message:e,conversationId:a,status:s,onDone:r}){let l=(0,c.parseDraft)(T(e.content)),[i,o]=(0,n.useState)(l?.recipient??""),[d,u]=(0,n.useState)(l?.body??""),[m,h]=(0,n.useState)(!1),[p,f]=(0,n.useState)("open"!==s),g=(0,n.useRef)("open"!==s);if(!l)return null;let x="open"!==s||p,y=x?l.recipient:i,v=x?l.body:d,j=async t=>{if(!x&&!g.current&&!m&&("send"!==t||""!==i.trim())){g.current=!0,f(!0),h(!0);try{(await fetch(`/api/conversations/${a}/draft`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messageId:e.id,action:t,recipient:i,body:d})})).ok||(g.current=!1,f(!1))}finally{h(!1),r()}}};return(0,t.jsxs)("div",{className:"draft-card",children:[(0,t.jsx)("div",{className:"draft-title",children:(0,c.draftTitle)(l.channel)}),(0,t.jsx)("input",{type:"text","aria-label":"Recipient",value:y,readOnly:x,disabled:m,onChange:e=>{x||o(e.target.value)}}),(0,t.jsx)("textarea",{rows:3,"aria-label":"Draft body",value:v,readOnly:x,disabled:m,onChange:e=>{x||u(e.target.value)}}),"sent"===s?(0,t.jsx)("span",{className:"draft-mark",children:"Sent"}):null,"discarded"===s?(0,t.jsx)("span",{className:"draft-mark",children:"Discarded"}):null,"discarded"!==s?(0,t.jsx)("button",{type:"button",className:"approve-control",disabled:m,onClick:()=>{j("send")},children:"Send"}):null,"open"===s?(0,t.jsx)("button",{type:"button",className:"approve-control",style:{marginLeft:8},disabled:m,onClick:()=>{j("discard")},children:"Discard"}):null]})}function F({message:e,conversationId:a,status:s,onDone:r}){let l=(0,c.parseApprovalCode)(e.content),[i,o]=(0,n.useState)(!1),d=(0,n.useRef)("pending"!==s);if(!l)return null;let u=async t=>{if(!d.current&&!i){d.current=!0,o(!0);try{(await fetch(`/api/conversations/${a}/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:l,messageId:e.id})})).ok||(d.current=!1)}finally{o(!1),r()}}};return"pending"!==s?(0,t.jsx)("span",{className:"draft-mark",children:"approved"===s?"Approved":"Denied"}):(0,t.jsxs)("span",{className:"draft-mark",children:[(0,t.jsx)("button",{type:"button",className:"approve-control",disabled:i,onClick:()=>{u("approve")},children:"Approve"}),(0,t.jsx)("button",{type:"button",className:"approve-control",style:{marginLeft:8},disabled:i,onClick:()=>{u("deny")},children:"Deny"})]})}function _({names:e}){return 0===e.length?null:(0,t.jsx)(t.Fragment,{children:e.map(e=>(0,t.jsxs)("span",{children:[(0,t.jsx)("br",{}),(0,t.jsxs)("a",{className:"file-control",href:`/api/files/${encodeURIComponent(e)}`,download:e,children:["Download ",e]})]},e))})}function P({anchorRef:e,onClose:a,onCreated:s}){let[r,l]=(0,n.useState)(""),[i,o]=(0,n.useState)(u.DEFAULT_REGISTRATION_FORM),[c,p]=(0,n.useState)(""),[f,g]=(0,n.useState)(!1),[x,y]=(0,n.useState)(!1),[v,b]=(0,n.useState)(null),w=(0,h.useRuntimeConnections)(),[N,C]=(0,n.useState)(null),S=(0,n.useRef)(null),k=(0,n.useRef)(null),D=(0,n.useRef)(null);(0,n.useLayoutEffect)(()=>{let t=()=>{let t=e.current?.getBoundingClientRect();C((0,j.newAgentDialogPlacement)(t?{left:t.left,bottom:t.bottom}:null,{width:window.innerWidth,height:window.innerHeight}))};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),(0,n.useEffect)(()=>{k.current?.focus()},[]),(0,n.useEffect)(()=>{v&&D.current?.focus()},[v]),(0,n.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(e.stopPropagation(),a())};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[a]);let I=(0,u.registrationFormView)(i,w.state),E=async e=>{let t;if(e.preventDefault(),I.submitDisabled||x)return;if((0,u.hasRegistrationErrors)(I)){g(!0),p("Fix the highlighted fields.");return}p(""),y(!0);try{t=await fetch("/api/bots",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,u.registrationCreateBody)(r,i))})}finally{y(!1)}let n=await t.json().catch(()=>null);if(!t.ok)return void p("string"==typeof n?.error&&n.error?n.error:"Failed to create agent");let a=n?.session_sync;if(!a||"string"!=typeof a.outcome)return void s();let l="string"==typeof n?.agent?(0,A.agentLabel)(n.agent):"Sessions";b({line:(0,R.registrationSessionSyncCopy)(a,l),agentName:"string"==typeof n?.name?n.name:r})};return(0,t.jsx)("div",{className:"modal-scrim new-agent-scrim",onKeyDown:e=>{if("Tab"!==e.key||!S.current)return;let t=Array.from(S.current.querySelectorAll(j.DIALOG_FOCUSABLE)),n=(0,j.wrapFocusTarget)(t,document.activeElement,e.shiftKey);n&&(e.preventDefault(),n.focus())},children:(0,t.jsxs)("div",{ref:S,className:"form-card new-agent-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"new-agent-title",style:N??void 0,children:[(0,t.jsx)("div",{className:"kind-row",children:(0,t.jsx)("h2",{id:"new-agent-title",className:"kind-word new-agent-title",children:"New Agent"})}),v?(0,t.jsxs)("div",{className:"bot-form",children:[(0,t.jsx)("div",{className:"new-agent-body",children:(0,t.jsxs)("p",{role:"status",children:[v.agentName," created. ",v.line]})}),(0,t.jsx)("div",{className:"form-actions",children:(0,t.jsx)("button",{ref:D,type:"button",className:"create-btn",onClick:s,children:"Done"})})]}):(0,t.jsxs)("form",{onSubmit:E,className:"bot-form",children:[(0,t.jsxs)("div",{className:"new-agent-body",children:[(0,t.jsx)("label",{htmlFor:"bot-name",children:"Name"}),(0,t.jsx)("input",{ref:k,id:"bot-name",type:"text",value:r,onChange:e=>l(e.target.value),required:!0}),(0,t.jsx)(m.RegistrationFields,{idPrefix:"bot",variant:"modal",form:i,onChange:e=>{p(""),o(t=>({...t,...e}))},view:I,showErrors:f,connections:w.state,onRetryConnections:w.retry,onAddConnection:w.add,workspacePlaceholder:d.WORKSPACE_TEMPLATE,workspaceHint:d.NEW_AGENT_WORKSPACE_HINT}),c?(0,t.jsx)("p",{className:"form-error",role:"alert",children:c}):null]}),(0,t.jsxs)("div",{className:"form-actions",children:[(0,t.jsx)("button",{type:"button",className:"cancel-btn",onClick:a,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",className:"create-btn",disabled:I.submitDisabled||x,children:x?"Creating…":"Create"})]})]})]})})}e.s(["default",0,function(){var e,u,m,h;let f=(0,r.useRouter)(),[x,y]=(0,n.useState)([]),[j,R]=(0,n.useState)(!1),[A,O]=(0,n.useState)(null),U=(0,n.useRef)(!1),B=(0,n.useRef)(0),[M,H]=(0,n.useState)([]),[K,q]=(0,n.useState)([]),[W,J]=(0,n.useState)([]),z=(0,n.useRef)(null),[G,V]=(0,n.useState)(null),Z=(0,n.useRef)(null),[Y,Q]=(0,n.useState)(""),[X,ee]=(0,n.useState)(""),[et,en]=(0,n.useState)(!1),[ea,es]=(0,n.useState)([]),[er,el]=(0,n.useState)(""),ei=(0,n.useRef)(null),eo=(0,n.useRef)(null),[ec,ed]=(0,n.useState)(!1),eu=(0,n.useRef)(null),[em,eh]=(0,n.useState)(!1),[ep,ef]=(0,n.useState)(!1),[eg,ex]=(0,n.useState)({}),ey=(0,n.useRef)({}),[ev,ej]=(0,n.useState)(!1),eb=(0,n.useRef)(null),[ew,eN]=(0,n.useState)(""),eC=(0,n.useRef)(null),eS=(0,n.useRef)(null),ek=(0,n.useRef)(null),eR=(0,n.useRef)(null),eA=(0,n.useRef)(null),eD=(0,n.useRef)(null),eI=(0,n.useRef)(null),[eE,e$]=(0,n.useState)([]),[eT,eL]=(0,n.useState)({serverNow:0,fetchedAt:0}),[eF,e_]=(0,n.useState)(()=>Date.now()),eP=(0,n.useRef)({}),eO=(0,n.useRef)(!1),[eU,eB]=(0,n.useState)(!1);(0,n.useEffect)(()=>{eO.current||0===x.length||(eO.current=!0,eB(!0))},[x.length]),(0,n.useEffect)(()=>{let e=(0,p.importedBotId)(window.location.search);if(e)return void window.location.replace((0,p.importedConfigPath)(e));let t=new URLSearchParams(window.location.search);"1"===t.get("new")?(U.current=!0,window.setTimeout(()=>ed(!0),0),window.history.replaceState(null,"","/")):"1"===t.get("manage")&&(U.current=!0,window.setTimeout(()=>ej(!0),0),window.history.replaceState(null,"","/"));let n=Number(t.get("deleted"));n>0&&(B.current=n,window.history.replaceState(null,"","/"));let a=t.get("agent");if(a){if(U.current=!0,"1"===t.get("sessions")){let e=t.get("session"),n=e?`/agents/${encodeURIComponent(a)}/sessions?session=${encodeURIComponent(e)}`:`/agents/${encodeURIComponent(a)}/sessions`;window.location.replace(n);return}let e=t.get("exchange");fetch(`/api/conversations?botId=${encodeURIComponent(a)}`,{cache:"no-store"}).then(async e=>e.ok?e.json():null).then(t=>{window.location.replace(D(a,t?.id??null,e))}).catch(()=>window.location.replace(D(a,null,e)))}eq().then(()=>{n>0&&eN((0,g.deletedStatusLine)(n))});let s=setInterval(eq,2e3),r=setInterval(()=>e_(Date.now()),1e3);return()=>{clearInterval(s),clearInterval(r)}},[]),(0,n.useEffect)(()=>{if(U.current||0===x.length||A)return;let e=[...x].filter(e=>!e.hidden).sort((e,t)=>E(e)-E(t))[0]||x[0];U.current=!0;let t=B.current;f.replace(`/agents/${encodeURIComponent(e.id)}${t>0?`?deleted=${t}`:""}`)},[x,A]),(0,n.useEffect)(()=>{if(Z.current=A?.id??null,A)return eW(),eI.current&&clearInterval(eI.current),eI.current=setInterval(eW,2e3),()=>{eI.current&&clearInterval(eI.current)}},[A]);let eM=A?x.find(e=>e.id===A.details.id)??A.details:void 0,eH=!!A&&I(eM),eK=eH?function(e){for(let t=e.length-1;t>=0;t--){let n=(0,l.parseRun)(e[t].content);if(n){if("stopped"===n.state)return null;return n.page||n.html||null}}return null}(M):null;async function eq(){let e=await fetch("/api/bots",{cache:"no-store"}),t=await e.json(),n=Date.parse(e.headers.get("date")||"");eL({serverNow:Number.isNaN(n)?Date.now():n,fetchedAt:Date.now()}),Array.isArray(t)&&(y(t),R(!0))}async function eW(){if(!A)return;let e=A.id,t=null,n=!1,a=fetch(`/api/conversations/${e}`).then(async e=>{let t=await e.json();return e.ok&&Array.isArray(t?.events)?t.events:null}).catch(()=>null),s=fetch(`/api/exchanges?conversation=${encodeURIComponent(e)}`,{cache:"no-store"}).then(async e=>{let t=await e.json();return e.ok&&Array.isArray(t?.exchanges)?t.exchanges:null}).catch(()=>null);try{let a=await fetch(`/api/conversations/${e}/messages`);t=await a.json(),n=a.ok&&Array.isArray(t)}catch{n=!1}let r=await a,l=await s;Z.current===e&&(n&&H(t),r&&q((0,S.wakeNotices)(r)),l&&J(l),V({conversationId:e,status:n?"ready":"error"}))}(0,n.useLayoutEffect)(()=>{let e=ek.current?.parentElement;if(!e)return;let t=eR.current,n=eA.current,a=eD.current;if(eH&&t&&n&&a){let s=s=>{let r=Math.ceil(t.getBoundingClientRect().height);n.style.height=r+16+s+"px";let l=n.getBoundingClientRect().top-e.getBoundingClientRect().top;a.style.height=Math.max(0,e.clientHeight-l)+"px";let i=t.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;e.scrollTop=Math.max(0,i-l)};s(0);let r=n.nextElementSibling,l=t.getBoundingClientRect().bottom,i=r?r.getBoundingClientRect().top:n.getBoundingClientRect().bottom;l>=i&&s(Math.max(16,Math.ceil(l-i)));return}a&&(a.style.height="0px"),n&&(n.style.height=""),e.scrollTop=e.scrollHeight},[M,eH]),(0,n.useEffect)(()=>{let e=z.current;if(!e)return;let t=document.getElementById(`exchange-${e}`);t&&(z.current=null,t.scrollIntoView({block:"center"}),t.focus({preventScroll:!0}))},[W]),(0,n.useLayoutEffect)(()=>{e$(e=>{if(0===e.length)return e;let t=e.filter(e=>{let t=eP.current[e]??0;return M.some(n=>"bot"===n.sender_type&&n.sender_id===e&&n.created_at>t&&!/^\[(mcp|tool call|tool result)\]/i.test(n.content.trim()))});if(0===t.length)return e;for(let e of t)delete eP.current[e];return e.filter(e=>!t.includes(e))})},[M]);let eJ=async e=>{A&&(await fetch(`/api/conversations/${A.id}/messages/${e}/stop`,{method:"POST"}),await eW())},ez=async()=>{A&&(await fetch(`/api/conversations/${A.id}/stop`,{method:"POST"}),await eW())},eG=async(e,t)=>{if(eg[e.id])return void ex(t=>{let n={...t};return delete n[e.id],n});if(ey.current[e.id])return;let n=M.findIndex(t=>t.id===e.id),a=x.find(e=>e.name===t),s=M.slice(n+1).find(e=>"bot"===e.sender_type&&(a?e.sender_id===a.id:e.sender_name===t));if(s){ey.current[e.id]=!0;try{let t=await fetch(`/api/messages/${e.id}/between?other=${encodeURIComponent(s.id)}`),n=await t.json().catch(()=>null);t.ok&&Array.isArray(n)&&n.length>0&&ex(t=>({...t,[e.id]:n}))}finally{delete ey.current[e.id]}}},eV=async()=>{if(!A)return;let e=eC.current?.files?.[0];if(!e)return;let t=await new Promise((t,n)=>{let a=new FileReader;a.onload=()=>t(String(a.result||"")),a.onerror=()=>n(a.error),a.readAsDataURL(e)});if(!t.startsWith("data:image/"))return;let n=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:A.details.id,avatar:t})});if(!n.ok)return;let a=await n.json();y(e=>e.map(e=>e.id===a.id?{...e,avatar:a.avatar}:e)),O({...A,details:{...A.details,avatar:a.avatar}})},eZ=async e=>{if(!e||!A)return;let t=await new Promise((t,n)=>{let a=new FileReader;a.onload=()=>t(String(a.result||"")),a.onerror=()=>n(a.error),a.readAsDataURL(e)});if(!t.startsWith("data:image/"))return;let n=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:A.details.id,avatar:t})});if(!n.ok)return;let a=await n.json();y(e=>e.map(e=>e.id===a.id?{...e,avatar:a.avatar}:e)),O({...A,details:{...A.details,avatar:a.avatar}})},eY=async()=>{if(!A)return;let e=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:A.details.id,avatar:null})});if(!e.ok)return;let t=await e.json();y(e=>e.map(e=>e.id===t.id?{...e,avatar:t.avatar||""}:e)),O({...A,details:{...A.details,avatar:t.avatar||""}})},eQ=j&&0===x.length,eX=async e=>{let t=e.map(e=>e.id);ej(!1),eN((0,g.deletedStatusLine)(t.length)),requestAnimationFrame(()=>eb.current?.focus()),y(e=>e.filter(e=>!t.includes(e.id))),A&&t.includes(A.details.id)&&(O(null),H([]),q([])),await eq()},e0=et?x.filter(e=>e.name.toLowerCase().includes(X.toLowerCase())):[],e1=e=>{let t=ei.current,n=t?t.selectionStart:Y.length,a=Y.slice(0,n).lastIndexOf("@");if(a<0)return;Q(Y.slice(0,a)+"@"+e+" "+Y.slice(n)),en(!1);let s=a+e.length+2;requestAnimationFrame(()=>{t?.focus(),t?.setSelectionRange(s,s)})},e6=e=>{if(0===e.length)return;let t=6-ea.length;e.length>t?el("Up to six attachments."):el("");let n=e.slice(0,Math.max(t,0));0!==n.length&&es(e=>[...e,...n.map((t,n)=>({id:t.name+"-"+e.length+"-"+n+"-"+t.size,name:t.name}))])},e4=async()=>{let e=ea.map(e=>e.name),t=Y.trim();if(!t&&0===e.length||!A)return;let n=[t,...e].filter(e=>e.length>0).join("\n"),a=[A.details.id],s=M.reduce((e,t)=>Math.max(e,t.created_at||0),0);for(let e of a)eP.current[e]=s;e$(e=>Array.from(new Set([...e,...a])));let r=[...x].sort((e,t)=>t.name.length-e.name.length).find(e=>(function(e,t){let n="@"+t,a=0;for(;a<e.length;){let t=e.indexOf(n,a);if(t<0)break;let s=e[t+n.length];if(!s||/[\s.,!?:;]/.test(s))return!0;a=t+n.length}return!1})(n,e.name));if(!(await fetch(`/api/conversations/${A.id}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,mentionedBotId:r?.id,idempotencyKey:crypto.randomUUID()})})).ok){for(let e of a)delete eP.current[e];e$(e=>e.filter(e=>!a.includes(e)))}Q(""),es([]),el(""),en(!1),eW()},e3=A?(e=A.id,M.length>0?"messages":G&&G.conversationId===e&&"loading"!==G.status?"error"===G.status?"error":"empty":"loading"):"loading",e2=A?(0,t.jsx)(b,{view:e3,agentName:A.details.name}):null,e8=(A?.details.title||"").trim(),e9=A?.details.color,e5=new Set,e7=e=>(0,t.jsx)("div",{className:"msg-status",children:(0,t.jsx)(C.default,{notice:e,onDone:()=>{eW()}})},e.eventId),te=new Set,tt=e=>(0,t.jsx)("div",{className:"msg-status",children:(0,t.jsx)(k.default,{summary:e,onChanged:()=>{eW()}})},`exchange-${e.id}`),tn=e=>{let t=W.filter(t=>!te.has(t.id)&&t.created_at<e).sort((e,t)=>e.created_at-t.created_at||(e.id<t.id?-1:1));return t.forEach(e=>te.add(e.id)),t.map(tt)},ta=()=>{ed(!1),requestAnimationFrame(()=>eu.current?.focus())};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"field",inert:ec,children:[(0,t.jsx)(o.default,{agents:x,activeAgentId:A?.details.id,workingIds:eE,beatClock:eT,now:eF,status:ew,logoDrop:eU,onAgentsChange:e=>y(e),onNew:()=>ed(!0),onManage:()=>{eN(""),ej(!0)},onDeleted:e=>{eX(e)},newButtonRef:eu,manageButtonRef:eb}),(0,t.jsx)("section",{className:"pane",children:A?(0,t.jsxs)("div",{className:"thread",children:[(0,t.jsxs)("div",{className:"thread-bar",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("button",{type:"button",className:"thread-name",style:e9?{color:e9}:void 0,onClick:()=>{eh(!0),ef(!1)},children:A.details.name}),e8?(0,t.jsx)("div",{className:"thread-role",children:e8}):null,(0,t.jsx)("div",{className:"thread-role",children:eE.includes(A.details.id)?"Working":"Not working"}),(0,t.jsx)("div",{className:"thread-role",children:(u=(eM??A.details).last_seen,m=eT.serverNow,h=eT.fetchedAt,u&&m?eF-h+(m-u)>15e3?"Stopped":"Heartbeat "+new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles",hour:"numeric",minute:"2-digit",second:"2-digit"}).format(new Date(u)):"Stopped")}),em?(0,t.jsx)("button",{type:"button",className:"avatar-pic",onClick:()=>ef(!0),"aria-label":"Picture",children:A.details.avatar?(0,t.jsx)("img",{src:A.details.avatar,alt:""}):(0,t.jsx)(i.default,{bot:A.details,size:46})}):null]}),(0,t.jsxs)("div",{style:{marginLeft:"auto",display:"flex",gap:16,alignItems:"flex-start"},children:[(0,t.jsx)(a.default,{href:`/bots/${A.details.id}/config`,className:"attach-word",style:{textDecoration:"none"},children:"Config"}),(0,t.jsx)(a.default,{href:`/agents/${encodeURIComponent(A.details.id)}/sessions`,className:"attach-word",style:{textDecoration:"none"},children:"Sessions"}),(0,t.jsx)("button",{type:"button",className:"attach-word",title:"Stop delegated turns in this thread",onClick:()=>{ez()},children:"Stop"})]})]}),ep?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"avatar-step avatar-desk",children:[(0,t.jsx)("span",{className:"kind-word",children:"Agent"}),(0,t.jsx)("button",{type:"button",className:"kind-word",children:"Generate"}),(0,t.jsxs)("label",{className:"kind-word",children:["Upload",(0,t.jsx)("input",{ref:eC,type:"file",accept:"image/*,.svg"})]}),(0,t.jsx)("button",{type:"button",className:"create-btn",onClick:eV,children:"Set avatar"})]}),(0,t.jsxs)("div",{className:"avatar-step avatar-phone",children:[(0,t.jsx)("button",{type:"button",className:"kind-word",onClick:()=>eS.current?.click(),children:"Gallery"}),(0,t.jsx)("button",{type:"button",className:"kind-word",children:"Generate"}),(0,t.jsx)("button",{type:"button",className:"kind-word",onClick:eY,children:"Remove Photo"}),(0,t.jsx)("input",{ref:eS,type:"file",accept:"image/*,.svg",onChange:e=>{let t=e.target.files?.[0];e.target.value="",eZ(t)}})]})]}):null,(0,t.jsxs)("div",{className:"messages-wrap",children:[(0,t.jsxs)("div",{className:"messages",children:[eH?null:e2,M.map(e=>{var a;let s,r=K.filter(t=>!e5.has(t.eventId)&&t.createdAt<e.created_at);r.forEach(e=>e5.add(e.eventId));let i=tn(e.created_at),o="user"===e.sender_type,u=o?null:(0,N.classifyRuntimeFailure)(T(e.content));if(u)return(0,t.jsxs)(n.Fragment,{children:[r.map(e7),i,(0,t.jsx)("div",{className:"msg-status",children:(0,t.jsx)(w.default,{failure:u})})]},e.id);let m=(a=T(e.content),s=[],{text:$(a.replace(/data:image\/[a-zA-Z0-9.+-]+;base64,[A-Za-z0-9+/=\s]+/g,e=>(s.push(e.replace(/\s/g,"")),""))),images:s}),h=m.images.map(e=>(0,t.jsx)("img",{src:e,alt:"",style:{display:"block",width:64,height:64}},e.slice(0,48))),p=o?void 0:A.details.color,f=o?null:(0,l.parseRun)(e.content),g=o||f?null:(0,c.parseDraft)(T(e.content)),x=o||f?null:(0,c.parseApprovalCode)(e.content),y=o||f?[]:(0,c.parseFileNames)(e.content),v=o||f?null:(0,c.parseHandoff)(m.text),j=e.draftStatus??(g?"open":null),b=e.approvalStatus??(x?"pending":null);return(0,t.jsxs)(n.Fragment,{children:[r.map(e7),i,(0,t.jsxs)("div",{className:o?"msg-you":"msg-bot",ref:f&&"running"===f.state?eR:void 0,children:[(0,t.jsx)("div",{className:o?"msg-name msg-name-you":"msg-name",style:p?{color:p}:void 0,children:o?"You":e.sender_name||A.details.name}),f?(0,t.jsxs)("div",{className:"msg-body",children:[(0,l.runLine)(f),"running"===f.state?(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("button",{type:"button",className:"attach-word",style:{font:"inherit"},onClick:t=>{t.preventDefault(),t.stopPropagation(),eJ(e.id)},children:"Stop"})]}):null]}):g&&j?(0,t.jsx)("div",{className:"msg-body",children:(0,t.jsx)(L,{message:e,conversationId:A.id,status:j,onDone:()=>{eW()}},e.id+j)}):(0,t.jsxs)("div",{className:"msg-body",onClick:v?()=>{eG(e,v)}:void 0,title:v?"Show the replies between this handoff and the reply":void 0,style:v?{cursor:"pointer"}:void 0,children:[function(e,n){let a=String(e??"").split("\n");if(!a.some(e=>null!==(0,d.agentEventDisplay)(e)))return e;let s=[];return a.forEach((e,a)=>{a>0&&s.push((0,t.jsx)("br",{},n+"-br-"+a));let r=(0,d.agentEventDisplay)(e);r?s.push((0,t.jsxs)("span",{className:"agent-event",children:[(0,t.jsx)("span",{className:"agent-event-label",children:r.label}),r.detail?" "+r.detail:""]},n+"-"+a)):s.push((0,t.jsx)("span",{children:e},n+"-"+a))}),s}(m.text,e.id),h,x&&b?(0,t.jsx)(F,{message:e,conversationId:A.id,status:b,onDone:()=>{eW()}},e.id+b):null,(0,t.jsx)(_,{names:y})]}),eg[e.id]?(0,t.jsx)("div",{className:"msg-body",children:eg[e.id].map(e=>(0,t.jsx)("div",{children:(e.sender_name||"Agent")+": "+$(e.content)},e.id))}):null]})]},e.id)}),K.filter(e=>!e5.has(e.eventId)).map(e7),tn(1/0),(0,t.jsx)("div",{ref:eD}),(0,t.jsx)("div",{ref:ek})]}),eH?(0,t.jsxs)("div",{className:"computer-float",children:[(0,t.jsxs)("div",{className:"computer-top",children:[(0,t.jsxs)("span",{className:"computer-lights","aria-hidden":"true",children:[(0,t.jsx)("span",{className:"computer-light computer-light-red"}),(0,t.jsx)("span",{className:"computer-light computer-light-yellow"}),(0,t.jsx)("span",{className:"computer-light computer-light-green"})]}),(0,t.jsxs)("span",{className:"computer-teach",children:[(0,t.jsxs)("span",{className:"computer-teach-pill",children:[(0,t.jsx)("span",{className:"computer-teach-mark","aria-hidden":"true"}),"Teach a task"]}),(0,t.jsx)("span",{className:"computer-expand","aria-hidden":"true",children:(0,t.jsx)("svg",{viewBox:"0 0 16 16",width:"14",height:"14",children:(0,t.jsx)("path",{d:"M9.2 2.6H13.4V6.8M6.8 13.4H2.6V9.2M13.1 2.9L9.4 6.6M2.9 13.1L6.6 9.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),(0,t.jsx)("div",{className:"messages"===e3?"computer-band":"computer-band computer-band-note",ref:eA,children:e2}),(0,t.jsxs)("div",{className:"computer-desk",children:[eK?(0,t.jsx)("iframe",{className:"computer-page",sandbox:"",srcDoc:eK,tabIndex:-1}):null,(0,t.jsxs)("div",{className:"computer-dock",children:[(0,t.jsx)("img",{src:"/computer/dock-chrome.png",alt:""}),(0,t.jsx)("img",{src:"/computer/dock-gray.png",alt:""}),(0,t.jsx)("img",{src:"/computer/dock-terminal.png",alt:""})]})]})]}):null]}),(0,t.jsxs)("div",{className:"composer",onPaste:e=>{let t=[],n=e.clipboardData.files;if(n&&n.length>0)t.push(...Array.from(n));else for(let n of Array.from(e.clipboardData.items)){if("file"!==n.kind)continue;let e=n.getAsFile();e&&t.push(e)}0!==t.length&&(e.preventDefault(),e6(t))},children:[et&&e0.length>0?(0,t.jsx)("div",{className:"mention-list",children:e0.map(e=>(0,t.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),e1(e.name)},children:["@",e.name]},e.id))}):null,(0,t.jsxs)("div",{className:"composer-box",children:[er?(0,t.jsx)("p",{className:"attach-error",children:er}):null,ea.length>0?(0,t.jsx)("div",{className:"attach-names",children:ea.map(e=>(0,t.jsx)("span",{children:e.name},e.id))}):null,(0,t.jsx)("textarea",{ref:ei,rows:2,value:Y,onChange:e=>{var t,n;let a,s;Q(e.target.value),t=e.target.value,n=e.target.selectionStart,(s=(a=t.slice(0,n)).lastIndexOf("@"))<0||/\s/.test(a.slice(s+1))?en(!1):(ee(a.slice(s+1)),en(!0))},onKeyDown:e=>{if("Enter"===e.key&&!e.shiftKey){if(e.preventDefault(),et&&e0.length>0)return void e1(e0[0].name);e4()}},placeholder:"Say something"})]}),(0,t.jsx)("input",{ref:eo,className:"attach-input",type:"file",multiple:!0,onChange:e=>{e6(Array.from(e.target.files||[])),e.target.value=""}}),(0,t.jsx)("button",{type:"button",className:"attach-word",onClick:()=>eo.current?.click(),children:"Attach"}),(0,t.jsx)("button",{type:"button",className:"send-btn",onClick:e4,children:"Send"})]})]}):eQ?(0,t.jsxs)("div",{className:"welcome",children:[(0,t.jsx)(s.default,{className:"welcome-mark",src:"/brand/botmancers-logo-outline-256.png",alt:"Botmancers",width:144,height:144,priority:!0}),(0,t.jsx)("p",{className:"empty-line",children:"Pick someone to talk to."})]}):(0,t.jsx)("p",{className:"empty-line",children:"Pick someone to talk to."})}),ev?(0,t.jsx)(v,{onClose:()=>{ej(!1),requestAnimationFrame(()=>eb.current?.focus())},onDeleted:e=>{eX(e)}}):null]}),ec&&(0,t.jsx)(P,{anchorRef:eu,onClose:ta,onCreated:()=>{eq(),ta()}})]})}],31713)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51118,e=>{"use strict";var n=e.i(43476),s=e.i(71645),t=e.i(22016),a=e.i(70925);e.s(["default",0,function(){let{id:e,overview:o,loading:i,error:r,notFound:c}=(0,a.useAgentOverview)(),[l,d]=(0,s.useState)(null),[h,v]=(0,s.useState)(null),[u,m]=(0,s.useState)(""),[g,p]=(0,s.useState)(""),[x,j]=(0,s.useState)(""),[y,b]=(0,s.useState)(!1),[f,N]=(0,s.useState)(0),w=(0,s.useCallback)(async(n,s)=>{if(e){s&&b(!0);try{let t=new URLSearchParams({limit:"30"});g&&t.set("q",g),n&&t.set("cursor",n);let a=await fetch(`/api/bots/${encodeURIComponent(e)}/conversations?${t}`,{cache:"no-store"}),o=await a.json().catch(()=>null);if(!a.ok||!o||!Array.isArray(o.conversations))throw Error("load");d(e=>s&&e?[...e,...o.conversations]:o.conversations),v(o.next_cursor),j("")}catch{j("Could not load conversations.")}finally{b(!1)}}},[g,e]);return((0,s.useEffect)(()=>{let e=window.setTimeout(()=>{d(null),w(null,!1)},0);return()=>window.clearTimeout(e)},[w,f]),i)?(0,n.jsx)("div",{className:"agent-state",role:"status",children:"Loading Agent conversations…"}):c?(0,n.jsxs)("div",{className:"agent-state",children:[(0,n.jsx)("h2",{children:"Agent not found"}),(0,n.jsx)(t.default,{href:"/",children:"Choose an Agent"})]}):r||!o?(0,n.jsx)("div",{className:"agent-state",role:"alert",children:"This Agent’s conversations are unavailable."}):(0,n.jsxs)("div",{className:"conversation-index","data-agent-conversations":!0,children:[(0,n.jsxs)("header",{className:"conversation-index-head",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"agent-eyebrow",children:"Conversations"}),(0,n.jsx)("h2",{children:"Durable history"}),(0,n.jsxs)("p",{children:["Direct messages, group rooms, Agent handoffs, and connected-service conversations involving ",o.agent.name,"."]})]}),o.conversation?(0,n.jsxs)(t.default,{className:"agent-primary-action",href:`/agents/${encodeURIComponent(e)}/conversations/${encodeURIComponent(o.conversation.id)}`,children:["Message ",o.agent.name]}):null]}),(0,n.jsxs)("form",{className:"conversation-search",role:"search",onSubmit:e=>{e.preventDefault(),p(u.trim())},children:[(0,n.jsx)("label",{htmlFor:"conversation-query",children:"Search conversations"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("input",{id:"conversation-query",value:u,onChange:e=>m(e.target.value),placeholder:"Participant, origin, or type"}),(0,n.jsx)("button",{type:"submit",children:"Search"})]})]}),null!==l||x?null:(0,n.jsx)("p",{className:"conversation-state",role:"status","data-conversation-state":"loading",children:"Loading conversations…"}),x?(0,n.jsxs)("div",{className:"conversation-state",role:"alert","data-conversation-state":"error",children:[(0,n.jsx)("p",{children:x}),(0,n.jsx)("button",{type:"button",onClick:()=>N(e=>e+1),children:"Retry"})]}):null,l?.length!==0||x?null:(0,n.jsx)("p",{className:"conversation-state","data-conversation-state":"empty",children:g?"No conversations match this search.":"No conversations involve this Agent yet."}),l&&l.length>0?(0,n.jsx)("ol",{className:"conversation-list","aria-label":"Conversations, newest activity first",children:l.map(s=>(0,n.jsx)("li",{children:(0,n.jsxs)(t.default,{href:`/agents/${encodeURIComponent(e)}/conversations/${encodeURIComponent(s.conversation_id)}`,children:[(0,n.jsxs)("span",{className:"conversation-row-title",children:[(0,n.jsx)("strong",{children:s.label}),(0,n.jsx)("span",{children:"direct"===s.type?"Direct":"group"===s.type?"Group":s.origin?.kind==="service"?"External service":"Agent to Agent"})]}),(0,n.jsx)("span",{className:"conversation-row-participants",children:s.participants.map(e=>e.label).join(" · ")}),(0,n.jsxs)("span",{className:"conversation-row-meta",children:[(0,n.jsxs)("span",{children:["Origin: ",s.origin?.label??"Unknown"]}),(0,n.jsxs)("span",{children:[s.message_count," ",1===s.message_count?"message":"messages"]}),(0,n.jsx)("time",{dateTime:new Date(s.last_activity_at).toISOString(),children:new Date(s.last_activity_at).toLocaleString()})]})]})},s.conversation_id))}):null,h&&l&&!x?(0,n.jsx)("button",{className:"conversation-more",type:"button",disabled:y,onClick:()=>void w(h,!0),children:y?"Loading…":"Load older conversations"}):null]})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66464,e=>{"use strict";var t=e.i(43476),s=e.i(22016),a=e.i(71645),i=e.i(70925);let n=[{value:"all",label:"All"},{value:"sessions",label:"Sessions"},{value:"conversations",label:"Conversations & exchanges"},{value:"slack",label:"Slack"},{value:"errors",label:"Errors"}],r={filter:"all",requestKey:"",activity:{state:"loading"},nextCursor:null,loadingMore:!1};function l(e,t){return"select_filter"===t.type?{...e,filter:t.filter,requestKey:"",activity:{state:"loading"},nextCursor:null,loadingMore:!1}:"request_started"===t.type?{...e,requestKey:t.key,activity:{state:"loading"},nextCursor:null,loadingMore:!1}:"request_succeeded"===t.type?t.key===e.requestKey?{...e,activity:{state:"ready",items:t.items},nextCursor:t.nextCursor}:e:"request_failed"===t.type?t.key===e.requestKey?{...e,activity:{state:"error"},nextCursor:null}:e:"load_started"===t.type?t.key===e.requestKey?{...e,loadingMore:!0}:e:"load_succeeded"===t.type&&t.key===e.requestKey&&"ready"===e.activity.state?{...e,activity:{state:"ready",items:[...e.activity.items,...t.items]},nextCursor:t.nextCursor,loadingMore:!1}:"load_failed"===t.type&&t.key===e.requestKey?{...e,activity:{state:"error"},nextCursor:null,loadingMore:!1}:e}function c(e,t,s=null){let a=new URLSearchParams({filter:t,limit:String(20)});return s&&a.set("cursor",s),`/api/bots/${encodeURIComponent(e)}/activity?${a.toString()}`}function o({items:e,compact:a=!1}){return(0,t.jsx)("ol",{className:a?"agent-activity-list is-compact":"agent-activity-list","aria-label":"Agent activity, newest first",children:e.map(e=>(0,t.jsxs)("li",{className:`agent-activity-item is-${e.severity}`,"data-activity-kind":e.kind,children:[(0,t.jsx)("span",{className:"agent-activity-marker","aria-hidden":"true"}),(0,t.jsxs)("div",{className:"agent-activity-card",children:[(0,t.jsxs)("div",{className:"agent-activity-summary",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"agent-activity-category",children:"conversations"===e.category?"Conversations & exchanges":e.category}),(0,t.jsx)("strong",{children:e.summary}),(0,t.jsx)("time",{dateTime:new Date(e.occurred_at).toISOString(),children:new Date(e.occurred_at).toLocaleString()})]}),e.attention?(0,t.jsx)("span",{className:"agent-activity-attention",children:"Needs attention"}):null]}),(0,t.jsx)("div",{className:"agent-activity-actions",children:(0,t.jsx)(s.default,{href:e.target.href,children:e.target.label})}),!a&&Object.keys(e.details).length?(0,t.jsxs)("details",{className:"agent-activity-details",children:[(0,t.jsx)("summary",{children:"Raw details"}),(0,t.jsx)("dl",{children:Object.entries(e.details).map(([e,s])=>(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:e.replaceAll("_"," ")}),(0,t.jsx)("dd",{children:(0,t.jsx)("code",{children:String(s)})})]},e))}),(0,t.jsx)("p",{children:"Safe structured fields only. Provider transcripts and identifiers are excluded."})]}):null]})]},e.id))})}function d({activity:e,filter:s,nextCursor:a,loadingMore:i,onLoadMore:r}){return(0,t.jsxs)(t.Fragment,{children:["loading"===e.state?(0,t.jsx)("p",{className:"agent-activity-state",role:"status",children:"Loading activity…"}):null,"error"===e.state?(0,t.jsxs)("div",{className:"agent-activity-state is-error",role:"alert",children:[(0,t.jsx)("strong",{children:"Activity unavailable"}),(0,t.jsx)("p",{children:"No partial or stale timeline is shown. Refresh to try again."})]}):null,"ready"!==e.state||e.items.length?null:(0,t.jsx)("p",{className:"agent-activity-state",children:"all"===s?"No operational activity has been recorded for this Agent yet.":`No ${n.find(e=>e.value===s)?.label.toLowerCase()} activity matches this filter.`}),"ready"===e.state&&e.items.length?(0,t.jsx)(o,{items:e.items}):null,"ready"===e.state&&a?(0,t.jsx)("button",{type:"button",className:"agent-activity-more",onClick:r,disabled:i,children:i?"Loading…":"Load older activity"}):null]})}e.s(["ActivityList",0,o,"ActivityResults",0,d,"activityPageReducer",0,l,"agentActivityUrl",0,c,"default",0,function(){let{id:e,overview:o,loading:h,error:g,notFound:u}=(0,i.useAgentOverview)(),[x,v]=(0,a.useReducer)(l,r),{filter:m,activity:y,nextCursor:j,loadingMore:p}=x,f=(0,a.useRef)(0),N=(0,a.useCallback)((t=null)=>c(e,m,t),[m,e]);(0,a.useEffect)(()=>{let t=!1,s=++f.current,a=`${e}:${m}:${s}`;return v({type:"request_started",key:a}),fetch(N(),{cache:"no-store"}).then(async e=>{let i=await e.json().catch(()=>null);if(!e.ok||!Array.isArray(i?.activity))throw Error("activity");t||s!==f.current||v({type:"request_succeeded",key:a,items:i.activity,nextCursor:"string"==typeof i.next_cursor?i.next_cursor:null})}).catch(()=>{t||s!==f.current||v({type:"request_failed",key:a})}),()=>{t=!0}},[m,e,N]);let b=async()=>{if(!j||"ready"!==y.state||p)return;let e=x.requestKey;v({type:"load_started",key:e});try{let t=await fetch(N(j),{cache:"no-store"}),s=await t.json().catch(()=>null);if(!t.ok||!Array.isArray(s?.activity))throw Error("activity");v({type:"load_succeeded",key:e,items:s.activity,nextCursor:"string"==typeof s.next_cursor?s.next_cursor:null})}catch{v({type:"load_failed",key:e})}};return h?(0,t.jsx)("div",{className:"agent-state",role:"status",children:"Loading Agent activity…"}):u?(0,t.jsxs)("div",{className:"agent-state",children:[(0,t.jsx)("h2",{children:"Agent not found"}),(0,t.jsx)(s.default,{href:"/",children:"Choose an Agent"})]}):g||!o?(0,t.jsxs)("div",{className:"agent-state",role:"alert",children:[(0,t.jsx)("h2",{children:"Activity unavailable"}),(0,t.jsx)("p",{children:"Botmancers could not load this Agent."})]}):(0,t.jsxs)("div",{className:"agent-activity","data-agent-activity-page":!0,children:[(0,t.jsxs)("header",{className:"agent-activity-intro",children:[(0,t.jsx)("p",{className:"agent-eyebrow",children:"Activity"}),(0,t.jsxs)("h2",{children:["What changed for ",o.agent.name]}),(0,t.jsx)("p",{children:"Operational history from Botmancers records. Open the owning page for actions and complete detail."})]}),(0,t.jsx)("div",{className:"agent-activity-filters",role:"group","aria-label":"Filter Agent activity",children:n.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":m===e.value,onClick:()=>v({type:"select_filter",filter:e.value}),children:e.label},e.value))}),(0,t.jsx)(d,{activity:y,filter:m,nextCursor:j,loadingMore:p,onLoadMore:()=>{b()}})]})},"initialActivityPageState",0,r],66464)},65143,e=>{"use strict";var t=e.i(43476),s=e.i(22016),a=e.i(70925),i=e.i(3136),n=e.i(66464);let r={"agents:read":"Discoverable to connected coding agents","sessions:read":"Session history","conversations:read":"Conversation history","sessions:message":"Session messaging","shares:create":"Slack session sharing"};function l({rows:e,empty:s}){return e.length?(0,t.jsx)("ul",{className:"agent-work-list",children:e.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("span",{children:[(0,t.jsx)("strong",{children:e.title}),(0,t.jsxs)("small",{children:["active"===e.status?"Active now":"Recent"," · ",new Date(e.last_activity_at).toLocaleString()]})]})},e.ref))}):(0,t.jsx)("p",{className:"agent-empty",children:s})}e.s(["default",0,function(){let{id:e,overview:c,loading:o,error:d,notFound:h}=(0,a.useAgentOverview)();if(o)return(0,t.jsx)("div",{className:"agent-state",role:"status",children:"Loading Agent overview…"});if(h)return(0,t.jsxs)("div",{className:"agent-state",children:[(0,t.jsx)("h2",{children:"Agent not found"}),(0,t.jsx)("p",{children:"This Agent does not exist or was removed."}),(0,t.jsx)(s.default,{href:"/",children:"Choose an Agent"})]});if(d||!c)return(0,t.jsxs)("div",{className:"agent-state",role:"alert",children:[(0,t.jsx)("h2",{children:"Overview unavailable"}),(0,t.jsx)("p",{children:"Botmancers could not load this Agent. Refresh to try again."})]});let g=`/bots/${encodeURIComponent(e)}/config`,u=c.conversation?`/agents/${encodeURIComponent(e)}/conversations/${encodeURIComponent(c.conversation.id)}`:`/agents/${encodeURIComponent(e)}/conversations`,x=c.messaging.home_session_ref?"Home session configured":c.messaging.new_sessions_allowed&&c.messaging.default_workspace_set?"Can start a configured session":c.current_work.length>0?"Uses an eligible existing session":"No ready session is known";return(0,t.jsxs)("div",{className:"agent-overview","data-agent-overview":!0,children:[(0,t.jsxs)("section",{className:"agent-hero",children:[(0,t.jsx)("p",{className:"agent-eyebrow",children:"Overview"}),(0,t.jsx)("h2",{children:c.agent.role}),(0,t.jsx)("ul",{className:"agent-capabilities","aria-label":"Capabilities",children:c.capabilities.map(e=>(0,t.jsx)("li",{children:r[e]||e},e))})]}),(0,t.jsxs)("div",{className:"agent-overview-grid",children:[(0,t.jsxs)("section",{className:"agent-panel agent-instructions",children:[(0,t.jsxs)("div",{className:"agent-panel-head",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"agent-eyebrow",children:"Standing instructions"}),(0,t.jsx)("h2",{children:"How this Agent works"})]}),(0,t.jsx)(s.default,{href:g,children:"Full Config"})]}),(0,t.jsxs)("dl",{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Rules"}),(0,t.jsx)("dd",{children:c.instructions.rules})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Skill"}),(0,t.jsx)("dd",{children:c.instructions.skill})]})]})]}),(0,t.jsxs)("section",{className:"agent-panel",children:[(0,t.jsxs)("div",{className:"agent-panel-head",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"agent-eyebrow",children:"Runtime"}),(0,t.jsx)("h2",{children:c.runtime.available?"Ready to work":"Setup required"})]}),(0,t.jsx)(s.default,{href:g,children:"Config"})]}),(0,t.jsx)("p",{children:c.runtime.available?`${(0,i.agentLabel)(c.runtime.agent)} is connected through ${c.runtime.connection||"the configured runtime"}.`:"This Agent cannot launch with its current registration. Open Config to resolve the connection or session scope."}),(0,t.jsxs)("dl",{className:"agent-runtime-facts",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Heartbeat"}),(0,t.jsx)("dd",{children:c.runtime.last_seen?new Date(c.runtime.last_seen).toLocaleString():"Not reported"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Messaging"}),(0,t.jsx)("dd",{children:x})]})]}),(0,t.jsx)("p",{className:"agent-muted",children:"Messages use the Agent’s configured home session or launch policy. Callers do not choose its runtime, model, or provider session."})]})]}),(0,t.jsxs)("section",{className:"agent-use","aria-labelledby":"use-this-agent",children:[(0,t.jsx)("p",{className:"agent-eyebrow",children:"Start here"}),(0,t.jsx)("h2",{id:"use-this-agent",children:"Use this Agent"}),(0,t.jsxs)("div",{className:"agent-use-grid",children:[(0,t.jsxs)("article",{children:[(0,t.jsx)("span",{className:"agent-use-number",children:"01"}),(0,t.jsx)("h3",{children:"Message in Botmancers"}),(0,t.jsxs)("p",{children:["Open a focused conversation when you want to talk directly with ",c.agent.name,"."]}),(0,t.jsx)(s.default,{className:"agent-primary-action",href:u,children:"Open conversation"})]}),(0,t.jsxs)("article",{children:[(0,t.jsx)("span",{className:"agent-use-number",children:"02"}),(0,t.jsx)("h3",{children:"Use from a coding agent"}),(0,t.jsxs)("p",{children:["Connect your coding agent to ",(0,t.jsx)("code",{children:"POST /api/v0/mcp"}),", then call ",(0,t.jsx)("code",{children:"botmancers_capabilities"})," and ",(0,t.jsx)("code",{children:"botmancers_list_agents"})," before messaging."]}),(0,t.jsx)("a",{href:"https://github.com/not-so-fat/botmancers/blob/main/packages/mcp-server/README.md#client-setup-and-the-collaboration-skill",target:"_blank",rel:"noreferrer",children:"Open bridge setup guidance"})]}),(0,t.jsxs)("article",{children:[(0,t.jsx)("span",{className:"agent-use-number",children:"03"}),(0,t.jsx)("h3",{children:"Share a session to Slack"}),(0,t.jsx)("p",{children:"Choose one of this Agent’s sessions and create a time-limited, read-only Slack share."}),(0,t.jsx)(s.default,{href:`/agents/${encodeURIComponent(e)}/slack`,children:"Share through Slack"})]})]})]}),(0,t.jsxs)("div",{className:"agent-overview-grid agent-work-grid",children:[(0,t.jsxs)("section",{className:"agent-panel",children:[(0,t.jsxs)("div",{className:"agent-panel-head",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"agent-eyebrow",children:"Current work"}),(0,t.jsx)("h2",{children:"Active sessions"})]}),(0,t.jsx)(s.default,{href:`/agents/${encodeURIComponent(e)}/sessions`,children:"All sessions"})]}),(0,t.jsx)(l,{rows:c.current_work,empty:"No active work right now."})]}),(0,t.jsxs)("section",{className:"agent-panel",children:[(0,t.jsxs)("div",{className:"agent-panel-head",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"agent-eyebrow",children:"Recent activity"}),(0,t.jsx)("h2",{children:"Latest work"})]}),(0,t.jsx)(s.default,{href:`/agents/${encodeURIComponent(e)}/activity`,children:"View activity"})]}),c.recent_activity.length?(0,t.jsx)(n.ActivityList,{items:c.recent_activity,compact:!0}):(0,t.jsx)("p",{className:"agent-empty",children:"No operational activity yet."})]})]})]})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13255,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(22016),r=e.i(50814);e.s(["default",0,function({summary:e,onChanged:s}){let[i,o]=(0,n.useState)(!1),[l,c]=(0,n.useState)(""),u=(0,r.stateTone)(e.state),d=(0,r.outcomeLine)(e),h=(0,r.failureAdvice)(e),f=`exchange-${e.id}-title`,p=async()=>{if(!i){o(!0),c("");try{let t=await fetch(`/api/exchanges/${encodeURIComponent(e.id)}/cancel`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!t.ok){let e=await t.json().catch(()=>null);c("string"==typeof e?.error?.message?e.error.message:"Could not cancel. Try again.")}}catch{c("Could not cancel. Try again.")}finally{o(!1),s?.()}}};return(0,t.jsxs)("article",{id:`exchange-${e.id}`,className:`exchange-card is-${u} is-${e.state}`,"data-exchange-id":e.id,"data-exchange-state":e.state,"aria-labelledby":f,tabIndex:-1,children:[(0,t.jsxs)("p",{className:"exchange-card-line",children:[(0,t.jsx)("span",{className:"exchange-card-mode",children:(0,r.modeLabel)(e.mode)}),(0,t.jsx)("span",{id:f,className:"exchange-card-title",children:(0,r.participantsLabel)(e)}),(0,t.jsx)("span",{className:"exchange-card-state",role:"status",children:(0,r.liveStateLabel)(e)})]}),(0,t.jsx)("p",{className:"exchange-card-session",children:(0,r.sessionLabel)(e)}),(0,t.jsxs)("p",{className:"exchange-card-instruction",children:[(0,t.jsx)("span",{className:"exchange-card-key",children:(0,r.instructionHeading)(e.mode)})," ",(0,r.excerpt)(e.instruction,220)]}),d?(0,t.jsx)("p",{className:"failed"===e.state?"exchange-card-outcome is-failure":"exchange-card-outcome",children:d}):null,h?(0,t.jsx)("p",{className:"exchange-card-advice",children:h}):null,l?(0,t.jsx)("p",{className:"exchange-card-error",role:"alert",children:l}):null,(0,t.jsxs)("p",{className:"exchange-card-foot",children:[(0,t.jsxs)("span",{className:"exchange-card-time",children:["Updated ",(0,r.formatExchangeTime)(e.updated_at)]}),(0,t.jsx)(a.default,{className:"exchange-card-link",href:(0,r.detailsHref)(e.id),"aria-label":`Details: ${(0,r.modeLabel)(e.mode)} ${(0,r.participantsLabel)(e)}`,children:"Details"}),e.can_cancel?(0,t.jsx)("button",{type:"button",className:"exchange-card-cancel",disabled:i,onClick:()=>{p()},children:i?"Cancelling…":"Cancel"}):null]})]})}])},87164,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(22016),r=e.i(13255),s=e.i(50814);let i="botmancers:exchanges-navigate";function o(e){return window.addEventListener("popstate",e),window.addEventListener(i,e),()=>{window.removeEventListener("popstate",e),window.removeEventListener(i,e)}}function l(){return new URLSearchParams(window.location.search).get("id")}function c({id:e,onBack:i,onChanged:o}){let[l,u]=(0,n.useState)(null),[d,h]=(0,n.useState)(""),[f,p]=(0,n.useState)(0),g=(0,n.useRef)(null),m=(0,n.useRef)(!1),x=(0,n.useId)();(0,n.useEffect)(()=>{let t=!1,n=()=>{fetch(`/api/exchanges/${encodeURIComponent(e)}`,{cache:"no-store"}).then(async e=>{let n=await e.json().catch(()=>null);if(!t){if(!e.ok||!n?.detail)return void h(404===e.status?"This exchange no longer exists.":"Could not load this exchange.");h(""),u(n.detail)}}).catch(()=>{t||h("Could not load this exchange.")})};n();let a=setInterval(n,2e3);return()=>{t=!0,clearInterval(a)}},[e,f]),(0,n.useEffect)(()=>{l&&!m.current&&(m.current=!0,g.current?.focus())},[l]);let b=(0,t.jsx)("button",{type:"button",className:"pin-word ledger-detail-back",onClick:i,children:"← All exchanges"});if(!l)return(0,t.jsxs)("div",{className:"ledger-detail",children:[b,d?(0,t.jsxs)("div",{role:"alert",className:"ledger-state",children:[(0,t.jsx)("p",{className:"delete-error",children:d}),(0,t.jsx)("button",{type:"button",className:"pin-word",onClick:()=>p(e=>e+1),children:"Retry"})]}):(0,t.jsx)("p",{className:"ledger-state",role:"status",children:"Loading exchange…"})]});let{summary:v,events:y,packet:_}=l;return(0,t.jsxs)("article",{className:"ledger-detail","aria-labelledby":x,"data-exchange-detail":v.id,children:[b,(0,t.jsxs)("h2",{id:x,ref:g,tabIndex:-1,className:"ledger-detail-title",children:[(0,s.modeLabel)(v.mode),": ",(0,s.participantsLabel)(v)]}),(0,t.jsx)(r.default,{summary:v,onChanged:()=>{p(e=>e+1),o()}}),(0,t.jsxs)("section",{className:"ledger-section","aria-label":(0,s.instructionHeading)(v.mode),children:[(0,t.jsx)("h3",{className:"ledger-section-title",children:(0,s.instructionHeading)(v.mode)}),(0,t.jsx)("p",{className:"ledger-text",children:v.instruction})]}),l.answer?(0,t.jsxs)("section",{className:"ledger-section","aria-label":"Answer",children:[(0,t.jsx)("h3",{className:"ledger-section-title",children:"Answer"}),(0,t.jsx)("p",{className:"ledger-text",children:l.answer})]}):null,_?(0,t.jsxs)("section",{className:"ledger-section","aria-label":"Handoff packet",children:[(0,t.jsx)("h3",{className:"ledger-section-title",children:"Handoff packet"}),(0,t.jsx)("p",{className:"ledger-text",children:_.objective}),[["Decisions",_.decisions],["Constraints",_.constraints],["Artifacts and references",_.artifacts],["Open questions",_.open_questions]].filter(([,e])=>e.length>0).map(([e,n])=>(0,t.jsxs)("div",{className:"ledger-packet-list",children:[(0,t.jsx)("h4",{className:"ledger-packet-title",children:e}),(0,t.jsx)("ul",{children:n.map((e,n)=>(0,t.jsx)("li",{children:e},n))})]},e))]}):null,(0,t.jsxs)("section",{className:"ledger-section","aria-label":"Linked threads",children:[(0,t.jsx)("h3",{className:"ledger-section-title",children:"Linked threads"}),(0,t.jsx)("ul",{className:"ledger-links",children:v.links.map(e=>{let n=(0,s.threadHref)(e,v.id);return(0,t.jsxs)("li",{children:[n?(0,t.jsx)(a.default,{className:"session-link ledger-thread-link",href:n,children:e.label}):(0,t.jsxs)("span",{children:[e.label,"agent_api"===e.kind?(0,t.jsx)("span",{className:"ledger-link-role",children:" (between Agents, not an owner thread)"}):null]}),(0,t.jsxs)("span",{className:"ledger-link-role",children:[" · ",(0,s.linkRoleLabel)(e.roles)]})]},e.id)})})]}),(0,t.jsxs)("section",{className:"ledger-section","aria-label":"Timeline",children:[(0,t.jsx)("h3",{className:"ledger-section-title",children:"Timeline"}),(0,t.jsx)("ol",{className:"ledger-timeline",children:y.map(e=>(0,t.jsxs)("li",{"data-event-type":e.type,children:[(0,t.jsx)("span",{className:"ledger-timeline-time",children:(0,s.formatExchangeTime)(e.at)}),(0,t.jsx)("span",{className:"ledger-timeline-text",children:(0,s.eventLabel)(e,v)})]},e.sequence))})]}),(0,t.jsxs)("p",{className:"ledger-foot",children:[(0,s.excerpt)(`${v.source.agent_name}’s session: ${v.source.session_title}`,200),v.destination?.session_title?` \xb7 ${v.destination.agent_name}’s new session: ${v.destination.session_title}`:""]})]})}e.s(["default",0,function(){let[e,r]=(0,n.useState)(null),[u,d]=(0,n.useState)(""),[h,f]=(0,n.useState)(0),[p,g]=(0,n.useState)(s.DEFAULT_LEDGER_FILTER),m=(0,n.useSyncExternalStore)(o,l,()=>null),x=(0,n.useId)(),b=(0,n.useId)(),v=(0,n.useId)(),y=(0,n.useRef)(null),_=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=_.current;if(_.current=m,m||!e)return;let t=document.querySelector(`.ledger-row[data-exchange-id="${CSS.escape(e)}"]`);(t??y.current)?.focus()},[m]),(0,n.useEffect)(()=>{let e=!1,t=()=>{fetch("/api/exchanges",{cache:"no-store"}).then(async t=>{let n=await t.json().catch(()=>null);if(!e){if(!t.ok||!Array.isArray(n?.exchanges))return void d("string"==typeof n?.error?.message?n.error.message:"Could not load exchanges.");d(""),r(n.exchanges)}}).catch(()=>{e||d("Could not load exchanges.")})};t();let n=setInterval(t,2e3);return()=>{e=!0,clearInterval(n)}},[h]);let $=e=>{window.history.pushState(null,"",e?`/exchanges?id=${encodeURIComponent(e)}`:"/exchanges"),window.dispatchEvent(new Event(i))},j=e?(0,s.ledgerRows)(e,p):[],w=(0,s.ledgerView)(e,e?"":u,j),k=e?(0,s.ledgerAgents)(e):[];return(0,t.jsxs)("div",{className:m?"ledger-page has-detail":"ledger-page",children:[(0,t.jsxs)("header",{className:"ledger-head",children:[(0,t.jsx)(a.default,{href:"/",className:"cfg-link ledger-back",children:"← Back to chat"}),(0,t.jsx)("h1",{className:"ledger-title",children:"Agent Exchanges"}),(0,t.jsx)("p",{className:"ledger-sub",children:"Every Ask and Continue between Agent sessions, newest activity first."})]}),(0,t.jsxs)("main",{className:"ledger-main",children:[(0,t.jsxs)("section",{className:"ledger-list-pane","aria-labelledby":v,children:[(0,t.jsx)("h2",{id:v,ref:y,tabIndex:-1,className:"ledger-pane-title",children:"Exchanges"}),(0,t.jsxs)("div",{className:"ledger-filters",children:[(0,t.jsx)("div",{className:"sessions-filter ledger-mode",role:"group","aria-label":"Mode",children:s.MODE_FILTER_OPTIONS.map(e=>(0,t.jsx)("button",{type:"button",className:"sessions-filter-btn","aria-pressed":p.mode===e.value,onClick:()=>g(t=>({...t,mode:e.value})),children:e.label},e.value))}),(0,t.jsxs)("div",{className:"ledger-selects",children:[(0,t.jsxs)("label",{className:"ledger-select-label",htmlFor:x,children:["Status",(0,t.jsx)("select",{id:x,className:"exchange-select",value:p.state,onChange:e=>g(t=>({...t,state:e.target.value})),children:s.STATE_FILTER_OPTIONS.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,t.jsxs)("label",{className:"ledger-select-label",htmlFor:b,children:["Agent",(0,t.jsxs)("select",{id:b,className:"exchange-select",value:p.agentId,onChange:e=>g(t=>({...t,agentId:e.target.value})),children:[(0,t.jsx)("option",{value:"",children:"Any Agent"}),k.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})]})]}),(0,t.jsx)("p",{className:"manage-count ledger-count",role:"status",children:e?`${j.length} of ${e.length} shown`:""})]}),"loading"===w?(0,t.jsx)("p",{className:"ledger-state",role:"status","data-ledger-state":"loading",children:"Loading exchanges…"}):null,"error"===w?(0,t.jsxs)("div",{className:"ledger-state",role:"alert","data-ledger-state":"error",children:[(0,t.jsx)("p",{className:"delete-error",children:u}),(0,t.jsx)("button",{type:"button",className:"pin-word",onClick:()=>{d(""),f(e=>e+1)},children:"Retry"})]}):null,"empty"===w?(0,t.jsx)("p",{className:"ledger-state","data-ledger-state":"empty",children:"No exchanges yet. Open an Agent’s Sessions and choose Ask from this context or Hand off to… to start one."}):null,"filtered-out"===w?(0,t.jsxs)("div",{className:"ledger-state","data-ledger-state":"filtered-out",children:[(0,t.jsx)("p",{children:"No exchanges match these filters."}),(0,t.jsx)("button",{type:"button",className:"pin-word",onClick:()=>g(s.DEFAULT_LEDGER_FILTER),children:"Clear filters"})]}):null,"rows"===w?(0,t.jsx)("ol",{className:"ledger-list","aria-label":"Exchanges, newest activity first",children:j.map(e=>(0,t.jsx)("li",{className:"ledger-row-item",children:(0,t.jsxs)("button",{type:"button",className:`ledger-row is-${(0,s.stateTone)(e.state)}`,"data-exchange-id":e.id,"aria-current":m===e.id?"true":void 0,onClick:()=>$(e.id),children:[(0,t.jsxs)("span",{className:"ledger-row-line",children:[(0,t.jsx)("span",{className:"exchange-card-mode",children:(0,s.modeLabel)(e.mode)}),(0,t.jsx)("span",{className:"ledger-row-who",children:(0,s.participantsLabel)(e)}),(0,t.jsx)("span",{className:"ledger-row-state",children:(0,s.liveStateLabel)(e)})]}),(0,t.jsx)("span",{className:"ledger-row-session",children:e.source.session_title}),(0,t.jsxs)("span",{className:"ledger-row-meta",children:["From ",e.origin?.label??"an unknown thread"," · Started ",(0,s.formatExchangeTime)(e.created_at)," · Updated ",(0,s.formatExchangeTime)(e.updated_at)]})]})},e.id))}):null]}),(0,t.jsx)("section",{className:"ledger-detail-pane","aria-label":"Exchange detail",children:m?(0,t.jsx)(c,{id:m,onBack:()=>$(null),onChanged:()=>f(e=>e+1)},m):(0,t.jsx)("p",{className:"ledger-state ledger-placeholder",children:"Choose an exchange to see its timeline and linked threads."})})]})]})}])},50814,63352,e=>{"use strict";function t(e){return`${new Date(e).toISOString().slice(0,16).replace("T"," ")} UTC`}function n(e){return e?e.split("/").filter(e=>e.length>0).pop()??null:null}function a(e,t){let n=function(e){if(!e)return null;let t=e.toLowerCase();return"muse code"===t?"muse":(["codex","claude","cursor","hermes","muse"].includes(t),t)}(t);switch(e){case"provider_unavailable":return n?{reason:`${n} is not installed or did not start`,fix:`Install ${n} and Retry.`}:{reason:"the runtime is not installed or did not start",fix:"Install the runtime and Retry."};case"auth_required":return{reason:"not signed in",fix:"Sign in and Retry."};case"permission_denied":return{reason:"permission denied",fix:"Check permissions and Retry."};case"incompatible_version":return{reason:"incompatible version",fix:"Update the runtime and Retry."};case"usage_limit":return{reason:"usage limit reached",fix:"Wait or upgrade and Retry."};case"scope_missing":return{reason:"no session scope is set",fix:"Choose a scope in Config."};case"provider_failed":return{reason:"the listing failed",fix:"Retry."};default:return{reason:e,fix:"Retry."}}}let r="Not reported";function s(e){return e.toFixed(1).replace(/\.0$/,"")}function i(e){return e.toLocaleString("en-US")}function o(e){return 0===e?"$0.00":e>=.01?`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`:e<1e-4?"<$0.0001":`$${e.toFixed(4)}`}let l={input_tokens:"Input tokens",output_tokens:"Output tokens",cost_usd:"Cost"};function c(e,t,n){return"cost_usd"===e?o(t):n?i(t):t<1e3?String(t):t<999950?`${s(t/1e3)}k`:t<99995e4?`${s(t/1e6)}M`:`${s(t/1e9)}B`}function u(e){return`${e} ${1===e?"run":"runs"}`}function d(e,t,n=!1){let a=l[e];if(!t||"unavailable"===t.quality||null===t.sum)return{name:a,text:r,quality:"unavailable",coverage:t&&t.total>0?`0 of ${u(t.total)} reported`:"No runs recorded",label:`${a}: not reported`};let s=c(e,t.sum,n),i=c(e,t.sum,!0);return"partial"===t.quality?{name:a,text:s,quality:"partial",coverage:`Partial: ${t.known} of ${u(t.total)} reported`,label:`${a}: at least ${i}, partial, reported by ${t.known} of ${u(t.total)}`}:{name:a,text:s,quality:"complete",coverage:`All ${u(t.total)} reported`,label:`${a}: ${i}, reported by all ${u(t.total)}`}}e.s(["SESSION_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"ended",label:"Ended"}],"attemptLabel",0,function(e){let t="source"===e.role?"Started the session":"Resumed the session";return`${t} \xb7 ${e.outcome??"running"}`},"emptySessionsCopy",0,function(e,t,n,r){if("active"===e)return`${t} has no active sessions.`;if("ended"===e)return`${t} has no ended sessions.`;if(n?.last_error_code){let{reason:e,fix:t}=a(n.last_error_code,r),s=r?`${r} sessions`:"sessions";return`Could not read ${s}: ${e}. ${t}`}if(n&&null===n.synced_at)return`${t} has not synced sessions yet. Refresh to load past sessions.`;let s=n?.out_of_scope_count??0;return s>0?`${s} ${1===s?"session exists":"sessions exist"} outside ${t}'s scope. Widen the scope to see them.`:`${t} has no sessions yet. One appears after a coding run keeps its runtime context.`},"formatSessionDate",0,t,"formatSyncRelativeTime",0,function(e,t=Date.now()){if(null===e)return"never";let n=Math.max(0,t-e);if(n<6e4)return"just now";let a=Math.floor(n/6e4);if(a<60)return`${a} minute${1===a?"":"s"} ago`;let r=Math.floor(a/60);if(r<24)return`${r} hour${1===r?"":"s"} ago`;let s=Math.floor(r/24);return`${s} day${1===s?"":"s"} ago`},"noMatchingSessionsCopy",0,function(e,t){let a=e.trim();if(a)return`No sessions match “${a}”.`;let r=n(t);return r?`No sessions in ${r}.`:"No sessions match the current filters."},"registrationSessionSyncCopy",0,function(e,t){if("failed"===e.outcome){let{reason:n,fix:r}=a(e.error_code??"provider_failed",t);return`Could not read ${t} sessions: ${n}. ${r}`}if("unsupported"===e.outcome)return`Past sessions are not available for ${t}.`;let n=1===e.imported?"session":"sessions",r=`Loaded ${e.imported} ${n}`;return e.rejected_out_of_scope>0&&(r+=`, ${e.rejected_out_of_scope} outside the scope`),e.complete||(r+=", more remain"),`${r}.`},"runtimeLabel",0,function(e){return e.agent.transport?`${e.agent.adapter} \xb7 ${e.agent.transport}`:e.agent.adapter},"sessionOriginChips",0,function(e){let t=[],n=e.origin.work_request?.requester;return n?.kind==="person"?t.push("Human origin"):n?.kind==="bot"?t.push(n.name?`${n.name} Agent`:"Agent origin"):n?.kind==="service"&&t.push("Service origin"),e.origin.conversation&&t.push(e.origin.conversation.label),[...new Set(t)]},"sessionStateTags",0,function(e){let t=[];return(e.home&&t.push("Home"),e.state?.availability==="missing")?[...t,"Missing"]:(e.state?.lifecycle==="archived"&&t.push("Archived"),e.state?.busy&&t.push("Busy"),(e.resumable||e.state?.resumable===!0)&&t.push("Resumable"),t)},"sessionUsageLine",0,function(e){let t=d("input_tokens",e?.input_tokens),n=d("output_tokens",e?.output_tokens),a=d("cost_usd",e?.cost_usd),s=[t,n,a];if(s.every(e=>"unavailable"===e.quality))return{text:r,label:"Usage: not reported",quality:"unavailable",partial:!1};let i=["unavailable"===t.quality?"input not reported":`${t.text} in`,"unavailable"===n.quality?"output not reported":`${n.text} out`,"unavailable"===a.quality?"cost not reported":a.text].join(" · "),o=s.some(e=>"partial"===e.quality),l=o||s.some(e=>"unavailable"===e.quality)?"partial":"complete";return{text:i,label:`Reported usage: ${s.map(e=>e.label).join("; ")}`,quality:l,partial:o}},"statusLabel",0,function(e){return"active"===e.status?"Active":"Ended"},"usageMetricView",0,d,"usageSampleLabel",0,function(e,t){let n="turn"===e.kind?"start"===e.turn_kind?"provider turn, started":"provider turn":"resume"===e.turn_kind?"resumed":"started";return`Run ${t+1} \xb7 ${n}`},"usageSampleValues",0,function(e){return{input:null===e.input_tokens?r:i(e.input_tokens),output:null===e.output_tokens?r:i(e.output_tokens),cost:null===e.cost_usd?r:o(e.cost_usd)}},"workRequestLabel",0,function(e){var t;let n=e.origin.work_request;return n?`${(t=n.execution_kind)?t[0].toUpperCase()+t.slice(1):t} \xb7 ${n.state}`:null},"workspaceFolderName",0,n,"workspaceOptions",0,function(e){let t=[...new Set(e.filter(e=>"string"==typeof e&&e.length>0))],a=t.map(e=>n(e)??e);return t.map((e,t)=>({value:e,label:a.filter(e=>e===a[t]).length>1?e:a[t]})).sort((e,t)=>e.label<t.label?-1:+(e.label>t.label))}],63352);let h={ask:"Ask from this context",resume:"Resume work here",handoff:"Hand off to…"},f=["queued","extracting","delivering","completed","failed","cancelled"],p=["completed","failed","cancelled"];function g(e,t){switch(t){case"queued":return"Queued";case"extracting":return"ask"===e?"Asking the session":"Extracting handoff";case"delivering":return"Delivering handoff";case"completed":return"ask"===e?"Answered":"Handed off";case"failed":return"Failed";case"cancelled":return"Cancelled"}}function m(e,t=140){let n=String(e??"").split("\n").map(e=>e.trim()).filter(e=>e.length>0).join(" ");return n.length>t?`${n.slice(0,t-1).trimEnd()}…`:n}function x(e,t){return t.updated_at-e.updated_at||t.created_at-e.created_at||(e.id<t.id?-1:+(e.id>t.id))}e.s(["DEFAULT_LEDGER_FILTER",0,{mode:"all",state:"all",agentId:""},"INSTRUCTION_LIMIT",0,4e3,"MODE_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"ask",label:"Ask"},{value:"continue",label:"Continue"}],"STATE_FILTER_OPTIONS",0,[{value:"all",label:"Any status"},{value:"active",label:"In progress"},{value:"queued",label:"Queued"},{value:"extracting",label:"Asking / extracting"},{value:"delivering",label:"Delivering"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"}],"detailsHref",0,function(e){return`/exchanges?id=${encodeURIComponent(e)}`},"eventLabel",0,function(e,t){let n=e.data??{},a=t.source.agent_name,r=t.destination?.agent_name??"the destination Agent",s="string"==typeof n.hop?n.hop:null;switch(e.type){case"created":return"ask"===t.mode?`You asked ${a}'s session a question`:`You handed ${a}'s session to ${r}`;case"hop_queued":if("deliver"===s)return`Handoff queued for ${r}'s new session`;return"extract"===s?`Handoff extraction queued in ${a}'s session`:`Question queued for ${a}'s session`;case"hop_started":if("deliver"===s)return`${r} started a new session`;return"extract"===s?`${a}'s session started extracting the handoff`:`${a}'s session started answering`;case"state_changed":{let e="string"==typeof n.to&&f.includes(n.to)?n.to:null;return e?`Now ${g(t.mode,e).toLowerCase()}`:"State changed"}case"answer_returned":return`Answer returned to ${t.origin?.label??"the origin thread"}${n.truncated?" (shortened)":""}`;case"packet_extracted":return"Handoff packet extracted";case"packet_rejected":return`Handoff packet refused${"string"==typeof n.reason?`: ${n.reason}`:""}`;case"destination_replied":return`${r} replied in ${t.destination?.conversation?.label??"its thread"}`;case"destination_session_rejected":return`${r}'s session was not new; the handoff stopped`;case"cancel_requested":return"You asked to cancel";case"hop_result_discarded":return"A late result was discarded";default:return e.type.replace(/_/g," ")}},"excerpt",0,m,"exchangeRequestBody",0,function(e,t,n){let a={mode:e.mode,idempotency_key:n,origin_conversation_id:e.originConversationId,source:{agent_id:t.agentId,session_ref:t.sessionRef},instruction:e.instruction.trim()};return"continue"===e.mode&&(a.destination={agent_id:e.destinationAgentId}),a},"failureAdvice",0,function(e){if("failed"!==e.state)return null;switch(e.failure?.code){case"packet_invalid":case"packet_missing":return"The source session did not return a usable handoff. Start a new Continue with a clearer objective.";case"destination_session_invalid":return"The destination did not start a fresh session. Check its runtime, then start a new Continue.";case"destination_turn_failed":return"Check the destination Agent’s runtime, then start a new Continue from the source session.";case"source_turn_failed":return"Check the source Agent’s runtime, then start a new exchange from its Sessions.";default:return"Start a new exchange from the session to try again."}},"formatExchangeTime",0,function(e){return t(e)},"instructionHeading",0,function(e){return"ask"===e?"Question":"Objective"},"ledgerAgents",0,function(e){let t=new Map;for(let n of e)t.set(n.source.agent_id,n.source.agent_name),n.destination&&t.set(n.destination.agent_id,n.destination.agent_name);return[...t.entries()].map(([e,t])=>({id:e,name:t})).sort((e,t)=>e.name.localeCompare(t.name)||e.id.localeCompare(t.id))},"ledgerRows",0,function(e,t){return e.filter(e=>("all"===t.mode||e.mode===t.mode)&&("active"!==t.state||!e.terminal)&&("all"===t.state||"active"===t.state||e.state===t.state)&&(!t.agentId||e.source.agent_id===t.agentId||e.destination?.agent_id===t.agentId)).sort(x)},"ledgerView",0,function(e,t,n){return null===e?t?"error":"loading":0===e.length?"empty":0===n.length?"filtered-out":"rows"},"linkRoleLabel",0,function(e){let t={origin:"Started here",source:"Source session",destination:"Destination"};return e.map(e=>t[e]).join(" · ")},"liveStateLabel",0,function(e){var t;return e.cancel_requested&&(t=e.state,!p.includes(t))?"Cancelling…":g(e.mode,e.state)},"modeLabel",0,function(e){return"ask"===e?"Ask":"Continue"},"outcomeLine",0,function(e){if("completed"===e.state){if("ask"===e.mode){let t=e.origin?.label??"the origin thread";return e.outcome.answer?`Answer in ${t}: ${m(e.outcome.answer,200)}`:`Answered in ${t}.`}let t=e.destination?.agent_name??"The destination Agent";return e.outcome.reply?`${t} picked it up in a new session: ${m(e.outcome.reply,200)}`:`${t} picked it up in a new session.`}return"failed"===e.state?e.failure?.message||"The exchange failed.":"cancelled"===e.state?"Cancelled before it finished. Nothing more will run.":null},"participantsLabel",0,function(e){return"ask"===e.mode?`You → ${e.source.agent_name}`:`${e.source.agent_name} → ${e.destination?.agent_name??"another Agent"}`},"pinRequestBody",0,function(e,t,n,a,r){return{action:e,content:t.trim(),conversation_id:n,idempotency_key:r,..."resume"===e?{approve_write:a}:{}}},"sessionDialogMode",0,function(e){return"handoff"===e?"continue":e},"sessionDialogTitle",0,function(e){return h["continue"===e?"handoff":e]},"sessionDialogUsesPin",0,function(e,t){return"resume"===e||"ask"===e&&"provider"===t},"sessionLabel",0,function(e){return`${e.source.agent_name}'s session “${e.source.session_title}”`},"sessionRowActions",0,function(e){let t;if(e.actions)t=e.actions;else{let n="ended"===e.status?{available:!1,reason:"Ask from this context and Hand off to… are unavailable: this session has ended. Its history stays here."}:e.resumable?{available:!0}:{available:!1,reason:`Ask from this context and Hand off to… are unavailable: Botmancers can’t resume this session under ${e.agent.name}’s current runtime.`},a=n.available?{available:!0}:{available:!1,code:"ended"===e.status?"session_ended":"session_not_resumable",reason:n.reason,recovery:"choose_session"};t={ask:a,resume:{available:!1,code:"action_unavailable",reason:`${h.resume} is unavailable: this runtime can’t resume a session with edits.`,recovery:"choose_action"},handoff:a}}return["ask","resume","handoff"].map(e=>({action:e,label:h[e],availability:t[e]}))},"stateTone",0,function(e){return"completed"===e?"done":"failed"===e||"cancelled"===e?"stopped":"active"},"submitErrorMessage",0,function(e,t){switch(e){case"session_ended":return"This session has ended and can’t be resumed.";case"session_not_resumable":return"Botmancers can’t resume this session under the Agent’s current runtime.";case"source_session_busy":return"This session already has an exchange in progress. Wait for it or cancel it from its card.";case"agent_unavailable":return t||"That Agent can’t launch yet. Choose its runtime connection and session scope in Config.";case"idempotency_conflict":return"This request changed while it was being sent. Send again.";case"session_missing":return"The runtime no longer has this session. Its history stays here; choose another session.";case"approval_required":return"Resume work here needs your approval of edits. Tick the approval, then send again.";case"authority_not_allowed":return t||"This Agent’s policy doesn’t allow edits in a resumed session. Change it in Config.";case"action_unavailable":return t||"This runtime can’t do that in this session. Choose another action.";case"provider_failed":return"The runtime failed this turn. Nothing moved to another session; try again later.";default:return t||"The exchange could not be started. Your draft is kept; try again."}},"threadHref",0,function(e,t){let n=new URLSearchParams;if(e.thread_agent_id){t&&n.set("exchange",t);let a=n.toString();return`/agents/${encodeURIComponent(e.thread_agent_id)}/conversations/${encodeURIComponent(e.id)}${a?`?${a}`:""}`}if("group"!==e.kind)return null;t&&n.set("exchange",t);let a=n.toString();return`/threads/${encodeURIComponent(e.id)}${a?`?${a}`:""}`},"validateDraft",0,function(e){let t={},n=e.instruction.trim(),a="ask"===e.mode?"a question":"an objective";return n?e.instruction.length>4e3&&(t.instruction="Keep it under 4000 characters."):t.instruction=`Enter ${a}.`,e.originConversationId||(t.origin="Choose the thread that follows this exchange."),"continue"!==e.mode||e.destinationAgentId||(t.destination="Choose the Agent who continues the work."),t},"validateResumeDraft",0,function(e,t){let n={};return e.trim()?e.length>4e3&&(n.instruction="Keep it under 4000 characters."):n.instruction="Enter what to work on.",t||(n.approval="Approve edits in this session to resume work here."),n}],50814)},22016,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var a={default:function(){return x},useLinkStatus:function(){return v}};for(var r in a)Object.defineProperty(n,r,{enumerable:!0,get:a[r]});let s=e.r(90809),i=e.r(43476),o=s._(e.r(71645)),l=e.r(95057),c=e.r(8372),u=e.r(18581),d=e.r(18967),h=e.r(5550),f=e.r(88540),p=e.r(91949),g=e.r(73668),m=e.r(9396);function x(t){var n;let a,r,s,[x,v]=(0,o.useOptimistic)(p.IDLE_LINK_STATUS),y=(0,o.useRef)(null),{href:_,as:$,children:j,prefetch:w=null,passHref:k,replace:N,shallow:C,scroll:S,onClick:E,onMouseEnter:T,onTouchStart:R,legacyBehavior:A=!1,onNavigate:L,transitionTypes:I,ref:O,unstable_dynamicOnHover:P,...U}=t;a=j,A&&("string"==typeof a||"number"==typeof a)&&(a=(0,i.jsx)("a",{children:a}));let q=o.default.useContext(c.AppRouterContext),D=!1!==w,F=!1===w?"none":!0===w?"full":"auto",M="none"!==F?"auto"===F?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,H="string"==typeof(n=$||_)?n:(0,l.formatUrl)(n);if(A){if(a?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});r=o.default.Children.only(a)}let B=A?r&&"object"==typeof r&&r.ref:O,K,Q=o.default.useCallback(e=>(null!==q&&(y.current=(0,p.mountLinkInstance)(e,H,q,M,D,v,K)),()=>{y.current&&((0,p.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,p.unmountPrefetchableInstance)(e)}),[D,H,q,M,v,K]),z={ref:(0,u.useMergedRef)(Q,B),onClick(t){A||"function"!=typeof E||E(t),A&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(t),!q||t.defaultPrevented||function(t,n,a,r,s,i,l,c="none"){if("u">typeof window){let u,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(n)){r&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:h}=e.r(99781);o.default.startTransition(()=>{h(n,r?"replace":"push",!1===s?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,a.current,l,c)})}}(t,H,y,N,S,L,I,F)},onMouseEnter(e){A||"function"!=typeof T||T(e),A&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),q&&D&&(0,p.onNavigationIntent)(e.currentTarget,!0===P)},onTouchStart:function(e){A||"function"!=typeof R||R(e),A&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),q&&D&&(0,p.onNavigationIntent)(e.currentTarget,!0===P)}};return(0,d.isAbsoluteUrl)(H)?z.href=H:A&&!k&&("a"!==r.type||"href"in r.props)||(z.href=(0,h.addBasePath)(H)),s=A?o.default.cloneElement(r,z):(0,i.jsx)("a",{...U,...z,children:a}),(0,i.jsx)(b.Provider,{value:x,children:s})}let b=(0,o.createContext)(p.IDLE_LINK_STATUS),v=()=>(0,o.useContext)(b);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},18581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return r}});let a=e.r(71645);function r(e,t){let n=(0,a.useRef)(null),r=(0,a.useRef)(null);return(0,a.useCallback)(a=>{if(null===a){let e=n.current;e&&(n.current=null,e());let t=r.current;t&&(r.current=null,t())}else e&&(n.current=s(e,a)),t&&(r.current=s(t,a))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},73668,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return s}});let a=e.r(18967),r=e.r(52817);function s(e){if(!(0,a.isAbsoluteUrl)(e))return!0;try{let t=(0,a.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,r.hasBasePath)(n.pathname)}catch(e){return!1}}},98183,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a={assign:function(){return l},searchParamsToUrlQuery:function(){return s},urlQueryToSearchParams:function(){return o}};for(var r in a)Object.defineProperty(n,r,{enumerable:!0,get:a[r]});function s(e){let t={};for(let[n,a]of e.entries()){let e=t[n];void 0===e?t[n]=a:Array.isArray(e)?e.push(a):t[n]=[e,a]}return t}function i(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[n,a]of Object.entries(e))if(Array.isArray(a))for(let e of a)t.append(n,i(e));else t.set(n,i(a));return t}function l(e,...t){for(let n of t){for(let t of n.keys())e.delete(t);for(let[t,a]of n.entries())e.append(t,a)}return e}},95057,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var a={formatUrl:function(){return o},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var r in a)Object.defineProperty(n,r,{enumerable:!0,get:a[r]});let s=e.r(90809)._(e.r(98183)),i=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:n}=e,a=e.protocol||"",r=e.pathname||"",o=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(s.urlQueryToSearchParams(l)));let u=e.search||l&&`?${l}`||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||i.test(a))&&!1!==c?(c="//"+(c||""),r&&"/"!==r[0]&&(r="/"+r)):c||(c=""),o&&"#"!==o[0]&&(o="#"+o),u&&"?"!==u[0]&&(u="?"+u),r=r.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${a}${c}${r}${u}${o}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return o(e)}},18967,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var a={DecodeError:function(){return x},MiddlewareNotFoundError:function(){return _},MissingStaticPage:function(){return y},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return s},execOnce:function(){return i},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return l},isResSent:function(){return h},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return $}};for(var r in a)Object.defineProperty(n,r,{enumerable:!0,get:a[r]});let s=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,n=!1;return(...a)=>(n||(n=!0,t=e(...a)),t)}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&o.test(e)};function c(){let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?":"+n:""}`}function u(){let{href:e}=window.location,t=c();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function h(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let a=await e.getInitialProps(t);if(n&&h(n))return a;if(!a)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${a}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return a}let g="u">typeof performance,m=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class x extends Error{}class b extends Error{}class v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class y extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class _ extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function $(e){return JSON.stringify({message:e.message,stack:e.stack})}}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70925,e=>{"use strict";var t=e.i(43476),a=e.i(71645),n=e.i(22016),s=e.i(18566),l=e.i(87303),i=e.i(89873),r=e.i(3136),o=e.i(10718);let c=(0,a.createContext)(null),d=[{label:"Overview",segment:""},{label:"Sessions",segment:"sessions"},{label:"Conversations",segment:"conversations"},{label:"Slack",segment:"slack"},{label:"Activity",segment:"activity"}];e.s(["default",0,function({children:e}){let u=String((0,s.useParams)().id??""),h=(0,s.usePathname)(),g=(0,s.useRouter)(),m=(0,s.useSearchParams)(),[v,w]=(0,a.useState)([]),[b,f]=(0,a.useState)(null),[j,p]=(0,a.useState)(!0),[x,N]=(0,a.useState)(!1),[A,S]=(0,a.useState)(!1),[y,C]=(0,a.useState)(()=>{let e=Number(m.get("deleted"))||0;return e>0?(0,o.deletedStatusLine)(e):""}),[k,I]=(0,a.useState)({serverNow:0,fetchedAt:0}),[P,R]=(0,a.useState)(()=>Date.now()),$=(0,a.useCallback)(async e=>{try{let[t,a]=await Promise.all([fetch("/api/bots",{cache:"no-store"}),fetch(`/api/bots/${encodeURIComponent(u)}/overview`,{cache:"no-store"})]),n=t.ok?await t.json():[];if(e())return;w(Array.isArray(n)?n:[]);let s=Date.parse(t.headers.get("date")||"");if(I({serverNow:Number.isNaN(s)?Date.now():s,fetchedAt:Date.now()}),404===a.status){S(!0),f(null),N(!1);return}if(!a.ok)throw Error("overview request failed");let l=await a.json();if(e())return;f(l),S(!1),N(!1)}catch{e()||N(!0)}finally{e()||p(!1)}},[u]);(0,a.useEffect)(()=>{let e=!1,t=()=>e,a=window.setTimeout(()=>{$(t)},0),n=window.setInterval(()=>{$(t)},2e3),s=window.setInterval(()=>R(Date.now()),1e3);return()=>{e=!0,window.clearTimeout(a),window.clearInterval(n),window.clearInterval(s)}},[$]);let D=b?.agent,T=b?.runtime;return(0,t.jsx)(c.Provider,{value:{id:u,agents:v,overview:b,loading:j,error:x,notFound:A},children:(0,t.jsxs)("div",{className:"field agent-field",children:[(0,t.jsx)(i.default,{agents:v,activeAgentId:u,beatClock:k,now:P,status:y,onAgentsChange:w,onNew:()=>g.push("/?new=1"),onManage:()=>g.push("/?manage=1"),onDeleted:e=>{C((0,o.deletedStatusLine)(e.length)),e.some(e=>e.id===u)&&g.replace(`/?deleted=${e.length}`)}}),(0,t.jsxs)("section",{className:"pane agent-pane",children:[(0,t.jsxs)("header",{className:"agent-shell-header",children:[(0,t.jsxs)("div",{className:"agent-shell-identity",children:[D?(0,t.jsx)(l.default,{bot:D,size:48,title:`${D.name} avatar`}):null,(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"agent-shell-kicker",children:"Agent"}),(0,t.jsx)("h1",{children:D?.name??(j?"Loading…":"Unknown Agent")}),D?(0,t.jsx)("p",{children:D.role}):null]})]}),T?(0,t.jsxs)("div",{className:"agent-shell-runtime","aria-label":"Runtime and availability",children:[(0,t.jsx)("span",{className:T.available?"availability is-available":"availability is-blocked",children:T.available?"Available":"Needs setup"}),(0,t.jsxs)("span",{children:[(0,r.agentLabel)(T.agent)," · ",T.connection||"No connection"]})]}):null]}),(0,t.jsxs)("nav",{className:"agent-tabs","aria-label":"Agent",children:[d.map(e=>{let a=`/agents/${encodeURIComponent(u)}${e.segment?`/${e.segment}`:""}`,s=h===a;return(0,t.jsx)(n.default,{href:a,"aria-current":s?"page":void 0,children:e.label},e.label)}),(0,t.jsx)(n.default,{href:`/bots/${encodeURIComponent(u)}/config`,children:"Config"})]}),(0,t.jsx)("main",{className:"agent-content",children:e})]})]})})},"useAgentOverview",0,function(){let e=(0,a.useContext)(c);if(!e)throw Error("useAgentOverview must be used inside AgentShell");return e}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69603,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(22016),s=e.i(18566),r=e.i(13255),i=e.i(46986),o=e.i(15366),l=e.i(70925),c=e.i(74904),d=e.i(68684),u=e.i(96594),p=e.i(64711),h=e.i(54423);function m(e){let t=e;for(let e=0;e<4;e++){let e=t.replace(/^\s*\[(?:Message from|From) [^\]]+\]\s*(?:\r?\n)?/,"");if(e===t)break;t=e}return t.replace(/^\s+/,"")}function f(e,t){let n=new Map(e.map(e=>[e.id,e]));for(let e of t)n.set(e.id,e);return[...n.values()].sort((e,t)=>e.created_at-t.created_at||e.id.localeCompare(t.id))}function g({message:e,conversationId:a,status:s,writable:r,onDone:i}){let o=(0,d.parseDraft)(m(e.content)),[l,c]=(0,n.useState)(o?.recipient??""),[u,p]=(0,n.useState)(o?.body??""),[h,f]=(0,n.useState)(!1);if(!o)return null;let v=!r||"open"!==s,b=async t=>{v||h||(f(!0),await fetch(`/api/conversations/${encodeURIComponent(a)}/draft`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messageId:e.id,action:t,recipient:l,body:u})}),f(!1),i())};return(0,t.jsxs)("div",{className:"draft-card",children:[(0,t.jsx)("div",{className:"draft-title",children:(0,d.draftTitle)(o.channel)}),(0,t.jsx)("input",{"aria-label":"Recipient",value:v?o.recipient:l,readOnly:v,onChange:e=>c(e.target.value)}),(0,t.jsx)("textarea",{rows:3,"aria-label":"Draft body",value:v?o.body:u,readOnly:v,onChange:e=>p(e.target.value)}),"open"===s&&r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"approve-control",disabled:h||!l.trim(),onClick:()=>void b("send"),children:"Send"}),(0,t.jsx)("button",{type:"button",className:"approve-control",disabled:h,onClick:()=>void b("discard"),children:"Discard"})]}):(0,t.jsx)("span",{className:"draft-mark",children:"open"===s?"Read only":"sent"===s?"Sent":"Discarded"})]})}function v({message:e,conversationId:a,status:s,writable:r,onDone:i}){let o=(0,d.parseApprovalCode)(e.content),[l,c]=(0,n.useState)(!1);if(!o)return null;if(!r||"pending"!==s)return(0,t.jsx)("span",{className:"draft-mark",children:"pending"===s?"Approval is read only":"approved"===s?"Approved":"Denied"});let u=async t=>{l||(c(!0),await fetch(`/api/conversations/${encodeURIComponent(a)}/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:o,messageId:e.id})}),c(!1),i())};return(0,t.jsxs)("span",{className:"draft-mark",children:[(0,t.jsx)("button",{type:"button",className:"approve-control",disabled:l,onClick:()=>void u("approve"),children:"Approve"}),(0,t.jsx)("button",{type:"button",className:"approve-control",disabled:l,onClick:()=>void u("deny"),children:"Deny"})]})}function b({names:e}){return e.length?(0,t.jsx)(t.Fragment,{children:e.map(e=>(0,t.jsxs)("span",{children:[(0,t.jsx)("br",{}),(0,t.jsxs)("a",{className:"file-control",href:`/api/files/${encodeURIComponent(e)}`,download:e,children:["Download ",e]})]},e))}):null}e.s(["default",0,function(){let e=(0,s.useParams)(),y=(0,s.useSearchParams)(),x=String(e.id??""),w=String(e.conversationId??""),{overview:_}=(0,l.useAgentOverview)(),[$,k]=(0,n.useState)(null),[j,N]=(0,n.useState)([]),[C,S]=(0,n.useState)(null),[I,A]=(0,n.useState)([]),[R,T]=(0,n.useState)(""),[q,D]=(0,n.useState)(!1),[L,U]=(0,n.useState)(!1),[E,O]=(0,n.useState)(""),[M,F]=(0,n.useState)([]),[P,H]=(0,n.useState)(""),[B,K]=(0,n.useState)(!1),[Q,Y]=(0,n.useState)(0),J=(0,n.useRef)(null),V=(0,n.useRef)(null),W=(0,n.useRef)(null),z=(0,n.useRef)(!1),G=(0,n.useRef)(!1),Z=(0,n.useCallback)(async(e=null,t=!1)=>{if(x&&w){t&&U(!0);try{let n=new URLSearchParams({limit:"60"});e&&n.set("cursor",e);let[a,s]=await Promise.all([fetch(`/api/bots/${encodeURIComponent(x)}/conversations/${encodeURIComponent(w)}?${n}`,{cache:"no-store"}),fetch(`/api/exchanges?conversation=${encodeURIComponent(w)}`,{cache:"no-store"})]);if(404===a.status){D(!0),T("");return}let r=await a.json().catch(()=>null);if(!a.ok||!r||!Array.isArray(r.messages))throw Error("history");let i=await s.json().catch(()=>null);k(r),N(e=>t?f(r.messages,e):f(e,r.messages)),(t||!z.current)&&S(r.next_cursor),s.ok&&Array.isArray(i?.exchanges)&&A(i.exchanges),T(""),D(!1)}catch{T("Could not load this conversation.")}finally{U(!1)}}},[w,x]);(0,n.useEffect)(()=>{let e=window.setTimeout(()=>{Z()},0),t=window.setInterval(()=>{Z()},2e3);return()=>{window.clearTimeout(e),window.clearInterval(t)}},[Z,Q]),(0,n.useEffect)(()=>{$&&!z.current&&(z.current=!0,W.current?.lastElementChild?.scrollIntoView({block:"end"}),$.writable&&J.current?.focus({preventScroll:!0}))},[$]),(0,n.useEffect)(()=>{let e=y.get("exchange");if(!e||G.current)return;let t=document.getElementById(`exchange-${e}`);t&&(G.current=!0,t.scrollIntoView({block:"center"}),t.focus({preventScroll:!0}))},[I,y]);let X=e=>{let t=6-M.length;H(e.length>t?"Up to six attachments.":""),F(n=>[...n,...e.slice(0,Math.max(t,0)).map((e,t)=>({id:`${e.name}-${e.size}-${n.length+t}`,name:e.name}))])},ee=async()=>{if(!$?.writable||B)return;let e=[E.trim(),...M.map(e=>e.name)].filter(Boolean).join("\n");if(e){K(!0);try{if(!(await fetch(`/api/conversations/${encodeURIComponent(w)}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e,idempotencyKey:crypto.randomUUID()})})).ok)throw Error("send");O(""),F([]),H(""),await Z()}catch{H("Message could not be sent. Try again.")}finally{K(!1)}}},et=async e=>{if(!$?.writable)return;let t=e?`/messages/${encodeURIComponent(e)}/stop`:"/stop";await fetch(`/api/conversations/${encodeURIComponent(w)}${t}`,{method:"POST"}),await Z()};if(q)return(0,t.jsxs)("div",{className:"conversation-detail-state",children:[(0,t.jsx)("h2",{children:"Conversation not found"}),(0,t.jsx)("p",{children:"This conversation does not involve the selected Agent or no longer exists."}),(0,t.jsx)(a.default,{href:`/agents/${encodeURIComponent(x)}/conversations`,children:"All conversations"})]});if(!$&&!R)return(0,t.jsx)("p",{className:"conversation-detail-state",role:"status","data-conversation-detail-state":"loading",children:"Loading conversation…"});if(!$&&R)return(0,t.jsxs)("div",{className:"conversation-detail-state",role:"alert","data-conversation-detail-state":"error",children:[(0,t.jsx)("p",{children:R}),(0,t.jsx)("button",{type:"button",onClick:()=>Y(e=>e+1),children:"Retry"})]});if(!$)return null;let en=(0,h.wakeNotices)($.events).map(e=>({...e,actionable:e.actionable&&$.writable})),ea=new Set,es=new Set,er=e=>en.filter(t=>!ea.has(t.eventId)&&t.createdAt<e).map(e=>(ea.add(e.eventId),(0,t.jsx)("li",{className:"msg-status",children:(0,t.jsx)(o.default,{notice:e,onDone:()=>void Z()})},e.eventId))),ei=e=>I.filter(t=>!es.has(t.id)&&t.created_at<e).sort((e,t)=>e.created_at-t.created_at).map(e=>(es.add(e.id),(0,t.jsx)("li",{className:"msg-status",children:(0,t.jsx)(r.default,{summary:e,onChanged:()=>void Z()})},e.id)));return(0,t.jsxs)("div",{className:"conversation-detail","data-conversation-writable":$.writable?"true":"false",children:[(0,t.jsxs)("header",{className:"conversation-detail-head",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(a.default,{href:`/agents/${encodeURIComponent(x)}/conversations`,children:"← Conversations"}),(0,t.jsx)("p",{className:"agent-eyebrow",children:"direct"===$.type?"Direct conversation":"group"===$.type?"Group history":$.origin?.kind==="service"?"External-service history":"Agent-to-Agent history"}),(0,t.jsx)("h2",{children:$.label}),(0,t.jsx)("p",{className:"conversation-participant-line",children:$.participants.map(e=>e.label).join(" · ")}),(0,t.jsxs)("p",{className:"conversation-origin-line",children:["Origin: ",$.origin?.label??"Unknown"," · ",$.message_count," messages"]})]}),$.writable?(0,t.jsx)("button",{type:"button",className:"conversation-stop",onClick:()=>void et(),children:"Stop delegated turns"}):null]}),$.writable?null:(0,t.jsxs)("aside",{className:"conversation-read-only",role:"note",children:[(0,t.jsx)("strong",{children:"Read-only history"}),(0,t.jsx)("p",{children:$.read_only_reason}),_?.conversation?(0,t.jsx)(a.default,{href:`/agents/${encodeURIComponent(x)}/conversations/${encodeURIComponent(_.conversation.id)}`,children:"Open direct conversation"}):null]}),R?(0,t.jsxs)("p",{className:"conversation-refresh-error",role:"alert",children:[R," Showing the last loaded history."]}):null,(0,t.jsxs)("div",{className:"conversation-history",children:[C?(0,t.jsx)("button",{className:"conversation-older",type:"button",disabled:L,onClick:()=>void Z(C,!0),children:L?"Loading…":"Load older messages"}):null,(0,t.jsxs)("ol",{ref:W,className:"conversation-message-list","aria-label":"Conversation history",children:[0===j.length?(0,t.jsx)("li",{className:"conversation-empty-history",children:"No messages in this conversation yet."}):null,j.map(e=>{let a="You"===e.sender_name,s=m(e.content),r=a?null:(0,u.classifyRuntimeFailure)(s),o=a?null:(0,p.parseRun)(e.content),l=a||o?null:(0,d.parseDraft)(s),h=a||o?null:(0,d.parseApprovalCode)(e.content);return(0,t.jsxs)(n.Fragment,{children:[er(e.created_at),ei(e.created_at),(0,t.jsxs)("li",{className:a?"msg-you":"msg-bot",children:[(0,t.jsx)("div",{className:a?"msg-name msg-name-you":"msg-name",children:e.sender_name}),r?(0,t.jsx)("div",{className:"msg-status",children:(0,t.jsx)(i.default,{failure:r})}):o?(0,t.jsxs)("div",{className:"msg-body",children:[(0,p.runLine)(o),"running"===o.state&&$.writable?(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("button",{type:"button",className:"attach-word",onClick:()=>void et(e.id),children:"Stop"})]}):null]}):l&&e.draftStatus?(0,t.jsx)("div",{className:"msg-body",children:(0,t.jsx)(g,{message:e,conversationId:w,status:e.draftStatus,writable:$.writable,onDone:()=>void Z()})}):(0,t.jsxs)("div",{className:"msg-body",children:[function(e,n){let a=String(e??"").split("\n");if(!a.some(e=>null!==(0,c.agentEventDisplay)(e)))return e;let s=[];return a.forEach((e,a)=>{a>0&&s.push((0,t.jsx)("br",{},`${n}-br-${a}`));let r=(0,c.agentEventDisplay)(e);s.push(r?(0,t.jsxs)("span",{className:"agent-event",children:[(0,t.jsx)("span",{className:"agent-event-label",children:r.label}),r.detail?` ${r.detail}`:""]},`${n}-${a}`):(0,t.jsx)("span",{children:e},`${n}-${a}`))}),s}(s,e.id),h&&e.approvalStatus?(0,t.jsx)(v,{message:e,conversationId:w,status:e.approvalStatus,writable:$.writable,onDone:()=>void Z()}):null,(0,t.jsx)(b,{names:(0,d.parseFileNames)(e.content)})]})]})]},e.id)}),er(1/0),ei(1/0)]})]}),$.writable?(0,t.jsxs)("div",{className:"composer conversation-composer",onPaste:e=>{let t=Array.from(e.clipboardData.files??[]);t.length&&(e.preventDefault(),X(t))},children:[(0,t.jsxs)("div",{className:"composer-box",children:[P?(0,t.jsx)("p",{className:"attach-error",role:"alert",children:P}):null,M.length?(0,t.jsx)("div",{className:"attach-names",children:M.map(e=>(0,t.jsx)("span",{children:e.name},e.id))}):null,(0,t.jsx)("textarea",{ref:J,rows:2,value:E,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),ee())},placeholder:`Message ${_?.agent.name??"this Agent"}`,"aria-label":"Message"})]}),(0,t.jsx)("input",{ref:V,className:"attach-input",type:"file",multiple:!0,onChange:e=>{X(Array.from(e.target.files??[])),e.target.value=""}}),(0,t.jsx)("button",{type:"button",className:"attach-word",onClick:()=>V.current?.click(),children:"Attach"}),(0,t.jsx)("button",{type:"button",className:"send-btn",disabled:B,onClick:()=>void ee(),children:B?"Sending…":"Send"})]}):null]})}])},13255,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(22016),s=e.i(50814);e.s(["default",0,function({summary:e,onChanged:r}){let[i,o]=(0,n.useState)(!1),[l,c]=(0,n.useState)(""),d=(0,s.stateTone)(e.state),u=(0,s.outcomeLine)(e),p=(0,s.failureAdvice)(e),h=`exchange-${e.id}-title`,m=async()=>{if(!i){o(!0),c("");try{let t=await fetch(`/api/exchanges/${encodeURIComponent(e.id)}/cancel`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!t.ok){let e=await t.json().catch(()=>null);c("string"==typeof e?.error?.message?e.error.message:"Could not cancel. Try again.")}}catch{c("Could not cancel. Try again.")}finally{o(!1),r?.()}}};return(0,t.jsxs)("article",{id:`exchange-${e.id}`,className:`exchange-card is-${d} is-${e.state}`,"data-exchange-id":e.id,"data-exchange-state":e.state,"aria-labelledby":h,tabIndex:-1,children:[(0,t.jsxs)("p",{className:"exchange-card-line",children:[(0,t.jsx)("span",{className:"exchange-card-mode",children:(0,s.modeLabel)(e.mode)}),(0,t.jsx)("span",{id:h,className:"exchange-card-title",children:(0,s.participantsLabel)(e)}),(0,t.jsx)("span",{className:"exchange-card-state",role:"status",children:(0,s.liveStateLabel)(e)})]}),(0,t.jsx)("p",{className:"exchange-card-session",children:(0,s.sessionLabel)(e)}),(0,t.jsxs)("p",{className:"exchange-card-instruction",children:[(0,t.jsx)("span",{className:"exchange-card-key",children:(0,s.instructionHeading)(e.mode)})," ",(0,s.excerpt)(e.instruction,220)]}),u?(0,t.jsx)("p",{className:"failed"===e.state?"exchange-card-outcome is-failure":"exchange-card-outcome",children:u}):null,p?(0,t.jsx)("p",{className:"exchange-card-advice",children:p}):null,l?(0,t.jsx)("p",{className:"exchange-card-error",role:"alert",children:l}):null,(0,t.jsxs)("p",{className:"exchange-card-foot",children:[(0,t.jsxs)("span",{className:"exchange-card-time",children:["Updated ",(0,s.formatExchangeTime)(e.updated_at)]}),(0,t.jsx)(a.default,{className:"exchange-card-link",href:(0,s.detailsHref)(e.id),"aria-label":`Details: ${(0,s.modeLabel)(e.mode)} ${(0,s.participantsLabel)(e)}`,children:"Details"}),e.can_cancel?(0,t.jsx)("button",{type:"button",className:"exchange-card-cancel",disabled:i,onClick:()=>{m()},children:i?"Cancelling…":"Cancel"}):null]})]})}])},46986,15366,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(96594);e.s(["default",0,function({failure:e}){let[s,r]=(0,n.useState)("idle"),i=(0,a.severityLabel)(e.severity),o=(0,n.useId)();async function l(){try{await navigator.clipboard.writeText(e.detail),r("copied")}catch{r("failed")}}return(0,t.jsxs)("div",{className:`runtime-failure runtime-failure-${e.severity}`,role:"status","aria-labelledby":o,"data-runtime-failure":e.kind,children:[(0,t.jsxs)("p",{className:"runtime-failure-title",id:o,children:[(0,t.jsx)("span",{className:"runtime-failure-severity",children:i}),e.title]}),(0,t.jsx)("p",{className:"runtime-failure-recovery",children:e.recovery}),(0,t.jsxs)("details",{className:"runtime-failure-details",children:[(0,t.jsx)("summary",{children:"Details"}),(0,t.jsx)("code",{className:"runtime-failure-detail",children:e.detail}),(0,t.jsx)("button",{type:"button",className:"runtime-failure-copy",onClick:()=>{l()},children:"copied"===s?"Copied":"failed"===s?"Copy failed":"Copy details"})]})]})}],46986);let s={blocked:"Needs approval",rejected:"Not started",allowed:"Allowed",denied:"Denied",waiting:"Queued",stopped:"Stopped"};e.s(["default",0,function({notice:e,onDone:a}){let[r,i]=(0,n.useState)(!1),[o,l]=(0,n.useState)(""),c="blocked"!==e.tone||e.actionable?s[e.tone]:"Blocked",d=async t=>{if(!r&&e.wakeId){i(!0),l("");try{let n=await fetch(`/api/wakes/${e.wakeId}/decision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:t})});if(!n.ok){let e=await n.json().catch(()=>null);l("string"==typeof e?.error?.message?e.error.message:"The decision could not be recorded.")}}catch{l("The decision could not be recorded.")}finally{i(!1),a()}}};return(0,t.jsxs)("div",{className:`wake-notice wake-notice-${e.tone}`,role:"status","data-wake-notice":e.tone,"data-wake-id":e.wakeId??void 0,children:[(0,t.jsxs)("p",{className:"wake-notice-line",children:[(0,t.jsx)("span",{className:"wake-notice-label",children:c}),e.text]}),e.actionable?(0,t.jsxs)("div",{className:"wake-notice-actions",children:[(0,t.jsx)("button",{type:"button",className:"approve-control",disabled:r,onClick:()=>{d("allow")},children:"Allow"}),(0,t.jsx)("button",{type:"button",className:"approve-control",style:{marginLeft:8},disabled:r,onClick:()=>{d("deny")},children:"Deny"})]}):null,o?(0,t.jsx)("p",{className:"wake-notice-error",role:"alert",children:o}):null]})}],15366)},68684,e=>{"use strict";e.s(["draftTitle",0,function(e){return"email"===e?"New Email":"New Slack Message"},"parseApprovalCode",0,function(e){let t=e.match(/approve using the code ([A-Za-z0-9][A-Za-z0-9_-]*)/i);return t?t[1]:null},"parseDraft",0,function(e){let t,n=e.match(/^\s*\[draft\]\s*([\s\S]*)$/);if(!n)return null;try{t=JSON.parse(n[1])}catch{return null}if(!t||"object"!=typeof t)return null;let a=t;return"email"!==a.channel&&"slack"!==a.channel||"open"!==a.state&&"sent"!==a.state&&"discarded"!==a.state||"string"!=typeof a.recipient||"string"!=typeof a.body?null:{channel:a.channel,recipient:a.recipient,body:a.body,state:a.state}},"parseFileNames",0,function(e){let t=[];for(let n of e.split("\n")){let e=n.match(/^\s*\[file\]\s*(\S+)\s*$/i);e&&!t.includes(e[1])&&t.push(e[1])}return t},"parseHandoff",0,function(e){let t=e.match(/^\s*\[Handing off to ([^\]]+)\]/);return t&&t[1].trim()||null}])},50814,63352,e=>{"use strict";function t(e){return`${new Date(e).toISOString().slice(0,16).replace("T"," ")} UTC`}function n(e){return e?e.split("/").filter(e=>e.length>0).pop()??null:null}function a(e,t){let n=function(e){if(!e)return null;let t=e.toLowerCase();return"muse code"===t?"muse":(["codex","claude","cursor","hermes","muse"].includes(t),t)}(t);switch(e){case"provider_unavailable":return n?{reason:`${n} is not installed or did not start`,fix:`Install ${n} and Retry.`}:{reason:"the runtime is not installed or did not start",fix:"Install the runtime and Retry."};case"auth_required":return{reason:"not signed in",fix:"Sign in and Retry."};case"permission_denied":return{reason:"permission denied",fix:"Check permissions and Retry."};case"incompatible_version":return{reason:"incompatible version",fix:"Update the runtime and Retry."};case"usage_limit":return{reason:"usage limit reached",fix:"Wait or upgrade and Retry."};case"scope_missing":return{reason:"no session scope is set",fix:"Choose a scope in Config."};case"provider_failed":return{reason:"the listing failed",fix:"Retry."};default:return{reason:e,fix:"Retry."}}}let s="Not reported";function r(e){return e.toFixed(1).replace(/\.0$/,"")}function i(e){return e.toLocaleString("en-US")}function o(e){return 0===e?"$0.00":e>=.01?`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`:e<1e-4?"<$0.0001":`$${e.toFixed(4)}`}let l={input_tokens:"Input tokens",output_tokens:"Output tokens",cost_usd:"Cost"};function c(e,t,n){return"cost_usd"===e?o(t):n?i(t):t<1e3?String(t):t<999950?`${r(t/1e3)}k`:t<99995e4?`${r(t/1e6)}M`:`${r(t/1e9)}B`}function d(e){return`${e} ${1===e?"run":"runs"}`}function u(e,t,n=!1){let a=l[e];if(!t||"unavailable"===t.quality||null===t.sum)return{name:a,text:s,quality:"unavailable",coverage:t&&t.total>0?`0 of ${d(t.total)} reported`:"No runs recorded",label:`${a}: not reported`};let r=c(e,t.sum,n),i=c(e,t.sum,!0);return"partial"===t.quality?{name:a,text:r,quality:"partial",coverage:`Partial: ${t.known} of ${d(t.total)} reported`,label:`${a}: at least ${i}, partial, reported by ${t.known} of ${d(t.total)}`}:{name:a,text:r,quality:"complete",coverage:`All ${d(t.total)} reported`,label:`${a}: ${i}, reported by all ${d(t.total)}`}}e.s(["SESSION_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"ended",label:"Ended"}],"attemptLabel",0,function(e){let t="source"===e.role?"Started the session":"Resumed the session";return`${t} \xb7 ${e.outcome??"running"}`},"emptySessionsCopy",0,function(e,t,n,s){if("active"===e)return`${t} has no active sessions.`;if("ended"===e)return`${t} has no ended sessions.`;if(n?.last_error_code){let{reason:e,fix:t}=a(n.last_error_code,s),r=s?`${s} sessions`:"sessions";return`Could not read ${r}: ${e}. ${t}`}if(n&&null===n.synced_at)return`${t} has not synced sessions yet. Refresh to load past sessions.`;let r=n?.out_of_scope_count??0;return r>0?`${r} ${1===r?"session exists":"sessions exist"} outside ${t}'s scope. Widen the scope to see them.`:`${t} has no sessions yet. One appears after a coding run keeps its runtime context.`},"formatSessionDate",0,t,"formatSyncRelativeTime",0,function(e,t=Date.now()){if(null===e)return"never";let n=Math.max(0,t-e);if(n<6e4)return"just now";let a=Math.floor(n/6e4);if(a<60)return`${a} minute${1===a?"":"s"} ago`;let s=Math.floor(a/60);if(s<24)return`${s} hour${1===s?"":"s"} ago`;let r=Math.floor(s/24);return`${r} day${1===r?"":"s"} ago`},"noMatchingSessionsCopy",0,function(e,t){let a=e.trim();if(a)return`No sessions match “${a}”.`;let s=n(t);return s?`No sessions in ${s}.`:"No sessions match the current filters."},"registrationSessionSyncCopy",0,function(e,t){if("failed"===e.outcome){let{reason:n,fix:s}=a(e.error_code??"provider_failed",t);return`Could not read ${t} sessions: ${n}. ${s}`}if("unsupported"===e.outcome)return`Past sessions are not available for ${t}.`;let n=1===e.imported?"session":"sessions",s=`Loaded ${e.imported} ${n}`;return e.rejected_out_of_scope>0&&(s+=`, ${e.rejected_out_of_scope} outside the scope`),e.complete||(s+=", more remain"),`${s}.`},"runtimeLabel",0,function(e){return e.agent.transport?`${e.agent.adapter} \xb7 ${e.agent.transport}`:e.agent.adapter},"sessionOriginChips",0,function(e){let t=[],n=e.origin.work_request?.requester;return n?.kind==="person"?t.push("Human origin"):n?.kind==="bot"?t.push(n.name?`${n.name} Agent`:"Agent origin"):n?.kind==="service"&&t.push("Service origin"),e.origin.conversation&&t.push(e.origin.conversation.label),[...new Set(t)]},"sessionStateTags",0,function(e){let t=[];return(e.home&&t.push("Home"),e.state?.availability==="missing")?[...t,"Missing"]:(e.state?.lifecycle==="archived"&&t.push("Archived"),e.state?.busy&&t.push("Busy"),(e.resumable||e.state?.resumable===!0)&&t.push("Resumable"),t)},"sessionUsageLine",0,function(e){let t=u("input_tokens",e?.input_tokens),n=u("output_tokens",e?.output_tokens),a=u("cost_usd",e?.cost_usd),r=[t,n,a];if(r.every(e=>"unavailable"===e.quality))return{text:s,label:"Usage: not reported",quality:"unavailable",partial:!1};let i=["unavailable"===t.quality?"input not reported":`${t.text} in`,"unavailable"===n.quality?"output not reported":`${n.text} out`,"unavailable"===a.quality?"cost not reported":a.text].join(" · "),o=r.some(e=>"partial"===e.quality),l=o||r.some(e=>"unavailable"===e.quality)?"partial":"complete";return{text:i,label:`Reported usage: ${r.map(e=>e.label).join("; ")}`,quality:l,partial:o}},"statusLabel",0,function(e){return"active"===e.status?"Active":"Ended"},"usageMetricView",0,u,"usageSampleLabel",0,function(e,t){let n="turn"===e.kind?"start"===e.turn_kind?"provider turn, started":"provider turn":"resume"===e.turn_kind?"resumed":"started";return`Run ${t+1} \xb7 ${n}`},"usageSampleValues",0,function(e){return{input:null===e.input_tokens?s:i(e.input_tokens),output:null===e.output_tokens?s:i(e.output_tokens),cost:null===e.cost_usd?s:o(e.cost_usd)}},"workRequestLabel",0,function(e){var t;let n=e.origin.work_request;return n?`${(t=n.execution_kind)?t[0].toUpperCase()+t.slice(1):t} \xb7 ${n.state}`:null},"workspaceFolderName",0,n,"workspaceOptions",0,function(e){let t=[...new Set(e.filter(e=>"string"==typeof e&&e.length>0))],a=t.map(e=>n(e)??e);return t.map((e,t)=>({value:e,label:a.filter(e=>e===a[t]).length>1?e:a[t]})).sort((e,t)=>e.label<t.label?-1:+(e.label>t.label))}],63352);let p={ask:"Ask from this context",resume:"Resume work here",handoff:"Hand off to…"},h=["queued","extracting","delivering","completed","failed","cancelled"],m=["completed","failed","cancelled"];function f(e,t){switch(t){case"queued":return"Queued";case"extracting":return"ask"===e?"Asking the session":"Extracting handoff";case"delivering":return"Delivering handoff";case"completed":return"ask"===e?"Answered":"Handed off";case"failed":return"Failed";case"cancelled":return"Cancelled"}}function g(e,t=140){let n=String(e??"").split("\n").map(e=>e.trim()).filter(e=>e.length>0).join(" ");return n.length>t?`${n.slice(0,t-1).trimEnd()}…`:n}function v(e,t){return t.updated_at-e.updated_at||t.created_at-e.created_at||(e.id<t.id?-1:+(e.id>t.id))}e.s(["DEFAULT_LEDGER_FILTER",0,{mode:"all",state:"all",agentId:""},"INSTRUCTION_LIMIT",0,4e3,"MODE_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"ask",label:"Ask"},{value:"continue",label:"Continue"}],"STATE_FILTER_OPTIONS",0,[{value:"all",label:"Any status"},{value:"active",label:"In progress"},{value:"queued",label:"Queued"},{value:"extracting",label:"Asking / extracting"},{value:"delivering",label:"Delivering"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"}],"detailsHref",0,function(e){return`/exchanges?id=${encodeURIComponent(e)}`},"eventLabel",0,function(e,t){let n=e.data??{},a=t.source.agent_name,s=t.destination?.agent_name??"the destination Agent",r="string"==typeof n.hop?n.hop:null;switch(e.type){case"created":return"ask"===t.mode?`You asked ${a}'s session a question`:`You handed ${a}'s session to ${s}`;case"hop_queued":if("deliver"===r)return`Handoff queued for ${s}'s new session`;return"extract"===r?`Handoff extraction queued in ${a}'s session`:`Question queued for ${a}'s session`;case"hop_started":if("deliver"===r)return`${s} started a new session`;return"extract"===r?`${a}'s session started extracting the handoff`:`${a}'s session started answering`;case"state_changed":{let e="string"==typeof n.to&&h.includes(n.to)?n.to:null;return e?`Now ${f(t.mode,e).toLowerCase()}`:"State changed"}case"answer_returned":return`Answer returned to ${t.origin?.label??"the origin thread"}${n.truncated?" (shortened)":""}`;case"packet_extracted":return"Handoff packet extracted";case"packet_rejected":return`Handoff packet refused${"string"==typeof n.reason?`: ${n.reason}`:""}`;case"destination_replied":return`${s} replied in ${t.destination?.conversation?.label??"its thread"}`;case"destination_session_rejected":return`${s}'s session was not new; the handoff stopped`;case"cancel_requested":return"You asked to cancel";case"hop_result_discarded":return"A late result was discarded";default:return e.type.replace(/_/g," ")}},"excerpt",0,g,"exchangeRequestBody",0,function(e,t,n){let a={mode:e.mode,idempotency_key:n,origin_conversation_id:e.originConversationId,source:{agent_id:t.agentId,session_ref:t.sessionRef},instruction:e.instruction.trim()};return"continue"===e.mode&&(a.destination={agent_id:e.destinationAgentId}),a},"failureAdvice",0,function(e){if("failed"!==e.state)return null;switch(e.failure?.code){case"packet_invalid":case"packet_missing":return"The source session did not return a usable handoff. Start a new Continue with a clearer objective.";case"destination_session_invalid":return"The destination did not start a fresh session. Check its runtime, then start a new Continue.";case"destination_turn_failed":return"Check the destination Agent’s runtime, then start a new Continue from the source session.";case"source_turn_failed":return"Check the source Agent’s runtime, then start a new exchange from its Sessions.";default:return"Start a new exchange from the session to try again."}},"formatExchangeTime",0,function(e){return t(e)},"instructionHeading",0,function(e){return"ask"===e?"Question":"Objective"},"ledgerAgents",0,function(e){let t=new Map;for(let n of e)t.set(n.source.agent_id,n.source.agent_name),n.destination&&t.set(n.destination.agent_id,n.destination.agent_name);return[...t.entries()].map(([e,t])=>({id:e,name:t})).sort((e,t)=>e.name.localeCompare(t.name)||e.id.localeCompare(t.id))},"ledgerRows",0,function(e,t){return e.filter(e=>("all"===t.mode||e.mode===t.mode)&&("active"!==t.state||!e.terminal)&&("all"===t.state||"active"===t.state||e.state===t.state)&&(!t.agentId||e.source.agent_id===t.agentId||e.destination?.agent_id===t.agentId)).sort(v)},"ledgerView",0,function(e,t,n){return null===e?t?"error":"loading":0===e.length?"empty":0===n.length?"filtered-out":"rows"},"linkRoleLabel",0,function(e){let t={origin:"Started here",source:"Source session",destination:"Destination"};return e.map(e=>t[e]).join(" · ")},"liveStateLabel",0,function(e){var t;return e.cancel_requested&&(t=e.state,!m.includes(t))?"Cancelling…":f(e.mode,e.state)},"modeLabel",0,function(e){return"ask"===e?"Ask":"Continue"},"outcomeLine",0,function(e){if("completed"===e.state){if("ask"===e.mode){let t=e.origin?.label??"the origin thread";return e.outcome.answer?`Answer in ${t}: ${g(e.outcome.answer,200)}`:`Answered in ${t}.`}let t=e.destination?.agent_name??"The destination Agent";return e.outcome.reply?`${t} picked it up in a new session: ${g(e.outcome.reply,200)}`:`${t} picked it up in a new session.`}return"failed"===e.state?e.failure?.message||"The exchange failed.":"cancelled"===e.state?"Cancelled before it finished. Nothing more will run.":null},"participantsLabel",0,function(e){return"ask"===e.mode?`You → ${e.source.agent_name}`:`${e.source.agent_name} → ${e.destination?.agent_name??"another Agent"}`},"pinRequestBody",0,function(e,t,n,a,s){return{action:e,content:t.trim(),conversation_id:n,idempotency_key:s,..."resume"===e?{approve_write:a}:{}}},"sessionDialogMode",0,function(e){return"handoff"===e?"continue":e},"sessionDialogTitle",0,function(e){return p["continue"===e?"handoff":e]},"sessionDialogUsesPin",0,function(e,t){return"resume"===e||"ask"===e&&"provider"===t},"sessionLabel",0,function(e){return`${e.source.agent_name}'s session “${e.source.session_title}”`},"sessionRowActions",0,function(e){let t;if(e.actions)t=e.actions;else{let n="ended"===e.status?{available:!1,reason:"Ask from this context and Hand off to… are unavailable: this session has ended. Its history stays here."}:e.resumable?{available:!0}:{available:!1,reason:`Ask from this context and Hand off to… are unavailable: Botmancers can’t resume this session under ${e.agent.name}’s current runtime.`},a=n.available?{available:!0}:{available:!1,code:"ended"===e.status?"session_ended":"session_not_resumable",reason:n.reason,recovery:"choose_session"};t={ask:a,resume:{available:!1,code:"action_unavailable",reason:`${p.resume} is unavailable: this runtime can’t resume a session with edits.`,recovery:"choose_action"},handoff:a}}return["ask","resume","handoff"].map(e=>({action:e,label:p[e],availability:t[e]}))},"stateTone",0,function(e){return"completed"===e?"done":"failed"===e||"cancelled"===e?"stopped":"active"},"submitErrorMessage",0,function(e,t){switch(e){case"session_ended":return"This session has ended and can’t be resumed.";case"session_not_resumable":return"Botmancers can’t resume this session under the Agent’s current runtime.";case"source_session_busy":return"This session already has an exchange in progress. Wait for it or cancel it from its card.";case"agent_unavailable":return t||"That Agent can’t launch yet. Choose its runtime connection and session scope in Config.";case"idempotency_conflict":return"This request changed while it was being sent. Send again.";case"session_missing":return"The runtime no longer has this session. Its history stays here; choose another session.";case"approval_required":return"Resume work here needs your approval of edits. Tick the approval, then send again.";case"authority_not_allowed":return t||"This Agent’s policy doesn’t allow edits in a resumed session. Change it in Config.";case"action_unavailable":return t||"This runtime can’t do that in this session. Choose another action.";case"provider_failed":return"The runtime failed this turn. Nothing moved to another session; try again later.";default:return t||"The exchange could not be started. Your draft is kept; try again."}},"threadHref",0,function(e,t){let n=new URLSearchParams;if(e.thread_agent_id){t&&n.set("exchange",t);let a=n.toString();return`/agents/${encodeURIComponent(e.thread_agent_id)}/conversations/${encodeURIComponent(e.id)}${a?`?${a}`:""}`}if("group"!==e.kind)return null;t&&n.set("exchange",t);let a=n.toString();return`/threads/${encodeURIComponent(e.id)}${a?`?${a}`:""}`},"validateDraft",0,function(e){let t={},n=e.instruction.trim(),a="ask"===e.mode?"a question":"an objective";return n?e.instruction.length>4e3&&(t.instruction="Keep it under 4000 characters."):t.instruction=`Enter ${a}.`,e.originConversationId||(t.origin="Choose the thread that follows this exchange."),"continue"!==e.mode||e.destinationAgentId||(t.destination="Choose the Agent who continues the work."),t},"validateResumeDraft",0,function(e,t){let n={};return e.trim()?e.length>4e3&&(n.instruction="Keep it under 4000 characters."):n.instruction="Enter what to work on.",t||(n.approval="Approve edits in this session to resume work here."),n}],50814)},54423,e=>{"use strict";e.s(["wakeNotices",0,function(e){let t=[],n=new Map;return e.forEach((a,s)=>{let r="string"==typeof a.data.target_name?a.data.target_name:null;a.requestId&&r&&n.set(a.requestId,r);let i=function(e){switch(e.kind){case"wake_blocked":return"blocked";case"wake_rejected":return"rejected";case"lineage_stopped":return"stopped";case"wake_accepted":return"string"==typeof e.data.reason?"allowed":null;case"request_cancelled":return"grant_denied"===e.data.reason?"denied":null;case"request_queued":return"capacity"===e.data.waiting_for?"waiting":null;default:return null}}(a);if(!i)return;let o=Array.isArray(a.data.actions)?a.data.actions:[],l=null!==a.requestId&&e.slice(s+1).some(e=>e.requestId===a.requestId);if("waiting"===i&&l)return;let c=a.requestId?n.get(a.requestId):void 0,d="denied"===i&&c?`Wake denied: ${c} — no work ran`:"waiting"===i&&c?`Queued: ${c} — waiting for capacity`:a.text;t.push({eventId:a.eventId,wakeId:a.wakeId,tone:i,text:d,actionable:"blocked"===i&&!!a.wakeId&&o.includes("allow")&&o.includes("deny")&&!l,createdAt:a.createdAt})}),t}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87303,37947,e=>{"use strict";var t=e.i(43476),n=e.i(71645);let r=[{id:"purple",label:"Purple",hex:"#7C3AED"},{id:"blue",label:"Blue",hex:"#2563EB"},{id:"teal",label:"Teal",hex:"#0D9488"},{id:"green",label:"Green",hex:"#16A34A"},{id:"amber",label:"Amber",hex:"#B45309"},{id:"orange",label:"Orange",hex:"#EA580C"},{id:"pink",label:"Pink",hex:"#DB2777"},{id:"slate",label:"Slate",hex:"#64748B"}],a=[{id:"dots",label:"Round dots"},{id:"sleepy",label:"Sleepy"},{id:"happy",label:"Happy arcs"},{id:"wide",label:"Wide ovals"}],s=[{id:"folded",label:"Folded arms"},{id:"reaching",label:"Reaching right"},{id:"waving",label:"Waving"}],o=[{id:"none",label:"None"},{id:"crown",label:"Crown"},{id:"glasses",label:"Glasses"},{id:"headset",label:"Headset"},{id:"hat",label:"Hat"},{id:"bow",label:"Bow"}],i={color:"purple",eyes:"dots",hands:"folded",accessory:"none"},l={...i,accessory:"crown"};function u(e,t){return"string"==typeof t&&e.some(e=>e.id===t)}function c(e){let t=u(r,e.avatar_color)?e.avatar_color:i.color,n=u(a,e.avatar_eyes)?e.avatar_eyes:i.eyes;return{color:t,eyes:n,hands:u(s,e.avatar_hands)?e.avatar_hands:i.hands,accessory:u(o,e.avatar_accessory)?e.avatar_accessory:"chief-of-staff"===String(e.name??"").trim().toLowerCase()?l.accessory:i.accessory}}let d=[{x:70,y:70.5,w:38,h:6},{x:70,y:82,w:38,h:6}];function f(e){return d.map(t=>`<rect x="${t.x}" y="${t.y}" width="${t.w}" height="${t.h}" rx="${t.h/2}" ${e}/>`).join("")}function h(e,t="static"){var n,a;let s,o,i=r.find(t=>t.id===e.color)?.hex??r[0].hex,l=String(t).replace(/[^A-Za-z0-9_-]/g,"")||"static",u=`avatar-knockout-${l}`,c=`fill="none" stroke="${i}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"`,d=(n=e.hands,a=e.accessory,s=[],"reaching"===n&&s.push({x1:87.6,y1:69,x2:90.4,y2:86.5,w:8}),"waving"===n&&s.push({x1:35,y1:59,x2:28,y2:72,w:10}),"crown"===a&&s.push({x1:44,y1:30,x2:76,y2:30,w:9}),"hat"===a&&s.push({x1:38,y1:34,x2:82,y2:34,w:9}),"bow"===a&&s.push({x1:60,y1:28.5,x2:84,y2:28,w:10}),"headset"===a&&(s.push({x1:42,y1:24.5,x2:78,y2:24.5,w:10}),s.push({x1:33,y1:55,x2:37,y2:64,w:8}),s.push({x1:83,y1:55,x2:87,y2:64,w:8})),"glasses"===a&&(s.push({x1:29,y1:56,x2:34,y2:62,w:8}),s.push({x1:86,y1:62,x2:91,y2:56,w:8})),s).map(e=>`<line x1="${e.x1}" y1="${e.y1}" x2="${e.x2}" y2="${e.y2}" stroke="#000000" stroke-width="${e.w}" stroke-linecap="round"/>`).join(""),p=`avatar-arms-${l}`,g="reaching"===e.hands,m=g?`<mask id="${p}"><rect x="0" y="0" width="120" height="120" fill="#ffffff"/>${f('fill="#000000" stroke="#000000" stroke-width="7"')}</mask>`:"",y=function(e,t){let n=`fill="none" stroke="${t}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"`;switch(e){case"sleepy":return`<g data-avatar-layer="eyes" data-avatar-eyes="sleepy"><path d="M42 61 Q48 64 54 61" ${n}/><path d="M66 61 Q72 64 78 61" ${n}/></g>`;case"happy":return`<g data-avatar-layer="eyes" data-avatar-eyes="happy"><path d="M42 63 Q48 54 54 63" ${n}/><path d="M66 63 Q72 54 78 63" ${n}/></g>`;case"wide":return`<g data-avatar-layer="eyes" data-avatar-eyes="wide"><ellipse cx="48" cy="60" rx="5.5" ry="8" ${n}/><ellipse cx="72" cy="60" rx="5.5" ry="8" ${n}/></g>`;default:return`<g data-avatar-layer="eyes" data-avatar-eyes="dots"><circle cx="48" cy="60" r="3.5" ${n}/><circle cx="72" cy="60" r="3.5" ${n}/></g>`}}(e.eyes,i),v=function(e,t){let n=`fill="none" stroke="${t}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"`;switch(e){case"crown":return`<g data-avatar-layer="accessory" data-avatar-accessory="crown"><path d="M44 31 L46.5 14 L54 24 L60 10 L66 24 L73.5 14 L76 31 Z" ${n}/></g>`;case"glasses":return`<g data-avatar-layer="accessory" data-avatar-accessory="glasses"><circle cx="48" cy="60" r="9" ${n}/><circle cx="72" cy="60" r="9" ${n}/><path d="M57 60 Q60 57 63 60" ${n}/><path d="M39 59 L32 57" ${n}/><path d="M81 59 L88 57" ${n}/></g>`;case"headset":return`<g data-avatar-layer="accessory" data-avatar-accessory="headset"><path d="M36 62 Q34 24 60 24 Q86 24 84 62" ${n}/><rect x="79" y="54" width="10" height="17" rx="5" ${n}/><path d="M84 71 Q80 84 66 84" ${n}/></g>`;case"hat":return`<g data-avatar-layer="accessory" data-avatar-accessory="hat"><path d="M38 34 Q60 40 82 34" ${n}/><path d="M46 34 Q48 14 60 14 Q72 14 74 34" ${n}/></g>`;case"bow":return`<g data-avatar-layer="accessory" data-avatar-accessory="bow"><circle cx="79" cy="29" r="3.5" ${n}/><path d="M76 27 L62 18 Q60 26 66 32 Z" ${n}/><path d="M82 27 L95 19 Q97 27 91 32 Z" ${n}/></g>`;default:return'<g data-avatar-layer="accessory" data-avatar-accessory="none"></g>'}}(e.accessory,i);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" role="img" data-avatar-color="${e.color}" data-avatar-eyes="${e.eyes}" data-avatar-hands="${e.hands}" data-avatar-accessory="${e.accessory}"><mask id="${u}"><rect x="0" y="0" width="120" height="120" fill="#ffffff"/>${d}</mask>`+m+`<g data-avatar-layer="body" mask="url(#${u})">`+`<path d="M60 28 C75 28 84 39 85.5 56 L91 90 C92.5 98 87 102 79 102 L41 102 C33 102 27.5 98 29 90 L34.5 56 C36 39 45 28 60 28 Z" ${c}/>`+`<path d="M54 71 Q60 75.5 66 71" ${c}/>`+`<path data-avatar-brows="straight" d="${o="wide"===e.eyes?45:46,`M42 ${o} H54 M66 ${o} H78`}" fill="none" stroke="${i}" stroke-width="4.8" stroke-linecap="round"/>`+"</g>"+(g?`<g mask="url(#${p})">${y}</g>`:y)+function(e,t){let n=`fill="none" stroke="${t}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"`;switch(e){case"reaching":return'<g data-avatar-layer="hands" data-avatar-hands="reaching">'+f(n)+"</g>";case"waving":return`<g data-avatar-layer="hands" data-avatar-hands="waving"><path d="M32 68 Q24 60 22 48" ${n}/><circle cx="21" cy="41" r="5" ${n}/><path d="M11 36 Q9 46 12 54" ${n}/></g>`;default:return`<g data-avatar-layer="hands" data-avatar-hands="folded"><rect x="44" y="79" width="32" height="9" rx="4.5" ${n}/><rect x="46" y="90" width="28" height="9" rx="4.5" ${n}/></g>`}}(e.hands,i)+(g?`<g mask="url(#${p})">${v}</g>`:v)+"</svg>"}e.s(["AVATAR_ACCESSORIES",0,o,"AVATAR_COLORS",0,r,"AVATAR_EYES",0,a,"AVATAR_HANDS",0,s,"renderAvatarSvg",0,h,"resolveAvatar",0,c],37947),e.s(["default",0,function({bot:e,config:r,size:a=28,className:s,title:o}){let i=(0,n.useId)().replace(/[^A-Za-z0-9_-]/g,"")||"avatar",l=h(r??e?.avatar_config??c(e??{}),i).replace("<svg ",`<svg width="${a}" height="${a}" `);return(0,t.jsx)("span",{className:s??"bot-avatar",style:{display:"inline-flex",width:a,height:a,flex:"none"},title:o,"aria-label":o??"Agent avatar",role:"img",dangerouslySetInnerHTML:{__html:l}})}],87303)},15983,10718,e=>{"use strict";var t=e.i(43476),n=e.i(71645);let r="Permanently removes each agent with its direct conversation, messages, queue rows, approvals, launch snapshots, memories, one-shots, routines, and pending questions. There is no undo.",a="Skill files, working directories, Hermes profiles, and imported source files stay on disk.";function s(e){return"chief"===e?"Chief of Staff cannot be deleted.":"Working now — stop it or let it finish before deleting."}function o(e){return 1===e?"Delete agent":`Delete ${e} agents`}e.s(["DELETE_KEEPS_COPY",0,a,"DELETE_REMOVES_COPY",0,r,"blockedReasonCopy",0,s,"deleteConfirmLabel",0,o,"deletedStatusLine",0,function(e){return 1===e?"Deleted 1 agent.":`Deleted ${e} agents.`}],10718),e.s(["default",0,function({ids:e,onCancel:i,onDeleted:l}){let u=(0,n.useId)(),[c,d]=(0,n.useState)(null),[f,h]=(0,n.useState)(""),[p,g]=(0,n.useState)(""),[m,y]=(0,n.useState)(!1),v=(0,n.useRef)(null),b=(0,n.useRef)(null),$=e.join("\n");(0,n.useEffect)(()=>{let e=!1;return fetch("/api/bots/delete-preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:$.split("\n")})}).then(async t=>{let n=await t.json().catch(()=>null);if(!e){if(!t.ok)return void h("string"==typeof n?.error?n.error:"Could not load the deletion preview.");d(n)}}).catch(()=>{e||h("Could not load the deletion preview.")}),()=>{e=!0}},[$]),(0,n.useEffect)(()=>{v.current?.focus()},[]),(0,n.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(e.stopPropagation(),m||i())};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[m,i]);let _=e.length,x=!c||c.blocked.length>0||c.missing.length>0,k=async()=>{if(!m&&!x){y(!0),g("");try{let t=await fetch("/api/bots",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),n=await t.json().catch(()=>null);if(!t.ok){g("string"==typeof n?.error&&n.error?n.error:`Delete failed (${t.status}).`),y(!1),requestAnimationFrame(()=>v.current?.focus());return}l(Array.isArray(n?.deleted)?n.deleted:[])}catch{g("Delete failed: the server did not respond."),y(!1),requestAnimationFrame(()=>v.current?.focus())}}};return(0,t.jsx)("div",{className:"modal-scrim delete-scrim",onKeyDown:e=>{if("Tab"!==e.key||!b.current)return;let t=Array.from(b.current.querySelectorAll("button:not(:disabled)"));if(0===t.length)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):e.shiftKey||document.activeElement!==r||(e.preventDefault(),n.focus())},children:(0,t.jsxs)("div",{ref:b,className:"delete-card",role:"alertdialog","aria-modal":"true","aria-labelledby":u,"data-testid":"delete-agents-dialog",children:[(0,t.jsx)("h2",{id:u,className:"delete-title",children:1===_?"Delete this agent permanently?":`Delete ${_} agents permanently?`}),f?(0,t.jsx)("p",{className:"delete-error",role:"alert",children:f}):null,c||f?null:(0,t.jsx)("p",{className:"delete-copy",children:"Checking what will be removed…"}),c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("ul",{className:"delete-names","aria-label":"Agents to delete",children:[c.agents.map(e=>(0,t.jsx)("li",{children:e.name},e.id)),c.missing.map(e=>(0,t.jsxs)("li",{children:["Not found: ",e]},e))]}),c.blocked.length>0?(0,t.jsxs)("div",{className:"delete-blocked",role:"alert",children:[(0,t.jsx)("p",{children:"Nothing can be deleted until these are deselected:"}),(0,t.jsx)("ul",{children:c.blocked.map(e=>(0,t.jsxs)("li",{children:[e.name," — ",s(e.reason)]},e.id))})]}):null,(0,t.jsx)("p",{className:"delete-copy",children:r}),(0,t.jsx)("p",{className:"delete-copy delete-keeps",children:a})]}):null,p?(0,t.jsx)("p",{className:"delete-error",role:"alert",children:p}):null,(0,t.jsxs)("div",{className:"form-actions delete-actions",children:[(0,t.jsx)("button",{ref:v,type:"button",className:"cancel-btn",onClick:i,disabled:m,children:"Cancel"}),(0,t.jsx)("button",{type:"button",className:"delete-btn",onClick:()=>{k()},disabled:m||x,children:m?"Deleting…":o(_)})]})]})})}],15983)},74904,3136,e=>{"use strict";let t=["hermes","cursor","claude","codex","muse"],n={hermes:"Hermes",cursor:"Cursor",claude:"Claude",codex:"Codex",muse:"Muse Code"},r="hermes";function a(e){return t.includes(String(e))?n[e]:String(e??"")}t.join("|"),e.s(["AGENTS",0,t,"AGENT_LABELS",0,n,"DEFAULT_AGENT",0,r,"agentLabel",0,a],3136);let s=t.map(e=>({value:e,label:n[e]}));function o(e){return a((e.agent??"").trim()||r)}function i(e){let t=e.runtime_connection;return t&&t.label.trim()?t.label.trim():(e.runtime_connection_id??"").trim()?(e.runtime_connection_id??"").trim():null}function l(e){return`~/.botmancers/${e}`}let u="~/.botmancers/{agentID}",c=`Default: ${u} — {agentID} is this agent's ID, assigned at creation.`;function d(e){return String(e).padStart(2,"0")}let f=[{prefix:"[Agent failed]",kind:"failed",label:"Agent failed"},{prefix:"[Deck handoff]",kind:"handoff",label:"Agent launch"},{prefix:"[Deck run]",kind:"run",label:"Agent run"},{prefix:"[Deck review]",kind:"review",label:"Agent review"},{prefix:"[Deck resume]",kind:"resume",label:"Agent resume"},{prefix:"[Deck result]",kind:"result",label:"Agent result"},{prefix:"[Deck failed]",kind:"failed",label:"Agent failed"},{prefix:"[Deck needs selection]",kind:"reselection",label:"Agent needs setup"},{prefix:"[Deck needs reselection]",kind:"reselection",label:"Agent needs setup"}];e.s(["AGENT_OPTIONS",0,s,"NEW_AGENT_WORKSPACE_HINT",0,c,"WORKSPACE_TEMPLATE",0,u,"agentEventDisplay",0,function(e){let t=String(e??"").trimStart(),n=f.find(e=>t.startsWith(e.prefix));return n?{label:n.label,detail:t.slice(n.prefix.length).trim()}:null},"botAgentLabel",0,o,"botConnectionLabel",0,i,"configWorkspaceHint",0,function(e){return`Default: ${l(e)} — leave blank to use it.`},"defaultWorkdirFor",0,l,"formatClock",0,function(e){let t=new Date(e);return`${d(t.getHours())}:${d(t.getMinutes())}:${d(t.getSeconds())}`},"rosterRuntimeLine",0,function(e){let t=`Agent: ${o(e)} \xb7 `+(i(e)??"No connection");return!1===e.launchable?t+" — see Config":t}],74904)},50814,63352,e=>{"use strict";function t(e){return`${new Date(e).toISOString().slice(0,16).replace("T"," ")} UTC`}function n(e){return e?e.split("/").filter(e=>e.length>0).pop()??null:null}function r(e,t){let n=function(e){if(!e)return null;let t=e.toLowerCase();return"muse code"===t?"muse":(["codex","claude","cursor","hermes","muse"].includes(t),t)}(t);switch(e){case"provider_unavailable":return n?{reason:`${n} is not installed or did not start`,fix:`Install ${n} and Retry.`}:{reason:"the runtime is not installed or did not start",fix:"Install the runtime and Retry."};case"auth_required":return{reason:"not signed in",fix:"Sign in and Retry."};case"permission_denied":return{reason:"permission denied",fix:"Check permissions and Retry."};case"incompatible_version":return{reason:"incompatible version",fix:"Update the runtime and Retry."};case"usage_limit":return{reason:"usage limit reached",fix:"Wait or upgrade and Retry."};case"scope_missing":return{reason:"no session scope is set",fix:"Choose a scope in Config."};case"provider_failed":return{reason:"the listing failed",fix:"Retry."};default:return{reason:e,fix:"Retry."}}}let a="Not reported";function s(e){return e.toFixed(1).replace(/\.0$/,"")}function o(e){return e.toLocaleString("en-US")}function i(e){return 0===e?"$0.00":e>=.01?`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`:e<1e-4?"<$0.0001":`$${e.toFixed(4)}`}let l={input_tokens:"Input tokens",output_tokens:"Output tokens",cost_usd:"Cost"};function u(e,t,n){return"cost_usd"===e?i(t):n?o(t):t<1e3?String(t):t<999950?`${s(t/1e3)}k`:t<99995e4?`${s(t/1e6)}M`:`${s(t/1e9)}B`}function c(e){return`${e} ${1===e?"run":"runs"}`}function d(e,t,n=!1){let r=l[e];if(!t||"unavailable"===t.quality||null===t.sum)return{name:r,text:a,quality:"unavailable",coverage:t&&t.total>0?`0 of ${c(t.total)} reported`:"No runs recorded",label:`${r}: not reported`};let s=u(e,t.sum,n),o=u(e,t.sum,!0);return"partial"===t.quality?{name:r,text:s,quality:"partial",coverage:`Partial: ${t.known} of ${c(t.total)} reported`,label:`${r}: at least ${o}, partial, reported by ${t.known} of ${c(t.total)}`}:{name:r,text:s,quality:"complete",coverage:`All ${c(t.total)} reported`,label:`${r}: ${o}, reported by all ${c(t.total)}`}}e.s(["SESSION_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"ended",label:"Ended"}],"attemptLabel",0,function(e){let t="source"===e.role?"Started the session":"Resumed the session";return`${t} \xb7 ${e.outcome??"running"}`},"emptySessionsCopy",0,function(e,t,n,a){if("active"===e)return`${t} has no active sessions.`;if("ended"===e)return`${t} has no ended sessions.`;if(n?.last_error_code){let{reason:e,fix:t}=r(n.last_error_code,a),s=a?`${a} sessions`:"sessions";return`Could not read ${s}: ${e}. ${t}`}if(n&&null===n.synced_at)return`${t} has not synced sessions yet. Refresh to load past sessions.`;let s=n?.out_of_scope_count??0;return s>0?`${s} ${1===s?"session exists":"sessions exist"} outside ${t}'s scope. Widen the scope to see them.`:`${t} has no sessions yet. One appears after a coding run keeps its runtime context.`},"formatSessionDate",0,t,"formatSyncRelativeTime",0,function(e,t=Date.now()){if(null===e)return"never";let n=Math.max(0,t-e);if(n<6e4)return"just now";let r=Math.floor(n/6e4);if(r<60)return`${r} minute${1===r?"":"s"} ago`;let a=Math.floor(r/60);if(a<24)return`${a} hour${1===a?"":"s"} ago`;let s=Math.floor(a/24);return`${s} day${1===s?"":"s"} ago`},"noMatchingSessionsCopy",0,function(e,t){let r=e.trim();if(r)return`No sessions match “${r}”.`;let a=n(t);return a?`No sessions in ${a}.`:"No sessions match the current filters."},"registrationSessionSyncCopy",0,function(e,t){if("failed"===e.outcome){let{reason:n,fix:a}=r(e.error_code??"provider_failed",t);return`Could not read ${t} sessions: ${n}. ${a}`}if("unsupported"===e.outcome)return`Past sessions are not available for ${t}.`;let n=1===e.imported?"session":"sessions",a=`Loaded ${e.imported} ${n}`;return e.rejected_out_of_scope>0&&(a+=`, ${e.rejected_out_of_scope} outside the scope`),e.complete||(a+=", more remain"),`${a}.`},"runtimeLabel",0,function(e){return e.agent.transport?`${e.agent.adapter} \xb7 ${e.agent.transport}`:e.agent.adapter},"sessionOriginChips",0,function(e){let t=[],n=e.origin.work_request?.requester;return n?.kind==="person"?t.push("Human origin"):n?.kind==="bot"?t.push(n.name?`${n.name} Agent`:"Agent origin"):n?.kind==="service"&&t.push("Service origin"),e.origin.conversation&&t.push(e.origin.conversation.label),[...new Set(t)]},"sessionStateTags",0,function(e){let t=[];return(e.home&&t.push("Home"),e.state?.availability==="missing")?[...t,"Missing"]:(e.state?.lifecycle==="archived"&&t.push("Archived"),e.state?.busy&&t.push("Busy"),(e.resumable||e.state?.resumable===!0)&&t.push("Resumable"),t)},"sessionUsageLine",0,function(e){let t=d("input_tokens",e?.input_tokens),n=d("output_tokens",e?.output_tokens),r=d("cost_usd",e?.cost_usd),s=[t,n,r];if(s.every(e=>"unavailable"===e.quality))return{text:a,label:"Usage: not reported",quality:"unavailable",partial:!1};let o=["unavailable"===t.quality?"input not reported":`${t.text} in`,"unavailable"===n.quality?"output not reported":`${n.text} out`,"unavailable"===r.quality?"cost not reported":r.text].join(" · "),i=s.some(e=>"partial"===e.quality),l=i||s.some(e=>"unavailable"===e.quality)?"partial":"complete";return{text:o,label:`Reported usage: ${s.map(e=>e.label).join("; ")}`,quality:l,partial:i}},"statusLabel",0,function(e){return"active"===e.status?"Active":"Ended"},"usageMetricView",0,d,"usageSampleLabel",0,function(e,t){let n="turn"===e.kind?"start"===e.turn_kind?"provider turn, started":"provider turn":"resume"===e.turn_kind?"resumed":"started";return`Run ${t+1} \xb7 ${n}`},"usageSampleValues",0,function(e){return{input:null===e.input_tokens?a:o(e.input_tokens),output:null===e.output_tokens?a:o(e.output_tokens),cost:null===e.cost_usd?a:i(e.cost_usd)}},"workRequestLabel",0,function(e){var t;let n=e.origin.work_request;return n?`${(t=n.execution_kind)?t[0].toUpperCase()+t.slice(1):t} \xb7 ${n.state}`:null},"workspaceFolderName",0,n,"workspaceOptions",0,function(e){let t=[...new Set(e.filter(e=>"string"==typeof e&&e.length>0))],r=t.map(e=>n(e)??e);return t.map((e,t)=>({value:e,label:r.filter(e=>e===r[t]).length>1?e:r[t]})).sort((e,t)=>e.label<t.label?-1:+(e.label>t.label))}],63352);let f={ask:"Ask from this context",resume:"Resume work here",handoff:"Hand off to…"},h=["queued","extracting","delivering","completed","failed","cancelled"],p=["completed","failed","cancelled"];function g(e,t){switch(t){case"queued":return"Queued";case"extracting":return"ask"===e?"Asking the session":"Extracting handoff";case"delivering":return"Delivering handoff";case"completed":return"ask"===e?"Answered":"Handed off";case"failed":return"Failed";case"cancelled":return"Cancelled"}}function m(e,t=140){let n=String(e??"").split("\n").map(e=>e.trim()).filter(e=>e.length>0).join(" ");return n.length>t?`${n.slice(0,t-1).trimEnd()}…`:n}function y(e,t){return t.updated_at-e.updated_at||t.created_at-e.created_at||(e.id<t.id?-1:+(e.id>t.id))}e.s(["DEFAULT_LEDGER_FILTER",0,{mode:"all",state:"all",agentId:""},"INSTRUCTION_LIMIT",0,4e3,"MODE_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"ask",label:"Ask"},{value:"continue",label:"Continue"}],"STATE_FILTER_OPTIONS",0,[{value:"all",label:"Any status"},{value:"active",label:"In progress"},{value:"queued",label:"Queued"},{value:"extracting",label:"Asking / extracting"},{value:"delivering",label:"Delivering"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"}],"detailsHref",0,function(e){return`/exchanges?id=${encodeURIComponent(e)}`},"eventLabel",0,function(e,t){let n=e.data??{},r=t.source.agent_name,a=t.destination?.agent_name??"the destination Agent",s="string"==typeof n.hop?n.hop:null;switch(e.type){case"created":return"ask"===t.mode?`You asked ${r}'s session a question`:`You handed ${r}'s session to ${a}`;case"hop_queued":if("deliver"===s)return`Handoff queued for ${a}'s new session`;return"extract"===s?`Handoff extraction queued in ${r}'s session`:`Question queued for ${r}'s session`;case"hop_started":if("deliver"===s)return`${a} started a new session`;return"extract"===s?`${r}'s session started extracting the handoff`:`${r}'s session started answering`;case"state_changed":{let e="string"==typeof n.to&&h.includes(n.to)?n.to:null;return e?`Now ${g(t.mode,e).toLowerCase()}`:"State changed"}case"answer_returned":return`Answer returned to ${t.origin?.label??"the origin thread"}${n.truncated?" (shortened)":""}`;case"packet_extracted":return"Handoff packet extracted";case"packet_rejected":return`Handoff packet refused${"string"==typeof n.reason?`: ${n.reason}`:""}`;case"destination_replied":return`${a} replied in ${t.destination?.conversation?.label??"its thread"}`;case"destination_session_rejected":return`${a}'s session was not new; the handoff stopped`;case"cancel_requested":return"You asked to cancel";case"hop_result_discarded":return"A late result was discarded";default:return e.type.replace(/_/g," ")}},"excerpt",0,m,"exchangeRequestBody",0,function(e,t,n){let r={mode:e.mode,idempotency_key:n,origin_conversation_id:e.originConversationId,source:{agent_id:t.agentId,session_ref:t.sessionRef},instruction:e.instruction.trim()};return"continue"===e.mode&&(r.destination={agent_id:e.destinationAgentId}),r},"failureAdvice",0,function(e){if("failed"!==e.state)return null;switch(e.failure?.code){case"packet_invalid":case"packet_missing":return"The source session did not return a usable handoff. Start a new Continue with a clearer objective.";case"destination_session_invalid":return"The destination did not start a fresh session. Check its runtime, then start a new Continue.";case"destination_turn_failed":return"Check the destination Agent’s runtime, then start a new Continue from the source session.";case"source_turn_failed":return"Check the source Agent’s runtime, then start a new exchange from its Sessions.";default:return"Start a new exchange from the session to try again."}},"formatExchangeTime",0,function(e){return t(e)},"instructionHeading",0,function(e){return"ask"===e?"Question":"Objective"},"ledgerAgents",0,function(e){let t=new Map;for(let n of e)t.set(n.source.agent_id,n.source.agent_name),n.destination&&t.set(n.destination.agent_id,n.destination.agent_name);return[...t.entries()].map(([e,t])=>({id:e,name:t})).sort((e,t)=>e.name.localeCompare(t.name)||e.id.localeCompare(t.id))},"ledgerRows",0,function(e,t){return e.filter(e=>("all"===t.mode||e.mode===t.mode)&&("active"!==t.state||!e.terminal)&&("all"===t.state||"active"===t.state||e.state===t.state)&&(!t.agentId||e.source.agent_id===t.agentId||e.destination?.agent_id===t.agentId)).sort(y)},"ledgerView",0,function(e,t,n){return null===e?t?"error":"loading":0===e.length?"empty":0===n.length?"filtered-out":"rows"},"linkRoleLabel",0,function(e){let t={origin:"Started here",source:"Source session",destination:"Destination"};return e.map(e=>t[e]).join(" · ")},"liveStateLabel",0,function(e){var t;return e.cancel_requested&&(t=e.state,!p.includes(t))?"Cancelling…":g(e.mode,e.state)},"modeLabel",0,function(e){return"ask"===e?"Ask":"Continue"},"outcomeLine",0,function(e){if("completed"===e.state){if("ask"===e.mode){let t=e.origin?.label??"the origin thread";return e.outcome.answer?`Answer in ${t}: ${m(e.outcome.answer,200)}`:`Answered in ${t}.`}let t=e.destination?.agent_name??"The destination Agent";return e.outcome.reply?`${t} picked it up in a new session: ${m(e.outcome.reply,200)}`:`${t} picked it up in a new session.`}return"failed"===e.state?e.failure?.message||"The exchange failed.":"cancelled"===e.state?"Cancelled before it finished. Nothing more will run.":null},"participantsLabel",0,function(e){return"ask"===e.mode?`You → ${e.source.agent_name}`:`${e.source.agent_name} → ${e.destination?.agent_name??"another Agent"}`},"pinRequestBody",0,function(e,t,n,r,a){return{action:e,content:t.trim(),conversation_id:n,idempotency_key:a,..."resume"===e?{approve_write:r}:{}}},"sessionDialogMode",0,function(e){return"handoff"===e?"continue":e},"sessionDialogTitle",0,function(e){return f["continue"===e?"handoff":e]},"sessionDialogUsesPin",0,function(e,t){return"resume"===e||"ask"===e&&"provider"===t},"sessionLabel",0,function(e){return`${e.source.agent_name}'s session “${e.source.session_title}”`},"sessionRowActions",0,function(e){let t;if(e.actions)t=e.actions;else{let n="ended"===e.status?{available:!1,reason:"Ask from this context and Hand off to… are unavailable: this session has ended. Its history stays here."}:e.resumable?{available:!0}:{available:!1,reason:`Ask from this context and Hand off to… are unavailable: Botmancers can’t resume this session under ${e.agent.name}’s current runtime.`},r=n.available?{available:!0}:{available:!1,code:"ended"===e.status?"session_ended":"session_not_resumable",reason:n.reason,recovery:"choose_session"};t={ask:r,resume:{available:!1,code:"action_unavailable",reason:`${f.resume} is unavailable: this runtime can’t resume a session with edits.`,recovery:"choose_action"},handoff:r}}return["ask","resume","handoff"].map(e=>({action:e,label:f[e],availability:t[e]}))},"stateTone",0,function(e){return"completed"===e?"done":"failed"===e||"cancelled"===e?"stopped":"active"},"submitErrorMessage",0,function(e,t){switch(e){case"session_ended":return"This session has ended and can’t be resumed.";case"session_not_resumable":return"Botmancers can’t resume this session under the Agent’s current runtime.";case"source_session_busy":return"This session already has an exchange in progress. Wait for it or cancel it from its card.";case"agent_unavailable":return t||"That Agent can’t launch yet. Choose its runtime connection and session scope in Config.";case"idempotency_conflict":return"This request changed while it was being sent. Send again.";case"session_missing":return"The runtime no longer has this session. Its history stays here; choose another session.";case"approval_required":return"Resume work here needs your approval of edits. Tick the approval, then send again.";case"authority_not_allowed":return t||"This Agent’s policy doesn’t allow edits in a resumed session. Change it in Config.";case"action_unavailable":return t||"This runtime can’t do that in this session. Choose another action.";case"provider_failed":return"The runtime failed this turn. Nothing moved to another session; try again later.";default:return t||"The exchange could not be started. Your draft is kept; try again."}},"threadHref",0,function(e,t){let n=new URLSearchParams;if(e.thread_agent_id){t&&n.set("exchange",t);let r=n.toString();return`/agents/${encodeURIComponent(e.thread_agent_id)}/conversations/${encodeURIComponent(e.id)}${r?`?${r}`:""}`}if("group"!==e.kind)return null;t&&n.set("exchange",t);let r=n.toString();return`/threads/${encodeURIComponent(e.id)}${r?`?${r}`:""}`},"validateDraft",0,function(e){let t={},n=e.instruction.trim(),r="ask"===e.mode?"a question":"an objective";return n?e.instruction.length>4e3&&(t.instruction="Keep it under 4000 characters."):t.instruction=`Enter ${r}.`,e.originConversationId||(t.origin="Choose the thread that follows this exchange."),"continue"!==e.mode||e.destinationAgentId||(t.destination="Choose the Agent who continues the work."),t},"validateResumeDraft",0,function(e,t){let n={};return e.trim()?e.length>4e3&&(n.instruction="Keep it under 4000 characters."):n.instruction="Enter what to work on.",t||(n.approval="Approve edits in this session to resume work here."),n}],50814)},22016,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return y},useLinkStatus:function(){return b}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let s=e.r(90809),o=e.r(43476),i=s._(e.r(71645)),l=e.r(95057),u=e.r(8372),c=e.r(18581),d=e.r(18967),f=e.r(5550),h=e.r(88540),p=e.r(91949),g=e.r(73668),m=e.r(9396);function y(t){var n;let r,a,s,[y,b]=(0,i.useOptimistic)(p.IDLE_LINK_STATUS),$=(0,i.useRef)(null),{href:_,as:x,children:k,prefetch:w=null,passHref:A,replace:S,shallow:C,scroll:E,onClick:T,onMouseEnter:L,onTouchStart:R,legacyBehavior:j=!1,onNavigate:N,transitionTypes:O,ref:D,unstable_dynamicOnHover:P,...I}=t;r=k,j&&("string"==typeof r||"number"==typeof r)&&(r=(0,o.jsx)("a",{children:r}));let M=i.default.useContext(u.AppRouterContext),q=!1!==w,U=!1===w?"none":!0===w?"full":"auto",F="none"!==U?"auto"===U?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,B="string"==typeof(n=x||_)?n:(0,l.formatUrl)(n);if(j){if(r?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=i.default.Children.only(r)}let H=j?a&&"object"==typeof a&&a.ref:D,Q,K=i.default.useCallback(e=>(null!==M&&($.current=(0,p.mountLinkInstance)(e,B,M,F,q,b,Q)),()=>{$.current&&((0,p.unmountLinkForCurrentNavigation)($.current),$.current=null),(0,p.unmountPrefetchableInstance)(e)}),[q,B,M,F,b,Q]),W={ref:(0,c.useMergedRef)(K,H),onClick(t){j||"function"!=typeof T||T(t),j&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!M||t.defaultPrevented||function(t,n,r,a,s,o,l,u="none"){if("u">typeof window){let c,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(n)){a&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(99781);i.default.startTransition(()=>{f(n,a?"replace":"push",!1===s?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,r.current,l,u)})}}(t,B,$,S,E,N,O,U)},onMouseEnter(e){j||"function"!=typeof L||L(e),j&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),M&&q&&(0,p.onNavigationIntent)(e.currentTarget,!0===P)},onTouchStart:function(e){j||"function"!=typeof R||R(e),j&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),M&&q&&(0,p.onNavigationIntent)(e.currentTarget,!0===P)}};return(0,d.isAbsoluteUrl)(B)?W.href=B:j&&!A&&("a"!==a.type||"href"in a.props)||(W.href=(0,f.addBasePath)(B)),s=j?i.default.cloneElement(a,W):(0,o.jsx)("a",{...I,...W,children:r}),(0,o.jsx)(v.Provider,{value:y,children:s})}let v=(0,i.createContext)(p.IDLE_LINK_STATUS),b=()=>(0,i.useContext)(v);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},18581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return a}});let r=e.r(71645);function a(e,t){let n=(0,r.useRef)(null),a=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(n.current=s(e,r)),t&&(a.current=s(t,r))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},73668,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return s}});let r=e.r(18967),a=e.r(52817);function s(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,a.hasBasePath)(n.pathname)}catch(e){return!1}}},98183,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={assign:function(){return l},searchParamsToUrlQuery:function(){return s},urlQueryToSearchParams:function(){return i}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});function s(e){let t={};for(let[n,r]of e.entries()){let e=t[n];void 0===e?t[n]=r:Array.isArray(e)?e.push(r):t[n]=[e,r]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,o(e));else t.set(n,o(r));return t}function l(e,...t){for(let n of t){for(let t of n.keys())e.delete(t);for(let[t,r]of n.entries())e.append(t,r)}return e}},95057,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let s=e.r(90809)._(e.r(98183)),o=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:n}=e,r=e.protocol||"",a=e.pathname||"",i=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:n&&(u=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(s.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||o.test(r))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${r}${u}${a}${c}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},18967,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return _},MissingStaticPage:function(){return $},NormalizeError:function(){return v},PageNotFoundError:function(){return b},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return s},execOnce:function(){return o},getDisplayName:function(){return d},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return x}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let s=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,n=!1;return(...r)=>(n||(n=!0,t=e(...r)),t)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&i.test(e)};function u(){let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?":"+n:""}`}function c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&f(n))return r;if(!r)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return r}let g="u">typeof performance,m=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class v extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class $ extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class _ extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function x(e){return JSON.stringify({message:e.message,stack:e.stack})}},18566,(e,t,n)=>{t.exports=e.r(76562)}]);