botmancers 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +13 -12
  3. package/app/.next/BUILD_ID +1 -1
  4. package/app/.next/app-path-routes-manifest.json +1 -2
  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 +8 -12
  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/api/bots/[id]/config/route.js.nft.json +1 -1
  22. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route.js +2 -2
  23. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route.js.nft.json +1 -1
  24. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/route.js.nft.json +1 -1
  25. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/shares/route.js +3 -3
  26. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/shares/route.js.nft.json +1 -1
  27. package/app/.next/server/app/api/bots/[id]/sessions/route.js +5 -5
  28. package/app/.next/server/app/api/bots/[id]/sessions/route.js.nft.json +1 -1
  29. package/app/.next/server/app/api/bots/[id]/sessions/sync/route/app-paths-manifest.json +3 -0
  30. package/app/.next/server/app/api/bots/[id]/sessions/sync/route.js +11 -0
  31. package/app/.next/server/app/api/bots/[id]/sessions/sync/route.js.nft.json +1 -0
  32. package/app/.next/server/app/api/bots/[id]/sessions/sync/route_client-reference-manifest.js +3 -0
  33. package/app/.next/server/app/api/bots/[id]/share-policy/route.js +3 -3
  34. package/app/.next/server/app/api/bots/[id]/share-policy/route.js.nft.json +1 -1
  35. package/app/.next/server/app/api/bots/[id]/skill/route.js.nft.json +1 -1
  36. package/app/.next/server/app/api/bots/availability/route.js +3 -2
  37. package/app/.next/server/app/api/bots/availability/route.js.nft.json +1 -1
  38. package/app/.next/server/app/api/bots/delete-preview/route.js.nft.json +1 -1
  39. package/app/.next/server/app/api/bots/import/route.js.nft.json +1 -1
  40. package/app/.next/server/app/api/bots/manage/route.js.nft.json +1 -1
  41. package/app/.next/server/app/api/bots/name-migrations/route.js.nft.json +1 -1
  42. package/app/.next/server/app/api/bots/route.js +4 -4
  43. package/app/.next/server/app/api/bots/route.js.nft.json +1 -1
  44. package/app/.next/server/app/api/conversations/[id]/approve/route.js.nft.json +1 -1
  45. package/app/.next/server/app/api/conversations/[id]/deny/route.js.nft.json +1 -1
  46. package/app/.next/server/app/api/conversations/[id]/draft/route.js.nft.json +1 -1
  47. package/app/.next/server/app/api/conversations/[id]/messages/[messageId]/stop/route.js.nft.json +1 -1
  48. package/app/.next/server/app/api/conversations/[id]/messages/route.js +5 -5
  49. package/app/.next/server/app/api/conversations/[id]/messages/route.js.nft.json +1 -1
  50. package/app/.next/server/app/api/conversations/[id]/route.js.nft.json +1 -1
  51. package/app/.next/server/app/api/conversations/[id]/stop/route.js +6 -6
  52. package/app/.next/server/app/api/conversations/[id]/stop/route.js.nft.json +1 -1
  53. package/app/.next/server/app/api/conversations/route.js.nft.json +1 -1
  54. package/app/.next/server/app/api/exchanges/[id]/cancel/route.js +2 -2
  55. package/app/.next/server/app/api/exchanges/[id]/cancel/route.js.nft.json +1 -1
  56. package/app/.next/server/app/api/exchanges/[id]/route.js +3 -3
  57. package/app/.next/server/app/api/exchanges/[id]/route.js.nft.json +1 -1
  58. package/app/.next/server/app/api/exchanges/route.js +2 -2
  59. package/app/.next/server/app/api/exchanges/route.js.nft.json +1 -1
  60. package/app/.next/server/app/api/files/[name]/route.js.nft.json +1 -1
  61. package/app/.next/server/app/api/groups/route.js.nft.json +1 -1
  62. package/app/.next/server/app/api/health/route.js +2 -2
  63. package/app/.next/server/app/api/health/route.js.nft.json +1 -1
  64. package/app/.next/server/app/api/mcp/route.js.nft.json +1 -1
  65. package/app/.next/server/app/api/messages/[id]/between/route.js.nft.json +1 -1
  66. package/app/.next/server/app/api/runtime-connections/route.js.nft.json +1 -1
  67. package/app/.next/server/app/api/service-grants/route.js.nft.json +1 -1
  68. package/app/.next/server/app/api/shares/[shareRef]/revoke/route.js +3 -3
  69. package/app/.next/server/app/api/shares/[shareRef]/revoke/route.js.nft.json +1 -1
  70. package/app/.next/server/app/api/shares/route.js +3 -3
  71. package/app/.next/server/app/api/shares/route.js.nft.json +1 -1
  72. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js +3 -3
  73. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js.nft.json +1 -1
  74. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js +3 -3
  75. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js.nft.json +1 -1
  76. package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js +2 -2
  77. package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js.nft.json +1 -1
  78. package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js +3 -3
  79. package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js.nft.json +1 -1
  80. package/app/.next/server/app/api/v0/agents/[agentId]/route.js +3 -3
  81. package/app/.next/server/app/api/v0/agents/[agentId]/route.js.nft.json +1 -1
  82. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js +3 -3
  83. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js.nft.json +1 -1
  84. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js +3 -3
  85. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js.nft.json +1 -1
  86. package/app/.next/server/app/api/v0/agents/route.js +3 -3
  87. package/app/.next/server/app/api/v0/agents/route.js.nft.json +1 -1
  88. package/app/.next/server/app/api/v0/capabilities/route.js +3 -3
  89. package/app/.next/server/app/api/v0/capabilities/route.js.nft.json +1 -1
  90. package/app/.next/server/app/api/v0/conversations/[id]/route.js +2 -2
  91. package/app/.next/server/app/api/v0/conversations/[id]/route.js.nft.json +1 -1
  92. package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js +3 -3
  93. package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js.nft.json +1 -1
  94. package/app/.next/server/app/api/v0/exchanges/[id]/route.js +3 -3
  95. package/app/.next/server/app/api/v0/exchanges/[id]/route.js.nft.json +1 -1
  96. package/app/.next/server/app/api/v0/exchanges/route.js +3 -3
  97. package/app/.next/server/app/api/v0/exchanges/route.js.nft.json +1 -1
  98. package/app/.next/server/app/api/v0/mcp/route.js +4 -4
  99. package/app/.next/server/app/api/v0/mcp/route.js.nft.json +1 -1
  100. package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js +3 -3
  101. package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js.nft.json +1 -1
  102. package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js +3 -3
  103. package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js.nft.json +1 -1
  104. package/app/.next/server/app/api/v0/pins/[pinRef]/route.js +3 -3
  105. package/app/.next/server/app/api/v0/pins/[pinRef]/route.js.nft.json +1 -1
  106. package/app/.next/server/app/api/v0/requests/[id]/route.js +2 -2
  107. package/app/.next/server/app/api/v0/requests/[id]/route.js.nft.json +1 -1
  108. package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js +3 -3
  109. package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js.nft.json +1 -1
  110. package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js +3 -3
  111. package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js.nft.json +1 -1
  112. package/app/.next/server/app/api/v0/sessions/[ref]/shares/route.js +3 -3
  113. package/app/.next/server/app/api/v0/sessions/[ref]/shares/route.js.nft.json +1 -1
  114. package/app/.next/server/app/api/v0/shares/[shareRef]/revoke/route.js +3 -3
  115. package/app/.next/server/app/api/v0/shares/[shareRef]/revoke/route.js.nft.json +1 -1
  116. package/app/.next/server/app/api/v0/shares/[shareRef]/route.js +3 -3
  117. package/app/.next/server/app/api/v0/shares/[shareRef]/route.js.nft.json +1 -1
  118. package/app/.next/server/app/api/v0/shares/current/route.js +3 -3
  119. package/app/.next/server/app/api/v0/shares/current/route.js.nft.json +1 -1
  120. package/app/.next/server/app/api/v0/shares/route.js +3 -3
  121. package/app/.next/server/app/api/v0/shares/route.js.nft.json +1 -1
  122. package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js +2 -2
  123. package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js.nft.json +1 -1
  124. package/app/.next/server/app/api/wakes/[id]/decision/route.js +2 -2
  125. package/app/.next/server/app/api/wakes/[id]/decision/route.js.nft.json +1 -1
  126. package/app/.next/server/app/api/wakes/[id]/retry/route.js +2 -2
  127. package/app/.next/server/app/api/wakes/[id]/retry/route.js.nft.json +1 -1
  128. package/app/.next/server/app/bots/[id]/config/page.js.nft.json +1 -1
  129. package/app/.next/server/app/bots/[id]/config/page_client-reference-manifest.js +1 -1
  130. package/app/.next/server/app/exchanges/page.js.nft.json +1 -1
  131. package/app/.next/server/app/exchanges/page_client-reference-manifest.js +1 -1
  132. package/app/.next/server/app/exchanges.html +1 -1
  133. package/app/.next/server/app/exchanges.rsc +3 -3
  134. package/app/.next/server/app/exchanges.segments/_full.segment.rsc +3 -3
  135. package/app/.next/server/app/exchanges.segments/_tree.segment.rsc +2 -2
  136. package/app/.next/server/app/exchanges.segments/exchanges/__PAGE__.segment.rsc +3 -3
  137. package/app/.next/server/app/index.html +1 -1
  138. package/app/.next/server/app/index.rsc +3 -3
  139. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  140. package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
  141. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  142. package/app/.next/server/app/page.js.nft.json +1 -1
  143. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  144. package/app/.next/server/app/settings/page.js.nft.json +1 -1
  145. package/app/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  146. package/app/.next/server/app/settings.html +1 -1
  147. package/app/.next/server/app/settings.rsc +3 -3
  148. package/app/.next/server/app/settings.segments/_full.segment.rsc +3 -3
  149. package/app/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  150. package/app/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +3 -3
  151. package/app/.next/server/app/threads/[id]/page.js.nft.json +1 -1
  152. package/app/.next/server/app/threads/[id]/page_client-reference-manifest.js +1 -1
  153. package/app/.next/server/app-paths-manifest.json +1 -2
  154. package/app/.next/server/chunks/[root-of-the-server]__0d3fjix._.js +1 -1
  155. package/app/.next/server/chunks/[root-of-the-server]__0hhill-._.js +3 -0
  156. package/app/.next/server/chunks/[root-of-the-server]__0k8wfe2._.js +3 -0
  157. package/app/.next/server/chunks/[root-of-the-server]__0mp8bap._.js +1 -1
  158. package/app/.next/server/chunks/[root-of-the-server]__0qaiqut._.js +5 -5
  159. package/app/.next/server/chunks/[root-of-the-server]__0qqsovi._.js +3 -0
  160. package/app/.next/server/chunks/[root-of-the-server]__0zrx1iz._.js +1 -1
  161. package/app/.next/server/chunks/[root-of-the-server]__10b5-i-._.js +1 -1
  162. package/app/.next/server/chunks/[root-of-the-server]__17xl_55._.js +1 -1
  163. package/app/.next/server/chunks/[root-of-the-server]__1j8fg_n._.js +3 -0
  164. package/app/.next/server/chunks/[root-of-the-server]__1x8phwp._.js +44 -0
  165. package/app/.next/server/chunks/[root-of-the-server]__200ep0k._.js +1 -1
  166. package/app/.next/server/chunks/_0061c2q._.js +1 -1
  167. package/app/.next/server/chunks/_057h7zr._.js +3 -0
  168. package/app/.next/server/chunks/_0_b7py8._.js +3 -0
  169. package/app/.next/server/chunks/_0a2do3x._.js +1 -1
  170. package/app/.next/server/chunks/_1-5mthb._.js +1 -1
  171. package/app/.next/server/chunks/_next-internal_server_app_api_bots_[id]_sessions_sync_route_actions_00y6n-f.js +3 -0
  172. package/app/.next/server/chunks/lib_0-opbv7._.js +330 -0
  173. package/app/.next/server/chunks/lib_0aejojj._.js +330 -0
  174. package/app/.next/server/chunks/lib_0il0ml1._.js +330 -0
  175. package/app/.next/server/chunks/lib_0iujsdg._.js +330 -0
  176. package/app/.next/server/chunks/lib_0kik6bx._.js +20 -20
  177. package/app/.next/server/chunks/lib_0pe3tiv._.js +20 -20
  178. package/app/.next/server/chunks/{lib_1zc7-gl._.js → lib_15a9ejf._.js} +122 -130
  179. package/app/.next/server/chunks/{lib_15adnlz._.js → lib_19pzc33._.js} +122 -130
  180. package/app/.next/server/chunks/lib_1a4ucxv._.js +330 -0
  181. package/app/.next/server/chunks/lib_1dehbst._.js +330 -0
  182. package/app/.next/server/chunks/lib_1z4vnh4._.js +330 -0
  183. package/app/.next/server/chunks/lib_1z7d95m._.js +2181 -0
  184. package/app/.next/server/chunks/lib_db_ts_1ttuckb._.js +58 -56
  185. package/app/.next/server/chunks/lib_service-api-http_ts_0xzqhny._.js +5 -5
  186. package/app/.next/server/chunks/ssr/_00ysoah._.js +3 -0
  187. package/app/.next/server/chunks/ssr/_14d-lxn._.js +3 -0
  188. package/app/.next/server/chunks/ssr/_1cvuhjt._.js +1 -1
  189. package/app/.next/server/chunks/ssr/_1lkd0ui._.js +3 -0
  190. package/app/.next/server/chunks/ssr/_1n5mvo5._.js +1 -1
  191. package/app/.next/server/chunks/ssr/_1o94bnv._.js +8 -1
  192. package/app/.next/server/chunks/ssr/_1r5kd5j._.js +3 -0
  193. package/app/.next/server/chunks/ssr/app_1-nwnha._.js +3 -0
  194. package/app/.next/server/chunks/ssr/app_bots_[id]_config_page_tsx_1e0uue9._.js +1 -1
  195. package/app/.next/server/chunks/ssr/lib_exchange-view_ts_1a4q9ju._.js +3 -0
  196. package/app/.next/server/instrumentation.js +1 -1
  197. package/app/.next/server/middleware-build-manifest.js +3 -3
  198. package/app/.next/server/pages/404.html +1 -1
  199. package/app/.next/server/pages/500.html +1 -1
  200. package/app/.next/server/server-reference-manifest.js +1 -1
  201. package/app/.next/server/server-reference-manifest.json +1 -1
  202. package/app/.next/static/chunks/0y1ihx4vq8du3.js +10 -0
  203. package/app/.next/static/chunks/1c2dl2ga-lqcb.css +3 -0
  204. package/app/.next/static/chunks/2q-tgwkalrnms.js +1 -0
  205. package/app/.next/static/chunks/2qf-mb__71dkk.js +1 -0
  206. package/app/.next/static/chunks/399dvlpyl00wn.js +1 -0
  207. package/app/.next/static/chunks/3b7r6u9nfsjb1.js +1 -0
  208. package/app/.next/static/chunks/3f1v-zuki9k7k.js +1 -0
  209. package/app/.next/static/chunks/3whw2-l4a2sli.js +1 -0
  210. package/app/BUILD_INFO.json +2 -2
  211. package/app/package.json +1 -1
  212. package/app/server.js +1 -1
  213. package/dist/cli.d.ts +1 -1
  214. package/dist/cli.js +2 -2
  215. package/dist/product.d.ts +0 -1
  216. package/dist/product.js +12 -22
  217. package/dist/setup.js +9 -9
  218. package/package.json +1 -2
  219. package/schemas/botmancers.mcp.v2.tools.json +3 -3
  220. package/app/.next/server/app/api/agent-deck/decks/route/app-paths-manifest.json +0 -3
  221. package/app/.next/server/app/api/agent-deck/decks/route.js +0 -9
  222. package/app/.next/server/app/api/agent-deck/decks/route.js.nft.json +0 -1
  223. package/app/.next/server/app/api/agent-deck/decks/route_client-reference-manifest.js +0 -3
  224. package/app/.next/server/app/api/agent-deck/settings/route/app-paths-manifest.json +0 -3
  225. package/app/.next/server/app/api/agent-deck/settings/route/build-manifest.json +0 -12
  226. package/app/.next/server/app/api/agent-deck/settings/route/server-reference-manifest.json +0 -4
  227. package/app/.next/server/app/api/agent-deck/settings/route.js +0 -9
  228. package/app/.next/server/app/api/agent-deck/settings/route.js.nft.json +0 -1
  229. package/app/.next/server/app/api/agent-deck/settings/route_client-reference-manifest.js +0 -3
  230. package/app/.next/server/chunks/[root-of-the-server]__0e_agq4._.js +0 -3
  231. package/app/.next/server/chunks/[root-of-the-server]__0j4pjyg._.js +0 -3
  232. package/app/.next/server/chunks/[root-of-the-server]__0mo_kn3._.js +0 -48
  233. package/app/.next/server/chunks/[root-of-the-server]__17mum5-._.js +0 -3
  234. package/app/.next/server/chunks/[root-of-the-server]__1bhzfu_._.js +0 -7
  235. package/app/.next/server/chunks/[root-of-the-server]__1g_n99l._.js +0 -3
  236. package/app/.next/server/chunks/[root-of-the-server]__1t4ybp2._.js +0 -48
  237. package/app/.next/server/chunks/_0qv-4by._.js +0 -3
  238. package/app/.next/server/chunks/_next-internal_server_app_api_agent-deck_decks_route_actions_0yguyfv.js +0 -3
  239. package/app/.next/server/chunks/_next-internal_server_app_api_agent-deck_settings_route_actions_0z_nbkb.js +0 -3
  240. package/app/.next/server/chunks/lib_0v4d9w0._.js +0 -339
  241. package/app/.next/server/chunks/lib_0v6lblw._.js +0 -5
  242. package/app/.next/server/chunks/lib_0zzo6zb._.js +0 -339
  243. package/app/.next/server/chunks/lib_1_u7n-u._.js +0 -339
  244. package/app/.next/server/chunks/lib_1muhwn7._.js +0 -339
  245. package/app/.next/server/chunks/lib_1xnxg-q._.js +0 -339
  246. package/app/.next/server/chunks/ssr/_0_fa0na._.js +0 -3
  247. package/app/.next/server/chunks/ssr/_0epgorw._.js +0 -3
  248. package/app/.next/server/chunks/ssr/_1i02yyi._.js +0 -3
  249. package/app/.next/server/chunks/ssr/app_components_AgentDeckRuntime_tsx_024janf._.js +0 -3
  250. package/app/.next/server/chunks/ssr/app_exchanges_page_tsx_0j-n2a1._.js +0 -3
  251. package/app/.next/server/chunks/ssr/app_settings_page_tsx_1t-rdz-._.js +0 -3
  252. package/app/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_1ztp13a._.js +0 -3
  253. package/app/.next/static/chunks/0jon21u-9j2aw.css +0 -3
  254. package/app/.next/static/chunks/14k6cvywgknx2.js +0 -3
  255. package/app/.next/static/chunks/1ku9himlsx-hn.js +0 -1
  256. package/app/.next/static/chunks/1r5tqd-7h1xjn.js +0 -1
  257. package/app/.next/static/chunks/21aqekm5z0j47.js +0 -1
  258. package/app/.next/static/chunks/22xbkclbkct3s.js +0 -1
  259. package/app/.next/static/chunks/2c953okoei6ip.js +0 -1
  260. package/app/.next/static/chunks/2t_2gf3xoxz_m.js +0 -1
  261. package/app/.next/static/chunks/34vnvo1qssbaj.js +0 -1
  262. /package/app/.next/server/app/api/{agent-deck/decks → bots/[id]/sessions/sync}/route/build-manifest.json +0 -0
  263. /package/app/.next/server/app/api/{agent-deck/decks → bots/[id]/sessions/sync}/route/server-reference-manifest.json +0 -0
  264. /package/app/.next/static/{_yrIZIFsIbXA0Gaxkytjd → 3rSDqQK0KGcTDI98uoZRy}/_buildManifest.js +0 -0
  265. /package/app/.next/static/{_yrIZIFsIbXA0Gaxkytjd → 3rSDqQK0KGcTDI98uoZRy}/_clientMiddlewareManifest.js +0 -0
  266. /package/app/.next/static/{_yrIZIFsIbXA0Gaxkytjd → 3rSDqQK0KGcTDI98uoZRy}/_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),r=e.i(22016),a=e.i(50814);e.s(["default",0,function({summary:e,onChanged:s}){let[i,o]=(0,n.useState)(!1),[u,l]=(0,n.useState)(""),c=(0,a.stateTone)(e.state),d=(0,a.outcomeLine)(e),f=(0,a.failureAdvice)(e),p=`exchange-${e.id}-title`,h=async()=>{if(!i){o(!0),l("");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);l("string"==typeof e?.error?.message?e.error.message:"Could not cancel. Try again.")}}catch{l("Could not cancel. Try again.")}finally{o(!1),s?.()}}};return(0,t.jsxs)("article",{id:`exchange-${e.id}`,className:`exchange-card is-${c} is-${e.state}`,"data-exchange-id":e.id,"data-exchange-state":e.state,"aria-labelledby":p,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:p,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)]}),d?(0,t.jsx)("p",{className:"failed"===e.state?"exchange-card-outcome is-failure":"exchange-card-outcome",children:d}):null,f?(0,t.jsx)("p",{className:"exchange-card-advice",children:f}):null,u?(0,t.jsx)("p",{className:"exchange-card-error",role:"alert",children:u}):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)(r.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:i,onClick:()=>{h()},children:i?"Cancelling…":"Cancel"}):null]})]})}])},74904,3136,e=>{"use strict";let t=["hermes","cursor","claude","codex","muse"],n={hermes:"Hermes",cursor:"Cursor",claude:"Claude",codex:"Codex",muse:"Muse Code"},r="hermes";function a(e){return t.includes(String(e))?n[e]:String(e??"")}t.join("|"),e.s(["AGENTS",0,t,"AGENT_LABELS",0,n,"DEFAULT_AGENT",0,r,"agentLabel",0,a],3136);let s=t.map(e=>({value:e,label:n[e]}));function i(e){return a((e.agent??"").trim()||r)}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 u(e){return`~/.botmancers/${e}`}let l="~/.botmancers/{agentID}",c=`Default: ${l} — {agentID} is this agent's ID, assigned at creation.`;function d(e){return String(e).padStart(2,"0")}let f=[{prefix:"[Agent failed]",kind:"failed",label:"Agent failed"},{prefix:"[Deck handoff]",kind:"handoff",label:"Agent launch"},{prefix:"[Deck run]",kind:"run",label:"Agent run"},{prefix:"[Deck review]",kind:"review",label:"Agent review"},{prefix:"[Deck resume]",kind:"resume",label:"Agent resume"},{prefix:"[Deck result]",kind:"result",label:"Agent result"},{prefix:"[Deck failed]",kind:"failed",label:"Agent failed"},{prefix:"[Deck needs selection]",kind:"reselection",label:"Agent needs setup"},{prefix:"[Deck needs reselection]",kind:"reselection",label:"Agent needs setup"}];e.s(["AGENT_OPTIONS",0,s,"NEW_AGENT_WORKSPACE_HINT",0,c,"WORKSPACE_TEMPLATE",0,l,"agentEventDisplay",0,function(e){let t=String(e??"").trimStart(),n=f.find(e=>t.startsWith(e.prefix));return n?{label:n.label,detail:t.slice(n.prefix.length).trim()}:null},"botAgentLabel",0,i,"botConnectionLabel",0,o,"configWorkspaceHint",0,function(e){return`Default: ${u(e)} — leave blank to use it.`},"defaultWorkdirFor",0,u,"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: ${i(e)} \xb7 `+(o(e)??"No connection");return!1===e.launchable?t+" — see Config":t}],74904)},50814,63352,e=>{"use strict";function t(e){return`${new Date(e).toISOString().slice(0,16).replace("T"," ")} UTC`}function n(e){return e?e.split("/").filter(e=>e.length>0).pop()??null:null}function r(e,t){let n=function(e){if(!e)return null;let t=e.toLowerCase();return"muse code"===t?"muse":(["codex","claude","cursor","hermes","muse"].includes(t),t)}(t);switch(e){case"provider_unavailable":return n?{reason:`${n} is not installed or did not start`,fix:`Install ${n} and Retry.`}:{reason:"the runtime is not installed or did not start",fix:"Install the runtime and Retry."};case"auth_required":return{reason:"not signed in",fix:"Sign in and Retry."};case"permission_denied":return{reason:"permission denied",fix:"Check permissions and Retry."};case"incompatible_version":return{reason:"incompatible version",fix:"Update the runtime and Retry."};case"usage_limit":return{reason:"usage limit reached",fix:"Wait or upgrade and Retry."};case"scope_missing":return{reason:"no session scope is set",fix:"Choose a scope in Config."};case"provider_failed":return{reason:"the listing failed",fix:"Retry."};default:return{reason:e,fix:"Retry."}}}let a="Not reported";function s(e){return e.toFixed(1).replace(/\.0$/,"")}function 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 u={input_tokens:"Input tokens",output_tokens:"Output tokens",cost_usd:"Cost"};function l(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 c(e){return`${e} ${1===e?"run":"runs"}`}function d(e,t,n=!1){let r=u[e];if(!t||"unavailable"===t.quality||null===t.sum)return{name:r,text:a,quality:"unavailable",coverage:t&&t.total>0?`0 of ${c(t.total)} reported`:"No runs recorded",label:`${r}: not reported`};let s=l(e,t.sum,n),i=l(e,t.sum,!0);return"partial"===t.quality?{name:r,text:s,quality:"partial",coverage:`Partial: ${t.known} of ${c(t.total)} reported`,label:`${r}: at least ${i}, partial, reported by ${t.known} of ${c(t.total)}`}:{name:r,text:s,quality:"complete",coverage:`All ${c(t.total)} reported`,label:`${r}: ${i}, reported by all ${c(t.total)}`}}e.s(["SESSION_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"ended",label:"Ended"}],"attemptLabel",0,function(e){let t="source"===e.role?"Started the session":"Resumed the session";return`${t} \xb7 ${e.outcome??"running"}`},"emptySessionsCopy",0,function(e,t,n,a){if("active"===e)return`${t} has no active sessions.`;if("ended"===e)return`${t} has no ended sessions.`;if(n?.last_error_code){let{reason:e,fix:t}=r(n.last_error_code,a),s=a?`${a} sessions`:"sessions";return`Could not read ${s}: ${e}. ${t}`}if(n&&null===n.synced_at)return`${t} has not synced sessions yet. Refresh to load past sessions.`;let s=n?.out_of_scope_count??0;return s>0?`${s} ${1===s?"session exists":"sessions exist"} outside ${t}'s scope. Widen the scope to see them.`:`${t} has no sessions yet. One appears after a coding run keeps its runtime context.`},"formatSessionDate",0,t,"formatSyncRelativeTime",0,function(e,t=Date.now()){if(null===e)return"never";let n=Math.max(0,t-e);if(n<6e4)return"just now";let r=Math.floor(n/6e4);if(r<60)return`${r} minute${1===r?"":"s"} ago`;let a=Math.floor(r/60);if(a<24)return`${a} hour${1===a?"":"s"} ago`;let s=Math.floor(a/24);return`${s} day${1===s?"":"s"} ago`},"noMatchingSessionsCopy",0,function(e,t){let r=e.trim();if(r)return`No sessions match “${r}”.`;let a=n(t);return a?`No sessions in ${a}.`:"No sessions match the current filters."},"registrationSessionSyncCopy",0,function(e,t){if("failed"===e.outcome){let{reason:n,fix:a}=r(e.error_code??"provider_failed",t);return`Could not read ${t} sessions: ${n}. ${a}`}if("unsupported"===e.outcome)return`Past sessions are not available for ${t}.`;let n=1===e.imported?"session":"sessions",a=`Loaded ${e.imported} ${n}`;return e.rejected_out_of_scope>0&&(a+=`, ${e.rejected_out_of_scope} outside the scope`),e.complete||(a+=", more remain"),`${a}.`},"runtimeLabel",0,function(e){return e.agent.transport?`${e.agent.adapter} \xb7 ${e.agent.transport}`:e.agent.adapter},"sessionStateTags",0,function(e){let t=[];return(e.home&&t.push("Home"),e.state?.availability==="missing")?[...t,"Missing"]:(e.state?.lifecycle==="archived"&&t.push("Archived"),e.state?.busy&&t.push("Busy"),(e.resumable||e.state?.resumable===!0)&&t.push("Resumable"),t)},"sessionUsageLine",0,function(e){let t=d("input_tokens",e?.input_tokens),n=d("output_tokens",e?.output_tokens),r=d("cost_usd",e?.cost_usd),s=[t,n,r];if(s.every(e=>"unavailable"===e.quality))return{text:a,label:"Usage: not reported",quality:"unavailable",partial:!1};let i=["unavailable"===t.quality?"input not reported":`${t.text} in`,"unavailable"===n.quality?"output not reported":`${n.text} out`,"unavailable"===r.quality?"cost not reported":r.text].join(" · "),o=s.some(e=>"partial"===e.quality),u=o||s.some(e=>"unavailable"===e.quality)?"partial":"complete";return{text:i,label:`Reported usage: ${s.map(e=>e.label).join("; ")}`,quality:u,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?a:i(e.input_tokens),output:null===e.output_tokens?a:i(e.output_tokens),cost:null===e.cost_usd?a: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))],r=t.map(e=>n(e)??e);return t.map((e,t)=>({value:e,label:r.filter(e=>e===r[t]).length>1?e:r[t]})).sort((e,t)=>e.label<t.label?-1:+(e.label>t.label))}],63352);let f={ask:"Ask from this context",resume:"Resume work here",handoff:"Hand off to…"},p=["queued","extracting","delivering","completed","failed","cancelled"],h=["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 b(e,t){return t.updated_at-e.updated_at||t.created_at-e.created_at||(e.id<t.id?-1:+(e.id>t.id))}e.s(["DEFAULT_LEDGER_FILTER",0,{mode:"all",state:"all",agentId:""},"INSTRUCTION_LIMIT",0,4e3,"MODE_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"ask",label:"Ask"},{value:"continue",label:"Continue"}],"STATE_FILTER_OPTIONS",0,[{value:"all",label:"Any status"},{value:"active",label:"In progress"},{value:"queued",label:"Queued"},{value:"extracting",label:"Asking / extracting"},{value:"delivering",label:"Delivering"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"}],"detailsHref",0,function(e){return`/exchanges?id=${encodeURIComponent(e)}`},"eventLabel",0,function(e,t){let n=e.data??{},r=t.source.agent_name,a=t.destination?.agent_name??"the destination Agent",s="string"==typeof n.hop?n.hop:null;switch(e.type){case"created":return"ask"===t.mode?`You asked ${r}'s session a question`:`You handed ${r}'s session to ${a}`;case"hop_queued":if("deliver"===s)return`Handoff queued for ${a}'s new session`;return"extract"===s?`Handoff extraction queued in ${r}'s session`:`Question queued for ${r}'s session`;case"hop_started":if("deliver"===s)return`${a} started a new session`;return"extract"===s?`${r}'s session started extracting the handoff`:`${r}'s session started answering`;case"state_changed":{let e="string"==typeof n.to&&p.includes(n.to)?n.to:null;return e?`Now ${g(t.mode,e).toLowerCase()}`:"State changed"}case"answer_returned":return`Answer returned to ${t.origin?.label??"the origin thread"}${n.truncated?" (shortened)":""}`;case"packet_extracted":return"Handoff packet extracted";case"packet_rejected":return`Handoff packet refused${"string"==typeof n.reason?`: ${n.reason}`:""}`;case"destination_replied":return`${a} replied in ${t.destination?.conversation?.label??"its thread"}`;case"destination_session_rejected":return`${a}'s session was not new; the handoff stopped`;case"cancel_requested":return"You asked to cancel";case"hop_result_discarded":return"A late result was discarded";default:return e.type.replace(/_/g," ")}},"excerpt",0,m,"exchangeRequestBody",0,function(e,t,n){let r={mode:e.mode,idempotency_key:n,origin_conversation_id:e.originConversationId,source:{agent_id:t.agentId,session_ref:t.sessionRef},instruction:e.instruction.trim()};return"continue"===e.mode&&(r.destination={agent_id:e.destinationAgentId}),r},"failureAdvice",0,function(e){if("failed"!==e.state)return null;switch(e.failure?.code){case"packet_invalid":case"packet_missing":return"The source session did not return a usable handoff. Start a new Continue with a clearer objective.";case"destination_session_invalid":return"The destination did not start a fresh session. Check its runtime, then start a new Continue.";case"destination_turn_failed":return"Check the destination Agent’s runtime, then start a new Continue from the source session.";case"source_turn_failed":return"Check the source Agent’s runtime, then start a new exchange from its Sessions.";default:return"Start a new exchange from the session to try again."}},"formatExchangeTime",0,function(e){return t(e)},"instructionHeading",0,function(e){return"ask"===e?"Question":"Objective"},"ledgerAgents",0,function(e){let t=new Map;for(let n of e)t.set(n.source.agent_id,n.source.agent_name),n.destination&&t.set(n.destination.agent_id,n.destination.agent_name);return[...t.entries()].map(([e,t])=>({id:e,name:t})).sort((e,t)=>e.name.localeCompare(t.name)||e.id.localeCompare(t.id))},"ledgerRows",0,function(e,t){return e.filter(e=>("all"===t.mode||e.mode===t.mode)&&("active"!==t.state||!e.terminal)&&("all"===t.state||"active"===t.state||e.state===t.state)&&(!t.agentId||e.source.agent_id===t.agentId||e.destination?.agent_id===t.agentId)).sort(b)},"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,!h.includes(t))?"Cancelling…":g(e.mode,e.state)},"modeLabel",0,function(e){return"ask"===e?"Ask":"Continue"},"outcomeLine",0,function(e){if("completed"===e.state){if("ask"===e.mode){let t=e.origin?.label??"the origin thread";return e.outcome.answer?`Answer in ${t}: ${m(e.outcome.answer,200)}`:`Answered in ${t}.`}let t=e.destination?.agent_name??"The destination Agent";return e.outcome.reply?`${t} picked it up in a new session: ${m(e.outcome.reply,200)}`:`${t} picked it up in a new session.`}return"failed"===e.state?e.failure?.message||"The exchange failed.":"cancelled"===e.state?"Cancelled before it finished. Nothing more will run.":null},"participantsLabel",0,function(e){return"ask"===e.mode?`You → ${e.source.agent_name}`:`${e.source.agent_name} → ${e.destination?.agent_name??"another Agent"}`},"pinRequestBody",0,function(e,t,n,r,a){return{action:e,content:t.trim(),conversation_id:n,idempotency_key:a,..."resume"===e?{approve_write:r}:{}}},"sessionDialogMode",0,function(e){return"handoff"===e?"continue":e},"sessionDialogTitle",0,function(e){return f["continue"===e?"handoff":e]},"sessionDialogUsesPin",0,function(e,t){return"resume"===e||"ask"===e&&"provider"===t},"sessionLabel",0,function(e){return`${e.source.agent_name}'s session “${e.source.session_title}”`},"sessionRowActions",0,function(e){let t;if(e.actions)t=e.actions;else{let n="ended"===e.status?{available:!1,reason:"Ask from this context and Hand off to… are unavailable: this session has ended. Its history stays here."}:e.resumable?{available:!0}:{available:!1,reason:`Ask from this context and Hand off to… are unavailable: Botmancers can’t resume this session under ${e.agent.name}’s current runtime.`},r=n.available?{available:!0}:{available:!1,code:"ended"===e.status?"session_ended":"session_not_resumable",reason:n.reason,recovery:"choose_session"};t={ask:r,resume:{available:!1,code:"action_unavailable",reason:`${f.resume} is unavailable: this runtime can’t resume a session with edits.`,recovery:"choose_action"},handoff:r}}return["ask","resume","handoff"].map(e=>({action:e,label:f[e],availability:t[e]}))},"stateTone",0,function(e){return"completed"===e?"done":"failed"===e||"cancelled"===e?"stopped":"active"},"submitErrorMessage",0,function(e,t){switch(e){case"session_ended":return"This session has ended and can’t be resumed.";case"session_not_resumable":return"Botmancers can’t resume this session under the Agent’s current runtime.";case"source_session_busy":return"This session already has an exchange in progress. Wait for it or cancel it from its card.";case"agent_unavailable":return t||"That Agent can’t launch yet. Choose its runtime connection and session scope in Config.";case"idempotency_conflict":return"This request changed while it was being sent. Send again.";case"session_missing":return"The runtime no longer has this session. Its history stays here; choose another session.";case"approval_required":return"Resume work here needs your approval of edits. Tick the approval, then send again.";case"authority_not_allowed":return t||"This Agent’s policy doesn’t allow edits in a resumed session. Change it in Config.";case"action_unavailable":return t||"This runtime can’t do that in this session. Choose another action.";case"provider_failed":return"The runtime failed this turn. Nothing moved to another session; try again later.";default:return t||"The exchange could not be started. Your draft is kept; try again."}},"threadHref",0,function(e,t){let n=new URLSearchParams;if(e.thread_agent_id)return n.set("agent",e.thread_agent_id),t&&n.set("exchange",t),`/?${n.toString()}`;if("group"!==e.kind)return null;t&&n.set("exchange",t);let r=n.toString();return`/threads/${encodeURIComponent(e.id)}${r?`?${r}`:""}`},"validateDraft",0,function(e){let t={},n=e.instruction.trim(),r="ask"===e.mode?"a question":"an objective";return n?e.instruction.length>4e3&&(t.instruction="Keep it under 4000 characters."):t.instruction=`Enter ${r}.`,e.originConversationId||(t.origin="Choose the thread that follows this exchange."),"continue"!==e.mode||e.destinationAgentId||(t.destination="Choose the Agent who continues the work."),t},"validateResumeDraft",0,function(e,t){let n={};return e.trim()?e.length>4e3&&(n.instruction="Keep it under 4000 characters."):n.instruction="Enter what to work on.",t||(n.approval="Approve edits in this session to resume work here."),n}],50814)},22016,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return b},useLinkStatus:function(){return y}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let s=e.r(90809),i=e.r(43476),o=s._(e.r(71645)),u=e.r(95057),l=e.r(8372),c=e.r(18581),d=e.r(18967),f=e.r(5550),p=e.r(88540),h=e.r(91949),g=e.r(73668),m=e.r(9396);function b(t){var n;let r,a,s,[b,y]=(0,o.useOptimistic)(h.IDLE_LINK_STATUS),v=(0,o.useRef)(null),{href:$,as:x,children:k,prefetch:S=null,passHref:w,replace:C,shallow:T,scroll:A,onClick:E,onMouseEnter:R,onTouchStart:L,legacyBehavior:N=!1,onNavigate:j,transitionTypes:P,ref:I,unstable_dynamicOnHover:O,...D}=t;r=k,N&&("string"==typeof r||"number"==typeof r)&&(r=(0,i.jsx)("a",{children:r}));let U=o.default.useContext(l.AppRouterContext),M=!1!==S,q=!1===S?"none":!0===S?"full":"auto",F="none"!==q?"auto"===q?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,B="string"==typeof(n=x||$)?n:(0,u.formatUrl)(n);if(N){if(r?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=o.default.Children.only(r)}let H=N?a&&"object"==typeof a&&a.ref:I,K,W=o.default.useCallback(e=>(null!==U&&(v.current=(0,h.mountLinkInstance)(e,B,U,F,M,y,K)),()=>{v.current&&((0,h.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,h.unmountPrefetchableInstance)(e)}),[M,B,U,F,y,K]),G={ref:(0,c.useMergedRef)(W,H),onClick(t){N||"function"!=typeof E||E(t),N&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!U||t.defaultPrevented||function(t,n,r,a,s,i,u,l="none"){if("u">typeof window){let c,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(n)){a&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(99781);o.default.startTransition(()=>{f(n,a?"replace":"push",!1===s?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,r.current,u,l)})}}(t,B,v,C,A,j,P,q)},onMouseEnter(e){N||"function"!=typeof R||R(e),N&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),U&&M&&(0,h.onNavigationIntent)(e.currentTarget,!0===O)},onTouchStart:function(e){N||"function"!=typeof L||L(e),N&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),U&&M&&(0,h.onNavigationIntent)(e.currentTarget,!0===O)}};return(0,d.isAbsoluteUrl)(B)?G.href=B:N&&!w&&("a"!==a.type||"href"in a.props)||(G.href=(0,f.addBasePath)(B)),s=N?o.default.cloneElement(a,G):(0,i.jsx)("a",{...D,...G,children:r}),(0,i.jsx)(_.Provider,{value:b,children:s})}let _=(0,o.createContext)(h.IDLE_LINK_STATUS),y=()=>(0,o.useContext)(_);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},18581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return a}});let r=e.r(71645);function a(e,t){let n=(0,r.useRef)(null),a=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(n.current=s(e,r)),t&&(a.current=s(t,r))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},73668,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return s}});let r=e.r(18967),a=e.r(52817);function s(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,a.hasBasePath)(n.pathname)}catch(e){return!1}}},98183,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={assign:function(){return u},searchParamsToUrlQuery:function(){return s},urlQueryToSearchParams:function(){return o}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});function s(e){let t={};for(let[n,r]of e.entries()){let e=t[n];void 0===e?t[n]=r:Array.isArray(e)?e.push(r):t[n]=[e,r]}return t}function 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,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,i(e));else t.set(n,i(r));return t}function u(e,...t){for(let n of t){for(let t of n.keys())e.delete(t);for(let[t,r]of n.entries())e.append(t,r)}return e}},95057,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={formatUrl:function(){return o},formatWithValidation:function(){return l},urlObjectKeys:function(){return u}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let s=e.r(90809)._(e.r(98183)),i=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:n}=e,r=e.protocol||"",a=e.pathname||"",o=e.hash||"",u=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:n&&(l=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(l+=":"+e.port)),u&&"object"==typeof u&&(u=String(s.urlQueryToSearchParams(u)));let c=e.search||u&&`?${u}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||i.test(r))&&!1!==l?(l="//"+(l||""),a&&"/"!==a[0]&&(a="/"+a)):l||(l=""),o&&"#"!==o[0]&&(o="#"+o),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${r}${l}${a}${c}${o}`}let u=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(e){return o(e)}},18967,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={DecodeError:function(){return b},MiddlewareNotFoundError:function(){return $},MissingStaticPage:function(){return v},NormalizeError:function(){return _},PageNotFoundError:function(){return y},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return s},execOnce:function(){return i},getDisplayName:function(){return d},getLocationOrigin:function(){return l},getURL:function(){return c},isAbsoluteUrl:function(){return u},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return x}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let s=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,n=!1;return(...r)=>(n||(n=!0,t=e(...r)),t)}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,u=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&o.test(e)};function l(){let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?":"+n:""}`}function c(){let{href:e}=window.location,t=l();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 n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&f(n))return r;if(!r)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return r}let g="u">typeof performance,m=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class b extends Error{}class _ extends Error{}class y extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class $ extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function x(e){return JSON.stringify({message:e.message,stack:e.stack})}}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13978,e=>{"use strict";var t=e.i(43476),n=e.i(71645),s=e.i(22016),a=e.i(18566),r=e.i(15983),i=e.i(24204);function l({agentId:e,agentName:s}){let a=(0,n.useId)(),r=(0,n.useId)(),o=(0,n.useId)(),[c,d]=(0,n.useState)(null),[u,f]=(0,n.useState)(""),[m,h]=(0,n.useState)(0),[p,g]=(0,n.useState)("idle"),[x,b]=(0,n.useState)(""),[v,y]=(0,n.useState)(""),[j,N]=(0,n.useState)(""),[k,_]=(0,n.useState)(""),[w,S]=(0,n.useState)("");(0,n.useEffect)(()=>{let t=!1;return fetch(`/api/bots/${encodeURIComponent(e)}/share-policy`,{cache:"no-store"}).then(async e=>{let n=await e.json().catch(()=>null);t||(e.ok&&n?.policy?(f(""),d(n.policy)):f("Could not load the share policy."))}).catch(()=>{t||f("Could not load the share policy.")}),()=>{t=!0}},[e,m]);let C=()=>{b(""),g("idle"),h(e=>e+1)},$=async(t,n)=>{if(!c)return!1;g("saving"),b(""),y("");try{let s=await fetch(`/api/bots/${encodeURIComponent(e)}/share-policy`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({revision:c.revision,...t})}),a=await s.json().catch(()=>null);if(!s.ok||!a?.policy)return g("error"),b("string"==typeof a?.error?.message?a.error.message:"The share policy could not be saved."),!1;return d(a.policy),g("idle"),y(n("number"==typeof a.revoked_contexts?a.revoked_contexts:0)),!0}catch{return g("error"),b("The share policy could not be saved."),!1}},A=async e=>{if(e.preventDefault(),!c)return;let t=(0,i.audienceInputError)(j,k,c.audiences);if(S(t??""),t)return;let n={kind:"slack",team_id:j.trim(),channel_id:k.trim()};await $({audiences:[...c.audiences,n]},()=>`Added ${(0,i.audienceLabel)(n)}.`)&&(N(""),_(""))},T="saving"===p,E=!!c&&"invalid"!==c.state;return(0,t.jsxs)("section",{className:"cfg-card share-policy",id:"session-sharing","aria-labelledby":"cfg-sharing-title",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{id:"cfg-sharing-title",className:"cfg-title",children:"Session sharing"}),T?(0,t.jsx)("span",{className:"text-sm cfg-faint",role:"status",children:"Saving…"}):null]}),(0,t.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:["A share lets people in one Slack channel ask one of ",s,"’s sessions questions, read-only, until it expires or you revoke it. Create and revoke shares from Sessions."]}),u?(0,t.jsxs)("p",{className:"text-sm cfg-error",role:"alert",children:[u," ",(0,t.jsx)("button",{type:"button",onClick:C,className:"underline hover:no-underline",children:"Retry"})]}):null,c||u?null:(0,t.jsx)("p",{className:"text-sm cfg-faint",role:"status",children:"Loading…"}),c?.state==="invalid"?(0,t.jsxs)("p",{className:"text-sm cfg-error mb-3",role:"alert",children:["The share policy file is invalid, so nothing can be shared: ",c.reason," Fix or remove config/session-shares.json, then"," ",(0,t.jsx)("button",{type:"button",onClick:C,className:"underline hover:no-underline",children:"reload"}),"."]}):null,c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"share-policy-toggle",children:[(0,t.jsx)("input",{id:a,type:"checkbox",role:"switch",checked:c.agent.share_from_turn,"aria-checked":c.agent.share_from_turn,disabled:!E||T||!c.agent.share_current.supported&&!c.agent.share_from_turn,"data-share-policy":"share_from_turn",onChange:e=>{let t=e.target.checked;$({share_from_turn:t},e=>t?"Share from a turn is on.":`Share from a turn is off.${e?` Revoked ${e} live turn context${1===e?"":"s"}.`:""}`)}}),(0,t.jsxs)("label",{htmlFor:a,className:"text-sm",children:[(0,t.jsx)("span",{className:"font-medium",children:"Share from a turn"})," (",(0,t.jsx)("code",{className:"cfg-code",children:"share_from_turn"}),")"]})]}),(0,t.jsx)("p",{className:"text-sm cfg-faint share-policy-hint",children:(0,i.shareFromTurnNote)(c)}),c.agent.live_contexts>0?(0,t.jsxs)("p",{className:"text-sm cfg-faint share-policy-hint",children:[c.agent.live_contexts," live turn context",1===c.agent.live_contexts?"":"s"," now."]}):null,(0,t.jsx)("h3",{className:"cfg-title share-policy-sub",children:"Slack channel allowlist"}),(0,t.jsx)("p",{className:"text-sm cfg-faint",children:"Every Agent’s shares use this list. A share can only go to a channel on it."}),0===c.audiences.length?(0,t.jsx)("p",{className:"text-sm cfg-muted share-policy-empty",children:"No channel yet: nothing can be shared to Slack."}):(0,t.jsx)("ul",{className:"share-policy-list","aria-label":"Allowed Slack channels",children:c.audiences.map(e=>(0,t.jsxs)("li",{className:"share-policy-entry",children:[(0,t.jsx)("span",{className:"cfg-code",children:e.channel_id}),(0,t.jsxs)("span",{className:"cfg-faint",children:["workspace ",e.team_id]}),(0,t.jsx)("button",{type:"button",className:"cfg-link text-sm share-policy-remove",disabled:!E||T,"aria-label":`Remove ${(0,i.audienceLabel)(e)}`,onClick:()=>{c&&$({audiences:c.audiences.filter(t=>t.team_id!==e.team_id||t.channel_id!==e.channel_id)},()=>`Removed ${(0,i.audienceLabel)(e)}. Its Slack threads stop being answered.`)},children:"Remove"})]},`${e.team_id}:${e.channel_id}`))}),(0,t.jsxs)("form",{className:"share-policy-add",onSubmit:e=>{A(e)},"aria-label":"Add a Slack channel",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:r,className:"text-sm",children:"Workspace ID"}),(0,t.jsx)("input",{id:r,className:"cfg-input",value:j,placeholder:"T0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!E||T,"aria-invalid":!!w,onChange:e=>{N(e.target.value),S("")}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:o,className:"text-sm",children:"Channel ID"}),(0,t.jsx)("input",{id:o,className:"cfg-input",value:k,placeholder:"C0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!E||T,"aria-invalid":!!w,onChange:e=>{_(e.target.value),S("")}})]}),(0,t.jsx)("button",{type:"submit",className:"cfg-btn-primary text-sm",disabled:!E||T||!j.trim()||!k.trim(),children:"Add channel"})]}),w?(0,t.jsx)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:w}):null,"error"===p?(0,t.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:["Couldn't save: ",x," ",(0,t.jsx)("button",{type:"button",onClick:C,className:"underline hover:no-underline",children:"Reload"})]}):null,(0,t.jsx)("p",{className:"mt-2 text-sm cfg-ok",role:"status",children:v})]}):null]})}var o=e.i(10718),c=e.i(74904),d=e.i(33851),u=e.i(44079),f=e.i(52900),m=e.i(87303);function h({attribute:e,label:s,options:a,current:r,onPick:i,className:l}){let o=(0,n.useId)(),c=`avatar-${e}`;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{id:o,className:"avatar-group-label",children:s}),(0,t.jsx)("div",{className:l?`avatar-opt-grid ${l}`:"avatar-opt-grid",role:"radiogroup","aria-labelledby":o,children:a.map(n=>(0,t.jsxs)("label",{title:n.label,className:"avatar-opt",children:[(0,t.jsx)("input",{type:"radio",name:c,value:n.id,checked:r[e]===n.id,onChange:()=>i({[e]:n.id}),className:"avatar-opt-input"}),(0,t.jsx)("span",{className:"avatar-opt-art","aria-hidden":"true",children:(0,t.jsx)(m.default,{config:{...r,[e]:n.id},size:44})}),(0,t.jsx)("span",{children:n.label})]},n.id))})]})}var p=e.i(68541);function g({phase:e,onImport:n}){let s=(0,p.marketImportView)(e);return(0,t.jsxs)("div",{className:"mt-3","data-field":"marketplace-import",children:[(0,t.jsx)("button",{type:"button",onClick:n,disabled:s.busy,"aria-busy":s.busy,"aria-describedby":"cfg-market-import-status",className:"cfg-btn-ghost text-sm w-full sm:w-auto",children:"Import from Grok Marketplace"}),(0,t.jsx)("p",{id:"cfg-market-import-status",role:"status","aria-live":"polite",className:"error"===s.tone?"mt-2 text-sm cfg-error":"mt-2 text-xs cfg-faint",children:s.message})]})}var x=e.i(37947);let b="Fix the highlighted fields.",v=[{key:"avatar_accessory",label:"Avatar accessory"},{key:"avatar_color",label:"Avatar color"},{key:"avatar_eyes",label:"Avatar eyes"},{key:"avatar_hands",label:"Avatar hands"},{key:"description",label:"Description (rules)"},{key:"import_operation_id",label:"Import operation ID"},{key:"import_schema_version",label:"Import schema version"},{key:"memories",label:"Remembered facts"},{key:"name",label:"Name"},{key:"skill_content",label:"Skill content"},{key:"skill_path",label:"Skill path"},{key:"skill_present",label:"Skill present"},{key:"source_provider",label:"Source provider"},{key:"template_id",label:"Template ID"},{key:"template_url",label:"Template URL"},{key:"title",label:"Title"}];function y(e){return String(e).padStart(2,"0")}function j(e){let t=new Date(e);return`${t.getFullYear()}-${y(t.getMonth()+1)}-${y(t.getDate())} ${y(t.getHours())}:${y(t.getMinutes())}`}function N(e){let t=new Date(e);return`${y(t.getHours())}:${y(t.getMinutes())}:${y(t.getSeconds())}`}async function k(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}e.s(["default",0,function(){var e;let i=String((0,a.useParams)().id??""),y=(0,a.useRouter)(),[_,w]=(0,n.useState)(!1),[S,C]=(0,n.useState)(null),[$,A]=(0,n.useState)(!0),[T,E]=(0,n.useState)(!1),[R,I]=(0,n.useState)(!1),[D,P]=(0,n.useState)(0),[L,O]=(0,n.useState)(null),[U,F]=(0,n.useState)("clean"),[q,M]=(0,n.useState)(""),[H,B]=(0,n.useState)(0),[W,K]=(0,n.useState)(!1),[V,z]=(0,n.useState)(""),[J,Y]=(0,n.useState)("clean"),[G,Q]=(0,n.useState)(""),[X,Z]=(0,n.useState)(0),[ee,et]=(0,n.useState)({}),[en,es]=(0,n.useState)(""),[ea,er]=(0,n.useState)(!1),[ei,el]=(0,n.useState)(null),[eo,ec]=(0,n.useState)(!1),ed=(0,f.useRuntimeConnections)(),[eu,ef]=(0,n.useState)(void 0),[em,eh]=(0,n.useState)("clean"),[ep,eg]=(0,n.useState)(""),[ex,eb]=(0,n.useState)(0),[ev,ey]=(0,n.useState)(null),[ej,eN]=(0,n.useState)("clean"),[ek,e_]=(0,n.useState)(""),[ew,eS]=(0,n.useState)(0),{phase:eC,startImport:e$}=function(e){let[t,s]=(0,n.useState)("idle");return(0,n.useEffect)(()=>{let t=window.location.search;if(null===(0,p.importedBotId)(t))return;let n=new URL(window.location.href);n.searchParams.delete(p.IMPORT_RETURN_QUERY),window.history.replaceState(null,"",n.pathname+n.search);let a=!1;return(0,p.resolveImportReturn)(t,e,async e=>(await fetch(`/api/bots/${encodeURIComponent(e)}/config`,{cache:"no-store"})).ok).then(e=>{a||("open"===e.kind?window.location.replace(e.path):"missing"===e.kind&&s("missing"))}),()=>{a=!0}},[e]),{phase:t,startImport:async function(){s("checking");try{let e=await fetch(p.HANDOFF_STATUS_PATH,{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok)return void s("failed");if(t?.configured!==!0)return void s("unavailable");s("redirecting"),window.location.href=(0,p.handoffStartPath)(window.location.origin,window.location.pathname),setTimeout(()=>s(e=>"redirecting"===e?"idle":e),4e3)}catch{s("failed")}}}}(i);function eA(){A(!0),E(!1),P(e=>e+1)}(0,n.useEffect)(()=>{if(!i)return;let e=!1;return fetch(`/api/bots/${encodeURIComponent(i)}/sessions?status=all`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(t=>{e||ef((t?.sessions??[]).map(e=>({ref:e.ref,title:e.title,status:e.status})))}).catch(()=>{e||ef([])}),()=>{e=!0}},[i,D]),(0,n.useEffect)(()=>{if(!i)return;let e=!1;return fetch(`/api/bots/${encodeURIComponent(i)}/config`).then(async t=>{if(e)return;if(404===t.status){I(!0),C(null);return}if(!t.ok)throw Error("request failed");let n=await t.json();e||(C(n),O(n.bot.description??""),I(!1),E(!1))}).catch(()=>{e||E(!0)}).finally(()=>{e||A(!1)}),()=>{e=!0}},[i,D]);let eT=S?.bot.description??"",eE=null!==L&&L!==eT,eR=S?.skill.content??"",eI=W&&V!==eR,eD=S?(0,d.registrationFormFromBot)(S.bot):null,eP=ea&&null!==ei&&JSON.stringify(ei)!==JSON.stringify(eD),eL=S?.bot.avatar_config??(0,x.resolveAvatar)(S?.bot??{}),eO=ev??eL,eU=null!==ev&&JSON.stringify(ev)!==JSON.stringify(eL),eF=eE||eI||eP||eU;function eq(e,t){k(t).then(t=>{t&&(es(e),setTimeout(()=>es(t=>t===e?"":t),2e3))})}async function eM(){if(S&&null!==L){F("saving"),M("");try{let e=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:S.bot.id,description:L})});if(!e.ok){let t="request failed";try{let n=await e.json();n.error&&(t=n.error)}catch{}throw Error(t)}let t=await fetch(`/api/bots/${encodeURIComponent(i)}/config`);if(!t.ok)throw Error("request failed");C(await t.json()),F("confirmed"),B(Date.now()),setTimeout(()=>{F(e=>"confirmed"===e?"clean":e)},5e3)}catch(e){F("error"),M(e instanceof Error?e.message:"request failed")}}}function eH(){S&&(el((0,d.registrationFormFromBot)(S.bot)),er(!0),ec(!1),eh("clean"),eg(""),ed.retry())}function eB(e){el(t=>t?{...t,...e}:t),eg(""),eh(e=>"error"===e?"clean":e)}function eW(){er(!1),el(null),eh("clean"),eg("")}function eK(e){ey({...ev??eL,...e}),eN("clean"),e_("")}async function eV(){if(S&&ev){eN("saving"),e_("");try{let e=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:S.bot.id,avatar:ev})});if(!e.ok){let t="request failed";try{let n=await e.json();n.error&&(t=n.error)}catch{}throw Error(t)}let t=await fetch(`/api/bots/${encodeURIComponent(i)}/config`);if(!t.ok)throw Error("request failed");C(await t.json()),ey(null),eN("confirmed"),eS(Date.now()),setTimeout(()=>{eN(e=>"confirmed"===e?"clean":e)},5e3)}catch(e){eN("error"),e_(e instanceof Error?e.message:"request failed")}}}async function ez(){if(S&&ei){if((0,d.hasRegistrationErrors)((0,d.registrationFormView)(ei,ed.state))){ec(!0),eh("error"),eg(b);return}eh("saving"),eg("");try{let e=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,d.registrationPatchBody)(S.bot.id,ei))});if(!e.ok){let t="request failed";try{let n=await e.json();n.error&&(t=n.error)}catch{}throw Error(t)}let t=await fetch(`/api/bots/${encodeURIComponent(i)}/config`);if(!t.ok)throw Error("request failed");C(await t.json()),er(!1),el(null),eh("confirmed"),eb(Date.now()),setTimeout(()=>{eh(e=>"confirmed"===e?"clean":e)},5e3)}catch(e){eh("error"),eg(e instanceof Error?e.message:"request failed")}}}function eJ(){z(S?.skill.content??""),K(!0),Y("clean"),Q("")}async function eY(){if(S&&(V.trim()||window.confirm("Delete this skill file?"))){Y("saving"),Q("");try{let e=await fetch(`/api/bots/${encodeURIComponent(i)}/skill`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:V})});if(!e.ok){let t="request failed";try{let n=await e.json();n.error&&(t=n.error)}catch{}throw Error(t)}let t=await e.json();C(e=>e?{...e,skill:t.skill,currentHash:t.currentHash}:e),K(!1),Y("confirmed"),Z(Date.now()),setTimeout(()=>{Y(e=>"confirmed"===e?"clean":e)},5e3)}catch(e){Y("error"),Q(e instanceof Error?e.message:"request failed")}}}if((0,n.useEffect)(()=>{if(!eF)return;let e=e=>{e.preventDefault()};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[eF]),R)return(0,t.jsx)("div",{className:"cfg-page flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"mb-4",children:"Agent not found."}),(0,t.jsx)(s.default,{href:"/",className:"cfg-link",children:"← Back to chat"})]})});if($&&!S)return(0,t.jsx)("div",{className:"cfg-page",children:(0,t.jsxs)("div",{className:"max-w-6xl mx-auto space-y-6",children:[(0,t.jsx)("div",{className:"h-6 w-32 rounded animate-pulse cfg-skel"}),(0,t.jsx)("div",{className:"h-20 rounded-lg animate-pulse cfg-skel"}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsx)("div",{className:"space-y-6",children:[0,1,2].map(e=>(0,t.jsx)("div",{className:"h-48 rounded-lg animate-pulse cfg-skel"},e))}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)("div",{className:"h-64 rounded-lg animate-pulse cfg-skel"}),(0,t.jsx)("div",{className:"h-80 rounded-lg animate-pulse cfg-skel"})]})]})]})});if(T&&!S)return(0,t.jsx)("div",{className:"cfg-page",children:(0,t.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,t.jsx)(s.default,{href:"/",className:"cfg-link cfg-back text-sm",children:"← Back to chat"}),(0,t.jsxs)("header",{className:"mt-3 mb-6 flex flex-wrap items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"text-xl font-bold truncate",children:"Agent configuration"}),(0,t.jsx)("p",{className:"text-sm cfg-faint truncate",children:"Couldn't load agent details."})]}),(0,t.jsxs)("div",{className:"ml-auto text-right",children:[(0,t.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash: ",(0,t.jsx)("code",{className:"cfg-code",children:"—"})]}),(0,t.jsx)("p",{className:"text-sm mt-1",children:(0,t.jsx)("span",{className:"cfg-faint",children:"○ Not loaded"})})]})]}),(0,t.jsx)("div",{className:"grid gap-6 lg:grid-cols-2 items-start",children:[["Skills","Rules","Agent","Template source"],["Launch snapshots","Avatar"]].map(e=>(0,t.jsx)("div",{className:"min-w-0 space-y-6",children:e.map(e=>(0,t.jsxs)("div",{className:"cfg-card",children:[(0,t.jsx)("h2",{className:"cfg-title mb-2",children:e}),(0,t.jsxs)("p",{className:"text-sm cfg-muted",children:["Couldn't load this section."," ",(0,t.jsx)("button",{onClick:eA,className:"cfg-link",children:"Retry"})]})]},e))},e[0]))})]})});if(!S)return null;let{bot:eG,skill:eQ,currentHash:eX,snapshots:eZ}=S,e0=!!(eG.source_provider||eG.template_id||eG.template_url||eG.import_schema_version||eG.import_operation_id),e1="saving"===U?(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):eE||"error"===U?(0,t.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===U?(0,t.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",N(H)]}):(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),e2="saving"===J?(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):eI||"error"===J?(0,t.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===J?(0,t.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",N(X)]}):(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),e3="saving"===em?(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):eP||"error"===em?(0,t.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===em?(0,t.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",N(ex)]}):(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),e4="saving"===ej?(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):eU||"error"===ej?(0,t.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===ej?(0,t.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",N(ew)]}):(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"});return(0,t.jsxs)("div",{className:"cfg-page",children:[(0,t.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,t.jsx)(s.default,{href:"/",onClick:function(e){eF&&!window.confirm("You have unsaved changes. Leave without saving?")&&e.preventDefault()},className:"cfg-link cfg-back text-sm",children:"← Back to chat"}),(0,t.jsxs)("header",{className:"mt-3 mb-6 flex flex-wrap items-center gap-4",children:[(0,t.jsx)(m.default,{bot:eG,size:48,title:`${eG.name} avatar`}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"text-xl font-bold truncate",children:eG.name}),(0,t.jsx)("p",{className:"text-sm cfg-faint truncate",children:eG.title||" "})]}),(0,t.jsxs)("div",{className:"ml-auto text-right",children:[(0,t.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash:"," ",(0,t.jsx)("code",{className:"cfg-code",title:eX,children:eX.slice(0,8)})," ",(0,t.jsx)("button",{onClick:()=>eq("header",eX),className:"cfg-link text-sm",children:"header"===en?"Copied":"Copy"})]}),(0,t.jsx)("p",{className:"text-sm mt-1",children:eF?(0,t.jsxs)("span",{className:"cfg-dirty",children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):(0,t.jsx)("span",{className:"cfg-faint",children:"● Saved"})})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2 items-start","data-cfg-layout":"columns",children:[(0,t.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"primary",children:[(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"cfg-title",children:"Skills"}),e2]}),"unsupported"===eQ.status?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Unsupported name"}),(0,t.jsx)("p",{className:"text-sm cfg-muted",children:"Skill files need an agent name matching /^[A-Za-z0-9_-]+$/ — this name cannot map to a skill path."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:[eQ.path," · ","present"===eQ.status?"Present":"Not present"]}),W?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("textarea",{value:V,onChange:e=>z(e.target.value),rows:8,className:"cfg-input text-sm"}),"error"===J&&(0,t.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",G,"."," ",(0,t.jsx)("button",{onClick:eY,className:"underline hover:no-underline",children:"Retry"})]}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)("button",{onClick:eY,disabled:!eI||"saving"===J,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===J?"Saving…":"Save"}),(0,t.jsx)("button",{onClick:function(){K(!1),Y("clean"),Q("")},disabled:!eI||"saving"===J,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}):"present"===eQ.status?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"text-sm cfg-pre max-h-64 overflow-y-auto",children:eQ.content}),(0,t.jsx)("button",{onClick:eJ,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm cfg-muted",children:"No skill file yet. Create SKILL.md to give this agent standing instructions."}),(0,t.jsx)("button",{onClick:eJ,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Create"})]}),(0,t.jsx)("p",{className:"mt-3 text-xs cfg-faint",children:"Appended verbatim as a system message at launch."})]})]}),(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"cfg-title",children:"Rules"}),e1]}),(0,t.jsx)("textarea",{value:L??"",onChange:e=>O(e.target.value),rows:8,className:"cfg-input cfg-input-sans text-sm"}),(0,t.jsx)("p",{className:"mt-2 text-xs cfg-faint",children:"Sent verbatim as the standing-rules system message on every turn. This beats the user's request for detail or length."}),"error"===U&&(0,t.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",q,"."," ",(0,t.jsx)("button",{onClick:eM,className:"underline hover:no-underline",children:"Retry"})]}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)("button",{onClick:eM,disabled:!eE||"saving"===U,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===U?"Saving…":"Save"}),(0,t.jsx)("button",{onClick:function(){O(eT),F("clean"),M("")},disabled:!eE||"saving"===U,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"cfg-title",children:"Agent"}),e3]}),(()=>{if(!ea||!ei){let e=(0,d.registrationReadView)(eG,eu);return(0,t.jsxs)("div",{"data-field":"runtime-read",children:[(0,t.jsx)("dl",{className:"text-sm",children:e.rows.map(e=>(0,t.jsxs)("div",{"data-row":e.key,className:"flex flex-col sm:flex-row sm:justify-between gap-x-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:e.label}),(0,t.jsx)("dd",{className:"sm:text-right break-words cfg-muted",children:e.value})]},e.key))}),e.notices.map(e=>(0,t.jsx)("p",{className:"text-sm cfg-dirty mt-2",children:e},e)),(0,t.jsx)("button",{onClick:eH,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]})}let e=(0,d.registrationFormView)(ei,ed.state);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.RegistrationFields,{idPrefix:"cfg",variant:"config",form:ei,onChange:eB,view:e,showErrors:eo,connections:ed.state,onRetryConnections:ed.retry,onAddConnection:ed.add,workspacePlaceholder:(0,c.defaultWorkdirFor)(eG.id),workspaceHint:(0,c.configWorkspaceHint)(eG.id),sessions:eu,includeHomeSession:!0}),"error"===em&&(0,t.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:[ep===b?ep:`Couldn't save: ${ep}.`," ",ep===b?null:(0,t.jsx)("button",{onClick:ez,className:"underline hover:no-underline",children:"Retry"})]}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)("button",{onClick:ez,disabled:!eP||"saving"===em||e.submitDisabled,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===em?"Saving…":"Save"}),(0,t.jsx)("button",{onClick:eW,disabled:"saving"===em,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:eP?"Discard":"Cancel"})]})]})})()]}),(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsx)("h2",{className:"cfg-title mb-3",children:"Template source"}),!e0&&(0,t.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Created manually in Botmancers — no template source."}),(0,t.jsxs)("dl",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:"Source provider"}),(0,t.jsx)("dd",{className:"text-right",children:eG.source_provider??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:"Template ID"}),(0,t.jsx)("dd",{className:"text-right",children:eG.template_id??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:"Template URL"}),(0,t.jsx)("dd",{className:"text-right break-all",children:eG.template_url?(e=eG.template_url).startsWith("http://")||e.startsWith("https://")?(0,t.jsx)("a",{href:eG.template_url,className:"cfg-link",children:eG.template_url}):eG.template_url:"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:"Import schema version"}),(0,t.jsx)("dd",{className:"text-right",children:eG.import_schema_version??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:"Import operation ID"}),(0,t.jsx)("dd",{className:"text-right break-all",children:eG.import_operation_id??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-y cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:"Imported at"}),(0,t.jsx)("dd",{className:"text-right",children:eG.import_timestamp?j(eG.import_timestamp):"—"})]})]}),(0,t.jsx)(g,{phase:eC,onImport:()=>{e$()}})]})]}),(0,t.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"secondary",children:[(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsx)("h2",{className:"cfg-title mb-3",children:"Launch snapshots"}),0===eZ.length?(0,t.jsx)("p",{className:"text-sm cfg-muted",children:"No launches recorded yet."}):(0,t.jsx)("ul",{className:"space-y-3",children:eZ.map(e=>{let n=e.hash===eX,s=!!ee[e.id];return(0,t.jsxs)("li",{className:"cfg-row",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("p",{className:"text-sm",children:[j(e.created_at)," · ",e.id.slice(0,4),e.transport?` \xb7 ${e.transport}`:null]}),(0,t.jsx)("button",{onClick:()=>et(t=>({...t,[e.id]:!t[e.id]})),"aria-label":s?"Collapse snapshot detail":"Expand snapshot detail",className:"cfg-chevron px-1",children:s?"▾":"▸"})]}),(0,t.jsxs)("p",{className:"mt-1 text-sm",children:[(0,t.jsx)("code",{className:"cfg-code",children:e.hash.slice(0,12)})," ",(0,t.jsx)("button",{onClick:()=>eq(e.id,e.hash),className:"cfg-link text-sm",children:en===e.id?"Copied":"Copy"})]}),(0,t.jsx)("p",{className:"mt-1 text-sm",children:n?(0,t.jsx)("span",{className:"cfg-ok",children:"● Matches current config"}):(0,t.jsx)("span",{className:"cfg-faint",children:"○ Config changed since"})}),s&&(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t cfg-line text-sm",children:[(0,t.jsxs)("p",{className:"cfg-muted break-all",children:[(0,t.jsx)("span",{className:"font-medium",children:"Launch ID:"})," ",e.id]}),(0,t.jsxs)("p",{className:"mt-1 cfg-muted break-all",children:[(0,t.jsx)("span",{className:"font-medium",children:"Hash:"})," ",(0,t.jsx)("code",{className:"cfg-code",children:e.hash})]}),(0,t.jsx)("dl",{className:"mt-2",children:v.map(n=>{let s=e.snapshot[n.key];return(0,t.jsxs)("div",{className:"py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:n.label}),(0,t.jsx)("dd",{className:"whitespace-pre-wrap break-words",children:null==s?(0,t.jsx)("span",{className:"cfg-faint",children:"null"}):Array.isArray(s)?0===s.length?(0,t.jsx)("span",{className:"cfg-faint",children:"(none)"}):(0,t.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:s.map(e=>`- ${e}`).join("\n")}):"boolean"==typeof s?String(s):""===s?(0,t.jsx)("span",{className:"cfg-faint",children:"(empty)"}):(0,t.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:s})})]},n.key)})})]})]},e.id)})})]}),(0,t.jsx)(l,{agentId:eG.id,agentName:eG.name}),(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"cfg-title",children:"Avatar"}),e4]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,t.jsx)(m.default,{config:eO,size:96,title:"Avatar live preview"}),(0,t.jsx)("p",{className:"text-sm cfg-muted",children:"Outline style: the color is the line color, nothing is filled. Pick an option to preview, then Save."})]}),(0,t.jsx)(h,{attribute:"color",label:"Color",options:x.AVATAR_COLORS,current:eO,onPick:eK,className:"mb-3"}),(0,t.jsx)(h,{attribute:"eyes",label:"Eyes",options:x.AVATAR_EYES,current:eO,onPick:eK,className:"mb-3"}),(0,t.jsx)(h,{attribute:"hands",label:"Hands",options:x.AVATAR_HANDS,current:eO,onPick:eK,className:"mb-3"}),(0,t.jsx)(h,{attribute:"accessory",label:"Accessory",options:x.AVATAR_ACCESSORIES,current:eO,onPick:eK}),"error"===ej&&(0,t.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",ek,"."," ",(0,t.jsx)("button",{onClick:eV,className:"underline hover:no-underline",children:"Retry"})]}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)("button",{onClick:eV,disabled:!eU||"saving"===ej,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===ej?"Saving…":"Save"}),(0,t.jsx)("button",{onClick:function(){ey(null),eN("clean"),e_("")},disabled:!eU||"saving"===ej,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,t.jsxs)("section",{className:"cfg-card cfg-danger","aria-labelledby":"cfg-danger-title",children:[(0,t.jsx)("h2",{id:"cfg-danger-title",className:"cfg-title mb-3",children:"Danger zone"}),(0,t.jsx)("p",{className:"text-sm cfg-muted",children:o.DELETE_REMOVES_COPY}),(0,t.jsx)("p",{className:"text-sm cfg-faint mt-2",children:o.DELETE_KEEPS_COPY}),(0,t.jsx)("button",{type:"button",onClick:()=>w(!0),className:"mt-3 delete-btn text-sm w-full sm:w-auto",children:"Delete agent"})]})]})]})]}),_?(0,t.jsx)(r.default,{ids:[eG.id],onCancel:()=>w(!1),onDeleted:e=>y.push(`/?deleted=${Math.max(e.length,1)}`)}):null]})}],13978)},74904,3136,e=>{"use strict";let t=["hermes","cursor","claude","codex","muse"],n={hermes:"Hermes",cursor:"Cursor",claude:"Claude",codex:"Codex",muse:"Muse Code"},s="hermes";function a(e){return t.includes(String(e))?n[e]:String(e??"")}t.join("|"),e.s(["AGENTS",0,t,"AGENT_LABELS",0,n,"DEFAULT_AGENT",0,s,"agentLabel",0,a],3136);let r=t.map(e=>({value:e,label:n[e]}));function i(e){return a((e.agent??"").trim()||s)}function l(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 o(e){return`~/.botmancers/${e}`}let c="~/.botmancers/{agentID}",d=`Default: ${c} — {agentID} is this agent's ID, assigned at creation.`;function u(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,r,"NEW_AGENT_WORKSPACE_HINT",0,d,"WORKSPACE_TEMPLATE",0,c,"agentEventDisplay",0,function(e){let t=String(e??"").trimStart(),n=f.find(e=>t.startsWith(e.prefix));return n?{label:n.label,detail:t.slice(n.prefix.length).trim()}:null},"botAgentLabel",0,i,"botConnectionLabel",0,l,"configWorkspaceHint",0,function(e){return`Default: ${o(e)} — leave blank to use it.`},"defaultWorkdirFor",0,o,"formatClock",0,function(e){let t=new Date(e);return`${u(t.getHours())}:${u(t.getMinutes())}:${u(t.getSeconds())}`},"rosterRuntimeLine",0,function(e){let t=`Agent: ${i(e)} \xb7 `+(l(e)??"No connection");return!1===e.launchable?t+" — see Config":t}],74904)},50814,63352,e=>{"use strict";function t(e){return`${new Date(e).toISOString().slice(0,16).replace("T"," ")} UTC`}function n(e){return e?e.split("/").filter(e=>e.length>0).pop()??null:null}function 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 r(e){return e.toFixed(1).replace(/\.0$/,"")}function i(e){return e.toLocaleString("en-US")}function l(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 o={input_tokens:"Input tokens",output_tokens:"Output tokens",cost_usd:"Cost"};function c(e,t,n){return"cost_usd"===e?l(t):n?i(t):t<1e3?String(t):t<999950?`${r(t/1e3)}k`:t<99995e4?`${r(t/1e6)}M`:`${r(t/1e9)}B`}function d(e){return`${e} ${1===e?"run":"runs"}`}function u(e,t,n=!1){let s=o[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 r=c(e,t.sum,n),i=c(e,t.sum,!0);return"partial"===t.quality?{name:s,text:r,quality:"partial",coverage:`Partial: ${t.known} of ${d(t.total)} reported`,label:`${s}: at least ${i}, partial, reported by ${t.known} of ${d(t.total)}`}:{name:s,text:r,quality:"complete",coverage:`All ${d(t.total)} reported`,label:`${s}: ${i}, reported by all ${d(t.total)}`}}e.s(["SESSION_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"ended",label:"Ended"}],"attemptLabel",0,function(e){let t="source"===e.role?"Started the session":"Resumed the session";return`${t} \xb7 ${e.outcome??"running"}`},"emptySessionsCopy",0,function(e,t,n,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),r=a?`${a} sessions`:"sessions";return`Could not read ${r}: ${e}. ${t}`}if(n&&null===n.synced_at)return`${t} has not synced sessions yet. Refresh to load past sessions.`;let r=n?.out_of_scope_count??0;return r>0?`${r} ${1===r?"session exists":"sessions exist"} outside ${t}'s scope. Widen the scope to see them.`:`${t} has no sessions yet. One appears after a coding run keeps its runtime context.`},"formatSessionDate",0,t,"formatSyncRelativeTime",0,function(e,t=Date.now()){if(null===e)return"never";let n=Math.max(0,t-e);if(n<6e4)return"just now";let 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 r=Math.floor(a/24);return`${r} day${1===r?"":"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},"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),r=[t,n,s];if(r.every(e=>"unavailable"===e.quality))return{text:a,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"===s.quality?"cost not reported":s.text].join(" · "),l=r.some(e=>"partial"===e.quality),o=l||r.some(e=>"unavailable"===e.quality)?"partial":"complete";return{text:i,label:`Reported usage: ${r.map(e=>e.label).join("; ")}`,quality:o,partial:l}},"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:i(e.input_tokens),output:null===e.output_tokens?a:i(e.output_tokens),cost:null===e.cost_usd?a:l(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 f={ask:"Ask from this context",resume:"Resume work here",handoff:"Hand off to…"},m=["queued","extracting","delivering","completed","failed","cancelled"],h=["completed","failed","cancelled"];function p(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 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??{},s=t.source.agent_name,a=t.destination?.agent_name??"the destination Agent",r="string"==typeof n.hop?n.hop:null;switch(e.type){case"created":return"ask"===t.mode?`You asked ${s}'s session a question`:`You handed ${s}'s session to ${a}`;case"hop_queued":if("deliver"===r)return`Handoff queued for ${a}'s new session`;return"extract"===r?`Handoff extraction queued in ${s}'s session`:`Question queued for ${s}'s session`;case"hop_started":if("deliver"===r)return`${a} started a new session`;return"extract"===r?`${s}'s session started extracting the handoff`:`${s}'s session started answering`;case"state_changed":{let e="string"==typeof n.to&&m.includes(n.to)?n.to:null;return e?`Now ${p(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(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,!h.includes(t))?"Cancelling…":p(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 f["continue"===e?"handoff":e]},"sessionDialogUsesPin",0,function(e,t){return"resume"===e||"ask"===e&&"provider"===t},"sessionLabel",0,function(e){return`${e.source.agent_name}'s session “${e.source.session_title}”`},"sessionRowActions",0,function(e){let t;if(e.actions)t=e.actions;else{let n="ended"===e.status?{available:!1,reason:"Ask from this context and Hand off to… are unavailable: this session has ended. Its history stays here."}:e.resumable?{available:!0}:{available:!1,reason:`Ask from this context and Hand off to… are unavailable: Botmancers can’t resume this session under ${e.agent.name}’s current runtime.`},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:`${f.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:f[e],availability:t[e]}))},"stateTone",0,function(e){return"completed"===e?"done":"failed"===e||"cancelled"===e?"stopped":"active"},"submitErrorMessage",0,function(e,t){switch(e){case"session_ended":return"This session has ended and can’t be resumed.";case"session_not_resumable":return"Botmancers can’t resume this session under the Agent’s current runtime.";case"source_session_busy":return"This session already has an exchange in progress. Wait for it or cancel it from its card.";case"agent_unavailable":return t||"That Agent can’t launch yet. Choose its runtime connection and session scope in Config.";case"idempotency_conflict":return"This request changed while it was being sent. Send again.";case"session_missing":return"The runtime no longer has this session. Its history stays here; choose another session.";case"approval_required":return"Resume work here needs your approval of edits. Tick the approval, then send again.";case"authority_not_allowed":return t||"This Agent’s policy doesn’t allow edits in a resumed session. Change it in Config.";case"action_unavailable":return t||"This runtime can’t do that in this session. Choose another action.";case"provider_failed":return"The runtime failed this turn. Nothing moved to another session; try again later.";default:return t||"The exchange could not be started. Your draft is kept; try again."}},"threadHref",0,function(e,t){let n=new URLSearchParams;if(e.thread_agent_id)return n.set("agent",e.thread_agent_id),t&&n.set("exchange",t),`/?${n.toString()}`;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)},22016,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var s={default:function(){return x},useLinkStatus:function(){return v}};for(var a in s)Object.defineProperty(n,a,{enumerable:!0,get:s[a]});let r=e.r(90809),i=e.r(43476),l=r._(e.r(71645)),o=e.r(95057),c=e.r(8372),d=e.r(18581),u=e.r(18967),f=e.r(5550),m=e.r(88540),h=e.r(91949),p=e.r(73668),g=e.r(9396);function x(t){var n;let s,a,r,[x,v]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),y=(0,l.useRef)(null),{href:j,as:N,children:k,prefetch:_=null,passHref:w,replace:S,shallow:C,scroll:$,onClick:A,onMouseEnter:T,onTouchStart:E,legacyBehavior:R=!1,onNavigate:I,transitionTypes:D,ref:P,unstable_dynamicOnHover:L,...O}=t;s=k,R&&("string"==typeof s||"number"==typeof s)&&(s=(0,i.jsx)("a",{children:s}));let U=l.default.useContext(c.AppRouterContext),F=!1!==_,q=!1===_?"none":!0===_?"full":"auto",M="none"!==q?"auto"===q?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,H="string"==typeof(n=N||j)?n:(0,o.formatUrl)(n);if(R){if(s?.$$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=l.default.Children.only(s)}let B=R?a&&"object"==typeof a&&a.ref:P,W,K=l.default.useCallback(e=>(null!==U&&(y.current=(0,h.mountLinkInstance)(e,H,U,M,F,v,W)),()=>{y.current&&((0,h.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,h.unmountPrefetchableInstance)(e)}),[F,H,U,M,v,W]),V={ref:(0,d.useMergedRef)(K,B),onClick(t){R||"function"!=typeof A||A(t),R&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!U||t.defaultPrevented||function(t,n,s,a,r,i,o,c="none"){if("u">typeof window){let d,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(n)){a&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(99781);l.default.startTransition(()=>{f(n,a?"replace":"push",!1===r?m.ScrollBehavior.NoScroll:m.ScrollBehavior.Default,s.current,o,c)})}}(t,H,y,S,$,I,D,q)},onMouseEnter(e){R||"function"!=typeof T||T(e),R&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),U&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===L)},onTouchStart:function(e){R||"function"!=typeof E||E(e),R&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),U&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===L)}};return(0,u.isAbsoluteUrl)(H)?V.href=H:R&&!w&&("a"!==a.type||"href"in a.props)||(V.href=(0,f.addBasePath)(H)),r=R?l.default.cloneElement(a,V):(0,i.jsx)("a",{...O,...V,children:s}),(0,i.jsx)(b.Provider,{value:x,children:r})}let b=(0,l.createContext)(h.IDLE_LINK_STATUS),v=()=>(0,l.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 a}});let s=e.r(71645);function a(e,t){let n=(0,s.useRef)(null),a=(0,s.useRef)(null);return(0,s.useCallback)(s=>{if(null===s){let e=n.current;e&&(n.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(n.current=r(e,s)),t&&(a.current=r(t,s))},[e,t])}function r(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 r}});let s=e.r(18967),a=e.r(52817);function r(e){if(!(0,s.isAbsoluteUrl)(e))return!0;try{let t=(0,s.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,a.hasBasePath)(n.pathname)}catch(e){return!1}}},98183,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var s={assign:function(){return o},searchParamsToUrlQuery:function(){return r},urlQueryToSearchParams:function(){return l}};for(var a in s)Object.defineProperty(n,a,{enumerable:!0,get:s[a]});function r(e){let t={};for(let[n,s]of e.entries()){let e=t[n];void 0===e?t[n]=s:Array.isArray(e)?e.push(s):t[n]=[e,s]}return t}function i(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[n,s]of Object.entries(e))if(Array.isArray(s))for(let e of s)t.append(n,i(e));else t.set(n,i(s));return t}function o(e,...t){for(let n of t){for(let t of n.keys())e.delete(t);for(let[t,s]of n.entries())e.append(t,s)}return e}},95057,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var s={formatUrl:function(){return l},formatWithValidation:function(){return c},urlObjectKeys:function(){return o}};for(var a in s)Object.defineProperty(n,a,{enumerable:!0,get:s[a]});let r=e.r(90809)._(e.r(98183)),i=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:n}=e,s=e.protocol||"",a=e.pathname||"",l=e.hash||"",o=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)),o&&"object"==typeof o&&(o=String(r.urlQueryToSearchParams(o)));let d=e.search||o&&`?${o}`||"";return s&&!s.endsWith(":")&&(s+=":"),e.slashes||(!s||i.test(s))&&!1!==c?(c="//"+(c||""),a&&"/"!==a[0]&&(a="/"+a)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),d&&"?"!==d[0]&&(d="?"+d),a=a.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${s}${c}${a}${d}${l}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return l(e)}},18967,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var s={DecodeError:function(){return x},MiddlewareNotFoundError:function(){return j},MissingStaticPage:function(){return y},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return p},ST:function(){return g},WEB_VITALS:function(){return r},execOnce:function(){return i},getDisplayName:function(){return u},getLocationOrigin:function(){return c},getURL:function(){return d},isAbsoluteUrl:function(){return o},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return m},stringifyError:function(){return N}};for(var a in s)Object.defineProperty(n,a,{enumerable:!0,get:s[a]});let r=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,n=!1;return(...s)=>(n||(n=!0,t=e(...s)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,o=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&l.test(e)};function c(){let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?":"+n:""}`}function d(){let{href:e}=window.location,t=c();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function m(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let s=await e.getInitialProps(t);if(n&&f(n))return s;if(!s)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${s}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return s}let p="u">typeof performance,g=p&&["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 j extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function N(e){return JSON.stringify({message:e.message,stack:e.stack})}},18566,(e,t,n)=>{t.exports=e.r(76562)}]);
@@ -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 j=e=>{window.history.pushState(null,"",e?`/exchanges?id=${encodeURIComponent(e)}`:"/exchanges"),window.dispatchEvent(new Event(i))},$=e?(0,s.ledgerRows)(e,p):[],w=(0,s.ledgerView)(e,e?"":u,$),N=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"}),N.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?`${$.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:$.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:()=>j(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:()=>j(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},"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)return n.set("agent",e.thread_agent_id),t&&n.set("exchange",t),`/?${n.toString()}`;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:j,children:$,prefetch:w=null,passHref:N,replace:k,shallow:C,scroll:S,onClick:E,onMouseEnter:T,onTouchStart:L,legacyBehavior:R=!1,onNavigate:A,transitionTypes:I,ref:O,unstable_dynamicOnHover:P,...U}=t;a=$,R&&("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,B="string"==typeof(n=j||_)?n:(0,l.formatUrl)(n);if(R){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 H=R?r&&"object"==typeof r&&r.ref:O,K,Q=o.default.useCallback(e=>(null!==q&&(y.current=(0,p.mountLinkInstance)(e,B,q,M,D,v,K)),()=>{y.current&&((0,p.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,p.unmountPrefetchableInstance)(e)}),[D,B,q,M,v,K]),z={ref:(0,u.useMergedRef)(Q,H),onClick(t){R||"function"!=typeof E||E(t),R&&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,B,y,k,S,A,I,F)},onMouseEnter(e){R||"function"!=typeof T||T(e),R&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),q&&D&&(0,p.onNavigationIntent)(e.currentTarget,!0===P)},onTouchStart:function(e){R||"function"!=typeof L||L(e),R&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),q&&D&&(0,p.onNavigationIntent)(e.currentTarget,!0===P)}};return(0,d.isAbsoluteUrl)(B)?z.href=B:R&&!N&&("a"!==r.type||"href"in r.props)||(z.href=(0,h.addBasePath)(B)),s=R?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 j}};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 j(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,32545,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(22016),o=e.i(74904);e.s(["default",0,function(){let[e,a]=(0,r.useState)(null),[i,l]=(0,r.useState)(0),[u,s]=(0,r.useState)(!1),[c,f]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let e=!1;return fetch("/api/bots/availability",{cache:"no-store"}).then(async t=>{if(!t.ok)throw Error("request failed");let r=await t.json();if(e)return;let n=Array.isArray(r.agents)?r.agents:null;if(!n)throw Error("request failed");a(new Set(n.filter(e=>e.launchable).map(e=>e.agent))),l(Date.now()),s(!1)}).catch(()=>{e||s(!0)}),()=>{e=!0}},[c]),(0,t.jsx)("div",{className:"cfg-page",children:(0,t.jsxs)("div",{className:"max-w-3xl mx-auto",children:[(0,t.jsx)(n.default,{href:"/",className:"cfg-link cfg-back text-sm",children:"← Back to chat"}),(0,t.jsxs)("header",{className:"mt-3 mb-6",children:[(0,t.jsx)("h1",{className:"text-xl font-bold",children:"Settings"}),(0,t.jsx)("p",{className:"text-sm cfg-faint",children:"Local runtime status for every agent in this Botmancers."})]}),(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"cfg-title",children:"Local runtimes"}),null!==e?(0,t.jsxs)("span",{className:"text-sm cfg-faint",children:["Checked ",(0,o.formatClock)(i)]}):null]}),u&&null===e?(0,t.jsxs)("p",{className:"text-sm cfg-muted",children:["Couldn't check the local runtimes."," ",(0,t.jsx)("button",{onClick:()=>f(e=>e+1),className:"cfg-link",children:"Retry"})]}):null===e?(0,t.jsx)("div",{className:"h-10 rounded-lg animate-pulse cfg-skel"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dl",{className:"text-sm",children:o.AGENT_OPTIONS.map(r=>{let n=e.has(r.value);return(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-muted",children:r.label}),(0,t.jsx)("dd",{className:n?"cfg-ok":"cfg-faint",children:n?"● Ready":"○ Not available"})]},r.value)})}),(0,t.jsx)("p",{className:"mt-2 text-xs cfg-faint",children:"Coding Agents need their provider CLI installed and signed in on this computer; Hermes needs the gateway key. A runtime that is not available here cannot launch an Agent until it is fixed."}),(0,t.jsx)("button",{onClick:()=>f(e=>e+1),className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Re-check"})]})]})]})})}])},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 o(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,o],3136);let a=t.map(e=>({value:e,label:r[e]}));function i(e){return o((e.agent??"").trim()||n)}function l(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 u(e){return`~/.botmancers/${e}`}let s="~/.botmancers/{agentID}",c=`Default: ${s} — {agentID} is this agent's ID, assigned at creation.`;function f(e){return String(e).padStart(2,"0")}let d=[{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,a,"NEW_AGENT_WORKSPACE_HINT",0,c,"WORKSPACE_TEMPLATE",0,s,"agentEventDisplay",0,function(e){let t=String(e??"").trimStart(),r=d.find(e=>t.startsWith(e.prefix));return r?{label:r.label,detail:t.slice(r.prefix.length).trim()}:null},"botAgentLabel",0,i,"botConnectionLabel",0,l,"configWorkspaceHint",0,function(e){return`Default: ${u(e)} — leave blank to use it.`},"defaultWorkdirFor",0,u,"formatClock",0,function(e){let t=new Date(e);return`${f(t.getHours())}:${f(t.getMinutes())}:${f(t.getSeconds())}`},"rosterRuntimeLine",0,function(e){let t=`Agent: ${i(e)} \xb7 `+(l(e)??"No connection");return!1===e.launchable?t+" — see Config":t}],74904)},22016,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return b},useLinkStatus:function(){return x}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(90809),i=e.r(43476),l=a._(e.r(71645)),u=e.r(95057),s=e.r(8372),c=e.r(18581),f=e.r(18967),d=e.r(5550),p=e.r(88540),h=e.r(91949),m=e.r(73668),g=e.r(9396);function b(t){var r;let n,o,a,[b,x]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),v=(0,l.useRef)(null),{href:j,as:E,children:N,prefetch:S=null,passHref:k,replace:_,shallow:A,scroll:P,onClick:C,onMouseEnter:T,onTouchStart:O,legacyBehavior:w=!1,onNavigate:L,transitionTypes:R,ref:D,unstable_dynamicOnHover:$,...I}=t;n=N,w&&("string"==typeof n||"number"==typeof n)&&(n=(0,i.jsx)("a",{children:n}));let M=l.default.useContext(s.AppRouterContext),U=!1!==S,B=!1===S?"none":!0===S?"full":"auto",F="none"!==B?"auto"===B?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,K="string"==typeof(r=E||j)?r:(0,u.formatUrl)(r);if(w){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});o=l.default.Children.only(n)}let W=w?o&&"object"==typeof o&&o.ref:D,G,z=l.default.useCallback(e=>(null!==M&&(v.current=(0,h.mountLinkInstance)(e,K,M,F,U,x,G)),()=>{v.current&&((0,h.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,h.unmountPrefetchableInstance)(e)}),[U,K,M,F,x,G]),H={ref:(0,c.useMergedRef)(z,W),onClick(t){w||"function"!=typeof C||C(t),w&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!M||t.defaultPrevented||function(t,r,n,o,a,i,u,s="none"){if("u">typeof window){let c,{nodeName:f}=t.currentTarget;if("A"===f.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)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(99781);l.default.startTransition(()=>{d(r,o?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,u,s)})}}(t,K,v,_,P,L,R,B)},onMouseEnter(e){w||"function"!=typeof T||T(e),w&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),M&&U&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)},onTouchStart:function(e){w||"function"!=typeof O||O(e),w&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),M&&U&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)}};return(0,f.isAbsoluteUrl)(K)?H.href=K:w&&!k&&("a"!==o.type||"href"in o.props)||(H.href=(0,d.addBasePath)(K)),a=w?l.default.cloneElement(o,H):(0,i.jsx)("a",{...I,...H,children:n}),(0,i.jsx)(y.Provider,{value:b,children:a})}let y=(0,l.createContext)(h.IDLE_LINK_STATUS),x=()=>(0,l.useContext)(y);("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)},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(71645);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=a(e,n)),t&&(o.current=a(t,n))},[e,t])}function a(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)},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(18967),o=e.r(52817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return u},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function a(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 i(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(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,i(e));else t.set(r,i(n));return t}function u(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 l},formatWithValidation:function(){return s},urlObjectKeys:function(){return u}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(90809)._(e.r(98183)),i=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",l=e.hash||"",u=e.query||"",s=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?s=t+e.host:r&&(s=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(s+=":"+e.port)),u&&"object"==typeof u&&(u=String(a.urlQueryToSearchParams(u)));let c=e.search||u&&`?${u}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||i.test(n))&&!1!==s?(s="//"+(s||""),o&&"/"!==o[0]&&(o="/"+o)):s||(s=""),l&&"#"!==l[0]&&(l="#"+l),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${s}${o}${c}${l}`}let u=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function s(e){return l(e)}},18967,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return b},MiddlewareNotFoundError:function(){return j},MissingStaticPage:function(){return v},NormalizeError:function(){return y},PageNotFoundError:function(){return x},SP:function(){return m},ST:function(){return g},WEB_VITALS:function(){return a},execOnce:function(){return i},getDisplayName:function(){return f},getLocationOrigin:function(){return s},getURL:function(){return c},isAbsoluteUrl:function(){return u},isResSent:function(){return d},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return E}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,u=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&l.test(e)};function s(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=s();return e.substring(t.length)}function f(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(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&&d(r))return n;if(!n)throw Object.defineProperty(Error(`"${f(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 b extends Error{}class y extends Error{}class x extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class j extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function E(e){return JSON.stringify({message:e.message,stack:e.stack})}}]);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "botmancers",
3
- "version": "0.6.1",
4
- "commit": "37fd03570d80dad5a36f4ce5e901641aa2dd4295",
3
+ "version": "0.8.0",
4
+ "commit": "a2e83251202536e4873bc876544841cfc5e2f80d",
5
5
  "dirty": false,
6
6
  "next": "16.3.8"
7
7
  }
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "botmancers-app",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
4
4
  "private": true,
5
5
  "type": "commonjs"
6
6
  }
package/app/server.js CHANGED
@@ -9,7 +9,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
9
9
  const hostname = process.env.HOSTNAME || '0.0.0.0'
10
10
 
11
11
  let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
12
- const nextConfig = {"env":{"BOTMANCERS_BUILD_VERSION":"0.6.1","BOTMANCERS_BUILD_COMMIT":"37fd03570d80dad5a36f4ce5e901641aa2dd4295"},"webpack":null,"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"instrumentationClientInject":[],"poweredByHeader":true,"compress":true,"images":{"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":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":__dirname,"enablePrerenderSourceMaps":true,"cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"appNewScrollHandler":true,"coldCacheBadge":false,"devValidationWorker":true,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"dynamicOnHover":false,"useOffline":false,"varyParams":true,"optimisticRouting":true,"instrumentationClientRouterTransitionEvents":false,"prefetchInlining":{"maxSize":2048,"maxBundleSize":10240},"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":9,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptOperationCache":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"devMemoryThresholdRestart":true,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"requestInsights":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"useTypeScriptCli":true,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":true,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"serverComponentsHmrCancellation":false,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":true,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","turbopackMemoryEvictionMode":"auto","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"useCacheTimeout":54,"instantInsights":{"validationLevel":"warning"},"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","serverExternalPackages":["@slack/socket-mode","@slack/web-api"],"repoRoot":__dirname,"turbopack":{"root":__dirname},"distDirRoot":".next","_originalRewrites":{"beforeFiles":[],"afterFiles":[{"source":"/favicon.ico","destination":"/brand/botmancers-logo-filled-64.png"}],"fallback":[]}}
12
+ const nextConfig = {"env":{"BOTMANCERS_BUILD_VERSION":"0.8.0","BOTMANCERS_BUILD_COMMIT":"a2e83251202536e4873bc876544841cfc5e2f80d"},"webpack":null,"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"instrumentationClientInject":[],"poweredByHeader":true,"compress":true,"images":{"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":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":__dirname,"enablePrerenderSourceMaps":true,"cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"appNewScrollHandler":true,"coldCacheBadge":false,"devValidationWorker":true,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"dynamicOnHover":false,"useOffline":false,"varyParams":true,"optimisticRouting":true,"instrumentationClientRouterTransitionEvents":false,"prefetchInlining":{"maxSize":2048,"maxBundleSize":10240},"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":9,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptOperationCache":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"devMemoryThresholdRestart":true,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"requestInsights":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"useTypeScriptCli":true,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":true,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"serverComponentsHmrCancellation":false,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":true,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","turbopackMemoryEvictionMode":"auto","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"useCacheTimeout":54,"instantInsights":{"validationLevel":"warning"},"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","serverExternalPackages":["@slack/socket-mode","@slack/web-api"],"repoRoot":__dirname,"turbopack":{"root":__dirname},"distDirRoot":".next","_originalRewrites":{"beforeFiles":[],"afterFiles":[{"source":"/favicon.ico","destination":"/brand/botmancers-logo-filled-64.png"}],"fallback":[]}}
13
13
 
14
14
  process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
15
15
 
package/dist/cli.d.ts CHANGED
@@ -13,7 +13,7 @@ export interface CliIo {
13
13
  export declare const PRODUCT_COMMANDS: readonly ["setup", "start", "stop", "status", "doctor", "open"];
14
14
  export declare const INSTALL_COMMANDS: readonly ["install", "upgrade"];
15
15
  export declare const UPDATE_WORKER_COMMAND = "__update-check";
16
- export declare const PRODUCT_HELP = "Usage: botmancers <command>\n\nRun Botmancers (UI, API, core engine, and MCP bridge) from this package:\n\n setup Create BOTMANCERS_HOME (owner-only) and generate the\n bridge credentials; prints Hermes and Agent Deck steps;\n refreshes the clients set up with --client\n setup --client codex|cursor|claude [--remove]\n Connect that client to the MCP bridge and install the\n optional botmancers-collaboration skill (or remove both);\n files you edited are never overwritten\n start [--daemon] [--open] Start the UI/core on 127.0.0.1:3333 and the MCP bridge\n on 127.0.0.1:3332 under one supervisor\n stop Stop the supervisor, core, and bridge\n status Report healthy / degraded / stopped, versions, endpoints\n doctor Check the installation, home, ports, Hermes, Agent Deck\n open Open the UI in a browser\n mcp [options] Run only the MCP bridge (same as bare `botmancers`)\n install [--to VERSION] Managed install into ~/.botmancers/versions with the\n ~/.local/bin/botmancers launcher (--help for options)\n upgrade [--check] [--to VERSION] [--yes]\n Update this installation (managed or npm-global)\n\nManaged installs update themselves: at most one npm check a day, a background\ndownload, activation at the next `botmancers start` once nothing is running.\nBOTMANCERS_DISABLE_AUTOUPDATER=1 turns that off; `botmancers upgrade` still works.\n\nEnvironment: BOTMANCERS_HOME (default ~/.botmancers), BOTMANCERS_UI_PORT,\nBOTMANCERS_MCP_PORT. Variables exported in your shell (HERMES_*, BOTMANCERS_DB_PATH,\n...) take precedence over <home>/config/core.env.\n\nExit codes: 0 ok, 1 degraded or check failed, 2 usage, 3 not running,\n6 port in use, 7 core or bridge failed to start, 8 packaged app incomplete,\n9 home not writable, 10 not set up (run botmancers setup), 11 the client is not\ninstalled, 12 client files conflict (setup --client changed nothing).\n";
16
+ export declare const PRODUCT_HELP = "Usage: botmancers <command>\n\nRun Botmancers (UI, API, core engine, and MCP bridge) from this package:\n\n setup Create BOTMANCERS_HOME (owner-only) and generate the\n bridge credentials; prints Hermes and provider steps;\n refreshes the clients set up with --client\n setup --client codex|cursor|claude [--remove]\n Connect that client to the MCP bridge and install the\n optional botmancers-collaboration skill (or remove both);\n files you edited are never overwritten\n start [--daemon] [--open] Start the UI/core on 127.0.0.1:3333 and the MCP bridge\n on 127.0.0.1:3332 under one supervisor\n stop Stop the supervisor, core, and bridge\n status Report healthy / degraded / stopped, versions, endpoints\n doctor Check the installation, home, ports, Hermes, provider CLIs\n open Open the UI in a browser\n mcp [options] Run only the MCP bridge (same as bare `botmancers`)\n install [--to VERSION] Managed install into ~/.botmancers/versions with the\n ~/.local/bin/botmancers launcher (--help for options)\n upgrade [--check] [--to VERSION] [--yes]\n Update this installation (managed or npm-global)\n\nManaged installs update themselves: at most one npm check a day, a background\ndownload, activation at the next `botmancers start` once nothing is running.\nBOTMANCERS_DISABLE_AUTOUPDATER=1 turns that off; `botmancers upgrade` still works.\n\nEnvironment: BOTMANCERS_HOME (default ~/.botmancers), BOTMANCERS_UI_PORT,\nBOTMANCERS_MCP_PORT. Variables exported in your shell (HERMES_*, BOTMANCERS_DB_PATH,\n...) take precedence over <home>/config/core.env.\n\nExit codes: 0 ok, 1 degraded or check failed, 2 usage, 3 not running,\n6 port in use, 7 core or bridge failed to start, 8 packaged app incomplete,\n9 home not writable, 10 not set up (run botmancers setup), 11 the client is not\ninstalled, 12 client files conflict (setup --client changed nothing).\n";
17
17
  export declare function productMain(command: typeof PRODUCT_COMMANDS[number], argv: string[], env: NodeJS.ProcessEnv, io?: CliIo): Promise<number>;
18
18
  export declare function main(argv: string[], env: NodeJS.ProcessEnv, io?: CliIo): Promise<number | 'serving'>;
19
19
  export declare function bridgeMain(argv: string[], env: NodeJS.ProcessEnv, io?: CliIo): Promise<number | 'serving'>;
package/dist/cli.js CHANGED
@@ -39,7 +39,7 @@ export const PRODUCT_HELP = `Usage: botmancers <command>
39
39
  Run Botmancers (UI, API, core engine, and MCP bridge) from this package:
40
40
 
41
41
  setup Create BOTMANCERS_HOME (owner-only) and generate the
42
- bridge credentials; prints Hermes and Agent Deck steps;
42
+ bridge credentials; prints Hermes and provider steps;
43
43
  refreshes the clients set up with --client
44
44
  setup --client codex|cursor|claude [--remove]
45
45
  Connect that client to the MCP bridge and install the
@@ -49,7 +49,7 @@ Run Botmancers (UI, API, core engine, and MCP bridge) from this package:
49
49
  on 127.0.0.1:3332 under one supervisor
50
50
  stop Stop the supervisor, core, and bridge
51
51
  status Report healthy / degraded / stopped, versions, endpoints
52
- doctor Check the installation, home, ports, Hermes, Agent Deck
52
+ doctor Check the installation, home, ports, Hermes, provider CLIs
53
53
  open Open the UI in a browser
54
54
  mcp [options] Run only the MCP bridge (same as bare \`botmancers\`)
55
55
  install [--to VERSION] Managed install into ~/.botmancers/versions with the
package/dist/product.d.ts CHANGED
@@ -16,7 +16,6 @@ export declare const PRODUCT_EXIT: {
16
16
  };
17
17
  export declare const STARTUP_TIMEOUT_ENV = "BOTMANCERS_STARTUP_TIMEOUT_MS";
18
18
  export declare const BROWSER_ENV = "BOTMANCERS_BROWSER";
19
- export declare const AGENT_DECK_URL_ENV = "BOTMANCERS_AGENT_DECK_URL";
20
19
  export declare const CORE_HEALTH_PATH = "/api/health";
21
20
  export declare const BRIDGE_HEALTH_PATH = "/healthz";
22
21
  export interface ProductIo {
package/dist/product.js CHANGED
@@ -5,7 +5,7 @@
5
5
  // start [--daemon] [--open] launch (idempotent: an already healthy product is left alone)
6
6
  // stop terminate the supervisor and both children
7
7
  // status healthy / degraded / stopped, with versions and endpoints
8
- // doctor preflight checks, including optional Hermes and Agent Deck
8
+ // doctor preflight checks, including optional Hermes and provider CLIs
9
9
  // open open the UI in a browser
10
10
  //
11
11
  // Health: healthy only when the supervisor and both children are alive, the
@@ -42,11 +42,9 @@ export const PRODUCT_EXIT = {
42
42
  };
43
43
  export const STARTUP_TIMEOUT_ENV = 'BOTMANCERS_STARTUP_TIMEOUT_MS';
44
44
  export const BROWSER_ENV = 'BOTMANCERS_BROWSER';
45
- export const AGENT_DECK_URL_ENV = 'BOTMANCERS_AGENT_DECK_URL';
46
45
  export const CORE_HEALTH_PATH = '/api/health';
47
46
  export const BRIDGE_HEALTH_PATH = '/healthz';
48
47
  const DEFAULT_STARTUP_TIMEOUT_MS = 60_000;
49
- const DEFAULT_AGENT_DECK_URL = 'http://127.0.0.1:1111';
50
48
  export class UsageError extends Error {
51
49
  }
52
50
  export function productContext(env, io) {
@@ -901,15 +899,6 @@ function onPath(command, env) {
901
899
  }
902
900
  return null;
903
901
  }
904
- async function reachable(url) {
905
- try {
906
- await fetch(url, { signal: AbortSignal.timeout(1500), redirect: 'manual' });
907
- return true;
908
- }
909
- catch {
910
- return false;
911
- }
912
- }
913
902
  // NOT-519: the Slack relay line. A running core reports its state on the
914
903
  // read-only GET /api/health (lib/slack-runtime slackRuntimeStatus: state,
915
904
  // reason, connections, never a token); doctor never sends Slack anything and
@@ -1063,16 +1052,17 @@ export async function doctor(ctx) {
1063
1052
  else
1064
1053
  add('warn', 'hermes', `Hermes is not configured: conversational turns post a Hermes error until HERMES_API_SERVER_KEY is set in ${ctx.paths.coreEnv}.`);
1065
1054
  add(...slackDoctorLine(view.core?.ok ? view.core.body : undefined, core, !!view.record && !!view.core?.ok));
1066
- const deckUrl = (ctx.env[AGENT_DECK_URL_ENV] ?? '').trim() || DEFAULT_AGENT_DECK_URL;
1067
- const deckBin = onPath('agent-deck', ctx.env);
1068
- if (!deckBin)
1069
- add('warn', 'agent-deck', 'Agent Deck is unavailable: `agent-deck` is not on PATH; coding-agent runs cannot launch.');
1070
- else if (!(await reachable(deckUrl)))
1071
- add('warn', 'agent-deck', `Agent Deck is unavailable: ${deckBin} found, but its server at ${deckUrl} is not answering.`);
1072
- else if (!(core.AGENT_DECK_RUN_TOKEN ?? '').trim())
1073
- add('warn', 'agent-deck', `Agent Deck is reachable at ${deckUrl}, but AGENT_DECK_RUN_TOKEN is not set in ${ctx.paths.coreEnv}.`);
1074
- else
1075
- add('ok', 'agent-deck', `agent-deck on PATH, server ${deckUrl} reachable, run token configured`);
1055
+ const providers = ['claude', 'codex', 'cursor', 'muse'];
1056
+ const found = providers.filter(name => onPath(name, ctx.env));
1057
+ if (found.length === 0) {
1058
+ add('warn', 'providers', 'No coding-agent CLI is on PATH (looked for claude, codex, cursor, muse); coding-agent runs cannot launch until one is installed and signed in.');
1059
+ }
1060
+ else if (found.length < providers.length) {
1061
+ add('warn', 'providers', `Coding-agent CLIs on PATH: ${found.join(', ')}; not found: ${providers.filter(name => !found.includes(name)).join(', ')}.`);
1062
+ }
1063
+ else {
1064
+ add('ok', 'providers', 'claude, codex, cursor, and muse are all on PATH.');
1065
+ }
1076
1066
  // MCP clients connected by `setup --client` and their skill (optional: only warn).
1077
1067
  for (const [level, name, detail] of clientDoctorLines(ctx.env, ctx.paths, mcpTarget(ctx.paths, ctx.mcpPort)))
1078
1068
  add(level, name, detail);