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.
- package/CHANGELOG.md +26 -0
- package/README.md +13 -12
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +0 -2
- package/app/.next/build-manifest.json +3 -3
- package/app/.next/prerender-manifest.json +4 -4
- package/app/.next/required-server-files.json +2 -2
- package/app/.next/routes-manifest.json +0 -12
- package/app/.next/server/app/_global-error.html +1 -1
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/api/bots/[id]/config/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route.js +2 -2
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/shares/route.js +3 -3
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/shares/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/sessions/route.js +2 -2
- package/app/.next/server/app/api/bots/[id]/sessions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/share-policy/route.js +3 -3
- package/app/.next/server/app/api/bots/[id]/share-policy/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/skill/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/availability/route.js +3 -2
- package/app/.next/server/app/api/bots/availability/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/delete-preview/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/import/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/manage/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/name-migrations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/route.js +5 -5
- package/app/.next/server/app/api/bots/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/approve/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/deny/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/draft/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/messages/[messageId]/stop/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/messages/route.js +5 -5
- package/app/.next/server/app/api/conversations/[id]/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/stop/route.js +5 -5
- package/app/.next/server/app/api/conversations/[id]/stop/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/exchanges/[id]/cancel/route.js +2 -2
- package/app/.next/server/app/api/exchanges/[id]/cancel/route.js.nft.json +1 -1
- package/app/.next/server/app/api/exchanges/[id]/route.js +3 -3
- package/app/.next/server/app/api/exchanges/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/exchanges/route.js +3 -3
- package/app/.next/server/app/api/exchanges/route.js.nft.json +1 -1
- package/app/.next/server/app/api/files/[name]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/groups/route.js.nft.json +1 -1
- package/app/.next/server/app/api/health/route.js +3 -3
- package/app/.next/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/app/.next/server/app/api/messages/[id]/between/route.js.nft.json +1 -1
- package/app/.next/server/app/api/runtime-connections/route.js.nft.json +1 -1
- package/app/.next/server/app/api/service-grants/route.js.nft.json +1 -1
- package/app/.next/server/app/api/shares/[shareRef]/revoke/route.js +3 -3
- package/app/.next/server/app/api/shares/[shareRef]/revoke/route.js.nft.json +1 -1
- package/app/.next/server/app/api/shares/route.js +3 -3
- package/app/.next/server/app/api/shares/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js +3 -3
- package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js +3 -3
- package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js +2 -2
- package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js +3 -3
- package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/route.js +3 -3
- package/app/.next/server/app/api/v0/agents/[agentId]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js +3 -3
- package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js +3 -3
- package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/route.js +3 -3
- package/app/.next/server/app/api/v0/agents/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/capabilities/route.js +3 -3
- package/app/.next/server/app/api/v0/capabilities/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/conversations/[id]/route.js +2 -2
- package/app/.next/server/app/api/v0/conversations/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js +3 -3
- package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/exchanges/[id]/route.js +3 -3
- package/app/.next/server/app/api/v0/exchanges/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/exchanges/route.js +3 -3
- package/app/.next/server/app/api/v0/exchanges/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/mcp/route.js +3 -3
- package/app/.next/server/app/api/v0/mcp/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js +3 -3
- package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js +3 -3
- package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/pins/[pinRef]/route.js +3 -3
- package/app/.next/server/app/api/v0/pins/[pinRef]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/requests/[id]/route.js +2 -2
- package/app/.next/server/app/api/v0/requests/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js +3 -3
- package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js +3 -3
- package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/sessions/[ref]/shares/route.js +3 -3
- package/app/.next/server/app/api/v0/sessions/[ref]/shares/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/shares/[shareRef]/revoke/route.js +3 -3
- package/app/.next/server/app/api/v0/shares/[shareRef]/revoke/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/shares/[shareRef]/route.js +3 -3
- package/app/.next/server/app/api/v0/shares/[shareRef]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/shares/current/route.js +3 -3
- package/app/.next/server/app/api/v0/shares/current/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/shares/route.js +3 -3
- package/app/.next/server/app/api/v0/shares/route.js.nft.json +1 -1
- package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js +2 -2
- package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js.nft.json +1 -1
- package/app/.next/server/app/api/wakes/[id]/decision/route.js +2 -2
- package/app/.next/server/app/api/wakes/[id]/decision/route.js.nft.json +1 -1
- package/app/.next/server/app/api/wakes/[id]/retry/route.js +2 -2
- package/app/.next/server/app/api/wakes/[id]/retry/route.js.nft.json +1 -1
- package/app/.next/server/app/bots/[id]/config/page.js.nft.json +1 -1
- package/app/.next/server/app/bots/[id]/config/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/exchanges/page.js.nft.json +1 -1
- package/app/.next/server/app/exchanges/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/exchanges.html +1 -1
- package/app/.next/server/app/exchanges.rsc +3 -3
- package/app/.next/server/app/exchanges.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/exchanges.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/exchanges.segments/exchanges/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +3 -3
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/settings/page.js.nft.json +1 -1
- package/app/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/settings.html +1 -1
- package/app/.next/server/app/settings.rsc +3 -3
- package/app/.next/server/app/settings.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/threads/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/threads/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +0 -2
- package/app/.next/server/chunks/[root-of-the-server]__0792yb1._.js +44 -0
- package/app/.next/server/chunks/[root-of-the-server]__0d3fjix._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__0mp8bap._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__0qaiqut._.js +4 -4
- package/app/.next/server/chunks/[root-of-the-server]__0zrx1iz._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__10b5-i-._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__17mum5-._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__17xl_55._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__1j8fg_n._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__1x8phwp._.js +44 -0
- package/app/.next/server/chunks/[root-of-the-server]__200ep0k._.js +1 -1
- package/app/.next/server/chunks/_0061c2q._.js +1 -1
- package/app/.next/server/chunks/_057h7zr._.js +3 -0
- package/app/.next/server/chunks/_0a2do3x._.js +1 -1
- package/app/.next/server/chunks/_1-5mthb._.js +1 -1
- package/app/.next/server/chunks/lib_0-opbv7._.js +316 -0
- package/app/.next/server/chunks/lib_0aejojj._.js +316 -0
- package/app/.next/server/chunks/lib_0il0ml1._.js +316 -0
- package/app/.next/server/chunks/lib_0iujsdg._.js +316 -0
- package/app/.next/server/chunks/lib_0kik6bx._.js +20 -20
- package/app/.next/server/chunks/lib_0pe3tiv._.js +20 -20
- package/app/.next/server/chunks/lib_15adnlz._.js +109 -126
- package/app/.next/server/chunks/lib_1dehbst._.js +316 -0
- package/app/.next/server/chunks/lib_1z4vnh4._.js +316 -0
- package/app/.next/server/chunks/lib_1zc7-gl._.js +109 -126
- package/app/.next/server/chunks/lib_db_ts_1ttuckb._.js +58 -56
- package/app/.next/server/chunks/ssr/_0_fa0na._.js +1 -1
- package/app/.next/server/chunks/ssr/_0a6r_bx._.js +3 -0
- package/app/.next/server/chunks/ssr/_14d-lxn._.js +3 -0
- package/app/.next/server/chunks/ssr/_1cvuhjt._.js +1 -1
- package/app/.next/server/chunks/ssr/_1is_iwu._.js +3 -0
- package/app/.next/server/chunks/ssr/_1n5mvo5._.js +1 -1
- package/app/.next/server/chunks/ssr/_1o94bnv._.js +1 -1
- package/app/.next/server/chunks/ssr/app_bots_[id]_config_page_tsx_1e0uue9._.js +1 -1
- package/app/.next/server/middleware-build-manifest.js +3 -3
- package/app/.next/server/pages/404.html +1 -1
- package/app/.next/server/pages/500.html +1 -1
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/{22xbkclbkct3s.js → 1ouuczm-gmvxs.js} +1 -1
- package/app/.next/static/chunks/{2c953okoei6ip.js → 1w72fds3-utrx.js} +1 -1
- package/app/.next/static/chunks/2095-o17ji0fs.css +3 -0
- package/app/.next/static/chunks/2q-tgwkalrnms.js +1 -0
- package/app/.next/static/chunks/34bv9o9bjkwk0.js +3 -0
- package/app/.next/static/chunks/3rwwunh5sdjzg.js +1 -0
- package/app/.next/static/chunks/3whw2-l4a2sli.js +1 -0
- package/app/.next/static/chunks/3z3mn526_3fwd.js +1 -0
- package/app/BUILD_INFO.json +2 -2
- package/app/package.json +1 -1
- package/app/server.js +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +2 -2
- package/dist/product.d.ts +0 -1
- package/dist/product.js +12 -22
- package/dist/setup.js +9 -9
- package/package.json +1 -2
- package/schemas/botmancers.mcp.v2.tools.json +3 -3
- package/app/.next/server/app/api/agent-deck/decks/route/app-paths-manifest.json +0 -3
- package/app/.next/server/app/api/agent-deck/decks/route/build-manifest.json +0 -12
- package/app/.next/server/app/api/agent-deck/decks/route/server-reference-manifest.json +0 -4
- package/app/.next/server/app/api/agent-deck/decks/route.js +0 -9
- package/app/.next/server/app/api/agent-deck/decks/route.js.nft.json +0 -1
- package/app/.next/server/app/api/agent-deck/decks/route_client-reference-manifest.js +0 -3
- package/app/.next/server/app/api/agent-deck/settings/route/app-paths-manifest.json +0 -3
- package/app/.next/server/app/api/agent-deck/settings/route/build-manifest.json +0 -12
- package/app/.next/server/app/api/agent-deck/settings/route/server-reference-manifest.json +0 -4
- package/app/.next/server/app/api/agent-deck/settings/route.js +0 -9
- package/app/.next/server/app/api/agent-deck/settings/route.js.nft.json +0 -1
- package/app/.next/server/app/api/agent-deck/settings/route_client-reference-manifest.js +0 -3
- package/app/.next/server/chunks/[root-of-the-server]__0j4pjyg._.js +0 -3
- package/app/.next/server/chunks/[root-of-the-server]__0mo_kn3._.js +0 -48
- package/app/.next/server/chunks/[root-of-the-server]__1bhzfu_._.js +0 -7
- package/app/.next/server/chunks/[root-of-the-server]__1g_n99l._.js +0 -3
- package/app/.next/server/chunks/[root-of-the-server]__1t4ybp2._.js +0 -48
- package/app/.next/server/chunks/_next-internal_server_app_api_agent-deck_decks_route_actions_0yguyfv.js +0 -3
- package/app/.next/server/chunks/_next-internal_server_app_api_agent-deck_settings_route_actions_0z_nbkb.js +0 -3
- package/app/.next/server/chunks/lib_0v4d9w0._.js +0 -339
- package/app/.next/server/chunks/lib_0zzo6zb._.js +0 -339
- package/app/.next/server/chunks/lib_1_u7n-u._.js +0 -339
- package/app/.next/server/chunks/lib_1muhwn7._.js +0 -339
- package/app/.next/server/chunks/lib_1xnxg-q._.js +0 -339
- package/app/.next/server/chunks/ssr/_1i02yyi._.js +0 -3
- package/app/.next/server/chunks/ssr/app_components_AgentDeckRuntime_tsx_024janf._.js +0 -3
- package/app/.next/server/chunks/ssr/app_settings_page_tsx_1t-rdz-._.js +0 -3
- package/app/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_1ztp13a._.js +0 -3
- package/app/.next/static/chunks/0jon21u-9j2aw.css +0 -3
- package/app/.next/static/chunks/14k6cvywgknx2.js +0 -3
- package/app/.next/static/chunks/1ku9himlsx-hn.js +0 -1
- package/app/.next/static/chunks/1r5tqd-7h1xjn.js +0 -1
- package/app/.next/static/chunks/21aqekm5z0j47.js +0 -1
- package/app/.next/static/chunks/2t_2gf3xoxz_m.js +0 -1
- package/app/.next/static/chunks/34vnvo1qssbaj.js +0 -1
- /package/app/.next/static/{_yrIZIFsIbXA0Gaxkytjd → A9sQnaf9i6YzjHNoPgRfU}/_buildManifest.js +0 -0
- /package/app/.next/static/{_yrIZIFsIbXA0Gaxkytjd → A9sQnaf9i6YzjHNoPgRfU}/_clientMiddlewareManifest.js +0 -0
- /package/app/.next/static/{_yrIZIFsIbXA0Gaxkytjd → A9sQnaf9i6YzjHNoPgRfU}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31713,e=>{"use strict";var t=e.i(43476),s=e.i(71645),n=e.i(22016),a=e.i(57688);function r(e){let t,s=e.match(/^\s*\[run\]\s*([\s\S]*)$/);if(!s)return null;try{t=JSON.parse(s[1])}catch{return null}if(!t||"object"!=typeof t)return null;let n=t,a="string"==typeof n.page?n.page:"string"==typeof n.html?n.html:void 0,r=void 0===a?{}:{page:a,html:a};return"running"===n.state||"stopped"===n.state?{state:n.state,...r}:"done"===n.state&&"string"==typeof n.output?{state:"done",output:n.output,...r}:null}function i(e){return"done"===e.state?e.output??"":"stopped"===e.state?"The command was stopped.":"The command is running"}var l=e.i(87303);function o(e){let t,s=e.match(/^\s*\[draft\]\s*([\s\S]*)$/);if(!s)return null;try{t=JSON.parse(s[1])}catch{return null}if(!t||"object"!=typeof t)return null;let n=t;return"email"!==n.channel&&"slack"!==n.channel||"open"!==n.state&&"sent"!==n.state&&"discarded"!==n.state||"string"!=typeof n.recipient||"string"!=typeof n.body?null:{channel:n.channel,recipient:n.recipient,body:n.body,state:n.state}}function d(e){let t=e.match(/approve using the code ([A-Za-z0-9][A-Za-z0-9_-]*)/i);return t?t[1]:null}var c=e.i(74904),u=e.i(33851),h=e.i(44079),m=e.i(52900),p=e.i(68541),f=e.i(15983),g=e.i(10718);function x(e){return String(e).padStart(2,"0")}function b(e){let t=new Date(e);return`${t.getFullYear()}-${x(t.getMonth()+1)}-${x(t.getDate())} ${x(t.getHours())}:${x(t.getMinutes())}`}function y({onClose:e,onDeleted:n}){let a=(0,s.useId)(),[r,i]=(0,s.useState)(null),[l,o]=(0,s.useState)(""),[d,u]=(0,s.useState)(""),[h,m]=(0,s.useState)([]),[p,x]=(0,s.useState)(!1),j=(0,s.useRef)(null),v=(0,s.useRef)(null),w=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=!1;return fetch("/api/bots/manage",{cache:"no-store"}).then(async t=>{let s=await t.json().catch(()=>null);if(!e){if(!t.ok||!Array.isArray(s))return void o("string"==typeof s?.error?s.error:"Could not load agents.");i(s)}}).catch(()=>{e||o("Could not load agents.")}),j.current?.focus(),()=>{e=!0}},[]);let N=d.trim().toLowerCase(),S=(r??[]).filter(e=>e.name.toLowerCase().includes(N)),k=S.filter(e=>!e.blocked);return(0,s.useEffect)(()=>{if(p)return;let t=t=>{"Escape"===t.key&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[p,e]),(0,t.jsxs)("div",{className:"modal-scrim manage-scrim",children:[(0,t.jsxs)("div",{ref:w,className:"manage-card",role:"dialog","aria-modal":"true","aria-labelledby":a,onKeyDown:e=>{if("Tab"!==e.key||!w.current)return;let t=Array.from(w.current.querySelectorAll("button:not(:disabled), input:not(:disabled)"));if(0===t.length)return;let s=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===s?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n||(e.preventDefault(),s.focus())},children:[(0,t.jsxs)("div",{className:"manage-head",children:[(0,t.jsx)("h2",{id:a,className:"delete-title",children:"Manage agents"}),(0,t.jsx)("button",{type:"button",className:"cancel-btn",onClick:e,children:"Close"})]}),(0,t.jsx)("label",{className:"manage-search-label",htmlFor:`${a}-search`,children:"Filter by name"}),(0,t.jsx)("input",{id:`${a}-search`,ref:j,className:"manage-search",type:"search",value:d,onChange:e=>u(e.target.value),placeholder:"Name contains…"}),(0,t.jsxs)("div",{className:"manage-tools",children:[(0,t.jsx)("button",{type:"button",className:"pin-word",onClick:()=>{m(e=>Array.from(new Set([...e,...k.map(e=>e.id)])))},disabled:0===k.length,children:"Select all shown"}),(0,t.jsx)("button",{type:"button",className:"pin-word",onClick:()=>{m([]),j.current?.focus()},disabled:0===h.length,children:"Clear selection"}),(0,t.jsxs)("span",{className:"manage-count","aria-live":"polite",children:[h.length," selected · ",S.length," shown of ",r?.length??0]})]}),l?(0,t.jsx)("p",{className:"delete-error",role:"alert",children:l}):null,r||l?null:(0,t.jsx)("p",{className:"delete-copy",children:"Loading agents…"}),r?(0,t.jsxs)("ul",{className:"manage-list","aria-label":"Agents",children:[0===S.length?(0,t.jsx)("li",{className:"delete-copy",children:"No agents match."}):null,S.map(e=>{let s=`${a}-row-${e.id}`,n=(0,c.botConnectionLabel)(e)??"Not set";return(0,t.jsxs)("li",{className:e.blocked?"manage-row is-blocked":"manage-row","data-agent-id":e.id,children:[(0,t.jsx)("input",{id:s,type:"checkbox",checked:h.includes(e.id),disabled:!!e.blocked,onChange:()=>{var t;return t=e.id,void m(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},"aria-describedby":e.blocked?`${s}-reason`:void 0}),(0,t.jsxs)("div",{className:"manage-copy",children:[(0,t.jsxs)("label",{htmlFor:s,className:"manage-name",children:[e.name,e.hidden?(0,t.jsx)("span",{className:"manage-tag",children:"Hidden"}):null]}),(0,t.jsxs)("dl",{className:"manage-meta",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Agent"}),(0,t.jsx)("dd",{children:(0,c.botAgentLabel)(e)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Connection"}),(0,t.jsx)("dd",{children:n})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Source"}),(0,t.jsx)("dd",{children:e.source_provider||"Created here"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Created"}),(0,t.jsx)("dd",{children:b(e.created_at)})]}),e.last_activity?(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Last activity"}),(0,t.jsx)("dd",{children:b(e.last_activity)})]}):null]}),e.blocked?(0,t.jsx)("p",{id:`${s}-reason`,className:"manage-reason",children:(0,g.blockedReasonCopy)(e.blocked)}):null]})]},e.id)})]}):null,(0,t.jsxs)("div",{className:"form-actions manage-actions",children:[(0,t.jsx)("button",{type:"button",className:"cancel-btn",onClick:e,children:"Cancel"}),(0,t.jsxs)("button",{ref:v,type:"button",className:"delete-btn",disabled:0===h.length,onClick:()=>x(!0),children:["Delete selected",h.length>0?` (${h.length})`:""]})]})]}),p?(0,t.jsx)(f.default,{ids:h,onCancel:()=>{x(!1),requestAnimationFrame(()=>v.current?.focus())},onDeleted:n}):null]})}var j=e.i(63352);function v(e,t,s){if(0===e.length)return null;let n=e[0],a=e[e.length-1],r=null!==t&&e.includes(t);return s?r&&t!==n?null:a:r&&t!==a?null:n}let w='a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])';var N=e.i(50814);function S({mode:e,session:n,agents:a,origin:r,onClose:i,onStarted:l}){let o=(0,s.useId)(),d=(0,s.useId)(),c=(0,s.useId)(),u=(0,s.useId)(),[h,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[g,x]=(0,s.useState)(!1),[b,y]=(0,s.useState)({}),[k,C]=(0,s.useState)(""),[_,R]=(0,s.useState)(!1),E=(0,s.useRef)(!1),I=(0,s.useRef)(null),$=(0,s.useRef)(null),A=(0,s.useRef)(null),T=(0,s.useRef)(null),P=(0,s.useRef)(null),D=(0,N.sessionDialogUsesPin)(e,n.route),O=a.filter(e=>e.id!==n.agent.id);(0,s.useEffect)(()=>{("continue"===e?T.current:A.current)?.focus()},[e]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(e.stopPropagation(),i())};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[i]);let L=async t=>{if(t.preventDefault(),E.current)return;let s={mode:"resume"===e?"ask":e,instruction:h,originConversationId:r.conversationId,destinationAgentId:p},a="resume"===e?(0,N.validateResumeDraft)(h,g):(0,N.validateDraft)(s);if(y(a),Object.keys(a).length>0)return void(a.destination?T.current?.focus():a.instruction?A.current?.focus():P.current?.focus());let i="resume"===e?"resume":"ask",o=e=>D?(0,N.pinRequestBody)(i,h,r.conversationId,g,e):(0,N.exchangeRequestBody)(s,{agentId:n.agent.id,sessionRef:n.ref},e),d=JSON.stringify(o(""));I.current&&I.current.payload===d||(I.current={payload:d,key:crypto.randomUUID()}),E.current=!0,R(!0),C("");try{let e=D?`/api/bots/${encodeURIComponent(n.agent.id)}/sessions/${encodeURIComponent(n.ref)}/pins`:"/api/exchanges",t=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o(I.current.key))}),s=await t.json().catch(()=>null);if(!t.ok){let e="string"==typeof s?.error?.code?s.error.code:null;"idempotency_conflict"===e&&(I.current=null),C((0,N.submitErrorMessage)(e,"string"==typeof s?.error?.message?s.error.message:null));return}let a=D?s?.turn?.exchange_id:s?.exchange?.id;l("string"==typeof a?a:null)}catch{C((0,N.submitErrorMessage)(null,"Botmancers could not be reached. Your draft is kept; try again."))}finally{E.current=!1,R(!1)}},M=O.find(e=>e.id===p)?.name,F="ask"===e,U="resume"===e;return(0,t.jsx)("div",{className:"modal-scrim exchange-scrim",onMouseDown:e=>{e.target===e.currentTarget&&i()},onKeyDown:e=>{if("Tab"!==e.key||!$.current)return;let t=v(Array.from($.current.querySelectorAll(w)),document.activeElement,e.shiftKey);t&&(e.preventDefault(),t.focus())},children:(0,t.jsxs)("div",{ref:$,className:"form-card exchange-dialog",role:"dialog","aria-modal":"true","aria-labelledby":o,"data-exchange-mode":e,children:[(0,t.jsx)("h2",{id:o,className:"delete-title",children:(0,N.sessionDialogTitle)(e)}),(0,t.jsxs)("section",{className:"exchange-source","aria-label":"Source session",children:[(0,t.jsx)("p",{className:"exchange-source-agent",children:n.agent.name}),(0,t.jsx)("p",{className:"exchange-source-title",children:n.title}),(0,t.jsxs)("p",{className:"exchange-source-meta",children:["Last activity ",(0,j.formatSessionDate)(n.last_activity_at),n.origin.conversation?` \xb7 from ${n.origin.conversation.label}`:""]})]}),(0,t.jsxs)("form",{onSubmit:L,noValidate:!0,className:"exchange-form",children:[F||U?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("label",{htmlFor:c,children:"Hand off to"}),(0,t.jsxs)("select",{ref:T,id:c,className:"exchange-select",value:p,"aria-invalid":!!b.destination||void 0,"aria-describedby":b.destination?`${c}-error`:void 0,disabled:_,onChange:e=>{f(e.target.value),y(e=>({...e,destination:void 0}))},children:[(0,t.jsx)("option",{value:"",children:"Choose an Agent"}),O.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]}),b.destination?(0,t.jsx)("p",{id:`${c}-error`,className:"exchange-field-error",children:b.destination}):null]}),(0,t.jsx)("label",{htmlFor:d,children:F?"Question":U?"Instruction":"Objective"}),(0,t.jsx)("textarea",{ref:A,id:d,rows:4,maxLength:N.INSTRUCTION_LIMIT,value:h,readOnly:_,"aria-invalid":!!b.instruction||void 0,"aria-describedby":`${d}-hint${b.instruction?` ${d}-error`:""}`,onChange:e=>{m(e.target.value),y(e=>({...e,instruction:void 0}))}}),b.instruction?(0,t.jsx)("p",{id:`${d}-error`,className:"exchange-field-error",children:b.instruction}):null,(0,t.jsx)("p",{id:`${d}-hint`,className:"exchange-hint",children:F?`${n.agent.name} answers from this exact session, read-only. The answer arrives in ${r.label}.`:U?`${n.agent.name} resumes work in this exact session and may edit its workspace. The turn never moves to another session. Progress shows in ${r.label}.`:`${M??"The Agent you choose"} receives an extracted handoff (objective, decisions, constraints, references, open questions) and starts a new session of its own. ${n.agent.name}’s session is not shared and is not changed. Progress shows in ${r.label}.`}),U?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("label",{className:"exchange-approval",htmlFor:u,children:[(0,t.jsx)("input",{ref:P,id:u,type:"checkbox",checked:g,disabled:_,"aria-invalid":!!b.approval||void 0,"aria-describedby":b.approval?`${u}-error`:void 0,onChange:e=>{x(e.target.checked),y(e=>({...e,approval:void 0}))}})," ","I approve edits by ",n.agent.name," in this session"]}),b.approval?(0,t.jsx)("p",{id:`${u}-error`,className:"exchange-field-error",children:b.approval}):null]}):null,k?(0,t.jsx)("p",{className:"exchange-server-error",role:"alert",children:k}):null,(0,t.jsx)("p",{className:"exchange-sending",role:"status",children:_?"Sending…":""}),(0,t.jsxs)("div",{className:"form-actions",children:[(0,t.jsx)("button",{type:"button",className:"cancel-btn",onClick:i,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",className:"create-btn",disabled:_,"aria-disabled":_,children:k?"Try again":"Send"})]})]})]})})}var k=e.i(24204);function C(){return"u">typeof crypto&&"function"==typeof crypto.randomUUID?`owner-share-${crypto.randomUUID()}`:`owner-share-${Date.now()}-${Math.random().toString(36).slice(2)}`}function _({row:e,shares:a,policy:r,onChanged:i}){let l=(0,s.useId)(),[o,d]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!1),h=a?(0,k.sessionShares)(a,e.ref):[],m=h.filter(k.shareIsLive),p=h.filter(e=>!(0,k.shareIsLive)(e)),f="loading"===r,g="loading"===r?null:r,x=f?null:(0,k.shareCreateAvailability)(e,g),b=c?p:p.slice(0,3*!m.length);return(0,t.jsxs)("section",{className:"session-shares","aria-labelledby":l,"data-session-shares":e.ref,children:[(0,t.jsxs)("div",{className:"session-shares-head",children:[(0,t.jsx)("h3",{id:l,className:"session-shares-title",children:"Slack share"}),x?.available&&!o?(0,t.jsx)("button",{type:"button",className:"session-action","data-share-action":"create",onClick:()=>d(!0),children:"Share to Slack"}):null]}),f?(0,t.jsx)("p",{className:"session-share-note session-share-loading",role:"status",children:"Checking the share policy…"}):null,x&&!x.available?(0,t.jsxs)("p",{className:"session-share-unavailable",children:[x.reason," ",x.configHref?(0,t.jsx)(n.default,{className:"session-link",href:x.configHref,children:"Open Config"}):null]}):null,o&&g?(0,t.jsx)(E,{row:e,policy:g,onCancel:()=>d(!1),onCreated:()=>{d(!1),i()}}):null,null===a?(0,t.jsx)("p",{className:"session-share-note",role:"status",children:"Loading shares…"}):null,null===a||0!==h.length||o?null:(0,t.jsx)("p",{className:"session-share-note",children:"Not shared."}),m.length+b.length>0?(0,t.jsx)("ul",{className:"session-share-list","aria-label":`Slack shares of ${e.title}`,children:[...m,...b].map(e=>(0,t.jsx)(R,{share:e,onChanged:i},e.share_ref))}):null,p.length>b.length?(0,t.jsxs)("button",{type:"button",className:"pin-word",onClick:()=>u(!0),children:["Show ",p.length-b.length," ended share",p.length-b.length==1?"":"s"]}):null]})}function R({share:e,onChanged:n}){let[a,r]=(0,s.useState)(!1),[i,l]=(0,s.useState)(!1),[o,d]=(0,s.useState)(""),[c,u]=(0,s.useState)(!1),h=(0,k.shareIsLive)(e),m=async()=>{try{await navigator.clipboard.writeText(e.share_ref),u(!0)}catch{d("Copy failed. Select the reference instead.")}},p=async()=>{l(!0),d("");try{let t=await fetch(`/api/shares/${encodeURIComponent(e.share_ref)}/revoke`,{method:"POST"}),s=await t.json().catch(()=>null);t.ok?(r(!1),n()):d("string"==typeof s?.error?.message?s.error.message:"The share could not be revoked.")}catch{d("The share could not be revoked.")}finally{l(!1)}};return(0,t.jsxs)("li",{className:`session-share is-${e.status}`,"data-share-ref":e.share_ref,"data-share-status":e.status,children:[(0,t.jsxs)("div",{className:"session-share-head",children:[(0,t.jsx)("span",{className:`manage-tag session-share-status is-${e.status}`,children:k.SHARE_STATUS_LABELS[e.status]}),(0,t.jsx)("span",{className:"session-share-audience",children:(0,k.audienceLabel)(e.audience)})]}),(0,t.jsxs)("dl",{className:"manage-meta session-share-meta",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Expiry"}),(0,t.jsx)("dd",{children:(0,k.expiryLabel)(e)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Questions"}),(0,t.jsx)("dd",{children:(0,k.turnsLabel)(e)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Thread"}),(0,t.jsx)("dd",{children:(0,k.threadLabel)(e)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Reference"}),(0,t.jsx)("dd",{children:(0,t.jsx)("code",{className:"session-share-ref",children:e.share_ref})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Origin"}),(0,t.jsxs)("dd",{children:[(0,k.createdByLabel)(e)," · read-only Ask"]})]})]}),(0,t.jsx)("p",{className:"session-share-note",children:(0,k.shareStatusNote)(e)}),(0,t.jsxs)("div",{className:"session-actions",role:"group","aria-label":"Share actions",children:[(0,t.jsx)("button",{type:"button",className:"pin-word","data-share-action":"copy",onClick:()=>{m()},children:c?"Copied":"Copy reference"}),h&&!a?(0,t.jsx)("button",{type:"button",className:"session-action session-share-revoke","data-share-action":"revoke",onClick:()=>r(!0),children:"Revoke"}):null]}),a?(0,t.jsxs)("div",{className:"session-share-confirm",role:"group","aria-label":"Confirm revoke",children:[(0,t.jsx)("p",{children:"Revoke this share? The next Slack question in its thread gets the revoked notice. This can’t be undone."}),(0,t.jsxs)("div",{className:"session-actions",children:[(0,t.jsx)("button",{type:"button",className:"session-action session-share-revoke","data-share-action":"confirm-revoke",disabled:i,onClick:()=>{p()},children:i?"Revoking…":"Revoke share"}),(0,t.jsx)("button",{type:"button",className:"pin-word",disabled:i,onClick:()=>r(!1),children:"Keep it"})]})]}):null,o?(0,t.jsx)("p",{className:"delete-error",role:"alert",children:o}):null]})}function E({row:e,policy:n,onCancel:a,onCreated:r}){let i={channel:(0,s.useId)(),duration:(0,s.useId)(),turns:(0,s.useId)()},[l,o]=(0,s.useState)(0),[d,c]=(0,s.useState)(n.limits.ttl_seconds.default),[u,h]=(0,s.useState)(String(n.limits.max_turns.default)),[m]=(0,s.useState)(C),[p,f]=(0,s.useState)(!1),[g,x]=(0,s.useState)(""),b=Number(u),y=Number.isInteger(b)&&b>=n.limits.max_turns.min&&b<=n.limits.max_turns.max,j=async t=>{if(t.preventDefault(),y){f(!0),x("");try{let t=await fetch(`/api/bots/${encodeURIComponent(e.agent.id)}/sessions/${encodeURIComponent(e.ref)}/shares`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify((0,k.shareCreateBody)(n.audiences[l],d,b,m))}),s=await t.json().catch(()=>null);t.ok?r():x("string"==typeof s?.error?.message?s.error.message:"The share could not be created.")}catch{x("The share could not be created.")}finally{f(!1)}}};return(0,t.jsxs)("form",{className:"session-share-form",onSubmit:e=>{j(e)},"aria-label":`Share ${e.title} to Slack`,children:[(0,t.jsxs)("p",{className:"session-share-note",children:["Shares ",(0,t.jsx)("strong",{children:e.title})," (",e.agent.name,") as a read-only Ask: Slack replies in the share’s thread ask exactly this session."]}),(0,t.jsx)("label",{htmlFor:i.channel,children:"Slack channel"}),(0,t.jsx)("select",{id:i.channel,value:l,onChange:e=>o(Number(e.target.value)),disabled:p,children:n.audiences.map((e,s)=>(0,t.jsx)("option",{value:s,children:(0,k.audienceLabel)(e)},`${e.team_id}:${e.channel_id}`))}),(0,t.jsx)("label",{htmlFor:i.duration,children:"Expires after"}),(0,t.jsx)("select",{id:i.duration,value:d,onChange:e=>c(Number(e.target.value)),disabled:p,children:k.SHARE_DURATIONS.map(e=>(0,t.jsx)("option",{value:e.seconds,children:e.label},e.seconds))}),(0,t.jsx)("label",{htmlFor:i.turns,children:"Questions allowed"}),(0,t.jsx)("input",{id:i.turns,type:"number",inputMode:"numeric",min:n.limits.max_turns.min,max:n.limits.max_turns.max,value:u,onChange:e=>h(e.target.value),disabled:p,"aria-invalid":!y}),y?null:(0,t.jsxs)("p",{className:"delete-error",children:["Questions allowed must be a whole number from ",n.limits.max_turns.min," to ",n.limits.max_turns.max,"."]}),g?(0,t.jsx)("p",{className:"delete-error",role:"alert",children:g}):null,(0,t.jsxs)("div",{className:"session-actions",children:[(0,t.jsx)("button",{type:"submit",className:"session-action","data-share-action":"submit",disabled:p||!y,children:p?"Sharing…":"Create share"}),(0,t.jsx)("button",{type:"button",className:"pin-word",onClick:a,disabled:p,children:"Cancel"})]})]})}function I({agentId:e,agentName:a,agents:r,origin:i,onClose:l,onOpenThread:o,onExchangeStarted:d}){let c=(0,s.useId)(),[u,h]=(0,s.useState)("all"),[m,p]=(0,s.useState)(null),[f,g]=(0,s.useState)(""),[x,b]=(0,s.useState)(0),[y,v]=(0,s.useState)(null),w=(0,s.useRef)(null),k=(0,s.useRef)(null),[C,_]=(0,s.useState)(null),[R,E]=(0,s.useState)(null),[A,T]=(0,s.useState)(null),[P,D]=(0,s.useState)("loading"),[O,L]=(0,s.useState)(0),M=(0,s.useRef)(null),F=()=>{M.current=C?.returnTo??null,_(null)};(0,s.useEffect)(()=>{if(C||!M.current)return;let e=M.current;M.current=null,e.isConnected&&e.focus()},[C]),(0,s.useEffect)(()=>{k.current?.focus()},[]),(0,s.useEffect)(()=>{let t=!1;return fetch(`/api/bots/${encodeURIComponent(e)}/sessions?status=${u}`,{cache:"no-store"}).then(async e=>{let s=await e.json().catch(()=>null);if(!t){if(!e.ok||!Array.isArray(s?.sessions))return void g("string"==typeof s?.error?s.error:"Could not load sessions.");p(s.sessions)}}).catch(()=>{t||g("Could not load sessions.")}),()=>{t=!0}},[e,u,x]),(0,s.useEffect)(()=>{let t=!1,s=encodeURIComponent(e);return fetch(`/api/bots/${s}/share-policy`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{t||D(e?.policy??null)}).catch(()=>{t||D(null)}),fetch(`/api/shares?agent_id=${s}&limit=100`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{t||T(Array.isArray(e?.shares)?e.shares:[])}).catch(()=>{t||T([])}),()=>{t=!0}},[e,O]),(0,s.useEffect)(()=>{let e=setInterval(()=>L(e=>e+1),15e3);return()=>clearInterval(e)},[]);let U=(e=u)=>{p(null),g(""),h(e),b(e=>e+1)};return(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&l()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[l]),(0,t.jsxs)("div",{className:"modal-scrim sessions-scrim",onMouseDown:e=>{e.target!==e.currentTarget||C||l()},children:[(0,t.jsxs)("div",{ref:w,className:"sessions-drawer",role:"dialog","aria-modal":"true","aria-labelledby":c,onKeyDown:e=>{if("Tab"!==e.key||!w.current)return;let t=Array.from(w.current.querySelectorAll("button:not(:disabled), summary, select:not(:disabled), input:not(:disabled), a[href]"));if(0===t.length)return;let s=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===s?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n||(e.preventDefault(),s.focus())},inert:!!C,children:[(0,t.jsxs)("div",{className:"manage-head",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{id:c,className:"delete-title sessions-title",children:"Sessions"}),(0,t.jsx)("p",{className:"sessions-sub",children:a})]}),(0,t.jsx)("button",{ref:k,type:"button",className:"cancel-btn",onClick:l,children:"Close"})]}),(0,t.jsxs)("div",{className:"sessions-filter",role:"group","aria-label":"Show sessions",children:[j.SESSION_FILTER_OPTIONS.map(e=>(0,t.jsx)("button",{type:"button",className:"sessions-filter-btn","aria-pressed":u===e.value,onClick:()=>{u!==e.value&&U(e.value)},children:e.label},e.value)),(0,t.jsx)("span",{className:"manage-count","aria-live":"polite",children:m?`${m.length} shown`:""})]}),(0,t.jsx)("div",{className:"exchange-started",role:"status",children:R?(0,t.jsxs)(t.Fragment,{children:[R.text," ",R.id?(0,t.jsx)(n.default,{className:"session-link",href:(0,N.detailsHref)(R.id),children:"View in Exchanges"}):null]}):null}),f?(0,t.jsxs)("div",{className:"sessions-state",role:"alert",children:[(0,t.jsx)("p",{className:"delete-error",children:f}),(0,t.jsx)("button",{type:"button",className:"pin-word",onClick:()=>U(),children:"Retry"})]}):null,m||f?null:(0,t.jsx)("p",{className:"delete-copy sessions-state",role:"status",children:"Loading sessions…"}),m?(0,t.jsxs)("ul",{className:"manage-list sessions-list","aria-label":`Sessions for ${a}`,children:[0===m.length?(0,t.jsx)("li",{className:"delete-copy sessions-state",children:(0,j.emptySessionsCopy)(u,a)}):null,m.map(s=>(0,t.jsx)($,{agentId:e,row:s,open:y===s.ref,onToggle:()=>v(e=>e===s.ref?null:s.ref),onOpenThread:o,onAction:(e,t)=>{E(null),_({mode:e,row:s,returnTo:t})},shares:A,sharePolicy:P,onSharesChanged:()=>L(e=>e+1)},s.ref))]}):null]}),C?(0,t.jsx)(S,{mode:C.mode,session:C.row,agents:r,origin:i,onClose:F,onStarted:e=>{E({id:e,text:"ask"===C.mode?`Asked ${C.row.agent.name}’s session. The answer arrives in ${i.label}.`:"resume"===C.mode?`Resumed work in ${C.row.agent.name}’s session. Progress shows in ${i.label}.`:`Handoff started from ${C.row.agent.name}’s session. Progress shows in ${i.label}.`}),F(),d(e)}}):null]})}function $({agentId:e,row:n,open:a,onToggle:r,onOpenThread:i,onAction:l,shares:o,sharePolicy:d,onSharesChanged:c}){let u=(0,s.useId)(),h=(0,N.sessionRowActions)(n),m=h.filter(e=>e.availability.available),p=h.flatMap(e=>e.availability.available?[]:[e.availability.reason]),f=n.origin.conversation,g=(0,j.workRequestLabel)(n),x=(0,j.sessionUsageLine)(n.usage);return(0,t.jsx)("li",{className:`manage-row session-row is-${n.status}`,"data-session-ref":n.ref,children:(0,t.jsxs)("div",{className:"manage-copy",children:[(0,t.jsxs)("div",{className:"session-head",children:[(0,t.jsx)("span",{className:"session-title",children:n.title}),(0,t.jsx)("span",{className:`manage-tag session-status is-${n.status}`,children:(0,j.statusLabel)(n)}),(0,j.sessionStateTags)(n).map(e=>(0,t.jsx)("span",{className:`manage-tag session-state-tag is-${e.toLowerCase()}`,children:e},e))]}),(0,t.jsxs)("dl",{className:"manage-meta",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Last activity"}),(0,t.jsx)("dd",{children:(0,j.formatSessionDate)(n.last_activity_at)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Started"}),(0,t.jsx)("dd",{children:(0,j.formatSessionDate)(n.created_at)})]}),null!==n.ended_at?(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Ended"}),(0,t.jsx)("dd",{children:(0,j.formatSessionDate)(n.ended_at)})]}):null,(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Runtime"}),(0,t.jsx)("dd",{children:(0,j.runtimeLabel)(n)})]}),(0,t.jsxs)("div",{className:"session-usage-meta",children:[(0,t.jsx)("dt",{children:"Reported usage"}),(0,t.jsxs)("dd",{children:[(0,t.jsx)("span",{className:`session-usage is-${x.quality}`,"aria-hidden":"true",children:x.text}),(0,t.jsx)("span",{className:"session-sr",children:x.label}),x.partial?(0,t.jsx)("span",{className:"manage-tag session-usage-tag",children:"Partial"}):null]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Origin"}),(0,t.jsx)("dd",{children:f?.thread_agent_id?(0,t.jsx)("button",{type:"button",className:"session-link",onClick:()=>i(f.thread_agent_id),children:f.label}):f?.label??"Not recorded"})]}),g?(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Work request"}),(0,t.jsx)("dd",{children:g})]}):null,n.context.workspace?(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Workspace"}),(0,t.jsx)("dd",{children:n.context.workspace})]}):null]}),m.length>0?(0,t.jsx)("div",{className:"session-actions",role:"group","aria-label":`Actions for ${n.title}`,children:m.map(e=>(0,t.jsx)("button",{type:"button",className:"session-action","data-session-action":e.action,"aria-haspopup":"dialog",onClick:t=>l((0,N.sessionDialogMode)(e.action),t.currentTarget),children:e.label},e.action))}):null,p.length>0?(0,t.jsx)("ul",{className:"session-unavailable","aria-label":`Unavailable actions for ${n.title}`,children:p.map(e=>(0,t.jsx)("li",{children:e},e))}):null,(0,t.jsx)(_,{row:n,shares:o,policy:d,onChanged:c}),(0,t.jsx)("button",{type:"button",className:"pin-word session-toggle","aria-expanded":a,"aria-controls":u,onClick:r,children:a?"Hide details":"Details"}),a?(0,t.jsx)(A,{id:u,agentId:e,sessionRef:n.ref}):null]})})}function A({id:e,agentId:n,sessionRef:a}){let[r,i]=(0,s.useState)(null),[l,o]=(0,s.useState)(null),[d,c]=(0,s.useState)(""),[u,h]=(0,s.useState)(null),[m,p]=(0,s.useState)(""),[f,g]=(0,s.useState)(!1),x=`/api/bots/${encodeURIComponent(n)}/sessions/${encodeURIComponent(a)}`;(0,s.useEffect)(()=>{let e=!1;return fetch(x,{cache:"no-store"}).then(async t=>{let s=await t.json().catch(()=>null);e||(t.ok&&Array.isArray(s?.session?.attempts)?(i(s.session.attempts),o({totals:s.session.usage,samples:Array.isArray(s.session.usage_samples)?s.session.usage_samples:[]})):c("Could not load session details."))}).catch(()=>{e||c("Could not load session details.")}),()=>{e=!0}},[x]);let b=(0,s.useCallback)(async()=>{if(null===u)try{let e=await fetch(`${x}?debug=external_session_id`,{cache:"no-store"}),t=await e.json().catch(()=>null),s=t?.debug?.external_session_id;e.ok&&"string"==typeof s?h(s):p("Not available.")}catch{p("Not available.")}},[x,u]),y=async()=>{if(u)try{await navigator.clipboard.writeText(u),g(!0)}catch{g(!1)}};return(0,t.jsxs)("div",{id:e,className:"session-detail",children:[d?(0,t.jsx)("p",{className:"delete-error",role:"alert",children:d}):null,r||d?null:(0,t.jsx)("p",{className:"delete-copy",role:"status",children:"Loading details…"}),r?(0,t.jsxs)("ol",{className:"session-attempts","aria-label":"Runs in this session",children:[0===r.length?(0,t.jsx)("li",{children:"No recorded runs."}):null,r.map(e=>(0,t.jsxs)("li",{children:[(0,j.formatSessionDate)(e.started_at)," · ",(0,j.attemptLabel)(e)]},`${e.request_id}-${e.attempt_number}`))]}):null,l?(0,t.jsx)(P,{totals:l.totals,samples:l.samples}):null,(0,t.jsxs)("details",{className:"session-debug",onToggle:e=>{e.currentTarget.open&&b()},children:[(0,t.jsx)("summary",{children:"Local debug: provider session ID"}),(0,t.jsx)("p",{className:"session-debug-note",children:"For local troubleshooting only. Botmancers resumes sessions for you; you never need to copy this."}),m?(0,t.jsx)("p",{className:"delete-error",children:m}):null,u?(0,t.jsxs)("div",{className:"session-debug-value",children:[(0,t.jsx)("code",{children:u}),(0,t.jsx)("button",{type:"button",className:"pin-word",onClick:()=>{y()},children:f?"Copied":"Copy"})]}):null]})]})}let T=["input_tokens","output_tokens","cost_usd"];function P({totals:e,samples:n}){let a=(0,s.useId)();return(0,t.jsxs)("section",{className:"session-usage-detail","aria-labelledby":a,children:[(0,t.jsx)("h3",{id:a,className:"session-usage-head",children:"Reported usage"}),(0,t.jsx)("dl",{className:"session-usage-totals",children:T.map(s=>{let n=(0,j.usageMetricView)(s,e?.[s],!0);return(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:n.name}),(0,t.jsxs)("dd",{children:[(0,t.jsx)("span",{className:`session-usage is-${n.quality}`,"aria-hidden":"true",children:n.text}),(0,t.jsxs)("span",{className:"session-sr",children:[n.label,"."]}),(0,t.jsx)("span",{className:`session-usage-coverage is-${n.quality}`,children:n.coverage})]})]},s)})}),0===n.length?(0,t.jsx)("p",{className:"session-usage-none",children:"No run in this session reported usage."}):(0,t.jsx)("ol",{className:"session-usage-runs","aria-label":"Reported usage by run",children:n.map((e,s)=>{let n=(0,j.usageSampleValues)(e);return(0,t.jsxs)("li",{children:[(0,t.jsxs)("span",{className:"session-usage-run",children:[(0,j.formatSessionDate)(e.observed_at)," · ",(0,j.usageSampleLabel)(e,s)]}),(0,t.jsxs)("span",{className:"session-usage-values",children:[(0,t.jsxs)("span",{className:null===e.input_tokens?"is-unavailable":void 0,children:["In ",n.input]}),(0,t.jsxs)("span",{className:null===e.output_tokens?"is-unavailable":void 0,children:["Out ",n.output]}),(0,t.jsxs)("span",{className:null===e.cost_usd?"is-unavailable":void 0,children:["Cost ",n.cost]})]})]},`${e.observed_at}-${s}`)})})]})}function D({view:e,agentName:s}){if("loading"===e)return(0,t.jsx)("p",{className:"thread-note",role:"status",children:"Loading messages…"});if("error"===e)return(0,t.jsx)("p",{className:"thread-note thread-note-error",role:"alert",children:"Couldn’t load messages. Trying again…"});if("empty"===e){let e={title:`No messages with ${s} yet.`,hint:"Say something below to start the conversation."};return(0,t.jsxs)("div",{className:"thread-empty","data-thread-empty":"",children:[(0,t.jsx)("p",{className:"thread-empty-title",children:e.title}),(0,t.jsx)("p",{className:"thread-empty-hint",children:e.hint})]})}return null}let O={error:"Error"},L=[{kind:"hermes-config-missing",severity:"error",pattern:/^\[Hermes configuration missing: [^\n]*\]$/,title:"Hermes needs configuration",recovery:"This agent can’t reply until the Hermes API key is set on the Botmancers server. Set it, restart, then send your message again."},{kind:"hermes-turn-failed",severity:"error",pattern:/^\[Hermes turn failed for [\s\S]*\]$/,title:"Hermes couldn’t complete the turn",recovery:"Check that the Hermes gateway is running and reachable, then send your message again."}];function M(e){let t=String(e??"").trim();if(!t)return null;let s=L.find(e=>e.pattern.test(t));return s?{kind:s.kind,severity:s.severity,title:s.title,recovery:s.recovery,detail:t}:null}function F({failure:e}){let[n,a]=(0,s.useState)("idle"),r=O[e.severity],i=(0,s.useId)();async function l(){try{await navigator.clipboard.writeText(e.detail),a("copied")}catch{a("failed")}}return(0,t.jsxs)("div",{className:`runtime-failure runtime-failure-${e.severity}`,role:"status","aria-labelledby":i,"data-runtime-failure":e.kind,children:[(0,t.jsxs)("p",{className:"runtime-failure-title",id:i,children:[(0,t.jsx)("span",{className:"runtime-failure-severity",children:r}),e.title]}),(0,t.jsx)("p",{className:"runtime-failure-recovery",children:e.recovery}),(0,t.jsxs)("details",{className:"runtime-failure-details",children:[(0,t.jsx)("summary",{children:"Details"}),(0,t.jsx)("code",{className:"runtime-failure-detail",children:e.detail}),(0,t.jsx)("button",{type:"button",className:"runtime-failure-copy",onClick:()=>{l()},children:"copied"===n?"Copied":"failed"===n?"Copy failed":"Copy details"})]})]})}function U(e){if(!e)return"";let t=r(e);if(t)return i(t);let s=M(e);if(s)return s.title;let n=(0,c.agentEventDisplay)(e);return n?`${n.label} ${n.detail}`.replace(/\s+/g," ").trim():e.replace(/\s+/g," ").trim()}let q={blocked:"Needs approval",rejected:"Not started",allowed:"Allowed",denied:"Denied",waiting:"Queued",stopped:"Stopped"};function z({notice:e,onDone:n}){let[a,r]=(0,s.useState)(!1),[i,l]=(0,s.useState)(""),o="blocked"!==e.tone||e.actionable?q[e.tone]:"Blocked",d=async t=>{if(!a&&e.wakeId){r(!0),l("");try{let s=await fetch(`/api/wakes/${e.wakeId}/decision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:t})});if(!s.ok){let e=await s.json().catch(()=>null);l("string"==typeof e?.error?.message?e.error.message:"The decision could not be recorded.")}}catch{l("The decision could not be recorded.")}finally{r(!1),n()}}};return(0,t.jsxs)("div",{className:`wake-notice wake-notice-${e.tone}`,role:"status","data-wake-notice":e.tone,"data-wake-id":e.wakeId??void 0,children:[(0,t.jsxs)("p",{className:"wake-notice-line",children:[(0,t.jsx)("span",{className:"wake-notice-label",children:o}),e.text]}),e.actionable?(0,t.jsxs)("div",{className:"wake-notice-actions",children:[(0,t.jsx)("button",{type:"button",className:"approve-control",disabled:a,onClick:()=>{d("allow")},children:"Allow"}),(0,t.jsx)("button",{type:"button",className:"approve-control",style:{marginLeft:8},disabled:a,onClick:()=>{d("deny")},children:"Deny"})]}):null,i?(0,t.jsx)("p",{className:"wake-notice-error",role:"alert",children:i}):null]})}var H=e.i(13255);function B(e){return!!e&&"chief-of-staff"===e.name.toLowerCase()}function W(e){return B(e)?0:e.pinned?1:2}function K(e,t,s,n){return e&&t?n-s+(t-e)>15e3?"Stopped":"Heartbeat "+new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles",hour:"numeric",minute:"2-digit",second:"2-digit"}).format(new Date(e)):"Stopped"}function J(e){let t=e;for(let e=0;e<2;e++){let e=t.replace(/^\s*\[Message from [^\]]+\]\s*(?:\r?\n)?/,"");if(e===t)break;t=e}return t.replace(/^\s+/,"")}function G(e){let t=e;for(let e=0;e<4;e++){let e=t.replace(/^\s*\[(?:Message from|From) [^\]]+\]\s*(?:\r?\n)?/,"");if(e===t)break;t=e}return t}function V({message:e,conversationId:n,status:a,onDone:r}){let i=o(G(e.content)),[l,d]=(0,s.useState)(i?.recipient??""),[c,u]=(0,s.useState)(i?.body??""),[h,m]=(0,s.useState)(!1),[p,f]=(0,s.useState)("open"!==a),g=(0,s.useRef)("open"!==a);if(!i)return null;let x="open"!==a||p,b=x?i.recipient:l,y=x?i.body:c,j=async t=>{if(!x&&!g.current&&!h&&("send"!==t||""!==l.trim())){g.current=!0,f(!0),m(!0);try{(await fetch(`/api/conversations/${n}/draft`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messageId:e.id,action:t,recipient:l,body:c})})).ok||(g.current=!1,f(!1))}finally{m(!1),r()}}};return(0,t.jsxs)("div",{className:"draft-card",children:[(0,t.jsx)("div",{className:"draft-title",children:"email"===i.channel?"New Email":"New Slack Message"}),(0,t.jsx)("input",{type:"text","aria-label":"Recipient",value:b,readOnly:x,disabled:h,onChange:e=>{x||d(e.target.value)}}),(0,t.jsx)("textarea",{rows:3,"aria-label":"Draft body",value:y,readOnly:x,disabled:h,onChange:e=>{x||u(e.target.value)}}),"sent"===a?(0,t.jsx)("span",{className:"draft-mark",children:"Sent"}):null,"discarded"===a?(0,t.jsx)("span",{className:"draft-mark",children:"Discarded"}):null,"discarded"!==a?(0,t.jsx)("button",{type:"button",className:"approve-control",disabled:h,onClick:()=>{j("send")},children:"Send"}):null,"open"===a?(0,t.jsx)("button",{type:"button",className:"approve-control",style:{marginLeft:8},disabled:h,onClick:()=>{j("discard")},children:"Discard"}):null]})}function Q({message:e,conversationId:n,status:a,onDone:r}){let i=d(e.content),[l,o]=(0,s.useState)(!1),c=(0,s.useRef)("pending"!==a);if(!i)return null;let u=async t=>{if(!c.current&&!l){c.current=!0,o(!0);try{(await fetch(`/api/conversations/${n}/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:i,messageId:e.id})})).ok||(c.current=!1)}finally{o(!1),r()}}};return"pending"!==a?(0,t.jsx)("span",{className:"draft-mark",children:"approved"===a?"Approved":"Denied"}):(0,t.jsxs)("span",{className:"draft-mark",children:[(0,t.jsx)("button",{type:"button",className:"approve-control",disabled:l,onClick:()=>{u("approve")},children:"Approve"}),(0,t.jsx)("button",{type:"button",className:"approve-control",style:{marginLeft:8},disabled:l,onClick:()=>{u("deny")},children:"Deny"})]})}function X({names:e}){return 0===e.length?null:(0,t.jsx)(t.Fragment,{children:e.map(e=>(0,t.jsxs)("span",{children:[(0,t.jsx)("br",{}),(0,t.jsxs)("a",{className:"file-control",href:`/api/files/${encodeURIComponent(e)}`,download:e,children:["Download ",e]})]},e))})}function Y({anchorRef:e,onClose:n,onCreated:a}){let[r,i]=(0,s.useState)(""),[l,o]=(0,s.useState)(u.DEFAULT_REGISTRATION_FORM),[d,p]=(0,s.useState)(""),[f,g]=(0,s.useState)(!1),[x,b]=(0,s.useState)(!1),y=(0,m.useRuntimeConnections)(),[j,N]=(0,s.useState)(null),S=(0,s.useRef)(null),k=(0,s.useRef)(null);(0,s.useLayoutEffect)(()=>{let t=()=>{let t=e.current?.getBoundingClientRect();N(function(e,t){let s=Math.min(358,t.width-32),n=Math.max(16,t.width-16-s),a=16,r=16;if(e){r=Math.min(Math.max(e.left,16),n);let s=e.bottom+8;t.height-s-16>=360&&(a=s)}return{top:a,left:r,maxHeight:Math.max(0,t.height-a-16)}}(t?{left:t.left,bottom:t.bottom}:null,{width:window.innerWidth,height:window.innerHeight}))};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),(0,s.useEffect)(()=>{k.current?.focus()},[]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(e.stopPropagation(),n())};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[n]);let C=(0,u.registrationFormView)(l,y.state),_=async e=>{if(e.preventDefault(),C.submitDisabled||x)return;if((0,u.hasRegistrationErrors)(C)){g(!0),p("Fix the highlighted fields.");return}p(""),b(!0);let t=await fetch("/api/bots",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,u.registrationCreateBody)(r,l))}).finally(()=>b(!1));if(!t.ok){let e=await t.json().catch(()=>null);p("string"==typeof e?.error&&e.error?e.error:"Failed to create agent");return}a()};return(0,t.jsx)("div",{className:"modal-scrim new-agent-scrim",onKeyDown:e=>{if("Tab"!==e.key||!S.current)return;let t=v(Array.from(S.current.querySelectorAll(w)),document.activeElement,e.shiftKey);t&&(e.preventDefault(),t.focus())},children:(0,t.jsxs)("div",{ref:S,className:"form-card new-agent-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"new-agent-title",style:j??void 0,children:[(0,t.jsx)("div",{className:"kind-row",children:(0,t.jsx)("h2",{id:"new-agent-title",className:"kind-word new-agent-title",children:"New Agent"})}),(0,t.jsxs)("form",{onSubmit:_,className:"bot-form",children:[(0,t.jsxs)("div",{className:"new-agent-body",children:[(0,t.jsx)("label",{htmlFor:"bot-name",children:"Name"}),(0,t.jsx)("input",{ref:k,id:"bot-name",type:"text",value:r,onChange:e=>i(e.target.value),required:!0}),(0,t.jsx)(h.RegistrationFields,{idPrefix:"bot",variant:"modal",form:l,onChange:e=>{p(""),o(t=>({...t,...e}))},view:C,showErrors:f,connections:y.state,onRetryConnections:y.retry,onAddConnection:y.add,workspacePlaceholder:c.WORKSPACE_TEMPLATE,workspaceHint:c.NEW_AGENT_WORKSPACE_HINT}),d?(0,t.jsx)("p",{className:"form-error",role:"alert",children:d}):null]}),(0,t.jsxs)("div",{className:"form-actions",children:[(0,t.jsx)("button",{type:"button",className:"cancel-btn",onClick:n,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",className:"create-btn",disabled:C.submitDisabled||x,children:x?"Creating…":"Create"})]})]})]})})}e.s(["default",0,function(){var e;let[u,h]=(0,s.useState)([]),[m,x]=(0,s.useState)(!1),[b,j]=(0,s.useState)(null),v=(0,s.useRef)(!1),w=(0,s.useRef)(null),[N,S]=(0,s.useState)([]),[k,C]=(0,s.useState)([]),[_,R]=(0,s.useState)([]),E=(0,s.useRef)(null),[$,A]=(0,s.useState)(null),T=(0,s.useRef)(null),[P,O]=(0,s.useState)(""),[L,q]=(0,s.useState)(""),[Z,ee]=(0,s.useState)(!1),[et,es]=(0,s.useState)([]),[en,ea]=(0,s.useState)(""),er=(0,s.useRef)(null),ei=(0,s.useRef)(null),[el,eo]=(0,s.useState)(!1),ed=(0,s.useRef)(null),[ec,eu]=(0,s.useState)(!1),[eh,em]=(0,s.useState)(!1),[ep,ef]=(0,s.useState)(null),[eg,ex]=(0,s.useState)(""),[eb,ey]=(0,s.useState)({}),ej=(0,s.useRef)({}),[ev,ew]=(0,s.useState)(null),[eN,eS]=(0,s.useState)(null),ek=(0,s.useRef)(null),eC=(0,s.useRef)(null),[e_,eR]=(0,s.useState)(!1),eE=(0,s.useRef)(null),[eI,e$]=(0,s.useState)(!1),eA=(0,s.useRef)(null),[eT,eP]=(0,s.useState)(""),[eD,eO]=(0,s.useState)(!1),eL=(0,s.useRef)(null),eM=(0,s.useRef)(null),eF=(0,s.useRef)(null),eU=(0,s.useRef)(null),eq=(0,s.useRef)(null),ez=(0,s.useRef)(null),eH=(0,s.useRef)(null),[eB,eW]=(0,s.useState)([]),[eK,eJ]=(0,s.useState)({serverNow:0,fetchedAt:0}),[eG,eV]=(0,s.useState)(()=>Date.now()),eQ=(0,s.useRef)({}),eX=(0,s.useRef)(!1),[eY,eZ]=(0,s.useState)(!1);(0,s.useEffect)(()=>{eX.current||0===u.length||(eX.current=!0,eZ(!0))},[u.length]),(0,s.useEffect)(()=>{let e=(0,p.importedBotId)(window.location.search);if(e)return void window.location.replace((0,p.importedConfigPath)(e));let t=new URLSearchParams(window.location.search),s=Number(t.get("deleted"));s>0&&window.history.replaceState(null,"","/");let n=t.get("agent");n&&(w.current=n,E.current=t.get("exchange"),window.history.replaceState(null,"","/")),e4().then(()=>{s>0&&eP((0,g.deletedStatusLine)(s))});let a=setInterval(e4,2e3),r=setInterval(()=>eV(Date.now()),1e3);return()=>{clearInterval(a),clearInterval(r)}},[]),(0,s.useEffect)(()=>{if(v.current||0===u.length||b)return;let e=u.find(e=>e.id===w.current)||[...u].filter(e=>!e.hidden).sort((e,t)=>W(e)-W(t))[0]||u[0];v.current=!0,e7(e.id)},[u,b]),(0,s.useEffect)(()=>{if(T.current=b?.id??null,b)return e3(),eH.current&&clearInterval(eH.current),eH.current=setInterval(e3,2e3),()=>{eH.current&&clearInterval(eH.current)}},[b]);let e0=b?u.find(e=>e.id===b.details.id)??b.details:void 0,e1=!!b&&B(e0),e6=e1?function(e){for(let t=e.length-1;t>=0;t--){let s=r(e[t].content);if(s){if("stopped"===s.state)return null;return s.page||s.html||null}}return null}(N):null;async function e4(){let e=await fetch("/api/bots",{cache:"no-store"}),t=await e.json(),s=Date.parse(e.headers.get("date")||"");eJ({serverNow:Number.isNaN(s)?Date.now():s,fetchedAt:Date.now()}),Array.isArray(t)&&(h(t),x(!0))}async function e3(){if(!b)return;let e=b.id,t=null,s=!1,n=fetch(`/api/conversations/${e}`).then(async e=>{let t=await e.json();return e.ok&&Array.isArray(t?.events)?t.events:null}).catch(()=>null),a=fetch(`/api/exchanges?conversation=${encodeURIComponent(e)}`,{cache:"no-store"}).then(async e=>{let t=await e.json();return e.ok&&Array.isArray(t?.exchanges)?t.exchanges:null}).catch(()=>null);try{let n=await fetch(`/api/conversations/${e}/messages`);t=await n.json(),s=n.ok&&Array.isArray(t)}catch{s=!1}let r=await n,i=await a;if(T.current===e){let n,a;s&&S(t),r&&C((n=[],a=new Map,r.forEach((e,t)=>{let s="string"==typeof e.data.target_name?e.data.target_name:null;e.requestId&&s&&a.set(e.requestId,s);let i=function(e){switch(e.kind){case"wake_blocked":return"blocked";case"wake_rejected":return"rejected";case"lineage_stopped":return"stopped";case"wake_accepted":return"string"==typeof e.data.reason?"allowed":null;case"request_cancelled":return"grant_denied"===e.data.reason?"denied":null;case"request_queued":return"capacity"===e.data.waiting_for?"waiting":null;default:return null}}(e);if(!i)return;let l=Array.isArray(e.data.actions)?e.data.actions:[],o=null!==e.requestId&&r.slice(t+1).some(t=>t.requestId===e.requestId);if("waiting"===i&&o)return;let d=e.requestId?a.get(e.requestId):void 0,c="denied"===i&&d?`Wake denied: ${d} — no work ran`:"waiting"===i&&d?`Queued: ${d} — waiting for capacity`:e.text;n.push({eventId:e.eventId,wakeId:e.wakeId,tone:i,text:c,actionable:"blocked"===i&&!!e.wakeId&&l.includes("allow")&&l.includes("deny")&&!o,createdAt:e.createdAt})}),n)),i&&R(i),A({conversationId:e,status:s?"ready":"error"})}}(0,s.useLayoutEffect)(()=>{let e=eF.current?.parentElement;if(!e)return;let t=eU.current,s=eq.current,n=ez.current;if(e1&&t&&s&&n){let a=a=>{let r=Math.ceil(t.getBoundingClientRect().height);s.style.height=r+16+a+"px";let i=s.getBoundingClientRect().top-e.getBoundingClientRect().top;n.style.height=Math.max(0,e.clientHeight-i)+"px";let l=t.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;e.scrollTop=Math.max(0,l-i)};a(0);let r=s.nextElementSibling,i=t.getBoundingClientRect().bottom,l=r?r.getBoundingClientRect().top:s.getBoundingClientRect().bottom;i>=l&&a(Math.max(16,Math.ceil(i-l)));return}n&&(n.style.height="0px"),s&&(s.style.height=""),e.scrollTop=e.scrollHeight},[N,e1]),(0,s.useEffect)(()=>{let e=E.current;if(!e)return;let t=document.getElementById(`exchange-${e}`);t&&(E.current=null,t.scrollIntoView({block:"center"}),t.focus({preventScroll:!0}))},[_]),(0,s.useLayoutEffect)(()=>{eW(e=>{if(0===e.length)return e;let t=e.filter(e=>{let t=eQ.current[e]??0;return N.some(s=>"bot"===s.sender_type&&s.sender_id===e&&s.created_at>t&&!/^\[(mcp|tool call|tool result)\]/i.test(s.content.trim()))});if(0===t.length)return e;for(let e of t)delete eQ.current[e];return e.filter(e=>!t.includes(e))})},[N]);let e2=async e=>{b&&(await fetch(`/api/conversations/${b.id}/messages/${e}/stop`,{method:"POST"}),await e3())},e8=async()=>{b&&(await fetch(`/api/conversations/${b.id}/stop`,{method:"POST"}),await e3())},e5=async(e,t)=>{if(eb[e.id])return void ey(t=>{let s={...t};return delete s[e.id],s});if(ej.current[e.id])return;let s=N.findIndex(t=>t.id===e.id),n=u.find(e=>e.name===t),a=N.slice(s+1).find(e=>"bot"===e.sender_type&&(n?e.sender_id===n.id:e.sender_name===t));if(a){ej.current[e.id]=!0;try{let t=await fetch(`/api/messages/${e.id}/between?other=${encodeURIComponent(a.id)}`),s=await t.json().catch(()=>null);t.ok&&Array.isArray(s)&&s.length>0&&ey(t=>({...t,[e.id]:s}))}finally{delete ej.current[e.id]}}};async function e7(e){let t=u.find(t=>t.id===e);if(!t)return;let s=await fetch(`/api/conversations?botId=${e}`),n=await s.json();eu(!1),em(!1),n.id!==b?.id&&(S([]),C([]),R([])),T.current=n.id,j({id:n.id,details:t})}let e9=async()=>{if(!b)return;let e=eL.current?.files?.[0];if(!e)return;let t=await new Promise((t,s)=>{let n=new FileReader;n.onload=()=>t(String(n.result||"")),n.onerror=()=>s(n.error),n.readAsDataURL(e)});if(!t.startsWith("data:image/"))return;let s=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:b.details.id,avatar:t})});if(!s.ok)return;let n=await s.json();h(e=>e.map(e=>e.id===n.id?{...e,avatar:n.avatar}:e)),j({...b,details:{...b.details,avatar:n.avatar}})},te=async e=>{if(!e||!b)return;let t=await new Promise((t,s)=>{let n=new FileReader;n.onload=()=>t(String(n.result||"")),n.onerror=()=>s(n.error),n.readAsDataURL(e)});if(!t.startsWith("data:image/"))return;let s=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:b.details.id,avatar:t})});if(!s.ok)return;let n=await s.json();h(e=>e.map(e=>e.id===n.id?{...e,avatar:n.avatar}:e)),j({...b,details:{...b.details,avatar:n.avatar}})},tt=async()=>{if(!b)return;let e=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:b.details.id,avatar:null})});if(!e.ok)return;let t=await e.json();h(e=>e.map(e=>e.id===t.id?{...e,avatar:t.avatar||""}:e)),j({...b,details:{...b.details,avatar:t.avatar||""}})},ts=m&&0===u.length,tn=[...u].filter(e=>!e.hidden).sort((e,t)=>W(e)-W(t)),ta=u.filter(e=>e.hidden),tr=async e=>{let t=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id,pinned:+!e.pinned})});if(!t.ok)return;let s=await t.json();h(e=>e.map(e=>e.id===s.id?{...e,...s}:e))},ti=async(e,t)=>{let s=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id,hidden:+!!t})});if(!s.ok)return;let n=await s.json();h(e=>e.map(e=>e.id===n.id?{...e,...n,hidden:+!!n.hidden}:e)),t?requestAnimationFrame(()=>eC.current?.focus()):tc(e.id)},tl=async e=>{(await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id,unread:1})})).ok&&h(t=>t.map(t=>t.id===e.id?{...t,unread:1}:t))};(0,s.useEffect)(()=>{if(!eN)return;let e=e=>{"Escape"===e.key&&(eS(null),eN.returnTo?.focus())},t=e=>{ek.current&&ek.current.contains(e.target)||eS(null)};return document.addEventListener("keydown",e),document.addEventListener("pointerdown",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("pointerdown",t)}},[eN]);let to=async e=>{let t=eg.trim();if(ef(null),!t||t===e.name)return;let s=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id,name:t})});if(!s.ok)return;let n=await s.json();h(e=>e.map(e=>e.id===n.id?{...e,...n}:e)),b&&b.details.id===n.id&&j({...b,details:{...b.details,...n}})},td=async e=>{let t=e.map(e=>e.id);ew(null),eR(!1),eP((0,g.deletedStatusLine)(t.length)),requestAnimationFrame(()=>eE.current?.focus()),h(e=>e.filter(e=>!t.includes(e.id))),b&&t.includes(b.details.id)&&(j(null),S([]),C([])),await e4()},tc=(e,t=30)=>{requestAnimationFrame(()=>{let s=document.querySelector(`[data-open-bot="${e}"]`);s?s.focus():t>0&&tc(e,t-1)})},tu=(e=!0)=>{let t=eN?.returnTo;eS(null),e&&t&&requestAnimationFrame(()=>{t.isConnected&&t.focus()})},th=(e,t)=>{e.preventDefault(),eS({bot:t,x:e.clientX,y:e.clientY,returnTo:e.currentTarget.querySelector("[data-open-bot]")})},tm=(e,s)=>(0,t.jsx)("input",{className:"bot-name","aria-label":`Rename ${e.name}`,value:eg,autoFocus:!0,onChange:e=>ex(e.target.value),onBlur:()=>to(e),onKeyDown:t=>{"Enter"===t.key&&(t.preventDefault(),t.target.blur(),tc(e.id)),"Escape"===t.key&&(ef(null),tc(e.id))},style:s}),tp=(e,s)=>(0,t.jsx)("button",{type:"button",className:"bot-name row-open","data-open-bot":e.id,"aria-current":b?.details.id===e.id?"true":void 0,onClick:()=>e7(e.id),style:s,children:e.name}),tf=e=>(0,t.jsx)("button",{type:"button",className:"row-actions","aria-haspopup":"menu","aria-expanded":eN?.bot.id===e.id,"aria-label":`Actions for ${e.name}`,title:`Actions for ${e.name}`,onClick:t=>{var s;let n;eS({bot:e,x:(n=(s=t.currentTarget).getBoundingClientRect()).left,y:n.bottom+4,returnTo:s})},children:"⋯"}),tg=e=>(0,t.jsxs)("div",{className:"row-tip",children:[e.unread&&b?.details.id!==e.id?(0,t.jsx)("div",{className:"card-role",children:"Unread"}):null,(0,t.jsx)("div",{className:"card-role",children:K(e.last_seen,eK.serverNow,eK.fetchedAt,eG)})]}),tx=e=>(0,t.jsxs)("div",{className:b?.details.id===e.id?"bot-row is-open":"bot-row",onContextMenu:t=>th(t,e),children:[(0,t.jsxs)("span",{className:"mark-avatar mark-avatar-sm",children:[(0,t.jsx)(l.default,{bot:e,size:36,title:`${e.name} avatar`}),eB.includes(e.id)?(0,t.jsx)("span",{className:"mark-dot"}):null]}),(0,t.jsxs)("div",{className:"bot-copy",children:[ep===e.id?tm(e):tp(e),U(e.latest)?(0,t.jsx)("div",{className:"bot-preview",children:U(e.latest)}):null,(0,t.jsx)("div",{className:"bot-runtime",title:(0,c.rosterRuntimeLine)(e),children:(0,c.rosterRuntimeLine)(e)})]}),tf(e),tg(e)]},e.id),tb=Z?u.filter(e=>e.name.toLowerCase().includes(L.toLowerCase())):[],ty=e=>{let t=er.current,s=t?t.selectionStart:P.length,n=P.slice(0,s).lastIndexOf("@");if(n<0)return;O(P.slice(0,n)+"@"+e+" "+P.slice(s)),ee(!1);let a=n+e.length+2;requestAnimationFrame(()=>{t?.focus(),t?.setSelectionRange(a,a)})},tj=e=>{if(0===e.length)return;let t=6-et.length;e.length>t?ea("Up to six attachments."):ea("");let s=e.slice(0,Math.max(t,0));0!==s.length&&es(e=>[...e,...s.map((t,s)=>({id:t.name+"-"+e.length+"-"+s+"-"+t.size,name:t.name}))])},tv=async()=>{let e=et.map(e=>e.name),t=P.trim();if(!t&&0===e.length||!b)return;let s=[t,...e].filter(e=>e.length>0).join("\n"),n=[b.details.id],a=N.reduce((e,t)=>Math.max(e,t.created_at||0),0);for(let e of n)eQ.current[e]=a;eW(e=>Array.from(new Set([...e,...n])));let r=[...u].sort((e,t)=>t.name.length-e.name.length).find(e=>(function(e,t){let s="@"+t,n=0;for(;n<e.length;){let t=e.indexOf(s,n);if(t<0)break;let a=e[t+s.length];if(!a||/[\s.,!?:;]/.test(a))return!0;n=t+s.length}return!1})(s,e.name));if(!(await fetch(`/api/conversations/${b.id}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:s,mentionedBotId:r?.id,idempotencyKey:crypto.randomUUID()})})).ok){for(let e of n)delete eQ.current[e];eW(e=>e.filter(e=>!n.includes(e)))}O(""),es([]),ea(""),ee(!1),e3()},tw=b?(e=b.id,N.length>0?"messages":$&&$.conversationId===e&&"loading"!==$.status?"error"===$.status?"error":"empty":"loading"):"loading",tN=b?(0,t.jsx)(D,{view:tw,agentName:b.details.name}):null,tS=(b?.details.title||"").trim(),tk=b?.details.color,tC=new Set,t_=e=>(0,t.jsx)("div",{className:"msg-status",children:(0,t.jsx)(z,{notice:e,onDone:()=>{e3()}})},e.eventId),tR=new Set,tE=e=>(0,t.jsx)("div",{className:"msg-status",children:(0,t.jsx)(H.default,{summary:e,onChanged:()=>{e3()}})},`exchange-${e.id}`),tI=e=>{let t=_.filter(t=>!tR.has(t.id)&&t.created_at<e).sort((e,t)=>e.created_at-t.created_at||(e.id<t.id?-1:1));return t.forEach(e=>tR.add(e.id)),t.map(tE)},t$=()=>{eo(!1),requestAnimationFrame(()=>ed.current?.focus())};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"field",inert:el,children:[(0,t.jsxs)("aside",{className:"rail",children:[(0,t.jsxs)("div",{className:"brand",children:[(0,t.jsx)("div",{className:eY?"logo-shape is-settling":"logo-shape",children:(0,t.jsx)(a.default,{src:"/brand/botmancers-logo-filled-256.png",alt:"",width:40,height:40})}),(0,t.jsx)("div",{className:"logo-word",children:"botmancers"})]}),(0,t.jsxs)("div",{className:"bar",children:[(0,t.jsx)("button",{ref:ed,type:"button",className:"add-btn","aria-haspopup":"dialog",onClick:()=>eo(!0),children:"New"}),ts?null:(0,t.jsx)("button",{ref:eE,type:"button",className:"add-btn","aria-haspopup":"dialog",onClick:()=>{eP(""),eR(!0)},children:"Manage agents"}),(0,t.jsx)(n.default,{href:"/settings",className:"add-btn settings-link",children:"Settings"})]}),ts?null:(0,t.jsx)("nav",{className:"rail-nav","aria-label":"Workspace",children:(0,t.jsx)(n.default,{href:"/exchanges",className:"add-btn rail-nav-link",children:"Exchanges"})}),(0,t.jsx)("p",{className:"roster-status",role:"status",children:eT}),ts?null:(0,t.jsx)("div",{className:eN?"roster menu-open":"roster",children:tn.map(e=>B(e)?(0,t.jsxs)("div",{className:"card",onContextMenu:t=>th(t,e),children:[(0,t.jsxs)("div",{className:"row-head",children:[(0,t.jsxs)("span",{className:"mark-avatar",children:[(0,t.jsx)(l.default,{bot:e,size:44,title:`${e.name} avatar`}),eB.includes(e.id)?(0,t.jsx)("span",{className:"mark-dot"}):null]}),ep===e.id?tm(e,{color:"#D5D0C3",fontSize:26}):tp(e,{fontSize:26}),tf(e)]}),U(e.latest)?(0,t.jsx)("div",{className:"bot-preview",children:U(e.latest)}):null,(0,t.jsx)("div",{className:"bot-runtime",title:(0,c.rosterRuntimeLine)(e),children:(0,c.rosterRuntimeLine)(e)}),tg(e)]},e.id):tx(e))}),ta.length>0?(0,t.jsxs)("div",{className:eN?"roster menu-open":"roster",children:[(0,t.jsx)("button",{ref:eC,type:"button",className:"pin-word","aria-expanded":eD,onClick:()=>eO(e=>!e),children:"Hidden"}),eD?ta.map(tx):null]}):null]}),(0,t.jsx)("section",{className:"pane",children:b?(0,t.jsxs)("div",{className:"thread",children:[(0,t.jsxs)("div",{className:"thread-bar",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("button",{type:"button",className:"thread-name",style:tk?{color:tk}:void 0,onClick:()=>{eu(!0),em(!1)},children:b.details.name}),tS?(0,t.jsx)("div",{className:"thread-role",children:tS}):null,(0,t.jsx)("div",{className:"thread-role",children:eB.includes(b.details.id)?"Working":"Not working"}),(0,t.jsx)("div",{className:"thread-role",children:K((e0??b.details).last_seen,eK.serverNow,eK.fetchedAt,eG)}),ec?(0,t.jsx)("button",{type:"button",className:"avatar-pic",onClick:()=>em(!0),"aria-label":"Picture",children:b.details.avatar?(0,t.jsx)("img",{src:b.details.avatar,alt:""}):(0,t.jsx)(l.default,{bot:b.details,size:46})}):null]}),(0,t.jsxs)("div",{style:{marginLeft:"auto",display:"flex",gap:16,alignItems:"flex-start"},children:[(0,t.jsx)(n.default,{href:`/bots/${b.details.id}/config`,className:"attach-word",style:{textDecoration:"none"},children:"Config"}),(0,t.jsx)("button",{ref:eA,type:"button",className:"attach-word","aria-haspopup":"dialog","aria-expanded":eI,onClick:()=>e$(!0),children:"Sessions"}),(0,t.jsx)("button",{type:"button",className:"attach-word",title:"Stop delegated turns in this thread",onClick:()=>{e8()},children:"Stop"})]})]}),eh?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"avatar-step avatar-desk",children:[(0,t.jsx)("span",{className:"kind-word",children:"Agent"}),(0,t.jsx)("button",{type:"button",className:"kind-word",children:"Generate"}),(0,t.jsxs)("label",{className:"kind-word",children:["Upload",(0,t.jsx)("input",{ref:eL,type:"file",accept:"image/*,.svg"})]}),(0,t.jsx)("button",{type:"button",className:"create-btn",onClick:e9,children:"Set avatar"})]}),(0,t.jsxs)("div",{className:"avatar-step avatar-phone",children:[(0,t.jsx)("button",{type:"button",className:"kind-word",onClick:()=>eM.current?.click(),children:"Gallery"}),(0,t.jsx)("button",{type:"button",className:"kind-word",children:"Generate"}),(0,t.jsx)("button",{type:"button",className:"kind-word",onClick:tt,children:"Remove Photo"}),(0,t.jsx)("input",{ref:eM,type:"file",accept:"image/*,.svg",onChange:e=>{let t=e.target.files?.[0];e.target.value="",te(t)}})]})]}):null,(0,t.jsxs)("div",{className:"messages-wrap",children:[(0,t.jsxs)("div",{className:"messages",children:[e1?null:tN,N.map(e=>{var n;let a,l,u=k.filter(t=>!tC.has(t.eventId)&&t.createdAt<e.created_at);u.forEach(e=>tC.add(e.eventId));let h=tI(e.created_at),m="user"===e.sender_type,p=m?null:M(G(e.content));if(p)return(0,t.jsxs)(s.Fragment,{children:[u.map(t_),h,(0,t.jsx)("div",{className:"msg-status",children:(0,t.jsx)(F,{failure:p})})]},e.id);let f=(n=G(e.content),a=[],{text:J(n.replace(/data:image\/[a-zA-Z0-9.+-]+;base64,[A-Za-z0-9+/=\s]+/g,e=>(a.push(e.replace(/\s/g,"")),""))),images:a}),g=f.images.map(e=>(0,t.jsx)("img",{src:e,alt:"",style:{display:"block",width:64,height:64}},e.slice(0,48))),x=m?void 0:b.details.color,y=m?null:r(e.content),j=m||y?null:o(G(e.content)),v=m||y?null:d(e.content),w=m||y?[]:function(e){let t=[];for(let s of e.split("\n")){let e=s.match(/^\s*\[file\]\s*(\S+)\s*$/i);e&&!t.includes(e[1])&&t.push(e[1])}return t}(e.content),N=m||y?null:(l=f.text.match(/^\s*\[Handing off to ([^\]]+)\]/))&&l[1].trim()||null,S=e.draftStatus??(j?"open":null),C=e.approvalStatus??(v?"pending":null);return(0,t.jsxs)(s.Fragment,{children:[u.map(t_),h,(0,t.jsxs)("div",{className:m?"msg-you":"msg-bot",ref:y&&"running"===y.state?eU:void 0,children:[(0,t.jsx)("div",{className:m?"msg-name msg-name-you":"msg-name",style:x?{color:x}:void 0,children:m?"You":e.sender_name||b.details.name}),y?(0,t.jsxs)("div",{className:"msg-body",children:[i(y),"running"===y.state?(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("button",{type:"button",className:"attach-word",style:{font:"inherit"},onClick:t=>{t.preventDefault(),t.stopPropagation(),e2(e.id)},children:"Stop"})]}):null]}):j&&S?(0,t.jsx)("div",{className:"msg-body",children:(0,t.jsx)(V,{message:e,conversationId:b.id,status:S,onDone:()=>{e3()}},e.id+S)}):(0,t.jsxs)("div",{className:"msg-body",onClick:N?()=>{e5(e,N)}:void 0,title:N?"Show the replies between this handoff and the reply":void 0,style:N?{cursor:"pointer"}:void 0,children:[function(e,s){let n=String(e??"").split("\n");if(!n.some(e=>null!==(0,c.agentEventDisplay)(e)))return e;let a=[];return n.forEach((e,n)=>{n>0&&a.push((0,t.jsx)("br",{},s+"-br-"+n));let r=(0,c.agentEventDisplay)(e);r?a.push((0,t.jsxs)("span",{className:"agent-event",children:[(0,t.jsx)("span",{className:"agent-event-label",children:r.label}),r.detail?" "+r.detail:""]},s+"-"+n)):a.push((0,t.jsx)("span",{children:e},s+"-"+n))}),a}(f.text,e.id),g,v&&C?(0,t.jsx)(Q,{message:e,conversationId:b.id,status:C,onDone:()=>{e3()}},e.id+C):null,(0,t.jsx)(X,{names:w})]}),eb[e.id]?(0,t.jsx)("div",{className:"msg-body",children:eb[e.id].map(e=>(0,t.jsx)("div",{children:(e.sender_name||"Agent")+": "+J(e.content)},e.id))}):null]})]},e.id)}),k.filter(e=>!tC.has(e.eventId)).map(t_),tI(1/0),(0,t.jsx)("div",{ref:ez}),(0,t.jsx)("div",{ref:eF})]}),e1?(0,t.jsxs)("div",{className:"computer-float",children:[(0,t.jsxs)("div",{className:"computer-top",children:[(0,t.jsxs)("span",{className:"computer-lights","aria-hidden":"true",children:[(0,t.jsx)("span",{className:"computer-light computer-light-red"}),(0,t.jsx)("span",{className:"computer-light computer-light-yellow"}),(0,t.jsx)("span",{className:"computer-light computer-light-green"})]}),(0,t.jsxs)("span",{className:"computer-teach",children:[(0,t.jsxs)("span",{className:"computer-teach-pill",children:[(0,t.jsx)("span",{className:"computer-teach-mark","aria-hidden":"true"}),"Teach a task"]}),(0,t.jsx)("span",{className:"computer-expand","aria-hidden":"true",children:(0,t.jsx)("svg",{viewBox:"0 0 16 16",width:"14",height:"14",children:(0,t.jsx)("path",{d:"M9.2 2.6H13.4V6.8M6.8 13.4H2.6V9.2M13.1 2.9L9.4 6.6M2.9 13.1L6.6 9.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),(0,t.jsx)("div",{className:"messages"===tw?"computer-band":"computer-band computer-band-note",ref:eq,children:tN}),(0,t.jsxs)("div",{className:"computer-desk",children:[e6?(0,t.jsx)("iframe",{className:"computer-page",sandbox:"",srcDoc:e6,tabIndex:-1}):null,(0,t.jsxs)("div",{className:"computer-dock",children:[(0,t.jsx)("img",{src:"/computer/dock-chrome.png",alt:""}),(0,t.jsx)("img",{src:"/computer/dock-gray.png",alt:""}),(0,t.jsx)("img",{src:"/computer/dock-terminal.png",alt:""})]})]})]}):null]}),(0,t.jsxs)("div",{className:"composer",onPaste:e=>{let t=[],s=e.clipboardData.files;if(s&&s.length>0)t.push(...Array.from(s));else for(let s of Array.from(e.clipboardData.items)){if("file"!==s.kind)continue;let e=s.getAsFile();e&&t.push(e)}0!==t.length&&(e.preventDefault(),tj(t))},children:[Z&&tb.length>0?(0,t.jsx)("div",{className:"mention-list",children:tb.map(e=>(0,t.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),ty(e.name)},children:["@",e.name]},e.id))}):null,(0,t.jsxs)("div",{className:"composer-box",children:[en?(0,t.jsx)("p",{className:"attach-error",children:en}):null,et.length>0?(0,t.jsx)("div",{className:"attach-names",children:et.map(e=>(0,t.jsx)("span",{children:e.name},e.id))}):null,(0,t.jsx)("textarea",{ref:er,rows:2,value:P,onChange:e=>{var t,s;let n,a;O(e.target.value),t=e.target.value,s=e.target.selectionStart,(a=(n=t.slice(0,s)).lastIndexOf("@"))<0||/\s/.test(n.slice(a+1))?ee(!1):(q(n.slice(a+1)),ee(!0))},onKeyDown:e=>{if("Enter"===e.key&&!e.shiftKey){if(e.preventDefault(),Z&&tb.length>0)return void ty(tb[0].name);tv()}},placeholder:"Say something"})]}),(0,t.jsx)("input",{ref:ei,className:"attach-input",type:"file",multiple:!0,onChange:e=>{tj(Array.from(e.target.files||[])),e.target.value=""}}),(0,t.jsx)("button",{type:"button",className:"attach-word",onClick:()=>ei.current?.click(),children:"Attach"}),(0,t.jsx)("button",{type:"button",className:"send-btn",onClick:tv,children:"Send"})]})]}):ts?(0,t.jsxs)("div",{className:"welcome",children:[(0,t.jsx)(a.default,{className:"welcome-mark",src:"/brand/botmancers-logo-outline-256.png",alt:"Botmancers",width:144,height:144,priority:!0}),(0,t.jsx)("p",{className:"empty-line",children:"Pick someone to talk to."})]}):(0,t.jsx)("p",{className:"empty-line",children:"Pick someone to talk to."})}),ev?(0,t.jsx)(f.default,{ids:[ev.id],onCancel:()=>{tc(ev.id),ew(null)},onDeleted:e=>{td(e)}}):null,eI&&b?(0,t.jsx)(I,{agentId:b.details.id,agentName:b.details.name,agents:u.map(e=>({id:e.id,name:e.name})),origin:{conversationId:b.id,label:`${b.details.name} thread`},onExchangeStarted:()=>{e3()},onClose:()=>{e$(!1),requestAnimationFrame(()=>eA.current?.focus())},onOpenThread:e=>{e$(!1),e7(e).then(()=>requestAnimationFrame(()=>eA.current?.focus()))}},b.details.id):null,e_?(0,t.jsx)(y,{onClose:()=>{eR(!1),requestAnimationFrame(()=>eE.current?.focus())},onDeleted:e=>{td(e)}}):null,eN?(0,t.jsxs)("div",{ref:ek,className:"row-menu",role:"menu","aria-label":`Actions for ${eN.bot.name}`,style:{left:eN.x,top:eN.y},onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),onKeyDown:e=>{let t=Array.from(e.currentTarget.querySelectorAll("[role=menuitem]")),s=t.indexOf(document.activeElement),n=s=>{e.preventDefault(),t[(s+t.length)%t.length]?.focus()};"ArrowDown"===e.key?n(s+1):"ArrowUp"===e.key?n(s-1):"Home"===e.key?n(0):"End"===e.key?n(t.length-1):"Tab"===e.key&&(e.preventDefault(),tu())},children:[(0,t.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,autoFocus:!0,onClick:e=>{e.stopPropagation(),tu(),tr(eN.bot)},children:eN.bot.pinned?"Unpin":"Pin"}),(0,t.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:e=>{e.stopPropagation(),tu(),tl(eN.bot)},children:"Mark as Unread"}),(0,t.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:e=>{e.stopPropagation(),tu(!1),ef(eN.bot.id),ex(eN.bot.name)},children:"Rename Agent"}),(0,t.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:e=>{e.stopPropagation(),tu(!1),ti(eN.bot,!eN.bot.hidden)},children:eN.bot.hidden?"Unhide":"Hide from sidebar"}),(0,t.jsx)(n.default,{role:"menuitem",tabIndex:-1,href:`/bots/${eN.bot.id}/config`,onClick:()=>eS(null),children:"Config"}),(0,t.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:e=>{e.stopPropagation(),tu(!1),ew(eN.bot)},children:"Delete agent…"})]}):null]}),el&&(0,t.jsx)(Y,{anchorRef:ed,onClose:t$,onCreated:()=>{e4(),t$()}})]})}],31713)},5500,(e,t,s)=>{"use strict";e.i(47167),Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"Image",{enumerable:!0,get:function(){return v}});let n=e.r(55682),a=e.r(90809),r=e.r(43476),i=a._(e.r(71645)),l=n._(e.r(74080)),o=n._(e.r(25633)),d=e.r(8927),c=e.r(87690),u=e.r(18556),h=e.r(65856),m=n._(e.r(1948)),p=e.r(18581),f={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function g(e,t,s,n,a,r,i){let l=e?.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&a(!0),s?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,a=!1;s.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>a,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{a=!0,t.stopPropagation()}})}n?.current&&n.current(e)}}))}function x(e){return i.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let b="u"<typeof window?i.useEffect:i.useLayoutEffect,y=(0,i.forwardRef)(({src:e,srcSet:t,sizes:s,height:n,width:a,decoding:l,className:o,style:d,fetchPriority:c,placeholder:u,loading:h,unoptimized:m,fill:f,onLoadRef:y,onLoadingCompleteRef:j,setBlurComplete:v,setShowAltText:w,sizesInput:N,onLoad:S,onError:k,...C},_)=>{let R=(0,i.useRef)(!1),E=(0,i.useRef)(null);b(()=>{let{current:e}=R,{current:t}=E;e||null===t||(k&&(t.src=t.src),t.complete&&g(t,u,y,j,v,m,N),R.current=!0)},[e,u,y,j,k,m,N]);let I=(0,p.useMergedRef)(_,E);return(0,r.jsx)("img",{...C,...x(c),loading:h,width:a,height:n,decoding:l,"data-nimg":f?"fill":"1",className:o,style:d,sizes:s,srcSet:t,src:e,ref:I,onLoad:e=>{g(e.currentTarget,u,y,j,v,m,N)},onError:e=>{w(!0),"empty"!==u&&v(!0),k&&k(e)}})});function j({isAppRouter:e,imgAttributes:t}){let s={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...x(t.fetchPriority)};return e&&l.default.preload?(l.default.preload(t.src,s),null):(0,r.jsx)(o.default,{children:(0,r.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...s},"__nimg-"+t.src+t.srcSet+t.sizes)})}let v=(0,i.forwardRef)((e,t)=>{let s=(0,i.useContext)(h.RouterContext),n=(0,i.useContext)(u.ImageConfigContext),a=(0,i.useMemo)(()=>{let e=f||n||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),s=e.deviceSizes.sort((e,t)=>e-t),a=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:s,qualities:a,localPatterns:"u"<typeof window?n?.localPatterns:e.localPatterns}},[n]),{onLoad:l,onLoadingComplete:o}=e,p=(0,i.useRef)(l);(0,i.useEffect)(()=>{p.current=l},[l]);let g=(0,i.useRef)(o);(0,i.useEffect)(()=>{g.current=o},[o]);let[x,b]=(0,i.useState)(!1),[v,w]=(0,i.useState)(!1),{props:N,meta:S}=(0,d.getImgProps)(e,{defaultLoader:m.default,imgConf:a,blurComplete:x,showAltText:v});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y,{...N,unoptimized:S.unoptimized,placeholder:S.placeholder,fill:S.fill,onLoadRef:p,onLoadingCompleteRef:g,setBlurComplete:b,setShowAltText:w,sizesInput:e.sizes,ref:t}),S.preload?(0,r.jsx)(j,{isAppRouter:!s,imgAttributes:N}):null]})});("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},94909,(e,t,s)=>{"use strict";e.i(47167),Object.defineProperty(s,"__esModule",{value:!0});var n={default:function(){return c},getImageProps:function(){return d}};for(var a in n)Object.defineProperty(s,a,{enumerable:!0,get:n[a]});let r=e.r(55682),i=e.r(8927),l=e.r(5500),o=r._(e.r(1948));function d(e){let{props:t}=(0,i.getImgProps)(e,{defaultLoader:o.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,s]of Object.entries(t))void 0===s&&delete t[e];return{props:t}}let c=l.Image},57688,(e,t,s)=>{t.exports=e.r(94909)},25633,(e,t,s)=>{"use strict";e.i(47167),Object.defineProperty(s,"__esModule",{value:!0});var n={default:function(){return f},defaultHead:function(){return u}};for(var a in n)Object.defineProperty(s,a,{enumerable:!0,get:n[a]});let r=e.r(55682),i=e.r(90809),l=e.r(43476),o=i._(e.r(71645)),d=r._(e.r(98879)),c=e.r(42732);function u(){return[(0,l.jsx)("meta",{charSet:"utf-8"},"charset"),(0,l.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function h(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}let m=["name","httpEquiv","charSet","itemProp"];function p(e){let t,s,n,a;return e.reduce(h,[]).reverse().concat(u().reverse()).filter((t=new Set,s=new Set,n=new Set,a={},e=>{let r=!0,i=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){i=!0;let s=e.key.slice(e.key.indexOf("$")+1);t.has(s)?r=!1:t.add(s)}switch(e.type){case"title":case"base":s.has(e.type)?r=!1:s.add(e.type);break;case"meta":for(let t=0,s=m.length;t<s;t++){let s=m[t];if(e.props.hasOwnProperty(s))if("charSet"===s)n.has(s)?r=!1:n.add(s);else{let t=e.props[s],n=a[s]||new Set;("name"!==s||!i)&&n.has(t)?r=!1:(n.add(t),a[s]=n)}}}return r})).reverse().map((e,t)=>{let s=e.key||t;return o.default.cloneElement(e,{key:s})})}let f=function({children:e}){let t=(0,o.useContext)(c.HeadManagerContext);return(0,l.jsx)(d.default,{reduceComponentsToState:p,headManager:t,children:e})};("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},18556,(e,t,s)=>{"use strict";e.i(47167),Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"ImageConfigContext",{enumerable:!0,get:function(){return r}});let n=e.r(55682)._(e.r(71645)),a=e.r(87690),r=n.default.createContext(a.imageConfigDefault)},65856,(e,t,s)=>{"use strict";e.i(47167),Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"RouterContext",{enumerable:!0,get:function(){return n}});let n=e.r(55682)._(e.r(71645)).default.createContext(null)},70965,(e,t,s)=>{"use strict";function n(e,t){let s=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-s)<Math.abs(e-s)?t:e,t.qualities[0]):s}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"findClosestQuality",{enumerable:!0,get:function(){return n}})},1948,(e,t,s)=>{"use strict";e.i(47167),Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return i}});let n=e.r(70965),a=e.r(43369);function r({config:e,src:t,width:s,quality:i}){let l=(0,a.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//"))if(t.includes("/_next/static/immutable")&&!(0,a.getAssetToken)())l=void 0;else{let e=t.indexOf("?");if(-1!==e){let s=new URLSearchParams(t.slice(e+1)),n=s.get("dpl");if(n){l=n,s.delete("dpl");let a=s.toString();t=t.slice(0,e)+(a?"?"+a:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
|
|
2
|
+
Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let o=(0,n.findClosestQuality)(i,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${s}&q=${o}${t.startsWith("/")&&l?`&dpl=${l}`:""}`}r.__next_img_default=!0;let i=r},88143,(e,t,s)=>{"use strict";function n({widthInt:e,heightInt:t,blurWidth:s,blurHeight:a,blurDataURL:r,objectFit:i}){let l=s?40*s:e,o=a?40*a:t,d=l&&o?`viewBox='0 0 ${l} ${o}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${d}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${d?"none":"contain"===i?"xMidYMid":"cover"===i?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${r}'/%3E%3C/svg%3E`}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},87690,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var n={VALID_LOADERS:function(){return r},imageConfigDefault:function(){return i}};for(var a in n)Object.defineProperty(s,a,{enumerable:!0,get:n[a]});let r=["default","imgix","cloudinary","akamai","custom"],i={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},8927,(e,t,s)=>{"use strict";e.i(47167),Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"getImgProps",{enumerable:!0,get:function(){return d}});let n=e.r(43369),a=e.r(88143),r=e.r(87690),i=["-moz-initial","fill","none","scale-down",void 0];function l(e){return void 0!==e.default}function o(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function d({src:e,sizes:t,unoptimized:s=!1,priority:c=!1,preload:u=!1,loading:h,className:m,quality:p,width:f,height:g,fill:x=!1,style:b,overrideSrc:y,onLoad:j,onLoadingComplete:v,placeholder:w="empty",blurDataURL:N,fetchPriority:S,decoding:k="async",layout:C,objectFit:_,objectPosition:R,lazyBoundary:E,lazyRoot:I,...$},A){var T;let P,D,O,{imgConf:L,showAltText:M,blurComplete:F,defaultLoader:U}=A,q=L||r.imageConfigDefault;if("allSizes"in q)P=q;else{let e=[...q.deviceSizes,...q.imageSizes].sort((e,t)=>e-t),t=q.deviceSizes.sort((e,t)=>e-t),s=q.qualities?.sort((e,t)=>e-t);P={...q,allSizes:e,deviceSizes:t,qualities:s}}if(void 0===U)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let z=$.loader||U;delete $.loader,delete $.srcSet;let H="__next_img_default"in z;if(H){if("custom"===P.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
|
|
3
|
+
Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=z;z=t=>{let{config:s,...n}=t;return e(n)}}if(C){"fill"===C&&(x=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[C];e&&(b={...b,...e});let s={responsive:"100vw",fill:"100vw"}[C];s&&!t&&(t=s)}let B="",W=o(f),K=o(g);if((T=e)&&"object"==typeof T&&(l(T)||void 0!==T.src)){let t=l(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(D=t.blurWidth,O=t.blurHeight,N=N||t.blurDataURL,B=t.src,!x)if(W||K){if(W&&!K){let e=W/t.width;K=Math.round(t.height*e)}else if(!W&&K){let e=K/t.height;W=Math.round(t.width*e)}}else W=t.width,K=t.height}let J=!c&&!u&&("lazy"===h||void 0===h);(!(e="string"==typeof e?e:B)||e.startsWith("data:")||e.startsWith("blob:"))&&(s=!0,J=!1),P.unoptimized&&(s=!0),H&&!P.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(s=!0);let G=o(p),V=Object.assign(x?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:_,objectPosition:R}:{},M?{}:{color:"transparent"},b),Q=F||"empty"===w?null:"blur"===w?`url("data:image/svg+xml;charset=utf-8,${(0,a.getImageBlurSvg)({widthInt:W,heightInt:K,blurWidth:D,blurHeight:O,blurDataURL:N||"",objectFit:V.objectFit})}")`:`url("${w}")`,X=i.includes(V.objectFit)?"fill"===V.objectFit?"100% 100%":"cover":V.objectFit,Y=Q?{backgroundSize:X,backgroundPosition:V.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:Q}:{},Z=function({config:e,src:t,unoptimized:s,width:a,quality:r,sizes:i,loader:l}){if(s){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,n.getDeploymentId)();if(t.includes("/_next/static/immutable")&&!(0,n.getAssetToken)())e=void 0;else if(e){let s=t.indexOf("?");if(-1!==s){let n=new URLSearchParams(t.slice(s+1));n.get("dpl")||(n.append("dpl",e),t=t.slice(0,s)+"?"+n.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:o,kind:d}=function({deviceSizes:e,allSizes:t},s,n){if(n){let s=/(^|\s)(1?\d?\d)vw/g,a=[];for(let e;e=s.exec(n);)a.push(parseInt(e[2]));if(a.length){let s=.01*Math.min(...a);return{widths:t.filter(t=>t>=e[0]*s),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof s?{widths:e,kind:"w"}:{widths:[...new Set([s,2*s].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,a,i),c=o.length-1;return{sizes:i||"w"!==d?i:"100vw",srcSet:o.map((s,n)=>`${l({config:e,src:t,quality:r,width:s})} ${"w"===d?s:n+1}${d}`).join(", "),src:l({config:e,src:t,quality:r,width:o[c]})}}({config:P,src:e,unoptimized:s,width:W,quality:G,sizes:t,loader:z}),ee=J?"lazy":h;return{props:{...$,loading:ee,fetchPriority:S,width:W,height:K,decoding:k,className:m,style:{...V,...Y},sizes:Z.sizes,srcSet:Z.srcSet,src:y||Z.src},meta:{unoptimized:s,preload:u||c,placeholder:w,fill:x}}}},98879,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return l}});let n=e.r(71645),a="u"<typeof window,r=a?()=>{}:n.useLayoutEffect,i=a?()=>{}:n.useEffect;function l(e){let{headManager:t,reduceComponentsToState:s}=e;function l(){if(t&&t.mountedInstances){let e=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(s(e))}}return a&&(t?.mountedInstances?.add(e.children),l()),r(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),r(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),i(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13255,e=>{"use strict";var t=e.i(43476),n=e.i(71645),r=e.i(22016),a=e.i(50814);e.s(["default",0,function({summary:e,onChanged:i}){let[o,s]=(0,n.useState)(!1),[u,l]=(0,n.useState)(""),c=(0,a.stateTone)(e.state),d=(0,a.outcomeLine)(e),f=(0,a.failureAdvice)(e),p=`exchange-${e.id}-title`,h=async()=>{if(!o){s(!0),l("");try{let t=await fetch(`/api/exchanges/${encodeURIComponent(e.id)}/cancel`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!t.ok){let e=await t.json().catch(()=>null);l("string"==typeof e?.error?.message?e.error.message:"Could not cancel. Try again.")}}catch{l("Could not cancel. Try again.")}finally{s(!1),i?.()}}};return(0,t.jsxs)("article",{id:`exchange-${e.id}`,className:`exchange-card is-${c} is-${e.state}`,"data-exchange-id":e.id,"data-exchange-state":e.state,"aria-labelledby":p,tabIndex:-1,children:[(0,t.jsxs)("p",{className:"exchange-card-line",children:[(0,t.jsx)("span",{className:"exchange-card-mode",children:(0,a.modeLabel)(e.mode)}),(0,t.jsx)("span",{id:p,className:"exchange-card-title",children:(0,a.participantsLabel)(e)}),(0,t.jsx)("span",{className:"exchange-card-state",role:"status",children:(0,a.liveStateLabel)(e)})]}),(0,t.jsx)("p",{className:"exchange-card-session",children:(0,a.sessionLabel)(e)}),(0,t.jsxs)("p",{className:"exchange-card-instruction",children:[(0,t.jsx)("span",{className:"exchange-card-key",children:(0,a.instructionHeading)(e.mode)})," ",(0,a.excerpt)(e.instruction,220)]}),d?(0,t.jsx)("p",{className:"failed"===e.state?"exchange-card-outcome is-failure":"exchange-card-outcome",children:d}):null,f?(0,t.jsx)("p",{className:"exchange-card-advice",children:f}):null,u?(0,t.jsx)("p",{className:"exchange-card-error",role:"alert",children:u}):null,(0,t.jsxs)("p",{className:"exchange-card-foot",children:[(0,t.jsxs)("span",{className:"exchange-card-time",children:["Updated ",(0,a.formatExchangeTime)(e.updated_at)]}),(0,t.jsx)(r.default,{className:"exchange-card-link",href:(0,a.detailsHref)(e.id),"aria-label":`Details: ${(0,a.modeLabel)(e.mode)} ${(0,a.participantsLabel)(e)}`,children:"Details"}),e.can_cancel?(0,t.jsx)("button",{type:"button",className:"exchange-card-cancel",disabled:o,onClick:()=>{h()},children:o?"Cancelling…":"Cancel"}):null]})]})}])},74904,3136,e=>{"use strict";let t=["hermes","cursor","claude","codex","muse"],n={hermes:"Hermes",cursor:"Cursor",claude:"Claude",codex:"Codex",muse:"Muse Code"},r="hermes";function a(e){return t.includes(String(e))?n[e]:String(e??"")}t.join("|"),e.s(["AGENTS",0,t,"AGENT_LABELS",0,n,"DEFAULT_AGENT",0,r,"agentLabel",0,a],3136);let i=t.map(e=>({value:e,label:n[e]}));function o(e){return a((e.agent??"").trim()||r)}function s(e){let t=e.runtime_connection;return t&&t.label.trim()?t.label.trim():(e.runtime_connection_id??"").trim()?(e.runtime_connection_id??"").trim():null}function u(e){return`~/.botmancers/${e}`}let l="~/.botmancers/{agentID}",c=`Default: ${l} — {agentID} is this agent's ID, assigned at creation.`;function d(e){return String(e).padStart(2,"0")}let f=[{prefix:"[Agent failed]",kind:"failed",label:"Agent failed"},{prefix:"[Deck handoff]",kind:"handoff",label:"Agent launch"},{prefix:"[Deck run]",kind:"run",label:"Agent run"},{prefix:"[Deck review]",kind:"review",label:"Agent review"},{prefix:"[Deck resume]",kind:"resume",label:"Agent resume"},{prefix:"[Deck result]",kind:"result",label:"Agent result"},{prefix:"[Deck failed]",kind:"failed",label:"Agent failed"},{prefix:"[Deck needs selection]",kind:"reselection",label:"Agent needs setup"},{prefix:"[Deck needs reselection]",kind:"reselection",label:"Agent needs setup"}];e.s(["AGENT_OPTIONS",0,i,"NEW_AGENT_WORKSPACE_HINT",0,c,"WORKSPACE_TEMPLATE",0,l,"agentEventDisplay",0,function(e){let t=String(e??"").trimStart(),n=f.find(e=>t.startsWith(e.prefix));return n?{label:n.label,detail:t.slice(n.prefix.length).trim()}:null},"botAgentLabel",0,o,"botConnectionLabel",0,s,"configWorkspaceHint",0,function(e){return`Default: ${u(e)} — leave blank to use it.`},"defaultWorkdirFor",0,u,"formatClock",0,function(e){let t=new Date(e);return`${d(t.getHours())}:${d(t.getMinutes())}:${d(t.getSeconds())}`},"rosterRuntimeLine",0,function(e){let t=`Agent: ${o(e)} \xb7 `+(s(e)??"No connection");return!1===e.launchable?t+" — see Config":t}],74904)},50814,63352,e=>{"use strict";function t(e){return`${new Date(e).toISOString().slice(0,16).replace("T"," ")} UTC`}let n="Not reported";function r(e){return e.toFixed(1).replace(/\.0$/,"")}function a(e){return e.toLocaleString("en-US")}function i(e){return 0===e?"$0.00":e>=.01?`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`:e<1e-4?"<$0.0001":`$${e.toFixed(4)}`}let o={input_tokens:"Input tokens",output_tokens:"Output tokens",cost_usd:"Cost"};function s(e,t,n){return"cost_usd"===e?i(t):n?a(t):t<1e3?String(t):t<999950?`${r(t/1e3)}k`:t<99995e4?`${r(t/1e6)}M`:`${r(t/1e9)}B`}function u(e){return`${e} ${1===e?"run":"runs"}`}function l(e,t,r=!1){let a=o[e];if(!t||"unavailable"===t.quality||null===t.sum)return{name:a,text:n,quality:"unavailable",coverage:t&&t.total>0?`0 of ${u(t.total)} reported`:"No runs recorded",label:`${a}: not reported`};let i=s(e,t.sum,r),c=s(e,t.sum,!0);return"partial"===t.quality?{name:a,text:i,quality:"partial",coverage:`Partial: ${t.known} of ${u(t.total)} reported`,label:`${a}: at least ${c}, partial, reported by ${t.known} of ${u(t.total)}`}:{name:a,text:i,quality:"complete",coverage:`All ${u(t.total)} reported`,label:`${a}: ${c}, reported by all ${u(t.total)}`}}e.s(["SESSION_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"ended",label:"Ended"}],"attemptLabel",0,function(e){let t="source"===e.role?"Started the session":"Resumed the session";return`${t} \xb7 ${e.outcome??"running"}`},"emptySessionsCopy",0,function(e,t){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=l("input_tokens",e?.input_tokens),r=l("output_tokens",e?.output_tokens),a=l("cost_usd",e?.cost_usd),i=[t,r,a];if(i.every(e=>"unavailable"===e.quality))return{text:n,label:"Usage: not reported",quality:"unavailable",partial:!1};let o=["unavailable"===t.quality?"input not reported":`${t.text} in`,"unavailable"===r.quality?"output not reported":`${r.text} out`,"unavailable"===a.quality?"cost not reported":a.text].join(" · "),s=i.some(e=>"partial"===e.quality),u=s||i.some(e=>"unavailable"===e.quality)?"partial":"complete";return{text:o,label:`Reported usage: ${i.map(e=>e.label).join("; ")}`,quality:u,partial:s}},"statusLabel",0,function(e){return"active"===e.status?"Active":"Ended"},"usageMetricView",0,l,"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:a(e.input_tokens),output:null===e.output_tokens?n:a(e.output_tokens),cost:null===e.cost_usd?n:i(e.cost_usd)}},"workRequestLabel",0,function(e){var t;let n=e.origin.work_request;return n?`${(t=n.execution_kind)?t[0].toUpperCase()+t.slice(1):t} \xb7 ${n.state}`:null}],63352);let c={ask:"Ask from this context",resume:"Resume work here",handoff:"Hand off to…"},d=["queued","extracting","delivering","completed","failed","cancelled"],f=["completed","failed","cancelled"];function p(e,t){switch(t){case"queued":return"Queued";case"extracting":return"ask"===e?"Asking the session":"Extracting handoff";case"delivering":return"Delivering handoff";case"completed":return"ask"===e?"Answered":"Handed off";case"failed":return"Failed";case"cancelled":return"Cancelled"}}function h(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 g(e,t){return t.updated_at-e.updated_at||t.created_at-e.created_at||(e.id<t.id?-1:+(e.id>t.id))}e.s(["DEFAULT_LEDGER_FILTER",0,{mode:"all",state:"all",agentId:""},"INSTRUCTION_LIMIT",0,4e3,"MODE_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"ask",label:"Ask"},{value:"continue",label:"Continue"}],"STATE_FILTER_OPTIONS",0,[{value:"all",label:"Any status"},{value:"active",label:"In progress"},{value:"queued",label:"Queued"},{value:"extracting",label:"Asking / extracting"},{value:"delivering",label:"Delivering"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"}],"detailsHref",0,function(e){return`/exchanges?id=${encodeURIComponent(e)}`},"eventLabel",0,function(e,t){let n=e.data??{},r=t.source.agent_name,a=t.destination?.agent_name??"the destination Agent",i="string"==typeof n.hop?n.hop:null;switch(e.type){case"created":return"ask"===t.mode?`You asked ${r}'s session a question`:`You handed ${r}'s session to ${a}`;case"hop_queued":if("deliver"===i)return`Handoff queued for ${a}'s new session`;return"extract"===i?`Handoff extraction queued in ${r}'s session`:`Question queued for ${r}'s session`;case"hop_started":if("deliver"===i)return`${a} started a new session`;return"extract"===i?`${r}'s session started extracting the handoff`:`${r}'s session started answering`;case"state_changed":{let e="string"==typeof n.to&&d.includes(n.to)?n.to:null;return e?`Now ${p(t.mode,e).toLowerCase()}`:"State changed"}case"answer_returned":return`Answer returned to ${t.origin?.label??"the origin thread"}${n.truncated?" (shortened)":""}`;case"packet_extracted":return"Handoff packet extracted";case"packet_rejected":return`Handoff packet refused${"string"==typeof n.reason?`: ${n.reason}`:""}`;case"destination_replied":return`${a} replied in ${t.destination?.conversation?.label??"its thread"}`;case"destination_session_rejected":return`${a}'s session was not new; the handoff stopped`;case"cancel_requested":return"You asked to cancel";case"hop_result_discarded":return"A late result was discarded";default:return e.type.replace(/_/g," ")}},"excerpt",0,h,"exchangeRequestBody",0,function(e,t,n){let r={mode:e.mode,idempotency_key:n,origin_conversation_id:e.originConversationId,source:{agent_id:t.agentId,session_ref:t.sessionRef},instruction:e.instruction.trim()};return"continue"===e.mode&&(r.destination={agent_id:e.destinationAgentId}),r},"failureAdvice",0,function(e){if("failed"!==e.state)return null;switch(e.failure?.code){case"packet_invalid":case"packet_missing":return"The source session did not return a usable handoff. Start a new Continue with a clearer objective.";case"destination_session_invalid":return"The destination did not start a fresh session. Check its runtime, then start a new Continue.";case"destination_turn_failed":return"Check the destination Agent’s runtime, then start a new Continue from the source session.";case"source_turn_failed":return"Check the source Agent’s runtime, then start a new exchange from its Sessions.";default:return"Start a new exchange from the session to try again."}},"formatExchangeTime",0,function(e){return t(e)},"instructionHeading",0,function(e){return"ask"===e?"Question":"Objective"},"ledgerAgents",0,function(e){let t=new Map;for(let n of e)t.set(n.source.agent_id,n.source.agent_name),n.destination&&t.set(n.destination.agent_id,n.destination.agent_name);return[...t.entries()].map(([e,t])=>({id:e,name:t})).sort((e,t)=>e.name.localeCompare(t.name)||e.id.localeCompare(t.id))},"ledgerRows",0,function(e,t){return e.filter(e=>("all"===t.mode||e.mode===t.mode)&&("active"!==t.state||!e.terminal)&&("all"===t.state||"active"===t.state||e.state===t.state)&&(!t.agentId||e.source.agent_id===t.agentId||e.destination?.agent_id===t.agentId)).sort(g)},"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,!f.includes(t))?"Cancelling…":p(e.mode,e.state)},"modeLabel",0,function(e){return"ask"===e?"Ask":"Continue"},"outcomeLine",0,function(e){if("completed"===e.state){if("ask"===e.mode){let t=e.origin?.label??"the origin thread";return e.outcome.answer?`Answer in ${t}: ${h(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: ${h(e.outcome.reply,200)}`:`${t} picked it up in a new session.`}return"failed"===e.state?e.failure?.message||"The exchange failed.":"cancelled"===e.state?"Cancelled before it finished. Nothing more will run.":null},"participantsLabel",0,function(e){return"ask"===e.mode?`You → ${e.source.agent_name}`:`${e.source.agent_name} → ${e.destination?.agent_name??"another Agent"}`},"pinRequestBody",0,function(e,t,n,r,a){return{action:e,content:t.trim(),conversation_id:n,idempotency_key:a,..."resume"===e?{approve_write:r}:{}}},"sessionDialogMode",0,function(e){return"handoff"===e?"continue":e},"sessionDialogTitle",0,function(e){return c["continue"===e?"handoff":e]},"sessionDialogUsesPin",0,function(e,t){return"resume"===e||"ask"===e&&"provider"===t},"sessionLabel",0,function(e){return`${e.source.agent_name}'s session “${e.source.session_title}”`},"sessionRowActions",0,function(e){let t;if(e.actions)t=e.actions;else{let n="ended"===e.status?{available:!1,reason:"Ask from this context and Hand off to… are unavailable: this session has ended. Its history stays here."}:e.resumable?{available:!0}:{available:!1,reason:`Ask from this context and Hand off to… are unavailable: Botmancers can’t resume this session under ${e.agent.name}’s current runtime.`},r=n.available?{available:!0}:{available:!1,code:"ended"===e.status?"session_ended":"session_not_resumable",reason:n.reason,recovery:"choose_session"};t={ask:r,resume:{available:!1,code:"action_unavailable",reason:`${c.resume} is unavailable: this runtime can’t resume a session with edits.`,recovery:"choose_action"},handoff:r}}return["ask","resume","handoff"].map(e=>({action:e,label:c[e],availability:t[e]}))},"stateTone",0,function(e){return"completed"===e?"done":"failed"===e||"cancelled"===e?"stopped":"active"},"submitErrorMessage",0,function(e,t){switch(e){case"session_ended":return"This session has ended and can’t be resumed.";case"session_not_resumable":return"Botmancers can’t resume this session under the Agent’s current runtime.";case"source_session_busy":return"This session already has an exchange in progress. Wait for it or cancel it from its card.";case"agent_unavailable":return t||"That Agent can’t launch yet. Choose its runtime connection and session scope in Config.";case"idempotency_conflict":return"This request changed while it was being sent. Send again.";case"session_missing":return"The runtime no longer has this session. Its history stays here; choose another session.";case"approval_required":return"Resume work here needs your approval of edits. Tick the approval, then send again.";case"authority_not_allowed":return t||"This Agent’s policy doesn’t allow edits in a resumed session. Change it in Config.";case"action_unavailable":return t||"This runtime can’t do that in this session. Choose another action.";case"provider_failed":return"The runtime failed this turn. Nothing moved to another session; try again later.";default:return t||"The exchange could not be started. Your draft is kept; try again."}},"threadHref",0,function(e,t){let n=new URLSearchParams;if(e.thread_agent_id)return n.set("agent",e.thread_agent_id),t&&n.set("exchange",t),`/?${n.toString()}`;if("group"!==e.kind)return null;t&&n.set("exchange",t);let r=n.toString();return`/threads/${encodeURIComponent(e.id)}${r?`?${r}`:""}`},"validateDraft",0,function(e){let t={},n=e.instruction.trim(),r="ask"===e.mode?"a question":"an objective";return n?e.instruction.length>4e3&&(t.instruction="Keep it under 4000 characters."):t.instruction=`Enter ${r}.`,e.originConversationId||(t.origin="Choose the thread that follows this exchange."),"continue"!==e.mode||e.destinationAgentId||(t.destination="Choose the Agent who continues the work."),t},"validateResumeDraft",0,function(e,t){let n={};return e.trim()?e.length>4e3&&(n.instruction="Keep it under 4000 characters."):n.instruction="Enter what to work on.",t||(n.approval="Approve edits in this session to resume work here."),n}],50814)},22016,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return b},useLinkStatus:function(){return v}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let i=e.r(90809),o=e.r(43476),s=i._(e.r(71645)),u=e.r(95057),l=e.r(8372),c=e.r(18581),d=e.r(18967),f=e.r(5550),p=e.r(88540),h=e.r(91949),g=e.r(73668),m=e.r(9396);function b(t){var n;let r,a,i,[b,v]=(0,s.useOptimistic)(h.IDLE_LINK_STATUS),y=(0,s.useRef)(null),{href:x,as:$,children:k,prefetch:S=null,passHref:w,replace:A,shallow:T,scroll:C,onClick:E,onMouseEnter:L,onTouchStart:N,legacyBehavior:j=!1,onNavigate:P,transitionTypes:R,ref:I,unstable_dynamicOnHover:O,...D}=t;r=k,j&&("string"==typeof r||"number"==typeof r)&&(r=(0,o.jsx)("a",{children:r}));let U=s.default.useContext(l.AppRouterContext),q=!1!==S,M=!1===S?"none":!0===S?"full":"auto",F="none"!==M?"auto"===M?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,B="string"==typeof(n=$||x)?n:(0,u.formatUrl)(n);if(j){if(r?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=s.default.Children.only(r)}let H=j?a&&"object"==typeof a&&a.ref:I,K,W=s.default.useCallback(e=>(null!==U&&(y.current=(0,h.mountLinkInstance)(e,B,U,F,q,v,K)),()=>{y.current&&((0,h.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,h.unmountPrefetchableInstance)(e)}),[q,B,U,F,v,K]),G={ref:(0,c.useMergedRef)(W,H),onClick(t){j||"function"!=typeof E||E(t),j&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!U||t.defaultPrevented||function(t,n,r,a,i,o,u,l="none"){if("u">typeof window){let c,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(n)){a&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(99781);s.default.startTransition(()=>{f(n,a?"replace":"push",!1===i?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,r.current,u,l)})}}(t,B,y,A,C,P,R,M)},onMouseEnter(e){j||"function"!=typeof L||L(e),j&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),U&&q&&(0,h.onNavigationIntent)(e.currentTarget,!0===O)},onTouchStart:function(e){j||"function"!=typeof N||N(e),j&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),U&&q&&(0,h.onNavigationIntent)(e.currentTarget,!0===O)}};return(0,d.isAbsoluteUrl)(B)?G.href=B:j&&!w&&("a"!==a.type||"href"in a.props)||(G.href=(0,f.addBasePath)(B)),i=j?s.default.cloneElement(a,G):(0,o.jsx)("a",{...D,...G,children:r}),(0,o.jsx)(_.Provider,{value:b,children:i})}let _=(0,s.createContext)(h.IDLE_LINK_STATUS),v=()=>(0,s.useContext)(_);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},18581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return a}});let r=e.r(71645);function a(e,t){let n=(0,r.useRef)(null),a=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(n.current=i(e,r)),t&&(a.current=i(t,r))},[e,t])}function i(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 i}});let r=e.r(18967),a=e.r(52817);function i(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,a.hasBasePath)(n.pathname)}catch(e){return!1}}},98183,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={assign:function(){return u},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return s}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});function i(e){let t={};for(let[n,r]of e.entries()){let e=t[n];void 0===e?t[n]=r:Array.isArray(e)?e.push(r):t[n]=[e,r]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function s(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,o(e));else t.set(n,o(r));return t}function u(e,...t){for(let n of t){for(let t of n.keys())e.delete(t);for(let[t,r]of n.entries())e.append(t,r)}return e}},95057,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={formatUrl:function(){return s},formatWithValidation:function(){return l},urlObjectKeys:function(){return u}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let i=e.r(90809)._(e.r(98183)),o=/https?|ftp|gopher|file/;function s(e){let{auth:t,hostname:n}=e,r=e.protocol||"",a=e.pathname||"",s=e.hash||"",u=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:n&&(l=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(l+=":"+e.port)),u&&"object"==typeof u&&(u=String(i.urlQueryToSearchParams(u)));let c=e.search||u&&`?${u}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||o.test(r))&&!1!==l?(l="//"+(l||""),a&&"/"!==a[0]&&(a="/"+a)):l||(l=""),s&&"#"!==s[0]&&(s="#"+s),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${r}${l}${a}${c}${s}`}let u=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(e){return s(e)}},18967,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={DecodeError:function(){return b},MiddlewareNotFoundError:function(){return x},MissingStaticPage:function(){return y},NormalizeError:function(){return _},PageNotFoundError:function(){return v},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return i},execOnce:function(){return o},getDisplayName:function(){return d},getLocationOrigin:function(){return l},getURL:function(){return c},isAbsoluteUrl:function(){return u},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return $}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,n=!1;return(...r)=>(n||(n=!0,t=e(...r)),t)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,u=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&s.test(e)};function l(){let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?":"+n:""}`}function c(){let{href:e}=window.location,t=l();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&f(n))return r;if(!r)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return r}let g="u">typeof performance,m=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class b extends Error{}class _ extends Error{}class 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 x extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function $(e){return JSON.stringify({message:e.message,stack:e.stack})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,32545,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(22016),o=e.i(74904);e.s(["default",0,function(){let[e,a]=(0,r.useState)(null),[i,l]=(0,r.useState)(0),[u,s]=(0,r.useState)(!1),[c,f]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let e=!1;return fetch("/api/bots/availability",{cache:"no-store"}).then(async t=>{if(!t.ok)throw Error("request failed");let r=await t.json();if(e)return;let n=Array.isArray(r.agents)?r.agents:null;if(!n)throw Error("request failed");a(new Set(n.filter(e=>e.launchable).map(e=>e.agent))),l(Date.now()),s(!1)}).catch(()=>{e||s(!0)}),()=>{e=!0}},[c]),(0,t.jsx)("div",{className:"cfg-page",children:(0,t.jsxs)("div",{className:"max-w-3xl mx-auto",children:[(0,t.jsx)(n.default,{href:"/",className:"cfg-link cfg-back text-sm",children:"← Back to chat"}),(0,t.jsxs)("header",{className:"mt-3 mb-6",children:[(0,t.jsx)("h1",{className:"text-xl font-bold",children:"Settings"}),(0,t.jsx)("p",{className:"text-sm cfg-faint",children:"Local runtime status for every agent in this Botmancers."})]}),(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"cfg-title",children:"Local runtimes"}),null!==e?(0,t.jsxs)("span",{className:"text-sm cfg-faint",children:["Checked ",(0,o.formatClock)(i)]}):null]}),u&&null===e?(0,t.jsxs)("p",{className:"text-sm cfg-muted",children:["Couldn't check the local runtimes."," ",(0,t.jsx)("button",{onClick:()=>f(e=>e+1),className:"cfg-link",children:"Retry"})]}):null===e?(0,t.jsx)("div",{className:"h-10 rounded-lg animate-pulse cfg-skel"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dl",{className:"text-sm",children:o.AGENT_OPTIONS.map(r=>{let n=e.has(r.value);return(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-muted",children:r.label}),(0,t.jsx)("dd",{className:n?"cfg-ok":"cfg-faint",children:n?"● Ready":"○ Not available"})]},r.value)})}),(0,t.jsx)("p",{className:"mt-2 text-xs cfg-faint",children:"Coding Agents need their provider CLI installed and signed in on this computer; Hermes needs the gateway key. A runtime that is not available here cannot launch an Agent until it is fixed."}),(0,t.jsx)("button",{onClick:()=>f(e=>e+1),className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Re-check"})]})]})]})})}])},74904,3136,e=>{"use strict";let t=["hermes","cursor","claude","codex","muse"],r={hermes:"Hermes",cursor:"Cursor",claude:"Claude",codex:"Codex",muse:"Muse Code"},n="hermes";function o(e){return t.includes(String(e))?r[e]:String(e??"")}t.join("|"),e.s(["AGENTS",0,t,"AGENT_LABELS",0,r,"DEFAULT_AGENT",0,n,"agentLabel",0,o],3136);let a=t.map(e=>({value:e,label:r[e]}));function i(e){return o((e.agent??"").trim()||n)}function l(e){let t=e.runtime_connection;return t&&t.label.trim()?t.label.trim():(e.runtime_connection_id??"").trim()?(e.runtime_connection_id??"").trim():null}function u(e){return`~/.botmancers/${e}`}let s="~/.botmancers/{agentID}",c=`Default: ${s} — {agentID} is this agent's ID, assigned at creation.`;function f(e){return String(e).padStart(2,"0")}let d=[{prefix:"[Agent failed]",kind:"failed",label:"Agent failed"},{prefix:"[Deck handoff]",kind:"handoff",label:"Agent launch"},{prefix:"[Deck run]",kind:"run",label:"Agent run"},{prefix:"[Deck review]",kind:"review",label:"Agent review"},{prefix:"[Deck resume]",kind:"resume",label:"Agent resume"},{prefix:"[Deck result]",kind:"result",label:"Agent result"},{prefix:"[Deck failed]",kind:"failed",label:"Agent failed"},{prefix:"[Deck needs selection]",kind:"reselection",label:"Agent needs setup"},{prefix:"[Deck needs reselection]",kind:"reselection",label:"Agent needs setup"}];e.s(["AGENT_OPTIONS",0,a,"NEW_AGENT_WORKSPACE_HINT",0,c,"WORKSPACE_TEMPLATE",0,s,"agentEventDisplay",0,function(e){let t=String(e??"").trimStart(),r=d.find(e=>t.startsWith(e.prefix));return r?{label:r.label,detail:t.slice(r.prefix.length).trim()}:null},"botAgentLabel",0,i,"botConnectionLabel",0,l,"configWorkspaceHint",0,function(e){return`Default: ${u(e)} — leave blank to use it.`},"defaultWorkdirFor",0,u,"formatClock",0,function(e){let t=new Date(e);return`${f(t.getHours())}:${f(t.getMinutes())}:${f(t.getSeconds())}`},"rosterRuntimeLine",0,function(e){let t=`Agent: ${i(e)} \xb7 `+(l(e)??"No connection");return!1===e.launchable?t+" — see Config":t}],74904)},22016,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return b},useLinkStatus:function(){return x}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(90809),i=e.r(43476),l=a._(e.r(71645)),u=e.r(95057),s=e.r(8372),c=e.r(18581),f=e.r(18967),d=e.r(5550),p=e.r(88540),h=e.r(91949),m=e.r(73668),g=e.r(9396);function b(t){var r;let n,o,a,[b,x]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),v=(0,l.useRef)(null),{href:j,as:E,children:N,prefetch:S=null,passHref:k,replace:_,shallow:A,scroll:P,onClick:C,onMouseEnter:T,onTouchStart:O,legacyBehavior:w=!1,onNavigate:L,transitionTypes:R,ref:D,unstable_dynamicOnHover:$,...I}=t;n=N,w&&("string"==typeof n||"number"==typeof n)&&(n=(0,i.jsx)("a",{children:n}));let M=l.default.useContext(s.AppRouterContext),U=!1!==S,B=!1===S?"none":!0===S?"full":"auto",F="none"!==B?"auto"===B?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,K="string"==typeof(r=E||j)?r:(0,u.formatUrl)(r);if(w){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=l.default.Children.only(n)}let W=w?o&&"object"==typeof o&&o.ref:D,G,z=l.default.useCallback(e=>(null!==M&&(v.current=(0,h.mountLinkInstance)(e,K,M,F,U,x,G)),()=>{v.current&&((0,h.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,h.unmountPrefetchableInstance)(e)}),[U,K,M,F,x,G]),H={ref:(0,c.useMergedRef)(z,W),onClick(t){w||"function"!=typeof C||C(t),w&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!M||t.defaultPrevented||function(t,r,n,o,a,i,u,s="none"){if("u">typeof window){let c,{nodeName:f}=t.currentTarget;if("A"===f.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(99781);l.default.startTransition(()=>{d(r,o?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,u,s)})}}(t,K,v,_,P,L,R,B)},onMouseEnter(e){w||"function"!=typeof T||T(e),w&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),M&&U&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)},onTouchStart:function(e){w||"function"!=typeof O||O(e),w&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),M&&U&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)}};return(0,f.isAbsoluteUrl)(K)?H.href=K:w&&!k&&("a"!==o.type||"href"in o.props)||(H.href=(0,d.addBasePath)(K)),a=w?l.default.cloneElement(o,H):(0,i.jsx)("a",{...I,...H,children:n}),(0,i.jsx)(y.Provider,{value:b,children:a})}let y=(0,l.createContext)(h.IDLE_LINK_STATUS),x=()=>(0,l.useContext)(y);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(71645);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=a(e,n)),t&&(o.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(18967),o=e.r(52817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return u},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function a(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function i(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,i(e));else t.set(r,i(n));return t}function u(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},95057,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return l},formatWithValidation:function(){return s},urlObjectKeys:function(){return u}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(90809)._(e.r(98183)),i=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",l=e.hash||"",u=e.query||"",s=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?s=t+e.host:r&&(s=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(s+=":"+e.port)),u&&"object"==typeof u&&(u=String(a.urlQueryToSearchParams(u)));let c=e.search||u&&`?${u}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||i.test(n))&&!1!==s?(s="//"+(s||""),o&&"/"!==o[0]&&(o="/"+o)):s||(s=""),l&&"#"!==l[0]&&(l="#"+l),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${s}${o}${c}${l}`}let u=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function s(e){return l(e)}},18967,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return b},MiddlewareNotFoundError:function(){return j},MissingStaticPage:function(){return v},NormalizeError:function(){return y},PageNotFoundError:function(){return x},SP:function(){return m},ST:function(){return g},WEB_VITALS:function(){return a},execOnce:function(){return i},getDisplayName:function(){return f},getLocationOrigin:function(){return s},getURL:function(){return c},isAbsoluteUrl:function(){return u},isResSent:function(){return d},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return E}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,u=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&l.test(e)};function s(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=s();return e.substring(t.length)}function f(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Object.defineProperty(Error(`"${f(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}let m="u">typeof performance,g=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class b extends Error{}class y extends Error{}class x extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class j extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function E(e){return JSON.stringify({message:e.message,stack:e.stack})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13978,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(22016),s=e.i(18566),r=e.i(15983),i=e.i(24204);function l({agentId:e,agentName:a}){let s=(0,n.useId)(),r=(0,n.useId)(),o=(0,n.useId)(),[c,d]=(0,n.useState)(null),[u,m]=(0,n.useState)(""),[f,h]=(0,n.useState)(0),[p,g]=(0,n.useState)("idle"),[x,b]=(0,n.useState)(""),[v,j]=(0,n.useState)(""),[y,N]=(0,n.useState)(""),[k,_]=(0,n.useState)(""),[w,S]=(0,n.useState)("");(0,n.useEffect)(()=>{let t=!1;return fetch(`/api/bots/${encodeURIComponent(e)}/share-policy`,{cache:"no-store"}).then(async e=>{let n=await e.json().catch(()=>null);t||(e.ok&&n?.policy?(m(""),d(n.policy)):m("Could not load the share policy."))}).catch(()=>{t||m("Could not load the share policy.")}),()=>{t=!0}},[e,f]);let C=()=>{b(""),g("idle"),h(e=>e+1)},$=async(t,n)=>{if(!c)return!1;g("saving"),b(""),j("");try{let a=await fetch(`/api/bots/${encodeURIComponent(e)}/share-policy`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({revision:c.revision,...t})}),s=await a.json().catch(()=>null);if(!a.ok||!s?.policy)return g("error"),b("string"==typeof s?.error?.message?s.error.message:"The share policy could not be saved."),!1;return d(s.policy),g("idle"),j(n("number"==typeof s.revoked_contexts?s.revoked_contexts:0)),!0}catch{return g("error"),b("The share policy could not be saved."),!1}},A=async e=>{if(e.preventDefault(),!c)return;let t=(0,i.audienceInputError)(y,k,c.audiences);if(S(t??""),t)return;let n={kind:"slack",team_id:y.trim(),channel_id:k.trim()};await $({audiences:[...c.audiences,n]},()=>`Added ${(0,i.audienceLabel)(n)}.`)&&(N(""),_(""))},T="saving"===p,E=!!c&&"invalid"!==c.state;return(0,t.jsxs)("section",{className:"cfg-card share-policy",id:"session-sharing","aria-labelledby":"cfg-sharing-title",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{id:"cfg-sharing-title",className:"cfg-title",children:"Session sharing"}),T?(0,t.jsx)("span",{className:"text-sm cfg-faint",role:"status",children:"Saving…"}):null]}),(0,t.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:["A share lets people in one Slack channel ask one of ",a,"’s sessions questions, read-only, until it expires or you revoke it. Create and revoke shares from Sessions."]}),u?(0,t.jsxs)("p",{className:"text-sm cfg-error",role:"alert",children:[u," ",(0,t.jsx)("button",{type:"button",onClick:C,className:"underline hover:no-underline",children:"Retry"})]}):null,c||u?null:(0,t.jsx)("p",{className:"text-sm cfg-faint",role:"status",children:"Loading…"}),c?.state==="invalid"?(0,t.jsxs)("p",{className:"text-sm cfg-error mb-3",role:"alert",children:["The share policy file is invalid, so nothing can be shared: ",c.reason," Fix or remove config/session-shares.json, then"," ",(0,t.jsx)("button",{type:"button",onClick:C,className:"underline hover:no-underline",children:"reload"}),"."]}):null,c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"share-policy-toggle",children:[(0,t.jsx)("input",{id:s,type:"checkbox",role:"switch",checked:c.agent.share_from_turn,"aria-checked":c.agent.share_from_turn,disabled:!E||T||!c.agent.share_current.supported&&!c.agent.share_from_turn,"data-share-policy":"share_from_turn",onChange:e=>{let t=e.target.checked;$({share_from_turn:t},e=>t?"Share from a turn is on.":`Share from a turn is off.${e?` Revoked ${e} live turn context${1===e?"":"s"}.`:""}`)}}),(0,t.jsxs)("label",{htmlFor:s,className:"text-sm",children:[(0,t.jsx)("span",{className:"font-medium",children:"Share from a turn"})," (",(0,t.jsx)("code",{className:"cfg-code",children:"share_from_turn"}),")"]})]}),(0,t.jsx)("p",{className:"text-sm cfg-faint share-policy-hint",children:(0,i.shareFromTurnNote)(c)}),c.agent.live_contexts>0?(0,t.jsxs)("p",{className:"text-sm cfg-faint share-policy-hint",children:[c.agent.live_contexts," live turn context",1===c.agent.live_contexts?"":"s"," now."]}):null,(0,t.jsx)("h3",{className:"cfg-title share-policy-sub",children:"Slack channel allowlist"}),(0,t.jsx)("p",{className:"text-sm cfg-faint",children:"Every Agent’s shares use this list. A share can only go to a channel on it."}),0===c.audiences.length?(0,t.jsx)("p",{className:"text-sm cfg-muted share-policy-empty",children:"No channel yet: nothing can be shared to Slack."}):(0,t.jsx)("ul",{className:"share-policy-list","aria-label":"Allowed Slack channels",children:c.audiences.map(e=>(0,t.jsxs)("li",{className:"share-policy-entry",children:[(0,t.jsx)("span",{className:"cfg-code",children:e.channel_id}),(0,t.jsxs)("span",{className:"cfg-faint",children:["workspace ",e.team_id]}),(0,t.jsx)("button",{type:"button",className:"cfg-link text-sm share-policy-remove",disabled:!E||T,"aria-label":`Remove ${(0,i.audienceLabel)(e)}`,onClick:()=>{c&&$({audiences:c.audiences.filter(t=>t.team_id!==e.team_id||t.channel_id!==e.channel_id)},()=>`Removed ${(0,i.audienceLabel)(e)}. Its Slack threads stop being answered.`)},children:"Remove"})]},`${e.team_id}:${e.channel_id}`))}),(0,t.jsxs)("form",{className:"share-policy-add",onSubmit:e=>{A(e)},"aria-label":"Add a Slack channel",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:r,className:"text-sm",children:"Workspace ID"}),(0,t.jsx)("input",{id:r,className:"cfg-input",value:y,placeholder:"T0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!E||T,"aria-invalid":!!w,onChange:e=>{N(e.target.value),S("")}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:o,className:"text-sm",children:"Channel ID"}),(0,t.jsx)("input",{id:o,className:"cfg-input",value:k,placeholder:"C0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!E||T,"aria-invalid":!!w,onChange:e=>{_(e.target.value),S("")}})]}),(0,t.jsx)("button",{type:"submit",className:"cfg-btn-primary text-sm",disabled:!E||T||!y.trim()||!k.trim(),children:"Add channel"})]}),w?(0,t.jsx)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:w}):null,"error"===p?(0,t.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:["Couldn't save: ",x," ",(0,t.jsx)("button",{type:"button",onClick:C,className:"underline hover:no-underline",children:"Reload"})]}):null,(0,t.jsx)("p",{className:"mt-2 text-sm cfg-ok",role:"status",children:v})]}):null]})}var o=e.i(10718),c=e.i(74904),d=e.i(33851),u=e.i(44079),m=e.i(52900),f=e.i(87303);function h({attribute:e,label:a,options:s,current:r,onPick:i,className:l}){let o=(0,n.useId)(),c=`avatar-${e}`;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{id:o,className:"avatar-group-label",children:a}),(0,t.jsx)("div",{className:l?`avatar-opt-grid ${l}`:"avatar-opt-grid",role:"radiogroup","aria-labelledby":o,children:s.map(n=>(0,t.jsxs)("label",{title:n.label,className:"avatar-opt",children:[(0,t.jsx)("input",{type:"radio",name:c,value:n.id,checked:r[e]===n.id,onChange:()=>i({[e]:n.id}),className:"avatar-opt-input"}),(0,t.jsx)("span",{className:"avatar-opt-art","aria-hidden":"true",children:(0,t.jsx)(f.default,{config:{...r,[e]:n.id},size:44})}),(0,t.jsx)("span",{children:n.label})]},n.id))})]})}var p=e.i(68541);function g({phase:e,onImport:n}){let a=(0,p.marketImportView)(e);return(0,t.jsxs)("div",{className:"mt-3","data-field":"marketplace-import",children:[(0,t.jsx)("button",{type:"button",onClick:n,disabled:a.busy,"aria-busy":a.busy,"aria-describedby":"cfg-market-import-status",className:"cfg-btn-ghost text-sm w-full sm:w-auto",children:"Import from Grok Marketplace"}),(0,t.jsx)("p",{id:"cfg-market-import-status",role:"status","aria-live":"polite",className:"error"===a.tone?"mt-2 text-sm cfg-error":"mt-2 text-xs cfg-faint",children:a.message})]})}var x=e.i(37947);let b="Fix the highlighted fields.",v=[{key:"avatar_accessory",label:"Avatar accessory"},{key:"avatar_color",label:"Avatar color"},{key:"avatar_eyes",label:"Avatar eyes"},{key:"avatar_hands",label:"Avatar hands"},{key:"description",label:"Description (rules)"},{key:"import_operation_id",label:"Import operation ID"},{key:"import_schema_version",label:"Import schema version"},{key:"memories",label:"Remembered facts"},{key:"name",label:"Name"},{key:"skill_content",label:"Skill content"},{key:"skill_path",label:"Skill path"},{key:"skill_present",label:"Skill present"},{key:"source_provider",label:"Source provider"},{key:"template_id",label:"Template ID"},{key:"template_url",label:"Template URL"},{key:"title",label:"Title"}];function j(e){return String(e).padStart(2,"0")}function y(e){let t=new Date(e);return`${t.getFullYear()}-${j(t.getMonth()+1)}-${j(t.getDate())} ${j(t.getHours())}:${j(t.getMinutes())}`}function N(e){let t=new Date(e);return`${j(t.getHours())}:${j(t.getMinutes())}:${j(t.getSeconds())}`}async function k(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}e.s(["default",0,function(){var e;let i=String((0,s.useParams)().id??""),j=(0,s.useRouter)(),[_,w]=(0,n.useState)(!1),[S,C]=(0,n.useState)(null),[$,A]=(0,n.useState)(!0),[T,E]=(0,n.useState)(!1),[R,I]=(0,n.useState)(!1),[D,P]=(0,n.useState)(0),[L,O]=(0,n.useState)(null),[U,F]=(0,n.useState)("clean"),[q,M]=(0,n.useState)(""),[H,B]=(0,n.useState)(0),[K,W]=(0,n.useState)(!1),[V,z]=(0,n.useState)(""),[J,Y]=(0,n.useState)("clean"),[G,Q]=(0,n.useState)(""),[X,Z]=(0,n.useState)(0),[ee,et]=(0,n.useState)({}),[en,ea]=(0,n.useState)(""),[es,er]=(0,n.useState)(!1),[ei,el]=(0,n.useState)(null),[eo,ec]=(0,n.useState)(!1),ed=(0,m.useRuntimeConnections)(),[eu,em]=(0,n.useState)(void 0),[ef,eh]=(0,n.useState)("clean"),[ep,eg]=(0,n.useState)(""),[ex,eb]=(0,n.useState)(0),[ev,ej]=(0,n.useState)(null),[ey,eN]=(0,n.useState)("clean"),[ek,e_]=(0,n.useState)(""),[ew,eS]=(0,n.useState)(0),{phase:eC,startImport:e$}=function(e){let[t,a]=(0,n.useState)("idle");return(0,n.useEffect)(()=>{let t=window.location.search;if(null===(0,p.importedBotId)(t))return;let n=new URL(window.location.href);n.searchParams.delete(p.IMPORT_RETURN_QUERY),window.history.replaceState(null,"",n.pathname+n.search);let s=!1;return(0,p.resolveImportReturn)(t,e,async e=>(await fetch(`/api/bots/${encodeURIComponent(e)}/config`,{cache:"no-store"})).ok).then(e=>{s||("open"===e.kind?window.location.replace(e.path):"missing"===e.kind&&a("missing"))}),()=>{s=!0}},[e]),{phase:t,startImport:async function(){a("checking");try{let e=await fetch(p.HANDOFF_STATUS_PATH,{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok)return void a("failed");if(t?.configured!==!0)return void a("unavailable");a("redirecting"),window.location.href=(0,p.handoffStartPath)(window.location.origin,window.location.pathname),setTimeout(()=>a(e=>"redirecting"===e?"idle":e),4e3)}catch{a("failed")}}}}(i);function eA(){A(!0),E(!1),P(e=>e+1)}(0,n.useEffect)(()=>{if(!i)return;let e=!1;return fetch(`/api/bots/${encodeURIComponent(i)}/sessions?status=all`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(t=>{e||em((t?.sessions??[]).map(e=>({ref:e.ref,title:e.title,status:e.status})))}).catch(()=>{e||em([])}),()=>{e=!0}},[i,D]),(0,n.useEffect)(()=>{if(!i)return;let e=!1;return fetch(`/api/bots/${encodeURIComponent(i)}/config`).then(async t=>{if(e)return;if(404===t.status){I(!0),C(null);return}if(!t.ok)throw Error("request failed");let n=await t.json();e||(C(n),O(n.bot.description??""),I(!1),E(!1))}).catch(()=>{e||E(!0)}).finally(()=>{e||A(!1)}),()=>{e=!0}},[i,D]);let eT=S?.bot.description??"",eE=null!==L&&L!==eT,eR=S?.skill.content??"",eI=K&&V!==eR,eD=S?(0,d.registrationFormFromBot)(S.bot):null,eP=es&&null!==ei&&JSON.stringify(ei)!==JSON.stringify(eD),eL=S?.bot.avatar_config??(0,x.resolveAvatar)(S?.bot??{}),eO=ev??eL,eU=null!==ev&&JSON.stringify(ev)!==JSON.stringify(eL),eF=eE||eI||eP||eU;function eq(e,t){k(t).then(t=>{t&&(ea(e),setTimeout(()=>ea(t=>t===e?"":t),2e3))})}async function eM(){if(S&&null!==L){F("saving"),M("");try{let e=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:S.bot.id,description:L})});if(!e.ok){let t="request failed";try{let n=await e.json();n.error&&(t=n.error)}catch{}throw Error(t)}let t=await fetch(`/api/bots/${encodeURIComponent(i)}/config`);if(!t.ok)throw Error("request failed");C(await t.json()),F("confirmed"),B(Date.now()),setTimeout(()=>{F(e=>"confirmed"===e?"clean":e)},5e3)}catch(e){F("error"),M(e instanceof Error?e.message:"request failed")}}}function eH(){S&&(el((0,d.registrationFormFromBot)(S.bot)),er(!0),ec(!1),eh("clean"),eg(""),ed.retry())}function eB(e){el(t=>t?{...t,...e}:t),eg(""),eh(e=>"error"===e?"clean":e)}function eK(){er(!1),el(null),eh("clean"),eg("")}function eW(e){ej({...ev??eL,...e}),eN("clean"),e_("")}async function eV(){if(S&&ev){eN("saving"),e_("");try{let e=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:S.bot.id,avatar:ev})});if(!e.ok){let t="request failed";try{let n=await e.json();n.error&&(t=n.error)}catch{}throw Error(t)}let t=await fetch(`/api/bots/${encodeURIComponent(i)}/config`);if(!t.ok)throw Error("request failed");C(await t.json()),ej(null),eN("confirmed"),eS(Date.now()),setTimeout(()=>{eN(e=>"confirmed"===e?"clean":e)},5e3)}catch(e){eN("error"),e_(e instanceof Error?e.message:"request failed")}}}async function ez(){if(S&&ei){if((0,d.hasRegistrationErrors)((0,d.registrationFormView)(ei,ed.state))){ec(!0),eh("error"),eg(b);return}eh("saving"),eg("");try{let e=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,d.registrationPatchBody)(S.bot.id,ei))});if(!e.ok){let t="request failed";try{let n=await e.json();n.error&&(t=n.error)}catch{}throw Error(t)}let t=await fetch(`/api/bots/${encodeURIComponent(i)}/config`);if(!t.ok)throw Error("request failed");C(await t.json()),er(!1),el(null),eh("confirmed"),eb(Date.now()),setTimeout(()=>{eh(e=>"confirmed"===e?"clean":e)},5e3)}catch(e){eh("error"),eg(e instanceof Error?e.message:"request failed")}}}function eJ(){z(S?.skill.content??""),W(!0),Y("clean"),Q("")}async function eY(){if(S&&(V.trim()||window.confirm("Delete this skill file?"))){Y("saving"),Q("");try{let e=await fetch(`/api/bots/${encodeURIComponent(i)}/skill`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:V})});if(!e.ok){let t="request failed";try{let n=await e.json();n.error&&(t=n.error)}catch{}throw Error(t)}let t=await e.json();C(e=>e?{...e,skill:t.skill,currentHash:t.currentHash}:e),W(!1),Y("confirmed"),Z(Date.now()),setTimeout(()=>{Y(e=>"confirmed"===e?"clean":e)},5e3)}catch(e){Y("error"),Q(e instanceof Error?e.message:"request failed")}}}if((0,n.useEffect)(()=>{if(!eF)return;let e=e=>{e.preventDefault()};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[eF]),R)return(0,t.jsx)("div",{className:"cfg-page flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"mb-4",children:"Agent not found."}),(0,t.jsx)(a.default,{href:"/",className:"cfg-link",children:"← Back to chat"})]})});if($&&!S)return(0,t.jsx)("div",{className:"cfg-page",children:(0,t.jsxs)("div",{className:"max-w-6xl mx-auto space-y-6",children:[(0,t.jsx)("div",{className:"h-6 w-32 rounded animate-pulse cfg-skel"}),(0,t.jsx)("div",{className:"h-20 rounded-lg animate-pulse cfg-skel"}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsx)("div",{className:"space-y-6",children:[0,1,2].map(e=>(0,t.jsx)("div",{className:"h-48 rounded-lg animate-pulse cfg-skel"},e))}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)("div",{className:"h-64 rounded-lg animate-pulse cfg-skel"}),(0,t.jsx)("div",{className:"h-80 rounded-lg animate-pulse cfg-skel"})]})]})]})});if(T&&!S)return(0,t.jsx)("div",{className:"cfg-page",children:(0,t.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,t.jsx)(a.default,{href:"/",className:"cfg-link cfg-back text-sm",children:"← Back to chat"}),(0,t.jsxs)("header",{className:"mt-3 mb-6 flex flex-wrap items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"text-xl font-bold truncate",children:"Agent configuration"}),(0,t.jsx)("p",{className:"text-sm cfg-faint truncate",children:"Couldn't load agent details."})]}),(0,t.jsxs)("div",{className:"ml-auto text-right",children:[(0,t.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash: ",(0,t.jsx)("code",{className:"cfg-code",children:"—"})]}),(0,t.jsx)("p",{className:"text-sm mt-1",children:(0,t.jsx)("span",{className:"cfg-faint",children:"○ Not loaded"})})]})]}),(0,t.jsx)("div",{className:"grid gap-6 lg:grid-cols-2 items-start",children:[["Skills","Rules","Agent","Template source"],["Launch snapshots","Avatar"]].map(e=>(0,t.jsx)("div",{className:"min-w-0 space-y-6",children:e.map(e=>(0,t.jsxs)("div",{className:"cfg-card",children:[(0,t.jsx)("h2",{className:"cfg-title mb-2",children:e}),(0,t.jsxs)("p",{className:"text-sm cfg-muted",children:["Couldn't load this section."," ",(0,t.jsx)("button",{onClick:eA,className:"cfg-link",children:"Retry"})]})]},e))},e[0]))})]})});if(!S)return null;let{bot:eG,skill:eQ,currentHash:eX,snapshots:eZ}=S,e0=!!(eG.source_provider||eG.template_id||eG.template_url||eG.import_schema_version||eG.import_operation_id),e1="saving"===U?(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):eE||"error"===U?(0,t.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===U?(0,t.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",N(H)]}):(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),e3="saving"===J?(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):eI||"error"===J?(0,t.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===J?(0,t.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",N(X)]}):(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),e2="saving"===ef?(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):eP||"error"===ef?(0,t.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===ef?(0,t.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",N(ex)]}):(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),e4="saving"===ey?(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):eU||"error"===ey?(0,t.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===ey?(0,t.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",N(ew)]}):(0,t.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"});return(0,t.jsxs)("div",{className:"cfg-page",children:[(0,t.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,t.jsx)(a.default,{href:"/",onClick:function(e){eF&&!window.confirm("You have unsaved changes. Leave without saving?")&&e.preventDefault()},className:"cfg-link cfg-back text-sm",children:"← Back to chat"}),(0,t.jsxs)("header",{className:"mt-3 mb-6 flex flex-wrap items-center gap-4",children:[(0,t.jsx)(f.default,{bot:eG,size:48,title:`${eG.name} avatar`}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"text-xl font-bold truncate",children:eG.name}),(0,t.jsx)("p",{className:"text-sm cfg-faint truncate",children:eG.title||" "})]}),(0,t.jsxs)("div",{className:"ml-auto text-right",children:[(0,t.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash:"," ",(0,t.jsx)("code",{className:"cfg-code",title:eX,children:eX.slice(0,8)})," ",(0,t.jsx)("button",{onClick:()=>eq("header",eX),className:"cfg-link text-sm",children:"header"===en?"Copied":"Copy"})]}),(0,t.jsx)("p",{className:"text-sm mt-1",children:eF?(0,t.jsxs)("span",{className:"cfg-dirty",children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):(0,t.jsx)("span",{className:"cfg-faint",children:"● Saved"})})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2 items-start","data-cfg-layout":"columns",children:[(0,t.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"primary",children:[(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"cfg-title",children:"Skills"}),e3]}),"unsupported"===eQ.status?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Unsupported name"}),(0,t.jsx)("p",{className:"text-sm cfg-muted",children:"Skill files need an agent name matching /^[A-Za-z0-9_-]+$/ — this name cannot map to a skill path."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:[eQ.path," · ","present"===eQ.status?"Present":"Not present"]}),K?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("textarea",{value:V,onChange:e=>z(e.target.value),rows:8,className:"cfg-input text-sm"}),"error"===J&&(0,t.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",G,"."," ",(0,t.jsx)("button",{onClick:eY,className:"underline hover:no-underline",children:"Retry"})]}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)("button",{onClick:eY,disabled:!eI||"saving"===J,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===J?"Saving…":"Save"}),(0,t.jsx)("button",{onClick:function(){W(!1),Y("clean"),Q("")},disabled:!eI||"saving"===J,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}):"present"===eQ.status?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"text-sm cfg-pre max-h-64 overflow-y-auto",children:eQ.content}),(0,t.jsx)("button",{onClick:eJ,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm cfg-muted",children:"No skill file yet. Create SKILL.md to give this agent standing instructions."}),(0,t.jsx)("button",{onClick:eJ,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Create"})]}),(0,t.jsx)("p",{className:"mt-3 text-xs cfg-faint",children:"Appended verbatim as a system message at launch."})]})]}),(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"cfg-title",children:"Rules"}),e1]}),(0,t.jsx)("textarea",{value:L??"",onChange:e=>O(e.target.value),rows:8,className:"cfg-input cfg-input-sans text-sm"}),(0,t.jsx)("p",{className:"mt-2 text-xs cfg-faint",children:"Sent verbatim as the standing-rules system message on every turn. This beats the user's request for detail or length."}),"error"===U&&(0,t.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",q,"."," ",(0,t.jsx)("button",{onClick:eM,className:"underline hover:no-underline",children:"Retry"})]}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)("button",{onClick:eM,disabled:!eE||"saving"===U,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===U?"Saving…":"Save"}),(0,t.jsx)("button",{onClick:function(){O(eT),F("clean"),M("")},disabled:!eE||"saving"===U,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"cfg-title",children:"Agent"}),e2]}),(()=>{if(!es||!ei){let e=(0,d.registrationReadView)(eG,eu);return(0,t.jsxs)("div",{"data-field":"runtime-read",children:[(0,t.jsx)("dl",{className:"text-sm",children:e.rows.map(e=>(0,t.jsxs)("div",{"data-row":e.key,className:"flex flex-col sm:flex-row sm:justify-between gap-x-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:e.label}),(0,t.jsx)("dd",{className:"sm:text-right break-words cfg-muted",children:e.value})]},e.key))}),e.notices.map(e=>(0,t.jsx)("p",{className:"text-sm cfg-dirty mt-2",children:e},e)),(0,t.jsx)("button",{onClick:eH,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]})}let e=(0,d.registrationFormView)(ei,ed.state);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.RegistrationFields,{idPrefix:"cfg",variant:"config",form:ei,onChange:eB,view:e,showErrors:eo,connections:ed.state,onRetryConnections:ed.retry,onAddConnection:ed.add,workspacePlaceholder:(0,c.defaultWorkdirFor)(eG.id),workspaceHint:(0,c.configWorkspaceHint)(eG.id),sessions:eu,includeHomeSession:!0}),"error"===ef&&(0,t.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:[ep===b?ep:`Couldn't save: ${ep}.`," ",ep===b?null:(0,t.jsx)("button",{onClick:ez,className:"underline hover:no-underline",children:"Retry"})]}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)("button",{onClick:ez,disabled:!eP||"saving"===ef||e.submitDisabled,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===ef?"Saving…":"Save"}),(0,t.jsx)("button",{onClick:eK,disabled:"saving"===ef,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:eP?"Discard":"Cancel"})]})]})})()]}),(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsx)("h2",{className:"cfg-title mb-3",children:"Template source"}),!e0&&(0,t.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Created manually in Botmancers — no template source."}),(0,t.jsxs)("dl",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:"Source provider"}),(0,t.jsx)("dd",{className:"text-right",children:eG.source_provider??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:"Template ID"}),(0,t.jsx)("dd",{className:"text-right",children:eG.template_id??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:"Template URL"}),(0,t.jsx)("dd",{className:"text-right break-all",children:eG.template_url?(e=eG.template_url).startsWith("http://")||e.startsWith("https://")?(0,t.jsx)("a",{href:eG.template_url,className:"cfg-link",children:eG.template_url}):eG.template_url:"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:"Import schema version"}),(0,t.jsx)("dd",{className:"text-right",children:eG.import_schema_version??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:"Import operation ID"}),(0,t.jsx)("dd",{className:"text-right break-all",children:eG.import_operation_id??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-y cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:"Imported at"}),(0,t.jsx)("dd",{className:"text-right",children:eG.import_timestamp?y(eG.import_timestamp):"—"})]})]}),(0,t.jsx)(g,{phase:eC,onImport:()=>{e$()}})]})]}),(0,t.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"secondary",children:[(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsx)("h2",{className:"cfg-title mb-3",children:"Launch snapshots"}),0===eZ.length?(0,t.jsx)("p",{className:"text-sm cfg-muted",children:"No launches recorded yet."}):(0,t.jsx)("ul",{className:"space-y-3",children:eZ.map(e=>{let n=e.hash===eX,a=!!ee[e.id];return(0,t.jsxs)("li",{className:"cfg-row",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("p",{className:"text-sm",children:[y(e.created_at)," · ",e.id.slice(0,4),e.transport?` \xb7 ${e.transport}`:null]}),(0,t.jsx)("button",{onClick:()=>et(t=>({...t,[e.id]:!t[e.id]})),"aria-label":a?"Collapse snapshot detail":"Expand snapshot detail",className:"cfg-chevron px-1",children:a?"▾":"▸"})]}),(0,t.jsxs)("p",{className:"mt-1 text-sm",children:[(0,t.jsx)("code",{className:"cfg-code",children:e.hash.slice(0,12)})," ",(0,t.jsx)("button",{onClick:()=>eq(e.id,e.hash),className:"cfg-link text-sm",children:en===e.id?"Copied":"Copy"})]}),(0,t.jsx)("p",{className:"mt-1 text-sm",children:n?(0,t.jsx)("span",{className:"cfg-ok",children:"● Matches current config"}):(0,t.jsx)("span",{className:"cfg-faint",children:"○ Config changed since"})}),a&&(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t cfg-line text-sm",children:[(0,t.jsxs)("p",{className:"cfg-muted break-all",children:[(0,t.jsx)("span",{className:"font-medium",children:"Launch ID:"})," ",e.id]}),(0,t.jsxs)("p",{className:"mt-1 cfg-muted break-all",children:[(0,t.jsx)("span",{className:"font-medium",children:"Hash:"})," ",(0,t.jsx)("code",{className:"cfg-code",children:e.hash})]}),(0,t.jsx)("dl",{className:"mt-2",children:v.map(n=>{let a=e.snapshot[n.key];return(0,t.jsxs)("div",{className:"py-1 border-t cfg-line",children:[(0,t.jsx)("dt",{className:"cfg-faint",children:n.label}),(0,t.jsx)("dd",{className:"whitespace-pre-wrap break-words",children:null==a?(0,t.jsx)("span",{className:"cfg-faint",children:"null"}):Array.isArray(a)?0===a.length?(0,t.jsx)("span",{className:"cfg-faint",children:"(none)"}):(0,t.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:a.map(e=>`- ${e}`).join("\n")}):"boolean"==typeof a?String(a):""===a?(0,t.jsx)("span",{className:"cfg-faint",children:"(empty)"}):(0,t.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:a})})]},n.key)})})]})]},e.id)})})]}),(0,t.jsx)(l,{agentId:eG.id,agentName:eG.name}),(0,t.jsxs)("section",{className:"cfg-card",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"cfg-title",children:"Avatar"}),e4]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,t.jsx)(f.default,{config:eO,size:96,title:"Avatar live preview"}),(0,t.jsx)("p",{className:"text-sm cfg-muted",children:"Outline style: the color is the line color, nothing is filled. Pick an option to preview, then Save."})]}),(0,t.jsx)(h,{attribute:"color",label:"Color",options:x.AVATAR_COLORS,current:eO,onPick:eW,className:"mb-3"}),(0,t.jsx)(h,{attribute:"eyes",label:"Eyes",options:x.AVATAR_EYES,current:eO,onPick:eW,className:"mb-3"}),(0,t.jsx)(h,{attribute:"hands",label:"Hands",options:x.AVATAR_HANDS,current:eO,onPick:eW,className:"mb-3"}),(0,t.jsx)(h,{attribute:"accessory",label:"Accessory",options:x.AVATAR_ACCESSORIES,current:eO,onPick:eW}),"error"===ey&&(0,t.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",ek,"."," ",(0,t.jsx)("button",{onClick:eV,className:"underline hover:no-underline",children:"Retry"})]}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)("button",{onClick:eV,disabled:!eU||"saving"===ey,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===ey?"Saving…":"Save"}),(0,t.jsx)("button",{onClick:function(){ej(null),eN("clean"),e_("")},disabled:!eU||"saving"===ey,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,t.jsxs)("section",{className:"cfg-card cfg-danger","aria-labelledby":"cfg-danger-title",children:[(0,t.jsx)("h2",{id:"cfg-danger-title",className:"cfg-title mb-3",children:"Danger zone"}),(0,t.jsx)("p",{className:"text-sm cfg-muted",children:o.DELETE_REMOVES_COPY}),(0,t.jsx)("p",{className:"text-sm cfg-faint mt-2",children:o.DELETE_KEEPS_COPY}),(0,t.jsx)("button",{type:"button",onClick:()=>w(!0),className:"mt-3 delete-btn text-sm w-full sm:w-auto",children:"Delete agent"})]})]})]})]}),_?(0,t.jsx)(r.default,{ids:[eG.id],onCancel:()=>w(!1),onDeleted:e=>j.push(`/?deleted=${Math.max(e.length,1)}`)}):null]})}],13978)},74904,3136,e=>{"use strict";let t=["hermes","cursor","claude","codex","muse"],n={hermes:"Hermes",cursor:"Cursor",claude:"Claude",codex:"Codex",muse:"Muse Code"},a="hermes";function s(e){return t.includes(String(e))?n[e]:String(e??"")}t.join("|"),e.s(["AGENTS",0,t,"AGENT_LABELS",0,n,"DEFAULT_AGENT",0,a,"agentLabel",0,s],3136);let r=t.map(e=>({value:e,label:n[e]}));function i(e){return s((e.agent??"").trim()||a)}function l(e){let t=e.runtime_connection;return t&&t.label.trim()?t.label.trim():(e.runtime_connection_id??"").trim()?(e.runtime_connection_id??"").trim():null}function o(e){return`~/.botmancers/${e}`}let c="~/.botmancers/{agentID}",d=`Default: ${c} — {agentID} is this agent's ID, assigned at creation.`;function u(e){return String(e).padStart(2,"0")}let m=[{prefix:"[Agent failed]",kind:"failed",label:"Agent failed"},{prefix:"[Deck handoff]",kind:"handoff",label:"Agent launch"},{prefix:"[Deck run]",kind:"run",label:"Agent run"},{prefix:"[Deck review]",kind:"review",label:"Agent review"},{prefix:"[Deck resume]",kind:"resume",label:"Agent resume"},{prefix:"[Deck result]",kind:"result",label:"Agent result"},{prefix:"[Deck failed]",kind:"failed",label:"Agent failed"},{prefix:"[Deck needs selection]",kind:"reselection",label:"Agent needs setup"},{prefix:"[Deck needs reselection]",kind:"reselection",label:"Agent needs setup"}];e.s(["AGENT_OPTIONS",0,r,"NEW_AGENT_WORKSPACE_HINT",0,d,"WORKSPACE_TEMPLATE",0,c,"agentEventDisplay",0,function(e){let t=String(e??"").trimStart(),n=m.find(e=>t.startsWith(e.prefix));return n?{label:n.label,detail:t.slice(n.prefix.length).trim()}:null},"botAgentLabel",0,i,"botConnectionLabel",0,l,"configWorkspaceHint",0,function(e){return`Default: ${o(e)} — leave blank to use it.`},"defaultWorkdirFor",0,o,"formatClock",0,function(e){let t=new Date(e);return`${u(t.getHours())}:${u(t.getMinutes())}:${u(t.getSeconds())}`},"rosterRuntimeLine",0,function(e){let t=`Agent: ${i(e)} \xb7 `+(l(e)??"No connection");return!1===e.launchable?t+" — see Config":t}],74904)},50814,63352,e=>{"use strict";function t(e){return`${new Date(e).toISOString().slice(0,16).replace("T"," ")} UTC`}let n="Not reported";function a(e){return e.toFixed(1).replace(/\.0$/,"")}function s(e){return e.toLocaleString("en-US")}function r(e){return 0===e?"$0.00":e>=.01?`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`:e<1e-4?"<$0.0001":`$${e.toFixed(4)}`}let i={input_tokens:"Input tokens",output_tokens:"Output tokens",cost_usd:"Cost"};function l(e,t,n){return"cost_usd"===e?r(t):n?s(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 s=i[e];if(!t||"unavailable"===t.quality||null===t.sum)return{name:s,text:n,quality:"unavailable",coverage:t&&t.total>0?`0 of ${o(t.total)} reported`:"No runs recorded",label:`${s}: not reported`};let r=l(e,t.sum,a),d=l(e,t.sum,!0);return"partial"===t.quality?{name:s,text:r,quality:"partial",coverage:`Partial: ${t.known} of ${o(t.total)} reported`,label:`${s}: at least ${d}, partial, reported by ${t.known} of ${o(t.total)}`}:{name:s,text:r,quality:"complete",coverage:`All ${o(t.total)} reported`,label:`${s}: ${d}, 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),s=c("cost_usd",e?.cost_usd),r=[t,a,s];if(r.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"===s.quality?"cost not reported":s.text].join(" · "),l=r.some(e=>"partial"===e.quality),o=l||r.some(e=>"unavailable"===e.quality)?"partial":"complete";return{text:i,label:`Reported usage: ${r.map(e=>e.label).join("; ")}`,quality:o,partial:l}},"statusLabel",0,function(e){return"active"===e.status?"Active":"Ended"},"usageMetricView",0,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:s(e.input_tokens),output:null===e.output_tokens?n:s(e.output_tokens),cost:null===e.cost_usd?n:r(e.cost_usd)}},"workRequestLabel",0,function(e){var t;let n=e.origin.work_request;return n?`${(t=n.execution_kind)?t[0].toUpperCase()+t.slice(1):t} \xb7 ${n.state}`:null}],63352);let d={ask:"Ask from this context",resume:"Resume work here",handoff:"Hand off to…"},u=["queued","extracting","delivering","completed","failed","cancelled"],m=["completed","failed","cancelled"];function f(e,t){switch(t){case"queued":return"Queued";case"extracting":return"ask"===e?"Asking the session":"Extracting handoff";case"delivering":return"Delivering handoff";case"completed":return"ask"===e?"Answered":"Handed off";case"failed":return"Failed";case"cancelled":return"Cancelled"}}function h(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,s=t.destination?.agent_name??"the destination Agent",r="string"==typeof n.hop?n.hop:null;switch(e.type){case"created":return"ask"===t.mode?`You asked ${a}'s session a question`:`You handed ${a}'s session to ${s}`;case"hop_queued":if("deliver"===r)return`Handoff queued for ${s}'s new session`;return"extract"===r?`Handoff extraction queued in ${a}'s session`:`Question queued for ${a}'s session`;case"hop_started":if("deliver"===r)return`${s} started a new session`;return"extract"===r?`${a}'s session started extracting the handoff`:`${a}'s session started answering`;case"state_changed":{let e="string"==typeof n.to&&u.includes(n.to)?n.to:null;return e?`Now ${f(t.mode,e).toLowerCase()}`:"State changed"}case"answer_returned":return`Answer returned to ${t.origin?.label??"the origin thread"}${n.truncated?" (shortened)":""}`;case"packet_extracted":return"Handoff packet extracted";case"packet_rejected":return`Handoff packet refused${"string"==typeof n.reason?`: ${n.reason}`:""}`;case"destination_replied":return`${s} replied in ${t.destination?.conversation?.label??"its thread"}`;case"destination_session_rejected":return`${s}'s session was not new; the handoff stopped`;case"cancel_requested":return"You asked to cancel";case"hop_result_discarded":return"A late result was discarded";default:return e.type.replace(/_/g," ")}},"excerpt",0,h,"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,!m.includes(t))?"Cancelling…":f(e.mode,e.state)},"modeLabel",0,function(e){return"ask"===e?"Ask":"Continue"},"outcomeLine",0,function(e){if("completed"===e.state){if("ask"===e.mode){let t=e.origin?.label??"the origin thread";return e.outcome.answer?`Answer in ${t}: ${h(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: ${h(e.outcome.reply,200)}`:`${t} picked it up in a new session.`}return"failed"===e.state?e.failure?.message||"The exchange failed.":"cancelled"===e.state?"Cancelled before it finished. Nothing more will run.":null},"participantsLabel",0,function(e){return"ask"===e.mode?`You → ${e.source.agent_name}`:`${e.source.agent_name} → ${e.destination?.agent_name??"another Agent"}`},"pinRequestBody",0,function(e,t,n,a,s){return{action:e,content:t.trim(),conversation_id:n,idempotency_key:s,..."resume"===e?{approve_write:a}:{}}},"sessionDialogMode",0,function(e){return"handoff"===e?"continue":e},"sessionDialogTitle",0,function(e){return d["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:`${d.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:d[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 s in a)Object.defineProperty(n,s,{enumerable:!0,get:a[s]});let r=e.r(90809),i=e.r(43476),l=r._(e.r(71645)),o=e.r(95057),c=e.r(8372),d=e.r(18581),u=e.r(18967),m=e.r(5550),f=e.r(88540),h=e.r(91949),p=e.r(73668),g=e.r(9396);function x(t){var n;let a,s,r,[x,v]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),j=(0,l.useRef)(null),{href:y,as:N,children:k,prefetch:_=null,passHref:w,replace:S,shallow:C,scroll:$,onClick:A,onMouseEnter:T,onTouchStart:E,legacyBehavior:R=!1,onNavigate:I,transitionTypes:D,ref:P,unstable_dynamicOnHover:L,...O}=t;a=k,R&&("string"==typeof a||"number"==typeof a)&&(a=(0,i.jsx)("a",{children:a}));let U=l.default.useContext(c.AppRouterContext),F=!1!==_,q=!1===_?"none":!0===_?"full":"auto",M="none"!==q?"auto"===q?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,H="string"==typeof(n=N||y)?n:(0,o.formatUrl)(n);if(R){if(a?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});s=l.default.Children.only(a)}let B=R?s&&"object"==typeof s&&s.ref:P,K,W=l.default.useCallback(e=>(null!==U&&(j.current=(0,h.mountLinkInstance)(e,H,U,M,F,v,K)),()=>{j.current&&((0,h.unmountLinkForCurrentNavigation)(j.current),j.current=null),(0,h.unmountPrefetchableInstance)(e)}),[F,H,U,M,v,K]),V={ref:(0,d.useMergedRef)(W,B),onClick(t){R||"function"!=typeof A||A(t),R&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(t),!U||t.defaultPrevented||function(t,n,a,s,r,i,o,c="none"){if("u">typeof window){let d,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(n)){s&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:m}=e.r(99781);l.default.startTransition(()=>{m(n,s?"replace":"push",!1===r?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,a.current,o,c)})}}(t,H,j,S,$,I,D,q)},onMouseEnter(e){R||"function"!=typeof T||T(e),R&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(e),U&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===L)},onTouchStart:function(e){R||"function"!=typeof E||E(e),R&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(e),U&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===L)}};return(0,u.isAbsoluteUrl)(H)?V.href=H:R&&!w&&("a"!==s.type||"href"in s.props)||(V.href=(0,m.addBasePath)(H)),r=R?l.default.cloneElement(s,V):(0,i.jsx)("a",{...O,...V,children:a}),(0,i.jsx)(b.Provider,{value:x,children:r})}let b=(0,l.createContext)(h.IDLE_LINK_STATUS),v=()=>(0,l.useContext)(b);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},18581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return s}});let a=e.r(71645);function s(e,t){let n=(0,a.useRef)(null),s=(0,a.useRef)(null);return(0,a.useCallback)(a=>{if(null===a){let e=n.current;e&&(n.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(n.current=r(e,a)),t&&(s.current=r(t,a))},[e,t])}function r(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},73668,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return r}});let a=e.r(18967),s=e.r(52817);function r(e){if(!(0,a.isAbsoluteUrl)(e))return!0;try{let t=(0,a.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,s.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 r},urlQueryToSearchParams:function(){return l}};for(var s in a)Object.defineProperty(n,s,{enumerable:!0,get:a[s]});function r(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 s in a)Object.defineProperty(n,s,{enumerable:!0,get:a[s]});let r=e.r(90809)._(e.r(98183)),i=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:n}=e,a=e.protocol||"",s=e.pathname||"",l=e.hash||"",o=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(c+=":"+e.port)),o&&"object"==typeof o&&(o=String(r.urlQueryToSearchParams(o)));let d=e.search||o&&`?${o}`||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||i.test(a))&&!1!==c?(c="//"+(c||""),s&&"/"!==s[0]&&(s="/"+s)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),d&&"?"!==d[0]&&(d="?"+d),s=s.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${a}${c}${s}${d}${l}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return l(e)}},18967,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var a={DecodeError:function(){return x},MiddlewareNotFoundError:function(){return y},MissingStaticPage:function(){return j},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return p},ST:function(){return g},WEB_VITALS:function(){return r},execOnce:function(){return i},getDisplayName:function(){return u},getLocationOrigin:function(){return c},getURL:function(){return d},isAbsoluteUrl:function(){return o},isResSent:function(){return m},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return N}};for(var s in a)Object.defineProperty(n,s,{enumerable:!0,get:a[s]});let r=["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 d(){let{href:e}=window.location,t=c();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function m(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 h(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let a=await e.getInitialProps(t);if(n&&m(n))return a;if(!a)throw Object.defineProperty(Error(`"${u(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,g=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class x extends Error{}class b extends Error{}class v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class j extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class y extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function N(e){return JSON.stringify({message:e.message,stack:e.stack})}},18566,(e,t,n)=>{t.exports=e.r(76562)}]);
|
package/app/BUILD_INFO.json
CHANGED
package/app/package.json
CHANGED
package/app/server.js
CHANGED
|
@@ -9,7 +9,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
|
|
|
9
9
|
const hostname = process.env.HOSTNAME || '0.0.0.0'
|
|
10
10
|
|
|
11
11
|
let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
|
|
12
|
-
const nextConfig = {"env":{"BOTMANCERS_BUILD_VERSION":"0.
|
|
12
|
+
const nextConfig = {"env":{"BOTMANCERS_BUILD_VERSION":"0.7.0","BOTMANCERS_BUILD_COMMIT":"60fab8ad681e26b6a810aa2527805bc27a92f97e"},"webpack":null,"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"instrumentationClientInject":[],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":__dirname,"enablePrerenderSourceMaps":true,"cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"appNewScrollHandler":true,"coldCacheBadge":false,"devValidationWorker":true,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"dynamicOnHover":false,"useOffline":false,"varyParams":true,"optimisticRouting":true,"instrumentationClientRouterTransitionEvents":false,"prefetchInlining":{"maxSize":2048,"maxBundleSize":10240},"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":9,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptOperationCache":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"devMemoryThresholdRestart":true,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"requestInsights":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"useTypeScriptCli":true,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":true,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"serverComponentsHmrCancellation":false,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":true,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","turbopackMemoryEvictionMode":"auto","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"useCacheTimeout":54,"instantInsights":{"validationLevel":"warning"},"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","serverExternalPackages":["@slack/socket-mode","@slack/web-api"],"repoRoot":__dirname,"turbopack":{"root":__dirname},"distDirRoot":".next","_originalRewrites":{"beforeFiles":[],"afterFiles":[{"source":"/favicon.ico","destination":"/brand/botmancers-logo-filled-64.png"}],"fallback":[]}}
|
|
13
13
|
|
|
14
14
|
process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
|
|
15
15
|
|