botmancers 0.9.3 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -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 +3 -3
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/required-server-files.json +2 -2
- package/app/.next/routes-manifest.json +6 -0
- package/app/.next/server/app/_global-error.html +1 -1
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/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.js.nft.json +1 -1
- package/app/.next/server/app/agents/[id]/config/page_client-reference-manifest.js +1 -1
- 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.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.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.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.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/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-capacity/route/app-paths-manifest.json +3 -0
- package/app/.next/server/app/api/runtime-capacity/route/build-manifest.json +12 -0
- package/app/.next/server/app/api/runtime-capacity/route/server-reference-manifest.json +4 -0
- package/app/.next/server/app/api/runtime-capacity/route.js +10 -0
- package/app/.next/server/app/api/runtime-capacity/route.js.nft.json +1 -0
- package/app/.next/server/app/api/runtime-capacity/route_client-reference-manifest.js +3 -0
- 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.js.nft.json +1 -1
- package/app/.next/server/app/bots/[id]/config/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/exchanges/page.js.nft.json +1 -1
- package/app/.next/server/app/exchanges/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/exchanges.html +1 -1
- package/app/.next/server/app/exchanges.rsc +3 -3
- package/app/.next/server/app/exchanges.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/exchanges.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/exchanges.segments/exchanges/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +3 -3
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/settings/page.js.nft.json +1 -1
- package/app/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/settings.html +1 -1
- package/app/.next/server/app/settings.rsc +3 -3
- package/app/.next/server/app/settings.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/threads/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app-paths-manifest.json +1 -0
- package/app/.next/server/chunks/[externals]__06_ygwr._.js +3 -0
- package/app/.next/server/chunks/{[externals]__1eaoma8._.js → [externals]__0z3qnkl._.js} +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__0aincj4._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__0anfwiu._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__0fku-bw._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__1280ke1._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__13wghn3._.js +4 -4
- package/app/.next/server/chunks/[root-of-the-server]__1jxwu9_._.js +2 -2
- package/app/.next/server/chunks/{[root-of-the-server]__00ntari._.js → [root-of-the-server]__1nf6z4s._.js} +10 -10
- package/app/.next/server/chunks/[root-of-the-server]__1qbadul._.js +5 -0
- package/app/.next/server/chunks/_0061c2q._.js +1 -1
- package/app/.next/server/chunks/_1-5mthb._.js +1 -1
- package/app/.next/server/chunks/_1a0er16._.js +3 -3
- package/app/.next/server/chunks/_1uxmsh3._.js +3 -3
- package/app/.next/server/chunks/_next-internal_server_app_api_runtime-capacity_route_actions_1dzvg7f.js +3 -0
- package/app/.next/server/chunks/lib_service-api_ts_18eok4w._.js +3 -3
- package/app/.next/server/chunks/ssr/_00qrupp._.js +3 -0
- package/app/.next/server/chunks/ssr/_01ngpwj._.js +1 -1
- package/app/.next/server/chunks/ssr/_0d7gv3q._.js +3 -0
- package/app/.next/server/chunks/ssr/_0iywd5g._.js +1 -1
- package/app/.next/server/chunks/ssr/_0mxifu3._.js +1 -1
- package/app/.next/server/chunks/ssr/_0u7urta._.js +1 -1
- package/app/.next/server/chunks/ssr/app_agents_[id]_0sr4fdg._.js +1 -1
- package/app/.next/server/chunks/ssr/app_agents_[id]_activity_AgentActivityPage_tsx_042-590._.js +1 -1
- package/app/.next/server/chunks/ssr/app_agents_[id]_config_page_tsx_1f_gu1l._.js +1 -1
- package/app/.next/server/chunks/ssr/app_agents_[id]_sessions_page_tsx_0tfup-2._.js +3 -3
- package/app/.next/server/chunks/ssr/app_agents_[id]_slack_AgentSlackPage_tsx_20njhs1._.js +1 -1
- 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_exchange-view_ts_1a4q9ju._.js +1 -1
- package/app/.next/server/chunks/ssr/lib_share-view_ts_08psw5o._.js +1 -1
- package/app/.next/server/middleware-build-manifest.js +3 -3
- package/app/.next/server/middleware.js +2 -2
- 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/{2dtkykrnob8wk.js → 00pca1oa16xc5.js} +1 -1
- package/app/.next/static/chunks/{3x56k5qa012au.js → 0apccyvpyjlo7.js} +1 -1
- package/app/.next/static/chunks/{04nfr73lkk7pz.js → 0l9r-x310007w.js} +1 -1
- package/app/.next/static/chunks/{0eqgs3167zj2j.js → 0xo3nwo_nscvf.js} +1 -1
- package/app/.next/static/chunks/{326jto9l-m8vj.js → 0z_bq7h1mwcf3.js} +4 -4
- package/app/.next/static/chunks/18btj4qlun8o7.js +1 -0
- package/app/.next/static/chunks/{2cc4uzbhs_v23.js → 1k8e6j67zksws.js} +1 -1
- package/app/.next/static/chunks/1y9hc8qm0hqds.js +1 -0
- package/app/.next/static/chunks/{2ebpfmg4vni8e.js → 2wbcr5n_vcynr.js} +1 -1
- package/app/.next/static/chunks/3_lwv2zgy_-bw.css +3 -0
- package/app/.next/static/chunks/3a_ffnuma49te.js +1 -0
- package/app/.next/static/chunks/{3whw2-l4a2sli.js → 3fm68xa8a4-es.js} +1 -1
- package/app/.next/static/chunks/{0cjh4u-f7mlwd.js → 3gw1ytgjq4pxu.js} +1 -1
- package/app/.next/static/chunks/3wlqn3gd_jv_r.js +1 -0
- package/app/.next/static/chunks/3xjoca0z2onuc.js +1 -0
- package/app/BUILD_INFO.json +2 -2
- package/app/package.json +1 -1
- package/app/public/brand/harness/claude.svg +3 -0
- package/app/public/brand/harness/codex.png +0 -0
- package/app/public/brand/harness/cursor.svg +3 -0
- package/app/public/brand/harness/muse.svg +33 -0
- package/app/server.js +1 -1
- package/package.json +1 -1
- package/schemas/botmancers.mcp.v2.tools.json +46 -46
- package/app/.next/server/chunks/ssr/_0g3y1u9._.js +0 -3
- package/app/.next/server/chunks/ssr/app_agents_[id]_conversations_page_tsx_15zl_c8._.js +0 -3
- package/app/.next/static/chunks/10i-rrea371m2.js +0 -1
- package/app/.next/static/chunks/1ob-de9xo9m2e.css +0 -3
- package/app/.next/static/chunks/1ypwptc0fsn4w.js +0 -1
- package/app/.next/static/chunks/1zryovio86f1z.js +0 -1
- package/app/.next/static/chunks/34v8aumua0x5n.js +0 -1
- package/app/.next/static/chunks/3m-2-98qud-hf.js +0 -1
- /package/app/.next/static/{0BJMiZPkEfFOd56nhl62e → eBmHBBldHWytVvYPu0zHc}/_buildManifest.js +0 -0
- /package/app/.next/static/{0BJMiZPkEfFOd56nhl62e → eBmHBBldHWytVvYPu0zHc}/_clientMiddlewareManifest.js +0 -0
- /package/app/.next/static/{0BJMiZPkEfFOd56nhl62e → eBmHBBldHWytVvYPu0zHc}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[10014,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(71987),e=a.i(38246),f=a.i(50944),g=a.i(36391),h=a.i(60193),i=a.i(15752),j=a.i(20851),k=a.i(59807);function l(a){if(!a)return"";let b=(0,i.parseRun)(a);if(b)return(0,i.runLine)(b);let c=(0,k.classifyRuntimeFailure)(a);if(c)return c.title;let d=(0,j.agentEventDisplay)(a);return d?`${d.label} ${d.detail}`.replace(/\s+/g," ").trim():a.replace(/\s+/g," ").trim()}function m(a){return"chief-of-staff"===a.name.toLowerCase()}function n(a){return m(a)?0:a.pinned?1:2}a.s(["default",0,function({agents:a,activeAgentId:i,workingIds:k=[],beatClock:o,now:p,status:q="",logoDrop:r=!1,onAgentsChange:s,onNew:t,onManage:u,onDeleted:v,newButtonRef:w,manageButtonRef:x}){let y=(0,f.useRouter)(),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(""),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(null),J=(0,c.useRef)(null),K=(0,c.useRef)(null),L=a.filter(a=>!a.hidden).sort((a,b)=>n(a)-n(b)),M=a.filter(a=>a.hidden),N=async(b,c)=>{let d=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:b.id,...c})});if(!d.ok)return null;let e=await d.json();return s(a.map(a=>a.id===e.id?{...a,...e}:a)),e},O=(a,b=30)=>requestAnimationFrame(()=>{let c=document.querySelector(`[data-open-bot="${a}"]`);c?c.focus():b>0&&O(a,b-1)}),P=(a=!0)=>{let b=H?.returnTo;I(null),a&&b&&requestAnimationFrame(()=>{b.isConnected&&b.focus()})};(0,c.useEffect)(()=>{if(!H)return;let a=a=>{"Escape"===a.key&&(I(null),H.returnTo?.focus())},b=a=>{J.current?.contains(a.target)||I(null)};return document.addEventListener("keydown",a),document.addEventListener("pointerdown",b),()=>{document.removeEventListener("keydown",a),document.removeEventListener("pointerdown",b)}},[H]);let Q=async a=>{let b=B.trim();A(null),b&&b!==a.name&&await N(a,{name:b})},R=(a,c)=>(0,b.jsx)("input",{className:"bot-name","aria-label":`Rename ${a.name}`,value:B,autoFocus:!0,onChange:a=>C(a.target.value),onBlur:()=>{Q(a)},onKeyDown:b=>{"Enter"===b.key&&(b.preventDefault(),b.currentTarget.blur(),O(a.id)),"Escape"===b.key&&(A(null),O(a.id))},style:c}),S=(a,c)=>(0,b.jsx)("button",{type:"button",className:"bot-name row-open","data-open-bot":a.id,"aria-current":i===a.id?"true":void 0,onClick:()=>y.push(`/agents/${encodeURIComponent(a.id)}`),style:c,children:a.name}),T=a=>(0,b.jsx)("button",{type:"button",className:"row-actions","aria-haspopup":"menu","aria-expanded":H?.agent.id===a.id,"aria-label":`Actions for ${a.name}`,title:`Actions for ${a.name}`,onClick:b=>{let c=b.currentTarget.getBoundingClientRect();I({agent:a,x:c.left,y:c.bottom+4,returnTo:b.currentTarget})},children:"⋯"}),U=a=>(0,b.jsxs)("div",{className:"row-tip",children:[a.unread&&i!==a.id?(0,b.jsx)("div",{className:"card-role",children:"Unread"}):null,(0,b.jsx)("div",{className:"card-role",children:function(a,b,c,d){if(!a||!b||d-c+(b-a)>15e3)return"Stopped";let e=new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles",hour:"numeric",minute:"2-digit",second:"2-digit"}).format(new Date(a));return`Heartbeat ${e}`}(a.last_seen,o.serverNow,o.fetchedAt,p)})]}),V=(a,b)=>{a.preventDefault(),I({agent:b,x:a.clientX,y:a.clientY,returnTo:a.currentTarget.querySelector("[data-open-bot]")})},W=a=>(0,b.jsxs)("div",{className:i===a.id?"bot-row is-open":"bot-row",onContextMenu:b=>V(b,a),children:[(0,b.jsxs)("span",{className:"mark-avatar mark-avatar-sm",children:[(0,b.jsx)(g.default,{bot:a,size:40,title:`${a.name} avatar`}),k.includes(a.id)?(0,b.jsx)("span",{className:"mark-dot"}):null]}),(0,b.jsxs)("div",{className:"bot-copy",children:[z===a.id?R(a):S(a),l(a.latest)?(0,b.jsx)("div",{className:"bot-preview",children:l(a.latest)}):null,(0,b.jsx)("div",{className:"bot-runtime",title:(0,j.rosterRuntimeLine)(a),children:(0,j.rosterRuntimeLine)(a)})]}),T(a),U(a)]},a.id);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("aside",{className:"rail agent-rail",children:[(0,b.jsxs)(e.default,{href:"/",className:"brand agent-brand","aria-label":"Botmancers home",children:[(0,b.jsx)("span",{className:r?"logo-shape is-settling":"logo-shape",children:(0,b.jsx)(d.default,{src:"/brand/botmancers-logo-filled-256.png",alt:"",width:40,height:40})}),(0,b.jsx)("span",{className:"logo-word",children:"botmancers"})]}),(0,b.jsxs)("div",{className:"bar",children:[(0,b.jsx)("button",{ref:w,type:"button",className:"add-btn","aria-haspopup":"dialog",onClick:t,children:"New"}),a.length?(0,b.jsx)("button",{ref:x,type:"button",className:"add-btn","aria-haspopup":"dialog",onClick:u,children:"Manage agents"}):null,(0,b.jsx)(e.default,{className:"add-btn settings-link",href:"/settings",children:"Settings"})]}),a.length?(0,b.jsx)("nav",{className:"rail-nav","aria-label":"Workspace",children:(0,b.jsx)(e.default,{href:"/exchanges",className:"add-btn rail-nav-link",children:"Exchanges"})}):null,(0,b.jsx)("p",{className:"roster-status",role:"status",children:q}),a.length?(0,b.jsx)("div",{className:H?"roster menu-open":"roster",children:L.map(a=>m(a)?(0,b.jsxs)("div",{className:"card",onContextMenu:b=>V(b,a),children:[(0,b.jsxs)("div",{className:"row-head",children:[(0,b.jsxs)("span",{className:"mark-avatar",children:[(0,b.jsx)(g.default,{bot:a,size:48,title:`${a.name} avatar`}),k.includes(a.id)?(0,b.jsx)("span",{className:"mark-dot"}):null]}),z===a.id?R(a,{color:"#D5D0C3",fontSize:26}):S(a,{fontSize:26}),T(a)]}),l(a.latest)?(0,b.jsx)("div",{className:"bot-preview",children:l(a.latest)}):null,(0,b.jsx)("div",{className:"bot-runtime",title:(0,j.rosterRuntimeLine)(a),children:(0,j.rosterRuntimeLine)(a)}),U(a)]},a.id):W(a))}):null,M.length?(0,b.jsxs)("div",{className:H?"roster menu-open":"roster",children:[(0,b.jsx)("button",{ref:K,type:"button",className:"pin-word","aria-expanded":D,onClick:()=>E(a=>!a),children:"Hidden"}),D?M.map(W):null]}):null]}),F?(0,b.jsx)(h.default,{ids:[F.id],onCancel:()=>{O(F.id),G(null)},onDeleted:b=>{G(null),s(a.filter(a=>!b.some(b=>b.id===a.id))),v(b)}}):null,H?(0,b.jsxs)("div",{ref:J,className:"row-menu",role:"menu","aria-label":`Actions for ${H.agent.name}`,style:{left:H.x,top:H.y},onPointerDown:a=>a.stopPropagation(),onClick:a=>a.stopPropagation(),onContextMenu:a=>a.preventDefault(),onKeyDown:a=>{let b=Array.from(a.currentTarget.querySelectorAll("[role=menuitem]")),c=b.indexOf(document.activeElement),d=c=>{a.preventDefault(),b[(c+b.length)%b.length]?.focus()};"ArrowDown"===a.key?d(c+1):"ArrowUp"===a.key?d(c-1):"Home"===a.key?d(0):"End"===a.key?d(b.length-1):"Tab"===a.key&&(a.preventDefault(),P())},children:[(0,b.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,autoFocus:!0,onClick:()=>{P(),N(H.agent,{pinned:+!H.agent.pinned})},children:H.agent.pinned?"Unpin":"Pin"}),(0,b.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:()=>{P(),N(H.agent,{unread:1})},children:"Mark as Unread"}),(0,b.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:()=>{let a=H.agent;P(!1),A(a.id),C(a.name)},children:"Rename Agent"}),(0,b.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:()=>{let a=H.agent;P(!1),N(a,{hidden:+!a.hidden}).then(()=>a.hidden?O(a.id):K.current?.focus())},children:H.agent.hidden?"Unhide":"Hide from sidebar"}),(0,b.jsx)(e.default,{role:"menuitem",tabIndex:-1,href:`/agents/${H.agent.id}/config`,onClick:()=>I(null),children:"Config"}),(0,b.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:()=>{let a=H.agent;P(!1),G(a)},children:"Delete agent…"})]}):null]})}],10014)},15752,a=>{"use strict";a.s(["parseRun",0,function(a){let b,c=a.match(/^\s*\[run\]\s*([\s\S]*)$/);if(!c)return null;try{b=JSON.parse(c[1])}catch{return null}if(!b||"object"!=typeof b)return null;let d=b,e="string"==typeof d.page?d.page:"string"==typeof d.html?d.html:void 0,f=void 0===e?{}:{page:e,html:e};return"running"===d.state||"stopped"===d.state?{state:d.state,...f}:"done"===d.state&&"string"==typeof d.output?{state:"done",output:d.output,...f}:null},"runLine",0,function(a){return"done"===a.state?a.output??"":"stopped"===a.state?"The command was stopped.":"The command is running"}])},59807,a=>{"use strict";let b={error:"Error"},c=[{kind:"hermes-config-missing",severity:"error",pattern:/^\[Hermes configuration missing: [^\n]*\]$/,title:"Hermes needs configuration",recovery:"This agent can’t reply until the Hermes API key is set on the Botmancers server. Set it, restart, then send your message again."},{kind:"hermes-turn-failed",severity:"error",pattern:/^\[Hermes turn failed for [\s\S]*\]$/,title:"Hermes couldn’t complete the turn",recovery:"Check that the Hermes gateway is running and reachable, then send your message again."}];a.s(["classifyRuntimeFailure",0,function(a){let b=String(a??"").trim();if(!b)return null;let d=c.find(a=>a.pattern.test(b));return d?{kind:d.kind,severity:d.severity,title:d.title,recovery:d.recovery,detail:b}:null},"severityLabel",0,function(a){return b[a]}])},67161,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"Image",{enumerable:!0,get:function(){return v}});let d=a.r(33354),e=a.r(46058),f=a.r(87924),g=e._(a.r(72131)),h=d._(a.r(35112)),i=d._(a.r(58018)),j=a.r(94915),k=a.r(345),l=a.r(4486),m=a.r(53773),n=d._(a.r(2305)),o=a.r(8591),p={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function q(a,b,c,d,e,f,g){let h=a?.src;a&&a["data-loaded-src"]!==h&&(a["data-loaded-src"]=h,("decode"in a?a.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(a.parentElement&&a.isConnected){if("empty"!==b&&e(!0),c?.current){let b=new Event("load");Object.defineProperty(b,"target",{writable:!1,value:a});let d=!1,e=!1;c.current({...b,nativeEvent:b,currentTarget:a,target:a,isDefaultPrevented:()=>d,isPropagationStopped:()=>e,persist:()=>{},preventDefault:()=>{d=!0,b.preventDefault()},stopPropagation:()=>{e=!0,b.stopPropagation()}})}d?.current&&d.current(a)}}))}function r(a){return g.use?{fetchPriority:a}:{fetchpriority:a}}globalThis.__NEXT_IMAGE_IMPORTED=!0;let s=g.useEffect,t=(0,g.forwardRef)(({src:a,srcSet:b,sizes:c,height:d,width:e,decoding:h,className:i,style:j,fetchPriority:k,placeholder:l,loading:m,unoptimized:n,fill:p,onLoadRef:t,onLoadingCompleteRef:u,setBlurComplete:v,setShowAltText:w,sizesInput:x,onLoad:y,onError:z,...A},B)=>{let C=(0,g.useRef)(!1),D=(0,g.useRef)(null);s(()=>{let{current:a}=C,{current:b}=D;a||null===b||(z&&(b.src=b.src),b.complete&&q(b,l,t,u,v,n,x),C.current=!0)},[a,l,t,u,z,n,x]);let E=(0,o.useMergedRef)(B,D);return(0,f.jsx)("img",{...A,...r(k),loading:m,width:e,height:d,decoding:h,"data-nimg":p?"fill":"1",className:i,style:j,sizes:c,srcSet:b,src:a,ref:E,onLoad:a=>{q(a.currentTarget,l,t,u,v,n,x)},onError:a=>{w(!0),"empty"!==l&&v(!0),z&&z(a)}})});function u({isAppRouter:a,imgAttributes:b}){let c={as:"image",imageSrcSet:b.srcSet,imageSizes:b.sizes,crossOrigin:b.crossOrigin,referrerPolicy:b.referrerPolicy,...r(b.fetchPriority)};return a&&h.default.preload?(h.default.preload(b.src,c),null):(0,f.jsx)(i.default,{children:(0,f.jsx)("link",{rel:"preload",href:b.srcSet?void 0:b.src,...c},"__nimg-"+b.src+b.srcSet+b.sizes)})}let v=(0,g.forwardRef)((a,b)=>{let c=(0,g.useContext)(m.RouterContext),d=(0,g.useContext)(l.ImageConfigContext),e=(0,g.useMemo)(()=>{let a=p||d||k.imageConfigDefault,b=[...a.deviceSizes,...a.imageSizes].sort((a,b)=>a-b),c=a.deviceSizes.sort((a,b)=>a-b),e=a.qualities?.sort((a,b)=>a-b);return{...a,allSizes:b,deviceSizes:c,qualities:e,localPatterns:d?.localPatterns}},[d]),{onLoad:h,onLoadingComplete:i}=a,o=(0,g.useRef)(h);(0,g.useEffect)(()=>{o.current=h},[h]);let q=(0,g.useRef)(i);(0,g.useEffect)(()=>{q.current=i},[i]);let[r,s]=(0,g.useState)(!1),[v,w]=(0,g.useState)(!1),{props:x,meta:y}=(0,j.getImgProps)(a,{defaultLoader:n.default,imgConf:e,blurComplete:r,showAltText:v});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(t,{...x,unoptimized:y.unoptimized,placeholder:y.placeholder,fill:y.fill,onLoadRef:o,onLoadingCompleteRef:q,setBlurComplete:s,setShowAltText:w,sizesInput:a.sizes,ref:b}),y.preload?(0,f.jsx)(u,{isAppRouter:!c,imgAttributes:x}):null]})});("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},33095,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={default:function(){return k},getImageProps:function(){return j}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(33354),g=a.r(94915),h=a.r(67161),i=f._(a.r(2305));function j(a){let{props:b}=(0,g.getImgProps)(a,{defaultLoader:i.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[a,c]of Object.entries(b))void 0===c&&delete b[a];return{props:b}}let k=h.Image},71987,(a,b,c)=>{b.exports=a.r(33095)},92966,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HeadManagerContext},58018,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={default:function(){return p},defaultHead:function(){return l}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(33354),g=a.r(46058),h=a.r(87924),i=g._(a.r(72131)),j=f._(a.r(94613)),k=a.r(92966);function l(){return[(0,h.jsx)("meta",{charSet:"utf-8"},"charset"),(0,h.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function m(a,b){return"string"==typeof b||"number"==typeof b?a:b.type===i.default.Fragment?a.concat(i.default.Children.toArray(b.props.children).reduce((a,b)=>"string"==typeof b||"number"==typeof b?a:a.concat(b),[])):a.concat(b)}let n=["name","httpEquiv","charSet","itemProp"];function o(a){let b,c,d,e;return a.reduce(m,[]).reverse().concat(l().reverse()).filter((b=new Set,c=new Set,d=new Set,e={},a=>{let f=!0,g=!1;if(a.key&&"number"!=typeof a.key&&a.key.indexOf("$")>0){g=!0;let c=a.key.slice(a.key.indexOf("$")+1);b.has(c)?f=!1:b.add(c)}switch(a.type){case"title":case"base":c.has(a.type)?f=!1:c.add(a.type);break;case"meta":for(let b=0,c=n.length;b<c;b++){let c=n[b];if(a.props.hasOwnProperty(c))if("charSet"===c)d.has(c)?f=!1:d.add(c);else{let b=a.props[c],d=e[c]||new Set;("name"!==c||!g)&&d.has(b)?f=!1:(d.add(b),e[c]=d)}}}return f})).reverse().map((a,b)=>{let c=a.key||b;return i.default.cloneElement(a,{key:c})})}let p=function({children:a}){let b=(0,i.useContext)(k.HeadManagerContext);return(0,h.jsx)(j.default,{reduceComponentsToState:o,headManager:b,children:a})};("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},4486,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ImageConfigContext},53773,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.RouterContext},35444,(a,b,c)=>{"use strict";function d(a,b){let c=a||75;return b?.qualities?.length?b.qualities.reduce((a,b)=>Math.abs(b-c)<Math.abs(a-c)?b:a,b.qualities[0]):c}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"findClosestQuality",{enumerable:!0,get:function(){return d}})},2305,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return g}});let d=a.r(35444),e=a.r(68063);function f({config:a,src:b,width:c,quality:g}){let h=(0,e.getDeploymentId)();if(b.startsWith("/")&&!b.startsWith("//"))if(b.includes("/_next/static/immutable")&&!(0,e.getAssetToken)())h=void 0;else{let a=b.indexOf("?");if(-1!==a){let c=new URLSearchParams(b.slice(a+1)),d=c.get("dpl");if(d){h=d,c.delete("dpl");let e=c.toString();b=b.slice(0,a)+(e?"?"+e:"")}}}if(b.startsWith("/")&&b.includes("?")&&a.localPatterns?.length===1&&"**"===a.localPatterns[0].pathname&&""===a.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${b}" is using a query string which is not configured in images.localPatterns.
|
|
1
|
+
module.exports=[10014,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(71987),e=a.i(38246),f=a.i(50944),g=a.i(36391),h=a.i(60193),i=a.i(15752),j=a.i(20851),k=a.i(59807);function l(a){if(!a)return"";let b=(0,i.parseRun)(a);if(b)return(0,i.runLine)(b);let c=(0,k.classifyRuntimeFailure)(a);if(c)return c.title;let d=(0,j.agentEventDisplay)(a);return d?`${d.label} ${d.detail}`.replace(/\s+/g," ").trim():a.replace(/\s+/g," ").trim()}function m(a){return"chief-of-staff"===a.name.toLowerCase()}function n(a){return m(a)?0:a.pinned?1:2}a.s(["default",0,function({agents:a,activeAgentId:i,workingIds:k=[],beatClock:o,now:p,status:q="",logoDrop:r=!1,onAgentsChange:s,onNew:t,onManage:u,onDeleted:v,newButtonRef:w,manageButtonRef:x}){let y=(0,f.useRouter)(),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(""),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(null),J=(0,c.useRef)(null),K=(0,c.useRef)(null),L=a.filter(a=>!a.hidden).sort((a,b)=>n(a)-n(b)),M=a.filter(a=>a.hidden),N=async(b,c)=>{let d=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:b.id,...c})});if(!d.ok)return null;let e=await d.json();return s(a.map(a=>a.id===e.id?{...a,...e}:a)),e},O=(a,b=30)=>requestAnimationFrame(()=>{let c=document.querySelector(`[data-open-bot="${a}"]`);c?c.focus():b>0&&O(a,b-1)}),P=(a=!0)=>{let b=H?.returnTo;I(null),a&&b&&requestAnimationFrame(()=>{b.isConnected&&b.focus()})};(0,c.useEffect)(()=>{if(!H)return;let a=a=>{"Escape"===a.key&&(I(null),H.returnTo?.focus())},b=a=>{J.current?.contains(a.target)||I(null)};return document.addEventListener("keydown",a),document.addEventListener("pointerdown",b),()=>{document.removeEventListener("keydown",a),document.removeEventListener("pointerdown",b)}},[H]);let Q=async a=>{let b=B.trim();A(null),b&&b!==a.name&&await N(a,{name:b})},R=(a,c)=>(0,b.jsx)("input",{className:"bot-name","aria-label":`Rename ${a.name}`,value:B,autoFocus:!0,onChange:a=>C(a.target.value),onBlur:()=>{Q(a)},onKeyDown:b=>{"Enter"===b.key&&(b.preventDefault(),b.currentTarget.blur(),O(a.id)),"Escape"===b.key&&(A(null),O(a.id))},style:c}),S=(a,c)=>(0,b.jsx)("button",{type:"button",className:"bot-name row-open","data-open-bot":a.id,"aria-current":i===a.id?"true":void 0,onClick:()=>y.push(`/agents/${encodeURIComponent(a.id)}`),style:c,children:a.name}),T=a=>(0,b.jsx)("button",{type:"button",className:"row-actions","aria-haspopup":"menu","aria-expanded":H?.agent.id===a.id,"aria-label":`Actions for ${a.name}`,title:`Actions for ${a.name}`,onClick:b=>{let c=b.currentTarget.getBoundingClientRect();I({agent:a,x:c.left,y:c.bottom+4,returnTo:b.currentTarget})},children:"⋯"}),U=a=>(0,b.jsxs)("div",{className:"row-tip",children:[a.unread&&i!==a.id?(0,b.jsx)("div",{className:"card-role",children:"Unread"}):null,(0,b.jsx)("div",{className:"card-role",children:function(a,b,c,d){if(!a||!b||d-c+(b-a)>15e3)return"Stopped";let e=new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles",hour:"numeric",minute:"2-digit",second:"2-digit"}).format(new Date(a));return`Heartbeat ${e}`}(a.last_seen,o.serverNow,o.fetchedAt,p)})]}),V=(a,b)=>{a.preventDefault(),I({agent:b,x:a.clientX,y:a.clientY,returnTo:a.currentTarget.querySelector("[data-open-bot]")})},W=a=>(0,b.jsxs)("div",{className:i===a.id?"bot-row is-open":"bot-row",onContextMenu:b=>V(b,a),children:[(0,b.jsxs)("span",{className:"mark-avatar mark-avatar-sm",children:[(0,b.jsx)(g.default,{bot:a,size:40,title:`${a.name} avatar`}),k.includes(a.id)?(0,b.jsx)("span",{className:"mark-dot"}):null]}),(0,b.jsxs)("div",{className:"bot-copy",children:[z===a.id?R(a):S(a),l(a.latest)?(0,b.jsx)("div",{className:"bot-preview",children:l(a.latest)}):null,(0,b.jsx)("div",{className:"bot-runtime",title:(0,j.rosterRuntimeLine)(a),children:(0,j.rosterRuntimeLine)(a)})]}),T(a),U(a)]},a.id);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("aside",{className:"rail agent-rail",children:[(0,b.jsxs)(e.default,{href:"/",className:"brand agent-brand","aria-label":"Botmancers home",children:[(0,b.jsx)("span",{className:r?"logo-shape is-settling":"logo-shape",children:(0,b.jsx)(d.default,{src:"/brand/botmancers-logo-filled-256.png",alt:"",width:40,height:40})}),(0,b.jsx)("span",{className:"logo-word",children:"botmancers"})]}),(0,b.jsxs)("div",{className:"bar",children:[(0,b.jsx)("button",{ref:w,type:"button",className:"add-btn","aria-haspopup":"dialog",onClick:t,children:"New"}),a.length?(0,b.jsx)("button",{ref:x,type:"button",className:"add-btn","aria-haspopup":"dialog",onClick:u,children:"Manage agents"}):null,(0,b.jsx)(e.default,{className:"add-btn settings-link",href:"/settings",children:"Settings"})]}),a.length?(0,b.jsx)("nav",{className:"rail-nav","aria-label":"Workspace",children:(0,b.jsx)(e.default,{href:"/exchanges",className:"add-btn rail-nav-link",children:"Exchanges"})}):null,(0,b.jsx)("p",{className:"roster-status",role:"status",children:q}),a.length?(0,b.jsx)("div",{className:H?"roster menu-open":"roster",children:L.map(a=>m(a)?(0,b.jsxs)("div",{className:"card",onContextMenu:b=>V(b,a),children:[(0,b.jsxs)("div",{className:"row-head",children:[(0,b.jsxs)("span",{className:"mark-avatar",children:[(0,b.jsx)(g.default,{bot:a,size:48,title:`${a.name} avatar`}),k.includes(a.id)?(0,b.jsx)("span",{className:"mark-dot"}):null]}),z===a.id?R(a,{color:"#D5D0C3",fontSize:26}):S(a,{fontSize:26}),T(a)]}),l(a.latest)?(0,b.jsx)("div",{className:"bot-preview",children:l(a.latest)}):null,(0,b.jsx)("div",{className:"bot-runtime",title:(0,j.rosterRuntimeLine)(a),children:(0,j.rosterRuntimeLine)(a)}),U(a)]},a.id):W(a))}):null,M.length?(0,b.jsxs)("div",{className:H?"roster menu-open":"roster",children:[(0,b.jsx)("button",{ref:K,type:"button",className:"pin-word","aria-expanded":D,onClick:()=>E(a=>!a),children:"Hidden"}),D?M.map(W):null]}):null]}),F?(0,b.jsx)(h.default,{ids:[F.id],onCancel:()=>{O(F.id),G(null)},onDeleted:b=>{G(null),s(a.filter(a=>!b.some(b=>b.id===a.id))),v(b)}}):null,H?(0,b.jsxs)("div",{ref:J,className:"row-menu",role:"menu","aria-label":`Actions for ${H.agent.name}`,style:{left:H.x,top:H.y},onPointerDown:a=>a.stopPropagation(),onClick:a=>a.stopPropagation(),onContextMenu:a=>a.preventDefault(),onKeyDown:a=>{let b=Array.from(a.currentTarget.querySelectorAll("[role=menuitem]")),c=b.indexOf(document.activeElement),d=c=>{a.preventDefault(),b[(c+b.length)%b.length]?.focus()};"ArrowDown"===a.key?d(c+1):"ArrowUp"===a.key?d(c-1):"Home"===a.key?d(0):"End"===a.key?d(b.length-1):"Tab"===a.key&&(a.preventDefault(),P())},children:[(0,b.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,autoFocus:!0,onClick:()=>{P(),N(H.agent,{pinned:+!H.agent.pinned})},children:H.agent.pinned?"Unpin":"Pin"}),(0,b.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:()=>{P(),N(H.agent,{unread:1})},children:"Mark as Unread"}),(0,b.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:()=>{let a=H.agent;P(!1),A(a.id),C(a.name)},children:"Rename agent"}),(0,b.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:()=>{let a=H.agent;P(!1),N(a,{hidden:+!a.hidden}).then(()=>a.hidden?O(a.id):K.current?.focus())},children:H.agent.hidden?"Unhide":"Hide from sidebar"}),(0,b.jsx)(e.default,{role:"menuitem",tabIndex:-1,href:`/agents/${H.agent.id}/config`,onClick:()=>I(null),children:"Config"}),(0,b.jsx)("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:()=>{let a=H.agent;P(!1),G(a)},children:"Delete agent…"})]}):null]})}],10014)},15752,a=>{"use strict";a.s(["parseRun",0,function(a){let b,c=a.match(/^\s*\[run\]\s*([\s\S]*)$/);if(!c)return null;try{b=JSON.parse(c[1])}catch{return null}if(!b||"object"!=typeof b)return null;let d=b,e="string"==typeof d.page?d.page:"string"==typeof d.html?d.html:void 0,f=void 0===e?{}:{page:e,html:e};return"running"===d.state||"stopped"===d.state?{state:d.state,...f}:"done"===d.state&&"string"==typeof d.output?{state:"done",output:d.output,...f}:null},"runLine",0,function(a){return"done"===a.state?a.output??"":"stopped"===a.state?"The command was stopped.":"The command is running"}])},59807,a=>{"use strict";let b={error:"Error"},c=[{kind:"hermes-config-missing",severity:"error",pattern:/^\[Hermes configuration missing: [^\n]*\]$/,title:"Hermes needs configuration",recovery:"This agent can’t reply until the Hermes API key is set on the Botmancers server. Set it, restart, then send your message again."},{kind:"hermes-turn-failed",severity:"error",pattern:/^\[Hermes turn failed for [\s\S]*\]$/,title:"Hermes couldn’t complete the turn",recovery:"Check that the Hermes gateway is running and reachable, then send your message again."}];a.s(["classifyRuntimeFailure",0,function(a){let b=String(a??"").trim();if(!b)return null;let d=c.find(a=>a.pattern.test(b));return d?{kind:d.kind,severity:d.severity,title:d.title,recovery:d.recovery,detail:b}:null},"severityLabel",0,function(a){return b[a]}])},67161,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"Image",{enumerable:!0,get:function(){return v}});let d=a.r(33354),e=a.r(46058),f=a.r(87924),g=e._(a.r(72131)),h=d._(a.r(35112)),i=d._(a.r(58018)),j=a.r(94915),k=a.r(345),l=a.r(4486),m=a.r(53773),n=d._(a.r(2305)),o=a.r(8591),p={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function q(a,b,c,d,e,f,g){let h=a?.src;a&&a["data-loaded-src"]!==h&&(a["data-loaded-src"]=h,("decode"in a?a.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(a.parentElement&&a.isConnected){if("empty"!==b&&e(!0),c?.current){let b=new Event("load");Object.defineProperty(b,"target",{writable:!1,value:a});let d=!1,e=!1;c.current({...b,nativeEvent:b,currentTarget:a,target:a,isDefaultPrevented:()=>d,isPropagationStopped:()=>e,persist:()=>{},preventDefault:()=>{d=!0,b.preventDefault()},stopPropagation:()=>{e=!0,b.stopPropagation()}})}d?.current&&d.current(a)}}))}function r(a){return g.use?{fetchPriority:a}:{fetchpriority:a}}globalThis.__NEXT_IMAGE_IMPORTED=!0;let s=g.useEffect,t=(0,g.forwardRef)(({src:a,srcSet:b,sizes:c,height:d,width:e,decoding:h,className:i,style:j,fetchPriority:k,placeholder:l,loading:m,unoptimized:n,fill:p,onLoadRef:t,onLoadingCompleteRef:u,setBlurComplete:v,setShowAltText:w,sizesInput:x,onLoad:y,onError:z,...A},B)=>{let C=(0,g.useRef)(!1),D=(0,g.useRef)(null);s(()=>{let{current:a}=C,{current:b}=D;a||null===b||(z&&(b.src=b.src),b.complete&&q(b,l,t,u,v,n,x),C.current=!0)},[a,l,t,u,z,n,x]);let E=(0,o.useMergedRef)(B,D);return(0,f.jsx)("img",{...A,...r(k),loading:m,width:e,height:d,decoding:h,"data-nimg":p?"fill":"1",className:i,style:j,sizes:c,srcSet:b,src:a,ref:E,onLoad:a=>{q(a.currentTarget,l,t,u,v,n,x)},onError:a=>{w(!0),"empty"!==l&&v(!0),z&&z(a)}})});function u({isAppRouter:a,imgAttributes:b}){let c={as:"image",imageSrcSet:b.srcSet,imageSizes:b.sizes,crossOrigin:b.crossOrigin,referrerPolicy:b.referrerPolicy,...r(b.fetchPriority)};return a&&h.default.preload?(h.default.preload(b.src,c),null):(0,f.jsx)(i.default,{children:(0,f.jsx)("link",{rel:"preload",href:b.srcSet?void 0:b.src,...c},"__nimg-"+b.src+b.srcSet+b.sizes)})}let v=(0,g.forwardRef)((a,b)=>{let c=(0,g.useContext)(m.RouterContext),d=(0,g.useContext)(l.ImageConfigContext),e=(0,g.useMemo)(()=>{let a=p||d||k.imageConfigDefault,b=[...a.deviceSizes,...a.imageSizes].sort((a,b)=>a-b),c=a.deviceSizes.sort((a,b)=>a-b),e=a.qualities?.sort((a,b)=>a-b);return{...a,allSizes:b,deviceSizes:c,qualities:e,localPatterns:d?.localPatterns}},[d]),{onLoad:h,onLoadingComplete:i}=a,o=(0,g.useRef)(h);(0,g.useEffect)(()=>{o.current=h},[h]);let q=(0,g.useRef)(i);(0,g.useEffect)(()=>{q.current=i},[i]);let[r,s]=(0,g.useState)(!1),[v,w]=(0,g.useState)(!1),{props:x,meta:y}=(0,j.getImgProps)(a,{defaultLoader:n.default,imgConf:e,blurComplete:r,showAltText:v});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(t,{...x,unoptimized:y.unoptimized,placeholder:y.placeholder,fill:y.fill,onLoadRef:o,onLoadingCompleteRef:q,setBlurComplete:s,setShowAltText:w,sizesInput:a.sizes,ref:b}),y.preload?(0,f.jsx)(u,{isAppRouter:!c,imgAttributes:x}):null]})});("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},33095,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={default:function(){return k},getImageProps:function(){return j}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(33354),g=a.r(94915),h=a.r(67161),i=f._(a.r(2305));function j(a){let{props:b}=(0,g.getImgProps)(a,{defaultLoader:i.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[a,c]of Object.entries(b))void 0===c&&delete b[a];return{props:b}}let k=h.Image},71987,(a,b,c)=>{b.exports=a.r(33095)},92966,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.HeadManagerContext},58018,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={default:function(){return p},defaultHead:function(){return l}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(33354),g=a.r(46058),h=a.r(87924),i=g._(a.r(72131)),j=f._(a.r(94613)),k=a.r(92966);function l(){return[(0,h.jsx)("meta",{charSet:"utf-8"},"charset"),(0,h.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function m(a,b){return"string"==typeof b||"number"==typeof b?a:b.type===i.default.Fragment?a.concat(i.default.Children.toArray(b.props.children).reduce((a,b)=>"string"==typeof b||"number"==typeof b?a:a.concat(b),[])):a.concat(b)}let n=["name","httpEquiv","charSet","itemProp"];function o(a){let b,c,d,e;return a.reduce(m,[]).reverse().concat(l().reverse()).filter((b=new Set,c=new Set,d=new Set,e={},a=>{let f=!0,g=!1;if(a.key&&"number"!=typeof a.key&&a.key.indexOf("$")>0){g=!0;let c=a.key.slice(a.key.indexOf("$")+1);b.has(c)?f=!1:b.add(c)}switch(a.type){case"title":case"base":c.has(a.type)?f=!1:c.add(a.type);break;case"meta":for(let b=0,c=n.length;b<c;b++){let c=n[b];if(a.props.hasOwnProperty(c))if("charSet"===c)d.has(c)?f=!1:d.add(c);else{let b=a.props[c],d=e[c]||new Set;("name"!==c||!g)&&d.has(b)?f=!1:(d.add(b),e[c]=d)}}}return f})).reverse().map((a,b)=>{let c=a.key||b;return i.default.cloneElement(a,{key:c})})}let p=function({children:a}){let b=(0,i.useContext)(k.HeadManagerContext);return(0,h.jsx)(j.default,{reduceComponentsToState:o,headManager:b,children:a})};("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},4486,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.ImageConfigContext},53773,(a,b,c)=>{"use strict";b.exports=a.r(42602).vendored.contexts.RouterContext},35444,(a,b,c)=>{"use strict";function d(a,b){let c=a||75;return b?.qualities?.length?b.qualities.reduce((a,b)=>Math.abs(b-c)<Math.abs(a-c)?b:a,b.qualities[0]):c}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"findClosestQuality",{enumerable:!0,get:function(){return d}})},2305,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return g}});let d=a.r(35444),e=a.r(68063);function f({config:a,src:b,width:c,quality:g}){let h=(0,e.getDeploymentId)();if(b.startsWith("/")&&!b.startsWith("//"))if(b.includes("/_next/static/immutable")&&!(0,e.getAssetToken)())h=void 0;else{let a=b.indexOf("?");if(-1!==a){let c=new URLSearchParams(b.slice(a+1)),d=c.get("dpl");if(d){h=d,c.delete("dpl");let e=c.toString();b=b.slice(0,a)+(e?"?"+e:"")}}}if(b.startsWith("/")&&b.includes("?")&&a.localPatterns?.length===1&&"**"===a.localPatterns[0].pathname&&""===a.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${b}" is using a query string which is not configured in images.localPatterns.
|
|
2
2
|
Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let i=(0,d.findClosestQuality)(g,a);return`${a.path}?url=${encodeURIComponent(b)}&w=${c}&q=${i}${b.startsWith("/")&&h?`&dpl=${h}`:""}`}f.__next_img_default=!0;let g=f},4987,(a,b,c)=>{"use strict";function d({widthInt:a,heightInt:b,blurWidth:c,blurHeight:e,blurDataURL:f,objectFit:g}){let h=c?40*c:a,i=e?40*e:b,j=h&&i?`viewBox='0 0 ${h} ${i}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${j}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${j?"none":"contain"===g?"xMidYMid":"cover"===g?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${f}'/%3E%3C/svg%3E`}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"getImageBlurSvg",{enumerable:!0,get:function(){return d}})},345,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={VALID_LOADERS:function(){return f},imageConfigDefault:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=["default","imgix","cloudinary","akamai","custom"],g={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},94915,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"getImgProps",{enumerable:!0,get:function(){return j}});let d=a.r(68063),e=a.r(4987),f=a.r(345),g=["-moz-initial","fill","none","scale-down",void 0];function h(a){return void 0!==a.default}function i(a){return void 0===a?a:"number"==typeof a?Number.isFinite(a)?a:NaN:"string"==typeof a&&/^[0-9]+$/.test(a)?parseInt(a,10):NaN}function j({src:a,sizes:b,unoptimized:c=!1,priority:k=!1,preload:l=!1,loading:m,className:n,quality:o,width:p,height:q,fill:r=!1,style:s,overrideSrc:t,onLoad:u,onLoadingComplete:v,placeholder:w="empty",blurDataURL:x,fetchPriority:y,decoding:z="async",layout:A,objectFit:B,objectPosition:C,lazyBoundary:D,lazyRoot:E,...F},G){var H;let I,J,K,{imgConf:L,showAltText:M,blurComplete:N,defaultLoader:O}=G,P=L||f.imageConfigDefault;if("allSizes"in P)I=P;else{let a=[...P.deviceSizes,...P.imageSizes].sort((a,b)=>a-b),b=P.deviceSizes.sort((a,b)=>a-b),c=P.qualities?.sort((a,b)=>a-b);I={...P,allSizes:a,deviceSizes:b,qualities:c}}if(void 0===O)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let Q=F.loader||O;delete F.loader,delete F.srcSet;let R="__next_img_default"in Q;if(R){if("custom"===I.loader)throw Object.defineProperty(Error(`Image with src "${a}" is missing "loader" prop.
|
|
3
3
|
Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let a=Q;Q=b=>{let{config:c,...d}=b;return a(d)}}if(A){"fill"===A&&(r=!0);let a={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[A];a&&(s={...s,...a});let c={responsive:"100vw",fill:"100vw"}[A];c&&!b&&(b=c)}let S="",T=i(p),U=i(q);if((H=a)&&"object"==typeof H&&(h(H)||void 0!==H.src)){let b=h(a)?a.default:a;if(!b.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(b)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!b.height||!b.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(b)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(J=b.blurWidth,K=b.blurHeight,x=x||b.blurDataURL,S=b.src,!r)if(T||U){if(T&&!U){let a=T/b.width;U=Math.round(b.height*a)}else if(!T&&U){let a=U/b.height;T=Math.round(b.width*a)}}else T=b.width,U=b.height}let V=!k&&!l&&("lazy"===m||void 0===m);(!(a="string"==typeof a?a:S)||a.startsWith("data:")||a.startsWith("blob:"))&&(c=!0,V=!1),I.unoptimized&&(c=!0),R&&!I.dangerouslyAllowSVG&&a.split("?",1)[0].endsWith(".svg")&&(c=!0);let W=i(o),X=Object.assign(r?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:B,objectPosition:C}:{},M?{}:{color:"transparent"},s),Y=N||"empty"===w?null:"blur"===w?`url("data:image/svg+xml;charset=utf-8,${(0,e.getImageBlurSvg)({widthInt:T,heightInt:U,blurWidth:J,blurHeight:K,blurDataURL:x||"",objectFit:X.objectFit})}")`:`url("${w}")`,Z=g.includes(X.objectFit)?"fill"===X.objectFit?"100% 100%":"cover":X.objectFit,$=Y?{backgroundSize:Z,backgroundPosition:X.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:Y}:{},_=function({config:a,src:b,unoptimized:c,width:e,quality:f,sizes:g,loader:h}){if(c){if(b.startsWith("/")&&!b.startsWith("//")){let a=(0,d.getDeploymentId)();if(b.includes("/_next/static/immutable")&&!(0,d.getAssetToken)())a=void 0;else if(a){let c=b.indexOf("?");if(-1!==c){let d=new URLSearchParams(b.slice(c+1));d.get("dpl")||(d.append("dpl",a),b=b.slice(0,c)+"?"+d.toString())}else b+=`?dpl=${a}`}}return{src:b,srcSet:void 0,sizes:void 0}}let{widths:i,kind:j}=function({deviceSizes:a,allSizes:b},c,d){if(d){let c=/(^|\s)(1?\d?\d)vw/g,e=[];for(let a;a=c.exec(d);)e.push(parseInt(a[2]));if(e.length){let c=.01*Math.min(...e);return{widths:b.filter(b=>b>=a[0]*c),kind:"w"}}return{widths:b,kind:"w"}}return"number"!=typeof c?{widths:a,kind:"w"}:{widths:[...new Set([c,2*c].map(a=>b.find(b=>b>=a)||b[b.length-1]))],kind:"x"}}(a,e,g),k=i.length-1;return{sizes:g||"w"!==j?g:"100vw",srcSet:i.map((c,d)=>`${h({config:a,src:b,quality:f,width:c})} ${"w"===j?c:d+1}${j}`).join(", "),src:h({config:a,src:b,quality:f,width:i[k]})}}({config:I,src:a,unoptimized:c,width:T,quality:W,sizes:b,loader:Q}),aa=V?"lazy":m;return{props:{...F,loading:aa,fetchPriority:y,width:T,height:U,decoding:z,className:n,style:{...X,...$},sizes:_.sizes,srcSet:_.srcSet,src:t||_.src},meta:{unoptimized:c,preload:l||k,placeholder:w,fill:r}}}},94613,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return f}});let d=a.r(72131),e=()=>{};function f(a){let{headManager:b,reduceComponentsToState:c}=a;return b?.mountedInstances?.add(a.children),function(){if(b&&b.mountedInstances){let a=d.Children.toArray(Array.from(b.mountedInstances).filter(Boolean));b.updateHead(c(a))}}(),e(),e(),null}}];
|
|
4
4
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[10932,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(72131),e=a.i(15722);let f=[{value:"all",label:"All"},{value:"sessions",label:"Sessions"},{value:"conversations",label:"Conversations & exchanges"},{value:"slack",label:"Slack"},{value:"errors",label:"Errors"}],g={filter:"all",requestKey:"",activity:{state:"loading"},nextCursor:null,loadingMore:!1};function h(a,b){return"select_filter"===b.type?{...a,filter:b.filter,requestKey:"",activity:{state:"loading"},nextCursor:null,loadingMore:!1}:"request_started"===b.type?{...a,requestKey:b.key,activity:{state:"loading"},nextCursor:null,loadingMore:!1}:"request_succeeded"===b.type?b.key===a.requestKey?{...a,activity:{state:"ready",items:b.items},nextCursor:b.nextCursor}:a:"request_failed"===b.type?b.key===a.requestKey?{...a,activity:{state:"error"},nextCursor:null}:a:"load_started"===b.type?b.key===a.requestKey?{...a,loadingMore:!0}:a:"load_succeeded"===b.type&&b.key===a.requestKey&&"ready"===a.activity.state?{...a,activity:{state:"ready",items:[...a.activity.items,...b.items]},nextCursor:b.nextCursor,loadingMore:!1}:"load_failed"===b.type&&b.key===a.requestKey?{...a,activity:{state:"error"},nextCursor:null,loadingMore:!1}:a}function i(a,b,c=null){let d=new URLSearchParams({filter:b,limit:String(20)});return c&&d.set("cursor",c),`/api/bots/${encodeURIComponent(a)}/activity?${d.toString()}`}function j({items:a,compact:d=!1}){return(0,b.jsx)("ol",{className:d?"agent-activity-list is-compact":"agent-activity-list","aria-label":"Agent activity, newest first",children:a.map(a=>(0,b.jsxs)("li",{className:`agent-activity-item is-${a.severity}`,"data-activity-kind":a.kind,children:[(0,b.jsx)("span",{className:"agent-activity-marker","aria-hidden":"true"}),(0,b.jsxs)("div",{className:"agent-activity-card",children:[(0,b.jsxs)("div",{className:"agent-activity-summary",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"agent-activity-category",children:"conversations"===a.category?"Conversations & exchanges":a.category}),(0,b.jsx)("strong",{children:a.summary}),(0,b.jsx)("time",{dateTime:new Date(a.occurred_at).toISOString(),children:new Date(a.occurred_at).toLocaleString()})]}),a.attention?(0,b.jsx)("span",{className:"agent-activity-attention",children:"Needs attention"}):null]}),(0,b.jsx)("div",{className:"agent-activity-actions",children:(0,b.jsx)(c.default,{href:a.target.href,children:a.target.label})}),!d&&Object.keys(a.details).length?(0,b.jsxs)("details",{className:"agent-activity-details",children:[(0,b.jsx)("summary",{children:"Raw details"}),(0,b.jsx)("dl",{children:Object.entries(a.details).map(([a,c])=>(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{children:a.replaceAll("_"," ")}),(0,b.jsx)("dd",{children:(0,b.jsx)("code",{children:String(c)})})]},a))}),(0,b.jsx)("p",{children:"Safe structured fields only. Provider transcripts and identifiers are excluded."})]}):null]})]},a.id))})}function k({activity:a,filter:c,nextCursor:d,loadingMore:e,onLoadMore:g}){return(0,b.jsxs)(b.Fragment,{children:["loading"===a.state?(0,b.jsx)("p",{className:"agent-activity-state",role:"status",children:"Loading activity…"}):null,"error"===a.state?(0,b.jsxs)("div",{className:"agent-activity-state is-error",role:"alert",children:[(0,b.jsx)("strong",{children:"Activity unavailable"}),(0,b.jsx)("p",{children:"No partial or stale timeline is shown. Refresh to try again."})]}):null,"ready"!==a.state||a.items.length?null:(0,b.jsx)("p",{className:"agent-activity-state",children:"all"===c?"No operational activity has been recorded for this Agent yet.":`No ${f.find(a=>a.value===c)?.label.toLowerCase()} activity matches this filter.`}),"ready"===a.state&&a.items.length?(0,b.jsx)(j,{items:a.items}):null,"ready"===a.state&&d?(0,b.jsx)("button",{type:"button",className:"agent-activity-more",onClick:g,disabled:e,children:e?"Loading…":"Load older activity"}):null]})}a.s(["ActivityList",0,j,"ActivityResults",0,k,"activityPageReducer",0,h,"agentActivityUrl",0,i,"default",0,function(){let{id:a,overview:j,loading:l,error:m,notFound:n}=(0,e.useAgentOverview)(),[o,p]=(0,d.useReducer)(h,g),{filter:q,activity:r,nextCursor:s,loadingMore:t}=o,u=(0,d.useRef)(0),v=(0,d.useCallback)((b=null)=>i(a,q,b),[q,a]);(0,d.useEffect)(()=>{let b=!1,c=++u.current,d=`${a}:${q}:${c}`;return p({type:"request_started",key:d}),fetch(v(),{cache:"no-store"}).then(async a=>{let e=await a.json().catch(()=>null);if(!a.ok||!Array.isArray(e?.activity))throw Error("activity");b||c!==u.current||p({type:"request_succeeded",key:d,items:e.activity,nextCursor:"string"==typeof e.next_cursor?e.next_cursor:null})}).catch(()=>{b||c!==u.current||p({type:"request_failed",key:d})}),()=>{b=!0}},[q,a,v]);let w=async()=>{if(!s||"ready"!==r.state||t)return;let a=o.requestKey;p({type:"load_started",key:a});try{let b=await fetch(v(s),{cache:"no-store"}),c=await b.json().catch(()=>null);if(!b.ok||!Array.isArray(c?.activity))throw Error("activity");p({type:"load_succeeded",key:a,items:c.activity,nextCursor:"string"==typeof c.next_cursor?c.next_cursor:null})}catch{p({type:"load_failed",key:a})}};return l?(0,b.jsx)("div",{className:"agent-state",role:"status",children:"Loading Agent activity…"}):n?(0,b.jsxs)("div",{className:"agent-state",children:[(0,b.jsx)("h2",{children:"Agent not found"}),(0,b.jsx)(c.default,{href:"/",children:"Choose an Agent"})]}):m||!j?(0,b.jsxs)("div",{className:"agent-state",role:"alert",children:[(0,b.jsx)("h2",{children:"Activity unavailable"}),(0,b.jsx)("p",{children:"Botmancers could not load this Agent."})]}):(0,b.jsxs)("div",{className:"agent-activity","data-agent-activity-page":!0,children:[(0,b.jsxs)("header",{className:"agent-activity-intro",children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Activity"}),(0,b.jsxs)("h2",{children:["What changed for ",j.agent.name]}),(0,b.jsx)("p",{children:"Operational history from Botmancers records. Open the owning page for actions and complete detail."})]}),(0,b.jsx)("div",{className:"agent-activity-filters",role:"group","aria-label":"Filter Agent activity",children:f.map(a=>(0,b.jsx)("button",{type:"button","aria-pressed":q===a.value,onClick:()=>p({type:"select_filter",filter:a.value}),children:a.label},a.value))}),(0,b.jsx)(k,{activity:r,filter:q,nextCursor:s,loadingMore:t,onLoadMore:()=>{w()}})]})},"initialActivityPageState",0,g],10932)},88204,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(15722),f=a.i(22151),g=a.i(10932);let h="botmancers setup --client cursor";function i(){let[a,d]=(0,c.useState)(!1);return(0,b.jsx)("button",{type:"button",className:"agent-primary-action",onClick:async()=>{try{await navigator.clipboard.writeText(h),d(!0),window.setTimeout(()=>d(!1),1600)}catch{d(!1)}},children:a?"Copied":"Copy setup command"})}function j({rows:a,empty:c}){return a.length?(0,b.jsx)("ul",{className:"agent-work-list",children:a.map(a=>(0,b.jsx)("li",{children:(0,b.jsxs)("span",{children:[(0,b.jsx)("strong",{children:a.title}),(0,b.jsxs)("small",{children:["active"===a.status?"Active now":"Recent"," · ",new Date(a.last_activity_at).toLocaleString()]})]})},a.ref))}):(0,b.jsx)("p",{className:"agent-empty",children:c})}a.s(["default",0,function(){let{id:a,overview:c,loading:k,error:l,notFound:m}=(0,e.useAgentOverview)();if(k)return(0,b.jsx)("div",{className:"agent-state",role:"status",children:"Loading Agent overview…"});if(m)return(0,b.jsxs)("div",{className:"agent-state",children:[(0,b.jsx)("h2",{children:"Agent not found"}),(0,b.jsx)("p",{children:"This Agent does not exist or was removed."}),(0,b.jsx)(d.default,{href:"/",children:"Choose an Agent"})]});if(l||!c)return(0,b.jsxs)("div",{className:"agent-state",role:"alert",children:[(0,b.jsx)("h2",{children:"Overview unavailable"}),(0,b.jsx)("p",{children:"Botmancers could not load this Agent. Refresh to try again."})]});let n=`/agents/${encodeURIComponent(a)}/config`,o=c.conversation?`/agents/${encodeURIComponent(a)}/conversations/${encodeURIComponent(c.conversation.id)}`:`/agents/${encodeURIComponent(a)}/conversations`,p=c.messaging.home_session_ref?"Home session configured":c.messaging.new_sessions_allowed&&c.messaging.default_workspace_set?"Can start a configured session":c.current_work.length>0?"Uses an eligible existing session":"No ready session is known";return(0,b.jsxs)("div",{className:"agent-overview","data-agent-overview":!0,children:[(0,b.jsxs)("div",{className:"agent-overview-grid",children:[(0,b.jsxs)("section",{className:"agent-panel agent-instructions",children:[(0,b.jsxs)("div",{className:"agent-panel-head",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Standing instructions"}),(0,b.jsx)("h2",{children:"How this Agent works"})]}),(0,b.jsx)(d.default,{href:n,children:"Config"})]}),(0,b.jsxs)("dl",{children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{children:"Rules"}),(0,b.jsx)("dd",{children:c.instructions.rules})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{children:"Skill"}),(0,b.jsx)("dd",{children:c.instructions.skill})]})]})]}),(0,b.jsxs)("section",{className:"agent-panel",children:[(0,b.jsxs)("div",{className:"agent-panel-head",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Runtime"}),(0,b.jsx)("h2",{children:c.runtime.available?"Ready to work":"Setup required"})]}),(0,b.jsx)(d.default,{href:n,children:"Config"})]}),(0,b.jsx)("p",{children:c.runtime.available?`${(0,f.agentLabel)(c.runtime.agent)} is connected through ${c.runtime.connection||"the configured runtime"}.`:"This Agent cannot launch with its current registration. Open Config to resolve the connection or session scope."}),(0,b.jsxs)("dl",{className:"agent-runtime-facts",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{children:"Heartbeat"}),(0,b.jsx)("dd",{children:c.runtime.last_seen?new Date(c.runtime.last_seen).toLocaleString():"Not reported"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{children:"Messaging"}),(0,b.jsx)("dd",{children:p})]})]}),(0,b.jsx)("p",{className:"agent-muted",children:"Messages use the Agent’s configured home session or launch policy. Callers do not choose its runtime, model, or provider session."})]})]}),(0,b.jsxs)("section",{className:"agent-use","aria-labelledby":"open-this-agent",children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Open this Agent"}),(0,b.jsx)("h2",{id:"open-this-agent",children:"Make it reachable"}),(0,b.jsxs)("div",{className:"agent-use-grid",children:[(0,b.jsxs)("article",{children:[(0,b.jsx)("span",{className:"agent-use-number",children:"01"}),(0,b.jsx)("h3",{children:"Use from a coding agent"}),(0,b.jsxs)("p",{children:["Let another coding agent discover ",c.agent.name," and ask its sessions — so work learned here can travel between agents."]}),(0,b.jsx)("p",{className:"agent-muted",children:"One command connects the client to the bridge and installs the collaboration skill:"}),(0,b.jsx)("pre",{className:"agent-setup-command",children:(0,b.jsx)("code",{children:h})}),(0,b.jsx)(i,{}),(0,b.jsxs)("p",{className:"agent-muted",children:["Swap ",(0,b.jsx)("code",{children:"cursor"})," for ",(0,b.jsx)("code",{children:"codex"})," or ",(0,b.jsx)("code",{children:"claude"}),"."]})]}),(0,b.jsxs)("article",{children:[(0,b.jsx)("span",{className:"agent-use-number",children:"02"}),(0,b.jsx)("h3",{children:"Share a session to Slack"}),(0,b.jsx)("p",{children:"Open one of this Agent’s sessions to people in Slack — a time-limited, read-only share so others can ask what the session already knows."}),(0,b.jsx)(d.default,{href:`/agents/${encodeURIComponent(a)}/slack`,children:"Share through Slack"})]}),(0,b.jsxs)("article",{children:[(0,b.jsx)("span",{className:"agent-use-number",children:"03"}),(0,b.jsx)("h3",{children:"Message in Botmancers"}),(0,b.jsxs)("p",{children:["Talk directly with ",c.agent.name," in a focused conversation when you are the one asking."]}),(0,b.jsx)(d.default,{href:o,children:"Open conversation"})]})]})]}),(0,b.jsxs)("div",{className:"agent-overview-grid agent-work-grid",children:[(0,b.jsxs)("section",{className:"agent-panel",children:[(0,b.jsxs)("div",{className:"agent-panel-head",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Current work"}),(0,b.jsx)("h2",{children:"Active sessions"})]}),(0,b.jsx)(d.default,{href:`/agents/${encodeURIComponent(a)}/sessions`,children:"All sessions"})]}),(0,b.jsx)(j,{rows:c.current_work,empty:"No active work right now."})]}),(0,b.jsxs)("section",{className:"agent-panel",children:[(0,b.jsxs)("div",{className:"agent-panel-head",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Recent activity"}),(0,b.jsx)("h2",{children:"Latest work"})]}),(0,b.jsx)(d.default,{href:`/agents/${encodeURIComponent(a)}/activity`,children:"View activity"})]}),c.recent_activity.length?(0,b.jsx)(g.ActivityList,{items:c.recent_activity,compact:!0}):(0,b.jsx)("p",{className:"agent-empty",children:"No operational activity yet."})]})]})]})}])}];
|
|
1
|
+
module.exports=[10932,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(72131),e=a.i(15722);let f=[{value:"all",label:"All"},{value:"sessions",label:"Sessions"},{value:"conversations",label:"Conversations & exchanges"},{value:"slack",label:"Slack"},{value:"errors",label:"Errors"}],g={filter:"all",requestKey:"",activity:{state:"loading"},nextCursor:null,loadingMore:!1};function h(a,b){return"select_filter"===b.type?{...a,filter:b.filter,requestKey:"",activity:{state:"loading"},nextCursor:null,loadingMore:!1}:"request_started"===b.type?{...a,requestKey:b.key,activity:{state:"loading"},nextCursor:null,loadingMore:!1}:"request_succeeded"===b.type?b.key===a.requestKey?{...a,activity:{state:"ready",items:b.items},nextCursor:b.nextCursor}:a:"request_failed"===b.type?b.key===a.requestKey?{...a,activity:{state:"error"},nextCursor:null}:a:"load_started"===b.type?b.key===a.requestKey?{...a,loadingMore:!0}:a:"load_succeeded"===b.type&&b.key===a.requestKey&&"ready"===a.activity.state?{...a,activity:{state:"ready",items:[...a.activity.items,...b.items]},nextCursor:b.nextCursor,loadingMore:!1}:"load_failed"===b.type&&b.key===a.requestKey?{...a,activity:{state:"error"},nextCursor:null,loadingMore:!1}:a}function i(a,b,c=null){let d=new URLSearchParams({filter:b,limit:String(20)});return c&&d.set("cursor",c),`/api/bots/${encodeURIComponent(a)}/activity?${d.toString()}`}function j({items:a,compact:d=!1}){return(0,b.jsx)("ol",{className:d?"agent-activity-list is-compact":"agent-activity-list","aria-label":"Agent activity, newest first",children:a.map(a=>(0,b.jsxs)("li",{className:`agent-activity-item is-${a.severity}`,"data-activity-kind":a.kind,children:[(0,b.jsx)("span",{className:"agent-activity-marker","aria-hidden":"true"}),(0,b.jsxs)("div",{className:"agent-activity-card",children:[(0,b.jsxs)("div",{className:"agent-activity-summary",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"agent-activity-category",children:"conversations"===a.category?"Conversations & exchanges":a.category}),(0,b.jsx)("strong",{children:a.summary}),(0,b.jsx)("time",{dateTime:new Date(a.occurred_at).toISOString(),children:new Date(a.occurred_at).toLocaleString()})]}),a.attention?(0,b.jsx)("span",{className:"agent-activity-attention",children:"Needs attention"}):null]}),(0,b.jsx)("div",{className:"agent-activity-actions",children:(0,b.jsx)(c.default,{href:a.target.href,children:a.target.label})}),!d&&Object.keys(a.details).length?(0,b.jsxs)("details",{className:"agent-activity-details",children:[(0,b.jsx)("summary",{children:"Raw details"}),(0,b.jsx)("dl",{children:Object.entries(a.details).map(([a,c])=>(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{children:a.replaceAll("_"," ")}),(0,b.jsx)("dd",{children:(0,b.jsx)("code",{children:String(c)})})]},a))}),(0,b.jsx)("p",{children:"Safe structured fields only. Provider transcripts and identifiers are excluded."})]}):null]})]},a.id))})}function k({activity:a,filter:c,nextCursor:d,loadingMore:e,onLoadMore:g}){return(0,b.jsxs)(b.Fragment,{children:["loading"===a.state?(0,b.jsx)("p",{className:"agent-activity-state",role:"status",children:"Loading activity…"}):null,"error"===a.state?(0,b.jsxs)("div",{className:"agent-activity-state is-error",role:"alert",children:[(0,b.jsx)("strong",{children:"Activity unavailable"}),(0,b.jsx)("p",{children:"No partial or stale timeline is shown. Refresh to try again."})]}):null,"ready"!==a.state||a.items.length?null:(0,b.jsx)("p",{className:"agent-activity-state",children:"all"===c?"No operational activity has been recorded for this agent yet.":`No ${f.find(a=>a.value===c)?.label.toLowerCase()} activity matches this filter.`}),"ready"===a.state&&a.items.length?(0,b.jsx)(j,{items:a.items}):null,"ready"===a.state&&d?(0,b.jsx)("button",{type:"button",className:"agent-activity-more",onClick:g,disabled:e,children:e?"Loading…":"Load older activity"}):null]})}a.s(["ActivityList",0,j,"ActivityResults",0,k,"activityPageReducer",0,h,"agentActivityUrl",0,i,"default",0,function(){let{id:a,overview:j,loading:l,error:m,notFound:n}=(0,e.useAgentOverview)(),[o,p]=(0,d.useReducer)(h,g),{filter:q,activity:r,nextCursor:s,loadingMore:t}=o,u=(0,d.useRef)(0),v=(0,d.useCallback)((b=null)=>i(a,q,b),[q,a]);(0,d.useEffect)(()=>{let b=!1,c=++u.current,d=`${a}:${q}:${c}`;return p({type:"request_started",key:d}),fetch(v(),{cache:"no-store"}).then(async a=>{let e=await a.json().catch(()=>null);if(!a.ok||!Array.isArray(e?.activity))throw Error("activity");b||c!==u.current||p({type:"request_succeeded",key:d,items:e.activity,nextCursor:"string"==typeof e.next_cursor?e.next_cursor:null})}).catch(()=>{b||c!==u.current||p({type:"request_failed",key:d})}),()=>{b=!0}},[q,a,v]);let w=async()=>{if(!s||"ready"!==r.state||t)return;let a=o.requestKey;p({type:"load_started",key:a});try{let b=await fetch(v(s),{cache:"no-store"}),c=await b.json().catch(()=>null);if(!b.ok||!Array.isArray(c?.activity))throw Error("activity");p({type:"load_succeeded",key:a,items:c.activity,nextCursor:"string"==typeof c.next_cursor?c.next_cursor:null})}catch{p({type:"load_failed",key:a})}};return l?(0,b.jsx)("div",{className:"agent-state",role:"status",children:"Loading agent activity…"}):n?(0,b.jsxs)("div",{className:"agent-state",children:[(0,b.jsx)("h2",{children:"Agent not found"}),(0,b.jsx)(c.default,{href:"/",children:"Choose an agent"})]}):m||!j?(0,b.jsxs)("div",{className:"agent-state",role:"alert",children:[(0,b.jsx)("h2",{children:"Activity unavailable"}),(0,b.jsx)("p",{children:"Botmancers could not load this agent."})]}):(0,b.jsxs)("div",{className:"agent-activity","data-agent-activity-page":!0,children:[(0,b.jsxs)("header",{className:"agent-activity-intro",children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Activity"}),(0,b.jsxs)("h2",{children:["What changed for ",j.agent.name]}),(0,b.jsx)("p",{children:"Operational history from Botmancers records. Open the owning page for actions and complete detail."})]}),(0,b.jsx)("div",{className:"agent-activity-filters",role:"group","aria-label":"Filter Agent activity",children:f.map(a=>(0,b.jsx)("button",{type:"button","aria-pressed":q===a.value,onClick:()=>p({type:"select_filter",filter:a.value}),children:a.label},a.value))}),(0,b.jsx)(k,{activity:r,filter:q,nextCursor:s,loadingMore:t,onLoadMore:()=>{w()}})]})},"initialActivityPageState",0,g],10932)},88204,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(15722),f=a.i(22151),g=a.i(78627),h=a.i(10932);let i=[{id:"cursor",label:"Cursor"},{id:"codex",label:"Codex"},{id:"claude",label:"Claude Code"}];function j(a){return`botmancers setup --client ${a}`}async function k(a,b){try{let c=b??navigator.clipboard;return await c.writeText(a),!0}catch{return!1}}function l(){let[a,d]=(0,c.useState)("cursor"),[e,f]=(0,c.useState)(null),h=j(a);async function l(a){d(a),await k(j(a))?(f(a),window.setTimeout(()=>f(b=>b===a?null:b),1600)):f(null)}return(0,b.jsxs)("div",{className:"agent-setup-clients",children:[(0,b.jsx)("div",{className:"agent-setup-client-row",role:"group","aria-label":"Copy setup command for a coding client",children:i.map(c=>{let d=a===c.id,f=e===c.id;return(0,b.jsxs)("button",{type:"button",className:`agent-setup-client${d?" is-active":""}${f?" is-copied":""}`,"aria-pressed":d,"aria-label":f?`Copied setup command for ${c.label}`:`Copy setup command for ${c.label}`,onClick:()=>void l(c.id),children:[(0,b.jsx)(g.HarnessIcon,{agent:c.id,size:14,className:"agent-setup-client-mark"}),(0,b.jsx)("span",{children:f?"Copied":c.label})]},c.id)})}),(0,b.jsx)("pre",{className:"agent-setup-command",children:(0,b.jsx)("code",{children:h})})]})}function m({agentName:a}){let[d,e]=(0,c.useState)(!1),f=`Use Botmancers to ask ${a}: <your question>`;async function g(){await k(f)?(e(!0),window.setTimeout(()=>e(!1),1600)):e(!1)}return(0,b.jsxs)("div",{className:"agent-setup-prompt",children:[(0,b.jsx)("pre",{className:"agent-setup-command",children:(0,b.jsx)("code",{children:f})}),(0,b.jsx)("button",{type:"button",className:`agent-setup-client agent-setup-copy${d?" is-copied":""}`,"aria-label":d?`Copied prompt to ask ${a}`:`Copy prompt to ask ${a}`,onClick:()=>void g(),children:d?"Copied":"Copy"})]})}function n({rows:a,empty:c}){return a.length?(0,b.jsx)("ul",{className:"agent-work-list",children:a.map(a=>(0,b.jsx)("li",{children:(0,b.jsxs)("span",{children:[(0,b.jsx)("strong",{children:a.title}),(0,b.jsxs)("small",{children:["active"===a.status?"Active now":"Recent"," · ",new Date(a.last_activity_at).toLocaleString()]})]})},a.ref))}):(0,b.jsx)("p",{className:"agent-empty",children:c})}a.s(["default",0,function(){let{id:a,overview:c,loading:g,error:i,notFound:j}=(0,e.useAgentOverview)();if(g)return(0,b.jsx)("div",{className:"agent-state",role:"status",children:"Loading agent overview…"});if(j)return(0,b.jsxs)("div",{className:"agent-state",children:[(0,b.jsx)("h2",{children:"Agent not found"}),(0,b.jsx)("p",{children:"This agent does not exist or was removed."}),(0,b.jsx)(d.default,{href:"/",children:"Choose an agent"})]});if(i||!c)return(0,b.jsxs)("div",{className:"agent-state",role:"alert",children:[(0,b.jsx)("h2",{children:"Overview unavailable"}),(0,b.jsx)("p",{children:"Botmancers could not load this agent. Refresh to try again."})]});let k=`/agents/${encodeURIComponent(a)}/config`,o=c.conversation?`/agents/${encodeURIComponent(a)}/conversations/${encodeURIComponent(c.conversation.id)}`:`/agents/${encodeURIComponent(a)}/conversations`,p=c.messaging.home_session_ref?"Home session configured":c.messaging.new_sessions_allowed&&c.messaging.default_workspace_set?"Can start a configured session":c.current_work.length>0?"Uses an eligible existing session":"No ready session is known";return(0,b.jsxs)("div",{className:"agent-overview","data-agent-overview":!0,children:[(0,b.jsxs)("div",{className:"agent-overview-grid",children:[(0,b.jsxs)("section",{className:"agent-panel agent-instructions",children:[(0,b.jsxs)("div",{className:"agent-panel-head",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Standing instructions"}),(0,b.jsx)("h2",{children:"How this agent works"})]}),(0,b.jsx)(d.default,{href:k,children:"Config"})]}),(0,b.jsxs)("dl",{children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{children:"Rules"}),(0,b.jsx)("dd",{children:c.instructions.rules})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{children:"Skill"}),(0,b.jsx)("dd",{children:c.instructions.skill})]})]})]}),(0,b.jsxs)("section",{className:"agent-panel",children:[(0,b.jsxs)("div",{className:"agent-panel-head",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Runtime"}),(0,b.jsx)("h2",{children:c.runtime.available?"Ready to work":"Setup required"})]}),(0,b.jsx)(d.default,{href:k,children:"Config"})]}),(0,b.jsx)("p",{children:c.runtime.available?`${(0,f.agentLabel)(c.runtime.agent)} is connected through ${c.runtime.connection||"the configured runtime"}.`:"This agent cannot launch with its current registration. Open Config to resolve the connection or session scope."}),(0,b.jsxs)("dl",{className:"agent-runtime-facts",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{children:"Heartbeat"}),(0,b.jsx)("dd",{children:c.runtime.last_seen?new Date(c.runtime.last_seen).toLocaleString():"Not reported"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{children:"Messaging"}),(0,b.jsx)("dd",{children:p})]})]}),(0,b.jsx)("p",{className:"agent-muted",children:"Messages use the agent’s configured home session or launch policy. Callers do not choose its runtime, model, or provider session."})]})]}),(0,b.jsxs)("section",{className:"agent-use","aria-labelledby":"open-this-agent",children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Open this agent"}),(0,b.jsx)("h2",{id:"open-this-agent",children:"Make it reachable"}),(0,b.jsxs)("div",{className:"agent-use-grid",children:[(0,b.jsxs)("article",{children:[(0,b.jsx)("span",{className:"agent-use-number",children:"01"}),(0,b.jsx)("h3",{children:"Use from a coding agent"}),(0,b.jsxs)("p",{children:["Let another coding agent discover ",c.agent.name," and ask its sessions — so work learned here can travel between agents."]}),(0,b.jsxs)("ol",{className:"agent-setup-steps",children:[(0,b.jsxs)("li",{children:[(0,b.jsxs)("h4",{children:[(0,b.jsx)("span",{className:"agent-setup-step-label",children:"Step 1"})," Install in your coding agent"]}),(0,b.jsxs)("p",{className:"agent-muted",children:["Run this where your coding agent runs (the one that will ask ",c.agent.name,"), not on this registered agent. Click your client to copy it:"]}),(0,b.jsx)(l,{})]}),(0,b.jsxs)("li",{children:[(0,b.jsxs)("h4",{children:[(0,b.jsx)("span",{className:"agent-setup-step-label",children:"Step 2"})," Ask it to talk to ",c.agent.name]}),(0,b.jsx)(m,{agentName:c.agent.name}),(0,b.jsxs)("p",{className:"agent-muted",children:["Your coding agent sends the question to ",c.agent.name,", waits for the answer, and can read the conversation."]})]})]})]}),(0,b.jsxs)("article",{children:[(0,b.jsx)("span",{className:"agent-use-number",children:"02"}),(0,b.jsx)("h3",{children:"Share a session to Slack"}),(0,b.jsx)("p",{children:"Open one of this agent’s sessions to people in Slack — a time-limited, read-only share so others can ask what the session already knows."}),(0,b.jsx)(d.default,{href:`/agents/${encodeURIComponent(a)}/slack`,children:"Share through Slack"})]}),(0,b.jsxs)("article",{children:[(0,b.jsx)("span",{className:"agent-use-number",children:"03"}),(0,b.jsx)("h3",{children:"Message in Botmancers"}),(0,b.jsxs)("p",{children:["Talk directly with ",c.agent.name," in a focused conversation when you are the one asking."]}),(0,b.jsx)(d.default,{href:o,children:"Open conversation"})]})]})]}),(0,b.jsxs)("div",{className:"agent-overview-grid agent-work-grid",children:[(0,b.jsxs)("section",{className:"agent-panel",children:[(0,b.jsxs)("div",{className:"agent-panel-head",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Current work"}),(0,b.jsx)("h2",{children:"Active sessions"})]}),(0,b.jsx)(d.default,{href:`/agents/${encodeURIComponent(a)}/sessions`,children:"All sessions"})]}),(0,b.jsx)(n,{rows:c.current_work,empty:"No active work right now."})]}),(0,b.jsxs)("section",{className:"agent-panel",children:[(0,b.jsxs)("div",{className:"agent-panel-head",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Recent activity"}),(0,b.jsx)("h2",{children:"Latest work"})]}),(0,b.jsx)(d.default,{href:`/agents/${encodeURIComponent(a)}/activity`,children:"View activity"})]}),c.recent_activity.length?(0,b.jsx)(h.ActivityList,{items:c.recent_activity,compact:!0}):(0,b.jsx)("p",{className:"agent-empty",children:"No operational activity yet."})]})]})]})}])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=app_agents_%5Bid%5D_0sr4fdg._.js.map
|
package/app/.next/server/chunks/ssr/app_agents_[id]_activity_AgentActivityPage_tsx_042-590._.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[10932,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(72131),e=a.i(15722);let f=[{value:"all",label:"All"},{value:"sessions",label:"Sessions"},{value:"conversations",label:"Conversations & exchanges"},{value:"slack",label:"Slack"},{value:"errors",label:"Errors"}],g={filter:"all",requestKey:"",activity:{state:"loading"},nextCursor:null,loadingMore:!1};function h(a,b){return"select_filter"===b.type?{...a,filter:b.filter,requestKey:"",activity:{state:"loading"},nextCursor:null,loadingMore:!1}:"request_started"===b.type?{...a,requestKey:b.key,activity:{state:"loading"},nextCursor:null,loadingMore:!1}:"request_succeeded"===b.type?b.key===a.requestKey?{...a,activity:{state:"ready",items:b.items},nextCursor:b.nextCursor}:a:"request_failed"===b.type?b.key===a.requestKey?{...a,activity:{state:"error"},nextCursor:null}:a:"load_started"===b.type?b.key===a.requestKey?{...a,loadingMore:!0}:a:"load_succeeded"===b.type&&b.key===a.requestKey&&"ready"===a.activity.state?{...a,activity:{state:"ready",items:[...a.activity.items,...b.items]},nextCursor:b.nextCursor,loadingMore:!1}:"load_failed"===b.type&&b.key===a.requestKey?{...a,activity:{state:"error"},nextCursor:null,loadingMore:!1}:a}function i(a,b,c=null){let d=new URLSearchParams({filter:b,limit:String(20)});return c&&d.set("cursor",c),`/api/bots/${encodeURIComponent(a)}/activity?${d.toString()}`}function j({items:a,compact:d=!1}){return(0,b.jsx)("ol",{className:d?"agent-activity-list is-compact":"agent-activity-list","aria-label":"Agent activity, newest first",children:a.map(a=>(0,b.jsxs)("li",{className:`agent-activity-item is-${a.severity}`,"data-activity-kind":a.kind,children:[(0,b.jsx)("span",{className:"agent-activity-marker","aria-hidden":"true"}),(0,b.jsxs)("div",{className:"agent-activity-card",children:[(0,b.jsxs)("div",{className:"agent-activity-summary",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"agent-activity-category",children:"conversations"===a.category?"Conversations & exchanges":a.category}),(0,b.jsx)("strong",{children:a.summary}),(0,b.jsx)("time",{dateTime:new Date(a.occurred_at).toISOString(),children:new Date(a.occurred_at).toLocaleString()})]}),a.attention?(0,b.jsx)("span",{className:"agent-activity-attention",children:"Needs attention"}):null]}),(0,b.jsx)("div",{className:"agent-activity-actions",children:(0,b.jsx)(c.default,{href:a.target.href,children:a.target.label})}),!d&&Object.keys(a.details).length?(0,b.jsxs)("details",{className:"agent-activity-details",children:[(0,b.jsx)("summary",{children:"Raw details"}),(0,b.jsx)("dl",{children:Object.entries(a.details).map(([a,c])=>(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{children:a.replaceAll("_"," ")}),(0,b.jsx)("dd",{children:(0,b.jsx)("code",{children:String(c)})})]},a))}),(0,b.jsx)("p",{children:"Safe structured fields only. Provider transcripts and identifiers are excluded."})]}):null]})]},a.id))})}function k({activity:a,filter:c,nextCursor:d,loadingMore:e,onLoadMore:g}){return(0,b.jsxs)(b.Fragment,{children:["loading"===a.state?(0,b.jsx)("p",{className:"agent-activity-state",role:"status",children:"Loading activity…"}):null,"error"===a.state?(0,b.jsxs)("div",{className:"agent-activity-state is-error",role:"alert",children:[(0,b.jsx)("strong",{children:"Activity unavailable"}),(0,b.jsx)("p",{children:"No partial or stale timeline is shown. Refresh to try again."})]}):null,"ready"!==a.state||a.items.length?null:(0,b.jsx)("p",{className:"agent-activity-state",children:"all"===c?"No operational activity has been recorded for this
|
|
1
|
+
module.exports=[10932,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(72131),e=a.i(15722);let f=[{value:"all",label:"All"},{value:"sessions",label:"Sessions"},{value:"conversations",label:"Conversations & exchanges"},{value:"slack",label:"Slack"},{value:"errors",label:"Errors"}],g={filter:"all",requestKey:"",activity:{state:"loading"},nextCursor:null,loadingMore:!1};function h(a,b){return"select_filter"===b.type?{...a,filter:b.filter,requestKey:"",activity:{state:"loading"},nextCursor:null,loadingMore:!1}:"request_started"===b.type?{...a,requestKey:b.key,activity:{state:"loading"},nextCursor:null,loadingMore:!1}:"request_succeeded"===b.type?b.key===a.requestKey?{...a,activity:{state:"ready",items:b.items},nextCursor:b.nextCursor}:a:"request_failed"===b.type?b.key===a.requestKey?{...a,activity:{state:"error"},nextCursor:null}:a:"load_started"===b.type?b.key===a.requestKey?{...a,loadingMore:!0}:a:"load_succeeded"===b.type&&b.key===a.requestKey&&"ready"===a.activity.state?{...a,activity:{state:"ready",items:[...a.activity.items,...b.items]},nextCursor:b.nextCursor,loadingMore:!1}:"load_failed"===b.type&&b.key===a.requestKey?{...a,activity:{state:"error"},nextCursor:null,loadingMore:!1}:a}function i(a,b,c=null){let d=new URLSearchParams({filter:b,limit:String(20)});return c&&d.set("cursor",c),`/api/bots/${encodeURIComponent(a)}/activity?${d.toString()}`}function j({items:a,compact:d=!1}){return(0,b.jsx)("ol",{className:d?"agent-activity-list is-compact":"agent-activity-list","aria-label":"Agent activity, newest first",children:a.map(a=>(0,b.jsxs)("li",{className:`agent-activity-item is-${a.severity}`,"data-activity-kind":a.kind,children:[(0,b.jsx)("span",{className:"agent-activity-marker","aria-hidden":"true"}),(0,b.jsxs)("div",{className:"agent-activity-card",children:[(0,b.jsxs)("div",{className:"agent-activity-summary",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"agent-activity-category",children:"conversations"===a.category?"Conversations & exchanges":a.category}),(0,b.jsx)("strong",{children:a.summary}),(0,b.jsx)("time",{dateTime:new Date(a.occurred_at).toISOString(),children:new Date(a.occurred_at).toLocaleString()})]}),a.attention?(0,b.jsx)("span",{className:"agent-activity-attention",children:"Needs attention"}):null]}),(0,b.jsx)("div",{className:"agent-activity-actions",children:(0,b.jsx)(c.default,{href:a.target.href,children:a.target.label})}),!d&&Object.keys(a.details).length?(0,b.jsxs)("details",{className:"agent-activity-details",children:[(0,b.jsx)("summary",{children:"Raw details"}),(0,b.jsx)("dl",{children:Object.entries(a.details).map(([a,c])=>(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{children:a.replaceAll("_"," ")}),(0,b.jsx)("dd",{children:(0,b.jsx)("code",{children:String(c)})})]},a))}),(0,b.jsx)("p",{children:"Safe structured fields only. Provider transcripts and identifiers are excluded."})]}):null]})]},a.id))})}function k({activity:a,filter:c,nextCursor:d,loadingMore:e,onLoadMore:g}){return(0,b.jsxs)(b.Fragment,{children:["loading"===a.state?(0,b.jsx)("p",{className:"agent-activity-state",role:"status",children:"Loading activity…"}):null,"error"===a.state?(0,b.jsxs)("div",{className:"agent-activity-state is-error",role:"alert",children:[(0,b.jsx)("strong",{children:"Activity unavailable"}),(0,b.jsx)("p",{children:"No partial or stale timeline is shown. Refresh to try again."})]}):null,"ready"!==a.state||a.items.length?null:(0,b.jsx)("p",{className:"agent-activity-state",children:"all"===c?"No operational activity has been recorded for this agent yet.":`No ${f.find(a=>a.value===c)?.label.toLowerCase()} activity matches this filter.`}),"ready"===a.state&&a.items.length?(0,b.jsx)(j,{items:a.items}):null,"ready"===a.state&&d?(0,b.jsx)("button",{type:"button",className:"agent-activity-more",onClick:g,disabled:e,children:e?"Loading…":"Load older activity"}):null]})}a.s(["ActivityList",0,j,"ActivityResults",0,k,"activityPageReducer",0,h,"agentActivityUrl",0,i,"default",0,function(){let{id:a,overview:j,loading:l,error:m,notFound:n}=(0,e.useAgentOverview)(),[o,p]=(0,d.useReducer)(h,g),{filter:q,activity:r,nextCursor:s,loadingMore:t}=o,u=(0,d.useRef)(0),v=(0,d.useCallback)((b=null)=>i(a,q,b),[q,a]);(0,d.useEffect)(()=>{let b=!1,c=++u.current,d=`${a}:${q}:${c}`;return p({type:"request_started",key:d}),fetch(v(),{cache:"no-store"}).then(async a=>{let e=await a.json().catch(()=>null);if(!a.ok||!Array.isArray(e?.activity))throw Error("activity");b||c!==u.current||p({type:"request_succeeded",key:d,items:e.activity,nextCursor:"string"==typeof e.next_cursor?e.next_cursor:null})}).catch(()=>{b||c!==u.current||p({type:"request_failed",key:d})}),()=>{b=!0}},[q,a,v]);let w=async()=>{if(!s||"ready"!==r.state||t)return;let a=o.requestKey;p({type:"load_started",key:a});try{let b=await fetch(v(s),{cache:"no-store"}),c=await b.json().catch(()=>null);if(!b.ok||!Array.isArray(c?.activity))throw Error("activity");p({type:"load_succeeded",key:a,items:c.activity,nextCursor:"string"==typeof c.next_cursor?c.next_cursor:null})}catch{p({type:"load_failed",key:a})}};return l?(0,b.jsx)("div",{className:"agent-state",role:"status",children:"Loading agent activity…"}):n?(0,b.jsxs)("div",{className:"agent-state",children:[(0,b.jsx)("h2",{children:"Agent not found"}),(0,b.jsx)(c.default,{href:"/",children:"Choose an agent"})]}):m||!j?(0,b.jsxs)("div",{className:"agent-state",role:"alert",children:[(0,b.jsx)("h2",{children:"Activity unavailable"}),(0,b.jsx)("p",{children:"Botmancers could not load this agent."})]}):(0,b.jsxs)("div",{className:"agent-activity","data-agent-activity-page":!0,children:[(0,b.jsxs)("header",{className:"agent-activity-intro",children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Activity"}),(0,b.jsxs)("h2",{children:["What changed for ",j.agent.name]}),(0,b.jsx)("p",{children:"Operational history from Botmancers records. Open the owning page for actions and complete detail."})]}),(0,b.jsx)("div",{className:"agent-activity-filters",role:"group","aria-label":"Filter Agent activity",children:f.map(a=>(0,b.jsx)("button",{type:"button","aria-pressed":q===a.value,onClick:()=>p({type:"select_filter",filter:a.value}),children:a.label},a.value))}),(0,b.jsx)(k,{activity:r,filter:q,nextCursor:s,loadingMore:t,onLoadMore:()=>{w()}})]})},"initialActivityPageState",0,g],10932)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=app_agents_%5Bid%5D_activity_AgentActivityPage_tsx_042-590._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[48219,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(50944),f=a.i(60193),g=a.i(23464);function h({agentId:a,agentName:d}){let e=(0,c.useId)(),f=(0,c.useId)(),i=(0,c.useId)(),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(0),[p,q]=(0,c.useState)("idle"),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),[v,w]=(0,c.useState)(""),[x,y]=(0,c.useState)(""),[z,A]=(0,c.useState)("");(0,c.useEffect)(()=>{let b=!1;return fetch(`/api/bots/${encodeURIComponent(a)}/share-policy`,{cache:"no-store"}).then(async a=>{let c=await a.json().catch(()=>null);b||(a.ok&&c?.policy?(m(""),k(c.policy)):m("Could not load the share policy."))}).catch(()=>{b||m("Could not load the share policy.")}),()=>{b=!0}},[a,n]);let B=()=>{s(""),q("idle"),o(a=>a+1)},C=async(b,c)=>{if(!j)return!1;q("saving"),s(""),u("");try{let d=await fetch(`/api/bots/${encodeURIComponent(a)}/share-policy`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({revision:j.revision,...b})}),e=await d.json().catch(()=>null);if(!d.ok||!e?.policy)return q("error"),s("string"==typeof e?.error?.message?e.error.message:"The share policy could not be saved."),!1;return k(e.policy),q("idle"),u(c("number"==typeof e.revoked_contexts?e.revoked_contexts:0)),!0}catch{return q("error"),s("The share policy could not be saved."),!1}},D=async a=>{if(a.preventDefault(),!j)return;let b=(0,g.audienceInputError)(v,x,j.audiences);if(A(b??""),b)return;let c={kind:"slack",team_id:v.trim(),channel_id:x.trim()};await C({audiences:[...j.audiences,c]},()=>`Added ${(0,g.audienceLabel)(c)}.`)&&(w(""),y(""))},E="saving"===p,F=!!j&&"invalid"!==j.state;return(0,b.jsxs)("section",{className:"cfg-card share-policy",id:"session-sharing","aria-labelledby":"cfg-sharing-title",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{id:"cfg-sharing-title",className:"cfg-title",children:"Session sharing"}),E?(0,b.jsx)("span",{className:"text-sm cfg-faint",role:"status",children:"Saving…"}):null]}),(0,b.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:["A share lets people in one Slack channel ask one of ",d,"’s sessions questions, read-only, until it expires or you revoke it. Create and revoke shares from Sessions."]}),l?(0,b.jsxs)("p",{className:"text-sm cfg-error",role:"alert",children:[l," ",(0,b.jsx)("button",{type:"button",onClick:B,className:"underline hover:no-underline",children:"Retry"})]}):null,j||l?null:(0,b.jsx)("p",{className:"text-sm cfg-faint",role:"status",children:"Loading…"}),j?.state==="invalid"?(0,b.jsxs)("p",{className:"text-sm cfg-error mb-3",role:"alert",children:["The share policy file is invalid, so nothing can be shared: ",j.reason," Fix or remove config/session-shares.json, then"," ",(0,b.jsx)("button",{type:"button",onClick:B,className:"underline hover:no-underline",children:"reload"}),"."]}):null,j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"share-policy-toggle",children:[(0,b.jsx)("input",{id:e,type:"checkbox",role:"switch",checked:j.agent.share_from_turn,"aria-checked":j.agent.share_from_turn,disabled:!F||E||!j.agent.share_current.supported&&!j.agent.share_from_turn,"data-share-policy":"share_from_turn",onChange:a=>{let b=a.target.checked;C({share_from_turn:b},a=>b?"Share from a turn is on.":`Share from a turn is off.${a?` Revoked ${a} live turn context${1===a?"":"s"}.`:""}`)}}),(0,b.jsxs)("label",{htmlFor:e,className:"text-sm",children:[(0,b.jsx)("span",{className:"font-medium",children:"Share from a turn"})," (",(0,b.jsx)("code",{className:"cfg-code",children:"share_from_turn"}),")"]})]}),(0,b.jsx)("p",{className:"text-sm cfg-faint share-policy-hint",children:(0,g.shareFromTurnNote)(j)}),j.agent.live_contexts>0?(0,b.jsxs)("p",{className:"text-sm cfg-faint share-policy-hint",children:[j.agent.live_contexts," live turn context",1===j.agent.live_contexts?"":"s"," now."]}):null,(0,b.jsx)("h3",{className:"cfg-title share-policy-sub",children:"Slack channel allowlist"}),(0,b.jsx)("p",{className:"text-sm cfg-faint",children:"Every Agent’s shares use this list. A share can only go to a channel on it."}),0===j.audiences.length?(0,b.jsx)("p",{className:"text-sm cfg-muted share-policy-empty",children:"No channel yet: nothing can be shared to Slack."}):(0,b.jsx)("ul",{className:"share-policy-list","aria-label":"Allowed Slack channels",children:j.audiences.map(a=>(0,b.jsxs)("li",{className:"share-policy-entry",children:[(0,b.jsx)("span",{className:"cfg-code",children:a.channel_id}),(0,b.jsxs)("span",{className:"cfg-faint",children:["workspace ",a.team_id]}),(0,b.jsx)("button",{type:"button",className:"cfg-link text-sm share-policy-remove",disabled:!F||E,"aria-label":`Remove ${(0,g.audienceLabel)(a)}`,onClick:()=>{j&&C({audiences:j.audiences.filter(b=>b.team_id!==a.team_id||b.channel_id!==a.channel_id)},()=>`Removed ${(0,g.audienceLabel)(a)}. Its Slack threads stop being answered.`)},children:"Remove"})]},`${a.team_id}:${a.channel_id}`))}),(0,b.jsxs)("form",{className:"share-policy-add",onSubmit:a=>{D(a)},"aria-label":"Add a Slack channel",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:f,className:"text-sm",children:"Workspace ID"}),(0,b.jsx)("input",{id:f,className:"cfg-input",value:v,placeholder:"T0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!F||E,"aria-invalid":!!z,onChange:a=>{w(a.target.value),A("")}})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:i,className:"text-sm",children:"Channel ID"}),(0,b.jsx)("input",{id:i,className:"cfg-input",value:x,placeholder:"C0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!F||E,"aria-invalid":!!z,onChange:a=>{y(a.target.value),A("")}})]}),(0,b.jsx)("button",{type:"submit",className:"cfg-btn-primary text-sm",disabled:!F||E||!v.trim()||!x.trim(),children:"Add channel"})]}),z?(0,b.jsx)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:z}):null,"error"===p?(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:["Couldn't save: ",r," ",(0,b.jsx)("button",{type:"button",onClick:B,className:"underline hover:no-underline",children:"Reload"})]}):null,(0,b.jsx)("p",{className:"mt-2 text-sm cfg-ok",role:"status",children:t})]}):null]})}var i=a.i(35832),j=a.i(20851),k=a.i(1160),l=a.i(22855),m=a.i(79202),n=a.i(36391);function o({attribute:a,label:d,options:e,current:f,onPick:g,className:h}){let i=(0,c.useId)(),j=`avatar-${a}`;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{id:i,className:"avatar-group-label",children:d}),(0,b.jsx)("div",{className:h?`avatar-opt-grid ${h}`:"avatar-opt-grid",role:"radiogroup","aria-labelledby":i,children:e.map(c=>(0,b.jsxs)("label",{title:c.label,className:"avatar-opt",children:[(0,b.jsx)("input",{type:"radio",name:j,value:c.id,checked:f[a]===c.id,onChange:()=>g({[a]:c.id}),className:"avatar-opt-input"}),(0,b.jsx)("span",{className:"avatar-opt-art","aria-hidden":"true",children:(0,b.jsx)(n.default,{config:{...f,[a]:c.id},size:44})}),(0,b.jsx)("span",{children:c.label})]},c.id))})]})}var p=a.i(80219);function q({phase:a,onImport:c}){let d=(0,p.marketImportView)(a);return(0,b.jsxs)("div",{className:"mt-3","data-field":"marketplace-import",children:[(0,b.jsx)("button",{type:"button",onClick:c,disabled:d.busy,"aria-busy":d.busy,"aria-describedby":"cfg-market-import-status",className:"cfg-btn-ghost text-sm w-full sm:w-auto",children:"Import from Grok Marketplace"}),(0,b.jsx)("p",{id:"cfg-market-import-status",role:"status","aria-live":"polite",className:"error"===d.tone?"mt-2 text-sm cfg-error":"mt-2 text-xs cfg-faint",children:d.message})]})}var r=a.i(5020);let s="Fix the highlighted fields.",t=[{key:"avatar_accessory",label:"Avatar accessory"},{key:"avatar_color",label:"Avatar color"},{key:"avatar_eyes",label:"Avatar eyes"},{key:"avatar_hands",label:"Avatar hands"},{key:"description",label:"Description (rules)"},{key:"import_operation_id",label:"Import operation ID"},{key:"import_schema_version",label:"Import schema version"},{key:"memories",label:"Remembered facts"},{key:"name",label:"Name"},{key:"skill_content",label:"Skill content"},{key:"skill_path",label:"Skill path"},{key:"skill_present",label:"Skill present"},{key:"source_provider",label:"Source provider"},{key:"template_id",label:"Template ID"},{key:"template_url",label:"Template URL"},{key:"title",label:"Title"}];function u(a){return String(a).padStart(2,"0")}function v(a){let b=new Date(a);return`${b.getFullYear()}-${u(b.getMonth()+1)}-${u(b.getDate())} ${u(b.getHours())}:${u(b.getMinutes())}`}function w(a){let b=new Date(a);return`${u(b.getHours())}:${u(b.getMinutes())}:${u(b.getSeconds())}`}async function x(a){try{return await navigator.clipboard.writeText(a),!0}catch{return!1}}a.s(["default",0,function(){var a;let g=String((0,e.useParams)().id??""),u=(0,e.useRouter)(),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(null),[C,D]=(0,c.useState)(!0),[E,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(0),[K,L]=(0,c.useState)(null),[M,N]=(0,c.useState)("clean"),[O,P]=(0,c.useState)(""),[Q,R]=(0,c.useState)(0),[S,T]=(0,c.useState)(!1),[U,V]=(0,c.useState)(""),[W,X]=(0,c.useState)("clean"),[Y,Z]=(0,c.useState)(""),[$,_]=(0,c.useState)(0),[aa,ab]=(0,c.useState)({}),[ac,ad]=(0,c.useState)(""),[ae,af]=(0,c.useState)(!1),[ag,ah]=(0,c.useState)(null),[ai,aj]=(0,c.useState)(!1),ak=(0,m.useRuntimeConnections)(),[al,am]=(0,c.useState)(void 0),[an,ao]=(0,c.useState)("clean"),[ap,aq]=(0,c.useState)(""),[ar,as]=(0,c.useState)(0),[at,au]=(0,c.useState)(null),[av,aw]=(0,c.useState)("clean"),[ax,ay]=(0,c.useState)(""),[az,aA]=(0,c.useState)(0),{phase:aB,startImport:aC}=function(a){let[b,d]=(0,c.useState)("idle");return(0,c.useEffect)(()=>{let b=window.location.search;if(null===(0,p.importedBotId)(b))return;let c=new URL(window.location.href);c.searchParams.delete(p.IMPORT_RETURN_QUERY),window.history.replaceState(null,"",c.pathname+c.search);let e=!1;return(0,p.resolveImportReturn)(b,a,async a=>(await fetch(`/api/bots/${encodeURIComponent(a)}/config`,{cache:"no-store"})).ok).then(a=>{e||("open"===a.kind?window.location.replace(a.path):"missing"===a.kind&&d("missing"))}),()=>{e=!0}},[a]),{phase:b,startImport:async function(){d("checking");try{let a=await fetch(p.HANDOFF_STATUS_PATH,{cache:"no-store"}),b=await a.json().catch(()=>null);if(!a.ok)return void d("failed");if(b?.configured!==!0)return void d("unavailable");d("redirecting"),window.location.href=(0,p.handoffStartPath)(window.location.origin,window.location.pathname),setTimeout(()=>d(a=>"redirecting"===a?"idle":a),4e3)}catch{d("failed")}}}}(g);function aD(){D(!0),F(!1),J(a=>a+1)}(0,c.useEffect)(()=>{if(!g)return;let a=!1;return fetch(`/api/bots/${encodeURIComponent(g)}/sessions?status=all`,{cache:"no-store"}).then(a=>a.ok?a.json():null).then(b=>{a||am((b?.sessions??[]).map(a=>({ref:a.ref,title:a.title,status:a.status})))}).catch(()=>{a||am([])}),()=>{a=!0}},[g,I]),(0,c.useEffect)(()=>{if(!g)return;let a=!1;return fetch(`/api/bots/${encodeURIComponent(g)}/config`).then(async b=>{if(a)return;if(404===b.status){H(!0),B(null);return}if(!b.ok)throw Error("request failed");let c=await b.json();a||(B(c),L(c.bot.description??""),H(!1),F(!1))}).catch(()=>{a||F(!0)}).finally(()=>{a||D(!1)}),()=>{a=!0}},[g,I]);let aE=A?.bot.description??"",aF=null!==K&&K!==aE,aG=A?.skill.content??"",aH=S&&U!==aG,aI=A?(0,k.registrationFormFromBot)(A.bot):null,aJ=ae&&null!==ag&&JSON.stringify(ag)!==JSON.stringify(aI),aK=A?.bot.avatar_config??(0,r.resolveAvatar)(A?.bot??{}),aL=at??aK,aM=null!==at&&JSON.stringify(at)!==JSON.stringify(aK),aN=aF||aH||aJ||aM;function aO(a,b){x(b).then(b=>{b&&(ad(a),setTimeout(()=>ad(b=>b===a?"":b),2e3))})}async function aP(){if(A&&null!==K){N("saving"),P("");try{let a=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:A.bot.id,description:K})});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await fetch(`/api/bots/${encodeURIComponent(g)}/config`);if(!b.ok)throw Error("request failed");B(await b.json()),N("confirmed"),R(Date.now()),setTimeout(()=>{N(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){N("error"),P(a instanceof Error?a.message:"request failed")}}}function aQ(){A&&(ah((0,k.registrationFormFromBot)(A.bot)),af(!0),aj(!1),ao("clean"),aq(""),ak.retry())}function aR(a){ah(b=>b?{...b,...a}:b),aq(""),ao(a=>"error"===a?"clean":a)}function aS(){af(!1),ah(null),ao("clean"),aq("")}function aT(a){au({...at??aK,...a}),aw("clean"),ay("")}async function aU(){if(A&&at){aw("saving"),ay("");try{let a=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:A.bot.id,avatar:at})});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await fetch(`/api/bots/${encodeURIComponent(g)}/config`);if(!b.ok)throw Error("request failed");B(await b.json()),au(null),aw("confirmed"),aA(Date.now()),setTimeout(()=>{aw(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){aw("error"),ay(a instanceof Error?a.message:"request failed")}}}async function aV(){if(A&&ag){if((0,k.hasRegistrationErrors)((0,k.registrationFormView)(ag,ak.state))){aj(!0),ao("error"),aq(s);return}ao("saving"),aq("");try{let a=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,k.registrationPatchBody)(A.bot.id,ag))});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await fetch(`/api/bots/${encodeURIComponent(g)}/config`);if(!b.ok)throw Error("request failed");B(await b.json()),af(!1),ah(null),ao("confirmed"),as(Date.now()),setTimeout(()=>{ao(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){ao("error"),aq(a instanceof Error?a.message:"request failed")}}}function aW(){V(A?.skill.content??""),T(!0),X("clean"),Z("")}async function aX(){if(A&&(U.trim()||window.confirm("Delete this skill file?"))){X("saving"),Z("");try{let a=await fetch(`/api/bots/${encodeURIComponent(g)}/skill`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:U})});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await a.json();B(a=>a?{...a,skill:b.skill,currentHash:b.currentHash}:a),T(!1),X("confirmed"),_(Date.now()),setTimeout(()=>{X(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){X("error"),Z(a instanceof Error?a.message:"request failed")}}}if((0,c.useEffect)(()=>{if(!aN)return;let a=a=>{a.preventDefault()};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[aN]),G)return(0,b.jsx)("div",{className:"cfg-page cfg-page-framed",children:(0,b.jsxs)("div",{className:"agent-state",children:[(0,b.jsx)("h2",{children:"Agent not found"}),(0,b.jsx)("p",{children:"This Agent does not exist or was removed."}),(0,b.jsx)(d.default,{href:"/",children:"Choose an Agent"})]})});if(C&&!A)return(0,b.jsx)("div",{className:"cfg-page cfg-page-framed",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto space-y-6",children:[(0,b.jsx)("div",{className:"h-12 rounded-lg animate-pulse cfg-skel"}),(0,b.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,b.jsx)("div",{className:"space-y-6",children:[0,1,2].map(a=>(0,b.jsx)("div",{className:"h-48 rounded-lg animate-pulse cfg-skel"},a))}),(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)("div",{className:"h-64 rounded-lg animate-pulse cfg-skel"}),(0,b.jsx)("div",{className:"h-80 rounded-lg animate-pulse cfg-skel"})]})]})]})});if(E&&!A)return(0,b.jsx)("div",{className:"cfg-page cfg-page-framed",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,b.jsxs)("header",{className:"mb-6 flex flex-wrap items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Config"}),(0,b.jsx)("h2",{className:"text-xl font-bold truncate",children:"Couldn't load agent details"})]}),(0,b.jsxs)("div",{className:"ml-auto text-right",children:[(0,b.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash: ",(0,b.jsx)("code",{className:"cfg-code",children:"—"})]}),(0,b.jsx)("p",{className:"text-sm mt-1",children:(0,b.jsx)("span",{className:"cfg-faint",children:"○ Not loaded"})})]})]}),(0,b.jsx)("div",{className:"grid gap-6 lg:grid-cols-2 items-start",children:[["Skills","Rules","Agent","Template source"],["Launch snapshots","Avatar"]].map(a=>(0,b.jsx)("div",{className:"min-w-0 space-y-6",children:a.map(a=>(0,b.jsxs)("div",{className:"cfg-card",children:[(0,b.jsx)("h2",{className:"cfg-title mb-2",children:a}),(0,b.jsxs)("p",{className:"text-sm cfg-muted",children:["Couldn't load this section."," ",(0,b.jsx)("button",{onClick:aD,className:"cfg-link",children:"Retry"})]})]},a))},a[0]))})]})});if(!A)return null;let{bot:aY,skill:aZ,currentHash:a$,snapshots:a_}=A,a0=!!(aY.source_provider||aY.template_id||aY.template_url||aY.import_schema_version||aY.import_operation_id),a1="saving"===M?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aF||"error"===M?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===M?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",w(Q)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),a2="saving"===W?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aH||"error"===W?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===W?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",w($)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),a3="saving"===an?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aJ||"error"===an?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===an?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",w(ar)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),a4="saving"===av?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aM||"error"===av?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===av?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",w(az)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"});return(0,b.jsxs)("div",{className:"cfg-page cfg-page-framed",children:[(0,b.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,b.jsxs)("header",{className:"mb-6 flex flex-wrap items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Config"}),(0,b.jsx)("h2",{className:"text-xl font-bold truncate",children:"Standing setup"})]}),(0,b.jsxs)("div",{className:"ml-auto text-right",children:[(0,b.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash:"," ",(0,b.jsx)("code",{className:"cfg-code",title:a$,children:a$.slice(0,8)})," ",(0,b.jsx)("button",{onClick:()=>aO("header",a$),className:"cfg-link text-sm",children:"header"===ac?"Copied":"Copy"})]}),(0,b.jsx)("p",{className:"text-sm mt-1",children:aN?(0,b.jsxs)("span",{className:"cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):(0,b.jsx)("span",{className:"cfg-faint",children:"● Saved"})})]})]}),(0,b.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2 items-start","data-cfg-layout":"columns",children:[(0,b.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"primary",children:[(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Skills"}),a2]}),"unsupported"===aZ.status?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Unsupported name"}),(0,b.jsx)("p",{className:"text-sm cfg-muted",children:"Skill files need an agent name matching /^[A-Za-z0-9_-]+$/ — this name cannot map to a skill path."})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:[aZ.path," · ","present"===aZ.status?"Present":"Not present"]}),S?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("textarea",{value:U,onChange:a=>V(a.target.value),rows:8,className:"cfg-input text-sm"}),"error"===W&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",Y,"."," ",(0,b.jsx)("button",{onClick:aX,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aX,disabled:!aH||"saving"===W,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===W?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:function(){T(!1),X("clean"),Z("")},disabled:!aH||"saving"===W,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}):"present"===aZ.status?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("pre",{className:"text-sm cfg-pre max-h-64 overflow-y-auto",children:aZ.content}),(0,b.jsx)("button",{onClick:aW,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"text-sm cfg-muted",children:"No skill file yet. Create SKILL.md to give this agent standing instructions."}),(0,b.jsx)("button",{onClick:aW,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Create"})]}),(0,b.jsx)("p",{className:"mt-3 text-xs cfg-faint",children:"Appended verbatim as a system message at launch."})]})]}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Rules"}),a1]}),(0,b.jsx)("textarea",{value:K??"",onChange:a=>L(a.target.value),rows:8,className:"cfg-input cfg-input-sans text-sm"}),(0,b.jsx)("p",{className:"mt-2 text-xs cfg-faint",children:"Sent verbatim as the standing-rules system message on every turn. This beats the user's request for detail or length."}),"error"===M&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",O,"."," ",(0,b.jsx)("button",{onClick:aP,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aP,disabled:!aF||"saving"===M,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===M?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:function(){L(aE),N("clean"),P("")},disabled:!aF||"saving"===M,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Agent"}),a3]}),(()=>{if(!ae||!ag){let a=(0,k.registrationReadView)(aY,al);return(0,b.jsxs)("div",{"data-field":"runtime-read",children:[(0,b.jsx)("dl",{className:"text-sm",children:a.rows.map(a=>(0,b.jsxs)("div",{"data-row":a.key,className:"flex flex-col sm:flex-row sm:justify-between gap-x-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:a.label}),(0,b.jsx)("dd",{className:"sm:text-right break-words cfg-muted",children:a.value})]},a.key))}),a.notices.map(a=>(0,b.jsx)("p",{className:"text-sm cfg-dirty mt-2",children:a},a)),(0,b.jsx)("button",{onClick:aQ,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]})}let a=(0,k.registrationFormView)(ag,ak.state);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.RegistrationFields,{idPrefix:"cfg",variant:"config",form:ag,onChange:aR,view:a,showErrors:ai,connections:ak.state,onRetryConnections:ak.retry,onAddConnection:ak.add,workspacePlaceholder:(0,j.defaultWorkdirFor)(aY.id),workspaceHint:(0,j.configWorkspaceHint)(aY.id),sessions:al,includeHomeSession:!0}),"error"===an&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:[ap===s?ap:`Couldn't save: ${ap}.`," ",ap===s?null:(0,b.jsx)("button",{onClick:aV,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aV,disabled:!aJ||"saving"===an||a.submitDisabled,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===an?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:aS,disabled:"saving"===an,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:aJ?"Discard":"Cancel"})]})]})})()]}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsx)("h2",{className:"cfg-title mb-3",children:"Template source"}),!a0&&(0,b.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Created manually in Botmancers — no template source."}),(0,b.jsxs)("dl",{className:"text-sm",children:[(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Source provider"}),(0,b.jsx)("dd",{className:"text-right",children:aY.source_provider??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Template ID"}),(0,b.jsx)("dd",{className:"text-right",children:aY.template_id??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Template URL"}),(0,b.jsx)("dd",{className:"text-right break-all",children:aY.template_url?(a=aY.template_url).startsWith("http://")||a.startsWith("https://")?(0,b.jsx)("a",{href:aY.template_url,className:"cfg-link",children:aY.template_url}):aY.template_url:"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Import schema version"}),(0,b.jsx)("dd",{className:"text-right",children:aY.import_schema_version??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Import operation ID"}),(0,b.jsx)("dd",{className:"text-right break-all",children:aY.import_operation_id??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-y cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Imported at"}),(0,b.jsx)("dd",{className:"text-right",children:aY.import_timestamp?v(aY.import_timestamp):"—"})]})]}),(0,b.jsx)(q,{phase:aB,onImport:()=>{aC()}})]})]}),(0,b.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"secondary",children:[(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsx)("h2",{className:"cfg-title mb-3",children:"Launch snapshots"}),0===a_.length?(0,b.jsx)("p",{className:"text-sm cfg-muted",children:"No launches recorded yet."}):(0,b.jsx)("ul",{className:"space-y-3",children:a_.map(a=>{let c=a.hash===a$,d=!!aa[a.id];return(0,b.jsxs)("li",{className:"cfg-row",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsxs)("p",{className:"text-sm",children:[v(a.created_at)," · ",a.id.slice(0,4),a.transport?` \xb7 ${a.transport}`:null]}),(0,b.jsx)("button",{onClick:()=>ab(b=>({...b,[a.id]:!b[a.id]})),"aria-label":d?"Collapse snapshot detail":"Expand snapshot detail",className:"cfg-chevron px-1",children:d?"▾":"▸"})]}),(0,b.jsxs)("p",{className:"mt-1 text-sm",children:[(0,b.jsx)("code",{className:"cfg-code",children:a.hash.slice(0,12)})," ",(0,b.jsx)("button",{onClick:()=>aO(a.id,a.hash),className:"cfg-link text-sm",children:ac===a.id?"Copied":"Copy"})]}),(0,b.jsx)("p",{className:"mt-1 text-sm",children:c?(0,b.jsx)("span",{className:"cfg-ok",children:"● Matches current config"}):(0,b.jsx)("span",{className:"cfg-faint",children:"○ Config changed since"})}),d&&(0,b.jsxs)("div",{className:"mt-3 pt-3 border-t cfg-line text-sm",children:[(0,b.jsxs)("p",{className:"cfg-muted break-all",children:[(0,b.jsx)("span",{className:"font-medium",children:"Launch ID:"})," ",a.id]}),(0,b.jsxs)("p",{className:"mt-1 cfg-muted break-all",children:[(0,b.jsx)("span",{className:"font-medium",children:"Hash:"})," ",(0,b.jsx)("code",{className:"cfg-code",children:a.hash})]}),(0,b.jsx)("dl",{className:"mt-2",children:t.map(c=>{let d=a.snapshot[c.key];return(0,b.jsxs)("div",{className:"py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:c.label}),(0,b.jsx)("dd",{className:"whitespace-pre-wrap break-words",children:null==d?(0,b.jsx)("span",{className:"cfg-faint",children:"null"}):Array.isArray(d)?0===d.length?(0,b.jsx)("span",{className:"cfg-faint",children:"(none)"}):(0,b.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:d.map(a=>`- ${a}`).join("\n")}):"boolean"==typeof d?String(d):""===d?(0,b.jsx)("span",{className:"cfg-faint",children:"(empty)"}):(0,b.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:d})})]},c.key)})})]})]},a.id)})})]}),(0,b.jsx)(h,{agentId:aY.id,agentName:aY.name}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Avatar"}),a4]}),(0,b.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,b.jsx)(n.default,{config:aL,size:96,title:"Avatar live preview"}),(0,b.jsx)("p",{className:"text-sm cfg-muted",children:"Outline style: the color is the line color, nothing is filled. Pick an option to preview, then Save."})]}),(0,b.jsx)(o,{attribute:"color",label:"Color",options:r.AVATAR_COLORS,current:aL,onPick:aT,className:"mb-3"}),(0,b.jsx)(o,{attribute:"eyes",label:"Eyes",options:r.AVATAR_EYES,current:aL,onPick:aT,className:"mb-3"}),(0,b.jsx)(o,{attribute:"hands",label:"Hands",options:r.AVATAR_HANDS,current:aL,onPick:aT,className:"mb-3"}),(0,b.jsx)(o,{attribute:"accessory",label:"Accessory",options:r.AVATAR_ACCESSORIES,current:aL,onPick:aT}),"error"===av&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",ax,"."," ",(0,b.jsx)("button",{onClick:aU,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aU,disabled:!aM||"saving"===av,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===av?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:function(){au(null),aw("clean"),ay("")},disabled:!aM||"saving"===av,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,b.jsxs)("section",{className:"cfg-card cfg-danger","aria-labelledby":"cfg-danger-title",children:[(0,b.jsx)("h2",{id:"cfg-danger-title",className:"cfg-title mb-3",children:"Danger zone"}),(0,b.jsx)("p",{className:"text-sm cfg-muted",children:i.DELETE_REMOVES_COPY}),(0,b.jsx)("p",{className:"text-sm cfg-faint mt-2",children:i.DELETE_KEEPS_COPY}),(0,b.jsx)("button",{type:"button",onClick:()=>z(!0),className:"mt-3 delete-btn text-sm w-full sm:w-auto",children:"Delete agent"})]})]})]})]}),y?(0,b.jsx)(f.default,{ids:[aY.id],onCancel:()=>z(!1),onDeleted:a=>u.push(`/?deleted=${Math.max(a.length,1)}`)}):null]})}],48219)}];
|
|
1
|
+
module.exports=[48219,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(50944),f=a.i(60193),g=a.i(23464);function h({agentId:a,agentName:d}){let e=(0,c.useId)(),f=(0,c.useId)(),i=(0,c.useId)(),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(0),[p,q]=(0,c.useState)("idle"),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),[v,w]=(0,c.useState)(""),[x,y]=(0,c.useState)(""),[z,A]=(0,c.useState)("");(0,c.useEffect)(()=>{let b=!1;return fetch(`/api/bots/${encodeURIComponent(a)}/share-policy`,{cache:"no-store"}).then(async a=>{let c=await a.json().catch(()=>null);b||(a.ok&&c?.policy?(m(""),k(c.policy)):m("Could not load the share policy."))}).catch(()=>{b||m("Could not load the share policy.")}),()=>{b=!0}},[a,n]);let B=()=>{s(""),q("idle"),o(a=>a+1)},C=async(b,c)=>{if(!j)return!1;q("saving"),s(""),u("");try{let d=await fetch(`/api/bots/${encodeURIComponent(a)}/share-policy`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({revision:j.revision,...b})}),e=await d.json().catch(()=>null);if(!d.ok||!e?.policy)return q("error"),s("string"==typeof e?.error?.message?e.error.message:"The share policy could not be saved."),!1;return k(e.policy),q("idle"),u(c("number"==typeof e.revoked_contexts?e.revoked_contexts:0)),!0}catch{return q("error"),s("The share policy could not be saved."),!1}},D=async a=>{if(a.preventDefault(),!j)return;let b=(0,g.audienceInputError)(v,x,j.audiences);if(A(b??""),b)return;let c={kind:"slack",team_id:v.trim(),channel_id:x.trim()};await C({audiences:[...j.audiences,c]},()=>`Added ${(0,g.audienceLabel)(c)}.`)&&(w(""),y(""))},E="saving"===p,F=!!j&&"invalid"!==j.state;return(0,b.jsxs)("section",{className:"cfg-card share-policy",id:"session-sharing","aria-labelledby":"cfg-sharing-title",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{id:"cfg-sharing-title",className:"cfg-title",children:"Session sharing"}),E?(0,b.jsx)("span",{className:"text-sm cfg-faint",role:"status",children:"Saving…"}):null]}),(0,b.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:["A share lets people in one Slack channel ask one of ",d,"’s sessions questions, read-only, until it expires or you revoke it. Create and revoke shares from Sessions."]}),l?(0,b.jsxs)("p",{className:"text-sm cfg-error",role:"alert",children:[l," ",(0,b.jsx)("button",{type:"button",onClick:B,className:"underline hover:no-underline",children:"Retry"})]}):null,j||l?null:(0,b.jsx)("p",{className:"text-sm cfg-faint",role:"status",children:"Loading…"}),j?.state==="invalid"?(0,b.jsxs)("p",{className:"text-sm cfg-error mb-3",role:"alert",children:["The share policy file is invalid, so nothing can be shared: ",j.reason," Fix or remove config/session-shares.json, then"," ",(0,b.jsx)("button",{type:"button",onClick:B,className:"underline hover:no-underline",children:"reload"}),"."]}):null,j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"share-policy-toggle",children:[(0,b.jsx)("input",{id:e,type:"checkbox",role:"switch",checked:j.agent.share_from_turn,"aria-checked":j.agent.share_from_turn,disabled:!F||E||!j.agent.share_current.supported&&!j.agent.share_from_turn,"data-share-policy":"share_from_turn",onChange:a=>{let b=a.target.checked;C({share_from_turn:b},a=>b?"Share from a turn is on.":`Share from a turn is off.${a?` Revoked ${a} live turn context${1===a?"":"s"}.`:""}`)}}),(0,b.jsxs)("label",{htmlFor:e,className:"text-sm",children:[(0,b.jsx)("span",{className:"font-medium",children:"Share from a turn"})," (",(0,b.jsx)("code",{className:"cfg-code",children:"share_from_turn"}),")"]})]}),(0,b.jsx)("p",{className:"text-sm cfg-faint share-policy-hint",children:(0,g.shareFromTurnNote)(j)}),j.agent.live_contexts>0?(0,b.jsxs)("p",{className:"text-sm cfg-faint share-policy-hint",children:[j.agent.live_contexts," live turn context",1===j.agent.live_contexts?"":"s"," now."]}):null,(0,b.jsx)("h3",{className:"cfg-title share-policy-sub",children:"Slack channel allowlist"}),(0,b.jsx)("p",{className:"text-sm cfg-faint",children:"Every agent’s shares use this list. A share can only go to a channel on it."}),0===j.audiences.length?(0,b.jsx)("p",{className:"text-sm cfg-muted share-policy-empty",children:"No channel yet: nothing can be shared to Slack."}):(0,b.jsx)("ul",{className:"share-policy-list","aria-label":"Allowed Slack channels",children:j.audiences.map(a=>(0,b.jsxs)("li",{className:"share-policy-entry",children:[(0,b.jsx)("span",{className:"cfg-code",children:a.channel_id}),(0,b.jsxs)("span",{className:"cfg-faint",children:["workspace ",a.team_id]}),(0,b.jsx)("button",{type:"button",className:"cfg-link text-sm share-policy-remove",disabled:!F||E,"aria-label":`Remove ${(0,g.audienceLabel)(a)}`,onClick:()=>{j&&C({audiences:j.audiences.filter(b=>b.team_id!==a.team_id||b.channel_id!==a.channel_id)},()=>`Removed ${(0,g.audienceLabel)(a)}. Its Slack threads stop being answered.`)},children:"Remove"})]},`${a.team_id}:${a.channel_id}`))}),(0,b.jsxs)("form",{className:"share-policy-add",onSubmit:a=>{D(a)},"aria-label":"Add a Slack channel",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:f,className:"text-sm",children:"Workspace ID"}),(0,b.jsx)("input",{id:f,className:"cfg-input",value:v,placeholder:"T0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!F||E,"aria-invalid":!!z,onChange:a=>{w(a.target.value),A("")}})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:i,className:"text-sm",children:"Channel ID"}),(0,b.jsx)("input",{id:i,className:"cfg-input",value:x,placeholder:"C0123ABCD",autoComplete:"off",spellCheck:!1,disabled:!F||E,"aria-invalid":!!z,onChange:a=>{y(a.target.value),A("")}})]}),(0,b.jsx)("button",{type:"submit",className:"cfg-btn-primary text-sm",disabled:!F||E||!v.trim()||!x.trim(),children:"Add channel"})]}),z?(0,b.jsx)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:z}):null,"error"===p?(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:["Couldn't save: ",r," ",(0,b.jsx)("button",{type:"button",onClick:B,className:"underline hover:no-underline",children:"Reload"})]}):null,(0,b.jsx)("p",{className:"mt-2 text-sm cfg-ok",role:"status",children:t})]}):null]})}var i=a.i(35832),j=a.i(20851),k=a.i(1160),l=a.i(22855),m=a.i(79202),n=a.i(36391);function o({attribute:a,label:d,options:e,current:f,onPick:g,className:h}){let i=(0,c.useId)(),j=`avatar-${a}`;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{id:i,className:"avatar-group-label",children:d}),(0,b.jsx)("div",{className:h?`avatar-opt-grid ${h}`:"avatar-opt-grid",role:"radiogroup","aria-labelledby":i,children:e.map(c=>(0,b.jsxs)("label",{title:c.label,className:"avatar-opt",children:[(0,b.jsx)("input",{type:"radio",name:j,value:c.id,checked:f[a]===c.id,onChange:()=>g({[a]:c.id}),className:"avatar-opt-input"}),(0,b.jsx)("span",{className:"avatar-opt-art","aria-hidden":"true",children:(0,b.jsx)(n.default,{config:{...f,[a]:c.id},size:44})}),(0,b.jsx)("span",{children:c.label})]},c.id))})]})}var p=a.i(80219);function q({phase:a,onImport:c}){let d=(0,p.marketImportView)(a);return(0,b.jsxs)("div",{className:"mt-3","data-field":"marketplace-import",children:[(0,b.jsx)("button",{type:"button",onClick:c,disabled:d.busy,"aria-busy":d.busy,"aria-describedby":"cfg-market-import-status",className:"cfg-btn-ghost text-sm w-full sm:w-auto",children:"Import from Grok Marketplace"}),(0,b.jsx)("p",{id:"cfg-market-import-status",role:"status","aria-live":"polite",className:"error"===d.tone?"mt-2 text-sm cfg-error":"mt-2 text-xs cfg-faint",children:d.message})]})}var r=a.i(5020);let s="Fix the highlighted fields.",t=[{key:"avatar_accessory",label:"Avatar accessory"},{key:"avatar_color",label:"Avatar color"},{key:"avatar_eyes",label:"Avatar eyes"},{key:"avatar_hands",label:"Avatar hands"},{key:"description",label:"Description (rules)"},{key:"import_operation_id",label:"Import operation ID"},{key:"import_schema_version",label:"Import schema version"},{key:"memories",label:"Remembered facts"},{key:"name",label:"Name"},{key:"skill_content",label:"Skill content"},{key:"skill_path",label:"Skill path"},{key:"skill_present",label:"Skill present"},{key:"source_provider",label:"Source provider"},{key:"template_id",label:"Template ID"},{key:"template_url",label:"Template URL"},{key:"title",label:"Title"}];function u(a){return String(a).padStart(2,"0")}function v(a){let b=new Date(a);return`${b.getFullYear()}-${u(b.getMonth()+1)}-${u(b.getDate())} ${u(b.getHours())}:${u(b.getMinutes())}`}function w(a){let b=new Date(a);return`${u(b.getHours())}:${u(b.getMinutes())}:${u(b.getSeconds())}`}async function x(a){try{return await navigator.clipboard.writeText(a),!0}catch{return!1}}a.s(["default",0,function(){var a;let g=String((0,e.useParams)().id??""),u=(0,e.useRouter)(),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(null),[C,D]=(0,c.useState)(!0),[E,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(0),[K,L]=(0,c.useState)(null),[M,N]=(0,c.useState)("clean"),[O,P]=(0,c.useState)(""),[Q,R]=(0,c.useState)(0),[S,T]=(0,c.useState)(!1),[U,V]=(0,c.useState)(""),[W,X]=(0,c.useState)("clean"),[Y,Z]=(0,c.useState)(""),[$,_]=(0,c.useState)(0),[aa,ab]=(0,c.useState)({}),[ac,ad]=(0,c.useState)(""),[ae,af]=(0,c.useState)(!1),[ag,ah]=(0,c.useState)(null),[ai,aj]=(0,c.useState)(!1),ak=(0,m.useRuntimeConnections)(),[al,am]=(0,c.useState)(void 0),[an,ao]=(0,c.useState)("clean"),[ap,aq]=(0,c.useState)(""),[ar,as]=(0,c.useState)(0),[at,au]=(0,c.useState)(null),[av,aw]=(0,c.useState)("clean"),[ax,ay]=(0,c.useState)(""),[az,aA]=(0,c.useState)(0),{phase:aB,startImport:aC}=function(a){let[b,d]=(0,c.useState)("idle");return(0,c.useEffect)(()=>{let b=window.location.search;if(null===(0,p.importedBotId)(b))return;let c=new URL(window.location.href);c.searchParams.delete(p.IMPORT_RETURN_QUERY),window.history.replaceState(null,"",c.pathname+c.search);let e=!1;return(0,p.resolveImportReturn)(b,a,async a=>(await fetch(`/api/bots/${encodeURIComponent(a)}/config`,{cache:"no-store"})).ok).then(a=>{e||("open"===a.kind?window.location.replace(a.path):"missing"===a.kind&&d("missing"))}),()=>{e=!0}},[a]),{phase:b,startImport:async function(){d("checking");try{let a=await fetch(p.HANDOFF_STATUS_PATH,{cache:"no-store"}),b=await a.json().catch(()=>null);if(!a.ok)return void d("failed");if(b?.configured!==!0)return void d("unavailable");d("redirecting"),window.location.href=(0,p.handoffStartPath)(window.location.origin,window.location.pathname),setTimeout(()=>d(a=>"redirecting"===a?"idle":a),4e3)}catch{d("failed")}}}}(g);function aD(){D(!0),F(!1),J(a=>a+1)}(0,c.useEffect)(()=>{if(!g)return;let a=!1;return fetch(`/api/bots/${encodeURIComponent(g)}/sessions?status=all`,{cache:"no-store"}).then(a=>a.ok?a.json():null).then(b=>{a||am((b?.sessions??[]).map(a=>({ref:a.ref,title:a.title,status:a.status})))}).catch(()=>{a||am([])}),()=>{a=!0}},[g,I]),(0,c.useEffect)(()=>{if(!g)return;let a=!1;return fetch(`/api/bots/${encodeURIComponent(g)}/config`).then(async b=>{if(a)return;if(404===b.status){H(!0),B(null);return}if(!b.ok)throw Error("request failed");let c=await b.json();a||(B(c),L(c.bot.description??""),H(!1),F(!1))}).catch(()=>{a||F(!0)}).finally(()=>{a||D(!1)}),()=>{a=!0}},[g,I]);let aE=A?.bot.description??"",aF=null!==K&&K!==aE,aG=A?.skill.content??"",aH=S&&U!==aG,aI=A?(0,k.registrationFormFromBot)(A.bot):null,aJ=ae&&null!==ag&&JSON.stringify(ag)!==JSON.stringify(aI),aK=A?.bot.avatar_config??(0,r.resolveAvatar)(A?.bot??{}),aL=at??aK,aM=null!==at&&JSON.stringify(at)!==JSON.stringify(aK),aN=aF||aH||aJ||aM;function aO(a,b){x(b).then(b=>{b&&(ad(a),setTimeout(()=>ad(b=>b===a?"":b),2e3))})}async function aP(){if(A&&null!==K){N("saving"),P("");try{let a=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:A.bot.id,description:K})});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await fetch(`/api/bots/${encodeURIComponent(g)}/config`);if(!b.ok)throw Error("request failed");B(await b.json()),N("confirmed"),R(Date.now()),setTimeout(()=>{N(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){N("error"),P(a instanceof Error?a.message:"request failed")}}}function aQ(){A&&(ah((0,k.registrationFormFromBot)(A.bot)),af(!0),aj(!1),ao("clean"),aq(""),ak.retry())}function aR(a){ah(b=>b?{...b,...a}:b),aq(""),ao(a=>"error"===a?"clean":a)}function aS(){af(!1),ah(null),ao("clean"),aq("")}function aT(a){au({...at??aK,...a}),aw("clean"),ay("")}async function aU(){if(A&&at){aw("saving"),ay("");try{let a=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:A.bot.id,avatar:at})});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await fetch(`/api/bots/${encodeURIComponent(g)}/config`);if(!b.ok)throw Error("request failed");B(await b.json()),au(null),aw("confirmed"),aA(Date.now()),setTimeout(()=>{aw(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){aw("error"),ay(a instanceof Error?a.message:"request failed")}}}async function aV(){if(A&&ag){if((0,k.hasRegistrationErrors)((0,k.registrationFormView)(ag,ak.state))){aj(!0),ao("error"),aq(s);return}ao("saving"),aq("");try{let a=await fetch("/api/bots",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,k.registrationPatchBody)(A.bot.id,ag))});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await fetch(`/api/bots/${encodeURIComponent(g)}/config`);if(!b.ok)throw Error("request failed");B(await b.json()),af(!1),ah(null),ao("confirmed"),as(Date.now()),setTimeout(()=>{ao(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){ao("error"),aq(a instanceof Error?a.message:"request failed")}}}function aW(){V(A?.skill.content??""),T(!0),X("clean"),Z("")}async function aX(){if(A&&(U.trim()||window.confirm("Delete this skill file?"))){X("saving"),Z("");try{let a=await fetch(`/api/bots/${encodeURIComponent(g)}/skill`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:U})});if(!a.ok){let b="request failed";try{let c=await a.json();c.error&&(b=c.error)}catch{}throw Error(b)}let b=await a.json();B(a=>a?{...a,skill:b.skill,currentHash:b.currentHash}:a),T(!1),X("confirmed"),_(Date.now()),setTimeout(()=>{X(a=>"confirmed"===a?"clean":a)},5e3)}catch(a){X("error"),Z(a instanceof Error?a.message:"request failed")}}}if((0,c.useEffect)(()=>{if(!aN)return;let a=a=>{a.preventDefault()};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[aN]),G)return(0,b.jsx)("div",{className:"cfg-page cfg-page-framed",children:(0,b.jsxs)("div",{className:"agent-state",children:[(0,b.jsx)("h2",{children:"Agent not found"}),(0,b.jsx)("p",{children:"This agent does not exist or was removed."}),(0,b.jsx)(d.default,{href:"/",children:"Choose an agent"})]})});if(C&&!A)return(0,b.jsx)("div",{className:"cfg-page cfg-page-framed",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto space-y-6",children:[(0,b.jsx)("div",{className:"h-12 rounded-lg animate-pulse cfg-skel"}),(0,b.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,b.jsx)("div",{className:"space-y-6",children:[0,1,2].map(a=>(0,b.jsx)("div",{className:"h-48 rounded-lg animate-pulse cfg-skel"},a))}),(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)("div",{className:"h-64 rounded-lg animate-pulse cfg-skel"}),(0,b.jsx)("div",{className:"h-80 rounded-lg animate-pulse cfg-skel"})]})]})]})});if(E&&!A)return(0,b.jsx)("div",{className:"cfg-page cfg-page-framed",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,b.jsxs)("header",{className:"mb-6 flex flex-wrap items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Config"}),(0,b.jsx)("h2",{className:"text-xl font-bold truncate",children:"Couldn't load agent details"})]}),(0,b.jsxs)("div",{className:"ml-auto text-right",children:[(0,b.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash: ",(0,b.jsx)("code",{className:"cfg-code",children:"—"})]}),(0,b.jsx)("p",{className:"text-sm mt-1",children:(0,b.jsx)("span",{className:"cfg-faint",children:"○ Not loaded"})})]})]}),(0,b.jsx)("div",{className:"grid gap-6 lg:grid-cols-2 items-start",children:[["Skills","Rules","Agent","Template source"],["Launch snapshots","Avatar"]].map(a=>(0,b.jsx)("div",{className:"min-w-0 space-y-6",children:a.map(a=>(0,b.jsxs)("div",{className:"cfg-card",children:[(0,b.jsx)("h2",{className:"cfg-title mb-2",children:a}),(0,b.jsxs)("p",{className:"text-sm cfg-muted",children:["Couldn't load this section."," ",(0,b.jsx)("button",{onClick:aD,className:"cfg-link",children:"Retry"})]})]},a))},a[0]))})]})});if(!A)return null;let{bot:aY,skill:aZ,currentHash:a$,snapshots:a_}=A,a0=!!(aY.source_provider||aY.template_id||aY.template_url||aY.import_schema_version||aY.import_operation_id),a1="saving"===M?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aF||"error"===M?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===M?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",w(Q)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),a2="saving"===W?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aH||"error"===W?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===W?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",w($)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),a3="saving"===an?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aJ||"error"===an?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===an?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",w(ar)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"}),a4="saving"===av?(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saving…"}):aM||"error"===av?(0,b.jsxs)("span",{className:"text-sm cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):"confirmed"===av?(0,b.jsxs)("span",{className:"text-sm cfg-faint",children:["Saved ",w(az)]}):(0,b.jsx)("span",{className:"text-sm cfg-faint",children:"Saved"});return(0,b.jsxs)("div",{className:"cfg-page cfg-page-framed",children:[(0,b.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,b.jsxs)("header",{className:"mb-6 flex flex-wrap items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"agent-eyebrow",children:"Config"}),(0,b.jsx)("h2",{className:"text-xl font-bold truncate",children:"Standing setup"})]}),(0,b.jsxs)("div",{className:"ml-auto text-right",children:[(0,b.jsxs)("p",{className:"text-sm cfg-muted",children:["Current config hash:"," ",(0,b.jsx)("code",{className:"cfg-code",title:a$,children:a$.slice(0,8)})," ",(0,b.jsx)("button",{onClick:()=>aO("header",a$),className:"cfg-link text-sm",children:"header"===ac?"Copied":"Copy"})]}),(0,b.jsx)("p",{className:"text-sm mt-1",children:aN?(0,b.jsxs)("span",{className:"cfg-dirty",children:[(0,b.jsx)("span",{className:"inline-block w-2 h-2 rounded-full cfg-dot-amber mr-1"}),"Unsaved changes"]}):(0,b.jsx)("span",{className:"cfg-faint",children:"● Saved"})})]})]}),(0,b.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2 items-start","data-cfg-layout":"columns",children:[(0,b.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"primary",children:[(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Skills"}),a2]}),"unsupported"===aZ.status?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Unsupported name"}),(0,b.jsx)("p",{className:"text-sm cfg-muted",children:"Skill files need an agent name matching /^[A-Za-z0-9_-]+$/ — this name cannot map to a skill path."})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"text-sm cfg-muted mb-3",children:[aZ.path," · ","present"===aZ.status?"Present":"Not present"]}),S?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("textarea",{value:U,onChange:a=>V(a.target.value),rows:8,className:"cfg-input text-sm"}),"error"===W&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",Y,"."," ",(0,b.jsx)("button",{onClick:aX,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aX,disabled:!aH||"saving"===W,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===W?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:function(){T(!1),X("clean"),Z("")},disabled:!aH||"saving"===W,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}):"present"===aZ.status?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("pre",{className:"text-sm cfg-pre max-h-64 overflow-y-auto",children:aZ.content}),(0,b.jsx)("button",{onClick:aW,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"text-sm cfg-muted",children:"No skill file yet. Create SKILL.md to give this agent standing instructions."}),(0,b.jsx)("button",{onClick:aW,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Create"})]}),(0,b.jsx)("p",{className:"mt-3 text-xs cfg-faint",children:"Appended verbatim as a system message at launch."})]})]}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Rules"}),a1]}),(0,b.jsx)("textarea",{value:K??"",onChange:a=>L(a.target.value),rows:8,className:"cfg-input cfg-input-sans text-sm"}),(0,b.jsx)("p",{className:"mt-2 text-xs cfg-faint",children:"Sent verbatim as the standing-rules system message on every turn. This beats the user's request for detail or length."}),"error"===M&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",O,"."," ",(0,b.jsx)("button",{onClick:aP,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aP,disabled:!aF||"saving"===M,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===M?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:function(){L(aE),N("clean"),P("")},disabled:!aF||"saving"===M,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Agent"}),a3]}),(()=>{if(!ae||!ag){let a=(0,k.registrationReadView)(aY,al);return(0,b.jsxs)("div",{"data-field":"runtime-read",children:[(0,b.jsx)("dl",{className:"text-sm",children:a.rows.map(a=>(0,b.jsxs)("div",{"data-row":a.key,className:"flex flex-col sm:flex-row sm:justify-between gap-x-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:a.label}),(0,b.jsx)("dd",{className:"sm:text-right break-words cfg-muted",children:a.value})]},a.key))}),a.notices.map(a=>(0,b.jsx)("p",{className:"text-sm cfg-dirty mt-2",children:a},a)),(0,b.jsx)("button",{onClick:aQ,className:"mt-3 cfg-btn-ghost text-sm w-full sm:w-auto",children:"Edit"})]})}let a=(0,k.registrationFormView)(ag,ak.state);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.RegistrationFields,{idPrefix:"cfg",variant:"config",form:ag,onChange:aR,view:a,showErrors:ai,connections:ak.state,onRetryConnections:ak.retry,onAddConnection:ak.add,workspacePlaceholder:(0,j.defaultWorkdirFor)(aY.id),workspaceHint:(0,j.configWorkspaceHint)(aY.id),sessions:al,includeHomeSession:!0}),"error"===an&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",role:"alert",children:[ap===s?ap:`Couldn't save: ${ap}.`," ",ap===s?null:(0,b.jsx)("button",{onClick:aV,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aV,disabled:!aJ||"saving"===an||a.submitDisabled,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===an?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:aS,disabled:"saving"===an,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:aJ?"Discard":"Cancel"})]})]})})()]}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsx)("h2",{className:"cfg-title mb-3",children:"Template source"}),!a0&&(0,b.jsx)("p",{className:"text-sm cfg-muted mb-3",children:"Created manually in Botmancers — no template source."}),(0,b.jsxs)("dl",{className:"text-sm",children:[(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Source provider"}),(0,b.jsx)("dd",{className:"text-right",children:aY.source_provider??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Template ID"}),(0,b.jsx)("dd",{className:"text-right",children:aY.template_id??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Template URL"}),(0,b.jsx)("dd",{className:"text-right break-all",children:aY.template_url?(a=aY.template_url).startsWith("http://")||a.startsWith("https://")?(0,b.jsx)("a",{href:aY.template_url,className:"cfg-link",children:aY.template_url}):aY.template_url:"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Import schema version"}),(0,b.jsx)("dd",{className:"text-right",children:aY.import_schema_version??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Import operation ID"}),(0,b.jsx)("dd",{className:"text-right break-all",children:aY.import_operation_id??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between gap-4 py-1 border-y cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:"Imported at"}),(0,b.jsx)("dd",{className:"text-right",children:aY.import_timestamp?v(aY.import_timestamp):"—"})]})]}),(0,b.jsx)(q,{phase:aB,onImport:()=>{aC()}})]})]}),(0,b.jsxs)("div",{className:"min-w-0 space-y-6","data-cfg-column":"secondary",children:[(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsx)("h2",{className:"cfg-title mb-3",children:"Launch snapshots"}),0===a_.length?(0,b.jsx)("p",{className:"text-sm cfg-muted",children:"No launches recorded yet."}):(0,b.jsx)("ul",{className:"space-y-3",children:a_.map(a=>{let c=a.hash===a$,d=!!aa[a.id];return(0,b.jsxs)("li",{className:"cfg-row",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsxs)("p",{className:"text-sm",children:[v(a.created_at)," · ",a.id.slice(0,4),a.transport?` \xb7 ${a.transport}`:null]}),(0,b.jsx)("button",{onClick:()=>ab(b=>({...b,[a.id]:!b[a.id]})),"aria-label":d?"Collapse snapshot detail":"Expand snapshot detail",className:"cfg-chevron px-1",children:d?"▾":"▸"})]}),(0,b.jsxs)("p",{className:"mt-1 text-sm",children:[(0,b.jsx)("code",{className:"cfg-code",children:a.hash.slice(0,12)})," ",(0,b.jsx)("button",{onClick:()=>aO(a.id,a.hash),className:"cfg-link text-sm",children:ac===a.id?"Copied":"Copy"})]}),(0,b.jsx)("p",{className:"mt-1 text-sm",children:c?(0,b.jsx)("span",{className:"cfg-ok",children:"● Matches current config"}):(0,b.jsx)("span",{className:"cfg-faint",children:"○ Config changed since"})}),d&&(0,b.jsxs)("div",{className:"mt-3 pt-3 border-t cfg-line text-sm",children:[(0,b.jsxs)("p",{className:"cfg-muted break-all",children:[(0,b.jsx)("span",{className:"font-medium",children:"Launch ID:"})," ",a.id]}),(0,b.jsxs)("p",{className:"mt-1 cfg-muted break-all",children:[(0,b.jsx)("span",{className:"font-medium",children:"Hash:"})," ",(0,b.jsx)("code",{className:"cfg-code",children:a.hash})]}),(0,b.jsx)("dl",{className:"mt-2",children:t.map(c=>{let d=a.snapshot[c.key];return(0,b.jsxs)("div",{className:"py-1 border-t cfg-line",children:[(0,b.jsx)("dt",{className:"cfg-faint",children:c.label}),(0,b.jsx)("dd",{className:"whitespace-pre-wrap break-words",children:null==d?(0,b.jsx)("span",{className:"cfg-faint",children:"null"}):Array.isArray(d)?0===d.length?(0,b.jsx)("span",{className:"cfg-faint",children:"(none)"}):(0,b.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:d.map(a=>`- ${a}`).join("\n")}):"boolean"==typeof d?String(d):""===d?(0,b.jsx)("span",{className:"cfg-faint",children:"(empty)"}):(0,b.jsx)("span",{className:"block max-h-32 overflow-y-auto",children:d})})]},c.key)})})]})]},a.id)})})]}),(0,b.jsx)(h,{agentId:aY.id,agentName:aY.name}),(0,b.jsxs)("section",{className:"cfg-card",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"cfg-title",children:"Avatar"}),a4]}),(0,b.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,b.jsx)(n.default,{config:aL,size:96,title:"Avatar live preview"}),(0,b.jsx)("p",{className:"text-sm cfg-muted",children:"Outline style: the color is the line color, nothing is filled. Pick an option to preview, then Save."})]}),(0,b.jsx)(o,{attribute:"color",label:"Color",options:r.AVATAR_COLORS,current:aL,onPick:aT,className:"mb-3"}),(0,b.jsx)(o,{attribute:"eyes",label:"Eyes",options:r.AVATAR_EYES,current:aL,onPick:aT,className:"mb-3"}),(0,b.jsx)(o,{attribute:"hands",label:"Hands",options:r.AVATAR_HANDS,current:aL,onPick:aT,className:"mb-3"}),(0,b.jsx)(o,{attribute:"accessory",label:"Accessory",options:r.AVATAR_ACCESSORIES,current:aL,onPick:aT}),"error"===av&&(0,b.jsxs)("p",{className:"mt-2 text-sm cfg-error",children:["Couldn't save: ",ax,"."," ",(0,b.jsx)("button",{onClick:aU,className:"underline hover:no-underline",children:"Retry"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)("button",{onClick:aU,disabled:!aM||"saving"===av,className:"flex-1 sm:flex-none cfg-btn-primary text-sm",children:"saving"===av?"Saving…":"Save"}),(0,b.jsx)("button",{onClick:function(){au(null),aw("clean"),ay("")},disabled:!aM||"saving"===av,className:"flex-1 sm:flex-none cfg-btn-ghost text-sm",children:"Discard"})]})]}),(0,b.jsxs)("section",{className:"cfg-card cfg-danger","aria-labelledby":"cfg-danger-title",children:[(0,b.jsx)("h2",{id:"cfg-danger-title",className:"cfg-title mb-3",children:"Danger zone"}),(0,b.jsx)("p",{className:"text-sm cfg-muted",children:i.DELETE_REMOVES_COPY}),(0,b.jsx)("p",{className:"text-sm cfg-faint mt-2",children:i.DELETE_KEEPS_COPY}),(0,b.jsx)("button",{type:"button",onClick:()=>z(!0),className:"mt-3 delete-btn text-sm w-full sm:w-auto",children:"Delete agent"})]})]})]})]}),y?(0,b.jsx)(f.default,{ids:[aY.id],onCancel:()=>z(!1),onDeleted:a=>u.push(`/?deleted=${Math.max(a.length,1)}`)}):null]})}],48219)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=app_agents_%5Bid%5D_config_page_tsx_1f_gu1l._.js.map
|