botmancers 0.9.1 → 0.9.3
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 +21 -0
- package/README.md +5 -5
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +1 -0
- package/app/.next/build-manifest.json +6 -6
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/required-server-files.json +2 -2
- package/app/.next/routes-manifest.json +8 -0
- package/app/.next/server/app/_global-error/page/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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/agents/[id]/activity/page/build-manifest.json +3 -3
- package/app/.next/server/app/agents/[id]/activity/page.js.nft.json +1 -1
- package/app/.next/server/app/agents/[id]/activity/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/agents/[id]/config/page/app-paths-manifest.json +3 -0
- package/app/.next/server/app/agents/[id]/config/page/build-manifest.json +20 -0
- package/app/.next/server/app/agents/[id]/config/page/next-font-manifest.json +11 -0
- package/app/.next/server/app/agents/[id]/config/page/react-loadable-manifest.json +1 -0
- package/app/.next/server/app/agents/[id]/config/page/server-reference-manifest.json +4 -0
- package/app/.next/server/app/agents/[id]/config/page.js +14 -0
- package/app/.next/server/app/agents/[id]/config/page.js.nft.json +1 -0
- package/app/.next/server/app/agents/[id]/config/page_client-reference-manifest.js +3 -0
- package/app/.next/server/app/agents/[id]/conversations/[conversationId]/page/build-manifest.json +3 -3
- package/app/.next/server/app/agents/[id]/conversations/[conversationId]/page.js.nft.json +1 -1
- package/app/.next/server/app/agents/[id]/conversations/[conversationId]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/agents/[id]/conversations/page/build-manifest.json +3 -3
- package/app/.next/server/app/agents/[id]/conversations/page.js.nft.json +1 -1
- package/app/.next/server/app/agents/[id]/conversations/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/agents/[id]/page/build-manifest.json +3 -3
- package/app/.next/server/app/agents/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/agents/[id]/sessions/page/build-manifest.json +3 -3
- package/app/.next/server/app/agents/[id]/sessions/page.js.nft.json +1 -1
- package/app/.next/server/app/agents/[id]/sessions/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/agents/[id]/slack/page/build-manifest.json +3 -3
- package/app/.next/server/app/agents/[id]/slack/page.js.nft.json +1 -1
- package/app/.next/server/app/agents/[id]/slack/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/bots/[id]/activity/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/config/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/conversations/[conversationId]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/conversations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/overview/route.js.nft.json +1 -1
- 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.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/sessions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/sessions/sync/route.js.nft.json +1 -1
- 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.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.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.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.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.nft.json +1 -1
- package/app/.next/server/app/api/exchanges/[id]/route.js.nft.json +1 -1
- 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.nft.json +1 -1
- package/app/.next/server/app/api/import-capabilities/route.js +1 -1
- package/app/.next/server/app/api/import-capabilities/route.js.nft.json +1 -1
- package/app/.next/server/app/api/marketplace-handoff/route.js +1 -1
- package/app/.next/server/app/api/marketplace-handoff/route.js.nft.json +1 -1
- package/app/.next/server/app/api/marketplace-handoff/status/route.js +1 -1
- package/app/.next/server/app/api/marketplace-handoff/status/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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/route.js.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- package/app/.next/server/app/api/v0/exchanges/route.js.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- package/app/.next/server/app/api/wakes/[id]/retry/route.js.nft.json +1 -1
- package/app/.next/server/app/bots/[id]/config/page/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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 +2 -2
- package/app/.next/server/app/exchanges.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/exchanges.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/exchanges.segments/exchanges/__PAGE__.segment.rsc +2 -2
- 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/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- 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 +2 -2
- package/app/.next/server/app/settings.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/threads/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app-paths-manifest.json +1 -0
- package/app/.next/server/chunks/[root-of-the-server]__0anfwiu._.js +1 -1
- package/app/.next/server/chunks/{[root-of-the-server]__1z5l5cg._.js → [root-of-the-server]__0p1hgpt._.js} +1 -1
- package/app/.next/server/chunks/{[root-of-the-server]__1kik2zt._.js → [root-of-the-server]__0v3ksno._.js} +1 -1
- package/app/.next/server/chunks/{[root-of-the-server]__1igzl05._.js → [root-of-the-server]__1eugxjw._.js} +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__1jxwu9_._.js +1 -1
- package/app/.next/server/chunks/_0061c2q._.js +1 -1
- package/app/.next/server/chunks/ssr/[root-of-the-server]__1tudi1e._.js +3 -0
- package/app/.next/server/chunks/ssr/{_14d-lxn._.js → _01ngpwj._.js} +22 -2
- package/app/.next/server/chunks/ssr/_06qzsne._.js +23 -0
- package/app/.next/server/chunks/ssr/{app_1-nwnha._.js → _0iywd5g._.js} +22 -2
- package/app/.next/server/chunks/ssr/{_17ngohj._.js → _0jvl76a._.js} +22 -2
- package/app/.next/server/chunks/ssr/_0mxifu3._.js +23 -0
- package/app/.next/server/chunks/ssr/_0u7urta._.js +1 -1
- package/app/.next/server/chunks/ssr/_next-internal_server_app_agents_[id]_config_page_actions_1cq16xp.js +3 -0
- package/app/.next/server/chunks/ssr/app_agents_[id]_0sr4fdg._.js +1 -1
- package/app/.next/server/chunks/ssr/app_agents_[id]_config_page_tsx_1f_gu1l._.js +3 -0
- package/app/.next/server/chunks/ssr/app_agents_[id]_sessions_page_tsx_0tfup-2._.js +1 -1
- package/app/.next/server/chunks/ssr/app_agents_[id]_slack_AgentSlackPage_tsx_20njhs1._.js +1 -1
- package/app/.next/server/chunks/ssr/app_components_0bhuhd-._.js +3 -0
- package/app/.next/server/chunks/ssr/app_page_tsx_0pxmutw._.js +1 -1
- package/app/.next/server/chunks/ssr/lib_0pfn9gs._.js +1 -1
- package/app/.next/server/chunks/ssr/lib_agent-registration-ui_ts_1z582mm._.js +1 -1
- package/app/.next/server/chunks/ssr/lib_share-view_ts_08psw5o._.js +1 -1
- package/app/.next/server/chunks/ssr/{_0gzxfz3._.js → node_modules_next_0x3i8za._.js} +2 -2
- package/app/.next/server/chunks/ssr/node_modules_next_dist_0kq7z60._.js +3 -0
- package/app/.next/server/middleware-build-manifest.js +6 -6
- package/app/.next/server/next-font-manifest.js +1 -1
- package/app/.next/server/next-font-manifest.json +4 -0
- 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/{1ttvnc6qdye8s.js → 04nfr73lkk7pz.js} +1 -1
- package/app/.next/static/chunks/{1dhk3pcv7yvm6.js → 0eqgs3167zj2j.js} +1 -1
- package/app/.next/static/chunks/10i-rrea371m2.js +1 -0
- package/app/.next/static/chunks/1n8wfulak4ltx.js +1 -0
- package/app/.next/static/chunks/1ob-de9xo9m2e.css +3 -0
- package/app/.next/static/chunks/1zryovio86f1z.js +1 -0
- package/app/.next/static/chunks/2dtkykrnob8wk.js +1 -0
- package/app/.next/static/chunks/2ebpfmg4vni8e.js +3 -0
- package/app/.next/static/chunks/2mmpezlrfmbu5.js +1 -0
- package/app/.next/static/chunks/{3y5bo6syunkzn.js → 326jto9l-m8vj.js} +1 -1
- package/app/.next/static/chunks/3m-2-98qud-hf.js +1 -0
- package/app/.next/static/chunks/3un1mb5bx4x8k.js +22 -0
- package/app/.next/static/chunks/{06i_6p0-ipitj.js → 3x56k5qa012au.js} +1 -1
- package/app/.next/static/chunks/{turbopack-03rfayxv7ep_b.js → turbopack-2yajevry3z_n6.js} +1 -1
- package/app/BUILD_INFO.json +2 -2
- package/app/package.json +1 -1
- package/app/server.js +1 -1
- package/package.json +1 -1
- package/app/.next/server/chunks/ssr/_0_u9-u6._.js +0 -3
- package/app/.next/server/chunks/ssr/_0rvu-il._.js +0 -131
- package/app/.next/server/chunks/ssr/_1iq-7cn._.js +0 -3
- package/app/.next/server/chunks/ssr/app_bots_[id]_config_page_tsx_1e0uue9._.js +0 -3
- package/app/.next/server/chunks/ssr/node_modules_1nkgb45._.js +0 -23
- package/app/.next/static/chunks/19mx3mg6lkumu.js +0 -1
- package/app/.next/static/chunks/1ka9dp1l6c0ga.js +0 -3
- package/app/.next/static/chunks/2-fhbx41zyanc.js +0 -1
- package/app/.next/static/chunks/2n1u8a2efnt88.js +0 -1
- package/app/.next/static/chunks/2q4c2cj6ftmp_.css +0 -3
- package/app/.next/static/chunks/2z-e6jheq0ftu.js +0 -22
- package/app/.next/static/chunks/3aasli1i-eiio.js +0 -1
- package/app/.next/static/chunks/3p_p4gnr0d2-x.js +0 -1
- package/app/.next/static/chunks/3s9t477v-z09o.js +0 -1
- /package/app/.next/static/{k_jNwnr0zNTXiU6M6Kx5O → 0BJMiZPkEfFOd56nhl62e}/_buildManifest.js +0 -0
- /package/app/.next/static/{k_jNwnr0zNTXiU6M6Kx5O → 0BJMiZPkEfFOd56nhl62e}/_clientMiddlewareManifest.js +0 -0
- /package/app/.next/static/{k_jNwnr0zNTXiU6M6Kx5O → 0BJMiZPkEfFOd56nhl62e}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13978,e=>{"use strict";var s=e.i(43476),t=e.i(71645),a=e.i(22016),n=e.i(18566),i=e.i(15983),r=e.i(24204);function l({agentId:e,agentName:a}){let n=(0,t.useId)(),i=(0,t.useId)(),o=(0,t.useId)(),[c,d]=(0,t.useState)(null),[m,u]=(0,t.useState)(""),[h,p]=(0,t.useState)(0),[f,g]=(0,t.useState)("idle"),[x,b]=(0,t.useState)(""),[j,v]=(0,t.useState)(""),[k,y]=(0,t.useState)(""),[N,w]=(0,t.useState)(""),[S,_]=(0,t.useState)("");(0,t.useEffect)(()=>{let s=!1;return fetch(`/api/bots/${encodeURIComponent(e)}/share-policy`,{cache:"no-store"}).then(async e=>{let t=await e.json().catch(()=>null);s||(e.ok&&t?.policy?(u(""),d(t.policy)):u("Could not load the share policy."))}).catch(()=>{s||u("Could not load the share policy.")}),()=>{s=!0}},[e,h]);let C=()=>{b(""),g("idle"),p(e=>e+1)},$=async(s,t)=>{if(!c)return!1;g("saving"),b(""),v("");try{let a=await fetch(`/api/bots/${encodeURIComponent(e)}/share-policy`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({revision:c.revision,...s})}),n=await a.json().catch(()=>null);if(!a.ok||!n?.policy)return g("error"),b("string"==typeof n?.error?.message?n.error.message:"The share policy could not be saved."),!1;return d(n.policy),g("idle"),v(t("number"==typeof n.revoked_contexts?n.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 s=(0,r.audienceInputError)(k,N,c.audiences);if(_(s??""),s)return;let t={kind:"slack",team_id:k.trim(),channel_id:N.trim()};await $({audiences:[...c.audiences,t]},()=>`Added ${(0,r.audienceLabel)(t)}.`)&&(y(""),w(""))},R="saving"===f,T=!!c&&"invalid"!==c.state;return(0,s.jsxs)("section",{className:"cfg-card share-policy",id:"session-sharing","aria-labelledby":"cfg-sharing-title",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("h2",{id:"cfg-sharing-title",className:"cfg-title",children:"Session sharing"}),R?(0,s.jsx)("span",{className:"text-sm cfg-faint",role:"status",children:"Saving…"}):null]}),(0,s.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."]}),m?(0,s.jsxs)("p",{className:"text-sm cfg-error",role:"alert",children:[m," ",(0,s.jsx)("button",{type:"button",onClick:C,className:"underline hover:no-underline",children:"Retry"})]}):null,c||m?null:(0,s.jsx)("p",{className:"text-sm cfg-faint",role:"status",children:"Loading…"}),c?.state==="invalid"?(0,s.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,s.jsx)("button",{type:"button",onClick:C,className:"underline hover:no-underline",children:"reload"}),"."]}):null,c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"share-policy-toggle",children:[(0,s.jsx)("input",{id:n,type:"checkbox",role:"switch",checked:c.agent.share_from_turn,"aria-checked":c.agent.share_from_turn,disabled:!T||R||!c.agent.share_current.supported&&!c.agent.share_from_turn,"data-share-policy":"share_from_turn",onChange:e=>{let s=e.target.checked;$({share_from_turn:s},e=>s?"Share from a turn is on.":`Share from a turn is off.${e?` Revoked ${e} live turn context${1===e?"":"s"}.`:""}`)}}),(0,s.jsxs)("label",{htmlFor:n,className:"text-sm",children:[(0,s.jsx)("span",{className:"font-medium",children:"Share from a turn"})," (",(0,s.jsx)("code",{className:"cfg-code",children:"share_from_turn"}),")"]})]}),(0,s.jsx)("p",{className:"text-sm cfg-faint share-policy-hint",children:(0,r.shareFromTurnNote)(c)}),c.agent.live_contexts>0?(0,s.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,s.jsx)("h3",{className:"cfg-title share-policy-sub",children:"Slack channel allowlist"}),(0,s.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,s.jsx)("p",{className:"text-sm cfg-muted share-policy-empty",children:"No channel yet: nothing can be shared to Slack."}):(0,s.jsx)("ul",{className:"share-policy-list","aria-label":"Allowed Slack channels",children:c.audiences.map(e=>(0,s.jsxs)("li",{className:"share-policy-entry",children:[(0,s.jsx)("span",{className:"cfg-code",children:e.channel_id}),(0,s.jsxs)("span",{className:"cfg-faint",children:["workspace ",e.team_id]}),(0,s.jsx)("button",{type:"button",className:"cfg-link text-sm share-policy-remove",disabled:!T||R,"aria-label":`Remove ${(0,r.audienceLabel)(e)}`,onClick:()=>{c&&$({audiences:c.audiences.filter(s=>s.team_id!==e.team_id||s.channel_id!==e.channel_id)},()=>`Removed ${(0,r.audienceLabel)(e)}. Its Slack threads stop being answered.`)},children:"Remove"})]},`${e.team_id}:${e.channel_id}`))}),(0,s.jsxs)("form",{className:"share-policy-add",onSubmit:e=>{A(e)},"aria-label":"Add a Slack channel",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:i,className:"text-sm",children:"Workspace ID"}),(0,s.jsx)("input",{id:i,className:"cfg-input",value:k,placeholder:"T0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!T||R,"aria-invalid":!!S,onChange:e=>{y(e.target.value),_("")}})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:o,className:"text-sm",children:"Channel ID"}),(0,s.jsx)("input",{id:o,className:"cfg-input",value:N,placeholder:"C0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!T||R,"aria-invalid":!!S,onChange:e=>{w(e.target.value),_("")}})]}),(0,s.jsx)("button",{type:"submit",className:"cfg-btn-primary text-sm",disabled:!T||R||!k.trim()||!N.trim(),children:"Add channel"})]}),S?(0,s.jsx)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:S}):null,"error"===f?(0,s.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:["Couldn't save: ",x," ",(0,s.jsx)("button",{type:"button",onClick:C,className:"underline hover:no-underline",children:"Reload"})]}):null,(0,s.jsx)("p",{className:"mt-2 text-sm cfg-ok",role:"status",children:j})]}):null]})}var o=e.i(10718),c=e.i(74904),d=e.i(33851),m=e.i(44079),u=e.i(52900),h=e.i(87303);function p({attribute:e,label:a,options:n,current:i,onPick:r,className:l}){let o=(0,t.useId)(),c=`avatar-${e}`;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{id:o,className:"avatar-group-label",children:a}),(0,s.jsx)("div",{className:l?`avatar-opt-grid ${l}`:"avatar-opt-grid",role:"radiogroup","aria-labelledby":o,children:n.map(t=>(0,s.jsxs)("label",{title:t.label,className:"avatar-opt",children:[(0,s.jsx)("input",{type:"radio",name:c,value:t.id,checked:i[e]===t.id,onChange:()=>r({[e]:t.id}),className:"avatar-opt-input"}),(0,s.jsx)("span",{className:"avatar-opt-art","aria-hidden":"true",children:(0,s.jsx)(h.default,{config:{...i,[e]:t.id},size:44})}),(0,s.jsx)("span",{children:t.label})]},t.id))})]})}var f=e.i(68541);function g({phase:e,onImport:t}){let a=(0,f.marketImportView)(e);return(0,s.jsxs)("div",{className:"mt-3","data-field":"marketplace-import",children:[(0,s.jsx)("button",{type:"button",onClick:t,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,s.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.",j=[{key:"avatar_accessory",label:"Avatar accessory"},{key:"avatar_color",label:"Avatar color"},{key:"avatar_eyes",label:"Avatar eyes"},{key:"avatar_hands",label:"Avatar hands"},{key:"description",label:"Description (rules)"},{key:"import_operation_id",label:"Import operation ID"},{key:"import_schema_version",label:"Import schema version"},{key:"memories",label:"Remembered facts"},{key:"name",label:"Name"},{key:"skill_content",label:"Skill content"},{key:"skill_path",label:"Skill path"},{key:"skill_present",label:"Skill present"},{key:"source_provider",label:"Source provider"},{key:"template_id",label:"Template ID"},{key:"template_url",label:"Template URL"},{key:"title",label:"Title"}];function v(e){return String(e).padStart(2,"0")}function k(e){let s=new Date(e);return`${s.getFullYear()}-${v(s.getMonth()+1)}-${v(s.getDate())} ${v(s.getHours())}:${v(s.getMinutes())}`}function y(e){let s=new Date(e);return`${v(s.getHours())}:${v(s.getMinutes())}:${v(s.getSeconds())}`}async function N(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}e.s(["default",0,function(){var e;let r=String((0,n.useParams)().id??""),v=(0,n.useRouter)(),[w,S]=(0,t.useState)(!1),[_,C]=(0,t.useState)(null),[$,A]=(0,t.useState)(!0),[R,T]=(0,t.useState)(!1),[E,I]=(0,t.useState)(!1),[D,O]=(0,t.useState)(0),[F,P]=(0,t.useState)(null),[W,L]=(0,t.useState)("clean"),[U,B]=(0,t.useState)(""),[H,M]=(0,t.useState)(0),[q,K]=(0,t.useState)(!1),[V,G]=(0,t.useState)(""),[J,Y]=(0,t.useState)("clean"),[z,Z]=(0,t.useState)(""),[Q,X]=(0,t.useState)(0),[ee,es]=(0,t.useState)({}),[et,ea]=(0,t.useState)(""),[en,ei]=(0,t.useState)(!1),[er,el]=(0,t.useState)(null),[eo,ec]=(0,t.useState)(!1),ed=(0,u.useRuntimeConnections)(),[em,eu]=(0,t.useState)(void 0),[eh,ep]=(0,t.useState)("clean"),[ef,eg]=(0,t.useState)(""),[ex,eb]=(0,t.useState)(0),[ej,ev]=(0,t.useState)(null),[ek,ey]=(0,t.useState)("clean"),[eN,ew]=(0,t.useState)(""),[eS,e_]=(0,t.useState)(0),{phase:eC,startImport:e$}=function(e){let[s,a]=(0,t.useState)("idle");return(0,t.useEffect)(()=>{let s=window.location.search;if(null===(0,f.importedBotId)(s))return;let t=new URL(window.location.href);t.searchParams.delete(f.IMPORT_RETURN_QUERY),window.history.replaceState(null,"",t.pathname+t.search);let n=!1;return(0,f.resolveImportReturn)(s,e,async e=>(await fetch(`/api/bots/${encodeURIComponent(e)}/config`,{cache:"no-store"})).ok).then(e=>{n||("open"===e.kind?window.location.replace(e.path):"missing"===e.kind&&a("missing"))}),()=>{n=!0}},[e]),{phase:s,startImport:async function(){a("checking");try{let e=await fetch(f.HANDOFF_STATUS_PATH,{cache:"no-store"}),s=await e.json().catch(()=>null);if(!e.ok)return void a("failed");if(s?.configured!==!0)return void a("unavailable");a("redirecting"),window.location.href=(0,f.handoffStartPath)(window.location.origin,window.location.pathname),setTimeout(()=>a(e=>"redirecting"===e?"idle":e),4e3)}catch{a("failed")}}}}(r);function eA(){A(!0),T(!1),O(e=>e+1)}(0,t.useEffect)(()=>{if(!r)return;let e=!1;return fetch(`/api/bots/${encodeURIComponent(r)}/sessions?status=all`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(s=>{e||eu((s?.sessions??[]).map(e=>({ref:e.ref,title:e.title,status:e.status})))}).catch(()=>{e||eu([])}),()=>{e=!0}},[r,D]),(0,t.useEffect)(()=>{if(!r)return;let e=!1;return fetch(`/api/bots/${encodeURIComponent(r)}/config`).then(async s=>{if(e)return;if(404===s.status){I(!0),C(null);return}if(!s.ok)throw Error("request failed");let t=await s.json();e||(C(t),P(t.bot.description??""),I(!1),T(!1))}).catch(()=>{e||T(!0)}).finally(()=>{e||A(!1)}),()=>{e=!0}},[r,D]);let eR=_?.bot.description??"",eT=null!==F&&F!==eR,eE=_?.skill.content??"",eI=q&&V!==eE,eD=_?(0,d.registrationFormFromBot)(_.bot):null,eO=en&&null!==er&&JSON.stringify(er)!==JSON.stringify(eD),eF=_?.bot.avatar_config??(0,x.resolveAvatar)(_?.bot??{}),eP=ej??eF,eW=null!==ej&&JSON.stringify(ej)!==JSON.stringify(eF),eL=eT||eI||eO||eW;function eU(e,s){N(s).then(s=>{s&&(ea(e),setTimeout(()=>ea(s=>s===e?"":s),2e3))})}async function eB(){if(_&&null!==F){L("saving"),B("");try{let e=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:_.bot.id,description:F})});if(!e.ok){let s="request failed";try{let t=await e.json();t.error&&(s=t.error)}catch{}throw Error(s)}let s=await fetch(`/api/bots/${encodeURIComponent(r)}/config`);if(!s.ok)throw Error("request failed");C(await s.json()),L("confirmed"),M(Date.now()),setTimeout(()=>{L(e=>"confirmed"===e?"clean":e)},5e3)}catch(e){L("error"),B(e instanceof Error?e.message:"request failed")}}}function eH(){_&&(el((0,d.registrationFormFromBot)(_.bot)),ei(!0),ec(!1),ep("clean"),eg(""),ed.retry())}function eM(e){el(s=>s?{...s,...e}:s),eg(""),ep(e=>"error"===e?"clean":e)}function eq(){ei(!1),el(null),ep("clean"),eg("")}function eK(e){ev({...ej??eF,...e}),ey("clean"),ew("")}async function eV(){if(_&&ej){ey("saving"),ew("");try{let e=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:_.bot.id,avatar:ej})});if(!e.ok){let s="request failed";try{let t=await e.json();t.error&&(s=t.error)}catch{}throw Error(s)}let s=await fetch(`/api/bots/${encodeURIComponent(r)}/config`);if(!s.ok)throw Error("request failed");C(await s.json()),ev(null),ey("confirmed"),e_(Date.now()),setTimeout(()=>{ey(e=>"confirmed"===e?"clean":e)},5e3)}catch(e){ey("error"),ew(e instanceof Error?e.message:"request failed")}}}async function eG(){if(_&&er){if((0,d.hasRegistrationErrors)((0,d.registrationFormView)(er,ed.state))){ec(!0),ep("error"),eg(b);return}ep("saving"),eg("");try{let e=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,d.registrationPatchBody)(_.bot.id,er))});if(!e.ok){let s="request failed";try{let t=await e.json();t.error&&(s=t.error)}catch{}throw Error(s)}let s=await fetch(`/api/bots/${encodeURIComponent(r)}/config`);if(!s.ok)throw Error("request failed");C(await s.json()),ei(!1),el(null),ep("confirmed"),eb(Date.now()),setTimeout(()=>{ep(e=>"confirmed"===e?"clean":e)},5e3)}catch(e){ep("error"),eg(e instanceof Error?e.message:"request failed")}}}function eJ(){G(_?.skill.content??""),K(!0),Y("clean"),Z("")}async function eY(){if(_&&(V.trim()||window.confirm("Delete this skill file?"))){Y("saving"),Z("");try{let e=await fetch(`/api/bots/${encodeURIComponent(r)}/skill`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:V})});if(!e.ok){let s="request failed";try{let t=await e.json();t.error&&(s=t.error)}catch{}throw Error(s)}let s=await e.json();C(e=>e?{...e,skill:s.skill,currentHash:s.currentHash}:e),K(!1),Y("confirmed"),X(Date.now()),setTimeout(()=>{Y(e=>"confirmed"===e?"clean":e)},5e3)}catch(e){Y("error"),Z(e instanceof Error?e.message:"request failed")}}}if((0,t.useEffect)(()=>{if(!eL)return;let e=e=>{e.preventDefault()};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[eL]),E)return(0,s.jsx)("div",{className:"cfg-page flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("p",{className:"mb-4",children:"Agent not found."}),(0,s.jsx)(a.default,{href:`/agents/${encodeURIComponent(r)}`,className:"cfg-link",children:"← Back to Overview"})]})});if($&&!_)return(0,s.jsx)("div",{className:"cfg-page",children:(0,s.jsxs)("div",{className:"max-w-6xl mx-auto space-y-6",children:[(0,s.jsx)("div",{className:"h-6 w-32 rounded animate-pulse cfg-skel"}),(0,s.jsx)("div",{className:"h-20 rounded-lg animate-pulse cfg-skel"}),(0,s.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,s.jsx)("div",{className:"space-y-6",children:[0,1,2].map(e=>(0,s.jsx)("div",{className:"h-48 rounded-lg animate-pulse cfg-skel"},e))}),(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("div",{className:"h-64 rounded-lg animate-pulse cfg-skel"}),(0,s.jsx)("div",{className:"h-80 rounded-lg animate-pulse cfg-skel"})]})]})]})});if(R&&!_)return(0,s.jsx)("div",{className:"cfg-page",children:(0,s.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,s.jsx)(a.default,{href:`/agents/${encodeURIComponent(r)}`,className:"cfg-link cfg-back text-sm",children:"← Back to Overview"}),(0,s.jsxs)("header",{className:"mt-3 mb-6 flex flex-wrap items-center gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h1",{className:"text-xl font-bold truncate",children:"Agent configuration"}),(0,s.jsx)("p",{className:"text-sm cfg-faint truncate",children:"Couldn't load agent details."})]}),(0,s.jsxs)("div",{className:"ml-auto text-right",children:[(0,s.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash: ",(0,s.jsx)("code",{className:"cfg-code",children:"—"})]}),(0,s.jsx)("p",{className:"text-sm mt-1",children:(0,s.jsx)("span",{className:"cfg-faint",children:"○ Not loaded"})})]})]}),(0,s.jsx)("div",{className:"grid gap-6 lg:grid-cols-2 items-start",children:[["Skills","Rules","Agent","Template source"],["Launch snapshots","Avatar"]].map(e=>(0,s.jsx)("div",{className:"min-w-0 space-y-6",children:e.map(e=>(0,s.jsxs)("div",{className:"cfg-card",children:[(0,s.jsx)("h2",{className:"cfg-title mb-2",children:e}),(0,s.jsxs)("p",{className:"text-sm cfg-muted",children:["Couldn't load this section."," ",(0,s.jsx)("button",{onClick:eA,className:"cfg-link",children:"Retry"})]})]},e))},e[0]))})]})});if(!_)return null;let{bot:ez,skill:eZ,currentHash:eQ,snapshots:eX}=_,e0=!!(ez.source_provider||ez.template_id||ez.template_url||ez.import_schema_version||ez.import_operation_id),e1="saving"===W?(0,s.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):eT||"error"===W?(0,s.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,s.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===W?(0,s.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",y(H)]}):(0,s.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),e2="saving"===J?(0,s.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):eI||"error"===J?(0,s.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,s.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===J?(0,s.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",y(Q)]}):(0,s.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),e3="saving"===eh?(0,s.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):eO||"error"===eh?(0,s.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,s.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===eh?(0,s.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",y(ex)]}):(0,s.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),e4="saving"===ek?(0,s.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):eW||"error"===ek?(0,s.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,s.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===ek?(0,s.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",y(eS)]}):(0,s.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"});return(0,s.jsxs)("div",{className:"cfg-page",children:[(0,s.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,s.jsx)(a.default,{href:`/agents/${encodeURIComponent(r)}`,onClick:function(e){eL&&!window.confirm("You have unsaved changes. Leave without saving?")&&e.preventDefault()},className:"cfg-link cfg-back text-sm",children:"← Back to Overview"}),(0,s.jsxs)("header",{className:"mt-3 mb-6 flex flex-wrap items-center gap-4",children:[(0,s.jsx)(h.default,{bot:ez,size:48,title:`${ez.name} avatar`}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h1",{className:"text-xl font-bold truncate",children:ez.name}),(0,s.jsx)("p",{className:"text-sm cfg-faint truncate",children:ez.title||" "})]}),(0,s.jsxs)("div",{className:"ml-auto text-right",children:[(0,s.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash:"," ",(0,s.jsx)("code",{className:"cfg-code",title:eQ,children:eQ.slice(0,8)})," ",(0,s.jsx)("button",{onClick:()=>eU("header",eQ),className:"cfg-link text-sm",children:"header"===et?"Copied":"Copy"})]}),(0,s.jsx)("p",{className:"text-sm mt-1",children:eL?(0,s.jsxs)("span",{className:"cfg-dirty",children:[(0,s.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):(0,s.jsx)("span",{className:"cfg-faint",children:"● Saved"})})]})]}),(0,s.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2 items-start","data-cfg-layout":"columns",children:[(0,s.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"primary",children:[(0,s.jsxs)("section",{className:"cfg-card",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("h2",{className:"cfg-title",children:"Skills"}),e2]}),"unsupported"===eZ.status?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Unsupported name"}),(0,s.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,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:[eZ.path," · ","present"===eZ.status?"Present":"Not present"]}),q?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("textarea",{value:V,onChange:e=>G(e.target.value),rows:8,className:"cfg-input text-sm"}),"error"===J&&(0,s.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",z,"."," ",(0,s.jsx)("button",{onClick:eY,className:"underline hover:no-underline",children:"Retry"})]}),(0,s.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,s.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,s.jsx)("button",{onClick:function(){K(!1),Y("clean"),Z("")},disabled:!eI||"saving"===J,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}):"present"===eZ.status?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("pre",{className:"text-sm cfg-pre max-h-64 overflow-y-auto",children:eZ.content}),(0,s.jsx)("button",{onClick:eJ,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm cfg-muted",children:"No skill file yet. Create SKILL.md to give this agent standing instructions."}),(0,s.jsx)("button",{onClick:eJ,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Create"})]}),(0,s.jsx)("p",{className:"mt-3 text-xs cfg-faint",children:"Appended verbatim as a system message at launch."})]})]}),(0,s.jsxs)("section",{className:"cfg-card",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("h2",{className:"cfg-title",children:"Rules"}),e1]}),(0,s.jsx)("textarea",{value:F??"",onChange:e=>P(e.target.value),rows:8,className:"cfg-input cfg-input-sans text-sm"}),(0,s.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"===W&&(0,s.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",U,"."," ",(0,s.jsx)("button",{onClick:eB,className:"underline hover:no-underline",children:"Retry"})]}),(0,s.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,s.jsx)("button",{onClick:eB,disabled:!eT||"saving"===W,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===W?"Saving…":"Save"}),(0,s.jsx)("button",{onClick:function(){P(eR),L("clean"),B("")},disabled:!eT||"saving"===W,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,s.jsxs)("section",{className:"cfg-card",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("h2",{className:"cfg-title",children:"Agent"}),e3]}),(()=>{if(!en||!er){let e=(0,d.registrationReadView)(ez,em);return(0,s.jsxs)("div",{"data-field":"runtime-read",children:[(0,s.jsx)("dl",{className:"text-sm",children:e.rows.map(e=>(0,s.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,s.jsx)("dt",{className:"cfg-faint",children:e.label}),(0,s.jsx)("dd",{className:"sm:text-right break-words cfg-muted",children:e.value})]},e.key))}),e.notices.map(e=>(0,s.jsx)("p",{className:"text-sm cfg-dirty mt-2",children:e},e)),(0,s.jsx)("button",{onClick:eH,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]})}let e=(0,d.registrationFormView)(er,ed.state);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.RegistrationFields,{idPrefix:"cfg",variant:"config",form:er,onChange:eM,view:e,showErrors:eo,connections:ed.state,onRetryConnections:ed.retry,onAddConnection:ed.add,workspacePlaceholder:(0,c.defaultWorkdirFor)(ez.id),workspaceHint:(0,c.configWorkspaceHint)(ez.id),sessions:em,includeHomeSession:!0}),"error"===eh&&(0,s.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:[ef===b?ef:`Couldn't save: ${ef}.`," ",ef===b?null:(0,s.jsx)("button",{onClick:eG,className:"underline hover:no-underline",children:"Retry"})]}),(0,s.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,s.jsx)("button",{onClick:eG,disabled:!eO||"saving"===eh||e.submitDisabled,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===eh?"Saving…":"Save"}),(0,s.jsx)("button",{onClick:eq,disabled:"saving"===eh,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:eO?"Discard":"Cancel"})]})]})})()]}),(0,s.jsxs)("section",{className:"cfg-card",children:[(0,s.jsx)("h2",{className:"cfg-title mb-3",children:"Template source"}),!e0&&(0,s.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Created manually in Botmancers — no template source."}),(0,s.jsxs)("dl",{className:"text-sm",children:[(0,s.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,s.jsx)("dt",{className:"cfg-faint",children:"Source provider"}),(0,s.jsx)("dd",{className:"text-right",children:ez.source_provider??"—"})]}),(0,s.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,s.jsx)("dt",{className:"cfg-faint",children:"Template ID"}),(0,s.jsx)("dd",{className:"text-right",children:ez.template_id??"—"})]}),(0,s.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,s.jsx)("dt",{className:"cfg-faint",children:"Template URL"}),(0,s.jsx)("dd",{className:"text-right break-all",children:ez.template_url?(e=ez.template_url).startsWith("http://")||e.startsWith("https://")?(0,s.jsx)("a",{href:ez.template_url,className:"cfg-link",children:ez.template_url}):ez.template_url:"—"})]}),(0,s.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,s.jsx)("dt",{className:"cfg-faint",children:"Import schema version"}),(0,s.jsx)("dd",{className:"text-right",children:ez.import_schema_version??"—"})]}),(0,s.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,s.jsx)("dt",{className:"cfg-faint",children:"Import operation ID"}),(0,s.jsx)("dd",{className:"text-right break-all",children:ez.import_operation_id??"—"})]}),(0,s.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-y cfg-line",children:[(0,s.jsx)("dt",{className:"cfg-faint",children:"Imported at"}),(0,s.jsx)("dd",{className:"text-right",children:ez.import_timestamp?k(ez.import_timestamp):"—"})]})]}),(0,s.jsx)(g,{phase:eC,onImport:()=>{e$()}})]})]}),(0,s.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"secondary",children:[(0,s.jsxs)("section",{className:"cfg-card",children:[(0,s.jsx)("h2",{className:"cfg-title mb-3",children:"Launch snapshots"}),0===eX.length?(0,s.jsx)("p",{className:"text-sm cfg-muted",children:"No launches recorded yet."}):(0,s.jsx)("ul",{className:"space-y-3",children:eX.map(e=>{let t=e.hash===eQ,a=!!ee[e.id];return(0,s.jsxs)("li",{className:"cfg-row",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsxs)("p",{className:"text-sm",children:[k(e.created_at)," · ",e.id.slice(0,4),e.transport?` \xb7 ${e.transport}`:null]}),(0,s.jsx)("button",{onClick:()=>es(s=>({...s,[e.id]:!s[e.id]})),"aria-label":a?"Collapse snapshot detail":"Expand snapshot detail",className:"cfg-chevron px-1",children:a?"▾":"▸"})]}),(0,s.jsxs)("p",{className:"mt-1 text-sm",children:[(0,s.jsx)("code",{className:"cfg-code",children:e.hash.slice(0,12)})," ",(0,s.jsx)("button",{onClick:()=>eU(e.id,e.hash),className:"cfg-link text-sm",children:et===e.id?"Copied":"Copy"})]}),(0,s.jsx)("p",{className:"mt-1 text-sm",children:t?(0,s.jsx)("span",{className:"cfg-ok",children:"● Matches current config"}):(0,s.jsx)("span",{className:"cfg-faint",children:"○ Config changed since"})}),a&&(0,s.jsxs)("div",{className:"mt-3 pt-3 border-t cfg-line text-sm",children:[(0,s.jsxs)("p",{className:"cfg-muted break-all",children:[(0,s.jsx)("span",{className:"font-medium",children:"Launch ID:"})," ",e.id]}),(0,s.jsxs)("p",{className:"mt-1 cfg-muted break-all",children:[(0,s.jsx)("span",{className:"font-medium",children:"Hash:"})," ",(0,s.jsx)("code",{className:"cfg-code",children:e.hash})]}),(0,s.jsx)("dl",{className:"mt-2",children:j.map(t=>{let a=e.snapshot[t.key];return(0,s.jsxs)("div",{className:"py-1 border-t cfg-line",children:[(0,s.jsx)("dt",{className:"cfg-faint",children:t.label}),(0,s.jsx)("dd",{className:"whitespace-pre-wrap break-words",children:null==a?(0,s.jsx)("span",{className:"cfg-faint",children:"null"}):Array.isArray(a)?0===a.length?(0,s.jsx)("span",{className:"cfg-faint",children:"(none)"}):(0,s.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:a.map(e=>`- ${e}`).join("\n")}):"boolean"==typeof a?String(a):""===a?(0,s.jsx)("span",{className:"cfg-faint",children:"(empty)"}):(0,s.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:a})})]},t.key)})})]})]},e.id)})})]}),(0,s.jsx)(l,{agentId:ez.id,agentName:ez.name}),(0,s.jsxs)("section",{className:"cfg-card",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("h2",{className:"cfg-title",children:"Avatar"}),e4]}),(0,s.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,s.jsx)(h.default,{config:eP,size:96,title:"Avatar live preview"}),(0,s.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,s.jsx)(p,{attribute:"color",label:"Color",options:x.AVATAR_COLORS,current:eP,onPick:eK,className:"mb-3"}),(0,s.jsx)(p,{attribute:"eyes",label:"Eyes",options:x.AVATAR_EYES,current:eP,onPick:eK,className:"mb-3"}),(0,s.jsx)(p,{attribute:"hands",label:"Hands",options:x.AVATAR_HANDS,current:eP,onPick:eK,className:"mb-3"}),(0,s.jsx)(p,{attribute:"accessory",label:"Accessory",options:x.AVATAR_ACCESSORIES,current:eP,onPick:eK}),"error"===ek&&(0,s.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",eN,"."," ",(0,s.jsx)("button",{onClick:eV,className:"underline hover:no-underline",children:"Retry"})]}),(0,s.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,s.jsx)("button",{onClick:eV,disabled:!eW||"saving"===ek,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===ek?"Saving…":"Save"}),(0,s.jsx)("button",{onClick:function(){ev(null),ey("clean"),ew("")},disabled:!eW||"saving"===ek,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,s.jsxs)("section",{className:"cfg-card cfg-danger","aria-labelledby":"cfg-danger-title",children:[(0,s.jsx)("h2",{id:"cfg-danger-title",className:"cfg-title mb-3",children:"Danger zone"}),(0,s.jsx)("p",{className:"text-sm cfg-muted",children:o.DELETE_REMOVES_COPY}),(0,s.jsx)("p",{className:"text-sm cfg-faint mt-2",children:o.DELETE_KEEPS_COPY}),(0,s.jsx)("button",{type:"button",onClick:()=>S(!0),className:"mt-3 delete-btn text-sm w-full sm:w-auto",children:"Delete agent"})]})]})]})]}),w?(0,s.jsx)(i.default,{ids:[ez.id],onCancel:()=>S(!1),onDeleted:e=>v.push(`/?deleted=${Math.max(e.length,1)}`)}):null]})}],13978)},33851,44079,52900,68541,e=>{"use strict";var s=e.i(3136);let t="This computer",a={read_only:"Read only",workspace_write:"Workspace write"},n={workspaces:"Selected workspaces",sessions:"Selected imported sessions",all_provider_sessions:"All sessions this runtime can see"};function i(e){return e.startsWith("/")||"~"===e||e.startsWith("~/")}function r(e){return e.length>1?e.replace(/\/+$/,""):e}s.AGENTS.join("|");let l="/api/runtime-connections",o={connection:"Runtime connection",scope:"Session scope",defaultWorkspace:"Default workspace (optional)",policy:"Policy",homeSession:"Home session (optional)"},c={connection:"The runtime installation or account this Agent uses. Several Agents can share one.",workspaces:"One absolute path per line. An empty scope never means unrestricted.",sessions:"Only this Agent’s own Botmancers sessions can be selected.",noSessions:"This Agent has no sessions yet. Choose workspaces or all sessions for now.",allSessions:"Every session this runtime can see. Choose this only on purpose.",defaultWorkspace:"Where new sessions start. Convenience only — not a permission.",resumeEdits:"Needs Workspace write.",homeSession:"A stable session to return to. Must be one of this Agent’s sessions.",addConnection:"Stores a name and host only. Credentials stay with the runtime."},d="Loading runtime connections…",m="Couldn't load runtime connections — retry.";function u(){return{status:"loading",connections:[],error:""}}function h(e){return`${e.label} \xb7 ${s.AGENT_LABELS[e.provider]??e.provider}`}function p(e){if("object"!=typeof e||null===e)return null;let s=e.connections;if(!Array.isArray(s))return null;let t=[];for(let e of s){if("object"!=typeof e||null===e||"string"!=typeof e.id||"string"!=typeof e.provider||"string"!=typeof e.label)return null;t.push({id:e.id,provider:e.provider,label:e.label,host:"string"==typeof e.host?e.host:"",agent_count:"number"==typeof e.agent_count?e.agent_count:void 0})}return t}function f(e){let s=[];for(let t of e.split("\n")){let e=t.trim();e&&!s.includes(e)&&s.push(e)}return s}function g(e){return"workspaces"===e.scopeKind?{kind:"workspaces",workspaces:f(e.workspaces)}:"sessions"===e.scopeKind?{kind:"sessions",sessions:e.sessions}:{kind:e.scopeKind}}function x(e){return{mode:e.policyMode,allow_new_sessions:e.allowNewSessions,allow_resume_with_edits:e.allowResumeWithEdits}}e.s(["CONNECTIONS_ENDPOINT",0,l,"CONNECTIONS_ERROR_COPY",0,m,"CONNECTIONS_LOADING_COPY",0,d,"DEFAULT_REGISTRATION_FORM",0,{connectionId:"",scopeKind:"",workspaces:"",sessions:[],defaultWorkspace:"",policyMode:"read_only",allowNewSessions:!0,allowResumeWithEdits:!1,homeSessionId:""},"HINTS",0,c,"LABELS",0,o,"connectionOptionLabel",0,h,"hasRegistrationErrors",0,function(e){return Object.keys(e.errors).length>0},"initialConnectionListState",0,u,"parseConnectionList",0,p,"registrationCreateBody",0,function(e,s){let t={name:String(e??"").trim(),runtime_connection_id:s.connectionId,session_scope:g(s),policy:x(s)},a=s.defaultWorkspace.trim();return a&&(t.default_workspace=a),t},"registrationFormFromBot",0,function(e){let s=e.session_scope??null;return{connectionId:e.runtime_connection_id??"",scopeKind:s?.kind??"",workspaces:s?.kind==="workspaces"?s.workspaces.join("\n"):"",sessions:s?.kind==="sessions"?[...s.sessions]:[],defaultWorkspace:e.default_workspace??"",policyMode:e.policy?.mode??"read_only",allowNewSessions:!e.policy||e.policy.allow_new_sessions,allowResumeWithEdits:!!e.policy&&e.policy.allow_resume_with_edits,homeSessionId:e.home_session_id??""}},"registrationFormView",0,function(e,s){let t={};e.connectionId||(t.connection="Pick a runtime connection.");let a=f(e.workspaces);e.scopeKind?"workspaces"===e.scopeKind?0===a.length?t.workspaces="Add at least one workspace.":a.every(i)||(t.workspaces="Workspaces must be absolute paths (or start with ~/)."):"sessions"===e.scopeKind&&0===e.sessions.length&&(t.sessions="Select at least one session."):t.scope="Choose a session scope.";let n=e.defaultWorkspace.trim();n&&(i(n)?"workspaces"!==e.scopeKind||t.workspaces||a.some(e=>{let s,t;return s=r(e),s===(t=r(n))||t.startsWith("/"===s?"/":`${s}/`)})||(t.defaultWorkspace="The default workspace must be inside one of the selected workspaces."):t.defaultWorkspace="The default workspace must be an absolute path (or start with ~/)."),e.allowResumeWithEdits&&"workspace_write"!==e.policyMode&&(t.policy="Resume with edits needs the Workspace write policy.");let l="",o=!1;return"ready"!==s.status&&(o=!0,l="error"===s.status?m:""),{errors:t,submitDisabled:o,blocker:l}},"registrationPatchBody",0,function(e,s){return{id:e,runtime_connection_id:s.connectionId,session_scope:g(s),default_workspace:s.defaultWorkspace.trim(),policy:x(s),home_session_id:s.homeSessionId}},"registrationReadView",0,function(e,t){var i;let r,l=[{key:"connection",label:o.connection,value:(r=e.runtime_connection)?`${r.label} (${(0,s.agentLabel)(r.provider)} \xb7 ${r.host})`:"Not set"},{key:"scope",label:o.scope,value:function(e,s){if(!e)return"Not set — this Agent cannot launch until a scope is chosen.";if("all_provider_sessions"===e.kind)return n.all_provider_sessions;if("workspaces"===e.kind)return`${n.workspaces}: ${e.workspaces.join(", ")}`;let t=e.sessions.map(e=>s?.find(s=>s.ref===e)?.title??e);return`${n.sessions}: ${t.join(", ")}`}(e.session_scope,t)},{key:"defaultWorkspace",label:"Default workspace",value:e.default_workspace||"None"},{key:"policy",label:o.policy,value:(i=e.policy)?[a[i.mode],i.allow_new_sessions?"new sessions allowed":"no new sessions",i.allow_resume_with_edits?"resume with edits allowed":"no resume with edits"].join(" · "):"Not set"}],c=[];return l.push({key:"homeSession",label:"Home session",value:e.home_session_id?t?.find(s=>s.ref===e.home_session_id)?.title??e.home_session_id:"None"}),"connection"===e.launch_blocker?c.push("Choose a runtime connection before this Agent can run."):"session_scope"===e.launch_blocker?c.push("Choose a session scope before this Agent can run."):"agent"===e.launch_blocker&&c.push("This Agent has an unsupported Agent type."),{rows:l,notices:c}}],33851);var b=e.i(43476),j=e.i(71645),v=e.i(74904);let k={modal:{fieldset:"agent-fieldset reg-fieldset",legend:"field-legend",label:"",picks:"runtime-picks",pick:"runtime-pick",stack:"reg-stack",control:"reg-control",input:"",hint:"runtime-hint",error:"form-error reg-error",button:"runtime-retry",note:"runtime-note"},config:{fieldset:"agent-fieldset reg-fieldset",legend:"block text-sm cfg-muted mt-3 mb-1 p-0",label:"block text-sm cfg-muted mt-3 mb-1",picks:"flex flex-wrap gap-x-4 gap-y-1 text-sm cfg-muted",pick:"text-sm cfg-muted",stack:"flex flex-col gap-1 text-sm cfg-muted",control:"cfg-input text-sm",input:"cfg-input text-sm",hint:"mt-1 text-xs cfg-faint",error:"mt-1 text-sm cfg-error",button:"cfg-link text-sm",note:"text-sm cfg-muted mt-1"}};function y({id:e,message:s,variant:t}){return s?(0,b.jsx)("p",{id:e,className:k[t].error,role:"alert",children:s}):null}function N({idPrefix:e,variant:s,onAdd:a}){let n=k[s],[i,r]=(0,j.useState)(!1),[l,o]=(0,j.useState)(v.AGENT_OPTIONS[0].value),[d,m]=(0,j.useState)(""),[u,h]=(0,j.useState)(""),[p,f]=(0,j.useState)(""),[g,x]=(0,j.useState)(!1),y=async()=>{if(g)return;x(!0),f("");let e=await a({provider:l,label:d,host:u.trim()||t});(x(!1),"string"==typeof e)?f(e):(r(!1),m(""),h(""))};return i?(0,b.jsxs)("div",{id:`${e}-add-connection`,className:"reg-add-connection",role:"group","aria-label":"Add connection",children:[(0,b.jsx)("label",{className:n.label,htmlFor:`${e}-add-provider`,children:"Provider"}),(0,b.jsx)("select",{id:`${e}-add-provider`,className:n.control,value:l,onChange:e=>o(e.target.value),children:v.AGENT_OPTIONS.map(e=>(0,b.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,b.jsx)("label",{className:n.label,htmlFor:`${e}-add-label`,children:"Connection name"}),(0,b.jsx)("input",{id:`${e}-add-label`,type:"text",className:n.input||void 0,value:d,placeholder:"Codex on my laptop",onChange:e=>m(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),y())}}),(0,b.jsx)("label",{className:n.label,htmlFor:`${e}-add-host`,children:"Host"}),(0,b.jsx)("input",{id:`${e}-add-host`,type:"text",className:n.input||void 0,value:u,placeholder:t,"aria-describedby":`${e}-add-hint`,onChange:e=>h(e.target.value)}),(0,b.jsx)("p",{id:`${e}-add-hint`,className:n.hint,children:c.addConnection}),p?(0,b.jsx)("p",{className:n.error,role:"alert",children:p}):null,(0,b.jsxs)("div",{className:"reg-actions",children:[(0,b.jsx)("button",{type:"button",className:n.button,onClick:()=>void y(),disabled:g,children:g?"Adding…":"Add"}),(0,b.jsx)("button",{type:"button",className:n.button,"aria-expanded":"true",onClick:()=>r(!1),children:"Cancel"})]})]}):(0,b.jsx)("button",{type:"button",className:n.button,"aria-expanded":"false","aria-controls":`${e}-add-connection`,onClick:()=>r(!0),children:"Add connection…"})}e.s(["RegistrationFields",0,function({idPrefix:e,variant:s,form:t,onChange:i,view:r,showErrors:l,connections:u,onRetryConnections:p,onAddConnection:f,workspacePlaceholder:g,workspaceHint:x,sessions:j,includeHomeSession:v}){let w=k[s],S=e=>l?r.errors[e]:void 0,_=s=>`${e}-${s}-error`,C=(e,...s)=>[...s,S(e)?_(e):""].filter(Boolean).join(" ")||void 0,$=!!(j&&j.length>0);return(0,b.jsxs)("div",{className:"registration-fields","data-registration":s,children:[(0,b.jsxs)("fieldset",{className:w.fieldset,"data-field":"connection","aria-describedby":C("connection",`${e}-connection-hint`),children:[(0,b.jsx)("legend",{className:w.legend,id:`${e}-connection-legend`,children:o.connection}),"loading"===u.status?(0,b.jsx)("p",{className:w.note,role:"status",children:d}):"error"===u.status?(0,b.jsxs)("p",{className:w.note,role:"status",children:[m," ",(0,b.jsx)("button",{type:"button",className:w.button,onClick:p,children:"Retry"})]}):(0,b.jsxs)("select",{id:`${e}-connection`,className:w.control,"aria-labelledby":`${e}-connection-legend`,"aria-required":"true","aria-invalid":!!S("connection")||void 0,value:t.connectionId,onChange:e=>i({connectionId:e.target.value}),children:[(0,b.jsx)("option",{value:"",disabled:!0,children:"Select a connection…"}),u.connections.map(e=>(0,b.jsx)("option",{value:e.id,children:h(e)},e.id))]}),(0,b.jsx)("p",{id:`${e}-connection-hint`,className:w.hint,children:c.connection}),(0,b.jsx)(y,{id:_("connection"),message:S("connection"),variant:s}),"ready"===u.status?(0,b.jsx)(N,{idPrefix:e,variant:s,onAdd:async e=>{let s=await f(e);return"string"!=typeof s&&i({connectionId:s.id}),s}}):null]}),(0,b.jsxs)("fieldset",{className:w.fieldset,"data-field":"scope",children:[(0,b.jsx)("legend",{className:w.legend,id:`${e}-scope-legend`,children:o.scope}),(0,b.jsx)("div",{className:w.stack,role:"radiogroup","aria-labelledby":`${e}-scope-legend`,"aria-required":"true","aria-describedby":C("scope"),children:["workspaces","sessions","all_provider_sessions"].map(s=>(0,b.jsxs)("label",{className:w.pick,children:[(0,b.jsx)("input",{type:"radio",name:`${e}-scope`,value:s,checked:t.scopeKind===s,disabled:"sessions"===s&&!$,onChange:()=>i({scopeKind:s})})," "+n[s]]},s))}),$?null:(0,b.jsx)("p",{className:w.hint,children:c.noSessions}),(0,b.jsx)(y,{id:_("scope"),message:S("scope"),variant:s}),"workspaces"===t.scopeKind?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("label",{className:w.label,htmlFor:`${e}-workspaces`,children:"Workspaces"}),(0,b.jsx)("textarea",{id:`${e}-workspaces`,className:w.input||void 0,rows:2,value:t.workspaces,placeholder:"/Users/you/work/project","aria-required":"true","aria-invalid":!!S("workspaces")||void 0,"aria-describedby":C("workspaces",`${e}-workspaces-hint`),onChange:e=>i({workspaces:e.target.value})}),(0,b.jsx)("p",{id:`${e}-workspaces-hint`,className:w.hint,children:c.workspaces}),(0,b.jsx)(y,{id:_("workspaces"),message:S("workspaces"),variant:s})]}):null,"sessions"===t.scopeKind&&j?(0,b.jsxs)("div",{className:w.stack,role:"group","aria-label":"Sessions in scope","aria-describedby":C("sessions",`${e}-sessions-hint`),children:[j.map(e=>(0,b.jsxs)("label",{className:w.pick,children:[(0,b.jsx)("input",{type:"checkbox",checked:t.sessions.includes(e.ref),onChange:s=>i({sessions:s.target.checked?[...t.sessions,e.ref]:t.sessions.filter(s=>s!==e.ref)})}),` ${e.title} (${e.status})`]},e.ref)),(0,b.jsx)("p",{id:`${e}-sessions-hint`,className:w.hint,children:c.sessions}),(0,b.jsx)(y,{id:_("sessions"),message:S("sessions"),variant:s})]}):null,"all_provider_sessions"===t.scopeKind?(0,b.jsx)("p",{className:w.hint,children:c.allSessions}):null]}),(0,b.jsxs)("div",{"data-field":"default-workspace",children:[(0,b.jsx)("label",{className:w.label,htmlFor:`${e}-default-workspace`,children:o.defaultWorkspace}),(0,b.jsx)("input",{id:`${e}-default-workspace`,type:"text",className:w.input||void 0,value:t.defaultWorkspace,placeholder:g,"aria-invalid":!!S("defaultWorkspace")||void 0,"aria-describedby":C("defaultWorkspace",`${e}-default-workspace-hint`,`${e}-default-workspace-note`),onChange:e=>i({defaultWorkspace:e.target.value})}),(0,b.jsx)("p",{id:`${e}-default-workspace-hint`,className:w.hint,children:x}),(0,b.jsx)("p",{id:`${e}-default-workspace-note`,className:w.hint,children:c.defaultWorkspace}),(0,b.jsx)(y,{id:_("defaultWorkspace"),message:S("defaultWorkspace"),variant:s})]}),(0,b.jsxs)("fieldset",{className:w.fieldset,"data-field":"policy",children:[(0,b.jsx)("legend",{className:w.legend,id:`${e}-policy-legend`,children:o.policy}),(0,b.jsx)("div",{className:w.picks,role:"radiogroup","aria-labelledby":`${e}-policy-legend`,children:["read_only","workspace_write"].map(s=>(0,b.jsxs)("label",{className:w.pick,children:[(0,b.jsx)("input",{type:"radio",name:`${e}-policy`,value:s,checked:t.policyMode===s,onChange:()=>i("read_only"===s?{policyMode:s,allowResumeWithEdits:!1}:{policyMode:s})})," "+a[s]]},s))}),(0,b.jsxs)("div",{className:w.stack,children:[(0,b.jsxs)("label",{className:w.pick,children:[(0,b.jsx)("input",{type:"checkbox",checked:t.allowNewSessions,onChange:e=>i({allowNewSessions:e.target.checked})})," Allow new sessions"]}),(0,b.jsxs)("label",{className:w.pick,children:[(0,b.jsx)("input",{type:"checkbox",checked:t.allowResumeWithEdits,disabled:"workspace_write"!==t.policyMode,"aria-describedby":`${e}-resume-hint`,onChange:e=>i({allowResumeWithEdits:e.target.checked})})," Allow resume with edits"]}),(0,b.jsx)("p",{id:`${e}-resume-hint`,className:w.hint,children:c.resumeEdits})]}),(0,b.jsx)(y,{id:_("policy"),message:S("policy"),variant:s})]}),v?(0,b.jsxs)("div",{"data-field":"home-session",children:[(0,b.jsx)("label",{className:w.label,htmlFor:`${e}-home-session`,children:o.homeSession}),(0,b.jsxs)("select",{id:`${e}-home-session`,className:w.control,value:t.homeSessionId,"aria-describedby":`${e}-home-session-hint`,onChange:e=>i({homeSessionId:e.target.value}),children:[(0,b.jsx)("option",{value:"",children:"None"}),(j??[]).map(e=>(0,b.jsx)("option",{value:e.ref,children:`${e.title} (${e.status})`},e.ref))]}),(0,b.jsx)("p",{id:`${e}-home-session-hint`,className:w.hint,children:c.homeSession})]}):null]})}],44079),e.s(["useRuntimeConnections",0,function(){let[e,s]=(0,j.useState)(()=>u()),[t,a]=(0,j.useState)(0);return(0,j.useEffect)(()=>{let e=!1;return fetch(l,{cache:"no-store"}).then(async t=>{let a=t.ok?p(await t.json().catch(()=>null)):null;e||s(a?{status:"ready",connections:a,error:""}:{status:"error",connections:[],error:`HTTP ${t.status}`})}).catch(t=>{e||s({status:"error",connections:[],error:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},[t]),{state:e,retry:(0,j.useCallback)(()=>{s(u()),a(e=>e+1)},[]),add:(0,j.useCallback)(async e=>{let t=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json().catch(()=>null);if(!t.ok)return"string"==typeof a?.error?a.error:"Failed to add the connection";let n=p({connections:[a]})?.[0];return n?(s(e=>({status:"ready",connections:[...e.connections,n],error:""})),n):"Failed to add the connection"},[])}}],52900);let w="imported",S=/^[A-Za-z0-9_-]{1,128}$/;function _(e){let s=new URLSearchParams(e).get(w);if(null===s)return null;let t=s.trim();return S.test(t)?t:""}function C(e){return`/bots/${encodeURIComponent(e)}/config`}async function $(e,s,t){let a=_(e);if(null===a)return{kind:"none"};if(!a)return{kind:"missing"};if(a===s)return{kind:"stay"};try{return await t(a)?{kind:"open",path:C(a)}:{kind:"missing"}}catch{return{kind:"missing"}}}e.s(["HANDOFF_STATUS_PATH",0,"/api/marketplace-handoff/status","IMPORT_RETURN_QUERY",0,w,"handoffStartPath",0,function(e,s){return`/api/marketplace-handoff?return=${encodeURIComponent(e+s)}`},"importedBotId",0,_,"importedConfigPath",0,C,"marketImportView",0,function(e){switch(e){case"checking":return{busy:!0,tone:"muted",message:"Checking Grok Marketplace…"};case"redirecting":return{busy:!0,tone:"muted",message:"Opening Grok Marketplace…"};case"unavailable":return{busy:!1,tone:"error",message:"Grok Marketplace isn't configured. Set CLONE_MARKET_URL on the Botmancers server."};case"failed":return{busy:!1,tone:"error",message:"Couldn't reach Botmancers to start the import. Try again."};case"missing":return{busy:!1,tone:"error",message:"Imported agent not found. The import may not have completed."};default:return{busy:!1,tone:"muted",message:"Imports a new agent and opens its Config. This agent is not changed."}}},"resolveImportReturn",0,$],68541)},24204,e=>{"use strict";var s=e.i(63352),t=e.i(50814);function a(e){return"active"===e.state}let n=/^T[A-Z0-9]{2,20}$/,i=/^[CG][A-Z0-9]{2,20}$/;e.s(["SHARE_DURATIONS",0,[{label:"5 minutes",seconds:300},{label:"1 hour",seconds:3600},{label:"8 hours",seconds:28800},{label:"24 hours",seconds:86400}],"SHARE_STATUS_LABELS",0,{active:"Active",exhausted:"Questions used",answering:"Answering",recovering:"Recovering",expired:"Expired",revoked:"Revoked"},"audienceInputError",0,function(e,s,t){let a=e.trim(),r=s.trim();return n.test(a)?i.test(r)?t.some(e=>e.team_id===a&&e.channel_id===r)?"That channel is already on the allowlist.":null:"Channel ID must look like C0123ABCD (a public or private channel ID; no wildcards).":"Workspace ID must look like T0123ABCD (a Slack team ID; no wildcards)."},"audienceLabel",0,function(e){return`Slack channel ${e.channel_id} \xb7 workspace ${e.team_id}`},"createdByLabel",0,function(e){return"owner"===e.created_by?"Shared by you":"current_session"===e.created_by?"Shared from a turn of this session":"Shared by a service"},"expiryLabel",0,function(e,t=Date.now()){return"revoked"===e.state?`Revoked ${(0,s.formatSessionDate)(e.revoked_at??e.expires_at)}`:"expired"===e.state||e.expires_at<=t?`Expired ${(0,s.formatSessionDate)(e.expires_at)}`:`Expires ${(0,s.formatSessionDate)(e.expires_at)} (in ${function(e){let s=Math.max(1,Math.round(e/6e4));if(s<60)return`${s} min`;let t=Math.floor(s/60),a=s%60;return a?`${t} h ${a} min`:`${t} h`}(e.expires_at-t)})`},"sessionShares",0,function(e,s){let t=e.filter(e=>e.session_ref===s);return[...t.filter(a).sort((e,s)=>s.created_at-e.created_at),...t.filter(e=>!a(e)).sort((e,s)=>(s.revoked_at??s.expires_at)-(e.revoked_at??e.expires_at))]},"shareCreateAvailability",0,function(e,s){let a=`/bots/${encodeURIComponent(e.agent.id)}/config#session-sharing`;if(!s)return{available:!1,reason:"Share to Slack is unavailable: the share policy could not be loaded.",configHref:null};let n=(0,t.sessionRowActions)(e).find(e=>"ask"===e.action);return n&&!n.availability.available?{available:!1,reason:n.availability.reason.replace(/^Ask from this context is unavailable:/,"Share to Slack is unavailable:"),configHref:null}:"invalid"===s.state?{available:!1,reason:"Share to Slack is unavailable: the share policy file is invalid. Fix it in Config.",configHref:a}:0===s.audiences.length?{available:!1,reason:"Share to Slack needs a Slack channel on the share allowlist. Add one in Config.",configHref:a}:{available:!0}},"shareCreateBody",0,function(e,s,t,a){return{audience:{team_id:e.team_id,channel_id:e.channel_id},ttl_seconds:s,max_turns:t,idempotency_key:a}},"shareFromTurnNote",0,function(e){return e.agent.share_current.supported?e.agent.share_from_turn?"On: a turn Botmancers launches for this Agent can share its own session to an allowlisted channel. Turning it off revokes every live turn context at once.":"Off: no turn of this Agent can share its own session. Sessions can still be shared from the Agent Sessions page.":e.agent.share_current.reason??"This runtime cannot share its own session from a turn."},"shareIsLive",0,a,"shareStatusNote",0,function(e){switch(e.status){case"active":return"Slack replies in its thread ask this session (read-only).";case"answering":return"A Slack question is being answered now. The next one waits until it finishes.";case"recovering":return"A question was interrupted by a Botmancers restart. The next Slack question clears it.";case"exhausted":return`All ${e.max_turns} questions are used. Slack questions get the limit notice; create a new share to keep going.`;case"expired":return"Expired: Slack questions get the expired notice. Its history stays here.";case"revoked":return"Revoked: Slack questions get the revoked notice. Its history stays here."}},"threadLabel",0,function(e){return e.thread.posted?`Slack thread posted ${(0,s.formatSessionDate)(e.thread.posted_at??0)}`:"active"===e.state?"Waiting for the Slack relay to post the thread":"No Slack thread was posted"},"turnsLabel",0,function(e){return`${e.turns_used} of ${e.max_turns} question${1===e.max_turns?"":"s"} used`}])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,91267,e=>{"use strict";var t=e.i(43476),n=e.i(22016),a=e.i(71645),s=e.i(70925);let r=["disabled","misconfigured","connecting","connected","reconnecting","failed","stopped"],i=["slack_tokens_absent","app_token_missing","bot_token_missing","app_token_invalid","bot_token_invalid","share_config_absent","share_config_invalid","share_config_no_audience","workspace_not_allowlisted","slack_auth_failed","slack_connect_failed"],o={app_token_missing:"Add the Socket Mode app token to the Botmancers core environment, then restart Botmancers.",bot_token_missing:"Add the bot token to the Botmancers core environment, then restart Botmancers.",app_token_invalid:"Replace the Socket Mode app token with a valid value, then restart Botmancers.",bot_token_invalid:"Replace the bot token with a valid value, then restart Botmancers.",share_config_absent:"Add an allowlisted Slack channel in Agent Config, then restart Botmancers.",share_config_invalid:"Repair the session sharing policy in Agent Config, then restart Botmancers.",share_config_no_audience:"Add an allowlisted Slack channel in Agent Config, then restart Botmancers.",workspace_not_allowlisted:"Allowlist a channel from the workspace connected to the Botmancers Slack app, then restart Botmancers."};function l(e){switch(e.state){case"disabled":return{label:"Disabled",summary:"The optional Botmancers Slack relay is off.",guidance:"To use Slack sharing, configure both Slack relay credentials and at least one allowlisted channel, then restart Botmancers.",tone:"quiet"};case"misconfigured":return{label:"Needs configuration",summary:"The Botmancers Slack relay cannot start with its current configuration.",guidance:o[e.reason??"share_config_invalid"]??"Review the Slack relay credentials and sharing allowlist, then restart Botmancers.",tone:"warning"};case"connecting":return{label:"Connecting",summary:"The Botmancers Slack relay is opening its Socket Mode connection.",guidance:"Wait a moment, then refresh. Existing shares remain bounded to their exact sessions.",tone:"working"};case"connected":return{label:"Connected",summary:"The single Botmancers Slack relay is connected.",guidance:"It can post and answer eligible shared-session threads for all Agents on this Botmancers instance.",tone:"good"};case"reconnecting":return{label:"Reconnecting",summary:"The Botmancers Slack relay lost its connection and is reconnecting.",guidance:"Wait and refresh. Pending work is recovered after the connection returns; do not recreate shares just for a reconnect.",tone:"working"};case"failed":return{label:"Failed",summary:"The Botmancers Slack relay could not authenticate or connect.",guidance:"slack_auth_failed"===e.reason?"Check the configured Slack app and bot credentials, then restart Botmancers.":"Check Slack connectivity and the Socket Mode app configuration, then restart Botmancers.",tone:"warning"};case"stopped":return{label:"Stopped",summary:"The Botmancers Slack relay is not running.",guidance:"Start or restart Botmancers. Existing share records remain available for review.",tone:"quiet"}}}let c=[{value:"all",label:"All states"},{value:"active",label:"Live"},{value:"expired",label:"Expired"},{value:"revoked",label:"Revoked"}];var d=e.i(24204);function u({agentId:e,agentName:a,relay:s,policy:r,shares:i,filter:o,nextCursor:l,refreshing:d,loadingMore:p,onFilter:v,onRefresh:k,onLoadMore:_,onSharesChanged:b}){let x=`/agents/${encodeURIComponent(e)}/sessions`,y=`/bots/${encodeURIComponent(e)}/config#session-sharing`;return(0,t.jsxs)("div",{className:"agent-slack","data-agent-slack-page":!0,children:[(0,t.jsxs)("header",{className:"agent-slack-intro",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"agent-eyebrow",children:"Slack"}),(0,t.jsx)("h2",{children:"Relay health and shared sessions"}),(0,t.jsxs)("p",{children:["Botmancers runs one optional Slack relay. ",a," does not have a separate Slack app; below are only the session threads shared for this Agent."]})]}),(0,t.jsx)("button",{type:"button",className:"agent-slack-refresh",onClick:k,disabled:d,children:d?"Refreshing…":"Refresh"})]}),(0,t.jsxs)("section",{className:"agent-slack-relay","aria-labelledby":"relay-heading",children:[(0,t.jsxs)("div",{className:"agent-slack-section-head",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"agent-eyebrow",children:"Botmancers-wide connection"}),(0,t.jsx)("h3",{id:"relay-heading",children:"Slack relay"})]}),"ready"===s.state?(0,t.jsx)(h,{health:s.value}):null]}),"loading"===s.state?(0,t.jsx)("p",{role:"status",children:"Checking the relay…"}):null,"error"===s.state?(0,t.jsxs)("div",{className:"agent-slack-error",role:"alert",children:[(0,t.jsx)("strong",{children:"Relay health unavailable"}),(0,t.jsx)("p",{children:"Botmancers could not read the redacted health status. Refresh to try again."})]}):null,"ready"===s.state?(0,t.jsx)(g,{health:s.value}):null]}),(0,t.jsxs)("section",{className:"agent-slack-policy","aria-labelledby":"policy-heading",children:[(0,t.jsxs)("div",{className:"agent-slack-section-head",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"agent-eyebrow",children:"This Agent"}),(0,t.jsx)("h3",{id:"policy-heading",children:"Sharing readiness"})]}),(0,t.jsx)(n.default,{href:y,children:"Edit in Config"})]}),"loading"===r.state?(0,t.jsx)("p",{role:"status",children:"Checking sharing policy…"}):null,"error"===r.state?(0,t.jsxs)("div",{className:"agent-slack-error",role:"alert",children:[(0,t.jsx)("strong",{children:"Sharing policy unavailable"}),(0,t.jsx)("p",{children:"Refresh, or open Config to review this Agent’s stored policy."})]}):null,"ready"===r.state?(0,t.jsx)(f,{policy:r.value}):null]}),(0,t.jsxs)("section",{className:"agent-slack-shares","aria-labelledby":"shares-heading",children:[(0,t.jsxs)("div",{className:"agent-slack-section-head agent-slack-shares-head",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"agent-eyebrow",children:"This Agent"}),(0,t.jsx)("h3",{id:"shares-heading",children:"Shared session threads"}),(0,t.jsx)("p",{children:"Each share is ask-only and can reach exactly one owning session."})]}),(0,t.jsx)(n.default,{className:"agent-primary-action",href:x,children:"Share a session"})]}),(0,t.jsx)("div",{className:"agent-slack-filters",role:"group","aria-label":"Filter shares by state",children:c.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":o===e.value,onClick:()=>v(e.value),children:e.label},e.value))}),"loading"===i.state?(0,t.jsx)("p",{className:"agent-slack-empty",role:"status",children:"Loading shared sessions…"}):null,"error"===i.state?(0,t.jsxs)("div",{className:"agent-slack-error",role:"alert",children:[(0,t.jsx)("strong",{children:"Shared sessions unavailable"}),(0,t.jsx)("p",{children:"No partial or stale list is shown. Refresh to try again."})]}):null,"ready"===i.state&&0===i.value.length?(0,t.jsx)("p",{className:"agent-slack-empty",children:"all"===o?`No sessions from ${a} have been shared to Slack yet.`:`No ${c.find(e=>e.value===o)?.label.toLowerCase()} shares for ${a}.`}):null,"ready"===i.state&&i.value.length>0?(0,t.jsx)("ul",{className:"agent-slack-share-list","aria-label":`Slack shares for ${a}`,children:i.value.map(n=>(0,t.jsx)(m,{share:n,agentId:e,onChanged:b},n.share_ref))}):null,"ready"===i.state&&l?(0,t.jsx)("button",{type:"button",className:"agent-slack-more",onClick:_,disabled:p,children:p?"Loading…":"Load more shares"}):null]})]})}function h({health:e}){let n=l(e);return(0,t.jsx)("span",{className:`agent-slack-status is-${n.tone}`,"data-relay-state":e.state,children:n.label})}function g({health:e}){let n=l(e);return(0,t.jsxs)("div",{className:"agent-slack-relay-copy",children:[(0,t.jsx)("p",{children:(0,t.jsx)("strong",{children:n.summary})}),(0,t.jsx)("p",{children:n.guidance}),"connected"===e.state&&e.connections>0?(0,t.jsxs)("p",{className:"agent-muted",children:["Connections opened this run: ",e.connections]}):null]})}function f({policy:e}){let n="loaded"===e.state&&e.audiences.length>0;return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{children:(0,t.jsx)("strong",{children:n?"Ready to create session shares.":"invalid"===e.state?"The sharing policy needs repair.":"No Slack audience is allowlisted yet."})}),(0,t.jsxs)("p",{className:"agent-muted",children:["Share from a running Agent turn: ",e.agent.share_from_turn?"On":"Off",". Session owners can still share eligible sessions from Sessions."]}),e.audiences.length?(0,t.jsx)("ul",{className:"agent-slack-audiences","aria-label":"Allowed Slack audiences",children:e.audiences.map(e=>(0,t.jsx)("li",{children:(0,d.audienceLabel)(e)},`${e.team_id}:${e.channel_id}`))}):(0,t.jsx)("p",{className:"agent-slack-empty",children:"No allowlisted Slack channels."})]})}function m({share:e,agentId:s,onChanged:r}){let[i,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)(!1),[u,h]=(0,a.useState)(""),g=(0,a.useRef)(null),f=(0,d.shareIsLive)(e),p=`/agents/${encodeURIComponent(s)}/sessions?session=${encodeURIComponent(e.session_ref)}`,v=async()=>{c(!0),h("");try{let t=await fetch(`/api/shares/${encodeURIComponent(e.share_ref)}/revoke`,{method:"POST"}),n=await t.json().catch(()=>null);if(!t.ok)throw Error("string"==typeof n?.error?.message?n.error.message:"The share could not be revoked.");o(!1),r()}catch(e){h(e instanceof Error?e.message:"The share could not be revoked.")}finally{c(!1)}};return(0,t.jsxs)("li",{className:`agent-slack-share is-${e.status}`,"data-share-ref":e.share_ref,"data-share-status":e.status,children:[(0,t.jsxs)("div",{className:"agent-slack-share-summary",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:`agent-slack-status is-share-${e.status}`,children:d.SHARE_STATUS_LABELS[e.status]}),(0,t.jsx)("strong",{children:(0,d.audienceLabel)(e.audience)}),(0,t.jsxs)("small",{children:[(0,d.turnsLabel)(e)," · ",(0,d.expiryLabel)(e)]})]}),(0,t.jsx)("span",{className:"agent-slack-detail-hint",children:"Open for details"})]}),(0,t.jsx)("p",{className:"agent-slack-state-note",children:(0,d.shareStatusNote)(e)}),(0,t.jsxs)("details",{className:"agent-slack-details",children:[(0,t.jsx)("summary",{children:"Details"}),(0,t.jsxs)("dl",{className:"agent-slack-share-details",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Owning session"}),(0,t.jsx)("dd",{children:(0,t.jsx)(n.default,{href:p,children:e.session_ref})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Posted thread"}),(0,t.jsx)("dd",{children:(0,d.threadLabel)(e)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Creation path"}),(0,t.jsx)("dd",{children:"current_session"===e.created_via?"Running Agent turn":"owner"===e.created_by?"Agent Sessions":"Session share API"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Created by"}),(0,t.jsx)("dd",{children:(0,d.createdByLabel)(e)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Authority"}),(0,t.jsx)("dd",{children:"Ask only · exact session"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:"Share reference"}),(0,t.jsx)("dd",{children:(0,t.jsx)("code",{children:e.share_ref})})]})]})]}),(0,t.jsxs)("div",{className:"agent-slack-share-actions",children:[(0,t.jsx)(n.default,{href:p,children:"Open owning session"}),f&&!i?(0,t.jsx)("button",{ref:g,type:"button",className:"agent-slack-revoke","data-share-action":"revoke",onClick:()=>o(!0),children:"Revoke"}):null]}),i?(0,t.jsxs)("div",{className:"agent-slack-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",{children:[(0,t.jsx)("button",{type:"button",className:"agent-slack-revoke","data-share-action":"confirm-revoke",disabled:l,onClick:()=>{v()},children:l?"Revoking…":"Revoke share"}),(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>{o(!1),requestAnimationFrame(()=>g.current?.focus())},children:"Keep it"})]})]}):null,u?(0,t.jsx)("p",{className:"delete-error",role:"alert",children:u}):null]})}e.s(["AgentSlackView",0,u,"default",0,function(){let{id:e,overview:o,loading:l,error:c,notFound:d}=(0,s.useAgentOverview)(),[h,g]=(0,a.useState)({state:"loading"}),[f,m]=(0,a.useState)({state:"loading"}),[p,v]=(0,a.useState)({state:"loading"}),[k,_]=(0,a.useState)("all"),[b,x]=(0,a.useState)(null),[y,S]=(0,a.useState)(!1),[$,w]=(0,a.useState)(!1),[j,A]=(0,a.useState)(0),[C,R]=(0,a.useState)(""),N=(0,a.useRef)(0),T=(0,a.useCallback)((t=null)=>{let n=new URLSearchParams({agent_id:e,limit:String(12)});return"all"!==k&&n.set("state",k),t&&n.set("cursor",t),`/api/shares?${n.toString()}`},[k,e]);(0,a.useEffect)(()=>{let t=!1,n=++N.current;return Promise.allSettled([fetch("/api/health",{cache:"no-store"}).then(async e=>(function(e){if(!e||"object"!=typeof e||!r.includes(e.state))return null;let t=null===e.reason?null:i.includes(e.reason)?e.reason:null;return{state:e.state,reason:t,since:Number.isFinite(e.since)?Number(e.since):0,connections:Number.isInteger(e.connections)&&Number(e.connections)>=0?Number(e.connections):0}})((await e.json().catch(()=>null))?.slack)),fetch(`/api/bots/${encodeURIComponent(e)}/share-policy`,{cache:"no-store"}).then(async e=>{let t=await e.json().catch(()=>null);if(!e.ok||!t?.policy)throw Error("policy");return t.policy}),fetch(T(),{cache:"no-store"}).then(async t=>{let n=await t.json().catch(()=>null);if(!t.ok||!Array.isArray(n?.shares))throw Error("shares");return{shares:n.shares.filter(t=>t.agent.id===e),cursor:"string"==typeof n.next_cursor?n.next_cursor:null}})]).then(([a,s,r])=>{t||n!==N.current||(g("fulfilled"===a.status&&a.value?{state:"ready",value:a.value}:{state:"error"}),m("fulfilled"===s.status?{state:"ready",value:s.value}:{state:"error"}),"fulfilled"===r.status?(v({state:"ready",value:r.value.shares}),x(r.value.cursor)):v({state:"error"}),R(e))}).finally(()=>{t||n!==N.current||w(!1)}),()=>{t=!0}},[e,j,T]);let I=()=>{w(!0),g({state:"loading"}),m({state:"loading"}),v({state:"loading"}),x(null),A(e=>e+1)},L=async()=>{if(b&&!y&&"ready"===p.state){S(!0);try{let t=await fetch(T(b),{cache:"no-store"}),n=await t.json().catch(()=>null);if(!t.ok||!Array.isArray(n?.shares))throw Error("shares");let a=n.shares.filter(t=>t.agent.id===e);v({state:"ready",value:[...p.value,...a]}),x("string"==typeof n.next_cursor?n.next_cursor:null)}catch{v({state:"error"})}finally{S(!1)}}};if(l)return(0,t.jsx)("div",{className:"agent-state",role:"status",children:"Loading Slack operations…"});if(d)return(0,t.jsxs)("div",{className:"agent-state",children:[(0,t.jsx)("h2",{children:"Agent not found"}),(0,t.jsx)(n.default,{href:"/",children:"Choose an Agent"})]});if(c||!o)return(0,t.jsxs)("div",{className:"agent-state",role:"alert",children:[(0,t.jsx)("h2",{children:"Slack page unavailable"}),(0,t.jsx)("p",{children:"Botmancers could not load this Agent."})]});let B=C!==e;return(0,t.jsx)(u,{agentId:e,agentName:o.agent.name,relay:B?{state:"loading"}:h,policy:B?{state:"loading"}:f,shares:B?{state:"loading"}:p,filter:k,nextCursor:b,refreshing:$,loadingMore:y,onFilter:e=>{e!==k&&(v({state:"loading"}),x(null),_(e))},onRefresh:I,onLoadMore:()=>{L()},onSharesChanged:I})}],91267)},50814,63352,e=>{"use strict";function t(e){return`${new Date(e).toISOString().slice(0,16).replace("T"," ")} UTC`}function n(e){return e?e.split("/").filter(e=>e.length>0).pop()??null:null}function a(e,t){let n=function(e){if(!e)return null;let t=e.toLowerCase();return"muse code"===t?"muse":(["codex","claude","cursor","hermes","muse"].includes(t),t)}(t);switch(e){case"provider_unavailable":return n?{reason:`${n} is not installed or did not start`,fix:`Install ${n} and Retry.`}:{reason:"the runtime is not installed or did not start",fix:"Install the runtime and Retry."};case"auth_required":return{reason:"not signed in",fix:"Sign in and Retry."};case"permission_denied":return{reason:"permission denied",fix:"Check permissions and Retry."};case"incompatible_version":return{reason:"incompatible version",fix:"Update the runtime and Retry."};case"usage_limit":return{reason:"usage limit reached",fix:"Wait or upgrade and Retry."};case"scope_missing":return{reason:"no session scope is set",fix:"Choose a scope in Config."};case"provider_failed":return{reason:"the listing failed",fix:"Retry."};default:return{reason:e,fix:"Retry."}}}let s="Not reported";function r(e){return e.toFixed(1).replace(/\.0$/,"")}function i(e){return e.toLocaleString("en-US")}function o(e){return 0===e?"$0.00":e>=.01?`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`:e<1e-4?"<$0.0001":`$${e.toFixed(4)}`}let l={input_tokens:"Input tokens",output_tokens:"Output tokens",cost_usd:"Cost"};function c(e,t,n){return"cost_usd"===e?o(t):n?i(t):t<1e3?String(t):t<999950?`${r(t/1e3)}k`:t<99995e4?`${r(t/1e6)}M`:`${r(t/1e9)}B`}function d(e){return`${e} ${1===e?"run":"runs"}`}function u(e,t,n=!1){let a=l[e];if(!t||"unavailable"===t.quality||null===t.sum)return{name:a,text:s,quality:"unavailable",coverage:t&&t.total>0?`0 of ${d(t.total)} reported`:"No runs recorded",label:`${a}: not reported`};let r=c(e,t.sum,n),i=c(e,t.sum,!0);return"partial"===t.quality?{name:a,text:r,quality:"partial",coverage:`Partial: ${t.known} of ${d(t.total)} reported`,label:`${a}: at least ${i}, partial, reported by ${t.known} of ${d(t.total)}`}:{name:a,text:r,quality:"complete",coverage:`All ${d(t.total)} reported`,label:`${a}: ${i}, reported by all ${d(t.total)}`}}e.s(["SESSION_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"ended",label:"Ended"}],"attemptLabel",0,function(e){let t="source"===e.role?"Started the session":"Resumed the session";return`${t} \xb7 ${e.outcome??"running"}`},"emptySessionsCopy",0,function(e,t,n,s){if("active"===e)return`${t} has no active sessions.`;if("ended"===e)return`${t} has no ended sessions.`;if(n?.last_error_code){let{reason:e,fix:t}=a(n.last_error_code,s),r=s?`${s} sessions`:"sessions";return`Could not read ${r}: ${e}. ${t}`}if(n&&null===n.synced_at)return`${t} has not synced sessions yet. Refresh to load past sessions.`;let r=n?.out_of_scope_count??0;return r>0?`${r} ${1===r?"session exists":"sessions exist"} outside ${t}'s scope. Widen the scope to see them.`:`${t} has no sessions yet. One appears after a coding run keeps its runtime context.`},"formatSessionDate",0,t,"formatSyncRelativeTime",0,function(e,t=Date.now()){if(null===e)return"never";let n=Math.max(0,t-e);if(n<6e4)return"just now";let a=Math.floor(n/6e4);if(a<60)return`${a} minute${1===a?"":"s"} ago`;let s=Math.floor(a/60);if(s<24)return`${s} hour${1===s?"":"s"} ago`;let r=Math.floor(s/24);return`${r} day${1===r?"":"s"} ago`},"noMatchingSessionsCopy",0,function(e,t){let a=e.trim();if(a)return`No sessions match “${a}”.`;let s=n(t);return s?`No sessions in ${s}.`:"No sessions match the current filters."},"registrationSessionSyncCopy",0,function(e,t){if("failed"===e.outcome){let{reason:n,fix:s}=a(e.error_code??"provider_failed",t);return`Could not read ${t} sessions: ${n}. ${s}`}if("unsupported"===e.outcome)return`Past sessions are not available for ${t}.`;let n=1===e.imported?"session":"sessions",s=`Loaded ${e.imported} ${n}`;return e.rejected_out_of_scope>0&&(s+=`, ${e.rejected_out_of_scope} outside the scope`),e.complete||(s+=", more remain"),`${s}.`},"runtimeLabel",0,function(e){return e.agent.transport?`${e.agent.adapter} \xb7 ${e.agent.transport}`:e.agent.adapter},"sessionOriginChips",0,function(e){let t=[],n=e.origin.work_request?.requester;return n?.kind==="person"?t.push("Human origin"):n?.kind==="bot"?t.push(n.name?`${n.name} Agent`:"Agent origin"):n?.kind==="service"&&t.push("Service origin"),e.origin.conversation&&t.push(e.origin.conversation.label),[...new Set(t)]},"sessionStateTags",0,function(e){let t=[];return(e.home&&t.push("Home"),e.state?.availability==="missing")?[...t,"Missing"]:(e.state?.lifecycle==="archived"&&t.push("Archived"),e.state?.busy&&t.push("Busy"),(e.resumable||e.state?.resumable===!0)&&t.push("Resumable"),t)},"sessionUsageLine",0,function(e){let t=u("input_tokens",e?.input_tokens),n=u("output_tokens",e?.output_tokens),a=u("cost_usd",e?.cost_usd),r=[t,n,a];if(r.every(e=>"unavailable"===e.quality))return{text:s,label:"Usage: not reported",quality:"unavailable",partial:!1};let i=["unavailable"===t.quality?"input not reported":`${t.text} in`,"unavailable"===n.quality?"output not reported":`${n.text} out`,"unavailable"===a.quality?"cost not reported":a.text].join(" · "),o=r.some(e=>"partial"===e.quality),l=o||r.some(e=>"unavailable"===e.quality)?"partial":"complete";return{text:i,label:`Reported usage: ${r.map(e=>e.label).join("; ")}`,quality:l,partial:o}},"statusLabel",0,function(e){return"active"===e.status?"Active":"Ended"},"usageMetricView",0,u,"usageSampleLabel",0,function(e,t){let n="turn"===e.kind?"start"===e.turn_kind?"provider turn, started":"provider turn":"resume"===e.turn_kind?"resumed":"started";return`Run ${t+1} \xb7 ${n}`},"usageSampleValues",0,function(e){return{input:null===e.input_tokens?s:i(e.input_tokens),output:null===e.output_tokens?s:i(e.output_tokens),cost:null===e.cost_usd?s:o(e.cost_usd)}},"workRequestLabel",0,function(e){var t;let n=e.origin.work_request;return n?`${(t=n.execution_kind)?t[0].toUpperCase()+t.slice(1):t} \xb7 ${n.state}`:null},"workspaceFolderName",0,n,"workspaceOptions",0,function(e){let t=[...new Set(e.filter(e=>"string"==typeof e&&e.length>0))],a=t.map(e=>n(e)??e);return t.map((e,t)=>({value:e,label:a.filter(e=>e===a[t]).length>1?e:a[t]})).sort((e,t)=>e.label<t.label?-1:+(e.label>t.label))}],63352);let h={ask:"Ask from this context",resume:"Resume work here",handoff:"Hand off to…"},g=["queued","extracting","delivering","completed","failed","cancelled"],f=["completed","failed","cancelled"];function m(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 p(e,t=140){let n=String(e??"").split("\n").map(e=>e.trim()).filter(e=>e.length>0).join(" ");return n.length>t?`${n.slice(0,t-1).trimEnd()}…`:n}function v(e,t){return t.updated_at-e.updated_at||t.created_at-e.created_at||(e.id<t.id?-1:+(e.id>t.id))}e.s(["DEFAULT_LEDGER_FILTER",0,{mode:"all",state:"all",agentId:""},"INSTRUCTION_LIMIT",0,4e3,"MODE_FILTER_OPTIONS",0,[{value:"all",label:"All"},{value:"ask",label:"Ask"},{value:"continue",label:"Continue"}],"STATE_FILTER_OPTIONS",0,[{value:"all",label:"Any status"},{value:"active",label:"In progress"},{value:"queued",label:"Queued"},{value:"extracting",label:"Asking / extracting"},{value:"delivering",label:"Delivering"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"}],"detailsHref",0,function(e){return`/exchanges?id=${encodeURIComponent(e)}`},"eventLabel",0,function(e,t){let n=e.data??{},a=t.source.agent_name,s=t.destination?.agent_name??"the destination Agent",r="string"==typeof n.hop?n.hop:null;switch(e.type){case"created":return"ask"===t.mode?`You asked ${a}'s session a question`:`You handed ${a}'s session to ${s}`;case"hop_queued":if("deliver"===r)return`Handoff queued for ${s}'s new session`;return"extract"===r?`Handoff extraction queued in ${a}'s session`:`Question queued for ${a}'s session`;case"hop_started":if("deliver"===r)return`${s} started a new session`;return"extract"===r?`${a}'s session started extracting the handoff`:`${a}'s session started answering`;case"state_changed":{let e="string"==typeof n.to&&g.includes(n.to)?n.to:null;return e?`Now ${m(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,p,"exchangeRequestBody",0,function(e,t,n){let a={mode:e.mode,idempotency_key:n,origin_conversation_id:e.originConversationId,source:{agent_id:t.agentId,session_ref:t.sessionRef},instruction:e.instruction.trim()};return"continue"===e.mode&&(a.destination={agent_id:e.destinationAgentId}),a},"failureAdvice",0,function(e){if("failed"!==e.state)return null;switch(e.failure?.code){case"packet_invalid":case"packet_missing":return"The source session did not return a usable handoff. Start a new Continue with a clearer objective.";case"destination_session_invalid":return"The destination did not start a fresh session. Check its runtime, then start a new Continue.";case"destination_turn_failed":return"Check the destination Agent’s runtime, then start a new Continue from the source session.";case"source_turn_failed":return"Check the source Agent’s runtime, then start a new exchange from its Sessions.";default:return"Start a new exchange from the session to try again."}},"formatExchangeTime",0,function(e){return t(e)},"instructionHeading",0,function(e){return"ask"===e?"Question":"Objective"},"ledgerAgents",0,function(e){let t=new Map;for(let n of e)t.set(n.source.agent_id,n.source.agent_name),n.destination&&t.set(n.destination.agent_id,n.destination.agent_name);return[...t.entries()].map(([e,t])=>({id:e,name:t})).sort((e,t)=>e.name.localeCompare(t.name)||e.id.localeCompare(t.id))},"ledgerRows",0,function(e,t){return e.filter(e=>("all"===t.mode||e.mode===t.mode)&&("active"!==t.state||!e.terminal)&&("all"===t.state||"active"===t.state||e.state===t.state)&&(!t.agentId||e.source.agent_id===t.agentId||e.destination?.agent_id===t.agentId)).sort(v)},"ledgerView",0,function(e,t,n){return null===e?t?"error":"loading":0===e.length?"empty":0===n.length?"filtered-out":"rows"},"linkRoleLabel",0,function(e){let t={origin:"Started here",source:"Source session",destination:"Destination"};return e.map(e=>t[e]).join(" · ")},"liveStateLabel",0,function(e){var t;return e.cancel_requested&&(t=e.state,!f.includes(t))?"Cancelling…":m(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}: ${p(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: ${p(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 h["continue"===e?"handoff":e]},"sessionDialogUsesPin",0,function(e,t){return"resume"===e||"ask"===e&&"provider"===t},"sessionLabel",0,function(e){return`${e.source.agent_name}'s session “${e.source.session_title}”`},"sessionRowActions",0,function(e){let t;if(e.actions)t=e.actions;else{let n="ended"===e.status?{available:!1,reason:"Ask from this context and Hand off to… are unavailable: this session has ended. Its history stays here."}:e.resumable?{available:!0}:{available:!1,reason:`Ask from this context and Hand off to… are unavailable: Botmancers can’t resume this session under ${e.agent.name}’s current runtime.`},a=n.available?{available:!0}:{available:!1,code:"ended"===e.status?"session_ended":"session_not_resumable",reason:n.reason,recovery:"choose_session"};t={ask:a,resume:{available:!1,code:"action_unavailable",reason:`${h.resume} is unavailable: this runtime can’t resume a session with edits.`,recovery:"choose_action"},handoff:a}}return["ask","resume","handoff"].map(e=>({action:e,label:h[e],availability:t[e]}))},"stateTone",0,function(e){return"completed"===e?"done":"failed"===e||"cancelled"===e?"stopped":"active"},"submitErrorMessage",0,function(e,t){switch(e){case"session_ended":return"This session has ended and can’t be resumed.";case"session_not_resumable":return"Botmancers can’t resume this session under the Agent’s current runtime.";case"source_session_busy":return"This session already has an exchange in progress. Wait for it or cancel it from its card.";case"agent_unavailable":return t||"That Agent can’t launch yet. Choose its runtime connection and session scope in Config.";case"idempotency_conflict":return"This request changed while it was being sent. Send again.";case"session_missing":return"The runtime no longer has this session. Its history stays here; choose another session.";case"approval_required":return"Resume work here needs your approval of edits. Tick the approval, then send again.";case"authority_not_allowed":return t||"This Agent’s policy doesn’t allow edits in a resumed session. Change it in Config.";case"action_unavailable":return t||"This runtime can’t do that in this session. Choose another action.";case"provider_failed":return"The runtime failed this turn. Nothing moved to another session; try again later.";default:return t||"The exchange could not be started. Your draft is kept; try again."}},"threadHref",0,function(e,t){let n=new URLSearchParams;if(e.thread_agent_id){t&&n.set("exchange",t);let a=n.toString();return`/agents/${encodeURIComponent(e.thread_agent_id)}/conversations/${encodeURIComponent(e.id)}${a?`?${a}`:""}`}if("group"!==e.kind)return null;t&&n.set("exchange",t);let a=n.toString();return`/threads/${encodeURIComponent(e.id)}${a?`?${a}`:""}`},"validateDraft",0,function(e){let t={},n=e.instruction.trim(),a="ask"===e.mode?"a question":"an objective";return n?e.instruction.length>4e3&&(t.instruction="Keep it under 4000 characters."):t.instruction=`Enter ${a}.`,e.originConversationId||(t.origin="Choose the thread that follows this exchange."),"continue"!==e.mode||e.destinationAgentId||(t.destination="Choose the Agent who continues the work."),t},"validateResumeDraft",0,function(e,t){let n={};return e.trim()?e.length>4e3&&(n.instruction="Keep it under 4000 characters."):n.instruction="Enter what to work on.",t||(n.approval="Approve edits in this session to resume work here."),n}],50814)},24204,e=>{"use strict";var t=e.i(63352),n=e.i(50814);function a(e){return"active"===e.state}let s=/^T[A-Z0-9]{2,20}$/,r=/^[CG][A-Z0-9]{2,20}$/;e.s(["SHARE_DURATIONS",0,[{label:"5 minutes",seconds:300},{label:"1 hour",seconds:3600},{label:"8 hours",seconds:28800},{label:"24 hours",seconds:86400}],"SHARE_STATUS_LABELS",0,{active:"Active",exhausted:"Questions used",answering:"Answering",recovering:"Recovering",expired:"Expired",revoked:"Revoked"},"audienceInputError",0,function(e,t,n){let a=e.trim(),i=t.trim();return s.test(a)?r.test(i)?n.some(e=>e.team_id===a&&e.channel_id===i)?"That channel is already on the allowlist.":null:"Channel ID must look like C0123ABCD (a public or private channel ID; no wildcards).":"Workspace ID must look like T0123ABCD (a Slack team ID; no wildcards)."},"audienceLabel",0,function(e){return`Slack channel ${e.channel_id} \xb7 workspace ${e.team_id}`},"createdByLabel",0,function(e){return"owner"===e.created_by?"Shared by you":"current_session"===e.created_by?"Shared from a turn of this session":"Shared by a service"},"expiryLabel",0,function(e,n=Date.now()){return"revoked"===e.state?`Revoked ${(0,t.formatSessionDate)(e.revoked_at??e.expires_at)}`:"expired"===e.state||e.expires_at<=n?`Expired ${(0,t.formatSessionDate)(e.expires_at)}`:`Expires ${(0,t.formatSessionDate)(e.expires_at)} (in ${function(e){let t=Math.max(1,Math.round(e/6e4));if(t<60)return`${t} min`;let n=Math.floor(t/60),a=t%60;return a?`${n} h ${a} min`:`${n} h`}(e.expires_at-n)})`},"sessionShares",0,function(e,t){let n=e.filter(e=>e.session_ref===t);return[...n.filter(a).sort((e,t)=>t.created_at-e.created_at),...n.filter(e=>!a(e)).sort((e,t)=>(t.revoked_at??t.expires_at)-(e.revoked_at??e.expires_at))]},"shareCreateAvailability",0,function(e,t){let a=`/bots/${encodeURIComponent(e.agent.id)}/config#session-sharing`;if(!t)return{available:!1,reason:"Share to Slack is unavailable: the share policy could not be loaded.",configHref:null};let s=(0,n.sessionRowActions)(e).find(e=>"ask"===e.action);return s&&!s.availability.available?{available:!1,reason:s.availability.reason.replace(/^Ask from this context is unavailable:/,"Share to Slack is unavailable:"),configHref:null}:"invalid"===t.state?{available:!1,reason:"Share to Slack is unavailable: the share policy file is invalid. Fix it in Config.",configHref:a}:0===t.audiences.length?{available:!1,reason:"Share to Slack needs a Slack channel on the share allowlist. Add one in Config.",configHref:a}:{available:!0}},"shareCreateBody",0,function(e,t,n,a){return{audience:{team_id:e.team_id,channel_id:e.channel_id},ttl_seconds:t,max_turns:n,idempotency_key:a}},"shareFromTurnNote",0,function(e){return e.agent.share_current.supported?e.agent.share_from_turn?"On: a turn Botmancers launches for this Agent can share its own session to an allowlisted channel. Turning it off revokes every live turn context at once.":"Off: no turn of this Agent can share its own session. Sessions can still be shared from the Agent Sessions page.":e.agent.share_current.reason??"This runtime cannot share its own session from a turn."},"shareIsLive",0,a,"shareStatusNote",0,function(e){switch(e.status){case"active":return"Slack replies in its thread ask this session (read-only).";case"answering":return"A Slack question is being answered now. The next one waits until it finishes.";case"recovering":return"A question was interrupted by a Botmancers restart. The next Slack question clears it.";case"exhausted":return`All ${e.max_turns} questions are used. Slack questions get the limit notice; create a new share to keep going.`;case"expired":return"Expired: Slack questions get the expired notice. Its history stays here.";case"revoked":return"Revoked: Slack questions get the revoked notice. Its history stays here."}},"threadLabel",0,function(e){return e.thread.posted?`Slack thread posted ${(0,t.formatSessionDate)(e.thread.posted_at??0)}`:"active"===e.state?"Waiting for the Slack relay to post the thread":"No Slack thread was posted"},"turnsLabel",0,function(e){return`${e.turns_used} of ${e.max_turns} question${1===e.max_turns?"":"s"} used`}])}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|