openmausbot 0.1.99 → 0.1.100
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/dist/assets/{ActivityPanel-CgUgtumZ.js → ActivityPanel-CA9zfl3_.js} +1 -1
- package/dist/assets/{BotSettingsDialog-lJj6oiir.js → BotSettingsDialog-3i_izROu.js} +1 -1
- package/dist/assets/{CloudBackendPicker-C5-_arUz.js → CloudBackendPicker-BR42-xBg.js} +1 -1
- package/dist/assets/{ComputerPanel-euJ2CSlH.js → ComputerPanel-CvThnFmt.js} +1 -1
- package/dist/assets/{DesktopViewer-XCln1Pn_.js → DesktopViewer-CqovWUic.js} +1 -1
- package/dist/assets/{InspectorPanel-DKYyQZlo.js → InspectorPanel-Cbjm86gt.js} +1 -1
- package/dist/assets/{KeyboardShortcutsModal-DkkZWZRI.js → KeyboardShortcutsModal-X13pVrkh.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-Cwt3_XSx.js → LocalVmWorkspace-BGD3Tvd3.js} +1 -1
- package/dist/assets/{MacLocalControl-B28RbdCS.js → MacLocalControl-ExdXHVUv.js} +1 -1
- package/dist/assets/{NewBotDialog-dMWDs5xm.js → NewBotDialog-ftDBMjWR.js} +1 -1
- package/dist/assets/{RemoteAgentSettingsPanel-B5KWXnqH.js → RemoteAgentSettingsPanel-BUHLV_vC.js} +1 -1
- package/dist/assets/{RoutinesPage-DOosRYDK.js → RoutinesPage-Buk5-r3o.js} +1 -1
- package/dist/assets/{RoutinesSection-uOfOTfkB.js → RoutinesSection-NyReOXr8.js} +1 -1
- package/dist/assets/{SettingsModal-BTGkFbj1.js → SettingsModal-DkkhdxKM.js} +1 -1
- package/dist/assets/{TeamMapPage-DqNdJn96.js → TeamMapPage-BIxeHoy3.js} +1 -1
- package/dist/assets/{TriggersPanel-c6xkG9mi.js → TriggersPanel-m5iqc43H.js} +1 -1
- package/dist/assets/{VisibilitySection-DD4ffIR5.js → VisibilitySection-y8Adk-c4.js} +1 -1
- package/dist/assets/{WebhooksPanel-Cz17K-_O.js → WebhooksPanel-G_NWjHOP.js} +1 -1
- package/dist/assets/{abnfDiagram-O67JEVCF-CX6tDpkg.js → abnfDiagram-O67JEVCF-D56ZgyPf.js} +1 -1
- package/dist/assets/{activity-BAVWO0Zj.js → activity-D_puBfZo.js} +1 -1
- package/dist/assets/{arc-h45-9NFk.js → arc-DzduGHbq.js} +1 -1
- package/dist/assets/{architectureDiagram-NJMV4G6O-CgLFXbg6.js → architectureDiagram-NJMV4G6O-C4NS6DQF.js} +1 -1
- package/dist/assets/{blockDiagram-BEXU5L5S-DGDFFc9M.js → blockDiagram-BEXU5L5S-BNvsskiE.js} +1 -1
- package/dist/assets/{brain-CeCdoTb2.js → brain-oq48IgWl.js} +1 -1
- package/dist/assets/{c4Diagram-YGBWAQC7-B9aklAUj.js → c4Diagram-YGBWAQC7-ch3B7xZy.js} +1 -1
- package/dist/assets/channel-CmFDMHrN.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-BC0KmWsM.js → chunk-2Q5K7J3B-D9dL9ZS7.js} +1 -1
- package/dist/assets/{chunk-3FUC2YCW-BbDFHsJ1.js → chunk-3FUC2YCW-DmLUUuNr.js} +2 -2
- package/dist/assets/{chunk-5VM5RSS4-DtGbsjOM.js → chunk-5VM5RSS4-B90ODeo2.js} +1 -1
- package/dist/assets/{chunk-GTNCS2PH-VMghMcEl.js → chunk-GTNCS2PH-BtlGIG3W.js} +1 -1
- package/dist/assets/{chunk-GWA4HPMP-BP_JyGWQ.js → chunk-GWA4HPMP-CurBwFFG.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-CYFyzgAU.js → chunk-JWPE2WC7-DTjNNXcd.js} +1 -1
- package/dist/assets/{chunk-NETBCI7D-DBNa_kqm.js → chunk-NETBCI7D-xS7hOqBJ.js} +1 -1
- package/dist/assets/{chunk-WEXAMYUT-BKEeM7CJ.js → chunk-WEXAMYUT-DJZBSyA9.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-C__m3ZXl.js → chunk-XXDRQBXY-CbiNRzjt.js} +1 -1
- package/dist/assets/{classDiagram-v2-NBCMYWYE-CBUrTSAX.js → classDiagram-v2-NBCMYWYE-DyON9tUb.js} +1 -1
- package/dist/assets/{core-6lvx-ypA.js → core-CRkAXD3N.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-GRfL-1Vb.js → cose-bilkent-JH36ORCC-C7UwNnp8.js} +1 -1
- package/dist/assets/{cynefin-OW5HDTMX-LopwGUjm.js → cynefin-OW5HDTMX-Dv1GTekc.js} +1 -1
- package/dist/assets/{cynefinDiagram-VND7K2PF-DSB8ZRNS.js → cynefinDiagram-VND7K2PF-CKgpyZxo.js} +1 -1
- package/dist/assets/{dagre-6A5THRUB-DL3Kgdfk.js → dagre-6A5THRUB-BY3cYc8R.js} +1 -1
- package/dist/assets/{diagram-22UHCM2B-DIxN34BM.js → diagram-22UHCM2B-D71jBFCO.js} +1 -1
- package/dist/assets/{diagram-3UASUU5V-CJnSvXaI.js → diagram-3UASUU5V-Bc3i6JGD.js} +1 -1
- package/dist/assets/{diagram-ATOU4E4O-C-XF-lO8.js → diagram-ATOU4E4O-BPDSHISG.js} +1 -1
- package/dist/assets/{diagram-CDSNMT55-Df2yZPi_.js → diagram-CDSNMT55-xuCT1v32.js} +1 -1
- package/dist/assets/{diagram-MLGK6HIB-BBs9oZFs.js → diagram-MLGK6HIB-LEDTXDPg.js} +1 -1
- package/dist/assets/{diagram-MPIPVDR6-CEbK11mM.js → diagram-MPIPVDR6-B0kfscRD.js} +1 -1
- package/dist/assets/{ebnfDiagram-ZINNZB2B-BNq6Yv3C.js → ebnfDiagram-ZINNZB2B-B-Z0HLzJ.js} +1 -1
- package/dist/assets/{elk-276RUBZZ-CFbQ2bGm.js → elk-276RUBZZ-Bzypn7lU.js} +1 -1
- package/dist/assets/{erDiagram-OPXOYQCR-Bz8vmjN4.js → erDiagram-OPXOYQCR-vl1xKmbS.js} +1 -1
- package/dist/assets/{flowDiagram-KWPJA3E3-cQUfEYrx.js → flowDiagram-KWPJA3E3-DQXCXm7z.js} +1 -1
- package/dist/assets/{ganttDiagram-FUAMR5RP-BY8n9tbI.js → ganttDiagram-FUAMR5RP-B0wwnP2j.js} +1 -1
- package/dist/assets/{gitGraphDiagram-X574FWY7-KduSOMDN.js → gitGraphDiagram-X574FWY7-HfEVZRuR.js} +1 -1
- package/dist/assets/{image-plus-DNIWU160.js → image-plus-D9o3v9bi.js} +1 -1
- package/dist/assets/{index-C8xb62XS.js → index-CyM91z0J.js} +111 -111
- package/dist/assets/{infoDiagram-VRGFBTTK-xBKgUkpL.js → infoDiagram-VRGFBTTK-BcCklxlu.js} +1 -1
- package/dist/assets/{ishikawaDiagram-OU5B5YK6-_ei09tAJ.js → ishikawaDiagram-OU5B5YK6-Bw7Fp8yZ.js} +1 -1
- package/dist/assets/{journeyDiagram-ZHPQQLJL-Fp49MkSp.js → journeyDiagram-ZHPQQLJL-BqFaTPiB.js} +1 -1
- package/dist/assets/{kanban-definition-PNTS6WVX-CY9lLm7V.js → kanban-definition-PNTS6WVX-BdGyimUh.js} +1 -1
- package/dist/assets/{linear-D2ai4eM2.js → linear-DezKjgv7.js} +1 -1
- package/dist/assets/{mermaid.core-DP6qPqu1.js → mermaid.core-97L7xtx0.js} +5 -5
- package/dist/assets/{mindmap-definition-NLK3R4M7-g1ynEw_d.js → mindmap-definition-NLK3R4M7-DP6qz87C.js} +1 -1
- package/dist/assets/{page-visible-BZn8304W.js → page-visible-BehtKJDm.js} +1 -1
- package/dist/assets/{pegDiagram-GJSIUBJH-Bt4ObsZj.js → pegDiagram-GJSIUBJH-CsYSloVz.js} +1 -1
- package/dist/assets/{pieDiagram-5QR66LMP-CeLld8bY.js → pieDiagram-5QR66LMP-CFI2Dcix.js} +1 -1
- package/dist/assets/{quadrantDiagram-O4NWA36T-D4WWZw3x.js → quadrantDiagram-O4NWA36T-DqTdAE5z.js} +1 -1
- package/dist/assets/{railroadDiagram-XR7U4H2S-D95P5NqU.js → railroadDiagram-XR7U4H2S-t_rszRIF.js} +1 -1
- package/dist/assets/{remote-desktop-panel-DOIMmT4T.js → remote-desktop-panel-WTaz_HI9.js} +1 -1
- package/dist/assets/{requirementDiagram-PLB6GJNP-D12p3RhR.js → requirementDiagram-PLB6GJNP-1MU-l7p8.js} +1 -1
- package/dist/assets/{sankeyDiagram-IPEJSGJF-Co26Dwcs.js → sankeyDiagram-IPEJSGJF-CtkrwAvo.js} +1 -1
- package/dist/assets/{sequenceDiagram-PO4LG4MO-y5YxaDKt.js → sequenceDiagram-PO4LG4MO-CJOwBubv.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-D49hZ8U5.js → sizeCapture-INFHLROL-DhQVhKCc.js} +1 -1
- package/dist/assets/{stateDiagram-v2-GCMORJYK-C0sylr-r.js → stateDiagram-v2-GCMORJYK-CaQK9yA9.js} +1 -1
- package/dist/assets/{swimlanes-2SLR337P-DmRWsDIs.js → swimlanes-2SLR337P-Ct8cqf01.js} +1 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-BBUcFKOA.js +8 -0
- package/dist/assets/{timeline-definition-EJHVYXUP-DVmHYs3w.js → timeline-definition-EJHVYXUP-qim2Km3q.js} +1 -1
- package/dist/assets/{usecaseDiagram-POWQR4AR-BQ1q0VV6.js → usecaseDiagram-POWQR4AR-BIzcxmgX.js} +1 -1
- package/dist/assets/{user-B9lohN4n.js → user-EQ8rI0f4.js} +1 -1
- package/dist/assets/{vennDiagram-UO4OBE2U-C_cnfST0.js → vennDiagram-UO4OBE2U-BFEuz8Ba.js} +1 -1
- package/dist/assets/{wardleyDiagram-VNRHLVJA-Bb3BSu12.js → wardleyDiagram-VNRHLVJA-JRkAN01c.js} +1 -1
- package/dist/assets/{xychartDiagram-PMCCYNJV-CcwEuuEi.js → xychartDiagram-PMCCYNJV-WBsvmu0R.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-server/index.js +9 -6
- package/dist-server/server/mcp-probe.js +18 -10
- package/package.json +1 -1
- package/dist/assets/channel-TsOXCiPg.js +0 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-DzhbBHtd.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as g,a as v,r,l as b,j as e,L as j,R as N,X as I,c as y}from"./index-
|
|
1
|
+
import{u as g,a as v,r,l as b,j as e,L as j,R as N,X as I,c as y}from"./index-CyM91z0J.js";import{g as C,o as A,f as E}from"./activity-D_puBfZo.js";const $=300,w={ok:"bg-accent/12 text-accent",danger:"bg-danger/15 text-danger",accent:"bg-accent/12 text-accent",warn:"bg-warning/15 text-warning"};function T({bot:t}){const{dispatch:o}=g(),{padClass:p}=v(),[n,u]=r.useState(null),[d,h]=r.useState(null),c=r.useRef(null),i=r.useCallback(async()=>{c.current?.abort();const s=new AbortController;c.current=s;try{const a=await fetch(`/api/bots/${t.id}/activity?limit=${$}`,{signal:s.signal});if(!a.ok)throw new Error(`${a.status}`);const x=await a.json();if(s.signal.aborted)return;u(x.rows),h(null)}catch(a){if(s.signal.aborted)return;h(a instanceof Error?a.message:String(a))}finally{c.current===s&&(c.current=null)}},[t.id]);r.useEffect(()=>(u(null),i(),()=>c.current?.abort()),[i]);const m=r.useMemo(()=>new Set([t.threadId,...(t.tasks??[]).map(s=>s.threadId)]),[t.threadId,t.tasks]);r.useEffect(()=>{let s=null;const a=b({onMissedFrames:()=>{i()},onFrame:x=>{if(x.kind!=="runtime")return;const l=x.event;m.has(l.threadId)&&(l.type==="turn.completed"||l.type==="runtime.error"||l.type==="request.opened"||l.type==="request.resolved"||l.type==="item.completed")&&(s&&clearTimeout(s),s=setTimeout(()=>{i()},400))}});return()=>{a(),s&&clearTimeout(s)}},[m,i]);const f=r.useMemo(()=>n?C(n,new Date):[],[n]),k=s=>{s.threadId!==t.threadId&&m.has(s.threadId)&&o({type:"switchTask",botId:t.id,threadId:s.threadId})};return e.jsxs("aside",{"aria-label":`${t.name} activity`,className:"animate-panel-in flex h-full w-[400px] max-w-full shrink-0 flex-col border-l border-hairline/40 bg-panel max-md:absolute max-md:inset-y-0 max-md:right-0 max-md:z-30",children:[e.jsxs("div",{className:y("flex items-center justify-between px-4 py-3",p),children:[e.jsxs("span",{className:"flex items-center gap-2 text-[15px] font-semibold text-ink",children:[e.jsx(j,{size:16,className:"text-ink-secondary"})," Activity"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>{i()},className:"rounded-md p-1 text-ink-secondary hover:bg-raised hover:text-ink",title:"Reload","aria-label":"Reload activity",children:e.jsx(N,{size:14})}),e.jsx("button",{onClick:()=>o({type:"toggleActivity",open:!1}),"aria-label":"Close Activity",title:"Close Activity",className:"rounded-md p-1 text-ink-secondary hover:bg-raised hover:text-ink",children:e.jsx(I,{size:18})})]})]}),e.jsxs("p",{className:"border-b border-hairline/40 px-4 pb-3 text-[12px] text-ink-secondary",children:["Every tool ",t.name," used and every approval it asked for, newest first."]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[d&&e.jsxs("div",{className:"px-4 py-3 text-[13px] text-danger",children:["couldn't load: ",d]}),n&&n.length===0&&!d&&e.jsxs("div",{className:"px-4 py-6 text-[13px] text-ink-secondary",children:["Nothing yet. Once ",t.name," runs a tool or asks for an approval, it shows up here."]}),!n&&!d&&e.jsx("div",{className:"px-4 py-6 text-[13px] text-ink-secondary",children:"Loading…"}),f.map(s=>e.jsxs("section",{children:[e.jsx("h3",{className:"sticky top-0 bg-panel px-4 pt-3 pb-1 text-[11px] font-semibold tracking-wide text-ink-secondary uppercase",children:s.label}),s.rows.map(a=>e.jsx(L,{row:a,current:a.threadId===t.threadId,onJump:()=>k(a)},`${a.threadId}:${a.at}:${a.tool}:${a.requestId??""}`))]},s.key))]})]})}function L({row:t,current:o,onJump:p}){const n=A(t.outcome);return e.jsxs("button",{type:"button",onClick:p,className:"flex w-full items-start gap-3 border-b border-hairline/20 px-4 py-2 text-left hover:bg-raised/60",title:o?t.tool:`${t.tool} — in another task; click to open it`,children:[e.jsx("span",{className:"mt-[2px] shrink-0 tabular-nums text-[11px] text-ink-secondary",children:E(t.at)}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[13px] text-ink",children:[t.app&&e.jsx("span",{className:"font-medium",children:t.app}),t.app&&e.jsx("span",{className:"text-ink-secondary",children:"·"}),e.jsx("span",{className:"truncate",children:t.label})]}),t.summary&&e.jsx("span",{className:"mt-0.5 block truncate font-mono text-[11px] text-ink-secondary",children:t.summary})]}),e.jsx("span",{className:y("mt-[2px] shrink-0 rounded px-1.5 py-0.5 text-[10.5px] font-medium",w[n.tone]),children:n.text})]})}export{T as ActivityPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as re,aQ as Se,aG as Ae,C as Ue,aN as Be,ag as De,aR as Ie,aS as Pe,j as t,a9 as Ce,c as b,r as u,t as m,a4 as pe,aT as $e,E as ze,g as k,A as Me,ax as He,u as le,aU as Fe,aV as _e,v as Re,F as Le,T as Ve,aW as We,aX as qe,aY as Ke,aZ as Je,a_ as Ye,a$ as Ge,b0 as he,b1 as Xe,b2 as Qe,b3 as Ze,X as Ee,B as et,V as ge,b4 as tt,b5 as st,aa as nt,b6 as at,am as it,a7 as rt,b7 as lt,b8 as ot,b9 as ye,an as ct,a as dt,ba as xt,aj as mt,U as ut,S as pt,aM as ht}from"./index-C8xb62XS.js";import{U as gt,C as yt}from"./user-B9lohN4n.js";import{B as ft}from"./brain-CeCdoTb2.js";import{i as fe,u as vt,b as bt,c as kt,d as jt,V as Nt,P as wt,M as St,A as Ct,a as $t,S as Mt,I as Rt}from"./VisibilitySection-DD4ffIR5.js";import{R as Lt}from"./RoutinesSection-uOfOTfkB.js";import"./RoutinesPage-DOosRYDK.js";import"./WebhooksPanel-Cz17K-_O.js";import"./image-plus-DNIWU160.js";import"./CloudBackendPicker-C5-_arUz.js";const Et=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Tt=re("cpu",Et);const Ot=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],At=re("history",Ot);const Ut=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Bt=re("layout-dashboard",Ut);const Dt=[["rect",{width:"3",height:"8",x:"13",y:"2",rx:"1.5",key:"diqz80"}],["path",{d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5",key:"183iwg"}],["rect",{width:"3",height:"8",x:"8",y:"14",rx:"1.5",key:"hqg7r1"}],["path",{d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5",key:"76g71w"}],["rect",{width:"8",height:"3",x:"14",y:"13",rx:"1.5",key:"1kmz0a"}],["path",{d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5",key:"jc4sz0"}],["rect",{width:"8",height:"3",x:"2",y:"8",rx:"1.5",key:"1omvl4"}],["path",{d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5",key:"16f3cl"}]],It=re("slack",Dt),Pt=[{id:"overview",label:"Overview",icon:Bt,keywords:["summary","status","what it does","won't","prompt","what the model sees"]},{id:"identity",label:"Identity",icon:gt,keywords:["name","title","avatar","blurb","instructions"]},{id:"slack",label:"Slack",icon:It,keywords:["slack","slack app","admin","message","direct messages","mentions"]},{id:"soul",label:"Soul",icon:Se,keywords:["standing instructions","instructions","persona","rules","soul.md"]},{id:"skills",label:"Skills",icon:Ae,keywords:["skills","learned","procedures","teach"]},{id:"memory",label:"Memory",icon:ft,keywords:["memory","notes","remember","topics"]},{id:"routines",label:"Routines",icon:Ue,keywords:["schedule","routines","cron","tasks"]},{id:"access",label:"Access",icon:Be,keywords:["works on","computer","vm","cloud","vps","folder","workspace","browser","connected apps","composio","webhooks","always allow","grants","tool selection","tools","mcp","allow","exclude"]},{id:"model",label:"Model",icon:Tt,keywords:["engine","model","provider","cli","effort"]},{id:"permissions",label:"Permissions",icon:De,keywords:["auto mode","approve","auto approve","review","routine approvals","peers","contact","coordination","chief of staff","section"]},{id:"voice",label:"Voice & alerts",icon:Ie,keywords:["voice","alerts","notifications","speak"]},{id:"visibility",label:"Who can see it",labelKey:"botSettings.visibility.title",icon:Pe,keywords:["visibility","who can see","private","people","admins","members","access","hide"]},{id:"history",label:"History",icon:At,keywords:["history","changes","undo","rollback","log"]},{id:"usage",label:"Usage",icon:yt,keywords:["tokens","cost","billing"]}];function zt({data:e,error:s,open:i,onToggle:a}){return t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsxs("button",{type:"button",onClick:a,"aria-expanded":i,className:"flex w-full items-center justify-between gap-3 text-left",children:[t.jsx("span",{className:"text-[15px] font-medium text-ink",children:e?`Prompt preview · ${e.totalBytes.toLocaleString()} bytes ≈ ${e.approxTokens.toLocaleString()} tokens`:"Prompt preview"}),t.jsx(Ce,{size:16,className:b("shrink-0 text-ink-secondary transition-transform",i&&"rotate-180")})]}),i&&!e&&s&&t.jsx("div",{className:"mt-3 text-[13px] text-ink-secondary",children:"Couldn’t load the prompt preview."}),i&&!e&&!s&&t.jsx("div",{className:"mt-3 text-[13px] text-ink-secondary",children:"Loading…"}),i&&e&&t.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[e.sections.map(l=>t.jsxs("details",{className:"rounded-lg border border-hairline/40 bg-inset px-3 py-2",children:[t.jsxs("summary",{className:"flex cursor-pointer items-center justify-between gap-3 text-[13px] text-ink",children:[t.jsx("span",{children:l.label}),t.jsxs("span",{className:"shrink-0 tabular-nums text-ink-secondary",children:[l.bytes.toLocaleString()," bytes"]})]}),t.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[12px] leading-relaxed text-ink",children:l.text})]},l.id)),e.note&&t.jsx("div",{className:"text-[11px] text-ink-secondary",children:e.note})]})]})}function Ht({overview:e,refreshError:s,prompt:i,promptError:a,onOpen:l,onSetup:r}){const[o,y]=u.useState(!1);if(!e)return t.jsx("div",{className:"text-[13px] text-ink-secondary",children:"Loading…"});const f=(e.setup??[]).filter(h=>!h.done);return t.jsxs("div",{className:"flex flex-col gap-4",children:[s&&t.jsx("div",{className:"rounded-lg bg-inset px-3 py-2 text-[12.5px] text-ink-secondary",children:"Couldn’t refresh — showing the last loaded overview."}),f.length>0&&t.jsxs("div",{className:"rounded-xl border border-accent/30 bg-accent/[0.06] p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:m("botSetup.ideas")}),t.jsx("p",{className:"mt-1 text-[13px] text-ink-secondary",children:m("botSetup.optional")}),t.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:f.map(h=>t.jsx("li",{children:h.section?t.jsxs("button",{type:"button",onClick:()=>l(h.section),className:"flex w-full items-center gap-2.5 rounded-lg px-1 py-1 text-left text-[13px] text-ink hover:bg-inset",children:[t.jsx(pe,{"aria-hidden":"true",size:14,className:"shrink-0 text-ink-secondary"}),t.jsx("span",{className:"flex-1",children:h.label}),t.jsx("span",{className:"text-[12px] text-ink-secondary",children:"→"})]}):t.jsxs("div",{className:"flex items-center gap-2.5 px-1 py-1 text-[13px] text-ink",children:[t.jsx(pe,{"aria-hidden":"true",size:14,className:"shrink-0 text-ink-secondary"}),t.jsx("span",{children:h.label})]})},h.id))}),r&&t.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-lg bg-accent px-3 py-2 text-[12.5px] font-medium text-accent-ink hover:brightness-110",children:[t.jsx(Se,{size:14})," ",m("botSetup.withBot")]}),t.jsx("span",{className:"text-[12px] text-ink-secondary",children:m("botSetup.help")})]})]}),t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:e.who.name}),e.who.title&&t.jsx("div",{className:"mt-0.5 text-[13px] text-ink-secondary",children:e.who.title}),e.who.blurb&&t.jsx("p",{className:"mt-2 text-[13px] leading-relaxed text-ink",children:e.who.blurb}),e.who.soulLead&&t.jsxs("div",{className:"mt-3 rounded-lg bg-inset px-3 py-2.5",children:[t.jsx("p",{className:"text-[13px] leading-relaxed text-ink-secondary",children:e.who.soulLead}),t.jsx("button",{type:"button",onClick:()=>l("soul"),className:"mt-1.5 rounded-md text-[12px] font-medium text-accent-text hover:underline",children:"Read all"})]})]}),t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:"Does"}),e.does.length===0?t.jsx("p",{className:"mt-2 text-[13px] text-ink-secondary",children:"Nothing scheduled or learned yet."}):t.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] leading-relaxed text-ink",children:e.does.map((h,p)=>t.jsx("li",{children:h},p))})]}),t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:"Can reach"}),e.reaches.length===0?t.jsx("p",{className:"mt-2 text-[13px] text-ink-secondary",children:"Nothing yet."}):t.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] leading-relaxed text-ink",children:e.reaches.map((h,p)=>t.jsx("li",{children:h},p))})]}),t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:"Won’t"}),t.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] leading-relaxed text-ink",children:e.wont.map((h,p)=>t.jsx("li",{children:h},p))})]}),t.jsx(zt,{data:i,error:a,open:o,onToggle:()=>y(h=>!h)}),t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:"Recent changes"}),t.jsx("button",{type:"button",onClick:()=>l("history"),className:"shrink-0 text-[12px] text-ink-secondary hover:text-ink",children:"View all →"})]}),e.recent.length===0?t.jsx("p",{className:"mt-2 text-[13px] text-ink-secondary",children:"Nothing changed recently."}):t.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] text-ink",children:e.recent.map((h,p)=>t.jsxs("li",{className:"flex items-baseline justify-between gap-3",children:[t.jsx("span",{className:"min-w-0 truncate",children:h.summary}),t.jsxs("span",{className:"shrink-0 text-[11.5px] text-ink-secondary",children:["· ",$e(h.at)]})]},p))})]})]})}function Ft({managementUrl:e}){return t.jsxs("div",{className:"flex flex-col gap-3 text-[13px] leading-relaxed text-ink-secondary",children:[t.jsx("p",{children:m("botSlack.body")}),t.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"flex w-fit items-center gap-2 rounded-lg bg-control px-3 py-2 font-medium text-ink hover:bg-control/70",children:[m("botSlack.manage")," ",t.jsx(ze,{size:14,"aria-hidden":"true"})]})]})}function _t(e){if(!e||typeof e!="object")return null;const{available:s,managementUrl:i}=e;if(s!==!0||typeof i!="string")return null;try{return new URL(i).protocol==="https:"?i:null}catch{return null}}function Vt(e){const[s,i]=u.useState(null);return u.useEffect(()=>{const a=new AbortController;return k(`/api/bots/${encodeURIComponent(e)}/slack-management`,{signal:a.signal,timeoutMs:1e4}).then(l=>{a.signal.aborted||i({botId:e,url:_t(l)})}).catch(()=>{a.signal.aborted||i({botId:e,url:null})}),()=>a.abort()},[e]),s?.botId===e?s.url:null}const D="MEMORY.md";function Wt(e){return k(`/api/bots/${e}/memory`)}function ve(e,s){return k(`/api/bots/${e}/memory/file?path=${encodeURIComponent(s)}`)}async function qt(e,s,i,a){const l=await fetch(`/api/bots/${e}/memory/file`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({path:s,text:i,expectedHash:a})}),r=await l.json().catch(()=>({}));if(l.status===409&&typeof r.current=="string"&&typeof r.currentHash=="string")return{ok:!1,conflict:!0,current:r.current,currentHash:r.currentHash};if(!l.ok)throw new Me(typeof r.error=="string"?r.error:`${l.status} ${l.statusText}`,l.status);const o=r;return{ok:!0,doc:{path:o.path,text:o.text,hash:o.hash,exists:o.exists},overview:o.overview}}function Kt(e,s){return k(`/api/bots/${e}/memory/file?path=${encodeURIComponent(s)}`,{method:"DELETE"})}async function G(e,s=50){return(await k(`/api/bots/${e}/memory/journal?limit=${s}`)).entries}function Jt(e,s){return k(`/api/bots/${e}/memory/journal/${encodeURIComponent(s)}/revert`,{method:"POST"})}function xe(e){return e?e.added+(e.topics??0):0}function be(e){return k(`/api/bots/${e}/memory/upkeep`)}function Yt(e,s){return k(`/api/bots/${e}/memory/reviewed`,{method:"POST",body:JSON.stringify({token:s})})}function Gt(e){return k(`/api/bots/${e}/memory/tidy`,{method:"POST"})}function Te(e){const s=[];e.expired&&s.push(`archived ${e.expired} expired note${e.expired===1?"":"s"}`),e.duplicates&&s.push(`merged ${e.duplicates} duplicate${e.duplicates===1?"":"s"}`),e.superseded&&s.push(`crossed out ${e.superseded} contradicted note${e.superseded===1?"":"s"}`),e.organized&&s.push(`filed ${e.organized} note${e.organized===1?"":"s"} into topics`);const i=s.length?s.join(", "):"nothing to tidy";return i.charAt(0).toUpperCase()+i.slice(1)}function Xt(e,s){return k(`/api/bots/${e}/memory/open`,{method:"POST",body:JSON.stringify({target:s})})}function I(e){return e<1024?`${e} B`:`${Math.round(e/102.4)/10} KB`}function ie(e,s=Date.now()){const i=Math.max(0,Math.round((s-e)/1e3));if(i<45)return"just now";const a=Math.round(i/60);if(a<60)return`${a} min ago`;const l=Math.round(a/60);if(l<24)return`${l} hr ago`;const r=Math.round(l/24);return r===1?"yesterday":r<7?`${r} days ago`:new Date(e).toLocaleDateString([],{month:"short",day:"numeric"})}function Qt(e){const s=e.maxLines?e.lines/e.maxLines:0,i=e.maxBytes?e.bytes/e.maxBytes:0,a=e.truncated?"over":Math.max(s,i)>=.8?"near":"ok",l=`${e.lines} of ${e.maxLines} lines · ${I(e.bytes)} of ${I(e.maxBytes)} — only the first ${e.maxLines} lines load each turn.`;let r=null;if(e.truncated){const o=e.lines-e.loadedLines;r=o>0?`${e.lines} lines saved, ${e.loadedLines} load into every conversation — ${o} ${o===1?"line is":"lines are"} not being loaded. Trim this file or move notes into a topic file.`:`${I(e.bytes)} saved, ${I(e.loadedBytes)} load into every conversation — the rest is not being loaded. Trim this file or move notes into a topic file.`}return{level:a,lineShare:s,byteShare:i,sentence:l,warning:r}}function Zt(e){return e===D?"MEMORY.md":e.startsWith("memory/log/")?`the ${e.slice(11).replace(/\.md$/,"")} log`:e.replace(/^memory\//,"").replace(/\.md$/,"")}function es(e,s){const i=e.actor==="bot"?s:e.actor==="import"?"An import":e.actor==="upkeep"?"Memory upkeep":"You",a=Zt(e.path),r=e.path===D||e.path.startsWith("memory/log/")?a:`the ${a} topic`;return e.kind==="created"?`${i} created ${r}${e.added?` with ${ae(e.added,"line")}`:""}`:e.kind==="deleted"?`${i} deleted ${r}`:e.added&&!e.removed?`${i} added ${ae(e.added,"line")} to ${r}`:e.removed&&!e.added?`${i} removed ${ae(e.removed,"line")} from ${r}`:`${i} rewrote ${ae(Math.max(e.added,e.removed),"line")} in ${r}`}function ae(e,s){return`${e} ${s}${e===1?"":"s"}`}function ts(e){return e.via==="revert"?"undo":e.via==="disk"?"changed outside the app":e.via==="tidy"?"tidy-up":e.via==="organize"?"filed into topics":e.via==="capture"?e.threadTitle?`noticed in chat “${e.threadTitle}”`:"noticed in a chat":e.threadTitle?`from chat “${e.threadTitle}”`:e.actor==="bot"?"during a task":e.via==="ui"?"in Settings":e.via==="api"?"through the API":null}function ss(e){return e==="darwin"?"Show in Finder":e==="win32"?"Show in Explorer":"Show in file manager"}function ns(e){const s=e.trim().replace(/\.md$/i,"").replace(/[^\w .-]+/g,"-").replace(/^[^\w]+/,"").trim();return s?`${s}.md`:null}const O="rounded-lg bg-control px-3 py-1.5 text-[13px] text-ink hover:bg-raised-hover disabled:opacity-50",me="rounded-md px-2 py-1 text-[12.5px] text-ink-secondary hover:bg-control hover:text-ink disabled:opacity-50",T=e=>e instanceof Error?e.message:String(e);function as({changed:e,stale:s,busy:i,onReviewed:a}){return t.jsxs("div",{role:"status",className:"rounded-xl border border-danger/40 bg-card p-4",children:[t.jsx("p",{className:"text-[13px] leading-relaxed text-ink",children:m(s?"memory.lendingReviewStale":"memory.lendingReview")}),e.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mt-2 text-[12px] text-ink-secondary",children:m("memory.lendingReviewChanged")}),t.jsx("ul",{className:"mt-1 space-y-0.5",children:e.map(l=>t.jsx("li",{className:"break-all font-mono text-[12px] text-ink",children:l},l))})]}),t.jsx("button",{type:"button",className:b(O,"mt-3"),disabled:i,onClick:a,children:m("memory.lendingReviewed")})]})}function is({bot:e,active:s=!0,onToggle:i}){const{capabilities:a}=He(),[l,r]=u.useState(null),[o,y]=u.useState(null),[c,f]=u.useState(null),[h,p]=u.useState(null),[j,N]=u.useState(null),[R,v]=u.useState(null),[w,C]=u.useState(null),[$,P]=u.useState(!1),[A,U]=u.useState(null),[x,L]=u.useState(""),[X,z]=u.useState(null),[oe,Q]=u.useState(!1),[V,W]=u.useState(null),[q,Z]=u.useState(!1),[ee,K]=u.useState(!1),{dispatch:J}=le(),te=async n=>{const[d,M,B]=await Promise.all([Wt(e.id),G(e.id),be(e.id).catch(()=>null)]);if(r(d),W(d.lendingReview??null),y(M),z(B),n){const E=await ve(e.id,n);f({path:E.path,text:E.text,hash:E.hash,dirty:!1,readOnly:n.startsWith("memory/log/")})}};u.useEffect(()=>{if(!s)return;let n=!1;v(null);const d=c?.dirty===!0;return te(d?void 0:c?.path??D).catch(M=>{n||v(T(M))}),()=>{n=!0}},[s,e.id]);const S=async n=>{v(null),p(null);try{const d=await ve(e.id,n);f({path:d.path,text:d.text,hash:d.hash,dirty:!1,readOnly:n.startsWith("memory/log/")})}catch(d){v(T(d))}},Y=async n=>{if(c){P(!0),v(null);try{const d=await qt(e.id,c.path,c.text,n);if(!d.ok){p({path:c.path,current:d.current,currentHash:d.currentHash});return}p(null),N(null),f({...c,text:d.doc.text,hash:d.doc.hash,dirty:!1}),r(d.overview),y(await G(e.id))}catch(d){v(T(d))}finally{P(!1)}}},se=()=>{!h||!c||(N(c.text),f({...c,text:h.current,hash:h.currentHash,dirty:!1}),p(null))},H=async n=>{if(window.confirm(`Delete ${n.name}? The journal below can bring it back.`)){v(null);try{const{overview:d}=await Kt(e.id,n.path);r(d),y(await G(e.id)),c?.path===n.path&&f(null)}catch(d){v(T(d))}}},F=async()=>{const n=ns(x);if(!n){v("Give the topic a name — letters, numbers, spaces, dots or dashes.");return}L(""),await S(`memory/${n}`),f(d=>d&&{...d,dirty:!0,text:d.text||rs(n)})},ce=async n=>{U(n.id),v(null);try{const d=await Jt(e.id,n.id);r(d.overview),y(await G(e.id)),c?.path===n.path&&!c.dirty&&f({...c,text:d.text,hash:d.hash}),C(`Put ${n.path} back the way it was.`)}catch(d){v(T(d))}finally{U(null)}},_=async n=>{v(null),C(null);try{await Xt(e.id,n)}catch(d){v(T(d))}},de=()=>{const n=e.memoryUpkeep===!1;J({type:"updateBot",botId:e.id,patch:{memoryUpkeep:n}}),z(d=>d&&{...d,enabled:n})},ne=async()=>{Q(!0),v(null),C(null);try{const{report:n,overview:d}=await Gt(e.id);r(d),y(await G(e.id)),z(await be(e.id)),c&&!c.dirty&&await S(c.path),C(`${Te(n)}.${n.note?` ${n.note}`:""}`)}catch(n){v(T(n))}finally{Q(!1)}},g=a.host.homeDir;return t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:"Memory"}),t.jsxs("label",{className:"mt-3 flex items-center gap-2 text-[13px] text-ink",children:[t.jsx("input",{type:"checkbox",checked:e.memoryEnabled!==!1,disabled:e.busy,onChange:n=>i(n.target.checked)}),"Let this bot use memory"]}),t.jsxs("p",{className:"mt-1 text-[12.5px] text-ink-secondary",children:["Off stops memory prompts, recall, native memory tools, upkeep, and automatic turn logs. Existing files remain available for review.",e.busy?" Stop this bot's turn before changing this setting.":""]}),t.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:"Notes this bot keeps between tasks. They are plain markdown files in a folder on this computer — open them in any editor, or in Obsidian."}),l&&t.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-secondary",title:l.workspacePath,children:Fe(l.workspacePath,g)}),t.jsx("button",{type:"button",className:O,onClick:()=>{_("obsidian")},children:"Open in Obsidian"}),t.jsxs("button",{type:"button",className:b(O,"inline-flex items-center gap-1.5"),onClick:()=>{_("folder")},children:[t.jsx(_e,{size:14}),ss(a.host.platform)]})]})]}),V&&t.jsx(as,{changed:V.changed,stale:q,busy:ee,onReviewed:()=>{K(!0),Yt(e.id,V.token).then(()=>{W(null),Z(!1)}).catch(n=>{if(n instanceof Me&&n.status===409)return Z(!0),te();v(T(n))}).finally(()=>K(!1))}}),l&&t.jsx(os,{index:l.index}),e.memoryEnabled!==!1&&t.jsx(ls,{enabled:e.memoryUpkeep!==!1,status:X,tidying:oe,onToggle:de,onTidy:()=>{ne()}}),c&&t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("span",{className:"truncate font-mono text-[12.5px] text-ink",children:c.path}),c.path!==D&&t.jsx("button",{type:"button",className:me,onClick:()=>{S(D)},children:"Back to MEMORY.md"})]}),h&&t.jsx(cs,{botName:e.name,busy:$,onReload:se,onOverwrite:()=>{Y(h.currentHash)}}),t.jsx("textarea",{className:b(fe,"mt-2 min-h-[200px] resize-y font-mono text-[12.5px] leading-relaxed"),value:c.text,readOnly:c.readOnly,placeholder:c.path===D?"Nothing remembered yet. The bot writes durable notes here — or add your own.":"Write the note here.","aria-label":c.path===D?"Bot memory":`Memory file ${c.path}`,onChange:n=>f({...c,text:n.target.value,dirty:!0})}),c.readOnly?t.jsx("p",{className:"mt-2 text-[12px] text-ink-secondary",children:"Daily logs are the bot's own record of what it did; they are not loaded into conversations and are read-only here."}):t.jsxs("div",{className:"mt-2 flex items-center gap-3",children:[t.jsx("button",{type:"button",onClick:()=>{Y(c.hash)},disabled:$||!c.dirty,className:O,children:$?"Saving…":"Save"}),c.dirty&&t.jsx("button",{type:"button",className:me,disabled:$,onClick:()=>{S(c.path)},children:"Discard changes"})]}),j!==null&&t.jsxs("div",{className:"mt-3",children:[t.jsx("div",{className:"mb-1 text-[12px] text-ink-secondary",children:"Your unsaved draft, kept so nothing is lost:"}),t.jsx("pre",{className:"max-h-[160px] overflow-auto whitespace-pre-wrap rounded-lg border border-hairline/40 bg-inset p-3 font-mono text-[12px] leading-relaxed text-ink",children:j}),t.jsx("button",{type:"button",className:b(me,"mt-1"),onClick:()=>N(null),children:"Dismiss draft"})]})]}),l&&t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx(je,{title:"Topic files",hint:"Longer notes the bot reads on demand. Click one to edit it.",files:l.topics,selected:c?.path,onOpen:n=>{S(n.path)},onDelete:n=>{H(n)}}),t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[t.jsx("input",{className:b(fe,"py-1.5 text-[13px]"),value:x,placeholder:"New topic name, e.g. clients","aria-label":"New topic name",onChange:n=>L(n.target.value),onKeyDown:n=>{n.key==="Enter"&&F()}}),t.jsx("button",{type:"button",className:O,disabled:!x.trim(),onClick:()=>{F()},children:"New topic"})]}),l.logs.length>0&&t.jsx("div",{className:"mt-4",children:t.jsx(je,{title:"Daily logs",hint:"What the bot did each day, in its own words. Not loaded into conversations.",files:l.logs,selected:c?.path,onOpen:n=>{S(n.path)},onDelete:n=>{H(n)}})})]}),t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:"Changes"}),t.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:"Every change to these files, whoever made it. Undo puts a file back the way it was before that change."}),t.jsx("div",{className:"mt-3",children:t.jsx(ds,{rows:o,botName:e.name,reverting:A,onRevert:n=>{ce(n)}})})]}),w&&t.jsx("div",{className:"text-[12.5px] text-ink-secondary",children:w}),R&&t.jsx("div",{className:"text-[12.5px] text-danger",children:R})]})}function rs(e){return`---
|
|
1
|
+
import{m as re,aQ as Se,aG as Ae,C as Ue,aN as Be,ag as De,aR as Ie,aS as Pe,j as t,a9 as Ce,c as b,r as u,t as m,a4 as pe,aT as $e,E as ze,g as k,A as Me,ax as He,u as le,aU as Fe,aV as _e,v as Re,F as Le,T as Ve,aW as We,aX as qe,aY as Ke,aZ as Je,a_ as Ye,a$ as Ge,b0 as he,b1 as Xe,b2 as Qe,b3 as Ze,X as Ee,B as et,V as ge,b4 as tt,b5 as st,aa as nt,b6 as at,am as it,a7 as rt,b7 as lt,b8 as ot,b9 as ye,an as ct,a as dt,ba as xt,aj as mt,U as ut,S as pt,aM as ht}from"./index-CyM91z0J.js";import{U as gt,C as yt}from"./user-EQ8rI0f4.js";import{B as ft}from"./brain-oq48IgWl.js";import{i as fe,u as vt,b as bt,c as kt,d as jt,V as Nt,P as wt,M as St,A as Ct,a as $t,S as Mt,I as Rt}from"./VisibilitySection-y8Adk-c4.js";import{R as Lt}from"./RoutinesSection-NyReOXr8.js";import"./RoutinesPage-Buk5-r3o.js";import"./WebhooksPanel-G_NWjHOP.js";import"./image-plus-D9o3v9bi.js";import"./CloudBackendPicker-BR42-xBg.js";const Et=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Tt=re("cpu",Et);const Ot=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],At=re("history",Ot);const Ut=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Bt=re("layout-dashboard",Ut);const Dt=[["rect",{width:"3",height:"8",x:"13",y:"2",rx:"1.5",key:"diqz80"}],["path",{d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5",key:"183iwg"}],["rect",{width:"3",height:"8",x:"8",y:"14",rx:"1.5",key:"hqg7r1"}],["path",{d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5",key:"76g71w"}],["rect",{width:"8",height:"3",x:"14",y:"13",rx:"1.5",key:"1kmz0a"}],["path",{d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5",key:"jc4sz0"}],["rect",{width:"8",height:"3",x:"2",y:"8",rx:"1.5",key:"1omvl4"}],["path",{d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5",key:"16f3cl"}]],It=re("slack",Dt),Pt=[{id:"overview",label:"Overview",icon:Bt,keywords:["summary","status","what it does","won't","prompt","what the model sees"]},{id:"identity",label:"Identity",icon:gt,keywords:["name","title","avatar","blurb","instructions"]},{id:"slack",label:"Slack",icon:It,keywords:["slack","slack app","admin","message","direct messages","mentions"]},{id:"soul",label:"Soul",icon:Se,keywords:["standing instructions","instructions","persona","rules","soul.md"]},{id:"skills",label:"Skills",icon:Ae,keywords:["skills","learned","procedures","teach"]},{id:"memory",label:"Memory",icon:ft,keywords:["memory","notes","remember","topics"]},{id:"routines",label:"Routines",icon:Ue,keywords:["schedule","routines","cron","tasks"]},{id:"access",label:"Access",icon:Be,keywords:["works on","computer","vm","cloud","vps","folder","workspace","browser","connected apps","composio","webhooks","always allow","grants","tool selection","tools","mcp","allow","exclude"]},{id:"model",label:"Model",icon:Tt,keywords:["engine","model","provider","cli","effort"]},{id:"permissions",label:"Permissions",icon:De,keywords:["auto mode","approve","auto approve","review","routine approvals","peers","contact","coordination","chief of staff","section"]},{id:"voice",label:"Voice & alerts",icon:Ie,keywords:["voice","alerts","notifications","speak"]},{id:"visibility",label:"Who can see it",labelKey:"botSettings.visibility.title",icon:Pe,keywords:["visibility","who can see","private","people","admins","members","access","hide"]},{id:"history",label:"History",icon:At,keywords:["history","changes","undo","rollback","log"]},{id:"usage",label:"Usage",icon:yt,keywords:["tokens","cost","billing"]}];function zt({data:e,error:s,open:i,onToggle:a}){return t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsxs("button",{type:"button",onClick:a,"aria-expanded":i,className:"flex w-full items-center justify-between gap-3 text-left",children:[t.jsx("span",{className:"text-[15px] font-medium text-ink",children:e?`Prompt preview · ${e.totalBytes.toLocaleString()} bytes ≈ ${e.approxTokens.toLocaleString()} tokens`:"Prompt preview"}),t.jsx(Ce,{size:16,className:b("shrink-0 text-ink-secondary transition-transform",i&&"rotate-180")})]}),i&&!e&&s&&t.jsx("div",{className:"mt-3 text-[13px] text-ink-secondary",children:"Couldn’t load the prompt preview."}),i&&!e&&!s&&t.jsx("div",{className:"mt-3 text-[13px] text-ink-secondary",children:"Loading…"}),i&&e&&t.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[e.sections.map(l=>t.jsxs("details",{className:"rounded-lg border border-hairline/40 bg-inset px-3 py-2",children:[t.jsxs("summary",{className:"flex cursor-pointer items-center justify-between gap-3 text-[13px] text-ink",children:[t.jsx("span",{children:l.label}),t.jsxs("span",{className:"shrink-0 tabular-nums text-ink-secondary",children:[l.bytes.toLocaleString()," bytes"]})]}),t.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[12px] leading-relaxed text-ink",children:l.text})]},l.id)),e.note&&t.jsx("div",{className:"text-[11px] text-ink-secondary",children:e.note})]})]})}function Ht({overview:e,refreshError:s,prompt:i,promptError:a,onOpen:l,onSetup:r}){const[o,y]=u.useState(!1);if(!e)return t.jsx("div",{className:"text-[13px] text-ink-secondary",children:"Loading…"});const f=(e.setup??[]).filter(h=>!h.done);return t.jsxs("div",{className:"flex flex-col gap-4",children:[s&&t.jsx("div",{className:"rounded-lg bg-inset px-3 py-2 text-[12.5px] text-ink-secondary",children:"Couldn’t refresh — showing the last loaded overview."}),f.length>0&&t.jsxs("div",{className:"rounded-xl border border-accent/30 bg-accent/[0.06] p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:m("botSetup.ideas")}),t.jsx("p",{className:"mt-1 text-[13px] text-ink-secondary",children:m("botSetup.optional")}),t.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:f.map(h=>t.jsx("li",{children:h.section?t.jsxs("button",{type:"button",onClick:()=>l(h.section),className:"flex w-full items-center gap-2.5 rounded-lg px-1 py-1 text-left text-[13px] text-ink hover:bg-inset",children:[t.jsx(pe,{"aria-hidden":"true",size:14,className:"shrink-0 text-ink-secondary"}),t.jsx("span",{className:"flex-1",children:h.label}),t.jsx("span",{className:"text-[12px] text-ink-secondary",children:"→"})]}):t.jsxs("div",{className:"flex items-center gap-2.5 px-1 py-1 text-[13px] text-ink",children:[t.jsx(pe,{"aria-hidden":"true",size:14,className:"shrink-0 text-ink-secondary"}),t.jsx("span",{children:h.label})]})},h.id))}),r&&t.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-lg bg-accent px-3 py-2 text-[12.5px] font-medium text-accent-ink hover:brightness-110",children:[t.jsx(Se,{size:14})," ",m("botSetup.withBot")]}),t.jsx("span",{className:"text-[12px] text-ink-secondary",children:m("botSetup.help")})]})]}),t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:e.who.name}),e.who.title&&t.jsx("div",{className:"mt-0.5 text-[13px] text-ink-secondary",children:e.who.title}),e.who.blurb&&t.jsx("p",{className:"mt-2 text-[13px] leading-relaxed text-ink",children:e.who.blurb}),e.who.soulLead&&t.jsxs("div",{className:"mt-3 rounded-lg bg-inset px-3 py-2.5",children:[t.jsx("p",{className:"text-[13px] leading-relaxed text-ink-secondary",children:e.who.soulLead}),t.jsx("button",{type:"button",onClick:()=>l("soul"),className:"mt-1.5 rounded-md text-[12px] font-medium text-accent-text hover:underline",children:"Read all"})]})]}),t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:"Does"}),e.does.length===0?t.jsx("p",{className:"mt-2 text-[13px] text-ink-secondary",children:"Nothing scheduled or learned yet."}):t.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] leading-relaxed text-ink",children:e.does.map((h,p)=>t.jsx("li",{children:h},p))})]}),t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:"Can reach"}),e.reaches.length===0?t.jsx("p",{className:"mt-2 text-[13px] text-ink-secondary",children:"Nothing yet."}):t.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] leading-relaxed text-ink",children:e.reaches.map((h,p)=>t.jsx("li",{children:h},p))})]}),t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:"Won’t"}),t.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] leading-relaxed text-ink",children:e.wont.map((h,p)=>t.jsx("li",{children:h},p))})]}),t.jsx(zt,{data:i,error:a,open:o,onToggle:()=>y(h=>!h)}),t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:"Recent changes"}),t.jsx("button",{type:"button",onClick:()=>l("history"),className:"shrink-0 text-[12px] text-ink-secondary hover:text-ink",children:"View all →"})]}),e.recent.length===0?t.jsx("p",{className:"mt-2 text-[13px] text-ink-secondary",children:"Nothing changed recently."}):t.jsx("ul",{className:"mt-2 flex flex-col gap-1.5 text-[13px] text-ink",children:e.recent.map((h,p)=>t.jsxs("li",{className:"flex items-baseline justify-between gap-3",children:[t.jsx("span",{className:"min-w-0 truncate",children:h.summary}),t.jsxs("span",{className:"shrink-0 text-[11.5px] text-ink-secondary",children:["· ",$e(h.at)]})]},p))})]})]})}function Ft({managementUrl:e}){return t.jsxs("div",{className:"flex flex-col gap-3 text-[13px] leading-relaxed text-ink-secondary",children:[t.jsx("p",{children:m("botSlack.body")}),t.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"flex w-fit items-center gap-2 rounded-lg bg-control px-3 py-2 font-medium text-ink hover:bg-control/70",children:[m("botSlack.manage")," ",t.jsx(ze,{size:14,"aria-hidden":"true"})]})]})}function _t(e){if(!e||typeof e!="object")return null;const{available:s,managementUrl:i}=e;if(s!==!0||typeof i!="string")return null;try{return new URL(i).protocol==="https:"?i:null}catch{return null}}function Vt(e){const[s,i]=u.useState(null);return u.useEffect(()=>{const a=new AbortController;return k(`/api/bots/${encodeURIComponent(e)}/slack-management`,{signal:a.signal,timeoutMs:1e4}).then(l=>{a.signal.aborted||i({botId:e,url:_t(l)})}).catch(()=>{a.signal.aborted||i({botId:e,url:null})}),()=>a.abort()},[e]),s?.botId===e?s.url:null}const D="MEMORY.md";function Wt(e){return k(`/api/bots/${e}/memory`)}function ve(e,s){return k(`/api/bots/${e}/memory/file?path=${encodeURIComponent(s)}`)}async function qt(e,s,i,a){const l=await fetch(`/api/bots/${e}/memory/file`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({path:s,text:i,expectedHash:a})}),r=await l.json().catch(()=>({}));if(l.status===409&&typeof r.current=="string"&&typeof r.currentHash=="string")return{ok:!1,conflict:!0,current:r.current,currentHash:r.currentHash};if(!l.ok)throw new Me(typeof r.error=="string"?r.error:`${l.status} ${l.statusText}`,l.status);const o=r;return{ok:!0,doc:{path:o.path,text:o.text,hash:o.hash,exists:o.exists},overview:o.overview}}function Kt(e,s){return k(`/api/bots/${e}/memory/file?path=${encodeURIComponent(s)}`,{method:"DELETE"})}async function G(e,s=50){return(await k(`/api/bots/${e}/memory/journal?limit=${s}`)).entries}function Jt(e,s){return k(`/api/bots/${e}/memory/journal/${encodeURIComponent(s)}/revert`,{method:"POST"})}function xe(e){return e?e.added+(e.topics??0):0}function be(e){return k(`/api/bots/${e}/memory/upkeep`)}function Yt(e,s){return k(`/api/bots/${e}/memory/reviewed`,{method:"POST",body:JSON.stringify({token:s})})}function Gt(e){return k(`/api/bots/${e}/memory/tidy`,{method:"POST"})}function Te(e){const s=[];e.expired&&s.push(`archived ${e.expired} expired note${e.expired===1?"":"s"}`),e.duplicates&&s.push(`merged ${e.duplicates} duplicate${e.duplicates===1?"":"s"}`),e.superseded&&s.push(`crossed out ${e.superseded} contradicted note${e.superseded===1?"":"s"}`),e.organized&&s.push(`filed ${e.organized} note${e.organized===1?"":"s"} into topics`);const i=s.length?s.join(", "):"nothing to tidy";return i.charAt(0).toUpperCase()+i.slice(1)}function Xt(e,s){return k(`/api/bots/${e}/memory/open`,{method:"POST",body:JSON.stringify({target:s})})}function I(e){return e<1024?`${e} B`:`${Math.round(e/102.4)/10} KB`}function ie(e,s=Date.now()){const i=Math.max(0,Math.round((s-e)/1e3));if(i<45)return"just now";const a=Math.round(i/60);if(a<60)return`${a} min ago`;const l=Math.round(a/60);if(l<24)return`${l} hr ago`;const r=Math.round(l/24);return r===1?"yesterday":r<7?`${r} days ago`:new Date(e).toLocaleDateString([],{month:"short",day:"numeric"})}function Qt(e){const s=e.maxLines?e.lines/e.maxLines:0,i=e.maxBytes?e.bytes/e.maxBytes:0,a=e.truncated?"over":Math.max(s,i)>=.8?"near":"ok",l=`${e.lines} of ${e.maxLines} lines · ${I(e.bytes)} of ${I(e.maxBytes)} — only the first ${e.maxLines} lines load each turn.`;let r=null;if(e.truncated){const o=e.lines-e.loadedLines;r=o>0?`${e.lines} lines saved, ${e.loadedLines} load into every conversation — ${o} ${o===1?"line is":"lines are"} not being loaded. Trim this file or move notes into a topic file.`:`${I(e.bytes)} saved, ${I(e.loadedBytes)} load into every conversation — the rest is not being loaded. Trim this file or move notes into a topic file.`}return{level:a,lineShare:s,byteShare:i,sentence:l,warning:r}}function Zt(e){return e===D?"MEMORY.md":e.startsWith("memory/log/")?`the ${e.slice(11).replace(/\.md$/,"")} log`:e.replace(/^memory\//,"").replace(/\.md$/,"")}function es(e,s){const i=e.actor==="bot"?s:e.actor==="import"?"An import":e.actor==="upkeep"?"Memory upkeep":"You",a=Zt(e.path),r=e.path===D||e.path.startsWith("memory/log/")?a:`the ${a} topic`;return e.kind==="created"?`${i} created ${r}${e.added?` with ${ae(e.added,"line")}`:""}`:e.kind==="deleted"?`${i} deleted ${r}`:e.added&&!e.removed?`${i} added ${ae(e.added,"line")} to ${r}`:e.removed&&!e.added?`${i} removed ${ae(e.removed,"line")} from ${r}`:`${i} rewrote ${ae(Math.max(e.added,e.removed),"line")} in ${r}`}function ae(e,s){return`${e} ${s}${e===1?"":"s"}`}function ts(e){return e.via==="revert"?"undo":e.via==="disk"?"changed outside the app":e.via==="tidy"?"tidy-up":e.via==="organize"?"filed into topics":e.via==="capture"?e.threadTitle?`noticed in chat “${e.threadTitle}”`:"noticed in a chat":e.threadTitle?`from chat “${e.threadTitle}”`:e.actor==="bot"?"during a task":e.via==="ui"?"in Settings":e.via==="api"?"through the API":null}function ss(e){return e==="darwin"?"Show in Finder":e==="win32"?"Show in Explorer":"Show in file manager"}function ns(e){const s=e.trim().replace(/\.md$/i,"").replace(/[^\w .-]+/g,"-").replace(/^[^\w]+/,"").trim();return s?`${s}.md`:null}const O="rounded-lg bg-control px-3 py-1.5 text-[13px] text-ink hover:bg-raised-hover disabled:opacity-50",me="rounded-md px-2 py-1 text-[12.5px] text-ink-secondary hover:bg-control hover:text-ink disabled:opacity-50",T=e=>e instanceof Error?e.message:String(e);function as({changed:e,stale:s,busy:i,onReviewed:a}){return t.jsxs("div",{role:"status",className:"rounded-xl border border-danger/40 bg-card p-4",children:[t.jsx("p",{className:"text-[13px] leading-relaxed text-ink",children:m(s?"memory.lendingReviewStale":"memory.lendingReview")}),e.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mt-2 text-[12px] text-ink-secondary",children:m("memory.lendingReviewChanged")}),t.jsx("ul",{className:"mt-1 space-y-0.5",children:e.map(l=>t.jsx("li",{className:"break-all font-mono text-[12px] text-ink",children:l},l))})]}),t.jsx("button",{type:"button",className:b(O,"mt-3"),disabled:i,onClick:a,children:m("memory.lendingReviewed")})]})}function is({bot:e,active:s=!0,onToggle:i}){const{capabilities:a}=He(),[l,r]=u.useState(null),[o,y]=u.useState(null),[c,f]=u.useState(null),[h,p]=u.useState(null),[j,N]=u.useState(null),[R,v]=u.useState(null),[w,C]=u.useState(null),[$,P]=u.useState(!1),[A,U]=u.useState(null),[x,L]=u.useState(""),[X,z]=u.useState(null),[oe,Q]=u.useState(!1),[V,W]=u.useState(null),[q,Z]=u.useState(!1),[ee,K]=u.useState(!1),{dispatch:J}=le(),te=async n=>{const[d,M,B]=await Promise.all([Wt(e.id),G(e.id),be(e.id).catch(()=>null)]);if(r(d),W(d.lendingReview??null),y(M),z(B),n){const E=await ve(e.id,n);f({path:E.path,text:E.text,hash:E.hash,dirty:!1,readOnly:n.startsWith("memory/log/")})}};u.useEffect(()=>{if(!s)return;let n=!1;v(null);const d=c?.dirty===!0;return te(d?void 0:c?.path??D).catch(M=>{n||v(T(M))}),()=>{n=!0}},[s,e.id]);const S=async n=>{v(null),p(null);try{const d=await ve(e.id,n);f({path:d.path,text:d.text,hash:d.hash,dirty:!1,readOnly:n.startsWith("memory/log/")})}catch(d){v(T(d))}},Y=async n=>{if(c){P(!0),v(null);try{const d=await qt(e.id,c.path,c.text,n);if(!d.ok){p({path:c.path,current:d.current,currentHash:d.currentHash});return}p(null),N(null),f({...c,text:d.doc.text,hash:d.doc.hash,dirty:!1}),r(d.overview),y(await G(e.id))}catch(d){v(T(d))}finally{P(!1)}}},se=()=>{!h||!c||(N(c.text),f({...c,text:h.current,hash:h.currentHash,dirty:!1}),p(null))},H=async n=>{if(window.confirm(`Delete ${n.name}? The journal below can bring it back.`)){v(null);try{const{overview:d}=await Kt(e.id,n.path);r(d),y(await G(e.id)),c?.path===n.path&&f(null)}catch(d){v(T(d))}}},F=async()=>{const n=ns(x);if(!n){v("Give the topic a name — letters, numbers, spaces, dots or dashes.");return}L(""),await S(`memory/${n}`),f(d=>d&&{...d,dirty:!0,text:d.text||rs(n)})},ce=async n=>{U(n.id),v(null);try{const d=await Jt(e.id,n.id);r(d.overview),y(await G(e.id)),c?.path===n.path&&!c.dirty&&f({...c,text:d.text,hash:d.hash}),C(`Put ${n.path} back the way it was.`)}catch(d){v(T(d))}finally{U(null)}},_=async n=>{v(null),C(null);try{await Xt(e.id,n)}catch(d){v(T(d))}},de=()=>{const n=e.memoryUpkeep===!1;J({type:"updateBot",botId:e.id,patch:{memoryUpkeep:n}}),z(d=>d&&{...d,enabled:n})},ne=async()=>{Q(!0),v(null),C(null);try{const{report:n,overview:d}=await Gt(e.id);r(d),y(await G(e.id)),z(await be(e.id)),c&&!c.dirty&&await S(c.path),C(`${Te(n)}.${n.note?` ${n.note}`:""}`)}catch(n){v(T(n))}finally{Q(!1)}},g=a.host.homeDir;return t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:"Memory"}),t.jsxs("label",{className:"mt-3 flex items-center gap-2 text-[13px] text-ink",children:[t.jsx("input",{type:"checkbox",checked:e.memoryEnabled!==!1,disabled:e.busy,onChange:n=>i(n.target.checked)}),"Let this bot use memory"]}),t.jsxs("p",{className:"mt-1 text-[12.5px] text-ink-secondary",children:["Off stops memory prompts, recall, native memory tools, upkeep, and automatic turn logs. Existing files remain available for review.",e.busy?" Stop this bot's turn before changing this setting.":""]}),t.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:"Notes this bot keeps between tasks. They are plain markdown files in a folder on this computer — open them in any editor, or in Obsidian."}),l&&t.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-secondary",title:l.workspacePath,children:Fe(l.workspacePath,g)}),t.jsx("button",{type:"button",className:O,onClick:()=>{_("obsidian")},children:"Open in Obsidian"}),t.jsxs("button",{type:"button",className:b(O,"inline-flex items-center gap-1.5"),onClick:()=>{_("folder")},children:[t.jsx(_e,{size:14}),ss(a.host.platform)]})]})]}),V&&t.jsx(as,{changed:V.changed,stale:q,busy:ee,onReviewed:()=>{K(!0),Yt(e.id,V.token).then(()=>{W(null),Z(!1)}).catch(n=>{if(n instanceof Me&&n.status===409)return Z(!0),te();v(T(n))}).finally(()=>K(!1))}}),l&&t.jsx(os,{index:l.index}),e.memoryEnabled!==!1&&t.jsx(ls,{enabled:e.memoryUpkeep!==!1,status:X,tidying:oe,onToggle:de,onTidy:()=>{ne()}}),c&&t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("span",{className:"truncate font-mono text-[12.5px] text-ink",children:c.path}),c.path!==D&&t.jsx("button",{type:"button",className:me,onClick:()=>{S(D)},children:"Back to MEMORY.md"})]}),h&&t.jsx(cs,{botName:e.name,busy:$,onReload:se,onOverwrite:()=>{Y(h.currentHash)}}),t.jsx("textarea",{className:b(fe,"mt-2 min-h-[200px] resize-y font-mono text-[12.5px] leading-relaxed"),value:c.text,readOnly:c.readOnly,placeholder:c.path===D?"Nothing remembered yet. The bot writes durable notes here — or add your own.":"Write the note here.","aria-label":c.path===D?"Bot memory":`Memory file ${c.path}`,onChange:n=>f({...c,text:n.target.value,dirty:!0})}),c.readOnly?t.jsx("p",{className:"mt-2 text-[12px] text-ink-secondary",children:"Daily logs are the bot's own record of what it did; they are not loaded into conversations and are read-only here."}):t.jsxs("div",{className:"mt-2 flex items-center gap-3",children:[t.jsx("button",{type:"button",onClick:()=>{Y(c.hash)},disabled:$||!c.dirty,className:O,children:$?"Saving…":"Save"}),c.dirty&&t.jsx("button",{type:"button",className:me,disabled:$,onClick:()=>{S(c.path)},children:"Discard changes"})]}),j!==null&&t.jsxs("div",{className:"mt-3",children:[t.jsx("div",{className:"mb-1 text-[12px] text-ink-secondary",children:"Your unsaved draft, kept so nothing is lost:"}),t.jsx("pre",{className:"max-h-[160px] overflow-auto whitespace-pre-wrap rounded-lg border border-hairline/40 bg-inset p-3 font-mono text-[12px] leading-relaxed text-ink",children:j}),t.jsx("button",{type:"button",className:b(me,"mt-1"),onClick:()=>N(null),children:"Dismiss draft"})]})]}),l&&t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx(je,{title:"Topic files",hint:"Longer notes the bot reads on demand. Click one to edit it.",files:l.topics,selected:c?.path,onOpen:n=>{S(n.path)},onDelete:n=>{H(n)}}),t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[t.jsx("input",{className:b(fe,"py-1.5 text-[13px]"),value:x,placeholder:"New topic name, e.g. clients","aria-label":"New topic name",onChange:n=>L(n.target.value),onKeyDown:n=>{n.key==="Enter"&&F()}}),t.jsx("button",{type:"button",className:O,disabled:!x.trim(),onClick:()=>{F()},children:"New topic"})]}),l.logs.length>0&&t.jsx("div",{className:"mt-4",children:t.jsx(je,{title:"Daily logs",hint:"What the bot did each day, in its own words. Not loaded into conversations.",files:l.logs,selected:c?.path,onOpen:n=>{S(n.path)},onDelete:n=>{H(n)}})})]}),t.jsxs("div",{className:"rounded-xl bg-card p-4",children:[t.jsx("div",{className:"text-[15px] font-medium text-ink",children:"Changes"}),t.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:"Every change to these files, whoever made it. Undo puts a file back the way it was before that change."}),t.jsx("div",{className:"mt-3",children:t.jsx(ds,{rows:o,botName:e.name,reverting:A,onRevert:n=>{ce(n)}})})]}),w&&t.jsx("div",{className:"text-[12.5px] text-ink-secondary",children:w}),R&&t.jsx("div",{className:"text-[12.5px] text-danger",children:R})]})}function rs(e){return`---
|
|
2
2
|
title: ${e.replace(/\.md$/,"")}
|
|
3
3
|
description:
|
|
4
4
|
aliases: []
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as d,j as e,c as a}from"./index-
|
|
1
|
+
import{u as d,j as e,c as a}from"./index-CyM91z0J.js";function c({value:o,compact:r=!1,onChange:s}){const{state:n}=d();return n.config?.cloudHome?null:e.jsxs("div",{className:"mt-3 rounded-lg bg-inset p-3",children:[e.jsx("div",{className:"text-[12px] font-medium text-ink",children:r?"Cloud provider":"Cloud backend"}),e.jsx("div",{className:"mt-0.5 text-[11.5px] text-ink-secondary",children:r?o==="vps"?"Your own server, connected over SSH.":"A hosted computer managed by Boat.":o==="vps"?"Auto reuses a running VPS by default. Enable Start VPS automatically to let Auto create or wake its managed container, or choose Cloud to do it explicitly. Open the live desktop securely from the computer panel.":"Boat is the default hosted computer. Choose Self-hosted VPS to use your SSH-configured Linux Docker host."}),e.jsx("div",{className:"mt-2 flex overflow-hidden rounded-lg border border-hairline/40",children:["box","vps"].map((t,i)=>e.jsx("button",{onClick:()=>s(t),className:a("flex-1 py-1.5 text-[12px]",i>0&&"border-l border-hairline/40",o===t?"bg-raised text-ink":"text-ink-secondary hover:bg-raised/60 hover:text-ink"),children:t==="vps"?"Self-hosted VPS":"Boat"},t))})]})}export{c as C};
|