botmancers 0.6.1 → 0.7.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 (244) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +13 -12
  3. package/app/.next/BUILD_ID +1 -1
  4. package/app/.next/app-path-routes-manifest.json +0 -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 +0 -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 +2 -2
  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]/share-policy/route.js +3 -3
  30. package/app/.next/server/app/api/bots/[id]/share-policy/route.js.nft.json +1 -1
  31. package/app/.next/server/app/api/bots/[id]/skill/route.js.nft.json +1 -1
  32. package/app/.next/server/app/api/bots/availability/route.js +3 -2
  33. package/app/.next/server/app/api/bots/availability/route.js.nft.json +1 -1
  34. package/app/.next/server/app/api/bots/delete-preview/route.js.nft.json +1 -1
  35. package/app/.next/server/app/api/bots/import/route.js.nft.json +1 -1
  36. package/app/.next/server/app/api/bots/manage/route.js.nft.json +1 -1
  37. package/app/.next/server/app/api/bots/name-migrations/route.js.nft.json +1 -1
  38. package/app/.next/server/app/api/bots/route.js +5 -5
  39. package/app/.next/server/app/api/bots/route.js.nft.json +1 -1
  40. package/app/.next/server/app/api/conversations/[id]/approve/route.js.nft.json +1 -1
  41. package/app/.next/server/app/api/conversations/[id]/deny/route.js.nft.json +1 -1
  42. package/app/.next/server/app/api/conversations/[id]/draft/route.js.nft.json +1 -1
  43. package/app/.next/server/app/api/conversations/[id]/messages/[messageId]/stop/route.js.nft.json +1 -1
  44. package/app/.next/server/app/api/conversations/[id]/messages/route.js +5 -5
  45. package/app/.next/server/app/api/conversations/[id]/messages/route.js.nft.json +1 -1
  46. package/app/.next/server/app/api/conversations/[id]/route.js.nft.json +1 -1
  47. package/app/.next/server/app/api/conversations/[id]/stop/route.js +5 -5
  48. package/app/.next/server/app/api/conversations/[id]/stop/route.js.nft.json +1 -1
  49. package/app/.next/server/app/api/conversations/route.js.nft.json +1 -1
  50. package/app/.next/server/app/api/exchanges/[id]/cancel/route.js +2 -2
  51. package/app/.next/server/app/api/exchanges/[id]/cancel/route.js.nft.json +1 -1
  52. package/app/.next/server/app/api/exchanges/[id]/route.js +3 -3
  53. package/app/.next/server/app/api/exchanges/[id]/route.js.nft.json +1 -1
  54. package/app/.next/server/app/api/exchanges/route.js +3 -3
  55. package/app/.next/server/app/api/exchanges/route.js.nft.json +1 -1
  56. package/app/.next/server/app/api/files/[name]/route.js.nft.json +1 -1
  57. package/app/.next/server/app/api/groups/route.js.nft.json +1 -1
  58. package/app/.next/server/app/api/health/route.js +3 -3
  59. package/app/.next/server/app/api/health/route.js.nft.json +1 -1
  60. package/app/.next/server/app/api/mcp/route.js.nft.json +1 -1
  61. package/app/.next/server/app/api/messages/[id]/between/route.js.nft.json +1 -1
  62. package/app/.next/server/app/api/runtime-connections/route.js.nft.json +1 -1
  63. package/app/.next/server/app/api/service-grants/route.js.nft.json +1 -1
  64. package/app/.next/server/app/api/shares/[shareRef]/revoke/route.js +3 -3
  65. package/app/.next/server/app/api/shares/[shareRef]/revoke/route.js.nft.json +1 -1
  66. package/app/.next/server/app/api/shares/route.js +3 -3
  67. package/app/.next/server/app/api/shares/route.js.nft.json +1 -1
  68. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js +3 -3
  69. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js.nft.json +1 -1
  70. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js +3 -3
  71. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js.nft.json +1 -1
  72. package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js +2 -2
  73. package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js.nft.json +1 -1
  74. package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js +3 -3
  75. package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js.nft.json +1 -1
  76. package/app/.next/server/app/api/v0/agents/[agentId]/route.js +3 -3
  77. package/app/.next/server/app/api/v0/agents/[agentId]/route.js.nft.json +1 -1
  78. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js +3 -3
  79. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js.nft.json +1 -1
  80. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js +3 -3
  81. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js.nft.json +1 -1
  82. package/app/.next/server/app/api/v0/agents/route.js +3 -3
  83. package/app/.next/server/app/api/v0/agents/route.js.nft.json +1 -1
  84. package/app/.next/server/app/api/v0/capabilities/route.js +3 -3
  85. package/app/.next/server/app/api/v0/capabilities/route.js.nft.json +1 -1
  86. package/app/.next/server/app/api/v0/conversations/[id]/route.js +2 -2
  87. package/app/.next/server/app/api/v0/conversations/[id]/route.js.nft.json +1 -1
  88. package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js +3 -3
  89. package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js.nft.json +1 -1
  90. package/app/.next/server/app/api/v0/exchanges/[id]/route.js +3 -3
  91. package/app/.next/server/app/api/v0/exchanges/[id]/route.js.nft.json +1 -1
  92. package/app/.next/server/app/api/v0/exchanges/route.js +3 -3
  93. package/app/.next/server/app/api/v0/exchanges/route.js.nft.json +1 -1
  94. package/app/.next/server/app/api/v0/mcp/route.js +3 -3
  95. package/app/.next/server/app/api/v0/mcp/route.js.nft.json +1 -1
  96. package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js +3 -3
  97. package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js.nft.json +1 -1
  98. package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js +3 -3
  99. package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js.nft.json +1 -1
  100. package/app/.next/server/app/api/v0/pins/[pinRef]/route.js +3 -3
  101. package/app/.next/server/app/api/v0/pins/[pinRef]/route.js.nft.json +1 -1
  102. package/app/.next/server/app/api/v0/requests/[id]/route.js +2 -2
  103. package/app/.next/server/app/api/v0/requests/[id]/route.js.nft.json +1 -1
  104. package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js +3 -3
  105. package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js.nft.json +1 -1
  106. package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js +3 -3
  107. package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js.nft.json +1 -1
  108. package/app/.next/server/app/api/v0/sessions/[ref]/shares/route.js +3 -3
  109. package/app/.next/server/app/api/v0/sessions/[ref]/shares/route.js.nft.json +1 -1
  110. package/app/.next/server/app/api/v0/shares/[shareRef]/revoke/route.js +3 -3
  111. package/app/.next/server/app/api/v0/shares/[shareRef]/revoke/route.js.nft.json +1 -1
  112. package/app/.next/server/app/api/v0/shares/[shareRef]/route.js +3 -3
  113. package/app/.next/server/app/api/v0/shares/[shareRef]/route.js.nft.json +1 -1
  114. package/app/.next/server/app/api/v0/shares/current/route.js +3 -3
  115. package/app/.next/server/app/api/v0/shares/current/route.js.nft.json +1 -1
  116. package/app/.next/server/app/api/v0/shares/route.js +3 -3
  117. package/app/.next/server/app/api/v0/shares/route.js.nft.json +1 -1
  118. package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js +2 -2
  119. package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js.nft.json +1 -1
  120. package/app/.next/server/app/api/wakes/[id]/decision/route.js +2 -2
  121. package/app/.next/server/app/api/wakes/[id]/decision/route.js.nft.json +1 -1
  122. package/app/.next/server/app/api/wakes/[id]/retry/route.js +2 -2
  123. package/app/.next/server/app/api/wakes/[id]/retry/route.js.nft.json +1 -1
  124. package/app/.next/server/app/bots/[id]/config/page.js.nft.json +1 -1
  125. package/app/.next/server/app/bots/[id]/config/page_client-reference-manifest.js +1 -1
  126. package/app/.next/server/app/exchanges/page.js.nft.json +1 -1
  127. package/app/.next/server/app/exchanges/page_client-reference-manifest.js +1 -1
  128. package/app/.next/server/app/exchanges.html +1 -1
  129. package/app/.next/server/app/exchanges.rsc +3 -3
  130. package/app/.next/server/app/exchanges.segments/_full.segment.rsc +3 -3
  131. package/app/.next/server/app/exchanges.segments/_tree.segment.rsc +2 -2
  132. package/app/.next/server/app/exchanges.segments/exchanges/__PAGE__.segment.rsc +3 -3
  133. package/app/.next/server/app/index.html +1 -1
  134. package/app/.next/server/app/index.rsc +3 -3
  135. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  136. package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
  137. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  138. package/app/.next/server/app/page.js.nft.json +1 -1
  139. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  140. package/app/.next/server/app/settings/page.js.nft.json +1 -1
  141. package/app/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  142. package/app/.next/server/app/settings.html +1 -1
  143. package/app/.next/server/app/settings.rsc +3 -3
  144. package/app/.next/server/app/settings.segments/_full.segment.rsc +3 -3
  145. package/app/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  146. package/app/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +3 -3
  147. package/app/.next/server/app/threads/[id]/page.js.nft.json +1 -1
  148. package/app/.next/server/app/threads/[id]/page_client-reference-manifest.js +1 -1
  149. package/app/.next/server/app-paths-manifest.json +0 -2
  150. package/app/.next/server/chunks/[root-of-the-server]__0792yb1._.js +44 -0
  151. package/app/.next/server/chunks/[root-of-the-server]__0d3fjix._.js +1 -1
  152. package/app/.next/server/chunks/[root-of-the-server]__0mp8bap._.js +1 -1
  153. package/app/.next/server/chunks/[root-of-the-server]__0qaiqut._.js +4 -4
  154. package/app/.next/server/chunks/[root-of-the-server]__0zrx1iz._.js +1 -1
  155. package/app/.next/server/chunks/[root-of-the-server]__10b5-i-._.js +1 -1
  156. package/app/.next/server/chunks/[root-of-the-server]__17mum5-._.js +1 -1
  157. package/app/.next/server/chunks/[root-of-the-server]__17xl_55._.js +1 -1
  158. package/app/.next/server/chunks/[root-of-the-server]__1j8fg_n._.js +3 -0
  159. package/app/.next/server/chunks/[root-of-the-server]__1x8phwp._.js +44 -0
  160. package/app/.next/server/chunks/[root-of-the-server]__200ep0k._.js +1 -1
  161. package/app/.next/server/chunks/_0061c2q._.js +1 -1
  162. package/app/.next/server/chunks/_057h7zr._.js +3 -0
  163. package/app/.next/server/chunks/_0a2do3x._.js +1 -1
  164. package/app/.next/server/chunks/_1-5mthb._.js +1 -1
  165. package/app/.next/server/chunks/lib_0-opbv7._.js +316 -0
  166. package/app/.next/server/chunks/lib_0aejojj._.js +316 -0
  167. package/app/.next/server/chunks/lib_0il0ml1._.js +316 -0
  168. package/app/.next/server/chunks/lib_0iujsdg._.js +316 -0
  169. package/app/.next/server/chunks/lib_0kik6bx._.js +20 -20
  170. package/app/.next/server/chunks/lib_0pe3tiv._.js +20 -20
  171. package/app/.next/server/chunks/lib_15adnlz._.js +109 -126
  172. package/app/.next/server/chunks/lib_1dehbst._.js +316 -0
  173. package/app/.next/server/chunks/lib_1z4vnh4._.js +316 -0
  174. package/app/.next/server/chunks/lib_1zc7-gl._.js +109 -126
  175. package/app/.next/server/chunks/lib_db_ts_1ttuckb._.js +58 -56
  176. package/app/.next/server/chunks/ssr/_0_fa0na._.js +1 -1
  177. package/app/.next/server/chunks/ssr/_0a6r_bx._.js +3 -0
  178. package/app/.next/server/chunks/ssr/_14d-lxn._.js +3 -0
  179. package/app/.next/server/chunks/ssr/_1cvuhjt._.js +1 -1
  180. package/app/.next/server/chunks/ssr/_1is_iwu._.js +3 -0
  181. package/app/.next/server/chunks/ssr/_1n5mvo5._.js +1 -1
  182. package/app/.next/server/chunks/ssr/_1o94bnv._.js +1 -1
  183. package/app/.next/server/chunks/ssr/app_bots_[id]_config_page_tsx_1e0uue9._.js +1 -1
  184. package/app/.next/server/middleware-build-manifest.js +3 -3
  185. package/app/.next/server/pages/404.html +1 -1
  186. package/app/.next/server/pages/500.html +1 -1
  187. package/app/.next/server/server-reference-manifest.js +1 -1
  188. package/app/.next/server/server-reference-manifest.json +1 -1
  189. package/app/.next/static/chunks/{22xbkclbkct3s.js → 1ouuczm-gmvxs.js} +1 -1
  190. package/app/.next/static/chunks/{2c953okoei6ip.js → 1w72fds3-utrx.js} +1 -1
  191. package/app/.next/static/chunks/2095-o17ji0fs.css +3 -0
  192. package/app/.next/static/chunks/2q-tgwkalrnms.js +1 -0
  193. package/app/.next/static/chunks/34bv9o9bjkwk0.js +3 -0
  194. package/app/.next/static/chunks/3rwwunh5sdjzg.js +1 -0
  195. package/app/.next/static/chunks/3whw2-l4a2sli.js +1 -0
  196. package/app/.next/static/chunks/3z3mn526_3fwd.js +1 -0
  197. package/app/BUILD_INFO.json +2 -2
  198. package/app/package.json +1 -1
  199. package/app/server.js +1 -1
  200. package/dist/cli.d.ts +1 -1
  201. package/dist/cli.js +2 -2
  202. package/dist/product.d.ts +0 -1
  203. package/dist/product.js +12 -22
  204. package/dist/setup.js +9 -9
  205. package/package.json +1 -2
  206. package/schemas/botmancers.mcp.v2.tools.json +3 -3
  207. package/app/.next/server/app/api/agent-deck/decks/route/app-paths-manifest.json +0 -3
  208. package/app/.next/server/app/api/agent-deck/decks/route/build-manifest.json +0 -12
  209. package/app/.next/server/app/api/agent-deck/decks/route/server-reference-manifest.json +0 -4
  210. package/app/.next/server/app/api/agent-deck/decks/route.js +0 -9
  211. package/app/.next/server/app/api/agent-deck/decks/route.js.nft.json +0 -1
  212. package/app/.next/server/app/api/agent-deck/decks/route_client-reference-manifest.js +0 -3
  213. package/app/.next/server/app/api/agent-deck/settings/route/app-paths-manifest.json +0 -3
  214. package/app/.next/server/app/api/agent-deck/settings/route/build-manifest.json +0 -12
  215. package/app/.next/server/app/api/agent-deck/settings/route/server-reference-manifest.json +0 -4
  216. package/app/.next/server/app/api/agent-deck/settings/route.js +0 -9
  217. package/app/.next/server/app/api/agent-deck/settings/route.js.nft.json +0 -1
  218. package/app/.next/server/app/api/agent-deck/settings/route_client-reference-manifest.js +0 -3
  219. package/app/.next/server/chunks/[root-of-the-server]__0j4pjyg._.js +0 -3
  220. package/app/.next/server/chunks/[root-of-the-server]__0mo_kn3._.js +0 -48
  221. package/app/.next/server/chunks/[root-of-the-server]__1bhzfu_._.js +0 -7
  222. package/app/.next/server/chunks/[root-of-the-server]__1g_n99l._.js +0 -3
  223. package/app/.next/server/chunks/[root-of-the-server]__1t4ybp2._.js +0 -48
  224. package/app/.next/server/chunks/_next-internal_server_app_api_agent-deck_decks_route_actions_0yguyfv.js +0 -3
  225. package/app/.next/server/chunks/_next-internal_server_app_api_agent-deck_settings_route_actions_0z_nbkb.js +0 -3
  226. package/app/.next/server/chunks/lib_0v4d9w0._.js +0 -339
  227. package/app/.next/server/chunks/lib_0zzo6zb._.js +0 -339
  228. package/app/.next/server/chunks/lib_1_u7n-u._.js +0 -339
  229. package/app/.next/server/chunks/lib_1muhwn7._.js +0 -339
  230. package/app/.next/server/chunks/lib_1xnxg-q._.js +0 -339
  231. package/app/.next/server/chunks/ssr/_1i02yyi._.js +0 -3
  232. package/app/.next/server/chunks/ssr/app_components_AgentDeckRuntime_tsx_024janf._.js +0 -3
  233. package/app/.next/server/chunks/ssr/app_settings_page_tsx_1t-rdz-._.js +0 -3
  234. package/app/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_1ztp13a._.js +0 -3
  235. package/app/.next/static/chunks/0jon21u-9j2aw.css +0 -3
  236. package/app/.next/static/chunks/14k6cvywgknx2.js +0 -3
  237. package/app/.next/static/chunks/1ku9himlsx-hn.js +0 -1
  238. package/app/.next/static/chunks/1r5tqd-7h1xjn.js +0 -1
  239. package/app/.next/static/chunks/21aqekm5z0j47.js +0 -1
  240. package/app/.next/static/chunks/2t_2gf3xoxz_m.js +0 -1
  241. package/app/.next/static/chunks/34vnvo1qssbaj.js +0 -1
  242. /package/app/.next/static/{_yrIZIFsIbXA0Gaxkytjd → A9sQnaf9i6YzjHNoPgRfU}/_buildManifest.js +0 -0
  243. /package/app/.next/static/{_yrIZIFsIbXA0Gaxkytjd → A9sQnaf9i6YzjHNoPgRfU}/_clientMiddlewareManifest.js +0 -0
  244. /package/app/.next/static/{_yrIZIFsIbXA0Gaxkytjd → A9sQnaf9i6YzjHNoPgRfU}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[25209,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(50944),f=a.i(60193),g=a.i(23464);function h({agentId:a,agentName:d}){let e=(0,c.useId)(),f=(0,c.useId)(),i=(0,c.useId)(),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(0),[p,q]=(0,c.useState)("idle"),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),[v,w]=(0,c.useState)(""),[x,y]=(0,c.useState)(""),[z,A]=(0,c.useState)("");(0,c.useEffect)(()=>{let b=!1;return fetch(`/api/bots/${encodeURIComponent(a)}/share-policy`,{cache:"no-store"}).then(async a=>{let c=await a.json().catch(()=>null);b||(a.ok&&c?.policy?(m(""),k(c.policy)):m("Could not load the share policy."))}).catch(()=>{b||m("Could not load the share policy.")}),()=>{b=!0}},[a,n]);let B=()=>{s(""),q("idle"),o(a=>a+1)},C=async(b,c)=>{if(!j)return!1;q("saving"),s(""),u("");try{let d=await fetch(`/api/bots/${encodeURIComponent(a)}/share-policy`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({revision:j.revision,...b})}),e=await d.json().catch(()=>null);if(!d.ok||!e?.policy)return q("error"),s("string"==typeof e?.error?.message?e.error.message:"The share policy could not be saved."),!1;return k(e.policy),q("idle"),u(c("number"==typeof e.revoked_contexts?e.revoked_contexts:0)),!0}catch{return q("error"),s("The share policy could not be saved."),!1}},D=async a=>{if(a.preventDefault(),!j)return;let b=(0,g.audienceInputError)(v,x,j.audiences);if(A(b??""),b)return;let c={kind:"slack",team_id:v.trim(),channel_id:x.trim()};await C({audiences:[...j.audiences,c]},()=>`Added ${(0,g.audienceLabel)(c)}.`)&&(w(""),y(""))},E="saving"===p,F=!!j&&"invalid"!==j.state;return(0,b.jsxs)("section",{className:"cfg-card share-policy",id:"session-sharing","aria-labelledby":"cfg-sharing-title",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{id:"cfg-sharing-title",className:"cfg-title",children:"Session sharing"}),E?(0,b.jsx)("span",{className:"text-sm cfg-faint",role:"status",children:"Saving…"}):null]}),(0,b.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:["A share lets people in one Slack channel ask one of ",d,"’s sessions questions, read-only, until it expires or you revoke it. Create and revoke shares from Sessions."]}),l?(0,b.jsxs)("p",{className:"text-sm cfg-error",role:"alert",children:[l," ",(0,b.jsx)("button",{type:"button",onClick:B,className:"underline hover:no-underline",children:"Retry"})]}):null,j||l?null:(0,b.jsx)("p",{className:"text-sm cfg-faint",role:"status",children:"Loading…"}),j?.state==="invalid"?(0,b.jsxs)("p",{className:"text-sm cfg-error mb-3",role:"alert",children:["The share policy file is invalid, so nothing can be shared: ",j.reason," Fix or remove config/session-shares.json, then"," ",(0,b.jsx)("button",{type:"button",onClick:B,className:"underline hover:no-underline",children:"reload"}),"."]}):null,j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"share-policy-toggle",children:[(0,b.jsx)("input",{id:e,type:"checkbox",role:"switch",checked:j.agent.share_from_turn,"aria-checked":j.agent.share_from_turn,disabled:!F||E||!j.agent.share_current.supported&&!j.agent.share_from_turn,"data-share-policy":"share_from_turn",onChange:a=>{let b=a.target.checked;C({share_from_turn:b},a=>b?"Share from a turn is on.":`Share from a turn is off.${a?` Revoked ${a} live turn context${1===a?"":"s"}.`:""}`)}}),(0,b.jsxs)("label",{htmlFor:e,className:"text-sm",children:[(0,b.jsx)("span",{className:"font-medium",children:"Share from a turn"})," (",(0,b.jsx)("code",{className:"cfg-code",children:"share_from_turn"}),")"]})]}),(0,b.jsx)("p",{className:"text-sm cfg-faint share-policy-hint",children:(0,g.shareFromTurnNote)(j)}),j.agent.live_contexts>0?(0,b.jsxs)("p",{className:"text-sm cfg-faint share-policy-hint",children:[j.agent.live_contexts," live turn context",1===j.agent.live_contexts?"":"s"," now."]}):null,(0,b.jsx)("h3",{className:"cfg-title share-policy-sub",children:"Slack channel allowlist"}),(0,b.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===j.audiences.length?(0,b.jsx)("p",{className:"text-sm cfg-muted share-policy-empty",children:"No channel yet: nothing can be shared to Slack."}):(0,b.jsx)("ul",{className:"share-policy-list","aria-label":"Allowed Slack channels",children:j.audiences.map(a=>(0,b.jsxs)("li",{className:"share-policy-entry",children:[(0,b.jsx)("span",{className:"cfg-code",children:a.channel_id}),(0,b.jsxs)("span",{className:"cfg-faint",children:["workspace ",a.team_id]}),(0,b.jsx)("button",{type:"button",className:"cfg-link text-sm share-policy-remove",disabled:!F||E,"aria-label":`Remove ${(0,g.audienceLabel)(a)}`,onClick:()=>{j&&C({audiences:j.audiences.filter(b=>b.team_id!==a.team_id||b.channel_id!==a.channel_id)},()=>`Removed ${(0,g.audienceLabel)(a)}. Its Slack threads stop being answered.`)},children:"Remove"})]},`${a.team_id}:${a.channel_id}`))}),(0,b.jsxs)("form",{className:"share-policy-add",onSubmit:a=>{D(a)},"aria-label":"Add a Slack channel",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:f,className:"text-sm",children:"Workspace ID"}),(0,b.jsx)("input",{id:f,className:"cfg-input",value:v,placeholder:"T0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!F||E,"aria-invalid":!!z,onChange:a=>{w(a.target.value),A("")}})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:i,className:"text-sm",children:"Channel ID"}),(0,b.jsx)("input",{id:i,className:"cfg-input",value:x,placeholder:"C0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!F||E,"aria-invalid":!!z,onChange:a=>{y(a.target.value),A("")}})]}),(0,b.jsx)("button",{type:"submit",className:"cfg-btn-primary text-sm",disabled:!F||E||!v.trim()||!x.trim(),children:"Add channel"})]}),z?(0,b.jsx)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:z}):null,"error"===p?(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:["Couldn't save: ",r," ",(0,b.jsx)("button",{type:"button",onClick:B,className:"underline hover:no-underline",children:"Reload"})]}):null,(0,b.jsx)("p",{className:"mt-2 text-sm cfg-ok",role:"status",children:t})]}):null]})}var i=a.i(35832),j=a.i(20851),k=a.i(1160),l=a.i(22855),m=a.i(2296),n=a.i(79202),o=a.i(36391);function p({attribute:a,label:d,options:e,current:f,onPick:g,className:h}){let i=(0,c.useId)(),j=`avatar-${a}`;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{id:i,className:"avatar-group-label",children:d}),(0,b.jsx)("div",{className:h?`avatar-opt-grid ${h}`:"avatar-opt-grid",role:"radiogroup","aria-labelledby":i,children:e.map(c=>(0,b.jsxs)("label",{title:c.label,className:"avatar-opt",children:[(0,b.jsx)("input",{type:"radio",name:j,value:c.id,checked:f[a]===c.id,onChange:()=>g({[a]:c.id}),className:"avatar-opt-input"}),(0,b.jsx)("span",{className:"avatar-opt-art","aria-hidden":"true",children:(0,b.jsx)(o.default,{config:{...f,[a]:c.id},size:44})}),(0,b.jsx)("span",{children:c.label})]},c.id))})]})}var q=a.i(80219);function r({phase:a,onImport:c}){let d=(0,q.marketImportView)(a);return(0,b.jsxs)("div",{className:"mt-3","data-field":"marketplace-import",children:[(0,b.jsx)("button",{type:"button",onClick:c,disabled:d.busy,"aria-busy":d.busy,"aria-describedby":"cfg-market-import-status",className:"cfg-btn-ghost text-sm w-full sm:w-auto",children:"Import from Grok Marketplace"}),(0,b.jsx)("p",{id:"cfg-market-import-status",role:"status","aria-live":"polite",className:"error"===d.tone?"mt-2 text-sm cfg-error":"mt-2 text-xs cfg-faint",children:d.message})]})}var s=a.i(5020);let t="Fix the highlighted fields.",u=[{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 v(a){return String(a).padStart(2,"0")}function w(a){let b=new Date(a);return`${b.getFullYear()}-${v(b.getMonth()+1)}-${v(b.getDate())} ${v(b.getHours())}:${v(b.getMinutes())}`}function x(a){let b=new Date(a);return`${v(b.getHours())}:${v(b.getMinutes())}:${v(b.getSeconds())}`}async function y(a){try{return await navigator.clipboard.writeText(a),!0}catch{return!1}}a.s(["default",0,function(){var a;let g=String((0,e.useParams)().id??""),v=(0,e.useRouter)(),[z,A]=(0,c.useState)(!1),[B,C]=(0,c.useState)(null),[D,E]=(0,c.useState)(!0),[F,G]=(0,c.useState)(!1),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(0),[L,M]=(0,c.useState)(null),[N,O]=(0,c.useState)("clean"),[P,Q]=(0,c.useState)(""),[R,S]=(0,c.useState)(0),[T,U]=(0,c.useState)(!1),[V,W]=(0,c.useState)(""),[X,Y]=(0,c.useState)("clean"),[Z,$]=(0,c.useState)(""),[_,aa]=(0,c.useState)(0),[ab,ac]=(0,c.useState)({}),[ad,ae]=(0,c.useState)(""),[af,ag]=(0,c.useState)(!1),[ah,ai]=(0,c.useState)(null),[aj,ak]=(0,c.useState)(!1),al=B?.bot.launch_profile==="agent_deck"||ah?.launchProfile==="agent_deck",{state:am,retry:an}=(0,m.useDeckList)(!!al),ao=(0,n.useRuntimeConnections)(),[ap,aq]=(0,c.useState)(void 0),[ar,as]=(0,c.useState)("clean"),[at,au]=(0,c.useState)(""),[av,aw]=(0,c.useState)(0),[ax,ay]=(0,c.useState)(null),[az,aA]=(0,c.useState)("clean"),[aB,aC]=(0,c.useState)(""),[aD,aE]=(0,c.useState)(0),{phase:aF,startImport:aG}=function(a){let[b,d]=(0,c.useState)("idle");return(0,c.useEffect)(()=>{let b=window.location.search;if(null===(0,q.importedBotId)(b))return;let c=new URL(window.location.href);c.searchParams.delete(q.IMPORT_RETURN_QUERY),window.history.replaceState(null,"",c.pathname+c.search);let e=!1;return(0,q.resolveImportReturn)(b,a,async a=>(await fetch(`/api/bots/${encodeURIComponent(a)}/config`,{cache:"no-store"})).ok).then(a=>{e||("open"===a.kind?window.location.replace(a.path):"missing"===a.kind&&d("missing"))}),()=>{e=!0}},[a]),{phase:b,startImport:async function(){d("checking");try{let a=await fetch(q.HANDOFF_STATUS_PATH,{cache:"no-store"}),b=await a.json().catch(()=>null);if(!a.ok)return void d("failed");if(b?.configured!==!0)return void d("unavailable");d("redirecting"),window.location.href=(0,q.handoffStartPath)(window.location.origin,window.location.pathname),setTimeout(()=>d(a=>"redirecting"===a?"idle":a),4e3)}catch{d("failed")}}}}(g);function aH(){E(!0),G(!1),K(a=>a+1)}(0,c.useEffect)(()=>{if(!g)return;let a=!1;return fetch(`/api/bots/${encodeURIComponent(g)}/sessions?status=all`,{cache:"no-store"}).then(a=>a.ok?a.json():null).then(b=>{a||aq((b?.sessions??[]).map(a=>({ref:a.ref,title:a.title,status:a.status})))}).catch(()=>{a||aq([])}),()=>{a=!0}},[g,J]),(0,c.useEffect)(()=>{if(!g)return;let a=!1;return fetch(`/api/bots/${encodeURIComponent(g)}/config`).then(async b=>{if(a)return;if(404===b.status){I(!0),C(null);return}if(!b.ok)throw Error("request failed");let c=await b.json();a||(C(c),M(c.bot.description??""),I(!1),G(!1))}).catch(()=>{a||G(!0)}).finally(()=>{a||E(!1)}),()=>{a=!0}},[g,J]);let aI=B?.bot.description??"",aJ=null!==L&&L!==aI,aK=B?.skill.content??"",aL=T&&V!==aK,aM=B?(0,k.registrationFormFromBot)(B.bot):null,aN=af&&null!==ah&&JSON.stringify(ah)!==JSON.stringify(aM),aO=B?.bot.avatar_config??(0,s.resolveAvatar)(B?.bot??{}),aP=ax??aO,aQ=null!==ax&&JSON.stringify(ax)!==JSON.stringify(aO),aR=aJ||aL||aN||aQ;function aS(a,b){y(b).then(b=>{b&&(ae(a),setTimeout(()=>ae(b=>b===a?"":b),2e3))})}async function aT(){if(B&&null!==L){O("saving"),Q("");try{let a=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:B.bot.id,description:L})});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await fetch(`/api/bots/${encodeURIComponent(g)}/config`);if(!b.ok)throw Error("request failed");C(await b.json()),O("confirmed"),S(Date.now()),setTimeout(()=>{O(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){O("error"),Q(a instanceof Error?a.message:"request failed")}}}function aU(){B&&(ai((0,k.registrationFormFromBot)(B.bot)),ag(!0),ak(!1),as("clean"),au(""),"agent_deck"===B.bot.launch_profile&&an(),ao.retry())}function aV(){ag(!1),ai(null),as("clean"),au("")}function aW(a){ay({...ax??aO,...a}),aA("clean"),aC("")}async function aX(){if(B&&ax){aA("saving"),aC("");try{let a=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:B.bot.id,avatar:ax})});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await fetch(`/api/bots/${encodeURIComponent(g)}/config`);if(!b.ok)throw Error("request failed");C(await b.json()),ay(null),aA("confirmed"),aE(Date.now()),setTimeout(()=>{aA(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){aA("error"),aC(a instanceof Error?a.message:"request failed")}}}async function aY(){if(B&&ah){if((0,k.hasRegistrationErrors)((0,k.registrationFormView)(ah,am,ao.state))){ak(!0),as("error"),au(t);return}as("saving"),au("");try{let a=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,k.registrationPatchBody)(B.bot.id,ah))});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await fetch(`/api/bots/${encodeURIComponent(g)}/config`);if(!b.ok)throw Error("request failed");C(await b.json()),ag(!1),ai(null),as("confirmed"),aw(Date.now()),setTimeout(()=>{as(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){as("error"),au(a instanceof Error?a.message:"request failed")}}}function aZ(){W(B?.skill.content??""),U(!0),Y("clean"),$("")}async function a$(){if(B&&(V.trim()||window.confirm("Delete this skill file?"))){Y("saving"),$("");try{let a=await fetch(`/api/bots/${encodeURIComponent(g)}/skill`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:V})});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await a.json();C(a=>a?{...a,skill:b.skill,currentHash:b.currentHash}:a),U(!1),Y("confirmed"),aa(Date.now()),setTimeout(()=>{Y(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){Y("error"),$(a instanceof Error?a.message:"request failed")}}}if((0,c.useEffect)(()=>{if(!aR)return;let a=a=>{a.preventDefault()};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[aR]),H)return(0,b.jsx)("div",{className:"cfg-page flex items-center justify-center",children:(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsx)("p",{className:"mb-4",children:"Agent not found."}),(0,b.jsx)(d.default,{href:"/",className:"cfg-link",children:"← Back to chat"})]})});if(D&&!B)return(0,b.jsx)("div",{className:"cfg-page",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto space-y-6",children:[(0,b.jsx)("div",{className:"h-6 w-32 rounded animate-pulse cfg-skel"}),(0,b.jsx)("div",{className:"h-20 rounded-lg animate-pulse cfg-skel"}),(0,b.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,b.jsx)("div",{className:"space-y-6",children:[0,1,2].map(a=>(0,b.jsx)("div",{className:"h-48 rounded-lg animate-pulse cfg-skel"},a))}),(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)("div",{className:"h-64 rounded-lg animate-pulse cfg-skel"}),(0,b.jsx)("div",{className:"h-80 rounded-lg animate-pulse cfg-skel"})]})]})]})});if(F&&!B)return(0,b.jsx)("div",{className:"cfg-page",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,b.jsx)(d.default,{href:"/",className:"cfg-link cfg-back text-sm",children:"← Back to chat"}),(0,b.jsxs)("header",{className:"mt-3 mb-6 flex flex-wrap items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h1",{className:"text-xl font-bold truncate",children:"Agent configuration"}),(0,b.jsx)("p",{className:"text-sm cfg-faint truncate",children:"Couldn't load agent details."})]}),(0,b.jsxs)("div",{className:"ml-auto text-right",children:[(0,b.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash: ",(0,b.jsx)("code",{className:"cfg-code",children:"—"})]}),(0,b.jsx)("p",{className:"text-sm mt-1",children:(0,b.jsx)("span",{className:"cfg-faint",children:"○ Not loaded"})})]})]}),(0,b.jsx)("div",{className:"grid gap-6 lg:grid-cols-2 items-start",children:[["Skills","Rules","Agent","Template source"],["Launch snapshots","Avatar"]].map(a=>(0,b.jsx)("div",{className:"min-w-0 space-y-6",children:a.map(a=>(0,b.jsxs)("div",{className:"cfg-card",children:[(0,b.jsx)("h2",{className:"cfg-title mb-2",children:a}),(0,b.jsxs)("p",{className:"text-sm cfg-muted",children:["Couldn't load this section."," ",(0,b.jsx)("button",{onClick:aH,className:"cfg-link",children:"Retry"})]})]},a))},a[0]))})]})});if(!B)return null;let{bot:a_,skill:a0,currentHash:a1,snapshots:a2}=B,a3=!!(a_.source_provider||a_.template_id||a_.template_url||a_.import_schema_version||a_.import_operation_id),a4="saving"===N?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aJ||"error"===N?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===N?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",x(R)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),a5="saving"===X?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aL||"error"===X?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===X?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",x(_)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),a6="saving"===ar?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aN||"error"===ar?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===ar?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",x(av)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),a7="saving"===az?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aQ||"error"===az?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===az?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",x(aD)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"});return(0,b.jsxs)("div",{className:"cfg-page",children:[(0,b.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,b.jsx)(d.default,{href:"/",onClick:function(a){aR&&!window.confirm("You have unsaved changes. Leave without saving?")&&a.preventDefault()},className:"cfg-link cfg-back text-sm",children:"← Back to chat"}),(0,b.jsxs)("header",{className:"mt-3 mb-6 flex flex-wrap items-center gap-4",children:[(0,b.jsx)(o.default,{bot:a_,size:48,title:`${a_.name} avatar`}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h1",{className:"text-xl font-bold truncate",children:a_.name}),(0,b.jsx)("p",{className:"text-sm cfg-faint truncate",children:a_.title||" "})]}),(0,b.jsxs)("div",{className:"ml-auto text-right",children:[(0,b.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash:"," ",(0,b.jsx)("code",{className:"cfg-code",title:a1,children:a1.slice(0,8)})," ",(0,b.jsx)("button",{onClick:()=>aS("header",a1),className:"cfg-link text-sm",children:"header"===ad?"Copied":"Copy"})]}),(0,b.jsx)("p",{className:"text-sm mt-1",children:aR?(0,b.jsxs)("span",{className:"cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):(0,b.jsx)("span",{className:"cfg-faint",children:"● Saved"})})]})]}),(0,b.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2 items-start","data-cfg-layout":"columns",children:[(0,b.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"primary",children:[(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Skills"}),a5]}),"unsupported"===a0.status?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Unsupported name"}),(0,b.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,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:[a0.path," · ","present"===a0.status?"Present":"Not present"]}),T?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("textarea",{value:V,onChange:a=>W(a.target.value),rows:8,className:"cfg-input text-sm"}),"error"===X&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",Z,"."," ",(0,b.jsx)("button",{onClick:a$,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:a$,disabled:!aL||"saving"===X,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===X?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:function(){U(!1),Y("clean"),$("")},disabled:!aL||"saving"===X,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}):"present"===a0.status?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("pre",{className:"text-sm cfg-pre max-h-64 overflow-y-auto",children:a0.content}),(0,b.jsx)("button",{onClick:aZ,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"text-sm cfg-muted",children:"No skill file yet. Create SKILL.md to give this agent standing instructions."}),(0,b.jsx)("button",{onClick:aZ,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Create"})]}),(0,b.jsx)("p",{className:"mt-3 text-xs cfg-faint",children:"Appended verbatim as a system message at launch."})]})]}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Rules"}),a4]}),(0,b.jsx)("textarea",{value:L??"",onChange:a=>M(a.target.value),rows:8,className:"cfg-input cfg-input-sans text-sm"}),(0,b.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"===N&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",P,"."," ",(0,b.jsx)("button",{onClick:aT,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aT,disabled:!aJ||"saving"===N,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===N?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:function(){M(aI),O("clean"),Q("")},disabled:!aJ||"saving"===N,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Agent"}),a6]}),(()=>{if(!af||!ah){let a=(0,k.registrationReadView)(a_,"agent_deck"===a_.launch_profile?am:null,ap);return(0,b.jsxs)("div",{"data-field":"runtime-read",children:[(0,b.jsx)("dl",{className:"text-sm",children:a.rows.map(a=>(0,b.jsxs)("div",{"data-row":a.key,className:"flex flex-col sm:flex-row sm:justify-between gap-x-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:a.label}),(0,b.jsx)("dd",{className:"sm:text-right break-words cfg-muted",children:a.value})]},a.key))}),a.notices.map(a=>(0,b.jsxs)("p",{className:"text-sm cfg-dirty mt-2",children:[a," ",/Settings/.test(a)?(0,b.jsx)(d.default,{href:"/settings",className:"cfg-link",children:"Open Settings"}):null]},a)),(0,b.jsx)("button",{onClick:aU,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]})}let a=(0,k.registrationFormView)(ah,am,ao.state),c="agent_deck"!==a_.launch_profile||(0,j.isMigratedPending)(a_)?null:a_.deck_id;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.RegistrationFields,{idPrefix:"cfg",variant:"config",form:ah,onChange:a=>{"agent_deck"===a.launchProfile&&"agent_deck"!==ah.launchProfile&&an(),ai(b=>b?{...b,...a}:b),au(""),as(a=>"error"===a?"clean":a)},view:a,showErrors:aj,connections:ao.state,onRetryConnections:ao.retry,onAddConnection:ao.add,deckState:am,onRetryDecks:an,savedDeckId:c,workdirPlaceholder:(0,j.defaultWorkdirFor)(a_.id),workdirHint:(0,j.configWorkdirHint)(a_.id),sessions:ap,includeHomeSession:!0}),"error"===ar&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:[at===t?at:`Couldn't save: ${at}.`," ",at===t?null:(0,b.jsx)("button",{onClick:aY,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aY,disabled:!aN||"saving"===ar||a.submitDisabled,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===ar?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:aV,disabled:"saving"===ar,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:aN?"Discard":"Cancel"})]})]})})()]}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsx)("h2",{className:"cfg-title mb-3",children:"Template source"}),!a3&&(0,b.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Created manually in Botmancers — no template source."}),(0,b.jsxs)("dl",{className:"text-sm",children:[(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Source provider"}),(0,b.jsx)("dd",{className:"text-right",children:a_.source_provider??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Template ID"}),(0,b.jsx)("dd",{className:"text-right",children:a_.template_id??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Template URL"}),(0,b.jsx)("dd",{className:"text-right break-all",children:a_.template_url?(a=a_.template_url).startsWith("http://")||a.startsWith("https://")?(0,b.jsx)("a",{href:a_.template_url,className:"cfg-link",children:a_.template_url}):a_.template_url:"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Import schema version"}),(0,b.jsx)("dd",{className:"text-right",children:a_.import_schema_version??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Import operation ID"}),(0,b.jsx)("dd",{className:"text-right break-all",children:a_.import_operation_id??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-y cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Imported at"}),(0,b.jsx)("dd",{className:"text-right",children:a_.import_timestamp?w(a_.import_timestamp):"—"})]})]}),(0,b.jsx)(r,{phase:aF,onImport:()=>{aG()}})]})]}),(0,b.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"secondary",children:[(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsx)("h2",{className:"cfg-title mb-3",children:"Launch snapshots"}),0===a2.length?(0,b.jsx)("p",{className:"text-sm cfg-muted",children:"No launches recorded yet."}):(0,b.jsx)("ul",{className:"space-y-3",children:a2.map(a=>{let c=a.hash===a1,d=!!ab[a.id];return(0,b.jsxs)("li",{className:"cfg-row",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsxs)("p",{className:"text-sm",children:[w(a.created_at)," · ",a.id.slice(0,4),a.transport?` \xb7 ${a.transport}`:null]}),(0,b.jsx)("button",{onClick:()=>ac(b=>({...b,[a.id]:!b[a.id]})),"aria-label":d?"Collapse snapshot detail":"Expand snapshot detail",className:"cfg-chevron px-1",children:d?"▾":"▸"})]}),(0,b.jsxs)("p",{className:"mt-1 text-sm",children:[(0,b.jsx)("code",{className:"cfg-code",children:a.hash.slice(0,12)})," ",(0,b.jsx)("button",{onClick:()=>aS(a.id,a.hash),className:"cfg-link text-sm",children:ad===a.id?"Copied":"Copy"})]}),(0,b.jsx)("p",{className:"mt-1 text-sm",children:c?(0,b.jsx)("span",{className:"cfg-ok",children:"● Matches current config"}):(0,b.jsx)("span",{className:"cfg-faint",children:"○ Config changed since"})}),d&&(0,b.jsxs)("div",{className:"mt-3 pt-3 border-t cfg-line text-sm",children:[(0,b.jsxs)("p",{className:"cfg-muted break-all",children:[(0,b.jsx)("span",{className:"font-medium",children:"Launch ID:"})," ",a.id]}),(0,b.jsxs)("p",{className:"mt-1 cfg-muted break-all",children:[(0,b.jsx)("span",{className:"font-medium",children:"Hash:"})," ",(0,b.jsx)("code",{className:"cfg-code",children:a.hash})]}),(0,b.jsx)("dl",{className:"mt-2",children:u.map(c=>{let d=a.snapshot[c.key];return(0,b.jsxs)("div",{className:"py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:c.label}),(0,b.jsx)("dd",{className:"whitespace-pre-wrap break-words",children:null==d?(0,b.jsx)("span",{className:"cfg-faint",children:"null"}):Array.isArray(d)?0===d.length?(0,b.jsx)("span",{className:"cfg-faint",children:"(none)"}):(0,b.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:d.map(a=>`- ${a}`).join("\n")}):"boolean"==typeof d?String(d):""===d?(0,b.jsx)("span",{className:"cfg-faint",children:"(empty)"}):(0,b.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:d})})]},c.key)})})]})]},a.id)})})]}),(0,b.jsx)(h,{agentId:a_.id,agentName:a_.name}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Avatar"}),a7]}),(0,b.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,b.jsx)(o.default,{config:aP,size:96,title:"Avatar live preview"}),(0,b.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,b.jsx)(p,{attribute:"color",label:"Color",options:s.AVATAR_COLORS,current:aP,onPick:aW,className:"mb-3"}),(0,b.jsx)(p,{attribute:"eyes",label:"Eyes",options:s.AVATAR_EYES,current:aP,onPick:aW,className:"mb-3"}),(0,b.jsx)(p,{attribute:"hands",label:"Hands",options:s.AVATAR_HANDS,current:aP,onPick:aW,className:"mb-3"}),(0,b.jsx)(p,{attribute:"accessory",label:"Accessory",options:s.AVATAR_ACCESSORIES,current:aP,onPick:aW}),"error"===az&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",aB,"."," ",(0,b.jsx)("button",{onClick:aX,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aX,disabled:!aQ||"saving"===az,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===az?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:function(){ay(null),aA("clean"),aC("")},disabled:!aQ||"saving"===az,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,b.jsxs)("section",{className:"cfg-card cfg-danger","aria-labelledby":"cfg-danger-title",children:[(0,b.jsx)("h2",{id:"cfg-danger-title",className:"cfg-title mb-3",children:"Danger zone"}),(0,b.jsx)("p",{className:"text-sm cfg-muted",children:i.DELETE_REMOVES_COPY}),(0,b.jsx)("p",{className:"text-sm cfg-faint mt-2",children:i.DELETE_KEEPS_COPY}),(0,b.jsx)("button",{type:"button",onClick:()=>A(!0),className:"mt-3 delete-btn text-sm w-full sm:w-auto",children:"Delete agent"})]})]})]})]}),z?(0,b.jsx)(f.default,{ids:[a_.id],onCancel:()=>A(!1),onDeleted:a=>v.push(`/?deleted=${Math.max(a.length,1)}`)}):null]})}],25209)}];
1
+ module.exports=[25209,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(50944),f=a.i(60193),g=a.i(23464);function h({agentId:a,agentName:d}){let e=(0,c.useId)(),f=(0,c.useId)(),i=(0,c.useId)(),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(0),[p,q]=(0,c.useState)("idle"),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),[v,w]=(0,c.useState)(""),[x,y]=(0,c.useState)(""),[z,A]=(0,c.useState)("");(0,c.useEffect)(()=>{let b=!1;return fetch(`/api/bots/${encodeURIComponent(a)}/share-policy`,{cache:"no-store"}).then(async a=>{let c=await a.json().catch(()=>null);b||(a.ok&&c?.policy?(m(""),k(c.policy)):m("Could not load the share policy."))}).catch(()=>{b||m("Could not load the share policy.")}),()=>{b=!0}},[a,n]);let B=()=>{s(""),q("idle"),o(a=>a+1)},C=async(b,c)=>{if(!j)return!1;q("saving"),s(""),u("");try{let d=await fetch(`/api/bots/${encodeURIComponent(a)}/share-policy`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({revision:j.revision,...b})}),e=await d.json().catch(()=>null);if(!d.ok||!e?.policy)return q("error"),s("string"==typeof e?.error?.message?e.error.message:"The share policy could not be saved."),!1;return k(e.policy),q("idle"),u(c("number"==typeof e.revoked_contexts?e.revoked_contexts:0)),!0}catch{return q("error"),s("The share policy could not be saved."),!1}},D=async a=>{if(a.preventDefault(),!j)return;let b=(0,g.audienceInputError)(v,x,j.audiences);if(A(b??""),b)return;let c={kind:"slack",team_id:v.trim(),channel_id:x.trim()};await C({audiences:[...j.audiences,c]},()=>`Added ${(0,g.audienceLabel)(c)}.`)&&(w(""),y(""))},E="saving"===p,F=!!j&&"invalid"!==j.state;return(0,b.jsxs)("section",{className:"cfg-card share-policy",id:"session-sharing","aria-labelledby":"cfg-sharing-title",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{id:"cfg-sharing-title",className:"cfg-title",children:"Session sharing"}),E?(0,b.jsx)("span",{className:"text-sm cfg-faint",role:"status",children:"Saving…"}):null]}),(0,b.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:["A share lets people in one Slack channel ask one of ",d,"’s sessions questions, read-only, until it expires or you revoke it. Create and revoke shares from Sessions."]}),l?(0,b.jsxs)("p",{className:"text-sm cfg-error",role:"alert",children:[l," ",(0,b.jsx)("button",{type:"button",onClick:B,className:"underline hover:no-underline",children:"Retry"})]}):null,j||l?null:(0,b.jsx)("p",{className:"text-sm cfg-faint",role:"status",children:"Loading…"}),j?.state==="invalid"?(0,b.jsxs)("p",{className:"text-sm cfg-error mb-3",role:"alert",children:["The share policy file is invalid, so nothing can be shared: ",j.reason," Fix or remove config/session-shares.json, then"," ",(0,b.jsx)("button",{type:"button",onClick:B,className:"underline hover:no-underline",children:"reload"}),"."]}):null,j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"share-policy-toggle",children:[(0,b.jsx)("input",{id:e,type:"checkbox",role:"switch",checked:j.agent.share_from_turn,"aria-checked":j.agent.share_from_turn,disabled:!F||E||!j.agent.share_current.supported&&!j.agent.share_from_turn,"data-share-policy":"share_from_turn",onChange:a=>{let b=a.target.checked;C({share_from_turn:b},a=>b?"Share from a turn is on.":`Share from a turn is off.${a?` Revoked ${a} live turn context${1===a?"":"s"}.`:""}`)}}),(0,b.jsxs)("label",{htmlFor:e,className:"text-sm",children:[(0,b.jsx)("span",{className:"font-medium",children:"Share from a turn"})," (",(0,b.jsx)("code",{className:"cfg-code",children:"share_from_turn"}),")"]})]}),(0,b.jsx)("p",{className:"text-sm cfg-faint share-policy-hint",children:(0,g.shareFromTurnNote)(j)}),j.agent.live_contexts>0?(0,b.jsxs)("p",{className:"text-sm cfg-faint share-policy-hint",children:[j.agent.live_contexts," live turn context",1===j.agent.live_contexts?"":"s"," now."]}):null,(0,b.jsx)("h3",{className:"cfg-title share-policy-sub",children:"Slack channel allowlist"}),(0,b.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===j.audiences.length?(0,b.jsx)("p",{className:"text-sm cfg-muted share-policy-empty",children:"No channel yet: nothing can be shared to Slack."}):(0,b.jsx)("ul",{className:"share-policy-list","aria-label":"Allowed Slack channels",children:j.audiences.map(a=>(0,b.jsxs)("li",{className:"share-policy-entry",children:[(0,b.jsx)("span",{className:"cfg-code",children:a.channel_id}),(0,b.jsxs)("span",{className:"cfg-faint",children:["workspace ",a.team_id]}),(0,b.jsx)("button",{type:"button",className:"cfg-link text-sm share-policy-remove",disabled:!F||E,"aria-label":`Remove ${(0,g.audienceLabel)(a)}`,onClick:()=>{j&&C({audiences:j.audiences.filter(b=>b.team_id!==a.team_id||b.channel_id!==a.channel_id)},()=>`Removed ${(0,g.audienceLabel)(a)}. Its Slack threads stop being answered.`)},children:"Remove"})]},`${a.team_id}:${a.channel_id}`))}),(0,b.jsxs)("form",{className:"share-policy-add",onSubmit:a=>{D(a)},"aria-label":"Add a Slack channel",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:f,className:"text-sm",children:"Workspace ID"}),(0,b.jsx)("input",{id:f,className:"cfg-input",value:v,placeholder:"T0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!F||E,"aria-invalid":!!z,onChange:a=>{w(a.target.value),A("")}})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:i,className:"text-sm",children:"Channel ID"}),(0,b.jsx)("input",{id:i,className:"cfg-input",value:x,placeholder:"C0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!F||E,"aria-invalid":!!z,onChange:a=>{y(a.target.value),A("")}})]}),(0,b.jsx)("button",{type:"submit",className:"cfg-btn-primary text-sm",disabled:!F||E||!v.trim()||!x.trim(),children:"Add channel"})]}),z?(0,b.jsx)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:z}):null,"error"===p?(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:["Couldn't save: ",r," ",(0,b.jsx)("button",{type:"button",onClick:B,className:"underline hover:no-underline",children:"Reload"})]}):null,(0,b.jsx)("p",{className:"mt-2 text-sm cfg-ok",role:"status",children:t})]}):null]})}var i=a.i(35832),j=a.i(20851),k=a.i(1160),l=a.i(22855),m=a.i(79202),n=a.i(36391);function o({attribute:a,label:d,options:e,current:f,onPick:g,className:h}){let i=(0,c.useId)(),j=`avatar-${a}`;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{id:i,className:"avatar-group-label",children:d}),(0,b.jsx)("div",{className:h?`avatar-opt-grid ${h}`:"avatar-opt-grid",role:"radiogroup","aria-labelledby":i,children:e.map(c=>(0,b.jsxs)("label",{title:c.label,className:"avatar-opt",children:[(0,b.jsx)("input",{type:"radio",name:j,value:c.id,checked:f[a]===c.id,onChange:()=>g({[a]:c.id}),className:"avatar-opt-input"}),(0,b.jsx)("span",{className:"avatar-opt-art","aria-hidden":"true",children:(0,b.jsx)(n.default,{config:{...f,[a]:c.id},size:44})}),(0,b.jsx)("span",{children:c.label})]},c.id))})]})}var p=a.i(80219);function q({phase:a,onImport:c}){let d=(0,p.marketImportView)(a);return(0,b.jsxs)("div",{className:"mt-3","data-field":"marketplace-import",children:[(0,b.jsx)("button",{type:"button",onClick:c,disabled:d.busy,"aria-busy":d.busy,"aria-describedby":"cfg-market-import-status",className:"cfg-btn-ghost text-sm w-full sm:w-auto",children:"Import from Grok Marketplace"}),(0,b.jsx)("p",{id:"cfg-market-import-status",role:"status","aria-live":"polite",className:"error"===d.tone?"mt-2 text-sm cfg-error":"mt-2 text-xs cfg-faint",children:d.message})]})}var r=a.i(5020);let s="Fix the highlighted fields.",t=[{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 u(a){return String(a).padStart(2,"0")}function v(a){let b=new Date(a);return`${b.getFullYear()}-${u(b.getMonth()+1)}-${u(b.getDate())} ${u(b.getHours())}:${u(b.getMinutes())}`}function w(a){let b=new Date(a);return`${u(b.getHours())}:${u(b.getMinutes())}:${u(b.getSeconds())}`}async function x(a){try{return await navigator.clipboard.writeText(a),!0}catch{return!1}}a.s(["default",0,function(){var a;let g=String((0,e.useParams)().id??""),u=(0,e.useRouter)(),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(null),[C,D]=(0,c.useState)(!0),[E,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(0),[K,L]=(0,c.useState)(null),[M,N]=(0,c.useState)("clean"),[O,P]=(0,c.useState)(""),[Q,R]=(0,c.useState)(0),[S,T]=(0,c.useState)(!1),[U,V]=(0,c.useState)(""),[W,X]=(0,c.useState)("clean"),[Y,Z]=(0,c.useState)(""),[$,_]=(0,c.useState)(0),[aa,ab]=(0,c.useState)({}),[ac,ad]=(0,c.useState)(""),[ae,af]=(0,c.useState)(!1),[ag,ah]=(0,c.useState)(null),[ai,aj]=(0,c.useState)(!1),ak=(0,m.useRuntimeConnections)(),[al,am]=(0,c.useState)(void 0),[an,ao]=(0,c.useState)("clean"),[ap,aq]=(0,c.useState)(""),[ar,as]=(0,c.useState)(0),[at,au]=(0,c.useState)(null),[av,aw]=(0,c.useState)("clean"),[ax,ay]=(0,c.useState)(""),[az,aA]=(0,c.useState)(0),{phase:aB,startImport:aC}=function(a){let[b,d]=(0,c.useState)("idle");return(0,c.useEffect)(()=>{let b=window.location.search;if(null===(0,p.importedBotId)(b))return;let c=new URL(window.location.href);c.searchParams.delete(p.IMPORT_RETURN_QUERY),window.history.replaceState(null,"",c.pathname+c.search);let e=!1;return(0,p.resolveImportReturn)(b,a,async a=>(await fetch(`/api/bots/${encodeURIComponent(a)}/config`,{cache:"no-store"})).ok).then(a=>{e||("open"===a.kind?window.location.replace(a.path):"missing"===a.kind&&d("missing"))}),()=>{e=!0}},[a]),{phase:b,startImport:async function(){d("checking");try{let a=await fetch(p.HANDOFF_STATUS_PATH,{cache:"no-store"}),b=await a.json().catch(()=>null);if(!a.ok)return void d("failed");if(b?.configured!==!0)return void d("unavailable");d("redirecting"),window.location.href=(0,p.handoffStartPath)(window.location.origin,window.location.pathname),setTimeout(()=>d(a=>"redirecting"===a?"idle":a),4e3)}catch{d("failed")}}}}(g);function aD(){D(!0),F(!1),J(a=>a+1)}(0,c.useEffect)(()=>{if(!g)return;let a=!1;return fetch(`/api/bots/${encodeURIComponent(g)}/sessions?status=all`,{cache:"no-store"}).then(a=>a.ok?a.json():null).then(b=>{a||am((b?.sessions??[]).map(a=>({ref:a.ref,title:a.title,status:a.status})))}).catch(()=>{a||am([])}),()=>{a=!0}},[g,I]),(0,c.useEffect)(()=>{if(!g)return;let a=!1;return fetch(`/api/bots/${encodeURIComponent(g)}/config`).then(async b=>{if(a)return;if(404===b.status){H(!0),B(null);return}if(!b.ok)throw Error("request failed");let c=await b.json();a||(B(c),L(c.bot.description??""),H(!1),F(!1))}).catch(()=>{a||F(!0)}).finally(()=>{a||D(!1)}),()=>{a=!0}},[g,I]);let aE=A?.bot.description??"",aF=null!==K&&K!==aE,aG=A?.skill.content??"",aH=S&&U!==aG,aI=A?(0,k.registrationFormFromBot)(A.bot):null,aJ=ae&&null!==ag&&JSON.stringify(ag)!==JSON.stringify(aI),aK=A?.bot.avatar_config??(0,r.resolveAvatar)(A?.bot??{}),aL=at??aK,aM=null!==at&&JSON.stringify(at)!==JSON.stringify(aK),aN=aF||aH||aJ||aM;function aO(a,b){x(b).then(b=>{b&&(ad(a),setTimeout(()=>ad(b=>b===a?"":b),2e3))})}async function aP(){if(A&&null!==K){N("saving"),P("");try{let a=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:A.bot.id,description:K})});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await fetch(`/api/bots/${encodeURIComponent(g)}/config`);if(!b.ok)throw Error("request failed");B(await b.json()),N("confirmed"),R(Date.now()),setTimeout(()=>{N(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){N("error"),P(a instanceof Error?a.message:"request failed")}}}function aQ(){A&&(ah((0,k.registrationFormFromBot)(A.bot)),af(!0),aj(!1),ao("clean"),aq(""),ak.retry())}function aR(a){ah(b=>b?{...b,...a}:b),aq(""),ao(a=>"error"===a?"clean":a)}function aS(){af(!1),ah(null),ao("clean"),aq("")}function aT(a){au({...at??aK,...a}),aw("clean"),ay("")}async function aU(){if(A&&at){aw("saving"),ay("");try{let a=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:A.bot.id,avatar:at})});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await fetch(`/api/bots/${encodeURIComponent(g)}/config`);if(!b.ok)throw Error("request failed");B(await b.json()),au(null),aw("confirmed"),aA(Date.now()),setTimeout(()=>{aw(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){aw("error"),ay(a instanceof Error?a.message:"request failed")}}}async function aV(){if(A&&ag){if((0,k.hasRegistrationErrors)((0,k.registrationFormView)(ag,ak.state))){aj(!0),ao("error"),aq(s);return}ao("saving"),aq("");try{let a=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,k.registrationPatchBody)(A.bot.id,ag))});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await fetch(`/api/bots/${encodeURIComponent(g)}/config`);if(!b.ok)throw Error("request failed");B(await b.json()),af(!1),ah(null),ao("confirmed"),as(Date.now()),setTimeout(()=>{ao(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){ao("error"),aq(a instanceof Error?a.message:"request failed")}}}function aW(){V(A?.skill.content??""),T(!0),X("clean"),Z("")}async function aX(){if(A&&(U.trim()||window.confirm("Delete this skill file?"))){X("saving"),Z("");try{let a=await fetch(`/api/bots/${encodeURIComponent(g)}/skill`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:U})});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await a.json();B(a=>a?{...a,skill:b.skill,currentHash:b.currentHash}:a),T(!1),X("confirmed"),_(Date.now()),setTimeout(()=>{X(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){X("error"),Z(a instanceof Error?a.message:"request failed")}}}if((0,c.useEffect)(()=>{if(!aN)return;let a=a=>{a.preventDefault()};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[aN]),G)return(0,b.jsx)("div",{className:"cfg-page flex items-center justify-center",children:(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsx)("p",{className:"mb-4",children:"Agent not found."}),(0,b.jsx)(d.default,{href:"/",className:"cfg-link",children:"← Back to chat"})]})});if(C&&!A)return(0,b.jsx)("div",{className:"cfg-page",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto space-y-6",children:[(0,b.jsx)("div",{className:"h-6 w-32 rounded animate-pulse cfg-skel"}),(0,b.jsx)("div",{className:"h-20 rounded-lg animate-pulse cfg-skel"}),(0,b.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,b.jsx)("div",{className:"space-y-6",children:[0,1,2].map(a=>(0,b.jsx)("div",{className:"h-48 rounded-lg animate-pulse cfg-skel"},a))}),(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)("div",{className:"h-64 rounded-lg animate-pulse cfg-skel"}),(0,b.jsx)("div",{className:"h-80 rounded-lg animate-pulse cfg-skel"})]})]})]})});if(E&&!A)return(0,b.jsx)("div",{className:"cfg-page",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,b.jsx)(d.default,{href:"/",className:"cfg-link cfg-back text-sm",children:"← Back to chat"}),(0,b.jsxs)("header",{className:"mt-3 mb-6 flex flex-wrap items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h1",{className:"text-xl font-bold truncate",children:"Agent configuration"}),(0,b.jsx)("p",{className:"text-sm cfg-faint truncate",children:"Couldn't load agent details."})]}),(0,b.jsxs)("div",{className:"ml-auto text-right",children:[(0,b.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash: ",(0,b.jsx)("code",{className:"cfg-code",children:"—"})]}),(0,b.jsx)("p",{className:"text-sm mt-1",children:(0,b.jsx)("span",{className:"cfg-faint",children:"○ Not loaded"})})]})]}),(0,b.jsx)("div",{className:"grid gap-6 lg:grid-cols-2 items-start",children:[["Skills","Rules","Agent","Template source"],["Launch snapshots","Avatar"]].map(a=>(0,b.jsx)("div",{className:"min-w-0 space-y-6",children:a.map(a=>(0,b.jsxs)("div",{className:"cfg-card",children:[(0,b.jsx)("h2",{className:"cfg-title mb-2",children:a}),(0,b.jsxs)("p",{className:"text-sm cfg-muted",children:["Couldn't load this section."," ",(0,b.jsx)("button",{onClick:aD,className:"cfg-link",children:"Retry"})]})]},a))},a[0]))})]})});if(!A)return null;let{bot:aY,skill:aZ,currentHash:a$,snapshots:a_}=A,a0=!!(aY.source_provider||aY.template_id||aY.template_url||aY.import_schema_version||aY.import_operation_id),a1="saving"===M?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aF||"error"===M?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===M?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",w(Q)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),a2="saving"===W?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aH||"error"===W?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===W?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",w($)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),a3="saving"===an?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aJ||"error"===an?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===an?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",w(ar)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),a4="saving"===av?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aM||"error"===av?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===av?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",w(az)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"});return(0,b.jsxs)("div",{className:"cfg-page",children:[(0,b.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,b.jsx)(d.default,{href:"/",onClick:function(a){aN&&!window.confirm("You have unsaved changes. Leave without saving?")&&a.preventDefault()},className:"cfg-link cfg-back text-sm",children:"← Back to chat"}),(0,b.jsxs)("header",{className:"mt-3 mb-6 flex flex-wrap items-center gap-4",children:[(0,b.jsx)(n.default,{bot:aY,size:48,title:`${aY.name} avatar`}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h1",{className:"text-xl font-bold truncate",children:aY.name}),(0,b.jsx)("p",{className:"text-sm cfg-faint truncate",children:aY.title||" "})]}),(0,b.jsxs)("div",{className:"ml-auto text-right",children:[(0,b.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash:"," ",(0,b.jsx)("code",{className:"cfg-code",title:a$,children:a$.slice(0,8)})," ",(0,b.jsx)("button",{onClick:()=>aO("header",a$),className:"cfg-link text-sm",children:"header"===ac?"Copied":"Copy"})]}),(0,b.jsx)("p",{className:"text-sm mt-1",children:aN?(0,b.jsxs)("span",{className:"cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):(0,b.jsx)("span",{className:"cfg-faint",children:"● Saved"})})]})]}),(0,b.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2 items-start","data-cfg-layout":"columns",children:[(0,b.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"primary",children:[(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Skills"}),a2]}),"unsupported"===aZ.status?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Unsupported name"}),(0,b.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,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:[aZ.path," · ","present"===aZ.status?"Present":"Not present"]}),S?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("textarea",{value:U,onChange:a=>V(a.target.value),rows:8,className:"cfg-input text-sm"}),"error"===W&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",Y,"."," ",(0,b.jsx)("button",{onClick:aX,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aX,disabled:!aH||"saving"===W,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===W?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:function(){T(!1),X("clean"),Z("")},disabled:!aH||"saving"===W,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}):"present"===aZ.status?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("pre",{className:"text-sm cfg-pre max-h-64 overflow-y-auto",children:aZ.content}),(0,b.jsx)("button",{onClick:aW,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"text-sm cfg-muted",children:"No skill file yet. Create SKILL.md to give this agent standing instructions."}),(0,b.jsx)("button",{onClick:aW,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Create"})]}),(0,b.jsx)("p",{className:"mt-3 text-xs cfg-faint",children:"Appended verbatim as a system message at launch."})]})]}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Rules"}),a1]}),(0,b.jsx)("textarea",{value:K??"",onChange:a=>L(a.target.value),rows:8,className:"cfg-input cfg-input-sans text-sm"}),(0,b.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"===M&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",O,"."," ",(0,b.jsx)("button",{onClick:aP,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aP,disabled:!aF||"saving"===M,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===M?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:function(){L(aE),N("clean"),P("")},disabled:!aF||"saving"===M,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Agent"}),a3]}),(()=>{if(!ae||!ag){let a=(0,k.registrationReadView)(aY,al);return(0,b.jsxs)("div",{"data-field":"runtime-read",children:[(0,b.jsx)("dl",{className:"text-sm",children:a.rows.map(a=>(0,b.jsxs)("div",{"data-row":a.key,className:"flex flex-col sm:flex-row sm:justify-between gap-x-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:a.label}),(0,b.jsx)("dd",{className:"sm:text-right break-words cfg-muted",children:a.value})]},a.key))}),a.notices.map(a=>(0,b.jsx)("p",{className:"text-sm cfg-dirty mt-2",children:a},a)),(0,b.jsx)("button",{onClick:aQ,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]})}let a=(0,k.registrationFormView)(ag,ak.state);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.RegistrationFields,{idPrefix:"cfg",variant:"config",form:ag,onChange:aR,view:a,showErrors:ai,connections:ak.state,onRetryConnections:ak.retry,onAddConnection:ak.add,workspacePlaceholder:(0,j.defaultWorkdirFor)(aY.id),workspaceHint:(0,j.configWorkspaceHint)(aY.id),sessions:al,includeHomeSession:!0}),"error"===an&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:[ap===s?ap:`Couldn't save: ${ap}.`," ",ap===s?null:(0,b.jsx)("button",{onClick:aV,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aV,disabled:!aJ||"saving"===an||a.submitDisabled,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===an?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:aS,disabled:"saving"===an,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:aJ?"Discard":"Cancel"})]})]})})()]}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsx)("h2",{className:"cfg-title mb-3",children:"Template source"}),!a0&&(0,b.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Created manually in Botmancers — no template source."}),(0,b.jsxs)("dl",{className:"text-sm",children:[(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Source provider"}),(0,b.jsx)("dd",{className:"text-right",children:aY.source_provider??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Template ID"}),(0,b.jsx)("dd",{className:"text-right",children:aY.template_id??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Template URL"}),(0,b.jsx)("dd",{className:"text-right break-all",children:aY.template_url?(a=aY.template_url).startsWith("http://")||a.startsWith("https://")?(0,b.jsx)("a",{href:aY.template_url,className:"cfg-link",children:aY.template_url}):aY.template_url:"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Import schema version"}),(0,b.jsx)("dd",{className:"text-right",children:aY.import_schema_version??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Import operation ID"}),(0,b.jsx)("dd",{className:"text-right break-all",children:aY.import_operation_id??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-y cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Imported at"}),(0,b.jsx)("dd",{className:"text-right",children:aY.import_timestamp?v(aY.import_timestamp):"—"})]})]}),(0,b.jsx)(q,{phase:aB,onImport:()=>{aC()}})]})]}),(0,b.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"secondary",children:[(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsx)("h2",{className:"cfg-title mb-3",children:"Launch snapshots"}),0===a_.length?(0,b.jsx)("p",{className:"text-sm cfg-muted",children:"No launches recorded yet."}):(0,b.jsx)("ul",{className:"space-y-3",children:a_.map(a=>{let c=a.hash===a$,d=!!aa[a.id];return(0,b.jsxs)("li",{className:"cfg-row",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsxs)("p",{className:"text-sm",children:[v(a.created_at)," · ",a.id.slice(0,4),a.transport?` \xb7 ${a.transport}`:null]}),(0,b.jsx)("button",{onClick:()=>ab(b=>({...b,[a.id]:!b[a.id]})),"aria-label":d?"Collapse snapshot detail":"Expand snapshot detail",className:"cfg-chevron px-1",children:d?"▾":"▸"})]}),(0,b.jsxs)("p",{className:"mt-1 text-sm",children:[(0,b.jsx)("code",{className:"cfg-code",children:a.hash.slice(0,12)})," ",(0,b.jsx)("button",{onClick:()=>aO(a.id,a.hash),className:"cfg-link text-sm",children:ac===a.id?"Copied":"Copy"})]}),(0,b.jsx)("p",{className:"mt-1 text-sm",children:c?(0,b.jsx)("span",{className:"cfg-ok",children:"● Matches current config"}):(0,b.jsx)("span",{className:"cfg-faint",children:"○ Config changed since"})}),d&&(0,b.jsxs)("div",{className:"mt-3 pt-3 border-t cfg-line text-sm",children:[(0,b.jsxs)("p",{className:"cfg-muted break-all",children:[(0,b.jsx)("span",{className:"font-medium",children:"Launch ID:"})," ",a.id]}),(0,b.jsxs)("p",{className:"mt-1 cfg-muted break-all",children:[(0,b.jsx)("span",{className:"font-medium",children:"Hash:"})," ",(0,b.jsx)("code",{className:"cfg-code",children:a.hash})]}),(0,b.jsx)("dl",{className:"mt-2",children:t.map(c=>{let d=a.snapshot[c.key];return(0,b.jsxs)("div",{className:"py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:c.label}),(0,b.jsx)("dd",{className:"whitespace-pre-wrap break-words",children:null==d?(0,b.jsx)("span",{className:"cfg-faint",children:"null"}):Array.isArray(d)?0===d.length?(0,b.jsx)("span",{className:"cfg-faint",children:"(none)"}):(0,b.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:d.map(a=>`- ${a}`).join("\n")}):"boolean"==typeof d?String(d):""===d?(0,b.jsx)("span",{className:"cfg-faint",children:"(empty)"}):(0,b.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:d})})]},c.key)})})]})]},a.id)})})]}),(0,b.jsx)(h,{agentId:aY.id,agentName:aY.name}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Avatar"}),a4]}),(0,b.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,b.jsx)(n.default,{config:aL,size:96,title:"Avatar live preview"}),(0,b.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,b.jsx)(o,{attribute:"color",label:"Color",options:r.AVATAR_COLORS,current:aL,onPick:aT,className:"mb-3"}),(0,b.jsx)(o,{attribute:"eyes",label:"Eyes",options:r.AVATAR_EYES,current:aL,onPick:aT,className:"mb-3"}),(0,b.jsx)(o,{attribute:"hands",label:"Hands",options:r.AVATAR_HANDS,current:aL,onPick:aT,className:"mb-3"}),(0,b.jsx)(o,{attribute:"accessory",label:"Accessory",options:r.AVATAR_ACCESSORIES,current:aL,onPick:aT}),"error"===av&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",ax,"."," ",(0,b.jsx)("button",{onClick:aU,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aU,disabled:!aM||"saving"===av,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===av?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:function(){au(null),aw("clean"),ay("")},disabled:!aM||"saving"===av,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,b.jsxs)("section",{className:"cfg-card cfg-danger","aria-labelledby":"cfg-danger-title",children:[(0,b.jsx)("h2",{id:"cfg-danger-title",className:"cfg-title mb-3",children:"Danger zone"}),(0,b.jsx)("p",{className:"text-sm cfg-muted",children:i.DELETE_REMOVES_COPY}),(0,b.jsx)("p",{className:"text-sm cfg-faint mt-2",children:i.DELETE_KEEPS_COPY}),(0,b.jsx)("button",{type:"button",onClick:()=>z(!0),className:"mt-3 delete-btn text-sm w-full sm:w-auto",children:"Delete agent"})]})]})]})]}),y?(0,b.jsx)(f.default,{ids:[aY.id],onCancel:()=>z(!1),onDeleted:a=>u.push(`/?deleted=${Math.max(a.length,1)}`)}):null]})}],25209)}];
2
2
 
3
3
  //# sourceMappingURL=app_bots_%5Bid%5D_config_page_tsx_1e0uue9._.js.map
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
7
7
  "static/chunks/0cz1d0mv5g_q7.js"
8
8
  ],
9
9
  "lowPriorityFiles": [
10
- "static/_yrIZIFsIbXA0Gaxkytjd/_buildManifest.js",
11
- "static/_yrIZIFsIbXA0Gaxkytjd/_ssgManifest.js",
12
- "static/_yrIZIFsIbXA0Gaxkytjd/_clientMiddlewareManifest.js"
10
+ "static/A9sQnaf9i6YzjHNoPgRfU/_buildManifest.js",
11
+ "static/A9sQnaf9i6YzjHNoPgRfU/_ssgManifest.js",
12
+ "static/A9sQnaf9i6YzjHNoPgRfU/_clientMiddlewareManifest.js"
13
13
  ],
14
14
  "rootMainFiles": [
15
15
  "static/chunks/3s6nzrbk-8mnv.js",
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en" class="geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable h-full antialiased"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/0jon21u-9j2aw.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/3s6nzrbk-8mnv.js"/><script src="/_next/static/chunks/19mx3mg6lkumu.js" async=""></script><script src="/_next/static/chunks/3g4px251sg85e.js" async=""></script><script src="/_next/static/chunks/2z-e6jheq0ftu.js" async=""></script><script src="/_next/static/chunks/turbopack-03rfayxv7ep_b.js" async=""></script><script src="/_next/static/chunks/3fntmmi971322.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>Botmancers</title><meta name="description" content="Cloud-hosted AI teammate app"/><link rel="icon" href="/brand/botmancers-logo-filled-64.png" sizes="64x64" type="image/png"/><link rel="icon" href="/brand/botmancers-logo-filled-256.png" sizes="256x256" type="image/png"/><link rel="apple-touch-icon" href="/brand/botmancers-logo-filled-256.png" sizes="256x256" type="image/png"/><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body class="min-h-full flex flex-col"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/3s6nzrbk-8mnv.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/3fntmmi971322.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/3fntmmi971322.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/3fntmmi971322.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/3fntmmi971322.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/3fntmmi971322.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/3fntmmi971322.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0jon21u-9j2aw.css\",\"style\"]\n7:X\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4608]},\"$undefined\",\"$undefined\",4608]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0jon21u-9j2aw.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/3fntmmi971322.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable h-full antialiased\",\"children\":[\"$\",\"body\",null,{\"className\":\"min-h-full flex flex-col\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0jon21u-9j2aw.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"_yrIZIFsIbXA0Gaxkytjd\"}\n"])</script><script>self.__next_f.push([1,"7:C\n9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[27201,[\"/_next/static/chunks/3fntmmi971322.js\"],\"IconMark\"]\n6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Botmancers\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Cloud-hosted AI teammate app\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/brand/botmancers-logo-filled-64.png\",\"sizes\":\"64x64\",\"type\":\"image/png\"}],[\"$\",\"link\",\"3\",{\"rel\":\"icon\",\"href\":\"/brand/botmancers-logo-filled-256.png\",\"sizes\":\"256x256\",\"type\":\"image/png\"}],[\"$\",\"link\",\"4\",{\"rel\":\"apple-touch-icon\",\"href\":\"/brand/botmancers-logo-filled-256.png\",\"sizes\":\"256x256\",\"type\":\"image/png\"}],[\"$\",\"$Ld\",\"5\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en" class="geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable h-full antialiased"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/2095-o17ji0fs.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/3s6nzrbk-8mnv.js"/><script src="/_next/static/chunks/19mx3mg6lkumu.js" async=""></script><script src="/_next/static/chunks/3g4px251sg85e.js" async=""></script><script src="/_next/static/chunks/2z-e6jheq0ftu.js" async=""></script><script src="/_next/static/chunks/turbopack-03rfayxv7ep_b.js" async=""></script><script src="/_next/static/chunks/3fntmmi971322.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>Botmancers</title><meta name="description" content="Cloud-hosted AI teammate app"/><link rel="icon" href="/brand/botmancers-logo-filled-64.png" sizes="64x64" type="image/png"/><link rel="icon" href="/brand/botmancers-logo-filled-256.png" sizes="256x256" type="image/png"/><link rel="apple-touch-icon" href="/brand/botmancers-logo-filled-256.png" sizes="256x256" type="image/png"/><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body class="min-h-full flex flex-col"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/3s6nzrbk-8mnv.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/3fntmmi971322.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/3fntmmi971322.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/3fntmmi971322.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/3fntmmi971322.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/3fntmmi971322.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/3fntmmi971322.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/2095-o17ji0fs.css\",\"style\"]\n7:X\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4608]},\"$undefined\",\"$undefined\",4608]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/2095-o17ji0fs.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/3fntmmi971322.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable h-full antialiased\",\"children\":[\"$\",\"body\",null,{\"className\":\"min-h-full flex flex-col\",\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/2095-o17ji0fs.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"A9sQnaf9i6YzjHNoPgRfU\"}\n"])</script><script>self.__next_f.push([1,"7:C\n9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[27201,[\"/_next/static/chunks/3fntmmi971322.js\"],\"IconMark\"]\n6:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Botmancers\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Cloud-hosted AI teammate app\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/brand/botmancers-logo-filled-64.png\",\"sizes\":\"64x64\",\"type\":\"image/png\"}],[\"$\",\"link\",\"3\",{\"rel\":\"icon\",\"href\":\"/brand/botmancers-logo-filled-256.png\",\"sizes\":\"256x256\",\"type\":\"image/png\"}],[\"$\",\"link\",\"4\",{\"rel\":\"apple-touch-icon\",\"href\":\"/brand/botmancers-logo-filled-256.png\",\"sizes\":\"256x256\",\"type\":\"image/png\"}],[\"$\",\"$Ld\",\"5\",{}]]\n"])</script></body></html>
@@ -1 +1 @@
1
- <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/3s6nzrbk-8mnv.js"/><script src="/_next/static/chunks/19mx3mg6lkumu.js" async=""></script><script src="/_next/static/chunks/3g4px251sg85e.js" async=""></script><script src="/_next/static/chunks/2z-e6jheq0ftu.js" async=""></script><script src="/_next/static/chunks/turbopack-03rfayxv7ep_b.js" async=""></script><script src="/_next/static/chunks/3fntmmi971322.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/3s6nzrbk-8mnv.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/3fntmmi971322.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/3fntmmi971322.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/3fntmmi971322.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/3fntmmi971322.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/3fntmmi971322.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/3fntmmi971322.js\"],\"default\",1]\n7:X\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"_yrIZIFsIbXA0Gaxkytjd\"}\n"])</script><script>self.__next_f.push([1,"7:C\n9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[]\n"])</script></body></html>
1
+ <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/3s6nzrbk-8mnv.js"/><script src="/_next/static/chunks/19mx3mg6lkumu.js" async=""></script><script src="/_next/static/chunks/3g4px251sg85e.js" async=""></script><script src="/_next/static/chunks/2z-e6jheq0ftu.js" async=""></script><script src="/_next/static/chunks/turbopack-03rfayxv7ep_b.js" async=""></script><script src="/_next/static/chunks/3fntmmi971322.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/3s6nzrbk-8mnv.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/3fntmmi971322.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/3fntmmi971322.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/3fntmmi971322.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/3fntmmi971322.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/3fntmmi971322.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/3fntmmi971322.js\"],\"default\",1]\n7:X\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"A9sQnaf9i6YzjHNoPgRfU\"}\n"])</script><script>self.__next_f.push([1,"7:C\n9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[]\n"])</script></body></html>
@@ -1 +1 @@
1
- self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"tOjJfMxk9xledK4aFfGbllDn/TYShzG4ApXov4EC76g=\"\n}"
1
+ self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"xzrZuz04qmEu61ysrrnYBpZVmDQD7boYfIBTPJfvLZc=\"\n}"
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "node": {},
3
3
  "edge": {},
4
- "encryptionKey": "tOjJfMxk9xledK4aFfGbllDn/TYShzG4ApXov4EC76g="
4
+ "encryptionKey": "xzrZuz04qmEu61ysrrnYBpZVmDQD7boYfIBTPJfvLZc="
5
5
  }
@@ -1 +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,l]=(0,n.useState)(!1),[o,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`,g=async()=>{if(!i){l(!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{l(!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,o?(0,t.jsx)("p",{className:"exchange-card-error",role:"alert",children:o}):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:()=>{g()},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 l(e){return window.addEventListener("popstate",e),window.addEventListener(i,e),()=>{window.removeEventListener("popstate",e),window.removeEventListener(i,e)}}function o(){return new URLSearchParams(window.location.search).get("id")}function c({id:e,onBack:i,onChanged:l}){let[o,u]=(0,n.useState)(null),[d,h]=(0,n.useState)(""),[f,g]=(0,n.useState)(0),p=(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)(()=>{o&&!m.current&&(m.current=!0,p.current?.focus())},[o]);let b=(0,t.jsx)("button",{type:"button",className:"pin-word ledger-detail-back",onClick:i,children:"← All exchanges"});if(!o)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:()=>g(e=>e+1),children:"Retry"})]}):(0,t.jsx)("p",{className:"ledger-state",role:"status",children:"Loading exchange…"})]});let{summary:v,events:y,packet:_}=o;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:p,tabIndex:-1,className:"ledger-detail-title",children:[(0,s.modeLabel)(v.mode),": ",(0,s.participantsLabel)(v)]}),(0,t.jsx)(r.default,{summary:v,onChanged:()=>{g(e=>e+1),l()}}),(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})]}),o.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:o.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),[g,p]=(0,n.useState)(s.DEFAULT_LEDGER_FILTER),m=(0,n.useSyncExternalStore)(l,o,()=>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))},w=e?(0,s.ledgerRows)(e,g):[],N=(0,s.ledgerView)(e,e?"":u,w),k=e?(0,s.ledgerAgents)(e):[];return(0,t.jsxs)("div",{className:m?"ledger-page has-detail":"ledger-page",children:[(0,t.jsxs)("header",{className:"ledger-head",children:[(0,t.jsx)(a.default,{href:"/",className:"cfg-link ledger-back",children:"← Back to chat"}),(0,t.jsx)("h1",{className:"ledger-title",children:"Agent Exchanges"}),(0,t.jsx)("p",{className:"ledger-sub",children:"Every Ask and Continue between Agent sessions, newest activity first."})]}),(0,t.jsxs)("main",{className:"ledger-main",children:[(0,t.jsxs)("section",{className:"ledger-list-pane","aria-labelledby":v,children:[(0,t.jsx)("h2",{id:v,ref:y,tabIndex:-1,className:"ledger-pane-title",children:"Exchanges"}),(0,t.jsxs)("div",{className:"ledger-filters",children:[(0,t.jsx)("div",{className:"sessions-filter ledger-mode",role:"group","aria-label":"Mode",children:s.MODE_FILTER_OPTIONS.map(e=>(0,t.jsx)("button",{type:"button",className:"sessions-filter-btn","aria-pressed":g.mode===e.value,onClick:()=>p(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:g.state,onChange:e=>p(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:g.agentId,onChange:e=>p(t=>({...t,agentId:e.target.value})),children:[(0,t.jsx)("option",{value:"",children:"Any Agent"}),k.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})]})]}),(0,t.jsx)("p",{className:"manage-count ledger-count",role:"status",children:e?`${w.length} of ${e.length} shown`:""})]}),"loading"===N?(0,t.jsx)("p",{className:"ledger-state",role:"status","data-ledger-state":"loading",children:"Loading exchanges…"}):null,"error"===N?(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"===N?(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"===N?(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:()=>p(s.DEFAULT_LEDGER_FILTER),children:"Clear filters"})]}):null,"rows"===N?(0,t.jsx)("ol",{className:"ledger-list","aria-label":"Exchanges, newest activity first",children:w.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`}let n="Not reported";function a(e){return e.toFixed(1).replace(/\.0$/,"")}function r(e){return e.toLocaleString("en-US")}function s(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 i={input_tokens:"Input tokens",output_tokens:"Output tokens",cost_usd:"Cost"};function l(e,t,n){return"cost_usd"===e?s(t):n?r(t):t<1e3?String(t):t<999950?`${a(t/1e3)}k`:t<99995e4?`${a(t/1e6)}M`:`${a(t/1e9)}B`}function o(e){return`${e} ${1===e?"run":"runs"}`}function c(e,t,a=!1){let r=i[e];if(!t||"unavailable"===t.quality||null===t.sum)return{name:r,text:n,quality:"unavailable",coverage:t&&t.total>0?`0 of ${o(t.total)} reported`:"No runs recorded",label:`${r}: not reported`};let s=l(e,t.sum,a),u=l(e,t.sum,!0);return"partial"===t.quality?{name:r,text:s,quality:"partial",coverage:`Partial: ${t.known} of ${o(t.total)} reported`,label:`${r}: at least ${u}, partial, reported by ${t.known} of ${o(t.total)}`}:{name:r,text:s,quality:"complete",coverage:`All ${o(t.total)} reported`,label:`${r}: ${u}, reported by all ${o(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){return"active"===e?`${t} has no active sessions.`:"ended"===e?`${t} has no ended sessions.`:`${t} has no sessions yet. One appears after a coding run keeps its runtime context.`},"formatSessionDate",0,t,"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=c("input_tokens",e?.input_tokens),a=c("output_tokens",e?.output_tokens),r=c("cost_usd",e?.cost_usd),s=[t,a,r];if(s.every(e=>"unavailable"===e.quality))return{text:n,label:"Usage: not reported",quality:"unavailable",partial:!1};let i=["unavailable"===t.quality?"input not reported":`${t.text} in`,"unavailable"===a.quality?"output not reported":`${a.text} out`,"unavailable"===r.quality?"cost not reported":r.text].join(" · "),l=s.some(e=>"partial"===e.quality),o=l||s.some(e=>"unavailable"===e.quality)?"partial":"complete";return{text:i,label:`Reported usage: ${s.map(e=>e.label).join("; ")}`,quality:o,partial:l}},"statusLabel",0,function(e){return"active"===e.status?"Active":"Ended"},"usageMetricView",0,c,"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?n:r(e.input_tokens),output:null===e.output_tokens?n:r(e.output_tokens),cost:null===e.cost_usd?n:s(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}],63352);let u={ask:"Ask from this context",resume:"Resume work here",handoff:"Hand off to…"},d=["queued","extracting","delivering","completed","failed","cancelled"],h=["completed","failed","cancelled"];function f(e,t){switch(t){case"queued":return"Queued";case"extracting":return"ask"===e?"Asking the session":"Extracting handoff";case"delivering":return"Delivering handoff";case"completed":return"ask"===e?"Answered":"Handed off";case"failed":return"Failed";case"cancelled":return"Cancelled"}}function g(e,t=140){let n=String(e??"").split("\n").map(e=>e.trim()).filter(e=>e.length>0).join(" ");return n.length>t?`${n.slice(0,t-1).trimEnd()}…`:n}function p(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&&d.includes(n.to)?n.to:null;return e?`Now ${f(t.mode,e).toLowerCase()}`:"State changed"}case"answer_returned":return`Answer returned to ${t.origin?.label??"the origin thread"}${n.truncated?" (shortened)":""}`;case"packet_extracted":return"Handoff packet extracted";case"packet_rejected":return`Handoff packet refused${"string"==typeof n.reason?`: ${n.reason}`:""}`;case"destination_replied":return`${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,g,"exchangeRequestBody",0,function(e,t,n){let a={mode:e.mode,idempotency_key:n,origin_conversation_id:e.originConversationId,source:{agent_id:t.agentId,session_ref:t.sessionRef},instruction:e.instruction.trim()};return"continue"===e.mode&&(a.destination={agent_id:e.destinationAgentId}),a},"failureAdvice",0,function(e){if("failed"!==e.state)return null;switch(e.failure?.code){case"packet_invalid":case"packet_missing":return"The source session did not return a usable handoff. Start a new Continue with a clearer objective.";case"destination_session_invalid":return"The destination did not start a fresh session. Check its runtime, then start a new Continue.";case"destination_turn_failed":return"Check the destination Agent’s runtime, then start a new Continue from the source session.";case"source_turn_failed":return"Check the source Agent’s runtime, then start a new exchange from its Sessions.";default:return"Start a new exchange from the session to try again."}},"formatExchangeTime",0,function(e){return t(e)},"instructionHeading",0,function(e){return"ask"===e?"Question":"Objective"},"ledgerAgents",0,function(e){let t=new Map;for(let n of e)t.set(n.source.agent_id,n.source.agent_name),n.destination&&t.set(n.destination.agent_id,n.destination.agent_name);return[...t.entries()].map(([e,t])=>({id:e,name:t})).sort((e,t)=>e.name.localeCompare(t.name)||e.id.localeCompare(t.id))},"ledgerRows",0,function(e,t){return e.filter(e=>("all"===t.mode||e.mode===t.mode)&&("active"!==t.state||!e.terminal)&&("all"===t.state||"active"===t.state||e.state===t.state)&&(!t.agentId||e.source.agent_id===t.agentId||e.destination?.agent_id===t.agentId)).sort(p)},"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…":f(e.mode,e.state)},"modeLabel",0,function(e){return"ask"===e?"Ask":"Continue"},"outcomeLine",0,function(e){if("completed"===e.state){if("ask"===e.mode){let t=e.origin?.label??"the origin thread";return e.outcome.answer?`Answer in ${t}: ${g(e.outcome.answer,200)}`:`Answered in ${t}.`}let t=e.destination?.agent_name??"The destination Agent";return e.outcome.reply?`${t} picked it up in a new session: ${g(e.outcome.reply,200)}`:`${t} picked it up in a new session.`}return"failed"===e.state?e.failure?.message||"The exchange failed.":"cancelled"===e.state?"Cancelled before it finished. Nothing more will run.":null},"participantsLabel",0,function(e){return"ask"===e.mode?`You → ${e.source.agent_name}`:`${e.source.agent_name} → ${e.destination?.agent_name??"another Agent"}`},"pinRequestBody",0,function(e,t,n,a,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 u["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:`${u.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:u[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 has no Agent Deck selected.";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),l=s._(e.r(71645)),o=e.r(95057),c=e.r(8372),u=e.r(18581),d=e.r(18967),h=e.r(5550),f=e.r(88540),g=e.r(91949),p=e.r(73668),m=e.r(9396);function x(t){var n;let a,r,s,[x,v]=(0,l.useOptimistic)(g.IDLE_LINK_STATUS),y=(0,l.useRef)(null),{href:_,as:j,children:w,prefetch:N=null,passHref:k,replace:$,shallow:S,scroll:C,onClick:E,onMouseEnter:T,onTouchStart:A,legacyBehavior:L=!1,onNavigate:I,transitionTypes:R,ref:O,unstable_dynamicOnHover:P,...U}=t;a=w,L&&("string"==typeof a||"number"==typeof a)&&(a=(0,i.jsx)("a",{children:a}));let q=l.default.useContext(c.AppRouterContext),D=!1!==N,F=!1===N?"none":!0===N?"full":"auto",M="none"!==F?"auto"===F?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,B="string"==typeof(n=j||_)?n:(0,o.formatUrl)(n);if(L){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=l.default.Children.only(a)}let H=L?r&&"object"==typeof r&&r.ref:O,K,Q=l.default.useCallback(e=>(null!==q&&(y.current=(0,g.mountLinkInstance)(e,B,q,M,D,v,K)),()=>{y.current&&((0,g.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,g.unmountPrefetchableInstance)(e)}),[D,B,q,M,v,K]),z={ref:(0,u.useMergedRef)(Q,H),onClick(t){L||"function"!=typeof E||E(t),L&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(t),!q||t.defaultPrevented||function(t,n,a,r,s,i,o,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,p.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);l.default.startTransition(()=>{h(n,r?"replace":"push",!1===s?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,a.current,o,c)})}}(t,B,y,$,C,I,R,F)},onMouseEnter(e){L||"function"!=typeof T||T(e),L&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),q&&D&&(0,g.onNavigationIntent)(e.currentTarget,!0===P)},onTouchStart:function(e){L||"function"!=typeof A||A(e),L&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),q&&D&&(0,g.onNavigationIntent)(e.currentTarget,!0===P)}};return(0,d.isAbsoluteUrl)(B)?z.href=B:L&&!k&&("a"!==r.type||"href"in r.props)||(z.href=(0,h.addBasePath)(B)),s=L?l.default.cloneElement(r,z):(0,i.jsx)("a",{...U,...z,children:a}),(0,i.jsx)(b.Provider,{value:x,children:s})}let b=(0,l.createContext)(g.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 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 o},searchParamsToUrlQuery:function(){return s},urlQueryToSearchParams:function(){return l}};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 l(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 o(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 l},formatWithValidation:function(){return c},urlObjectKeys:function(){return o}};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 l(e){let{auth:t,hostname:n}=e,a=e.protocol||"",r=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(s.urlQueryToSearchParams(o)));let u=e.search||o&&`?${o}`||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||i.test(a))&&!1!==c?(c="//"+(c||""),r&&"/"!==r[0]&&(r="/"+r)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),r=r.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${a}${c}${r}${u}${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 a={DecodeError:function(){return x},MiddlewareNotFoundError:function(){return _},MissingStaticPage:function(){return y},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return p},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 o},isResSent:function(){return h},loadGetInitialProps:function(){return g},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 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 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 g(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await g(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 p="u">typeof performance,m=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 _ 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})}}]);
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,l]=(0,n.useState)(!1),[o,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`,g=async()=>{if(!i){l(!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{l(!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,o?(0,t.jsx)("p",{className:"exchange-card-error",role:"alert",children:o}):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:()=>{g()},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 l(e){return window.addEventListener("popstate",e),window.addEventListener(i,e),()=>{window.removeEventListener("popstate",e),window.removeEventListener(i,e)}}function o(){return new URLSearchParams(window.location.search).get("id")}function c({id:e,onBack:i,onChanged:l}){let[o,u]=(0,n.useState)(null),[d,h]=(0,n.useState)(""),[f,g]=(0,n.useState)(0),p=(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)(()=>{o&&!m.current&&(m.current=!0,p.current?.focus())},[o]);let b=(0,t.jsx)("button",{type:"button",className:"pin-word ledger-detail-back",onClick:i,children:"← All exchanges"});if(!o)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:()=>g(e=>e+1),children:"Retry"})]}):(0,t.jsx)("p",{className:"ledger-state",role:"status",children:"Loading exchange…"})]});let{summary:v,events:y,packet:_}=o;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:p,tabIndex:-1,className:"ledger-detail-title",children:[(0,s.modeLabel)(v.mode),": ",(0,s.participantsLabel)(v)]}),(0,t.jsx)(r.default,{summary:v,onChanged:()=>{g(e=>e+1),l()}}),(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})]}),o.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:o.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),[g,p]=(0,n.useState)(s.DEFAULT_LEDGER_FILTER),m=(0,n.useSyncExternalStore)(l,o,()=>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))},w=e?(0,s.ledgerRows)(e,g):[],N=(0,s.ledgerView)(e,e?"":u,w),k=e?(0,s.ledgerAgents)(e):[];return(0,t.jsxs)("div",{className:m?"ledger-page has-detail":"ledger-page",children:[(0,t.jsxs)("header",{className:"ledger-head",children:[(0,t.jsx)(a.default,{href:"/",className:"cfg-link ledger-back",children:"← Back to chat"}),(0,t.jsx)("h1",{className:"ledger-title",children:"Agent Exchanges"}),(0,t.jsx)("p",{className:"ledger-sub",children:"Every Ask and Continue between Agent sessions, newest activity first."})]}),(0,t.jsxs)("main",{className:"ledger-main",children:[(0,t.jsxs)("section",{className:"ledger-list-pane","aria-labelledby":v,children:[(0,t.jsx)("h2",{id:v,ref:y,tabIndex:-1,className:"ledger-pane-title",children:"Exchanges"}),(0,t.jsxs)("div",{className:"ledger-filters",children:[(0,t.jsx)("div",{className:"sessions-filter ledger-mode",role:"group","aria-label":"Mode",children:s.MODE_FILTER_OPTIONS.map(e=>(0,t.jsx)("button",{type:"button",className:"sessions-filter-btn","aria-pressed":g.mode===e.value,onClick:()=>p(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:g.state,onChange:e=>p(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:g.agentId,onChange:e=>p(t=>({...t,agentId:e.target.value})),children:[(0,t.jsx)("option",{value:"",children:"Any Agent"}),k.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})]})]}),(0,t.jsx)("p",{className:"manage-count ledger-count",role:"status",children:e?`${w.length} of ${e.length} shown`:""})]}),"loading"===N?(0,t.jsx)("p",{className:"ledger-state",role:"status","data-ledger-state":"loading",children:"Loading exchanges…"}):null,"error"===N?(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"===N?(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"===N?(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:()=>p(s.DEFAULT_LEDGER_FILTER),children:"Clear filters"})]}):null,"rows"===N?(0,t.jsx)("ol",{className:"ledger-list","aria-label":"Exchanges, newest activity first",children:w.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`}let n="Not reported";function a(e){return e.toFixed(1).replace(/\.0$/,"")}function r(e){return e.toLocaleString("en-US")}function s(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 i={input_tokens:"Input tokens",output_tokens:"Output tokens",cost_usd:"Cost"};function l(e,t,n){return"cost_usd"===e?s(t):n?r(t):t<1e3?String(t):t<999950?`${a(t/1e3)}k`:t<99995e4?`${a(t/1e6)}M`:`${a(t/1e9)}B`}function o(e){return`${e} ${1===e?"run":"runs"}`}function c(e,t,a=!1){let r=i[e];if(!t||"unavailable"===t.quality||null===t.sum)return{name:r,text:n,quality:"unavailable",coverage:t&&t.total>0?`0 of ${o(t.total)} reported`:"No runs recorded",label:`${r}: not reported`};let s=l(e,t.sum,a),u=l(e,t.sum,!0);return"partial"===t.quality?{name:r,text:s,quality:"partial",coverage:`Partial: ${t.known} of ${o(t.total)} reported`,label:`${r}: at least ${u}, partial, reported by ${t.known} of ${o(t.total)}`}:{name:r,text:s,quality:"complete",coverage:`All ${o(t.total)} reported`,label:`${r}: ${u}, reported by all ${o(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){return"active"===e?`${t} has no active sessions.`:"ended"===e?`${t} has no ended sessions.`:`${t} has no sessions yet. One appears after a coding run keeps its runtime context.`},"formatSessionDate",0,t,"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=c("input_tokens",e?.input_tokens),a=c("output_tokens",e?.output_tokens),r=c("cost_usd",e?.cost_usd),s=[t,a,r];if(s.every(e=>"unavailable"===e.quality))return{text:n,label:"Usage: not reported",quality:"unavailable",partial:!1};let i=["unavailable"===t.quality?"input not reported":`${t.text} in`,"unavailable"===a.quality?"output not reported":`${a.text} out`,"unavailable"===r.quality?"cost not reported":r.text].join(" · "),l=s.some(e=>"partial"===e.quality),o=l||s.some(e=>"unavailable"===e.quality)?"partial":"complete";return{text:i,label:`Reported usage: ${s.map(e=>e.label).join("; ")}`,quality:o,partial:l}},"statusLabel",0,function(e){return"active"===e.status?"Active":"Ended"},"usageMetricView",0,c,"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?n:r(e.input_tokens),output:null===e.output_tokens?n:r(e.output_tokens),cost:null===e.cost_usd?n:s(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}],63352);let u={ask:"Ask from this context",resume:"Resume work here",handoff:"Hand off to…"},d=["queued","extracting","delivering","completed","failed","cancelled"],h=["completed","failed","cancelled"];function f(e,t){switch(t){case"queued":return"Queued";case"extracting":return"ask"===e?"Asking the session":"Extracting handoff";case"delivering":return"Delivering handoff";case"completed":return"ask"===e?"Answered":"Handed off";case"failed":return"Failed";case"cancelled":return"Cancelled"}}function g(e,t=140){let n=String(e??"").split("\n").map(e=>e.trim()).filter(e=>e.length>0).join(" ");return n.length>t?`${n.slice(0,t-1).trimEnd()}…`:n}function p(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&&d.includes(n.to)?n.to:null;return e?`Now ${f(t.mode,e).toLowerCase()}`:"State changed"}case"answer_returned":return`Answer returned to ${t.origin?.label??"the origin thread"}${n.truncated?" (shortened)":""}`;case"packet_extracted":return"Handoff packet extracted";case"packet_rejected":return`Handoff packet refused${"string"==typeof n.reason?`: ${n.reason}`:""}`;case"destination_replied":return`${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,g,"exchangeRequestBody",0,function(e,t,n){let a={mode:e.mode,idempotency_key:n,origin_conversation_id:e.originConversationId,source:{agent_id:t.agentId,session_ref:t.sessionRef},instruction:e.instruction.trim()};return"continue"===e.mode&&(a.destination={agent_id:e.destinationAgentId}),a},"failureAdvice",0,function(e){if("failed"!==e.state)return null;switch(e.failure?.code){case"packet_invalid":case"packet_missing":return"The source session did not return a usable handoff. Start a new Continue with a clearer objective.";case"destination_session_invalid":return"The destination did not start a fresh session. Check its runtime, then start a new Continue.";case"destination_turn_failed":return"Check the destination Agent’s runtime, then start a new Continue from the source session.";case"source_turn_failed":return"Check the source Agent’s runtime, then start a new exchange from its Sessions.";default:return"Start a new exchange from the session to try again."}},"formatExchangeTime",0,function(e){return t(e)},"instructionHeading",0,function(e){return"ask"===e?"Question":"Objective"},"ledgerAgents",0,function(e){let t=new Map;for(let n of e)t.set(n.source.agent_id,n.source.agent_name),n.destination&&t.set(n.destination.agent_id,n.destination.agent_name);return[...t.entries()].map(([e,t])=>({id:e,name:t})).sort((e,t)=>e.name.localeCompare(t.name)||e.id.localeCompare(t.id))},"ledgerRows",0,function(e,t){return e.filter(e=>("all"===t.mode||e.mode===t.mode)&&("active"!==t.state||!e.terminal)&&("all"===t.state||"active"===t.state||e.state===t.state)&&(!t.agentId||e.source.agent_id===t.agentId||e.destination?.agent_id===t.agentId)).sort(p)},"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…":f(e.mode,e.state)},"modeLabel",0,function(e){return"ask"===e?"Ask":"Continue"},"outcomeLine",0,function(e){if("completed"===e.state){if("ask"===e.mode){let t=e.origin?.label??"the origin thread";return e.outcome.answer?`Answer in ${t}: ${g(e.outcome.answer,200)}`:`Answered in ${t}.`}let t=e.destination?.agent_name??"The destination Agent";return e.outcome.reply?`${t} picked it up in a new session: ${g(e.outcome.reply,200)}`:`${t} picked it up in a new session.`}return"failed"===e.state?e.failure?.message||"The exchange failed.":"cancelled"===e.state?"Cancelled before it finished. Nothing more will run.":null},"participantsLabel",0,function(e){return"ask"===e.mode?`You → ${e.source.agent_name}`:`${e.source.agent_name} → ${e.destination?.agent_name??"another Agent"}`},"pinRequestBody",0,function(e,t,n,a,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 u["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:`${u.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:u[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),l=s._(e.r(71645)),o=e.r(95057),c=e.r(8372),u=e.r(18581),d=e.r(18967),h=e.r(5550),f=e.r(88540),g=e.r(91949),p=e.r(73668),m=e.r(9396);function x(t){var n;let a,r,s,[x,v]=(0,l.useOptimistic)(g.IDLE_LINK_STATUS),y=(0,l.useRef)(null),{href:_,as:j,children:w,prefetch:N=null,passHref:k,replace:$,shallow:S,scroll:C,onClick:E,onMouseEnter:T,onTouchStart:A,legacyBehavior:L=!1,onNavigate:I,transitionTypes:R,ref:O,unstable_dynamicOnHover:P,...U}=t;a=w,L&&("string"==typeof a||"number"==typeof a)&&(a=(0,i.jsx)("a",{children:a}));let q=l.default.useContext(c.AppRouterContext),D=!1!==N,F=!1===N?"none":!0===N?"full":"auto",M="none"!==F?"auto"===F?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,B="string"==typeof(n=j||_)?n:(0,o.formatUrl)(n);if(L){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=l.default.Children.only(a)}let H=L?r&&"object"==typeof r&&r.ref:O,K,Q=l.default.useCallback(e=>(null!==q&&(y.current=(0,g.mountLinkInstance)(e,B,q,M,D,v,K)),()=>{y.current&&((0,g.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,g.unmountPrefetchableInstance)(e)}),[D,B,q,M,v,K]),z={ref:(0,u.useMergedRef)(Q,H),onClick(t){L||"function"!=typeof E||E(t),L&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(t),!q||t.defaultPrevented||function(t,n,a,r,s,i,o,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,p.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);l.default.startTransition(()=>{h(n,r?"replace":"push",!1===s?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,a.current,o,c)})}}(t,B,y,$,C,I,R,F)},onMouseEnter(e){L||"function"!=typeof T||T(e),L&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),q&&D&&(0,g.onNavigationIntent)(e.currentTarget,!0===P)},onTouchStart:function(e){L||"function"!=typeof A||A(e),L&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),q&&D&&(0,g.onNavigationIntent)(e.currentTarget,!0===P)}};return(0,d.isAbsoluteUrl)(B)?z.href=B:L&&!k&&("a"!==r.type||"href"in r.props)||(z.href=(0,h.addBasePath)(B)),s=L?l.default.cloneElement(r,z):(0,i.jsx)("a",{...U,...z,children:a}),(0,i.jsx)(b.Provider,{value:x,children:s})}let b=(0,l.createContext)(g.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 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 o},searchParamsToUrlQuery:function(){return s},urlQueryToSearchParams:function(){return l}};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 l(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 o(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 l},formatWithValidation:function(){return c},urlObjectKeys:function(){return o}};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 l(e){let{auth:t,hostname:n}=e,a=e.protocol||"",r=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(s.urlQueryToSearchParams(o)));let u=e.search||o&&`?${o}`||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||i.test(a))&&!1!==c?(c="//"+(c||""),r&&"/"!==r[0]&&(r="/"+r)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),r=r.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${a}${c}${r}${u}${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 a={DecodeError:function(){return x},MiddlewareNotFoundError:function(){return _},MissingStaticPage:function(){return y},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return p},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 o},isResSent:function(){return h},loadGetInitialProps:function(){return g},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 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 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 g(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await g(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 p="u">typeof performance,m=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 _ 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})}}]);