botmancers 0.8.0 → 0.9.1

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 (358) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +5 -5
  3. package/app/.next/BUILD_ID +1 -1
  4. package/app/.next/app-path-routes-manifest.json +11 -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 +82 -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 +2 -2
  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.js +2 -2
  101. package/app/.next/server/app/api/bots/[id]/sessions/sync/route.js.nft.json +1 -1
  102. package/app/.next/server/app/api/bots/[id]/share-policy/route.js +2 -2
  103. package/app/.next/server/app/api/bots/[id]/share-policy/route.js.nft.json +1 -1
  104. package/app/.next/server/app/api/bots/[id]/skill/route.js +1 -1
  105. package/app/.next/server/app/api/bots/[id]/skill/route.js.nft.json +1 -1
  106. package/app/.next/server/app/api/bots/availability/route.js.nft.json +1 -1
  107. package/app/.next/server/app/api/bots/delete-preview/route.js +1 -1
  108. package/app/.next/server/app/api/bots/delete-preview/route.js.nft.json +1 -1
  109. package/app/.next/server/app/api/bots/import/route.js +1 -1
  110. package/app/.next/server/app/api/bots/import/route.js.nft.json +1 -1
  111. package/app/.next/server/app/api/bots/manage/route.js +1 -1
  112. package/app/.next/server/app/api/bots/manage/route.js.nft.json +1 -1
  113. package/app/.next/server/app/api/bots/name-migrations/route.js +1 -1
  114. package/app/.next/server/app/api/bots/name-migrations/route.js.nft.json +1 -1
  115. package/app/.next/server/app/api/bots/route.js +5 -5
  116. package/app/.next/server/app/api/bots/route.js.nft.json +1 -1
  117. package/app/.next/server/app/api/conversations/[id]/approve/route.js.nft.json +1 -1
  118. package/app/.next/server/app/api/conversations/[id]/deny/route.js.nft.json +1 -1
  119. package/app/.next/server/app/api/conversations/[id]/draft/route.js +1 -1
  120. package/app/.next/server/app/api/conversations/[id]/draft/route.js.nft.json +1 -1
  121. package/app/.next/server/app/api/conversations/[id]/messages/[messageId]/stop/route.js.nft.json +1 -1
  122. package/app/.next/server/app/api/conversations/[id]/messages/route.js +5 -5
  123. package/app/.next/server/app/api/conversations/[id]/messages/route.js.nft.json +1 -1
  124. package/app/.next/server/app/api/conversations/[id]/route.js +1 -1
  125. package/app/.next/server/app/api/conversations/[id]/route.js.nft.json +1 -1
  126. package/app/.next/server/app/api/conversations/[id]/stop/route.js +6 -6
  127. package/app/.next/server/app/api/conversations/[id]/stop/route.js.nft.json +1 -1
  128. package/app/.next/server/app/api/conversations/route.js +1 -1
  129. package/app/.next/server/app/api/conversations/route.js.nft.json +1 -1
  130. package/app/.next/server/app/api/exchanges/[id]/cancel/route.js +2 -2
  131. package/app/.next/server/app/api/exchanges/[id]/cancel/route.js.nft.json +1 -1
  132. package/app/.next/server/app/api/exchanges/[id]/route.js +1 -1
  133. package/app/.next/server/app/api/exchanges/[id]/route.js.nft.json +1 -1
  134. package/app/.next/server/app/api/exchanges/route.js +1 -1
  135. package/app/.next/server/app/api/exchanges/route.js.nft.json +1 -1
  136. package/app/.next/server/app/api/files/[name]/route.js +1 -1
  137. package/app/.next/server/app/api/files/[name]/route.js.nft.json +1 -1
  138. package/app/.next/server/app/api/groups/route.js +1 -1
  139. package/app/.next/server/app/api/groups/route.js.nft.json +1 -1
  140. package/app/.next/server/app/api/health/route.js +3 -3
  141. package/app/.next/server/app/api/health/route.js.nft.json +1 -1
  142. package/app/.next/server/app/api/import-capabilities/route.js.nft.json +1 -1
  143. package/app/.next/server/app/api/marketplace-handoff/route.js.nft.json +1 -1
  144. package/app/.next/server/app/api/marketplace-handoff/status/route.js.nft.json +1 -1
  145. package/app/.next/server/app/api/mcp/route.js +1 -1
  146. package/app/.next/server/app/api/mcp/route.js.nft.json +1 -1
  147. package/app/.next/server/app/api/messages/[id]/between/route.js +1 -1
  148. package/app/.next/server/app/api/messages/[id]/between/route.js.nft.json +1 -1
  149. package/app/.next/server/app/api/runtime-connections/route.js +1 -1
  150. package/app/.next/server/app/api/runtime-connections/route.js.nft.json +1 -1
  151. package/app/.next/server/app/api/service-grants/route.js.nft.json +1 -1
  152. package/app/.next/server/app/api/shares/[shareRef]/revoke/route.js +2 -2
  153. package/app/.next/server/app/api/shares/[shareRef]/revoke/route.js.nft.json +1 -1
  154. package/app/.next/server/app/api/shares/route.js +2 -2
  155. package/app/.next/server/app/api/shares/route.js.nft.json +1 -1
  156. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js +4 -3
  157. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js.nft.json +1 -1
  158. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js +4 -3
  159. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js.nft.json +1 -1
  160. package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js +1 -1
  161. package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js.nft.json +1 -1
  162. package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js +4 -3
  163. package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js.nft.json +1 -1
  164. package/app/.next/server/app/api/v0/agents/[agentId]/route.js +4 -3
  165. package/app/.next/server/app/api/v0/agents/[agentId]/route.js.nft.json +1 -1
  166. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js +4 -3
  167. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js.nft.json +1 -1
  168. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js +4 -3
  169. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js.nft.json +1 -1
  170. package/app/.next/server/app/api/v0/agents/route.js +4 -3
  171. package/app/.next/server/app/api/v0/agents/route.js.nft.json +1 -1
  172. package/app/.next/server/app/api/v0/capabilities/route.js +4 -3
  173. package/app/.next/server/app/api/v0/capabilities/route.js.nft.json +1 -1
  174. package/app/.next/server/app/api/v0/conversations/[id]/route.js +1 -1
  175. package/app/.next/server/app/api/v0/conversations/[id]/route.js.nft.json +1 -1
  176. package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js +4 -3
  177. package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js.nft.json +1 -1
  178. package/app/.next/server/app/api/v0/exchanges/[id]/route.js +4 -3
  179. package/app/.next/server/app/api/v0/exchanges/[id]/route.js.nft.json +1 -1
  180. package/app/.next/server/app/api/v0/exchanges/route.js +4 -3
  181. package/app/.next/server/app/api/v0/exchanges/route.js.nft.json +1 -1
  182. package/app/.next/server/app/api/v0/mcp/route.js +6 -5
  183. package/app/.next/server/app/api/v0/mcp/route.js.nft.json +1 -1
  184. package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js +4 -3
  185. package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js.nft.json +1 -1
  186. package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js +4 -3
  187. package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js.nft.json +1 -1
  188. package/app/.next/server/app/api/v0/pins/[pinRef]/route.js +4 -3
  189. package/app/.next/server/app/api/v0/pins/[pinRef]/route.js.nft.json +1 -1
  190. package/app/.next/server/app/api/v0/requests/[id]/route.js +1 -1
  191. package/app/.next/server/app/api/v0/requests/[id]/route.js.nft.json +1 -1
  192. package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js +4 -3
  193. package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js.nft.json +1 -1
  194. package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js +4 -3
  195. package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js.nft.json +1 -1
  196. package/app/.next/server/app/api/v0/sessions/[ref]/shares/route.js +4 -3
  197. package/app/.next/server/app/api/v0/sessions/[ref]/shares/route.js.nft.json +1 -1
  198. package/app/.next/server/app/api/v0/shares/[shareRef]/revoke/route.js +4 -3
  199. package/app/.next/server/app/api/v0/shares/[shareRef]/revoke/route.js.nft.json +1 -1
  200. package/app/.next/server/app/api/v0/shares/[shareRef]/route.js +4 -3
  201. package/app/.next/server/app/api/v0/shares/[shareRef]/route.js.nft.json +1 -1
  202. package/app/.next/server/app/api/v0/shares/current/route.js +4 -3
  203. package/app/.next/server/app/api/v0/shares/current/route.js.nft.json +1 -1
  204. package/app/.next/server/app/api/v0/shares/route.js +4 -3
  205. package/app/.next/server/app/api/v0/shares/route.js.nft.json +1 -1
  206. package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js +2 -2
  207. package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js.nft.json +1 -1
  208. package/app/.next/server/app/api/wakes/[id]/decision/route.js +2 -2
  209. package/app/.next/server/app/api/wakes/[id]/decision/route.js.nft.json +1 -1
  210. package/app/.next/server/app/api/wakes/[id]/retry/route.js +2 -2
  211. package/app/.next/server/app/api/wakes/[id]/retry/route.js.nft.json +1 -1
  212. package/app/.next/server/app/bots/[id]/config/page.js.nft.json +1 -1
  213. package/app/.next/server/app/bots/[id]/config/page_client-reference-manifest.js +1 -1
  214. package/app/.next/server/app/exchanges/page.js.nft.json +1 -1
  215. package/app/.next/server/app/exchanges/page_client-reference-manifest.js +1 -1
  216. package/app/.next/server/app/exchanges.html +1 -1
  217. package/app/.next/server/app/exchanges.rsc +3 -3
  218. package/app/.next/server/app/exchanges.segments/_full.segment.rsc +3 -3
  219. package/app/.next/server/app/exchanges.segments/_tree.segment.rsc +2 -2
  220. package/app/.next/server/app/exchanges.segments/exchanges/__PAGE__.segment.rsc +3 -3
  221. package/app/.next/server/app/index.html +1 -1
  222. package/app/.next/server/app/index.rsc +3 -3
  223. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  224. package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
  225. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  226. package/app/.next/server/app/page.js.nft.json +1 -1
  227. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  228. package/app/.next/server/app/settings/page.js.nft.json +1 -1
  229. package/app/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  230. package/app/.next/server/app/settings.html +1 -1
  231. package/app/.next/server/app/settings.rsc +2 -2
  232. package/app/.next/server/app/settings.segments/_full.segment.rsc +2 -2
  233. package/app/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  234. package/app/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  235. package/app/.next/server/app/threads/[id]/route/app-paths-manifest.json +3 -0
  236. package/app/.next/server/app/threads/[id]/route/build-manifest.json +12 -0
  237. package/app/.next/server/app/threads/[id]/route/server-reference-manifest.json +4 -0
  238. package/app/.next/server/app/threads/[id]/route.js +10 -0
  239. package/app/.next/server/app/threads/[id]/route.js.nft.json +1 -0
  240. package/app/.next/server/app/threads/[id]/route_client-reference-manifest.js +3 -0
  241. package/app/.next/server/app-paths-manifest.json +11 -1
  242. package/app/.next/server/chunks/1oeh_server_app_api_bots_[id]_conversations_[conversationId]_route_actions_11cb2lr.js +3 -0
  243. package/app/.next/server/chunks/{[root-of-the-server]__17xl_55._.js → [root-of-the-server]__03pk_x_._.js} +1 -1
  244. package/app/.next/server/chunks/{[root-of-the-server]__0mp8bap._.js → [root-of-the-server]__05ds5md._.js} +1 -1
  245. package/app/.next/server/chunks/[root-of-the-server]__0anfwiu._.js +52 -0
  246. package/app/.next/server/chunks/{[root-of-the-server]__0-w_t2y._.js → [root-of-the-server]__0atpy-s._.js} +1 -1
  247. package/app/.next/server/chunks/{[root-of-the-server]__06w5xhe._.js → [root-of-the-server]__0hiikkz._.js} +1 -1
  248. package/app/.next/server/chunks/{[root-of-the-server]__1eps2a4._.js → [root-of-the-server]__0pp5x67._.js} +1 -1
  249. package/app/.next/server/chunks/{[root-of-the-server]__1dxr858._.js → [root-of-the-server]__0thkp5l._.js} +1 -1
  250. package/app/.next/server/chunks/[root-of-the-server]__0xhwlr4._.js +3 -0
  251. package/app/.next/server/chunks/{[root-of-the-server]__0-vcyi-._.js → [root-of-the-server]__11yt1hv._.js} +1 -1
  252. package/app/.next/server/chunks/{[root-of-the-server]__1x8phwp._.js → [root-of-the-server]__1280ke1._.js} +8 -6
  253. package/app/.next/server/chunks/{[root-of-the-server]__0iqh5ta._.js → [root-of-the-server]__12wk406._.js} +1 -1
  254. package/app/.next/server/chunks/{[root-of-the-server]__0qaiqut._.js → [root-of-the-server]__13wghn3._.js} +8 -6
  255. package/app/.next/server/chunks/{[root-of-the-server]__0lwsto-._.js → [root-of-the-server]__14cwco7._.js} +3 -3
  256. package/app/.next/server/chunks/{[root-of-the-server]__1kczttr._.js → [root-of-the-server]__185i_bv._.js} +1 -1
  257. package/app/.next/server/chunks/[root-of-the-server]__1byhehl._.js +3 -0
  258. package/app/.next/server/chunks/{[root-of-the-server]__10b5-i-._.js → [root-of-the-server]__1ez_5xy._.js} +1 -1
  259. package/app/.next/server/chunks/[root-of-the-server]__1jxwu9_._.js +52 -0
  260. package/app/.next/server/chunks/{[root-of-the-server]__0o9ijih._.js → [root-of-the-server]__1mxp6z6._.js} +1 -1
  261. package/app/.next/server/chunks/{[root-of-the-server]__0ey3_2x._.js → [root-of-the-server]__1s2-vw3._.js} +1 -1
  262. package/app/.next/server/chunks/{[root-of-the-server]__1hwy3jx._.js → [root-of-the-server]__1xq61ti._.js} +1 -1
  263. package/app/.next/server/chunks/{[root-of-the-server]__04b3ml2._.js → [root-of-the-server]__20om7um._.js} +1 -1
  264. package/app/.next/server/chunks/_0061c2q._.js +1 -1
  265. package/app/.next/server/chunks/_1-5mthb._.js +1 -1
  266. package/app/.next/server/chunks/_12i5gam._.js +7 -0
  267. package/app/.next/server/chunks/_1a0er16._.js +18 -0
  268. package/app/.next/server/chunks/_1uxmsh3._.js +18 -0
  269. package/app/.next/server/chunks/_next-internal_server_app_api_bots_[id]_activity_route_actions_06oyah6.js +3 -0
  270. package/app/.next/server/chunks/_next-internal_server_app_api_bots_[id]_conversations_route_actions_0op0mjv.js +3 -0
  271. package/app/.next/server/chunks/_next-internal_server_app_api_bots_[id]_overview_route_actions_20nuetv.js +3 -0
  272. 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
  273. package/app/.next/server/chunks/lib_0al5wbc._.js +330 -0
  274. package/app/.next/server/chunks/lib_0i8cm07._.js +3 -0
  275. package/app/.next/server/chunks/lib_service-api-http_ts_0xzqhny._.js +1 -23
  276. package/app/.next/server/chunks/lib_service-api_ts_18eok4w._.js +25 -0
  277. package/app/.next/server/chunks/node_modules_next_1zc5q0a._.js +11 -11
  278. package/app/.next/server/chunks/ssr/1oeh_server_app_agents_[id]_conversations_[conversationId]_page_actions_08lev_i.js +3 -0
  279. package/app/.next/server/chunks/ssr/[root-of-the-server]__06s7ons._.js +3 -0
  280. package/app/.next/server/chunks/ssr/[root-of-the-server]__0r8nmcc._.js +3 -0
  281. package/app/.next/server/chunks/ssr/[root-of-the-server]__19qlmru._.js +3 -0
  282. package/app/.next/server/chunks/ssr/[root-of-the-server]__1dpye-p._.js +3 -0
  283. package/app/.next/server/chunks/ssr/[root-of-the-server]__1fxu3a8._.js +3 -0
  284. package/app/.next/server/chunks/ssr/[root-of-the-server]__1t9ljq3._.js +3 -0
  285. package/app/.next/server/chunks/ssr/_0_u9-u6._.js +3 -0
  286. package/app/.next/server/chunks/ssr/_0g3y1u9._.js +3 -0
  287. package/app/.next/server/chunks/ssr/{node_modules_next_0x3i8za._.js → _0gzxfz3._.js} +2 -2
  288. package/app/.next/server/chunks/ssr/_0rvu-il._.js +131 -0
  289. package/app/.next/server/chunks/ssr/_0u7urta._.js +5 -0
  290. package/app/.next/server/chunks/ssr/_17ngohj._.js +3 -0
  291. package/app/.next/server/chunks/ssr/_1iq-7cn._.js +3 -0
  292. package/app/.next/server/chunks/ssr/_next-internal_server_app_agents_[id]_activity_page_actions_1a_v567.js +3 -0
  293. package/app/.next/server/chunks/ssr/_next-internal_server_app_agents_[id]_conversations_page_actions_1dpbbj-.js +3 -0
  294. package/app/.next/server/chunks/ssr/_next-internal_server_app_agents_[id]_page_actions_0k__y7g.js +3 -0
  295. package/app/.next/server/chunks/ssr/_next-internal_server_app_agents_[id]_sessions_page_actions_1hft42g.js +3 -0
  296. package/app/.next/server/chunks/ssr/_next-internal_server_app_agents_[id]_slack_page_actions_0dmtbj_.js +3 -0
  297. package/app/.next/server/chunks/ssr/app_agents_[id]_009y8_j._.js +3 -0
  298. package/app/.next/server/chunks/ssr/app_agents_[id]_0sr4fdg._.js +3 -0
  299. package/app/.next/server/chunks/ssr/app_agents_[id]_activity_AgentActivityPage_tsx_042-590._.js +3 -0
  300. package/app/.next/server/chunks/ssr/app_agents_[id]_conversations_page_tsx_15zl_c8._.js +3 -0
  301. package/app/.next/server/chunks/ssr/app_agents_[id]_sessions_page_tsx_0tfup-2._.js +10 -0
  302. package/app/.next/server/chunks/ssr/app_agents_[id]_slack_AgentSlackPage_tsx_20njhs1._.js +3 -0
  303. package/app/.next/server/chunks/ssr/app_bots_[id]_config_page_tsx_1e0uue9._.js +1 -1
  304. package/app/.next/server/chunks/ssr/app_page_tsx_0pxmutw._.js +3 -0
  305. package/app/.next/server/chunks/ssr/lib_0pfn9gs._.js +3 -0
  306. package/app/.next/server/chunks/ssr/lib_agent-registration-ui_ts_1z582mm._.js +3 -0
  307. package/app/.next/server/chunks/ssr/lib_exchange-view_ts_1a4q9ju._.js +1 -1
  308. package/app/.next/server/chunks/ssr/lib_share-view_ts_08psw5o._.js +3 -0
  309. package/app/.next/server/middleware-build-manifest.js +3 -3
  310. package/app/.next/server/next-font-manifest.js +1 -1
  311. package/app/.next/server/next-font-manifest.json +24 -4
  312. package/app/.next/server/pages/404.html +1 -1
  313. package/app/.next/server/pages/500.html +1 -1
  314. package/app/.next/server/server-reference-manifest.js +1 -1
  315. package/app/.next/server/server-reference-manifest.json +1 -1
  316. package/app/.next/static/chunks/06i_6p0-ipitj.js +1 -0
  317. package/app/.next/static/chunks/0cjh4u-f7mlwd.js +1 -0
  318. package/app/.next/static/chunks/1dhk3pcv7yvm6.js +1 -0
  319. package/app/.next/static/chunks/1ka9dp1l6c0ga.js +3 -0
  320. package/app/.next/static/chunks/1ttvnc6qdye8s.js +1 -0
  321. package/app/.next/static/chunks/1ypwptc0fsn4w.js +1 -0
  322. package/app/.next/static/chunks/2-fhbx41zyanc.js +1 -0
  323. package/app/.next/static/chunks/2cc4uzbhs_v23.js +1 -0
  324. package/app/.next/static/chunks/2n1u8a2efnt88.js +1 -0
  325. package/app/.next/static/chunks/2q4c2cj6ftmp_.css +3 -0
  326. package/app/.next/static/chunks/34v8aumua0x5n.js +1 -0
  327. package/app/.next/static/chunks/3aasli1i-eiio.js +1 -0
  328. package/app/.next/static/chunks/3p_p4gnr0d2-x.js +1 -0
  329. package/app/.next/static/chunks/3s9t477v-z09o.js +1 -0
  330. package/app/.next/static/chunks/3y5bo6syunkzn.js +8 -0
  331. package/app/BUILD_INFO.json +2 -2
  332. package/app/package.json +1 -1
  333. package/app/server.js +1 -1
  334. package/package.json +1 -1
  335. package/app/.next/server/app/threads/[id]/page/app-paths-manifest.json +0 -3
  336. package/app/.next/server/app/threads/[id]/page_client-reference-manifest.js +0 -3
  337. package/app/.next/server/chunks/[root-of-the-server]__0d3fjix._.js +0 -3
  338. package/app/.next/server/chunks/lib_agent-api_ts_0iv52-o._.js +0 -3
  339. package/app/.next/server/chunks/ssr/[root-of-the-server]__1t063pe._.js +0 -3
  340. package/app/.next/server/chunks/ssr/_00ysoah._.js +0 -3
  341. package/app/.next/server/chunks/ssr/_1cvuhjt._.js +0 -3
  342. package/app/.next/server/chunks/ssr/_1lkd0ui._.js +0 -3
  343. package/app/.next/server/chunks/ssr/_1n5mvo5._.js +0 -3
  344. package/app/.next/server/chunks/ssr/_1o94bnv._.js +0 -12
  345. package/app/.next/server/chunks/ssr/_1r5kd5j._.js +0 -3
  346. package/app/.next/static/chunks/0y1ihx4vq8du3.js +0 -10
  347. package/app/.next/static/chunks/1c2dl2ga-lqcb.css +0 -3
  348. package/app/.next/static/chunks/2q-tgwkalrnms.js +0 -1
  349. package/app/.next/static/chunks/2qf-mb__71dkk.js +0 -1
  350. package/app/.next/static/chunks/399dvlpyl00wn.js +0 -1
  351. package/app/.next/static/chunks/3b7r6u9nfsjb1.js +0 -1
  352. package/app/.next/static/chunks/3f1v-zuki9k7k.js +0 -1
  353. /package/app/.next/server/app/{threads/[id] → agents/[id]/activity}/page/build-manifest.json +0 -0
  354. /package/app/.next/server/app/{threads/[id] → agents/[id]/activity}/page/react-loadable-manifest.json +0 -0
  355. /package/app/.next/server/app/{threads/[id] → agents/[id]/activity}/page/server-reference-manifest.json +0 -0
  356. /package/app/.next/static/{3rSDqQK0KGcTDI98uoZRy → k_jNwnr0zNTXiU6M6Kx5O}/_buildManifest.js +0 -0
  357. /package/app/.next/static/{3rSDqQK0KGcTDI98uoZRy → k_jNwnr0zNTXiU6M6Kx5O}/_clientMiddlewareManifest.js +0 -0
  358. /package/app/.next/static/{3rSDqQK0KGcTDI98uoZRy → k_jNwnr0zNTXiU6M6Kx5O}/_ssgManifest.js +0 -0
@@ -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),s=e.i(22016),a=e.i(50814);e.s(["default",0,function({summary:e,onChanged:i}){let[o,r]=(0,n.useState)(!1),[l,c]=(0,n.useState)(""),d=(0,a.stateTone)(e.state),u=(0,a.outcomeLine)(e),p=(0,a.failureAdvice)(e),h=`exchange-${e.id}-title`,m=async()=>{if(!o){r(!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{r(!1),i?.()}}};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,a.modeLabel)(e.mode)}),(0,t.jsx)("span",{id:h,className:"exchange-card-title",children:(0,a.participantsLabel)(e)}),(0,t.jsx)("span",{className:"exchange-card-state",role:"status",children:(0,a.liveStateLabel)(e)})]}),(0,t.jsx)("p",{className:"exchange-card-session",children:(0,a.sessionLabel)(e)}),(0,t.jsxs)("p",{className:"exchange-card-instruction",children:[(0,t.jsx)("span",{className:"exchange-card-key",children:(0,a.instructionHeading)(e.mode)})," ",(0,a.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,a.formatExchangeTime)(e.updated_at)]}),(0,t.jsx)(s.default,{className:"exchange-card-link",href:(0,a.detailsHref)(e.id),"aria-label":`Details: ${(0,a.modeLabel)(e.mode)} ${(0,a.participantsLabel)(e)}`,children:"Details"}),e.can_cancel?(0,t.jsx)("button",{type:"button",className:"exchange-card-cancel",disabled:o,onClick:()=>{m()},children:o?"Cancelling…":"Cancel"}):null]})]})}])},46986,15366,e=>{"use strict";var t=e.i(43476),n=e.i(71645),s=e.i(96594);e.s(["default",0,function({failure:e}){let[a,i]=(0,n.useState)("idle"),o=(0,s.severityLabel)(e.severity),r=(0,n.useId)();async function l(){try{await navigator.clipboard.writeText(e.detail),i("copied")}catch{i("failed")}}return(0,t.jsxs)("div",{className:`runtime-failure runtime-failure-${e.severity}`,role:"status","aria-labelledby":r,"data-runtime-failure":e.kind,children:[(0,t.jsxs)("p",{className:"runtime-failure-title",id:r,children:[(0,t.jsx)("span",{className:"runtime-failure-severity",children:o}),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"===a?"Copied":"failed"===a?"Copy failed":"Copy details"})]})]})}],46986);let a={blocked:"Needs approval",rejected:"Not started",allowed:"Allowed",denied:"Denied",waiting:"Queued",stopped:"Stopped"};e.s(["default",0,function({notice:e,onDone:s}){let[i,o]=(0,n.useState)(!1),[r,l]=(0,n.useState)(""),c="blocked"!==e.tone||e.actionable?a[e.tone]:"Blocked",d=async t=>{if(!i&&e.wakeId){o(!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{o(!1),s()}}};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:i,onClick:()=>{d("allow")},children:"Allow"}),(0,t.jsx)("button",{type:"button",className:"approve-control",style:{marginLeft:8},disabled:i,onClick:()=>{d("deny")},children:"Deny"})]}):null,r?(0,t.jsx)("p",{className:"wake-notice-error",role:"alert",children:r}):null]})}],15366)},33851,44079,52900,68541,e=>{"use strict";var t=e.i(3136);let n="This computer",s={read_only:"Read only",workspace_write:"Workspace write"},a={workspaces:"Selected workspaces",sessions:"Selected imported sessions",all_provider_sessions:"All sessions this runtime can see"};function i(e){return e.startsWith("/")||"~"===e||e.startsWith("~/")}function o(e){return e.length>1?e.replace(/\/+$/,""):e}t.AGENTS.join("|");let r="/api/runtime-connections",l={connection:"Runtime connection",scope:"Session scope",defaultWorkspace:"Default workspace (optional)",policy:"Policy",homeSession:"Home session (optional)"},c={connection:"The runtime installation or account this Agent uses. Several Agents can share one.",workspaces:"One absolute path per line. An empty scope never means unrestricted.",sessions:"Only this Agent’s own Botmancers sessions can be selected.",noSessions:"This Agent has no sessions yet. Choose workspaces or all sessions for now.",allSessions:"Every session this runtime can see. Choose this only on purpose.",defaultWorkspace:"Where new sessions start. Convenience only — not a permission.",resumeEdits:"Needs Workspace write.",homeSession:"A stable session to return to. Must be one of this Agent’s sessions.",addConnection:"Stores a name and host only. Credentials stay with the runtime."},d="Loading runtime connections…",u="Couldn't load runtime connections — retry.";function p(){return{status:"loading",connections:[],error:""}}function h(e){return`${e.label} \xb7 ${t.AGENT_LABELS[e.provider]??e.provider}`}function m(e){if("object"!=typeof e||null===e)return null;let t=e.connections;if(!Array.isArray(t))return null;let n=[];for(let e of t){if("object"!=typeof e||null===e||"string"!=typeof e.id||"string"!=typeof e.provider||"string"!=typeof e.label)return null;n.push({id:e.id,provider:e.provider,label:e.label,host:"string"==typeof e.host?e.host:"",agent_count:"number"==typeof e.agent_count?e.agent_count:void 0})}return n}function f(e){let t=[];for(let n of e.split("\n")){let e=n.trim();e&&!t.includes(e)&&t.push(e)}return t}function g(e){return"workspaces"===e.scopeKind?{kind:"workspaces",workspaces:f(e.workspaces)}:"sessions"===e.scopeKind?{kind:"sessions",sessions:e.sessions}:{kind:e.scopeKind}}function k(e){return{mode:e.policyMode,allow_new_sessions:e.allowNewSessions,allow_resume_with_edits:e.allowResumeWithEdits}}e.s(["CONNECTIONS_ENDPOINT",0,r,"CONNECTIONS_ERROR_COPY",0,u,"CONNECTIONS_LOADING_COPY",0,d,"DEFAULT_REGISTRATION_FORM",0,{connectionId:"",scopeKind:"",workspaces:"",sessions:[],defaultWorkspace:"",policyMode:"read_only",allowNewSessions:!0,allowResumeWithEdits:!1,homeSessionId:""},"HINTS",0,c,"LABELS",0,l,"connectionOptionLabel",0,h,"hasRegistrationErrors",0,function(e){return Object.keys(e.errors).length>0},"initialConnectionListState",0,p,"parseConnectionList",0,m,"registrationCreateBody",0,function(e,t){let n={name:String(e??"").trim(),runtime_connection_id:t.connectionId,session_scope:g(t),policy:k(t)},s=t.defaultWorkspace.trim();return s&&(n.default_workspace=s),n},"registrationFormFromBot",0,function(e){let t=e.session_scope??null;return{connectionId:e.runtime_connection_id??"",scopeKind:t?.kind??"",workspaces:t?.kind==="workspaces"?t.workspaces.join("\n"):"",sessions:t?.kind==="sessions"?[...t.sessions]:[],defaultWorkspace:e.default_workspace??"",policyMode:e.policy?.mode??"read_only",allowNewSessions:!e.policy||e.policy.allow_new_sessions,allowResumeWithEdits:!!e.policy&&e.policy.allow_resume_with_edits,homeSessionId:e.home_session_id??""}},"registrationFormView",0,function(e,t){let n={};e.connectionId||(n.connection="Pick a runtime connection.");let s=f(e.workspaces);e.scopeKind?"workspaces"===e.scopeKind?0===s.length?n.workspaces="Add at least one workspace.":s.every(i)||(n.workspaces="Workspaces must be absolute paths (or start with ~/)."):"sessions"===e.scopeKind&&0===e.sessions.length&&(n.sessions="Select at least one session."):n.scope="Choose a session scope.";let a=e.defaultWorkspace.trim();a&&(i(a)?"workspaces"!==e.scopeKind||n.workspaces||s.some(e=>{let t,n;return t=o(e),t===(n=o(a))||n.startsWith("/"===t?"/":`${t}/`)})||(n.defaultWorkspace="The default workspace must be inside one of the selected workspaces."):n.defaultWorkspace="The default workspace must be an absolute path (or start with ~/)."),e.allowResumeWithEdits&&"workspace_write"!==e.policyMode&&(n.policy="Resume with edits needs the Workspace write policy.");let r="",l=!1;return"ready"!==t.status&&(l=!0,r="error"===t.status?u:""),{errors:n,submitDisabled:l,blocker:r}},"registrationPatchBody",0,function(e,t){return{id:e,runtime_connection_id:t.connectionId,session_scope:g(t),default_workspace:t.defaultWorkspace.trim(),policy:k(t),home_session_id:t.homeSessionId}},"registrationReadView",0,function(e,n){var i;let o,r=[{key:"connection",label:l.connection,value:(o=e.runtime_connection)?`${o.label} (${(0,t.agentLabel)(o.provider)} \xb7 ${o.host})`:"Not set"},{key:"scope",label:l.scope,value:function(e,t){if(!e)return"Not set — this Agent cannot launch until a scope is chosen.";if("all_provider_sessions"===e.kind)return a.all_provider_sessions;if("workspaces"===e.kind)return`${a.workspaces}: ${e.workspaces.join(", ")}`;let n=e.sessions.map(e=>t?.find(t=>t.ref===e)?.title??e);return`${a.sessions}: ${n.join(", ")}`}(e.session_scope,n)},{key:"defaultWorkspace",label:"Default workspace",value:e.default_workspace||"None"},{key:"policy",label:l.policy,value:(i=e.policy)?[s[i.mode],i.allow_new_sessions?"new sessions allowed":"no new sessions",i.allow_resume_with_edits?"resume with edits allowed":"no resume with edits"].join(" · "):"Not set"}],c=[];return r.push({key:"homeSession",label:"Home session",value:e.home_session_id?n?.find(t=>t.ref===e.home_session_id)?.title??e.home_session_id:"None"}),"connection"===e.launch_blocker?c.push("Choose a runtime connection before this Agent can run."):"session_scope"===e.launch_blocker?c.push("Choose a session scope before this Agent can run."):"agent"===e.launch_blocker&&c.push("This Agent has an unsupported Agent type."),{rows:r,notices:c}}],33851);var b=e.i(43476),y=e.i(71645),w=e.i(74904);let _={modal:{fieldset:"agent-fieldset reg-fieldset",legend:"field-legend",label:"",picks:"runtime-picks",pick:"runtime-pick",stack:"reg-stack",control:"reg-control",input:"",hint:"runtime-hint",error:"form-error reg-error",button:"runtime-retry",note:"runtime-note"},config:{fieldset:"agent-fieldset reg-fieldset",legend:"block text-sm cfg-muted mt-3 mb-1 p-0",label:"block text-sm cfg-muted mt-3 mb-1",picks:"flex flex-wrap gap-x-4 gap-y-1 text-sm cfg-muted",pick:"text-sm cfg-muted",stack:"flex flex-col gap-1 text-sm cfg-muted",control:"cfg-input text-sm",input:"cfg-input text-sm",hint:"mt-1 text-xs cfg-faint",error:"mt-1 text-sm cfg-error",button:"cfg-link text-sm",note:"text-sm cfg-muted mt-1"}};function x({id:e,message:t,variant:n}){return t?(0,b.jsx)("p",{id:e,className:_[n].error,role:"alert",children:t}):null}function v({idPrefix:e,variant:t,onAdd:s}){let a=_[t],[i,o]=(0,y.useState)(!1),[r,l]=(0,y.useState)(w.AGENT_OPTIONS[0].value),[d,u]=(0,y.useState)(""),[p,h]=(0,y.useState)(""),[m,f]=(0,y.useState)(""),[g,k]=(0,y.useState)(!1),x=async()=>{if(g)return;k(!0),f("");let e=await s({provider:r,label:d,host:p.trim()||n});(k(!1),"string"==typeof e)?f(e):(o(!1),u(""),h(""))};return i?(0,b.jsxs)("div",{id:`${e}-add-connection`,className:"reg-add-connection",role:"group","aria-label":"Add connection",children:[(0,b.jsx)("label",{className:a.label,htmlFor:`${e}-add-provider`,children:"Provider"}),(0,b.jsx)("select",{id:`${e}-add-provider`,className:a.control,value:r,onChange:e=>l(e.target.value),children:w.AGENT_OPTIONS.map(e=>(0,b.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,b.jsx)("label",{className:a.label,htmlFor:`${e}-add-label`,children:"Connection name"}),(0,b.jsx)("input",{id:`${e}-add-label`,type:"text",className:a.input||void 0,value:d,placeholder:"Codex on my laptop",onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),x())}}),(0,b.jsx)("label",{className:a.label,htmlFor:`${e}-add-host`,children:"Host"}),(0,b.jsx)("input",{id:`${e}-add-host`,type:"text",className:a.input||void 0,value:p,placeholder:n,"aria-describedby":`${e}-add-hint`,onChange:e=>h(e.target.value)}),(0,b.jsx)("p",{id:`${e}-add-hint`,className:a.hint,children:c.addConnection}),m?(0,b.jsx)("p",{className:a.error,role:"alert",children:m}):null,(0,b.jsxs)("div",{className:"reg-actions",children:[(0,b.jsx)("button",{type:"button",className:a.button,onClick:()=>void x(),disabled:g,children:g?"Adding…":"Add"}),(0,b.jsx)("button",{type:"button",className:a.button,"aria-expanded":"true",onClick:()=>o(!1),children:"Cancel"})]})]}):(0,b.jsx)("button",{type:"button",className:a.button,"aria-expanded":"false","aria-controls":`${e}-add-connection`,onClick:()=>o(!0),children:"Add connection…"})}e.s(["RegistrationFields",0,function({idPrefix:e,variant:t,form:n,onChange:i,view:o,showErrors:r,connections:p,onRetryConnections:m,onAddConnection:f,workspacePlaceholder:g,workspaceHint:k,sessions:y,includeHomeSession:w}){let $=_[t],N=e=>r?o.errors[e]:void 0,j=t=>`${e}-${t}-error`,C=(e,...t)=>[...t,N(e)?j(e):""].filter(Boolean).join(" ")||void 0,S=!!(y&&y.length>0);return(0,b.jsxs)("div",{className:"registration-fields","data-registration":t,children:[(0,b.jsxs)("fieldset",{className:$.fieldset,"data-field":"connection","aria-describedby":C("connection",`${e}-connection-hint`),children:[(0,b.jsx)("legend",{className:$.legend,id:`${e}-connection-legend`,children:l.connection}),"loading"===p.status?(0,b.jsx)("p",{className:$.note,role:"status",children:d}):"error"===p.status?(0,b.jsxs)("p",{className:$.note,role:"status",children:[u," ",(0,b.jsx)("button",{type:"button",className:$.button,onClick:m,children:"Retry"})]}):(0,b.jsxs)("select",{id:`${e}-connection`,className:$.control,"aria-labelledby":`${e}-connection-legend`,"aria-required":"true","aria-invalid":!!N("connection")||void 0,value:n.connectionId,onChange:e=>i({connectionId:e.target.value}),children:[(0,b.jsx)("option",{value:"",disabled:!0,children:"Select a connection…"}),p.connections.map(e=>(0,b.jsx)("option",{value:e.id,children:h(e)},e.id))]}),(0,b.jsx)("p",{id:`${e}-connection-hint`,className:$.hint,children:c.connection}),(0,b.jsx)(x,{id:j("connection"),message:N("connection"),variant:t}),"ready"===p.status?(0,b.jsx)(v,{idPrefix:e,variant:t,onAdd:async e=>{let t=await f(e);return"string"!=typeof t&&i({connectionId:t.id}),t}}):null]}),(0,b.jsxs)("fieldset",{className:$.fieldset,"data-field":"scope",children:[(0,b.jsx)("legend",{className:$.legend,id:`${e}-scope-legend`,children:l.scope}),(0,b.jsx)("div",{className:$.stack,role:"radiogroup","aria-labelledby":`${e}-scope-legend`,"aria-required":"true","aria-describedby":C("scope"),children:["workspaces","sessions","all_provider_sessions"].map(t=>(0,b.jsxs)("label",{className:$.pick,children:[(0,b.jsx)("input",{type:"radio",name:`${e}-scope`,value:t,checked:n.scopeKind===t,disabled:"sessions"===t&&!S,onChange:()=>i({scopeKind:t})})," "+a[t]]},t))}),S?null:(0,b.jsx)("p",{className:$.hint,children:c.noSessions}),(0,b.jsx)(x,{id:j("scope"),message:N("scope"),variant:t}),"workspaces"===n.scopeKind?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("label",{className:$.label,htmlFor:`${e}-workspaces`,children:"Workspaces"}),(0,b.jsx)("textarea",{id:`${e}-workspaces`,className:$.input||void 0,rows:2,value:n.workspaces,placeholder:"/Users/you/work/project","aria-required":"true","aria-invalid":!!N("workspaces")||void 0,"aria-describedby":C("workspaces",`${e}-workspaces-hint`),onChange:e=>i({workspaces:e.target.value})}),(0,b.jsx)("p",{id:`${e}-workspaces-hint`,className:$.hint,children:c.workspaces}),(0,b.jsx)(x,{id:j("workspaces"),message:N("workspaces"),variant:t})]}):null,"sessions"===n.scopeKind&&y?(0,b.jsxs)("div",{className:$.stack,role:"group","aria-label":"Sessions in scope","aria-describedby":C("sessions",`${e}-sessions-hint`),children:[y.map(e=>(0,b.jsxs)("label",{className:$.pick,children:[(0,b.jsx)("input",{type:"checkbox",checked:n.sessions.includes(e.ref),onChange:t=>i({sessions:t.target.checked?[...n.sessions,e.ref]:n.sessions.filter(t=>t!==e.ref)})}),` ${e.title} (${e.status})`]},e.ref)),(0,b.jsx)("p",{id:`${e}-sessions-hint`,className:$.hint,children:c.sessions}),(0,b.jsx)(x,{id:j("sessions"),message:N("sessions"),variant:t})]}):null,"all_provider_sessions"===n.scopeKind?(0,b.jsx)("p",{className:$.hint,children:c.allSessions}):null]}),(0,b.jsxs)("div",{"data-field":"default-workspace",children:[(0,b.jsx)("label",{className:$.label,htmlFor:`${e}-default-workspace`,children:l.defaultWorkspace}),(0,b.jsx)("input",{id:`${e}-default-workspace`,type:"text",className:$.input||void 0,value:n.defaultWorkspace,placeholder:g,"aria-invalid":!!N("defaultWorkspace")||void 0,"aria-describedby":C("defaultWorkspace",`${e}-default-workspace-hint`,`${e}-default-workspace-note`),onChange:e=>i({defaultWorkspace:e.target.value})}),(0,b.jsx)("p",{id:`${e}-default-workspace-hint`,className:$.hint,children:k}),(0,b.jsx)("p",{id:`${e}-default-workspace-note`,className:$.hint,children:c.defaultWorkspace}),(0,b.jsx)(x,{id:j("defaultWorkspace"),message:N("defaultWorkspace"),variant:t})]}),(0,b.jsxs)("fieldset",{className:$.fieldset,"data-field":"policy",children:[(0,b.jsx)("legend",{className:$.legend,id:`${e}-policy-legend`,children:l.policy}),(0,b.jsx)("div",{className:$.picks,role:"radiogroup","aria-labelledby":`${e}-policy-legend`,children:["read_only","workspace_write"].map(t=>(0,b.jsxs)("label",{className:$.pick,children:[(0,b.jsx)("input",{type:"radio",name:`${e}-policy`,value:t,checked:n.policyMode===t,onChange:()=>i("read_only"===t?{policyMode:t,allowResumeWithEdits:!1}:{policyMode:t})})," "+s[t]]},t))}),(0,b.jsxs)("div",{className:$.stack,children:[(0,b.jsxs)("label",{className:$.pick,children:[(0,b.jsx)("input",{type:"checkbox",checked:n.allowNewSessions,onChange:e=>i({allowNewSessions:e.target.checked})})," Allow new sessions"]}),(0,b.jsxs)("label",{className:$.pick,children:[(0,b.jsx)("input",{type:"checkbox",checked:n.allowResumeWithEdits,disabled:"workspace_write"!==n.policyMode,"aria-describedby":`${e}-resume-hint`,onChange:e=>i({allowResumeWithEdits:e.target.checked})})," Allow resume with edits"]}),(0,b.jsx)("p",{id:`${e}-resume-hint`,className:$.hint,children:c.resumeEdits})]}),(0,b.jsx)(x,{id:j("policy"),message:N("policy"),variant:t})]}),w?(0,b.jsxs)("div",{"data-field":"home-session",children:[(0,b.jsx)("label",{className:$.label,htmlFor:`${e}-home-session`,children:l.homeSession}),(0,b.jsxs)("select",{id:`${e}-home-session`,className:$.control,value:n.homeSessionId,"aria-describedby":`${e}-home-session-hint`,onChange:e=>i({homeSessionId:e.target.value}),children:[(0,b.jsx)("option",{value:"",children:"None"}),(y??[]).map(e=>(0,b.jsx)("option",{value:e.ref,children:`${e.title} (${e.status})`},e.ref))]}),(0,b.jsx)("p",{id:`${e}-home-session-hint`,className:$.hint,children:c.homeSession})]}):null]})}],44079),e.s(["useRuntimeConnections",0,function(){let[e,t]=(0,y.useState)(()=>p()),[n,s]=(0,y.useState)(0);return(0,y.useEffect)(()=>{let e=!1;return fetch(r,{cache:"no-store"}).then(async n=>{let s=n.ok?m(await n.json().catch(()=>null)):null;e||t(s?{status:"ready",connections:s,error:""}:{status:"error",connections:[],error:`HTTP ${n.status}`})}).catch(n=>{e||t({status:"error",connections:[],error:n instanceof Error?n.message:String(n)})}),()=>{e=!0}},[n]),{state:e,retry:(0,y.useCallback)(()=>{t(p()),s(e=>e+1)},[]),add:(0,y.useCallback)(async e=>{let n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await n.json().catch(()=>null);if(!n.ok)return"string"==typeof s?.error?s.error:"Failed to add the connection";let a=m({connections:[s]})?.[0];return a?(t(e=>({status:"ready",connections:[...e.connections,a],error:""})),a):"Failed to add the connection"},[])}}],52900);let $="imported",N=/^[A-Za-z0-9_-]{1,128}$/;function j(e){let t=new URLSearchParams(e).get($);if(null===t)return null;let n=t.trim();return N.test(n)?n:""}function C(e){return`/bots/${encodeURIComponent(e)}/config`}async function S(e,t,n){let s=j(e);if(null===s)return{kind:"none"};if(!s)return{kind:"missing"};if(s===t)return{kind:"stay"};try{return await n(s)?{kind:"open",path:C(s)}:{kind:"missing"}}catch{return{kind:"missing"}}}e.s(["HANDOFF_STATUS_PATH",0,"/api/marketplace-handoff/status","IMPORT_RETURN_QUERY",0,$,"handoffStartPath",0,function(e,t){return`/api/marketplace-handoff?return=${encodeURIComponent(e+t)}`},"importedBotId",0,j,"importedConfigPath",0,C,"marketImportView",0,function(e){switch(e){case"checking":return{busy:!0,tone:"muted",message:"Checking Grok Marketplace…"};case"redirecting":return{busy:!0,tone:"muted",message:"Opening Grok Marketplace…"};case"unavailable":return{busy:!1,tone:"error",message:"Grok Marketplace isn't configured. Set CLONE_MARKET_URL on the Botmancers server."};case"failed":return{busy:!1,tone:"error",message:"Couldn't reach Botmancers to start the import. Try again."};case"missing":return{busy:!1,tone:"error",message:"Imported agent not found. The import may not have completed."};default:return{busy:!1,tone:"muted",message:"Imports a new agent and opens its Config. This agent is not changed."}}},"resolveImportReturn",0,S],68541)},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 s=t;return"email"!==s.channel&&"slack"!==s.channel||"open"!==s.state&&"sent"!==s.state&&"discarded"!==s.state||"string"!=typeof s.recipient||"string"!=typeof s.body?null:{channel:s.channel,recipient:s.recipient,body:s.body,state:s.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 s(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 i(e){return e.toFixed(1).replace(/\.0$/,"")}function o(e){return e.toLocaleString("en-US")}function r(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?r(t):n?o(t):t<1e3?String(t):t<999950?`${i(t/1e3)}k`:t<99995e4?`${i(t/1e6)}M`:`${i(t/1e9)}B`}function d(e){return`${e} ${1===e?"run":"runs"}`}function u(e,t,n=!1){let s=l[e];if(!t||"unavailable"===t.quality||null===t.sum)return{name:s,text:a,quality:"unavailable",coverage:t&&t.total>0?`0 of ${d(t.total)} reported`:"No runs recorded",label:`${s}: not reported`};let i=c(e,t.sum,n),o=c(e,t.sum,!0);return"partial"===t.quality?{name:s,text:i,quality:"partial",coverage:`Partial: ${t.known} of ${d(t.total)} reported`,label:`${s}: at least ${o}, partial, reported by ${t.known} of ${d(t.total)}`}:{name:s,text:i,quality:"complete",coverage:`All ${d(t.total)} reported`,label:`${s}: ${o}, 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,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}=s(n.last_error_code,a),i=a?`${a} sessions`:"sessions";return`Could not read ${i}: ${e}. ${t}`}if(n&&null===n.synced_at)return`${t} has not synced sessions yet. Refresh to load past sessions.`;let i=n?.out_of_scope_count??0;return i>0?`${i} ${1===i?"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 s=Math.floor(n/6e4);if(s<60)return`${s} minute${1===s?"":"s"} ago`;let a=Math.floor(s/60);if(a<24)return`${a} hour${1===a?"":"s"} ago`;let i=Math.floor(a/24);return`${i} day${1===i?"":"s"} ago`},"noMatchingSessionsCopy",0,function(e,t){let s=e.trim();if(s)return`No sessions match “${s}”.`;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}=s(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=u("input_tokens",e?.input_tokens),n=u("output_tokens",e?.output_tokens),s=u("cost_usd",e?.cost_usd),i=[t,n,s];if(i.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"===s.quality?"cost not reported":s.text].join(" · "),r=i.some(e=>"partial"===e.quality),l=r||i.some(e=>"unavailable"===e.quality)?"partial":"complete";return{text:o,label:`Reported usage: ${i.map(e=>e.label).join("; ")}`,quality:l,partial:r}},"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?a:o(e.input_tokens),output:null===e.output_tokens?a:o(e.output_tokens),cost:null===e.cost_usd?a:r(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))],s=t.map(e=>n(e)??e);return t.map((e,t)=>({value:e,label:s.filter(e=>e===s[t]).length>1?e:s[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 k(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??{},s=t.source.agent_name,a=t.destination?.agent_name??"the destination Agent",i="string"==typeof n.hop?n.hop:null;switch(e.type){case"created":return"ask"===t.mode?`You asked ${s}'s session a question`:`You handed ${s}'s session to ${a}`;case"hop_queued":if("deliver"===i)return`Handoff queued for ${a}'s new session`;return"extract"===i?`Handoff extraction queued in ${s}'s session`:`Question queued for ${s}'s session`;case"hop_started":if("deliver"===i)return`${a} started a new session`;return"extract"===i?`${s}'s session started extracting the handoff`:`${s}'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`${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,g,"exchangeRequestBody",0,function(e,t,n){let s={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&&(s.destination={agent_id:e.destinationAgentId}),s},"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(k)},"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,s,a){return{action:e,content:t.trim(),conversation_id:n,idempotency_key:a,..."resume"===e?{approve_write:s}:{}}},"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.`},s=n.available?{available:!0}:{available:!1,code:"ended"===e.status?"session_ended":"session_not_resumable",reason:n.reason,recovery:"choose_session"};t={ask:s,resume:{available:!1,code:"action_unavailable",reason:`${p.resume} is unavailable: this runtime can’t resume a session with edits.`,recovery:"choose_action"},handoff:s}}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 s=n.toString();return`/agents/${encodeURIComponent(e.thread_agent_id)}/conversations/${encodeURIComponent(e.id)}${s?`?${s}`:""}`}if("group"!==e.kind)return null;t&&n.set("exchange",t);let s=n.toString();return`/threads/${encodeURIComponent(e.id)}${s?`?${s}`:""}`},"validateDraft",0,function(e){let t={},n=e.instruction.trim(),s="ask"===e.mode?"a question":"an objective";return n?e.instruction.length>4e3&&(t.instruction="Keep it under 4000 characters."):t.instruction=`Enter ${s}.`,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)},71836,e=>{"use strict";e.s(["DIALOG_FOCUSABLE",0,'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])',"newAgentDialogPlacement",0,function(e,t){let n=Math.min(358,t.width-32),s=Math.max(16,t.width-16-n),a=16,i=16;if(e){i=Math.min(Math.max(e.left,16),s);let n=e.bottom+8;t.height-n-16>=360&&(a=n)}return{top:a,left:i,maxHeight:Math.max(0,t.height-a-16)}},"wrapFocusTarget",0,function(e,t,n){if(0===e.length)return null;let s=e[0],a=e[e.length-1],i=null!==t&&e.includes(t);return n?i&&t!==s?null:a:i&&t!==a?null:s}])},54423,e=>{"use strict";e.s(["wakeNotices",0,function(e){let t=[],n=new Map;return e.forEach((s,a)=>{let i="string"==typeof s.data.target_name?s.data.target_name:null;s.requestId&&i&&n.set(s.requestId,i);let o=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}}(s);if(!o)return;let r=Array.isArray(s.data.actions)?s.data.actions:[],l=null!==s.requestId&&e.slice(a+1).some(e=>e.requestId===s.requestId);if("waiting"===o&&l)return;let c=s.requestId?n.get(s.requestId):void 0,d="denied"===o&&c?`Wake denied: ${c} — no work ran`:"waiting"===o&&c?`Queued: ${c} — waiting for capacity`:s.text;t.push({eventId:s.eventId,wakeId:s.wakeId,tone:o,text:d,actionable:"blocked"===o&&!!s.wakeId&&r.includes("allow")&&r.includes("deny")&&!l,createdAt:s.createdAt})}),t}])}]);
@@ -0,0 +1,3 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,89873,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(57688),a=e.i(22016),i=e.i(18566),l=e.i(87303),o=e.i(15983),s=e.i(64711),u=e.i(74904),c=e.i(96594);function d(e){if(!e)return"";let t=(0,s.parseRun)(e);if(t)return(0,s.runLine)(t);let r=(0,c.classifyRuntimeFailure)(e);if(r)return r.title;let n=(0,u.agentEventDisplay)(e);return n?`${n.label} ${n.detail}`.replace(/\s+/g," ").trim():e.replace(/\s+/g," ").trim()}function f(e){return"chief-of-staff"===e.name.toLowerCase()}function p(e){return f(e)?0:e.pinned?1:2}e.s(["default",0,function({agents:e,activeAgentId:s,workingIds:c=[],beatClock:h,now:m,status:g="",logoDrop:y=!1,onAgentsChange:b,onNew:v,onManage:x,onDeleted:w,newButtonRef:j,manageButtonRef:_}){let k=(0,i.useRouter)(),[S,E]=(0,r.useState)(null),[C,$]=(0,r.useState)(""),[P,A]=(0,r.useState)(!1),[O,N]=(0,r.useState)(null),[R,T]=(0,r.useState)(null),D=(0,r.useRef)(null),L=(0,r.useRef)(null),M=e.filter(e=>!e.hidden).sort((e,t)=>p(e)-p(t)),I=e.filter(e=>e.hidden),z=async(t,r)=>{let n=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:t.id,...r})});if(!n.ok)return null;let a=await n.json();return b(e.map(e=>e.id===a.id?{...e,...a}:e)),a},U=(e,t=30)=>requestAnimationFrame(()=>{let r=document.querySelector(`[data-open-bot="${e}"]`);r?r.focus():t>0&&U(e,t-1)}),F=(e=!0)=>{let t=R?.returnTo;T(null),e&&t&&requestAnimationFrame(()=>{t.isConnected&&t.focus()})};(0,r.useEffect)(()=>{if(!R)return;let e=e=>{"Escape"===e.key&&(T(null),R.returnTo?.focus())},t=e=>{D.current?.contains(e.target)||T(null)};return document.addEventListener("keydown",e),document.addEventListener("pointerdown",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("pointerdown",t)}},[R]);let B=async e=>{let t=C.trim();E(null),t&&t!==e.name&&await z(e,{name:t})},H=(e,r)=>(0,t.jsx)("input",{className:"bot-name","aria-label":`Rename ${e.name}`,value:C,autoFocus:!0,onChange:e=>$(e.target.value),onBlur:()=>{B(e)},onKeyDown:t=>{"Enter"===t.key&&(t.preventDefault(),t.currentTarget.blur(),U(e.id)),"Escape"===t.key&&(E(null),U(e.id))},style:r}),q=(e,r)=>(0,t.jsx)("button",{type:"button",className:"bot-name row-open","data-open-bot":e.id,"aria-current":s===e.id?"true":void 0,onClick:()=>k.push(`/agents/${encodeURIComponent(e.id)}`),style:r,children:e.name}),W=e=>(0,t.jsx)("button",{type:"button",className:"row-actions","aria-haspopup":"menu","aria-expanded":R?.agent.id===e.id,"aria-label":`Actions for ${e.name}`,title:`Actions for ${e.name}`,onClick:t=>{let r=t.currentTarget.getBoundingClientRect();T({agent:e,x:r.left,y:r.bottom+4,returnTo:t.currentTarget})},children:"⋯"}),Q=e=>(0,t.jsxs)("div",{className:"row-tip",children:[e.unread&&s!==e.id?(0,t.jsx)("div",{className:"card-role",children:"Unread"}):null,(0,t.jsx)("div",{className:"card-role",children:function(e,t,r,n){if(!e||!t||n-r+(t-e)>15e3)return"Stopped";let a=new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles",hour:"numeric",minute:"2-digit",second:"2-digit"}).format(new Date(e));return`Heartbeat ${a}`}(e.last_seen,h.serverNow,h.fetchedAt,m)})]}),G=(e,t)=>{e.preventDefault(),T({agent:t,x:e.clientX,y:e.clientY,returnTo:e.currentTarget.querySelector("[data-open-bot]")})},K=e=>(0,t.jsxs)("div",{className:s===e.id?"bot-row is-open":"bot-row",onContextMenu:t=>G(t,e),children:[(0,t.jsxs)("span",{className:"mark-avatar mark-avatar-sm",children:[(0,t.jsx)(l.default,{bot:e,size:36,title:`${e.name} avatar`}),c.includes(e.id)?(0,t.jsx)("span",{className:"mark-dot"}):null]}),(0,t.jsxs)("div",{className:"bot-copy",children:[S===e.id?H(e):q(e),d(e.latest)?(0,t.jsx)("div",{className:"bot-preview",children:d(e.latest)}):null,(0,t.jsx)("div",{className:"bot-runtime",title:(0,u.rosterRuntimeLine)(e),children:(0,u.rosterRuntimeLine)(e)})]}),W(e),Q(e)]},e.id);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("aside",{className:"rail agent-rail",children:[(0,t.jsxs)(a.default,{href:"/",className:"brand agent-brand","aria-label":"Botmancers home",children:[(0,t.jsx)("span",{className:y?"logo-shape is-settling":"logo-shape",children:(0,t.jsx)(n.default,{src:"/brand/botmancers-logo-filled-256.png",alt:"",width:40,height:40})}),(0,t.jsx)("span",{className:"logo-word",children:"botmancers"})]}),(0,t.jsxs)("div",{className:"bar",children:[(0,t.jsx)("button",{ref:j,type:"button",className:"add-btn","aria-haspopup":"dialog",onClick:v,children:"New"}),e.length?(0,t.jsx)("button",{ref:_,type:"button",className:"add-btn","aria-haspopup":"dialog",onClick:x,children:"Manage agents"}):null,(0,t.jsx)(a.default,{className:"add-btn settings-link",href:"/settings",children:"Settings"})]}),e.length?(0,t.jsx)("nav",{className:"rail-nav","aria-label":"Workspace",children:(0,t.jsx)(a.default,{href:"/exchanges",className:"add-btn rail-nav-link",children:"Exchanges"})}):null,(0,t.jsx)("p",{className:"roster-status",role:"status",children:g}),e.length?(0,t.jsx)("div",{className:R?"roster menu-open":"roster",children:M.map(e=>f(e)?(0,t.jsxs)("div",{className:"card",onContextMenu:t=>G(t,e),children:[(0,t.jsxs)("div",{className:"row-head",children:[(0,t.jsxs)("span",{className:"mark-avatar",children:[(0,t.jsx)(l.default,{bot:e,size:44,title:`${e.name} avatar`}),c.includes(e.id)?(0,t.jsx)("span",{className:"mark-dot"}):null]}),S===e.id?H(e,{color:"#D5D0C3",fontSize:26}):q(e,{fontSize:26}),W(e)]}),d(e.latest)?(0,t.jsx)("div",{className:"bot-preview",children:d(e.latest)}):null,(0,t.jsx)("div",{className:"bot-runtime",title:(0,u.rosterRuntimeLine)(e),children:(0,u.rosterRuntimeLine)(e)}),Q(e)]},e.id):K(e))}):null,I.length?(0,t.jsxs)("div",{className:R?"roster menu-open":"roster",children:[(0,t.jsx)("button",{ref:L,type:"button",className:"pin-word","aria-expanded":P,onClick:()=>A(e=>!e),children:"Hidden"}),P?I.map(K):null]}):null]}),O?(0,t.jsx)(o.default,{ids:[O.id],onCancel:()=>{U(O.id),N(null)},onDeleted:t=>{N(null),b(e.filter(e=>!t.some(t=>t.id===e.id))),w(t)}}):null,R?(0,t.jsxs)("div",{ref:D,className:"row-menu",role:"menu","aria-label":`Actions for ${R.agent.name}`,style:{left:R.x,top:R.y},onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),onKeyDown:e=>{let t=Array.from(e.currentTarget.querySelectorAll("[role=menuitem]")),r=t.indexOf(document.activeElement),n=r=>{e.preventDefault(),t[(r+t.length)%t.length]?.focus()};"ArrowDown"===e.key?n(r+1):"ArrowUp"===e.key?n(r-1):"Home"===e.key?n(0):"End"===e.key?n(t.length-1):"Tab"===e.key&&(e.preventDefault(),F())},children:[(0,t.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,autoFocus:!0,onClick:()=>{F(),z(R.agent,{pinned:+!R.agent.pinned})},children:R.agent.pinned?"Unpin":"Pin"}),(0,t.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:()=>{F(),z(R.agent,{unread:1})},children:"Mark as Unread"}),(0,t.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:()=>{let e=R.agent;F(!1),E(e.id),$(e.name)},children:"Rename Agent"}),(0,t.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:()=>{let e=R.agent;F(!1),z(e,{hidden:+!e.hidden}).then(()=>e.hidden?U(e.id):L.current?.focus())},children:R.agent.hidden?"Unhide":"Hide from sidebar"}),(0,t.jsx)(a.default,{role:"menuitem",tabIndex:-1,href:`/bots/${R.agent.id}/config`,onClick:()=>T(null),children:"Config"}),(0,t.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:()=>{let e=R.agent;F(!1),N(e)},children:"Delete agent…"})]}):null]})}],89873)},87303,37947,e=>{"use strict";var t=e.i(43476),r=e.i(71645);let n=[{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"}],i=[{id:"folded",label:"Folded arms"},{id:"reaching",label:"Reaching right"},{id:"waving",label:"Waving"}],l=[{id:"none",label:"None"},{id:"crown",label:"Crown"},{id:"glasses",label:"Glasses"},{id:"headset",label:"Headset"},{id:"hat",label:"Hat"},{id:"bow",label:"Bow"}],o={color:"purple",eyes:"dots",hands:"folded",accessory:"none"},s={...o,accessory:"crown"};function u(e,t){return"string"==typeof t&&e.some(e=>e.id===t)}function c(e){let t=u(n,e.avatar_color)?e.avatar_color:o.color,r=u(a,e.avatar_eyes)?e.avatar_eyes:o.eyes;return{color:t,eyes:r,hands:u(i,e.avatar_hands)?e.avatar_hands:o.hands,accessory:u(l,e.avatar_accessory)?e.avatar_accessory:"chief-of-staff"===String(e.name??"").trim().toLowerCase()?s.accessory:o.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 p(e,t="static"){var r,a;let i,l,o=n.find(t=>t.id===e.color)?.hex??n[0].hex,s=String(t).replace(/[^A-Za-z0-9_-]/g,"")||"static",u=`avatar-knockout-${s}`,c=`fill="none" stroke="${o}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"`,d=(r=e.hands,a=e.accessory,i=[],"reaching"===r&&i.push({x1:87.6,y1:69,x2:90.4,y2:86.5,w:8}),"waving"===r&&i.push({x1:35,y1:59,x2:28,y2:72,w:10}),"crown"===a&&i.push({x1:44,y1:30,x2:76,y2:30,w:9}),"hat"===a&&i.push({x1:38,y1:34,x2:82,y2:34,w:9}),"bow"===a&&i.push({x1:60,y1:28.5,x2:84,y2:28,w:10}),"headset"===a&&(i.push({x1:42,y1:24.5,x2:78,y2:24.5,w:10}),i.push({x1:33,y1:55,x2:37,y2:64,w:8}),i.push({x1:83,y1:55,x2:87,y2:64,w:8})),"glasses"===a&&(i.push({x1:29,y1:56,x2:34,y2:62,w:8}),i.push({x1:86,y1:62,x2:91,y2:56,w:8})),i).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(""),h=`avatar-arms-${s}`,m="reaching"===e.hands,g=m?`<mask id="${h}"><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 r=`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" ${r}/><path d="M66 61 Q72 64 78 61" ${r}/></g>`;case"happy":return`<g data-avatar-layer="eyes" data-avatar-eyes="happy"><path d="M42 63 Q48 54 54 63" ${r}/><path d="M66 63 Q72 54 78 63" ${r}/></g>`;case"wide":return`<g data-avatar-layer="eyes" data-avatar-eyes="wide"><ellipse cx="48" cy="60" rx="5.5" ry="8" ${r}/><ellipse cx="72" cy="60" rx="5.5" ry="8" ${r}/></g>`;default:return`<g data-avatar-layer="eyes" data-avatar-eyes="dots"><circle cx="48" cy="60" r="3.5" ${r}/><circle cx="72" cy="60" r="3.5" ${r}/></g>`}}(e.eyes,o),b=function(e,t){let r=`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" ${r}/></g>`;case"glasses":return`<g data-avatar-layer="accessory" data-avatar-accessory="glasses"><circle cx="48" cy="60" r="9" ${r}/><circle cx="72" cy="60" r="9" ${r}/><path d="M57 60 Q60 57 63 60" ${r}/><path d="M39 59 L32 57" ${r}/><path d="M81 59 L88 57" ${r}/></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" ${r}/><rect x="79" y="54" width="10" height="17" rx="5" ${r}/><path d="M84 71 Q80 84 66 84" ${r}/></g>`;case"hat":return`<g data-avatar-layer="accessory" data-avatar-accessory="hat"><path d="M38 34 Q60 40 82 34" ${r}/><path d="M46 34 Q48 14 60 14 Q72 14 74 34" ${r}/></g>`;case"bow":return`<g data-avatar-layer="accessory" data-avatar-accessory="bow"><circle cx="79" cy="29" r="3.5" ${r}/><path d="M76 27 L62 18 Q60 26 66 32 Z" ${r}/><path d="M82 27 L95 19 Q97 27 91 32 Z" ${r}/></g>`;default:return'<g data-avatar-layer="accessory" data-avatar-accessory="none"></g>'}}(e.accessory,o);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>`+g+`<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="${l="wide"===e.eyes?45:46,`M42 ${l} H54 M66 ${l} H78`}" fill="none" stroke="${o}" stroke-width="4.8" stroke-linecap="round"/>`+"</g>"+(m?`<g mask="url(#${h})">${y}</g>`:y)+function(e,t){let r=`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(r)+"</g>";case"waving":return`<g data-avatar-layer="hands" data-avatar-hands="waving"><path d="M32 68 Q24 60 22 48" ${r}/><circle cx="21" cy="41" r="5" ${r}/><path d="M11 36 Q9 46 12 54" ${r}/></g>`;default:return`<g data-avatar-layer="hands" data-avatar-hands="folded"><rect x="44" y="79" width="32" height="9" rx="4.5" ${r}/><rect x="46" y="90" width="28" height="9" rx="4.5" ${r}/></g>`}}(e.hands,o)+(m?`<g mask="url(#${h})">${b}</g>`:b)+"</svg>"}e.s(["AVATAR_ACCESSORIES",0,l,"AVATAR_COLORS",0,n,"AVATAR_EYES",0,a,"AVATAR_HANDS",0,i,"renderAvatarSvg",0,p,"resolveAvatar",0,c],37947),e.s(["default",0,function({bot:e,config:n,size:a=28,className:i,title:l}){let o=(0,r.useId)().replace(/[^A-Za-z0-9_-]/g,"")||"avatar",s=p(n??e?.avatar_config??c(e??{}),o).replace("<svg ",`<svg width="${a}" height="${a}" `);return(0,t.jsx)("span",{className:i??"bot-avatar",style:{display:"inline-flex",width:a,height:a,flex:"none"},title:l,"aria-label":l??"Agent avatar",role:"img",dangerouslySetInnerHTML:{__html:s}})}],87303)},15983,10718,e=>{"use strict";var t=e.i(43476),r=e.i(71645);let n="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 i(e){return"chief"===e?"Chief of Staff cannot be deleted.":"Working now — stop it or let it finish before deleting."}function l(e){return 1===e?"Delete agent":`Delete ${e} agents`}e.s(["DELETE_KEEPS_COPY",0,a,"DELETE_REMOVES_COPY",0,n,"blockedReasonCopy",0,i,"deleteConfirmLabel",0,l,"deletedStatusLine",0,function(e){return 1===e?"Deleted 1 agent.":`Deleted ${e} agents.`}],10718),e.s(["default",0,function({ids:e,onCancel:o,onDeleted:s}){let u=(0,r.useId)(),[c,d]=(0,r.useState)(null),[f,p]=(0,r.useState)(""),[h,m]=(0,r.useState)(""),[g,y]=(0,r.useState)(!1),b=(0,r.useRef)(null),v=(0,r.useRef)(null),x=e.join("\n");(0,r.useEffect)(()=>{let e=!1;return fetch("/api/bots/delete-preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:x.split("\n")})}).then(async t=>{let r=await t.json().catch(()=>null);if(!e){if(!t.ok)return void p("string"==typeof r?.error?r.error:"Could not load the deletion preview.");d(r)}}).catch(()=>{e||p("Could not load the deletion preview.")}),()=>{e=!0}},[x]),(0,r.useEffect)(()=>{b.current?.focus()},[]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(e.stopPropagation(),g||o())};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[g,o]);let w=e.length,j=!c||c.blocked.length>0||c.missing.length>0,_=async()=>{if(!g&&!j){y(!0),m("");try{let t=await fetch("/api/bots",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),r=await t.json().catch(()=>null);if(!t.ok){m("string"==typeof r?.error&&r.error?r.error:`Delete failed (${t.status}).`),y(!1),requestAnimationFrame(()=>b.current?.focus());return}s(Array.isArray(r?.deleted)?r.deleted:[])}catch{m("Delete failed: the server did not respond."),y(!1),requestAnimationFrame(()=>b.current?.focus())}}};return(0,t.jsx)("div",{className:"modal-scrim delete-scrim",onKeyDown:e=>{if("Tab"!==e.key||!v.current)return;let t=Array.from(v.current.querySelectorAll("button:not(:disabled)"));if(0===t.length)return;let r=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n||(e.preventDefault(),r.focus())},children:(0,t.jsxs)("div",{ref:v,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===w?"Delete this agent permanently?":`Delete ${w} 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," — ",i(e.reason)]},e.id))})]}):null,(0,t.jsx)("p",{className:"delete-copy",children:n}),(0,t.jsx)("p",{className:"delete-copy delete-keeps",children:a})]}):null,h?(0,t.jsx)("p",{className:"delete-error",role:"alert",children:h}):null,(0,t.jsxs)("div",{className:"form-actions delete-actions",children:[(0,t.jsx)("button",{ref:b,type:"button",className:"cancel-btn",onClick:o,disabled:g,children:"Cancel"}),(0,t.jsx)("button",{type:"button",className:"delete-btn",onClick:()=>{_()},disabled:g||j,children:g?"Deleting…":l(w)})]})]})})}],15983)},74904,3136,e=>{"use strict";let t=["hermes","cursor","claude","codex","muse"],r={hermes:"Hermes",cursor:"Cursor",claude:"Claude",codex:"Codex",muse:"Muse Code"},n="hermes";function a(e){return t.includes(String(e))?r[e]:String(e??"")}t.join("|"),e.s(["AGENTS",0,t,"AGENT_LABELS",0,r,"DEFAULT_AGENT",0,n,"agentLabel",0,a],3136);let i=t.map(e=>({value:e,label:r[e]}));function l(e){return a((e.agent??"").trim()||n)}function o(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 s(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,i,"NEW_AGENT_WORKSPACE_HINT",0,c,"WORKSPACE_TEMPLATE",0,u,"agentEventDisplay",0,function(e){let t=String(e??"").trimStart(),r=f.find(e=>t.startsWith(e.prefix));return r?{label:r.label,detail:t.slice(r.prefix.length).trim()}:null},"botAgentLabel",0,l,"botConnectionLabel",0,o,"configWorkspaceHint",0,function(e){return`Default: ${s(e)} — leave blank to use it.`},"defaultWorkdirFor",0,s,"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: ${l(e)} \xb7 `+(o(e)??"No connection");return!1===e.launchable?t+" — see Config":t}],74904)},64711,e=>{"use strict";e.s(["parseRun",0,function(e){let t,r=e.match(/^\s*\[run\]\s*([\s\S]*)$/);if(!r)return null;try{t=JSON.parse(r[1])}catch{return null}if(!t||"object"!=typeof t)return null;let n=t,a="string"==typeof n.page?n.page:"string"==typeof n.html?n.html:void 0,i=void 0===a?{}:{page:a,html:a};return"running"===n.state||"stopped"===n.state?{state:n.state,...i}:"done"===n.state&&"string"==typeof n.output?{state:"done",output:n.output,...i}:null},"runLine",0,function(e){return"done"===e.state?e.output??"":"stopped"===e.state?"The command was stopped.":"The command is running"}])},96594,e=>{"use strict";let t={error:"Error"},r=[{kind:"hermes-config-missing",severity:"error",pattern:/^\[Hermes configuration missing: [^\n]*\]$/,title:"Hermes needs configuration",recovery:"This agent can’t reply until the Hermes API key is set on the Botmancers server. Set it, restart, then send your message again."},{kind:"hermes-turn-failed",severity:"error",pattern:/^\[Hermes turn failed for [\s\S]*\]$/,title:"Hermes couldn’t complete the turn",recovery:"Check that the Hermes gateway is running and reachable, then send your message again."}];e.s(["classifyRuntimeFailure",0,function(e){let t=String(e??"").trim();if(!t)return null;let n=r.find(e=>e.pattern.test(t));return n?{kind:n.kind,severity:n.severity,title:n.title,recovery:n.recovery,detail:t}:null},"severityLabel",0,function(e){return t[e]}])},22016,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return y},useLinkStatus:function(){return v}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(90809),l=e.r(43476),o=i._(e.r(71645)),s=e.r(95057),u=e.r(8372),c=e.r(18581),d=e.r(18967),f=e.r(5550),p=e.r(88540),h=e.r(91949),m=e.r(73668),g=e.r(9396);function y(t){var r;let n,a,i,[y,v]=(0,o.useOptimistic)(h.IDLE_LINK_STATUS),x=(0,o.useRef)(null),{href:w,as:j,children:_,prefetch:k=null,passHref:S,replace:E,shallow:C,scroll:$,onClick:P,onMouseEnter:A,onTouchStart:O,legacyBehavior:N=!1,onNavigate:R,transitionTypes:T,ref:D,unstable_dynamicOnHover:L,...M}=t;n=_,N&&("string"==typeof n||"number"==typeof n)&&(n=(0,l.jsx)("a",{children:n}));let I=o.default.useContext(u.AppRouterContext),z=!1!==k,U=!1===k?"none":!0===k?"full":"auto",F="none"!==U?"auto"===U?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,B="string"==typeof(r=j||w)?r:(0,s.formatUrl)(r);if(N){if(n?.$$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=o.default.Children.only(n)}let H=N?a&&"object"==typeof a&&a.ref:D,q,W=o.default.useCallback(e=>(null!==I&&(x.current=(0,h.mountLinkInstance)(e,B,I,F,z,v,q)),()=>{x.current&&((0,h.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,h.unmountPrefetchableInstance)(e)}),[z,B,I,F,v,q]),Q={ref:(0,c.useMergedRef)(W,H),onClick(t){N||"function"!=typeof P||P(t),N&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!I||t.defaultPrevented||function(t,r,n,a,i,l,s,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,m.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(99781);o.default.startTransition(()=>{f(r,a?"replace":"push",!1===i?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,s,u)})}}(t,B,x,E,$,R,T,U)},onMouseEnter(e){N||"function"!=typeof A||A(e),N&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),I&&z&&(0,h.onNavigationIntent)(e.currentTarget,!0===L)},onTouchStart:function(e){N||"function"!=typeof O||O(e),N&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),I&&z&&(0,h.onNavigationIntent)(e.currentTarget,!0===L)}};return(0,d.isAbsoluteUrl)(B)?Q.href=B:N&&!S&&("a"!==a.type||"href"in a.props)||(Q.href=(0,f.addBasePath)(B)),i=N?o.default.cloneElement(a,Q):(0,l.jsx)("a",{...M,...Q,children:n}),(0,l.jsx)(b.Provider,{value:y,children:i})}let b=(0,o.createContext)(h.IDLE_LINK_STATUS),v=()=>(0,o.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},5500,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"Image",{enumerable:!0,get:function(){return w}});let n=e.r(55682),a=e.r(90809),i=e.r(43476),l=a._(e.r(71645)),o=n._(e.r(74080)),s=n._(e.r(25633)),u=e.r(8927),c=e.r(87690),d=e.r(18556),f=e.r(65856),p=n._(e.r(1948)),h=e.r(18581),m={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function g(e,t,r,n,a,i,l){let o=e?.src;e&&e["data-loaded-src"]!==o&&(e["data-loaded-src"]=o,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&a(!0),r?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,a=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>a,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{a=!0,t.stopPropagation()}})}n?.current&&n.current(e)}}))}function y(e){return l.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let b="u"<typeof window?l.useEffect:l.useLayoutEffect,v=(0,l.forwardRef)(({src:e,srcSet:t,sizes:r,height:n,width:a,decoding:o,className:s,style:u,fetchPriority:c,placeholder:d,loading:f,unoptimized:p,fill:m,onLoadRef:v,onLoadingCompleteRef:x,setBlurComplete:w,setShowAltText:j,sizesInput:_,onLoad:k,onError:S,...E},C)=>{let $=(0,l.useRef)(!1),P=(0,l.useRef)(null);b(()=>{let{current:e}=$,{current:t}=P;e||null===t||(S&&(t.src=t.src),t.complete&&g(t,d,v,x,w,p,_),$.current=!0)},[e,d,v,x,S,p,_]);let A=(0,h.useMergedRef)(C,P);return(0,i.jsx)("img",{...E,...y(c),loading:f,width:a,height:n,decoding:o,"data-nimg":m?"fill":"1",className:s,style:u,sizes:r,srcSet:t,src:e,ref:A,onLoad:e=>{g(e.currentTarget,d,v,x,w,p,_)},onError:e=>{j(!0),"empty"!==d&&w(!0),S&&S(e)}})});function x({isAppRouter:e,imgAttributes:t}){let r={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...y(t.fetchPriority)};return e&&o.default.preload?(o.default.preload(t.src,r),null):(0,i.jsx)(s.default,{children:(0,i.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...r},"__nimg-"+t.src+t.srcSet+t.sizes)})}let w=(0,l.forwardRef)((e,t)=>{let r=(0,l.useContext)(f.RouterContext),n=(0,l.useContext)(d.ImageConfigContext),a=(0,l.useMemo)(()=>{let e=m||n||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t),a=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r,qualities:a,localPatterns:"u"<typeof window?n?.localPatterns:e.localPatterns}},[n]),{onLoad:o,onLoadingComplete:s}=e,h=(0,l.useRef)(o);(0,l.useEffect)(()=>{h.current=o},[o]);let g=(0,l.useRef)(s);(0,l.useEffect)(()=>{g.current=s},[s]);let[y,b]=(0,l.useState)(!1),[w,j]=(0,l.useState)(!1),{props:_,meta:k}=(0,u.getImgProps)(e,{defaultLoader:p.default,imgConf:a,blurComplete:y,showAltText:w});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v,{..._,unoptimized:k.unoptimized,placeholder:k.placeholder,fill:k.fill,onLoadRef:h,onLoadingCompleteRef:g,setBlurComplete:b,setShowAltText:j,sizesInput:e.sizes,ref:t}),k.preload?(0,i.jsx)(x,{isAppRouter:!r,imgAttributes:_}):null]})});("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},94909,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return c},getImageProps:function(){return u}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(55682),l=e.r(8927),o=e.r(5500),s=i._(e.r(1948));function u(e){let{props:t}=(0,l.getImgProps)(e,{defaultLoader:s.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let c=o.Image},57688,(e,t,r)=>{t.exports=e.r(94909)},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(71645);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=i(e,n)),t&&(a.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},25633,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return m},defaultHead:function(){return d}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(55682),l=e.r(90809),o=e.r(43476),s=l._(e.r(71645)),u=i._(e.r(98879)),c=e.r(42732);function d(){return[(0,o.jsx)("meta",{charSet:"utf-8"},"charset"),(0,o.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===s.default.Fragment?e.concat(s.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}let p=["name","httpEquiv","charSet","itemProp"];function h(e){let t,r,n,a;return e.reduce(f,[]).reverse().concat(d().reverse()).filter((t=new Set,r=new Set,n=new Set,a={},e=>{let i=!0,l=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){l=!0;let r=e.key.slice(e.key.indexOf("$")+1);t.has(r)?i=!1:t.add(r)}switch(e.type){case"title":case"base":r.has(e.type)?i=!1:r.add(e.type);break;case"meta":for(let t=0,r=p.length;t<r;t++){let r=p[t];if(e.props.hasOwnProperty(r))if("charSet"===r)n.has(r)?i=!1:n.add(r);else{let t=e.props[r],n=a[r]||new Set;("name"!==r||!l)&&n.has(t)?i=!1:(n.add(t),a[r]=n)}}}return i})).reverse().map((e,t)=>{let r=e.key||t;return s.default.cloneElement(e,{key:r})})}let m=function({children:e}){let t=(0,s.useContext)(c.HeadManagerContext);return(0,o.jsx)(u.default,{reduceComponentsToState:h,headManager:t,children:e})};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18556,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageConfigContext",{enumerable:!0,get:function(){return i}});let n=e.r(55682)._(e.r(71645)),a=e.r(87690),i=n.default.createContext(a.imageConfigDefault)},65856,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"RouterContext",{enumerable:!0,get:function(){return n}});let n=e.r(55682)._(e.r(71645)).default.createContext(null)},70965,(e,t,r)=>{"use strict";function n(e,t){let r=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-r)<Math.abs(e-r)?t:e,t.qualities[0]):r}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"findClosestQuality",{enumerable:!0,get:function(){return n}})},1948,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return l}});let n=e.r(70965),a=e.r(43369);function i({config:e,src:t,width:r,quality:l}){let o=(0,a.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//"))if(t.includes("/_next/static/immutable")&&!(0,a.getAssetToken)())o=void 0;else{let e=t.indexOf("?");if(-1!==e){let r=new URLSearchParams(t.slice(e+1)),n=r.get("dpl");if(n){o=n,r.delete("dpl");let a=r.toString();t=t.slice(0,e)+(a?"?"+a:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
2
+ Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let s=(0,n.findClosestQuality)(l,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${r}&q=${s}${t.startsWith("/")&&o?`&dpl=${o}`:""}`}i.__next_img_default=!0;let l=i},88143,(e,t,r)=>{"use strict";function n({widthInt:e,heightInt:t,blurWidth:r,blurHeight:a,blurDataURL:i,objectFit:l}){let o=r?40*r:e,s=a?40*a:t,u=o&&s?`viewBox='0 0 ${o} ${s}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${u}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${u?"none":"contain"===l?"xMidYMid":"cover"===l?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${i}'/%3E%3C/svg%3E`}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},87690,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={VALID_LOADERS:function(){return i},imageConfigDefault:function(){return l}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=["default","imgix","cloudinary","akamai","custom"],l={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},8927,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImgProps",{enumerable:!0,get:function(){return u}});let n=e.r(43369),a=e.r(88143),i=e.r(87690),l=["-moz-initial","fill","none","scale-down",void 0];function o(e){return void 0!==e.default}function s(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function u({src:e,sizes:t,unoptimized:r=!1,priority:c=!1,preload:d=!1,loading:f,className:p,quality:h,width:m,height:g,fill:y=!1,style:b,overrideSrc:v,onLoad:x,onLoadingComplete:w,placeholder:j="empty",blurDataURL:_,fetchPriority:k,decoding:S="async",layout:E,objectFit:C,objectPosition:$,lazyBoundary:P,lazyRoot:A,...O},N){var R;let T,D,L,{imgConf:M,showAltText:I,blurComplete:z,defaultLoader:U}=N,F=M||i.imageConfigDefault;if("allSizes"in F)T=F;else{let e=[...F.deviceSizes,...F.imageSizes].sort((e,t)=>e-t),t=F.deviceSizes.sort((e,t)=>e-t),r=F.qualities?.sort((e,t)=>e-t);T={...F,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===U)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let B=O.loader||U;delete O.loader,delete O.srcSet;let H="__next_img_default"in B;if(H){if("custom"===T.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
3
+ Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=B;B=t=>{let{config:r,...n}=t;return e(n)}}if(E){"fill"===E&&(y=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[E];e&&(b={...b,...e});let r={responsive:"100vw",fill:"100vw"}[E];r&&!t&&(t=r)}let q="",W=s(m),Q=s(g);if((R=e)&&"object"==typeof R&&(o(R)||void 0!==R.src)){let t=o(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(D=t.blurWidth,L=t.blurHeight,_=_||t.blurDataURL,q=t.src,!y)if(W||Q){if(W&&!Q){let e=W/t.width;Q=Math.round(t.height*e)}else if(!W&&Q){let e=Q/t.height;W=Math.round(t.width*e)}}else W=t.width,Q=t.height}let G=!c&&!d&&("lazy"===f||void 0===f);(!(e="string"==typeof e?e:q)||e.startsWith("data:")||e.startsWith("blob:"))&&(r=!0,G=!1),T.unoptimized&&(r=!0),H&&!T.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(r=!0);let K=s(h),V=Object.assign(y?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:C,objectPosition:$}:{},I?{}:{color:"transparent"},b),X=z||"empty"===j?null:"blur"===j?`url("data:image/svg+xml;charset=utf-8,${(0,a.getImageBlurSvg)({widthInt:W,heightInt:Q,blurWidth:D,blurHeight:L,blurDataURL:_||"",objectFit:V.objectFit})}")`:`url("${j}")`,Z=l.includes(V.objectFit)?"fill"===V.objectFit?"100% 100%":"cover":V.objectFit,J=X?{backgroundSize:Z,backgroundPosition:V.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:X}:{},Y=function({config:e,src:t,unoptimized:r,width:a,quality:i,sizes:l,loader:o}){if(r){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,n.getDeploymentId)();if(t.includes("/_next/static/immutable")&&!(0,n.getAssetToken)())e=void 0;else if(e){let r=t.indexOf("?");if(-1!==r){let n=new URLSearchParams(t.slice(r+1));n.get("dpl")||(n.append("dpl",e),t=t.slice(0,r)+"?"+n.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:s,kind:u}=function({deviceSizes:e,allSizes:t},r,n){if(n){let r=/(^|\s)(1?\d?\d)vw/g,a=[];for(let e;e=r.exec(n);)a.push(parseInt(e[2]));if(a.length){let r=.01*Math.min(...a);return{widths:t.filter(t=>t>=e[0]*r),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof r?{widths:e,kind:"w"}:{widths:[...new Set([r,2*r].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,a,l),c=s.length-1;return{sizes:l||"w"!==u?l:"100vw",srcSet:s.map((r,n)=>`${o({config:e,src:t,quality:i,width:r})} ${"w"===u?r:n+1}${u}`).join(", "),src:o({config:e,src:t,quality:i,width:s[c]})}}({config:T,src:e,unoptimized:r,width:W,quality:K,sizes:t,loader:B}),ee=G?"lazy":f;return{props:{...O,loading:ee,fetchPriority:k,width:W,height:Q,decoding:S,className:p,style:{...V,...J},sizes:Y.sizes,srcSet:Y.srcSet,src:v||Y.src},meta:{unoptimized:r,preload:d||c,placeholder:j,fill:y}}}},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(18967),a=e.r(52817);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return s},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return o}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});function i(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function l(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[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,l(e));else t.set(r,l(n));return t}function s(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},95057,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return o},formatWithValidation:function(){return u},urlObjectKeys:function(){return s}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(90809)._(e.r(98183)),l=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",o=e.hash||"",s=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),s&&"object"==typeof s&&(s=String(i.urlQueryToSearchParams(s)));let c=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||l.test(n))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),o&&"#"!==o[0]&&(o="#"+o),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${a}${c}${o}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return o(e)}},98879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let n=e.r(71645),a="u"<typeof window,i=a?()=>{}:n.useLayoutEffect,l=a?()=>{}:n.useEffect;function o(e){let{headManager:t,reduceComponentsToState:r}=e;function o(){if(t&&t.mountedInstances){let e=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(e))}}return a&&(t?.mountedInstances?.add(e.children),o()),i(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),i(()=>(t&&(t._pendingUpdate=o),()=>{t&&(t._pendingUpdate=o)})),l(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},18967,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return x},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return m},ST:function(){return g},WEB_VITALS:function(){return i},execOnce:function(){return l},getDisplayName:function(){return d},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return s},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return j}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function l(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&o.test(e)};function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}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 p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}let m="u">typeof performance,g=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y 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 x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function j(e){return JSON.stringify({message:e.message,stack:e.stack})}},18566,(e,t,r)=>{t.exports=e.r(76562)}]);
@@ -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}])}]);